Explorar o código

fix:同步代码流程执行代码,增加流程查询条件。更换启动标识

韩帛霖 hai 1 ano
pai
achega
aab22720af

+ 18 - 10
zkqy-admin/src/main/java/com/zkqy/ZkqyApplication.java

@@ -19,16 +19,24 @@ public class ZkqyApplication
     public static void main(String[] args)
     {
         SpringApplication.run(ZkqyApplication.class, args);
-        System.out.println("(♥◠‿◠)ノ゙  中科擎云智能制造平台客户端后台启动成功   ლ(´ڡ`ლ)゙  \n" +
-                " .-------.       ____     __        \n" +
-                " |  _ _   \\      \\   \\   /  /    \n" +
-                " | ( ' )  |       \\  _. /  '       \n" +
-                " |(_ o _) /        _( )_ .'         \n" +
-                " | (_,_).' __  ___(_ o _)'          \n" +
-                " |  |\\ \\  |  ||   |(_,_)'         \n" +
-                " |  | \\ `'   /|   `-'  /           \n" +
-                " |  |  \\    /  \\      /           \n" +
-                " ''-'   `'-'    `-..-'              ");
+        System.out.println("(♥◠‿◠)ノ゙  中科擎云智能制造平台客户端后台启动成功   ლ(´ڡ`ლ)゙  \n"+
+                "        CCCCCCCCCCCCCLLLLLLLLLLL             IIIIIIIIIIEEEEEEEEEEEEEEEEEEEEEENNNNNNNN        NNNNNNNNTTTTTTTTTTTTTTTTTTTTTTT\n" +
+                "     CCC::::::::::::CL:::::::::L             I::::::::IE::::::::::::::::::::EN:::::::N       N::::::NT:::::::::::::::::::::T\n" +
+                "   CC:::::::::::::::CL:::::::::L             I::::::::IE::::::::::::::::::::EN::::::::N      N::::::NT:::::::::::::::::::::T\n" +
+                "  C:::::CCCCCCCC::::CLL:::::::LL             II::::::IIEE::::::EEEEEEEEE::::EN:::::::::N     N::::::NT:::::TT:::::::TT:::::T\n" +
+                " C:::::C       CCCCCC  L:::::L                 I::::I    E:::::E       EEEEEEN::::::::::N    N::::::NTTTTTT  T:::::T  TTTTTT\n" +
+                "C:::::C                L:::::L                 I::::I    E:::::E             N:::::::::::N   N::::::N        T:::::T        \n" +
+                "C:::::C                L:::::L                 I::::I    E::::::EEEEEEEEEE   N:::::::N::::N  N::::::N        T:::::T        \n" +
+                "C:::::C                L:::::L                 I::::I    E:::::::::::::::E   N::::::N N::::N N::::::N        T:::::T        \n" +
+                "C:::::C                L:::::L                 I::::I    E:::::::::::::::E   N::::::N  N::::N:::::::N        T:::::T        \n" +
+                "C:::::C                L:::::L                 I::::I    E::::::EEEEEEEEEE   N::::::N   N:::::::::::N        T:::::T        \n" +
+                "C:::::C                L:::::L                 I::::I    E:::::E             N::::::N    N::::::::::N        T:::::T        \n" +
+                " C:::::C       CCCCCC  L:::::L         LLLLLL  I::::I    E:::::E       EEEEEEN::::::N     N:::::::::N        T:::::T        \n" +
+                "  C:::::CCCCCCCC::::CLL:::::::LLLLLLLLL:::::LII::::::IIEE::::::EEEEEEEE:::::EN::::::N      N::::::::N      TT:::::::TT      \n" +
+                "   CC:::::::::::::::CL::::::::::::::::::::::LI::::::::IE::::::::::::::::::::EN::::::N       N:::::::N      T:::::::::T      \n" +
+                "     CCC::::::::::::CL::::::::::::::::::::::LI::::::::IE::::::::::::::::::::EN::::::N        N::::::N      T:::::::::T      \n" +
+                "        CCCCCCCCCCCCCLLLLLLLLLLLLLLLLLLLLLLLLIIIIIIIIIIEEEEEEEEEEEEEEEEEEEEEENNNNNNNN         NNNNNNN      TTTTTTTTTTT      "
+        );
         ////输出容器中所有bean
         //ApplicationContext context = SpringApplication.run(ZkqyApplication.class, args);
         //Arrays.stream(context.getBeanDefinitionNames()).forEach(System.out::println);

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

@@ -77,21 +77,21 @@ public class BpmExecuteProcessServiceImpl implements IBpmExecuteProcessService {
         //params.put("isEnablePaging", "false");  // 不弃启用分页
         //params.put("dictType", "plan_execution_data"); // 排需要的必要参数
         //ResponseEntity tenantDict = sending.sendGetTenantDict(params);
-        SysDictData dictData=new SysDictData();
+        SysDictData dictData = new SysDictData();
         dictData.setDictType("plan_execution_data");
         List<SysDictData> dictDataList = sending.sendGetTenantDict(dictData);
         //if (tenantDict.getStatusCodeValue() == 200) {
-        if(StringUtils.isNotEmpty(dictDataList)){
+        if (StringUtils.isNotEmpty(dictDataList)) {
             Map<String, Object> objectMap = new HashMap<>();  // 查询执行管道的参数
             objectMap.putAll(convertEntityToMap(bpmExecuteProcess));
+            dictDataList.forEach(item -> {
+                objectMap.put(item.getDictLabel(), item.getDictValue());
+            });
             if (bpmExecuteProcess.getTaskProcessState() == 3L) {
                 // 首先根据当前登陆用户得到他可以执行的所有节点
-                List<CommonEntity> commonEntities = runBpmExecuteProcessMapper.queryExecuteProcess(objectMap);
+                List<CommonEntity> commonEntities = runBpmExecuteProcessMapper.queryExecuteProcessEnd(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) {
@@ -125,41 +125,50 @@ public class BpmExecuteProcessServiceImpl implements IBpmExecuteProcessService {
 
     @Override
     public List<CommonEntity> selectBpmExecuteProcessListLog(BpmExecuteProcess bpmExecuteProcess) {
-        Map<String, Object> objectMap = new HashMap<>();
-        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> commonEntityList = runBpmExecuteProcessMapper.selectBpmExecuteProcessListLog(objectMap); // 得到当前用户可以查看的流程
-        // 根据用户可以查看的流程任务编码,查询当前流程的详细信息
-        String[] taksKey = new String[commonEntityList.size()];
-        final int[] index = {0};
-        commonEntityList.forEach(item -> {
-            taksKey[index[0]] = item.getResultMap().get("taskKey").toString();
-            index[0]++;
-        });
-        if (taksKey.length <= 0){
+        SysDictData dictData = new SysDictData();
+        dictData.setDictType("plan_execution_data");
+        List<SysDictData> dictDataList = sending.sendGetTenantDict(dictData);
+        if (StringUtils.isNotEmpty(dictDataList)) {
+            Map<String, Object> objectMap = new HashMap<>();
+            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);
+            objectMap.putAll(convertEntityToMap(bpmExecuteProcess));
+            List<CommonEntity> commonEntityList = runBpmExecuteProcessMapper.selectBpmExecuteProcessListLog(objectMap); // 得到当前用户可以查看的流程
+            // 根据用户可以查看的流程任务编码,查询当前流程的详细信息
+            String[] taksKey = new String[commonEntityList.size()];
+            final int[] index = {0};
+            commonEntityList.forEach(item -> {
+                taksKey[index[0]] = item.getResultMap().get("taskKey").toString();
+                index[0]++;
+            });
+            if (taksKey.length <= 0) {
+                return commonEntityList;
+            }
+            objectMap.put("taskProcessList", taksKey);
+            // 当前用户可以看到流程的所有节点信息
+            List<BpmExecuteNodeLog> bpmExecuteNodeLogList = iBpmExecuteNodeLogService.selectBpmExecuteProcessNodeListLog(objectMap);
+            // 循环添加流程的详细信息
+            commonEntityList.forEach(item -> {
+                // 根据流程key筛选得到当前流程的所有执行过的节点信息
+                item.getResultMap().put("nodeLogList",
+                        bpmExecuteNodeLogList
+                                .stream()
+                                .filter(e -> e.getTaskProcessKey().equals(item.getResultMap().get("taskKey").toString()))
+                                .collect(Collectors.toList()));
+            });
             return commonEntityList;
         }
-        objectMap.put("taskProcessList", taksKey);
-        // 当前用户可以看到流程的所有节点信息
-        List<BpmExecuteNodeLog> bpmExecuteNodeLogList = iBpmExecuteNodeLogService.selectBpmExecuteProcessNodeListLog(objectMap);
-        // 循环添加流程的详细信息
-        commonEntityList.forEach(item -> {
-            // 根据流程key筛选得到当前流程的所有执行过的节点信息
-            item.getResultMap().put("nodeLogList",
-                    bpmExecuteNodeLogList
-                            .stream()
-                            .filter(e -> e.getTaskProcessKey().equals(item.getResultMap().get("taskKey").toString()))
-                            .collect(Collectors.toList()));
-        });
-        return commonEntityList;
+        return null;
     }
 
     /**
@@ -305,7 +314,18 @@ public class BpmExecuteProcessServiceImpl implements IBpmExecuteProcessService {
 
 
 }
-
+/*
+这样我补充一个刚才的需求:
+现在他是复制所有模块下的 jar 包,
+1.请你帮我设置一个开关功能:( true 就复制所有 jar 包,false 就只复制zkqy-admin这个模块下的 jar 包,所有项目都一样)。
+2.并且就像刚才说的,在我执行这个 工具类的时候,
+    他先去替换所有项目的配置文件中的信息(这个信息只是更改数据库的 ip 以及账号密码,还有 redis 的地址等)
+3.进行打包操作(所有的项目都是 springboot)。
+4.在所有项目打包完成后复制所有的 jar 到指定目录(就像刚才的这个工具类一样的逻辑,我感觉这个工具类的逻辑可以不变)。
+注意替换配置文件的信息的操作 例如:127.0.0.1替换成 192.168.110.59这样的操作,账号密码同理,root 替换 root 密码123456替换 qwe123等
+
+其实就是替换字符这样的一个操作
+ */
 
 
 

+ 6 - 3
zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteNodeMapper.xml

@@ -41,7 +41,7 @@
                task_node_form_key,
                task_node_form_type,
                task_node_type,
-               `task_node_execute_type`,
+               task_node_execute_type,
                task_node_before,
                task_node_after,
                task_node_role_permission,
@@ -49,7 +49,7 @@
                task_node_number,
                task_node_weight,
                task_node_state,
-               `task_node_other_state`,
+               task_node_other_state,
                task_priority,
                task1,
                task2,
@@ -228,6 +228,7 @@
             <if test="taskNodeNumber != null">task_node_number = #{taskNodeNumber},</if>
             <if test="taskNodeWeight != null">task_node_weight = #{taskNodeWeight},</if>
             <if test="taskNodeState != null">task_node_state = #{taskNodeState},</if>
+            <if test="taskNodeOtherState != null">task_node_other_state = #{taskNodeOtherState},</if>
             <if test="taskPriority != null">task_priority = #{taskPriority},</if>
             <if test="task1 != null">task1 = #{task1},</if>
             <if test="task2 != null">task2 = #{task2},</if>
@@ -244,6 +245,8 @@
             <if test="taskProcessKey != null"> and task_process_key = #{taskProcessKey}</if>
             <if test="taskNodeKey != null">and task_node_key = #{taskNodeKey}</if>
         </where>
+
+
     </update>
 
 
@@ -254,7 +257,7 @@
     </delete>
 
     <delete id="deleteBpmExecuteNodeByIds" parameterType="String">
-        delete from bpm_execute_node where id in
+        delete from {DBNAME}.bpm_execute_node where id in
         <foreach item="id" collection="array" open="(" separator="," close=")">
             #{id}
         </foreach>

+ 34 - 39
zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteProcessMapper.xml

@@ -64,9 +64,11 @@
     <!--benm.task_process_key-->
     <select id="selectBpmExecuteProcessListLog" resultMap="retMap">
         select
+        plan.${planName} as task_plan_name,
         bep.*
         from {DBNAME}.bpm_execute_process bep
         join {DBNAME}.bpm_execute_node_middle benm on bep.task_key = benm.task_process_key
+        join {DBNAME}.${planTableName} as plan on plan.${planID} = bep.task_plan_key
         where
         FIND_IN_SET(#{userId}, benm.task_execute_user_no) > 0
         <if test="taskRealRoleList != null and taskRealRoleList.size() > 0">
@@ -75,25 +77,19 @@
                 FIND_IN_SET(#{role}, benm.task_real_role) > 0
             </foreach>
         </if>
-
-        <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 =
-            #{taskNodeNextKey}
-        </if>
-        <if test="taskProcessKey != null  and taskProcessKey != ''">and bep.task_process_key = #{taskProcessKey}
-        </if>
-        <if test="taskProcessXmlContent != null  and taskProcessXmlContent != ''">and bep.task_process_xml_content =
-            #{taskProcessXmlContent}
-        </if>
-        <if test="taskProcessState != null ">and bep.task_process_state = #{taskProcessState}</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 test="taskProcessState != null">and bep.task_process_state = #{taskProcessState}</if>
+        <if test="taskName != null  and taskName != ''">
+            and CONCAT(
+            IFNULL( bep.task_key, '' ),
+            IFNULL( bep.task_name, '' ),
+            IFNULL( bep.task_node_key, '' ),
+            IFNULL( bep.task_node_next_key, '' ),
+            IFNULL( bep.task_process_key, '' ),
+            IFNULL( bep.task_process_note, '' ),
+            IFNULL( plan.${planName}, '' ),
+            IFNULL( task_process_type, '' )) LIKE concat('%', #{taskName}, '%')
         </if>
+
         GROUP BY benm.task_process_key
     </select>
 
@@ -250,18 +246,18 @@
             </foreach>
         </if>
         )
-        <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="taskProcessState != null ">and bep.task_process_state = #{taskProcessState}</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 test="taskProcessState != null">and bep.task_process_state = #{taskProcessState}</if>
+        <if test="taskName != null  and taskName != ''">
+            and CONCAT(
+            IFNULL( bep.task_key, '' ),
+            IFNULL( bep.task_name, '' ),
+            IFNULL( bep.task_node_key, '' ),
+            IFNULL( bep.task_node_next_key, '' ),
+            IFNULL( bep.task_process_key, '' ),
+            IFNULL( bep.task_process_note, '' ),
+            IFNULL( task_process_type, '' )) LIKE concat('%', #{taskName}, '%')
         </if>
+
         order by ben.create_time desc
     </select>
 
@@ -384,16 +380,15 @@
         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 test="taskName != null  and taskName != ''">
+            and CONCAT(
+            IFNULL( bep.task_key, '' ),
+            IFNULL( bep.task_name, '' ),
+            IFNULL( bep.task_node_key, '' ),
+            IFNULL( bep.task_node_next_key, '' ),
+            IFNULL( bep.task_process_key, '' ),
+            IFNULL( bep.task_process_note, '' ),
+            IFNULL( task_process_type, '' )) LIKE concat('%', #{taskName}, '%')
         </if>
         order by ben.create_time desc
     </select>