Forráskód Böngészése

Merge remote-tracking branch 'origin/dev/cdssman20200727_init' into debug

zhaops 4 éve
szülő
commit
744db991dc
33 módosított fájl, 972 hozzáadás és 132 törlés
  1. 1 1
      cdssman-service/src/main/java/com/diagbot/dto/ConceptDetailDTO.java
  2. 1 1
      cdssman-service/src/main/java/com/diagbot/dto/StaticKnowledgeDetailDTO.java
  3. 9 1
      cdssman-service/src/main/java/com/diagbot/dto/StaticKnowledgeIndexDTO.java
  4. 1 1
      cdssman-service/src/main/java/com/diagbot/entity/ConceptDetail.java
  5. 5 0
      cdssman-service/src/main/java/com/diagbot/entity/DeptConfig.java
  6. 3 0
      cdssman-service/src/main/java/com/diagbot/entity/DiseaseConfig.java
  7. 3 0
      cdssman-service/src/main/java/com/diagbot/entity/DrugConfig.java
  8. 3 0
      cdssman-service/src/main/java/com/diagbot/entity/OperationConfig.java
  9. 3 0
      cdssman-service/src/main/java/com/diagbot/entity/PacsConfig.java
  10. 178 0
      cdssman-service/src/main/java/com/diagbot/entity/TransfusionConfig.java
  11. 16 2
      cdssman-service/src/main/java/com/diagbot/enums/ConceptTypeEnum.java
  12. 27 15
      cdssman-service/src/main/java/com/diagbot/facade/ConceptInfoFacade.java
  13. 7 16
      cdssman-service/src/main/java/com/diagbot/facade/DeptConfigFacade.java
  14. 7 17
      cdssman-service/src/main/java/com/diagbot/facade/DiseaseConfigFacade.java
  15. 7 16
      cdssman-service/src/main/java/com/diagbot/facade/DrugConfigFacade.java
  16. 15 24
      cdssman-service/src/main/java/com/diagbot/facade/LisConfigFacade.java
  17. 7 16
      cdssman-service/src/main/java/com/diagbot/facade/OperationConfigFacade.java
  18. 7 16
      cdssman-service/src/main/java/com/diagbot/facade/PacsConfigFacade.java
  19. 266 0
      cdssman-service/src/main/java/com/diagbot/facade/TransfusionConfigFacade.java
  20. 35 0
      cdssman-service/src/main/java/com/diagbot/mapper/TransfusionConfigMapper.java
  21. 35 0
      cdssman-service/src/main/java/com/diagbot/service/TransfusionConfigService.java
  22. 46 0
      cdssman-service/src/main/java/com/diagbot/service/impl/TransfusionConfigServiceImpl.java
  23. 1 1
      cdssman-service/src/main/java/com/diagbot/vo/ConceptDetailVO.java
  24. 2 1
      cdssman-service/src/main/java/com/diagbot/vo/DiseaseConfigPageVO.java
  25. 2 1
      cdssman-service/src/main/java/com/diagbot/vo/DrugConfigPageVO.java
  26. 18 0
      cdssman-service/src/main/java/com/diagbot/vo/TransfusionConfigListVO.java
  27. 36 0
      cdssman-service/src/main/java/com/diagbot/vo/TransfusionConfigPageVO.java
  28. 174 0
      cdssman-service/src/main/java/com/diagbot/web/TransfusionConfigController.java
  29. 1 0
      cdssman-service/src/main/resources/mapper/ConceptInfoMapper.xml
  30. 53 0
      cdssman-service/src/main/resources/mapper/TransfusionConfigMapper.xml
  31. 1 1
      config-server/src/main/resources/shared/aipt-service-dev.yml
  32. 1 1
      config-server/src/main/resources/shared/aipt-service-local.yml
  33. 1 1
      config-server/src/main/resources/shared/aipt-service-pre.yml

+ 1 - 1
cdssman-service/src/main/java/com/diagbot/dto/ConceptDetailDTO.java

@@ -37,7 +37,7 @@ public class ConceptDetailDTO {
     private Integer orderNo;
 
     /**
-     * 内容类型(多选):1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径
+     * 内容类型(多选):1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径,4-治疗方案
      */
     private String contentType;
 }

+ 1 - 1
cdssman-service/src/main/java/com/diagbot/dto/StaticKnowledgeDetailDTO.java

@@ -37,7 +37,7 @@ public class StaticKnowledgeDetailDTO {
     private Integer orderNo;
 
     /**
-     * 内容类型(多选):1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径
+     * 内容类型(多选):1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径,4-治疗方案
      */
     private String contentType;
 }

+ 9 - 1
cdssman-service/src/main/java/com/diagbot/dto/StaticKnowledgeIndexDTO.java

