Browse Source

1、量表检索
2、量表映射关系维护
3、静态知识量表维护

zhaops 4 years ago
parent
commit
51393b09a0
19 changed files with 1280 additions and 12 deletions
  1. 1 0
      cdssman-service/src/main/java/com/diagbot/dto/ConceptMappingDTO.java
  2. 4 0
      cdssman-service/src/main/java/com/diagbot/dto/RetrievalDTO.java
  3. 19 0
      cdssman-service/src/main/java/com/diagbot/dto/ScaleInfoDTO.java
  4. 198 0
      cdssman-service/src/main/java/com/diagbot/entity/ScaleConfig.java
  5. 3 2
      cdssman-service/src/main/java/com/diagbot/enums/ConceptTypeEnum.java
  6. 2 2
      cdssman-service/src/main/java/com/diagbot/facade/OperationConfigFacade.java
  7. 1 1
      cdssman-service/src/main/java/com/diagbot/facade/ResultStaticKnowledgeFacade.java
  8. 596 0
      cdssman-service/src/main/java/com/diagbot/facade/ScaleConfigFacade.java
  9. 37 0
      cdssman-service/src/main/java/com/diagbot/mapper/ScaleConfigMapper.java
  10. 35 0
      cdssman-service/src/main/java/com/diagbot/service/ScaleConfigService.java
  11. 45 0
      cdssman-service/src/main/java/com/diagbot/service/impl/ScaleConfigServiceImpl.java
  12. 18 0
      cdssman-service/src/main/java/com/diagbot/vo/ScaleConfigListVO.java
  13. 37 0
      cdssman-service/src/main/java/com/diagbot/vo/ScaleConfigPageVO.java
  14. 4 4
      cdssman-service/src/main/java/com/diagbot/web/ConceptInfoController.java
  15. 1 1
      cdssman-service/src/main/java/com/diagbot/web/RetrievalController.java
  16. 220 0
      cdssman-service/src/main/java/com/diagbot/web/ScaleConfigController.java
  17. 3 1
      cdssman-service/src/main/resources/mapper/HospitalInfoMapper.xml
  18. 1 1
      cdssman-service/src/main/resources/mapper/OperationConfigMapper.xml
  19. 55 0
      cdssman-service/src/main/resources/mapper/ScaleConfigMapper.xml

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

@@ -21,4 +21,5 @@ public class ConceptMappingDTO {
     private Integer diseaseNum = 0;
     private Integer operationNum = 0;
     private Integer transfusionNum = 0;
+    private Integer scaleNum = 0;
 }

+ 4 - 0
cdssman-service/src/main/java/com/diagbot/dto/RetrievalDTO.java

@@ -45,4 +45,8 @@ public class RetrievalDTO {
      * 输血
      */
     private List<String> transfusionNames;
+    /**
+     * 量表
+     */
+    private List<ScaleInfoDTO> scalenames;
 }

+ 19 - 0
cdssman-service/src/main/java/com/diagbot/dto/ScaleInfoDTO.java

@@ -0,0 +1,19 @@
+package com.diagbot.dto;
+
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/4/13 14:06
+ */
+@Getter
+@Setter
+public class ScaleInfoDTO {
+    /**
+     * 量表名称
+     */
+    private String name;
+}
+

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

@@ -0,0 +1,198 @@
+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 java.io.Serializable;
+import java.util.Date;
+import java.util.Objects;
+
+/**
+ * <p>
+ * 量表映射表
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-04-13
+ */
+@TableName("tran_scale_config")
+public class ScaleConfig 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
+     */
+    private Long hospitalId;
+
+    /**
+     * 医院项目名称
+     */
+    @Excel(name = "医院量表名称", width = 60, orderNum = "1", isImportField = "true")
+    @NotBlank(message = "请输入医院量表名称")
+    private String hisName;
+
+    /**
+     * 标准名称
+     */
+    @Excel(name = "标准量表名称", width = 60, orderNum = "3", isImportField = "true")
+    @NotBlank(message = "请输入标准量表名称")
+    private String uniqueName;
+
+    /**
+     * 标准编码
+     */
+    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 "ScaleConfig{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", hospitalId=" + hospitalId +
+                ", hisName=" + hisName +
+                ", uniqueName=" + uniqueName +
+                ", uniqueCode=" + uniqueCode +
+                "}";
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (o == null || getClass() != o.getClass()) {
+            return false;
+        }
+        ScaleConfig scaleConfig = (ScaleConfig) o;
+        return Objects.equals(id, scaleConfig.id)
+                && Objects.equals(isDeleted, scaleConfig.isDeleted)
+                && Objects.equals(hospitalId, scaleConfig.hospitalId)
+                && Objects.equals(hisName, scaleConfig.hisName)
+                && Objects.equals(uniqueName, scaleConfig.uniqueName)
+                && Objects.equals(uniqueCode, scaleConfig.uniqueCode);
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id, isDeleted, hospitalId, hisName, uniqueName, uniqueCode);
+    }
+}

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

