Sfoglia il codice sorgente

新增自定义流程属性-功能BUG修改

wangliang 3 anni fa
parent
commit
5569c7869c

+ 6 - 6
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFCustomFlowList.java → distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/TFCustomFlowEntity.java

@@ -16,8 +16,8 @@ import java.io.Serializable;
  * @author wangliang
  * @since 2022-02-18
  */
-@ApiModel(value = "TFCustomFlowList对象", description = "自定义流程列表")
-public class TFCustomFlowList extends BaseEntity implements Serializable {
+@ApiModel(value = "TFCustomFlowEntity对象", description = "自定义流程实体")
+public class TFCustomFlowEntity extends BaseEntity implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
@@ -32,22 +32,22 @@ public class TFCustomFlowList extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "流程过程变量数据")
     private String flowProcessVar;
 
-    public TFCustomFlowList() {
+    public TFCustomFlowEntity() {
 
     }
 
-    public TFCustomFlowList(Long tFCustomFlowId, Long userId) {
+    public TFCustomFlowEntity(Long tFCustomFlowId, Long userId) {
         this.tFCustomFlowId = tFCustomFlowId;
         this.insertInfo(userId);
     }
 
-    public TFCustomFlowList(Long tFCustomFlowId, String flowProcessVar, Long userId) {
+    public TFCustomFlowEntity(Long tFCustomFlowId, String flowProcessVar, Long userId) {
         this.tFCustomFlowId = tFCustomFlowId;
         this.flowProcessVar = flowProcessVar;
         this.insertInfo(userId);
     }
 
-    public TFCustomFlowList(Long tFCustomFlowId, Long flowId, String flowProcessVar, Long userId) {
+    public TFCustomFlowEntity(Long tFCustomFlowId, Long flowId, String flowProcessVar, Long userId) {
         this.tFCustomFlowId = tFCustomFlowId;
         this.flowId = flowId;
         this.flowProcessVar = flowProcessVar;

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/TFCustomFlowListMapper.java → distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/TFCustomFlowEntityMapper.java

@@ -1,7 +1,7 @@
 package com.qmth.distributed.print.business.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.qmth.distributed.print.business.entity.TFCustomFlowList;
+import com.qmth.distributed.print.business.entity.TFCustomFlowEntity;
 
 /**
  * <p>
@@ -11,6 +11,6 @@ import com.qmth.distributed.print.business.entity.TFCustomFlowList;
  * @author wangliang
  * @since 2022-02-18
  */
-public interface TFCustomFlowListMapper extends BaseMapper<TFCustomFlowList> {
+public interface TFCustomFlowEntityMapper extends BaseMapper<TFCustomFlowEntity> {
 
 }

+ 4 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TFCustomFlowListService.java → distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TFCustomFlowEntityService.java

@@ -1,7 +1,7 @@
 package com.qmth.distributed.print.business.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.qmth.distributed.print.business.entity.TFCustomFlowList;
+import com.qmth.distributed.print.business.entity.TFCustomFlowEntity;
 
 /**
  * <p>
@@ -11,7 +11,7 @@ import com.qmth.distributed.print.business.entity.TFCustomFlowList;
  * @author wangliang
  * @since 2022-02-18
  */
-public interface TFCustomFlowListService extends IService<TFCustomFlowList> {
+public interface TFCustomFlowEntityService extends IService<TFCustomFlowEntity> {
 
     /**
      * 根据自定义流程id查找
@@ -19,7 +19,7 @@ public interface TFCustomFlowListService extends IService<TFCustomFlowList> {
      * @param customFlowId
      * @return
      */
-    TFCustomFlowList findByCustomFlowId(Long customFlowId);
+    TFCustomFlowEntity findByCustomFlowId(Long customFlowId);
 
     /**
      * 根据流程id查找
@@ -27,5 +27,5 @@ public interface TFCustomFlowListService extends IService<TFCustomFlowList> {
      * @param flowId
      * @return
      */
-    TFCustomFlowList findByFlowId(Long flowId);
+    TFCustomFlowEntity findByFlowId(Long flowId);
 }

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

@@ -114,7 +114,7 @@ public class ActivitiServiceImpl implements ActivitiService {
     TFCustomFlowService tfCustomFlowService;
 
     @Resource
-    TFCustomFlowListService tfCustomFlowListService;
+    TFCustomFlowEntityService tfCustomFlowEntityService;
 
     /**
      * 注册流程
@@ -208,7 +208,7 @@ public class ActivitiServiceImpl implements ActivitiService {
      * @param map
      */
     protected void createFlowPicture(Map<String, Object> map) {
-        String id = (String) map.get(SystemConstant.FLOW_LIST_ID);
+        String id = (String) map.get(SystemConstant.FLOW_ENTITY_ID);
         String processDefinitionId = (String) map.get(SystemConstant.PROCESS_DEFINITION_ID);
         String bpmnPngName = id + DefaultInstanceConvertToMultiInstance.FLOW_BPMN_PNG_NAME;
 
@@ -379,8 +379,8 @@ public class ActivitiServiceImpl implements ActivitiService {
             Map<String, Object> objectMap = new HashMap<>();
             TFFlowLog tfFlowLog = null;
 
-            TFCustomFlowList tfCustomFlowList = tfCustomFlowListService.findByFlowId(flowId);
-            Map<String, Object> flowProcessVarMap = this.getFlowProcessVarMap(tfCustomFlowList);
+            TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.findByFlowId(flowId);
+            Map<String, Object> flowProcessVarMap = this.getFlowProcessVarMap(tfCustomFlowEntity);
 
             String remark = null;
             FlowTaskResult currFlowTaskResult = null, nextFlowTaskResult = null;
@@ -1103,8 +1103,8 @@ public class ActivitiServiceImpl implements ActivitiService {
             multiInstance = true;
         }
 
-        TFCustomFlowList tfCustomFlowList = tfCustomFlowListService.findByFlowId(tfFlowApprove.getFlowId());
-        Map<String, Object> flowProcessVarMap = this.getFlowProcessVarMap(tfCustomFlowList);
+        TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.findByFlowId(tfFlowApprove.getFlowId());
+        Map<String, Object> flowProcessVarMap = this.getFlowProcessVarMap(tfCustomFlowEntity);
         Map<String, CustomFlowVarDto> agginessMap = (Map<String, CustomFlowVarDto>) flowProcessVarMap.get(SystemConstant.AGGINESS_MAP);
         if (Objects.nonNull(tfFlowApprove.getTransferAssignee())) {
             agginessMap = JacksonUtil.readJson(tfFlowApprove.getTransferAssignee(), Map.class);
@@ -2203,7 +2203,7 @@ public class ActivitiServiceImpl implements ActivitiService {
         TFCustomFlow tfCustomFlow = tfCustomFlowService.findMaxVersion(sysUser.getSchoolId(), sysUser.getOrgId(), TFCustomTypeEnum.ELECTRON_FLOW);
         Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("未找到自定义流程数据"));
 
-        TFCustomFlowList tfCustomFlowList = new TFCustomFlowList(tfCustomFlow.getId(), sysUser.getId());
+        TFCustomFlowEntity tfCustomFlowEntity = new TFCustomFlowEntity(tfCustomFlow.getId(), sysUser.getId());
         Map<String, Object> flowProcessVarMap = this.getFlowProcessVarMap(tfCustomFlow);
         Map<String, CustomFlowVarDto> agginessMap = (Map<String, CustomFlowVarDto>) flowProcessVarMap.get(SystemConstant.AGGINESS_MAP);
         agginessMap.put(CustomFlowTypeEnum.USER_TASK.getId() + DefaultInstanceConvertToMultiInstance.DEFAULT_USER_TASK, new CustomFlowVarDto(SystemConstant.APPROVE_ID, new ArrayList(Arrays.asList(String.valueOf(approveId)))));
@@ -2212,21 +2212,21 @@ public class ActivitiServiceImpl implements ActivitiService {
         Map<String, Object> map = new HashMap<>();
         map.computeIfAbsent(SystemConstant.ID, v -> tfCustomFlow.getFlowKey());
         map.computeIfAbsent(SystemConstant.FLOW_PROCESS_VAR_MAP, v -> flowProcessVarMap);
-        map.computeIfAbsent(SystemConstant.FLOW_LIST_ID, v -> String.valueOf(tfCustomFlowList.getId()));
+        map.computeIfAbsent(SystemConstant.FLOW_ENTITY_ID, v -> String.valueOf(tfCustomFlowEntity.getId()));
         map.computeIfAbsent(SystemConstant.APPROVE_ID, v -> String.valueOf(approveId));
         map.computeIfAbsent(SystemConstant.EXAM_TASK_ID, v -> taskId);
         this.flowStart(map);
 
         tfCustomFlow.setActFlowId((String) map.get(SystemConstant.PROCESS_DEFINITION_ID));
-        tfCustomFlowList.setFlowId(SystemConstant.convertIdToLong((String) map.get(SystemConstant.FLOW_ID)));
+        tfCustomFlowEntity.setFlowId(SystemConstant.convertIdToLong((String) map.get(SystemConstant.FLOW_ID)));
 
         map.remove(SystemConstant.APPROVE_ID);
-        map.remove(SystemConstant.FLOW_LIST_ID);
+        map.remove(SystemConstant.FLOW_ENTITY_ID);
         map.remove(SystemConstant.PROCESS_DEFINITION_ID);
         map.remove(SystemConstant.FLOW_STATUS);
-        tfCustomFlowList.setFlowProcessVar(JacksonUtil.parseJson(map));
+        tfCustomFlowEntity.setFlowProcessVar(JacksonUtil.parseJson(map));
         tfCustomFlow.setUpdateId(sysUser.getId());
-        tfCustomFlowListService.save(tfCustomFlowList);
+        tfCustomFlowEntityService.save(tfCustomFlowEntity);
         tfCustomFlowService.updateById(tfCustomFlow);
     }
 
@@ -2242,9 +2242,9 @@ public class ActivitiServiceImpl implements ActivitiService {
         if (o instanceof TFCustomFlow) {
             o = (TFCustomFlow) o;
             varMap = JacksonUtil.readJson(((TFCustomFlow) o).getFlowProcessVar(), Map.class);
-        } else if (o instanceof TFCustomFlowList) {
-            o = (TFCustomFlowList) o;
-            varMap = JacksonUtil.readJson(((TFCustomFlowList) o).getFlowProcessVar(), Map.class);
+        } else if (o instanceof TFCustomFlowEntity) {
+            o = (TFCustomFlowEntity) o;
+            varMap = JacksonUtil.readJson(((TFCustomFlowEntity) o).getFlowProcessVar(), Map.class);
         }
         Optional.ofNullable(varMap).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("自定义流程变量数据为空"));
         Map<String, Object> flowProcessVarMap = (Map<String, Object>) varMap.get(SystemConstant.FLOW_PROCESS_VAR_MAP);

+ 46 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TFCustomFlowEntityServiceImpl.java

@@ -0,0 +1,46 @@
+package com.qmth.distributed.print.business.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmth.distributed.print.business.entity.TFCustomFlowEntity;
+import com.qmth.distributed.print.business.mapper.TFCustomFlowEntityMapper;
+import com.qmth.distributed.print.business.service.TFCustomFlowEntityService;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 自定义流程列表 服务实现类
+ * </p>
+ *
+ * @author wangliang
+ * @since 2022-02-18
+ */
+@Service
+public class TFCustomFlowEntityServiceImpl extends ServiceImpl<TFCustomFlowEntityMapper, TFCustomFlowEntity> implements TFCustomFlowEntityService {
+
+    /**
+     * 根据自定义流程id查找
+     *
+     * @param customFlowId
+     * @return
+     */
+    @Override
+    public TFCustomFlowEntity findByCustomFlowId(Long customFlowId) {
+        QueryWrapper<TFCustomFlowEntity> tfCustomFlowListQueryWrapper = new QueryWrapper<>();
+        tfCustomFlowListQueryWrapper.lambda().eq(TFCustomFlowEntity::gettFCustomFlowId, customFlowId);
+        return this.getOne(tfCustomFlowListQueryWrapper);
+    }
+
+    /**
+     * 根据流程id查找
+     *
+     * @param flowId
+     * @return
+     */
+    @Override
+    public TFCustomFlowEntity findByFlowId(Long flowId) {
+        QueryWrapper<TFCustomFlowEntity> tfCustomFlowListQueryWrapper = new QueryWrapper<>();
+        tfCustomFlowListQueryWrapper.lambda().eq(TFCustomFlowEntity::getFlowId, flowId);
+        return this.getOne(tfCustomFlowListQueryWrapper);
+    }
+}

+ 0 - 46
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TFCustomFlowListServiceImpl.java

@@ -1,46 +0,0 @@
-package com.qmth.distributed.print.business.service.impl;
-
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.qmth.distributed.print.business.entity.TFCustomFlowList;
-import com.qmth.distributed.print.business.mapper.TFCustomFlowListMapper;
-import com.qmth.distributed.print.business.service.TFCustomFlowListService;
-import org.springframework.stereotype.Service;
-
-/**
- * <p>
- * 自定义流程列表 服务实现类
- * </p>
- *
- * @author wangliang
- * @since 2022-02-18
- */
-@Service
-public class TFCustomFlowListServiceImpl extends ServiceImpl<TFCustomFlowListMapper, TFCustomFlowList> implements TFCustomFlowListService {
-
-    /**
-     * 根据自定义流程id查找
-     *
-     * @param customFlowId
-     * @return
-     */
-    @Override
-    public TFCustomFlowList findByCustomFlowId(Long customFlowId) {
-        QueryWrapper<TFCustomFlowList> tfCustomFlowListQueryWrapper = new QueryWrapper<>();
-        tfCustomFlowListQueryWrapper.lambda().eq(TFCustomFlowList::gettFCustomFlowId, customFlowId);
-        return this.getOne(tfCustomFlowListQueryWrapper);
-    }
-
-    /**
-     * 根据流程id查找
-     *
-     * @param flowId
-     * @return
-     */
-    @Override
-    public TFCustomFlowList findByFlowId(Long flowId) {
-        QueryWrapper<TFCustomFlowList> tfCustomFlowListQueryWrapper = new QueryWrapper<>();
-        tfCustomFlowListQueryWrapper.lambda().eq(TFCustomFlowList::getFlowId, flowId);
-        return this.getOne(tfCustomFlowListQueryWrapper);
-    }
-}

+ 1 - 1
distributed-print-business/src/main/resources/mapper/TFCustomFlowListMapper.xml → distributed-print-business/src/main/resources/mapper/TFCustomFlowEntityMapper.xml

@@ -1,5 +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.TFCustomFlowListMapper">
+<mapper namespace="com.qmth.distributed.print.business.mapper.TFCustomFlowEntityMapper">
 
 </mapper>

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

@@ -58,7 +58,7 @@ public class SystemConstant {
     public static final String ID = "id";
     public static final String MODEL = "model";
     public static final String VERSION = "version";
-    public static final String FLOW_LIST_ID = "flowListId";
+    public static final String FLOW_ENTITY_ID = "flowEntityId";
     public static final String FLOW_PROCESS_VAR_MAP = "flowProcessVarMap";
     public static final String PROCESS_DEFINITION_ID = "processDefinitionId";
     public static final String FILE = "file";