|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.diagbot.client.UserServiceClient;
|
|
|
import com.diagbot.dto.GetAllForRelationDTO;
|
|
|
import com.diagbot.dto.KlConceptAllDTO;
|
|
|
+import com.diagbot.dto.KlConceptAllSubDTO;
|
|
|
import com.diagbot.dto.KlConceptInfoDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.entity.KlConcept;
|
|
@@ -13,25 +14,32 @@ import com.diagbot.entity.KlConceptCommon;
|
|
|
import com.diagbot.entity.KlDisease;
|
|
|
import com.diagbot.entity.KlLibraryInfo;
|
|
|
import com.diagbot.entity.KlLis;
|
|
|
-import com.diagbot.entity.KlRule;
|
|
|
import com.diagbot.enums.IsDeleteEnum;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.service.KlConceptCommonService;
|
|
|
-import com.diagbot.service.KlDiseaseService;
|
|
|
import com.diagbot.service.KlLisService;
|
|
|
import com.diagbot.service.impl.KlConceptServiceImpl;
|
|
|
+import com.diagbot.util.BeanUtil;
|
|
|
import com.diagbot.util.DateUtil;
|
|
|
import com.diagbot.util.ListUtil;
|
|
|
import com.diagbot.util.RespDTOUtil;
|
|
|
import com.diagbot.util.StringUtil;
|
|
|
import com.diagbot.util.UserUtils;
|
|
|
-import com.diagbot.vo.*;
|
|
|
+import com.diagbot.vo.GetAllForRelationVO;
|
|
|
+import com.diagbot.vo.KlConceptAllVO;
|
|
|
+import com.diagbot.vo.KlConceptClearVO;
|
|
|
+import com.diagbot.vo.KlConceptInfoVO;
|
|
|
+import com.diagbot.vo.KlConceptSatarOrdisaVO;
|
|
|
+import com.diagbot.vo.KlConceptSaveSubVO;
|
|
|
+import com.diagbot.vo.KlConceptSaveVO;
|
|
|
+import com.diagbot.vo.SearchConceptVO;
|
|
|
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 java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -75,8 +83,23 @@ public class KlConceptFacade extends KlConceptServiceImpl {
|
|
|
* @param klConceptAllVO
|
|
|
* @return
|
|
|
*/
|
|
|
- public List<KlConceptAllDTO> getConceptAlls(KlConceptAllVO klConceptAllVO) {
|
|
|
- return getConceptAll(klConceptAllVO);
|
|
|
+ public KlConceptAllDTO getConceptAlls(KlConceptAllVO klConceptAllVO) {
|
|
|
+ List<KlConceptAllDTO> conceptAll = getConceptAll(klConceptAllVO);
|
|
|
+ KlConceptAllDTO klConceptAll = new KlConceptAllDTO();
|
|
|
+ List<KlConceptAllSubDTO> klConceptSub = new ArrayList<>();
|
|
|
+ if (ListUtil.isNotEmpty(conceptAll)) {
|
|
|
+ for (KlConceptAllDTO data : conceptAll) {
|
|
|
+ if (data.getIsConcept().equals(1)) {
|
|
|
+ BeanUtil.copyProperties(data, klConceptAll);
|
|
|
+ } else {
|
|
|
+ KlConceptAllSubDTO klConceptAllSubDTO = new KlConceptAllSubDTO();
|
|
|
+ BeanUtil.copyProperties(data, klConceptAllSubDTO);
|
|
|
+ klConceptSub.add(klConceptAllSubDTO);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ klConceptAll.setKlConceptSub(klConceptSub);
|
|
|
+ return klConceptAll;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -290,19 +313,19 @@ public class KlConceptFacade extends KlConceptServiceImpl {
|
|
|
return retList;
|
|
|
}
|
|
|
|
|
|
- public List<GetAllForRelationDTO> searchConceptByNameAndLibType(SearchConceptVO searchConceptVO){
|
|
|
+ public List<GetAllForRelationDTO> searchConceptByNameAndLibType(SearchConceptVO searchConceptVO) {
|
|
|
List<GetAllForRelationDTO> getAllForRelationDTOS = Lists.newArrayList();
|
|
|
String name = searchConceptVO.getName();
|
|
|
List<Integer> libTypes = searchConceptVO.getLibTypes();
|
|
|
List<Long> excludedConceptIds = searchConceptVO.getExcludedConceptIds();
|
|
|
- if(StringUtils.isNotBlank(name) || ListUtil.isNotEmpty(libTypes) ){
|
|
|
+ if (StringUtils.isNotBlank(name) || ListUtil.isNotEmpty(libTypes)) {
|
|
|
List<KlConcept> conceptList = this.list(new QueryWrapper<KlConcept>()
|
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .like(StringUtil.isNotBlank(name),"lib_name",name.trim())
|
|
|
- .in(ListUtil.isNotEmpty(libTypes),"lib_type",libTypes)
|
|
|
- .notIn(ListUtil.isNotEmpty(excludedConceptIds),"id",excludedConceptIds));
|
|
|
- if(ListUtil.isNotEmpty(conceptList)){
|
|
|
- getAllForRelationDTOS = conceptList.stream().map(x ->{
|
|
|
+ .like(StringUtil.isNotBlank(name), "lib_name", name.trim())
|
|
|
+ .in(ListUtil.isNotEmpty(libTypes), "lib_type", libTypes)
|
|
|
+ .notIn(ListUtil.isNotEmpty(excludedConceptIds), "id", excludedConceptIds));
|
|
|
+ if (ListUtil.isNotEmpty(conceptList)) {
|
|
|
+ getAllForRelationDTOS = conceptList.stream().map(x -> {
|
|
|
GetAllForRelationDTO getAllForRelationDTO = new GetAllForRelationDTO();
|
|
|
getAllForRelationDTO.setConceptNameType(x.getLibName());
|
|
|
getAllForRelationDTO.setConceptName(x.getLibName());
|
|
@@ -335,13 +358,13 @@ public class KlConceptFacade extends KlConceptServiceImpl {
|
|
|
public Boolean clearConceptInfo(KlConceptClearVO klConceptClearVO) {
|
|
|
Date now = DateUtil.now();
|
|
|
int sum = klLibraryInfoFacade.count(new QueryWrapper<KlLibraryInfo>().eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("id", klConceptClearVO.getLibId()).eq("is_concept",0));
|
|
|
+ .eq("id", klConceptClearVO.getLibId()).eq("is_concept", 0));
|
|
|
if (sum == 0) {
|
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该数据已不存在或删除的不是同义词!");
|
|
|
}
|
|
|
UpdateWrapper<KlLibraryInfo> klLibraryUpdate = new UpdateWrapper<>();
|
|
|
klLibraryUpdate.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("id", klConceptClearVO.getLibId()).set("is_deleted",IsDeleteEnum.Y.getKey()).set("gmt_modified",now);
|
|
|
+ .eq("id", klConceptClearVO.getLibId()).set("is_deleted", IsDeleteEnum.Y.getKey()).set("gmt_modified", now);
|
|
|
return klLibraryInfoFacade.update(klLibraryUpdate);
|
|
|
}
|
|
|
|
|
@@ -354,7 +377,7 @@ public class KlConceptFacade extends KlConceptServiceImpl {
|
|
|
}
|
|
|
UpdateWrapper<KlConcept> klLibraryUpdate = new UpdateWrapper<>();
|
|
|
klLibraryUpdate.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
|
- .eq("id", klConceptSatarOrdisaVO.getConceptId()).set("status",status).set("gmt_modified",now);
|
|
|
+ .eq("id", klConceptSatarOrdisaVO.getConceptId()).set("status", status).set("gmt_modified", now);
|
|
|
return this.update(klLibraryUpdate);
|
|
|
|
|
|
}
|