wangliang vor 1 Jahr
Ursprung
Commit
5839ddf9f7

+ 127 - 20
sop-business/src/main/java/com/qmth/sop/business/bean/result/TBQualityProblemApplyResult.java

@@ -1,11 +1,15 @@
 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.entity.TBQualityProblemApply;
+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.Objects;
 
 public class TBQualityProblemApplyResult extends TBQualityProblemApply implements Serializable {
 
@@ -18,23 +22,142 @@ public class TBQualityProblemApplyResult extends TBQualityProblemApply implement
     @ApiModelProperty(value = "客户类型")
     private ProductTypeEnum customType;
 
+    @ApiModelProperty(value = "客户类型")
+    private String customTypeStr;
+
     @ApiModelProperty(value = "实施产品")
     private TFCustomTypeEnum sopType;
 
+    @ApiModelProperty(value = "实施产品")
+    private String sopTypeStr;
 
     @ApiModelProperty(value = "提交人")
     private String submitter;
+
     @ApiModelProperty(value = "提交时间")
-    private long submissionTime;
+    private Long submissionTime;
+
     @ApiModelProperty(value = "状态,START:已开始,AUDITING:审核中,REJECT:已驳回,END:已终止,FINISH:已结束")
-    private String status;
+    private FlowStatusEnum status;
+
+    @ApiModelProperty(value = "状态,START:已开始,AUDITING:审核中,REJECT:已驳回,END:已终止,FINISH:已结束")
+    private String statusStr;
+
     @ApiModelProperty(value = "更新时间")
-    private long updateDateTime;
+    private Long updateDateTime;
+
     @ApiModelProperty(value = "当前节点")
-    private String setup;
+    private Integer setup;
+
     @ApiModelProperty(value = "当前负责人")
     private String pendApproveUsers;
 
+    @ApiModelProperty(value = "流程id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long flowId;
+
+    @ApiModelProperty(value = "流程任务节点名称")
+    private String taskName;
+
+    @ApiModelProperty(value = "流程任务节点key")
+    private String taskDefKey;
+
+    @ApiModelProperty(value = "流程任务id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long taskId;
+
+    public String getCustomTypeStr() {
+        if (Objects.nonNull(customType)) {
+            return customType.getTitle();
+        } else {
+            return customTypeStr;
+        }
+    }
+
+    public void setCustomTypeStr(String customTypeStr) {
+        this.customTypeStr = customTypeStr;
+    }
+
+    public String getSopTypeStr() {
+        if (Objects.nonNull(sopType)) {
+            return sopType.getTitle();
+        } else {
+            return sopTypeStr;
+        }
+    }
+
+    public void setSopTypeStr(String sopTypeStr) {
+        this.sopTypeStr = sopTypeStr;
+    }
+
+    public void setSubmissionTime(Long submissionTime) {
+        this.submissionTime = submissionTime;
+    }
+
+    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 void setUpdateDateTime(Long updateDateTime) {
+        this.updateDateTime = updateDateTime;
+    }
+
+    public Integer getSetup() {
+        return setup;
+    }
+
+    public void setSetup(Integer setup) {
+        this.setup = setup;
+    }
+
+    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 getCustom() {
         return custom;
     }
@@ -75,14 +198,6 @@ public class TBQualityProblemApplyResult extends TBQualityProblemApply implement
         this.submissionTime = submissionTime;
     }
 
-    public String getStatus() {
-        return status;
-    }
-
-    public void setStatus(String status) {
-        this.status = status;
-    }
-
     public long getUpdateDateTime() {
         return updateDateTime;
     }
@@ -91,14 +206,6 @@ public class TBQualityProblemApplyResult extends TBQualityProblemApply implement
         this.updateDateTime = updateDateTime;
     }
 
-    public String getSetup() {
-        return setup;
-    }
-
-    public void setSetup(String setup) {
-        this.setup = setup;
-    }
-
     public String getPendApproveUsers() {
         return pendApproveUsers;
     }

+ 17 - 10
sop-business/src/main/resources/mapper/TBQualityProblemApplyMapper.xml

@@ -18,26 +18,33 @@
 <!--        AND si.sop_no = a.sop_no-->
 <!--        LEFT JOIN sys_custom sc ON sc.id = si.custom_id-->
         SELECT
-        a.*,
-        si.type sop_type,
+        distinct a.*,
+        si.type sopType,
         sc.NAME custom,
-        sc.type custom_type,
+        sc.type customType,
         fa.STATUS,
         fa.setup,
-        fa.create_time submission_time,
-        fa.update_time update_date_time,
+        fa.create_time submissionTime,
+        fa.update_time updateDateTime,
         cu.real_name submitter ,
-        (select group_concat(u.real_name) from sys_user u where u.id in (a.user_ids) order by u.id) user_names,
-        (select group_concat(u.real_name) from sys_user u where u.id in (fl.pend_approve_id ) order by u.id) pend_approve_users
+        cast(art.PROC_INST_ID_ as char) as flowId,
+        (select group_concat(art.NAME_) from ACT_RU_TASK art where art.PROC_INST_ID_ = fa.flow_id) as taskName,
+        (select group_concat(art.TASK_DEF_KEY_) from ACT_RU_TASK art where art.PROC_INST_ID_ = fa.flow_id) as taskDefKey,
+        (select group_concat(cast(art.ID_ as char)) from ACT_RU_TASK art where art.PROC_INST_ID_ = fa.flow_id) as taskId,
+        (select group_concat(us1.real_name SEPARATOR ';') from sys_user us1
+        where find_in_set(us1.id, a.user_ids)) user_names,
+        (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 = fe.flow_id order by tffl.create_time desc limit 1))) pend_approve_users
         FROM
         t_b_quality_problem_apply a
         LEFT JOIN t_b_sop_info si ON si.crm_no = a.crm_no
         AND si.sop_no = a.sop_no
         LEFT JOIN sys_custom sc ON sc.id = si.custom_id
-        LEFT JOIN t_f_custom_flow_entity fe ON fe.`code` = a.problem_no
-        LEFT JOIN t_f_flow_approve fa ON fa.id = fe.flow_id
+        LEFT JOIN t_f_custom_flow_entity fe ON 	fe.`code`= a.problem_no
+        LEFT JOIN t_f_flow_approve fa ON fa.flow_id = fe.flow_id
         LEFT JOIN sys_user cu ON cu.id = fa.create_id
-        LEFT JOIN t_f_flow_log fl ON fl.flow_id = fa.flow_id
+        left join ACT_RU_TASK art on art.PROC_INST_ID_ = fa.flow_id
+        left join act_ru_identitylink ari on ari.TASK_ID_ = art.ID_
         <where>
             <if test="serviceId != null and serviceId != ''">
                 and a.service_id = #{serviceId}