Explorar o código

流程待办任务修改

wangliang hai 1 ano
pai
achega
fcb3cc061d

+ 3 - 1
sop-business/src/main/java/com/qmth/sop/business/activiti/service/ActivitiService.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.qmth.sop.business.bean.params.FlowApproveParam;
 import com.qmth.sop.business.bean.result.FlowViewResult;
 import com.qmth.sop.business.bean.result.WorkTaskResult;
+import com.qmth.sop.common.enums.FlowTaskTypeEnum;
 import com.qmth.sop.common.enums.TFCustomTypeEnum;
 import org.springframework.web.multipart.MultipartFile;
 
@@ -69,9 +70,10 @@ public interface ActivitiService {
      *
      * @param iPage
      * @param userId
+     * @param flowTaskTypeEnum
      * @return
      */
-    public IPage<WorkTaskResult> getUnDoneFlowTaskList(IPage<Map> iPage, Long userId);
+    public IPage<WorkTaskResult> getUnDoneFlowTaskList(IPage<Map> iPage, Long userId, FlowTaskTypeEnum flowTaskTypeEnum);
 
     /**
      * 流程节点转他人审批

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

@@ -421,12 +421,13 @@ public class ActivitiServiceImpl implements ActivitiService {
      *
      * @param iPage
      * @param userId
+     * @param flowTaskTypeEnum
      * @return
      */
     @Override
-    public IPage<WorkTaskResult> getUnDoneFlowTaskList(IPage<Map> iPage, Long userId) {
+    public IPage<WorkTaskResult> getUnDoneFlowTaskList(IPage<Map> iPage, Long userId, FlowTaskTypeEnum flowTaskTypeEnum) {
         Map<String, Object> map = new HashMap<>();
-        IPage<WorkTaskResult> workTaskResultIPage = sysUserService.getUnDoneFlowTaskList(iPage, userId);
+        IPage<WorkTaskResult> workTaskResultIPage = sysUserService.getUnDoneFlowTaskList(iPage, userId, flowTaskTypeEnum);
         if (Objects.nonNull(workTaskResultIPage) && !CollectionUtils.isEmpty(workTaskResultIPage.getRecords())) {
             for (WorkTaskResult w : workTaskResultIPage.getRecords()) {
                 List<Task> taskList = taskService.createTaskQuery().taskId(String.valueOf(w.getTaskId())).list();

+ 141 - 34
sop-business/src/main/java/com/qmth/sop/business/bean/result/WorkTaskResult.java

@@ -4,6 +4,7 @@ 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.common.enums.FlowStatusEnum;
+import com.qmth.sop.common.enums.ProductTypeEnum;
 import com.qmth.sop.common.enums.TFCustomTypeEnum;
 import io.swagger.annotations.ApiModelProperty;
 
@@ -20,13 +21,10 @@ import java.util.Objects;
 @JsonInclude(JsonInclude.Include.NON_NULL)
 public class WorkTaskResult implements Serializable {
 
-    @ApiModelProperty(value = "用户id")
+    @ApiModelProperty(value = "待办人id")
     @JsonSerialize(using = ToStringSerializer.class)
     private Long userId;
 
-    @ApiModelProperty(value = "用户姓名")
-    private String realName;
-
     @ApiModelProperty(value = "流程状态")
     private FlowStatusEnum status;
 
@@ -70,12 +68,6 @@ public class WorkTaskResult implements Serializable {
     @ApiModelProperty(value = "流程类型str")
     private String typeStr;
 
-    @ApiModelProperty(value = "用户登录名")
-    private String loginName;
-
-    @ApiModelProperty(value = "用户手机号")
-    private String mobileNumber;
-
     @ApiModelProperty(value = "流程编号")
     private String code;
 
@@ -85,21 +77,152 @@ public class WorkTaskResult implements Serializable {
     @ApiModelProperty(value = "动态表单")
     FlowTaskResult setupMap;
 
+    @ApiModelProperty(value = "实体id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long objId;
 
-    public FlowTaskResult getSetupMap() {
-        return setupMap;
+    @ApiModelProperty(value = "crm单号")
+    private String crmNo;
+
+    @ApiModelProperty(value = "crm名称")
+    private String crmName;
+
+    @ApiModelProperty(value = "服务单元id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long serviceId;
+
+    @ApiModelProperty(value = "服务单元名称")
+    private String serviceName;
+
+    @ApiModelProperty(value = "服务单元类型,OFFICE:教务处,CLOUD_MARK:云阅卷")
+    private ProductTypeEnum serviceType;
+
+    @ApiModelProperty(value = "服务单元类型str")
+    private String serviceTypeStr;
+
+    @ApiModelProperty(value = "客户id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long customId;
+
+    @ApiModelProperty(value = "客户名称")
+    private String customName;
+
+    @ApiModelProperty(value = "发起人id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long createId;
+
+    @ApiModelProperty(value = "发起人登录名")
+    private String createLoginName;
+
+    @ApiModelProperty(value = "发起人真实姓名")
+    private String createRealName;
+
+    public Long getObjId() {
+        return objId;
     }
 
-    public void setSetupMap(FlowTaskResult setupMap) {
-        this.setupMap = setupMap;
+    public void setObjId(Long objId) {
+        this.objId = objId;
+    }
+
+    public String getCrmNo() {
+        return crmNo;
+    }
+
+    public void setCrmNo(String crmNo) {
+        this.crmNo = crmNo;
+    }
+
+    public String getCrmName() {
+        return crmName;
+    }
+
+    public void setCrmName(String crmName) {
+        this.crmName = crmName;
+    }
+
+    public Long getServiceId() {
+        return serviceId;
+    }
+
+    public void setServiceId(Long serviceId) {
+        this.serviceId = serviceId;
+    }
+
+    public String getServiceName() {
+        return serviceName;
+    }
+
+    public void setServiceName(String serviceName) {
+        this.serviceName = serviceName;
+    }
+
+    public ProductTypeEnum getServiceType() {
+        return serviceType;
     }
 
-    public String getRealName() {
-        return realName;
+    public void setServiceType(ProductTypeEnum serviceType) {
+        this.serviceType = serviceType;
     }
 
-    public void setRealName(String realName) {
-        this.realName = realName;
+    public String getServiceTypeStr() {
+        if (Objects.nonNull(serviceType)) {
+            return serviceType.getTitle();
+        } else {
+            return serviceTypeStr;
+        }
+    }
+
+    public void setServiceTypeStr(String serviceTypeStr) {
+        this.serviceTypeStr = serviceTypeStr;
+    }
+
+    public Long getCustomId() {
+        return customId;
+    }
+
+    public void setCustomId(Long customId) {
+        this.customId = customId;
+    }
+
+    public String getCustomName() {
+        return customName;
+    }
+
+    public void setCustomName(String customName) {
+        this.customName = customName;
+    }
+
+    public Long getCreateId() {
+        return createId;
+    }
+
+    public void setCreateId(Long createId) {
+        this.createId = createId;
+    }
+
+    public String getCreateLoginName() {
+        return createLoginName;
+    }
+
+    public void setCreateLoginName(String createLoginName) {
+        this.createLoginName = createLoginName;
+    }
+
+    public String getCreateRealName() {
+        return createRealName;
+    }
+
+    public void setCreateRealName(String createRealName) {
+        this.createRealName = createRealName;
+    }
+
+    public FlowTaskResult getSetupMap() {
+        return setupMap;
+    }
+
+    public void setSetupMap(FlowTaskResult setupMap) {
+        this.setupMap = setupMap;
     }
 
     public TFCustomTypeEnum getType() {
@@ -122,22 +245,6 @@ public class WorkTaskResult implements Serializable {
         this.typeStr = typeStr;
     }
 
-    public String getLoginName() {
-        return loginName;
-    }
-
-    public void setLoginName(String loginName) {
-        this.loginName = loginName;
-    }
-
-    public String getMobileNumber() {
-        return mobileNumber;
-    }
-
-    public void setMobileNumber(String mobileNumber) {
-        this.mobileNumber = mobileNumber;
-    }
-
     public String getCode() {
         return code;
     }

+ 2 - 1
sop-business/src/main/java/com/qmth/sop/business/mapper/SysUserMapper.java

@@ -37,9 +37,10 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
      *
      * @param iPage
      * @param userId
+     * @param flowTaskTypeEnum
      * @return
      */
-    IPage<WorkTaskResult> getUnDoneFlowTaskList(IPage<Map> iPage, @Param("userId") Long userId);
+    IPage<WorkTaskResult> getUnDoneFlowTaskList(IPage<Map> iPage, @Param("userId") Long userId, @Param("flowTaskTypeEnum") String flowTaskTypeEnum);
 
     /**
      * 根据机构id查询用户

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

@@ -9,6 +9,7 @@ import com.qmth.sop.business.bean.result.UserRoleNameResult;
 import com.qmth.sop.business.bean.result.WorkTaskResult;
 import com.qmth.sop.business.entity.SysUser;
 import com.qmth.sop.common.enums.AppSourceEnum;
+import com.qmth.sop.common.enums.FlowTaskTypeEnum;
 import com.qmth.sop.common.enums.RoleTypeEnum;
 
 import java.security.NoSuchAlgorithmException;
@@ -129,9 +130,10 @@ public interface SysUserService extends IService<SysUser> {
      *
      * @param iPage
      * @param userId
+     * @param flowTaskTypeEnum
      * @return
      */
-    IPage<WorkTaskResult> getUnDoneFlowTaskList(IPage<Map> iPage, Long userId);
+    IPage<WorkTaskResult> getUnDoneFlowTaskList(IPage<Map> iPage, Long userId, FlowTaskTypeEnum flowTaskTypeEnum);
 
     /**
      * 根据角色类型查询用户

+ 4 - 6
sop-business/src/main/java/com/qmth/sop/business/service/impl/SysUserServiceImpl.java

@@ -24,10 +24,7 @@ import com.qmth.sop.business.service.TBSessionService;
 import com.qmth.sop.business.util.AuthUtil;
 import com.qmth.sop.common.contant.SpringContextHolder;
 import com.qmth.sop.common.contant.SystemConstant;
-import com.qmth.sop.common.enums.AppSourceEnum;
-import com.qmth.sop.common.enums.ExceptionResultEnum;
-import com.qmth.sop.common.enums.FieldUniqueEnum;
-import com.qmth.sop.common.enums.RoleTypeEnum;
+import com.qmth.sop.common.enums.*;
 import com.qmth.sop.common.util.IpUtil;
 import com.qmth.sop.common.util.ResultUtil;
 import com.qmth.sop.common.util.ServletUtil;
@@ -449,11 +446,12 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
      *
      * @param iPage
      * @param userId
+     * @param flowTaskTypeEnum
      * @return
      */
     @Override
-    public IPage<WorkTaskResult> getUnDoneFlowTaskList(IPage<Map> iPage, Long userId) {
-        return this.baseMapper.getUnDoneFlowTaskList(iPage, userId);
+    public IPage<WorkTaskResult> getUnDoneFlowTaskList(IPage<Map> iPage, Long userId, FlowTaskTypeEnum flowTaskTypeEnum) {
+        return this.baseMapper.getUnDoneFlowTaskList(iPage, userId, Objects.nonNull(flowTaskTypeEnum) ? flowTaskTypeEnum.name() : null);
     }
 
     @Override

+ 5 - 0
sop-business/src/main/resources/db/log/wangliang_update_log.sql

@@ -517,3 +517,8 @@ ALTER TABLE t_b_ding_history CHANGE date_type date_type varchar(20) NULL COMMENT
 
 ALTER TABLE t_f_custom_flow_entity ADD crm_no varchar(100) NULL COMMENT 'crm单号';
 ALTER TABLE t_f_custom_flow_entity CHANGE crm_no crm_no varchar(100) NULL COMMENT 'crm单号' AFTER t_f_custom_flow_id;
+
+UPDATE sys_privilege
+SET name='获取流程待办', url='/api/admin/flow/task/list', `type`='URL', parent_id=64, `sequence`=19, property='SYS', related=NULL, enable=1, default_auth=1, front_display=0
+WHERE id=3006;
+

+ 50 - 18
sop-business/src/main/resources/mapper/SysUserMapper.xml

@@ -12,14 +12,22 @@
         from
             (select
                     cast(art.ASSIGNEE_ as Decimal(24)) as userId,
-                    c.real_name realName,
-                    c.login_name as loginName,
-                    c.mobile_number as mobileNumber,
                     tfcf.type,
                     tfcfe.code,
                     tffa.status,
                     tffa.setup,
                     tfcf.version,
+                    tfcfe.obj_id as objId,
+                    tfcfe.crm_no as crmNo,
+                    tbc.name as crmName,
+                    tbs.id as serviceId,
+                    tbs.name as serviceName,
+                    tbs.type as serviceType,
+                    sc.id as customId,
+                    sc.name as customName,
+                    tfcfe.create_id as createId,
+                    su.real_name as createRealName,
+                    su.login_name as createLoginName,
                     art.PROC_INST_ID_ as flowId,
                     art.NAME_ as taskName,
                     art.TASK_DEF_KEY_ as taskDefKey,
@@ -30,22 +38,38 @@
                     tfcfe.id as customFlowEntityid
                 from
                     ACT_RU_TASK art
-                        left join t_f_flow_approve tffa on art.PROC_INST_ID_ = tffa.flow_id
-                        left join t_f_custom_flow_entity tfcfe on tfcfe.flow_id = tffa.flow_id
-                        left join t_f_custom_flow tfcf on tfcf.id = tfcfe.t_f_custom_flow_id
-                        left join sys_user c ON art.ASSIGNEE_ = c.id
-                where art.ASSIGNEE_ = cast(#{userId} as char)
+                    left join t_f_flow_approve tffa on art.PROC_INST_ID_ = tffa.flow_id
+                    left join t_f_custom_flow_entity tfcfe on tfcfe.flow_id = tffa.flow_id
+                    left join t_f_custom_flow tfcf on tfcf.id = tfcfe.t_f_custom_flow_id
+                    left join t_b_crm tbc on tbc.crm_no = tfcfe.crm_no
+                    left join t_b_service tbs on tbs.id = tbc.service_id
+                    left join sys_custom sc on sc.id = tbc.custom_id
+                    left join sys_user su ON tfcfe.create_id = su.id
+                <where>
+                    art.ASSIGNEE_ = cast(#{userId} as char)
+                    <if test="flowTaskTypeEnum != null and flowTaskTypeEnum != '' and flowTaskTypeEnum == 'DRAFT'">
+                        and tffa.status = #{flowTaskTypeEnum}
+                    </if>
+                </where>
                 UNION all
                 select
                     cast(ari.USER_ID_ as Decimal(24)) as userId,
-                    c.real_name realName,
-                    c.login_name as loginName,
-                    c.mobile_number as mobileNumber,
                     tfcf.type,
                     tfcfe.code,
                     tffa.status,
                     tffa.setup,
                     tfcf.version,
+                    tfcfe.obj_id as objId,
+                    tfcfe.crm_no as crmNo,
+                    tbc.name as crmName,
+                    tbs.id as serviceId,
+                    tbs.name as serviceName,
+                    tbs.type as serviceType,
+                    sc.id as customId,
+                    sc.name as customName,
+                    tfcfe.create_id as createId,
+                    su.real_name as createRealName,
+                    su.login_name as createLoginName,
                     art.PROC_INST_ID_ as flowId,
                     art.NAME_ as taskName,
                     art.TASK_DEF_KEY_ as taskDefKey,
@@ -56,15 +80,23 @@
                     tfcfe.id as customFlowEntityid
                 from
                     ACT_RU_TASK art
-                        left join act_ru_identitylink ari on ari.TASK_ID_ = art.ID_
-                        left join t_f_flow_approve tffa on tffa.flow_id = art.PROC_INST_ID_
-                        left join t_f_custom_flow_entity tfcfe on tfcfe.flow_id = tffa.flow_id
-                        left join t_f_custom_flow tfcf on tfcf.id = tfcfe.t_f_custom_flow_id
-                        left join sys_user c ON ari.USER_ID_ = c.id
-                where
+                    left join act_ru_identitylink ari on ari.TASK_ID_ = art.ID_
+                    left join t_f_flow_approve tffa on tffa.flow_id = art.PROC_INST_ID_
+                    left join t_f_custom_flow_entity tfcfe on tfcfe.flow_id = tffa.flow_id
+                    left join t_f_custom_flow tfcf on tfcf.id = tfcfe.t_f_custom_flow_id
+                    left join t_b_crm tbc on tbc.crm_no = tfcfe.crm_no
+                    left join t_b_service tbs on tbs.id = tbc.service_id
+                    left join sys_custom sc on sc.id = tbc.custom_id
+                    left join sys_user su ON tfcfe.create_id = su.id
+                <where>
                     art.ASSIGNEE_ is null
                   and ari.USER_ID_ = cast(#{userId} as char)
-                  and ari.TYPE_ = 'candidate') t
+                  and ari.TYPE_ = 'candidate'
+                  <if test="flowTaskTypeEnum != null and flowTaskTypeEnum != '' and flowTaskTypeEnum == 'DRAFT'">
+                      and tffa.status = #{flowTaskTypeEnum}
+                  </if>
+                </where>
+                ) t
     </select>
 
     <select id="findSysUserResultList" resultType="com.qmth.sop.business.bean.result.SysUserResult">

+ 3 - 1
sop-common/src/main/java/com/qmth/sop/common/enums/EnumList.java

@@ -21,7 +21,9 @@ public enum EnumList {
 
     FLOW_STATUS_ENUM(FlowStatusEnum.class),
 
-    FLOW_APPROVE_OPERATION_ENUM(FlowApproveOperationEnum.class);
+    FLOW_APPROVE_OPERATION_ENUM(FlowApproveOperationEnum.class),
+
+    FLOW_TASK_TYPE_ENUM(FlowTaskTypeEnum.class);
 
     private Object obj;
 

+ 27 - 0
sop-common/src/main/java/com/qmth/sop/common/enums/FlowTaskTypeEnum.java

@@ -0,0 +1,27 @@
+package com.qmth.sop.common.enums;
+
+/**
+ * @Description: 流程待办任务类型
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2021/6/29
+ */
+public enum FlowTaskTypeEnum {
+
+    ALL("全部"),
+
+    OVER_TIME("已超时"),
+
+    DRAFT("暂存");
+
+    private String title;
+
+    private FlowTaskTypeEnum(String title) {
+        this.title = title;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+}

+ 6 - 0
sop-server/src/main/java/com/qmth/sop/server/api/SysController.java

@@ -421,6 +421,12 @@ public class SysController {
                     map.put(flowApproveOperationEnum, flowApproveOperationEnum.getTitle());
                 }
                 break;
+            case FLOW_TASK_TYPE_ENUM://流程待办任务类型枚举
+                FlowTaskTypeEnum[] flowTaskTypeEnums = FlowTaskTypeEnum.values();
+                for (FlowTaskTypeEnum flowTaskTypeEnum : flowTaskTypeEnums) {
+                    map.put(flowTaskTypeEnum, flowTaskTypeEnum.getTitle());
+                }
+                break;
             default:
                 break;
         }

+ 5 - 3
sop-server/src/main/java/com/qmth/sop/server/api/TFCustomFlowController.java

@@ -10,6 +10,7 @@ import com.qmth.sop.business.bean.result.WorkTaskResult;
 import com.qmth.sop.business.entity.TFCustomFlow;
 import com.qmth.sop.business.service.TFCustomFlowService;
 import com.qmth.sop.common.contant.SystemConstant;
+import com.qmth.sop.common.enums.FlowTaskTypeEnum;
 import com.qmth.sop.common.enums.TFCustomTypeEnum;
 import com.qmth.sop.common.util.Result;
 import com.qmth.sop.common.util.ResultUtil;
@@ -89,13 +90,14 @@ public class TFCustomFlowController {
         return ResultUtil.ok(true);
     }
 
-    @ApiOperation(value = "获取全部流程待办接口")
-    @RequestMapping(value = "/task/un_done/list", method = RequestMethod.POST)
+    @ApiOperation(value = "获取流程待办接口")
+    @RequestMapping(value = "/task/list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = WorkTaskResult.class)})
     public Result getUnDoneFlowTaskList(@ApiParam(value = "用户id", required = true) @RequestParam Long userId,
+                                        @ApiParam(value = "待办任务类型", required = true) @RequestParam FlowTaskTypeEnum flowTaskTypeEnum,
                                         @ApiParam(value = "页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                                         @ApiParam(value = "页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        return ResultUtil.ok(activitiService.getUnDoneFlowTaskList(new Page<>(pageNumber, pageSize), userId));
+        return ResultUtil.ok(activitiService.getUnDoneFlowTaskList(new Page<>(pageNumber, pageSize), userId, flowTaskTypeEnum));
     }
 
     @ApiOperation(value = "结束流程接口")