Browse Source

feat:修改共通按钮调用执行流程表单逻辑,动态表单增加表单key做唯一标识,新增解析xml获取当前节点类型方法,新增审批执行相关接口,发起审批流程接口修改,修改流程查询条件逻辑,新增审批流程中间表逻辑

韩帛霖 1 năm trước cách đây
mục cha
commit
3f8e499595
21 tập tin đã thay đổi với 1161 bổ sung177 xóa
  1. 4 0
      zkqy-admin/pom.xml
  2. 47 0
      zkqy-admin/src/main/java/com/zkqy/web/ljj.java
  3. 56 36
      zkqy-business/src/main/java/com/zkqy/business/controller/CommonBtnController.java
  4. 95 50
      zkqy-business/src/main/java/com/zkqy/business/entity/DragTableBtn.java
  5. 4 0
      zkqy-business/src/main/java/com/zkqy/business/mapper/DragFormMapper.java
  6. 6 1
      zkqy-business/src/main/java/com/zkqy/business/service/IDragFormService.java
  7. 6 2
      zkqy-business/src/main/java/com/zkqy/business/service/impl/DragFormServiceImpl.java
  8. 82 54
      zkqy-business/src/main/resources/mapper/dragmapper/DragFormMapper.xml
  9. 25 17
      zkqy-business/src/main/resources/mapper/dragmapper/DragTableBtnMapper.xml
  10. 9 0
      zkqy-common/src/main/java/com/zkqy/common/utils/bpm/XmlDataParserUtils.java
  11. 105 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/controller/BpmApprovalStatusController.java
  12. 28 1
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/controller/BpmRunController.java
  13. 112 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/entity/BpmApprovalStatus.java
  14. 29 2
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/entity/runbpm/BpmRunNodeVo.java
  15. 70 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/mapper/BpmApprovalStatusMapper.java
  16. 242 7
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/runbpm/PreExecutionToolClass.java
  17. 62 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/IBpmApprovalStatusService.java
  18. 94 0
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/BpmApprovalStatusServiceImpl.java
  19. 1 1
      zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/impl/CommonServiceImpl.java
  20. 79 0
      zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmApprovalStatusMapper.xml
  21. 5 6
      zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteProcessMapper.xml

+ 4 - 0
zkqy-admin/pom.xml

@@ -69,6 +69,10 @@
             <version>2.10.1</version>
             <scope>compile</scope>
         </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
 
     </dependencies>
 

+ 47 - 0
zkqy-admin/src/main/java/com/zkqy/web/ljj.java

@@ -0,0 +1,47 @@
+package com.zkqy.web;
+
+import com.zkqy.common.annotation.Anonymous;
+import org.junit.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.concurrent.CompletableFuture;
+
+
+@Anonymous
+@RestController
+@RequestMapping("/test")
+public class ljj {
+    @Autowired
+    private ThreadPoolTaskExecutor threadPoolTaskExecutor;
+
+    @GetMapping("/asd")
+    public void main11() {
+        // 多线程调用
+        for (int i = 0; i < 1000000; i++) {
+            int finalI = i;
+            CompletableFuture.runAsync(() -> {
+                System.err.println(hashCode(finalI) + "线程ID:" + Thread.currentThread().getId() + "线程NAME:" + Thread.currentThread().getName());
+            }, threadPoolTaskExecutor).exceptionally(e -> {
+                System.out.println(e);
+                return null;
+            });
+        }
+    }
+
+    public int hashCode(int i) {
+        if (i % 3 == 0) {
+            System.out.println("🚀🚀🚀🚀🚀");
+            new Exception();
+            return 999;
+
+        } else {
+            return i;
+        }
+    }
+
+
+}

+ 56 - 36
zkqy-business/src/main/java/com/zkqy/business/controller/CommonBtnController.java

@@ -17,6 +17,7 @@ import com.zkqy.execution.produce.dispersed.runbpm.RunImplementationClass;
 import com.zkqy.execution.produce.dispersed.service.ICommonService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
+
 import javax.annotation.Resource;
 import java.util.HashMap;
 import java.util.Map;
