Selaa lähdekoodia

sop列表修改

wangliang 1 vuosi sitten
vanhempi
commit
d7efc118f8

+ 14 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/params/SopInfoListParam.java

@@ -1,6 +1,8 @@
 package com.qmth.sop.business.bean.params;
 
 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.TBSopInfo;
 import com.qmth.sop.common.contant.SystemConstant;
 import io.swagger.annotations.ApiModelProperty;
@@ -42,6 +44,18 @@ public class SopInfoListParam extends TBSopInfo implements Serializable {
     @Max(SystemConstant.PAGE_SIZE_MAX)
     private Integer pageSize;
 
+    @ApiModelProperty(value = "用户id数组")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private List<Long> userIdList;
+
+    public List<Long> getUserIdList() {
+        return userIdList;
+    }
+
+    public void setUserIdList(List<Long> userIdList) {
+        this.userIdList = userIdList;
+    }
+
     public String getTypeStr() {
         if (Objects.nonNull(this.getType())) {
             return this.getType().getTitle();

+ 382 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/result/SopInfoResult.java

@@ -0,0 +1,382 @@
+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.FlowStatusEnum;
+import com.qmth.sop.common.enums.ProductTypeEnum;
+import com.qmth.sop.common.enums.TFCustomTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Map;
+import java.util.Objects;
+
+/**
+ * @Description: appinfo result
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2023/2/17
+ */
+public class SopInfoResult implements Serializable {
+
+    @ApiModelProperty(value = "sopid")
+    @JsonSerialize(using = ToStringSerializer.class)
+    Long id;
+
+    @ApiModelProperty(value = "服务单元id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    Long serviceId;
+
+    @ApiModelProperty(value = "服务单元名称")
+    String serviceName;
+
+    @ApiModelProperty(value = "sop单号")
+    String sopNo;
+
+    @ApiModelProperty(value = "crm单号")
+    String crmNo;
+
+    @ApiModelProperty(value = "派单时间")
+    Long beginTime;
+
+    @ApiModelProperty(value = "客户经理id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    Long customManagerId;
+
+    @ApiModelProperty(value = "客户类型,OFFICE:教务处,CLOUD_MARK:研究生")
+    ProductTypeEnum customManagerType;
+
+    @ApiModelProperty(value = "客户类型str")
+    String customManagerTypeStr;
+
+    @ApiModelProperty(value = "客户名称")
+    String customName;
+
+    @ApiModelProperty(value = "crm名称")
+    String crmName;
+
+    @ApiModelProperty(value = "产品id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    Long productId;
+
+    @ApiModelProperty(value = "产品名称")
+    String productName;
+
+    @ApiModelProperty(value = "考试开始时间")
+    Long examStartTime;
+
+    @ApiModelProperty(value = "考试结束时间")
+    Long examEndTime;
+
+    @ApiModelProperty(value = "提交人id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    Long flowCreateId;
+
+    @ApiModelProperty(value = "提交人")
+    String flowCreateName;
+
+    @ApiModelProperty(value = "提交时间")
+    Long flowCreateTime;
+
+    @ApiModelProperty(value = "更新时间")
+    Long flowUpdateTime;
+
+    @ApiModelProperty(value = "流程状态,START:已开始,AUDITING:审核中,REJECT:已驳回,END:已终止,FINISH:已结束")
+    FlowStatusEnum status;
+
+    @ApiModelProperty(value = "流程状态str")
+    String statusStr;
+
+    @ApiModelProperty(value = "流程类型,OFFICE_SOP_FLOW:教务处SOP,CLOUD_MARK_SOP_FLOW:研究生SOP,DING_EXCEPTION_FLOW:考勤异常审核流程,PROJECT_EXCHANGE_FLOW:项目计划变更流程,QUALITY_PROBLEM_FLOW:质量问题反馈流程")
+    TFCustomTypeEnum type;
+
+    @ApiModelProperty(value = "流程类型str")
+    String typeStr;
+
+    @ApiModelProperty(value = "流程版本号")
+    Integer version;
+
+    @ApiModelProperty(value = "流程部署id")
+    String flowDeploymentId;
+
+    @ApiModelProperty(value = "流程id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    Long flowId;
+
+    @ApiModelProperty(value = "流程节点名称")
+    String taskName;
+
+    @ApiModelProperty(value = "流程节点key")
+    String taskDefKey;
+
+    @ApiModelProperty(value = "流程节点id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    Long taskId;
+
+    @ApiModelProperty(value = "当前节点负责人")
+    String pendApproveName;
+
+    @ApiModelProperty(value = "动态节点")
+    Map<String, Object> dynamicFieldMap;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    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 String getSopNo() {
+        return sopNo;
+    }
+
+    public void setSopNo(String sopNo) {
+        this.sopNo = sopNo;
+    }
+
+    public String getCrmNo() {
+        return crmNo;
+    }
+
+    public void setCrmNo(String crmNo) {
+        this.crmNo = crmNo;
+    }
+
+    public Long getBeginTime() {
+        return beginTime;
+    }
+
+    public void setBeginTime(Long beginTime) {
+        this.beginTime = beginTime;
+    }
+
+    public Long getCustomManagerId() {
+        return customManagerId;
+    }
+
+    public void setCustomManagerId(Long customManagerId) {
+        this.customManagerId = customManagerId;
+    }
+
+    public ProductTypeEnum getCustomManagerType() {
+        return customManagerType;
+    }
+
+    public void setCustomManagerType(ProductTypeEnum customManagerType) {
+        this.customManagerType = customManagerType;
+    }
+
+    public String getCustomManagerTypeStr() {
+        if (Objects.nonNull(this.customManagerType)) {
+            return this.customManagerType.getTitle();
+        } else {
+            return customManagerTypeStr;
+        }
+    }
+
+    public void setCustomManagerTypeStr(String customManagerTypeStr) {
+        this.customManagerTypeStr = customManagerTypeStr;
+    }
+
+    public String getCustomName() {
+        return customName;
+    }
+
+    public void setCustomName(String customName) {
+        this.customName = customName;
+    }
+
+    public String getCrmName() {
+        return crmName;
+    }
+
+    public void setCrmName(String crmName) {
+        this.crmName = crmName;
+    }
+
+    public Long getProductId() {
+        return productId;
+    }
+
+    public void setProductId(Long productId) {
+        this.productId = productId;
+    }
+
+    public String getProductName() {
+        return productName;
+    }
+
+    public void setProductName(String productName) {
+        this.productName = productName;
+    }
+
+    public Long getExamStartTime() {
+        return examStartTime;
+    }
+
+    public void setExamStartTime(Long examStartTime) {
+        this.examStartTime = examStartTime;
+    }
+
+    public Long getExamEndTime() {
+        return examEndTime;
+    }
+
+    public void setExamEndTime(Long examEndTime) {
+        this.examEndTime = examEndTime;
+    }
+
+    public Long getFlowCreateId() {
+        return flowCreateId;
+    }
+
+    public void setFlowCreateId(Long flowCreateId) {
+        this.flowCreateId = flowCreateId;
+    }
+
+    public String getFlowCreateName() {
+        return flowCreateName;
+    }
+
+    public void setFlowCreateName(String flowCreateName) {
+        this.flowCreateName = flowCreateName;
+    }
+
+    public Long getFlowCreateTime() {
+        return flowCreateTime;
+    }
+
+    public void setFlowCreateTime(Long flowCreateTime) {
+        this.flowCreateTime = flowCreateTime;
+    }
+
+    public Long getFlowUpdateTime() {
+        return flowUpdateTime;
+    }
+
+    public void setFlowUpdateTime(Long flowUpdateTime) {
+        this.flowUpdateTime = flowUpdateTime;
+    }
+
+    public FlowStatusEnum getStatus() {
+        return status;
+    }
+
+    public void setStatus(FlowStatusEnum status) {
+        this.status = status;
+    }
+
+    public String getStatusStr() {
+        if (Objects.nonNull(this.status)) {
+            return this.status.getTitle();
+        } else {
+            return statusStr;
+        }
+    }
+
+    public void setStatusStr(String statusStr) {
+        this.statusStr = statusStr;
+    }
+
+    public TFCustomTypeEnum getType() {
+        return type;
+    }
+
+    public void setType(TFCustomTypeEnum type) {
+        this.type = type;
+    }
+
+    public String getTypeStr() {
+        if (Objects.nonNull(this.type)) {
+            return this.type.getTitle();
+        } else {
+            return typeStr;
+        }
+    }
+
+    public void setTypeStr(String typeStr) {
+        this.typeStr = typeStr;
+    }
+
+    public Integer getVersion() {
+        return version;
+    }
+
+    public void setVersion(Integer version) {
+        this.version = version;
+    }
+
+    public String getFlowDeploymentId() {
+        return flowDeploymentId;
+    }
+
+    public void setFlowDeploymentId(String flowDeploymentId) {
+        this.flowDeploymentId = flowDeploymentId;
+    }
+
+    public Long getFlowId() {
+        return flowId;
+    }
+
+    public void setFlowId(Long flowId) {
+        this.flowId = flowId;
+    }
+
+    public String getTaskName() {
+        return taskName;
+    }
+
+    public void setTaskName(String taskName) {
+        this.taskName = taskName;
+    }
+
+    public String getTaskDefKey() {
+        return taskDefKey;
+    }
+
+    public void setTaskDefKey(String taskDefKey) {
+        this.taskDefKey = taskDefKey;
+    }
+
+    public Long getTaskId() {
+        return taskId;
+    }
+
+    public void setTaskId(Long taskId) {
+        this.taskId = taskId;
+    }
+
+    public String getPendApproveName() {
+        return pendApproveName;
+    }
+
+    public void setPendApproveName(String pendApproveName) {
+        this.pendApproveName = pendApproveName;
+    }
+
+    public Map<String, Object> getDynamicFieldMap() {
+        return dynamicFieldMap;
+    }
+
+    public void setDynamicFieldMap(Map<String, Object> dynamicFieldMap) {
+        this.dynamicFieldMap = dynamicFieldMap;
+    }
+}

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

@@ -3,6 +3,7 @@ package com.qmth.sop.business.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.qmth.sop.business.bean.params.FormWidgetMetadataParam;
+import com.qmth.sop.business.bean.result.SopInfoResult;
 import com.qmth.sop.business.entity.TBSopInfo;
 import org.apache.ibatis.annotations.Param;
 
@@ -77,5 +78,5 @@ public interface TBSopInfoMapper extends BaseMapper<TBSopInfo> {
      * @return
      */
     @SuppressWarnings("MybatisXMapperMethodInspection")
-    IPage<Map> list(IPage<Map> iPage, @Param("serviceId") Long serviceId, @Param("formWidgetMetadataList") List<FormWidgetMetadataParam> formWidgetMetadataList);
+    IPage<SopInfoResult> list(IPage<Map> iPage, @Param("serviceId") Long serviceId, @Param("formWidgetMetadataList") List<FormWidgetMetadataParam> formWidgetMetadataList, @Param("userIdList") List<Long> userIdList);
 }

+ 2 - 3
sop-business/src/main/java/com/qmth/sop/business/service/TBSopInfoService.java

@@ -7,12 +7,11 @@ import com.qmth.sop.business.bean.params.SopApplyParam;
 import com.qmth.sop.business.bean.params.SopInfoListParam;
 import com.qmth.sop.business.bean.params.SopPublishParam;
 import com.qmth.sop.business.bean.result.FlowTaskResult;
+import com.qmth.sop.business.bean.result.SopInfoResult;
 import com.qmth.sop.business.entity.TBSopInfo;
 import com.qmth.sop.business.entity.TFCustomFlow;
 import com.qmth.sop.common.enums.FlowApprovePassEnum;
 
-import java.util.Map;
-
 /**
  * <p>
  * sop表 服务类
@@ -83,7 +82,7 @@ public interface TBSopInfoService extends IService<TBSopInfo> {
      * @param sopInfoListParam
      * @return
      */
-    IPage<Map> list(SopInfoListParam sopInfoListParam);
+    IPage<SopInfoResult> list(SopInfoListParam sopInfoListParam);
 
     /**
      * sop申请或发布

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

@@ -13,6 +13,7 @@ import com.qmth.sop.business.bean.params.SopPublishParam;
 import com.qmth.sop.business.bean.result.CrmProjectResult;
 import com.qmth.sop.business.bean.result.FlowFormWidgetResult;
 import com.qmth.sop.business.bean.result.FlowTaskResult;
+import com.qmth.sop.business.bean.result.SopInfoResult;
 import com.qmth.sop.business.entity.*;
 import com.qmth.sop.business.mapper.TBSopInfoMapper;
 import com.qmth.sop.business.service.*;
@@ -281,8 +282,10 @@ public class TBSopInfoServiceImpl extends ServiceImpl<TBSopInfoMapper, TBSopInfo
      * @return
      */
     @Override
-    public IPage<Map> list(SopInfoListParam sopInfoListParam) {
-        return this.baseMapper.list(new Page<>(sopInfoListParam.getPageNumber(), sopInfoListParam.getPageSize()), sopInfoListParam.getServiceId(), sopInfoListParam.getFormWidgetMetadataList());
+    public IPage<SopInfoResult> list(SopInfoListParam sopInfoListParam) {
+        SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+        List<Long> userIdList = !CollectionUtils.isEmpty(sopInfoListParam.getUserIdList()) ? sopInfoListParam.getUserIdList() : Arrays.asList(sysUser.getId());
+        return this.baseMapper.list(new Page<>(sopInfoListParam.getPageNumber(), sopInfoListParam.getPageSize()), sopInfoListParam.getServiceId(), sopInfoListParam.getFormWidgetMetadataList(), userIdList);
     }
 
     /**

+ 71 - 2
sop-business/src/main/resources/mapper/TBSopInfoMapper.xml

@@ -41,7 +41,76 @@
         SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME=#{tableName}
     </select>
 
-    <select id="list" resultType="java.util.Map">
-
+    <select id="list" resultType="com.qmth.sop.business.bean.result.SopInfoResult">
+        select tbsi.id,
+               tbs.id as serviceId,
+               tbs.name as serviceName,
+               tbsi.sop_no as sopNo,
+               tbsi.crm_no as crmNo,
+               tbc.begin_time as beginTime,
+               sc.manager_id as customManagerId,
+               su1.real_name as customManagerName,
+               sc.type as customManagerType,
+               sc.name as customName,
+               tbc.name as crmName,
+               tbp.id as productId,
+               tbp.name as productName,
+               tbc.exam_start_time as examStartTime,
+               tbc.exam_end_time as examEndTime,
+               tfcfe.create_id as flowCreateId,
+               su2.real_name as flowCreateName,
+               tfcfe.create_time as flowCreateTime,
+               tfcfe.update_time as flowUpdateTime,
+               tffa.status,
+               tfcf.type,
+               tfcf.version,
+               tfcf.flow_deployment_id as flowDeploymentId,
+               art.PROC_INST_ID_ as flowId,
+               art.NAME_ as taskName,
+               art.TASK_DEF_KEY_ as taskDefKey,
+               art.ID_ as taskId,
+               (select group_concat(us1.real_name SEPARATOR ';') from sys_user us1
+                where find_in_set(us1.id, (select tffl.pend_approve_id from t_f_flow_log tffl where tffl.flow_id = tfcfe.flow_id order by tffl.create_time desc limit 1))) as pendApproveName
+        from t_b_sop_info tbsi
+                 left join t_b_crm tbc on tbc.crm_no = tbsi.crm_no
+                 left join t_b_service tbs on tbs.id = tbsi.service_id
+                 left join sys_custom sc on sc.id = tbsi.custom_id
+                 left join sys_user su1 on su1.id = sc.manager_id
+                 left join t_b_product tbp on tbp.id = tbc.product_id
+                 left join t_f_custom_flow_entity tfcfe on tfcfe.code = tbsi.sop_no
+                 left join sys_user su2 on su2.id = tfcfe.create_id
+                 left join t_f_flow_approve tffa on tffa.flow_id = tfcfe.flow_id
+                 left join ACT_RU_TASK art on art.PROC_INST_ID_ = tffa.flow_id
+                 left join t_f_custom_flow tfcf on tfcf.id = tfcfe.t_f_custom_flow_id
+                 left join t_b_sop_dynamic_office_1 tbsdo1 on tbsdo1.flow_deployment_id = tfcf.flow_deployment_id
+        <where> 1 = 1
+            and EXISTS(
+            select t.* from(select cast(art.PROC_INST_ID_ as Decimal(24)) as flowId
+            from
+            ACT_RU_TASK art
+            where 1 = 1
+            <if test="userIdList != null and userIdList != '' and userIdList.size() > 0">
+                and art.ASSIGNEE_ IN
+                <foreach collection="userIdList" item="item" index="index" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            UNION ALL
+            select
+            art.PROC_INST_ID_ as flowId
+            from
+            ACT_RU_TASK art
+            left join act_ru_identitylink ari on
+            ari.TASK_ID_ = art.ID_
+            where
+            art.ASSIGNEE_ is null
+            <if test="userIdList != null and userIdList != '' and userIdList.size() > 0">
+                and ari.USER_ID_ IN
+                <foreach collection="userIdList" item="item" index="index" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
+            and ari.TYPE_ = 'candidate') t where t.flowId = art.PROC_INST_ID_)
+         </where>
     </select>
 </mapper>