Commit cef87346 authored by 王琮's avatar 王琮

修改核酸采集导入

parent 5fa625c0
...@@ -189,14 +189,16 @@ public class HscjServiceImpl implements IHscjService { ...@@ -189,14 +189,16 @@ public class HscjServiceImpl implements IHscjService {
failureList.add(hscj); failureList.add(hscj);
continue; continue;
} }
//如果小区不为空,去数据字典匹配value //如果街道不为空,去数据字典匹配value
if (StringUtils.isNotEmpty(hscj.getCommunity())) { if (StringUtils.isNotEmpty(hscj.getStreet())) {
List<SysDictData> communitys = DictUtils.getDictCache("community"); List<SysDictData> communitys = DictUtils.getDictCache("street_town");
List<String> values = communitys.stream().filter(l -> hscj.getCommunity().equals(l.getDictLabel())) List<String> values = communitys.stream().filter(l -> hscj.getStreet().equals(l.getDictLabel()))
.map(SysDictData::getDictValue).collect(Collectors.toList()); .map(SysDictData::getDictValue).collect(Collectors.toList());
if (!values.isEmpty()) if (!values.isEmpty())
hscj.setCommunity(values.get(0)); hscj.setStreet(values.get(0));
else { else {
hscj.setStreet(null);
hscj.setCommittee(null);
hscj.setCommunity(null); hscj.setCommunity(null);
} }
} }
...@@ -209,29 +211,20 @@ public class HscjServiceImpl implements IHscjService { ...@@ -209,29 +211,20 @@ public class HscjServiceImpl implements IHscjService {
hscj.setCommittee(values.get(0)); hscj.setCommittee(values.get(0));
else { else {
hscj.setCommittee(null); hscj.setCommittee(null);
hscj.setCommunity(null);
} }
} }
//如果街道不为空,去数据字典匹配value //如果小区不为空,去数据字典匹配value
if (StringUtils.isNotEmpty(hscj.getStreet())) { if (StringUtils.isNotEmpty(hscj.getCommunity())) {
List<SysDictData> communitys = DictUtils.getDictCache("street_town"); List<SysDictData> communitys = DictUtils.getDictCache("community");
List<String> values = communitys.stream().filter(l -> hscj.getStreet().equals(l.getDictLabel())) List<String> values = communitys.stream().filter(l -> hscj.getCommunity().equals(l.getDictLabel()))
.map(SysDictData::getDictValue).collect(Collectors.toList()); .map(SysDictData::getDictValue).collect(Collectors.toList());
if (!values.isEmpty()) if (!values.isEmpty())
hscj.setStreet(values.get(0)); hscj.setCommunity(values.get(0));
else { else {
hscj.setStreet(null); hscj.setCommunity(null);
} }
} }
if (StringUtils.isNotEmpty(hscj.getCommunity()) && StringUtils.isEmpty(hscj.getCommittee())) {
hscj.setError("小区存在时社区不能为空");
failureList.add(hscj);
continue;
}
if (StringUtils.isNotEmpty(hscj.getCommittee()) && StringUtils.isEmpty(hscj.getStreet())) {
hscj.setError("社区存在时街道不能为空");
failureList.add(hscj);
continue;
}
if (CheckUtils.checkCard(hscj.getCardNo())) { if (CheckUtils.checkCard(hscj.getCardNo())) {
hscj.setCheckCard("正确"); hscj.setCheckCard("正确");
trueList.add(hscj); trueList.add(hscj);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment