浏览代码

新增流程详细信息接口

wangliang 1 年之前
父节点
当前提交
9575323621
共有 21 个文件被更改,包括 809 次插入61 次删除
  1. 13 2
      sop-business/src/main/java/com/qmth/sop/business/activiti/service/ActivitiService.java
  2. 79 19
      sop-business/src/main/java/com/qmth/sop/business/activiti/service/impl/ActivitiServiceImpl.java
  3. 61 0
      sop-business/src/main/java/com/qmth/sop/business/bean/BaseFlowData.java
  4. 79 0
      sop-business/src/main/java/com/qmth/sop/business/bean/result/ApproveUserResult.java
  5. 3 0
      sop-business/src/main/java/com/qmth/sop/business/bean/result/FlowFormWidgetResult.java
  6. 131 0
      sop-business/src/main/java/com/qmth/sop/business/bean/result/FlowViewResult.java
  7. 155 0
      sop-business/src/main/java/com/qmth/sop/business/bean/result/TFFlowLogResult.java
  8. 149 0
      sop-business/src/main/java/com/qmth/sop/business/bean/result/TFFlowViewLogResult.java
  9. 12 1
      sop-business/src/main/java/com/qmth/sop/business/entity/TDFormWidget.java
  10. 0 11
      sop-business/src/main/java/com/qmth/sop/business/entity/TFFlowApprove.java
  11. 7 19
      sop-business/src/main/java/com/qmth/sop/business/entity/TFFlowLog.java
  12. 11 0
      sop-business/src/main/java/com/qmth/sop/business/mapper/TFFlowLogMapper.java
  13. 1 1
      sop-business/src/main/java/com/qmth/sop/business/service/SysUserService.java
  14. 10 0
      sop-business/src/main/java/com/qmth/sop/business/service/TFFlowLogService.java
  15. 2 1
      sop-business/src/main/java/com/qmth/sop/business/service/impl/SysUserServiceImpl.java
  16. 7 0
      sop-business/src/main/java/com/qmth/sop/business/service/impl/TFFlowLogServiceImpl.java
  17. 43 0
      sop-business/src/main/resources/mapper/TFFlowLogMapper.xml
  18. 10 0
      sop-common/src/main/java/com/qmth/sop/common/enums/ExceptionResultEnum.java
  19. 25 0
      sop-common/src/main/java/com/qmth/sop/common/enums/FlowMsgTypeEnum.java
  20. 10 5
      sop-server/src/main/java/com/qmth/sop/server/api/ActivitiFromHtmlController.java
  21. 1 2
      sop-server/src/main/java/com/qmth/sop/server/api/SysController.java

+ 13 - 2
sop-business/src/main/java/com/qmth/sop/business/activiti/service/ActivitiService.java

@@ -1,6 +1,7 @@
 package com.qmth.sop.business.activiti.service;
 
 import com.qmth.sop.business.bean.bean.FormPropertyBean;
+import com.qmth.sop.business.bean.result.FlowViewResult;
 import com.qmth.sop.common.enums.FlowApprovePassEnum;
 import com.qmth.sop.common.enums.TFCustomTypeEnum;
 
@@ -76,13 +77,23 @@ public interface ActivitiService {
      *
      * @param userId
      * @param taskId
+     * @return
      */
-    public void taskApproverExchange(Long userId, Long taskId);
+    public Boolean taskApproverExchange(Long userId, Long taskId);
 
     /**
      * 流程终止
      *
      * @param flowId
+     * @return
+     */
+    public Boolean flowEnd(Long flowId);
+
+    /**
+     * 获取流程详细信息接口
+     *
+     * @param flowId
+     * @return
      */
-    public void flowEnd(Long flowId);
+    public FlowViewResult flowView(Long flowId);
 }

+ 79 - 19
sop-business/src/main/java/com/qmth/sop/business/activiti/service/impl/ActivitiServiceImpl.java

@@ -2,11 +2,12 @@ package com.qmth.sop.business.activiti.service.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.google.gson.Gson;
+import com.google.gson.reflect.TypeToken;
 import com.qmth.boot.api.exception.ApiException;
 import com.qmth.sop.business.activiti.service.ActivitiService;
 import com.qmth.sop.business.bean.bean.FormPropertyBean;
-import com.qmth.sop.business.bean.result.FlowResult;
-import com.qmth.sop.business.bean.result.FlowTaskResult;
+import com.qmth.sop.business.bean.result.*;
 import com.qmth.sop.business.entity.TFCustomFlow;
 import com.qmth.sop.business.entity.TFCustomFlowEntity;
 import com.qmth.sop.business.entity.TFFlowApprove;
@@ -44,6 +45,7 @@ import org.springframework.util.CollectionUtils;
 import javax.annotation.Resource;
 import java.io.IOException;
 import java.util.*;
