|
@@ -424,10 +424,11 @@ public class TransfusionConfigFacade {
|
|
|
|
|
|
/**
|
|
|
* 导入数据预匹配
|
|
|
+ *
|
|
|
* @param file
|
|
|
* @param response
|
|
|
*/
|
|
|
- public void precDataMatch(MultipartFile file,HttpServletResponse response) {
|
|
|
+ public void precDataMatch(MultipartFile file, HttpServletResponse response) {
|
|
|
List<TransfusionConfig> originList = ExcelUtils.importExcel(file, 0, 1, TransfusionConfig.class);
|
|
|
List<TransfusionConfig> retList = dataProcess(originList);
|
|
|
|
|
@@ -455,7 +456,8 @@ public class TransfusionConfigFacade {
|
|
|
*/
|
|
|
public List<TransfusionConfig> dataProcess(List<TransfusionConfig> originList) {
|
|
|
List<TransfusionConfig> retList = Lists.newLinkedList();
|
|
|
- Map<String, List<TransfusionConfig>> allMap = getAll();
|
|
|
+ List<String> hisNameList = originList.stream().map(i -> i.getHisName()).distinct().collect(Collectors.toList());
|
|
|
+ Map<String, List<TransfusionConfig>> allMap = getAll(hisNameList);
|
|
|
|
|
|
//去除空格
|
|
|
originList.forEach(item -> {
|
|
@@ -468,10 +470,11 @@ public class TransfusionConfigFacade {
|
|
|
for (Map.Entry<String, List<TransfusionConfig>> entry : allMap.entrySet()) {
|
|
|
if (ListUtil.isNotEmpty(entry.getValue())) {
|
|
|
precUniqueName.addAll(entry.getValue().stream().map(i -> i.getUniqueName()).collect(Collectors.toList()));
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ precUniqueName = precUniqueName.stream().distinct().collect(Collectors.toList());
|
|
|
+
|
|
|
ConceptVO conceptVO = new ConceptVO();
|
|
|
conceptVO.setNames(precUniqueName);
|
|
|
conceptVO.setType(ConceptTypeEnum.Transfusion.getKey());
|
|
@@ -498,11 +501,16 @@ public class TransfusionConfigFacade {
|
|
|
|
|
|
/**
|
|
|
* 获取所有医院映射数据
|
|
|
+ *
|
|
|
* @return
|
|
|
*/
|
|
|
- public Map<String,List<TransfusionConfig>> getAll() {
|
|
|
+ public Map<String, List<TransfusionConfig>> getAll(List<String> hisNameList) {
|
|
|
Map<String, List<TransfusionConfig>> retMap = new HashMap<>();
|
|
|
- List<TransfusionConfig> records = transfusionConfigService.list();
|
|
|
+ QueryWrapper<TransfusionConfig> queryWrapper = new QueryWrapper<>();
|
|
|
+ if (ListUtil.isNotEmpty(hisNameList)) {
|
|
|
+ queryWrapper.eq("his_name", hisNameList);
|
|
|
+ }
|
|
|
+ List<TransfusionConfig> records = transfusionConfigService.list(queryWrapper);
|
|
|
if (ListUtil.isEmpty(records)) {
|
|
|
return retMap;
|
|
|
}
|