Commit d95972dd authored by 王琮's avatar 王琮

修改返回数据字典label值

parent 0b5a5035
...@@ -141,45 +141,45 @@ public class YxryServiceImpl implements IYxryService { ...@@ -141,45 +141,45 @@ public class YxryServiceImpl implements IYxryService {
List<Yxry> updateList = new ArrayList<>(); List<Yxry> updateList = new ArrayList<>();
for (Yxry zlqk : list) { for (Yxry zlqk : list) {
if (StringUtils.isNotEmpty(zlqk.getCardNo()) && StringUtils.isNotEmpty(zlqk.getUserName()) if (StringUtils.isNotEmpty(zlqk.getCardNo()) && StringUtils.isNotEmpty(zlqk.getUserName())
&& StringUtils.isNotEmpty(zlqk.getPhone()) && StringUtils.isNotEmpty(zlqk.getArea()) ) { && StringUtils.isNotEmpty(zlqk.getPhone()) && StringUtils.isNotEmpty(zlqk.getArea())) {
String community = ""; String community = "";
String committee = ""; String committee = "";
String street = ""; String street = "";
if (StringUtils.isNotEmpty(zlqk.getCommunity())){ //如果小区不为空,去数据字典匹配value if (StringUtils.isNotEmpty(zlqk.getCommunity())) { //如果小区不为空,去数据字典匹配value
List<SysDictData> communitys = DictUtils.getDictCache("community"); List<SysDictData> communitys = DictUtils.getDictCache("community");
List<String> values = communitys.stream().filter(l->zlqk.getCommunity().equals(l.getDictLabel())) List<String> values = communitys.stream().filter(l -> zlqk.getCommunity().equals(l.getDictLabel()))
.map(SysDictData::getDictValue).collect(Collectors.toList()); .map(SysDictData::getDictValue).collect(Collectors.toList());
if (!values.isEmpty()) if (!values.isEmpty())
community=values.get(0); community = values.get(0);
else { else {
failureList.add(zlqk); failureList.add(zlqk);
continue; continue;
} }
} }
if (StringUtils.isNotEmpty(zlqk.getCommittee())){ //如果委员会不为空,去数据字典匹配value if (StringUtils.isNotEmpty(zlqk.getCommittee())) { //如果委员会不为空,去数据字典匹配value
List<SysDictData> communitys = DictUtils.getDictCache("committee"); List<SysDictData> communitys = DictUtils.getDictCache("committee");
List<String> values = communitys.stream().filter(l->zlqk.getCommittee().equals(l.getDictLabel())) List<String> values = communitys.stream().filter(l -> zlqk.getCommittee().equals(l.getDictLabel()))
.map(SysDictData::getDictValue).collect(Collectors.toList()); .map(SysDictData::getDictValue).collect(Collectors.toList());
if (!values.isEmpty()) if (!values.isEmpty())
committee=values.get(0); committee = values.get(0);
else { else {
failureList.add(zlqk); failureList.add(zlqk);
continue; continue;
} }
} }
if (StringUtils.isNotEmpty(zlqk.getStreet())){ //如果街道不为空,去数据字典匹配value if (StringUtils.isNotEmpty(zlqk.getStreet())) { //如果街道不为空,去数据字典匹配value
List<SysDictData> communitys = DictUtils.getDictCache("street_town"); List<SysDictData> communitys = DictUtils.getDictCache("street_town");
List<String> values = communitys.stream().filter(l->zlqk.getStreet().equals(l.getDictLabel())) List<String> values = communitys.stream().filter(l -> zlqk.getStreet().equals(l.getDictLabel()))
.map(SysDictData::getDictValue).collect(Collectors.toList()); .map(SysDictData::getDictValue).collect(Collectors.toList());
if (!values.isEmpty()) if (!values.isEmpty())
street=values.get(0); street = values.get(0);
else { else {
failureList.add(zlqk); failureList.add(zlqk);
continue; continue;
} }
} }
if ((StringUtils.isNotEmpty(community)&&StringUtils.isEmpty(committee))|| if ((StringUtils.isNotEmpty(community) && StringUtils.isEmpty(committee)) ||
(StringUtils.isNotEmpty(committee)&&StringUtils.isEmpty(street))){ (StringUtils.isNotEmpty(committee) && StringUtils.isEmpty(street))) {
failureList.add(zlqk); failureList.add(zlqk);
continue; continue;
} }
...@@ -198,7 +198,7 @@ public class YxryServiceImpl implements IYxryService { ...@@ -198,7 +198,7 @@ public class YxryServiceImpl implements IYxryService {
if (!CheckUtils.checkPhone(zlqk.getPhone())) { if (!CheckUtils.checkPhone(zlqk.getPhone())) {
failureList.add(zlqk); failureList.add(zlqk);
} else { } else {
if (CheckUtils.checkCard(zlqk.getCardNo())){ if (CheckUtils.checkCard(zlqk.getCardNo())) {
zlqk.setCheckCard("正确"); zlqk.setCheckCard("正确");
zlqk.setCommunity(community); zlqk.setCommunity(community);
zlqk.setCommittee(committee); zlqk.setCommittee(committee);
...@@ -270,18 +270,18 @@ public class YxryServiceImpl implements IYxryService { ...@@ -270,18 +270,18 @@ public class YxryServiceImpl implements IYxryService {
map.put("glName", null); map.put("glName", null);
} else if (fcryList.size() > 0 && gldryList.size() > 0) { // 都没转出 } else if (fcryList.size() > 0 && gldryList.size() > 0) { // 都没转出
map.put("glPlace", "其他"); map.put("glPlace", "其他");
map.put("fcName", fcryList.stream().map(Fcry::getFcPlace).collect(Collectors.joining(","))); map.put("fcName", DictUtils.getDictLabel("shelters",fcryList.stream().map(Fcry::getFcPlace).collect(Collectors.joining(","))));
map.put("glName", gldryList.stream().map(Gldry::getGlPlace).collect(Collectors.joining(","))); map.put("glName", DictUtils.getDictLabel("isolation_point",gldryList.stream().map(Gldry::getGlPlace).collect(Collectors.joining(","))));
} else if (fcryList.size() > 0) { } else if (fcryList.size() > 0) {
map.put("glPlace", "方舱隔离"); map.put("glPlace", "方舱隔离");
map.put("fcName", fcryList.stream().map(Fcry::getFcPlace).collect(Collectors.joining(","))); map.put("fcName", DictUtils.getDictLabel("shelters",fcryList.stream().map(Fcry::getFcPlace).collect(Collectors.joining(","))));
map.put("glName", null); map.put("glName", null);
} else { } else {
map.put("glPlace", "隔离点隔离"); map.put("glPlace", "隔离点隔离");
map.put("fcName", null); map.put("fcName", null);
map.put("glName", gldryList.stream().map(Gldry::getGlPlace).collect(Collectors.joining(","))); map.put("glName", DictUtils.getDictLabel("isolation_point",gldryList.stream().map(Gldry::getGlPlace).collect(Collectors.joining(","))));
} }
map.put("card",zlqks.isEmpty()); map.put("card", zlqks.isEmpty());
return map; return map;
} }
} }
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