查询不存在清单 导致清单报错问题修复
This commit is contained in:
+41
-39
@@ -318,53 +318,55 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
wrapper.eq("sort_key", sortKey);
|
||||
Page<SarLawsDetailedList> pageRes = new Page<>(page, pageSize);
|
||||
IPage<SarLawsDetailedList> userIPage = sarLawsDetailedListDao.selectPage(pageRes, wrapper);
|
||||
if ("1".equals(sortKey)) {
|
||||
Map<String, Object> map = iDicTypeEOService.getDicTypeListCode();
|
||||
List<SarLawsDetailedList> list = userIPage.getRecords();
|
||||
List<Map<String, String>> arr = (List<Map<String, String>>) map.get("COUNTRY");
|
||||
for (SarLawsDetailedList list1 : list) {
|
||||
if (StringUtils.isNotBlank(list1.getCountryArea()) && list1.getCountryArea().contains(",")) {
|
||||
String[] split = list1.getCountryArea().split(",");
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String s : split) {
|
||||
if ( userIPage.getRecords().size()>0){
|
||||
if ("1".equals(sortKey)) {
|
||||
Map<String, Object> map = iDicTypeEOService.getDicTypeListCode();
|
||||
List<SarLawsDetailedList> list = userIPage.getRecords();
|
||||
List<Map<String, String>> arr = (List<Map<String, String>>) map.get("COUNTRY");
|
||||
for (SarLawsDetailedList list1 : list) {
|
||||
if (StringUtils.isNotBlank(list1.getCountryArea()) && list1.getCountryArea().contains(",")) {
|
||||
String[] split = list1.getCountryArea().split(",");
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String s : split) {
|
||||
for (Map<String, String> map1 : arr) {
|
||||
if (map1.get("value").equals(s)) {
|
||||
s = map1.get("value");
|
||||
builder.append(s + ",");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
String completedString = "";
|
||||
if (builder.length() > 0) {
|
||||
completedString = builder.delete(builder.length() - 1, builder.length()).toString();
|
||||
}
|
||||
list1.setCountryArea(completedString);
|
||||
} else {
|
||||
for (Map<String, String> map1 : arr) {
|
||||
if (map1.get("value").equals(s)) {
|
||||
s = map1.get("value");
|
||||
builder.append(s + ",");
|
||||
if (map1.get("value").equals(list1.getCountryArea())) {
|
||||
list1.setCountryArea(map1.get("value"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
String completedString = "";
|
||||
if (builder.length() > 0) {
|
||||
completedString = builder.delete(builder.length() - 1, builder.length()).toString();
|
||||
}
|
||||
list1.setCountryArea(completedString);
|
||||
} else {
|
||||
for (Map<String, String> map1 : arr) {
|
||||
if (map1.get("value").equals(list1.getCountryArea())) {
|
||||
list1.setCountryArea(map1.get("value"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
userIPage.setRecords(list);
|
||||
}
|
||||
userIPage.setRecords(list);
|
||||
List<String> names = new ArrayList<>();
|
||||
userIPage.getRecords().forEach(sarLawsDetailedList -> {
|
||||
names.add(sarLawsDetailedList.getUpdatePeople());
|
||||
});
|
||||
List<UpDTO> upDTOS = iTsUserService.selectNameById(names, "0");
|
||||
Map<String, String> stringMap = new HashMap<>();
|
||||
upDTOS.forEach(upDTO -> {
|
||||
stringMap.put(upDTO.getId(), upDTO.getValue());
|
||||
});
|
||||
userIPage.getRecords().forEach(sarLawsDetailedList -> {
|
||||
if (null != stringMap.get(sarLawsDetailedList.getUpdatePeople())) {
|
||||
sarLawsDetailedList.setUpdatePeople(stringMap.get(sarLawsDetailedList.getUpdatePeople()));
|
||||
}
|
||||
});
|
||||
}
|
||||
List<String> names = new ArrayList<>();
|
||||
userIPage.getRecords().forEach(sarLawsDetailedList -> {
|
||||
names.add(sarLawsDetailedList.getUpdatePeople());
|
||||
});
|
||||
List<UpDTO> upDTOS = iTsUserService.selectNameById(names, "0");
|
||||
Map<String, String> stringMap = new HashMap<>();
|
||||
upDTOS.forEach(upDTO -> {
|
||||
stringMap.put(upDTO.getId(), upDTO.getValue());
|
||||
});
|
||||
userIPage.getRecords().forEach(sarLawsDetailedList -> {
|
||||
if (null != stringMap.get(sarLawsDetailedList.getUpdatePeople())) {
|
||||
sarLawsDetailedList.setUpdatePeople(stringMap.get(sarLawsDetailedList.getUpdatePeople()));
|
||||
}
|
||||
});
|
||||
System.out.println("总条数" + userIPage.getTotal());
|
||||
System.out.println("总页数" + userIPage.getPages());
|
||||
return userIPage;
|
||||
|
||||
Reference in New Issue
Block a user