@@ -34,7 +34,11 @@ public class StaticKnowledgeIndexDTO {
     /**
      * 是否有静态知识
      */
-    private Integer hasInfomation = 0;
+    private Integer hasInfo = 0;
+    /**
+     * 是否有基本静态知识
+     */
+    private Integer hasStaticKnowledge = 0;
     /**
      * 是否有临床路径
      */
@@ -43,4 +47,8 @@ public class StaticKnowledgeIndexDTO {
      * 是否有注意事项
      */
     private Integer hasNotice = 0;
+    /**
+     * 是否有治疗方案静态知识
+     */
+    private Integer hasTreatInfo = 0;
 }

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

@@ -77,7 +77,7 @@ public class ConceptDetail implements Serializable {
     private Integer orderNo;
 
     /**
-     * 内容类型(多选):1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径
+     * 内容类型(多选):1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径,4-治疗方案
      */
     private String contentType;
 

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

@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 import java.util.Date;
 
@@ -55,12 +57,14 @@ public class DeptConfig implements Serializable {
     /**
      * 医院id
      */
+    @NotNull(message = "请输入医院id")
     private Long hospitalId;
 
     /**
      * 医院项目名称
      */
     @Excel(name="HIS名称", width = 40)
+    @NotBlank(message = "请输入医院端项目名称")
     private String hisName;
 
     /**
@@ -73,6 +77,7 @@ public class DeptConfig implements Serializable {
      * 标准名称
      */
     @Excel(name = "标准名称", width = 40)
+    @NotBlank(message = "请输入标准术语名称")
     private String uniqueName;
 
     /**

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

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 
+import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 import java.util.Date;
@@ -63,12 +64,14 @@ public class DiseaseConfig implements Serializable {
      * his名称
      */
     @Excel(name="HIS名称", width = 40)
+    @NotBlank(message = "请输入医院端项目名称")
     private String hisName;
 
     /**
      * 标准名
      */
     @Excel(name = "标准名称", width = 40)
+    @NotBlank(message = "请输入标准术语名称")
     private String uniqueName;
 
     /**

+ 3 - 0
cdssman-service/src/main/java/com/diagbot/entity/DrugConfig.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 
+import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 import java.util.Date;
@@ -63,12 +64,14 @@ public class DrugConfig implements Serializable {
      * his名称
      */
     @Excel(name="HIS名称", width = 40)
+    @NotBlank(message = "请输入医院端项目名称")
     private String hisName;
 
     /**
      * 标准名
      */
     @Excel(name = "标准名称", width = 40)
+    @NotBlank(message = "请输入标准术语名称")
     private String uniqueName;
 
     /**

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

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 
+import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 import java.util.Date;
@@ -63,12 +64,14 @@ public class OperationConfig implements Serializable {
      * his名称
      */
     @Excel(name="HIS名称", width = 40)
+    @NotBlank(message = "请输入医院端项目名称")
     private String hisName;
 
     /**
      * 标准名
      */
     @Excel(name = "标准名称", width = 40)
+    @NotBlank(message = "请输入标准术语名称")
     private String uniqueName;
 
     /**

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

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 
+import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 import java.util.Date;
@@ -63,12 +64,14 @@ public class PacsConfig implements Serializable {
      * his名称
      */
     @Excel(name="HIS名称", width = 40)
+    @NotBlank(message = "请输入医院端项目名称")
     private String hisName;
 
     /**
      * 标准名
      */
     @Excel(name = "标准名称", width = 40)
+    @NotBlank(message = "请输入标准术语名称")
     private String uniqueName;
 
     /**

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

@@ -0,0 +1,178 @@
+package com.diagbot.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 输血映射表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-08-31
+ */
+@TableName("tran_transfusion_config")
+public class TransfusionConfig 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;
+
+    /**
+     * 医院id
+     */
+    @NotNull(message = "请输入医院id")
+    private Long hospitalId;
+
+    /**
+     * 医院项目名称
+     */
+    @Excel(name = "HIS名称", width = 40)
+    @NotBlank(message = "请输入医院端项目名称")
+    private String hisName;
+
+    /**
+     * 标准名称
+     */
+    @Excel(name = "标准名称", width = 40)
+    @NotBlank(message = "请输入标准术语名称")
+    private String uniqueName;
+
+    /**
+     * 标准编码
+     */
+    @Excel(name = "标准编码", width = 40)
+    private String uniqueCode;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public Long getHospitalId() {
+        return hospitalId;
+    }
+
+    public void setHospitalId(Long hospitalId) {
+        this.hospitalId = hospitalId;
+    }
+
+    public String getHisName() {
+        return hisName;
+    }
+
+    public void setHisName(String hisName) {
+        this.hisName = hisName;
+    }
+
+    public String getUniqueName() {
+        return uniqueName;
+    }
+
+    public void setUniqueName(String uniqueName) {
+        this.uniqueName = uniqueName;
+    }
+
+    public String getUniqueCode() {
+        return uniqueCode;
+    }
+
+    public void setUniqueCode(String uniqueCode) {
+        this.uniqueCode = uniqueCode;
+    }
+
+    @Override
+    public String toString() {
+        return "TransfusionConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", hisName=" + hisName +
+                ", uniqueName=" + uniqueName +
+                ", uniqueCode=" + uniqueCode +
+                "}";
+    }
+}

+ 16 - 2
cdssman-service/src/main/java/com/diagbot/enums/ConceptTypeEnum.java

@@ -12,8 +12,8 @@ public enum ConceptTypeEnum implements KeyedNamed {
     All(0, "全部"),
     Disease(1, "诊断"),
     Drug(2, "药品"),
-    Lis(3, "检验套餐"),
-    LisPack(4, "检验明细"),
+    LisPack(3, "检验套餐"),
+    Lis(4, "检验明细"),
     Pacs(5, "检查"),
     Opeartion(6, "手术和操作");
 
@@ -37,11 +37,25 @@ public enum ConceptTypeEnum implements KeyedNamed {
         return null;
     }
 
+    public static ConceptTypeEnum getEnum(String name) {
+        for (ConceptTypeEnum item : ConceptTypeEnum.values()) {
+            if (item.name.equals(name)) {
+                return item;
+            }
+        }
+        return null;
+    }
+
     public static String getName(int key) {
         ConceptTypeEnum item = getEnum(key);
         return item != null ? item.name : null;
     }
 
+    public static int getKey(String name) {
+        ConceptTypeEnum item = getEnum(name);
+        return item != null ? item.key : null;
+    }
+
     @Override
     public int getKey() {
         return key;

+ 27 - 15
cdssman-service/src/main/java/com/diagbot/facade/ConceptInfoFacade.java

@@ -68,9 +68,7 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
         //过滤没有静态知识的检索结果
         staticKnowledgeIndexDTOList = staticKnowledgeIndexDTOList
                 .stream()
-                .filter(i -> i.getHasInfomation().equals(0)
-                        && i.getHasNotice().equals(0)
-                        && i.getHasClinicalPathway().equals(0))
+                .filter(i -> i.getHasInfo().equals(0))
                 .collect(Collectors.toList());
         return staticKnowledgeIndexDTOList;
     }
@@ -131,15 +129,18 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
                     for (StaticKnowledgeIndexDTO item : staticKnowledgeIndexDTOList) {
                         if (item.getId() == null
                                 || !detailMap.containsKey(item.getId())) {
-                            item.setHasInfomation(0);
+                            item.setHasInfo(0);
+                            item.setHasStaticKnowledge(0);
                             item.setHasClinicalPathway(0);
                             item.setHasNotice((0));
+                            item.setHasTreatInfo(0);
                             continue;
                         }
                         for (ConceptDetail detail : detailMap.get(item.getId())) {
+                            item.setHasInfo(1);
                             List<String> contentTypeList = Arrays.asList(detail.getContentType().split(","));
                             if (contentTypeList.contains("1")) {
-                                item.setHasInfomation(1);
+                                item.setHasStaticKnowledge(1);
                             }
                             if (contentTypeList.contains("2")) {
                                 item.setHasNotice(1);
@@ -147,6 +148,9 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
                             if (contentTypeList.contains("3")) {
                                 item.setHasClinicalPathway(1);
                             }
+                            if (contentTypeList.contains("4")) {
+                                item.setHasTreatInfo(1);
+                            }
                         }
                     }
                 }
@@ -211,7 +215,9 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
         List<ConceptInfoDTO> records = page.getRecords();
         if (ListUtil.isNotEmpty(records)) {
             records.forEach(record -> {
-                record.setTypeName(convertTypeName(record.getTypeName(), 2, dicList));
+                String typeName = convertTypeName(record.getType(), 2, dicList);
+                record.setTypeName(typeName);
+                record.setType(String.valueOf(ConceptTypeEnum.getKey(typeName)));
             });
         }
         page.setRecords(records);
@@ -231,29 +237,31 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
         //术语类型转换
         String typeName = convertTypeName(ConceptTypeEnum.getName(Integer.valueOf(conceptInfoVO.getType())), 1, dicList);
         conceptInfoVO.setTypeName(typeName);
+        ConceptInfo conceptInfo = new ConceptInfo();
         if (conceptInfoVO.getId() == null) {
             QueryWrapper<ConceptInfo> conceptInfoQueryWrapper = new QueryWrapper<>();
             conceptInfoQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
                     .eq("name", conceptInfoVO.getName())
                     .eq("type", typeName);
-            ConceptInfo conceptInfo = this.getOne(conceptInfoQueryWrapper, false);
+            conceptInfo = this.getOne(conceptInfoQueryWrapper, false);
             //术语不存在,保存术语信息
             if (conceptInfo == null) {
                 conceptInfo = new ConceptInfo();
-                BeanUtil.copyProperties(conceptInfoVO, conceptInfo);
-                conceptInfo.setType(typeName);
                 conceptInfo.setCreator(userId);
                 conceptInfo.setGmtCreate(now);
-                conceptInfo.setModifier(userId);
-                conceptInfo.setGmtModified(now);
-                this.save(conceptInfo);
             }
-            conceptInfoVO.setId(conceptInfo.getId());
         }
-
+        conceptInfo.setName(conceptInfoVO.getName());
+        conceptInfo.setClinicalPathwayName(conceptInfoVO.getClinicalPathwayName());
+        conceptInfo.setNoticeName(conceptInfoVO.getNoticeName());
+        conceptInfo.setType(typeName);
+        conceptInfo.setModifier(userId);
+        conceptInfo.setGmtModified(now);
+        this.saveOrUpdate(conceptInfo);
+        conceptInfoVO.setId(conceptInfo.getId());
         //是否包含静态信息,包含启用和禁用
         QueryWrapper<ConceptDetail> conceptDetailQueryWrapper = new QueryWrapper<>();
-        conceptDetailQueryWrapper.eq("concept_id", conceptInfoVO.getId());
+        conceptDetailQueryWrapper.eq("concept_id",conceptInfo.getId());
         List<ConceptDetail> oldDetails = conceptDetailFacade.list(conceptDetailQueryWrapper);
         if (ListUtil.isEmpty(oldDetails)
                 && ListUtil.isNotEmpty(conceptInfoVO.getDetails())) {
@@ -342,6 +350,7 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
      * @return
      */
     public ConceptInfoDTO getRecordById(IdVO idVO) {
+        List<DictionaryInfoDTO> dicList = dictionaryFacade.getListByGroupType(8);
         ConceptInfoDTO conceptInfoDTO = new ConceptInfoDTO();
         ConceptInfo conceptInfo = this.getById(idVO.getId());
         if (conceptInfo == null) {
@@ -357,6 +366,9 @@ public class ConceptInfoFacade extends ConceptInfoServiceImpl {
             List<ConceptDetailDTO> details = BeanUtil.listCopyTo(conceptDetailList, ConceptDetailDTO.class);
             conceptInfoDTO.setDetails(details);
             //启用状态、修改人、修改时间为明细的内容
+            String typeName = convertTypeName(conceptInfoDTO.getType(), 2, dicList);
+            conceptInfoDTO.setTypeName(typeName);
+            conceptInfoDTO.setType(String.valueOf(ConceptTypeEnum.getKey(typeName)));
             conceptInfoDTO.setModifier(conceptDetailList.get(0).getModifier());
             conceptInfoDTO.setGmtModified(conceptDetailList.get(0).getGmtModified());
             conceptInfoDTO.setIsDeleted(conceptDetailList.get(0).getIsDeleted());

+ 7 - 16
cdssman-service/src/main/java/com/diagbot/facade/DeptConfigFacade.java

@@ -49,22 +49,13 @@ public class DeptConfigFacade {
      */
     public Boolean isExistRecord(DeptConfig deptConfig) {
         QueryWrapper<DeptConfig> queryWrapper = new QueryWrapper<>();
-        DeptConfig oldRecord = new DeptConfig();
-        if (deptConfig.getId() != null) {
-            oldRecord = deptConfigService.getById(deptConfig.getId());
-            if (oldRecord != null && oldRecord.getIsDeleted().equals(IsDeleteEnum.N.getKey())) {
-                return true;
-            }
-        }
-        if (StringUtil.isNotBlank(deptConfig.getHisName())) {
-            queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id", deptConfig.getHospitalId())
-                    .eq("his_name", deptConfig.getHisName())
-                    .eq("unique_name", deptConfig.getUniqueName());
-            oldRecord = deptConfigService.getOne(queryWrapper);
-            if (oldRecord != null) {
-                return true;
-            }
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", deptConfig.getHospitalId())
+                .eq("his_name", deptConfig.getHisName())
+                .eq("unique_name", deptConfig.getUniqueName());
+        DeptConfig oldRecord = deptConfigService.getOne(queryWrapper, false);
+        if (oldRecord != null) {
+            return true;
         }
         return false;
     }

+ 7 - 17
cdssman-service/src/main/java/com/diagbot/facade/DiseaseConfigFacade.java

@@ -48,23 +48,13 @@ public class DiseaseConfigFacade {
      */
     public Boolean isExistRecord(DiseaseConfig diseaseConfig) {
         QueryWrapper<DiseaseConfig> queryWrapper = new QueryWrapper<>();
-        DiseaseConfig oldRecord = new DiseaseConfig();
-        if (diseaseConfig.getId() != null) {
-            oldRecord = diseaseConfigService.getById(diseaseConfig.getId());
-            if (oldRecord != null && oldRecord.getIsDeleted().equals(IsDeleteEnum.N.getKey())) {
-                return true;
-            }
-        }
-        //hisName:uniqueName 1:n
-        if (StringUtil.isNotBlank(diseaseConfig.getHisName())) {
-            queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id", diseaseConfig.getHospitalId())
-                    .eq("his_name", diseaseConfig.getHisName())
-                    .eq("unique_name", diseaseConfig.getUniqueName());
-            oldRecord = diseaseConfigService.getOne(queryWrapper);
-            if (oldRecord != null) {
-                return true;
-            }
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", diseaseConfig.getHospitalId())
+                .eq("his_name", diseaseConfig.getHisName())
+                .eq("unique_name", diseaseConfig.getUniqueName());
+        DiseaseConfig oldRecord = diseaseConfigService.getOne(queryWrapper, false);
+        if (oldRecord != null) {
+            return true;
         }
         return false;
     }

+ 7 - 16
cdssman-service/src/main/java/com/diagbot/facade/DrugConfigFacade.java

@@ -49,22 +49,13 @@ public class DrugConfigFacade {
      */
     public Boolean isExistRecord(DrugConfig drugConfig) {
         QueryWrapper<DrugConfig> queryWrapper = new QueryWrapper<>();
-        DrugConfig oldRecord = new DrugConfig();
-        if (drugConfig.getId() != null) {
-            oldRecord = drugConfigService.getById(drugConfig.getId());
-            if (oldRecord != null && oldRecord.getIsDeleted().equals(IsDeleteEnum.N.getKey())) {
-                return true;
-            }
-        }
-        if (StringUtil.isNotBlank(drugConfig.getHisName())) {
-            queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id", drugConfig.getHospitalId())
-                    .eq("his_name", drugConfig.getHisName())
-                    .eq("unique_name", drugConfig.getUniqueName());
-            oldRecord = drugConfigService.getOne(queryWrapper);
-            if (oldRecord != null) {
-                return true;
-            }
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", drugConfig.getHospitalId())
+                .eq("his_name", drugConfig.getHisName())
+                .eq("unique_name", drugConfig.getUniqueName());
+        DrugConfig oldRecord = drugConfigService.getOne(queryWrapper, false);
+        if (oldRecord != null) {
+            return true;
         }
         return false;
     }

+ 15 - 24
cdssman-service/src/main/java/com/diagbot/facade/LisConfigFacade.java

@@ -49,30 +49,21 @@ public class LisConfigFacade{
      */
     public Boolean isExistRecord(LisConfig lisConfig) {
         QueryWrapper<LisConfig> queryWrapper = new QueryWrapper<>();
-        LisConfig oldRecord = new LisConfig();
-        if (lisConfig.getId() != null) {
-            oldRecord = lisConfigService.getById(lisConfig.getId());
-            if (oldRecord != null && oldRecord.getIsDeleted().equals(IsDeleteEnum.N.getKey())) {
-                return true;
-            }
-        } else if (StringUtil.isNotBlank(lisConfig.getHisName())) {
-            queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id", lisConfig.getHospitalId())
-                    .eq("his_name", lisConfig.getHisName())
-                    .eq("unique_name", lisConfig.getUniqueName());
-            if (StringUtil.isBlank(lisConfig.getHisDetailName())) {
-                queryWrapper
-                        .isNull("his_detail_name")
-                        .or()
-                        .eq("his_detail_name", "");
-            } else {
-                queryWrapper
-                        .eq("his_detail_name", lisConfig.getHisDetailName());
-            }
-            oldRecord = lisConfigService.getOne(queryWrapper);
-            if (oldRecord != null) {
-                return true;
-            }
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", lisConfig.getHospitalId())
+                .eq("his_name", lisConfig.getHisName())
+                .eq("unique_name", lisConfig.getUniqueName());
+        if (StringUtil.isBlank(lisConfig.getHisDetailName())) {
+            queryWrapper.and(i -> i.isNull("his_detail_name")
+                    .or()
+                    .eq("his_detail_name", ""));
+        } else {
+            queryWrapper
+                    .eq("his_detail_name", lisConfig.getHisDetailName());
+        }
+        LisConfig oldRecord = lisConfigService.getOne(queryWrapper, false);
+        if (oldRecord != null) {
+            return true;
         }
         return false;
     }

+ 7 - 16
cdssman-service/src/main/java/com/diagbot/facade/OperationConfigFacade.java

@@ -49,22 +49,13 @@ public class OperationConfigFacade {
      */
     public Boolean isExistRecord(OperationConfig operationConfig) {
         QueryWrapper<OperationConfig> queryWrapper = new QueryWrapper<>();
-        OperationConfig oldRecord = new OperationConfig();
-        if (operationConfig.getId() != null) {
-            oldRecord = operationConfigService.getById(operationConfig.getId());
-            if (oldRecord != null && oldRecord.getIsDeleted().equals(IsDeleteEnum.N.getKey())) {
-                return true;
-            }
-        }
-        if (StringUtil.isNotBlank(operationConfig.getHisName())) {
-            queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id",operationConfig.getHospitalId())
-                    .eq("his_name", operationConfig.getHisName())
-                    .eq("unique_name", operationConfig.getUniqueName());
-            oldRecord = operationConfigService.getOne(queryWrapper);
-            if (oldRecord != null) {
-                return true;
-            }
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", operationConfig.getHospitalId())
+                .eq("his_name", operationConfig.getHisName())
+                .eq("unique_name", operationConfig.getUniqueName());
+        OperationConfig oldRecord = operationConfigService.getOne(queryWrapper, false);
+        if (oldRecord != null) {
+            return true;
         }
         return false;
     }

+ 7 - 16
cdssman-service/src/main/java/com/diagbot/facade/PacsConfigFacade.java

@@ -49,22 +49,13 @@ public class PacsConfigFacade {
      */
     public Boolean isExistRecord(PacsConfig pacsConfig) {
         QueryWrapper<PacsConfig> queryWrapper = new QueryWrapper<>();
-        PacsConfig oldRecord = new PacsConfig();
-        if (pacsConfig.getId() != null) {
-            oldRecord = pacsConfigService.getById(pacsConfig.getId());
-            if (oldRecord != null && oldRecord.getIsDeleted().equals(IsDeleteEnum.N.getKey())) {
-                return true;
-            }
-        }
-        if (StringUtil.isNotBlank(pacsConfig.getHisName())) {
-            queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
-                    .eq("hospital_id", pacsConfig.getHospitalId())
-                    .eq("his_name", pacsConfig.getHisName())
-                    .eq("unique_name", pacsConfig.getUniqueName());
-            oldRecord = pacsConfigService.getOne(queryWrapper);
-            if (oldRecord != null) {
-                return true;
-            }
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", pacsConfig.getHospitalId())
+                .eq("his_name", pacsConfig.getHisName())
+                .eq("unique_name", pacsConfig.getUniqueName());
+        PacsConfig oldRecord = pacsConfigService.getOne(queryWrapper, false);
+        if (oldRecord != null) {
+            return true;
         }
         return false;
     }

+ 266 - 0
cdssman-service/src/main/java/com/diagbot/facade/TransfusionConfigFacade.java

@@ -0,0 +1,266 @@
+package com.diagbot.facade;
+
+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.HosRelationNumDTO;
+import com.diagbot.entity.TransfusionConfig;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.service.TransfusionConfigService;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ExcelUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.TransfusionConfigListVO;
+import com.diagbot.vo.TransfusionConfigPageVO;
+import com.diagbot.vo.HosRelationNumPageVO;
+import com.diagbot.vo.HospitalIdVO;
+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.stereotype.Component;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/9/1 11:03
+ */
+@Component
+public class TransfusionConfigFacade {
+    @Autowired
+    private TransfusionConfigService transfusionConfigService;
+
+    /**
+     * 判断是否已存在
+     *
+     * @param transfusionConfig
+     * @return
+     */
+    public Boolean isExistRecord(TransfusionConfig transfusionConfig) {
+        QueryWrapper<TransfusionConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", transfusionConfig.getHospitalId())
+                .eq("his_name", transfusionConfig.getHisName())
+                .eq("unique_name", transfusionConfig.getUniqueName());
+        TransfusionConfig oldRecord = transfusionConfigService.getOne(queryWrapper, false);
+        if (oldRecord != null) {
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * 保存记录-单条
+     *
+     * @param transfusionConfig
+     * @return
+     */
+    public Boolean saveOrUpdateRecord(TransfusionConfig transfusionConfig) {
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        transfusionConfig.setModifier(userId);
+        transfusionConfig.setGmtModified(now);
+        //新增数据
+        if (transfusionConfig.getId() == null) {
+            transfusionConfig.setCreator(userId);
+            transfusionConfig.setGmtCreate(now);
+        }
+        if (transfusionConfig.getIsDeleted() == null) {
+            transfusionConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+        }
+        transfusionConfigService.saveOrUpdate(transfusionConfig);
+        return true;
+    }
+
+    /**
+     * 保存记录-批量
+     *
+     * @param transfusionConfigListVO
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(TransfusionConfigListVO transfusionConfigListVO) {
+        if (ListUtil.isEmpty(transfusionConfigListVO.getTransfusionConfigList())) {
+            return false;
+        }
+        return saveOrUpdateRecords(transfusionConfigListVO.getTransfusionConfigList());
+    }
+
+    /**
+     * 批量保存
+     *
+     * @param transfusionConfigList
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(List<TransfusionConfig> transfusionConfigList) {
+        if (ListUtil.isEmpty(transfusionConfigList)) {
+            return false;
+        }
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //数据不完整的不保存
+        //过滤外部名称或公表名为空的数据
+        transfusionConfigList = transfusionConfigList
+                .stream()
+                .filter(i -> i.getHospitalId() != null)
+                .filter(i -> StringUtil.isNotBlank(i.getHisName()))
+                .filter(i -> StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(transfusionConfigList)) {
+            return false;
+        }
+
+        Long hospitalId = transfusionConfigList.get(0).getHospitalId();
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, Long>> configMap
+                = getConfigMap(hospitalId, null, null);
+        transfusionConfigList.forEach(transfusionConfig -> {
+            transfusionConfig.setModifier(userId);
+            transfusionConfig.setGmtModified(now);
+            if (transfusionConfig.getId() == null) {
+                if (configMap.containsKey(transfusionConfig.getHisName())) {
+                    deleteIds.add(configMap.get(transfusionConfig.getHisName()).get(transfusionConfig.getUniqueName()));
+                }
+                transfusionConfig.setCreator(userId);
+                transfusionConfig.setGmtCreate(now);
+            }
+            if (transfusionConfig.getIsDeleted() == null) {
+                transfusionConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+        transfusionConfigService.saveOrUpdateBatch(transfusionConfigList);
+        return true;
+    }
+
+    /**
+     * 删除记录-单条
+     *
+     * @param idVO
+     * @return
+     */
+    public Boolean deleteRecord(IdVO idVO) {
+        UpdateWrapper<TransfusionConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("id", idVO.getId())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        transfusionConfigService.removeById(idVO.getId());
+        return true;
+    }
+
+    /**
+     * 删除记录-批量
+     *
+     * @param idListVO
+     * @return
+     */
+    public Boolean deleteRecords(IdListVO idListVO) {
+        if (ListUtil.isEmpty(idListVO.getIds())) {
+            return false;
+        }
+        UpdateWrapper<TransfusionConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.in("id", idListVO.getIds())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        transfusionConfigService.removeByIds(idListVO.getIds());
+        return true;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param transfusionConfigPageVO
+     * @return
+     */
+    public IPage<TransfusionConfig> getPage(TransfusionConfigPageVO transfusionConfigPageVO) {
+        return transfusionConfigService.getPage(transfusionConfigPageVO);
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param file
+     * @param hospitalIdVO
+     */
+    public void importExcel(MultipartFile file, HospitalIdVO hospitalIdVO) {
+        List<TransfusionConfig> transfusionConfigList = ExcelUtils.importExcel(file, 0, 1, TransfusionConfig.class);
+        if (ListUtil.isNotEmpty(transfusionConfigList)) {
+            transfusionConfigList.forEach(transfusionConfig -> {
+                transfusionConfig.setHospitalId(hospitalIdVO.getHospitalId());
+            });
+            saveOrUpdateRecords(transfusionConfigList);
+        }
+    }
+
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, Long>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, Long>> retMap = new HashMap<>();
+        QueryWrapper<TransfusionConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        if (ListUtil.isNotEmpty(hisNames)) {
+            queryWrapper.in("his_name", hisNames);
+        }
+        if (ListUtil.isNotEmpty(uniqueNames)) {
+            queryWrapper.in("unique_name", uniqueNames);
+        }
+        List<TransfusionConfig> records = transfusionConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<TransfusionConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<TransfusionConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                retMap.put(entry.getKey(), EntityUtil.makeMapWithKeyValue(entry.getValue(), "uniqueName", "id"));
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     * @param hospitalIdVO
+     */
+    public void exportExcel(HttpServletResponse response, HospitalIdVO hospitalIdVO) {
+        QueryWrapper<TransfusionConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalIdVO.getHospitalId());
+        List<TransfusionConfig> records = transfusionConfigService.list(queryWrapper);
+        String fileName = "输血映射.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", TransfusionConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 各医院映射关系数列表
+     *
+     * @param hosRelationNumPageVO
+     * @return
+     */
+    public IPage<HosRelationNumDTO> getRelationNumPage(HosRelationNumPageVO hosRelationNumPageVO) {
+        return transfusionConfigService.getRelationNumPage(hosRelationNumPageVO);
+    }
+}

+ 35 - 0
cdssman-service/src/main/java/com/diagbot/mapper/TransfusionConfigMapper.java

@@ -0,0 +1,35 @@
+package com.diagbot.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.dto.HosRelationNumDTO;
+import com.diagbot.entity.TransfusionConfig;
+import com.diagbot.vo.HosRelationNumPageVO;
+import com.diagbot.vo.TransfusionConfigPageVO;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * <p>
+ * 输血映射表 Mapper 接口
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-08-31
+ */
+public interface TransfusionConfigMapper extends BaseMapper<TransfusionConfig> {
+    /**
+     * 分页查询
+     *
+     * @param transfusionConfigPageVO
+     * @return
+     */
+    IPage<TransfusionConfig> getPage(@Param("transfusionConfigPageVO") TransfusionConfigPageVO transfusionConfigPageVO);
+
+    /**
+     * 各医院映射关系数列表
+     *
+     * @param hosRelationNumPageVO
+     * @return
+     */
+    IPage<HosRelationNumDTO> getRelationNumPage(@Param("hosRelationNumPageVO") HosRelationNumPageVO hosRelationNumPageVO);
+}

+ 35 - 0
cdssman-service/src/main/java/com/diagbot/service/TransfusionConfigService.java

@@ -0,0 +1,35 @@
+package com.diagbot.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.diagbot.dto.HosRelationNumDTO;
+import com.diagbot.entity.TransfusionConfig;
+import com.diagbot.vo.HosRelationNumPageVO;
+import com.diagbot.vo.TransfusionConfigPageVO;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * <p>
+ * 输血映射表 服务类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-08-31
+ */
+public interface TransfusionConfigService extends IService<TransfusionConfig> {
+    /**
+     * 分页查询
+     *
+     * @param transfusionConfigPageVO
+     * @return
+     */
+    IPage<TransfusionConfig> getPage(@Param("transfusionConfigPageVO") TransfusionConfigPageVO transfusionConfigPageVO);
+
+    /**
+     * 各医院映射关系数列表
+     *
+     * @param hosRelationNumPageVO
+     * @return
+     */
+    IPage<HosRelationNumDTO> getRelationNumPage(@Param("hosRelationNumPageVO") HosRelationNumPageVO hosRelationNumPageVO);
+}

+ 46 - 0
cdssman-service/src/main/java/com/diagbot/service/impl/TransfusionConfigServiceImpl.java

@@ -0,0 +1,46 @@
+package com.diagbot.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.diagbot.dto.HosRelationNumDTO;
+import com.diagbot.entity.TransfusionConfig;
+import com.diagbot.mapper.TransfusionConfigMapper;
+import com.diagbot.service.TransfusionConfigService;
+import com.diagbot.vo.HosRelationNumPageVO;
+import com.diagbot.vo.TransfusionConfigPageVO;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 输血映射表 服务实现类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2020-08-31
+ */
+@Service
+public class TransfusionConfigServiceImpl extends ServiceImpl<TransfusionConfigMapper, TransfusionConfig> implements TransfusionConfigService {
+
+    /**
+     * 分页查询
+     *
+     * @param transfusionConfigPageVO
+     * @return
+     */
+    @Override
+    public IPage<TransfusionConfig> getPage(@Param("transfusionConfigPageVO") TransfusionConfigPageVO transfusionConfigPageVO) {
+        return baseMapper.getPage(transfusionConfigPageVO);
+    }
+
+    /**
+     * 各医院映射关系数列表
+     *
+     * @param hosRelationNumPageVO
+     * @return
+     */
+    @Override
+    public IPage<HosRelationNumDTO> getRelationNumPage(@Param("hosRelationNumPageVO") HosRelationNumPageVO hosRelationNumPageVO) {
+        return baseMapper.getRelationNumPage(hosRelationNumPageVO);
+    }
+}

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

@@ -41,7 +41,7 @@ public class ConceptDetailVO {
     private Integer orderNo;
 
     /**
-     * 内容类型(多选):1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径
+     * 内容类型(多选):1-化验、辅检、手术和操作、诊断、药品静态信息,2-注意事项,3-临床路径,4-治疗方案
      */
     private String contentType;
 }

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

@@ -1,5 +1,6 @@
 package com.diagbot.vo;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -12,7 +13,7 @@ import javax.validation.constraints.NotNull;
  */
 @Getter
 @Setter
-public class DiseaseConfigPageVO {
+public class DiseaseConfigPageVO extends Page {
     /**
      * 医院id
      */

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

@@ -1,5 +1,6 @@
 package com.diagbot.vo;
 
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -12,7 +13,7 @@ import javax.validation.constraints.NotNull;
  */
 @Getter
 @Setter
-public class DrugConfigPageVO {
+public class DrugConfigPageVO extends Page {
     /**
      * 医院id
      */

+ 18 - 0
cdssman-service/src/main/java/com/diagbot/vo/TransfusionConfigListVO.java

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import com.diagbot.entity.TransfusionConfig;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/31 11:26
+ */
+@Getter
+@Setter
+public class TransfusionConfigListVO {
+    private List<TransfusionConfig> transfusionConfigList;
+}

+ 36 - 0
cdssman-service/src/main/java/com/diagbot/vo/TransfusionConfigPageVO.java

@@ -0,0 +1,36 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/8/31 11:25
+ */
+@Getter
+@Setter
+public class TransfusionConfigPageVO extends Page {
+    /**
+     * 医院id
+     */
+    @ApiModelProperty(hidden = true)
+    private Long hospitalId;
+
+    /**
+     * his项目名称
+     */
+    private String hisName;
+
+    /**
+     * 标准名
+     */
+    private String uniqueName;
+
+    /**
+     * 标准编码
+     */
+    private String uniqueCode;
+}

+ 174 - 0
cdssman-service/src/main/java/com/diagbot/web/TransfusionConfigController.java

@@ -0,0 +1,174 @@
+package com.diagbot.web;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.HosRelationNumDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.TransfusionConfig;
+import com.diagbot.facade.TransfusionConfigFacade;
+import com.diagbot.vo.HosRelationNumPageVO;
+import com.diagbot.vo.HospitalIdVO;
+import com.diagbot.vo.IdListVO;
+import com.diagbot.vo.IdVO;
+import com.diagbot.vo.TransfusionConfigListVO;
+import com.diagbot.vo.TransfusionConfigPageVO;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.validation.Valid;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2020/9/1 11:05
+ */
+@RestController
+@RequestMapping("/tran/transfusionConfig")
+@Api(value = "输血公表映射API", tags = { "输血公表映射API" })
+@SuppressWarnings("unchecked")
+public class TransfusionConfigController {
+    @Autowired
+    private TransfusionConfigFacade transfusionConfigFacade;
+
+    /**
+     * 映射关系是否已存在
+     *
+     * @param transfusionConfig
+     * @return
+     */
+    @ApiOperation(value = "映射关系是否已存在[by:zhaops]", notes = "")
+    @PostMapping("/isExistRecord")
+    @SysLogger("isExistRecord")
+    public RespDTO<Boolean> isExistRecord(@RequestBody @Valid TransfusionConfig transfusionConfig) {
+        Boolean data = transfusionConfigFacade.isExistRecord(transfusionConfig);
+        return RespDTO.onSuc(data);
+    }
+
+    /**
+     * 保存或修改映射关系
+     *
+     * @param transfusionConfig
+     * @return
+     */
+    @ApiOperation(value = "保存或修改映射关系[by:zhaops]", notes = "")
+    @PostMapping("/saveOrUpdateRecord")
+    @SysLogger("saveOrUpdateRecord")
+    @Transactional
+    public RespDTO<Boolean> saveOrUpdateRecord(@RequestBody @Valid TransfusionConfig transfusionConfig) {
+        Boolean data = transfusionConfigFacade.saveOrUpdateRecord(transfusionConfig);
+        return RespDTO.onSuc(data);
+    }
+
+    /**
+     * 批量保存或修改映射关系
+     *
+     * @param transfusionConfigListVO
+     * @return
+     */
+    @ApiOperation(value = "批量保存或修改映射关系[by:zhaops]", notes = "")
+    @PostMapping("/saveOrUpdateRecords")
+    @SysLogger("saveOrUpdateRecords")
+    @Transactional
+    public RespDTO<Boolean> saveOrUpdateRecords(@RequestBody @Valid TransfusionConfigListVO transfusionConfigListVO) {
+        Boolean data = transfusionConfigFacade.saveOrUpdateRecords(transfusionConfigListVO);
+        return RespDTO.onSuc(data);
+    }
+
+    /**
+     * 删除映射关系
+     *
+     * @param idVO
+     * @return
+     */
+    @ApiOperation(value = "删除映射关系[by:zhaops]", notes = "")
+    @PostMapping("/deleteRecord")
+    @SysLogger("deleteRecord")
+    @Transactional
+    public RespDTO<Boolean> deleteRecord(@RequestBody @Valid IdVO idVO) {
+        Boolean data = transfusionConfigFacade.deleteRecord(idVO);
+        return RespDTO.onSuc(data);
+    }
+
+    /**
+     * 批量删除映射关系
+     *
+     * @param idListVO
+     * @return
+     */
+    @ApiOperation(value = "批量删除映射关系[by:zhaops]", notes = "")
+    @PostMapping("/deleteRecords")
+    @SysLogger("deleteRecords")
+    @Transactional
+    public RespDTO<Boolean> deleteRecords(@RequestBody @Valid IdListVO idListVO) {
+        Boolean data = transfusionConfigFacade.deleteRecords(idListVO);
+        return RespDTO.onSuc(data);
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param transfusionConfigPageVO
+     * @return
+     */
+    @ApiOperation(value = "分页查询[by:zhaops]", notes = "")
+    @PostMapping("/getPage")
+    @SysLogger("getPage")
+    public RespDTO<TransfusionConfig> getPage(@RequestBody @Valid TransfusionConfigPageVO transfusionConfigPageVO) {
+        IPage<TransfusionConfig> data = transfusionConfigFacade.getPage(transfusionConfigPageVO);
+        return RespDTO.onSuc(data);
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param file
+     * @param hospitalIdVO
+     * @return
+     */
+    @ApiOperation(value = "数据导入[by:zhaops]",
+            notes = "")
+    @PostMapping("/importExcel")
+    @SysLogger("importExcel")
+    @Transactional
+    public void importExcel(@RequestParam("file") MultipartFile file, @RequestBody @Valid HospitalIdVO hospitalIdVO) {
+        transfusionConfigFacade.importExcel(file, hospitalIdVO);
+    }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     * @param hospitalIdVO
+     */
+    @ApiOperation(value = "数据导出[by:zhaops]",
+            notes = "")
+    @PostMapping("/exportExcel")
+    @SysLogger("exportExcel")
+    public void exportExcel(HttpServletResponse response, @RequestBody @Valid HospitalIdVO hospitalIdVO) {
+        transfusionConfigFacade.exportExcel(response, hospitalIdVO);
+    }
+
+    /**
+     * 各医院映射关系数列表
+     *
+     * @param hosRelationNumPageVO
+     * @return
+     */
+    @ApiOperation(value = "各医院映射关系数列表[by:zhaops]",
+            notes = "")
+    @PostMapping("/getRelationNumPage")
+    @SysLogger("getRelationNumPage")
+    public RespDTO<IPage<HosRelationNumDTO>> getRelationNumPage(@RequestBody @Valid HosRelationNumPageVO hosRelationNumPageVO) {
+        IPage<HosRelationNumDTO> data = transfusionConfigFacade.getRelationNumPage(hosRelationNumPageVO);
+        return RespDTO.onSuc(data);
+    }
+}

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

@@ -58,6 +58,7 @@
         a.id
         ) t1
         LEFT JOIN sys_user t2 ON t1.modifier = t2.id
+        ORDER BY t1.gmtModified DESC
     </select>
 
 </mapper>

+ 53 - 0
cdssman-service/src/main/resources/mapper/TransfusionConfigMapper.xml

@@ -0,0 +1,53 @@
+<?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.TransfusionConfigMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.TransfusionConfig">
+        <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="hospital_id" property="hospitalId" />
+        <result column="his_name" property="hisName" />
+        <result column="unique_name" property="uniqueName" />
+        <result column="unique_code" property="uniqueCode" />
+    </resultMap>
+
+    <!-- 分页查询 -->
+    <select id="getPage" resultType="com.diagbot.entity.TransfusionConfig">
+        select a.*
+        from tran_transfusion_config a
+        where a.is_deleted='N'
+        <if test="transfusionConfigPageVO.hospitalId!=null">
+            and a.hospital_id=#{transfusionConfigPageVO.hospitalId}
+        </if>
+        <if test="transfusionConfigPageVO.hisName!=null and transfusionConfigPageVO.hisName!=''">
+            and a.his_name like concat("%",#{transfusionConfigPageVO.hisName},"%")
+        </if>
+        <if test="transfusionConfigPageVO.uniqueName!=null and transfusionConfigPageVO.uniqueName!=''">
+            and a.unique_name like concat("%",#{transfusionConfigPageVO.uniqueName},"%")
+        </if>
+        <if test="transfusionConfigPageVO.uniqueCode!=null and transfusionConfigPageVO.uniqueCode!=''">
+            and a.unique_code like concat("%",#{transfusionConfigPageVO.uniqueCode},"%")
+        </if>
+    </select>
+
+    <!-- 各医院映射关系数列表 -->
+    <select id="getRelationNumPage" resultType="com.diagbot.dto.HosRelationNumDTO">
+        SELECT
+        a.id,
+        a.NAME,
+        sum( b.id IS NOT NULL ) AS num
+        FROM
+        tran_hospital_info a
+        LEFT JOIN tran_transfusion_config b ON a.id = b.hospital_id
+        AND b.is_deleted = 'N'
+        WHERE
+        a.is_deleted = 'N'
+        GROUP BY
+        a.id
+    </select>
+</mapper>

+ 1 - 1
config-server/src/main/resources/shared/aipt-service-dev.yml

@@ -107,4 +107,4 @@ nlp:
 
 aineo:
   server:
-    address: http://192.168.2.234:8888
+    address: http://192.168.3.150:8888

+ 1 - 1
config-server/src/main/resources/shared/aipt-service-local.yml

@@ -107,4 +107,4 @@ nlp:
 
 aineo:
   server:
-    address: http://192.168.2.234:8888
+    address: http://192.168.3.150:8888

+ 1 - 1
config-server/src/main/resources/shared/aipt-service-pre.yml

@@ -107,4 +107,4 @@ nlp:
 
 aineo:
   server:
-    address: http://192.168.3.150:8888
+    address: http://192.168.2.186:8888