@@ -14,9 +14,10 @@ public enum ConceptTypeEnum implements KeyedNamed {
     Pacs(3, "检查"),
     Disease(4, "诊断"),
     Drug(5, "药品"),
-    Opeartion(6, "手术和操作"),
+    Operation(6, "手术和操作"),
     Dept(7, "科室"),
-    Transfusion(8, "输血");
+    Transfusion(8, "输血"),
+    Scale(10,"量表");
 
     @Setter
     private int key;

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

@@ -321,7 +321,7 @@ public class OperationConfigFacade {
                 .collect(Collectors.toList());
         ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(uniqueNames);
-        conceptVO.setType(ConceptTypeEnum.Opeartion.getKey());
+        conceptVO.setType(ConceptTypeEnum.Operation.getKey());
         RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
         RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
         List<String> names = respDTO.data;
@@ -516,7 +516,7 @@ public class OperationConfigFacade {
 
         ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(precUniqueName);
-        conceptVO.setType(ConceptTypeEnum.Opeartion.getKey());
+        conceptVO.setType(ConceptTypeEnum.Operation.getKey());
         RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
         RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
         List<String> uniqueNames = respDTO.data;

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

@@ -897,7 +897,7 @@ public class ResultStaticKnowledgeFacade extends ResultStaticKnowledgeServiceImp
                 .collect(Collectors.toList());
         ConceptVO conceptVO = new ConceptVO();
         conceptVO.setNames(uniqueNames);
-        conceptVO.setType(ConceptTypeEnum.Opeartion.getKey());
+        conceptVO.setType(ConceptTypeEnum.Operation.getKey());
         RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
         List<String> names = Lists.newLinkedList();
         if (RespDTOUtil.respIsOK(respDTO)) {

+ 596 - 0
cdssman-service/src/main/java/com/diagbot/facade/ScaleConfigFacade.java

@@ -0,0 +1,596 @@
+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.client.CdssCoreClient;
+import com.diagbot.dto.HosRelationNumDTO;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.entity.ScaleConfig;
+import com.diagbot.enums.ConceptTypeEnum;
+import com.diagbot.enums.IsDeleteEnum;
+import com.diagbot.exception.CommonErrorCode;
+import com.diagbot.exception.CommonException;
+import com.diagbot.service.ScaleConfigService;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.EntityUtil;
+import com.diagbot.util.ExcelUtils;
+import com.diagbot.util.ListUtil;
+import com.diagbot.util.RespDTOUtil;
+import com.diagbot.util.StringUtil;
+import com.diagbot.util.UserUtils;
+import com.diagbot.vo.ConceptVO;
+import com.diagbot.vo.HosRelationNumPageVO;
+import com.diagbot.vo.HospitalIdVO;
+import com.diagbot.vo.IdListVO;
+import com.diagbot.vo.IdVO;
+import com.diagbot.vo.ScaleConfigListVO;
+import com.diagbot.vo.ScaleConfigPageVO;
+import com.google.common.collect.Lists;
+import org.apache.commons.lang3.StringUtils;
+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.ArrayList;
+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: 2021/4/13 16:15
+ */
+@Component
+public class ScaleConfigFacade {
+    @Autowired
+    private ScaleConfigService scaleConfigService;
+    @Autowired
+    private CdssCoreClient cdssCoreClient;
+
+    /**
+     * 判断是否已存在
+     *
+     * @param scaleConfig
+     * @return
+     */
+    public Boolean isExistRecord(ScaleConfig scaleConfig) {
+        QueryWrapper<ScaleConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", scaleConfig.getHospitalId())
+                .eq("his_name", scaleConfig.getHisName())
+                .eq("unique_name", scaleConfig.getUniqueName());
+        ScaleConfig oldRecord = scaleConfigService.getOne(queryWrapper, false);
+        if (scaleConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        if (scaleConfig.getId() != null
+                && oldRecord != null
+                && !scaleConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        return false;
+    }
+
+    /**
+     * 保存记录-单条
+     *
+     * @param scaleConfig
+     * @return
+     */
+    public Boolean saveOrUpdateRecord(ScaleConfig scaleConfig) {
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+        scaleConfig.setModifier(userId);
+        scaleConfig.setGmtModified(now);
+        QueryWrapper<ScaleConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", scaleConfig.getHospitalId())
+                .eq("his_name", scaleConfig.getHisName())
+                .eq("unique_name", scaleConfig.getUniqueName());
+        ScaleConfig oldRecord = scaleConfigService.getOne(queryWrapper, false);
+        if (scaleConfig.getId() == null
+                && oldRecord != null) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        if (scaleConfig.getId() != null
+                && oldRecord != null
+                && !scaleConfig.getId().equals(oldRecord.getId())) {
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "该条关联已存在,无法保存");
+        }
+        //新增数据
+        if (scaleConfig.getId() == null) {
+            scaleConfig.setCreator(userId);
+            scaleConfig.setGmtCreate(now);
+        }
+        if (scaleConfig.getIsDeleted() == null) {
+            scaleConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+        }
+        scaleConfigService.saveOrUpdate(scaleConfig);
+        return true;
+    }
+
+    /**
+     * 保存记录-批量
+     *
+     * @param scaleConfigListVO
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(ScaleConfigListVO scaleConfigListVO) {
+        if (ListUtil.isEmpty(scaleConfigListVO.getScaleConfigList())) {
+            return false;
+        }
+        return saveOrUpdateRecords(scaleConfigListVO.getScaleConfigList());
+    }
+
+    /**
+     * 批量保存
+     *
+     * @param scaleConfigList
+     * @return
+     */
+    public Boolean saveOrUpdateRecords(List<ScaleConfig> scaleConfigList) {
+        if (ListUtil.isEmpty(scaleConfigList)) {
+            return false;
+        }
+
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //数据不完整的不保存
+        //过滤外部名称或公表名为空的数据
+        scaleConfigList = scaleConfigList
+                .stream()
+                .filter(i -> i.getHospitalId() != null)
+                .filter(i -> StringUtil.isNotBlank(i.getHisName()))
+                .filter(i -> StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+
+        if (ListUtil.isEmpty(scaleConfigList)) {
+            return false;
+        }
+
+        Long hospitalId = scaleConfigList.get(0).getHospitalId();
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, List<Long>>> configMap
+                = getConfigMap(hospitalId, null, null);
+        scaleConfigList.forEach(scaleConfig -> {
+            scaleConfig.setModifier(userId);
+            scaleConfig.setGmtModified(now);
+            if (scaleConfig.getId() == null) {
+                if (configMap.containsKey(scaleConfig.getHisName())
+                        && ListUtil.isNotEmpty(configMap.get(scaleConfig.getHisName()).get(scaleConfig.getUniqueName()))) {
+                    deleteIds.addAll(configMap.get(scaleConfig.getHisName()).get(scaleConfig.getUniqueName()));
+                }
+                scaleConfig.setCreator(userId);
+                scaleConfig.setGmtCreate(now);
+            }
+            if (scaleConfig.getIsDeleted() == null) {
+                scaleConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+        scaleConfigService.saveOrUpdateBatch(scaleConfigList);
+        return true;
+    }
+
+    /**
+     * 删除记录-单条
+     *
+     * @param idVO
+     * @return
+     */
+    public Boolean deleteRecord(IdVO idVO) {
+        UpdateWrapper<ScaleConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.eq("id", idVO.getId())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        scaleConfigService.removeById(idVO.getId());
+        return true;
+    }
+
+    /**
+     * 删除记录-批量
+     *
+     * @param idListVO
+     * @return
+     */
+    public Boolean deleteRecords(IdListVO idListVO) {
+        if (ListUtil.isEmpty(idListVO.getIds())) {
+            return false;
+        }
+        UpdateWrapper<ScaleConfig> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.in("id", idListVO.getIds())
+                .set("is_deleted", IsDeleteEnum.Y.getKey());
+        scaleConfigService.removeByIds(idListVO.getIds());
+        return true;
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param scaleConfigPageVO
+     * @return
+     */
+    public IPage<ScaleConfig> getPage(ScaleConfigPageVO scaleConfigPageVO) {
+        return scaleConfigService.getPage(scaleConfigPageVO);
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param file
+     * @param hospitalIdVO
+     */
+    public void importExcel(MultipartFile file, HospitalIdVO hospitalIdVO) {
+        List<ScaleConfig> scaleConfigList = ExcelUtils.importExcel(file, 0, 1, ScaleConfig.class);
+        if (ListUtil.isNotEmpty(scaleConfigList)) {
+            scaleConfigList.forEach(scaleConfig -> {
+                scaleConfig.setHospitalId(hospitalIdVO.getHospitalId());
+            });
+            importExcelRecords(scaleConfigList, hospitalIdVO);
+        } else {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param scaleConfigList
+     * @return
+     */
+    public Boolean importExcelRecords(List<ScaleConfig> scaleConfigList, HospitalIdVO hospitalIdVO) {
+        Long hospitalId = hospitalIdVO.getHospitalId();
+        String userId = UserUtils.getCurrentPrincipleID();
+        Date now = DateUtil.now();
+
+        //1、数据完整性校验
+        //2、去除前后空格
+        //过滤空数据,保留重复数据,方便计行
+        scaleConfigList = scaleConfigList.stream()
+                .filter(i -> StringUtil.isNotBlank(i.getHisName())
+                        || StringUtil.isNotBlank(i.getUniqueCode())
+                        || StringUtil.isNotBlank(i.getUniqueName()))
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(scaleConfigList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "校验失败,导入数据不能为空");
+        }
+        List<String> emptyNumList = Lists.newLinkedList();
+        for (int i = 0; i < scaleConfigList.size(); i++) {
+            if (StringUtil.isBlank(scaleConfigList.get(i).getHisName())
+                    || StringUtil.isBlank(scaleConfigList.get(i).getUniqueName())) {
+                emptyNumList.add(String.valueOf(i + 2));
+            }
+            if (StringUtil.isNotBlank(scaleConfigList.get(i).getHisName())) {
+                scaleConfigList.get(i).setHisName(scaleConfigList.get(i).getHisName().trim());
+            }
+            if (StringUtil.isNotBlank(scaleConfigList.get(i).getUniqueName())) {
+                scaleConfigList.get(i).setUniqueName(scaleConfigList.get(i).getUniqueName().trim());
+            }
+            if (StringUtil.isNotBlank(scaleConfigList.get(i).getUniqueCode())) {
+                scaleConfigList.get(i).setUniqueCode(scaleConfigList.get(i).getUniqueCode().trim());
+            } else {
+                scaleConfigList.get(i).setUniqueCode(null);
+            }
+        }
+
+        if (ListUtil.isNotEmpty(emptyNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL, "以下行数(不计入空行)存在不完整数据:"
+                    + emptyNumList.stream().collect(Collectors.joining("、"))
+                    + "。导入取消,请修改后再试。\n");
+        }
+
+        // 验证数据是否已存在,已存在的先删除
+        // 没id的删除重新插入,有id的更新
+        List<Long> deleteIds = Lists.newLinkedList();
+        Map<String, Map<String, List<Long>>> configMap
+                = getConfigMap(Long.valueOf(hospitalId), null, null);
+        scaleConfigList.forEach(scaleConfig -> {
+            scaleConfig.setHospitalId(Long.valueOf(hospitalId));
+            scaleConfig.setModifier(userId);
+            scaleConfig.setGmtModified(now);
+            if (scaleConfig.getId() == null) {
+                if (configMap.containsKey(scaleConfig.getHisName())
+                        && ListUtil.isNotEmpty(configMap.get(scaleConfig.getHisName()).get(scaleConfig.getUniqueName()))) {
+                    deleteIds.addAll(configMap.get(scaleConfig.getHisName()).get(scaleConfig.getUniqueName()));
+                }
+                scaleConfig.setCreator(userId);
+                scaleConfig.setGmtCreate(now);
+            }
+            if (scaleConfig.getIsDeleted() == null) {
+                scaleConfig.setIsDeleted(IsDeleteEnum.N.getKey());
+            }
+        });
+
+        //标准术语校验
+        List<String> errorNumList = Lists.newLinkedList();
+        List<String> uniqueNames = scaleConfigList.stream()
+                .map(i -> i.getUniqueName())
+                .distinct()
+                .collect(Collectors.toList());
+        ConceptVO conceptVO = new ConceptVO();
+        conceptVO.setNames(uniqueNames);
+        conceptVO.setType(ConceptTypeEnum.Scale.getKey());
+        RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+        RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+        List<String> names = respDTO.data;
+        for (int i = 0; i < scaleConfigList.size(); i++) {
+            if (!names.contains(scaleConfigList.get(i).getUniqueName())) {
+                errorNumList.add(String.valueOf(i + 2));
+            }
+        }
+        if (ListUtil.isNotEmpty(errorNumList)) {
+            throw new CommonException(CommonErrorCode.PARAM_IS_NULL,
+                    "以下行数(不计空行)标准术语在数据库中不存在:"
+                            + errorNumList.stream().collect(Collectors.joining("、"))
+                            + "。导入取消,请修改后再试。");
+        }
+
+        //重复数据过滤
+        scaleConfigList = scaleConfigList
+                .stream()
+                .distinct()
+                .collect(Collectors.toList());
+
+        //删除已存在映射关系
+        IdListVO idListVO = new IdListVO();
+        idListVO.setIds(deleteIds);
+        deleteRecords(idListVO);
+        scaleConfigService.saveOrUpdateBatch(scaleConfigList);
+        return true;
+    }
+
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, List<Long>>> getConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, List<Long>>> retMap = new HashMap<>();
+        QueryWrapper<ScaleConfig> 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<ScaleConfig> records = scaleConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<ScaleConfig>> configMap = EntityUtil.makeEntityListMap(records, "hisName");
+        for (Map.Entry<String, List<ScaleConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                Map<String, List<ScaleConfig>> subMap = EntityUtil.makeEntityListMap(entry.getValue(), "uniqueName");
+                Map<String, List<Long>> subIdMap = new HashMap<>();
+                for (Map.Entry<String, List<ScaleConfig>> subEntry : subMap.entrySet()) {
+                    subIdMap.put(subEntry.getKey(), subEntry.getValue().stream().map(i -> i.getId()).distinct().collect(Collectors.toList()));
+                }
+                retMap.put(entry.getKey(), subIdMap);
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 获取映射关系-公表名
+     *
+     * @param hospitalId
+     * @param hisNames
+     * @param uniqueNames
+     * @return
+     */
+    public Map<String, Map<String, List<Long>>> getUniqueConfigMap(Long hospitalId, List<String> hisNames, List<String> uniqueNames) {
+        Map<String, Map<String, List<Long>>> retMap = new HashMap<>();
+        QueryWrapper<ScaleConfig> 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<ScaleConfig> records = scaleConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        Map<String, List<ScaleConfig>> configMap = EntityUtil.makeEntityListMap(records, "uniqueName");
+        for (Map.Entry<String, List<ScaleConfig>> entry : configMap.entrySet()) {
+            if (ListUtil.isNotEmpty(entry.getValue())) {
+                Map<String, List<ScaleConfig>> subMap = EntityUtil.makeEntityListMap(entry.getValue(), "hisName");
+                Map<String, List<Long>> subIdMap = new HashMap<>();
+                for (Map.Entry<String, List<ScaleConfig>> subEntry : subMap.entrySet()) {
+                    subIdMap.put(subEntry.getKey(), subEntry.getValue().stream().map(i -> i.getId()).distinct().collect(Collectors.toList()));
+                }
+                retMap.put(entry.getKey(), subIdMap);
+            }
+        }
+        return retMap;
+    }
+
+    /**
+     * 数据导出
+     *
+     * @param response
+     * @param hospitalIdVO
+     */
+    public void exportExcel(HttpServletResponse response, HospitalIdVO hospitalIdVO) {
+        QueryWrapper<ScaleConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalIdVO.getHospitalId())
+                .orderByDesc("gmt_modified");
+        List<ScaleConfig> records = scaleConfigService.list(queryWrapper);
+        String fileName = "量表映射.xls";
+        ExcelUtils.exportExcel(records, null, "sheet1", ScaleConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 各医院映射关系数列表
+     *
+     * @param hosRelationNumPageVO
+     * @return
+     */
+    public IPage<HosRelationNumDTO> getRelationNumPage(HosRelationNumPageVO hosRelationNumPageVO) {
+        return scaleConfigService.getRelationNumPage(hosRelationNumPageVO);
+    }
+
+    /**
+     * 数据导入模板导出
+     *
+     * @param response
+     */
+    public void exportExcelModule(HttpServletResponse response) {
+        String fileName = "量表映射模板.xls";
+        ExcelUtils.exportExcel(new ArrayList<>(), null, "sheet1", ScaleConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 导入数据预匹配
+     *
+     * @param file
+     * @param response
+     */
+    public void precDataMatch(MultipartFile file, HttpServletResponse response) {
+        List<ScaleConfig> originList = ExcelUtils.importExcel(file, 0, 1, ScaleConfig.class);
+        List<ScaleConfig> retList = dataProcess(originList);
+
+        String fileName = "量表关联数据(预匹配).xls";
+        ExcelUtils.exportExcel(retList, null, "sheet1", ScaleConfig.class, fileName, response, 12.8f);
+    }
+
+    /**
+     * 导入数据验证
+     *
+     * @param file
+     * @return
+     */
+    public Boolean dataVerify(MultipartFile file) {
+        List<ScaleConfig> originList = ExcelUtils.importExcel(file, 0, 1, ScaleConfig.class);
+        List<ScaleConfig> retList = dataProcess(originList);
+        return true;
+    }
+
+    /**
+     * 数据处理
+     *
+     * @param originList
+     * @return
+     */
+    public List<ScaleConfig> dataProcess(List<ScaleConfig> originList) {
+        List<ScaleConfig> retList = Lists.newLinkedList();
+        List<String> hisNameList = originList.stream().map(i -> i.getHisName()).distinct().collect(Collectors.toList());
+        Map<String, List<ScaleConfig>> allMap = getAll(hisNameList);
+
+        //去除空格
+        originList.forEach(item -> {
+            item.setHisName(item.getHisName().trim());
+        });
+
+        //获取标准术语
+        List<String> precUniqueName = Lists.newArrayList();
+        if (allMap != null) {
+            for (Map.Entry<String, List<ScaleConfig>> entry : allMap.entrySet()) {
+                if (ListUtil.isNotEmpty(entry.getValue())) {
+                    precUniqueName.addAll(entry.getValue().stream().map(i -> i.getUniqueName()).collect(Collectors.toList()));
+                }
+            }
+        }
+        precUniqueName = precUniqueName.stream().distinct().collect(Collectors.toList());
+
+        ConceptVO conceptVO = new ConceptVO();
+        conceptVO.setNames(precUniqueName);
+        conceptVO.setType(ConceptTypeEnum.Scale.getKey());
+        RespDTO<List<String>> respDTO = cdssCoreClient.getConceptNames(conceptVO);
+        RespDTOUtil.respNGDealCover(respDTO, "标准术语校验失败");
+        List<String> uniqueNames = respDTO.data;
+        if (ListUtil.isNotEmpty(originList)) {
+            for (ScaleConfig originItem : originList) {
+                if (allMap.containsKey(originItem.getHisName())) {
+                    List<ScaleConfig> items = allMap.get(originItem.getHisName());
+                    boolean flag = false;
+                    for (ScaleConfig item : items) {
+                        if (uniqueNames.contains(item.getUniqueName())) {
+                            retList.add(item);
+                            flag = true;
+                        }
+                    }
+                    if (!flag) {
+                        retList.add(originItem);
+                    }
+                } else {
+                    retList.add(originItem);
+                }
+            }
+        }
+
+        retList = retList.stream()
+                .distinct()
+                .collect(Collectors.toList());
+        return retList;
+    }
+
+    /**
+     * 获取所有医院映射数据
+     *
+     * @return
+     */
+    public Map<String, List<ScaleConfig>> getAll(List<String> hisNameList) {
+        Map<String, List<ScaleConfig>> retMap = new HashMap<>();
+        QueryWrapper<ScaleConfig> queryWrapper = new QueryWrapper<>();
+        if (ListUtil.isNotEmpty(hisNameList)) {
+            queryWrapper.in("his_name", hisNameList);
+        }
+        List<ScaleConfig> records = scaleConfigService.list(queryWrapper);
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+        records.forEach(record -> {
+            record.setHospitalId(null);
+            record.setId(null);
+            record.setUniqueCode(StringUtils.isBlank(record.getUniqueCode()) ? "" : record.getUniqueCode());
+        });
+
+        records = records
+                .stream()
+                .filter(record -> record.getIsDeleted().equals(IsDeleteEnum.N.getKey()))
+                .distinct()
+                .collect(Collectors.toList());
+        if (ListUtil.isEmpty(records)) {
+            return retMap;
+        }
+
+        retMap = EntityUtil.makeEntityListMap(records, "hisName");
+
+        return retMap;
+    }
+
+    /**
+     * 查找指定医院映射关系
+     *
+     * @param hospitalId
+     * @return
+     */
+    public List<ScaleConfig> getListByHospitalId(Long hospitalId) {
+        QueryWrapper<ScaleConfig> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
+                .eq("hospital_id", hospitalId);
+        return scaleConfigService.list(queryWrapper);
+    }
+}

+ 37 - 0
cdssman-service/src/main/java/com/diagbot/mapper/ScaleConfigMapper.java

@@ -0,0 +1,37 @@
+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.ScaleConfig;
+import com.diagbot.vo.HosRelationNumPageVO;
+import com.diagbot.vo.ScaleConfigPageVO;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * <p>
+ * 量表映射表 Mapper 接口
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-04-13
+ */
+public interface ScaleConfigMapper extends BaseMapper<ScaleConfig> {
+
+    /**
+     * 分页查询
+     *
+     * @param scaleConfigPageVO
+     * @return
+     */
+    IPage<ScaleConfig> getPage(@Param("scaleConfigPageVO") ScaleConfigPageVO scaleConfigPageVO);
+
+    /**
+     * 各医院映射关系数列表
+     *
+     * @param hosRelationNumPageVO
+     * @return
+     */
+    IPage<HosRelationNumDTO> getRelationNumPage(@Param("hosRelationNumPageVO") HosRelationNumPageVO hosRelationNumPageVO);
+
+}

+ 35 - 0
cdssman-service/src/main/java/com/diagbot/service/ScaleConfigService.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.ScaleConfig;
+import com.diagbot.vo.HosRelationNumPageVO;
+import com.diagbot.vo.ScaleConfigPageVO;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * <p>
+ * 量表映射表 服务类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-04-13
+ */
+public interface ScaleConfigService extends IService<ScaleConfig> {
+    /**
+     * 分页查询
+     *
+     * @param scaleConfigPageVO
+     * @return
+     */
+    IPage<ScaleConfig> getPage(@Param("scaleConfigPageVO") ScaleConfigPageVO scaleConfigPageVO);
+
+    /**
+     * 各医院映射关系数列表
+     *
+     * @param hosRelationNumPageVO
+     * @return
+     */
+    IPage<HosRelationNumDTO> getRelationNumPage(@Param("hosRelationNumPageVO") HosRelationNumPageVO hosRelationNumPageVO);
+}

+ 45 - 0
cdssman-service/src/main/java/com/diagbot/service/impl/ScaleConfigServiceImpl.java

@@ -0,0 +1,45 @@
+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.ScaleConfig;
+import com.diagbot.mapper.ScaleConfigMapper;
+import com.diagbot.service.ScaleConfigService;
+import com.diagbot.vo.HosRelationNumPageVO;
+import com.diagbot.vo.ScaleConfigPageVO;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 量表映射表 服务实现类
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-04-13
+ */
+@Service
+public class ScaleConfigServiceImpl extends ServiceImpl<ScaleConfigMapper, ScaleConfig> implements ScaleConfigService {
+    /**
+     * 分页查询
+     *
+     * @param scaleConfigPageVO
+     * @return
+     */
+    @Override
+    public IPage<ScaleConfig> getPage(@Param("scaleConfigPageVO") ScaleConfigPageVO scaleConfigPageVO) {
+        return baseMapper.getPage(scaleConfigPageVO);
+    }
+
+    /**
+     * 各医院映射关系数列表
+     *
+     * @param hosRelationNumPageVO
+     * @return
+     */
+    @Override
+    public IPage<HosRelationNumDTO> getRelationNumPage(@Param("hosRelationNumPageVO") HosRelationNumPageVO hosRelationNumPageVO) {
+        return baseMapper.getRelationNumPage(hosRelationNumPageVO);
+    }
+}

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

@@ -0,0 +1,18 @@
+package com.diagbot.vo;
+
+import com.diagbot.entity.ScaleConfig;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.List;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/4/13 16:09
+ */
+@Getter
+@Setter
+public class ScaleConfigListVO {
+    private List<ScaleConfig> scaleConfigList;
+}

+ 37 - 0
cdssman-service/src/main/java/com/diagbot/vo/ScaleConfigPageVO.java

@@ -0,0 +1,37 @@
+package com.diagbot.vo;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.Getter;
+import lombok.Setter;
+
+import javax.validation.constraints.NotNull;
+
+/**
+ * @Description:
+ * @Author:zhaops
+ * @time: 2021/4/13 16:08
+ */
+@Getter
+@Setter
+public class ScaleConfigPageVO extends Page {
+    /**
+     * 医院id
+     */
+    @NotNull(message = "请输入医院id")
+    private Long hospitalId;
+
+    /**
+     * his大项名称
+     */
+    private String hisName;
+
+    /**
+     * 标准名
+     */
+    private String uniqueName;
+
+    /**
+     * 标准编码
+     */
+    private String uniqueCode;
+}

+ 4 - 4
cdssman-service/src/main/java/com/diagbot/web/ConceptInfoController.java

@@ -42,7 +42,7 @@ public class ConceptInfoController {
     private KlConceptStaticFacade klConceptStaticFacade;
 
     @ApiOperation(value = "医学术语检索-新增静态知识[zhaops]",
-            notes = "types: 类型(多选):0-全部、1-诊断、2-药品、3-检验、5-检查、6-手术和操作 <br>" +
+            notes = "types: 类型(多选):0-全部、1-诊断、2-药品、3-检验、5-检查、6-手术和操作、8-量表 <br>" +
                     "inputStr: 检索内容<br>")
     @PostMapping("/staticKnowledgeIndexWithoutInfo")
     @SysLogger("staticKnowledgeIndexWithoutInfo")
@@ -53,7 +53,7 @@ public class ConceptInfoController {
     }
 
     @ApiOperation(value = "获取静态知识列表[zhaops]",
-            notes = "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验明细、5-检查、6-手术和操作 <br>" +
+            notes = "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验明细、5-检查、6-手术和操作、8-量表 <br>" +
                     "name: 术语名称<br>" +
                     "status: 启用状态:1-启用、0-禁用<br>")
     @PostMapping("/getPage")
@@ -66,7 +66,7 @@ public class ConceptInfoController {
     @ApiOperation(value = "保存静态知识-新增或修改[zhaops]",
             notes = "id: id <br>" +
                     "name: 术语名称 <br>" +
-                    "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验明细、5-检查、6-手术和操作 <br>" +
+                    "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验明细、5-检查、6-手术和操作、8-量表 <br>" +
                     "clinicalPathwayName: 临床路径名称<br>" +
                     "noticeName: 注意事项名称<br>" +
                     "details: 明细<br>")
@@ -91,7 +91,7 @@ public class ConceptInfoController {
 
     @ApiOperation(value = "静态知识是否存在[zhaops]",
             notes = "name: 术语名称 <br>" +
-                    "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验明细、5-检查、6-手术和操作 <br>")
+                    "type: 类型:1-诊断、2-药品、3-检验套餐、4-检验明细、5-检查、6-手术和操作、8-量表 <br>")
     @PostMapping("/isExist")
     @SysLogger("isExist")
     public RespDTO<Boolean> isExist(@Valid @RequestBody KlConceptStaticVO klConceptStaticVO) {

+ 1 - 1
cdssman-service/src/main/java/com/diagbot/web/RetrievalController.java

@@ -28,7 +28,7 @@ public class RetrievalController {
     private RetrievalFacade retrievalFacade;
 
     @ApiOperation(value = "术语检索[zhaops]",
-            notes = "type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血 <br>" +
+            notes = "type: 类型:1-化验大项、2-化验小项、3-辅检、4-诊断、5-药品、6-手术和操作、7-科室、8-输血、10-量表 <br>" +
                     "inputStr: 检索内容<br>" +
                     "sex: 性别:1-男、2-女、3-通用 <br>" +
                     "age: 年龄<br>")

+ 220 - 0
cdssman-service/src/main/java/com/diagbot/web/ScaleConfigController.java

@@ -0,0 +1,220 @@
+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.ScaleConfig;
+import com.diagbot.facade.ScaleConfigFacade;
+import com.diagbot.vo.HosRelationNumPageVO;
+import com.diagbot.vo.HospitalIdVO;
+import com.diagbot.vo.IdListVO;
+import com.diagbot.vo.IdVO;
+import com.diagbot.vo.ScaleConfigListVO;
+import com.diagbot.vo.ScaleConfigPageVO;
+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;
+
+/**
+ * <p>
+ * 量表映射表 前端控制器
+ * </p>
+ *
+ * @author zhaops
+ * @since 2021-04-13
+ */
+@RestController
+@RequestMapping("/tran/scaleConfig")
+@Api(value = "量表公表映射API", tags = { "量表公表映射API" })
+@SuppressWarnings("unchecked")
+public class ScaleConfigController {
+    @Autowired
+    private ScaleConfigFacade scaleConfigFacade;
+
+    /**
+     * 映射关系是否已存在
+     *
+     * @param scaleConfig
+     * @return
+     */
+    @ApiOperation(value = "映射关系是否已存在[by:zhaops]", notes = "")
+    @PostMapping("/isExistRecord")
+    @SysLogger("isExistRecord")
+    public RespDTO<Boolean> isExistRecord(@RequestBody @Valid ScaleConfig scaleConfig) {
+        Boolean data = scaleConfigFacade.isExistRecord(scaleConfig);
+        return RespDTO.onSuc(data);
+    }
+
+    /**
+     * 保存或修改映射关系
+     *
+     * @param scaleConfig
+     * @return
+     */
+    @ApiOperation(value = "保存或修改映射关系[by:zhaops]", notes = "")
+    @PostMapping("/saveOrUpdateRecord")
+    @SysLogger("saveOrUpdateRecord")
+    @Transactional
+    public RespDTO<Boolean> saveOrUpdateRecord(@RequestBody @Valid ScaleConfig scaleConfig) {
+        Boolean data = scaleConfigFacade.saveOrUpdateRecord(scaleConfig);
+        return RespDTO.onSuc(data);
+    }
+
+    /**
+     * 批量保存或修改映射关系
+     *
+     * @param scaleConfigListVO
+     * @return
+     */
+    @ApiOperation(value = "批量保存或修改映射关系[by:zhaops]", notes = "")
+    @PostMapping("/saveOrUpdateRecords")
+    @SysLogger("saveOrUpdateRecords")
+    @Transactional
+    public RespDTO<Boolean> saveOrUpdateRecords(@RequestBody @Valid ScaleConfigListVO scaleConfigListVO) {
+        Boolean data = scaleConfigFacade.saveOrUpdateRecords(scaleConfigListVO);
+        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 = scaleConfigFacade.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 = scaleConfigFacade.deleteRecords(idListVO);
+        return RespDTO.onSuc(data);
+    }
+
+    /**
+     * 分页查询
+     *
+     * @param scaleConfigPageVO
+     * @return
+     */
+    @ApiOperation(value = "分页查询[by:zhaops]", notes = "")
+    @PostMapping("/getPage")
+    @SysLogger("getPage")
+    public RespDTO<ScaleConfig> getPage(@RequestBody @Valid ScaleConfigPageVO scaleConfigPageVO) {
+        IPage<ScaleConfig> data = scaleConfigFacade.getPage(scaleConfigPageVO);
+        return RespDTO.onSuc(data);
+    }
+
+    /**
+     * 数据导入
+     *
+     * @param file
+     * @param hospitalId
+     * @return
+     */
+    @ApiOperation(value = "数据导入[by:zhaops]",
+            notes = "")
+    @PostMapping("/importExcel")
+    @SysLogger("importExcel")
+    @Transactional
+    public void importExcel(@RequestParam("file") MultipartFile file, @RequestParam("hospitalId") Long hospitalId) {
+        HospitalIdVO hospitalIdVO = new HospitalIdVO();
+        hospitalIdVO.setHospitalId(hospitalId);
+        scaleConfigFacade.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) {
+        scaleConfigFacade.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 = scaleConfigFacade.getRelationNumPage(hosRelationNumPageVO);
+        return RespDTO.onSuc(data);
+    }
+
+    /**
+     * 数据导入模板导出
+     *
+     * @return
+     */
+    @ApiOperation(value = "数据导入模板导出[by:zhaops]",
+            notes = "")
+    @PostMapping("/exportExcelModule")
+    @SysLogger("exportExcelModule")
+    public void exportExcelModule(HttpServletResponse response) {
+        scaleConfigFacade.exportExcelModule(response);
+    }
+
+    /**
+     * 导入数据预匹配
+     *
+     * @return
+     */
+    @ApiOperation(value = "导入数据预匹配[by:zhaops]",
+            notes = "")
+    @PostMapping("/precDataMatch")
+    @SysLogger("precDataMatch")
+    public void precDataMatch(@RequestParam("file") MultipartFile file, HttpServletResponse response) {
+        scaleConfigFacade.precDataMatch(file, response);
+    }
+
+    /**
+     * 导入数据预匹配
+     *
+     * @return
+     */
+    @ApiOperation(value = "导入数据验证[by:zhaops]",
+            notes = "")
+    @PostMapping("/dataVerify")
+    @SysLogger("dataVerify")
+    public RespDTO<Boolean> dataVerify(@RequestParam("file") MultipartFile file) {
+        Boolean data = scaleConfigFacade.dataVerify(file);
+        return RespDTO.onSuc(data);
+    }
+}

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

@@ -58,7 +58,8 @@
         e.num AS pacsNum,
         f.num AS diseaseNum,
         g.num AS operationNum,
-        h.num AS transfusionNum
+        h.num AS transfusionNum,
+        i.num AS scaleNum
         FROM
         tran_hospital_info a
         LEFT JOIN ( SELECT hospital_id, count(*) AS num FROM tran_lis_config WHERE is_deleted = 'N' GROUP BY hospital_id ) b ON a.id = b.hospital_id
@@ -68,6 +69,7 @@
         LEFT JOIN ( SELECT hospital_id, count(*) AS num FROM tran_disease_config WHERE is_deleted = 'N' GROUP BY hospital_id ) f ON a.id = f.hospital_id
         LEFT JOIN ( SELECT hospital_id, count(*) AS num FROM tran_operation_config WHERE is_deleted = 'N' GROUP BY hospital_id ) g ON a.id = g.hospital_id
         LEFT JOIN ( SELECT hospital_id, count(*) AS num FROM tran_transfusion_config WHERE is_deleted = 'N' GROUP BY hospital_id ) h ON a.id = h.hospital_id
+        LEFT JOIN ( SELECT hospital_id, count(*) AS num FROM tran_scale_config WHERE is_deleted = 'N' GROUP BY hospital_id ) i ON a.id = i.hospital_id
         WHERE
         a.is_deleted = 'N'
         <if test="hospitalInfoPageVO.name!=null and hospitalInfoPageVO.name!=''">

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

@@ -17,7 +17,7 @@
     </resultMap>
 
     <!-- 分页查询 -->
-    <select id="getPage" resultType="com.diagbot.entity.PacsConfig">
+    <select id="getPage" resultType="com.diagbot.entity.OperationConfig">
         select a.*
         from tran_operation_config a
         where a.is_deleted='N'

+ 55 - 0
cdssman-service/src/main/resources/mapper/ScaleConfigMapper.xml

@@ -0,0 +1,55 @@
+<?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.ScaleConfigMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.ScaleConfig">
+        <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.ScaleConfig">
+        select a.*
+        from tran_scale_config a
+        where a.is_deleted='N'
+        <if test="scaleConfigPageVO.hospitalId!=null">
+            and a.hospital_id=#{scaleConfigPageVO.hospitalId}
+        </if>
+        <if test="scaleConfigPageVO.hisName!=null and scaleConfigPageVO.hisName!=''">
+            and a.his_name like concat("%",#{scaleConfigPageVO.hisName},"%")
+        </if>
+        <if test="scaleConfigPageVO.uniqueName!=null and scaleConfigPageVO.uniqueName!=''">
+            and a.unique_name like concat("%",#{scaleConfigPageVO.uniqueName},"%")
+        </if>
+        <if test="scaleConfigPageVO.uniqueCode!=null and scaleConfigPageVO.uniqueCode!=''">
+            and a.unique_code like concat("%",#{scaleConfigPageVO.uniqueCode},"%")
+        </if>
+        order by a.gmt_modified desc
+    </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_scale_config b ON a.id = b.hospital_id
+        AND b.is_deleted = 'N'
+        WHERE
+        a.is_deleted = 'N'
+        GROUP BY
+        a.id
+    </select>
+
+</mapper>