浏览代码

新增sop元数据增删改

wangliang 1 年之前
父节点
当前提交
48a022e6cd

+ 2 - 5
sop-business/src/main/java/com/qmth/sop/business/activiti/service/impl/ActivitiServiceImpl.java

@@ -447,11 +447,8 @@ public class ActivitiServiceImpl implements ActivitiService {
                             }
                         }
                     }
-                    if (!CollectionUtils.isEmpty(tdFormWidgetMetadataSet)) {
-                        tdFormWidgetMetadataService.deleteAllData(tfCustomFlow.getType());
-                        tdFormWidgetMetadataService.saveBatch(tdFormWidgetMetadataSet);
-                    }
-                    mySQLExec.execCreateSopDynamicTable(SystemConstant.SOP_DYNAMIC_TABLE_FILE_NAME, tfCustomFlow.getType());
+                    tdFormWidgetMetadataService.selectMetadataExist(tfCustomFlow.getType(), tfCustomFlow.getVersion(), tdFormWidgetMetadataSet);
+                    mySQLExec.execCreateSopDynamicTable(SystemConstant.SOP_DYNAMIC_TABLE_FILE_NAME, tfCustomFlow.getType(), tfCustomFlow.getVersion());
                 }
             }
         } else if (Objects.nonNull(flowId)) {

+ 37 - 0
sop-business/src/main/java/com/qmth/sop/business/entity/TDFormWidgetMetadata.java

@@ -1,10 +1,15 @@
 package com.qmth.sop.business.entity;
 
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.sop.common.contant.SystemConstant;
 import com.qmth.sop.common.enums.TFCustomTypeEnum;
 import com.qmth.sop.common.enums.WidgetCodeEnum;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 
 /**
@@ -20,33 +25,48 @@ public class TDFormWidgetMetadata implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "主键")
+    private Long id;
+
     @ApiModelProperty(value = "流程类型,OFFICE_SOP_FLOW:教务处SOP,CLOUD_MARK_SOP_FLOW:研究生SOP,DING_EXCEPTION_FLOW:考勤异常审核流程,PROJECT_EXCHANGE_FLOW:项目计划变更流程,QUALITY_PROBLEM_FLOW:质量问题反馈流程")
+    @NotNull(message = "流程类型不能为空")
     private TFCustomTypeEnum type;
 
     @ApiModelProperty(value = "流程部署id")
+    @NotBlank(message = "流程部署id不能为空")
     private String flowDeploymentId;
 
     @ApiModelProperty(value = "版本号")
+    @NotNull(message = "流程版本号不能为空")
     private Integer version;
 
     @ApiModelProperty(value = "编码,TEXT:文本,NUMBER:数字文本,TEXTAREA:文本域,编码,TEXT:文本,TEXTAREA:文本域,SINGLE_SELECT:单选下拉框,MULTIPLE_SELECT:多选下拉框,RADIO:单选框,CHECKBOX:复选框,DATE:日期,BUTTON:按钮,IMG:图片,VIDEO:视频,AUDIO:音频,FILE:文件,POP_SELECT:弹出选择框,LABEL:标签,TABLE:表格,SIGN:签名,CASCADE_ADDRESS:城市选择控件,OTHER:其它,FORM_GROUP_TITLE:带虚线分割线的标题,ONLE_TITLE:普通标题,独占一行,RADIO_WITH_INPUT:带1个输入框的单选框,DEVICE_IN_TABLE:设备入库表格,DEVICE_OUT_TABLE:设备出库表格,RADIO:单选框,CHECKBOX:复选框,DATE:日期,BUTTON:按钮,IMG:图片,VIDEO:视频,AUDIO:音频,FILE:文件,POP_SELECT:弹出选择框,LABEL:标签,TABLE:表格,SIGN:签名,CASCADE_ADDRESS:城市选择控件,OTHER:其它,FORM_GROUP_TITLE:带虚线分割线的标题,ONLE_TITLE:普通标题,独占一行,RADIO_WITH_INPUT:带1个输入框的单选框,DEVICE_IN_TABLE:设备入库表格,DEVICE_OUT_TABLE:设备出库表格")
+    @NotNull(message = "编码不能为空")
     private WidgetCodeEnum code;
 
     @ApiModelProperty(value = "字段id")
+    @NotBlank(message = "字段id不能为空")
     private String fieldId;
 
     @ApiModelProperty(value = "字段名称")
+    @NotBlank(message = "字段名称不能为空")
     private String fieldName;
 
     @ApiModelProperty(value = "字段标题")
+    @NotBlank(message = "字段标题不能为空")
     private String fieldTitle;
 
     @ApiModelProperty(value = "流程步骤")
+    @NotNull(message = "流程步骤不能为空")
     private Integer setup;
 
     @ApiModelProperty(value = "是否勾选,0:未勾选,1:勾选")
     private Boolean fieldCheck;
 
+    @ApiModelProperty(value = "是否是项目计划变更关联字段,0:不是,1:是")
+    private Boolean changeJoin;
+
     @ApiModelProperty(value = "创建时间")
     private Long createTime;
 
@@ -55,6 +75,7 @@ public class TDFormWidgetMetadata implements Serializable {
     }
 
     public TDFormWidgetMetadata(TFCustomTypeEnum type, String flowDeploymentId, Integer version, Integer setup, WidgetCodeEnum code, String fieldId, String fieldName, String fieldTitle) {
+        this.id = SystemConstant.getDbUuid();
         this.type = type;
         this.flowDeploymentId = flowDeploymentId;
         this.version = version;
@@ -67,6 +88,22 @@ public class TDFormWidgetMetadata implements Serializable {
         this.createTime = System.currentTimeMillis();
     }
 
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Boolean getChangeJoin() {
+        return changeJoin;
+    }
+
+    public void setChangeJoin(Boolean changeJoin) {
+        this.changeJoin = changeJoin;
+    }
+
     public Integer getSetup() {
         return setup;
     }

+ 4 - 3
sop-business/src/main/java/com/qmth/sop/business/exec/MySQLExec.java

@@ -65,13 +65,14 @@ public class MySQLExec {
      *
      * @param fileName
      * @param type
+     * @param version
      * @throws Exception
      */
-    public void execCreateSopDynamicTable(String fileName, TFCustomTypeEnum type) throws Exception {
+    public void execCreateSopDynamicTable(String fileName, TFCustomTypeEnum type, Integer version) throws Exception {
         Optional.ofNullable(fileName).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("文件名不能为空"));
         Optional.ofNullable(type).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程类型不能为空"));
 
-        TFCustomFlow tfCustomFlow = tfCustomFlowService.getOne(new QueryWrapper<TFCustomFlow>().lambda().eq(TFCustomFlow::getType, type));
+        TFCustomFlow tfCustomFlow = tfCustomFlowService.getOne(new QueryWrapper<TFCustomFlow>().lambda().eq(TFCustomFlow::getType, type).eq(TFCustomFlow::getVersion, version));
         Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_CUSTOM_NO_DATA.exception());
 
         String tableName = type.getTableName() + "_" + tfCustomFlow.getVersion();
@@ -87,7 +88,7 @@ public class MySQLExec {
             String string = new String(ou.toByteArray(), StandardCharsets.UTF_8);
 
             if (Objects.nonNull(string)) {
-                List<TDFormWidgetMetadata> tdFormWidgetMetadataList = tdFormWidgetMetadataService.list(new QueryWrapper<TDFormWidgetMetadata>().lambda().eq(TDFormWidgetMetadata::getType, type));
+                List<TDFormWidgetMetadata> tdFormWidgetMetadataList = tdFormWidgetMetadataService.list(new QueryWrapper<TDFormWidgetMetadata>().lambda().eq(TDFormWidgetMetadata::getType, type).eq(TDFormWidgetMetadata::getVersion, version));
                 StringJoiner stringJoiner = new StringJoiner(",\r\n");
                 for (TDFormWidgetMetadata t : tdFormWidgetMetadataList) {
                     if (t.getCode() == WidgetCodeEnum.TABLE) {

+ 9 - 12
sop-business/src/main/java/com/qmth/sop/business/mapper/TDFormWidgetMetadataMapper.java

@@ -1,10 +1,7 @@
 package com.qmth.sop.business.mapper;
 
-import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.qmth.sop.business.entity.TDFormWidgetMetadata;
-import org.apache.ibatis.annotations.Delete;
-import org.apache.ibatis.annotations.Param;
 
 /**
  * <p>
@@ -16,13 +13,13 @@ import org.apache.ibatis.annotations.Param;
  */
 public interface TDFormWidgetMetadataMapper extends BaseMapper<TDFormWidgetMetadata> {
 
-    /**
-     * 根据流程类型删除数据
-     *
-     * @param type
-     * @return
-     */
-    @InterceptorIgnore(blockAttack = "true")
-    @Delete("delete t from t_d_form_widget_metadata t where t.type = '${type}'")
-    Boolean deleteAllData(@Param("type") String type);
+//    /**
+//     * 根据流程类型删除数据
+//     *
+//     * @param type
+//     * @return
+//     */
+//    @InterceptorIgnore(blockAttack = "true")
+//    @Delete("delete t from t_d_form_widget_metadata t where t.type = '${type}'")
+//    Boolean deleteAllData(@Param("type") String type);
 }

+ 24 - 2
sop-business/src/main/java/com/qmth/sop/business/service/TDFormWidgetMetadataService.java

@@ -4,6 +4,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.sop.business.entity.TDFormWidgetMetadata;
 import com.qmth.sop.common.enums.TFCustomTypeEnum;
 
+import java.util.List;
+import java.util.Set;
+
 /**
  * <p>
  * 动态表单元数据表 服务类
@@ -15,10 +18,29 @@ import com.qmth.sop.common.enums.TFCustomTypeEnum;
 public interface TDFormWidgetMetadataService extends IService<TDFormWidgetMetadata> {
 
     /**
-     * 根据流程类型删除数据
+     * 根据流程类型、版本号查询元数据
+     *
+     * @param type
+     * @param version
+     * @param tdFormWidgetMetadataSet
+     * @return
+     */
+    Boolean selectMetadataExist(TFCustomTypeEnum type, Integer version, Set<TDFormWidgetMetadata> tdFormWidgetMetadataSet);
+
+    /**
+     * 查询所有sop元数据
      *
      * @param type
+     * @param version
+     * @return
+     */
+    List<TDFormWidgetMetadata> selectAll(TFCustomTypeEnum type, Integer version);
+
+    /**
+     * 保存sop元数据
+     *
+     * @param tdFormWidgetMetadataList
      * @return
      */
-    Boolean deleteAllData(TFCustomTypeEnum type);
+    Boolean save(List<TDFormWidgetMetadata> tdFormWidgetMetadataList);
 }

+ 8 - 0
sop-business/src/main/java/com/qmth/sop/business/service/TFCustomFlowService.java

@@ -32,4 +32,12 @@ public interface TFCustomFlowService extends IService<TFCustomFlow> {
      * @return
      */
     List<TFCustomFlow> findFlowDeploymentList();
+
+    /**
+     * 获取流程版本信息
+     *
+     * @param type
+     * @return
+     */
+    List<TFCustomFlow> findFlowVersion(TFCustomTypeEnum type);
 }

+ 68 - 3
sop-business/src/main/java/com/qmth/sop/business/service/impl/TDFormWidgetMetadataServiceImpl.java

@@ -1,13 +1,24 @@
 package com.qmth.sop.business.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmth.boot.api.exception.ApiException;
 import com.qmth.sop.business.entity.TDFormWidgetMetadata;
 import com.qmth.sop.business.mapper.TDFormWidgetMetadataMapper;
 import com.qmth.sop.business.service.TDFormWidgetMetadataService;
+import com.qmth.sop.common.contant.SystemConstant;
 import com.qmth.sop.common.enums.TFCustomTypeEnum;
+import com.qmth.sop.common.util.ResultUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
 
+import javax.annotation.Resource;
+import java.util.List;
 import java.util.Objects;
+import java.util.Set;
 
 /**
  * <p>
@@ -19,15 +30,69 @@ import java.util.Objects;
  */
 @Service
 public class TDFormWidgetMetadataServiceImpl extends ServiceImpl<TDFormWidgetMetadataMapper, TDFormWidgetMetadata> implements TDFormWidgetMetadataService {
+    private final static Logger log = LoggerFactory.getLogger(TDFormWidgetMetadataServiceImpl.class);
+
+    @Resource
+    TDFormWidgetMetadataService tdFormWidgetMetadataService;
+
+    /**
+     * 根据流程类型、版本号查询元数据
+     *
+     * @param type
+     * @param version
+     * @param tdFormWidgetMetadataSet
+     * @return
+     */
+    @Override
+    @Transactional
+    public Boolean selectMetadataExist(TFCustomTypeEnum type, Integer version, Set<TDFormWidgetMetadata> tdFormWidgetMetadataSet) {
+        try {
+            int count = tdFormWidgetMetadataService.count(new QueryWrapper<TDFormWidgetMetadata>().lambda().eq(TDFormWidgetMetadata::getType, type).eq(TDFormWidgetMetadata::getVersion, version));
+            if (count == 0) {
+                tdFormWidgetMetadataService.saveBatch(tdFormWidgetMetadataSet);
+            } else if (!CollectionUtils.isEmpty(tdFormWidgetMetadataSet) && count != tdFormWidgetMetadataSet.size()) {
+                tdFormWidgetMetadataService.remove(new QueryWrapper<TDFormWidgetMetadata>().lambda().eq(TDFormWidgetMetadata::getType, type).eq(TDFormWidgetMetadata::getVersion, version));
+                tdFormWidgetMetadataService.saveBatch(tdFormWidgetMetadataSet);
+            }
+        } catch (Exception e) {
+            log.error(SystemConstant.LOG_ERROR, e);
+            if (e instanceof ApiException) {
+                ResultUtil.error((ApiException) e, e.getMessage());
+            } else {
+                ResultUtil.error(e.getMessage());
+            }
+        }
+        return true;
+//        return this.baseMapper.deleteAllData(Objects.nonNull(type) ? type.name() : null);
+    }
 
     /**
-     * 根据流程类型删除数据
+     * 查询所有sop元数据
      *
      * @param type
+     * @param version
+     * @return
+     */
+    @Override
+    public List<TDFormWidgetMetadata> selectAll(TFCustomTypeEnum type, Integer version) {
+        QueryWrapper<TDFormWidgetMetadata> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda().eq(TDFormWidgetMetadata::getType, type);
+        if (Objects.nonNull(version)) {
+            queryWrapper.lambda().eq(TDFormWidgetMetadata::getVersion, version);
+        }
+        queryWrapper.lambda().orderByAsc(TDFormWidgetMetadata::getSetup);
+        return this.list(queryWrapper);
+    }
+
+    /**
+     * 保存sop元数据
+     *
+     * @param tdFormWidgetMetadataList
      * @return
      */
     @Override
-    public Boolean deleteAllData(TFCustomTypeEnum type) {
-        return this.baseMapper.deleteAllData(Objects.nonNull(type) ? type.name() : null);
+    @Transactional
+    public Boolean save(List<TDFormWidgetMetadata> tdFormWidgetMetadataList) {
+        return this.saveOrUpdateBatch(tdFormWidgetMetadataList);
     }
 }

+ 12 - 0
sop-business/src/main/java/com/qmth/sop/business/service/impl/TFCustomFlowServiceImpl.java

@@ -1,5 +1,6 @@
 package com.qmth.sop.business.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.sop.business.entity.TFCustomFlow;
 import com.qmth.sop.business.mapper.TFCustomFlowMapper;
@@ -43,4 +44,15 @@ public class TFCustomFlowServiceImpl extends ServiceImpl<TFCustomFlowMapper, TFC
     public List<TFCustomFlow> findFlowDeploymentList() {
         return this.baseMapper.findFlowDeploymentList();
     }
+
+    /**
+     * 获取流程版本信息
+     *
+     * @param type
+     * @return
+     */
+    @Override
+    public List<TFCustomFlow> findFlowVersion(TFCustomTypeEnum type) {
+        return this.list(new QueryWrapper<TFCustomFlow>().lambda().eq(TFCustomFlow::getType, type).orderByDesc(TFCustomFlow::getVersion));
+    }
 }

+ 43 - 1
sop-business/src/main/resources/db/log/wangliang_update_log.sql

@@ -955,4 +955,46 @@ ALTER TABLE t_d_form_widget_metadata CHANGE COLUMN code code VARCHAR(20)
 
 ALTER TABLE t_d_form_widget DROP COLUMN value;
 
-ALTER TABLE t_f_custom_flow_entity CHANGE COLUMN code code VARCHAR(30) COMMENT '编号' NOT NULL;
+ALTER TABLE t_f_custom_flow_entity CHANGE COLUMN code code VARCHAR(30) COMMENT '编号' NOT NULL;
+
+--2023.9.2update
+ALTER TABLE t_d_form_widget_metadata ADD change_join TINYINT COMMENT '是否是项目计划变更关联字段,0:不是,1:是' NULL after setup;
+
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3034, 'sop元数据查询接口', '/api/admin/sop/metadata/list', 'URL', 40, 5, 'AUTH', NULL, 1, 1, 0);
+INSERT INTO sys_privilege
+(id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
+VALUES(3035, 'sop元数据修改接口', '/api/admin/sop/metadata/save', 'URL', 40, 5, 'AUTH', NULL, 1, 1, 0);
+
+UPDATE sys_privilege
+SET name='教务处SOP管理', url='office', `type`='MENU', parent_id=40, `sequence`=1, property=NULL, related='3034,3035', enable=1, default_auth=0, front_display=1
+WHERE id=41;
+UPDATE sys_privilege
+SET name='云阅卷SOP管理', url='cloudMark', `type`='MENU', parent_id=40, `sequence`=2, property=NULL, related='3034,3035', enable=1, default_auth=0, front_display=1
+WHERE id=42;
+UPDATE sys_privilege
+SET name='列表', url='List', `type`='LIST', parent_id=41, `sequence`=1, property='AUTH', related='3034,3035', enable=1, default_auth=0, front_display=1
+WHERE id=171;
+UPDATE sys_privilege
+SET name='查询条件', url='Condition', `type`='CONDITION', parent_id=41, `sequence`=1, property='AUTH', related='3034,3035', enable=1, default_auth=0, front_display=1
+WHERE id=172;
+UPDATE sys_privilege
+SET name='查询', url='Select', `type`='BUTTON', parent_id=41, `sequence`=2, property='AUTH', related='3034,3035', enable=1, default_auth=0, front_display=1
+WHERE id=174;
+UPDATE sys_privilege
+SET name='列表', url='List', `type`='LIST', parent_id=42, `sequence`=1, property='AUTH', related='3034,3035', enable=1, default_auth=0, front_display=1
+WHERE id=180;
+UPDATE sys_privilege
+SET name='查询条件', url='Condition', `type`='CONDITION', parent_id=42, `sequence`=1, property='AUTH', related='3034,3035', enable=1, default_auth=0, front_display=1
+WHERE id=181;
+UPDATE sys_privilege
+SET name='查询', url='Select', `type`='BUTTON', parent_id=42, `sequence`=2, property='AUTH', related='3034,3035', enable=1, default_auth=0, front_display=1
+WHERE id=183;
+
+
+ALTER TABLE t_d_form_widget_metadata ADD id BIGINT
+    COMMENT '主键' NOT NULL first;
+
+ALTER TABLE t_d_form_widget_metadata ADD CONSTRAINT pkt_d_form_widget_metadata
+    PRIMARY KEY (id);

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

@@ -179,6 +179,7 @@ public class SystemConstant {
     public static final String PREFIX_URL_MY_WORK_BENCH = "/admin/my/work_bench";
     public static final String PREFIX_URL_PROJECT_EXCHANGE = "/admin/project/exchange";
     public static final String PREFIX_URL_DEVICE_IN_OUT = "/admin/device/in/out";
+    public static final String PREFIX_URL_SOP = "/admin/sop";
 
     /**
      * 缓存配置

+ 33 - 3
sop-server/src/main/java/com/qmth/sop/server/api/TBSopInfoController.java

@@ -1,9 +1,21 @@
 package com.qmth.sop.server.api;
 
 
-import org.springframework.web.bind.annotation.RequestMapping;
+import com.qmth.boot.api.constant.ApiConstant;
+import com.qmth.sop.business.bean.dto.UserDto;
+import com.qmth.sop.business.entity.TDFormWidgetMetadata;
+import com.qmth.sop.business.service.TDFormWidgetMetadataService;
+import com.qmth.sop.common.contant.SystemConstant;
+import com.qmth.sop.common.enums.TFCustomTypeEnum;
+import com.qmth.sop.common.util.Result;
+import com.qmth.sop.common.util.ResultUtil;
+import io.swagger.annotations.*;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.*;
 
-import org.springframework.web.bind.annotation.RestController;
+import javax.annotation.Resource;
+import javax.validation.Valid;
+import java.util.List;
 
 /**
  * <p>
@@ -13,8 +25,26 @@ import org.springframework.web.bind.annotation.RestController;
  * @author wangliang
  * @since 2023-08-01
  */
+@Api(tags = "sop管理Controller")
 @RestController
-@RequestMapping("/t-bsop-info")
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_SOP)
 public class TBSopInfoController {
 
+    @Resource
+    TDFormWidgetMetadataService tdFormWidgetMetadataService;
+
+    @ApiOperation(value = "sop元数据查询")
+    @RequestMapping(value = "/metadata/list", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = TDFormWidgetMetadata.class)})
+    public Result list(@ApiParam(value = "sop流程类型", required = true) @RequestParam TFCustomTypeEnum type,
+                       @ApiParam(value = "sop流程版本") @RequestParam(required = false) Integer version) {
+        return ResultUtil.ok(tdFormWidgetMetadataService.selectAll(type, version));
+    }
+
+    @ApiOperation(value = "sop元数据修改")
+    @RequestMapping(value = "/metadata/save", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = UserDto.class)})
+    public Result list(@Valid @ApiParam(value = "元数据保存信息", required = true) @RequestBody List<TDFormWidgetMetadata> tdFormWidgetMetadataList, BindingResult bindingResult) {
+        return ResultUtil.ok(tdFormWidgetMetadataService.save(tdFormWidgetMetadataList));
+    }
 }

+ 7 - 0
sop-server/src/main/java/com/qmth/sop/server/api/TFCustomFlowController.java

@@ -73,6 +73,13 @@ public class TFCustomFlowController {
         return ResultUtil.ok(tfCustomFlowService.findFlowDeploymentList());
     }
 
+    @ApiOperation(value = "获取流程版本信息")
+    @RequestMapping(value = "/version/list", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = TFCustomFlow.class)})
+    public Result getVersionList(@ApiParam(value = "sop流程类型", required = true) @RequestParam TFCustomTypeEnum type) {
+        return ResultUtil.ok(tfCustomFlowService.findFlowVersion(type));
+    }
+
     @ApiOperation(value = "获取流程表单属性接口")
     @RequestMapping(value = "/form_properties/get", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})