+import java.util.stream.Collectors;
 import java.util.zip.ZipInputStream;
 
 /**
@@ -149,7 +151,7 @@ public class ActivitiServiceImpl implements ActivitiService {
         FlowResult flowResult = null;
         if (Objects.nonNull(flowDeploymentId) && Objects.isNull(taskId)) {
             TFCustomFlow tfCustomFlow = tfCustomFlowService.getOne(new QueryWrapper<TFCustomFlow>().lambda().eq(TFCustomFlow::getFlowDeploymentId, flowDeploymentId));
-            Optional.ofNullable(tfCustomFlow.getFlowProcessVar()).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程没有部署数据!"));
+            Optional.ofNullable(tfCustomFlow.getFlowProcessVar()).orElseThrow(() -> ExceptionResultEnum.FLOW_PROCESS_VAR_NO_DATA.exception());
 
             map.put(SystemConstant.DEFAULT_ASSIGNEE_LIST + 1, approveUserIds);
             ProcessInstance processInstance = runtimeService.startProcessInstanceById(tfCustomFlow.getFlowDefinitionId(), map);
@@ -159,7 +161,7 @@ public class ActivitiServiceImpl implements ActivitiService {
             flowResult = JSONObject.parseObject(tfCustomFlow.getFlowProcessVar(), FlowResult.class);
         } else if (Objects.nonNull(taskId)) {
             taskTemp = taskService.createTaskQuery().taskId(String.valueOf(taskId)).singleResult();
-            Optional.ofNullable(taskTemp).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程任务数据为空!"));
+            Optional.ofNullable(taskTemp).orElseThrow(() -> ExceptionResultEnum.FLOW_TASK_NO_DATA.exception());
             processFlowId = taskTemp.getProcessInstanceId();
         }
 
@@ -173,11 +175,11 @@ public class ActivitiServiceImpl implements ActivitiService {
                 taskList = taskService.createTaskQuery().processInstanceId(processFlowId).list();
             } else {
                 tfCustomFlowEntity = tfCustomFlowEntityService.getOne(new QueryWrapper<TFCustomFlowEntity>().lambda().eq(TFCustomFlowEntity::getFlowId, Long.parseLong(processFlowId)));
-                Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程没有实例数据!"));
+                Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
                 flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
 
                 tfFlowApprove = tfFlowApproveService.getOne(new QueryWrapper<TFFlowApprove>().lambda().eq(TFFlowApprove::getFlowId, Long.parseLong(processFlowId)));
-                Optional.ofNullable(tfFlowApprove).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程没有审批数据!"));
+                Optional.ofNullable(tfFlowApprove).orElseThrow(() -> ExceptionResultEnum.FLOW_APPROVE_NO_DATA.exception());
                 taskList.add(taskTemp);
             }
             List<TFFlowLog> tfFlowLogList = new ArrayList<>();
@@ -336,7 +338,7 @@ public class ActivitiServiceImpl implements ActivitiService {
         List<Task> taskList = null;
         if (Objects.nonNull(flowDeploymentId)) {
             tfCustomFlow = tfCustomFlowService.getOne(new QueryWrapper<TFCustomFlow>().lambda().eq(TFCustomFlow::getFlowDeploymentId, flowDeploymentId));
-            Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程没有部署数据!"));
+            Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_DEPLOYMENT_NO_DATA.exception());
             if (Objects.isNull(tfCustomFlow.getFlowDefinitionId())) {
                 String processDefinitionId = this.findProcessDefinitionIdByDeploymentId(flowDeploymentId);
                 tfCustomFlow.setFlowDefinitionId(processDefinitionId);
@@ -370,9 +372,9 @@ public class ActivitiServiceImpl implements ActivitiService {
         if (!CollectionUtils.isEmpty(taskList)) {
             for (Task t : taskList) {
                 TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.getOne(new QueryWrapper<TFCustomFlowEntity>().lambda().eq(TFCustomFlowEntity::getFlowId, Long.parseLong(t.getProcessInstanceId())));
-                Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程没有实例数据!"));
+                Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
                 TFCustomFlow tfCustomFlow = tfCustomFlowService.getById(tfCustomFlowEntity.gettFCustomFlowId());
-                Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程没有部署数据!"));
+                Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_DEPLOYMENT_NO_DATA.exception());
 
                 FlowResult flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
                 LinkedHashMap<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
@@ -381,7 +383,7 @@ public class ActivitiServiceImpl implements ActivitiService {
                     map = this.getFlowFormPropertie(flowResult, map, currFlowTaskResult.getSetup());
                 }
                 TFFlowApprove tfFlowApprove = tfFlowApproveService.getOne(new QueryWrapper<TFFlowApprove>().lambda().eq(TFFlowApprove::getFlowId, Long.parseLong(t.getProcessInstanceId())));
-                Optional.ofNullable(tfFlowApprove).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程没有审批数据!"));
+                Optional.ofNullable(tfFlowApprove).orElseThrow(() -> ExceptionResultEnum.FLOW_APPROVE_NO_DATA.exception());
 
                 formPropertyList.add(new FormPropertyBean(Long.parseLong(t.getProcessInstanceId()), Long.parseLong(t.getId()), userId, (FlowTaskResult) map.get(SystemConstant.FORM_PROPERTIES), tfFlowApprove.getStatus(), String.valueOf(tfCustomFlowEntity.getId())));
             }
@@ -394,17 +396,18 @@ public class ActivitiServiceImpl implements ActivitiService {
      *
      * @param userId
      * @param taskId
+     * @return
      */
     @Override
     @Transactional
