wangliang 9 mesi fa
parent
commit
debe766c87

+ 6 - 1
sop-business/src/main/java/com/qmth/sop/business/activiti/service/impl/ActivitiServiceImpl.java

@@ -339,9 +339,14 @@ public class ActivitiServiceImpl implements ActivitiService {
                             currFlowTaskResult.getSetup(), Long.parseLong(processFlowId), Long.parseLong(task.getId()),
                             tfCustomFlowEntity.getId(),
                             StringUtils.join(approveUserIds, SystemConstant.LIST_JOIN_SPLIT));
+                    String auto = null;
+                    if (!CollectionUtils.isEmpty(flowApproveParam.getVar())) {
+                        auto = (String) flowApproveParam.getVar().get(SystemConstant.APPROVE_AUTO);
+                    }
                     if (Objects.nonNull(flowApproveParam.getApproveRemark()) && Objects.equals(
                             flowApproveParam.getApproveRemark(), SystemConstant.SYSTEM_AUTO_APPROVE)
-                            && !approveUserIds.contains(sysUser.getId().toString())) {
+                            && !approveUserIds.contains(sysUser.getId().toString()) && Objects.nonNull(auto)
+                            && Objects.equals(auto, SystemConstant.APPROVE_AUTO)) {
                         tfFlowLog.setApproveId(Long.parseLong(approveUserIds.get(0)));
                     }
                     if (flowApproveParam.getApprove() == FlowApprovePassEnum.PASS

+ 2 - 1
sop-business/src/main/java/com/qmth/sop/business/bean/params/FlowApproveParam.java

@@ -97,13 +97,14 @@ public class FlowApproveParam implements Serializable {
     }
 
     public FlowApproveParam(Long taskId, FlowApprovePassEnum approve, List<String> approveUserIds, String crmNo,
-            String approveRemark, String formProperties) {
+            String approveRemark, String formProperties, Map<String, Object> var) {
         this.taskId = taskId;
         this.approve = approve;
         this.approveUserIds = approveUserIds;
         this.crmNo = crmNo;
         this.approveRemark = approveRemark;
         this.formProperties = formProperties;
+        this.var = var;
     }
 
     public Map<String, Object> getVar() {

+ 13 - 12
sop-business/src/main/java/com/qmth/sop/business/service/impl/TBSopInfoServiceImpl.java

@@ -567,17 +567,17 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
         tbSopInfoService.updateFlowInfo(sopAllocationParam.getAllocationParams(), tfCustomFlow, tfCustomFlowEntity,
                 tfFlowApprove, tbCrmDetail);
         tbUserArchivesAllocationService.editCrmAllocation(new UserArchivesAllocationParam(sopAllocationParam));
-//        FlowResult flowResult = JSONObject.parseObject(tfCustomFlow.getFlowProcessVar(), FlowResult.class);
-//        FlowResult flowResultEntity = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
-//        LinkedHashMap<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
-//        LinkedHashMap<String, FlowTaskResult> setupEntityMap = flowResultEntity.getSetupMap();
-//        FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, tfFlowApprove.getSetup());
-//        FlowTaskResult currFlowTaskResult = GsonUtil.fromJson(
-//                GsonUtil.toJson(setupMap.get(flowTaskResult.getTaskKey())), FlowTaskResult.class);
-//        setupEntityMap.put(flowTaskResult.getTaskKey(), currFlowTaskResult);
-//        flowResultEntity.setSetupMap(setupEntityMap);
-//        tfCustomFlowEntity.setFlowProcessVar(JacksonUtil.parseJson(flowResultEntity));
-//        tfCustomFlowEntityService.updateById(tfCustomFlowEntity);
+        //        FlowResult flowResult = JSONObject.parseObject(tfCustomFlow.getFlowProcessVar(), FlowResult.class);
+        //        FlowResult flowResultEntity = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
+        //        LinkedHashMap<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
+        //        LinkedHashMap<String, FlowTaskResult> setupEntityMap = flowResultEntity.getSetupMap();
+        //        FlowTaskResult flowTaskResult = this.getFormProperties(tfCustomFlowEntity, tfFlowApprove.getSetup());
+        //        FlowTaskResult currFlowTaskResult = GsonUtil.fromJson(
+        //                GsonUtil.toJson(setupMap.get(flowTaskResult.getTaskKey())), FlowTaskResult.class);
+        //        setupEntityMap.put(flowTaskResult.getTaskKey(), currFlowTaskResult);
+        //        flowResultEntity.setSetupMap(setupEntityMap);
+        //        tfCustomFlowEntity.setFlowProcessVar(JacksonUtil.parseJson(flowResultEntity));
+        //        tfCustomFlowEntityService.updateById(tfCustomFlowEntity);
         tbSopInfoService.sopProxySystemApprove(tfCustomFlowEntity.getFlowId(), tfCustomFlowEntity.getCode());
         return true;
     }
@@ -948,7 +948,8 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
                         new FlowApproveParam(Long.parseLong(taskNew.getId()), FlowApprovePassEnum.PASS,
                                 this.getNextApproveUserIds(tfCustomFlow.getType(), nextFlowTaskResult,
                                         nextFlowTaskResult, crmProjectResult, crmDetailId), crmNo,
-                                SystemConstant.SYSTEM_AUTO_APPROVE, JacksonUtil.parseJson(nextFlowTaskResult)));
+                                SystemConstant.SYSTEM_AUTO_APPROVE, JacksonUtil.parseJson(nextFlowTaskResult),
+                                Collections.singletonMap(SystemConstant.APPROVE_AUTO, SystemConstant.APPROVE_AUTO)));
             }
         }
     }

+ 4 - 3
sop-common/src/main/java/com/qmth/sop/common/contant/SystemConstant.java

@@ -171,7 +171,8 @@ public class SystemConstant {
     //    public static final String AND = " and ";
     //    public static final String OR = " or ";
     //    public static final String APPROVE_MAP_VAR = "approve_map_var";
-    //    public static final String APPROVE_AUTO = "auto";
+    public static final String APPROVE_AUTO = "auto";
+
     public static final String SYSTEM_AUTO_APPROVE = "系统自动审批";
 
     public static final String VALUE = "value";
@@ -441,9 +442,9 @@ public class SystemConstant {
 
     public static final String PREFIX_URL_PROJECT_MONITOR = "/admin/project/monitor";
 
-//    public static final String PREFIX_URL_SERVICE_ANALYSE = "/admin/service/analyse";
+    //    public static final String PREFIX_URL_SERVICE_ANALYSE = "/admin/service/analyse";
 
-//    public static final String PREFIX_URL_CRM_PROCESS_MONITOR = "/admin/crm/process/monitor";
+    //    public static final String PREFIX_URL_CRM_PROCESS_MONITOR = "/admin/crm/process/monitor";
 
     /**
      * 缓存配置