Bladeren bron

新增自定义流程属性

wangliang 3 jaren geleden
bovenliggende
commit
2be34cc21c
17 gewijzigde bestanden met toevoegingen van 810 en 18 verwijderingen
  1. 40 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowApproveRoleDto.java
  2. 40 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowApproveUserDto.java
  3. 40 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowCopyUserDto.java
  4. 108 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowDto.java
  5. 99 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowPropertyDto.java
  6. 139 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFCustomFlow.java
  7. 42 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowApproveUserTypeEnum.java
  8. 44 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowMultipleUserApproveTypeEnum.java
  9. 42 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowRejectResubmitTypeEnum.java
  10. 44 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowRejectTypeEnum.java
  11. 44 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowTypeEnum.java
  12. 16 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/TFCustomFlowMapper.java
  13. 16 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TFCustomFlowService.java
  14. 20 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TFCustomFlowServiceImpl.java
  15. 5 0
      distributed-print-business/src/main/resources/mapper/TFCustomFlowMapper.xml
  16. 53 0
      distributed-print/src/main/java/com/qmth/distributed/print/api/TFCustomFlowController.java
  17. 18 18
      distributed-print/src/main/java/com/qmth/distributed/print/config/SwaggerConfig.java

+ 40 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowApproveRoleDto.java

