|
@@ -32,10 +32,8 @@ import com.diagbot.dto.GetConceptInfoDetailDTO;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
import com.diagbot.entity.Concept;
|
|
|
import com.diagbot.entity.Lexicon;
|
|
|
-import com.diagbot.entity.LibraryDetail;
|
|
|
import com.diagbot.entity.LibraryInfo;
|
|
|
import com.diagbot.entity.Medical;
|
|
|
-import com.diagbot.entity.Relation;
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
|
import com.diagbot.exception.CommonException;
|
|
|
import com.diagbot.service.LibraryInfoService;
|
|
@@ -62,12 +60,12 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
|
|
|
@Autowired
|
|
|
private LibraryInfoFacade libraryinfoFacade;
|
|
|
- @Autowired
|
|
|
- private LibraryDetailFacade libraryDetailFacade;
|
|
|
+// @Autowired
|
|
|
+// private LibraryDetailFacade libraryDetailFacade;
|
|
|
@Autowired
|
|
|
private MedicalFacade medicalFacade;
|
|
|
- @Autowired
|
|
|
- private RelationFacade relationFacade;
|
|
|
+// @Autowired
|
|
|
+// private RelationFacade relationFacade;
|
|
|
@Autowired
|
|
|
@Qualifier("libraryInfoServiceImpl")
|
|
|
private LibraryInfoService libraryInfoService;
|
|
@@ -244,8 +242,6 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
public Map<String,List<GetConceptInfoDetailDTO>> getConceptInfoDetail(GetConceptInfoDetailVO getConceptInfoDetailVO){
|
|
|
QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<LibraryInfo>();
|
|
|
libraryInfoQe.eq("concept_id", getConceptInfoDetailVO.getConceptId());
|
|
|
- libraryInfoQe.eq("is_deleted", "N");
|
|
|
- libraryInfoQe.orderByAsc("order_no");
|
|
|
List<LibraryInfo> libraryInfoList = libraryinfoFacade.list(libraryInfoQe);
|
|
|
|
|
|
Map<String,List<GetConceptInfoDetailDTO>> retMap = new HashMap<>();
|
|
@@ -263,23 +259,27 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
* @return
|
|
|
*/
|
|
|
public Boolean addConceptInfo(AddConceptInfoVO addConceptInfoVO){
|
|
|
+ String lineNumStr = "";
|
|
|
+ if(addConceptInfoVO.getLineNum()!=null){
|
|
|
+ lineNumStr = "第"+addConceptInfoVO.getLineNum()+"行";
|
|
|
+ }
|
|
|
if(addConceptInfoVO.getDetailList().stream().distinct().count()!=addConceptInfoVO.getDetailList().size()){
|
|
|
- throw new CommonException(CommonErrorCode.RPC_ERROR,"存在重复数据("+addConceptInfoVO.getName()+")");
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,lineNumStr+"存在重复数据!");
|
|
|
}
|
|
|
|
|
|
List<AddConceptInfoDetailVO> addConceptInfoDetailVOMainList = addConceptInfoVO.getDetailList().stream().filter(i->i.getIsConcept()==1).collect(Collectors.toList());
|
|
|
if(addConceptInfoDetailVOMainList.size()==0){
|
|
|
- throw new CommonException(CommonErrorCode.RPC_ERROR,"无标准术语("+addConceptInfoVO.getName()+")");
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,lineNumStr+"无标准术语!");
|
|
|
}
|
|
|
if(addConceptInfoDetailVOMainList.size()>1){
|
|
|
- throw new CommonException(CommonErrorCode.RPC_ERROR,"标准术语只能有一个("+addConceptInfoVO.getName()+")");
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,lineNumStr+"标准术语只能有一个!");
|
|
|
}
|
|
|
|
|
|
QueryWrapper<Lexicon> lexiconQe = new QueryWrapper<>();
|
|
|
lexiconQe.eq("name", addConceptInfoVO.getType());
|
|
|
Lexicon lexicon = lexiconFacade.getOne(lexiconQe);
|
|
|
if(lexicon==null){
|
|
|
- throw new CommonException(CommonErrorCode.RPC_ERROR,"数据有误,该类型信息在数据库中不存在("+addConceptInfoVO.getName()+")");
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,lineNumStr+"数据有误,该类型信息在数据库中不存在!");
|
|
|
}
|
|
|
|
|
|
List<LibraryInfo> saveOrUpdateLibraryInfoList = new ArrayList<>();
|
|
@@ -320,10 +320,11 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
conceptId = concept.getId();
|
|
|
libraryInfoMain.setConceptId(conceptId);
|
|
|
}else{
|
|
|
- if(libraryInfoMain.getIsDeleted().equals("N")&&libraryInfoMain.getIsConcept()==0
|
|
|
- &&(libraryInfoList.stream().filter(i->i.getIsDeleted().equals("N")).count()==1||libraryInfoList.stream().filter(i->i.getIsDeleted().equals("N")).map(i->i.getConceptId()).distinct().count()>1)){
|
|
|
+ //如果标准词之前作为同义词被其他占用的情况
|
|
|
+ if(libraryInfoMain.getIsConcept()==0
|
|
|
+ &&libraryInfoList.stream().map(i->i.getConceptId()).distinct().count()>1
|
|
|
+ &&libraryInfoList.stream().filter(i->i.getIsConcept()==1).count()>=1){
|
|
|
QueryWrapper<LibraryInfo> libraryInfoQe2 = new QueryWrapper<>();
|
|
|
- libraryInfoQe2.eq("is_deleted", "N");
|
|
|
libraryInfoQe2.eq("is_concept", 1);
|
|
|
libraryInfoQe2.eq("concept_id", libraryInfoMain.getConceptId());
|
|
|
LibraryInfo libraryInfo = libraryinfoFacade.getOne(libraryInfoQe2);
|
|
@@ -335,15 +336,12 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
conceptId = libraryInfoMain.getConceptId();
|
|
|
concept.setId(conceptId);
|
|
|
|
|
|
- if(libraryInfoMain.getIsDeleted().equals("Y")
|
|
|
- ||(libraryInfoMain.getIsDeleted().equals("N")&&libraryInfoMain.getIsConcept()==0)
|
|
|
+ if(libraryInfoMain.getIsConcept()==0
|
|
|
||!(StringUtil.isBlank(libraryInfoMain.getRemark())?"":libraryInfoMain.getRemark()).equals((StringUtil.isBlank(addConceptInfoDetailVOMain.getRemark())?"":addConceptInfoDetailVOMain.getRemark()))){
|
|
|
concept.setLibId(libraryInfoMain.getId());
|
|
|
- concept.setIsDeleted("N");
|
|
|
concept.setGmtModified(now);
|
|
|
concept.setModifier(currentUser);
|
|
|
|
|
|
- libraryInfoMain.setIsDeleted("N");
|
|
|
libraryInfoMain.setIsConcept(1);
|
|
|
libraryInfoMain.setGmtModified(now);
|
|
|
libraryInfoMain.setModifier(currentUser);
|
|
@@ -372,10 +370,6 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
libraryInfo.setGmtModified(now);
|
|
|
libraryInfo.setModifier(currentUser);
|
|
|
isUpdateConcept = true;
|
|
|
- }else if(libraryInfo.getIsDeleted().equals("Y")){
|
|
|
- libraryInfo.setGmtModified(now);
|
|
|
- libraryInfo.setModifier(currentUser);
|
|
|
- isUpdateConcept = true;
|
|
|
}else if(libraryInfo.getConceptId().intValue()!=conceptId.intValue()){
|
|
|
sbf.append(i.getName()).append(" ");
|
|
|
continue;
|
|
@@ -387,7 +381,6 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
|
|
|
libraryInfo.setName(i.getName());
|
|
|
libraryInfo.setIsConcept(0);
|
|
|
- libraryInfo.setIsDeleted("N");
|
|
|
libraryInfo.setRemark(i.getRemark());
|
|
|
saveOrUpdateLibraryInfoList.add(libraryInfo);
|
|
|
}
|
|
@@ -477,6 +470,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
}
|
|
|
|
|
|
AddConceptInfoVO addConceptInfoVO = new AddConceptInfoVO();
|
|
|
+ addConceptInfoVO.setLineNum(count);
|
|
|
addConceptInfoVO.setName(libName);
|
|
|
addConceptInfoVO.setType(libType);
|
|
|
List<AddConceptInfoDetailVO> detailList = new ArrayList<>();
|
|
@@ -537,7 +531,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
|
|
|
/****************************导入空文件************************/
|
|
|
if(addConceptInfoVOList.size()==0){
|
|
|
- throw new CommonException(CommonErrorCode.RPC_ERROR,"导入文件内容不能为空!");
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,"导入数据不能为空!");
|
|
|
}
|
|
|
|
|
|
/****************excel文件中所有术语存在重复提示---名字和类型一样即重复***********************/
|
|
@@ -552,7 +546,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
}
|
|
|
}
|
|
|
if(sbf.length()>0){
|
|
|
- sbf.append("(术语存在重复)");
|
|
|
+ sbf.append("数据重复,请修改导入数据!");
|
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
|
|
|
}
|
|
|
|