Explorar el Código

fix:修复管道执行分页数据紊乱,管道展示查询问题,

韩帛霖 hace 1 año
padre
commit
e67b366e07

+ 1 - 1
zkqy-common/src/main/java/com/zkqy/common/config/datasource/config/CrosConfig.java

@@ -12,7 +12,7 @@ public class CrosConfig implements WebMvcConfigurer {
     @Override
     public void addCorsMappings(CorsRegistry registry) {
         registry.addMapping("/**") // 所有的当前站点的请求地址,都支持跨域访问。
-                .allowedOriginPatterns("*") // 所有的外部域都可跨域访问。 如果是localhost则很难配置,因为在跨域请求的时候,外部域的解析可能是localhost、127.0.0.1、主机名
+                .allowedOriginPatterns("*") // 所有的外部域都可跨域访问。 如果是192.168.110.59则很难配置,因为在跨域请求的时候,外部域的解析可能是192.168.110.59、127.0.0.1、主机名
                 .allowCredentials(true) // 是否支持跨域用户凭证
                 .allowedMethods(ORIGINS) // 当前站点支持的跨域请求类型是什么
                 .maxAge(3600); // 超时时长设置为1小时。 时间单位是秒。

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

@@ -28,6 +28,7 @@ import org.springframework.stereotype.Service;
 import java.lang.reflect.Field;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.stream.Stream;
 
 /**
  * 流程执行任务Service业务层处理
@@ -97,7 +98,20 @@ public class BpmExecuteProcessServiceImpl implements IBpmExecuteProcessService {
             // 首先根据当前登陆用户得到他可以执行的所有节点
             List<CommonEntity> commonEntities = runBpmExecuteProcessMapper.queryExecuteProcess(objectMap);
             // 查询异常脚本信息
-            return bpmExecuteNodeMiddleService.addExceptionScript(commonEntities);
+            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;
     }
@@ -110,7 +124,7 @@ public class BpmExecuteProcessServiceImpl implements IBpmExecuteProcessService {
         if (sysRoles.size() != 0) {
             roles.addAll(sysRoles.stream().map(SysRole::getRoleKey).collect(Collectors.toList()));
         }
-         // 根据当前的用户id得到可以执行的流程节点
+        // 根据当前的用户id得到可以执行的流程节点
         objectMap.put("userId", SecurityUtils.getUserId());
         // 得到当前发起请求的用户角色列表
         objectMap.put("taskRealRoleList", roles);
@@ -123,7 +137,7 @@ public class BpmExecuteProcessServiceImpl implements IBpmExecuteProcessService {
             taksKey[index[0]] = item.getResultMap().get("taskKey").toString();
             index[0]++;
         });
-        if (taksKey.length <= 0){
+        if (taksKey.length <= 0) {
             return commonEntityList;
         }
 

+ 1 - 2
zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteNodeLogMapper.xml

@@ -122,11 +122,10 @@
         <foreach collection="taskProcessList" item="task" open="(" separator="," close=")">
             #{task}
         </foreach>
-        GROUP BY task_process_key, task_node_key, task_node_name
+        GROUP BY id
         ORDER BY task_process_key, MIN(id)
     </select>
 
-
     <insert id="insertBpmExecuteNodeLog" parameterType="com.zkqy.execution.produce.dispersed.entity.BpmExecuteNodeLog"
             useGeneratedKeys="true" keyProperty="id">
         insert into bpm_execute_node_log

+ 21 - 22
zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteProcessMapper.xml

@@ -65,8 +65,8 @@
     <select id="selectBpmExecuteProcessListLog" resultMap="retMap">
         select
         bep.*
-        from {DBNAME}.bpm_execute_node_middle benm
-        join {DBNAME}.bpm_execute_process bep on bep.task_key = benm.task_process_key
+        from {DBNAME}.bpm_execute_process bep
+        join {DBNAME}.bpm_execute_node_middle benm on bep.task_key = benm.task_process_key
         where
         FIND_IN_SET(#{userId}, benm.task_execute_user_no) > 0
         <if test="taskRealRoleList != null and taskRealRoleList.size() > 0">
@@ -75,26 +75,25 @@
                 FIND_IN_SET(#{role}, benm.task_real_role) > 0
             </foreach>
         </if>
-        <where>
-            <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>
-        </where>
+
+        <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>
         GROUP BY benm.task_process_key
     </select>
 

+ 6 - 1
zkqy-system/src/main/java/com/zkqy/system/entity/CommonEntity.java

@@ -15,7 +15,7 @@ import java.util.Map;
  * @author hanzihang
  * @date 2023/7/19 4:05 PM
  */
-public class CommonEntity extends BaseEntity implements Serializable {
+public class CommonEntity extends BaseEntity implements Serializable, Cloneable {
 
     private static final long serialVersionUID = 2938L;
 
@@ -161,6 +161,11 @@ public class CommonEntity extends BaseEntity implements Serializable {
         this.execlMap = execlMap;
     }
 
+    @Override
+    public CommonEntity clone() throws CloneNotSupportedException {
+        return (CommonEntity) super.clone();
+    }
+
 }
 /*