@@ -0,0 +1,40 @@
+package com.qmth.distributed.print.business.bean.flow;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 自定义流程审核角色 dto
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/1/21
+ */
+public class CustomFlowApproveRoleDto implements Serializable {
+
+    @ApiModelProperty(value = "id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    Long id;
+
+    @ApiModelProperty(value = "id")
+    String name;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 40 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowApproveUserDto.java

@@ -0,0 +1,40 @@
+package com.qmth.distributed.print.business.bean.flow;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 自定义流程审核用户 dto
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/1/21
+ */
+public class CustomFlowApproveUserDto implements Serializable {
+
+    @ApiModelProperty(value = "id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    Long id;
+
+    @ApiModelProperty(value = "id")
+    String name;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 40 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowCopyUserDto.java

@@ -0,0 +1,40 @@
+package com.qmth.distributed.print.business.bean.flow;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 自定义流程抄送用户 dto
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/1/21
+ */
+public class CustomFlowCopyUserDto implements Serializable {
+
+    @ApiModelProperty(value = "id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    Long id;
+
+    @ApiModelProperty(value = "id")
+    String name;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 108 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowDto.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: 自定义流程dto
+ * @Param:
+ * @return:
+ * @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 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;
+    }
+}

+ 99 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/flow/CustomFlowPropertyDto.java

@@ -0,0 +1,99 @@
+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 io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * @Description: 自定义流程property dto
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/1/21
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class CustomFlowPropertyDto implements Serializable {
+
+    @ApiModelProperty(value = "属性")
+    CustomFlowApproveUserTypeEnum approveUserType;
+
+    @ApiModelProperty(value = "审批用户列表")
+    List<CustomFlowApproveUserDto> approveUsers;
+
+    @ApiModelProperty(value = "审批角色列表")
+    List<CustomFlowApproveRoleDto> approveRoles;
+
+    @ApiModelProperty(value = "抄送用户列表")
+    List<CustomFlowCopyUserDto> copyForUsers;
+
+    @ApiModelProperty(value = "自定义流程审核类型")
+    CustomFlowMultipleUserApproveTypeEnum multipleUserApproveType;
+
+    @ApiModelProperty(value = "自定义流程驳回类型")
+    CustomFlowRejectTypeEnum rejectType;
+
+    @ApiModelProperty(value = "自定义流程驳回重新提交类型")
+    CustomFlowRejectResubmitTypeEnum rejectResubmitType;
+
+    public CustomFlowApproveUserTypeEnum getApproveUserType() {
+        return approveUserType;
+    }
+
+    public void setApproveUserType(CustomFlowApproveUserTypeEnum approveUserType) {
+        this.approveUserType = approveUserType;
+    }
+
+    public List<CustomFlowApproveUserDto> getApproveUsers() {
+        return approveUsers;
+    }
+
+    public void setApproveUsers(List<CustomFlowApproveUserDto> approveUsers) {
+        this.approveUsers = approveUsers;
+    }
+
+    public List<CustomFlowApproveRoleDto> getApproveRoles() {
+        return approveRoles;
+    }
+
+    public void setApproveRoles(List<CustomFlowApproveRoleDto> approveRoles) {
+        this.approveRoles = approveRoles;
+    }
+
+    public List<CustomFlowCopyUserDto> getCopyForUsers() {
+        return copyForUsers;
+    }
+
+    public void setCopyForUsers(List<CustomFlowCopyUserDto> copyForUsers) {
+        this.copyForUsers = copyForUsers;
+    }
+
+    public CustomFlowMultipleUserApproveTypeEnum getMultipleUserApproveType() {
+        return multipleUserApproveType;
+    }
+
+    public void setMultipleUserApproveType(CustomFlowMultipleUserApproveTypeEnum multipleUserApproveType) {
+        this.multipleUserApproveType = multipleUserApproveType;
+    }
+
+    public CustomFlowRejectTypeEnum getRejectType() {
+        return rejectType;
+    }
+
+    public void setRejectType(CustomFlowRejectTypeEnum rejectType) {
+        this.rejectType = rejectType;
+    }
+
+    public CustomFlowRejectResubmitTypeEnum getRejectResubmitType() {
+        return rejectResubmitType;
+    }
+
+    public void setRejectResubmitType(CustomFlowRejectResubmitTypeEnum rejectResubmitType) {
+        this.rejectResubmitType = rejectResubmitType;
+    }
+}

+ 139 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFCustomFlow.java

@@ -0,0 +1,139 @@
+package com.qmth.distributed.print.business.entity;
+
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
+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 io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 自定义流程表
+ * </p>
+ *
+ * @author wangliang
+ * @since 2022-01-21
+ */
+@ApiModel(value = "TFCustomFlow对象", description = "自定义流程表")
+public class TFCustomFlow extends BaseEntity implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "学校id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long schoolId;
+
+    @ApiModelProperty(value = "机构id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    @TableField(value = "org_id", updateStrategy = FieldStrategy.IGNORED)
+    private Long orgId;
+
+    @ApiModelProperty(value = "流程名称")
+    private String name;
+
+    @ApiModelProperty(value = "流程类型,ELECTRON_FLOW:电子交卷审核,QUESTION_ELECTRON_FLOW:题库试题提交审核,PAPER_ELECTRON_FLOW:题库试卷审核")
+    private String type;
+
+    @ApiModelProperty(value = "是否启用,0:停用,1:启用")
+    private Boolean enable;
+
+    @ApiModelProperty(value = "是否发布,0:否,1:是")
+    private Boolean publish;
+
+    @ApiModelProperty(value = "自定义流程源数据")
+    private String objectData;
+
+    @ApiModelProperty(value = "版本号")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long version;
+
+    @ApiModelProperty(value = "流程key")
+    private String flowKey;
+
+    @ApiModelProperty(value = "流程版本id")
+    private String actFlowId;
+
+    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;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public Boolean getEnable() {
+        return enable;
+    }
+
+    public void setEnable(Boolean enable) {
+        this.enable = enable;
+    }
+
+    public Boolean getPublish() {
+        return publish;
+    }
+
+    public void setPublish(Boolean publish) {
+        this.publish = publish;
+    }
+
+    public String getObjectData() {
+        return objectData;
+    }
+
+    public void setObjectData(String objectData) {
+        this.objectData = objectData;
+    }
+
+    public Long getVersion() {
+        return version;
+    }
+
+    public void setVersion(Long version) {
+        this.version = version;
+    }
+
+    public String getFlowKey() {
+        return flowKey;
+    }
+
+    public void setFlowKey(String flowKey) {
+        this.flowKey = flowKey;
+    }
+
+    public String getActFlowId() {
+        return actFlowId;
+    }
+
+    public void setActFlowId(String actFlowId) {
+        this.actFlowId = actFlowId;
+    }
+}

+ 42 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowApproveUserTypeEnum.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 CustomFlowApproveUserTypeEnum {
+
+    USER("成员"),
+
+    ROLE("角色");
+
+    private String title;
+
+    private CustomFlowApproveUserTypeEnum(String title) {
+        this.title = title;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    /**
+     * 状态转换 toName
+     *
+     * @param title
+     * @return
+     */
+    public static String convertToName(String title) {
+        for (CustomFlowApproveUserTypeEnum e : CustomFlowApproveUserTypeEnum.values()) {
+            if (Objects.equals(title, e.getTitle())) {
+                return e.name();
+            }
+        }
+        return null;
+    }
+}

+ 44 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowMultipleUserApproveTypeEnum.java

@@ -0,0 +1,44 @@
+package com.qmth.distributed.print.business.enums;
+
+import java.util.Objects;
+
+/**
+ * @Description: 自定义流程审核类型
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/1/21
+ */
+public enum CustomFlowMultipleUserApproveTypeEnum {
+
+    ORDER("依次审批"),
+
+    ALL("会签(所有人必须审批)"),
+
+    SOME("或签(一名审批人同意或拒绝即可)");
+
+    private String title;
+
+    private CustomFlowMultipleUserApproveTypeEnum(String title) {
+        this.title = title;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    /**
+     * 状态转换 toName
+     *
+     * @param title
+     * @return
+     */
+    public static String convertToName(String title) {
+        for (CustomFlowMultipleUserApproveTypeEnum e : CustomFlowMultipleUserApproveTypeEnum.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/CustomFlowRejectResubmitTypeEnum.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 CustomFlowRejectResubmitTypeEnum {
+
+    NORMAL("按正常流程提交"),
+
+    PREV_STEP("提交到驳回节点");
+
+    private String title;
+
+    private CustomFlowRejectResubmitTypeEnum(String title) {
+        this.title = title;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    /**
+     * 状态转换 toName
+     *
+     * @param title
+     * @return
+     */
+    public static String convertToName(String title) {
+        for (CustomFlowRejectResubmitTypeEnum e : CustomFlowRejectResubmitTypeEnum.values()) {
+            if (Objects.equals(title, e.getTitle())) {
+                return e.name();
+            }
+        }
+        return null;
+    }
+}

+ 44 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowRejectTypeEnum.java

@@ -0,0 +1,44 @@
+package com.qmth.distributed.print.business.enums;
+
+import java.util.Objects;
+
+/**
+ * @Description: 自定义流程驳回类型
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/1/21
+ */
+public enum CustomFlowRejectTypeEnum {
+
+    PREV("上一节点"),
+
+    START("发起人节点"),
+
+    PREV_ALL("该节点前全部节点");
+
+    private String title;
+
+    private CustomFlowRejectTypeEnum(String title) {
+        this.title = title;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    /**
+     * 状态转换 toName
+     *
+     * @param title
+     * @return
+     */
+    public static String convertToName(String title) {
+        for (CustomFlowRejectTypeEnum e : CustomFlowRejectTypeEnum.values()) {
+            if (Objects.equals(title, e.getTitle())) {
+                return e.name();
+            }
+        }
+        return null;
+    }
+}

+ 44 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/enums/CustomFlowTypeEnum.java

@@ -0,0 +1,44 @@
+package com.qmth.distributed.print.business.enums;
+
+import java.util.Objects;
+
+/**
+ * @Description: 自定义流程审核用户类型
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2022/1/21
+ */
+public enum CustomFlowTypeEnum {
+
+    START("开始节点"),
+
+    PROCESS("过程节点"),
+
+    END("结束节点");
+
+    private String title;
+
+    private CustomFlowTypeEnum(String title) {
+        this.title = title;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    /**
+     * 状态转换 toName
+     *
+     * @param title
+     * @return
+     */
+    public static String convertToName(String title) {
+        for (CustomFlowTypeEnum e : CustomFlowTypeEnum.values()) {
+            if (Objects.equals(title, e.getTitle())) {
+                return e.name();
+            }
+        }
+        return null;
+    }
+}

+ 16 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/TFCustomFlowMapper.java

@@ -0,0 +1,16 @@
+package com.qmth.distributed.print.business.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.qmth.distributed.print.business.entity.TFCustomFlow;
+
+/**
+ * <p>
+ * 自定义流程表 Mapper 接口
+ * </p>
+ *
+ * @author wangliang
+ * @since 2022-01-21
+ */
+public interface TFCustomFlowMapper extends BaseMapper<TFCustomFlow> {
+
+}

+ 16 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TFCustomFlowService.java

@@ -0,0 +1,16 @@
+package com.qmth.distributed.print.business.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.qmth.distributed.print.business.entity.TFCustomFlow;
+
+/**
+ * <p>
+ * 自定义流程表 服务类
+ * </p>
+ *
+ * @author wangliang
+ * @since 2022-01-21
+ */
+public interface TFCustomFlowService extends IService<TFCustomFlow> {
+
+}

+ 20 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TFCustomFlowServiceImpl.java

@@ -0,0 +1,20 @@
+package com.qmth.distributed.print.business.service.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmth.distributed.print.business.entity.TFCustomFlow;
+import com.qmth.distributed.print.business.mapper.TFCustomFlowMapper;
+import com.qmth.distributed.print.business.service.TFCustomFlowService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 自定义流程表 服务实现类
+ * </p>
+ *
+ * @author wangliang
+ * @since 2022-01-21
+ */
+@Service
+public class TFCustomFlowServiceImpl extends ServiceImpl<TFCustomFlowMapper, TFCustomFlow> implements TFCustomFlowService {
+
+}

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

@@ -0,0 +1,5 @@
+<?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.qmth.distributed.print.business.mapper.TFCustomFlowMapper">
+
+</mapper>

+ 53 - 0
distributed-print/src/main/java/com/qmth/distributed/print/api/TFCustomFlowController.java

@@ -0,0 +1,53 @@
+package com.qmth.distributed.print.api;
+
+
+import com.qmth.boot.api.annotation.Aac;
+import com.qmth.boot.api.annotation.BOOL;
+import com.qmth.boot.api.constant.ApiConstant;
+import com.qmth.distributed.print.business.bean.flow.CustomFlowDto;
+import com.qmth.teachcloud.common.util.JacksonUtil;
+import com.qmth.teachcloud.common.util.Result;
+import com.qmth.teachcloud.common.util.ResultUtil;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiResponse;
+import io.swagger.annotations.ApiResponses;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.validation.BindingResult;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.validation.Valid;
+import java.util.List;
+
+/**
+ * <p>
+ * 自定义流程表 前端控制器
+ * </p>
+ *
+ * @author wangliang
+ * @since 2022-01-21
+ */
+@Api(tags = "自定义流程Controller")
+@RestController
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.customFlow}")
+@Aac(auth = BOOL.FALSE, strict = BOOL.FALSE)
+@Validated
+public class TFCustomFlowController {
+    private final static Logger log = LoggerFactory.getLogger(TFCustomFlowController.class);
+
+    @ApiOperation(value = "保存和发布流程")
+    @ApiResponses({@ApiResponse(code = 200, message = "常规信息", response = ResultUtil.class)})
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    public Result save(@Valid @RequestBody List<CustomFlowDto> customFlowDtoList, BindingResult bindingResult) {
+        if (bindingResult.hasErrors()) {
+            return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
+        }
+        log.info("customFlowDtoList:{}", JacksonUtil.parseJson(customFlowDtoList));
+        return ResultUtil.ok(true);
+    }
+}

+ 18 - 18
distributed-print/src/main/java/com/qmth/distributed/print/config/SwaggerConfig.java

@@ -30,25 +30,25 @@ public class SwaggerConfig {
 
     @Bean
     public Docket createRestApi() {
-//        ParameterBuilder tokenPar = new ParameterBuilder();
-//        ParameterBuilder tokenPar1 = new ParameterBuilder();
-//        ParameterBuilder tokenPar2 = new ParameterBuilder();
-//        ParameterBuilder tokenPar3 = new ParameterBuilder();
-//        ParameterBuilder tokenPar4 = new ParameterBuilder();
-//        ParameterBuilder tokenPar5 = new ParameterBuilder();
+        ParameterBuilder tokenPar = new ParameterBuilder();
+        ParameterBuilder tokenPar1 = new ParameterBuilder();
+        ParameterBuilder tokenPar2 = new ParameterBuilder();
+        ParameterBuilder tokenPar3 = new ParameterBuilder();
+        ParameterBuilder tokenPar4 = new ParameterBuilder();
+        ParameterBuilder tokenPar5 = new ParameterBuilder();
         List<Parameter> pars = new ArrayList<>();
-//        tokenPar.name(SystemConstant.HEADER_PLATFORM).description("平台").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
-//        tokenPar1.name(SystemConstant.HEADER_DEVICE_ID).description("设备id").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
-//        tokenPar2.name(SystemConstant.HEADER_AUTHORIZATION).description("鉴权token").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
-//        tokenPar3.name(SystemConstant.HEADER_TIME).description("时间戳").modelRef(new ModelRef("long")).parameterType("header").required(false).build();
-//        tokenPar4.name(SystemConstant.MD5.toLowerCase()).description("md5").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
-//        tokenPar5.name(SystemConstant.SCHOOL_ID).description("学校id").modelRef(new ModelRef("long")).parameterType("header").required(false).build();
-//        pars.add(tokenPar.build());
-//        pars.add(tokenPar1.build());
-//        pars.add(tokenPar2.build());
-//        pars.add(tokenPar3.build());
-//        pars.add(tokenPar4.build());
-//        pars.add(tokenPar5.build());
+        tokenPar.name(SystemConstant.HEADER_PLATFORM).description("平台").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
+        tokenPar1.name(SystemConstant.HEADER_DEVICE_ID).description("设备id").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
+        tokenPar2.name(SystemConstant.HEADER_AUTHORIZATION).description("鉴权token").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
+        tokenPar3.name(SystemConstant.HEADER_TIME).description("时间戳").modelRef(new ModelRef("long")).parameterType("header").required(false).build();
+        tokenPar4.name(SystemConstant.MD5.toLowerCase()).description("md5").modelRef(new ModelRef("string")).parameterType("header").required(false).build();
+        tokenPar5.name(SystemConstant.SCHOOL_ID).description("学校id").modelRef(new ModelRef("long")).parameterType("header").required(false).build();
+        pars.add(tokenPar.build());
+        pars.add(tokenPar1.build());
+        pars.add(tokenPar2.build());
+        pars.add(tokenPar3.build());
+        pars.add(tokenPar4.build());
+        pars.add(tokenPar5.build());
 
         return new Docket(DocumentationType.SWAGGER_2)
                 .groupName("distributed-print")