Przeglądaj źródła

feat:管道展示接口(流程执行日志接口),修复角色用户查询流程接口,注释补充

韩帛霖 1 rok temu
rodzic
commit
7742c8e543
12 zmienionych plików z 303 dodań i 92 usunięć
  1. 9 2
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/controller/BpmExecuteProcessController.java
  2. 1 1
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/controller/BpmRunController.java
  3. 11 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/mapper/BpmExecuteNodeLogMapper.java
  4. 14 5
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/mapper/BpmExecuteProcessMapper.java
  5. 8 1
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/runbpm/PreExecutionToolClass.java
  6. 10 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/IBpmExecuteNodeLogService.java
  7. 8 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/IBpmExecuteProcessService.java
  8. 22 21
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/BpmExecuteNodeLogServiceImpl.java
  9. 41 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/BpmExecuteProcessServiceImpl.java
  10. 1 1
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/nuts/WarehousingImpl.java
  11. 112 54
      zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteNodeLogMapper.xml
  12. 66 7
      zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteProcessMapper.xml

+ 9 - 2
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/controller/BpmExecuteProcessController.java

@@ -50,6 +50,13 @@ public class BpmExecuteProcessController extends BaseController {
         return getDataTable(bpmExecuteProcessService.selectBpmExecuteProcessList(bpmExecuteProcess));
     }
 
+    @GetMapping("listLog")
+    public TableDataInfo listLog(BpmExecuteProcess bpmExecuteProcess) {
+        startPage();
+        return getDataTable(bpmExecuteProcessService.selectBpmExecuteProcessListLog(bpmExecuteProcess));
+    }
+
+
     /**
      * 导出流程执行任务列表
      */
@@ -106,7 +113,7 @@ public class BpmExecuteProcessController extends BaseController {
      */
     @Log(title = "投产执行流程", businessType = BusinessType.INSERT)
     @PostMapping("/productionScheduling")
-    public AjaxResult productionScheduling(@RequestBody CommonEntity commonEntity)   {
+    public AjaxResult productionScheduling(@RequestBody CommonEntity commonEntity) {
         return bpmExecuteProcessService.productionScheduling(commonEntity);
     }
 
@@ -114,7 +121,7 @@ public class BpmExecuteProcessController extends BaseController {
      * 查询节点表单信息
      */
     @GetMapping("/getNodeFormInfos")
-    public AjaxResult getNodeFormInfos(Map<String,String> nodeForm) {
+    public AjaxResult getNodeFormInfos(Map<String, String> nodeForm) {
         return AjaxResult.success(PreExecutionToolClass.getNodeFormInfos(nodeForm));
     }
 

+ 1 - 1
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/controller/BpmRunController.java

@@ -75,7 +75,7 @@ public class BpmRunController extends BaseController {
     }
 
     /**
-     * handleSubmitForm
+     * 处理流程节点表单提交的业务数据
      *
      * @param bpmRunNodeFormDateVo
      * @return

+ 11 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/mapper/BpmExecuteNodeLogMapper.java

@@ -1,8 +1,11 @@
 package com.zkqy.execution.produce.dispersed.mapper;
 
 import com.zkqy.execution.produce.dispersed.entity.BpmExecuteNodeLog;
+import com.zkqy.system.entity.CommonEntity;
+import io.lettuce.core.dynamic.annotation.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 节点执行记录(日志)Mapper接口
@@ -20,6 +23,14 @@ public interface BpmExecuteNodeLogMapper
      */
     public BpmExecuteNodeLog selectBpmExecuteNodeLogById(Long id);
 
+    /**
+     * 查询流程执行任务log2
+     *
+     * @param objectMap 查询条件
+     * @return 流程执行任务集合
+     */
+    public List<BpmExecuteNodeLog> selectBpmExecuteProcessNodeListLog(@Param("objectMap") Map<String, Object> objectMap);
+
     /**
      * 查询节点执行记录(日志)列表
      * 

+ 14 - 5
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/mapper/BpmExecuteProcessMapper.java

@@ -30,6 +30,14 @@ public interface BpmExecuteProcessMapper {
      */
     public List<BpmExecuteProcess> selectBpmExecuteProcessList(BpmExecuteProcess bpmExecuteProcess);
 
+    /**
+     * 查询流程执行任务log
+     *
+     * @param objectMap 查询条件
+     * @return 流程执行任务集合
+     */
+    public List<CommonEntity> selectBpmExecuteProcessListLog(@Param("objectMap") Map<String, Object> objectMap);
+
     /**
      * 新增流程执行任务
      *
@@ -96,28 +104,29 @@ public interface BpmExecuteProcessMapper {
 
     /**
      * 通过formKey查询表单信息
+     *
      * @param formKey
      * @return
      */
-    Map<String,String> getFromInfo(String formKey);
+    Map<String, String> getFromInfo(String formKey);
 
     /**
      * 根据groupKey查询表格组信息
      */
-    Map<String,String> getGroupInfo(String groupKey);
+    Map<String, String> getGroupInfo(String groupKey);
 
     /**
      * 根据tableKey查询Table表格信息
      */
-    Map<String,String> getTableInfo(String tableKey);
+    Map<String, String> getTableInfo(String tableKey);
 
     /**
      * 根据tableKey查询Table表格信息
      */
-    Map<String,String> getTableSqlInfo(String sqlKey);
+    Map<String, String> getTableSqlInfo(String sqlKey);
 
     /**
      * 根据动态表格编号查询 drag_table_
      */
-    List<Map<String,String>> getTableCondition(String tId);
+    List<Map<String, String>> getTableCondition(String tId);
 }

+ 8 - 1
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/runbpm/PreExecutionToolClass.java

@@ -192,6 +192,8 @@ public class PreExecutionToolClass<R> {
                     }
                 }
             });
