소스 검색

新增根据服务单元id和用户id查询所有sop

wangliang 1 년 전
부모
커밋
b69238ae8c

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

@@ -2,9 +2,11 @@ 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.ProductTypeEnum;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
+import java.util.Objects;
 
 /**
  * @Description: sop result
@@ -28,6 +30,55 @@ public class SopInfoResult implements Serializable {
     @ApiModelProperty(value = "crm名称")
     private String crmName;
 
+    @ApiModelProperty(value = "客户id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long customId;
+
+    @ApiModelProperty(value = "客户名称")
+    private String customName;
+
+    @ApiModelProperty(value = "客户类型")
+    private ProductTypeEnum customType;
+
+    @ApiModelProperty(value = "客户类型str")
+    private String customTypeStr;
+
+    public ProductTypeEnum getCustomType() {
+        return customType;
+    }
+
+    public void setCustomType(ProductTypeEnum customType) {
+        this.customType = customType;
+    }
+
+    public String getCustomTypeStr() {
+        if (Objects.nonNull(customType)) {
+            return customType.getTitle();
+        } else {
+            return customTypeStr;
+        }
+    }
+
+    public void setCustomTypeStr(String customTypeStr) {
+        this.customTypeStr = customTypeStr;
+    }
+
+    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 getId() {
         return id;
     }

+ 7 - 3
sop-business/src/main/resources/mapper/TBSopInfoMapper.xml

@@ -162,11 +162,15 @@
             tbsi.id,
             tbsi.sop_no as sopNo,
             tbsi.crm_no as crmNo,
-            tbc.name as crmName
+            tbc.name as crmName,
+            sc.name as customName,
+            sc.type as customType,
+            sc.id as customId
         from
             t_b_sop_info tbsi
-                join t_b_sop_info_detail tbsid on tbsid.sop_info_id = tbsi.id
-                join t_b_crm tbc on tbc.crm_no = tbsi.crm_no
+        left join t_b_sop_info_detail tbsid on tbsid.sop_info_id = tbsi.id
+        left join t_b_crm tbc on tbc.crm_no = tbsi.crm_no
+        left join sys_custom sc on sc.id = tbsi.custom_id
         <where> 1 = 1
             <if test="userId != null and userId != ''">
                 and (tbsid.engineer_user_id is not null and tbsid.engineer_user_id = #{userId})