-    public void taskApproverExchange(Long userId, Long taskId) {
+    public Boolean taskApproverExchange(Long userId, Long taskId) {
         boolean lock = memoryLock.lock(SystemConstant.LOCK_FLOW_EXCHANGE_PREFIX + taskId, taskId, SystemConstant.LOCK_FLOW_TIME_OUT);
         if (!lock) {
             throw ExceptionResultEnum.ERROR.exception("正在转审中,请稍候再试!");
         }
         try {
             Task task = taskService.createTaskQuery().taskId(String.valueOf(taskId)).singleResult();
-            Optional.ofNullable(task).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程任务数据为空!"));
+            Optional.ofNullable(task).orElseThrow(() -> ExceptionResultEnum.FLOW_TASK_NO_DATA.exception());
 
             if (Objects.equals(task.getAssignee(), String.valueOf(userId))) {
                 throw ExceptionResultEnum.ERROR.exception("不能转给自己!");
@@ -427,7 +430,7 @@ public class ActivitiServiceImpl implements ActivitiService {
             taskService.setAssignee(String.valueOf(taskId), String.valueOf(userId));
 
             TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.getOne(new QueryWrapper<TFCustomFlowEntity>().lambda().eq(TFCustomFlowEntity::getFlowId, Long.parseLong(task.getProcessInstanceId())));
-            Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程没有实例数据!"));
+            Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
 
             FlowResult flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
             LinkedHashMap<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
@@ -448,32 +451,34 @@ public class ActivitiServiceImpl implements ActivitiService {
         } finally {
             memoryLock.unlock(SystemConstant.LOCK_FLOW_EXCHANGE_PREFIX + taskId);
         }
+        return true;
     }
 
     /**
      * 流程终止
      *
      * @param flowId
+     * @return
      */
     @Override
     @Transactional
-    public void flowEnd(Long flowId) {
+    public Boolean flowEnd(Long flowId) {
         boolean lock = memoryLock.lock(SystemConstant.LOCK_FLOW_END_PREFIX + flowId, flowId, SystemConstant.LOCK_FLOW_TIME_OUT);
         if (!lock) {
             throw ExceptionResultEnum.ERROR.exception("正在终止中,请稍候再试!");
         }
         try {
             TFFlowApprove tfFlowApprove = tfFlowApproveService.getOne(new QueryWrapper<TFFlowApprove>().lambda().eq(TFFlowApprove::getFlowId, flowId));
-            Optional.ofNullable(tfFlowApprove).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程没有审批数据!"));
+            Optional.ofNullable(tfFlowApprove).orElseThrow(() -> ExceptionResultEnum.FLOW_APPROVE_NO_DATA.exception());
 
             TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.getOne(new QueryWrapper<TFCustomFlowEntity>().lambda().eq(TFCustomFlowEntity::getFlowId, flowId));
-            Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程没有实例数据!"));
+            Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
 
             FlowResult flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
             LinkedHashMap<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
             List<Task> taskList = taskService.createTaskQuery().processInstanceId(String.valueOf(flowId)).list();
             if (CollectionUtils.isEmpty(taskList)) {
-                throw ExceptionResultEnum.ERROR.exception("流程任务数据为空!");
+                throw ExceptionResultEnum.FLOW_TASK_NO_DATA.exception();
             }
             FlowTaskResult currFlowTaskResult = GsonUtil.fromJson(GsonUtil.toJson(setupMap.get(taskList.get(0).getTaskDefinitionKey())), FlowTaskResult.class);
 
@@ -499,6 +504,61 @@ public class ActivitiServiceImpl implements ActivitiService {
         } finally {
             memoryLock.unlock(SystemConstant.LOCK_FLOW_END_PREFIX + flowId);
         }
+        return true;
+    }
+
+    /**
+     * 获取流程详细信息接口
+     *
+     * @param flowId
+     * @return
+     */
+    @Override
+    public FlowViewResult flowView(Long flowId) {
+        TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.getOne(new QueryWrapper<TFCustomFlowEntity>().lambda().eq(TFCustomFlowEntity::getFlowId, flowId));
+        Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
+
+        //获取当前流程节点
+        TFFlowApprove tfFlowApprove = tfFlowApproveService.getOne(new QueryWrapper<TFFlowApprove>().lambda().eq(TFFlowApprove::getFlowId, flowId));
+        Optional.ofNullable(tfFlowApprove).orElseThrow(() -> ExceptionResultEnum.FLOW_APPROVE_NO_DATA.exception());
+
+        FlowResult flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
+        LinkedHashMap<String, FlowTaskResult> setupMap = flowResult.getSetupMap();
+
+        Gson gson = new Gson();
+        FlowTaskResult currFlowTaskResult = null;
+        List<FlowTaskResult> flowTaskHistoryList = null;
+        List<Long> taskIdList = null;
+
+        List<TFFlowViewLogResult> flowApproveHistoryList = null;
+        Map<Integer, Integer> approveSetupMap = new HashMap<>();
+        //获取流程审批历史
+        List<TFFlowLogResult> tfFlowLogResultList = tfFlowLogService.findByObjectId(tfCustomFlowEntity.getId());
+        if (!CollectionUtils.isEmpty(tfFlowLogResultList)) {
+            flowApproveHistoryList = gson.fromJson(gson.toJson(tfFlowLogResultList), new TypeToken<List<TFFlowViewLogResult>>() {
+            }.getType());
+            for (TFFlowViewLogResult t : flowApproveHistoryList) {
+                t.setMessageType(FlowMsgTypeEnum.STANDARD);
+                approveSetupMap.put(t.getApproveSetup(), t.getApproveSetup());
+            }
+        }
+        for (Map.Entry<String, FlowTaskResult> entry : setupMap.entrySet()) {
+            FlowTaskResult flowTaskResult = gson.fromJson(gson.toJson(entry.getValue()), FlowTaskResult.class);
+            if (flowTaskResult.getSetup() > 0) {
+                //正在审批的表单
+                if (Objects.nonNull(tfFlowApprove.getSetup()) && flowTaskResult.getSetup().intValue() == tfFlowApprove.getSetup().intValue()) {
+                    currFlowTaskResult = flowTaskResult;
+                    List<Task> taskList = taskService.createTaskQuery().processInstanceId(String.valueOf(flowId)).list();
+                    if (!CollectionUtils.isEmpty(taskList)) {
+                        taskIdList = taskList.stream().map(s -> Long.parseLong(s.getId())).collect(Collectors.toList());
+                    }
+                } else if (approveSetupMap.containsKey(flowTaskResult.getSetup())) {//已经审批过的表单
+                    flowTaskHistoryList = CollectionUtils.isEmpty(flowTaskHistoryList) ? new ArrayList<>(approveSetupMap.size()) : flowTaskHistoryList;
+                    flowTaskHistoryList.add(flowTaskResult);
+                }
+            }
+        }
+        return new FlowViewResult(flowId, tfFlowApprove.getStatus(), String.valueOf(tfFlowApprove.getId()), taskIdList, flowTaskHistoryList, currFlowTaskResult, flowApproveHistoryList);
     }
 
     /**
@@ -519,9 +579,9 @@ public class ActivitiServiceImpl implements ActivitiService {
         }
         Long flowId = Long.parseLong(taskList.get(0).getProcessInstanceId());
         TFCustomFlowEntity tfCustomFlowEntity = tfCustomFlowEntityService.getOne(new QueryWrapper<TFCustomFlowEntity>().lambda().eq(TFCustomFlowEntity::getFlowId, flowId));
-        Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程没有实例数据!"));
+        Optional.ofNullable(tfCustomFlowEntity).orElseThrow(() -> ExceptionResultEnum.FLOW_ENTITY_NO_DATA.exception());
         tfCustomFlow = tfCustomFlowService.getById(tfCustomFlowEntity.gettFCustomFlowId());
-        Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.ERROR.exception("流程没有部署数据!"));
+        Optional.ofNullable(tfCustomFlow).orElseThrow(() -> ExceptionResultEnum.FLOW_DEPLOYMENT_NO_DATA.exception());
 
         flowResult = JSONObject.parseObject(tfCustomFlowEntity.getFlowProcessVar(), FlowResult.class);
         LinkedHashMap<String, FlowTaskResult> setupMap = flowResult.getSetupMap();

+ 61 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/BaseFlowData.java

@@ -0,0 +1,61 @@
+package com.qmth.sop.business.bean;
+
+import com.qmth.sop.common.enums.FlowMsgTypeEnum;
+import com.qmth.sop.common.enums.TFCustomTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 基础流程信息
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2023/6/14
+ */
+public class BaseFlowData implements Serializable {
+
+    @ApiModelProperty(value = "流程类型")
+    TFCustomTypeEnum flowType;
+
+    @ApiModelProperty(value = "消息类型")
+    FlowMsgTypeEnum messageType;
+
+    @ApiModelProperty(value = "待办链接")
+    String url;
+
+    @ApiModelProperty(value = "移动待办链接")
+    String mobileUrl;
+
+    public FlowMsgTypeEnum getMessageType() {
+        return messageType;
+    }
+
+    public void setMessageType(FlowMsgTypeEnum messageType) {
+        this.messageType = messageType;
+    }
+
+    public TFCustomTypeEnum getFlowType() {
+        return flowType;
+    }
+
+    public void setFlowType(TFCustomTypeEnum flowType) {
+        this.flowType = flowType;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getMobileUrl() {
+        return mobileUrl;
+    }
+
+    public void setMobileUrl(String mobileUrl) {
+        this.mobileUrl = mobileUrl;
+    }
+}

+ 79 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/result/ApproveUserResult.java

@@ -0,0 +1,79 @@
+package com.qmth.sop.business.bean.result;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.sop.business.entity.SysUser;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 审批人 result
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2021/8/17
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class ApproveUserResult extends SysUser implements Serializable {
+
+    @ApiModelProperty(value = "机构名称")
+    private String orgName;
+
+    @ApiModelProperty(value = "流程待审批人")
+    private String pendApproveUsers;
+
+    @ApiModelProperty(value = "角色id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long roleId;
+
+    @ApiModelProperty(value = "用户id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long userId;
+
+    public ApproveUserResult() {
+
+    }
+
+    public ApproveUserResult(String orgName, String loginName, String realName, Long schoolId, String code, String mobileNumber, Long createTime, String paperUrls) {
+        this.orgName = orgName;
+        setLoginName(loginName);
+        setRealName(realName);
+        setCode(code);
+        setMobileNumber(mobileNumber);
+        setCreateTime(createTime);
+    }
+
+    public Long getRoleId() {
+        return roleId;
+    }
+
+    public void setRoleId(Long roleId) {
+        this.roleId = roleId;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public String getPendApproveUsers() {
+        return pendApproveUsers;
+    }
+
+    public void setPendApproveUsers(String pendApproveUsers) {
+        this.pendApproveUsers = pendApproveUsers;
+    }
+
+    public String getOrgName() {
+        return orgName;
+    }
+
+    public void setOrgName(String orgName) {
+        this.orgName = orgName;
+    }
+}

+ 3 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/result/FlowFormWidgetResult.java

@@ -86,6 +86,9 @@ public class FlowFormWidgetResult implements Serializable {
     @ApiModelProperty(value = "名称")
     private String name;
 
+    @ApiModelProperty(value = "占宽符")
+    private Integer span;
+
     @ApiModelProperty(value = "表格信息")
     private List<FlowTablePropResult> tablePropList;
 

+ 131 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/result/FlowViewResult.java

@@ -0,0 +1,131 @@
+package com.qmth.sop.business.bean.result;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.sop.business.bean.BaseFlowData;
+import com.qmth.sop.common.enums.FlowStatusEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * @Description: 流程查看result
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2021/8/6
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class FlowViewResult extends BaseFlowData implements Serializable {
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "流程id")
+    Long flowId;
+
+    @ApiModelProperty(value = "流程状态")
+    FlowStatusEnum status;
+
+    @ApiModelProperty(value = "流程状态")
+    String statusStr;
+
+    @ApiModelProperty(value = "sopid")
+    String sopId;
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "流程任务id集合")
+    private List<Long> taskIdList;
+
+    @ApiModelProperty(value = "当前流程节点")
+    private FlowTaskResult currFlowTaskResult;
+
+    @ApiModelProperty(value = "历史流程节点信息")
+    List<FlowTaskResult> flowTaskHistoryList;
+
+    @ApiModelProperty(value = "流程审批信息")
+    List<TFFlowViewLogResult> flowApproveHistoryList;
+
+    public FlowViewResult() {
+
+    }
+
+    public FlowViewResult(Long flowId, FlowStatusEnum status, String sopId, List<Long> taskIdList, List<FlowTaskResult> flowTaskHistoryList, FlowTaskResult currFlowTaskResult, List<TFFlowViewLogResult> flowApproveHistoryList) {
+        this.flowId = flowId;
+        this.status = status;
+        this.sopId = sopId;
+        this.taskIdList = taskIdList;
+        this.flowTaskHistoryList = flowTaskHistoryList;
+        this.flowApproveHistoryList = flowApproveHistoryList;
+        this.currFlowTaskResult = currFlowTaskResult;
+    }
+
+    public Long getFlowId() {
+        return flowId;
+    }
+
+    public void setFlowId(Long flowId) {
+        this.flowId = flowId;
+    }
+
+    public FlowStatusEnum getStatus() {
+        return status;
+    }
+
+    public void setStatus(FlowStatusEnum status) {
+        this.status = status;
+    }
+
+    public String getStatusStr() {
+        if (Objects.nonNull(status)) {
+            return status.getTitle();
+        } else {
+            return statusStr;
+        }
+    }
+
+    public void setStatusStr(String statusStr) {
+        this.statusStr = statusStr;
+    }
+
+    public String getSopId() {
+        return sopId;
+    }
+
+    public void setSopId(String sopId) {
+        this.sopId = sopId;
+    }
+
+    public List<Long> getTaskIdList() {
+        return taskIdList;
+    }
+
+    public void setTaskIdList(List<Long> taskIdList) {
+        this.taskIdList = taskIdList;
+    }
+
+    public FlowTaskResult getCurrFlowTaskResult() {
+        return currFlowTaskResult;
+    }
+
+    public void setCurrFlowTaskResult(FlowTaskResult currFlowTaskResult) {
+        this.currFlowTaskResult = currFlowTaskResult;
+    }
+
+    public List<FlowTaskResult> getFlowTaskHistoryList() {
+        return flowTaskHistoryList;
+    }
+
+    public void setFlowTaskHistoryList(List<FlowTaskResult> flowTaskHistoryList) {
+        this.flowTaskHistoryList = flowTaskHistoryList;
+    }
+
+    public List<TFFlowViewLogResult> getFlowApproveHistoryList() {
+        return flowApproveHistoryList;
+    }
+
+    public void setFlowApproveHistoryList(List<TFFlowViewLogResult> flowApproveHistoryList) {
+        this.flowApproveHistoryList = flowApproveHistoryList;
+    }
+}

+ 155 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/result/TFFlowLogResult.java

@@ -0,0 +1,155 @@
+package com.qmth.sop.business.bean.result;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.sop.common.enums.FlowApproveOperationEnum;
+import com.qmth.sop.common.enums.TFCustomTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: TFFlowLogResult
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2021/11/22
+ */
+public class TFFlowLogResult extends ApproveUserResult implements Serializable {
+
+    @ApiModelProperty(value = "流程类型")
+    TFCustomTypeEnum flowType;
+
+    @ApiModelProperty(value = "流程id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long flowId;
+
+    @ApiModelProperty(value = "实体id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long objectId;
+
+    @ApiModelProperty(value = "审核人id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long approveId;
+
+    @ApiModelProperty(value = "审核步骤")
+    private Integer approveSetup;
+
+    @ApiModelProperty(value = "审核意见")
+    private String approveRemark;
+
+    @ApiModelProperty(value = "审批操作,SUBMIT:提交,APPROVE:审批,REJECT:驳回,END:终止,EXCHANGE:转他人审批")
+    private FlowApproveOperationEnum approveOperation;
+
+    @ApiModelProperty(value = "待审核人id")
+    private String pendApproveId;
+
+    @ApiModelProperty(value = "附件id集合")
+    private String attachmentIds;
+
+    @ApiModelProperty(value = "待审核人")
+    private String pendApproveUserName;
+
+    @ApiModelProperty(value = "已审核人")
+    private String approveUserName;
+
+    @ApiModelProperty(value = "流程节点id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long taskId;
+
+    public TFCustomTypeEnum getFlowType() {
+        return flowType;
+    }
+
+    public void setFlowType(TFCustomTypeEnum flowType) {
+        this.flowType = flowType;
+    }
+
+    public Long getTaskId() {
+        return taskId;
+    }
+
+    public void setTaskId(Long taskId) {
+        this.taskId = taskId;
+    }
+
+    public String getPendApproveUserName() {
+        return pendApproveUserName;
+    }
+
+    public void setPendApproveUserName(String pendApproveUserName) {
+        this.pendApproveUserName = pendApproveUserName;
+    }
+
+    public String getApproveUserName() {
+        return approveUserName;
+    }
+
+    public void setApproveUserName(String approveUserName) {
+        this.approveUserName = approveUserName;
+    }
+
+    public Long getFlowId() {
+        return flowId;
+    }
+
+    public void setFlowId(Long flowId) {
+        this.flowId = flowId;
+    }
+
+    public Long getObjectId() {
+        return objectId;
+    }
+
+    public void setObjectId(Long objectId) {
+        this.objectId = objectId;
+    }
+
+    public Long getApproveId() {
+        return approveId;
+    }
+
+    public void setApproveId(Long approveId) {
+        this.approveId = approveId;
+    }
+
+    public Integer getApproveSetup() {
+        return approveSetup;
+    }
+
+    public void setApproveSetup(Integer approveSetup) {
+        this.approveSetup = approveSetup;
+    }
+
+    public String getApproveRemark() {
+        return approveRemark;
+    }
+
+    public void setApproveRemark(String approveRemark) {
+        this.approveRemark = approveRemark;
+    }
+
+    public FlowApproveOperationEnum getApproveOperation() {
+        return approveOperation;
+    }
+
+    public void setApproveOperation(FlowApproveOperationEnum approveOperation) {
+        this.approveOperation = approveOperation;
+    }
+
+    public String getPendApproveId() {
+        return pendApproveId;
+    }
+
+    public void setPendApproveId(String pendApproveId) {
+        this.pendApproveId = pendApproveId;
+    }
+
+    public String getAttachmentIds() {
+        return attachmentIds;
+    }
+
+    public void setAttachmentIds(String attachmentIds) {
+        this.attachmentIds = attachmentIds;
+    }
+}

+ 149 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/result/TFFlowViewLogResult.java

@@ -0,0 +1,149 @@
+package com.qmth.sop.business.bean.result;
+
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.sop.business.bean.BaseFlowData;
+import com.qmth.sop.common.enums.FlowApproveOperationEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: TFFlowLogResult
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2021/11/22
+ */
+public class TFFlowViewLogResult extends BaseFlowData implements Serializable {
+
+    @ApiModelProperty(value = "流程id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long flowId;
+
+    @ApiModelProperty(value = "任务id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long objectId;
+
+    @ApiModelProperty(value = "审核人id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long approveId;
+
+    @ApiModelProperty(value = "审核步骤")
+    private Integer approveSetup;
+
+    @ApiModelProperty(value = "审核意见")
+    private String approveRemark;
+
+    @ApiModelProperty(value = "审批操作,SUBMIT:提交,APPROVE:审批,REJECT:驳回,END:终止,EXCHANGE:转他人审批")
+    private FlowApproveOperationEnum approveOperation;
+
+    @ApiModelProperty(value = "待审核人id")
+    private String pendApproveId;
+
+    @ApiModelProperty(value = "待审核人")
+    private String pendApproveUserName;
+
+    @ApiModelProperty(value = "已审核人")
+    private String approveUserName;
+
+    @ApiModelProperty(value = "创建时间")
+    private Long createTime;
+
+    public TFFlowViewLogResult() {
+
+    }
+
+    public TFFlowViewLogResult(TFFlowLogResult tfFlowLogResult) {
+        this.flowId = tfFlowLogResult.getFlowId();
+        this.objectId = tfFlowLogResult.getObjectId();
+        this.approveId = tfFlowLogResult.getApproveId();
+        this.approveSetup = tfFlowLogResult.getApproveSetup();
+        this.approveRemark = tfFlowLogResult.getApproveRemark();
+        this.approveOperation = tfFlowLogResult.getApproveOperation();
+        this.pendApproveId = tfFlowLogResult.getPendApproveId();
+        this.pendApproveUserName = tfFlowLogResult.getPendApproveUserName();
+        this.approveUserName = tfFlowLogResult.getApproveUserName();
+        this.createTime = tfFlowLogResult.getCreateTime();
+    }
+
+    public Long getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Long createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getPendApproveUserName() {
+        return pendApproveUserName;
+    }
+
+    public void setPendApproveUserName(String pendApproveUserName) {
+        this.pendApproveUserName = pendApproveUserName;
+    }
+
+    public String getApproveUserName() {
+        return approveUserName;
+    }
+
+    public void setApproveUserName(String approveUserName) {
+        this.approveUserName = approveUserName;
+    }
+
+    public Long getFlowId() {
+        return flowId;
+    }
+
+    public void setFlowId(Long flowId) {
+        this.flowId = flowId;
+    }
+
+    public Long getObjectId() {
+        return objectId;
+    }
+
+    public void setObjectId(Long objectId) {
+        this.objectId = objectId;
+    }
+
+    public Long getApproveId() {
+        return approveId;
+    }
+
+    public void setApproveId(Long approveId) {
+        this.approveId = approveId;
+    }
+
+    public Integer getApproveSetup() {
+        return approveSetup;
+    }
+
+    public void setApproveSetup(Integer approveSetup) {
+        this.approveSetup = approveSetup;
+    }
+
+    public String getApproveRemark() {
+        return approveRemark;
+    }
+
+    public void setApproveRemark(String approveRemark) {
+        this.approveRemark = approveRemark;
+    }
+
+    public FlowApproveOperationEnum getApproveOperation() {
+        return approveOperation;
+    }
+
+    public void setApproveOperation(FlowApproveOperationEnum approveOperation) {
+        this.approveOperation = approveOperation;
+    }
+
+    public String getPendApproveId() {
+        return pendApproveId;
+    }
+
+    public void setPendApproveId(String pendApproveId) {
+        this.pendApproveId = pendApproveId;
+    }
+}

+ 12 - 1
sop-business/src/main/java/com/qmth/sop/business/entity/TDFormWidget.java

@@ -29,7 +29,7 @@ public class TDFormWidget extends BaseEntity implements Serializable {
     @JsonSerialize(using = ToStringSerializer.class)
     private Long parentId;
 
-    @ApiModelProperty(value = "编码,TEXT:文本,TEXTAREA:文本域,SELECT:下拉框,RADIO:单选框,CHECKBOX:复选框,DATE:日期,BUTTON:按钮,IMG:图片,VIDEO:视频,AUDIO:音频,FILE:文件,POP_SELECT:弹出选择框,LABEL:标签,TABLE:表格,OTHER:其它")
+    @ApiModelProperty(value = "编码,TEXT:文本,TEXTAREA:文本域,SELECT:下拉框,RADIO:单选框,CHECKBOX:复选框,DATE:日期,BUTTON:按钮,IMG:图片,VIDEO:视频,AUDIO:音频,FILE:文件,POP_SELECT:弹出选择框,LABEL:标签,TABLE:表格,SIGN:签名,CASCADE_ADDRESS:城市选择控件,OTHER:其它")
     private WidgetCodeEnum code;
 
     @ApiModelProperty(value = "类型,FORM:表单,TABLE:表格,OTHER:其它")
@@ -83,6 +83,17 @@ public class TDFormWidget extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "格式化")
     private String format;
 
+    @ApiModelProperty(value = "占宽符")
+    private Integer span;
+
+    public Integer getSpan() {
+        return span;
+    }
+
+    public void setSpan(Integer span) {
+        this.span = span;
+    }
+
     public String getFormat() {
         return format;
     }

+ 0 - 11
sop-business/src/main/java/com/qmth/sop/business/entity/TFFlowApprove.java

@@ -62,9 +62,6 @@ public class TFFlowApprove extends BaseEntity implements Serializable {
     @TableField(value = "reject_link", updateStrategy = FieldStrategy.IGNORED)
     private String rejectLink;
 
-    @ApiModelProperty(value = "是否启用,0:停用,1:启用")
-    private Boolean enable;
-
     public TFFlowApprove() {
 
     }
@@ -156,12 +153,4 @@ public class TFFlowApprove extends BaseEntity implements Serializable {
     public void setRejectLink(String rejectLink) {
         this.rejectLink = rejectLink;
     }
-
-    public Boolean getEnable() {
-        return enable;
-    }
-
-    public void setEnable(Boolean enable) {
-        this.enable = enable;
-    }
 }

+ 7 - 19
sop-business/src/main/java/com/qmth/sop/business/entity/TFFlowLog.java

@@ -50,18 +50,15 @@ public class TFFlowLog extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "审核意见")
     private String approveRemark;
 
-    @ApiModelProperty(value = "是否启用,0:停用,1:启用")
-    private Boolean enable;
-
     @ApiModelProperty(value = "审批操作,SUBMIT:提交,APPROVE:审批,REJECT:驳回,END:终止")
     private FlowApproveOperationEnum approveOperation;
 
     @ApiModelProperty(value = "待审核人id")
     private String pendApproveId;
 
-    @ApiModelProperty(value = "附件")
-    @TableField(value = "paper_attachment_id", updateStrategy = FieldStrategy.IGNORED)
-    private String paperAttachmentId;
+    @ApiModelProperty(value = "附件id集合")
+    @TableField(value = "attachment_ids", updateStrategy = FieldStrategy.IGNORED)
+    private String attachmentIds;
 
     @ApiModelProperty(value = "审批步骤")
     @TableField(value = "approve_multi_setup", updateStrategy = FieldStrategy.IGNORED)
@@ -75,7 +72,6 @@ public class TFFlowLog extends BaseEntity implements Serializable {
     @JsonSerialize(using = ToStringSerializer.class)
     private Long taskId;
 
-
     public TFFlowLog() {
 
     }
@@ -148,14 +144,6 @@ public class TFFlowLog extends BaseEntity implements Serializable {
         this.approveRemark = approveRemark;
     }
 
-    public Boolean getEnable() {
-        return enable;
-    }
-
-    public void setEnable(Boolean enable) {
-        this.enable = enable;
-    }
-
     public FlowApproveOperationEnum getApproveOperation() {
         return approveOperation;
     }
@@ -172,12 +160,12 @@ public class TFFlowLog extends BaseEntity implements Serializable {
         this.pendApproveId = pendApproveId;
     }
 
-    public String getPaperAttachmentId() {
-        return paperAttachmentId;
+    public String getAttachmentIds() {
+        return attachmentIds;
     }
 
-    public void setPaperAttachmentId(String paperAttachmentId) {
-        this.paperAttachmentId = paperAttachmentId;
+    public void setAttachmentIds(String attachmentIds) {
+        this.attachmentIds = attachmentIds;
     }
 
     public Integer getApproveMultiSetup() {

+ 11 - 0
sop-business/src/main/java/com/qmth/sop/business/mapper/TFFlowLogMapper.java

@@ -1,7 +1,11 @@
 package com.qmth.sop.business.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.qmth.sop.business.bean.result.TFFlowLogResult;
 import com.qmth.sop.business.entity.TFFlowLog;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 /**
  * <p>
@@ -13,4 +17,11 @@ import com.qmth.sop.business.entity.TFFlowLog;
  */
 public interface TFFlowLogMapper extends BaseMapper<TFFlowLog> {
 
+    /**
+     * 根据实体id查询
+     *
+     * @param objectId
+     * @return
+     */
+    List<TFFlowLogResult> findByObjectId(@Param("objectId") Long objectId);
 }

+ 1 - 1
sop-business/src/main/java/com/qmth/sop/business/service/SysUserService.java

@@ -34,5 +34,5 @@ public interface SysUserService extends IService<SysUser> {
      * @param userId
      * @param all
      */
-    public void removeUserInfo(Long userId, boolean all) throws NoSuchAlgorithmException;
+    public Boolean removeUserInfo(Long userId, boolean all) throws NoSuchAlgorithmException;
 }

+ 10 - 0
sop-business/src/main/java/com/qmth/sop/business/service/TFFlowLogService.java

@@ -1,8 +1,11 @@
 package com.qmth.sop.business.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
+import com.qmth.sop.business.bean.result.TFFlowLogResult;
 import com.qmth.sop.business.entity.TFFlowLog;
 
+import java.util.List;
+
 /**
  * <p>
  * 流程流水表 服务类
@@ -13,4 +16,11 @@ import com.qmth.sop.business.entity.TFFlowLog;
  */
 public interface TFFlowLogService extends IService<TFFlowLog> {
 
+    /**
+     * 根据实体id查询
+     *
+     * @param objectId
+     * @return
+     */
+    List<TFFlowLogResult> findByObjectId(Long objectId);
 }

+ 2 - 1
sop-business/src/main/java/com/qmth/sop/business/service/impl/SysUserServiceImpl.java

@@ -88,7 +88,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
      * @param all
      */
     @Override
-    public void removeUserInfo(Long userId, boolean all) throws NoSuchAlgorithmException {
+    public Boolean removeUserInfo(Long userId, boolean all) throws NoSuchAlgorithmException {
         AuthBean authBean = commonCacheService.userAuthCache(userId);
         Optional.ofNullable(authBean).orElseThrow(() -> ExceptionResultEnum.NOT_LOGIN.exception());
         if (all) {
@@ -111,5 +111,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         commonCacheService.removeUserCache(userId);
         commonCacheService.removeUserAuthCache(userId);
         commonCacheService.removeUserRolePrivilegeCache(userId);
+        return true;
     }
 }

+ 7 - 0
sop-business/src/main/java/com/qmth/sop/business/service/impl/TFFlowLogServiceImpl.java

@@ -1,11 +1,14 @@
 package com.qmth.sop.business.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmth.sop.business.bean.result.TFFlowLogResult;
 import com.qmth.sop.business.entity.TFFlowLog;
 import com.qmth.sop.business.mapper.TFFlowLogMapper;
 import com.qmth.sop.business.service.TFFlowLogService;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 /**
  * <p>
  * 流程流水表 服务实现类
@@ -17,4 +20,8 @@ import org.springframework.stereotype.Service;
 @Service
 public class TFFlowLogServiceImpl extends ServiceImpl<TFFlowLogMapper, TFFlowLog> implements TFFlowLogService {
 
+    @Override
+    public List<TFFlowLogResult> findByObjectId(Long objectId) {
+        return this.baseMapper.findByObjectId(objectId);
+    }
 }

+ 43 - 0
sop-business/src/main/resources/mapper/TFFlowLogMapper.xml

@@ -2,4 +2,47 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.qmth.sop.business.mapper.TFFlowLogMapper">
 
+    <select id="findByObjectId" resultType="com.qmth.sop.business.bean.result.TFFlowLogResult">
+        select
+            DISTINCT tffl.approve_id as approveId,
+                     tffl.approve_setup as approveSetup,
+                     tffl.approve_remark as approveRemark,
+                     tffl.approve_operation as approveOperation,
+                     tffl.pend_approve_id as pendApproveId,
+                     tffl.create_time as createTime,
+                     tffl.flow_id as flowId,
+                     tffl.object_id as objectId,
+                     tffl.id,
+                     tffl.attachment_ids as attachmentIds,
+                     su.login_name as loginName,
+                     su.real_name as realName,
+                     su.code,
+                     su.mobile_number as mobileNumber,
+                     su.org_id as orgId,
+                     so.name as orgName,
+                     so.`type` as orgType,
+                     (select t.type from t_f_custom_flow t where t.id = tffe.t_f_custom_flow_id) as flowType,
+                     (select group_concat(su.real_name, '(', so.name, ')' order by FIND_IN_SET(su.id, replace(tffl.pend_approve_id, ', ', ',')))
+                      from sys_user su join sys_org so on so.id = su.org_id where FIND_IN_SET(su.id, replace(tffl.pend_approve_id, ', ', ','))) as pendApproveUserName,
+                     (
+                         select
+                             CONCAT(su.real_name, '(', so.name, ')')
+                         from
+                             sys_user su
+                             left join sys_org so on
+                                 so.id = su.org_id
+                         where
+                             su.id = tffl.approve_id) as approveUserName
+        from
+            t_f_flow_log tffl
+            left join sys_user su on
+                su.id = tffl.approve_id
+            left join sys_org so on
+                so.id = su.org_id
+            join t_f_custom_flow_entity tffe on tffe.id = tffl.object_id
+        where
+            tffl.object_id = #{objectId}
+        order by
+            tffl.create_time
+    </select>
 </mapper>

+ 10 - 0
sop-common/src/main/java/com/qmth/sop/common/enums/ExceptionResultEnum.java

@@ -41,6 +41,16 @@ public enum ExceptionResultEnum {
 
     MD5_EMPTY(HttpStatus.INTERNAL_SERVER_ERROR, 5000015, "md5为空"),
 
+    FLOW_ENTITY_NO_DATA(HttpStatus.INTERNAL_SERVER_ERROR, 5000016, "流程没有实例数据"),
+
+    FLOW_APPROVE_NO_DATA(HttpStatus.INTERNAL_SERVER_ERROR, 5000017, "流程没有审批数据"),
+
+    FLOW_DEPLOYMENT_NO_DATA(HttpStatus.INTERNAL_SERVER_ERROR, 5000018, "流程没有部署数据"),
+
+    FLOW_TASK_NO_DATA(HttpStatus.INTERNAL_SERVER_ERROR, 5000019, "流程任务数据为空"),
+
+    FLOW_PROCESS_VAR_NO_DATA(HttpStatus.INTERNAL_SERVER_ERROR, 5000020, "流程过程变量数据为空"),
+
     /**
      * 401
      */

+ 25 - 0
sop-common/src/main/java/com/qmth/sop/common/enums/FlowMsgTypeEnum.java

@@ -0,0 +1,25 @@
+package com.qmth.sop.common.enums;
+
+/**
+ * @Description: 流程消息类型
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2023/6/14
+ */
+public enum FlowMsgTypeEnum {
+
+    STANDARD("标准"),
+
+    OFF_STANDARD("非标准");
+
+    FlowMsgTypeEnum(String title) {
+        this.title = title;
+    }
+
+    private String title;
+
+    public String getTitle() {
+        return title;
+    }
+}

+ 10 - 5
sop-server/src/main/java/com/qmth/sop/server/api/ActivitiFromHtmlController.java

@@ -84,15 +84,14 @@ public class ActivitiFromHtmlController {
     @RequestMapping(value = "/getTaskList", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
     public Result getTaskList(@ApiParam(value = "用户id", required = true) @RequestParam String userId) {
-        return ResultUtil.ok(activitiService.getTaskList(Objects.nonNull(userId) ? Long.parseLong(userId) : null));
+        return ResultUtil.ok(activitiService.getTaskList(Long.parseLong(userId)));
     }
 
     @ApiOperation(value = "结束流程接口")
     @RequestMapping(value = "/delete", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
     public Result delete(@ApiParam(value = "流程id", required = true) String flowId) {
-        activitiService.flowEnd(Objects.nonNull(flowId) ? Long.parseLong(flowId) : null);
-        return ResultUtil.ok(true);
+        return ResultUtil.ok(activitiService.flowEnd(Long.parseLong(flowId)));
     }
 
     @ApiOperation(value = "流程转办接口")
@@ -100,7 +99,13 @@ public class ActivitiFromHtmlController {
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
     public Result taskApproverExchange(@ApiParam(value = "用户id", required = true) String userId,
                                        @ApiParam(value = "用户id", required = true) String taskId) {
-        activitiService.taskApproverExchange(Objects.nonNull(userId) ? Long.parseLong(userId) : null, Objects.nonNull(taskId) ? Long.parseLong(taskId) : null);
-        return ResultUtil.ok(true);
+        return ResultUtil.ok(activitiService.taskApproverExchange(Long.parseLong(userId), Long.parseLong(taskId)));
+    }
+
+    @ApiOperation(value = "获取流程详细信息接口")
+    @RequestMapping(value = "/view", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
+    public Result flowView(@ApiParam(value = "用户id", required = true) String flowId) {
+        return ResultUtil.ok(activitiService.flowView(Long.parseLong(flowId)));
     }
 }

+ 1 - 2
sop-server/src/main/java/com/qmth/sop/server/api/SysController.java

@@ -110,8 +110,7 @@ public class SysController {
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
     public Result logout() throws NoSuchAlgorithmException {
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        sysUserService.removeUserInfo(sysUser.getId(), false);
-        return ResultUtil.ok();
+        return ResultUtil.ok(sysUserService.removeUserInfo(sysUser.getId(), false));
     }
 
     @ApiOperation(value = "测试1")