瀏覽代碼

慢病管理与评估维护和慢病指标值关联维护代码初步移动到标准知识库管理

gaodm 6 年之前
父節點
當前提交
9b8622b833

+ 13 - 8
knowledgeman-service/src/main/java/com/diagbot/facade/EvaluationFacade.java

@@ -27,6 +27,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -103,13 +104,15 @@ public class EvaluationFacade extends EvaluationServiceImpl {
             res = cancelEvaluationModuleAll(evaluationModuleDiseaseIdVO);
             List<Evaluation> evaluationModuleLsit = new ArrayList<Evaluation>();
             List<EvaluationVO> data = evaluationModuleListVO.getEvaluationModuleData();
+            Date optDate = DateUtil.now();
+            String operator = UserUtils.getCurrentPrincipleID();
             for (EvaluationVO dataNew : data) {
                 Evaluation evaMou = new Evaluation();
                 BeanUtil.copyProperties(dataNew, evaMou);
-                evaMou.setGmtCreate(DateUtil.now());
-                evaMou.setGmtModified(DateUtil.now());
-                evaMou.setCreator(UserUtils.getCurrentPrincipleID());
-                evaMou.setModifier(UserUtils.getCurrentPrincipleID());
+                evaMou.setGmtCreate(optDate);
+                evaMou.setGmtModified(optDate);
+                evaMou.setCreator(operator);
+                evaMou.setModifier(operator);
                 evaMou.setOrderNo(dataNew.getOrderNo());
                 evaluationModuleLsit.add(evaMou);
             }
@@ -142,13 +145,15 @@ public class EvaluationFacade extends EvaluationServiceImpl {
             }
             List<Evaluation> evaluationModuleLsit = new ArrayList<Evaluation>();
             List<EvaluationVO> data = evaluationModuleListVO.getEvaluationModuleData();
+            Date optDate = DateUtil.now();
+            String operator = UserUtils.getCurrentPrincipleID();
             for (EvaluationVO dataNew : data) {
                 Evaluation evaMou = new Evaluation();
                 BeanUtil.copyProperties(dataNew, evaMou);
-                evaMou.setGmtCreate(DateUtil.now());
-                evaMou.setGmtModified(DateUtil.now());
-                evaMou.setCreator(UserUtils.getCurrentPrincipleID());
-                evaMou.setModifier(UserUtils.getCurrentPrincipleID());
+                evaMou.setGmtCreate(optDate);
+                evaMou.setGmtModified(optDate);
+                evaMou.setCreator(operator);
+                evaMou.setModifier(operator);
                 evaluationModuleLsit.add(evaMou);
             }
             res = evaluationModuleMappingService.saveBatch(evaluationModuleLsit);

+ 133 - 136
knowledgeman-service/src/main/java/com/diagbot/facade/IndexConfigFacade.java

@@ -4,7 +4,6 @@ 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.UserServiceClient;
-import com.diagbot.dto.DiseaseInfoDTO;
 import com.diagbot.dto.IndexConfigAllDTO;
 import com.diagbot.dto.IndexConfigDTO;
 import com.diagbot.dto.RespDTO;
@@ -19,7 +18,6 @@ import com.diagbot.util.DateUtil;
 import com.diagbot.util.ListUtil;
 import com.diagbot.util.RespDTOUtil;
 import com.diagbot.util.UserUtils;
-import com.diagbot.vo.DiseaseNameVO;
 import com.diagbot.vo.IndexConfigDiseaseIdVO;
 import com.diagbot.vo.IndexConfigDiseaseNameVO;
 import com.diagbot.vo.IndexConfigListVO;
@@ -29,6 +27,7 @@ import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.stereotype.Component;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -42,140 +41,138 @@ import java.util.stream.Collectors;
 @Component
 public class IndexConfigFacade extends IndexConfigServiceImpl {
 
-	@Autowired
-	@Qualifier("indexConfigServiceImpl")
-	IndexConfigService indexConfigService;
-	@Autowired
-	UserServiceClient userServiceClient;
-	/**
-	 *
-	 * @param indexConfigDiseaseNameVO
-	 * @return
-	 */
-	public IPage<IndexConfigDTO> queryIndexConfigPage(IndexConfigDiseaseNameVO indexConfigDiseaseNameVO) {
-		IPage<IndexConfigDTO> datas = this.queryIndexConfigPageAlls(indexConfigDiseaseNameVO);
-		List<IndexConfigDTO> data = datas.getRecords();
-		List<String> modifierid
-				= data.stream().map(ac -> ac.getModifier()).collect(Collectors.toList());
-		Map<String, String> userNames = new HashMap<>();
-		if (ListUtil.isNotEmpty(modifierid)) {
-			RespDTO<Map<String, String>> userNamesDTO = userServiceClient.getUserInfoByIds(modifierid);
-			if (RespDTOUtil.respIsNG(userNamesDTO)) {
-				throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "获取所有用户信息失败");
-			}
-			userNames = userNamesDTO.data;
-		}
-
-		for (IndexConfigDTO evalua : data) {
-			evalua.setModifier(userNames.get(evalua.getModifier()));
-		}
-		return datas;
-	}
-	/**
-	 * 
-	 * @param indexConfigDiseaseIdVO
-	 * @return
-	 */
-	public List<IndexConfigAllDTO> getIndexConfigLists(IndexConfigDiseaseIdVO indexConfigDiseaseIdVO) {
-		QueryWrapper<IndexConfig> IndexConfigQuery = new QueryWrapper<IndexConfig>();
-		IndexConfigQuery.eq("disease_id",indexConfigDiseaseIdVO.getDiseaseId()).eq("is_deleted", IsDeleteEnum.N.getKey());
-		List<IndexConfig> datas = list(IndexConfigQuery);
+    @Autowired
+    @Qualifier("indexConfigServiceImpl")
+    IndexConfigService indexConfigService;
+    @Autowired
+    UserServiceClient userServiceClient;
+
+    /**
+     * @param indexConfigDiseaseNameVO
+     * @return
+     */
+    public IPage<IndexConfigDTO> queryIndexConfigPage(IndexConfigDiseaseNameVO indexConfigDiseaseNameVO) {
+        IPage<IndexConfigDTO> datas = this.queryIndexConfigPageAlls(indexConfigDiseaseNameVO);
+        List<IndexConfigDTO> data = datas.getRecords();
+        List<String> modifierid
+                = data.stream().map(ac -> ac.getModifier()).collect(Collectors.toList());
+        Map<String, String> userNames = new HashMap<>();
+        if (ListUtil.isNotEmpty(modifierid)) {
+            RespDTO<Map<String, String>> userNamesDTO = userServiceClient.getUserInfoByIds(modifierid);
+            if (RespDTOUtil.respIsNG(userNamesDTO)) {
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "获取所有用户信息失败");
+            }
+            userNames = userNamesDTO.data;
+        }
+
+        for (IndexConfigDTO evalua : data) {
+            evalua.setModifier(userNames.get(evalua.getModifier()));
+        }
+        return datas;
+    }
+
+    /**
+     * @param indexConfigDiseaseIdVO
+     * @return
+     */
+    public List<IndexConfigAllDTO> getIndexConfigLists(IndexConfigDiseaseIdVO indexConfigDiseaseIdVO) {
+        QueryWrapper<IndexConfig> IndexConfigQuery = new QueryWrapper<IndexConfig>();
+        IndexConfigQuery.eq("disease_id", indexConfigDiseaseIdVO.getDiseaseId())
+                .eq("is_deleted", IsDeleteEnum.N.getKey());
+        List<IndexConfig> datas = list(IndexConfigQuery);
         //过滤
         List<IndexConfigAllDTO> data = BeanUtil.listCopyTo(datas, IndexConfigAllDTO.class);
-		return data;
-	}
-	/**
-	 * 
-	 * @param indexConfigListVO
-	 * @return
-	 */
-	public boolean updateIndexConfigList(IndexConfigListVO indexConfigListVO) {
-		boolean res = false;
-		if (indexConfigListVO != null && ListUtil.isNotEmpty(indexConfigListVO.getIndexConfigData())) {
-			IndexConfigDiseaseIdVO indexConfigDiseaseIdVO = new IndexConfigDiseaseIdVO();
-			indexConfigDiseaseIdVO.setDiseaseId(indexConfigListVO.getDiseaseId());
-			res = cancelIndexConfigAlls(indexConfigDiseaseIdVO);
-			List<IndexConfig> IndexConfigLsit = new ArrayList<IndexConfig>();
-			List<IndexConfigVO> data = indexConfigListVO.getIndexConfigData();
-			for (IndexConfigVO dataNew : data) {
-				IndexConfig IndexConfig = new IndexConfig();
-				BeanUtil.copyProperties(dataNew,IndexConfig);
-				IndexConfig.setGmtCreate(DateUtil.now());
-				IndexConfig.setGmtModified(DateUtil.now());
-				IndexConfig.setCreator(UserUtils.getCurrentPrincipleID());
-				IndexConfig.setModifier(UserUtils.getCurrentPrincipleID());
-				IndexConfigLsit.add(IndexConfig);
-			}
-
-			res = indexConfigService.saveBatch(IndexConfigLsit);
-
-		}
-
-		return res;
-	}
-	
-	/**
-	 * 
-	 * @param indexConfigListVO
-	 * @return
-	 */
-	public boolean saveIndexConfigList(IndexConfigListVO indexConfigListVO) {
-		boolean res = false;
-		if (indexConfigListVO != null
-				&& ListUtil.isNotEmpty(indexConfigListVO.getIndexConfigData())) {
-			List<IndexConfigVO> indexConfigData = indexConfigListVO.getIndexConfigData();
-			List<String> indexUnique = new ArrayList<>();
-			for (IndexConfigVO e : indexConfigData) {
-				indexUnique.add(e.getIndexUnique());
-			}
-
-			QueryWrapper<IndexConfig> IndexConfigQuery = new QueryWrapper<>();
-
-			IndexConfigQuery.eq("disease_id",indexConfigListVO.getDiseaseId())
-					.eq("is_deleted",IsDeleteEnum.N.getKey())
-					.in("index_unique", indexUnique);
-			List<IndexConfig> dataUnique = list(IndexConfigQuery);
-			if (ListUtil.isNotEmpty(dataUnique)) {
-				throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
-						"该'" + dataUnique.get(0).getConceptId() + "'已存在");
-			}
-
-			List<IndexConfig> IndexConfigLsit = new ArrayList<IndexConfig>();
-			List<IndexConfigVO> data = indexConfigListVO.getIndexConfigData();
-			for (IndexConfigVO dataNew : data) {
-				IndexConfig IndexConfig = new IndexConfig();
-				BeanUtil.copyProperties(dataNew,IndexConfig);
-				IndexConfig.setGmtCreate(DateUtil.now());
-				IndexConfig.setGmtModified(DateUtil.now());
-				IndexConfig.setCreator(UserUtils.getCurrentPrincipleID());
-				IndexConfig.setModifier(UserUtils.getCurrentPrincipleID());
-				IndexConfigLsit.add(IndexConfig);
-			}
-			res = indexConfigService.saveBatch(IndexConfigLsit);
-		}
-
-		return res;
-	}
-	
-	/**
-	 * 
-	 * @param indexConfigDiseaseIdVO
-	 * @return
-	 */
-	public boolean cancelIndexConfigAlls(IndexConfigDiseaseIdVO indexConfigDiseaseIdVO) {
-		
-		UpdateWrapper<IndexConfig> IndexConfigNew =new UpdateWrapper<>();
-		IndexConfigNew.eq("disease_id",indexConfigDiseaseIdVO.getDiseaseId()).eq("is_deleted", IsDeleteEnum.N.getKey())
-		.set("is_deleted", IsDeleteEnum.Y.getKey()).set("modifier", UserUtils.getCurrentPrincipleID())
-	    .set("gmt_modified", DateUtil.now());
-		return update(new IndexConfig(), IndexConfigNew);
-	}
-	/**
-	 * 
-	 * @param diseaseNameVO
-	 * @return
-	 */
-	public List<DiseaseInfoDTO> queryIndexConfigDiseaseName(DiseaseNameVO diseaseNameVO) {
-		return indexConfigService.queryIndexConfigDiseaseName(diseaseNameVO);
-	}
+        return data;
+    }
+
+    /**
+     * @param indexConfigListVO
+     * @return
+     */
+    public boolean updateIndexConfigList(IndexConfigListVO indexConfigListVO) {
+        boolean res = false;
+        if (indexConfigListVO != null && ListUtil.isNotEmpty(indexConfigListVO.getIndexConfigData())) {
+            IndexConfigDiseaseIdVO indexConfigDiseaseIdVO = new IndexConfigDiseaseIdVO();
+            indexConfigDiseaseIdVO.setDiseaseId(indexConfigListVO.getDiseaseId());
+            res = cancelIndexConfigAlls(indexConfigDiseaseIdVO);
+            List<IndexConfig> IndexConfigLsit = new ArrayList<IndexConfig>();
+            List<IndexConfigVO> data = indexConfigListVO.getIndexConfigData();
+            Date optDate = DateUtil.now();
+            String operator = UserUtils.getCurrentPrincipleID();
+            for (IndexConfigVO dataNew : data) {
+                IndexConfig IndexConfig = new IndexConfig();
+                BeanUtil.copyProperties(dataNew, IndexConfig);
+                IndexConfig.setGmtCreate(optDate);
+                IndexConfig.setGmtModified(optDate);
+                IndexConfig.setCreator(operator);
+                IndexConfig.setModifier(operator);
+                IndexConfigLsit.add(IndexConfig);
+            }
+
+            res = indexConfigService.saveBatch(IndexConfigLsit);
+
+        }
+
+        return res;
+    }
+
+    /**
+     * @param indexConfigListVO
+     * @return
+     */
+    public boolean saveIndexConfigList(IndexConfigListVO indexConfigListVO) {
+        boolean res = false;
+        if (indexConfigListVO != null
+                && ListUtil.isNotEmpty(indexConfigListVO.getIndexConfigData())) {
+            List<IndexConfigVO> indexConfigData = indexConfigListVO.getIndexConfigData();
+            List<String> indexUnique = new ArrayList<>();
+            for (IndexConfigVO e : indexConfigData) {
+                indexUnique.add(e.getIndexUnique());
+            }
+
+            QueryWrapper<IndexConfig> IndexConfigQuery = new QueryWrapper<>();
+
+            IndexConfigQuery.eq("disease_id", indexConfigListVO.getDiseaseId())
+                    .eq("is_deleted", IsDeleteEnum.N.getKey())
+                    .in("index_unique", indexUnique);
+            List<IndexConfig> dataUnique = list(IndexConfigQuery);
+            if (ListUtil.isNotEmpty(dataUnique)) {
+                throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
+                        "该'" + dataUnique.get(0).getConceptId() + "'已存在");
+            }
+
+            List<IndexConfig> IndexConfigLsit = new ArrayList<IndexConfig>();
+            List<IndexConfigVO> data = indexConfigListVO.getIndexConfigData();
+            Date optDate = DateUtil.now();
+            String operator = UserUtils.getCurrentPrincipleID();
+            for (IndexConfigVO dataNew : data) {
+                IndexConfig IndexConfig = new IndexConfig();
+                BeanUtil.copyProperties(dataNew, IndexConfig);
+                IndexConfig.setGmtCreate(optDate);
+                IndexConfig.setGmtModified(optDate);
+                IndexConfig.setCreator(operator);
+                IndexConfig.setModifier(operator);
+                IndexConfigLsit.add(IndexConfig);
+            }
+            res = indexConfigService.saveBatch(IndexConfigLsit);
+        }
+
+        return res;
+    }
+
+    /**
+     * @param indexConfigDiseaseIdVO
+     * @return
+     */
+    public boolean cancelIndexConfigAlls(IndexConfigDiseaseIdVO indexConfigDiseaseIdVO) {
+
+        UpdateWrapper<IndexConfig> IndexConfigNew = new UpdateWrapper<>();
+        IndexConfigNew.eq("disease_id", indexConfigDiseaseIdVO.getDiseaseId())
+                .eq("is_deleted", IsDeleteEnum.N.getKey())
+                .set("is_deleted", IsDeleteEnum.Y.getKey())
+                .set("modifier", UserUtils.getCurrentPrincipleID())
+                .set("gmt_modified", DateUtil.now());
+        return update(new IndexConfig(), IndexConfigNew);
+    }
+
 }

