Explorar o código

自定义流程-新增流程类型(发起人指定)

wangliang %!s(int64=3) %!d(string=hai) anos
pai
achega
94e976d26c
Modificáronse 20 ficheiros con 869 adicións e 213 borrados
  1. 108 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowCommonDto.java
  2. 2 36
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowDto.java
  3. 63 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowEditDto.java
  4. 151 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowPropDto.java
  5. 34 4
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowPropertyDto.java
  6. 2 88
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowSaveDto.java
  7. 66 7
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowVarDto.java
  8. 9 9
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/params/ExamTaskApplyParam.java
  9. 15 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/params/FlowTaskApproveParam.java
  10. 82 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/FlowTaskResult.java
  11. 11 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/TaskInfoResult.java
  12. 14 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFCustomFlow.java
  13. 42 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowApproveUserCountTypeEnum.java
  14. 42 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowApproveUserSelectRangeEnum.java
  15. 160 59
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ActivitiServiceImpl.java
  16. 4 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java
  17. 1 1
      distributed-print-business/src/main/resources/mapper/TFCustomFlowMapper.xml
  18. 20 4
      distributed-print/src/main/java/com/qmth/distributed/print/api/TFCustomFlowController.java
  19. 1 1
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/contant/SystemConstant.java
  20. 42 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/TFCustomModelTypeEnum.java

+ 108 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowCommonDto.java

