Эх сурвалжийг харах

加入考勤异常申请补卡次数校验和sop申请状态校验

wangliang 1 жил өмнө
parent
commit
882d9d42f0

+ 2 - 1
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -701,11 +701,12 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
 
         TBService tbService = tbServiceService.getById(crmProjectResult.getServiceUnitId());
         Optional.ofNullable(tbService).orElseThrow(() -> ExceptionResultEnum.SERVICE_NO_DATA.exception());
+        Optional.ofNullable(tbService.getStatus()).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("服务单元状态为空"));
 
         if (Objects.isNull(tbService.getEnable()) || !tbService.getEnable()) {
             throw ExceptionResultEnum.ERROR.exception("服务单元已作废");
         }
-        if (Objects.nonNull(tbService.getStatus()) && tbService.getStatus() != ServiceStatusEnum.PUBLISH) {
+        if (tbService.getStatus() != ServiceStatusEnum.PUBLISH) {
             throw ExceptionResultEnum.ERROR.exception("只有发布状态的服务单元才能新增sop");
         }