瀏覽代碼

Merge branch 'develop' into innerDevelop

gaodm 3 年之前
父節點
當前提交
5d5fac40ff
共有 37 個文件被更改,包括 557 次插入118 次删除
  1. 28 0
      cdssman-service/src/main/java/com/diagbot/client/CdssClient.java
  2. 28 0
      cdssman-service/src/main/java/com/diagbot/client/hystrix/CdssHystrix.java
  3. 13 0
      cdssman-service/src/main/java/com/diagbot/dto/IndexBatchDTO.java
  4. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/AnesthesiaConfig.java
  5. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/DeptConfig.java
  6. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/DiseaseConfig.java
  7. 6 60
      cdssman-service/src/main/java/com/diagbot/entity/DrugConfig.java
  8. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/LisConfig.java
  9. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/NurseConfig.java
  10. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/OperationConfig.java
  11. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/PacsConfig.java
  12. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/ScaleConfig.java
  13. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/TcmdiseaseConfig.java
  14. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/TcmsyndromeConfig.java
  15. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/TransfusionConfig.java
  16. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/AnesthesiaConfigWrapper.java
  17. 24 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/DeptConfigWrapper.java
  18. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/DiseaseConfigWrapper.java
  19. 28 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/DrugConfigWrapper.java
  20. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/LisConfigWrapper.java
  21. 10 1
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/MappingConfigWrapper.java
  22. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/NurseConfigWrapper.java
  23. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/OperationConfigWrapper.java
  24. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/PacsConfigWrapper.java
  25. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/ScaleConfigWrapper.java
  26. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/TcmdiseaseConfigWrapper.java
  27. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/TcmsyndromeConfigWrapper.java
  28. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/TransfusionConfigWrapper.java
  29. 2 1
      cdssman-service/src/main/java/com/diagbot/enums/MatchSourceEnum.java
  30. 1 1
      cdssman-service/src/main/java/com/diagbot/exception/ServiceErrorCode.java
  31. 1 1
      cdssman-service/src/main/java/com/diagbot/facade/KlConceptFacade.java
  32. 141 34
      cdssman-service/src/main/java/com/diagbot/facade/MappingConfigFacade.java
  33. 5 5
      cdssman-service/src/main/java/com/diagbot/facade/ResultStaticKnowledgeFacade.java
  34. 1 1
      cdssman-service/src/main/java/com/diagbot/vo/ConceptVO.java
  35. 1 0
      cdssman-service/src/main/java/com/diagbot/vo/FilterVO.java
  36. 10 0
      cdssman-service/src/main/java/com/diagbot/vo/MappingConfigPageVO.java
  37. 17 3
      cdssman-service/src/main/java/com/diagbot/web/MappingConfigController.java

+ 28 - 0
cdssman-service/src/main/java/com/diagbot/client/CdssClient.java

