|
@@ -13,14 +13,10 @@ import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.entity.CommonParam;
|
|
|
import com.diagbot.entity.DeptInfo;
|
|
|
import com.diagbot.entity.DeptVital;
|
|
|
-import com.diagbot.entity.DisScale;
|
|
|
import com.diagbot.entity.DisType;
|
|
|
-import com.diagbot.entity.ModuleDetail;
|
|
|
-import com.diagbot.entity.ModuleInfo;
|
|
|
import com.diagbot.entity.QuestionDetail;
|
|
|
import com.diagbot.entity.QuestionInfo;
|
|
|
import com.diagbot.entity.QuestionMapping;
|
|
|
-import com.diagbot.entity.RetrievalMapping;
|
|
|
import com.diagbot.entity.wrapper.QuestionInfoWrapper;
|
|
|
import com.diagbot.entity.wrapper.QuestionMappingWrapper;
|
|
|
import com.diagbot.entity.wrapper.QuestionWrapper;
|
|
@@ -39,8 +35,10 @@ import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.EntityUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
+import com.diagbot.util.RespDTOUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
+import com.diagbot.vo.ConceptExistVO;
|
|
|
import com.diagbot.vo.DeleteQuestionVO;
|
|
|
import com.diagbot.vo.GetQuestionIdsByTypeVO;
|
|
|
import com.diagbot.vo.GetQuestionInfoVO;
|
|
@@ -135,11 +133,6 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
|
|
|
default:
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "请选择标签显示类型");
|
|
|
}
|
|
|
-
|
|
|
- //保存诊断类型
|
|
|
- if (questionSaveVO.getDisTypeVO() != null) {
|
|
|
- saveDisType(param, questionSaveVO.getDisTypeVO().getType());
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
|
|
@@ -158,33 +151,6 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 保存诊断类型
|
|
|
- *
|
|
|
- * @param param
|
|
|
- * @param disType
|
|
|
- */
|
|
|
- public void saveDisType(CommonParam param, Integer disType) {
|
|
|
- if (param.getQuestionInfo().getType() == QuestionTypeEnum.Disease.getKey()) {
|
|
|
- DisType bean = disTypeFacade.getOne(new QueryWrapper<DisType>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("dis_id", param.getQuestionInfo().getId()));
|
|
|
- if (bean == null) {
|
|
|
- bean = new DisType();
|
|
|
- }
|
|
|
- if (InsertOrUpdateEnum.Insert.getKey() == param.getInsertOrUpdate()) {
|
|
|
- bean.setGmtCreate(param.getNow());
|
|
|
- bean.setCreator(param.getPerson());
|
|
|
- }
|
|
|
- bean.setType(disType);
|
|
|
- bean.setDisId(param.getQuestionInfo().getId());
|
|
|
- bean.setModifier(param.getPerson());
|
|
|
- bean.setGmtModified(param.getNow());
|
|
|
- disTypeFacade.saveOrUpdate(bean);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 保存映射关系
|
|
|
*
|
|
@@ -436,23 +402,24 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
|
|
|
bean.setModifier(mapRespDTO.data.get(bean.getModifier()));
|
|
|
}
|
|
|
|
|
|
- //TODO 待修改
|
|
|
-// List<String> nameList = res.getRecords().stream().map(row -> row.getTagName()).collect(Collectors.toList());
|
|
|
-// ConceptExistVO conceptExistVO = new ConceptExistVO();
|
|
|
-// conceptExistVO.setNameList(nameList);
|
|
|
-// conceptExistVO.setType(res.getRecords().get(0).getType());
|
|
|
-// try {
|
|
|
-// RespDTO<Map<String, Long>> resMap = knowledgemanServiceClient.getConceptMap(conceptExistVO);
|
|
|
-// RespDTOUtil.respNGDeal(resMap, "远程调用根据名称和类型获取概念列表失败");
|
|
|
-// Map<String, Long> map = resMap.data;
|
|
|
-// for (QuestionPageDTO bean : res.getRecords()) {
|
|
|
-// if(map.get(bean.getTagName()) != null) {
|
|
|
-// bean.setExist(true);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// } catch (Exception e) {
|
|
|
-// e.printStackTrace();
|
|
|
-// }
|
|
|
+ List<String> nameList = res.getRecords().stream().map(row -> row.getTagName()).collect(Collectors.toList());
|
|
|
+ ConceptExistVO conceptExistVO = new ConceptExistVO();
|
|
|
+ conceptExistVO.setNameList(nameList);
|
|
|
+ try {
|
|
|
+ RespDTO<Map<String, List<Integer>>> resMap = knowledgemanServiceClient.getConceptMap(conceptExistVO);
|
|
|
+ RespDTOUtil.respNGDeal(resMap, "远程调用根据名称和类型获取概念列表失败");
|
|
|
+ Map<String, List<Integer>> map = resMap.data;
|
|
|
+ for (QuestionPageDTO bean : res.getRecords()) {
|
|
|
+ List<Integer> list = map.get(bean.getTagName());
|
|
|
+ if (ListUtil.isNotEmpty(list)) {
|
|
|
+ if (list.contains(bean.getType())) {
|
|
|
+ bean.setExist(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
return res;
|
|
|
}
|
|
|
|
|
@@ -473,34 +440,6 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
|
|
|
Date now = DateUtil.now();
|
|
|
String person = UserUtils.getCurrentPrincipleID();
|
|
|
for (String id : idList) {
|
|
|
- // 查询映射关系中是否存在父级
|
|
|
- /* List<QuestionInfo> info = this.getParentQuestion(Long.parseLong(id));
|
|
|
- for (QuestionInfo bean : info) {
|
|
|
- if (bean.getTagType() != null && bean.getTagType() == TagTypeEnum.T10.getKey()) {
|
|
|
- List<QuestionInfo> info2 = this.getParentQuestion(bean.getId());
|
|
|
- List<String> msg = info2.stream().map(row -> "【" + row.getTagName() + "】").collect(Collectors.toList());
|
|
|
- errMsg.append(String.join("", msg));
|
|
|
- } else {
|
|
|
- errMsg.append("【").append(bean.getTagName()).append("】");
|
|
|
- }
|
|
|
- }
|
|
|
- if (StringUtil.isNotEmpty(errMsg.toString())) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "请先删除标签的关联:" + errMsg);
|
|
|
- }*/
|
|
|
-
|
|
|
- // 查询模板中是否存在
|
|
|
- /*List<ModuleDetail> moduleDetails = moduleDetailFacade.list(new QueryWrapper<ModuleDetail>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("question_id", id));
|
|
|
- if (ListUtil.isNotEmpty(moduleDetails)) {
|
|
|
- List<Long> moduleIds = moduleDetails.stream().map(row -> row.getModuleId()).collect(Collectors.toList());
|
|
|
- List<String> moduleName = moduleInfoFacade.list(new QueryWrapper<ModuleInfo>()
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .in("id", moduleIds))
|
|
|
- .stream().map(row -> "{" + row.getName() + "}").collect(Collectors.toList());
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "请先删除模板的关联:" + String.join("、", moduleName));
|
|
|
- }*/
|
|
|
-
|
|
|
Map paramMap = new HashMap<>();
|
|
|
paramMap.put("delete", IsDeleteEnum.Y.getKey());
|
|
|
paramMap.put("ids", Arrays.asList(ids.split(",")));
|
|
@@ -519,49 +458,6 @@ public class QuestionFacade extends QuestionInfoServiceImpl {
|
|
|
.set("gmt_modified", now)
|
|
|
.set("modifier", person)
|
|
|
.set("is_deleted", IsDeleteEnum.Y.getKey()));
|
|
|
- //删除检索映射
|
|
|
- retrievalMappingFacade.update(new RetrievalMapping(), new UpdateWrapper<RetrievalMapping>()
|
|
|
- .eq("question_id", id)
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .set("gmt_modified", now)
|
|
|
- .set("modifier", person)
|
|
|
- .set("is_deleted", IsDeleteEnum.Y.getKey()));
|
|
|
- //如果是诊断
|
|
|
- if (deleteQuestionVO.getType() == QuestionTypeEnum.Disease.getKey()) {
|
|
|
- // 删除诊断类型映射关系
|
|
|
- disTypeFacade.update(new DisType(), new UpdateWrapper<DisType>()
|
|
|
- .eq("dis_id", id)
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .set("gmt_modified", now)
|
|
|
- .set("modifier", person)
|
|
|
- .set("is_deleted", IsDeleteEnum.Y.getKey()));
|
|
|
- //删除诊断和量表的映射关系
|
|
|
- disScaleFacade.update(new DisScale(), new UpdateWrapper<DisScale>()
|
|
|
- .eq("dis_id", id)
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .set("gmt_modified", now)
|
|
|
- .set("modifier", person)
|
|
|
- .set("is_deleted", IsDeleteEnum.Y.getKey()));
|
|
|
- //删除慢病模板
|
|
|
- QueryWrapper<ModuleInfo> moduleInfoQueryWrapper = new QueryWrapper<>();
|
|
|
- moduleInfoQueryWrapper.eq("relation_id", id)
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
- List<ModuleInfo> moduleInfoList = moduleInfoFacade.list(moduleInfoQueryWrapper);
|
|
|
- List<Long> moduleIds = moduleInfoList.stream().map(ModuleInfo::getId).collect(Collectors.toList());
|
|
|
- moduleInfoFacade.update(new ModuleInfo(), new UpdateWrapper<ModuleInfo>()
|
|
|
- .in("id", moduleIds)
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .set("gmt_modified", now)
|
|
|
- .set("modifier", person)
|
|
|
- .set("is_deleted", IsDeleteEnum.Y.getKey()));
|
|
|
- //删除模板明细
|
|
|
- moduleDetailFacade.update(new ModuleDetail(), new UpdateWrapper<ModuleDetail>()
|
|
|
- .in("module_id", moduleIds)
|
|
|
- .eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .set("gmt_modified", now)
|
|
|
- .set("modifier", person)
|
|
|
- .set("is_deleted", IsDeleteEnum.Y.getKey()));
|
|
|
- }
|
|
|
|
|
|
//TODO 删除映射关系或检查抛异常
|
|
|
|