|
@@ -31,6 +31,7 @@ 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.Lexicon;
|
|
import com.diagbot.entity.LibraryDetail;
|
|
import com.diagbot.entity.LibraryDetail;
|
|
import com.diagbot.entity.LibraryInfo;
|
|
import com.diagbot.entity.LibraryInfo;
|
|
import com.diagbot.entity.Medical;
|
|
import com.diagbot.entity.Medical;
|
|
@@ -72,6 +73,8 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
private LibraryInfoService libraryInfoService;
|
|
private LibraryInfoService libraryInfoService;
|
|
@Autowired
|
|
@Autowired
|
|
private UserServiceClient userServiceClient;
|
|
private UserServiceClient userServiceClient;
|
|
|
|
+ @Autowired
|
|
|
|
+ private LexiconFacade lexiconFacade;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 获取所有化验公表项
|
|
* 获取所有化验公表项
|
|
@@ -254,6 +257,13 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR,"标准术语只能有一个("+addConceptInfoVO.getName()+")");
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR,"标准术语只能有一个("+addConceptInfoVO.getName()+")");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ 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()+")");
|
|
|
|
+ }
|
|
|
|
+
|
|
List<LibraryInfo> saveOrUpdateLibraryInfoList = new ArrayList<>();
|
|
List<LibraryInfo> saveOrUpdateLibraryInfoList = new ArrayList<>();
|
|
|
|
|
|
AddConceptInfoDetailVO addConceptInfoDetailVOMain = addConceptInfoDetailVOMainList.get(0);//提交过来的标准术语
|
|
AddConceptInfoDetailVO addConceptInfoDetailVOMain = addConceptInfoDetailVOMainList.get(0);//提交过来的标准术语
|
|
@@ -281,6 +291,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
libraryInfoMain.setGmtModified(now);
|
|
libraryInfoMain.setGmtModified(now);
|
|
libraryInfoMain.setModifier(currentUser);
|
|
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);
|
|
@@ -377,6 +388,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
i.setId(null);
|
|
i.setId(null);
|
|
i.setConceptId(conceptId);
|
|
i.setConceptId(conceptId);
|
|
i.setType(addConceptInfoVO.getType());
|
|
i.setType(addConceptInfoVO.getType());
|
|
|
|
+ i.setTypeId(lexicon.getId());
|
|
}
|
|
}
|
|
saveOrUpdateLibraryInfoList.add(libraryInfoMain);
|
|
saveOrUpdateLibraryInfoList.add(libraryInfoMain);
|
|
|
|
|
|
@@ -401,6 +413,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();
|
|
@@ -422,7 +435,14 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
String libName, libType, otherNames, remark;
|
|
String libName, libType, otherNames, remark;
|
|
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(" ", "");
|
|
@@ -484,11 +504,24 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**********************非规范的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文件本身问题提醒************************/
|
|
/*****************excel文件本身问题提醒************************/
|
|
if(sbf.length()>0){
|
|
if(sbf.length()>0){
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
|
|
throw new CommonException(CommonErrorCode.RPC_ERROR,sbf.toString());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /****************************导入空文件************************/
|
|
|
|
+ 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->{
|
|
@@ -504,7 +537,7 @@ public class ConceptFacade extends ConceptServiceImpl {
|
|
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);
|
|
});
|
|
});
|