Browse Source

代码修改

wangliang 1 year ago
parent
commit
2e2b5cfd9a

+ 27 - 0
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBCrmDetailServiceImpl.java

@@ -304,6 +304,20 @@ public class TBCrmDetailServiceImpl extends ServiceImpl<TBCrmDetailMapper, TBCrm
                     tbDingService.resetDingExceptionBySopNo(tbCrmDetail.getSopNo());
                     tbDingService.resetDingExceptionBySopNo(tbCrmDetail.getSopNo());
                 }
                 }
             }
             }
+            if (Objects.nonNull(tbCrmDetail.getScanStartTime()) && Objects.nonNull(tbCrmDetail.getScanEndTime())
+                    && tbCrmDetail.getScanEndTime().longValue() <= tbCrmDetail.getScanStartTime().longValue()) {
+                throw ExceptionResultEnum.ERROR.exception("扫描结束时间不能小于等于扫描开始时间");
+            }
+            if (Objects.nonNull(tbCrmDetail.getScanEndTime()) && Objects.nonNull(tbCrmDetail.getMarkPaperStartTime())
+                    && tbCrmDetail.getMarkPaperStartTime().longValue() <= tbCrmDetail.getScanEndTime().longValue()) {
+                throw ExceptionResultEnum.ERROR.exception("阅卷开始时间不能小于等于扫描结束时间");
+            }
+            if (Objects.nonNull(tbCrmDetail.getMarkPaperStartTime()) && Objects.nonNull(
+                    tbCrmDetail.getMarkPaperEndTime())
+                    && tbCrmDetail.getMarkPaperEndTime().longValue() <= tbCrmDetail.getMarkPaperStartTime()
+                    .longValue()) {
+                throw ExceptionResultEnum.ERROR.exception("阅卷结束时间不能小于等于阅卷开始时间");
+            }
             return tbCrmDetailService.saveOrUpdate(tbCrmDetail);
             return tbCrmDetailService.saveOrUpdate(tbCrmDetail);
         } catch (Exception e) {
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
             log.error(SystemConstant.LOG_ERROR, e);
@@ -377,6 +391,19 @@ public class TBCrmDetailServiceImpl extends ServiceImpl<TBCrmDetailMapper, TBCrm
                 tfCustomFlow.getFlowDeploymentId(), FlowApprovePassEnum.DRAFT, null, null, var);
                 tfCustomFlow.getFlowDeploymentId(), FlowApprovePassEnum.DRAFT, null, null, var);
         String sopNo = tbSopInfoService.sopPublish(sopPublishParam);
         String sopNo = tbSopInfoService.sopPublish(sopPublishParam);
         tbCrmDetail.setSopNo(sopNo);
         tbCrmDetail.setSopNo(sopNo);
+
+        if (Objects.nonNull(tbCrmDetail.getScanStartTime()) && Objects.nonNull(tbCrmDetail.getScanEndTime())
+                && tbCrmDetail.getScanEndTime().longValue() <= tbCrmDetail.getScanStartTime().longValue()) {
+            throw ExceptionResultEnum.ERROR.exception("扫描结束时间不能小于等于扫描开始时间");
+        }
+        if (Objects.nonNull(tbCrmDetail.getScanEndTime()) && Objects.nonNull(tbCrmDetail.getMarkPaperStartTime())
+                && tbCrmDetail.getMarkPaperStartTime().longValue() <= tbCrmDetail.getScanEndTime().longValue()) {
+            throw ExceptionResultEnum.ERROR.exception("阅卷开始时间不能小于等于扫描结束时间");
+        }
+        if (Objects.nonNull(tbCrmDetail.getMarkPaperStartTime()) && Objects.nonNull(tbCrmDetail.getMarkPaperEndTime())
+                && tbCrmDetail.getMarkPaperEndTime().longValue() <= tbCrmDetail.getMarkPaperStartTime().longValue()) {
+            throw ExceptionResultEnum.ERROR.exception("阅卷结束时间不能小于等于阅卷开始时间");
+        }
         return tbCrmDetailService.updateById(tbCrmDetail);
         return tbCrmDetailService.updateById(tbCrmDetail);
     }
     }
 
 

