wangliang 1 سال پیش
والد
کامیت
83b4e5100b

+ 4 - 1
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBCrmDetailServiceImpl.java

@@ -344,7 +344,10 @@ public class TBCrmDetailServiceImpl extends ServiceImpl<TBCrmDetailMapper, TBCrm
      */
     @Override
     public TBCrmDetail findBySopNo(String sopNo) {
-        return tbCrmDetailService.getOne(new QueryWrapper<TBCrmDetail>().lambda().eq(TBCrmDetail::getSopNo, sopNo));
+        TBCrmDetail tbCrmDetail = tbCrmDetailService.getOne(
+                new QueryWrapper<TBCrmDetail>().lambda().eq(TBCrmDetail::getSopNo, sopNo));
+        Objects.requireNonNull(tbCrmDetail, "未找到派单sop信息");
+        return tbCrmDetail;
     }
 
     /**

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

@@ -1121,9 +1121,10 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         flowResult.setSetupMap(setupMap);
         tfCustomFlowEntity.updateInfo(sysUser.getId());
         tfCustomFlowEntity.setFlowProcessVar(JacksonUtil.parseJson(flowResult));
+
+        TBCrmDetail tbCrmDetail = tbCrmDetailService.findBySopNo(tfCustomFlowEntity.getCode());
         if (tfFlowApprove.getStatus() != FlowStatusEnum.FINISH && tfFlowApprove.getStatus() != FlowStatusEnum.END) {
             Map<String, Object> map = new HashMap<>();
-            TBCrmDetail tbCrmDetail = tbCrmDetailService.findBySopNo(tfCustomFlowEntity.getCode());
             CrmProjectResult crmProjectResult = tbCrmService.findCrmProjectInfo(tfCustomFlowEntity.getCode(),
                     tbCrmDetail.getId(), tfCustomFlowEntity.getCrmNo());
             Optional.ofNullable(crmProjectResult).orElseThrow(() -> ExceptionResultEnum.CRM_NO_NO_DATA.exception());
@@ -1156,6 +1157,32 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
 
             tbDingService.resetDingExceptionBySopNo(tbSopInfo.getSopNo());
         }
+        FlowTaskResult flowTaskResult = tbSopInfoService.getFormProperties(tfCustomFlowEntity, 1);
+        List<FlowFormWidgetResult> flowFormWidgetResultList = flowTaskResult.getFormProperty();
+        for (FlowFormWidgetResult f : flowFormWidgetResultList) {
+            if (f.getFormId().contains(ProcessLimitedEnum.SCAN_START_TIME.getKey()) && Objects.nonNull(f.getValue())
+                    && !Objects.equals(f.getValue(), "{\"value\":null}")) {
+                JSONObject jsonObject = JSONObject.parseObject(f.getValue());
+                String value = jsonObject.getString(SystemConstant.VALUE);
+                tbCrmDetail.setScanStartTime(Long.parseLong(value));
+            } else if (f.getFormId().contains(ProcessLimitedEnum.SCAN_END_TIME.getKey()) && Objects.nonNull(
+                    f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
+                JSONObject jsonObject = JSONObject.parseObject(f.getValue());
+                String value = jsonObject.getString(SystemConstant.VALUE);
+                tbCrmDetail.setScanEndTime(Long.parseLong(value));
+            } else if (f.getFormId().contains(ProcessLimitedEnum.MARK_START_TIME.getKey()) && Objects.nonNull(
+                    f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
+                JSONObject jsonObject = JSONObject.parseObject(f.getValue());
+                String value = jsonObject.getString(SystemConstant.VALUE);
+                tbCrmDetail.setMarkPaperStartTime(Long.parseLong(value));
+            } else if (f.getFormId().contains(ProcessLimitedEnum.MARK_END_TIME.getKey()) && Objects.nonNull(
+                    f.getValue()) && !Objects.equals(f.getValue(), "{\"value\":null}")) {
+                JSONObject jsonObject = JSONObject.parseObject(f.getValue());
+                String value = jsonObject.getString(SystemConstant.VALUE);
+                tbCrmDetail.setMarkPaperEndTime(Long.parseLong(value));
+            }
+        }
+        tbCrmDetailService.updateById(tbCrmDetail);
         return tfCustomFlowEntityService.updateById(tfCustomFlowEntity);
     }