@@ -70,6 +70,20 @@ public interface CdssClient {
     RespDTO<List<MappingConfigWrapper>> precDataMatch_remote(@RequestPart("file") MultipartFile file,
                                                              @RequestParam("type") Integer type);
 
+    /**
+     * 数据导入校验
+     *
+     * @param file
+     * @param hospitalId
+     * @param type
+     * @param userId
+     */
+    @PostMapping(value = "/tran/mappingConfig/importExcelDataVerify", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    RespDTO<Boolean> importExcelDataVerify(@RequestPart("file") MultipartFile file,
+                                 @RequestParam("hospitalId") Long hospitalId,
+                                 @RequestParam("type") Integer type,
+                                 @RequestParam("uesrId") String userId);
+
     /**
      * 数据导入
      *
@@ -84,6 +98,20 @@ public interface CdssClient {
                                  @RequestParam("type") Integer type,
                                  @RequestParam("uesrId") String userId);
 
+    /**
+     * 数据导入
+     *
+     * @param file
+     * @param hospitalId
+     * @param type
+     * @param userId
+     */
+    @PostMapping(value = "/tran/mappingConfig/importExcel_remote", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    RespDTO<List<MappingConfigWrapper>> importExcel_remote(@RequestPart("file") MultipartFile file,
+                                 @RequestParam("hospitalId") Long hospitalId,
+                                 @RequestParam("type") Integer type,
+                                 @RequestParam("uesrId") String userId);
+
 
     /**
      * 数据导出_远程调用

+ 28 - 0
cdssman-service/src/main/java/com/diagbot/client/hystrix/CdssHystrix.java

@@ -11,7 +11,9 @@ import com.diagbot.vo.MappingConfigPageVO;
 import com.diagbot.vo.MappingConfigVO;
 import feign.FeignException;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.MediaType;
 import org.springframework.stereotype.Component;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RequestPart;
@@ -53,6 +55,15 @@ public class CdssHystrix implements CdssClient {
         return null;
     }
 
+    @Override
+    public RespDTO<Boolean> importExcelDataVerify(@RequestPart("file") MultipartFile file,
+                                           @RequestParam("hospitalId") Long hospitalId,
+                                           @RequestParam("type") Integer type,
+                                           @RequestParam("uesrId") String userId){
+        log.error("【hystrix】调用{}异常", "importExcelDataVerify");
+        return null;
+    }
+
     @Override
     public RespDTO<Boolean> importExcel(@RequestPart("file") MultipartFile file,
                                         @RequestParam("hospitalId") Long hospitalId,
@@ -62,6 +73,23 @@ public class CdssHystrix implements CdssClient {
         return null;
     }
 
+    /**
+     * 数据导入
+     *
+     * @param file
+     * @param hospitalId
+     * @param type
+     * @param userId
+     */
+    @Override
+    public RespDTO<List<MappingConfigWrapper>> importExcel_remote(@RequestPart("file") MultipartFile file,
+                                                    @RequestParam("hospitalId") Long hospitalId,
+                                                    @RequestParam("type") Integer type,
+                                                    @RequestParam("uesrId") String userId){
+        log.error("【hystrix】调用{}异常", "importExcel_remote");
+        return null;
+    }
+
     @Override
     public RespDTO<List<MappingConfigWrapper>> exportExcel_remote(@RequestBody @Valid MappingConfigPageVO mappingConfigPageVO) {
         log.error("【hystrix】调用{}异常", "exportExcel_remote");

+ 13 - 0
cdssman-service/src/main/java/com/diagbot/dto/IndexBatchDTO.java

@@ -12,8 +12,21 @@ import lombok.Setter;
 @Setter
 public class IndexBatchDTO {
     private Long id;
+    private Integer status;
     private String name;
     private String code;
     private String synonyms;
     private Integer type;
+    /**
+     * 国药准字
+     */
+    private String approval;
+    /**
+     * 药品剂型
+     */
+    private String form;
+    /**
+     * 药品剂型id
+     */
+    private Long formConceptId;
 }

+ 1 - 1
cdssman-service/src/main/java/com/diagbot/entity/AnesthesiaConfig.java

@@ -36,7 +36,7 @@ public class AnesthesiaConfig {
     /**
      * 是否匹配(0-未匹配、1-已匹配)
      */
-    @Excel(name = "是否匹配", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    @Excel(name = "是否匹配", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1", "_null"}, isImportField = "true")
     private Integer isMatch;
 
     /**

+ 1 - 1
cdssman-service/src/main/java/com/diagbot/entity/DeptConfig.java

@@ -83,7 +83,7 @@ public class DeptConfig {
     /**
      * 是否匹配(0-未匹配、1-已匹配)
      */
-    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1", "_null" }, isImportField = "true")
     private Integer isMatch;
 
     /**

+ 1 - 1
cdssman-service/src/main/java/com/diagbot/entity/DiseaseConfig.java

@@ -78,7 +78,7 @@ public class DiseaseConfig {
     /**
      * 是否匹配(0-未匹配、1-已匹配)
      */
-    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1", "_null" }, isImportField = "true")
     private Integer isMatch;
 
     /**

+ 6 - 60
cdssman-service/src/main/java/com/diagbot/entity/DrugConfig.java

@@ -1,15 +1,10 @@
 package com.diagbot.entity;
 
 import cn.afterturn.easypoi.excel.annotation.Excel;
-import com.baomidou.mybatisplus.annotation.FieldStrategy;
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.diagbot.util.StringUtil;
-import lombok.Getter;
-import lombok.Setter;
+import lombok.Data;
 
 import javax.validation.constraints.NotBlank;
 import java.util.Date;
-import java.util.Objects;
 
 /**
  * <p>
@@ -19,8 +14,7 @@ import java.util.Objects;
  * @author zhaops
  * @since 2020-07-28
  */
-@Getter
-@Setter
+@Data
 public class DrugConfig {
     /**
      * 主键
@@ -80,68 +74,20 @@ public class DrugConfig {
      * 剂型
      */
     @Excel(name = "药品剂型", width = 60, orderNum = "3", isImportField = "true")
-    @TableField(updateStrategy = FieldStrategy.IGNORED)
     private String form;
 
+    @Excel(name = "国药准字", width = 40, orderNum = "4", isImportField = "true")
+    private String approval;
 
     /**
      * 是否匹配(0-未匹配、1-已匹配)
      */
-    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "5", replace = { "未匹配_0", "已匹配_1", "_null" }, isImportField = "true")
     private Integer isMatch;
 
     /**
      * 数据来源(1-标准词、2-同义词、3-编码、4-历史数据、5-相似词、99-数据迁移)
      */
-    @Excel(name = "数据来源【不填、标准词、同义词、编码、历史数据、相似词】", width = 20, orderNum = "5", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "数据迁移_99", "_null" }, isImportField = "true")
+    @Excel(name = "数据来源【不填、标准词、同义词、编码、历史数据、相似词、国药准字】", width = 20, orderNum = "6", replace = { "标准词_1", "同义词_2", "编码_3", "历史数据_4", "相似词_5", "国药准字_6", "数据迁移_99", "_null" }, isImportField = "true")
     private Integer source;
-
-    @Override
-    public String toString() {
-        return "DrugConfig{" +
-                "id=" + id +
-                ", isDeleted=" + isDeleted +
-                ", gmtCreate=" + gmtCreate +
-                ", gmtModified=" + gmtModified +
-                ", creator=" + creator +
-                ", modifier=" + modifier +
-                ", hospitalId=" + hospitalId +
-                ", hisName=" + hisName +
-                ", uniqueName=" + uniqueName +
-                ", code=" + code +
-                ", form=" + form +
-                "}";
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) {
-            return true;
-        }
-        if (o == null || getClass() != o.getClass()) {
-            return false;
-        }
-        DrugConfig drugConfig = (DrugConfig) o;
-        return Objects.equals(id, drugConfig.id)
-                && Objects.equals(isDeleted, drugConfig.isDeleted)
-                && Objects.equals(hospitalId, drugConfig.hospitalId)
-                && Objects.equals(hisName, drugConfig.hisName)
-                && Objects.equals(form, drugConfig.form)
-                && Objects.equals(uniqueName, drugConfig.uniqueName)
-                && Objects.equals(code, drugConfig.code);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(id, isDeleted, hospitalId, hisName, form, uniqueName, code);
-    }
-
-    public static boolean nonNull(DrugConfig o) {
-        return !(o == null
-                || (o.hospitalId == null
-                && StringUtil.isBlank(o.hisName)
-                && StringUtil.isBlank(o.uniqueName)
-                && StringUtil.isBlank(o.code)
-                && StringUtil.isBlank(o.form)));
-    }
 }

+ 1 - 1
cdssman-service/src/main/java/com/diagbot/entity/LisConfig.java

@@ -87,7 +87,7 @@ public class LisConfig {
     /**
      * 是否匹配(0-未匹配、1-已匹配)
      */
-    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1", "_null" }, isImportField = "true")
     private Integer isMatch;
 
     /**

+ 1 - 1
cdssman-service/src/main/java/com/diagbot/entity/NurseConfig.java

@@ -77,7 +77,7 @@ public class NurseConfig{
     /**
      * 是否匹配(0-未匹配、1-已匹配)
      */
-    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1", "_null" }, isImportField = "true")
     private Integer isMatch;
 
     /**

+ 1 - 1
cdssman-service/src/main/java/com/diagbot/entity/OperationConfig.java

@@ -78,7 +78,7 @@ public class OperationConfig{
     /**
      * 是否匹配(0-未匹配、1-已匹配)
      */
-    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1", "_null"}, isImportField = "true")
     private Integer isMatch;
 
     /**

+ 1 - 1
cdssman-service/src/main/java/com/diagbot/entity/PacsConfig.java

@@ -79,7 +79,7 @@ public class PacsConfig implements Serializable {
     /**
      * 是否匹配(0-未匹配、1-已匹配)
      */
-    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1", "_null" }, isImportField = "true")
     private Integer isMatch;
 
     /**

+ 1 - 1
cdssman-service/src/main/java/com/diagbot/entity/ScaleConfig.java

@@ -77,7 +77,7 @@ public class ScaleConfig{
     /**
      * 是否匹配(0-未匹配、1-已匹配)
      */
-    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1", "_null" }, isImportField = "true")
     private Integer isMatch;
 
     /**

+ 1 - 1
cdssman-service/src/main/java/com/diagbot/entity/TcmdiseaseConfig.java

@@ -78,7 +78,7 @@ public class TcmdiseaseConfig{
     /**
      * 是否匹配(0-未匹配、1-已匹配)
      */
-    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1", "_null" }, isImportField = "true")
     private Integer isMatch;
 
     /**

+ 1 - 1
cdssman-service/src/main/java/com/diagbot/entity/TcmsyndromeConfig.java

@@ -78,7 +78,7 @@ public class TcmsyndromeConfig {
     /**
      * 是否匹配(0-未匹配、1-已匹配)
      */
-    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1", "_null" }, isImportField = "true")
     private Integer isMatch;
 
     /**

+ 1 - 1
cdssman-service/src/main/java/com/diagbot/entity/TransfusionConfig.java

@@ -78,7 +78,7 @@ public class TransfusionConfig {
     /**
      * 是否匹配(0-未匹配、1-已匹配)
      */
-    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1" }, isImportField = "true")
+    @Excel(name = "是否匹配【未匹配、已匹配】", width = 20, orderNum = "4", replace = { "未匹配_0", "已匹配_1", "_null" }, isImportField = "true")
     private Integer isMatch;
 
     /**

+ 23 - 0
cdssman-service/src/main/java/com/diagbot/entity/wrapper/AnesthesiaConfigWrapper.java

@@ -0,0 +1,23 @@
+package com.diagbot.entity.wrapper;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.diagbot.entity.AnesthesiaConfig;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/9/22 15:13
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class AnesthesiaConfigWrapper extends AnesthesiaConfig {
+    /**
+     * 医院诊断名称
+     */
+    @Excel(name = "标准术语状态", width = 40, replace = { "禁用_0", "启用_1", "_null" }, orderNum = "99")
+    private Integer status;
+}

+ 24 - 0
cdssman-service/src/main/java/com/diagbot/entity/wrapper/DeptConfigWrapper.java

@@ -0,0 +1,24 @@
+package com.diagbot.entity.wrapper;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.diagbot.entity.DeptConfig;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/9/22 14:53
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class DeptConfigWrapper extends DeptConfig {
+    /**
+     * 医院诊断名称
+     */
+    @Excel(name = "标准术语状态", width = 40, orderNum = "99")
+    private Integer status;
+}

+ 23 - 0
cdssman-service/src/main/java/com/diagbot/entity/wrapper/DiseaseConfigWrapper.java

@@ -0,0 +1,23 @@
+package com.diagbot.entity.wrapper;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.diagbot.entity.DiseaseConfig;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/9/22 15:00
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class DiseaseConfigWrapper extends DiseaseConfig {
+    /**
+     * 医院诊断名称
+     */
+    @Excel(name = "标准术语状态", width = 40, replace = { "禁用_0", "启用_1", "_null" }, orderNum = "99")
+    private Integer status;
+}

+ 28 - 0
cdssman-service/src/main/java/com/diagbot/entity/wrapper/DrugConfigWrapper.java

@@ -0,0 +1,28 @@
+package com.diagbot.entity.wrapper;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.diagbot.entity.DrugConfig;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/9/22 15:02
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class DrugConfigWrapper extends DrugConfig {
+    /**
+     * 医院诊断名称
+     */
+    @Excel(name = "标准术语状态", width = 40, replace = { "禁用_0", "启用_1", "_null" }, orderNum = "99")
+    private Integer status;
+    /**
+     * 医院诊断名称
+     */
+    @Excel(name = "标准剂型状态", width = 40, replace = { "禁用_0", "启用_1", "_null" }, orderNum = "100")
+    private Integer formStatus;
+}

+ 23 - 0
cdssman-service/src/main/java/com/diagbot/entity/wrapper/LisConfigWrapper.java

@@ -0,0 +1,23 @@
+package com.diagbot.entity.wrapper;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.diagbot.entity.LisConfig;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/9/22 15:09
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class LisConfigWrapper extends LisConfig {
+    /**
+     * 医院诊断名称
+     */
+    @Excel(name = "标准术语状态", width = 40, replace = { "禁用_0", "启用_1", "_null" }, orderNum = "99")
+    private Integer status;
+}

+ 10 - 1
cdssman-service/src/main/java/com/diagbot/entity/wrapper/MappingConfigWrapper.java

@@ -16,8 +16,14 @@ import lombok.ToString;
 @ToString(callSuper = true)
 public class MappingConfigWrapper extends MappingConfig {
     private String uniqueName;
+    private Integer status;
     private String form;
+    private Integer formStatus;
     private String code;
+    /**
+     * 国药准字
+     */
+    private String approval;
 
    /* @Override
     public boolean equals(Object o) {
@@ -42,8 +48,11 @@ public class MappingConfigWrapper extends MappingConfig {
     public static boolean nonNull(MappingConfigWrapper o) {
         return !(o == null
                 || (StringUtil.isBlank(o.uniqueName)
+                && o.status == null
                 && StringUtil.isBlank(o.form)
-                && StringUtil.isBlank(o.code)))
+                && o.formStatus == null
+                && StringUtil.isBlank(o.code)
+                && StringUtil.isBlank(o.approval)))
                 || MappingConfig.nonNull(o);
     }
 }

+ 23 - 0
cdssman-service/src/main/java/com/diagbot/entity/wrapper/NurseConfigWrapper.java

@@ -0,0 +1,23 @@
+package com.diagbot.entity.wrapper;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.diagbot.entity.NurseConfig;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/9/22 15:12
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class NurseConfigWrapper extends NurseConfig {
+    /**
+     * 医院诊断名称
+     */
+    @Excel(name = "标准术语状态", width = 40, replace = { "禁用_0", "启用_1", "_null" }, orderNum = "99")
+    private Integer status;
+}

+ 23 - 0
cdssman-service/src/main/java/com/diagbot/entity/wrapper/OperationConfigWrapper.java

@@ -0,0 +1,23 @@
+package com.diagbot.entity.wrapper;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.diagbot.entity.OperationConfig;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/9/22 15:08
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class OperationConfigWrapper extends OperationConfig {
+    /**
+     * 医院诊断名称
+     */
+    @Excel(name = "标准术语状态", width = 40, replace = { "禁用_0", "启用_1", "_null" }, orderNum = "99")
+    private Integer status;
+}

+ 23 - 0
cdssman-service/src/main/java/com/diagbot/entity/wrapper/PacsConfigWrapper.java

@@ -0,0 +1,23 @@
+package com.diagbot.entity.wrapper;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.diagbot.entity.PacsConfig;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/9/22 15:10
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class PacsConfigWrapper extends PacsConfig {
+    /**
+     * 医院诊断名称
+     */
+    @Excel(name = "标准术语状态", width = 40, replace = { "禁用_0", "启用_1", "_null" }, orderNum = "99")
+    private Integer status;
+}

+ 23 - 0
cdssman-service/src/main/java/com/diagbot/entity/wrapper/ScaleConfigWrapper.java

@@ -0,0 +1,23 @@
+package com.diagbot.entity.wrapper;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.diagbot.entity.ScaleConfig;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/9/22 15:15
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class ScaleConfigWrapper extends ScaleConfig {
+    /**
+     * 医院诊断名称
+     */
+    @Excel(name = "标准术语状态", width = 40, replace = { "禁用_0", "启用_1", "_null" }, orderNum = "99")
+    private Integer status;
+}

+ 23 - 0
cdssman-service/src/main/java/com/diagbot/entity/wrapper/TcmdiseaseConfigWrapper.java

@@ -0,0 +1,23 @@
+package com.diagbot.entity.wrapper;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.diagbot.entity.TcmdiseaseConfig;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/9/22 15:17
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class TcmdiseaseConfigWrapper extends TcmdiseaseConfig {
+    /**
+     * 医院诊断名称
+     */
+    @Excel(name = "标准术语状态", width = 40, replace = { "禁用_0", "启用_1", "_null" }, orderNum = "99")
+    private Integer status;
+}

+ 23 - 0
cdssman-service/src/main/java/com/diagbot/entity/wrapper/TcmsyndromeConfigWrapper.java

@@ -0,0 +1,23 @@
+package com.diagbot.entity.wrapper;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.diagbot.entity.TcmsyndromeConfig;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/9/22 15:18
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class TcmsyndromeConfigWrapper extends TcmsyndromeConfig {
+    /**
+     * 医院诊断名称
+     */
+    @Excel(name = "标准术语状态", width = 40, replace = { "禁用_0", "启用_1", "_null" }, orderNum = "99")
+    private Integer status;
+}

+ 23 - 0
cdssman-service/src/main/java/com/diagbot/entity/wrapper/TransfusionConfigWrapper.java

@@ -0,0 +1,23 @@
+package com.diagbot.entity.wrapper;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.diagbot.entity.TransfusionConfig;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/9/22 15:18
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class TransfusionConfigWrapper extends TransfusionConfig {
+    /**
+     * 医院诊断名称
+     */
+    @Excel(name = "标准术语状态", width = 40, replace = { "禁用_0", "启用_1", "_null" }, orderNum = "99")
+    private Integer status;
+}

+ 2 - 1
cdssman-service/src/main/java/com/diagbot/enums/MatchSourceEnum.java

@@ -13,7 +13,8 @@ public enum MatchSourceEnum implements KeyedNamed {
     SynonymsWord(2, "同义词"),
     Code(3,"编码"),
     History(4,"历史数据"),
-    SimilarWord(5,"相似词");
+    SimilarWord(5,"相似词"),
+    Approval(6,"国药准字");
 
     @Setter
     private int key;

+ 1 - 1
cdssman-service/src/main/java/com/diagbot/exception/ServiceErrorCode.java

@@ -30,7 +30,7 @@ public enum ServiceErrorCode implements ErrorCode {
 
     public static ServiceErrorCode codeOf(String code) {
         for (ServiceErrorCode state : values()) {
-            if (state.getCode() == code) {
+            if (state.getCode().equals(code)) {
                 return state;
             }
         }

+ 1 - 1
cdssman-service/src/main/java/com/diagbot/facade/KlConceptFacade.java

@@ -555,7 +555,7 @@ public class KlConceptFacade extends KlConceptServiceImpl {
         int sum = this.count(new QueryWrapper<KlConcept>().eq("is_deleted", IsDeleteEnum.N.getKey())
                 .eq("id", klConceptSatarOrdisaVO.getConceptId()));
         if (sum == 0) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该数据已不存!");
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该数据已不存!");
         }
         if (status == StatusEnum.Disable.getKey()) {
             //kl_concept_static 静态信息

+ 141 - 34
cdssman-service/src/main/java/com/diagbot/facade/MappingConfigFacade.java

@@ -21,7 +21,19 @@ import com.diagbot.entity.ScaleConfig;
 import com.diagbot.entity.TcmdiseaseConfig;
 import com.diagbot.entity.TcmsyndromeConfig;
 import com.diagbot.entity.TransfusionConfig;
+import com.diagbot.entity.wrapper.AnesthesiaConfigWrapper;
+import com.diagbot.entity.wrapper.DeptConfigWrapper;
+import com.diagbot.entity.wrapper.DiseaseConfigWrapper;
+import com.diagbot.entity.wrapper.DrugConfigWrapper;
+import com.diagbot.entity.wrapper.LisConfigWrapper;
 import com.diagbot.entity.wrapper.MappingConfigWrapper;
+import com.diagbot.entity.wrapper.NurseConfigWrapper;
+import com.diagbot.entity.wrapper.OperationConfigWrapper;
+import com.diagbot.entity.wrapper.PacsConfigWrapper;
+import com.diagbot.entity.wrapper.ScaleConfigWrapper;
+import com.diagbot.entity.wrapper.TcmdiseaseConfigWrapper;
+import com.diagbot.entity.wrapper.TcmsyndromeConfigWrapper;
+import com.diagbot.entity.wrapper.TransfusionConfigWrapper;
 import com.diagbot.enums.ConceptTypeEnum;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.enums.MatchSourceEnum;
@@ -72,69 +84,130 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
      * @param response
      * @param type
      * @param extFileName
+     * @param mode        1:模板导出、2:关联关系
      */
-    public void exportExcel(HttpServletResponse response, List<?> list, Integer type, String extFileName) {
+    public void exportExcel(HttpServletResponse response, List<?> list, Integer type, String extFileName, Integer mode) {
         String fileName = extFileName + ".xls";
         switch (type) {
             case 1:
                 fileName = "检验" + fileName;
-                List<LisConfig> lisConfigList = BeanUtil.listCopyTo(list, LisConfig.class);
-                ExcelUtils.exportExcel(lisConfigList, null, "sheet1", LisConfig.class, fileName, response, 12.8f);
+                if (mode.equals(1)) {
+                    List<LisConfig> lisConfigList = BeanUtil.listCopyTo(list, LisConfig.class);
+                    ExcelUtils.exportExcel(lisConfigList, null, "sheet1", LisConfig.class, fileName, response, 12.8f);
+                } else if (mode.equals(2)) {
+                    List<LisConfigWrapper> lisConfigList = BeanUtil.listCopyTo(list, LisConfigWrapper.class);
+                    ExcelUtils.exportExcel(lisConfigList, null, "sheet1", LisConfigWrapper.class, fileName, response, 12.8f);
+                }
                 break;
             case 3:
                 fileName = "检查" + fileName;
-                List<PacsConfig> pacsConfigList = BeanUtil.listCopyTo(list, PacsConfig.class);
-                ExcelUtils.exportExcel(pacsConfigList, null, "sheet1", PacsConfig.class, fileName, response, 12.8f);
+                if (mode.equals(1)) {
+                    List<PacsConfig> pacsConfigList = BeanUtil.listCopyTo(list, PacsConfig.class);
+                    ExcelUtils.exportExcel(pacsConfigList, null, "sheet1", PacsConfig.class, fileName, response, 12.8f);
+                } else if (mode.equals(2)) {
+                    List<PacsConfigWrapper> pacsConfigWrapperList = BeanUtil.listCopyTo(list, PacsConfigWrapper.class);
+                    ExcelUtils.exportExcel(pacsConfigWrapperList, null, "sheet1", PacsConfigWrapper.class, fileName, response, 12.8f);
+                }
                 break;
             case 4:
                 fileName = "诊断" + fileName;
-                List<DiseaseConfig> diseaseConfigList = BeanUtil.listCopyTo(list, DiseaseConfig.class);
-                ExcelUtils.exportExcel(diseaseConfigList, null, "sheet1", DiseaseConfig.class, fileName, response, 12.8f);
+                if (mode.equals(1)) {
+                    List<DiseaseConfig> diseaseConfigList = BeanUtil.listCopyTo(list, DiseaseConfig.class);
+                    ExcelUtils.exportExcel(diseaseConfigList, null, "sheet1", DiseaseConfig.class, fileName, response, 12.8f);
+                } else if (mode.equals(2)) {
+                    List<DiseaseConfigWrapper> diseaseConfigList = BeanUtil.listCopyTo(list, DiseaseConfigWrapper.class);
+                    ExcelUtils.exportExcel(diseaseConfigList, null, "sheet1", DiseaseConfigWrapper.class, fileName, response, 12.8f);
+                }
                 break;
             case 5:
                 fileName = "药品" + fileName;
-                List<DrugConfig> drugConfigList = BeanUtil.listCopyTo(list, DrugConfig.class);
-                ExcelUtils.exportExcel(drugConfigList, getForm(), "sheet1", DrugConfig.class, fileName, response, 12.8f);
+                if (mode.equals(1)) {
+                    List<DrugConfig> drugConfigList = BeanUtil.listCopyTo(list, DrugConfig.class);
+                    ExcelUtils.exportExcel(drugConfigList, getForm(), "sheet1", DrugConfig.class, fileName, response, 12.8f);
+                } else if (mode.equals(2)) {
+                    List<DrugConfigWrapper> drugConfigList = BeanUtil.listCopyTo(list, DrugConfigWrapper.class);
+                    ExcelUtils.exportExcel(drugConfigList, getForm(), "sheet1", DrugConfigWrapper.class, fileName, response, 12.8f);
+                }
                 break;
             case 6:
                 fileName = "手术和操作" + fileName;
-                List<OperationConfig> operationConfigList = BeanUtil.listCopyTo(list, OperationConfig.class);
-                ExcelUtils.exportExcel(operationConfigList, null, "sheet1", OperationConfig.class, fileName, response, 12.8f);
+                if (mode.equals(1)) {
+                    List<OperationConfig> operationConfigList = BeanUtil.listCopyTo(list, OperationConfig.class);
+                    ExcelUtils.exportExcel(operationConfigList, null, "sheet1", OperationConfig.class, fileName, response, 12.8f);
+                } else if (mode.equals(2)) {
+                    List<OperationConfigWrapper> operationConfigList = BeanUtil.listCopyTo(list, OperationConfigWrapper.class);
+                    ExcelUtils.exportExcel(operationConfigList, null, "sheet1", OperationConfigWrapper.class, fileName, response, 12.8f);
+                }
                 break;
             case 7:
                 fileName = "科室" + fileName;
-                List<DeptConfig> deptConfigList = BeanUtil.listCopyTo(list, DeptConfig.class);
-                ExcelUtils.exportExcel(deptConfigList, null, "sheet1", DeptConfig.class, fileName, response, 12.8f);
+                if (mode.equals(1)) {
+                    List<DeptConfig> deptConfigList = BeanUtil.listCopyTo(list, DeptConfig.class);
+                    ExcelUtils.exportExcel(deptConfigList, null, "sheet1", DeptConfig.class, fileName, response, 12.8f);
+                } else if (mode.equals(2)) {
+                    List<DeptConfigWrapper> deptConfigList = BeanUtil.listCopyTo(list, DeptConfigWrapper.class);
+                    ExcelUtils.exportExcel(deptConfigList, null, "sheet1", DeptConfigWrapper.class, fileName, response, 12.8f);
+                }
                 break;
             case 8:
                 fileName = "输血" + fileName;
-                List<TransfusionConfig> transfusionConfigList = BeanUtil.listCopyTo(list, TransfusionConfig.class);
-                ExcelUtils.exportExcel(transfusionConfigList, null, "sheet1", TransfusionConfig.class, fileName, response, 12.8f);
+                if (mode.equals(1)) {
+                    List<TransfusionConfig> transfusionConfigList = BeanUtil.listCopyTo(list, TransfusionConfig.class);
+                    ExcelUtils.exportExcel(transfusionConfigList, null, "sheet1", TransfusionConfig.class, fileName, response, 12.8f);
+                } else if (mode.equals(2)) {
+                    List<TransfusionConfigWrapper> transfusionConfigList = BeanUtil.listCopyTo(list, TransfusionConfigWrapper.class);
+                    ExcelUtils.exportExcel(transfusionConfigList, null, "sheet1", TransfusionConfigWrapper.class, fileName, response, 12.8f);
+                }
                 break;
             case 10:
                 fileName = "量表" + fileName;
-                List<ScaleConfig> scaleConfigList = BeanUtil.listCopyTo(list, ScaleConfig.class);
-                ExcelUtils.exportExcel(scaleConfigList, null, "sheet1", ScaleConfig.class, fileName, response, 12.8f);
+                if (mode.equals(1)) {
+                    List<ScaleConfig> scaleConfigList = BeanUtil.listCopyTo(list, ScaleConfig.class);
+                    ExcelUtils.exportExcel(scaleConfigList, null, "sheet1", ScaleConfig.class, fileName, response, 12.8f);
+                } else if (mode.equals(2)) {
+                    List<ScaleConfigWrapper> scaleConfigList = BeanUtil.listCopyTo(list, ScaleConfigWrapper.class);
+                    ExcelUtils.exportExcel(scaleConfigList, null, "sheet1", ScaleConfigWrapper.class, fileName, response, 12.8f);
+                }
                 break;
             case 11:
                 fileName = "护理" + fileName;
-                List<NurseConfig> nurseConfigList = BeanUtil.listCopyTo(list, NurseConfig.class);
-                ExcelUtils.exportExcel(nurseConfigList, null, "sheet1", NurseConfig.class, fileName, response, 12.8f);
+                if (mode.equals(1)) {
+                    List<NurseConfig> nurseConfigList = BeanUtil.listCopyTo(list, NurseConfig.class);
+                    ExcelUtils.exportExcel(nurseConfigList, null, "sheet1", NurseConfig.class, fileName, response, 12.8f);
+                } else if (mode.equals(2)) {
+                    List<NurseConfigWrapper> nurseConfigList = BeanUtil.listCopyTo(list, NurseConfigWrapper.class);
+                    ExcelUtils.exportExcel(nurseConfigList, null, "sheet1", NurseConfigWrapper.class, fileName, response, 12.8f);
+                }
                 break;
             case 12:
                 fileName = "中医疾病" + fileName;
-                List<TcmdiseaseConfig> tcmdiseaseConfigList = BeanUtil.listCopyTo(list, TcmdiseaseConfig.class);
-                ExcelUtils.exportExcel(tcmdiseaseConfigList, null, "sheet1", TcmdiseaseConfig.class, fileName, response, 12.8f);
+                if (mode.equals(1)) {
+                    List<TcmdiseaseConfig> tcmdiseaseConfigList = BeanUtil.listCopyTo(list, TcmdiseaseConfig.class);
+                    ExcelUtils.exportExcel(tcmdiseaseConfigList, null, "sheet1", TcmdiseaseConfig.class, fileName, response, 12.8f);
+                } else if (mode.equals(2)) {
+                    List<TcmdiseaseConfigWrapper> tcmdiseaseConfigList = BeanUtil.listCopyTo(list, TcmdiseaseConfigWrapper.class);
+                    ExcelUtils.exportExcel(tcmdiseaseConfigList, null, "sheet1", TcmdiseaseConfigWrapper.class, fileName, response, 12.8f);
+                }
                 break;
             case 13:
                 fileName = "中医证候" + fileName;
-                List<TcmsyndromeConfig> tcmsyndromeConfigList = BeanUtil.listCopyTo(list, TcmsyndromeConfig.class);
-                ExcelUtils.exportExcel(tcmsyndromeConfigList, null, "sheet1", TcmsyndromeConfig.class, fileName, response, 12.8f);
+                if (mode.equals(1)) {
+                    List<TcmsyndromeConfig> tcmsyndromeConfigList = BeanUtil.listCopyTo(list, TcmsyndromeConfig.class);
+                    ExcelUtils.exportExcel(tcmsyndromeConfigList, null, "sheet1", TcmsyndromeConfig.class, fileName, response, 12.8f);
+                } else if (mode.equals(2)) {
+                    List<TcmsyndromeConfigWrapper> tcmsyndromeConfigList = BeanUtil.listCopyTo(list, TcmsyndromeConfigWrapper.class);
+                    ExcelUtils.exportExcel(tcmsyndromeConfigList, null, "sheet1", TcmsyndromeConfigWrapper.class, fileName, response, 12.8f);
+                }
                 break;
             case 14:
                 fileName = "麻醉" + fileName;
-                List<AnesthesiaConfig> anesthesiaConfigList = BeanUtil.listCopyTo(list, AnesthesiaConfig.class);
-                ExcelUtils.exportExcel(anesthesiaConfigList, null, "sheet1", AnesthesiaConfig.class, fileName, response, 12.8f);
+                if (mode.equals(1)) {
+                    List<AnesthesiaConfig> anesthesiaConfigList = BeanUtil.listCopyTo(list, AnesthesiaConfig.class);
+                    ExcelUtils.exportExcel(anesthesiaConfigList, null, "sheet1", AnesthesiaConfig.class, fileName, response, 12.8f);
+                } else if (mode.equals(2)) {
+                    List<AnesthesiaConfigWrapper> anesthesiaConfigList = BeanUtil.listCopyTo(list, AnesthesiaConfigWrapper.class);
+                    ExcelUtils.exportExcel(anesthesiaConfigList, null, "sheet1", AnesthesiaConfigWrapper.class, fileName, response, 12.8f);
+                }
                 break;
             default:
                 break;
@@ -189,7 +262,7 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
      * @param response
      */
     public void exportExcelModule(HttpServletResponse response, MappingConfigVO mappingConfigVO) {
-        exportExcel(response, new ArrayList<>(), mappingConfigVO.getType(), "导入模板");
+        exportExcel(response, new ArrayList<>(), mappingConfigVO.getType(), "导入模板", 1);
     }
 
     /**
@@ -200,7 +273,7 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
     public void exportExcel(HttpServletResponse response, MappingConfigPageVO mappingConfigPageVO) {
         RespDTO<List<MappingConfigWrapper>> respDTO = cdssClient.exportExcel_remote(mappingConfigPageVO);
         if (RespDTOUtil.respIsOK(respDTO)) {
-            exportExcel(response, respDTO.data, mappingConfigPageVO.getType(), "映射");
+            exportExcel(response, respDTO.data, mappingConfigPageVO.getType(), "映射", 2);
         } else {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
         }
@@ -232,12 +305,34 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
 
         RespDTO<List<MappingConfigWrapper>> respDTO = cdssClient.precDataMatch_remote(file, type);
         if (RespDTOUtil.respIsOK(respDTO)) {
-            exportExcel(response, respDTO.data, type, "关联数据(预匹配)");
+            exportExcel(response, respDTO.data, type, "关联数据(预匹配)", 1);
         } else {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
         }
     }
 
+    /**
+     * 数据导入校验
+     *
+     * @param file
+     * @param hospitalId
+     * @param type
+     */
+    public Boolean importExcelDataVerify(MultipartFile file, Long hospitalId, Integer type, String userId) {
+        if (StringUtil.isBlank(userId)) {
+            userId = UserUtils.getCurrentPrincipleID();
+        }
+        RespDTO<Boolean> respDTO = cdssClient.importExcelDataVerify(file, hospitalId, type, userId);
+        if (RespDTOUtil.respIsOK(respDTO)) {
+            return respDTO.data;
+        } else {
+            if (respDTO.code.equals(CommonErrorCode.NOT_EXISTS.getCode())) {
+                throw new CommonException(CommonErrorCode.NOT_EXISTS, respDTO.msg);
+            } else {
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
+            }
+        }
+    }
 
     /**
      * 数据导入
@@ -246,13 +341,15 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
      * @param hospitalId
      * @param type
      */
-    public Boolean importExcel(MultipartFile file, Long hospitalId, Integer type, String userId) {
+    public void importExcel(HttpServletResponse response, MultipartFile file, Long hospitalId, Integer type, String userId) {
         if (StringUtil.isBlank(userId)) {
             userId = UserUtils.getCurrentPrincipleID();
         }
-        RespDTO<Boolean> respDTO = cdssClient.importExcel(file, hospitalId, type, userId);
+        RespDTO<List<MappingConfigWrapper>> respDTO = cdssClient.importExcel_remote(file, hospitalId, type, userId);
         if (RespDTOUtil.respIsOK(respDTO)) {
-            return respDTO.data;
+            if (ListUtil.isNotEmpty(respDTO.data)) {
+                exportExcel(response, respDTO.data, type, "标准词校验错误(含非标和禁用)", 1);
+            }
         } else {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, respDTO.msg);
         }
@@ -413,9 +510,10 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
      * @param hisNames
      * @param type
      * @param hospitalId
+     * @param status     标准术语启用禁用标志
      * @return
      */
-    public Map<String, Map<String, Map<String, List<String>>>> groupByHisNameWithName(List<String> hisNames, Integer type, Long hospitalId) {
+    public Map<String, Map<String, Map<String, List<String>>>> groupByHisNameWithName(List<String> hisNames, Integer type, Long hospitalId, Integer status) {
         Map<String, Map<String, Map<String, List<String>>>> retMap = new HashMap<>();
         Map<String, Map<String, Map<Long, List<Long>>>> idMap = groupByHisNameWithId(hisNames, type, hospitalId);
 
@@ -443,6 +541,7 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
         conceptVO.setSource(-1);
         conceptVO.setType(type);
         conceptVO.setIds(ids);
+        conceptVO.setStatus(status);
         RespDTO<List<IndexBatchDTO>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
         RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
         List<IndexBatchDTO> indexList = respDTO.data;
@@ -461,11 +560,19 @@ public class MappingConfigFacade extends MappingConfigServiceImpl {
                                 if (formConceptId == null) {
                                     forms.add("");
                                 } else {
-                                    forms.add(idNameMap.get(formConceptId));
+                                    if (idNameMap.containsKey(formConceptId)) {
+                                        forms.add(idNameMap.get(formConceptId));
+                                    } else {
+                                        forms.add("");
+                                    }
                                 }
                             }
                             forms = forms.stream().distinct().collect(Collectors.toList());
-                            thirdMap.put(idNameMap.get(thirdEntry.getKey()), forms);
+                            if (idNameMap.containsKey(thirdEntry.getKey())) {
+                                thirdMap.put(idNameMap.get(thirdEntry.getKey()), forms);
+                            } /*else {
+                                thirdMap.put("", Lists.newLinkedList());
+                            }*/
                         }
                     }
                     subMap.put(subEntry.getKey(), thirdMap);

+ 5 - 5
cdssman-service/src/main/java/com/diagbot/facade/ResultStaticKnowledgeFacade.java

@@ -144,7 +144,7 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
 
         // 已存在数据
         Map<String, Map<String, Map<String, List<String>>>> hisConfigMap
-                = mappingConfigFacade.groupByHisNameWithName(null, ConceptTypeEnum.LisPack.getKey(), Long.valueOf(hospitalId));
+                = mappingConfigFacade.groupByHisNameWithName(null, ConceptTypeEnum.LisPack.getKey(), Long.valueOf(hospitalId), StatusEnum.Enable.getKey());
 
         //术语映射
         for (LisConfig config : lisConfigList) {
@@ -346,7 +346,7 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
 
         // 已存在数据
         Map<String, Map<String, Map<String, List<String>>>> hisConfigMap
-                = mappingConfigFacade.groupByHisNameWithName(null, ConceptTypeEnum.Pacs.getKey(), Long.valueOf(hospitalId));
+                = mappingConfigFacade.groupByHisNameWithName(null, ConceptTypeEnum.Pacs.getKey(), Long.valueOf(hospitalId), StatusEnum.Enable.getKey());
         //术语映射
         for (PacsConfig config : pacsConfigList) {
             ResultStaticKnowledge result = new ResultStaticKnowledge();
@@ -538,7 +538,7 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
 
         // 已存在数据
         Map<String, Map<String, Map<String, List<String>>>> hisConfigMap
-                = mappingConfigFacade.groupByHisNameWithName(null, ConceptTypeEnum.Drug.getKey(), Long.valueOf(hospitalId));
+                = mappingConfigFacade.groupByHisNameWithName(null, ConceptTypeEnum.Drug.getKey(), Long.valueOf(hospitalId), StatusEnum.Enable.getKey());
 
         //术语映射
         for (DrugConfig config : drugConfigList) {
@@ -696,7 +696,7 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
 
         // 已存在数据
         Map<String, Map<String, Map<String, List<String>>>> hisConfigMap
-                = mappingConfigFacade.groupByHisNameWithName(null, ConceptTypeEnum.Disease.getKey(), Long.valueOf(hospitalId));
+                = mappingConfigFacade.groupByHisNameWithName(null, ConceptTypeEnum.Disease.getKey(), Long.valueOf(hospitalId), StatusEnum.Enable.getKey());
         //Map<String, Map<String, List<Long>>> hisConfigMap = diseaseConfigFacade.getConfigMap(Long.valueOf(hospitalId), null, null);
 
         //术语映射
@@ -855,7 +855,7 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
 
         // 已存在数据
         Map<String, Map<String, Map<String, List<String>>>> hisConfigMap
-                = mappingConfigFacade.groupByHisNameWithName(null, ConceptTypeEnum.Operation.getKey(), Long.valueOf(hospitalId));
+                = mappingConfigFacade.groupByHisNameWithName(null, ConceptTypeEnum.Operation.getKey(), Long.valueOf(hospitalId), StatusEnum.Enable.getKey());
         //Map<String, Map<String, List<Long>>> hisConfigMap = operationConfigFacade.getConfigMap(Long.valueOf(hospitalId), null, null);
 
         //术语映射

+ 1 - 1
cdssman-service/src/main/java/com/diagbot/vo/ConceptVO.java

@@ -3,7 +3,6 @@ package com.diagbot.vo;
 import lombok.Getter;
 import lombok.Setter;
 
-import javax.validation.constraints.NotNull;
 import java.util.List;
 
 /**
@@ -18,4 +17,5 @@ public class ConceptVO {
     private List<String> names;
     private Integer type;
     private Integer source;
+    private Integer status;
 }

+ 1 - 0
cdssman-service/src/main/java/com/diagbot/vo/FilterVO.java

@@ -15,4 +15,5 @@ import javax.validation.constraints.NotBlank;
 public class FilterVO {
     @NotBlank(message = "请输入检索内容")
     private String inputStr;
+    private Integer status;
 }

+ 10 - 0
cdssman-service/src/main/java/com/diagbot/vo/MappingConfigPageVO.java

@@ -71,4 +71,14 @@ public class MappingConfigPageVO extends Page {
      */
     @ApiModelProperty(hidden = true)
     private Integer isMultiple;
+
+    /**
+     * 标准术语启用禁用状态
+     */
+    private Integer status;
+
+    /**
+     * 剂型启用禁用状态
+     */
+    private Integer formStatus;
 }

+ 17 - 3
cdssman-service/src/main/java/com/diagbot/web/MappingConfigController.java

@@ -72,6 +72,21 @@ public class MappingConfigController {
         mappingConfigFacade.precDataMatch(file, type, response);
     }
 
+    @ApiOperation(value = "数据导入校验[by:zhaops]",
+            notes = "file(必填):导入文件 <br>" +
+                    "hospitalId(必填):医院id <br>" +
+                    "uesrId(必填):操作人id <br>" +
+                    "type(必填): 类型:1-化验、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表、11-护理、12-中医诊断、13-中医证候、14-麻醉 <br>")
+    @PostMapping(value = "/importExcelDataVerify", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+    @SysLogger("importExcelDataVerify")
+    public RespDTO<Boolean> importExcelDataVerify(@RequestParam("file") MultipartFile file,
+                                        @RequestParam("hospitalId") Long hospitalId,
+                                        @RequestParam("type") Integer type,
+                                        @RequestParam("uesrId") String userId) {
+        Boolean data = mappingConfigFacade.importExcelDataVerify(file, hospitalId, type, userId);
+        return RespDTO.onSuc(data);
+    }
+
     @ApiOperation(value = "数据导入[by:zhaops]",
             notes = "file(必填):导入文件 <br>" +
                     "hospitalId(必填):医院id <br>" +
@@ -80,12 +95,11 @@ public class MappingConfigController {
     @PostMapping(value = "/importExcel", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
     @SysLogger("importExcel")
     @Transactional
-    public RespDTO<Boolean> importExcel(@RequestParam("file") MultipartFile file,
+    public void importExcel(HttpServletResponse response,@RequestParam("file") MultipartFile file,
                             @RequestParam("hospitalId") Long hospitalId,
                             @RequestParam("type") Integer type,
                             @RequestParam("uesrId") String userId) {
-        Boolean data = mappingConfigFacade.importExcel(file, hospitalId, type, userId);
-        return RespDTO.onSuc(data);
+        mappingConfigFacade.importExcel(response, file, hospitalId, type, userId);
     }