@@ -62,6 +63,11 @@ public class CommonBtnController extends BaseController {
     public AjaxResult commonBtnHandle(@RequestBody CommonEntity commonEntity) throws JsonProcessingException {
         // 获取到按钮类型
         String btnType = commonEntity.getBasicMap().get("btnType").toString();
+        //查询当前按钮详情
+        DragTableBtn dragTableBtn = new DragTableBtn();
+        if (commonEntity.getBasicMap().get("btnKey") != null && !commonEntity.getBasicMap().get("btnKey").toString().isEmpty()) {
+            dragTableBtn = iDragTableBtnService.selectDragTableBtnByBtnKey(commonEntity.getBasicMap().get("btnKey").toString());
+        }
         /**
          * 发起流程类型(需要特定参数),
          * 启动脚本类型(执行特定脚本无需传递参数)
@@ -70,13 +76,13 @@ public class CommonBtnController extends BaseController {
             case "INSERT":
                 return insertBtn(commonEntity);
             case "UPDATE":
-                return updateBtn(commonEntity);
+                return updateBtn(commonEntity, dragTableBtn);
             case "DELETE":
                 return deleteBtn(commonEntity);
             case "EXECUTE":  // 执行脚本
-                return executeBtn(commonEntity);
+                return executeBtn(commonEntity, dragTableBtn);
             case "INITIATED":  // 发起流程
-                return initiatedBtn(commonEntity);
+                return initiatedBtn(commonEntity, dragTableBtn);
             default:
                 return warn("暂不支持该操作!");
         }
@@ -106,12 +112,10 @@ public class CommonBtnController extends BaseController {
      * @param commonEntity
      * @return
      */
-    public AjaxResult updateBtn(CommonEntity commonEntity) throws JsonProcessingException {
+    public AjaxResult updateBtn(CommonEntity commonEntity, DragTableBtn dragTableBtn) throws JsonProcessingException {
         //是否开启弹窗
         if (commonEntity.getBasicMap().get("visible").toString().equals("true")) {
             if (commonEntity.getBasicMap().containsKey("btnKey")) {  // 按钮提交时会触发别的操作
-                // 根据按钮别名查询按钮详细信息
-                DragTableBtn dragTableBtn = iDragTableBtnService.selectDragTableBtnByBtnKey(commonEntity.getBasicMap().get("btnKey").toString());
                 // 根据流程的key判断当前按钮是否执行触发流程
                 if (!dragTableBtn.getBtnProcessKey().isEmpty()) {
                     // 调用发起流程接口
@@ -123,7 +127,7 @@ public class CommonBtnController extends BaseController {
                 } else if (!dragTableBtn.getBtnScriptKey().isEmpty()) {
                     // 调用执行脚本接口
                     logger.info("执行脚本接口");
-                     fromUtils.triggerScript(commonEntity);
+                    fromUtils.triggerScript(commonEntity);
                     //IScriptEntity iScriptEntity = new IScriptEntity();
                     //iScriptEntity.setScriptFlowKey(commonEntity.toString()); // 脚本别名
                     //irunImplementationClass.RunScriptImplementationClassLogicCode(iScriptEntity,commonEntity.toString());
@@ -146,6 +150,7 @@ public class CommonBtnController extends BaseController {
 
     /**
      * 删除类型按钮
+     *
      * @param commonEntity
      * @return
      */
@@ -159,15 +164,11 @@ public class CommonBtnController extends BaseController {
      * @param commonEntity
      * @return
      */
-    public AjaxResult executeBtn(CommonEntity commonEntity) throws JsonProcessingException {
+    public AjaxResult executeBtn(CommonEntity commonEntity, DragTableBtn dragTableBtn) throws JsonProcessingException {
         if (commonEntity.getBasicMap().get("visible").toString().equals("true")) {
-            if (commonEntity.getBasicMap().containsKey("btnKey")) {  // 按钮提交时会触发别的操作
-                // 根据按钮别名查询按钮详细信息
-                DragTableBtn dragTableBtn = iDragTableBtnService.selectDragTableBtnByBtnKey(commonEntity.getBasicMap().get("btnKey").toString());
-                if (!dragTableBtn.getBtnScriptKey().isEmpty()) {
-                    // 调用执行脚本接口
-                    fromUtils.triggerScript(commonEntity);
-                }
+            if (!dragTableBtn.getBtnScriptKey().isEmpty()) {
+                // 调用执行脚本接口
+                fromUtils.triggerScript(commonEntity);
             }
             commonService.edit(commonEntity);
             return AjaxResult.success("执行脚本成功!");
@@ -189,39 +190,58 @@ public class CommonBtnController extends BaseController {
      * @param commonEntity
      * @return
      */
-    public AjaxResult initiatedBtn(CommonEntity commonEntity) throws JsonProcessingException {
+    public AjaxResult initiatedBtn(CommonEntity commonEntity, DragTableBtn dragTableBtn) throws JsonProcessingException {
         //是否开启弹窗
         if (commonEntity.getBasicMap().get("visible").toString().equals("true")) {
-            if (commonEntity.getBasicMap().containsKey("btnKey")) {  // 按钮提交时会触发别的操作
-                // 根据按钮别名查询按钮详细信息
-                DragTableBtn dragTableBtn = iDragTableBtnService.selectDragTableBtnByBtnKey(commonEntity.getBasicMap().get("btnKey").toString());
-                // 根据流程的key判断当前按钮是否执行触发流程
-                if (!dragTableBtn.getBtnProcessKey().isEmpty()) {
-                    //  表示对当前操作是及时选择的流程模板
-                    if (dragTableBtn.getBtnProcessKey().equals("unknown")) {
-                        // 调用发起流程接口
-                        //fromUtils.runBpmProductionScheduling(commonEntity);
-                        ipreExecutionToolClass.ReadyToExecute(commonEntity);
-                    } else {
-                        // 执行当前按钮绑定的流程-》暂无直接执行流程
+            // 根据流程的key判断当前按钮是否执行触发流程
+            if (!dragTableBtn.getBtnProcessKey().isEmpty()) {
+                //  表示对当前操作是及时选择的流程模板
+                if (dragTableBtn.getBtnProcessKey() != null && !dragTableBtn.getBtnProcessKey().isEmpty()) {
+                    if (commonEntity.getCommMap().get("process_key") == null) {
+                        commonEntity.getCommMap().put("process_key", dragTableBtn.getBtnProcessKey());
                     }
+                    // 调用发起流程接口
+                    ipreExecutionToolClass.ReadyToExecute(commonEntity);
+                } else {
+                    // 执行当前按钮绑定的流程-》暂无直接执行流程
                 }
             }
             toAjax(commonService.edit(commonEntity));
             return AjaxResult.success("启动流程成功!");
         } else if (commonEntity.getBasicMap().get("visible").toString().equals("false")) {
             Map<String, Object> map = new HashMap<>();
-            // 单纯是表格还是弹窗里有表格
-            String sqlKey = commonEntity.getBasicMap().get("sqlKey").toString();
-            DragForm dragForm = dragFormService.selectDragFormBySqlKey(sqlKey);
-            map.put("template", dragForm);
-            // 返回结果
-            map.put("result", commonService.getInfoById(commonEntity));
-            return success(map);
+            DragForm dragForm;
+            // 如果当前按钮绑定了表单则
+            // 判断当前表单的类型
+            if (dragTableBtn.getBtnFormType().equals("single")) {  // 单个表单
+                // 目前只是单个表单的模版
+                dragForm = dragFormService.selectDragFormByformKey(dragTableBtn.getBtnFormKey());
+                // 查询当前表的条件
+                CommonEntity commonEntity1 = new CommonEntity();
+                commonEntity1.getBasicMap().put("tableName", dragForm.getDfTableName());
+                commonEntity1.getConditionMap().putAll(commonEntity.getConditionMap());
+                // 返回结果
+                map.put("result", commonService.getInfoById(commonEntity1));
+                map.put("template", dragForm);
+                // 展示当前按钮绑定的表单
+                return success(map);
+            } else if (dragTableBtn.getBtnFormType().equals("multiple")) {  // 多个表单
+
+            } else if (dragTableBtn.getBtnFormType().equals("other")) {// 其他表单
+
+            } else {
+                // 单纯是表格还是弹窗里有表格
+                String sqlKey = commonEntity.getBasicMap().get("sqlKey").toString();
+                dragForm = dragFormService.selectDragFormBySqlKey(sqlKey);
+                map.put("template", dragForm);
+                // 返回结果
+                map.put("result", commonService.getInfoById(commonEntity));
+                return success(map);
+            }
         } else {
-            // return warn("暂不支持该操作!");
             return AjaxResult.error("发起流程失败!");
         }
+        return AjaxResult.error("发起流程失败!");
     }
 
 

+ 95 - 50
zkqy-business/src/main/java/com/zkqy/business/entity/DragTableBtn.java

@@ -9,70 +9,112 @@ import java.util.List;
 
 /**
  * 格绑定的自定义按钮对象 drag_table_btn
- * 
+ *
  * @author ruoyi
  * @date 2023-11-07
  */
-public class DragTableBtn extends BaseEntity
-{
+public class DragTableBtn extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
-    /** 主键 */
+    /**
+     * 主键
+     */
     private Long id;
 
-    /** 父级ID */
+    /**
+     * 父级ID
+     */
     private Long btnParentId;
 
-    /** 祖籍列表 */
+    /**
+     * 祖籍列表
+     */
     private String ancestorsId;
 
-    /** 按钮别名 */
+    /**
+     * 按钮别名
+     */
     private String btnKey;
 
-    /** 按钮组名称 */
+    /**
+     * 按钮组名称
+     */
     private String btnGroupName;
 
-    /** 按钮名称 */
+    /**
+     * 按钮名称
+     */
     private String btnName;
 
-    /** 按钮类型(0:操作按钮,1,其他,2表单,3跳转,4流程,5脚本,6目录) */
+    /**
+     * 按钮类型(0:操作按钮,1,其他,2表单,3跳转,4流程,5脚本,6目录)
+     */
     private String btnType;
 
-    /** 按钮图标 */
+    /**
+     * 按钮图标
+     */
     private String btnIcon;
 
-    /** 表单唯一标识 */
+    /**
+     * 表单唯一标识
+     */
     private String btnFormKey;
 
-    /** 流程唯一标识 */
+    /**
+     * 表单唯一标识
+     */
+    private String btnFormType;
+
+    /**
+     * 流程唯一标识
+     */
     private String btnProcessKey;
 
-    /** 表格唯一标识 */
+    /**
+     * 表格唯一标识
+     */
     private String btnTableKey;
 
-    /** 脚本唯一标识 */
+    /**
+     * 脚本唯一标识
+     */
     private String btnScriptKey;
 
-    /** 弹窗表格唯一标识 */
+    /**
+     * 弹窗表格唯一标识
+     */
     private String btnTableFormGroupKey;
 
-    /** 按钮显示条件 */
+    /**
+     * 按钮显示条件
+     */
     private String btnShowCondition;
 
-    /** 操作参数 */
+    /**
+     * 操作参数
+     */
     private String btnParams;
 
-    /** 权限字符 */
+    /**
+     * 权限字符
+     */
     private String btnHasPermi;
 
-    /** 按钮顺序 */
+    /**
+     * 按钮顺序
+     */
     private Long btnSort;
 
-    /** 删除标志(0:否;1:是) */
+    /**
+     * 删除标志(0:否;1:是)
+     */
     private String delFlag;
 
 
-    /** 子菜单 */
+    /**
+     * 子菜单
+     */
     private List<DragTableBtn> children = new ArrayList<DragTableBtn>();
 
     public Long getId() {
@@ -204,7 +246,6 @@ public class DragTableBtn extends BaseEntity
     }
 
 
-
     public List<DragTableBtn> getChildren() {
         return children;
     }
@@ -229,34 +270,38 @@ public class DragTableBtn extends BaseEntity
         this.btnTableFormGroupKey = btnTableFormGroupKey;
     }
 
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("btnParentId", getBtnParentId())
-            .append("ancestorsId",getAncestorsId())
-            .append("btnKey", getBtnKey())
-            .append("btnName", getBtnName())
-            .append("btnType", getBtnType())
-            .append("btnFormKey", getBtnFormKey())
-            .append("btnProcessKey", getBtnProcessKey())
-            .append("btnTableKey", getBtnTableKey())
-            .append("btnScriptKey", getBtnScriptKey())
-            .append("btnShowCondition", getBtnShowCondition())
-            .append("btnParams", getBtnParams())
-            .append("btnHasPermi", getBtnHasPermi())
-            .append("btnSort", getBtnSort())
-            .append("delFlag", getDelFlag())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .append("remark", getRemark())
-            .append("children",getChildren())
-            .append("btnGroupName",getBtnGroupName())
-            .append("btnIcon",getBtnIcon())
-            .toString();
+    public String getBtnFormType() {
+        return btnFormType;
     }
 
+    public void setBtnFormType(String btnFormType) {
+        this.btnFormType = btnFormType;
+    }
 
+    @Override
+    public String toString() {
+        final StringBuilder sb = new StringBuilder("DragTableBtn{");
+        sb.append("id=").append(id);
+        sb.append(", btnParentId=").append(btnParentId);
+        sb.append(", ancestorsId='").append(ancestorsId).append('\'');
+        sb.append(", btnKey='").append(btnKey).append('\'');
+        sb.append(", btnGroupName='").append(btnGroupName).append('\'');
+        sb.append(", btnName='").append(btnName).append('\'');
+        sb.append(", btnType='").append(btnType).append('\'');
+        sb.append(", btnIcon='").append(btnIcon).append('\'');
+        sb.append(", btnFormKey='").append(btnFormKey).append('\'');
+        sb.append(", btnFormType='").append(btnFormType).append('\'');
+        sb.append(", btnProcessKey='").append(btnProcessKey).append('\'');
+        sb.append(", btnTableKey='").append(btnTableKey).append('\'');
+        sb.append(", btnScriptKey='").append(btnScriptKey).append('\'');
+        sb.append(", btnTableFormGroupKey='").append(btnTableFormGroupKey).append('\'');
+        sb.append(", btnShowCondition='").append(btnShowCondition).append('\'');
+        sb.append(", btnParams='").append(btnParams).append('\'');
+        sb.append(", btnHasPermi='").append(btnHasPermi).append('\'');
+        sb.append(", btnSort=").append(btnSort);
+        sb.append(", delFlag='").append(delFlag).append('\'');
+        sb.append(", children=").append(children);
+        sb.append('}');
+        return sb.toString();
+    }
 }

+ 4 - 0
zkqy-business/src/main/java/com/zkqy/business/mapper/DragFormMapper.java

@@ -72,6 +72,10 @@ public interface DragFormMapper {
     DragForm selectDragFormBySqlKey(String sqlKey);
 
 
+    /**
+     * 根据formKey查询动态表单
+     */
+    DragForm selectDragFormByFormKey(String formKey);
     /**
      * 查询新增表单编号
      */

+ 6 - 1
zkqy-business/src/main/java/com/zkqy/business/service/IDragFormService.java

@@ -1,9 +1,9 @@
 package com.zkqy.business.service;
 
 
-
 import com.zkqy.common.core.domain.AjaxResult;
 import com.zkqy.business.entity.DragForm;
+
 import java.util.List;
 
 /**
@@ -72,4 +72,9 @@ public interface IDragFormService {
      * 根据sqlKey查询动态表单
      */
     DragForm selectDragFormBySqlKey(String sqlKey);
+
+    /**
+     * 根据formKey查询动态表单
+     */
+    DragForm selectDragFormByformKey(String formKey);
 }

+ 6 - 2
zkqy-business/src/main/java/com/zkqy/business/service/impl/DragFormServiceImpl.java

@@ -128,7 +128,7 @@ public class DragFormServiceImpl implements IDragFormService {
         for (Long fId : fIds) {
             delFileForm(fId);
             //删除表单表格关联表
-            if(StringUtils.isNotNull(dragTableFormMapper.selectDragTableForm(fId))){
+            if (StringUtils.isNotNull(dragTableFormMapper.selectDragTableForm(fId))) {
                 dragTableFormMapper.deleteDragTableFormByDfId(fId);
             }
         }
@@ -156,6 +156,11 @@ public class DragFormServiceImpl implements IDragFormService {
         return queryFormSelect(dragForm);
     }
 
+    @Override
+    public DragForm selectDragFormByformKey(String formKey) {
+        return queryFormSelect(dragFormMapper.selectDragFormByFormKey(formKey));
+    }
+
     /**
      * 查询当前表单的详细信息-》中前表单中所包含的下拉框
      */
@@ -184,7 +189,6 @@ public class DragFormServiceImpl implements IDragFormService {
     }
 
 
-
     /**
      * 删除表单源文件
      *

+ 82 - 54
zkqy-business/src/main/resources/mapper/dragmapper/DragFormMapper.xml

@@ -1,35 +1,55 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!DOCTYPE mapper
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.zkqy.business.mapper.DragFormMapper">
-    
+
     <resultMap type="com.zkqy.business.entity.DragForm" id="DragFormResult">
-        <result property="fId"    column="f_id"    />
+        <result property="fId" column="f_id"/>
         <result property="formKey" column="form_key"/>
         <result property="sqlKey" column="sql_key"/>
-        <result property="dfName"    column="df_name"    />
-        <result property="dfNickname"    column="df_nickname"    />
-        <result property="dfVueTemplate"    column="df_vue_template"    />
-        <result property="dfHtmlTemplate"    column="df_html_template"    />
-        <result property="dfFormSql"    column="df_form_sql"    />
-        <result property="dfNodeId"    column="df_node_id"    />
-        <result property="dfDatabase"    column="df_database"    />
-        <result property="dfTableName"    column="df_table_name"    />
-        <result property="dfFliePath"    column="df_flie_path"    />
-        <result property="dfNotes"    column="df_notes"    />
-        <result property="delFlag"    column="del_flag"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-        <result property="spare"    column="spare"    />
-        <result property="spare1"    column="spare1"    />
+        <result property="dfName" column="df_name"/>
+        <result property="dfNickname" column="df_nickname"/>
+        <result property="dfVueTemplate" column="df_vue_template"/>
+        <result property="dfHtmlTemplate" column="df_html_template"/>
+        <result property="dfFormSql" column="df_form_sql"/>
+        <result property="dfNodeId" column="df_node_id"/>
+        <result property="dfDatabase" column="df_database"/>
+        <result property="dfTableName" column="df_table_name"/>
+        <result property="dfFliePath" column="df_flie_path"/>
+        <result property="dfNotes" column="df_notes"/>
+        <result property="delFlag" column="del_flag"/>
+        <result property="createTime" column="create_time"/>
+        <result property="createBy" column="create_by"/>
+        <result property="updateBy" column="update_by"/>
+        <result property="updateTime" column="update_time"/>
+        <result property="spare" column="spare"/>
+        <result property="spare1" column="spare1"/>
         <result property="dtId" column="dt_id"/>
     </resultMap>
 
     <sql id="selectDragFormVo">
-        select f_id,form_key,sql_key, df_name, df_nickname, df_vue_template, df_html_template, df_form_sql, df_node_id, df_database, df_table_name, df_flie_path, df_notes, del_flag, create_time, create_by, update_by, update_time, spare, spare1 from {DBNAME}.drag_form
+        select f_id,
+               form_key,
+               sql_key,
+               df_name,
+               df_nickname,
+               df_vue_template,
+               df_html_template,
+               df_form_sql,
+               df_node_id,
+               df_database,
+               df_table_name,
+               df_flie_path,
+               df_notes,
+               del_flag,
+               create_time,
+               create_by,
+               update_by,
+               update_time,
+               spare,
+               spare1
+        from {DBNAME}.drag_form
     </sql>
 
     <select id="selectDragFormList" parameterType="com.zkqy.business.entity.DragForm" resultMap="DragFormResult">
@@ -54,35 +74,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
         order by create_time desc
     </select>
-    
+
     <select id="selectDragFormByFId" parameterType="Long" resultMap="DragFormResult">
-        select
-            d.f_id,
-            d.form_key,
-            d.sql_key,
-            d.df_name,
-            d.df_nickname,
-            d.df_vue_template,
-            d.df_html_template,
-            d.df_form_sql,
-            d.df_node_id,
-            d.df_database,
-            d.df_table_name,
-            d.df_flie_path,
-            d.df_notes,
-            d.del_flag,
-            d.create_time,
-            d.create_by,
-            d.update_by,
-            d.update_time,
-            d.spare,
-            d.spare1,
-            dtf.dt_id from drag_form d
-                LEFT JOIN drag_table_form dtf ON d.f_id = dtf.df_id
+        select d.f_id,
+               d.form_key,
+               d.sql_key,
+               d.df_name,
+               d.df_nickname,
+               d.df_vue_template,
+               d.df_html_template,
+               d.df_form_sql,
+               d.df_node_id,
+               d.df_database,
+               d.df_table_name,
+               d.df_flie_path,
+               d.df_notes,
+               d.del_flag,
+               d.create_time,
+               d.create_by,
+               d.update_by,
+               d.update_time,
+               d.spare,
+               d.spare1,
+               dtf.dt_id
+        from drag_form d
+                 LEFT JOIN drag_table_form dtf ON d.f_id = dtf.df_id
         where d.f_id = #{fId}
     </select>
-        
-    <insert id="insertDragForm" parameterType="com.zkqy.business.entity.DragForm" useGeneratedKeys="true" keyProperty="fId">
+
+    <insert id="insertDragForm" parameterType="com.zkqy.business.entity.DragForm" useGeneratedKeys="true"
+            keyProperty="fId">
         insert into drag_form
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="formKey != null">form_key,</if>
@@ -103,7 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createBy != null">create_by,</if>
             <if test="spare != null">spare,</if>
             <if test="spare1 != null">spare1,</if>
-         </trim>
+        </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="formKey != null">#{formKey},</if>
             <if test="sqlKey != null">#{sqlKey},</if>
@@ -123,7 +144,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="createBy != null">#{createBy},</if>
             <if test="spare != null">#{spare},</if>
             <if test="spare1 != null">#{spare1},</if>
-         </trim>
+        </trim>
     </insert>
 
     <update id="updateDragForm" parameterType="com.zkqy.business.entity.DragForm">
@@ -153,13 +174,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <delete id="deleteDragFormByFId" parameterType="Long">
         update drag_form
-        set del_flag = 1
+        set del_flag = 2
         where f_id = #{fId}
     </delete>
 
     <delete id="deleteDragFormByFIds" parameterType="String">
         update drag_form
-        set del_flag = 1 where f_id in
+        set del_flag = 2 where f_id in
         <foreach item="fId" collection="array" open="(" separator="," close=")">
             #{fId}
         </foreach>
@@ -167,10 +188,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectDragFormBySqlKey" resultMap="DragFormResult">
         <include refid="selectDragFormVo"/>
-        where sql_key = #{sqlKey}
+        where sql_key = #{sqlKey} and del_flag = 0
+    </select>
+
+    <select id="selectDragFormByFormKey" resultMap="DragFormResult">
+        <include refid="selectDragFormVo"/>
+        where form_key = #{formKey} and del_flag = 0
     </select>
 
     <select id="selectDragFormFId" resultType="int">
-        select f_id from drag_form ORDER BY f_id desc LIMIT 1
+        select f_id
+        from drag_form
+        ORDER BY f_id desc LIMIT 1
     </select>
 </mapper>

+ 25 - 17
zkqy-business/src/main/resources/mapper/dragmapper/DragTableBtnMapper.xml

@@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="btnType"    column="btn_type"    />
         <result property="btnIcon" column="btn_icon"/>
         <result property="btnFormKey"    column="btn_form_key"    />
+        <result property="btnFormType"    column="btn_form_type"    />
         <result property="btnProcessKey"    column="btn_process_key"    />
         <result property="btnTableKey"    column="btn_table_key"    />
         <result property="btnScriptKey"    column="btn_script_key"    />
@@ -32,28 +33,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectDragTableBtnVo">
-        select id, btn_parent_id,ancestors_id, btn_key,btn_group_name, btn_name, btn_type,btn_icon, btn_form_key, btn_process_key, btn_table_key, btn_script_key, btn_show_condition, btn_params, btn_has_permi, btn_sort, del_flag, create_by, create_by_id, create_time, update_by, update_by_id, update_time, remark from {DBNAME}.drag_table_btn
+        select id, btn_parent_id,ancestors_id, btn_key,btn_group_name, btn_name, btn_type,btn_icon, btn_form_key,btn_form_type, btn_process_key, btn_table_key, btn_script_key, btn_show_condition, btn_params, btn_has_permi, btn_sort, del_flag, create_by, create_by_id, create_time, update_by, update_by_id, update_time, remark from {DBNAME}.drag_table_btn
     </sql>
 
     <select id="selectDragTableBtnList" parameterType="com.zkqy.business.entity.DragTableBtn" resultMap="DragTableBtnResult">
         <include refid="selectDragTableBtnVo"/>
         where del_flag = '0'
-            <if test="btnParentId != null "> and btn_parent_id = #{btnParentId}</if>
-            <if test="btnKey != null  and btnKey != ''"> and btn_key = #{btnKey}</if>
-            <if test="btnGroupName != null  and btnGroupName != ''"> and btn_group_name like concat('%', #{btnGroupName}, '%')</if>
-            <if test="btnName != null  and btnName != ''"> and btn_name like concat('%', #{btnName}, '%')</if>
-            <if test="btnType != null  and btnType != ''"> and btn_type = #{btnType}</if>
-            <if test="btnFormKey != null  and btnFormKey != ''"> and btn_form_key = #{btnFormKey}</if>
-            <if test="btnProcessKey != null  and btnProcessKey != ''"> and btn_process_key = #{btnProcessKey}</if>
-            <if test="btnTableKey != null  and btnTableKey != ''"> and btn_table_key = #{btnTableKey}</if>
-            <if test="btnScriptKey != null  and btnScriptKey != ''"> and btn_script_key = #{btnScriptKey}</if>
-            <if test="btnShowCondition != null  and btnShowCondition != ''"> and btn_show_condition = #{btnShowCondition}</if>
-            <if test="btnParams != null  and btnParams != ''"> and btn_params = #{btnParams}</if>
-            <if test="btnHasPermi != null  and btnHasPermi != ''"> and btn_has_permi = #{btnHasPermi}</if>
-            <if test="btnSort != null "> and btn_sort = #{btnSort}</if>
-            <if test="createById != null "> and create_by_id = #{createById}</if>
-            <if test="updateById != null "> and update_by_id = #{updateById}</if>
-             order by btn_sort asc
+        <if test="btnParentId != null ">and btn_parent_id = #{btnParentId}</if>
+        <if test="btnKey != null  and btnKey != ''">and btn_key = #{btnKey}</if>
+        <if test="btnGroupName != null  and btnGroupName != ''">and btn_group_name like concat('%', #{btnGroupName},
+            '%')
+        </if>
+        <if test="btnName != null  and btnName != ''">and btn_name like concat('%', #{btnName}, '%')</if>
+        <if test="btnType != null  and btnType != ''">and btn_type = #{btnType}</if>
+        <if test="btnFormKey != null  and btnFormKey != ''">and btn_form_key = #{btnFormKey}</if>
+        <if test="btnFormType != null  and btnFormType != ''">and btn_form_type = #{btnFormType}</if>
+        <if test="btnProcessKey != null  and btnProcessKey != ''">and btn_process_key = #{btnProcessKey}</if>
+        <if test="btnTableKey != null  and btnTableKey != ''">and btn_table_key = #{btnTableKey}</if>
+        <if test="btnScriptKey != null  and btnScriptKey != ''">and btn_script_key = #{btnScriptKey}</if>
+        <if test="btnShowCondition != null  and btnShowCondition != ''">and btn_show_condition = #{btnShowCondition}
+        </if>
+        <if test="btnParams != null  and btnParams != ''">and btn_params = #{btnParams}</if>
+        <if test="btnHasPermi != null  and btnHasPermi != ''">and btn_has_permi = #{btnHasPermi}</if>
+        <if test="btnSort != null ">and btn_sort = #{btnSort}</if>
+        <if test="createById != null ">and create_by_id = #{createById}</if>
+        <if test="updateById != null ">and update_by_id = #{updateById}</if>
+        order by btn_sort asc
     </select>
     
     <select id="selectDragTableBtnById" parameterType="Long" resultMap="DragTableBtnResult">
@@ -72,6 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="btnType != null">btn_type,</if>
             <if test="btnIcon != null">btn_icon,</if>
             <if test="btnFormKey != null">btn_form_key,</if>
+            <if test="btnFormType != null">btn_form_type,</if>
             <if test="btnProcessKey != null">btn_process_key,</if>
             <if test="btnTableKey != null">btn_table_key,</if>
             <if test="btnScriptKey != null">btn_script_key,</if>
@@ -94,6 +100,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="btnType != null">#{btnType},</if>
             <if test="btnIcon != null">#{btnIcon},</if>
             <if test="btnFormKey != null">#{btnFormKey},</if>
+            <if test="btnFormType != null">#{btnFormType},</if>
             <if test="btnProcessKey != null">#{btnProcessKey},</if>
             <if test="btnTableKey != null">#{btnTableKey},</if>
             <if test="btnScriptKey != null">#{btnScriptKey},</if>
@@ -120,6 +127,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="btnType != null">btn_type = #{btnType},</if>
             <if test="btnIcon != null">btn_icon = #{btnIcon},</if>
             <if test="btnFormKey != null">btn_form_key = #{btnFormKey},</if>
+            <if test="btnFormType != null">btn_form_type = #{btnFormType},</if>
             <if test="btnProcessKey != null">btn_process_key = #{btnProcessKey},</if>
             <if test="btnTableKey != null">btn_table_key = #{btnTableKey},</if>
             <if test="btnScriptKey != null">btn_script_key = #{btnScriptKey},</if>

+ 9 - 0
zkqy-common/src/main/java/com/zkqy/common/utils/bpm/XmlDataParserUtils.java

@@ -308,4 +308,13 @@ public class XmlDataParserUtils {
         return null;
     }
 
+
+    public static String getNodeType(String xmlData, String nodeKey) {
+        //将xml文件内容转成Document对象
+        Document document = XmlUtil.parseXml(xmlData);
+        Element nodeinfo = getElement(document, nodeKey, "id");
+        // 返回当前节点类型
+        return nodeinfo.getLocalName();
+    }
+
 }

+ 105 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/controller/BpmApprovalStatusController.java

@@ -0,0 +1,105 @@
+package com.zkqy.execution.produce.dispersed.controller;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+
+import com.zkqy.common.utils.poi.ExcelUtil;
+import com.zkqy.execution.produce.dispersed.entity.BpmApprovalStatus;
+import com.zkqy.execution.produce.dispersed.service.IBpmApprovalStatusService;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.zkqy.common.annotation.Log;
+import com.zkqy.common.core.controller.BaseController;
+import com.zkqy.common.core.domain.AjaxResult;
+import com.zkqy.common.enums.BusinessType;
+import com.zkqy.common.core.page.TableDataInfo;
+
+/**
+ * 审批数据条中间Controller
+ *
+ * @author hzh
+ * @date 2024-01-31
+ */
+@RestController
+@RequestMapping("/system/approvalStatus")
+public class BpmApprovalStatusController extends BaseController
+{
+    @Autowired
+    private IBpmApprovalStatusService bpmApprovalStatusService;
+
+/**
+ * 查询审批数据条中间列表
+ */
+@PreAuthorize("@ss.hasPermi('system:approvalStatus:list')")
+@GetMapping("/list")
+    public TableDataInfo list(BpmApprovalStatus bpmApprovalStatus)
+    {
+        startPage();
+        List<BpmApprovalStatus> list = bpmApprovalStatusService.selectBpmApprovalStatusList(bpmApprovalStatus);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出审批数据条中间列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:approvalStatus:export')")
+    @Log(title = "审批数据条中间", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, BpmApprovalStatus bpmApprovalStatus)
+    {
+        List<BpmApprovalStatus> list = bpmApprovalStatusService.selectBpmApprovalStatusList(bpmApprovalStatus);
+        ExcelUtil<BpmApprovalStatus> util = new ExcelUtil<BpmApprovalStatus>(BpmApprovalStatus.class);
+        util.exportExcel(response, list, "审批数据条中间数据");
+    }
+
+    /**
+     * 获取审批数据条中间详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:approvalStatus:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(bpmApprovalStatusService.selectBpmApprovalStatusById(id));
+    }
+
+    /**
+     * 新增审批数据条中间
+     */
+    @PreAuthorize("@ss.hasPermi('system:approvalStatus:add')")
+    @Log(title = "审批数据条中间", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody BpmApprovalStatus bpmApprovalStatus)
+    {
+        return toAjax(bpmApprovalStatusService.insertBpmApprovalStatus(bpmApprovalStatus));
+    }
+
+    /**
+     * 修改审批数据条中间
+     */
+    @PreAuthorize("@ss.hasPermi('system:approvalStatus:edit')")
+    @Log(title = "审批数据条中间", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody BpmApprovalStatus bpmApprovalStatus)
+    {
+        return toAjax(bpmApprovalStatusService.updateBpmApprovalStatus(bpmApprovalStatus));
+    }
+
+    /**
+     * 删除审批数据条中间
+     */
+    @PreAuthorize("@ss.hasPermi('system:approvalStatus:remove')")
+    @Log(title = "审批数据条中间", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(bpmApprovalStatusService.deleteBpmApprovalStatusByIds(ids));
+    }
+}

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

@@ -48,7 +48,7 @@ public class BpmRunController extends BaseController {
     }
 
     /**
-     * 共通执行节点接口
+     * 共通执行节点接口 工业离散型
      */
     @Log(title = "执行流程节点", businessType = BusinessType.INSERT)
     @PostMapping("/processNodeExecution")
@@ -66,6 +66,25 @@ public class BpmRunController extends BaseController {
         return AjaxResult.success(ipreExecutionToolClass.executionNode(bpmRunNodeVo));
     }
 
+    /**
+     * 共通执行节点接口 审批类型
+     */
+    @Log(title = "执行流程节点", businessType = BusinessType.INSERT)
+    @PostMapping("/processNodeExecutionApproval")
+    public AjaxResult processNodeExecutionApproval(BpmRunNodeVo bpmRunNodeVo, @RequestParam("fileXML") MultipartFile fileXML) {
+        if (!fileXML.isEmpty()) {
+            try {
+                // 解析得到当前文件中的内容
+                byte[] bytes = fileXML.getBytes();
+                String xmlContent = new String(bytes);
+                bpmRunNodeVo.setTaskProcessXmlContent(xmlContent);
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        }
+        return AjaxResult.success(ipreExecutionToolClass.approvalNode(bpmRunNodeVo));
+    }
+
 
     /**
      * 共通执行节点表单回显数据接口
@@ -75,6 +94,14 @@ public class BpmRunController extends BaseController {
         return AjaxResult.success(ipreExecutionToolClass.processNodeFormInfoData(bpmRunNodeFromVo));
     }
 
+    /**
+     * 共通执行节点表单回显数据接口
+     */
+    @GetMapping("/processNodeFormTemplate")
+    public AjaxResult processNodeFormTemplate (BpmRunNodeFromVo bpmRunNodeFromVo) {
+        return AjaxResult.success(ipreExecutionToolClass.getProcessNodeFormTemplate(bpmRunNodeFromVo));
+    }
+
     /**
      * 处理流程节点表单提交的业务数据
      *

+ 112 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/entity/BpmApprovalStatus.java

@@ -0,0 +1,112 @@
+package com.zkqy.execution.produce.dispersed.entity;
+
+import com.zkqy.common.core.domain.BaseEntity;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.zkqy.common.annotation.Excel;
+
+/**
+ * 审批数据条中间对象 bpm_approval_status
+ *
+ * @author hzh
+ * @date 2024-01-31
+ */
+public class BpmApprovalStatus extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 表名某张表的数据表名
+     */
+    @Excel(name = "表名某张表的数据表名")
+    private String tableName;
+
+    /**
+     * 审批数据条主键
+     */
+    @Excel(name = "审批数据条主键")
+    private String tableId;
+
+    /**
+     * 审批状态 (0:已提交、1:已通过、2:不通过、4:驳回、5:审批中)
+     */
+    @Excel(name = "审批状态 (0:已提交、1:已通过、2:不通过、4:驳回、5:审批中)")
+    private String approvalState;
+
+    /**
+     * 流程任务key
+     */
+    @Excel(name = "流程任务key")
+    private String taskKey;
+
+    public BpmApprovalStatus(String approvalState, String taskKey) {
+        this.approvalState = approvalState;
+        this.taskKey = taskKey;
+    }
+
+    public BpmApprovalStatus() {
+    }
+
+    public BpmApprovalStatus(Long id, String tableName, String tableId, String approvalState, String taskKey) {
+        this.id = id;
+        this.tableName = tableName;
+        this.tableId = tableId;
+        this.approvalState = approvalState;
+        this.taskKey = taskKey;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setTableName(String tableName) {
+        this.tableName = tableName;
+    }
+
+    public String getTableName() {
+        return tableName;
+    }
+
+    public void setTableId(String tableId) {
+        this.tableId = tableId;
+    }
+
+    public String getTableId() {
+        return tableId;
+    }
+
+    public void setApprovalState(String approvalState) {
+        this.approvalState = approvalState;
+    }
+
+    public String getApprovalState() {
+        return approvalState;
+    }
+
+    public void setTaskKey(String taskKey) {
+        this.taskKey = taskKey;
+    }
+
+    public String getTaskKey() {
+        return taskKey;
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+                .append("id", getId())
+                .append("tableName", getTableName())
+                .append("tableId", getTableId())
+                .append("approvalState", getApprovalState())
+                .append("taskKey", getTaskKey())
+                .toString();
+    }
+}

+ 29 - 2
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/entity/runbpm/BpmRunNodeVo.java

@@ -36,6 +36,31 @@ public class BpmRunNodeVo {
     // 节点类型
     private String taskNodeType;
 
+    // 审批状态
+    private String approvalStatus;
+
+    // 审批备注
+    private String approvalRemark;
+
+    public void setFormDataMap(Map<String, Object> formDataMap) {
+        this.formDataMap = formDataMap;
+    }
+
+    public String getApprovalStatus() {
+        return approvalStatus;
+    }
+
+    public void setApprovalStatus(String approvalStatus) {
+        this.approvalStatus = approvalStatus;
+    }
+
+    public String getApprovalRemark() {
+        return approvalRemark;
+    }
+
+    public void setApprovalRemark(String approvalRemark) {
+        this.approvalRemark = approvalRemark;
+    }
 
     public String getTaskNodeType() {
         return taskNodeType;
@@ -110,7 +135,7 @@ public class BpmRunNodeVo {
 
     @Override
     public String toString() {
-        final StringBuffer sb = new StringBuffer("BpmRunNodeVo{");
+        final StringBuilder sb = new StringBuilder("BpmRunNodeVo{");
         sb.append("taskProcessKey='").append(taskProcessKey).append('\'');
         sb.append(", taskNodeKey='").append(taskNodeKey).append('\'');
         sb.append(", nextNodeKey='").append(nextNodeKey).append('\'');
@@ -118,6 +143,9 @@ public class BpmRunNodeVo {
         sb.append(", taskProcessXmlContent='").append(taskProcessXmlContent).append('\'');
         sb.append(", formDataMap=").append(formDataMap);
         sb.append(", tableName='").append(tableName).append('\'');
+        sb.append(", taskNodeType='").append(taskNodeType).append('\'');
+        sb.append(", approvalStatus='").append(approvalStatus).append('\'');
+        sb.append(", approvalRemark='").append(approvalRemark).append('\'');
         sb.append('}');
         return sb.toString();
     }
@@ -126,7 +154,6 @@ public class BpmRunNodeVo {
     }
 
 
-
     public BpmRunNodeVo(String taskProcessKey, String taskNodeKey, String nextNodeKey, String implementationName, String taskProcessXmlContent, Map<String, Object> formDataMap, String tableName, String taskNodeType) {
         this.taskProcessKey = taskProcessKey;
         this.taskNodeKey = taskNodeKey;

+ 70 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/mapper/BpmApprovalStatusMapper.java

@@ -0,0 +1,70 @@
+package com.zkqy.execution.produce.dispersed.mapper;
+
+import com.zkqy.execution.produce.dispersed.entity.BpmApprovalStatus;
+
+import java.util.List;
+
+/**
+ * 审批数据条中间Mapper接口
+ *
+ * @author hzh
+ * @date 2024-01-31
+ */
+public interface BpmApprovalStatusMapper {
+    /**
+     * 查询审批数据条中间
+     *
+     * @param id 审批数据条中间主键
+     * @return 审批数据条中间
+     */
+    public BpmApprovalStatus selectBpmApprovalStatusById(Long id);
+
+    /**
+     * 查询审批数据条中间列表
+     *
+     * @param bpmApprovalStatus 审批数据条中间
+     * @return 审批数据条中间集合
+     */
+    public List<BpmApprovalStatus> selectBpmApprovalStatusList(BpmApprovalStatus bpmApprovalStatus);
+
+    /**
+     * 新增审批数据条中间
+     *
+     * @param bpmApprovalStatus 审批数据条中间
+     * @return 结果
+     */
+    public int insertBpmApprovalStatus(BpmApprovalStatus bpmApprovalStatus);
+
+    /**
+     * 修改审批数据条中间
+     *
+     * @param bpmApprovalStatus 审批数据条中间
+     * @return 结果
+     */
+    public int updateBpmApprovalStatus(BpmApprovalStatus bpmApprovalStatus);
+
+    /**
+     * 删除审批数据条中间
+     *
+     * @param id 审批数据条中间主键
+     * @return 结果
+     */
+    public int deleteBpmApprovalStatusById(Long id);
+
+    /**
+     * 批量删除审批数据条中间
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteBpmApprovalStatusByIds(Long[] ids);
+
+
+    /**
+     * 修改当前审批条状态根据任务key
+     *
+     * @param bpmApprovalStatus
+     * @return
+     */
+    public int updateBpmApprovalStatusByTaskKey(BpmApprovalStatus bpmApprovalStatus);
+}

+ 242 - 7
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/runbpm/PreExecutionToolClass.java

@@ -1,15 +1,22 @@
 package com.zkqy.execution.produce.dispersed.runbpm;
 
 
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONArray;
+import com.alibaba.fastjson2.JSONObject;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.zkqy.common.constant.HttpStatus;
 import com.zkqy.common.core.domain.AjaxResult;
 import com.zkqy.common.utils.DateUtils;
 import com.zkqy.common.utils.SecurityUtils;
+import com.zkqy.common.utils.StringUtils;
 import com.zkqy.common.utils.bpm.XmlDataParserUtils;
 import com.zkqy.common.utils.uuid.IdUtils;
 import com.zkqy.execution.produce.dispersed.entity.*;
 import com.zkqy.execution.produce.dispersed.entity.runbpm.*;
 import com.zkqy.execution.produce.dispersed.mapper.*;
+import com.zkqy.execution.produce.dispersed.service.IBpmApprovalStatusService;
 import com.zkqy.execution.produce.dispersed.service.IBpmExecuteNodeFormService;
 import com.zkqy.execution.produce.dispersed.service.IBpmExecuteNodeLogService;
 import com.zkqy.execution.produce.dispersed.service.IBpmExecuteProcessService;
@@ -71,6 +78,9 @@ public class PreExecutionToolClass<R> {
     @Autowired  // 节点日志
     private IBpmExecuteNodeLogService iBpmExecuteNodeLogService;
 
+    @Autowired  // 审批流程中间表
+    private IBpmApprovalStatusService iBpmApprovalStatusService;
+
     /**
      * 预执行流程自动执行开始节点
      *
@@ -84,13 +94,25 @@ public class PreExecutionToolClass<R> {
         /**
          * 根据流程key校验当前流程数据的完整性,是否可以运行
          */
-         if (!iVerifyExecutionProcess.VerifyProcessData(intoProduction.getTaskProcessKey())) {
-                    return AjaxResult.error(HttpStatus.EXECUTEPROCESS, "流程数据验证失败!");
-         }
+        // if (!iVerifyExecutionProcess.VerifyProcessData(intoProduction.getTaskProcessKey())) {
+        // return AjaxResult.error(HttpStatus.EXECUTEPROCESS, "流程数据验证失败!");
+        // }
         /**1️⃣1️⃣1️⃣ 得到当前投产需要执行的流程详细信息*/
         //--得到当前流程的详细信息
         BpmProcess bpmProcess = bpmProcessMapper.selectBpmProcessByProcessKey(
                 intoProduction.getTaskProcessKey());
+
+        String taskKey = IdUtils.fastSimpleUUID(); // 得到流程的唯一标识
+        if (bpmProcess.getProcessType().toString().equals("1")) { // 当前被发起的流程是审批类型
+            //  发起审批类型的流程逻辑
+            BpmApprovalStatus bpmApprovalStatus = new BpmApprovalStatus();
+            bpmApprovalStatus.setTableName(intoProduction.getTableName());
+            bpmApprovalStatus.setTableId(intoProduction.getGuid());
+            bpmApprovalStatus.setApprovalState("5");// 当前流程发起后更改数据条状态
+            bpmApprovalStatus.setTaskKey(taskKey);
+            // 新增审批关系表
+            iBpmApprovalStatusService.insertBpmApprovalStatus(bpmApprovalStatus);
+        }
         //---根据流程key得到当前流程的所有节点信息
         List<BpmProcessConfiguration> bpmProcessConfigurationList =
                 bpmProcessConfigurationMapper.selectBpmProcessConfigurationList(
@@ -119,7 +141,7 @@ public class PreExecutionToolClass<R> {
         /**2️⃣2️⃣2️⃣ 新增执行流程表数据*/
         BpmExecuteProcess runBpmExecuteProcess = new BpmExecuteProcess();
         // 当前流程启动的唯一标识
-        runBpmExecuteProcess.setTaskKey(IdUtils.fastSimpleUUID());
+        runBpmExecuteProcess.setTaskKey(taskKey);
         // 投产数据条的唯一标识
         runBpmExecuteProcess.setTaskPlanKey(intoProduction.getGuid().split("=")[1]);
         // 当前流程任务名称
@@ -276,6 +298,8 @@ public class PreExecutionToolClass<R> {
                 iBpmExecuteNodeLogService.insertBpmExecuteNodeLog(bpmExecuteNodeLog);
             }
         });
+        // 0L:表示工业类型 1L表示审批类型
+        if (bpmProcess.getProcessType() == 1L) return AjaxResult.success();
         if (optionalStartNode.isPresent()) {
             // optionalStartNode.get().getNodeKey();  当前流程开始节点key
             Optional<BpmUserScriptVo> optionalBpmUserScriptVo = bpmUserScriptVoList.stream().filter(item -> item.getNodeKey().equals(optionalStartNode.get().getNodeKey())).findFirst();
@@ -481,6 +505,122 @@ public class PreExecutionToolClass<R> {
     }
 
 
+    /**
+     * 共通执行节点表单模版接口
+     */
+    public List<Map> getProcessNodeFormTemplate(BpmRunNodeFromVo bpmRunNodeFromVo) {
+        //任务流程key
+        String taskProcessKey = bpmRunNodeFromVo.getTaskProcessKey();
+        //任务节点key
+        String taskNodeKey = bpmRunNodeFromVo.getTaskNodeKey();
+        //脚本名称
+        // String taskScriptKey = bpmRunNodeFromVo.getTaskScriptKey();
+        //根据流程key和节点key查询节点表单关系表【bpm_execute_node_form】
+        BpmExecuteNodeForm bpmExecuteNodeForm = iBpmExecuteNodeFormService.getBpmExecuteNodeForm(taskProcessKey, taskNodeKey, null);
+        //存放返回结果
+        List<Map> mapList = new ArrayList<>();
+        //节点对应的表单信息不能为空
+        if (bpmExecuteNodeForm != null) {
+            String taskNodeFormContent = bpmExecuteNodeForm.getTaskNodeFormContent();
+
+            //拿到当前节点对应的表单类型
+            String taskNodeFormType = bpmExecuteNodeForm.getTaskNodeFormType();
+            if (taskNodeFormType.equals("dragForm")) {
+                HashMap hashMap = new HashMap();
+                //解析存进去的表单信息【task_node_from_content】
+                JSONObject taskNodeFromContentJson = JSONObject.parseObject(taskNodeFormContent);
+                //得到sqlKey
+                String sqlKey = taskNodeFromContentJson.get("sqlKey").toString();
+                //根据sqlKey查询表单数据
+                if (!sqlKey.isEmpty()) {
+                    Map<String, String> tableSqlBySqlKey = executeNodeFormMapper.getTableSqlBySqlKey(sqlKey);
+                    hashMap.put("resultMap", tableSqlBySqlKey);
+                }
+                //得到【df_form_sql】
+                String dfFormSql = taskNodeFromContentJson.get("dfFormSql").toString();
+                ObjectMapper objectMapper = new ObjectMapper();
+                Map<String, Object> sqlMap = null;
+                try {
+                    sqlMap = objectMapper.readValue(dfFormSql, Map.class);
+                    //循环得到每一个sql语句返回结果
+                    for (Map.Entry<String, Object> entry : sqlMap.entrySet()) {
+                        List<Map<String, Object>> resultMap = executeNodeFormMapper.executeSql(entry.getValue().toString());
+                        sqlMap.put(entry.getKey(), resultMap);
+                    }
+                    //把原来的sql语句替换成下拉框数据
+                    taskNodeFromContentJson.put("dfFormSql", JSONObject.toJSONString(sqlMap));
+                } catch (JsonProcessingException e) {
+                    e.printStackTrace();
+                }
+                //表单结构信息
+                hashMap.put("template", taskNodeFromContentJson);
+                //添加到返回集合中
+                mapList.add(hashMap);
+            } else if (taskNodeFormType.equals("dragFormGroup")) { // 当前节点绑定的是表单组类型
+                HashMap hashMap = new HashMap();
+                //解析存进去的表单信息【task_node_from_content】
+                JSONObject taskNodeFromContentJson = JSONObject.parseObject(taskNodeFormContent);
+                //得到sqlKey
+                String sqlKey = taskNodeFromContentJson.get("sqlKey").toString();
+                //根据sqlKey查询表单数据
+                if (!sqlKey.isEmpty()) {
+                    Map<String, String> tableSqlBySqlKey = executeNodeFormMapper.getTableSqlBySqlKey(sqlKey);
+                    hashMap.put("resultMap", tableSqlBySqlKey);
+                }
+                //得到【df_form_sql】
+                String dfFormSql = taskNodeFromContentJson.get("dfFormSql").toString();
+                ObjectMapper objectMapper = new ObjectMapper();
+                Map<String, Object> sqlMap = null;
+                try {
+                    sqlMap = objectMapper.readValue(dfFormSql, Map.class);
+                    //循环得到每一个sql语句返回结果
+                    for (Map.Entry<String, Object> entry : sqlMap.entrySet()) {
+                        List<Map<String, Object>> resultMap = executeNodeFormMapper.executeSql(entry.getValue().toString());
+                        sqlMap.put(entry.getKey(), resultMap);
+                    }
+                    //把原来的sql语句替换成下拉框数据
+                    taskNodeFromContentJson.put("dfFormSql", JSONObject.toJSONString(sqlMap));
+                } catch (JsonProcessingException e) {
+                    e.printStackTrace();
+                }
+                //表单结构信息
+                hashMap.put("template", taskNodeFromContentJson);
+                //添加到返回集合中
+                mapList.add(hashMap);
+            } else if (taskNodeFormType.equals("composeForm")) {
+                //参数为一个数组
+                JSONArray objects = JSON.parseArray(taskNodeFormContent);
+
+                //循环数组元素
+                objects.forEach(item -> {
+                    String s = item.toString();
+                    JSONObject jsonObject = JSONObject.parseObject(s);
+                    String tableSql = jsonObject.get("tableSql").toString();
+                    String conditionArrayJson = jsonObject.get("condition").toString();
+                    JSONArray jsonArray = JSON.parseArray(conditionArrayJson);
+
+                    jsonArray.forEach(conditionItem -> {
+                        //处理下这个条件 去掉 #{ 去掉.
+                        String conditionString = conditionItem.toString().replace("#{", "").replace(".", "_");
+                        //转驼峰
+                        String CamelConditionString = StringUtils.toCamelCase(conditionString);
+                        //
+                    });
+
+                    Map<String, String> stringHashMap = executeNodeFormMapper.tableSql(tableSql);
+                    jsonObject.put("tableList", stringHashMap);
+                    mapList.add(jsonObject);
+                });
+            } else if (taskNodeFormContent.equals("designForm")) {
+                HashMap hashMap = new HashMap();
+                hashMap.put("resultMap", "");
+                hashMap.put("template", "");
+                mapList.add(hashMap);
+            }
+        }
+        return mapList;
+    }
+
     /**
      * 查询节点对应的表单信息
      *
@@ -494,6 +634,12 @@ public class PreExecutionToolClass<R> {
             if (nodeForm.get(item).equals("dragForm")) {  // 拖拽类型的表单
                 String fromInfo = iBpmExecuteProcessService.getFromInfo(item);
                 resultMap.put(item, fromInfo);
+            } else if (nodeForm.get(item).equals("dragFormGroup")) { // 拖拽的表单组
+
+                String groupTableInfo = iBpmExecuteProcessService.getGroupTableInfo(item);
+
+
+                resultMap.put(item, groupTableInfo);
             } else if (nodeForm.get(item).equals("composeForm")) { // 组合类型的表单
                 String groupTableInfo = iBpmExecuteProcessService.getGroupTableInfo(item);
                 resultMap.put(item, groupTableInfo);
@@ -546,10 +692,99 @@ public class PreExecutionToolClass<R> {
         return AjaxResult.success();
     }
 
+    /**
+     * 执行审批流程节点
+     *
+     * @param bpmRunNodeVo 当前节点信息
+     * @return
+     */
+    public AjaxResult approvalNode(BpmRunNodeVo bpmRunNodeVo) {
+
+        /**
+         * 不能确定某张表可以发起流程,也就是发起审批的这个条数据需要回传后台标识
+         *
+         * 表名以及当前数据条的主键,
+         */
+
+
+        /**
+         * 1️⃣1️⃣1️⃣  准备执行节点所需数据
+         * * 审批节点不过是通过、未通过、驳回等状态信息
+         * * 审批备注与通过、不通过等状态是同一列数据,
+         * * 如果轮回审批,那么备注字段也会是同列,之前审批的状态以及审批备注,需要从日志表中获取
+         * * 把当前流程节点的完整执行记录到日志表中,审批流程的执行只修改状态
+         */
+        String taskProcessKey = bpmRunNodeVo.getTaskProcessKey(); // 任务流程编码
+        String taskNodeKey = bpmRunNodeVo.getTaskNodeKey(); // 任务节点编码
+        String taskNextNodeKey = XmlDataParserUtils.getNextNodeKey(bpmRunNodeVo.getTaskProcessXmlContent(), taskNodeKey);
+        // 获取当前节点的下个节点类型
+        String taskNextNodeType = XmlDataParserUtils.getNodeType(bpmRunNodeVo.getTaskProcessXmlContent(), taskNextNodeKey);
+
 
-    public CommonEntity getProcessNodeFormTemplate(BpmRunNodeFromVo bpmRunNodeFromVo) {
-        CommonEntity commonEntity = new CommonEntity();
-        return commonEntity;
+        // 得到当前执行的流程信息
+        BpmExecuteProcess currentBpmExecuteProcess = runBpmExecuteProcessMapper.selectBpmExecuteProcessByTaskKey(taskProcessKey);
+        // 得到当前节点的所有信息-》审批类型节点会出现节点后给某张表插入数据
+        BpmExecuteNode currentBpmExecuteNode = runBpmExecuteNodeMapper.queryBpmExecuteNodeBytaskNodeKey(taskProcessKey, taskNodeKey);
+        // 审批备注
+        String approvalRemark = bpmRunNodeVo.getApprovalRemark();
+        // 审批状态 pass:通过、noPass:不通过、reject:驳回
+        String approvalStatus = bpmRunNodeVo.getApprovalStatus();
+        // 当前执行的节点全部信息
+        currentBpmExecuteNode.setTaskNodeOtherState(approvalStatus);
+        currentBpmExecuteNode.setTaskRemark(approvalRemark);
+
+        // 当前执行的流程
+        currentBpmExecuteProcess.setTaskNodeKey(taskNodeKey);
+        currentBpmExecuteProcess.setTaskNodeNextKey(taskNextNodeKey);
+
+        // 2️⃣2️⃣2️⃣  开始执行当前节点
+        // 补充流程节点信息(如若驳回操作,会显示上次审批记录)
+        runBpmExecuteNodeMapper.updateBpmExecuteNode(currentBpmExecuteNode);
+        // --- 修改当前流程执行节点
+        runBpmExecuteProcessMapper.updateProcessNode(currentBpmExecuteProcess);
+        // --- 修改当前审批的数据条状态
+
+
+        // 3️⃣3️⃣3️⃣  判断当前节点是否存在给其他表插入数据
+        // currentBpmExecuteNode.getTask
+
+        // ⚠️⚠️⚠️ 新增节点执行记录
+        BpmExecuteNodeLog bpmExecuteNodeLog = new BpmExecuteNodeLog(currentBpmExecuteNode);
+        iBpmExecuteNodeLogService.insertBpmExecuteNodeLog(bpmExecuteNodeLog);
+
+        // 4️⃣4️⃣4️⃣  判断是否结束审批流程
+        if (taskNextNodeType.equals("endEvent")) {
+            // 当前节点是改流程的最后一个节点,默认执行结束节点
+            // 结束节点也是只修改状态
+            // runBpmExecuteProcessMapper.updateProcessNode();
+
+            // 审批流程结束,修改当前审批关联数据条的关联数据条的状态(bpm_approval_status)
+            // 审批状态 (0:已提交、1:已通过、2:不通过、4:驳回、5:审批中)
+            // iBpmApprovalStatusService.updateBpmApprovalStatus();
+//            iBpmApprovalStatusService.updateBpmApprovalStatus();
+        }
+
+        /**
+         * €23092802001001001820€0990€23-0€0001€BTS高弹单丝轻网€100D/36f€001特黑€AA
+         */
+
+
+        /* 审批的发起操作,相当于这个流程的开始
+           那么用户首次调用当前接口,都会就是一级审批
+           需要当前操作的状态以及审批过后的备注信息 两列数据。
+           修改节点状态,添加审批的数据,修改流程执行节点的key。
+           如何当前节点有节点后需要插入的其他表数据则执行。
+
+           理论上来讲每一个节点的表单都是一样的,都是审批数据条是否通过,以及审批意见
+           如果需要审批的数据条是多表中的数据,也看作为一条数据来处理。
+
+           流程发起时的表单数据开始存在用户的表中,所以同生产流程逻辑一样。
+           在发起这个流程的时候记录当前的数据条的表名以及表主键
+
+        */
+
+
+        return AjaxResult.success();
     }
 
 }

+ 62 - 0
zkqy-process-execution/src/main/java/com/zkqy/execution/produce/dispersed/service/IBpmApprovalStatusService.java

@@ -0,0 +1,62 @@
+package com.zkqy.execution.produce.dispersed.service;
+
+import com.zkqy.execution.produce.dispersed.entity.BpmApprovalStatus;
+
+import java.util.List;
+
+/**
+ * 审批数据条中间Service接口
+ * 
+ * @author hzh
+ * @date 2024-01-31
+ */
+public interface IBpmApprovalStatusService 
+{
+    /**
+     * 查询审批数据条中间
+     * 
+     * @param id 审批数据条中间主键
+     * @return 审批数据条中间
+     */
+    public BpmApprovalStatus selectBpmApprovalStatusById(Long id);
+
+    /**
+     * 查询审批数据条中间列表
+     * 
+     * @param bpmApprovalStatus 审批数据条中间
+     * @return 审批数据条中间集合
+     */
+    public List<BpmApprovalStatus> selectBpmApprovalStatusList(BpmApprovalStatus bpmApprovalStatus);
+
+    /**
+     * 新增审批数据条中间
+     * 
+     * @param bpmApprovalStatus 审批数据条中间
+     * @return 结果
+     */
+    public int insertBpmApprovalStatus(BpmApprovalStatus bpmApprovalStatus);
+
+    /**
+     * 修改审批数据条中间
+     * 
+     * @param bpmApprovalStatus 审批数据条中间
+     * @return 结果
+     */
+    public int updateBpmApprovalStatus(BpmApprovalStatus bpmApprovalStatus);
+
+    /**
+     * 批量删除审批数据条中间
+     * 
+     * @param ids 需要删除的审批数据条中间主键集合
+     * @return 结果
+     */
+    public int deleteBpmApprovalStatusByIds(Long[] ids);
+
+    /**
+     * 删除审批数据条中间信息
+     * 
+     * @param id 审批数据条中间主键
+     * @return 结果
+     */
+    public int deleteBpmApprovalStatusById(Long id);
+}

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

@@ -0,0 +1,94 @@
+package com.zkqy.execution.produce.dispersed.service.impl;
+
+import java.util.List;
+
+import com.zkqy.execution.produce.dispersed.entity.BpmApprovalStatus;
+import com.zkqy.execution.produce.dispersed.mapper.BpmApprovalStatusMapper;
+import com.zkqy.execution.produce.dispersed.service.IBpmApprovalStatusService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+/**
+ * 审批数据条中间Service业务层处理
+ * 
+ * @author hzh
+ * @date 2024-01-31
+ */
+@Service
+public class BpmApprovalStatusServiceImpl implements IBpmApprovalStatusService
+{
+    @Autowired
+    private BpmApprovalStatusMapper bpmApprovalStatusMapper;
+
+    /**
+     * 查询审批数据条中间
+     * 
+     * @param id 审批数据条中间主键
+     * @return 审批数据条中间
+     */
+    @Override
+    public BpmApprovalStatus selectBpmApprovalStatusById(Long id)
+    {
+        return bpmApprovalStatusMapper.selectBpmApprovalStatusById(id);
+    }
+
+    /**
+     * 查询审批数据条中间列表
+     * 
+     * @param bpmApprovalStatus 审批数据条中间
+     * @return 审批数据条中间
+     */
+    @Override
+    public List<BpmApprovalStatus> selectBpmApprovalStatusList(BpmApprovalStatus bpmApprovalStatus)
+    {
+        return bpmApprovalStatusMapper.selectBpmApprovalStatusList(bpmApprovalStatus);
+    }
+
+    /**
+     * 新增审批数据条中间
+     * 
+     * @param bpmApprovalStatus 审批数据条中间
+     * @return 结果
+     */
+    @Override
+    public int insertBpmApprovalStatus(BpmApprovalStatus bpmApprovalStatus)
+    {
+        return bpmApprovalStatusMapper.insertBpmApprovalStatus(bpmApprovalStatus);
+    }
+
+    /**
+     * 修改审批数据条中间
+     * 
+     * @param bpmApprovalStatus 审批数据条中间
+     * @return 结果
+     */
+    @Override
+    public int updateBpmApprovalStatus(BpmApprovalStatus bpmApprovalStatus)
+    {
+        return bpmApprovalStatusMapper.updateBpmApprovalStatus(bpmApprovalStatus);
+    }
+
+    /**
+     * 批量删除审批数据条中间
+     * 
+     * @param ids 需要删除的审批数据条中间主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBpmApprovalStatusByIds(Long[] ids)
+    {
+        return bpmApprovalStatusMapper.deleteBpmApprovalStatusByIds(ids);
+    }
+
+    /**
+     * 删除审批数据条中间信息
+     * 
+     * @param id 审批数据条中间主键
+     * @return 结果
+     */
+    @Override
+    public int deleteBpmApprovalStatusById(Long id)
+    {
+        return bpmApprovalStatusMapper.deleteBpmApprovalStatusById(id);
+    }
+}

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

@@ -231,7 +231,7 @@ public class CommonServiceImpl implements ICommonService {
     }
 
     @Override
-    public CommonEntity getInfoById(CommonEntity commonEntity) {
+    public CommonEntity  getInfoById(CommonEntity commonEntity) {
         String tableName = (String) commonEntity.getBasicMap().get("tableName");
         Map<String, Object> conditions = JSONObject.parseObject(JSON.toJSONString(commonEntity.getConditionMap()));
         CommonEntity common = new CommonEntity();

+ 79 - 0
zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmApprovalStatusMapper.xml

@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.zkqy.execution.produce.dispersed.mapper.BpmApprovalStatusMapper">
+    
+    <resultMap type="com.zkqy.execution.produce.dispersed.entity.BpmApprovalStatus" id="BpmApprovalStatusResult">
+        <result property="id"    column="id"    />
+        <result property="tableName"    column="table_name"    />
+        <result property="tableId"    column="table_id"    />
+        <result property="approvalState"    column="approval_state"    />
+        <result property="taskKey"    column="task_key"    />
+    </resultMap>
+
+    <sql id="selectBpmApprovalStatusVo">
+        select id, table_name, table_id, approval_state, task_key from {DBNAME}.bpm_approval_status
+    </sql>
+
+    <select id="selectBpmApprovalStatusList" parameterType="com.zkqy.execution.produce.dispersed.entity.BpmApprovalStatus" resultMap="BpmApprovalStatusResult">
+        <include refid="selectBpmApprovalStatusVo"/>
+        <where>  
+            <if test="tableName != null  and tableName != ''"> and table_name like concat('%', #{tableName}, '%')</if>
+            <if test="tableId != null  and tableId != ''"> and table_id = #{tableId}</if>
+            <if test="approvalState != null  and approvalState != ''"> and approval_state = #{approvalState}</if>
+            <if test="taskKey != null  and taskKey != ''"> and task_key = #{taskKey}</if>
+        </where>
+    </select>
+    
+    <select id="selectBpmApprovalStatusById" parameterType="Long" resultMap="BpmApprovalStatusResult">
+        <include refid="selectBpmApprovalStatusVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertBpmApprovalStatus" parameterType="com.zkqy.execution.produce.dispersed.entity.BpmApprovalStatus" useGeneratedKeys="true" keyProperty="id">
+        insert into {DBNAME}.bpm_approval_status
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="tableName != null">table_name,</if>
+            <if test="tableId != null">table_id,</if>
+            <if test="approvalState != null">approval_state,</if>
+            <if test="taskKey != null">task_key,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="tableName != null">#{tableName},</if>
+            <if test="tableId != null">#{tableId},</if>
+            <if test="approvalState != null">#{approvalState},</if>
+            <if test="taskKey != null">#{taskKey},</if>
+        </trim>
+    </insert>
+
+    <update id="updateBpmApprovalStatus" parameterType="com.zkqy.execution.produce.dispersed.entity.BpmApprovalStatus">
+        update {DBNAME}.bpm_approval_status
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="tableName != null">table_name = #{tableName},</if>
+            <if test="tableId != null">table_id = #{tableId},</if>
+            <if test="approvalState != null">approval_state = #{approvalState},</if>
+            <if test="taskKey != null">task_key = #{taskKey},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <update id="updateBpmApprovalStatusByTaskKey">
+        update {DBNAME}.bpm_approval_status
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="approvalState != null">approval_state = #{approvalState},</if>
+        </trim>
+        where taskKey = #{taskKey}
+    </update>
+
+    <delete id="deleteBpmApprovalStatusById" parameterType="Long">
+        delete from bpm_approval_status where id = #{id}
+    </delete>
+
+    <delete id="deleteBpmApprovalStatusByIds" parameterType="String">
+        delete from bpm_approval_status where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 5 - 6
zkqy-process-execution/src/main/resources/mapper/bpm/dispersed/BpmExecuteProcessMapper.xml

@@ -87,8 +87,7 @@
             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}, '%')
+            IFNULL( plan.${planName}, '' )) LIKE concat('%', #{taskName}, '%')
         </if>
 
         GROUP BY benm.task_process_key
@@ -248,6 +247,7 @@
         </if>
         )
         <if test="taskProcessState != null">and bep.task_process_state = #{taskProcessState}</if>
+        <if test="taskProcessType != null">and bep.task_process_type = #{taskProcessType}</if>
         <if test="taskName != null  and taskName != ''">
             and CONCAT(
             IFNULL( bep.task_key, '' ),
@@ -256,8 +256,7 @@
             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}, '%')
+            IFNULL( plan.${planName}, '' )) LIKE concat('%', #{taskName}, '%')
         </if>
 
         order by ben.create_time desc
@@ -382,6 +381,7 @@
         join {DBNAME}.${planTableName} as plan on
         plan.${planID} = bep.task_plan_key
         where bep.task_process_state = 3
+        <if test="taskProcessType != null">and bep.task_process_type = #{taskProcessType}</if>
         <if test="taskName != null  and taskName != ''">
             and CONCAT(
             IFNULL( bep.task_key, '' ),
@@ -390,8 +390,7 @@
             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}, '%')
+            IFNULL( plan.${planName}, '' )) LIKE concat('%', #{taskName}, '%')
         </if>
         order by ben.create_time desc
     </select>