修改
This commit is contained in:
@@ -62,46 +62,29 @@ public class AuditOpeningOperationPlanImpl implements AuditOpeningOperationPlanS
|
||||
log.error("auditPlan request is null");
|
||||
throw new ServiceException("auditPlan request is null");
|
||||
}
|
||||
String userId = CurrentUserHolder.getUserId();
|
||||
try {
|
||||
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.setShopId(request.getShopId());
|
||||
openingOperationPlanDO.setAuditId(auditId);
|
||||
openingOperationPlanDO.setResultType(request.getResultType());
|
||||
Integer plan = openingOperationPlanDAO.updateResultType(request.getShopId(),auditId,request.getResultType());
|
||||
if (Objects.isNull(plan)) {
|
||||
log.error("auditPlan plan is null");
|
||||
throw new ServiceException(ErrorCodeEnum.UPDATE_PLAN_FALSE);
|
||||
openingOperationPlanDAO.updateResultType(request.getShopId(),auditId,request.getResultType());
|
||||
ShopSubStageStatusEnum shopSubStageStatusEnum = null;
|
||||
Boolean flag = Boolean.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())) {
|
||||
//更改子阶段
|
||||
Integer Stage = shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(),
|
||||
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);
|
||||
}
|
||||
shopStageInfoDAO.updateShopStageAndAuditInfo(request.getShopId(),
|
||||
shopSubStageStatusEnum, auditId);
|
||||
if (flag){
|
||||
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;
|
||||
} catch (Exception e) {
|
||||
log.error("auditPlan Exception:{}", e);
|
||||
e.printStackTrace();
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user