+ 59 - 71
knowledgeman-service/src/main/java/com/diagbot/web/IndexConfigController.java

@@ -31,78 +31,66 @@ import java.util.List;
  */
 @RestController
 @RequestMapping("/indexConfig")
-@Api(value = "慢病指标值关联维护API[by:wangfeng]", tags = { "WF-2期-慢病指标值关联维护API" })
+@Api(value = "慢病指标值关联维护API[by:wangfeng]", tags = { "知识库标准化-慢病指标值关联维护API" })
 @SuppressWarnings("unchecked")
 public class IndexConfigController {
 
-	@Autowired
-	IndexConfigFacade indexConfigFacade;
-
-	@ApiOperation(value = "分页模糊查询慢病指标值关联维护[by:wangfeng]", notes = "diseaseName:慢病名字")
-	@PostMapping("/queryIndexConfigPages")
-	@SysLogger("queryIndexConfigPages")
-	@Transactional
-	public RespDTO<IPage<IndexConfigDTO>> queryIndexConfigPages(
-			@RequestBody IndexConfigDiseaseNameVO indexConfigDiseaseNameVO) {
-
-		IPage<IndexConfigDTO> data = indexConfigFacade.queryIndexConfigPage(indexConfigDiseaseNameVO);
-
-		return RespDTO.onSuc(data);
-	}
-
-	@ApiOperation(value = "获取慢病指标值关联维护[by:wangfeng]", notes = "diseaseId : 慢病id")
-	@PostMapping("/getIndexConfigLists")
-	@SysLogger("getIndexConfigLists")
-	@Transactional
-	public RespDTO<List<IndexConfigAllDTO>> getIndexConfigLists(
-			@RequestBody IndexConfigDiseaseIdVO indexConfigDiseaseIdVO) {
-
-		List<IndexConfigAllDTO> data = indexConfigFacade.getIndexConfigLists(indexConfigDiseaseIdVO);
-
-		return RespDTO.onSuc(data);
-	}
-
-	@ApiOperation(value = "慢病指标值关联维护——修改关联[by:wangfeng]", notes = "指标公表名+indexUnique; 疾病id+diseaseId;指标描述+indexDesc; 显示顺序+ orderNo; 备注+remark;")
-	@PostMapping("/updateIndexConfigList")
-	@SysLogger("updateIndexConfigList")
-	@Transactional
-	public RespDTO<Boolean> updateIndexConfigList(@RequestBody IndexConfigListVO indexConfigListVO) {
-
-		boolean res = indexConfigFacade.updateIndexConfigList(indexConfigListVO);
-
-		return RespDTO.onSuc(res);
-	}
-
-	@ApiOperation(value = "慢病指标值关联维护——添加关联[by:wangfeng]", notes = "指标公表名+indexUnique; 疾病id+diseaseId;指标描述+indexDesc; 显示顺序+ orderNo; 备注+remark;")
-	@PostMapping("/saveIndexConfigLists")
-	@SysLogger("saveIndexConfigLists")
-	@Transactional
-	public RespDTO<Boolean> saveIndexConfigLists(@RequestBody IndexConfigListVO indexConfigListVO) {
-
-		boolean res = indexConfigFacade.saveIndexConfigList(indexConfigListVO);
-
-		return RespDTO.onSuc(res);
-	}
-
-	@ApiOperation(value = "删除慢病指标值关联维护[by:wangfeng]", notes = "请输入疾病  id :diseaseId;")
-	@PostMapping("/cancelIndexConfigAlls")
-	@SysLogger("cancelIndexConfigAlls")
-	@Transactional
-	public RespDTO<Boolean> cancelIndexConfigAlls(@RequestBody IndexConfigDiseaseIdVO indexConfigDiseaseIdVO) {
-
-		boolean res = indexConfigFacade.cancelIndexConfigAlls(indexConfigDiseaseIdVO);
-
-		return RespDTO.onSuc(res);
-	}
-	
-	@ApiOperation(value = "慢病指标疾病标签查询[by:wangfeng]", notes = "请输 :diseaseId;")
-	@PostMapping("/queryIndexConfigDiseaseNames")
-	@SysLogger("queryIndexConfigDiseaseNames")
-	@Transactional
-	public RespDTO<List<DiseaseInfoDTO>> queryIndexConfigDiseaseNames(@RequestBody DiseaseNameVO diseaseNameVO) {
-
-		List<DiseaseInfoDTO> data = indexConfigFacade.queryIndexConfigDiseaseName(diseaseNameVO);
-
-		return RespDTO.onSuc(data);
-	}
+    @Autowired
+    IndexConfigFacade indexConfigFacade;
+
+    @ApiOperation(value = "知识库标准化-分页模糊查询慢病指标值关联维护[by:wangfeng]", notes = "diseaseName:慢病名字")
+    @PostMapping("/queryIndexConfigPages")
+    @SysLogger("queryIndexConfigPages")
+    @Transactional
+    public RespDTO<IPage<IndexConfigDTO>> queryIndexConfigPages(
+            @RequestBody IndexConfigDiseaseNameVO indexConfigDiseaseNameVO) {
+        IPage<IndexConfigDTO> data = indexConfigFacade.queryIndexConfigPage(indexConfigDiseaseNameVO);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "知识库标准化-获取慢病指标值关联维护[by:wangfeng]", notes = "diseaseId : 慢病id")
+    @PostMapping("/getIndexConfigLists")
+    @SysLogger("getIndexConfigLists")
+    @Transactional
+    public RespDTO<List<IndexConfigAllDTO>> getIndexConfigLists(
+            @RequestBody IndexConfigDiseaseIdVO indexConfigDiseaseIdVO) {
+        List<IndexConfigAllDTO> data = indexConfigFacade.getIndexConfigLists(indexConfigDiseaseIdVO);
+        return RespDTO.onSuc(data);
+    }
+
+    @ApiOperation(value = "知识库标准化-慢病指标值关联维护——修改关联[by:wangfeng]", notes = "指标公表名+indexUnique; 疾病id+diseaseId;指标描述+indexDesc; 显示顺序+ orderNo; 备注+remark;")
+    @PostMapping("/updateIndexConfigList")
+    @SysLogger("updateIndexConfigList")
+    @Transactional
+    public RespDTO<Boolean> updateIndexConfigList(@RequestBody IndexConfigListVO indexConfigListVO) {
+        boolean res = indexConfigFacade.updateIndexConfigList(indexConfigListVO);
+        return RespDTO.onSuc(res);
+    }
+
+    @ApiOperation(value = "知识库标准化-慢病指标值关联维护——添加关联[by:wangfeng]", notes = "指标公表名+indexUnique; 疾病id+diseaseId;指标描述+indexDesc; 显示顺序+ orderNo; 备注+remark;")
+    @PostMapping("/saveIndexConfigLists")
+    @SysLogger("saveIndexConfigLists")
+    @Transactional
+    public RespDTO<Boolean> saveIndexConfigLists(@RequestBody IndexConfigListVO indexConfigListVO) {
+        boolean res = indexConfigFacade.saveIndexConfigList(indexConfigListVO);
+        return RespDTO.onSuc(res);
+    }
+
+    @ApiOperation(value = "知识库标准化-删除慢病指标值关联维护[by:wangfeng]", notes = "请输入疾病  id :diseaseId;")
+    @PostMapping("/cancelIndexConfigAlls")
+    @SysLogger("cancelIndexConfigAlls")
+    @Transactional
+    public RespDTO<Boolean> cancelIndexConfigAlls(@RequestBody IndexConfigDiseaseIdVO indexConfigDiseaseIdVO) {
+        boolean res = indexConfigFacade.cancelIndexConfigAlls(indexConfigDiseaseIdVO);
+        return RespDTO.onSuc(res);
+    }
+
+    @ApiOperation(value = "知识库标准化-慢病指标疾病标签查询[by:wangfeng]", notes = "请输 :diseaseId;")
+    @PostMapping("/queryIndexConfigDiseaseNames")
+    @SysLogger("queryIndexConfigDiseaseNames")
+    @Transactional
+    public RespDTO<List<DiseaseInfoDTO>> queryIndexConfigDiseaseNames(@RequestBody DiseaseNameVO diseaseNameVO) {
+        List<DiseaseInfoDTO> data = indexConfigFacade.queryIndexConfigDiseaseName(diseaseNameVO);
+        return RespDTO.onSuc(data);
+    }
 }

