ソースを参照

Merge branch 'dev/subhos_defplan_20211009' into innerDevelop

zhoutg 3 年 前
コミット
02ec2deb90
59 ファイル変更1241 行追加189 行削除
  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. 72 0
      cdssman-service/src/main/java/com/diagbot/dto/HospitalInfoGetDTO.java
  4. 70 0
      cdssman-service/src/main/java/com/diagbot/dto/HospitalInfoPageDTO.java
  5. 30 0
      cdssman-service/src/main/java/com/diagbot/dto/HospitalRelationDTO.java
  6. 27 0
      cdssman-service/src/main/java/com/diagbot/dto/HospitalRelationErrorDTO.java
  7. 13 0
      cdssman-service/src/main/java/com/diagbot/dto/IndexBatchDTO.java
  8. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/AnesthesiaConfig.java
  9. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/DeptConfig.java
  10. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/DiseaseConfig.java
  11. 6 60
      cdssman-service/src/main/java/com/diagbot/entity/DrugConfig.java
  12. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/LisConfig.java
  13. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/NurseConfig.java
  14. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/OperationConfig.java
  15. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/PacsConfig.java
  16. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/ScaleConfig.java
  17. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/TcmdiseaseConfig.java
  18. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/TcmsyndromeConfig.java
  19. 73 0
      cdssman-service/src/main/java/com/diagbot/entity/TranHospitalRelation.java
  20. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/TransfusionConfig.java
  21. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/AnesthesiaConfigWrapper.java
  22. 24 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/DeptConfigWrapper.java
  23. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/DiseaseConfigWrapper.java
  24. 28 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/DrugConfigWrapper.java
  25. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/LisConfigWrapper.java
  26. 10 1
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/MappingConfigWrapper.java
  27. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/NurseConfigWrapper.java
  28. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/OperationConfigWrapper.java
  29. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/PacsConfigWrapper.java
  30. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/ScaleConfigWrapper.java
  31. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/TcmdiseaseConfigWrapper.java
  32. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/TcmsyndromeConfigWrapper.java
  33. 23 0
      cdssman-service/src/main/java/com/diagbot/entity/wrapper/TransfusionConfigWrapper.java
  34. 2 1
      cdssman-service/src/main/java/com/diagbot/enums/MatchSourceEnum.java
  35. 3 2
      cdssman-service/src/main/java/com/diagbot/exception/ServiceErrorCode.java
  36. 162 43
      cdssman-service/src/main/java/com/diagbot/facade/HospitalInfoFacade.java
  37. 1 1
      cdssman-service/src/main/java/com/diagbot/facade/KlConceptFacade.java
  38. 141 34
      cdssman-service/src/main/java/com/diagbot/facade/MappingConfigFacade.java
  39. 5 5
      cdssman-service/src/main/java/com/diagbot/facade/ResultStaticKnowledgeFacade.java
  40. 14 0
      cdssman-service/src/main/java/com/diagbot/facade/TranHospitalRelationFacade.java
  41. 2 2
      cdssman-service/src/main/java/com/diagbot/mapper/HospitalInfoMapper.java
  42. 16 0
      cdssman-service/src/main/java/com/diagbot/mapper/TranHospitalRelationMapper.java
  43. 2 2
      cdssman-service/src/main/java/com/diagbot/service/HospitalInfoService.java
  44. 16 0
      cdssman-service/src/main/java/com/diagbot/service/TranHospitalRelationService.java
  45. 2 2
      cdssman-service/src/main/java/com/diagbot/service/impl/HospitalInfoServiceImpl.java
  46. 20 0
      cdssman-service/src/main/java/com/diagbot/service/impl/TranHospitalRelationServiceImpl.java
  47. 1 1
      cdssman-service/src/main/java/com/diagbot/vo/ConceptVO.java
  48. 1 0
      cdssman-service/src/main/java/com/diagbot/vo/FilterVO.java
  49. 26 0
      cdssman-service/src/main/java/com/diagbot/vo/HospitalInfoGetVO.java
  50. 63 0
      cdssman-service/src/main/java/com/diagbot/vo/HospitalInfoSaveVO.java
  51. 33 0
      cdssman-service/src/main/java/com/diagbot/vo/HospitalRelationVO.java
  52. 10 0
      cdssman-service/src/main/java/com/diagbot/vo/MappingConfigPageVO.java
  53. 27 16
      cdssman-service/src/main/java/com/diagbot/web/HospitalInfoController.java
  54. 17 3
      cdssman-service/src/main/java/com/diagbot/web/MappingConfigController.java
  55. 1 1
      cdssman-service/src/main/resources/mapper/HospitalInfoMapper.xml
  56. 19 0
      cdssman-service/src/main/resources/mapper/TranHospitalRelationMapper.xml
  57. 2 2
      cdssman-service/src/test/java/com/diagbot/CodeGeneration.java
  58. 1 1
      user-service/src/main/java/com/diagbot/service/impl/TokenServiceImpl.java
  59. 4 1
      user-service/src/main/java/com/diagbot/web/UserController.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");

