|
@@ -253,7 +253,6 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
|
|
|
/**
|
|
|
* 医学术语命名添加或者编辑
|
|
|
- *
|
|
|
* @param addConceptInfoVO
|
|
|
* @return
|
|
|
*/
|
|
@@ -313,25 +312,23 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
saveOrUpdate(concept);
|
|
|
conceptId = concept.getId();
|
|
|
}else{
|
|
|
- int ckConceptId = libraryInfoMain.getConceptId().intValue();
|
|
|
+ conceptId = libraryInfoMain.getConceptId();
|
|
|
+ int ckConceptId = conceptId.intValue();
|
|
|
+
|
|
|
//如果标准词之前作为同义词被其他占用的情况
|
|
|
- if(libraryInfoMain.getIsConcept()==0
|
|
|
- &&libraryInfoList.stream().filter(i->i.getConceptId().intValue()==ckConceptId).count()==1){
|
|
|
- QueryWrapper<LibraryInfo> libraryInfoQe2 = new QueryWrapper<>();
|
|
|
- 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()+"占用");
|
|
|
+ if(libraryInfoMain.getIsConcept()==1){
|
|
|
+ //新增操作时,已经建立的标准词提示
|
|
|
+ if(addConceptInfoVO.getLineNum()==null&&addConceptInfoVO.getConceptId()==null){
|
|
|
+ concept = getById(conceptId);
|
|
|
+ if(concept.getIsDeleted().equals("N")){
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,"该数据已经建立!");
|
|
|
+ }else{
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,"该数据已经建立且处于已删除状态,可前往列表中恢复该条数据!");
|
|
|
+ }
|
|
|
}
|
|
|
+ }else if(libraryInfoList.stream().filter(i->i.getConceptId().intValue()==ckConceptId).count()==1){
|
|
|
+ throw new CommonException(CommonErrorCode.RPC_ERROR,lineNumStr+"标准术语已作为同义词被占用!");
|
|
|
}
|
|
|
-
|
|
|
- conceptId = libraryInfoMain.getConceptId();
|
|
|
- concept.setId(conceptId);
|
|
|
- concept.setLibId(libraryInfoMain.getId());
|
|
|
-
|
|
|
- libraryInfoMain.setIsConcept(1);
|
|
|
- libraryInfoMain.setRemark(addConceptInfoDetailVOMain.getRemark());
|
|
|
}
|
|
|
|
|
|
//先删除概念下的同义词,后续再插入
|
|
@@ -374,6 +371,8 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
i.setType(addConceptInfoVO.getType());
|
|
|
i.setTypeId(lexicon.getId());
|
|
|
}
|
|
|
+ libraryInfoMain.setIsConcept(1);
|
|
|
+ libraryInfoMain.setRemark(addConceptInfoDetailVOMain.getRemark());
|
|
|
libraryInfoMain.setConceptId(conceptId);
|
|
|
libraryInfoMain.setGmtModified(now);
|
|
|
libraryInfoMain.setModifier(currentUser);
|
|
@@ -381,13 +380,15 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
|
|
|
libraryInfoService.saveOrUpdateBatch(saveOrUpdateLibraryInfoList);
|
|
|
|
|
|
+ concept.setId(conceptId);
|
|
|
+ concept.setLibId(libraryInfoMain.getId());
|
|
|
concept.setGmtModified(now);
|
|
|
concept.setModifier(currentUser);
|
|
|
updateById(concept);
|
|
|
|
|
|
return true;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 医学术语命名excel文件导入
|
|
|
* @param file
|
|
@@ -418,6 +419,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
Sheet sheet = wb.getSheetAt(0);
|
|
|
int count = 0;
|
|
|
String libName, libType, otherNames, remark;
|
|
|
+ String regEx="[0-9`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]+";
|
|
|
for (Row row : sheet) {
|
|
|
count++;
|
|
|
if(row == null){
|
|
@@ -442,6 +444,14 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
sbf.append("第" + count + "行数据不完整;").append("<br/>");
|
|
|
continue;
|
|
|
}
|
|
|
+ if(libName.matches(regEx)||otherNames.matches(regEx)){
|
|
|
+ sbf.append("第" + count + "无法导入,导入数据无法为纯数字或特殊字符;").append("<br/>");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if(StringUtil.isNotEmpty(remark)&&remark.length()>120){
|
|
|
+ sbf.append("第" + count + "导入错误,说明最大可输入120个字;").append("<br/>");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
|
|
|
AddConceptInfoVO addConceptInfoVO = new AddConceptInfoVO();
|
|
|
addConceptInfoVO.setLineNum(count);
|
|
@@ -452,6 +462,10 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
|
if(StringUtil.isBlank(nm)){
|
|
|
continue;
|
|
|
}
|
|
|
+ if(nm.length()>30){
|
|
|
+ sbf.append("第" + count + "导入错误,标准词和同义词最大字数不可超过30个字;").append("<br/>");
|
|
|
+ break;
|
|
|
+ }
|
|
|
AddConceptInfoDetailVO addConceptInfoDetailVO = new AddConceptInfoDetailVO();
|
|
|
addConceptInfoDetailVO.setName(nm);
|
|
|
addConceptInfoDetailVO.setType(libType);
|