فهرست منبع

Merge branch 'master' of http://62.234.61.92:3000/wjm/mec-cloud_IntelligentManufacturing_CLIENT

lph 1 سال پیش
والد
کامیت
da01f8a710

+ 4 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/mapper/BpmExecuteProcessMapper.java

@@ -78,6 +78,10 @@ public interface BpmExecuteProcessMapper {
      */
     public List<CommonEntity> queryExecuteProcess(@Param("objectMap") Map<String, Object> objectMap);
 
+    /**
+     * 根据当前用户登陆信息得到当前可执行流程
+     */
+    public List<CommonEntity> queryExecuteProcessEnd(@Param("objectMap") Map<String, Object> objectMap);
 
     /**
      * 查询流程执行任务

+ 35 - 34
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/BpmExecuteProcessServiceImpl.java

@@ -82,42 +82,43 @@ public class BpmExecuteProcessServiceImpl implements IBpmExecuteProcessService {
         List<SysDictData> dictDataList = sending.sendGetTenantDict(dictData);
         //if (tenantDict.getStatusCodeValue() == 200) {
         if(StringUtils.isNotEmpty(dictDataList)){
-            //Map<String, Object> tenantRetMap = (Map<String, Object>) JSON.parse(tenantDict.getBody().toString());
-            //List<Map<String, Object>> tenantRetList = (List<Map<String, Object>>) tenantRetMap.get("rows");
             Map<String, Object> objectMap = new HashMap<>();  // 查询执行管道的参数
-            //tenantRetList.forEach(item -> {
-            //    objectMap.put(item.get("dictLabel").toString(), item.get("dictValue"));
-            //});
-            dictDataList.stream().forEach(item->{
-                objectMap.put(item.getDictLabel(),item.getDictValue());
-            });
-            List<SysRole> sysRoles = SecurityUtils.getLoginUser().getUser().getRoles();
-            List<String> roles = new ArrayList<>();
-            if (sysRoles.size() != 0) {
-                roles.addAll(sysRoles.stream().map(SysRole::getRoleKey).collect(Collectors.toList()));
-            }
-            // 根据当前的用户id得到可以执行的流程节点
-            objectMap.put("userId", SecurityUtils.getUserId());
-            // 得到当前发起请求的用户角色列表
-            objectMap.put("taskRealRoleList", roles);
             objectMap.putAll(convertEntityToMap(bpmExecuteProcess));
-            // 首先根据当前登陆用户得到他可以执行的所有节点
-            List<CommonEntity> commonEntities = runBpmExecuteProcessMapper.queryExecuteProcess(objectMap);
-            // 查询异常脚本信息
-            List<CommonEntity> commonEntities1 = bpmExecuteNodeMiddleService.addExceptionScript(commonEntities);
-            commonEntities.forEach(item -> {
-                String keyName = item.getResultMap().get("benTaskNodeKey").toString();
-                item.getResultMap().putAll(
-                        commonEntities1.stream()
-                                .filter(ctem ->
-                                        ctem.getResultMap().get("benTaskNodeKey")
-                                                .equals(keyName))
-                                .findFirst()
-                                .get()
-                                .getResultMap()
-                );
-            });
-            return commonEntities;
+            if (bpmExecuteProcess.getTaskProcessState() == 3L) {
+                // 首先根据当前登陆用户得到他可以执行的所有节点
+                List<CommonEntity> commonEntities = runBpmExecuteProcessMapper.queryExecuteProcess(objectMap);
+                return commonEntities;
+            } else {
+                dictDataList.forEach(item -> {
+                    objectMap.put(item.getDictLabel(), item.getDictValue());
+                });
+                List<SysRole> sysRoles = SecurityUtils.getLoginUser().getUser().getRoles();
+                List<String> roles = new ArrayList<>();
+                if (sysRoles.size() != 0) {
+                    roles.addAll(sysRoles.stream().map(SysRole::getRoleKey).collect(Collectors.toList()));
+                }
+                // 根据当前的用户id得到可以执行的流程节点
+                objectMap.put("userId", SecurityUtils.getUserId());
+                // 得到当前发起请求的用户角色列表
+                objectMap.put("taskRealRoleList", roles);
+                // 首先根据当前登陆用户得到他可以执行的所有节点
+                List<CommonEntity> commonEntities = runBpmExecuteProcessMapper.queryExecuteProcess(objectMap);
+                // 查询异常脚本信息
+                List<CommonEntity> commonEntities1 = bpmExecuteNodeMiddleService.addExceptionScript(commonEntities);
+                commonEntities.forEach(item -> {
+                    String keyName = item.getResultMap().get("benTaskNodeKey").toString();
+                    item.getResultMap().putAll(
+                            commonEntities1.stream()
+                                    .filter(ctem ->
+                                            ctem.getResultMap().get("benTaskNodeKey")
+                                                    .equals(keyName))
+                                    .findFirst()
+                                    .get()
+                                    .getResultMap()
+                    );
+                });
+                return commonEntities;
+            }
         }
         return null;
     }

+ 75 - 0
zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteProcessMapper.xml

@@ -324,5 +324,80 @@
         where t_id=#{tId}
     </select>
 
+    <select id="queryExecuteProcessEnd" resultMap="retMap">
+        select
+        bep.id as bep_id,
+        bep.task_key as bep_task_key,
+        bep.task_key as bpm_execute_process_task_key,
+        plan.${planName} as bep_task_name,
+        bep.task_plan_key as bep_task_plan_key,
+        bep.task_plan_key as bpm_execute_process_task_plan_key,
+        bep.task_node_key as bep_task_node_key,
+        bep.task_node_next_key as bep_task_node_next_key,
+        bep.task_node_next_key as bpm_execute_process_task_node_next_key,
+        bep.task_process_type as bep_task_process_type,
+        bep.task_process_key as bep_task_process_key,
+        bep.task_process_xml_content as bep_task_process_xml_content,
+        bep.task_process_state as bep_task_process_state,
+        bep.task_process_note as bep_task_process_note,
+        bep.del_flag as bep_del_flag,
+        bep.remark as bep_remark,
+        ben.id as ben_id,
+        ben.task_process_key as ben_task_process_key,
+        ben.task_node_key as ben_task_node_key,
+        ben.task_node_name as ben_task_node_name,
+        ben.task_node_form_key as ben_task_node_form_key,
+        ben.task_node_form_type as ben_task_node_form_type,
+        ben.task_node_type as ben_task_node_type,
+        ben.task_node_before as ben_task_node_before,
+        ben.task_node_after as ben_task_node_after,
+        ben.task_node_role_permission as ben_task_node_role_permission,
+        ben.task_remark as ben_task_remark,
+        ben.task_node_number as ben_task_node_number,
+        ben.task_node_weight as ben_task_node_weight,
+        ben.task_node_state as ben_task_node_state,
+        ben.task_priority as ben_task_priority,
+        ben.task1 as ben_task1,
+        ben.task2 as ben_task2,
+        ben.task3 as ben_task3,
+        ben.task4 as ben_task4,
+        ben.task5 as ben_task5,
+        ben.del_flag as ben_del_flag,
+        ben.create_by_id as ben_create_by_id,
+        ben.create_by as ben_create_by,
+        ben.create_time as ben_create_time,
+        benm.id as benm_id,
+        benm.task_node_key as benm_task_node_key,
+        benm.task_virtually_role as benm_task_virtually_role,
+        benm.task_real_role as benm_task_real_role,
+        benm.task_execute_user_no as benm_task_execute_user_no,
+        benm.task_artificial_script_key as benm_task_artificial_script_key,
+        benm.task_automatic_script_trigger_type as benm_task_automatic_script_trigger_type
+        from
+        {DBNAME}.bpm_execute_process as bep
+        inner join {DBNAME}.bpm_execute_node as ben on
+        ben.task_process_key = bep.task_key
+        and ben.task_node_key = bep.task_node_next_key
+        join {DBNAME}.bpm_execute_node_middle as benm on
+        benm.task_node_key = ben.task_node_key
+        and benm.task_process_key = bep.task_key
+        join {DBNAME}.${planTableName} as plan on
+        plan.${planID} = bep.task_plan_key
+        where bep.task_process_state = 3
+        <if test="taskKey != null  and taskKey != ''">and bep.task_key = #{taskKey}</if>
+        <if test="taskName != null  and taskName != ''">and bep.task_name like concat('%', #{taskName}, '%')</if>
+        <if test="taskNodeKey != null  and taskNodeKey != ''">and bep.task_node_key = #{taskNodeKey}</if>
+        <if test="taskNodeNextKey != null  and taskNodeNextKey != ''">and bep.task_node_next_key =
+            #{executeProcessTaskNodeNextKey}
+        </if>
+        <if test="taskProcessKey != null  and taskProcessKey != ''">and bep.task_process_key = #{taskProcessKey}</if>
+        <if test="taskProcessNote != null  and taskProcessNote != ''">and bep.task_process_note = #{taskProcessNote}
+        </if>
+        <if test="taskProcessType != null  and taskProcessType != ''">and bep.task_process_type = #{taskProcessType}
+        </if>
+        order by ben.create_time desc
+    </select>
+
+
 </mapper>