+            System.err.println("🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀🚀");
+            System.err.println(script0.toString().toString());
             // 手动异常触发脚本
             bpmExecuteNodeMiddle.setTaskArtificialScriptKey(script0.toString().replaceAll("\\[", "").replaceAll("\\]", ""));
             // 正常节点自动触发脚本
@@ -504,6 +506,9 @@ public class PreExecutionToolClass<R> {
          *
          * 发起的操作节点的表单还是操作的当前节点的表单
          * 也就是说相当于把当前节点执行后在更改当前任务流程的执行节点
+         *
+         *
+         * 被回退的节点
          */
         // 得到当前流程的详细信息
         BpmExecuteProcess bpmExecuteProcess = runBpmExecuteProcessMapper.selectBpmExecuteProcessByTaskKey(bpmBackNodeVo.getTaskProcessKey());
@@ -533,6 +538,7 @@ public class PreExecutionToolClass<R> {
             bpmExecuteNodeLog1.setTaskParentNodeKey(bpmBackNodeVo.getTaskNodeKey());
             iBpmExecuteNodeLogService.updateBpmExecuteNodeLog(bpmExecuteNodeLog1);
         }
+        nodeKeys.add(bpmBackNodeVo.getTaskBackNodeKey());
         // 修改回退节点后的所有异常节点信息
         runBpmExecuteNodeMapper.deleteExceptionNodeByKeys(bpmBackNodeVo.getTaskProcessKey(), nodeKeys);
         return AjaxResult.success();
@@ -545,7 +551,7 @@ public class PreExecutionToolClass<R> {
     }
 
 
-//    /**
+    //    /**
 //     * 共通执行节点表单模版接口
 //     */
 //    public List<Map> getProcessNodeFormTemplate(BpmRunNodePlusVo bpmRunNodeV) {
@@ -628,4 +634,5 @@ public class PreExecutionToolClass<R> {
 //        }
 //        return mapList;
 //    }
+
 }

+ 10 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/IBpmExecuteNodeLogService.java

@@ -1,8 +1,10 @@
 package com.zkqy.execution.produce.dispersed.service;
 
 import com.zkqy.execution.produce.dispersed.entity.BpmExecuteNodeLog;
+import io.lettuce.core.dynamic.annotation.Param;
 
 import java.util.List;
+import java.util.Map;
 
 /**
  * 节点执行记录(日志)Service接口
@@ -20,6 +22,14 @@ public interface IBpmExecuteNodeLogService
      */
     public BpmExecuteNodeLog selectBpmExecuteNodeLogById(Long id);
 
+    /**
+     * 查询流程执行任务log2
+     *
+     * @param objectMap 查询条件
+     * @return 流程执行任务集合
+     */
+    public List<BpmExecuteNodeLog> selectBpmExecuteProcessNodeListLog(@Param("objectMap") Map<String, Object> objectMap);
+
     /**
      * 查询节点执行记录(日志)列表
      * 

+ 8 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/IBpmExecuteProcessService.java

@@ -30,6 +30,14 @@ public interface IBpmExecuteProcessService {
      */
      List<CommonEntity> selectBpmExecuteProcessList(BpmExecuteProcess bpmExecuteProcess) throws Exception;
 
+    /**
+     * 查询流程执行记录log列表
+     *
+     * @param bpmExecuteProcess 流程执行任务
+     * @return 流程执行任务集合
+     */
+    List<CommonEntity> selectBpmExecuteProcessListLog(BpmExecuteProcess bpmExecuteProcess);
+
     /**
      * 新增流程执行任务
      *

+ 22 - 21
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/BpmExecuteNodeLogServiceImpl.java

@@ -1,94 +1,95 @@
 package com.zkqy.execution.produce.dispersed.service.impl;
 
 import java.util.List;
+import java.util.Map;
+
 import com.zkqy.common.utils.DateUtils;
 import com.zkqy.execution.produce.dispersed.entity.BpmExecuteNodeLog;
 import com.zkqy.execution.produce.dispersed.mapper.BpmExecuteNodeLogMapper;
 import com.zkqy.execution.produce.dispersed.service.IBpmExecuteNodeLogService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+
 /**
  * 节点执行记录(日志)Service业务层处理
- * 
+ *
  * @author zkqy
  * @date 2023-12-18
  */
 @Service
-public class BpmExecuteNodeLogServiceImpl implements IBpmExecuteNodeLogService
-{
+public class BpmExecuteNodeLogServiceImpl implements IBpmExecuteNodeLogService {
     @Autowired
     private BpmExecuteNodeLogMapper bpmExecuteNodeLogMapper;
 
     /**
      * 查询节点执行记录(日志)
-     * 
+     *
      * @param id 节点执行记录(日志)主键
      * @return 节点执行记录(日志)
      */
     @Override
-    public BpmExecuteNodeLog selectBpmExecuteNodeLogById(Long id)
-    {
+    public BpmExecuteNodeLog selectBpmExecuteNodeLogById(Long id) {
         return bpmExecuteNodeLogMapper.selectBpmExecuteNodeLogById(id);
     }
 
+    @Override
+    public List<BpmExecuteNodeLog> selectBpmExecuteProcessNodeListLog(Map<String, Object> objectMap) {
+        return bpmExecuteNodeLogMapper.selectBpmExecuteProcessNodeListLog(objectMap);
+    }
+
     /**
      * 查询节点执行记录(日志)列表
-     * 
+     *
      * @param bpmExecuteNodeLog 节点执行记录(日志)
      * @return 节点执行记录(日志)
      */
     @Override
-    public List<BpmExecuteNodeLog> selectBpmExecuteNodeLogList(BpmExecuteNodeLog bpmExecuteNodeLog)
-    {
+    public List<BpmExecuteNodeLog> selectBpmExecuteNodeLogList(BpmExecuteNodeLog bpmExecuteNodeLog) {
         return bpmExecuteNodeLogMapper.selectBpmExecuteNodeLogList(bpmExecuteNodeLog);
     }
 
     /**
      * 新增节点执行记录(日志)
-     * 
+     *
      * @param bpmExecuteNodeLog 节点执行记录(日志)
      * @return 结果
      */
     @Override
-    public int insertBpmExecuteNodeLog(BpmExecuteNodeLog bpmExecuteNodeLog)
-    {
+    public int insertBpmExecuteNodeLog(BpmExecuteNodeLog bpmExecuteNodeLog) {
         bpmExecuteNodeLog.setCreateTime(DateUtils.getNowDate());
         return bpmExecuteNodeLogMapper.insertBpmExecuteNodeLog(bpmExecuteNodeLog);
     }
 
     /**
      * 修改节点执行记录(日志)
-     * 
+     *
      * @param bpmExecuteNodeLog 节点执行记录(日志)
      * @return 结果
      */
     @Override
-    public int updateBpmExecuteNodeLog(BpmExecuteNodeLog bpmExecuteNodeLog)
-    {
+    public int updateBpmExecuteNodeLog(BpmExecuteNodeLog bpmExecuteNodeLog) {
         return bpmExecuteNodeLogMapper.updateBpmExecuteNodeLog(bpmExecuteNodeLog);
     }
 
     /**
      * 批量删除节点执行记录(日志)
-     * 
+     *
      * @param ids 需要删除的节点执行记录(日志)主键
      * @return 结果
      */
     @Override
-    public int deleteBpmExecuteNodeLogByIds(Long[] ids)
-    {
+    public int deleteBpmExecuteNodeLogByIds(Long[] ids) {
         return bpmExecuteNodeLogMapper.deleteBpmExecuteNodeLogByIds(ids);
     }
 
     /**
      * 删除节点执行记录(日志)信息
-     * 
+     *
      * @param id 节点执行记录(日志)主键
      * @return 结果
      */
     @Override
-    public int deleteBpmExecuteNodeLogById(Long id)
-    {
+    public int deleteBpmExecuteNodeLogById(Long id) {
         return bpmExecuteNodeLogMapper.deleteBpmExecuteNodeLogById(id);
     }
 }

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

@@ -11,12 +11,15 @@ import com.zkqy.common.core.domain.entity.SysRole;
 
 import com.zkqy.common.utils.SecurityUtils;
 import com.zkqy.common.utils.http.Sending;
+import com.zkqy.execution.produce.dispersed.entity.BpmExecuteNodeLog;
 import com.zkqy.execution.produce.dispersed.runbpm.PreExecutionToolClass;
 import com.zkqy.execution.produce.dispersed.entity.BpmExecuteProcess;
 import com.zkqy.execution.produce.dispersed.mapper.BpmExecuteProcessMapper;
+import com.zkqy.execution.produce.dispersed.service.IBpmExecuteNodeLogService;
 import com.zkqy.execution.produce.dispersed.service.IBpmExecuteNodeMiddleService;
 import com.zkqy.execution.produce.dispersed.service.IBpmExecuteProcessService;
 import com.zkqy.system.entity.CommonEntity;
+import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Service;
@@ -43,6 +46,8 @@ public class BpmExecuteProcessServiceImpl implements IBpmExecuteProcessService {
     @Autowired //执行流程用户、节点关联脚本中间Service接口
     private IBpmExecuteNodeMiddleService bpmExecuteNodeMiddleService;
 
+    @Autowired
+    private IBpmExecuteNodeLogService iBpmExecuteNodeLogService;
 
     @Autowired
     private Sending sending;
@@ -96,6 +101,42 @@ public class BpmExecuteProcessServiceImpl implements IBpmExecuteProcessService {
         return null;
     }
 
+    @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]++;
+        });
+        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;
+    }
+
     /**
      * 新增流程执行任务
      *

+ 1 - 1
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/runbpm/nuts/WarehousingImpl.java

@@ -36,7 +36,7 @@ public class WarehousingImpl implements IRunBPMService {
     @Override
     public CommonEntity getNodeFormData(BpmRunNodeFromVo bpmRunNodeFromVo) {
         HashMap hashMap=new HashMap();
-        hashMap.put("id", bpmRunNodeFromVo.getTaskPlanKey());
+        hashMap.put("id",4);
         CommonEntity commonEntity = commonMapper.selectOne("plan", hashMap);
         String goodsno = commonEntity.getResultMap().get("goodsno").toString();
         Map<String, Object> map2 = new HashMap<>();

+ 112 - 54
zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteNodeLogMapper.xml

@@ -5,65 +5,107 @@
 <mapper namespace="com.zkqy.execution.produce.dispersed.mapper.BpmExecuteNodeLogMapper">
 
     <resultMap type="com.zkqy.execution.produce.dispersed.entity.BpmExecuteNodeLog" id="BpmExecuteNodeLogResult">
-        <result property="id"    column="id"    />
-        <result property="taskParentNodeKey"    column="task_parent_node_key"    />
-        <result property="taskProcessKey"    column="task_process_key"    />
-        <result property="taskNodeKey"    column="task_node_key"    />
-        <result property="taskNodeName"    column="task_node_name"    />
-        <result property="taskNodeFormKey"    column="task_node_form_key"    />
-        <result property="taskNodeFormType"    column="task_node_form_type"    />
-        <result property="taskNodeType"    column="task_node_type"    />
-        <result property="taskNodeExecuteType"    column="task_node_execute_type"    />
-        <result property="taskNodeBefore"    column="task_node_before"    />
-        <result property="taskNodeAfter"    column="task_node_after"    />
-        <result property="taskNodeRolePermission"    column="task_node_role_permission"    />
-        <result property="taskRemark"    column="task_remark"    />
-        <result property="taskNodeNumber"    column="task_node_number"    />
-        <result property="taskNodeWeight"    column="task_node_weight"    />
-        <result property="taskNodeState"    column="task_node_state"    />
-        <result property="taskNodeOtherState"    column="task_node_other_state"    />
-        <result property="taskPriority"    column="task_priority"    />
-        <result property="task1"    column="task1"    />
-        <result property="task2"    column="task2"    />
-        <result property="task3"    column="task3"    />
-        <result property="task4"    column="task4"    />
-        <result property="task5"    column="task5"    />
-        <result property="delFlag"    column="del_flag"    />
-        <result property="createById"    column="create_by_id"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
+        <result property="id" column="id"/>
+        <result property="taskParentNodeKey" column="task_parent_node_key"/>
+        <result property="taskProcessKey" column="task_process_key"/>
+        <result property="taskNodeKey" column="task_node_key"/>
+        <result property="taskNodeName" column="task_node_name"/>
+        <result property="taskNodeFormKey" column="task_node_form_key"/>
+        <result property="taskNodeFormType" column="task_node_form_type"/>
+        <result property="taskNodeType" column="task_node_type"/>
+        <result property="taskNodeExecuteType" column="task_node_execute_type"/>
+        <result property="taskNodeBefore" column="task_node_before"/>
+        <result property="taskNodeAfter" column="task_node_after"/>
+        <result property="taskNodeRolePermission" column="task_node_role_permission"/>
+        <result property="taskRemark" column="task_remark"/>
+        <result property="taskNodeNumber" column="task_node_number"/>
+        <result property="taskNodeWeight" column="task_node_weight"/>
+        <result property="taskNodeState" column="task_node_state"/>
+        <result property="taskNodeOtherState" column="task_node_other_state"/>
+        <result property="taskPriority" column="task_priority"/>
+        <result property="task1" column="task1"/>
+        <result property="task2" column="task2"/>
+        <result property="task3" column="task3"/>
+        <result property="task4" column="task4"/>
+        <result property="task5" column="task5"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createById" column="create_by_id"/>
+        <result property="createBy" column="create_by"/>
+        <result property="createTime" column="create_time"/>
     </resultMap>
 
     <sql id="selectBpmExecuteNodeLogVo">
-        select id, task_parent_node_key, task_process_key, task_node_key, task_node_name, task_node_form_key, task_node_form_type, task_node_type, task_node_execute_type, task_node_before, task_node_after, task_node_role_permission, task_remark, task_node_number, task_node_weight, task_node_state, task_node_other_state, task_priority, task1, task2, task3, task4, task5, del_flag, create_by_id, create_by, create_time from bpm_execute_node_log
+        select id,
+               task_parent_node_key,
+               task_process_key,
+               task_node_key,
+               task_node_name,
+               task_node_form_key,
+               task_node_form_type,
+               task_node_type,
+               task_node_execute_type,
+               task_node_before,
+               task_node_after,
+               task_node_role_permission,
+               task_remark,
+               task_node_number,
+               task_node_weight,
+               task_node_state,
+               task_node_other_state,
+               task_priority,
+               task1,
+               task2,
+               task3,
+               task4,
+               task5,
+               del_flag,
+               create_by_id,
+               create_by,
+               create_time
+        from bpm_execute_node_log
     </sql>
 
-    <select id="selectBpmExecuteNodeLogList" parameterType="com.zkqy.execution.produce.dispersed.entity.BpmExecuteNodeLog" resultMap="BpmExecuteNodeLogResult">
+    <select id="selectBpmExecuteNodeLogList"
+            parameterType="com.zkqy.execution.produce.dispersed.entity.BpmExecuteNodeLog"
+            resultMap="BpmExecuteNodeLogResult">
         <include refid="selectBpmExecuteNodeLogVo"/>
         <where>
-            <if test="taskParentNodeKey != null  and taskParentNodeKey != ''"> and task_parent_node_key = #{taskParentNodeKey}</if>
-            <if test="taskProcessKey != null  and taskProcessKey != ''"> and task_process_key = #{taskProcessKey}</if>
-            <if test="taskNodeKey != null  and taskNodeKey != ''"> and task_node_key = #{taskNodeKey}</if>
-            <if test="taskNodeName != null  and taskNodeName != ''"> and task_node_name like concat('%', #{taskNodeName}, '%')</if>
-            <if test="taskNodeFormKey != null  and taskNodeFormKey != ''"> and task_node_form_key = #{taskNodeFormKey}</if>
-            <if test="taskNodeFormType != null  and taskNodeFormType != ''"> and task_node_form_type = #{taskNodeFormType}</if>
-            <if test="taskNodeType != null  and taskNodeType != ''"> and task_node_type = #{taskNodeType}</if>
-            <if test="taskNodeExecuteType != null  and taskNodeExecuteType != ''"> and task_node_execute_type = #{taskNodeExecuteType}</if>
-            <if test="taskNodeBefore != null  and taskNodeBefore != ''"> and task_node_before = #{taskNodeBefore}</if>
-            <if test="taskNodeAfter != null  and taskNodeAfter != ''"> and task_node_after = #{taskNodeAfter}</if>
-            <if test="taskNodeRolePermission != null  and taskNodeRolePermission != ''"> and task_node_role_permission = #{taskNodeRolePermission}</if>
-            <if test="taskRemark != null  and taskRemark != ''"> and task_remark = #{taskRemark}</if>
-            <if test="taskNodeNumber != null  and taskNodeNumber != ''"> and task_node_number = #{taskNodeNumber}</if>
-            <if test="taskNodeWeight != null  and taskNodeWeight != ''"> and task_node_weight = #{taskNodeWeight}</if>
-            <if test="taskNodeState != null  and taskNodeState != ''"> and task_node_state = #{taskNodeState}</if>
-            <if test="taskNodeOtherState != null  and taskNodeOtherState != ''"> and task_node_other_state = #{taskNodeOtherState}</if>
-            <if test="taskPriority != null  and taskPriority != ''"> and task_priority = #{taskPriority}</if>
-            <if test="task1 != null  and task1 != ''"> and task1 = #{task1}</if>
-            <if test="task2 != null  and task2 != ''"> and task2 = #{task2}</if>
-            <if test="task3 != null  and task3 != ''"> and task3 = #{task3}</if>
-            <if test="task4 != null  and task4 != ''"> and task4 = #{task4}</if>
-            <if test="task5 != null  and task5 != ''"> and task5 = #{task5}</if>
-            <if test="createById != null  and createById != ''"> and create_by_id = #{createById}</if>
+            <if test="taskParentNodeKey != null  and taskParentNodeKey != ''">and task_parent_node_key =
+                #{taskParentNodeKey}
+            </if>
+            <if test="taskProcessKey != null  and taskProcessKey != ''">and task_process_key = #{taskProcessKey}</if>
+            <if test="taskNodeKey != null  and taskNodeKey != ''">and task_node_key = #{taskNodeKey}</if>
+            <if test="taskNodeName != null  and taskNodeName != ''">and task_node_name like concat('%', #{taskNodeName},
+                '%')
+            </if>
+            <if test="taskNodeFormKey != null  and taskNodeFormKey != ''">and task_node_form_key = #{taskNodeFormKey}
+            </if>
+            <if test="taskNodeFormType != null  and taskNodeFormType != ''">and task_node_form_type =
+                #{taskNodeFormType}
+            </if>
+            <if test="taskNodeType != null  and taskNodeType != ''">and task_node_type = #{taskNodeType}</if>
+            <if test="taskNodeExecuteType != null  and taskNodeExecuteType != ''">and task_node_execute_type =
+                #{taskNodeExecuteType}
+            </if>
+            <if test="taskNodeBefore != null  and taskNodeBefore != ''">and task_node_before = #{taskNodeBefore}</if>
+            <if test="taskNodeAfter != null  and taskNodeAfter != ''">and task_node_after = #{taskNodeAfter}</if>
+            <if test="taskNodeRolePermission != null  and taskNodeRolePermission != ''">and task_node_role_permission =
+                #{taskNodeRolePermission}
+            </if>
+            <if test="taskRemark != null  and taskRemark != ''">and task_remark = #{taskRemark}</if>
+            <if test="taskNodeNumber != null  and taskNodeNumber != ''">and task_node_number = #{taskNodeNumber}</if>
+            <if test="taskNodeWeight != null  and taskNodeWeight != ''">and task_node_weight = #{taskNodeWeight}</if>
+            <if test="taskNodeState != null  and taskNodeState != ''">and task_node_state = #{taskNodeState}</if>
+            <if test="taskNodeOtherState != null  and taskNodeOtherState != ''">and task_node_other_state =
+                #{taskNodeOtherState}
+            </if>
+            <if test="taskPriority != null  and taskPriority != ''">and task_priority = #{taskPriority}</if>
+            <if test="task1 != null  and task1 != ''">and task1 = #{task1}</if>
+            <if test="task2 != null  and task2 != ''">and task2 = #{task2}</if>
+            <if test="task3 != null  and task3 != ''">and task3 = #{task3}</if>
+            <if test="task4 != null  and task4 != ''">and task4 = #{task4}</if>
+            <if test="task5 != null  and task5 != ''">and task5 = #{task5}</if>
+            <if test="createById != null  and createById != ''">and create_by_id = #{createById}</if>
         </where>
     </select>
 
@@ -72,7 +114,21 @@
         where id = #{id}
     </select>
 
-    <insert id="insertBpmExecuteNodeLog" parameterType="com.zkqy.execution.produce.dispersed.entity.BpmExecuteNodeLog" useGeneratedKeys="true" keyProperty="id">
+    <select id="selectBpmExecuteProcessNodeListLog"
+            resultMap="BpmExecuteNodeLogResult">
+        SELECT *
+        FROM bpm_execute_node_log
+        WHERE task_process_key IN
+        <foreach collection="taskProcessList" item="task" open="(" separator="," close=")">
+            #{task}
+        </foreach>
+        GROUP BY task_process_key, task_node_key, task_node_name
+        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
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="taskParentNodeKey != null">task_parent_node_key,</if>
@@ -166,7 +222,9 @@
     </update>
 
     <delete id="deleteBpmExecuteNodeLogById" parameterType="Long">
-        delete from bpm_execute_node_log where id = #{id}
+        delete
+        from bpm_execute_node_log
+        where id = #{id}
     </delete>
 
     <delete id="deleteBpmExecuteNodeLogByIds" parameterType="String">

+ 66 - 7
zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteProcessMapper.xml

@@ -61,6 +61,54 @@
             </if>
         </where>
     </select>
+    <!--benm.task_process_key-->
+    <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
+        where
+        FIND_IN_SET(#{userId}, benm.task_execute_user_no) > 0
+        <if test="taskRealRoleList != null and taskRealRoleList.size() > 0">
+            OR
+            <foreach collection="taskRealRoleList" item="role" separator=" OR ">
+                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>
+        GROUP BY benm.task_process_key
+    </select>
+
+    <select id="selectBpmExecuteProcessNodeListLog"
+            resultMap="retMap">
+        SELECT *
+        FROM bpm_execute_node_log
+        WHERE task_process_key IN
+        <foreach collection="taskProcessList" item="task" open="(" separator="," close=")">
+            #{task}
+        </foreach>
+        GROUP BY task_process_key, task_node_key, task_node_name
+        ORDER BY task_process_key, MIN(id)
+    </select>
 
     <select id="selectBpmExecuteProcessById" parameterType="Long" resultMap="BpmExecuteProcessResult">
         <include refid="selectBpmExecuteProcessVo"/>
@@ -196,7 +244,7 @@
         from {DBNAME}.bpm_execute_node_middle
         where
         FIND_IN_SET(#{userId}, task_execute_user_no) > 0
-        <if test="taskRealRoleList != null and taskRealRoleList.contains('specificValue')">
+        <if test="taskRealRoleList != null and taskRealRoleList.size() > 0">
             OR
             <foreach collection="taskRealRoleList" item="role" separator=" OR ">
                 FIND_IN_SET(#{role}, task_real_role) > 0
@@ -206,7 +254,8 @@
         <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 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>
@@ -247,23 +296,33 @@
     </update>
 
     <select id="getFromInfo" resultType="java.util.Map" parameterType="string">
-        select * from {DBNAME}.drag_form where f_id=#{fid}
+        select *
+        from {DBNAME}.drag_form
+        where f_id=#{fid}
     </select>
 
     <select id="getGroupInfo" resultType="java.util.Map" parameterType="string">
-        select * from {DBNAME}.drag_table_group where group_key=#{groupKey}
+        select *
+        from {DBNAME}.drag_table_group
+        where group_key=#{groupKey}
     </select>
 
     <select id="getTableInfo" resultType="java.util.Map" parameterType="string">
-        select * from {DBNAME}.drag_table where table_key=#{tableKey}
+        select *
+        from {DBNAME}.drag_table
+        where table_key=#{tableKey}
     </select>
 
     <select id="getTableSqlInfo" resultType="java.util.Map">
-        select table_sql,table_condition from {DBNAME}.table_sql where sql_key=#{sqlKey}
+        select table_sql, table_condition
+        from {DBNAME}.table_sql
+        where sql_key=#{sqlKey}
     </select>
 
     <select id="getTableCondition" resultType="java.util.Map">
-        select * from  {DBNAME}.drag_table_condition where t_id=#{tId}
+        select *
+        from {DBNAME}.drag_table_condition
+        where t_id=#{tId}
     </select>
 
 </mapper>