+ 2 - 3
knowledgeman-service/src/main/resources/mapper/EvaluationMapper.xml

@@ -18,8 +18,7 @@
     </resultMap>
 
 <select id="queryEvaluationModulePageAll" resultType="com.diagbot.dto.EvaluationModuleMappingDTO">
-	SELECT
-	a.id as id ,
+	SELECT DISTINCT
 	a.gmt_create as gmtCreate,
 	a.gmt_modified as gmtModified,
 	a.creator as creator,
@@ -41,7 +40,7 @@
 	ORDER BY a.gmt_create DESC
 </select>
 <select id="queryEvaluationDiseaseName" resultType="com.diagbot.dto.DiseaseInfoDTO">
-	SELECT
+	SELECT DISTINCT
 	a.diseaseId AS diseaseId,
 	a.diseaseName AS diseaseName
 	FROM

+ 35 - 24
knowledgeman-service/src/main/resources/mapper/IndexConfigMapper.xml

@@ -17,42 +17,53 @@
         <result column="remark" property="remark" />
     </resultMap>
 <select id="queryIndexConfigPageAlls" resultType="com.diagbot.dto.IndexConfigDTO">
-	SELECT
-	a.id as id,
+	SELECT DISTINCT
 	a.gmt_create as gmtCreate,
 	a.gmt_modified as gmtModified,
 	a.creator as creator,
 	a.modifier as modifier,