+ 72 - 0
cdssman-service/src/main/java/com/diagbot/dto/HospitalInfoGetDTO.java

@@ -0,0 +1,72 @@
+package com.diagbot.dto;
+
+import com.google.common.collect.Lists;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * <p>
+ * 医院信息表
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-06
+ */
+@Data
+public class HospitalInfoGetDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 医院名称
+     */
+    private String name;
+
+    /**
+     * 医院地址
+     */
+    private String address;
+
+    /**
+     * 医院名称拼音
+     */
+    private String spell;
+
+    /**
+     * 状态:0.禁用1.启用
+     */
+    private Integer status;
+
+    /**
+     * 是否对接(0-不对接,1-对接)
+     */
+    private Integer connect;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 子医院关联表
+     */
+    private List<HospitalRelationDTO> hospitalRelationDTOList = Lists.newLinkedList();
+}

+ 70 - 0
cdssman-service/src/main/java/com/diagbot/dto/HospitalInfoPageDTO.java

@@ -0,0 +1,70 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 医院信息表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-08-06
+ */
+@Data
+public class HospitalInfoPageDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 医院名称
+     */
+    private String name;
+
+    /**
+     * 医院地址
+     */
+    private String address;
+
+    /**
+     * 医院名称拼音
+     */
+    private String spell;
+
+    /**
+     * 状态:0.禁用1.启用
+     */
+    private Integer status;
+
+    /**
+     * 是否对接(0-不对接,1-对接)
+     */
+    private Integer connect;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 子医院
+     */
+    private String sonHospital;
+}

+ 30 - 0
cdssman-service/src/main/java/com/diagbot/dto/HospitalRelationDTO.java

@@ -0,0 +1,30 @@
+package com.diagbot.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 医院关联表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-08-06
+ */
+@Data
+public class HospitalRelationDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 子医院名称
+     */
+    private String name;
+
+    /**
+     * 子医院编码
+     */
+    private String code;
+
+}

+ 27 - 0
cdssman-service/src/main/java/com/diagbot/dto/HospitalRelationErrorDTO.java

@@ -0,0 +1,27 @@
+package com.diagbot.dto;
+
+import com.diagbot.vo.HospitalRelationVO;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * <p>
+ * 医院关联表提示出错
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-08-06
+ */
+@Data
+public class HospitalRelationErrorDTO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    // 当前医院重复
+    private List<HospitalRelationVO> errorCurrent;
+
+    // 与其他医院重复
+    private List<HospitalRelationVO> errorOther;
+}

+ 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;
 
     /**

+ 73 - 0
cdssman-service/src/main/java/com/diagbot/entity/TranHospitalRelation.java

@@ -0,0 +1,73 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 医院关联表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-10-09
+ */
+@Data
+public class TranHospitalRelation implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 子医院编码
+     */
+    private String code;
+
+    /**
+     * 子医院名称
+     */
+    private String name;
+
+    /**
+     * 父医院id
+     */
+    private Long hospitalId;
+
+    /**
+     * 备注
+     */
+    private String remark;
+}

+ 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;

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

@@ -8,7 +8,8 @@ package com.diagbot.exception;
  * @time: 2018/9/10 11:11
  */
 public enum ServiceErrorCode implements ErrorCode {
-    LOG_IS_NOT_EXIST("90020001", "该日志不存在");
+    LOG_IS_NOT_EXIST("90020001", "该日志不存在"),
+    NAME_CODE_ERROR("20020009", "操作失败,请检查【医院名称+医院编码】重复项");
 
     private String code;
     private String msg;
@@ -30,7 +31,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;
             }
         }

+ 162 - 43
cdssman-service/src/main/java/com/diagbot/facade/HospitalInfoFacade.java

@@ -4,33 +4,44 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.HospitalInfoDTO;
-import com.diagbot.entity.DiseaseConfig;
+import com.diagbot.dto.HospitalInfoGetDTO;
+import com.diagbot.dto.HospitalInfoPageDTO;
+import com.diagbot.dto.HospitalRelationDTO;
+import com.diagbot.dto.HospitalRelationErrorDTO;
 import com.diagbot.entity.HospitalInfo;
 import com.diagbot.entity.MappingConfig;
 import com.diagbot.entity.Plan;
+import com.diagbot.entity.TranHospitalRelation;
 import com.diagbot.enums.IsDeleteEnum;
 import com.diagbot.exception.CommonErrorCode;
 import com.diagbot.exception.CommonException;
 import com.diagbot.service.HospitalInfoService;