@@ -0,0 +1,108 @@
+package com.qmth.distributed.print.business.bean.flow;
+
+import com.qmth.distributed.print.business.enums.CustomFlowTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * @Description: 自定义流程common dto
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/1/21
+ */
+public class CustomFlowCommonDto implements Serializable {
+
+    @ApiModelProperty(value = "id")
+    @NotBlank(message = "id不能为空")
+    String id;
+
+    @ApiModelProperty(value = "节点类型")
+    @NotNull(message = "节点类型不能为空")
+    CustomFlowTypeEnum type;
+
+    @ApiModelProperty(value = "节点内容")
+    String content;
+
+    @ApiModelProperty(value = "width")
+    Double w;
+
+    @ApiModelProperty(value = "height")
+    Double h;
+
+    @ApiModelProperty(value = "x坐标轴")
+    Double x;
+
+    @ApiModelProperty(value = "y坐标轴")
+    Double y;
+
+    @ApiModelProperty(value = "属性")
+    CustomFlowPropertyDto property;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public CustomFlowTypeEnum getType() {
+        return type;
+    }
+
+    public void setType(CustomFlowTypeEnum type) {
+        this.type = type;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public Double getW() {
+        return w;
+    }
+
+    public void setW(Double w) {
+        this.w = w;
+    }
+
+    public Double getH() {
+        return h;
+    }
+
+    public void setH(Double h) {
+        this.h = h;
+    }
+
+    public Double getX() {
+        return x;
+    }
+
+    public void setX(Double x) {
+        this.x = x;
+    }
+
+    public Double getY() {
+        return y;
+    }
+
+    public void setY(Double y) {
+        this.y = y;
+    }
+
+    public CustomFlowPropertyDto getProperty() {
+        return property;
+    }
+
+    public void setProperty(CustomFlowPropertyDto property) {
+        this.property = property;
+    }
+}

+ 2 - 36
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowDto.java

@@ -3,12 +3,8 @@ package com.qmth.distributed.print.business.bean.flow;
 import com.qmth.distributed.print.business.enums.CustomFlowTypeEnum;
 import io.swagger.annotations.ApiModelProperty;
 
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
 import java.io.Serializable;
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Objects;
 
 /**
  * @Description: 自定义流程dto
@@ -17,33 +13,7 @@ import java.util.Objects;
  * @Author: wangliang
  * @Date: 2022/1/21
  */
-public class CustomFlowDto implements Serializable {
-
-    @ApiModelProperty(value = "id")
-    @NotBlank(message = "id不能为空")
-    String id;
-
-    @ApiModelProperty(value = "节点类型")
-    @NotNull(message = "节点类型不能为空")
-    CustomFlowTypeEnum type;
-
-    @ApiModelProperty(value = "节点内容")
-    String content;
-
-    @ApiModelProperty(value = "width")
-    Double w;
-
-    @ApiModelProperty(value = "height")
-    Double h;
-
-    @ApiModelProperty(value = "x坐标轴")
-    Double x;
-
-    @ApiModelProperty(value = "y坐标轴")
-    Double y;
-
-    @ApiModelProperty(value = "属性")
-    CustomFlowPropertyDto property;
+public class CustomFlowDto extends CustomFlowCommonDto implements Serializable {
 
     @ApiModelProperty(value = "流程属性id")
     String flowTaskId;
@@ -77,11 +47,7 @@ public class CustomFlowDto implements Serializable {
     }
 
     public List<CustomFlowSequenceDto> getBeforeFlowTaskIds() {
-        if (Objects.isNull(beforeFlowTaskIds)) {
-            return new ArrayList<>();
-        } else {
-            return beforeFlowTaskIds;
-        }
+        return beforeFlowTaskIds;
     }
 
     public void setBeforeFlowTaskIds(List<CustomFlowSequenceDto> beforeFlowTaskIds) {

+ 63 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowEditDto.java

@@ -0,0 +1,63 @@
+package com.qmth.distributed.print.business.bean.flow;
+
+import com.qmth.distributed.print.business.entity.TFCustomFlow;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * @Description: 自定义流程edit dto
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/1/21
+ */
+public class CustomFlowEditDto extends CustomFlowPropDto implements Serializable {
+
+    @ApiModelProperty(value = "流程节点内容")
+    List<CustomFlowCommonDto> customFlowLists;
+
+    public CustomFlowEditDto() {
+
+    }
+
+    public CustomFlowEditDto(TFCustomFlow tfCustomFlow, List<CustomFlowCommonDto> customFlowLists) {
+        super(tfCustomFlow);
+        this.customFlowLists = customFlowLists;
+    }
+
+    public List<CustomFlowCommonDto> getCustomFlowLists() {
+        return customFlowLists;
+    }
+
+    public void setCustomFlowLists(List<CustomFlowCommonDto> customFlowLists) {
+        this.customFlowLists = customFlowLists;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        CustomFlowEditDto that = (CustomFlowEditDto) o;
+        return type == that.type && schoolId.equals(that.schoolId);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(type, schoolId);
+    }
+
+    @Override
+    public String toString() {
+        return "CustomFlowEditDto{" +
+                "type=" + type +
+                ", schoolId=" + schoolId +
+                '}';
+    }
+}

+ 151 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowPropDto.java

@@ -0,0 +1,151 @@
+package com.qmth.distributed.print.business.bean.flow;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.distributed.print.business.entity.TFCustomFlow;
+import com.qmth.teachcloud.common.enums.TFCustomModelTypeEnum;
+import com.qmth.teachcloud.common.enums.TFCustomTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.Objects;
+
+/**
+ * @Description: 自定义流程save dto
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/1/21
+ */
+public class CustomFlowPropDto implements Serializable {
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "自定义流程id")
+    Long customFlowId;
+
+    @ApiModelProperty(value = "id")
+    @NotBlank(message = "流程名称")
+    String name;
+
+    @ApiModelProperty(value = "流程模式")
+    @NotNull(message = "流程模式不能为空")
+    TFCustomModelTypeEnum modelType;
+
+    @ApiModelProperty(value = "流程类型")
+    @NotNull(message = "流程类型不能为空")
+    TFCustomTypeEnum type;
+
+    @ApiModelProperty(value = "是否发布,0:否,1:是")
+    Boolean publish;
+
+    @ApiModelProperty(value = "学校id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    Long schoolId;
+
+    @ApiModelProperty(value = "机构id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    Long orgId;
+
+    public CustomFlowPropDto(){
+
+    }
+
+    public CustomFlowPropDto(TFCustomFlow tfCustomFlow){
+        this.customFlowId = tfCustomFlow.getId();
+        this.name = tfCustomFlow.getName();
+        this.modelType = tfCustomFlow.getModelType();
+        this.type = tfCustomFlow.getType();
+        this.publish = tfCustomFlow.getPublish();
+        this.schoolId = tfCustomFlow.getSchoolId();
+        this.orgId = tfCustomFlow.getOrgId();
+    }
+
+    public void setSchoolAndOrgInfo(Long schoolId, Long orgId) {
+        this.schoolId = schoolId;
+        this.orgId = orgId;
+    }
+
+
+    public TFCustomModelTypeEnum getModelType() {
+        return modelType;
+    }
+
+    public void setModelType(TFCustomModelTypeEnum modelType) {
+        this.modelType = modelType;
+    }
+
+    public Long getCustomFlowId() {
+        return customFlowId;
+    }
+
+    public void setCustomFlowId(Long customFlowId) {
+        this.customFlowId = customFlowId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public TFCustomTypeEnum getType() {
+        return type;
+    }
+
+    public void setType(TFCustomTypeEnum type) {
+        this.type = type;
+    }
+
+    public Boolean getPublish() {
+        return publish;
+    }
+
+    public void setPublish(Boolean publish) {
+        this.publish = publish;
+    }
+
+    public Long getSchoolId() {
+        return schoolId;
+    }
+
+    public void setSchoolId(Long schoolId) {
+        this.schoolId = schoolId;
+    }
+
+    public Long getOrgId() {
+        return orgId;
+    }
+
+    public void setOrgId(Long orgId) {
+        this.orgId = orgId;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        CustomFlowPropDto that = (CustomFlowPropDto) o;
+        return type == that.type && schoolId.equals(that.schoolId);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(type, schoolId);
+    }
+
+    @Override
+    public String toString() {
+        return "CustomFlowSaveDto{" +
+                "type=" + type +
+                ", schoolId=" + schoolId +
+                '}';
+    }
+}

+ 34 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowPropertyDto.java

@@ -1,10 +1,7 @@
 package com.qmth.distributed.print.business.bean.flow;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
-import com.qmth.distributed.print.business.enums.CustomFlowApproveUserTypeEnum;
-import com.qmth.distributed.print.business.enums.CustomFlowMultipleUserApproveTypeEnum;
-import com.qmth.distributed.print.business.enums.CustomFlowRejectResubmitTypeEnum;
-import com.qmth.distributed.print.business.enums.CustomFlowRejectTypeEnum;
+import com.qmth.distributed.print.business.enums.*;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
@@ -41,6 +38,39 @@ public class CustomFlowPropertyDto implements Serializable {
     @ApiModelProperty(value = "自定义流程驳回重新提交类型")
     CustomFlowRejectResubmitTypeEnum rejectResubmitType;
 
+    @ApiModelProperty(value = "自定义流程发起人指定选择人数")
+    CustomFlowApproveUserCountTypeEnum approveUserCountType;
+
+    @ApiModelProperty(value = "自定义流程发起人指定选择用户类型")
+    CustomFlowApproveUserSelectRangeEnum approveUserSelectRange;
+
+    @ApiModelProperty(value = "自定义流程发起人指定审批角色列表")
+    List<CustomFlowApproveRoleDto> approveUserSelectRoles;
+
+    public CustomFlowApproveUserCountTypeEnum getApproveUserCountType() {
+        return approveUserCountType;
+    }
+
+    public void setApproveUserCountType(CustomFlowApproveUserCountTypeEnum approveUserCountType) {
+        this.approveUserCountType = approveUserCountType;
+    }
+
+    public CustomFlowApproveUserSelectRangeEnum getApproveUserSelectRange() {
+        return approveUserSelectRange;
+    }
+
+    public void setApproveUserSelectRange(CustomFlowApproveUserSelectRangeEnum approveUserSelectRange) {
+        this.approveUserSelectRange = approveUserSelectRange;
+    }
+
+    public List<CustomFlowApproveRoleDto> getApproveUserSelectRoles() {
+        return approveUserSelectRoles;
+    }
+
+    public void setApproveUserSelectRoles(List<CustomFlowApproveRoleDto> approveUserSelectRoles) {
+        this.approveUserSelectRoles = approveUserSelectRoles;
+    }
+
     public CustomFlowApproveUserTypeEnum getApproveUserType() {
         return approveUserType;
     }

+ 2 - 88
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowSaveDto.java

@@ -1,13 +1,8 @@
 package com.qmth.distributed.print.business.bean.flow;
 
-import com.fasterxml.jackson.databind.annotation.JsonSerialize;
-import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.qmth.distributed.print.business.entity.TFCustomFlow;
-import com.qmth.teachcloud.common.enums.TFCustomTypeEnum;
 import io.swagger.annotations.ApiModelProperty;
 
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 import java.util.List;
 import java.util.Objects;
@@ -19,77 +14,20 @@ import java.util.Objects;
  * @Author: wangliang
  * @Date: 2022/1/21
  */
-public class CustomFlowSaveDto implements Serializable {
-
-    @JsonSerialize(using = ToStringSerializer.class)
-    @ApiModelProperty(value = "自定义流程id")
-    private Long customFlowId;
-
-    @ApiModelProperty(value = "id")
-    @NotBlank(message = "流程名称")
-    String name;
-
-    @ApiModelProperty(value = "流程类型")
-    @NotNull(message = "流程类型不能为空")
-    TFCustomTypeEnum type;
+public class CustomFlowSaveDto extends CustomFlowPropDto implements Serializable {
 
     @ApiModelProperty(value = "流程节点内容")
     List<CustomFlowDto> customFlowLists;
 
-    @ApiModelProperty(value = "是否发布,0:否,1:是")
-    Boolean publish;
-
-    @ApiModelProperty(value = "学校id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    Long schoolId;
-
-    @ApiModelProperty(value = "机构id")
-    @JsonSerialize(using = ToStringSerializer.class)
-    Long orgId;
-
     public CustomFlowSaveDto() {
 
     }
 
     public CustomFlowSaveDto(TFCustomFlow tfCustomFlow, List<CustomFlowDto> customFlowLists) {
-        this.customFlowId = tfCustomFlow.getId();
-        this.name = tfCustomFlow.getName();
-        this.type = tfCustomFlow.getType();
-        this.publish = tfCustomFlow.getPublish();
-        this.schoolId = tfCustomFlow.getSchoolId();
-        this.orgId = tfCustomFlow.getOrgId();
+        super(tfCustomFlow);
         this.customFlowLists = customFlowLists;
     }
 
-    public void setSchoolAndOrgInfo(Long schoolId, Long orgId) {
-        this.schoolId = schoolId;
-        this.orgId = orgId;
-    }
-
-    public Long getCustomFlowId() {
-        return customFlowId;
-    }
-
-    public void setCustomFlowId(Long customFlowId) {
-        this.customFlowId = customFlowId;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public TFCustomTypeEnum getType() {
-        return type;
-    }
-
-    public void setType(TFCustomTypeEnum type) {
-        this.type = type;
-    }
-
     public List<CustomFlowDto> getCustomFlowLists() {
         return customFlowLists;
     }
@@ -98,30 +36,6 @@ public class CustomFlowSaveDto implements Serializable {
         this.customFlowLists = customFlowLists;
     }
 
-    public Boolean getPublish() {
-        return publish;
-    }
-
-    public void setPublish(Boolean publish) {
-        this.publish = publish;
-    }
-
-    public Long getSchoolId() {
-        return schoolId;
-    }
-
-    public void setSchoolId(Long schoolId) {
-        this.schoolId = schoolId;
-    }
-
-    public Long getOrgId() {
-        return orgId;
-    }
-
-    public void setOrgId(Long orgId) {
-        this.orgId = orgId;
-    }
-
     @Override
     public boolean equals(Object o) {
         if (this == o) {

+ 66 - 7
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowVarDto.java

@@ -1,9 +1,7 @@
 package com.qmth.distributed.print.business.bean.flow;
 
-import com.qmth.distributed.print.business.enums.CustomFlowApproveUserTypeEnum;
-import com.qmth.distributed.print.business.enums.CustomFlowMultipleUserApproveTypeEnum;
-import com.qmth.distributed.print.business.enums.CustomFlowRejectResubmitTypeEnum;
-import com.qmth.distributed.print.business.enums.CustomFlowRejectTypeEnum;
+import com.qmth.distributed.print.business.enums.*;
+import com.qmth.teachcloud.common.enums.TFCustomModelTypeEnum;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
@@ -24,6 +22,9 @@ public class CustomFlowVarDto implements Serializable {
     @ApiModelProperty(value = "审批人id")
     List<String> approveIds;
 
+    @ApiModelProperty(value = "流程模式")
+    TFCustomModelTypeEnum modelType;
+
     @ApiModelProperty(value = "属性")
     CustomFlowApproveUserTypeEnum approveUserType;
 
@@ -48,6 +49,16 @@ public class CustomFlowVarDto implements Serializable {
     @ApiModelProperty(value = "审批角色ids")
     List<String> approveRoleIds;
 
+    @ApiModelProperty(value = "发起人指定审批角色ids")
+    List<String> approveUserSelectRolesIds;
+
+    @ApiModelProperty(value = "自定义流程发起人指定选择人数")
+    CustomFlowApproveUserCountTypeEnum approveUserCountType;
+
+    @ApiModelProperty(value = "自定义流程发起人指定选择用户类型")
+    CustomFlowApproveUserSelectRangeEnum approveUserSelectRange;
+
+
     public CustomFlowVarDto() {
 
     }
@@ -56,21 +67,29 @@ public class CustomFlowVarDto implements Serializable {
         this.flowTaskVar = flowTaskVar;
     }
 
-    public CustomFlowVarDto(String flowTaskVar, List<String> approveIds, List<String> copyForUserIds, String copyForUserNames, List<String> approveRoleIds) {
+    public CustomFlowVarDto(String flowTaskVar, List<String> approveIds, List<String> copyForUserIds, String copyForUserNames, List<String> approveRoleIds, List<String> approveUserSelectRolesIds, CustomFlowApproveUserCountTypeEnum approveUserCountType, CustomFlowApproveUserSelectRangeEnum approveUserSelectRange, TFCustomModelTypeEnum modelType) {
         this.flowTaskVar = flowTaskVar;
         this.approveIds = approveIds;
         this.copyForUserIds = copyForUserIds;
         this.copyForUserNames = copyForUserNames;
         this.approveRoleIds = approveRoleIds;
+        this.approveUserSelectRolesIds = approveUserSelectRolesIds;
+        this.approveUserCountType = approveUserCountType;
+        this.approveUserSelectRange = approveUserSelectRange;
+        this.modelType = modelType;
     }
 
-    public CustomFlowVarDto(String flowTaskVar, List<String> approveIds, String approveUserNames, List<String> copyForUserIds, String copyForUserNames, List<String> approveRoleIds) {
+    public CustomFlowVarDto(String flowTaskVar, List<String> approveIds, String approveUserNames, List<String> copyForUserIds, String copyForUserNames, List<String> approveRoleIds, List<String> approveUserSelectRolesIds, CustomFlowApproveUserCountTypeEnum approveUserCountType, CustomFlowApproveUserSelectRangeEnum approveUserSelectRange, TFCustomModelTypeEnum modelType) {
         this.flowTaskVar = flowTaskVar;
         this.approveIds = approveIds;
         this.approveUserNames = approveUserNames;
         this.copyForUserIds = copyForUserIds;
         this.copyForUserNames = copyForUserNames;
         this.approveRoleIds = approveRoleIds;
+        this.approveUserSelectRolesIds = approveUserSelectRolesIds;
+        this.approveUserCountType = approveUserCountType;
+        this.approveUserSelectRange = approveUserSelectRange;
+        this.modelType = modelType;
     }
 
     public CustomFlowVarDto(String flowTaskVar, List<String> approveIds,
@@ -81,7 +100,11 @@ public class CustomFlowVarDto implements Serializable {
                             String approveUserNames,
                             List<String> copyForUserIds,
                             String copyForUserNames,
-                            List<String> approveRoleIds) {
+                            List<String> approveRoleIds,
+                            List<String> approveUserSelectRolesIds,
+                            CustomFlowApproveUserCountTypeEnum approveUserCountType,
+                            CustomFlowApproveUserSelectRangeEnum approveUserSelectRange,
+                            TFCustomModelTypeEnum modelType) {
         this.flowTaskVar = flowTaskVar;
         this.approveIds = approveIds;
         this.approveUserType = approveUserType;
@@ -92,6 +115,42 @@ public class CustomFlowVarDto implements Serializable {
         this.copyForUserIds = copyForUserIds;
         this.copyForUserNames = copyForUserNames;
         this.approveRoleIds = approveRoleIds;
+        this.approveUserSelectRolesIds = approveUserSelectRolesIds;
+        this.approveUserCountType = approveUserCountType;
+        this.approveUserSelectRange = approveUserSelectRange;
+        this.modelType = modelType;
+    }
+
+    public TFCustomModelTypeEnum getModelType() {
+        return modelType;
+    }
+
+    public void setModelType(TFCustomModelTypeEnum modelType) {
+        this.modelType = modelType;
+    }
+
+    public CustomFlowApproveUserCountTypeEnum getApproveUserCountType() {
+        return approveUserCountType;
+    }
+
+    public void setApproveUserCountType(CustomFlowApproveUserCountTypeEnum approveUserCountType) {
+        this.approveUserCountType = approveUserCountType;
+    }
+
+    public CustomFlowApproveUserSelectRangeEnum getApproveUserSelectRange() {
+        return approveUserSelectRange;
+    }
+
+    public void setApproveUserSelectRange(CustomFlowApproveUserSelectRangeEnum approveUserSelectRange) {
+        this.approveUserSelectRange = approveUserSelectRange;
+    }
+
+    public List<String> getApproveUserSelectRolesIds() {
+        return approveUserSelectRolesIds;
+    }
+
+    public void setApproveUserSelectRolesIds(List<String> approveUserSelectRolesIds) {
+        this.approveUserSelectRolesIds = approveUserSelectRolesIds;
     }
 
     public List<String> getApproveRoleIds() {

+ 9 - 9
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/params/ExamTaskApplyParam.java

@@ -17,17 +17,17 @@ public class ExamTaskApplyParam {
     private ExamTask examTask;
     private ExamTaskDetail examTaskDetail;
 
-//    @ApiModelProperty(value = "流程审批人列表")
-//    @JsonSerialize(using = ToStringSerializer.class)
-//    private List<Long> approveUserIds;
+    @ApiModelProperty(value = "流程审批人列表")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private List<Long> approveUserIds;
 
-//    public List<Long> getApproveUserIds() {
-//        return approveUserIds;
-//    }
+    public List<Long> getApproveUserIds() {
+        return approveUserIds;
+    }
 
-//    public void setApproveUserIds(List<Long> approveUserIds) {
-//        this.approveUserIds = approveUserIds;
-//    }
+    public void setApproveUserIds(List<Long> approveUserIds) {
+        this.approveUserIds = approveUserIds;
+    }
 
     public ExamTask getExamTask() {
         return examTask;

+ 15 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/params/FlowTaskApproveParam.java

@@ -1,10 +1,13 @@
 package com.qmth.distributed.print.business.bean.params;
 
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.qmth.teachcloud.common.enums.FlowApprovePassEnum;
 import io.swagger.annotations.ApiModelProperty;
 
 import javax.validation.constraints.NotNull;
 import java.io.Serializable;
+import java.util.List;
 
 /**
  * @Description: 流程任务审批参数
@@ -29,6 +32,18 @@ public class FlowTaskApproveParam implements Serializable {
     @ApiModelProperty(value = "流程驳回节点")
     private Integer setup;
 
+    @ApiModelProperty(value = "流程审批人列表")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private List<Long> approveUserIds;
+
+    public List<Long> getApproveUserIds() {
+        return approveUserIds;
+    }
+
+    public void setApproveUserIds(List<Long> approveUserIds) {
+        this.approveUserIds = approveUserIds;
+    }
+
     public String getTaskId() {
         return taskId;
     }

+ 82 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/FlowTaskResult.java

@@ -2,7 +2,11 @@ package com.qmth.distributed.print.business.bean.result;
 
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.distributed.print.business.bean.flow.CustomFlowApproveRoleDto;
+import com.qmth.distributed.print.business.enums.CustomFlowApproveUserCountTypeEnum;
+import com.qmth.distributed.print.business.enums.CustomFlowApproveUserSelectRangeEnum;
 import com.qmth.distributed.print.business.enums.CustomFlowApproveUserTypeEnum;
+import com.qmth.teachcloud.common.enums.TFCustomModelTypeEnum;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
@@ -30,6 +34,9 @@ public class FlowTaskResult implements Serializable {
     @ApiModelProperty(value = "流程节点步骤")
     private Integer setup;
 
+    @ApiModelProperty(value = "审批人id")
+    List<String> approveIds;
+
     @ApiModelProperty(value = "审批人")
     String approveUserNames;
 
@@ -39,6 +46,18 @@ public class FlowTaskResult implements Serializable {
     @ApiModelProperty(value = "属性")
     CustomFlowApproveUserTypeEnum approveUserType;
 
+    @ApiModelProperty(value = "流程模式")
+    TFCustomModelTypeEnum modelType;
+
+    @ApiModelProperty(value = "自定义流程发起人指定选择人数")
+    CustomFlowApproveUserCountTypeEnum approveUserCountType;
+
+    @ApiModelProperty(value = "自定义流程发起人指定选择用户类型")
+    CustomFlowApproveUserSelectRangeEnum approveUserSelectRange;
+
+    @ApiModelProperty(value = "自定义流程发起人指定审批角色列表")
+    List<CustomFlowApproveRoleDto> approveUserSelectRoles;
+
     public FlowTaskResult() {
 
     }
@@ -49,13 +68,75 @@ public class FlowTaskResult implements Serializable {
         this.setup = setup;
     }
 
-    public FlowTaskResult(Long flowId, String taskName, String taskKey, Integer setup, List<String> approveRoleIds, CustomFlowApproveUserTypeEnum approveUserType) {
+    public FlowTaskResult(String taskName, String taskKey, Integer setup, TFCustomModelTypeEnum modelType) {
+        this.taskName = taskName;
+        this.taskKey = taskKey;
+        this.setup = setup;
+        this.modelType = modelType;
+    }
+
+    public FlowTaskResult(Long flowId,
+                          String taskName,
+                          String taskKey,
+                          Integer setup) {
         this.flowId = flowId;
         this.taskName = taskName;
         this.taskKey = taskKey;
         this.setup = setup;
+    }
+
+    public void setInfo(List<String> approveRoleIds,
+                        CustomFlowApproveUserTypeEnum approveUserType,
+                        TFCustomModelTypeEnum modelType,
+                        CustomFlowApproveUserCountTypeEnum approveUserCountType,
+                        CustomFlowApproveUserSelectRangeEnum approveUserSelectRange,
+                        List<CustomFlowApproveRoleDto> approveUserSelectRoles) {
         this.approveRoleIds = approveRoleIds;
         this.approveUserType = approveUserType;
+        this.modelType = modelType;
+        this.approveUserCountType = approveUserCountType;
+        this.approveUserSelectRange = approveUserSelectRange;
+        this.approveUserSelectRoles = approveUserSelectRoles;
+    }
+
+    public List<String> getApproveIds() {
+        return approveIds;
+    }
+
+    public void setApproveIds(List<String> approveIds) {
+        this.approveIds = approveIds;
+    }
+
+    public TFCustomModelTypeEnum getModelType() {
+        return modelType;
+    }
+
+    public void setModelType(TFCustomModelTypeEnum modelType) {
+        this.modelType = modelType;
+    }
+
+    public CustomFlowApproveUserCountTypeEnum getApproveUserCountType() {
+        return approveUserCountType;
+    }
+
+    public void setApproveUserCountType(CustomFlowApproveUserCountTypeEnum approveUserCountType) {
+        this.approveUserCountType = approveUserCountType;
+    }
+
+    public CustomFlowApproveUserSelectRangeEnum getApproveUserSelectRange() {
+        return approveUserSelectRange;
+    }
+
+    public void setApproveUserSelectRange(CustomFlowApproveUserSelectRangeEnum approveUserSelectRange) {
+        this.approveUserSelectRange = approveUserSelectRange;
+    }
+
+    public List<CustomFlowApproveRoleDto> getApproveUserSelectRoles() {
+        return approveUserSelectRoles;
+    }
+
+    public void setApproveUserSelectRoles(List<CustomFlowApproveRoleDto> approveUserSelectRoles) {
+        this.approveUserSelectRoles = approveUserSelectRoles;
     }
 
     public List<String> getApproveRoleIds() {

+ 11 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/TaskInfoResult.java

@@ -14,6 +14,9 @@ import java.util.List;
  */
 public class TaskInfoResult extends FlowTaskResult implements Serializable {
 
+    @ApiModelProperty(value = "下一节点信息")
+    FlowTaskResult nextFlowTaskResult;
+
     @ApiModelProperty(value = "驳回流程节点步骤")
     private List<FlowTaskResult> rejectSetupList;
 
@@ -34,6 +37,14 @@ public class TaskInfoResult extends FlowTaskResult implements Serializable {
         setSetup(setup);
     }
 
+    public FlowTaskResult getNextFlowTaskResult() {
+        return nextFlowTaskResult;
+    }
+
+    public void setNextFlowTaskResult(FlowTaskResult nextFlowTaskResult) {
+        this.nextFlowTaskResult = nextFlowTaskResult;
+    }
+
     public List<FlowTaskResult> getRejectSetupList() {
         return rejectSetupList;
     }

+ 14 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFCustomFlow.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import com.qmth.teachcloud.common.base.BaseEntity;
+import com.qmth.teachcloud.common.enums.TFCustomModelTypeEnum;
 import com.qmth.teachcloud.common.enums.TFCustomTypeEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -36,6 +37,9 @@ public class TFCustomFlow extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "流程名称")
     private String name;
 
+    @ApiModelProperty(value = "模式类型,USER_FIXED:指定人员,APPROVE_SET:发起人指定")
+    private TFCustomModelTypeEnum modelType;
+
     @ApiModelProperty(value = "流程类型,ELECTRON_FLOW:电子交卷审核,QUESTION_ELECTRON_FLOW:题库试题提交审核,PAPER_ELECTRON_FLOW:题库试卷审核")
     private TFCustomTypeEnum type;
 
@@ -71,7 +75,7 @@ public class TFCustomFlow extends BaseEntity implements Serializable {
 
     }
 
-    public TFCustomFlow(Long schoolId, Long orgId, String name, TFCustomTypeEnum type, Boolean publish, String objectData, Long userId, String flowKey) {
+    public TFCustomFlow(Long schoolId, Long orgId, String name, TFCustomTypeEnum type, Boolean publish, String objectData, Long userId, String flowKey, TFCustomModelTypeEnum modelType) {
         this.schoolId = schoolId;
         this.orgId = orgId;
         this.name = name;
@@ -79,9 +83,18 @@ public class TFCustomFlow extends BaseEntity implements Serializable {
         this.publish = publish;
         this.objectData = objectData;
         this.flowKey = flowKey;
+        this.modelType = modelType;
         insertInfo(userId);
     }
 
+    public TFCustomModelTypeEnum getModelType() {
+        return modelType;
+    }
+
+    public void setModelType(TFCustomModelTypeEnum modelType) {
+        this.modelType = modelType;
+    }
+
     public String getFlowProcessVar() {
         return flowProcessVar;
     }

+ 42 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowApproveUserCountTypeEnum.java

@@ -0,0 +1,42 @@
+package com.qmth.distributed.print.business.enums;
+
+import java.util.Objects;
+
+/**
+ * @Description: 自定义流程发起人指定选择人数
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/1/21
+ */
+public enum CustomFlowApproveUserCountTypeEnum {
+
+    ONE("一个"),
+
+    MORE("多个");
+
+    private String title;
+
+    private CustomFlowApproveUserCountTypeEnum(String title) {
+        this.title = title;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    /**
+     * 状态转换 toName
+     *
+     * @param title
+     * @return
+     */
+    public static String convertToName(String title) {
+        for (CustomFlowApproveUserCountTypeEnum e : CustomFlowApproveUserCountTypeEnum.values()) {
+            if (Objects.equals(title, e.getTitle())) {
+                return e.name();
+            }
+        }
+        return null;
+    }
+}

+ 42 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowApproveUserSelectRangeEnum.java

@@ -0,0 +1,42 @@
+package com.qmth.distributed.print.business.enums;
+
+import java.util.Objects;
+
+/**
+ * @Description: 自定义流程发起人指定选择用户类型
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/1/21
+ */
+public enum CustomFlowApproveUserSelectRangeEnum {
+
+    ALL("全单位"),
+
+    ROLE("角色");
+
+    private String title;
+
+    private CustomFlowApproveUserSelectRangeEnum(String title) {
+        this.title = title;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    /**
+     * 状态转换 toName
+     *
+     * @param title
+     * @return
+     */
+    public static String convertToName(String title) {
+        for (CustomFlowApproveUserSelectRangeEnum e : CustomFlowApproveUserSelectRangeEnum.values()) {
+            if (Objects.equals(title, e.getTitle())) {
+                return e.name();
+            }
+        }
+        return null;
+    }
+}

+ 160 - 59
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ActivitiServiceImpl.java

@@ -135,26 +135,30 @@ public class ActivitiServiceImpl implements ActivitiService {
         for (Map.Entry<String, CustomFlowVarDto> entry : agginessMap.entrySet()) {
             CustomFlowVarDto customFlowVarDto = gson.fromJson(gson.toJson(entry.getValue()), CustomFlowVarDto.class);
             if (Objects.nonNull(customFlowVarDto.getFlowTaskVar()) && customFlowVarDto.getFlowTaskVar().contains(DefaultInstanceConvertToMultiInstance.DEFAULT_ASSIGNEE_LIST)) {
-                if (customFlowVarDto.getApproveUserType() == CustomFlowApproveUserTypeEnum.USER) {
-                    Set<String> set = new LinkedHashSet(customFlowVarDto.getApproveIds());
-                    if (customFlowVarDto.getMultipleUserApproveType() == CustomFlowMultipleUserApproveTypeEnum.SOME) {
-                        varMap.computeIfAbsent(customFlowVarDto.getFlowTaskVar(), s -> set.toString().replaceAll("\\[", "").replaceAll("\\]", "").trim());
-                    } else {
-                        varMap.computeIfAbsent(customFlowVarDto.getFlowTaskVar(), s -> set);
-                    }
-                } else if (customFlowVarDto.getApproveUserType() == CustomFlowApproveUserTypeEnum.ROLE) {
-                    roleGroupMemberMatchParams = Objects.isNull(roleGroupMemberMatchParams) ? new SysRoleGroupMemberMatchParams() : roleGroupMemberMatchParams;
-                    if (Objects.isNull(roleGroupMemberMatchParams.getFlowRoleGroupMemberMatchMap()) || roleGroupMemberMatchParams.getFlowRoleGroupMemberMatchMap().size() == 0) {
-                        flowRoleGroupMemberMatchMap = new LinkedHashMap<>();
-                    } else {
-                        flowRoleGroupMemberMatchMap = roleGroupMemberMatchParams.getFlowRoleGroupMemberMatchMap();
-                    }
-                    if (flowRoleGroupMemberMatchMap.size() == 0) {
-                        flowRoleGroupMemberMatchMap.computeIfAbsent(entry.getKey(), v -> new SysRoleGroupMemberMatch(customFlowVarDto.getApproveRoleIds().stream().map(s -> SystemConstant.convertIdToLong(s)).collect(Collectors.toList()), approveId));
-                    } else {
-                        flowRoleGroupMemberMatchMap.computeIfAbsent(entry.getKey(), v -> new SysRoleGroupMemberMatch(customFlowVarDto.getApproveRoleIds().stream().map(s -> SystemConstant.convertIdToLong(s)).collect(Collectors.toList())));
+                if (Objects.nonNull(customFlowVarDto.getModelType()) && customFlowVarDto.getModelType() == TFCustomModelTypeEnum.USER_FIXED) {
+                    if (customFlowVarDto.getApproveUserType() == CustomFlowApproveUserTypeEnum.USER) {
+                        Set<String> set = new LinkedHashSet(customFlowVarDto.getApproveIds());
+                        if (customFlowVarDto.getMultipleUserApproveType() == CustomFlowMultipleUserApproveTypeEnum.SOME) {
+                            varMap.computeIfAbsent(customFlowVarDto.getFlowTaskVar(), s -> set.toString().replaceAll("\\[", "").replaceAll("\\]", "").trim());
+                        } else {
+                            varMap.computeIfAbsent(customFlowVarDto.getFlowTaskVar(), s -> set);
+                        }
+                    } else if (customFlowVarDto.getApproveUserType() == CustomFlowApproveUserTypeEnum.ROLE) {
+                        roleGroupMemberMatchParams = Objects.isNull(roleGroupMemberMatchParams) ? new SysRoleGroupMemberMatchParams() : roleGroupMemberMatchParams;
+                        if (Objects.isNull(roleGroupMemberMatchParams.getFlowRoleGroupMemberMatchMap()) || roleGroupMemberMatchParams.getFlowRoleGroupMemberMatchMap().size() == 0) {
+                            flowRoleGroupMemberMatchMap = new LinkedHashMap<>();
+                        } else {
+                            flowRoleGroupMemberMatchMap = roleGroupMemberMatchParams.getFlowRoleGroupMemberMatchMap();
+                        }
+                        if (flowRoleGroupMemberMatchMap.size() == 0) {
+                            flowRoleGroupMemberMatchMap.computeIfAbsent(entry.getKey(), v -> new SysRoleGroupMemberMatch(customFlowVarDto.getApproveRoleIds().stream().map(s -> SystemConstant.convertIdToLong(s)).collect(Collectors.toList()), approveId));
+                        } else {
+                            flowRoleGroupMemberMatchMap.computeIfAbsent(entry.getKey(), v -> new SysRoleGroupMemberMatch(customFlowVarDto.getApproveRoleIds().stream().map(s -> SystemConstant.convertIdToLong(s)).collect(Collectors.toList())));
+                        }
+                        roleGroupMemberMatchParams.setFlowRoleGroupMemberMatchMap(flowRoleGroupMemberMatchMap);
                     }
-                    roleGroupMemberMatchParams.setFlowRoleGroupMemberMatchMap(flowRoleGroupMemberMatchMap);
+                } else if (Objects.nonNull(customFlowVarDto.getModelType()) && customFlowVarDto.getModelType() == TFCustomModelTypeEnum.APPROVE_SET) {
+                    varMap.computeIfAbsent(customFlowVarDto.getFlowTaskVar(), s -> customFlowVarDto.getApproveIds());
                 }
             } else {
                 varMap.computeIfAbsent(customFlowVarDto.getFlowTaskVar(), s -> customFlowVarDto.getApproveIds().get(0));
@@ -347,6 +351,19 @@ public class ActivitiServiceImpl implements ActivitiService {
         tfFlowApproveService.save(tfFlowApprove);
 
         Long objectId = (Long) map.get(SystemConstant.OBJECT_ID);
+//        //TODO 测试用
+//        if (flowType == TFCustomTypeEnum.ELECTRON_FLOW) {//如果是电子交卷审核,就查询命题任务
+//            ExamTask examTask = examTaskService.getById(objectId);
+//            examTask.setFlowId(SystemConstant.convertIdToLong(flowId));
+//            examTaskService.updateById(examTask);
+//        }
+//
+//        String id = (String) map.get(SystemConstant.FLOW_ENTITY_ID);
+//        List<TFFlowJoin> tfFlowJoinList = tfFlowJoinService.findByObjectId(objectId);
+//        tfFlowJoinList.get(0).setFlowEntityId(SystemConstant.convertIdToLong(id));
+//        tfFlowJoinList.get(0).setFlowId(SystemConstant.convertIdToLong(flowId));
+//        tfFlowJoinList.get(0).setObjectTable(flowType.getTable());
+//        tfFlowJoinService.updateById(tfFlowJoinList.get(0));
         tfFlowLogService.save(new TFFlowLog(sysUser.getSchoolId(), sysUser.getOrgId(), SystemConstant.convertIdToLong(flowId), objectId, sysUser.getId(), sysUser.getId(), "提交流程", approveId, FlowApproveOperationEnum.SUBMIT, flowType.getTable()));
     }
 
@@ -390,6 +407,12 @@ public class ActivitiServiceImpl implements ActivitiService {
             TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.findByFlowId(flowId);
             Map<String, Object> flowProcessVarMap = this.getFlowProcessVarMap(tfCustomFlowEntity);
 
+            TFCustomFlow tfCustomFlow = tfCustomFlowService.getById(tfCustomFlowEntity.gettFCustomFlowId());
+            Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("自定义流程数据为空"));
+
+            if (Objects.isNull(tfCustomFlow.getEnable()) || !tfCustomFlow.getEnable()) {
+                throw ExceptionResultEnum.ERROR.exception("自定义流程未启用");
+            }
             String remark = null;
             FlowTaskResult currFlowTaskResult = null, nextFlowTaskResult = null;
             Map<String, CustomFlowVarDto> agginessMap = (Map<String, CustomFlowVarDto>) flowProcessVarMap.get(SystemConstant.AGGINESS_MAP);
@@ -399,6 +422,7 @@ public class ActivitiServiceImpl implements ActivitiService {
             Gson gson = new Gson();
             Integer nrOfCompletedInstances = null, nrOfInstances = null;
             boolean multiInstance = false;
+            FlowApprovePassEnum approvePass = null;
             if (currFlow instanceof UserTask) {
                 UserTask userTask = (UserTask) currFlow;
                 String id = userTask.getId().substring(userTask.getId().length() - 1, userTask.getId().length());
@@ -412,7 +436,7 @@ public class ActivitiServiceImpl implements ActivitiService {
                 //流程流水日志
                 tfFlowLog = new TFFlowLog(sysUser.getSchoolId(), sysUser.getOrgId(), flowId, tfFlowJoin.getObjectId(), sysUser.getId(), sysUser.getId(), remark, tfFlowJoin.getObjectTable());
                 //判断流程审批是通过还是驳回
-                FlowApprovePassEnum approvePass = (FlowApprovePassEnum) map.get(SystemConstant.APPROVE_OPERATION);
+                approvePass = (FlowApprovePassEnum) map.get(SystemConstant.APPROVE_OPERATION);
                 Map<String, FlowTaskResult> setupMap = (Map<String, FlowTaskResult>) flowProcessVarMap.get(SystemConstant.SETUP_MAP);
                 //获取当前流程和下一流程setup
                 currFlowTaskResult = gson.fromJson(gson.toJson(setupMap.get(userTask.getId())), FlowTaskResult.class);
@@ -482,7 +506,10 @@ public class ActivitiServiceImpl implements ActivitiService {
                 this.getAgginess(nextFlowTaskResult,
                         gson,
                         map,
-                        agginessMap);
+                        agginessMap,
+                        approvePass,
+                        flowProcessVarMap,
+                        tfCustomFlowEntity);
             }
             this.setApproveInfo(tfFlowApprove,
                     tfFlowLog,
@@ -603,23 +630,62 @@ public class ActivitiServiceImpl implements ActivitiService {
      * @param gson
      * @param map
      * @param agginessMap
+     * @param approvePass
+     * @param flowProcessVarMap
+     * @param tfCustomFlowEntity
      */
     protected void getAgginess(FlowTaskResult nextFlowTaskResult,
                                Gson gson,
                                Map<String, Object> map,
-                               Map<String, CustomFlowVarDto> agginessMap) {
+                               Map<String, CustomFlowVarDto> agginessMap,
+                               FlowApprovePassEnum approvePass,
+                               Map<String, Object> flowProcessVarMap,
+                               TFCustomFlowEntity tfCustomFlowEntity) {
         if (Objects.nonNull(agginessMap.get(nextFlowTaskResult.getTaskKey()))) {
             CustomFlowVarDto customFlowVarDto = gson.fromJson(gson.toJson(agginessMap.get(nextFlowTaskResult.getTaskKey())), CustomFlowVarDto.class);
-            if (Objects.nonNull(customFlowVarDto.getFlowTaskVar()) && customFlowVarDto.getFlowTaskVar().contains(DefaultInstanceConvertToMultiInstance.DEFAULT_ASSIGNEE_LIST)) {
-                Set<String> set = new LinkedHashSet(customFlowVarDto.getApproveIds());
-                if (customFlowVarDto.getMultipleUserApproveType() == CustomFlowMultipleUserApproveTypeEnum.SOME) {
-                    map.computeIfAbsent(customFlowVarDto.getFlowTaskVar(), s -> set.toString().replaceAll("\\[", "").replaceAll("\\]", "").trim());
-                } else {
-                    map.computeIfAbsent(customFlowVarDto.getFlowTaskVar(), s -> set);
+            if (Objects.nonNull(nextFlowTaskResult.getModelType()) && nextFlowTaskResult.getModelType() == TFCustomModelTypeEnum.APPROVE_SET) {
+                List<Long> approveUserIds = (List<Long>) map.get(SystemConstant.APPROVE_USER_IDS);
+                if (approvePass == FlowApprovePassEnum.PASS && Objects.nonNull(approveUserIds) && approveUserIds.size() > 0) {
+                    List<String> approveIds = approveUserIds.stream().map(s -> String.valueOf(s)).collect(Collectors.toList());
+                    nextFlowTaskResult.setApproveIds(approveIds);
+                    customFlowVarDto.setApproveIds(nextFlowTaskResult.getApproveIds());
+                    Set<String> set = new LinkedHashSet(customFlowVarDto.getApproveIds());
+                    ApproveUserResult approveUserResult = sysUserService.findByIds(set.stream().map(x -> SystemConstant.convertIdToLong(x)).collect(Collectors.toList()));
+                    customFlowVarDto.setApproveUserNames(approveUserResult.getPendApproveUsers());
+                    agginessMap.put(nextFlowTaskResult.getTaskKey(), customFlowVarDto);
+
+                    flowProcessVarMap.put(SystemConstant.AGGINESS_MAP, agginessMap);
+                    Map<String, Object> varMap = JacksonUtil.readJson(tfCustomFlowEntity.getFlowProcessVar(), Map.class);
+                    varMap.put(SystemConstant.FLOW_PROCESS_VAR_MAP, flowProcessVarMap);
+                    tfCustomFlowEntity.setFlowProcessVar(JacksonUtil.parseJson(varMap));
+                    tfCustomFlowEntityService.updateById(tfCustomFlowEntity);
                 }
+                setFlowTaskVar(customFlowVarDto, map);
+            } else {
+                setFlowTaskVar(customFlowVarDto, map);
+            }
+        }
+    }
+
+    /**
+     * 设置下一步值
+     *
+     * @param customFlowVarDto
+     * @param map
+     */
+    protected void setFlowTaskVar(CustomFlowVarDto customFlowVarDto, Map<String, Object> map) {
+        if (Objects.nonNull(customFlowVarDto.getFlowTaskVar()) && customFlowVarDto.getFlowTaskVar().contains(DefaultInstanceConvertToMultiInstance.DEFAULT_ASSIGNEE_LIST)) {
+            Set<String> set = new LinkedHashSet(customFlowVarDto.getApproveIds());
+            if (Objects.isNull(set) || set.size() == 0) {
+                throw ExceptionResultEnum.ERROR.exception("未设置审批人");
+            }
+            if (customFlowVarDto.getMultipleUserApproveType() == CustomFlowMultipleUserApproveTypeEnum.SOME) {
+                map.computeIfAbsent(customFlowVarDto.getFlowTaskVar(), s -> set.toString().replaceAll("\\[", "").replaceAll("\\]", "").trim());
             } else {
-                map.computeIfAbsent(customFlowVarDto.getFlowTaskVar(), v -> customFlowVarDto.getApproveIds().get(0));
+                map.computeIfAbsent(customFlowVarDto.getFlowTaskVar(), s -> set);
             }
+        } else {
+            map.computeIfAbsent(customFlowVarDto.getFlowTaskVar(), v -> customFlowVarDto.getApproveIds().get(0));
         }
     }
 
@@ -1017,8 +1083,8 @@ public class ActivitiServiceImpl implements ActivitiService {
                     process.addFlowElement(createStartEvent());
                     //默认在开始节点后新增一个审批节点
                     customFlowDefaultDto = multiWorkFlow.createDefaultUserTask(customFlowDto, flowTaskLink, DefaultInstanceConvertToMultiInstance.DEFAULT_USER_TASK);
-                    setupMap.put(customFlowDefaultDto.getFlowTaskId(), new FlowTaskResult(customFlowDefaultDto.getContent(), customFlowDefaultDto.getFlowTaskId(), customFlowDefaultDto.getSetup()));
-                    agginessMap.computeIfAbsent(customFlowDefaultDto.getFlowTaskId(), v -> new CustomFlowVarDto(SystemConstant.APPROVE_ID, new ArrayList(Arrays.asList("")), null, null, null));
+                    setupMap.put(customFlowDefaultDto.getFlowTaskId(), new FlowTaskResult(customFlowDefaultDto.getContent(), customFlowDefaultDto.getFlowTaskId(), customFlowDefaultDto.getSetup(), customFlowSaveDto.getModelType()));
+                    agginessMap.computeIfAbsent(customFlowDefaultDto.getFlowTaskId(), v -> new CustomFlowVarDto(SystemConstant.APPROVE_ID, new ArrayList(Arrays.asList("")), null, null, null, null, null, null, customFlowSaveDto.getModelType()));
                     process.addFlowElement(createUserTask(CustomFlowTypeEnum.USER_TASK.getId() + DefaultInstanceConvertToMultiInstance.DEFAULT_USER_TASK, Objects.nonNull(flowTaskLink.getLast().getTask().getContent()) && !Objects.equals(flowTaskLink.getLast().getTask().getContent(), "") ? flowTaskLink.getLast().getTask().getContent() : DefaultInstanceConvertToMultiInstance.DEFAULT_USER_TASK_NAME, DefaultInstanceConvertToMultiInstance.APPROVE_ID_EXP));
                     break;
                 case PROCESS://过程节点
@@ -1030,37 +1096,47 @@ public class ActivitiServiceImpl implements ActivitiService {
                     List<String> approveUserIds = new ArrayList<>();//审批用户
                     List<String> copyUserIds = new ArrayList<>();//抄送用户
                     List<String> approveRoleIds = null;//审批角色
+                    List<String> approveUserSelectRolesIds = null;//发起人指定审批角色
+                    ApproveUserResult approveUserResult = null;
+                    ApproveUserResult approveUserResultCopyUser = null;
                     //抄送用户
                     if (Objects.nonNull(customFlowPropertyDto.getCopyForUsers()) && customFlowPropertyDto.getCopyForUsers().size() > 0) {
                         copyUserIds.addAll(customFlowPropertyDto.getCopyForUsers().stream().map(x -> String.valueOf(x.getId())).collect(Collectors.toList()));
                     }
                     if (Objects.nonNull(customFlowDto.getProperty())) {
-                        //选人属性
-                        switch (customFlowPropertyDto.getApproveUserType()) {
-                            case USER://用户
-                                if (Objects.nonNull(customFlowPropertyDto.getApproveUsers()) && customFlowPropertyDto.getApproveUsers().size() > 0) {
-                                    approveUserIds.addAll(customFlowPropertyDto.getApproveUsers().stream().map(x -> String.valueOf(x.getId())).collect(Collectors.toList()));
-                                }
-                                break;
-                            case ROLE://角色
-                                if (Objects.nonNull(customFlowPropertyDto.getApproveRoles()) && customFlowPropertyDto.getApproveRoles().size() > 0) {
-                                    approveRoleIds = customFlowPropertyDto.getApproveRoles().stream().map(x -> String.valueOf(x.getId())).collect(Collectors.toList());
-                                }
-                                break;
-                            default:
-                                break;
-                        }
-                        ApproveUserResult approveUserResult = null;
-                        if (approveUserIds.size() > 0) {
-                            Set<String> set = new LinkedHashSet(approveUserIds);
-                            approveUserResult = sysUserService.findByIds(set.stream().map(x -> SystemConstant.convertIdToLong(x)).collect(Collectors.toList()));
-                        }
-                        ApproveUserResult approveUserResultCopyUser = null;
-                        if (copyUserIds.size() > 0) {
-                            Set<String> copyUserSet = new LinkedHashSet(copyUserIds);
-                            approveUserResultCopyUser = sysUserService.findByIds(copyUserSet.stream().map(x -> SystemConstant.convertIdToLong(x)).collect(Collectors.toList()));
+                        if (customFlowSaveDto.getModelType() == TFCustomModelTypeEnum.APPROVE_SET) {
+                            if ((Objects.nonNull(customFlowPropertyDto.getApproveUserSelectRange())
+                                    && customFlowPropertyDto.getApproveUserSelectRange() == CustomFlowApproveUserSelectRangeEnum.ROLE)
+                                    && (Objects.nonNull(customFlowPropertyDto.getApproveUserSelectRoles()) &&
+                                    customFlowPropertyDto.getApproveUserSelectRoles().size() > 0)) {
+                                approveUserSelectRolesIds = customFlowPropertyDto.getApproveUserSelectRoles().stream().map(x -> String.valueOf(x.getId())).collect(Collectors.toList());
+                            }
+                        } else if (customFlowSaveDto.getModelType() == TFCustomModelTypeEnum.USER_FIXED) {
+                            //选人属性
+                            switch (customFlowPropertyDto.getApproveUserType()) {
+                                case USER://用户
+                                    if (Objects.nonNull(customFlowPropertyDto.getApproveUsers()) && customFlowPropertyDto.getApproveUsers().size() > 0) {
+                                        approveUserIds.addAll(customFlowPropertyDto.getApproveUsers().stream().map(x -> String.valueOf(x.getId())).collect(Collectors.toList()));
+                                    }
+                                    break;
+                                case ROLE://角色
+                                    if (Objects.nonNull(customFlowPropertyDto.getApproveRoles()) && customFlowPropertyDto.getApproveRoles().size() > 0) {
+                                        approveRoleIds = customFlowPropertyDto.getApproveRoles().stream().map(x -> String.valueOf(x.getId())).collect(Collectors.toList());
+                                    }
+                                    break;
+                                default:
+                                    break;
+                            }
+                            if (approveUserIds.size() > 0) {
+                                Set<String> set = new LinkedHashSet(approveUserIds);
+                                approveUserResult = sysUserService.findByIds(set.stream().map(x -> SystemConstant.convertIdToLong(x)).collect(Collectors.toList()));
+                            }
+                            if (copyUserIds.size() > 0) {
+                                Set<String> copyUserSet = new LinkedHashSet(copyUserIds);
+                                approveUserResultCopyUser = sysUserService.findByIds(copyUserSet.stream().map(x -> SystemConstant.convertIdToLong(x)).collect(Collectors.toList()));
+                            }
                         }
-                        agginessMap.put(node.getTask().getFlowTaskId(), new CustomFlowVarDto(DefaultInstanceConvertToMultiInstance.DEFAULT_ASSIGNEE_LIST + i, approveUserIds, node.getTask().getProperty().getApproveUserType(), node.getTask().getProperty().getMultipleUserApproveType(), node.getTask().getProperty().getRejectType(), node.getTask().getProperty().getRejectResubmitType(), Objects.nonNull(approveUserResult) ? approveUserResult.getPendApproveUsers() : null, copyUserIds, Objects.nonNull(approveUserResultCopyUser) ? approveUserResultCopyUser.getPendApproveUsers() : null, approveRoleIds));
+                        agginessMap.put(node.getTask().getFlowTaskId(), new CustomFlowVarDto(DefaultInstanceConvertToMultiInstance.DEFAULT_ASSIGNEE_LIST + i, approveUserIds, node.getTask().getProperty().getApproveUserType(), node.getTask().getProperty().getMultipleUserApproveType(), node.getTask().getProperty().getRejectType(), node.getTask().getProperty().getRejectResubmitType(), Objects.nonNull(approveUserResult) ? approveUserResult.getPendApproveUsers() : null, copyUserIds, Objects.nonNull(approveUserResultCopyUser) ? approveUserResultCopyUser.getPendApproveUsers() : null, approveRoleIds, approveUserSelectRolesIds, customFlowPropertyDto.getApproveUserCountType(), customFlowPropertyDto.getApproveUserSelectRange(), customFlowSaveDto.getModelType()));
                         if (Objects.nonNull(customFlowPropertyDto.getRejectType()) && !Objects.equals(customFlowPropertyDto.getRejectType(), "")) {
                             //驳回属性
                             switch (customFlowPropertyDto.getRejectType()) {
@@ -1159,8 +1235,12 @@ public class ActivitiServiceImpl implements ActivitiService {
                             }
                         }
                     }
-                    flowTaskResult.setApproveRoleIds(approveRoleIds);
-                    flowTaskResult.setApproveUserType(customFlowPropertyDto.getApproveUserType());
+                    flowTaskResult.setInfo(approveRoleIds,
+                            customFlowPropertyDto.getApproveUserType(),
+                            customFlowSaveDto.getModelType(),
+                            customFlowPropertyDto.getApproveUserCountType(),
+                            customFlowPropertyDto.getApproveUserSelectRange(),
+                            customFlowPropertyDto.getApproveUserSelectRoles());
                     process.addFlowElement(createUserTask(CustomFlowTypeEnum.USER_TASK.getId() + i, Objects.nonNull(customFlowDto.getContent()) && !Objects.equals(customFlowDto.getContent(), "") ? customFlowDto.getContent() : DefaultInstanceConvertToMultiInstance.USER_TASK_APPROVE_NAME, approveUserIds, customFlowPropertyDto.getMultipleUserApproveType()));
                     break;
                 case END://结束节点
@@ -1201,6 +1281,7 @@ public class ActivitiServiceImpl implements ActivitiService {
                 process.addFlowElement(createSequenceFlow(flowTaskNode.getBefore().getTask().getFlowTaskId(), flowTaskNode.getTask().getFlowTaskId(), normalSequenceId, FlowApprovePassEnum.PASS.getTitle(), null));
             }
             List<CustomFlowSequenceDto> beforeFlowTaskIdsList = flowTaskNode.getTask().getBeforeFlowTaskIds();
+            beforeFlowTaskIdsList = Objects.isNull(beforeFlowTaskIdsList) ? new ArrayList<>() : beforeFlowTaskIdsList;
             if (Objects.nonNull(beforeFlowTaskIdsList)) {
                 for (CustomFlowSequenceDto c : beforeFlowTaskIdsList) {
                     String gatewaySequenceId = DefaultInstanceConvertToMultiInstance.SEQUENCE_NAME + sequenceId.getAndIncrement();
@@ -1337,6 +1418,7 @@ public class ActivitiServiceImpl implements ActivitiService {
         customFlowGatewayDto.setFlowTaskIds(flowTaskIds);
         approveDataMap.put(node.getTask().getFlowTaskId(), customFlowGatewayDto);
         List<CustomFlowSequenceDto> customFlowSequenceGateWayDtoList = customFlowExclusiveGatewayTaskNode.getTask().getBeforeFlowTaskIds();
+        customFlowSequenceGateWayDtoList = Objects.isNull(customFlowSequenceGateWayDtoList) ? new ArrayList<>() : customFlowSequenceGateWayDtoList;
         customFlowSequenceGateWayDtoList.addAll(flowTaskIds.get(customFlowExclusiveGatewayTaskNode.getTask().getFlowTaskId()));
         customFlowExclusiveGatewayTaskNode.getTask().setBeforeFlowTaskIds(customFlowSequenceGateWayDtoList);
     }
@@ -1396,7 +1478,7 @@ public class ActivitiServiceImpl implements ActivitiService {
         List<String> approveUserIds = new ArrayList(Arrays.asList(String.valueOf(approveId)));
         Set<String> set = new LinkedHashSet(approveUserIds);
         ApproveUserResult approveUserResult = sysUserService.findByIds(set.stream().map(x -> SystemConstant.convertIdToLong(x)).collect(Collectors.toList()));
-        agginessMap.put(CustomFlowTypeEnum.USER_TASK.getId() + DefaultInstanceConvertToMultiInstance.DEFAULT_USER_TASK, new CustomFlowVarDto(SystemConstant.APPROVE_ID, approveUserIds, approveUserResult.getPendApproveUsers(), null, null, null));
+        agginessMap.put(CustomFlowTypeEnum.USER_TASK.getId() + DefaultInstanceConvertToMultiInstance.DEFAULT_USER_TASK, new CustomFlowVarDto(SystemConstant.APPROVE_ID, approveUserIds, approveUserResult.getPendApproveUsers(), null, null, null, null, null, null, tfCustomFlow.getModelType()));
         flowProcessVarMap.put(SystemConstant.AGGINESS_MAP, agginessMap);
 
         map.computeIfAbsent(SystemConstant.ID, v -> tfCustomFlow.getFlowKey());
@@ -1452,6 +1534,24 @@ public class ActivitiServiceImpl implements ActivitiService {
         }
 
         TaskInfoResult taskInfoResult = new TaskInfoResult(flowId, task.getName(), task.getTaskDefinitionKey(), currFlowTaskResult.getSetup());
+        taskInfoResult.setInfo(currFlowTaskResult.getApproveRoleIds(),
+                currFlowTaskResult.getApproveUserType(),
+                currFlowTaskResult.getModelType(),
+                currFlowTaskResult.getApproveUserCountType(),
+                currFlowTaskResult.getApproveUserSelectRange(),
+                currFlowTaskResult.getApproveUserSelectRoles());
+        CustomFlowVarDto currCustomFlowVarDto = gson.fromJson(gson.toJson(agginessMap.get(currFlowTaskResult.getTaskKey())), CustomFlowVarDto.class);
+        taskInfoResult.setApproveUserNames(currCustomFlowVarDto.getApproveUserNames());
+
+        int currSetup = currFlowTaskResult.getSetup().intValue();
+        currSetup = currSetup == setupMap.size() - 1 ? 0 : currSetup + 1;
+        FlowTaskResult nextFlowTaskResult = this.getNextFlowTaskResult(setupMap, gson, currSetup, null);
+        nextFlowTaskResult.setFlowId(flowId);
+        CustomFlowVarDto nextCustomFlowVarDto = gson.fromJson(gson.toJson(agginessMap.get(nextFlowTaskResult.getTaskKey())), CustomFlowVarDto.class);
+        if (Objects.nonNull(nextCustomFlowVarDto) && !Objects.equals(nextFlowTaskResult.getTaskKey(), CustomFlowTypeEnum.END.getId())) {
+            nextFlowTaskResult.setApproveUserNames(nextCustomFlowVarDto.getApproveUserNames());
+        }
+
         List<FlowTaskResult> flowTaskResultList = null;
         if (Objects.nonNull(approveRejectMap.get(task.getTaskDefinitionKey()))) {
             flowTaskResultList = new ArrayList<>();
@@ -1466,6 +1566,7 @@ public class ActivitiServiceImpl implements ActivitiService {
             }
         }
         taskInfoResult.setRejectSetupList(flowTaskResultList);
+        taskInfoResult.setNextFlowTaskResult(nextFlowTaskResult);
         return taskInfoResult;
     }
 

+ 4 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java

@@ -1,6 +1,5 @@
 package com.qmth.distributed.print.business.service.impl;
 
-import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@@ -997,6 +996,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                 map.computeIfAbsent(SystemConstant.FLOW_TASK_ID, v -> task.getId());
                 map.computeIfAbsent(SystemConstant.PAPAER_ATTACHMENT_IDS, v -> examTaskDetail.getPaperAttachmentIds());
                 map.computeIfAbsent(SystemConstant.APPROVE_OPERATION, v -> FlowApprovePassEnum.PASS);
+                map.computeIfAbsent(SystemConstant.APPROVE_USER_IDS, v -> examTaskDetail.getApproveUserIds());
                 activitiService.taskApprove(map);
             }
         }
@@ -1551,6 +1551,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                         map.computeIfAbsent(SystemConstant.FLOW_TASK_ID, v -> task.getId());
                         map.computeIfAbsent(SystemConstant.PAPAER_ATTACHMENT_IDS, v -> examTaskDetail.getPaperAttachmentIds());
                         map.computeIfAbsent(SystemConstant.APPROVE_OPERATION, v -> FlowApprovePassEnum.PASS);
+                        map.computeIfAbsent(SystemConstant.APPROVE_USER_IDS, v -> examTaskApplyParam.getApproveUserIds());
                         activitiService.taskApprove(map);
                     }
                 }
@@ -1741,7 +1742,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                     for (ExamDetailList examDetailList : examDetailLists) {
                         int count = examDetailList.getStudentCount();
                         String clazzName = examDetailList.getClassName();
-                        if (count == 0){
+                        if (count == 0) {
                             throw ExceptionResultEnum.ERROR.exception("选择的考试班级【" + clazzName + "】下无学生,请确认该班级学生信息。");
                         }
 
@@ -1848,6 +1849,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                     map.computeIfAbsent(SystemConstant.FLOW_TASK_ID, v -> task.getId());
                     map.computeIfAbsent(SystemConstant.APPROVE_OPERATION, v -> FlowApprovePassEnum.PASS);
                     map.computeIfAbsent(SystemConstant.PAPAER_ATTACHMENT_IDS, v -> examTaskDetail.getPaperAttachmentIds());
+                    map.computeIfAbsent(SystemConstant.APPROVE_USER_IDS, v -> examTaskApplyTemp.getApproveUserIds());
                     activitiService.taskApprove(map);
                 }
             }

+ 1 - 1
distributed-print-business/src/main/resources/mapper/TFCustomFlowMapper.xml

@@ -36,7 +36,7 @@
     </select>
 
     <select id="list" resultType="com.qmth.distributed.print.business.entity.TFCustomFlow">
-        select tfcf.id,tfcf.school_id as schoolId,tfcf.org_id as orgId,tfcf.name,tfcf.type,tfcf.version,tfcf.enable,tfcf.publish from t_f_custom_flow tfcf
+        select tfcf.id,tfcf.school_id as schoolId,tfcf.org_id as orgId,tfcf.name,tfcf.type,tfcf.model_type as modelType,tfcf.version,tfcf.enable,tfcf.publish from t_f_custom_flow tfcf
         <where>
             <if test="schoolId != null and schoolId != ''">
                 and tfcf.school_id = #{schoolId}

+ 20 - 4
distributed-print/src/main/java/com/qmth/distributed/print/api/TFCustomFlowController.java

@@ -8,7 +8,8 @@ import com.google.gson.Gson;
 import com.google.gson.reflect.TypeToken;
 import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.boot.api.exception.ApiException;
-import com.qmth.distributed.print.business.bean.flow.CustomFlowDto;
+import com.qmth.distributed.print.business.bean.flow.CustomFlowCommonDto;
+import com.qmth.distributed.print.business.bean.flow.CustomFlowEditDto;
 import com.qmth.distributed.print.business.bean.flow.CustomFlowSaveDto;
 import com.qmth.distributed.print.business.bean.params.CustomFlowParam;
 import com.qmth.distributed.print.business.bean.params.CustomFlowRenameParam;
@@ -104,7 +105,7 @@ public class TFCustomFlowController {
             TFCustomFlow dbTfCustomFlow = tfCustomFlowService.findMaxVersion(customFlowSaveDto.getSchoolId(), null, customFlowSaveDto.getType());
             TFCustomFlow tfCustomFlow = null;
             if (Objects.isNull(customFlowSaveDto.getCustomFlowId())) {
-                tfCustomFlow = new TFCustomFlow(customFlowSaveDto.getSchoolId(), customFlowSaveDto.getOrgId(), customFlowSaveDto.getName(), customFlowSaveDto.getType(), customFlowSaveDto.getPublish(), JacksonUtil.parseJson(customFlowSaveDto.getCustomFlowLists()), sysUser.getId(), flowBpmnId);
+                tfCustomFlow = new TFCustomFlow(customFlowSaveDto.getSchoolId(), customFlowSaveDto.getOrgId(), customFlowSaveDto.getName(), customFlowSaveDto.getType(), customFlowSaveDto.getPublish(), JacksonUtil.parseJson(customFlowSaveDto.getCustomFlowLists()), sysUser.getId(), flowBpmnId, customFlowSaveDto.getModelType());
             } else {
                 tfCustomFlow = tfCustomFlowService.getById(customFlowSaveDto.getCustomFlowId());
                 Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("自定义流程数据为空"));
@@ -145,6 +146,20 @@ public class TFCustomFlowController {
         return ResultUtil.ok(true);
     }
 
+//    @ApiOperation(value = "测试启动流程")
+//    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
+//    @RequestMapping(value = "/testStart", method = RequestMethod.POST)
+//    @Transactional
+//    public Result testStart(@ApiParam(value = "命题任务id", required = true) @RequestParam String taskId,
+//                            @ApiParam(value = "命题老师id", required = true) @RequestParam String approveId) {
+//        Map<String, Object> map = new HashMap<>();
+//        map.computeIfAbsent(SystemConstant.OBJECT_ID, v -> SystemConstant.convertIdToLong(taskId));
+//        map.computeIfAbsent(SystemConstant.APPROVE_ID, v -> SystemConstant.convertIdToLong(approveId));
+//        map.computeIfAbsent(SystemConstant.FLOW_TYPE, v -> TFCustomTypeEnum.ELECTRON_FLOW);
+//        activitiService.customFlowStart(map);
+//        return ResultUtil.ok(true);
+//    }
+
     @ApiOperation(value = "审批流程")
     @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
     @RequestMapping(value = "/task/approve", method = RequestMethod.POST)
@@ -157,6 +172,7 @@ public class TFCustomFlowController {
         map.computeIfAbsent(SystemConstant.APPROVE_OPERATION, v -> flowTaskApproveParam.getApprovePass());
         map.computeIfAbsent(SystemConstant.APPROVE_REMARK, v -> flowTaskApproveParam.getRemark());
         map.computeIfAbsent(SystemConstant.APPROVE_SETUP, v -> flowTaskApproveParam.getSetup());
+        map.computeIfAbsent(SystemConstant.APPROVE_USER_IDS, v -> flowTaskApproveParam.getApproveUserIds());
         activitiService.taskApprove(map);
         return ResultUtil.ok(true);
     }
@@ -192,9 +208,9 @@ public class TFCustomFlowController {
         Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("自定义流程数据为空"));
         Optional.ofNullable(tfCustomFlow.getObjectData()).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("自定义流程绘图数据为空"));
         Gson gson = new Gson();
-        List<CustomFlowDto> customFlowLists = gson.fromJson(tfCustomFlow.getObjectData(), new TypeToken<List<CustomFlowDto>>() {
+        List<CustomFlowCommonDto> customFlowLists = gson.fromJson(tfCustomFlow.getObjectData(), new TypeToken<List<CustomFlowCommonDto>>() {
         }.getType());
-        return ResultUtil.ok(new CustomFlowSaveDto(tfCustomFlow, customFlowLists), null);
+        return ResultUtil.ok(new CustomFlowEditDto(tfCustomFlow, customFlowLists), null);
     }
 
     @ApiOperation(value = "流程逻辑删除")

+ 1 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/contant/SystemConstant.java

@@ -209,7 +209,6 @@ public class SystemConstant {
     public static final String JXZYY_FLOW_KEY = "JxzyyPaperApprove";//江西流程key
     public static final String APPROVE_ID = "approveId";//审批id
     public static final String FLOW_SUBMIT = "flowSubmit";//命题提交申请
-    public static final String EXAM_TASK = "examTask";//命题提交申请
     public static final String FLOW_JOIN_TYPE = "flowJoinType";//流程关联类型
     public static final String OLD_FLOW_ID = "oldFlowId";//旧流程id
     public static final String FLOW_TYPE = "flowType";//流程类型
@@ -219,6 +218,7 @@ public class SystemConstant {
     public static final String AGGINESS_MAP = "agginessMap";//流程审批人变量
     public static final String APPROVE_PASS_MAP = "approvePassMap";//流程审批通过变量
     public static final String APPROVE_REJECT_MAP = "approveRejectMap";//流程审批驳回变量
+    public static final String APPROVE_USER_IDS = "approveUserIds";//流程审批人列表
     public static final String SETUP_MAP = "setupMap";//流程步骤变量
     public static final String APPROVE_SETUP = "approveSetup";//流程节点
     public static final String APPROVE_OPERATION = "approveOperation";//流程操作

+ 42 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/enums/TFCustomModelTypeEnum.java

@@ -0,0 +1,42 @@
+package com.qmth.teachcloud.common.enums;
+
+import java.util.Objects;
+
+/**
+ * @Description: 自定义流程类型enum
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/1/24
+ */
+public enum TFCustomModelTypeEnum {
+
+    USER_FIXED("指定人员"),
+
+    APPROVE_SET("发起人指定");
+
+    private String title;
+
+    private TFCustomModelTypeEnum(String title) {
+        this.title = title;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    /**
+     * 状态转换 toName
+     *
+     * @param title
+     * @return
+     */
+    public static String convertToName(String title) {
+        for (TFCustomModelTypeEnum e : TFCustomModelTypeEnum.values()) {
+            if (Objects.equals(title, e.getTitle())) {
+                return e.name();
+            }
+        }
+        return null;
+    }
+}