云立方接口异常

This commit is contained in:
苏竹红
2024-05-14 15:16:50 +08:00
parent cdc58ebede
commit b87fd21870
3 changed files with 9 additions and 8 deletions

View File

@@ -196,7 +196,7 @@ public enum ErrorCodeEnum {
XFSG_SERVICE_ERROR(103099,"鲜丰服务调用失败",null),
GET_FIRST_ORDER(103021,"获取鲜丰首批订货金失败",null),
YLF_ERROR(110001, "云立方接口异常!", null),
YLF_ERROR(110001, "云立方接口异常!异常信息:{0}", null),
//装修
THREE_ACCEPTANCE(121001,"提交三方验收失败",null),
CHECK_ITEM(12002,"插入检查项失败",null)

View File

@@ -39,8 +39,9 @@ public class YlfServiceImpl implements YlfService {
String forObject = httpRestTemplateService.getForObject(detailUrl, String.class, new HashMap<>());
Integer status = (Integer) JSONObject.parseObject(forObject, JSONObject.class).get("status");
if (status != 200) {
String msg = (String) JSONObject.parseObject(forObject, JSONObject.class).get("msg");
log.info("获取云立方装修公司信息失败,id:{}", id);
throw new ServiceException(ErrorCodeEnum.YLF_ERROR);
throw new ServiceException(ErrorCodeEnum.YLF_ERROR,msg);
}
Object data = JSONObject.parseObject(forObject, JSONObject.class).get("data");
if (data == null) {
@@ -52,7 +53,7 @@ public class YlfServiceImpl implements YlfService {
return list.get(0);
}
} catch (Exception e) {
throw new ServiceException(ErrorCodeEnum.YLF_ERROR);
throw new ServiceException(((ServiceException)e).getErrorMessage());
}
return null;
}
@@ -68,10 +69,11 @@ public class YlfServiceImpl implements YlfService {
try {
String jsonString = httpRestTemplateService.getForObject(url, String.class, new HashMap<>());
JSONObject jsonObject = JSONObject.parseObject(jsonString);
Integer status = (Integer) JSONObject.parseObject(jsonString, JSONObject.class).get("status");
Integer status = (Integer) jsonObject.get("status");
if (status != 200) {
log.info("获取云立方装修公司信息失败,storeNum:{}", storeNum);
throw new ServiceException(ErrorCodeEnum.YLF_ERROR);
String msg = (String) jsonObject.get("msg");
throw new ServiceException(ErrorCodeEnum.YLF_ERROR,msg);
}
JSONObject data = jsonObject.getJSONObject("data");
log.info("CoolStoreStartFlowServiceImpl#getOrder,jsonObject:{}", jsonObject);
@@ -93,7 +95,7 @@ public class YlfServiceImpl implements YlfService {
}
} catch (Exception e) {
log.info("调用云立方获取项目列表异常,getProjectList error:{}", e);
throw new ServiceException(ErrorCodeEnum.XFSG_SERVICE_ERROR);
throw new ServiceException(((ServiceException)e).getErrorMessage());
}
return null;

View File

@@ -100,8 +100,7 @@ public class DeskController {
@ApiOperation("招商经理-我的数据")
@GetMapping("/getInvestmentCount")
public ResponseResult<InvestmentCountDTO> getInvestmentCount(@RequestParam(value = "pageNumber",required = true,defaultValue = "1")Integer pageNumber,
@RequestParam(value = "pageSize",required = true,defaultValue = "10")Integer pageSize) {
public ResponseResult<InvestmentCountDTO> getInvestmentCount() {
LoginUserInfo userInfo = CurrentUserHolder.getUser();
return ResponseResult.success(deskService.getInvestmentCount(userInfo));
}