优化异常抛出

This commit is contained in:
guohb
2024-05-20 11:00:47 +08:00
parent 55f3cefd62
commit aa93b87b6f
2 changed files with 8 additions and 2 deletions

View File

@@ -52,7 +52,8 @@ public class CoolStoreStartFlowServiceImpl implements CoolStoreStartFlowService
InitiatingResponse initiatingResponse = httpRestTemplateService.postForObject(url, request, InitiatingResponse.class);
log.info("newStore API response:{}", JSONObject.toJSONString(initiatingResponse));
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 {
//更新阶段信息
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);
log.info("franchiseAgreement API response:{}", JSONObject.toJSONString(initiatingResponse));
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 {
return new ResponseResult(200000, initiatingResponse.getMsg(), initiatingResponse.getData());
}