+import com.diagbot.service.TranHospitalRelationService;
 import com.diagbot.service.impl.HospitalInfoServiceImpl;
 import com.diagbot.util.BeanUtil;
 import com.diagbot.util.Cn2SpellUtil;
 import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.StringUtil;
 import com.diagbot.util.UserUtils;
 import com.diagbot.vo.ChangeStatusVO;
+import com.diagbot.vo.HospitalInfoGetVO;
 import com.diagbot.vo.HospitalInfoListVO;
 import com.diagbot.vo.HospitalInfoPageVO;
+import com.diagbot.vo.HospitalInfoSaveVO;
+import com.diagbot.vo.HospitalRelationVO;
 import com.diagbot.vo.HospitalSaveVO;
 import com.diagbot.vo.IdListVO;
 import com.diagbot.vo.IdVO;
+import com.google.common.collect.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
 import java.util.Date;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -49,6 +60,9 @@ public class HospitalInfoFacade extends HospitalInfoServiceImpl {
     private MappingConfigFacade mappingConfigFacade;
     @Autowired
     private PlanFacade planFacade;
+    @Autowired
+    @Qualifier("tranHospitalRelationServiceImpl")
+    TranHospitalRelationService tranHospitalRelationService;
 
     public List<HospitalInfoDTO> getHospitalInfo() {
         QueryWrapper<HospitalInfo> hospitalInfo = new QueryWrapper<>();
@@ -59,49 +73,62 @@ public class HospitalInfoFacade extends HospitalInfoServiceImpl {
         return data;
     }
 
+    /**
+     * 根据ID获取医院信息
+     *
+     * @param hospitalInfoGetVO
+     * @return
+     */
+    public HospitalInfoGetDTO getById(HospitalInfoGetVO hospitalInfoGetVO) {
+        HospitalInfo hospitalInfo = this.getOne(new QueryWrapper<HospitalInfo>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("id", hospitalInfoGetVO.getId()), false);
+        if (hospitalInfo == null) {
+            throw new CommonException(CommonErrorCode.NOT_EXISTS, "数据不存在");
+        }
+        HospitalInfoGetDTO hospitalInfoGetDTO = new HospitalInfoGetDTO();
+        BeanUtil.copyProperties(hospitalInfo, hospitalInfoGetDTO);
+
+        List<TranHospitalRelation> relationList = tranHospitalRelationService.list(new QueryWrapper<TranHospitalRelation>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalInfoGetVO.getId()));
+        List<HospitalRelationDTO> hospitalRelationDTOS = BeanUtil.listCopyTo(relationList, HospitalRelationDTO.class);
+        hospitalInfoGetDTO.setHospitalRelationDTOList(hospitalRelationDTOS);
+        return hospitalInfoGetDTO;
+    }
+
     /**
      * 保存记录-单条
      *
-     * @param hospitalInfo
+     * @param hospitalInfoSaveVO
      * @return
      */
-    public Boolean saveOrUpdateRecord(HospitalInfo hospitalInfo) {
+    public HospitalRelationErrorDTO saveOrUpdateRecord(HospitalInfoSaveVO hospitalInfoSaveVO) {
         String userId = UserUtils.getCurrentPrincipleID();
+        HospitalInfo hospitalInfo = new HospitalInfo();
+        BeanUtil.copyProperties(hospitalInfoSaveVO, hospitalInfo);
         Date now = DateUtil.now();
         hospitalInfo.setModifier(userId);
         hospitalInfo.setGmtModified(now);
-        QueryWrapper<HospitalInfo> queryWrapper = new QueryWrapper<>();
         if (StringUtil.isNotBlank(hospitalInfo.getName())) {
-            queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
-            queryWrapper.eq("name", hospitalInfo.getName());
-            HospitalInfo oldRecord = this.getOne(queryWrapper, false);
-            if (hospitalInfo.getId() == null
-                    && oldRecord != null) {
-                throw new CommonException(CommonErrorCode.IS_EXISTS, "该医院名称已存在");
-            }
-            if (hospitalInfo.getId() != null
-                    && oldRecord != null
-                    && !hospitalInfo.getId().equals(oldRecord.getId())) {
+            HospitalInfo oldRecord = this.getOne(new QueryWrapper<HospitalInfo>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .eq("name", hospitalInfo.getName())
+                    .ne("id", hospitalInfo.getId() == null ? -999 : hospitalInfo.getId()), false);
+            if (oldRecord != null) {
                 throw new CommonException(CommonErrorCode.IS_EXISTS, "该医院名称已存在");
             }
         }
-        /*if (StringUtil.isNotBlank(hospitalInfo.getCode())) {
-            queryWrapper = new QueryWrapper<>();
-            queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey());
-            queryWrapper.eq("code", hospitalInfo.getCode());
-            HospitalInfo oldRecord = this.getOne(queryWrapper, false);
-            if (hospitalInfo.getId() == null
-                    && oldRecord != null) {
-                throw new CommonException(CommonErrorCode.IS_EXISTS, "该医院编码已存在");
-            }
-            if (hospitalInfo.getId() != null
-                    && oldRecord != null
-                    && !hospitalInfo.getId().equals(oldRecord.getId())) {
-                throw new CommonException(CommonErrorCode.IS_EXISTS, "该医院编码已存在");
-            }
-        }*/
 
-        //新增数据
+        // 获取子医院
+        List<HospitalRelationVO> hospitalRelationVOList = hospitalInfoSaveVO.getHospitalRelationVOList();
+        // 校验子医院
+        HospitalRelationErrorDTO res = checkRelationHospital(hospitalRelationVOList, hospitalInfo.getId());
+        if (res != null) {
+            return res;
+        }
+
+        // 新增数据
         if (hospitalInfo.getId() == null) {
             hospitalInfo.setCreator(userId);
             hospitalInfo.setGmtCreate(now);
@@ -110,11 +137,74 @@ public class HospitalInfoFacade extends HospitalInfoServiceImpl {
         if (StringUtil.isBlank(hospitalInfo.getSpell())) {
             hospitalInfo.setSpell(Cn2SpellUtil.converterToFirstSpell(hospitalInfo.getName()));
         }
-        if (hospitalInfo.getIsDeleted() == null) {
-            hospitalInfo.setIsDeleted(IsDeleteEnum.N.getKey());
-        }
         this.saveOrUpdate(hospitalInfo);
-        return true;
+
+        // 先删除子医院关联表
+        tranHospitalRelationService.remove(new QueryWrapper<TranHospitalRelation>().eq("hospital_id", hospitalInfo.getId()));
+        // 插入子医院关联表
+        List<TranHospitalRelation> saveRelationList = Lists.newArrayList();
+        for (HospitalRelationVO hospitalRelationVO : hospitalRelationVOList) {
+            TranHospitalRelation tranHospitalRelation = new TranHospitalRelation();
+            BeanUtil.copyProperties(hospitalRelationVO, tranHospitalRelation);
+            tranHospitalRelation.setHospitalId(hospitalInfo.getId());
+            tranHospitalRelation.setCreator(userId);
+            tranHospitalRelation.setModifier(userId);
+            tranHospitalRelation.setGmtCreate(now);
+            tranHospitalRelation.setGmtModified(now);
+            saveRelationList.add(tranHospitalRelation);
+        }
+        if (ListUtil.isNotEmpty(saveRelationList)) {
+            tranHospitalRelationService.saveBatch(saveRelationList);
+        }
+        return null;
+    }
+
+    /**
+     * 校验子医院
+     *
+     * @param hospitalRelationVOList
+     * @param curHospitalId
+     * @return
+     */
+    public HospitalRelationErrorDTO checkRelationHospital(List<HospitalRelationVO> hospitalRelationVOList, Long curHospitalId) {
+        HospitalRelationErrorDTO res = new HospitalRelationErrorDTO();
+        if (ListUtil.isNotEmpty(hospitalRelationVOList)) {
+            // 校验name+code唯一性
+            List<TranHospitalRelation> tranHospitalRelationList = tranHospitalRelationService.list(new QueryWrapper<TranHospitalRelation>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+            );
+            Map<String, Long> relationMap = tranHospitalRelationList.stream().collect(
+                    Collectors.toMap(k -> k.getName().toUpperCase() + "_" + k.getCode().toUpperCase(), v -> v.getHospitalId(), (v1, v2) -> (v2), LinkedHashMap::new));
+            List<String> keyExist = Lists.newArrayList(); // 避免重复数据返回
+            List<String> keyAll = Lists.newArrayList(); // 当前医院所有key
+            List<HospitalRelationVO> errorOther = Lists.newArrayList(); // 与其他医院重复
+            List<HospitalRelationVO> errorCurrent = Lists.newArrayList(); // 当前医院重复
+
+            for (HospitalRelationVO hospitalRelationVO : hospitalRelationVOList) {
+                // 联合key
+                String unionKey = hospitalRelationVO.getName().toUpperCase() + "_" + hospitalRelationVO.getCode().toUpperCase();
+                // 判断当前医院重复
+                if (keyAll.contains(unionKey)) {
+                    errorCurrent.add(hospitalRelationVO);
+                } else {
+                    keyAll.add(unionKey);
+                }
+                // 判断与其他医院重复
+                Long hospitalId = relationMap.get(unionKey);
+                if (hospitalId != null && !hospitalId.equals(curHospitalId) && !keyExist.contains(unionKey)) {
+                    errorOther.add(hospitalRelationVO);
+                    keyExist.add(unionKey);
+                }
+            }
+
+            // 有错误,直接返回
+            if (ListUtil.isNotEmpty(errorOther) || ListUtil.isNotEmpty(errorCurrent)) {
+                res.setErrorOther(errorOther);
+                res.setErrorCurrent(errorCurrent);
+                return res;
+            }
+        }
+        return null;
     }
 
     /**
@@ -150,7 +240,11 @@ public class HospitalInfoFacade extends HospitalInfoServiceImpl {
     public Boolean deleteRecord(IdVO idVO) {
         String userId = UserUtils.getCurrentPrincipleID();
         Date now = DateUtil.now();
-        HospitalInfo hospitalInfo = hospitalInfoService.getById(idVO.getId());
+        Long id = idVO.getId();
+        if (idVO.getId().equals(-1)) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "当前医院不能删除");
+        }
+        HospitalInfo hospitalInfo = hospitalInfoService.getById(id);
         if (hospitalInfo == null) {
             throw new CommonException(CommonErrorCode.NOT_EXISTS, "数据不存在");
         }
@@ -161,24 +255,34 @@ public class HospitalInfoFacade extends HospitalInfoServiceImpl {
         List<MappingConfig> mappingConfigList
                 = mappingConfigFacade.list(new QueryWrapper<MappingConfig>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", idVO.getId()));
+                .eq("hospital_id", id));
         if (ListUtil.isNotEmpty(mappingConfigList)) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在关联数据,无法删除");
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在映射关联,无法删除");
         }
 
         List<Plan> planList
                 = planFacade.list(new QueryWrapper<Plan>()
                 .eq("is_deleted", IsDeleteEnum.N.getKey())
-                .eq("hospital_id", idVO.getId()));
+                .eq("hospital_id", id));
         if (ListUtil.isNotEmpty(planList)) {
-            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在关联数据,无法删除");
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在方案配置关联,无法删除");
         }
 
-
+        int count = tranHospitalRelationService.count(new QueryWrapper<TranHospitalRelation>()
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", id));
+        if (count > 0) {
+            throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该医院存在子医院关联,无法删除");
+        }
+        // 主表逻辑删除
         hospitalInfo.setIsDeleted(IsDeleteEnum.Y.getKey());
         hospitalInfo.setModifier(userId);
         hospitalInfo.setGmtModified(now);
         hospitalInfoService.updateById(hospitalInfo);
+
+        // 关联表物理删除
+        tranHospitalRelationService.remove(new QueryWrapper<TranHospitalRelation>()
+                .eq("hospital_id", id));
         return true;
     }
 
@@ -215,9 +319,24 @@ public class HospitalInfoFacade extends HospitalInfoServiceImpl {
      * @param hospitalInfoPageVO
      * @return
      */
-    @Override
-    public IPage<DiseaseConfig> getPage(HospitalInfoPageVO hospitalInfoPageVO) {
-        return hospitalInfoService.getPage(hospitalInfoPageVO);
+    public IPage<HospitalInfoPageDTO> getPageFac(HospitalInfoPageVO hospitalInfoPageVO) {
+        IPage<HospitalInfoPageDTO> page = hospitalInfoService.getPage(hospitalInfoPageVO);
+        List<HospitalInfoPageDTO> records = page.getRecords();
+        if (ListUtil.isNotEmpty(records)) {
+            List<Long> idList = records.stream().map(r -> r.getId()).collect(Collectors.toList());
+            List<TranHospitalRelation> relationList = tranHospitalRelationService.list(new QueryWrapper<TranHospitalRelation>()
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .in("hospital_id", idList)
+            );
+            Map<Long, List<TranHospitalRelation>> hospitalIdMap = EntityUtil.makeEntityListMap(relationList, "hospitalId");
+            for (HospitalInfoPageDTO hospitalInfoPageDTO : records) {
+                List<TranHospitalRelation> tranHospitalRelationList = hospitalIdMap.get(hospitalInfoPageDTO.getId());
+                if (ListUtil.isNotEmpty(tranHospitalRelationList)) {
+                    hospitalInfoPageDTO.setSonHospital(tranHospitalRelationList.stream().map(r -> r.getName()).collect(Collectors.joining(",")));
+                }
+            }
+        }
+        return page;
     }
 
     /**

+ 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);
 
         //术语映射

+ 14 - 0
cdssman-service/src/main/java/com/diagbot/facade/TranHospitalRelationFacade.java

@@ -0,0 +1,14 @@
+package com.diagbot.facade;
+
+import com.diagbot.service.impl.TranHospitalRelationServiceImpl;
+import org.springframework.stereotype.Component;
+
+/**
+ * @author zhoutg
+ * @Description:
+ * @date 2020-07-29 11:08
+ */
+@Component
+public class TranHospitalRelationFacade extends TranHospitalRelationServiceImpl {
+
+}

+ 2 - 2
cdssman-service/src/main/java/com/diagbot/mapper/HospitalInfoMapper.java

@@ -3,7 +3,7 @@ package com.diagbot.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.dto.ConceptMappingDTO;
-import com.diagbot.entity.DiseaseConfig;
+import com.diagbot.dto.HospitalInfoPageDTO;
 import com.diagbot.entity.HospitalInfo;
 import com.diagbot.vo.HospitalInfoPageVO;
 import org.apache.ibatis.annotations.Param;
@@ -23,7 +23,7 @@ public interface HospitalInfoMapper extends BaseMapper<HospitalInfo> {
      * @param hospitalInfoPageVO
      * @return
      */
-    IPage<DiseaseConfig> getPage(@Param("hospitalInfoPageVO") HospitalInfoPageVO hospitalInfoPageVO);
+    IPage<HospitalInfoPageDTO> getPage(@Param("hospitalInfoPageVO") HospitalInfoPageVO hospitalInfoPageVO);
 
     /**
      * 获取术语映射统计列表

+ 16 - 0
cdssman-service/src/main/java/com/diagbot/mapper/TranHospitalRelationMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.TranHospitalRelation;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 医院关联表 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-10-09
+ */
+public interface TranHospitalRelationMapper extends BaseMapper<TranHospitalRelation> {
+
+}

+ 2 - 2
cdssman-service/src/main/java/com/diagbot/service/HospitalInfoService.java

@@ -3,7 +3,7 @@ package com.diagbot.service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.diagbot.dto.ConceptMappingDTO;
-import com.diagbot.entity.DiseaseConfig;
+import com.diagbot.dto.HospitalInfoPageDTO;
 import com.diagbot.entity.HospitalInfo;
 import com.diagbot.vo.HospitalInfoPageVO;
 import org.apache.ibatis.annotations.Param;
@@ -23,7 +23,7 @@ public interface HospitalInfoService extends IService<HospitalInfo> {
      * @param hospitalInfoPageVO
      * @return
      */
-    IPage<DiseaseConfig> getPage(@Param("hospitalInfoPageVO") HospitalInfoPageVO hospitalInfoPageVO);
+    IPage<HospitalInfoPageDTO> getPage(@Param("hospitalInfoPageVO") HospitalInfoPageVO hospitalInfoPageVO);
 
     /**
      * 获取术语映射统计列表

+ 16 - 0
cdssman-service/src/main/java/com/diagbot/service/TranHospitalRelationService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.TranHospitalRelation;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 医院关联表 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-10-09
+ */
+public interface TranHospitalRelationService extends IService<TranHospitalRelation> {
+
+}

+ 2 - 2
cdssman-service/src/main/java/com/diagbot/service/impl/HospitalInfoServiceImpl.java

@@ -3,7 +3,7 @@ package com.diagbot.service.impl;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.diagbot.dto.ConceptMappingDTO;
-import com.diagbot.entity.DiseaseConfig;
+import com.diagbot.dto.HospitalInfoPageDTO;
 import com.diagbot.entity.HospitalInfo;
 import com.diagbot.mapper.HospitalInfoMapper;
 import com.diagbot.service.HospitalInfoService;
@@ -27,7 +27,7 @@ public class HospitalInfoServiceImpl extends ServiceImpl<HospitalInfoMapper, Hos
      * @param hospitalInfoPageVO
      * @return
      */
-    public IPage<DiseaseConfig> getPage(@Param("hospitalInfoPageVO") HospitalInfoPageVO hospitalInfoPageVO) {
+    public IPage<HospitalInfoPageDTO> getPage(@Param("hospitalInfoPageVO") HospitalInfoPageVO hospitalInfoPageVO) {
         return baseMapper.getPage(hospitalInfoPageVO);
     }
 

+ 20 - 0
cdssman-service/src/main/java/com/diagbot/service/impl/TranHospitalRelationServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.TranHospitalRelation;
+import com.diagbot.mapper.TranHospitalRelationMapper;
+import com.diagbot.service.TranHospitalRelationService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 医院关联表 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2021-10-09
+ */
+@Service
+public class TranHospitalRelationServiceImpl extends ServiceImpl<TranHospitalRelationMapper, TranHospitalRelation> implements TranHospitalRelationService {
+
+}

+ 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;
 }

+ 26 - 0
cdssman-service/src/main/java/com/diagbot/vo/HospitalInfoGetVO.java

@@ -0,0 +1,26 @@
+package com.diagbot.vo;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 医院信息表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-08-06
+ */
+@Data
+public class HospitalInfoGetVO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @NotNull(message = "医院id不能为空")
+    private Long id;
+}

+ 63 - 0
cdssman-service/src/main/java/com/diagbot/vo/HospitalInfoSaveVO.java

@@ -0,0 +1,63 @@
+package com.diagbot.vo;
+
+import com.google.common.collect.Lists;
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+import java.util.List;
+
+/**
+ * <p>
+ * 医院信息表
+ * </p>
+ *
+ * @author wangfeng
+ * @since 2020-08-06
+ */
+@Data
+public class HospitalInfoSaveVO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    private Long id;
+
+    /**
+     * 医院名称
+     */
+    @NotBlank(message = "医院名称不能为空")
+    private String name;
+
+    /**
+     * 医院地址
+     */
+    private String address;
+
+    /**
+     * 医院名称拼音
+     */
+    private String spell;
+
+    /**
+     * 状态:0.禁用1.启用
+     */
+    private Integer status;
+
+    /**
+     * 是否对接(0-不对接,1-对接)
+     */
+    private Integer connect;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    /**
+     * 子医院关联表
+     */
+    private List<HospitalRelationVO> hospitalRelationVOList = Lists.newLinkedList();
+}

+ 33 - 0
cdssman-service/src/main/java/com/diagbot/vo/HospitalRelationVO.java

@@ -0,0 +1,33 @@
+package com.diagbot.vo;
+
+import lombok.Data;
+
+import javax.validation.constraints.NotBlank;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 医院关联表
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-08-06
+ */
+@Data
+public class HospitalRelationVO implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 子医院名称
+     */
+    @NotBlank(message = "子医院名称不能为空")
+    private String name;
+
+    /**
+     * 子医院编码
+     */
+    @NotBlank(message = "子医院编码不能为空")
+    private String code;
+
+}

+ 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;
 }

+ 27 - 16
cdssman-service/src/main/java/com/diagbot/web/HospitalInfoController.java

@@ -5,13 +5,17 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.diagbot.annotation.SysLogger;
 import com.diagbot.dto.ConceptMappingDTO;
 import com.diagbot.dto.HospitalInfoDTO;
+import com.diagbot.dto.HospitalInfoGetDTO;
+import com.diagbot.dto.HospitalInfoPageDTO;
+import com.diagbot.dto.HospitalRelationErrorDTO;
 import com.diagbot.dto.RespDTO;
-import com.diagbot.entity.DiseaseConfig;
-import com.diagbot.entity.HospitalInfo;
+import com.diagbot.exception.ServiceErrorCode;
 import com.diagbot.facade.HospitalInfoFacade;
 import com.diagbot.vo.ChangeStatusVO;
+import com.diagbot.vo.HospitalInfoGetVO;
 import com.diagbot.vo.HospitalInfoListVO;
 import com.diagbot.vo.HospitalInfoPageVO;
+import com.diagbot.vo.HospitalInfoSaveVO;
 import com.diagbot.vo.HospitalSaveVO;
 import com.diagbot.vo.IdListVO;
 import com.diagbot.vo.IdVO;
@@ -52,19 +56,26 @@ public class HospitalInfoController {
         return RespDTO.onSuc(data);
     }
 
-    /**
-     * 保存或修改映射关系
-     *
-     * @param hospitalInfo
-     * @return
-     */
-    @ApiOperation(value = "保存或修改映射关系[by:zhaops]", notes = "")
+    @ApiOperation(value = "根据医院id获取信息[by:zhoutg]", notes = "")
+    @PostMapping("/getById")
+    @SysLogger("getById")
+    public RespDTO<HospitalInfoGetDTO> getById(@RequestBody @Valid HospitalInfoGetVO hospitalInfoGetVO) {
+        HospitalInfoGetDTO data = hospitalInfoFacade.getById(hospitalInfoGetVO);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "保存或修改[by:zhaops]", notes = "")
     @PostMapping("/saveOrUpdateRecord")
     @SysLogger("saveOrUpdateRecord")
     @Transactional
-    public RespDTO<Boolean> saveOrUpdateRecord(@RequestBody @Valid HospitalInfo hospitalInfo) {
-        Boolean data = hospitalInfoFacade.saveOrUpdateRecord(hospitalInfo);
-        return RespDTO.onSuc(data);
+    public RespDTO<HospitalRelationErrorDTO> saveOrUpdateRecord(@RequestBody @Valid HospitalInfoSaveVO hospitalInfoSaveVO) {
+        HospitalRelationErrorDTO errorData = hospitalInfoFacade.saveOrUpdateRecord(hospitalInfoSaveVO);
+        if (errorData != null) {
+            return RespDTO.onSucBoth(ServiceErrorCode.NAME_CODE_ERROR.getCode(),
+                    "操作失败,请检查【医院名称+医院编码】重复项",
+                    errorData);
+        }
+        return RespDTO.onSuc(errorData);
     }
 
     /**
@@ -83,12 +94,12 @@ public class HospitalInfoController {
     }
 
     /**
-     * 删除映射关系
+     * 删除
      *
      * @param idVO
      * @return
      */
-    @ApiOperation(value = "删除映射关系[by:zhaops]", notes = "")
+    @ApiOperation(value = "删除[by:zhaops]", notes = "")
     @PostMapping("/deleteRecord")
     @SysLogger("deleteRecord")
     @Transactional
@@ -121,8 +132,8 @@ public class HospitalInfoController {
     @ApiOperation(value = "分页查询[by:zhaops]", notes = "")
     @PostMapping("/getPage")
     @SysLogger("getPage")
-    public RespDTO<DiseaseConfig> getPage(@RequestBody @Valid HospitalInfoPageVO hospitalInfoPageVO) {
-        IPage<DiseaseConfig> data = hospitalInfoFacade.getPage(hospitalInfoPageVO);
+    public RespDTO<IPage<HospitalInfoPageDTO>> getPage(@RequestBody @Valid HospitalInfoPageVO hospitalInfoPageVO) {
+        IPage<HospitalInfoPageDTO> data = hospitalInfoFacade.getPageFac(hospitalInfoPageVO);
         return RespDTO.onSuc(data);
     }
 

+ 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);
     }
 
 

+ 1 - 1
cdssman-service/src/main/resources/mapper/HospitalInfoMapper.xml

@@ -21,7 +21,7 @@
     </resultMap>
 
     <!-- 分页查询 -->
-    <select id="getPage" resultType="com.diagbot.entity.HospitalInfo">
+    <select id="getPage" resultType="com.diagbot.dto.HospitalInfoPageDTO">
         select a.*
         from tran_hospital_info a
         where a.is_deleted='N'

+ 19 - 0
cdssman-service/src/main/resources/mapper/TranHospitalRelationMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.diagbot.mapper.TranHospitalRelationMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.TranHospitalRelation">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="code" property="code" />
+        <result column="name" property="name" />
+        <result column="hospital_id" property="hospitalId" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>

+ 2 - 2
cdssman-service/src/test/java/com/diagbot/CodeGeneration.java

@@ -49,14 +49,14 @@ public class CodeGeneration {
         dsc.setDriverName("com.mysql.cj.jdbc.Driver");
         dsc.setUsername("root");
         dsc.setPassword("lantone");
-        dsc.setUrl("jdbc:mysql://192.168.2.236:3306/med_2021?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8");
+        dsc.setUrl("jdbc:mysql://192.168.2.236:3306/cdss?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf-8");
         mpg.setDataSource(dsc);
 
         // 策略配置
         StrategyConfig strategy = new StrategyConfig();
         //strategy.setTablePrefix(new String[] { "test" });// 此处可以修改为您的表前缀
         strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
-        strategy.setInclude(new String[] { "kl_tcm_disease","kl_tcm_syndrome"}); // 需要生成的表
+        strategy.setInclude(new String[] { "tran_hospital_relation"}); // 需要生成的表
 
         strategy.setSuperServiceClass(null);
         strategy.setSuperServiceImplClass(null);

+ 1 - 1
user-service/src/main/java/com/diagbot/service/impl/TokenServiceImpl.java

@@ -56,7 +56,7 @@ public class TokenServiceImpl implements TokenService {
      */
     @Override
     public Boolean createToken(JwtStore token) {
-        DecodedJWT jwt = JwtUtil.decodedJWT(token.getRefreshToken());
+        DecodedJWT jwt = JwtUtil.decodedJWT(token.getAccessToken());
         Map<String, Claim> claims = jwt.getClaims();
         String userId = claims.get("user_id").asInt().toString();
         Date expDate = claims.get("exp").asDate();

+ 4 - 1
user-service/src/main/java/com/diagbot/web/UserController.java

@@ -108,7 +108,10 @@ public class UserController {
 
     @ApiOperation(value = "登录获取jwt[by:zhoutg]",
             notes = "username:用户名,必填<br>" +
-                    "password:密码, 必填, 默认密码:dc483e80a7a0bd9ef71d8cf973673924<br> ")
+                    "password:密码, 必填<br> " +
+                    "【236】:f6af7afd01d4eb0dc5fe0a342cd6cee7<br>" +
+                    "【241】:ccd2fc33d2d423d7209035dbfff82b29<br>" +
+                    "【121、122】:27f78bb8d0adb1568d674518302f10b6<br>")
     @PostMapping("/getJwt")
     @SysLogger("getJwt")
     public RespDTO<JwtDTO> getJwt(@RequestBody UserLoginVO userLoginVO) {