|
@@ -31,10 +31,9 @@ import com.diagbot.dto.GetAllLisConceptDTO;
|
|
import com.diagbot.dto.GetConceptInfoDetailDTO;
|
|
import com.diagbot.dto.GetConceptInfoDetailDTO;
|
|
import com.diagbot.dto.RespDTO;
|
|
import com.diagbot.dto.RespDTO;
|
|
import com.diagbot.entity.Concept;
|
|
import com.diagbot.entity.Concept;
|
|
-import com.diagbot.entity.LibraryDetail;
|
|
|
|
|
|
+import com.diagbot.entity.Lexicon;
|
|
import com.diagbot.entity.LibraryInfo;
|
|
import com.diagbot.entity.LibraryInfo;
|
|
import com.diagbot.entity.Medical;
|
|
import com.diagbot.entity.Medical;
|
|
-import com.diagbot.entity.Relation;
|
|
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonErrorCode;
|
|
import com.diagbot.exception.CommonException;
|
|
import com.diagbot.exception.CommonException;
|
|
import com.diagbot.service.LibraryInfoService;
|
|
import com.diagbot.service.LibraryInfoService;
|
|
@@ -61,17 +60,19 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private LibraryInfoFacade libraryinfoFacade;
|
|
private LibraryInfoFacade libraryinfoFacade;
|
|
- @Autowired
|
|
|
|
- private LibraryDetailFacade libraryDetailFacade;
|
|
|
|
|
|
+// @Autowired
|
|
|
|
+// private LibraryDetailFacade libraryDetailFacade;
|
|
@Autowired
|
|
@Autowired
|
|
private MedicalFacade medicalFacade;
|
|
private MedicalFacade medicalFacade;
|
|
- @Autowired
|
|
|
|
- private RelationFacade relationFacade;
|
|
|
|
|
|
+// @Autowired
|
|
|
|
+// private RelationFacade relationFacade;
|
|
@Autowired
|
|
@Autowired
|
|
@Qualifier("libraryInfoServiceImpl")
|
|
@Qualifier("libraryInfoServiceImpl")
|
|
private LibraryInfoService libraryInfoService;
|
|
private LibraryInfoService libraryInfoService;
|
|
@Autowired
|
|
@Autowired
|
|
private UserServiceClient userServiceClient;
|
|
private UserServiceClient userServiceClient;
|
|
|
|
+ @Autowired
|
|
|
|
+ private LexiconFacade lexiconFacade;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取所有化验公表项
|
|
* 获取所有化验公表项
|
|
@@ -157,12 +158,12 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 医学术语命名删除
|
|
|
|
|
|
+ * 医学术语命名删除或者恢复
|
|
* @param removeConceptInfoVO
|
|
* @param removeConceptInfoVO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public Boolean removeConceptInfo(RemoveConceptInfoVO removeConceptInfoVO) {
|
|
public Boolean removeConceptInfo(RemoveConceptInfoVO removeConceptInfoVO) {
|
|
- StringBuffer sbf = new StringBuffer();
|
|
|
|
|
|
+ /*StringBuffer sbf = new StringBuffer();
|
|
|
|
|
|
QueryWrapper<Medical> medicalQe = new QueryWrapper<Medical>();
|
|
QueryWrapper<Medical> medicalQe = new QueryWrapper<Medical>();
|
|
medicalQe.eq("is_deleted", "N");
|
|
medicalQe.eq("is_deleted", "N");
|
|
@@ -187,12 +188,12 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
|
|
|
if(sbf.length()>0){
|
|
if(sbf.length()>0){
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
String currentUser = UserUtils.getCurrentPrincipleID();
|
|
String currentUser = UserUtils.getCurrentPrincipleID();
|
|
Date now = DateUtil.now();
|
|
Date now = DateUtil.now();
|
|
|
|
|
|
- QueryWrapper<LibraryInfo> libraryInfoQe1 = new QueryWrapper<>();
|
|
|
|
|
|
+ /*QueryWrapper<LibraryInfo> libraryInfoQe1 = new QueryWrapper<>();
|
|
libraryInfoQe1.eq("concept_id", removeConceptInfoVO.getConceptId());
|
|
libraryInfoQe1.eq("concept_id", removeConceptInfoVO.getConceptId());
|
|
libraryInfoQe1.eq("is_concept", 0);
|
|
libraryInfoQe1.eq("is_concept", 0);
|
|
libraryinfoFacade.remove(libraryInfoQe1);
|
|
libraryinfoFacade.remove(libraryInfoQe1);
|
|
@@ -203,13 +204,31 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
libraryInfo.setIsDeleted("Y");
|
|
libraryInfo.setIsDeleted("Y");
|
|
libraryInfo.setGmtModified(now);
|
|
libraryInfo.setGmtModified(now);
|
|
libraryInfo.setModifier(currentUser);
|
|
libraryInfo.setModifier(currentUser);
|
|
- libraryinfoFacade.update(libraryInfo, libraryInfoQe2);
|
|
|
|
-
|
|
|
|
- Concept concept = new Concept();
|
|
|
|
|
|
+ libraryinfoFacade.update(libraryInfo, libraryInfoQe2);*/
|
|
|
|
+
|
|
|
|
+ /*Concept concept = new Concept();
|
|
concept.setId(removeConceptInfoVO.getConceptId());
|
|
concept.setId(removeConceptInfoVO.getConceptId());
|
|
concept.setIsDeleted("Y");
|
|
concept.setIsDeleted("Y");
|
|
concept.setModifier(currentUser);
|
|
concept.setModifier(currentUser);
|
|
concept.setGmtModified(now);
|
|
concept.setGmtModified(now);
|
|
|
|
+ this.updateById(concept);*/
|
|
|
|
+
|
|
|
|
+ Concept concept = this.getById(removeConceptInfoVO.getConceptId());
|
|
|
|
+ if(concept==null){
|
|
|
|
+ throw new CommonException(CommonErrorCode.NOT_EXISTS);
|
|
|
|
+ }
|
|
|
|
+ if(concept.getIsDeleted().equals(removeConceptInfoVO.getIsDeleted())){
|
|
|
|
+ if(removeConceptInfoVO.getIsDeleted().equals("Y")){
|
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,"该数据已删除!");
|
|
|
|
+ }
|
|
|
|
+ if(removeConceptInfoVO.getIsDeleted().equals("N")){
|
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,"该数据已恢复!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ concept.setIsDeleted(removeConceptInfoVO.getIsDeleted());
|
|
|
|
+ concept.setModifier(currentUser);
|
|
|
|
+ concept.setGmtModified(now);
|
|
this.updateById(concept);
|
|
this.updateById(concept);
|
|
|
|
|
|
return true;
|
|
return true;
|
|
@@ -223,8 +242,6 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
public Map<String,List<GetConceptInfoDetailDTO>> getConceptInfoDetail(GetConceptInfoDetailVO getConceptInfoDetailVO){
|
|
public Map<String,List<GetConceptInfoDetailDTO>> getConceptInfoDetail(GetConceptInfoDetailVO getConceptInfoDetailVO){
|
|
QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<LibraryInfo>();
|
|
QueryWrapper<LibraryInfo> libraryInfoQe = new QueryWrapper<LibraryInfo>();
|
|
libraryInfoQe.eq("concept_id", getConceptInfoDetailVO.getConceptId());
|
|
libraryInfoQe.eq("concept_id", getConceptInfoDetailVO.getConceptId());
|
|
- libraryInfoQe.eq("is_deleted", "N");
|
|
|
|
- libraryInfoQe.orderByAsc("order_no");
|
|
|
|
List<LibraryInfo> libraryInfoList = libraryinfoFacade.list(libraryInfoQe);
|
|
List<LibraryInfo> libraryInfoList = libraryinfoFacade.list(libraryInfoQe);
|
|
|
|
|
|
Map<String,List<GetConceptInfoDetailDTO>> retMap = new HashMap<>();
|
|
Map<String,List<GetConceptInfoDetailDTO>> retMap = new HashMap<>();
|
|
@@ -236,22 +253,31 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
|
|
|
/**
|
|
/**
|
|
* 医学术语命名添加或者编辑
|
|
* 医学术语命名添加或者编辑
|
|
- * 说明:1、不允许单个非标准术语添加
|
|
|
|
- *
|
|
|
|
* @param addConceptInfoVO
|
|
* @param addConceptInfoVO
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
public Boolean addConceptInfo(AddConceptInfoVO addConceptInfoVO){
|
|
public Boolean addConceptInfo(AddConceptInfoVO addConceptInfoVO){
|
|
|
|
+ String lineNumStr = "";
|
|
|
|
+ if(addConceptInfoVO.getLineNum()!=null){
|
|
|
|
+ lineNumStr = "第"+addConceptInfoVO.getLineNum()+"行";
|
|
|
|
+ }
|
|
if(addConceptInfoVO.getDetailList().stream().distinct().count()!=addConceptInfoVO.getDetailList().size()){
|
|
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());
|
|
List<AddConceptInfoDetailVO> addConceptInfoDetailVOMainList = addConceptInfoVO.getDetailList().stream().filter(i->i.getIsConcept()==1).collect(Collectors.toList());
|
|
if(addConceptInfoDetailVOMainList.size()==0){
|
|
if(addConceptInfoDetailVOMainList.size()==0){
|
|
- throw new CommonException(CommonErrorCode.RPC_ERROR,"无标准术语("+addConceptInfoVO.getName()+")");
|
|
|
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,lineNumStr+"无标准术语!");
|
|
}
|
|
}
|
|
if(addConceptInfoDetailVOMainList.size()>1){
|
|
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,lineNumStr+"数据有误,该类型信息在数据库中不存在!");
|
|
}
|
|
}
|
|
|
|
|
|
List<LibraryInfo> saveOrUpdateLibraryInfoList = new ArrayList<>();
|
|
List<LibraryInfo> saveOrUpdateLibraryInfoList = new ArrayList<>();
|
|
@@ -271,65 +297,47 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
LibraryInfo libraryInfoMain = libraryInfoMap.get(addConceptInfoDetailVOMain.getName());
|
|
LibraryInfo libraryInfoMain = libraryInfoMap.get(addConceptInfoDetailVOMain.getName());
|
|
Concept concept = new Concept();
|
|
Concept concept = new Concept();
|
|
Long conceptId = null;
|
|
Long conceptId = null;
|
|
- int oldlibraryInfoCount = 0;
|
|
|
|
- boolean isUpdateConcept = false;
|
|
|
|
if(libraryInfoMain==null){
|
|
if(libraryInfoMain==null){
|
|
libraryInfoMain = new LibraryInfo();
|
|
libraryInfoMain = new LibraryInfo();
|
|
BeanUtil.copyProperties(addConceptInfoDetailVOMain, libraryInfoMain);
|
|
BeanUtil.copyProperties(addConceptInfoDetailVOMain, libraryInfoMain);
|
|
libraryInfoMain.setGmtCreated(now);
|
|
libraryInfoMain.setGmtCreated(now);
|
|
libraryInfoMain.setCreator(currentUser);
|
|
libraryInfoMain.setCreator(currentUser);
|
|
- libraryInfoMain.setGmtModified(now);
|
|
|
|
- libraryInfoMain.setModifier(currentUser);
|
|
|
|
libraryInfoMain.setType(addConceptInfoVO.getType());
|
|
libraryInfoMain.setType(addConceptInfoVO.getType());
|
|
|
|
+ libraryInfoMain.setTypeId(lexicon.getId());
|
|
libraryinfoFacade.save(libraryInfoMain);
|
|
libraryinfoFacade.save(libraryInfoMain);
|
|
concept.setLibId(libraryInfoMain.getId());
|
|
concept.setLibId(libraryInfoMain.getId());
|
|
concept.setGmtCreated(now);
|
|
concept.setGmtCreated(now);
|
|
concept.setCreator(currentUser);
|
|
concept.setCreator(currentUser);
|
|
- concept.setGmtModified(now);
|
|
|
|
- concept.setModifier(currentUser);
|
|
|
|
- save(concept);
|
|
|
|
|
|
+ concept.setId(addConceptInfoVO.getConceptId());
|
|
|
|
+ saveOrUpdate(concept);
|
|
conceptId = concept.getId();
|
|
conceptId = concept.getId();
|
|
- libraryInfoMain.setConceptId(conceptId);
|
|
|
|
}else{
|
|
}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)){
|
|
|
|
- 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);
|
|
|
|
- if(libraryInfo!=null){
|
|
|
|
- throw new CommonException(CommonErrorCode.RPC_ERROR,"标准术语已作为同义词被概念"+libraryInfo.getName()+"-"+libraryInfo.getType()+"占用");
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
conceptId = libraryInfoMain.getConceptId();
|
|
conceptId = libraryInfoMain.getConceptId();
|
|
- concept.setId(conceptId);
|
|
|
|
-
|
|
|
|
- if(libraryInfoMain.getIsDeleted().equals("Y")
|
|
|
|
- ||(libraryInfoMain.getIsDeleted().equals("N")&&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);
|
|
|
|
- libraryInfoMain.setRemark(addConceptInfoDetailVOMain.getRemark());
|
|
|
|
-
|
|
|
|
- isUpdateConcept = true;
|
|
|
|
- }
|
|
|
|
|
|
+ int ckConceptId = conceptId.intValue();
|
|
|
|
+ concept = getById(conceptId);
|
|
|
|
|
|
- QueryWrapper<LibraryInfo> libraryInfoQe2 = new QueryWrapper<>();
|
|
|
|
- libraryInfoQe2.eq("concept_id", conceptId);
|
|
|
|
- libraryInfoQe2.ne("id", libraryInfoMain.getId());
|
|
|
|
- oldlibraryInfoCount = libraryinfoFacade.count(libraryInfoQe2);
|
|
|
|
- libraryinfoFacade.remove(libraryInfoQe2);
|
|
|
|
|
|
+ //如果标准词之前作为同义词被其他占用的情况
|
|
|
|
+ if(libraryInfoMain.getIsConcept()==1){
|
|
|
|
+ //新增操作时,已经建立的标准词提示
|
|
|
|
+ if(addConceptInfoVO.getLineNum()==null&&addConceptInfoVO.getConceptId()==null){
|
|
|
|
+ if(concept.getIsDeleted().equals("N")){
|
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,"该数据已经建立!");
|
|
|
|
+ }else{
|
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,"该数据已经建立且处于已删除状态,可前往列表中恢复该条数据!");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else if(addConceptInfoVO.getLineNum()==null&&addConceptInfoVO.getConceptId()==null&&concept!=null
|
|
|
|
+ ||libraryInfoList.stream().filter(i->i.getConceptId().intValue()==ckConceptId).count()==1){
|
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,lineNumStr+"标准术语已作为同义词被占用!");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //先删除概念下的同义词,后续再插入
|
|
|
|
+ QueryWrapper<LibraryInfo> libraryInfoQe2 = new QueryWrapper<>();
|
|
|
|
+ libraryInfoQe2.eq("concept_id", conceptId);
|
|
|
|
+ libraryInfoQe2.ne("id", libraryInfoMain.getId());
|
|
|
|
+ libraryinfoFacade.remove(libraryInfoQe2);
|
|
|
|
+
|
|
StringBuffer sbf = new StringBuffer();
|
|
StringBuffer sbf = new StringBuffer();
|
|
for(AddConceptInfoDetailVO i:addConceptInfoVO.getDetailList()){
|
|
for(AddConceptInfoDetailVO i:addConceptInfoVO.getDetailList()){
|
|
if(i.getIsConcept()==1){
|
|
if(i.getIsConcept()==1){
|
|
@@ -340,25 +348,15 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
libraryInfo = new LibraryInfo();
|
|
libraryInfo = new LibraryInfo();
|
|
libraryInfo.setGmtCreated(now);
|
|
libraryInfo.setGmtCreated(now);
|
|
libraryInfo.setCreator(currentUser);
|
|
libraryInfo.setCreator(currentUser);
|
|
- 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()){
|
|
}else if(libraryInfo.getConceptId().intValue()!=conceptId.intValue()){
|
|
sbf.append(i.getName()).append(" ");
|
|
sbf.append(i.getName()).append(" ");
|
|
continue;
|
|
continue;
|
|
- }else if(!(StringUtil.isBlank(i.getRemark())?"":i.getRemark()).equals((StringUtil.isBlank(libraryInfo.getRemark())?"":libraryInfo.getRemark()))){
|
|
|
|
- libraryInfo.setGmtModified(now);
|
|
|
|
- libraryInfo.setModifier(currentUser);
|
|
|
|
- isUpdateConcept = true;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ libraryInfo.setGmtModified(now);
|
|
|
|
+ libraryInfo.setModifier(currentUser);
|
|
libraryInfo.setName(i.getName());
|
|
libraryInfo.setName(i.getName());
|
|
libraryInfo.setIsConcept(0);
|
|
libraryInfo.setIsConcept(0);
|
|
- libraryInfo.setIsDeleted("N");
|
|
|
|
libraryInfo.setRemark(i.getRemark());
|
|
libraryInfo.setRemark(i.getRemark());
|
|
saveOrUpdateLibraryInfoList.add(libraryInfo);
|
|
saveOrUpdateLibraryInfoList.add(libraryInfo);
|
|
}
|
|
}
|
|
@@ -368,29 +366,30 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
|
|
}
|
|
}
|
|
|
|
|
|
- //更新前后同义词个数不一样,修改更新时间
|
|
|
|
- if(oldlibraryInfoCount!=saveOrUpdateLibraryInfoList.size()){
|
|
|
|
- isUpdateConcept = true;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
for(LibraryInfo i : saveOrUpdateLibraryInfoList){
|
|
for(LibraryInfo i : saveOrUpdateLibraryInfoList){
|
|
i.setId(null);
|
|
i.setId(null);
|
|
i.setConceptId(conceptId);
|
|
i.setConceptId(conceptId);
|
|
i.setType(addConceptInfoVO.getType());
|
|
i.setType(addConceptInfoVO.getType());
|
|
|
|
+ i.setTypeId(lexicon.getId());
|
|
}
|
|
}
|
|
|
|
+ libraryInfoMain.setIsConcept(1);
|
|
|
|
+ libraryInfoMain.setRemark(addConceptInfoDetailVOMain.getRemark());
|
|
|
|
+ libraryInfoMain.setConceptId(conceptId);
|
|
|
|
+ libraryInfoMain.setGmtModified(now);
|
|
|
|
+ libraryInfoMain.setModifier(currentUser);
|
|
saveOrUpdateLibraryInfoList.add(libraryInfoMain);
|
|
saveOrUpdateLibraryInfoList.add(libraryInfoMain);
|
|
|
|
|
|
libraryInfoService.saveOrUpdateBatch(saveOrUpdateLibraryInfoList);
|
|
libraryInfoService.saveOrUpdateBatch(saveOrUpdateLibraryInfoList);
|
|
|
|
|
|
- if(isUpdateConcept){
|
|
|
|
- concept.setGmtModified(now);
|
|
|
|
- concept.setModifier(currentUser);
|
|
|
|
- updateById(concept);
|
|
|
|
- }
|
|
|
|
|
|
+ concept.setId(conceptId);
|
|
|
|
+ concept.setLibId(libraryInfoMain.getId());
|
|
|
|
+ concept.setGmtModified(now);
|
|
|
|
+ concept.setModifier(currentUser);
|
|
|
|
+ updateById(concept);
|
|
|
|
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 医学术语命名excel文件导入
|
|
* 医学术语命名excel文件导入
|
|
* @param file
|
|
* @param file
|
|
@@ -401,6 +400,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
StringBuffer sbf = new StringBuffer();
|
|
StringBuffer sbf = new StringBuffer();
|
|
InputStream inputStream = null;
|
|
InputStream inputStream = null;
|
|
Workbook wb = null;
|
|
Workbook wb = null;
|
|
|
|
+ String title_1="",title_2="",title_3="",title_4="";
|
|
try {
|
|
try {
|
|
if (!file.isEmpty()) {
|
|
if (!file.isEmpty()) {
|
|
inputStream = file.getInputStream();
|
|
inputStream = file.getInputStream();
|
|
@@ -420,9 +420,17 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
Sheet sheet = wb.getSheetAt(0);
|
|
Sheet sheet = wb.getSheetAt(0);
|
|
int count = 0;
|
|
int count = 0;
|
|
String libName, libType, otherNames, remark;
|
|
String libName, libType, otherNames, remark;
|
|
|
|
+ String regEx="[0-9]+|[`~·!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]+";
|
|
for (Row row : sheet) {
|
|
for (Row row : sheet) {
|
|
count++;
|
|
count++;
|
|
- if (count == 1 || row == null) {
|
|
|
|
|
|
+ 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;
|
|
continue;
|
|
}
|
|
}
|
|
libName = getValue(row.getCell(0)).trim().replace(" ", "");
|
|
libName = getValue(row.getCell(0)).trim().replace(" ", "");
|
|
@@ -437,8 +445,13 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
sbf.append("第" + count + "行数据不完整;").append("<br/>");
|
|
sbf.append("第" + count + "行数据不完整;").append("<br/>");
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
+ if(StringUtil.isNotEmpty(remark)&&remark.length()>120){
|
|
|
|
+ sbf.append("第" + count + "行导入错误,说明最大可输入120个字;").append("<br/>");
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
|
|
AddConceptInfoVO addConceptInfoVO = new AddConceptInfoVO();
|
|
AddConceptInfoVO addConceptInfoVO = new AddConceptInfoVO();
|
|
|
|
+ addConceptInfoVO.setLineNum(count);
|
|
addConceptInfoVO.setName(libName);
|
|
addConceptInfoVO.setName(libName);
|
|
addConceptInfoVO.setType(libType);
|
|
addConceptInfoVO.setType(libType);
|
|
List<AddConceptInfoDetailVO> detailList = new ArrayList<>();
|
|
List<AddConceptInfoDetailVO> detailList = new ArrayList<>();
|
|
@@ -446,6 +459,14 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
if(StringUtil.isBlank(nm)){
|
|
if(StringUtil.isBlank(nm)){
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
+ if(nm.matches(regEx)){
|
|
|
|
+ sbf.append("第" + count + "行无法导入,导入数据无法为纯数字或纯特殊字符;").append("<br/>");
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ if(nm.length()>30){
|
|
|
|
+ sbf.append("第" + count + "行导入错误,标准词和同义词最大字数不可超过30个字;").append("<br/>");
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
AddConceptInfoDetailVO addConceptInfoDetailVO = new AddConceptInfoDetailVO();
|
|
AddConceptInfoDetailVO addConceptInfoDetailVO = new AddConceptInfoDetailVO();
|
|
addConceptInfoDetailVO.setName(nm);
|
|
addConceptInfoDetailVO.setName(nm);
|
|
addConceptInfoDetailVO.setType(libType);
|
|
addConceptInfoDetailVO.setType(libType);
|
|
@@ -489,6 +510,19 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
|
|
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,"导入数据不正确,请选择正确数据导入!");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /****************************导入空文件************************/
|
|
|
|
+ if(addConceptInfoVOList.size()==0){
|
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,"导入数据不能为空!");
|
|
|
|
+ }
|
|
|
|
+
|
|
/****************excel文件中所有术语存在重复提示---名字和类型一样即重复***********************/
|
|
/****************excel文件中所有术语存在重复提示---名字和类型一样即重复***********************/
|
|
List<AddConceptInfoDetailVO> addConceptInfoDetailVOList = new ArrayList<>();
|
|
List<AddConceptInfoDetailVO> addConceptInfoDetailVOList = new ArrayList<>();
|
|
addConceptInfoVOList.forEach(i->{
|
|
addConceptInfoVOList.forEach(i->{
|
|
@@ -501,10 +535,10 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if(sbf.length()>0){
|
|
if(sbf.length()>0){
|
|
- sbf.append("(术语存在重复)");
|
|
|
|
|
|
+ sbf.append("数据重复,请修改导入数据!");
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
addConceptInfoVOList.forEach(i->{
|
|
addConceptInfoVOList.forEach(i->{
|
|
addConceptInfo(i);
|
|
addConceptInfo(i);
|
|
});
|
|
});
|
|
@@ -545,5 +579,5 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
return "";
|
|
return "";
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|