|
@@ -1,30 +1,9 @@
|
|
|
package com.diagbot.facade;
|
|
|
|
|
|
-import java.io.InputStream;
|
|
|
-import java.text.DecimalFormat;
|
|
|
-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;
|
|
|
-
|
|
|
-import org.apache.commons.lang.time.DateFormatUtils;
|
|
|
-import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
|
|
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
-import org.apache.poi.ss.usermodel.Cell;
|
|
|
-import org.apache.poi.ss.usermodel.Row;
|
|
|
-import org.apache.poi.ss.usermodel.Sheet;
|
|
|
-import org.apache.poi.ss.usermodel.Workbook;
|
|
|
-import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
-import org.springframework.stereotype.Component;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
-
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.diagbot.client.ICSSManServiceClient;
|
|
|
import com.diagbot.client.UserServiceClient;
|
|
|
import com.diagbot.dto.ConceptBaseDTO;
|
|
|
import com.diagbot.dto.ConceptRes;
|
|
@@ -39,6 +18,7 @@ import com.diagbot.entity.Concept;
|
|
|
import com.diagbot.entity.ConceptCommon;
|
|
|
import com.diagbot.entity.Lexicon;
|
|
|
import com.diagbot.entity.LibraryInfo;
|
|
|
+import com.diagbot.entity.QuestionInfo;
|
|
|
import com.diagbot.entity.Relation;
|
|
|
import com.diagbot.entity.wrapper.ConceptWrapper;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
@@ -72,10 +52,33 @@ import com.diagbot.vo.GetAllInformationVO;
|
|
|
import com.diagbot.vo.GetAllLisConceptVO;
|
|
|
import com.diagbot.vo.GetConceptInfoDetailVO;
|
|
|
import com.diagbot.vo.GetConceptPacInfosVO;
|
|
|
+import com.diagbot.vo.IdListVO;
|
|
|
import com.diagbot.vo.IndexLexiconVO;
|
|
|
import com.diagbot.vo.IndexVO;
|
|
|
+import com.diagbot.vo.KLQuestionVO;
|
|
|
import com.diagbot.vo.RemoveConceptInfoVO;
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import org.apache.commons.lang.time.DateFormatUtils;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFDateUtil;
|
|
|
+import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
|
|
+import org.apache.poi.ss.usermodel.Cell;
|
|
|
+import org.apache.poi.ss.usermodel.Row;
|
|
|
+import org.apache.poi.ss.usermodel.Sheet;
|
|
|
+import org.apache.poi.ss.usermodel.Workbook;
|
|
|
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Qualifier;
|
|
|
+import org.springframework.stereotype.Component;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
+
|
|
|
+import java.io.InputStream;
|
|
|
+import java.text.DecimalFormat;
|
|
|
+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: 术语查询业务层
|
|
@@ -104,6 +107,10 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
private LexiconFacade lexiconFacade;
|
|
|
@Autowired
|
|
|
private ConceptCommonFacade conceptCommonFacade;
|
|
|
+ @Autowired
|
|
|
+ private LisMappingFacade lisMappingFacade;
|
|
|
+ @Autowired
|
|
|
+ private ICSSManServiceClient icssManServiceClient;
|
|
|
|
|
|
/**
|
|
|
* 获取所有化验公表项
|
|
@@ -142,11 +149,11 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public List<GetAllConceptDTO> getAllConcept(GetAllConceptVO getAllConceptVO) {
|
|
|
- List<GetAllConceptDTO> getAllConceptDTOList = Lists.newArrayList();
|
|
|
- if(StringUtil.isBlank(getAllConceptVO.getName())){
|
|
|
- return getAllConceptDTOList;
|
|
|
- }
|
|
|
-
|
|
|
+ List<GetAllConceptDTO> getAllConceptDTOList = Lists.newArrayList();
|
|
|
+ if (StringUtil.isBlank(getAllConceptVO.getName())) {
|
|
|
+ return getAllConceptDTOList;
|
|
|
+ }
|
|
|
+
|
|
|
QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<LibraryInfo>();
|
|
|
libraryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
libraryInfoQe.eq(getAllConceptVO.getIsConcept() != null, "is_concept", getAllConceptVO.getIsConcept());
|
|
@@ -161,7 +168,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
Map<Long, Concept> conceptMap = list(conceptQe).stream().collect(Collectors.toMap(Concept::getId, i -> i));
|
|
|
libraryInfoList.forEach(i -> {
|
|
|
if (conceptMap.get(i.getConceptId()) == null || conceptMap.get(i.getConceptId()).getLibId().intValue() != i.getId().intValue()
|
|
|
- ||(getAllConceptVO.getExcludedConceptIds() != null && getAllConceptVO.getExcludedConceptIds().contains(i.getConceptId()))) {
|
|
|
+ || (getAllConceptVO.getExcludedConceptIds() != null && getAllConceptVO.getExcludedConceptIds().contains(i.getConceptId()))) {
|
|
|
i.setIsDeleted(IsDeleteEnum.Y.getKey());
|
|
|
}
|
|
|
});
|
|
@@ -200,14 +207,14 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
*/
|
|
|
public List<GetAllForRelationDTO> getAllForRelation(GetAllForRelationVO getAllForRelationVO) {
|
|
|
List<GetAllForRelationDTO> retList = new ArrayList<>();
|
|
|
- if(StringUtil.isBlank(getAllForRelationVO.getName())&&getAllForRelationVO.getTypeId()==null){
|
|
|
- return retList;
|
|
|
+ if (StringUtil.isBlank(getAllForRelationVO.getName()) && getAllForRelationVO.getTypeId() == null) {
|
|
|
+ return retList;
|
|
|
}
|
|
|
|
|
|
QueryWrapper<Concept> conceptQe = new QueryWrapper<>();
|
|
|
conceptQe.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
- conceptQe.like(StringUtil.isNotBlank(getAllForRelationVO.getName()),"lib_name", getAllForRelationVO.getName());
|
|
|
- conceptQe.eq(getAllForRelationVO.getTypeId()!=null,"lib_type", getAllForRelationVO.getTypeId());
|
|
|
+ conceptQe.like(StringUtil.isNotBlank(getAllForRelationVO.getName()), "lib_name", getAllForRelationVO.getName());
|
|
|
+ conceptQe.eq(getAllForRelationVO.getTypeId() != null, "lib_type", getAllForRelationVO.getTypeId());
|
|
|
List<Concept> conceptList = list(conceptQe);
|
|
|
|
|
|
Map<Long, Long> reCouMap = new HashMap<>();
|
|
@@ -220,10 +227,10 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
QueryWrapper<Relation> relationQe = new QueryWrapper<>();
|
|
|
relationQe.eq("relation_id", getAllForRelationVO.getRelationId());
|
|
|
if (getAllForRelationVO.getRelationPosition() == 1) {
|
|
|
- relationQe.eq(getAllForRelationVO.getRelationConceptId() != null, "end_id", getAllForRelationVO.getRelationConceptId());
|
|
|
- relationQe.and(wrapper->wrapper.in("start_id", conceptIdList).or(getAllForRelationVO.getRelationConceptId() == null).in("end_id", conceptIdList));
|
|
|
+ relationQe.eq(getAllForRelationVO.getRelationConceptId() != null, "end_id", getAllForRelationVO.getRelationConceptId());
|
|
|
+ relationQe.and(wrapper -> wrapper.in("start_id", conceptIdList).or(getAllForRelationVO.getRelationConceptId() == null).in("end_id", conceptIdList));
|
|
|
reCouMap = relationFacade.list(relationQe).stream().collect(Collectors.groupingBy(Relation::getStartId, Collectors.counting()));
|
|
|
- } else if(getAllForRelationVO.getRelationConceptId() != null) {
|
|
|
+ } else if (getAllForRelationVO.getRelationConceptId() != null) {
|
|
|
relationQe.in("end_id", conceptIdList);
|
|
|
relationQe.eq("start_id", getAllForRelationVO.getRelationConceptId());
|
|
|
reCouMap = relationFacade.list(relationQe).stream().collect(Collectors.groupingBy(Relation::getEndId, Collectors.counting()));
|
|
@@ -239,7 +246,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
GetAllForRelationDTO getAllForRelationDTO = new GetAllForRelationDTO();
|
|
|
getAllForRelationDTO.setConceptId(i.getId());
|
|
|
getAllForRelationDTO.setConceptName(i.getLibName());
|
|
|
- getAllForRelationDTO.setConceptNameType(i.getLibName()+"("+LexiconTypeEnum.getName(i.getLibType().intValue())+")");
|
|
|
+ getAllForRelationDTO.setConceptNameType(i.getLibName() + "(" + LexiconTypeEnum.getName(i.getLibType().intValue()) + ")");
|
|
|
retList.add(getAllForRelationDTO);
|
|
|
}
|
|
|
|
|
@@ -253,63 +260,63 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public IPage<GetAllInformationDTO> getAllInformation(GetAllInformationVO getAllInformationVO) {
|
|
|
- Page<GetAllInformationDTO> getAllInformationDTOPage = new Page<>();
|
|
|
-
|
|
|
- Page<Concept> conceptPage = new Page<>(getAllInformationVO.getCurrent(),getAllInformationVO.getSize());
|
|
|
- QueryWrapper<Concept> conceptQe = new QueryWrapper<>();
|
|
|
- if(StringUtil.isNotBlank(getAllInformationVO.getLibName())){
|
|
|
- QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<>();
|
|
|
- libraryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
- libraryInfoQe.like("name", getAllInformationVO.getLibName());
|
|
|
- libraryInfoQe.eq(StringUtil.isNotBlank(getAllInformationVO.getType()),"type_id", LexiconTypeEnum.getKey(getAllInformationVO.getType()));
|
|
|
- List<Long> conceptIdList = libraryinfoFacade.list(libraryInfoQe).stream().map(i->i.getConceptId()).distinct().collect(Collectors.toList());
|
|
|
- if(ListUtil.isNotEmpty(conceptIdList)){
|
|
|
- conceptQe.in("id", conceptIdList);
|
|
|
- }else{
|
|
|
- conceptQe.eq("id", -999999999);
|
|
|
- }
|
|
|
- }
|
|
|
- conceptQe.like(StringUtil.isNotBlank(getAllInformationVO.getName()),"lib_name", getAllInformationVO.getName());
|
|
|
- conceptQe.eq(StringUtil.isNotBlank(getAllInformationVO.getType()),"lib_type", LexiconTypeEnum.getKey(getAllInformationVO.getType()));
|
|
|
- conceptQe.eq(StringUtil.isNotBlank(getAllInformationVO.getIsDeleted()),"is_deleted", getAllInformationVO.getIsDeleted());
|
|
|
- conceptQe.orderByDesc("sort_deleted");
|
|
|
- conceptQe.orderByDesc("gmt_modified");
|
|
|
- conceptQe.orderByDesc("id");
|
|
|
- IPage<Concept> iPage = this.page(conceptPage, conceptQe);
|
|
|
- BeanUtil.copyProperties(iPage, getAllInformationDTOPage);
|
|
|
-
|
|
|
- if(ListUtil.isNotEmpty(iPage.getRecords())){
|
|
|
- List<GetAllInformationDTO> getAllInformationDTOList = Lists.newArrayList();
|
|
|
-
|
|
|
- List<Long> conceptIds = iPage.getRecords().stream().map(i->i.getId()).collect(Collectors.toList());
|
|
|
- QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<>();
|
|
|
- libraryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
- libraryInfoQe.in("concept_id", conceptIds);
|
|
|
- Map<Long,List<LibraryInfo>> libraryInfoListMap = libraryinfoFacade.list(libraryInfoQe).stream().collect(Collectors.groupingBy(LibraryInfo::getConceptId));
|
|
|
-
|
|
|
- List<String> userIds = iPage.getRecords().stream().map(i ->i.getModifier()).distinct().collect(Collectors.toList());
|
|
|
- RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(userIds);
|
|
|
- RespDTOUtil.respNGDealCover(respDTO, "获取用户信息失败");
|
|
|
- iPage.getRecords().forEach(i -> {
|
|
|
- GetAllInformationDTO getAllInformationDTO = new GetAllInformationDTO();
|
|
|
- getAllInformationDTO.setConceptId(i.getId());
|
|
|
- getAllInformationDTO.setLibName(i.getLibName());
|
|
|
- getAllInformationDTO.setLibType(LexiconTypeEnum.getName(i.getLibType().intValue()));
|
|
|
- getAllInformationDTO.setIsDeleted(i.getIsDeleted());
|
|
|
- getAllInformationDTO.setOperName(respDTO.data.get(i.getModifier()));
|
|
|
- getAllInformationDTO.setOperTime(i.getGmtModified());
|
|
|
- if(libraryInfoListMap.get(i.getId())!=null){
|
|
|
- getAllInformationDTO.setOtherNames(libraryInfoListMap.get(i.getId()).stream().sorted((a,b)->b.getIsConcept()-a.getIsConcept()).map(k->k.getName()).collect(Collectors.joining("、")));
|
|
|
- }
|
|
|
- getAllInformationDTOList.add(getAllInformationDTO);
|
|
|
- });
|
|
|
-
|
|
|
- getAllInformationDTOPage.setRecords(getAllInformationDTOList);
|
|
|
- }
|
|
|
-
|
|
|
+ Page<GetAllInformationDTO> getAllInformationDTOPage = new Page<>();
|
|
|
+
|
|
|
+ Page<Concept> conceptPage = new Page<>(getAllInformationVO.getCurrent(), getAllInformationVO.getSize());
|
|
|
+ QueryWrapper<Concept> conceptQe = new QueryWrapper<>();
|
|
|
+ if (StringUtil.isNotBlank(getAllInformationVO.getLibName())) {
|
|
|
+ QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<>();
|
|
|
+ libraryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
+ libraryInfoQe.like("name", getAllInformationVO.getLibName());
|
|
|
+ libraryInfoQe.eq(StringUtil.isNotBlank(getAllInformationVO.getType()), "type_id", LexiconTypeEnum.getKey(getAllInformationVO.getType()));
|
|
|
+ List<Long> conceptIdList = libraryinfoFacade.list(libraryInfoQe).stream().map(i -> i.getConceptId()).distinct().collect(Collectors.toList());
|
|
|
+ if (ListUtil.isNotEmpty(conceptIdList)) {
|
|
|
+ conceptQe.in("id", conceptIdList);
|
|
|
+ } else {
|
|
|
+ conceptQe.eq("id", -999999999);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ conceptQe.like(StringUtil.isNotBlank(getAllInformationVO.getName()), "lib_name", getAllInformationVO.getName());
|
|
|
+ conceptQe.eq(StringUtil.isNotBlank(getAllInformationVO.getType()), "lib_type", LexiconTypeEnum.getKey(getAllInformationVO.getType()));
|
|
|
+ conceptQe.eq(StringUtil.isNotBlank(getAllInformationVO.getIsDeleted()), "is_deleted", getAllInformationVO.getIsDeleted());
|
|
|
+ conceptQe.orderByDesc("sort_deleted");
|
|
|
+ conceptQe.orderByDesc("gmt_modified");
|
|
|
+ conceptQe.orderByDesc("id");
|
|
|
+ IPage<Concept> iPage = this.page(conceptPage, conceptQe);
|
|
|
+ BeanUtil.copyProperties(iPage, getAllInformationDTOPage);
|
|
|
+
|
|
|
+ if (ListUtil.isNotEmpty(iPage.getRecords())) {
|
|
|
+ List<GetAllInformationDTO> getAllInformationDTOList = Lists.newArrayList();
|
|
|
+
|
|
|
+ List<Long> conceptIds = iPage.getRecords().stream().map(i -> i.getId()).collect(Collectors.toList());
|
|
|
+ QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<>();
|
|
|
+ libraryInfoQe.eq("is_deleted", IsDeleteEnum.N.getKey());
|
|
|
+ libraryInfoQe.in("concept_id", conceptIds);
|
|
|
+ Map<Long, List<LibraryInfo>> libraryInfoListMap = libraryinfoFacade.list(libraryInfoQe).stream().collect(Collectors.groupingBy(LibraryInfo::getConceptId));
|
|
|
+
|
|
|
+ List<String> userIds = iPage.getRecords().stream().map(i -> i.getModifier()).distinct().collect(Collectors.toList());
|
|
|
+ RespDTO<Map<String, String>> respDTO = userServiceClient.getUserInfoByIds(userIds);
|
|
|
+ RespDTOUtil.respNGDealCover(respDTO, "获取用户信息失败");
|
|
|
+ iPage.getRecords().forEach(i -> {
|
|
|
+ GetAllInformationDTO getAllInformationDTO = new GetAllInformationDTO();
|
|
|
+ getAllInformationDTO.setConceptId(i.getId());
|
|
|
+ getAllInformationDTO.setLibName(i.getLibName());
|
|
|
+ getAllInformationDTO.setLibType(LexiconTypeEnum.getName(i.getLibType().intValue()));
|
|
|
+ getAllInformationDTO.setIsDeleted(i.getIsDeleted());
|
|
|
+ getAllInformationDTO.setOperName(respDTO.data.get(i.getModifier()));
|
|
|
+ getAllInformationDTO.setOperTime(i.getGmtModified());
|
|
|
+ if (libraryInfoListMap.get(i.getId()) != null) {
|
|
|
+ getAllInformationDTO.setOtherNames(libraryInfoListMap.get(i.getId()).stream().sorted((a, b) -> b.getIsConcept() - a.getIsConcept()).map(k -> k.getName()).collect(Collectors.joining("、")));
|
|
|
+ }
|
|
|
+ getAllInformationDTOList.add(getAllInformationDTO);
|
|
|
+ });
|
|
|
+
|
|
|
+ getAllInformationDTOPage.setRecords(getAllInformationDTOList);
|
|
|
+ }
|
|
|
+
|
|
|
return getAllInformationDTOPage;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 医学术语命名删除或者恢复
|
|
|
*
|
|
@@ -380,11 +387,25 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ //清理缓存
|
|
|
+ this.cacheClearByConceptId(concept.getId());
|
|
|
+
|
|
|
concept.setIsDeleted(removeConceptInfoVO.getIsDeleted());
|
|
|
concept.setModifier(currentUser);
|
|
|
concept.setGmtModified(now);
|
|
|
this.updateById(concept);
|
|
|
|
|
|
+ //清除缓存
|
|
|
+ List<QuestionInfo> questionInfoList = Lists.newArrayList();
|
|
|
+ if (concept.getLibType().equals(LexiconTypeEnum.LIS_PACKAGE.getKey())) {
|
|
|
+
|
|
|
+ }
|
|
|
+ if (concept.getLibType().equals(LexiconTypeEnum.LIS_TABLES.getKey())) {
|
|
|
+
|
|
|
+ }
|
|
|
+ if (concept.getLibType().equals(LexiconTypeEnum.LIS_DETAILS.getKey())) {
|
|
|
+
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
|
|
@@ -445,7 +466,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
for (AddConceptInfoDetailVO i : addConceptInfoVO.getDetailList()) {
|
|
|
if (i.getName().matches(regEx)) {
|
|
|
//throw new CommonException(CommonErrorCode.RPC_ERROR, lineNumStr + "无法输入纯数字或者纯字符,请输入正确数据!");
|
|
|
- throw new CommonException(CommonErrorCode.RPC_ERROR, lineNumStr + "无法输入纯数字,请输入正确数据!");
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR, lineNumStr + "无法输入纯数字,请输入正确数据!");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -518,8 +539,8 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
} else {
|
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR, "该数据已经建立且处于已删除状态,可前往列表中恢复该条数据!");
|
|
|
}
|
|
|
- }else if(addConceptInfoVO.getConceptId().intValue()!=ckConceptId){
|
|
|
- throw new CommonException(CommonErrorCode.RPC_ERROR, lineNumStr + "标准术语已被占用!");
|
|
|
+ } else if (addConceptInfoVO.getConceptId().intValue() != ckConceptId) {
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR, lineNumStr + "标准术语已被占用!");
|
|
|
}
|
|
|
} else if (addConceptInfoVO.getLineNum() == null && addConceptInfoVO.getConceptId() == null && concept != null
|
|
|
|| libraryInfoList.stream().filter(i -> i.getConceptId().intValue() == ckConceptId).count() == 1) {
|
|
@@ -577,6 +598,9 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
|
|
|
libraryInfoService.saveOrUpdateBatch(saveOrUpdateLibraryInfoList);
|
|
|
|
|
|
+ //清理原名称对应标签缓存
|
|
|
+ this.cacheClearByConceptId(conceptId);
|
|
|
+
|
|
|
concept.setId(conceptId);
|
|
|
concept.setLibId(libraryInfoMain.getId());
|
|
|
concept.setLibName(libraryInfoMain.getName());
|
|
@@ -594,7 +618,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
conceptCommon.setGmtCreate(now);
|
|
|
conceptCommon.setCreator(currentUser);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
BeanUtil.copyProperties(addConceptInfoVO, conceptCommon);
|
|
|
conceptCommon.setConceptId(conceptId);
|
|
|
conceptCommon.setGmtModified(now);
|
|
@@ -644,13 +668,13 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
if (row == null) {
|
|
|
continue;
|
|
|
}
|
|
|
-// if (count == 1) {
|
|
|
-// title_1 = getValue(row.getCell(0)).trim().replace(" ", "");
|
|
|
-// title_2 = getValue(row.getCell(1)).trim().replace(" ", "");
|
|
|
-// title_3 = getValue(row.getCell(2)).trim().replace(" ", "");
|
|
|
-// title_4 = getValue(row.getCell(3)).trim().replace(" ", "");
|
|
|
-// continue;
|
|
|
-// }
|
|
|
+ // if (count == 1) {
|
|
|
+ // title_1 = getValue(row.getCell(0)).trim().replace(" ", "");
|
|
|
+ // title_2 = getValue(row.getCell(1)).trim().replace(" ", "");
|
|
|
+ // title_3 = getValue(row.getCell(2)).trim().replace(" ", "");
|
|
|
+ // title_4 = getValue(row.getCell(3)).trim().replace(" ", "");
|
|
|
+ // continue;
|
|
|
+ // }
|
|
|
libName = getValue(row.getCell(0)).trim().replace(" ", "");
|
|
|
libType = getValue(row.getCell(1)).trim().replace(" ", "");
|
|
|
otherNames = getValue(row.getCell(2)).trim().replace(" ", "");
|
|
@@ -658,23 +682,23 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
sexType = getValue(row.getCell(4)).trim().replace(" ", "");
|
|
|
minAge = getValue(row.getCell(5)).trim().replace(" ", "");
|
|
|
maxAge = getValue(row.getCell(6)).trim().replace(" ", "");
|
|
|
-
|
|
|
- if(count == 1){
|
|
|
- //当前行是第一行时,libName、libType、otherNames、remark、sexType、minAge、maxAge是标题
|
|
|
- if (libName.indexOf("标准术语") == -1
|
|
|
- || libType.indexOf("类型") == -1
|
|
|
- || otherNames.indexOf("术语同义词") == -1
|
|
|
- || remark.indexOf("标准术语说明") == -1
|
|
|
- || sexType.indexOf("性别") == -1
|
|
|
- || minAge.indexOf("最小年龄") == -1
|
|
|
- || maxAge.indexOf("最大年龄") == -1) {
|
|
|
- sbf.append("导入数据不正确,请选择正确数据导入!").append("<br/>");
|
|
|
- break;
|
|
|
- }else{
|
|
|
- continue;
|
|
|
- }
|
|
|
+
|
|
|
+ if (count == 1) {
|
|
|
+ //当前行是第一行时,libName、libType、otherNames、remark、sexType、minAge、maxAge是标题
|
|
|
+ if (libName.indexOf("标准术语") == -1
|
|
|
+ || libType.indexOf("类型") == -1
|
|
|
+ || otherNames.indexOf("术语同义词") == -1
|
|
|
+ || remark.indexOf("标准术语说明") == -1
|
|
|
+ || sexType.indexOf("性别") == -1
|
|
|
+ || minAge.indexOf("最小年龄") == -1
|
|
|
+ || maxAge.indexOf("最大年龄") == -1) {
|
|
|
+ sbf.append("导入数据不正确,请选择正确数据导入!").append("<br/>");
|
|
|
+ break;
|
|
|
+ } else {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (StringUtil.isEmpty(libName) && StringUtil.isEmpty(libType)
|
|
|
&& StringUtil.isEmpty(otherNames) && StringUtil.isEmpty(remark)) {
|
|
|
continue;
|
|
@@ -706,8 +730,8 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
addConceptInfoVO.setLineNum(count);
|
|
|
addConceptInfoVO.setName(libName);
|
|
|
addConceptInfoVO.setType(libType);
|
|
|
- addConceptInfoVO.setMinAge(StringUtil.isEmpty(minAge)?0:Integer.parseInt(minAge));
|
|
|
- addConceptInfoVO.setMaxAge(StringUtil.isEmpty(minAge)?200:Integer.parseInt(maxAge));
|
|
|
+ addConceptInfoVO.setMinAge(StringUtil.isEmpty(minAge) ? 0 : Integer.parseInt(minAge));
|
|
|
+ addConceptInfoVO.setMaxAge(StringUtil.isEmpty(minAge) ? 200 : Integer.parseInt(maxAge));
|
|
|
if (sexType.equals("男")) {
|
|
|
addConceptInfoVO.setSexType(1);
|
|
|
} else if (sexType.equals("女")) {
|
|
@@ -772,21 +796,21 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR, sbf.toString());
|
|
|
}
|
|
|
|
|
|
-// /**********************非规范的excel导入提醒*****************************************/
|
|
|
-// if (title_1.indexOf("标准术语") == -1
|
|
|
-// || title_2.indexOf("类型") == -1
|
|
|
-// || title_3.indexOf("术语同义词") == -1
|
|
|
-// || title_4.indexOf("标准术语说明") == -1) {
|
|
|
-// throw new CommonException(CommonErrorCode.RPC_ERROR, "导入数据不正确,请选择正确数据导入!");
|
|
|
-// }
|
|
|
+ // /**********************非规范的excel导入提醒*****************************************/
|
|
|
+ // if (title_1.indexOf("标准术语") == -1
|
|
|
+ // || title_2.indexOf("类型") == -1
|
|
|
+ // || title_3.indexOf("术语同义词") == -1
|
|
|
+ // || title_4.indexOf("标准术语说明") == -1) {
|
|
|
+ // throw new CommonException(CommonErrorCode.RPC_ERROR, "导入数据不正确,请选择正确数据导入!");
|
|
|
+ // }
|
|
|
|
|
|
/****************************导入空文件************************/
|
|
|
if (addConceptInfoVOList.size() == 0) {
|
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR, "导入数据不能为空!");
|
|
|
}
|
|
|
-
|
|
|
- if(addConceptInfoVOList.size() > 5000){
|
|
|
- throw new CommonException(CommonErrorCode.RPC_ERROR, "当前数据导入失败,单次导入最多可支持5千条数据导入");
|
|
|
+
|
|
|
+ if (addConceptInfoVOList.size() > 5000) {
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR, "当前数据导入失败,单次导入最多可支持5千条数据导入");
|
|
|
}
|
|
|
|
|
|
/****************excel文件中所有术语存在重复提示---名字和类型一样即重复***********************/
|
|
@@ -810,100 +834,101 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
* addConceptInfoVOList.forEach(i -> {
|
|
|
addConceptInfo(i);
|
|
|
});*/
|
|
|
-
|
|
|
+
|
|
|
////优化后
|
|
|
QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<>();
|
|
|
- libraryInfoQe.in("name", addConceptInfoDetailVOList.stream().map(i->i.getName()).distinct().collect(Collectors.toList()));
|
|
|
- Map<String,List<LibraryInfo>> libraryInfoListMap = libraryinfoFacade.list(libraryInfoQe).stream().collect(Collectors.groupingBy(LibraryInfo::getName));
|
|
|
-
|
|
|
- Map<String,Lexicon> lexiconMap = lexiconFacade.list().stream().collect(Collectors.toMap(Lexicon::getName, i->i));
|
|
|
-
|
|
|
+ libraryInfoQe.in("name", addConceptInfoDetailVOList.stream().map(i -> i.getName()).distinct().collect(Collectors.toList()));
|
|
|
+ Map<String, List<LibraryInfo>> libraryInfoListMap = libraryinfoFacade.list(libraryInfoQe).stream().collect(Collectors.groupingBy(LibraryInfo::getName));
|
|
|
+
|
|
|
+ Map<String, Lexicon> lexiconMap = lexiconFacade.list().stream().collect(Collectors.toMap(Lexicon::getName, i -> i));
|
|
|
+
|
|
|
String ckmsg = null;
|
|
|
- for(AddConceptInfoVO addConceptInfoVO : addConceptInfoVOList){
|
|
|
- ckmsg = checkImConceptInfo(addConceptInfoVO,libraryInfoListMap,lexiconMap);
|
|
|
- if(StringUtil.isNotBlank(ckmsg)){
|
|
|
- sbf.append("第").append(addConceptInfoVO.getLineNum()).append("行").append(ckmsg).append("<br/>");
|
|
|
- }
|
|
|
+ for (AddConceptInfoVO addConceptInfoVO : addConceptInfoVOList) {
|
|
|
+ ckmsg = checkImConceptInfo(addConceptInfoVO, libraryInfoListMap, lexiconMap);
|
|
|
+ if (StringUtil.isNotBlank(ckmsg)) {
|
|
|
+ sbf.append("第").append(addConceptInfoVO.getLineNum()).append("行").append(ckmsg).append("<br/>");
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (sbf.length() > 0) {
|
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR, sbf.toString());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
saveAddConceptInfoVOList(addConceptInfoVOList);
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 导入数据插入更新前校验
|
|
|
+ *
|
|
|
* @param addConceptInfoVO
|
|
|
* @param libraryInfoListAllMap
|
|
|
* @param lexiconMap
|
|
|
* @return
|
|
|
*/
|
|
|
- public String checkImConceptInfo(AddConceptInfoVO addConceptInfoVO,Map<String,List<LibraryInfo>> libraryInfoListAllMap,Map<String,Lexicon> lexiconMap) {
|
|
|
- String currentUser = UserUtils.getCurrentPrincipleID();
|
|
|
+ public String checkImConceptInfo(AddConceptInfoVO addConceptInfoVO, Map<String, List<LibraryInfo>> libraryInfoListAllMap, Map<String, Lexicon> lexiconMap) {
|
|
|
+ String currentUser = UserUtils.getCurrentPrincipleID();
|
|
|
Date now = DateUtil.now();
|
|
|
-
|
|
|
- Concept concept = new Concept();
|
|
|
- ConceptCommon conceptCommon = null;
|
|
|
- List<LibraryInfo> libraryInfoList = Lists.newArrayList();
|
|
|
+
|
|
|
+ Concept concept = new Concept();
|
|
|
+ ConceptCommon conceptCommon = null;
|
|
|
+ List<LibraryInfo> libraryInfoList = Lists.newArrayList();
|
|
|
|
|
|
List<AddConceptInfoDetailVO> addConceptInfoDetailVOMainList = addConceptInfoVO.getDetailList().stream().filter(i -> i.getIsConcept() == 1).collect(Collectors.toList());
|
|
|
if (addConceptInfoDetailVOMainList.size() == 0) {
|
|
|
- return "同义词中缺少标准词本体!";
|
|
|
+ return "同义词中缺少标准词本体!";
|
|
|
}
|
|
|
if (addConceptInfoDetailVOMainList.size() > 1) {
|
|
|
- return "标准术语只能有一个!";
|
|
|
+ return "标准术语只能有一个!";
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
Lexicon lexicon = lexiconMap.get(addConceptInfoVO.getType());
|
|
|
if (lexicon == null) {
|
|
|
- return "数据有误,该类型信息在数据库中不存在!";
|
|
|
+ return "数据有误,该类型信息在数据库中不存在!";
|
|
|
}
|
|
|
Long typeId = lexicon.getId();
|
|
|
concept.setLibType(typeId);
|
|
|
concept.setGmtModified(now);
|
|
|
- concept.setModifier(currentUser);
|
|
|
- if(lexicon.getIsHasCommon()==1){
|
|
|
- conceptCommon = new ConceptCommon();
|
|
|
- conceptCommon.setSexType(addConceptInfoVO.getSexType());
|
|
|
- conceptCommon.setMinAge(addConceptInfoVO.getMinAge());
|
|
|
- conceptCommon.setMaxAge(addConceptInfoVO.getMaxAge());
|
|
|
- conceptCommon.setGmtModified(now);
|
|
|
- conceptCommon.setModifier(currentUser);
|
|
|
- }
|
|
|
-
|
|
|
+ concept.setModifier(currentUser);
|
|
|
+ if (lexicon.getIsHasCommon() == 1) {
|
|
|
+ conceptCommon = new ConceptCommon();
|
|
|
+ conceptCommon.setSexType(addConceptInfoVO.getSexType());
|
|
|
+ conceptCommon.setMinAge(addConceptInfoVO.getMinAge());
|
|
|
+ conceptCommon.setMaxAge(addConceptInfoVO.getMaxAge());
|
|
|
+ conceptCommon.setGmtModified(now);
|
|
|
+ conceptCommon.setModifier(currentUser);
|
|
|
+ }
|
|
|
+
|
|
|
List<LibraryInfo> extLibraryInfoList = Lists.newArrayList();
|
|
|
- addConceptInfoVO.getDetailList().forEach(a->{
|
|
|
- List<LibraryInfo> libraryInfoListAll = libraryInfoListAllMap.get(a.getName());
|
|
|
- if(ListUtil.isNotEmpty(libraryInfoListAll)){
|
|
|
- libraryInfoListAll = libraryInfoListAll.stream().filter(b->b.getTypeId().intValue()==typeId.intValue()).collect(Collectors.toList());
|
|
|
- if(ListUtil.isNotEmpty(libraryInfoListAll)){
|
|
|
- extLibraryInfoList.add(libraryInfoListAll.get(0));
|
|
|
- }
|
|
|
- }
|
|
|
+ addConceptInfoVO.getDetailList().forEach(a -> {
|
|
|
+ List<LibraryInfo> libraryInfoListAll = libraryInfoListAllMap.get(a.getName());
|
|
|
+ if (ListUtil.isNotEmpty(libraryInfoListAll)) {
|
|
|
+ libraryInfoListAll = libraryInfoListAll.stream().filter(b -> b.getTypeId().intValue() == typeId.intValue()).collect(Collectors.toList());
|
|
|
+ if (ListUtil.isNotEmpty(libraryInfoListAll)) {
|
|
|
+ extLibraryInfoList.add(libraryInfoListAll.get(0));
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
Map<String, LibraryInfo> extLibraryInfoMap = extLibraryInfoList.stream().collect(Collectors.toMap(LibraryInfo::getName, i -> i));
|
|
|
-
|
|
|
+
|
|
|
LibraryInfo libraryInfoMain = extLibraryInfoMap.get(addConceptInfoDetailVOMainList.get(0).getName());
|
|
|
Long conceptId = null;
|
|
|
if (libraryInfoMain == null) {
|
|
|
- conceptId = -9999l;
|
|
|
- concept.setGmtCreate(now);
|
|
|
- concept.setCreator(currentUser);
|
|
|
- if(conceptCommon!=null){
|
|
|
- conceptCommon.setGmtCreate(now);
|
|
|
- conceptCommon.setCreator(currentUser);
|
|
|
- }
|
|
|
+ conceptId = -9999l;
|
|
|
+ concept.setGmtCreate(now);
|
|
|
+ concept.setCreator(currentUser);
|
|
|
+ if (conceptCommon != null) {
|
|
|
+ conceptCommon.setGmtCreate(now);
|
|
|
+ conceptCommon.setCreator(currentUser);
|
|
|
+ }
|
|
|
} else {
|
|
|
conceptId = libraryInfoMain.getConceptId();
|
|
|
concept.setId(conceptId);
|
|
|
addConceptInfoVO.setConceptId(conceptId);
|
|
|
|
|
|
- if (libraryInfoMain.getIsConcept()!=1&&extLibraryInfoList.stream().filter(i -> i.getConceptId().intValue() == libraryInfoMain.getConceptId().intValue()).count() == 1) {
|
|
|
- return "标准术语已作为同义词被占用!";
|
|
|
+ if (libraryInfoMain.getIsConcept() != 1 && extLibraryInfoList.stream().filter(i -> i.getConceptId().intValue() == libraryInfoMain.getConceptId().intValue()).count() == 1) {
|
|
|
+ return "标准术语已作为同义词被占用!";
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -911,10 +936,10 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
for (AddConceptInfoDetailVO i : addConceptInfoVO.getDetailList()) {
|
|
|
LibraryInfo libraryInfo = extLibraryInfoMap.get(i.getName());
|
|
|
if (libraryInfo == null) {
|
|
|
- libraryInfo = new LibraryInfo();
|
|
|
- libraryInfo.setTypeId(typeId);
|
|
|
- libraryInfo.setGmtCreate(now);
|
|
|
- libraryInfo.setCreator(currentUser);
|
|
|
+ libraryInfo = new LibraryInfo();
|
|
|
+ libraryInfo.setTypeId(typeId);
|
|
|
+ libraryInfo.setGmtCreate(now);
|
|
|
+ libraryInfo.setCreator(currentUser);
|
|
|
} else if (libraryInfo.getConceptId().intValue() != conceptId.intValue()) {
|
|
|
sbf.append(i.getName()).append(" ");
|
|
|
continue;
|
|
@@ -925,10 +950,10 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
libraryInfo.setConceptId(conceptId);
|
|
|
libraryInfo.setGmtModified(now);
|
|
|
libraryInfo.setModifier(currentUser);
|
|
|
- if(i.getIsConcept()==1){
|
|
|
- libraryInfoList.add(0,libraryInfo);
|
|
|
- }else{
|
|
|
- libraryInfoList.add(libraryInfo);
|
|
|
+ if (i.getIsConcept() == 1) {
|
|
|
+ libraryInfoList.add(0, libraryInfo);
|
|
|
+ } else {
|
|
|
+ libraryInfoList.add(libraryInfo);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -936,74 +961,78 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
sbf.append("已被占用");
|
|
|
return sbf.toString();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
addConceptInfoVO.setConcept(concept);
|
|
|
addConceptInfoVO.setConceptCommon(conceptCommon);
|
|
|
addConceptInfoVO.setLibraryInfoList(libraryInfoList);
|
|
|
|
|
|
return null;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 导入数据插入更新
|
|
|
+ *
|
|
|
* @param addConceptInfoVOList
|
|
|
*/
|
|
|
- private void saveAddConceptInfoVOList(List<AddConceptInfoVO> addConceptInfoVOList){
|
|
|
- List<Long> conceptIds = addConceptInfoVOList.stream().filter(i->i.getConceptId()!=null).map(i->i.getConceptId()).collect(Collectors.toList());
|
|
|
- if(ListUtil.isNotEmpty(conceptIds)){
|
|
|
- QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<>();
|
|
|
+ private void saveAddConceptInfoVOList(List<AddConceptInfoVO> addConceptInfoVOList) {
|
|
|
+ List<Long> conceptIds = addConceptInfoVOList.stream().filter(i -> i.getConceptId() != null).map(i -> i.getConceptId()).collect(Collectors.toList());
|
|
|
+ if (ListUtil.isNotEmpty(conceptIds)) {
|
|
|
+ QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<>();
|
|
|
libraryInfoQe.in("concept_id", conceptIds);
|
|
|
libraryinfoFacade.remove(libraryInfoQe);
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
List<LibraryInfo> saveLibraryInfoList = Lists.newArrayList();
|
|
|
- addConceptInfoVOList.forEach(i->{
|
|
|
- saveLibraryInfoList.addAll(i.getLibraryInfoList());
|
|
|
+ addConceptInfoVOList.forEach(i -> {
|
|
|
+ saveLibraryInfoList.addAll(i.getLibraryInfoList());
|
|
|
});
|
|
|
libraryInfoService.saveBatch(saveLibraryInfoList);
|
|
|
-
|
|
|
+
|
|
|
List<Concept> saveOrUpdateConceptList = Lists.newArrayList();
|
|
|
- addConceptInfoVOList.forEach(i->{
|
|
|
- i.getConcept().setLibId(i.getLibraryInfoList().get(0).getId());
|
|
|
- i.getConcept().setLibName(i.getLibraryInfoList().get(0).getName());
|
|
|
- saveOrUpdateConceptList.add(i.getConcept());
|
|
|
+ addConceptInfoVOList.forEach(i -> {
|
|
|
+ i.getConcept().setLibId(i.getLibraryInfoList().get(0).getId());
|
|
|
+ i.getConcept().setLibName(i.getLibraryInfoList().get(0).getName());
|
|
|
+ saveOrUpdateConceptList.add(i.getConcept());
|
|
|
});
|
|
|
+ //删除标签缓存
|
|
|
+ List<Long> saveConceptIds = saveOrUpdateConceptList.stream().map(i -> i.getId()).filter(j -> j != null).distinct().collect(Collectors.toList());
|
|
|
+ this.cacheClearByConceptIds(saveConceptIds);
|
|
|
conceptService.saveOrUpdateBatch(saveOrUpdateConceptList);
|
|
|
-
|
|
|
+
|
|
|
List<LibraryInfo> updateLibraryInfoList = Lists.newArrayList();
|
|
|
- addConceptInfoVOList.forEach(i->{
|
|
|
- if(i.getConceptId()==null){
|
|
|
- i.getLibraryInfoList().forEach(j->{
|
|
|
- j.setConceptId(i.getConcept().getId());
|
|
|
- });
|
|
|
- updateLibraryInfoList.addAll(i.getLibraryInfoList());
|
|
|
- }
|
|
|
+ addConceptInfoVOList.forEach(i -> {
|
|
|
+ if (i.getConceptId() == null) {
|
|
|
+ i.getLibraryInfoList().forEach(j -> {
|
|
|
+ j.setConceptId(i.getConcept().getId());
|
|
|
+ });
|
|
|
+ updateLibraryInfoList.addAll(i.getLibraryInfoList());
|
|
|
+ }
|
|
|
});
|
|
|
- if(ListUtil.isNotEmpty(updateLibraryInfoList)){
|
|
|
- libraryInfoService.updateBatchById(updateLibraryInfoList);
|
|
|
+ if (ListUtil.isNotEmpty(updateLibraryInfoList)) {
|
|
|
+ libraryInfoService.updateBatchById(updateLibraryInfoList);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
List<ConceptCommon> saveOrUpdateConceptCommonList = Lists.newArrayList();
|
|
|
- Map<Long,ConceptCommon> conceptCommonMap = null;
|
|
|
- if(ListUtil.isNotEmpty(conceptIds)){
|
|
|
- QueryWrapper<ConceptCommon> conceptCommonQe = new QueryWrapper<>();
|
|
|
+ Map<Long, ConceptCommon> conceptCommonMap = null;
|
|
|
+ if (ListUtil.isNotEmpty(conceptIds)) {
|
|
|
+ QueryWrapper<ConceptCommon> conceptCommonQe = new QueryWrapper<>();
|
|
|
conceptCommonQe.in("concept_id", conceptIds);
|
|
|
- conceptCommonMap = conceptCommonFacade.list(conceptCommonQe).stream().collect(Collectors.toMap(ConceptCommon::getConceptId, i->i));
|
|
|
+ conceptCommonMap = conceptCommonFacade.list(conceptCommonQe).stream().collect(Collectors.toMap(ConceptCommon::getConceptId, i -> i));
|
|
|
}
|
|
|
- for(AddConceptInfoVO i : addConceptInfoVOList){
|
|
|
- if(i.getConceptCommon()!=null){
|
|
|
- if(i.getConceptId()!=null&&conceptCommonMap!=null&&conceptCommonMap.containsKey(i.getConceptId())){
|
|
|
- i.getConceptCommon().setId(conceptCommonMap.get(i.getConceptId()).getId());
|
|
|
- }
|
|
|
- i.getConceptCommon().setConceptId(i.getConcept().getId());
|
|
|
- saveOrUpdateConceptCommonList.add(i.getConceptCommon());
|
|
|
- }
|
|
|
+ for (AddConceptInfoVO i : addConceptInfoVOList) {
|
|
|
+ if (i.getConceptCommon() != null) {
|
|
|
+ if (i.getConceptId() != null && conceptCommonMap != null && conceptCommonMap.containsKey(i.getConceptId())) {
|
|
|
+ i.getConceptCommon().setId(conceptCommonMap.get(i.getConceptId()).getId());
|
|
|
+ }
|
|
|
+ i.getConceptCommon().setConceptId(i.getConcept().getId());
|
|
|
+ saveOrUpdateConceptCommonList.add(i.getConceptCommon());
|
|
|
+ }
|
|
|
}
|
|
|
- if(ListUtil.isNotEmpty(saveOrUpdateConceptCommonList)){
|
|
|
- conceptCommonService.saveOrUpdateBatch(saveOrUpdateConceptCommonList);
|
|
|
+ if (ListUtil.isNotEmpty(saveOrUpdateConceptCommonList)) {
|
|
|
+ conceptCommonService.saveOrUpdateBatch(saveOrUpdateConceptCommonList);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@SuppressWarnings("deprecation")
|
|
|
private String getValue(Cell cell) {
|
|
|
try {
|
|
@@ -1277,11 +1306,11 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
}
|
|
|
List<List<LibraryInfo>> listList = SqlExecuteUtil.divideList(list, 200);
|
|
|
int i = 0;
|
|
|
- for (List<LibraryInfo> libraryInfoList : listList){
|
|
|
+ for (List<LibraryInfo> libraryInfoList : listList) {
|
|
|
res = libraryInfoService.updateBatchById(libraryInfoList);
|
|
|
i++;
|
|
|
}
|
|
|
- System.out.println("批量更新拼音"+ i +"次!");
|
|
|
+ System.out.println("批量更新拼音" + i + "次!");
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
@@ -1292,7 +1321,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
* @param getConceptPacInfosVO
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<ConceptBaseDTO> getConceptPacInfos(GetConceptPacInfosVO getConceptPacInfosVO){
|
|
|
+ public List<ConceptBaseDTO> getConceptPacInfos(GetConceptPacInfosVO getConceptPacInfosVO) {
|
|
|
QueryWrapper<Concept> conceptQueryWrapper = new QueryWrapper<>();
|
|
|
conceptQueryWrapper.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
.eq("lib_type", LexiconTypeEnum.PACS_ITEMS.getKey())
|
|
@@ -1309,4 +1338,87 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除缓存(化验相关)
|
|
|
+ *
|
|
|
+ * @param conceptId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Boolean cacheClearByConceptId(Long conceptId) {
|
|
|
+ Concept concept = this.getById(conceptId);
|
|
|
+ List<String> names = Lists.newArrayList();
|
|
|
+ names.add(concept.getLibName());
|
|
|
+ List<String> mealNames = Lists.newArrayList();
|
|
|
+ if (concept.getLibType().equals(Long.valueOf(LexiconTypeEnum.LIS_TABLES.getKey()))) {
|
|
|
+ mealNames = lisMappingFacade.getMealNameByUniqueNames(names);
|
|
|
+ } else if (concept.getLibType().equals(Long.valueOf(LexiconTypeEnum.LIS_PACKAGE.getKey()))) {
|
|
|
+ mealNames.add(concept.getLibName());
|
|
|
+ } else if (concept.getLibType().equals(Long.valueOf(LexiconTypeEnum.LIS_DETAILS.getKey()))) {
|
|
|
+ mealNames = lisMappingFacade.getMealNameByItemNames(names);
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ if (ListUtil.isNotEmpty(mealNames)) {
|
|
|
+ KLQuestionVO klQuestionVO = new KLQuestionVO();
|
|
|
+ klQuestionVO.setTagNames(mealNames);
|
|
|
+ klQuestionVO.setNames(mealNames);
|
|
|
+ klQuestionVO.setType(5);
|
|
|
+ List<Integer> tagTypes = Lists.newArrayList();
|
|
|
+ tagTypes.add(7);
|
|
|
+ klQuestionVO.setTagType(tagTypes);
|
|
|
+ RespDTO<List<QuestionInfo>> respDTO = icssManServiceClient.indexForkl(klQuestionVO);
|
|
|
+ if (RespDTOUtil.respIsOK(respDTO)) {
|
|
|
+ List<QuestionInfo> questionInfoList = respDTO.data;
|
|
|
+ if (ListUtil.isNotEmpty(questionInfoList)) {
|
|
|
+ IdListVO idListVO = new IdListVO();
|
|
|
+ List<Long> idList = questionInfoList.stream().map(i -> i.getId()).collect(Collectors.toList());
|
|
|
+ idListVO.setIdList(idList);
|
|
|
+ RespDTO<Boolean> cacheRespDTO = icssManServiceClient.clearCache(idListVO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 批量删除化验相关标签缓存
|
|
|
+ *
|
|
|
+ * @param conceptIds
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public Boolean cacheClearByConceptIds(List<Long> conceptIds) {
|
|
|
+ List<Concept> concepts = this.getListByIds(conceptIds);
|
|
|
+ List<String> mealNames = Lists.newArrayList();
|
|
|
+ List<Concept> mealConcepts = concepts.stream().filter(i -> i.getLibType().equals(Long.valueOf(LexiconTypeEnum.LIS_PACKAGE.getKey()))).collect(Collectors.toList());
|
|
|
+ mealNames.addAll(mealConcepts.stream().map(i -> i.getLibName()).filter(j -> j != null).distinct().collect(Collectors.toList()));
|
|
|
+ List<Concept> itemConcepts = concepts.stream().filter(i -> i.getLibType().equals(Long.valueOf(LexiconTypeEnum.LIS_DETAILS.getKey()))).collect(Collectors.toList());
|
|
|
+ List<String> itemNames = itemConcepts.stream().map(i -> i.getLibName()).filter(j -> j != null).distinct().collect(Collectors.toList());
|
|
|
+ mealNames.addAll(lisMappingFacade.getMealNameByItemNames(itemNames));
|
|
|
+ List<Concept> uniqueConcepts = concepts.stream().filter(i -> i.getLibType().equals(Long.valueOf(LexiconTypeEnum.LIS_TABLES.getKey()))).collect(Collectors.toList());
|
|
|
+ List<String> uniqueNames = uniqueConcepts.stream().map(i -> i.getLibName()).filter(j -> j != null).distinct().collect(Collectors.toList());
|
|
|
+ mealNames.addAll(lisMappingFacade.getMealNameByUniqueNames(uniqueNames));
|
|
|
+ mealNames = mealNames.stream().filter(i -> StringUtil.isNotBlank(i)).distinct().collect(Collectors.toList());
|
|
|
+
|
|
|
+ if (ListUtil.isNotEmpty(mealNames)) {
|
|
|
+ KLQuestionVO klQuestionVO = new KLQuestionVO();
|
|
|
+ klQuestionVO.setTagNames(mealNames);
|
|
|
+ klQuestionVO.setNames(mealNames);
|
|
|
+ klQuestionVO.setType(5);
|
|
|
+ List<Integer> tagTypes = Lists.newArrayList();
|
|
|
+ tagTypes.add(7);
|
|
|
+ klQuestionVO.setTagType(tagTypes);
|
|
|
+ RespDTO<List<QuestionInfo>> respDTO = icssManServiceClient.indexForkl(klQuestionVO);
|
|
|
+ if (RespDTOUtil.respIsOK(respDTO)) {
|
|
|
+ List<QuestionInfo> questionInfoList = respDTO.data;
|
|
|
+ if (ListUtil.isNotEmpty(questionInfoList)) {
|
|
|
+ IdListVO idListVO = new IdListVO();
|
|
|
+ List<Long> idList = questionInfoList.stream().map(i -> i.getId()).collect(Collectors.toList());
|
|
|
+ idListVO.setIdList(idList);
|
|
|
+ RespDTO<Boolean> cacheRespDTO = icssManServiceClient.clearCache(idListVO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+}
|