This commit is contained in:
苏竹红
2024-04-26 11:07:57 +08:00
parent 8af98bde8e
commit 0fe72c7196

View File

@@ -62,46 +62,29 @@ public class AuditOpeningOperationPlanImpl implements AuditOpeningOperationPlanS
log.error("auditPlan request is null"); log.error("auditPlan request is null");
throw new ServiceException("auditPlan request is null"); throw new ServiceException("auditPlan request is null");
} }
String userId = CurrentUserHolder.getUserId();
try { try {
Long auditId = shopAuditInfoDAO.addAuditInfo(request.toShopAuditInfoDO()); Long auditId = shopAuditInfoDAO.addAuditInfo(request.toShopAuditInfoDO());
if (Objects.isNull(auditId)) {
log.error("auditPlan audit is null");
throw new ServiceException(ErrorCodeEnum.INSERT_OPENING_OPERATION_PLAN_AUDIT_FALSE);
}
OpeningOperationPlanDO openingOperationPlanDO = new OpeningOperationPlanDO(); OpeningOperationPlanDO openingOperationPlanDO = new OpeningOperationPlanDO();
openingOperationPlanDO.setShopId(request.getShopId()); openingOperationPlanDO.setShopId(request.getShopId());
openingOperationPlanDO.setAuditId(auditId); openingOperationPlanDO.setAuditId(auditId);
openingOperationPlanDO.setResultType(request.getResultType()); openingOperationPlanDO.setResultType(request.getResultType());
Integer plan = openingOperationPlanDAO.updateResultType(request.getShopId(),auditId,request.getResultType()); openingOperationPlanDAO.updateResultType(request.getShopId(),auditId,request.getResultType());
if (Objects.isNull(plan)) { ShopSubStageStatusEnum shopSubStageStatusEnum = null;
log.error("auditPlan plan is null"); Boolean flag = Boolean.FALSE;
throw new ServiceException(ErrorCodeEnum.UPDATE_PLAN_FALSE); if(OpeningOperationPlanResultTypeEnum.PASS_AUDIT.getCode().equals(request.getResultType())){
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_143;
flag = Boolean.TRUE;
}else {
shopSubStageStatusEnum = ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_142;
} }
if (request.getResultType().equals(OpeningOperationPlanResultTypeEnum.PASS_AUDIT.getCode())) { shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(),
//更改子阶段 shopSubStageStatusEnum, auditId);
Integer Stage = shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(), if (flag){
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_143, auditId);
if (Objects.isNull(Stage)) {
log.error("auditPlan stage is null");
throw new ServiceException(ErrorCodeEnum.UPDATE_SHOP_SUB_STAGE_STATUS_FALSE);
}
preparationService.whetherToOpenForAcceptance(request.getShopId()); preparationService.whetherToOpenForAcceptance(request.getShopId());
} else {
if (request.getResultType().equals(OpeningOperationPlanResultTypeEnum.REJECT_AUDIT.getCode())) {
//更改子阶段
Integer Stage = shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(),
ShopSubStageStatusEnum.SHOP_SUB_STAGE_STATUS_142, auditId);
if (Objects.isNull(Stage)) {
log.error("auditPlan stage is null");
throw new ServiceException(ErrorCodeEnum.UPDATE_SHOP_SUB_STAGE_STATUS_FALSE);
}
}
} }
return Boolean.TRUE; return Boolean.TRUE;
} catch (Exception e) { } catch (Exception e) {
log.error("auditPlan Exception:{}", e); log.error("auditPlan Exception:{}", e);
e.printStackTrace();
return Boolean.FALSE; return Boolean.FALSE;
} }