+ 20 - 10
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -1081,13 +1081,11 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                         tsJobRemindList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(),
                         tsJobRemindList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(),
                                 Long.parseLong(task.getId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(),
                                 Long.parseLong(task.getId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(),
                                 JobTypeEnum.BEFORE, Long.parseLong(task.getAssignee()), tfFlowLog.getApproveOperation(),
                                 JobTypeEnum.BEFORE, Long.parseLong(task.getAssignee()), tfFlowLog.getApproveOperation(),
-                                processLimitedTime, execField, sysUser.getId(),
-                                tfCustomFlowEntity.getCrmNo()));
+                                processLimitedTime, execField, sysUser.getId(), tfCustomFlowEntity.getCrmNo()));
                         tsJobRemindList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(),
                         tsJobRemindList.add(new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(),
                                 Long.parseLong(task.getId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(),
                                 Long.parseLong(task.getId()), tfCustomFlow.getType().getTitle() + ";" + task.getName(),
                                 JobTypeEnum.AFTER, Long.parseLong(task.getAssignee()), tfFlowLog.getApproveOperation(),
                                 JobTypeEnum.AFTER, Long.parseLong(task.getAssignee()), tfFlowLog.getApproveOperation(),
-                                processLimitedTime, execField, sysUser.getId(),
-                                tfCustomFlowEntity.getCrmNo()));
+                                processLimitedTime, execField, sysUser.getId(), tfCustomFlowEntity.getCrmNo()));
                     } else {
                     } else {
                         List<IdentityLink> identityLinkList = taskService.getIdentityLinksForTask(task.getId());
                         List<IdentityLink> identityLinkList = taskService.getIdentityLinksForTask(task.getId());
                         if (!CollectionUtils.isEmpty(identityLinkList)) {
                         if (!CollectionUtils.isEmpty(identityLinkList)) {
@@ -1097,17 +1095,15 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                                                 Long.parseLong(i.getTaskId()),
                                                 Long.parseLong(i.getTaskId()),
                                                 tfCustomFlow.getType().getTitle() + ";" + task.getName(),
                                                 tfCustomFlow.getType().getTitle() + ";" + task.getName(),
                                                 JobTypeEnum.BEFORE, Long.parseLong(i.getUserId()),
                                                 JobTypeEnum.BEFORE, Long.parseLong(i.getUserId()),
-                                                tfFlowLog.getApproveOperation(), processLimitedTime,
-                                                execField, sysUser.getId(),
-                                                tfCustomFlowEntity.getCrmNo()));
+                                                tfFlowLog.getApproveOperation(), processLimitedTime, execField,
+                                                sysUser.getId(), tfCustomFlowEntity.getCrmNo()));
                                 tsJobRemindList.add(
                                 tsJobRemindList.add(
                                         new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(),
                                         new TSJobRemind(JobQuartzTypeEnum.FLOW, tfCustomFlowEntity.getCode(),
                                                 Long.parseLong(i.getTaskId()),
                                                 Long.parseLong(i.getTaskId()),
                                                 tfCustomFlow.getType().getTitle() + ";" + task.getName(),
                                                 tfCustomFlow.getType().getTitle() + ";" + task.getName(),
                                                 JobTypeEnum.AFTER, Long.parseLong(i.getUserId()),
                                                 JobTypeEnum.AFTER, Long.parseLong(i.getUserId()),
-                                                tfFlowLog.getApproveOperation(), processLimitedTime,
-                                                execField, sysUser.getId(),
-                                                tfCustomFlowEntity.getCrmNo()));
+                                                tfFlowLog.getApproveOperation(), processLimitedTime, execField,
+                                                sysUser.getId(), tfCustomFlowEntity.getCrmNo()));
                             }
                             }
                         }
                         }
                     }
                     }
@@ -1233,16 +1229,30 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                 JSONObject jsonObject = JSONObject.parseObject(f.getValue());
                 JSONObject jsonObject = JSONObject.parseObject(f.getValue());
                 String value = jsonObject.getString(SystemConstant.VALUE);
                 String value = jsonObject.getString(SystemConstant.VALUE);
                 tbCrmDetail.setScanEndTime(Long.parseLong(value));
                 tbCrmDetail.setScanEndTime(Long.parseLong(value));
+                if (Objects.nonNull(tbCrmDetail.getScanStartTime())
+                        && tbCrmDetail.getScanEndTime().longValue() <= tbCrmDetail.getScanStartTime().longValue()) {
+                    throw ExceptionResultEnum.ERROR.exception("扫描结束时间不能小于等于扫描开始时间");
+                }
             } else if (f.getFormId().contains(ProcessLimitedEnum.MARK_START_TIME.getKey()) && Objects.nonNull(
             } else if (f.getFormId().contains(ProcessLimitedEnum.MARK_START_TIME.getKey()) && Objects.nonNull(
                     f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
                     f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
                 JSONObject jsonObject = JSONObject.parseObject(f.getValue());
                 JSONObject jsonObject = JSONObject.parseObject(f.getValue());
                 String value = jsonObject.getString(SystemConstant.VALUE);
                 String value = jsonObject.getString(SystemConstant.VALUE);
                 tbCrmDetail.setMarkPaperStartTime(Long.parseLong(value));
                 tbCrmDetail.setMarkPaperStartTime(Long.parseLong(value));
+                if (Objects.nonNull(tbCrmDetail.getScanEndTime())
+                        && tbCrmDetail.getMarkPaperStartTime().longValue() <= tbCrmDetail.getScanEndTime()
+                        .longValue()) {
+                    throw ExceptionResultEnum.ERROR.exception("阅卷开始时间不能小于等于扫描结束时间");
+                }
             } else if (f.getFormId().contains(ProcessLimitedEnum.MARK_END_TIME.getKey()) && Objects.nonNull(
             } else if (f.getFormId().contains(ProcessLimitedEnum.MARK_END_TIME.getKey()) && Objects.nonNull(
                     f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
                     f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
                 JSONObject jsonObject = JSONObject.parseObject(f.getValue());
                 JSONObject jsonObject = JSONObject.parseObject(f.getValue());
                 String value = jsonObject.getString(SystemConstant.VALUE);
                 String value = jsonObject.getString(SystemConstant.VALUE);
                 tbCrmDetail.setMarkPaperEndTime(Long.parseLong(value));
                 tbCrmDetail.setMarkPaperEndTime(Long.parseLong(value));
+                if (Objects.nonNull(tbCrmDetail.getMarkPaperStartTime())
+                        && tbCrmDetail.getMarkPaperEndTime().longValue() <= tbCrmDetail.getMarkPaperStartTime()
+                        .longValue()) {
+                    throw ExceptionResultEnum.ERROR.exception("阅卷结束时间不能小于等于阅卷开始时间");
+                }
             } else if (f.getFormId().contains(ProcessLimitedEnum.ENGINEER_USERS_ID.getKey()) && Objects.nonNull(
             } else if (f.getFormId().contains(ProcessLimitedEnum.ENGINEER_USERS_ID.getKey()) && Objects.nonNull(
                     f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
                     f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
                 JSONObject jsonObject = JSONObject.parseObject(f.getValue());
                 JSONObject jsonObject = JSONObject.parseObject(f.getValue());