优化异常抛出
This commit is contained in:
@@ -180,6 +180,10 @@ public enum ErrorCodeEnum {
|
|||||||
|
|
||||||
UNISSUED_STATEMENT(109010, "该门店未发布账单,无法付款", null),
|
UNISSUED_STATEMENT(109010, "该门店未发布账单,无法付款", null),
|
||||||
|
|
||||||
|
FRANCHISE_AGREEMENT_FALSE(109011, "特许经营合同API调用失败", null),
|
||||||
|
|
||||||
|
NEW_STORE_FALSE(109011, "新店开业流程API调用失败", null),
|
||||||
|
|
||||||
|
|
||||||
INSERT_OPENING_OPERATION_PLAN_AUDIT_FALSE(103001,"插入运营方案审核信息失败",null),
|
INSERT_OPENING_OPERATION_PLAN_AUDIT_FALSE(103001,"插入运营方案审核信息失败",null),
|
||||||
INSERT_OPENING_OPERATION_PLAN_FALSE(103002,"插入运营方案失败",null),
|
INSERT_OPENING_OPERATION_PLAN_FALSE(103002,"插入运营方案失败",null),
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ public class CoolStoreStartFlowServiceImpl implements CoolStoreStartFlowService
|
|||||||
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, request, InitiatingResponse.class);
|
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, request, InitiatingResponse.class);
|
||||||
log.info("newStore API response:{}", JSONObject.toJSONString(initiatingResponse));
|
log.info("newStore API response:{}", JSONObject.toJSONString(initiatingResponse));
|
||||||
if (initiatingResponse.getCode() != 0L) {
|
if (initiatingResponse.getCode() != 0L) {
|
||||||
return new ResponseResult(500, initiatingResponse.getMsg(), initiatingResponse.getData());
|
throw new ServiceException(ErrorCodeEnum.FRANCHISE_AGREEMENT_FALSE, initiatingResponse.getMsg(),initiatingResponse.getData());
|
||||||
|
// return new ResponseResult(500, initiatingResponse.getMsg(), initiatingResponse.getData());
|
||||||
} else {
|
} else {
|
||||||
//更新阶段信息
|
//更新阶段信息
|
||||||
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_31, null);
|
shopStageInfoDAO.updateShopStageAndAuditInfo(shopId, ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_31, null);
|
||||||
@@ -78,7 +79,8 @@ public class CoolStoreStartFlowServiceImpl implements CoolStoreStartFlowService
|
|||||||
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, request, InitiatingResponse.class);
|
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, request, InitiatingResponse.class);
|
||||||
log.info("franchiseAgreement API response:{}", JSONObject.toJSONString(initiatingResponse));
|
log.info("franchiseAgreement API response:{}", JSONObject.toJSONString(initiatingResponse));
|
||||||
if (initiatingResponse.getCode() != 0L) {
|
if (initiatingResponse.getCode() != 0L) {
|
||||||
return new ResponseResult(500, initiatingResponse.getMsg(), initiatingResponse.getData());
|
// throw new ServiceException(500, initiatingResponse.getMsg(), initiatingResponse.getData());
|
||||||
|
throw new ServiceException(ErrorCodeEnum.FRANCHISE_AGREEMENT_FALSE, initiatingResponse.getMsg(),initiatingResponse.getData());
|
||||||
} else {
|
} else {
|
||||||
return new ResponseResult(200000, initiatingResponse.getMsg(), initiatingResponse.getData());
|
return new ResponseResult(200000, initiatingResponse.getMsg(), initiatingResponse.getData());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user