-	a.disease_id as diseaseId ,
-	b.tag_name as diseaseName
-	FROM
-	icss_index_config a
-	JOIN icss_question_info b
-	WHERE a.disease_id = b.id
-	AND a.is_deleted = "N"
-	AND b.is_deleted = "N"
-	<if test="indexConfigVO.diseaseName != null and indexConfigVO.diseaseName != ''">
-	AND b.tag_name LIKE CONCAT('%', #{indexConfigVO.diseaseName}, '%')
+	a.disease_id as diseaseId,
+	b.lib_name as diseaseName
+	FROM kl_index_config a
+	JOIN kl_concept b
+	WHERE a.is_deleted = 'N'
+	and b.is_deleted = 'N'
+	and a.disease_id = b.id
+	<if test="indexConfigVO.diseaseName != null">
+		AND b.lib_name LIKE CONCAT('%', #{indexConfigVO.diseaseName}, '%')
 	</if>
-	GROUP BY a.disease_id
+	GROUP BY a.concept_id
 	ORDER BY a.gmt_create DESC
 </select>
 <select id="queryIndexConfigDiseaseName" resultType="com.diagbot.dto.DiseaseInfoDTO">
 	SELECT DISTINCT
-	a.dis_id AS diseaseId,
-	b.tag_name AS diseaseName
+	a.diseaseId AS diseaseId,
+	a.diseaseName AS diseaseName
+	FROM
+	(SELECT
+	t1.id AS diseaseId,
+	t1.lib_name AS diseaseName
 	FROM
-	icss_dis_type a
-	JOIN icss_question_info b
-	ON a.dis_id = b.id
-	LEFT JOIN icss_index_config f ON a.dis_id = f.disease_id and f.is_deleted = 'N'
-	WHERE a.type = 1
-	AND f.disease_id is null
-	AND a.is_deleted = "N"
+	`kl_concept` t1,
+	`kl_relation` t2,
+	`kl_concept` t3
+	WHERE
+	t1.is_deleted = 'N'
+	AND t2.is_deleted = 'N'
+	AND t3.is_deleted = 'N'
+	AND t1.id = t2.start_id
+	AND t3.id = t2.end_id
+	AND t1.lib_type = 18
+	AND t2.relation_id = 3
+	AND t3.lib_type = 51
+	AND t3.lib_name = "慢病") a
+	LEFT JOIN kl_index_config b
+	ON a.diseaseId = b.disease_id
 	AND b.is_deleted = "N"
+	WHERE b.disease_id IS NULL
 	<if test="diseaseNameVO.diseaseName != null and diseaseNameVO.diseaseName != ''">
-	AND b.tag_name LIKE CONCAT('%', #{diseaseNameVO.diseaseName}, '%')
+		AND a.diseaseName LIKE CONCAT('%', #{diseaseNameVO.diseaseName}, '%')
 	</if>
-	ORDER BY b.tag_name DESC
+	ORDER BY a.diseaseName DESC
 </select>
 </mapper>