|
|
@ -262,6 +262,7 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl<ChangeWelfareDao, |
|
|
|
if (StringUtils.isBlank(list.get(i).getIdCard()) && !list.get(i).getAddStatus()){ |
|
|
|
errorInfo.add(getErrorInfo(list.get(i), "证件号不能为空",i+1)); |
|
|
|
list.get(i).setAddStatus(true); |
|
|
|
list.get(i).setIdCard("10110"); // 后面有逻辑用到了证件号,10110代表证件号为空
|
|
|
|
continue; |
|
|
|
} |
|
|
|
// 校验是否为居民
|
|
|
@ -292,17 +293,17 @@ public class ChangeWelfareServiceImpl extends BaseServiceImpl<ChangeWelfareDao, |
|
|
|
|
|
|
|
} |
|
|
|
if (list.size() > errorInfo.size()){ |
|
|
|
// Map<String, Long> groupByIdCard = list.stream().collect(Collectors.groupingBy(ChangeWelfareImportExcel::getIdCard, Collectors.counting()));
|
|
|
|
// groupByIdCard.forEach((idCard,count) -> {
|
|
|
|
// if (StringUtils.isNotBlank(idCard) && Integer.valueOf(count.toString()).compareTo(1) != 0){
|
|
|
|
// for (ChangeWelfareImportExcel i : list) {
|
|
|
|
// if (idCard.equals(i.getIdCard()) && !i.getAddStatus()){
|
|
|
|
// errorInfo.add(getErrorInfo(i,"数据重复",i.getNum()));
|
|
|
|
// i.setAddStatus(true);
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
Map<String, Long> groupByIdCard = list.stream().collect(Collectors.groupingBy(ChangeWelfareImportExcel::getIdCard, Collectors.counting())); |
|
|
|
groupByIdCard.forEach((idCard,count) -> { |
|
|
|
if (!"10110".equals(idCard) && Integer.valueOf(count.toString()).compareTo(1) != 0){ |
|
|
|
for (ChangeWelfareImportExcel i : list) { |
|
|
|
if (idCard.equals(i.getIdCard()) && !i.getAddStatus()){ |
|
|
|
errorInfo.add(getErrorInfo(i,"数据重复",i.getNum())); |
|
|
|
i.setAddStatus(true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
Map<Boolean, List<ChangeWelfareImportExcel>> groupByStatus = list.stream().collect(Collectors.groupingBy(ChangeWelfareImportExcel::getAddStatus)); |
|
|
|
List<ChangeWelfareImportExcel> needInsert = groupByStatus.get(false); |
|
|
|