Explorar o código

feat:增加流程查询过滤条件

韩帛霖 hai 1 ano
pai
achega
57872dd141

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

@@ -83,14 +83,14 @@ public class BpmExecuteProcessServiceImpl implements IBpmExecuteProcessService {
             List<Map<String, Object>> tenantRetList = (List<Map<String, Object>>) tenantRetMap.get("rows");
             Map<String, Object> objectMap = new HashMap<>();  // 查询执行管道的参数
             objectMap.putAll(convertEntityToMap(bpmExecuteProcess));
+            tenantRetList.forEach(item -> {
+                objectMap.put(item.get("dictLabel").toString(), item.get("dictValue"));
+            });
             if (bpmExecuteProcess.getTaskProcessState() == 3L) {
                 // 首先根据当前登陆用户得到他可以执行的所有节点
-                List<CommonEntity> commonEntities = runBpmExecuteProcessMapper.queryExecuteProcess(objectMap);
+                List<CommonEntity> commonEntities = runBpmExecuteProcessMapper.queryExecuteProcessEnd(objectMap);
                 return commonEntities;
             } else {
-                tenantRetList.forEach(item -> {
-                    objectMap.put(item.get("dictLabel").toString(), item.get("dictValue"));
-                });
                 List<SysRole> sysRoles = SecurityUtils.getLoginUser().getUser().getRoles();
                 List<String> roles = new ArrayList<>();
                 if (sysRoles.size() != 0) {

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

@@ -61,9 +61,10 @@
             </if>
         </where>
     </select>
-    <!--benm.task_process_key-->
+    <!--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
@@ -76,24 +77,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 =
-            #{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="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,17 +245,16 @@
             </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="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>
         order by ben.create_time desc
     </select>
@@ -325,16 +319,16 @@
         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( plan.${planName}, '' ),
+            IFNULL( task_process_type, '' )) LIKE concat('%', #{taskName}, '%')
         </if>
         order by ben.create_time desc
     </select>

+ 9 - 4
zkqy-system/src/main/java/com/zkqy/system/service/impl/BpmProcessServiceImpl.java

@@ -84,7 +84,10 @@ public class BpmProcessServiceImpl implements IBpmProcessService {
             try {
                 // 解析得到当前文件中的内容
                 byte[] bytes = fileXML.getBytes();
-                String xmlContent = new String(bytes);
+                String xmlContent = new String(bytes, "UTF-8");  // 使用UTF-8编码处理文件内容
+                System.err.println("流程文件内容!!!!!!!!!!!!!!!!!!!!!!!");
+                System.err.println(xmlContent);
+                System.err.println("流程文件内容!!!!!!!!!!!!!!!!!!!!!!!");
                 // 存储标签内容
                 bpmProcess.setProcessXmlContent(xmlContent);
                 // 指定文件路径上传
@@ -100,8 +103,7 @@ public class BpmProcessServiceImpl implements IBpmProcessService {
         bpmProcess.setProcessVersion(0L);
         bpmProcess.setProcessType(0L);
         bpmProcess.setStartEventType(0L);
-        return bpmProcessMapper.insertBpmProcess(bpmProcess);
-    }
+        return bpmProcessMapper.insertBpmProcess(bpmProcess);    }
 
     /**
      * 修改流程定义
@@ -118,7 +120,10 @@ public class BpmProcessServiceImpl implements IBpmProcessService {
             try {
                 // 解析得到当前文件中的内容
                 byte[] bytes = fileXML.getBytes();
-                String xmlContent = new String(bytes);
+                String xmlContent = new String(bytes, "UTF-8");  // 使用UTF-8编码处理文件内容
+                System.err.println("流程文件内容!!!!!!!!!!!!!!!!!!!!!!!");
+                System.err.println(xmlContent);
+                System.err.println("流程文件内容!!!!!!!!!!!!!!!!!!!!!!!");
                 // 存储标签内容
                 bpmProcess.setProcessXmlContent(xmlContent);
                 // 指定文件路径上传