| | |
| | | if(dataList == null || dataList.size() ==0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,录入数据为空!"); |
| | | } |
| | | List<String> idCardList = dataList.stream().map(m->m.getIdCard()).collect(Collectors.toList()); |
| | | Set<String> set = new HashSet<>(idCardList); |
| | | if(idCardList.size() != set.size()){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对不起,录入数据存在身份证号相同数据!"); |
| | | } |
| | | // List<String> idCardList = dataList.stream().map(m->m.getIdCard()).collect(Collectors.toList()); |
| | | // Set<String> set = new HashSet<>(idCardList); |
| | | // if(idCardList.size() != set.size()){ |
| | | // throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对不起,录入数据存在身份证号相同数据!"); |
| | | // } |
| | | List<DispatchUnit> dispatchUnitList = new ArrayList<>(); |
| | | if(!Objects.isNull(solutionId)){ |
| | | dispatchUnitList = dispatchUnitJoinMapper.selectJoinList(DispatchUnit.class, |
| | |
| | | } |
| | | } |
| | | long index = Constants.TWO; |
| | | Map<String,String> idCardMap = new HashMap<>(); |
| | | for(MemberImport model : dataList){ |
| | | if(StringUtils.isBlank(model.getIdCard())||model.getIdCard().length()!=18){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,第"+index+"行数据身份证信息异常!"); |
| | |
| | | if(StringUtils.isBlank(model.getName())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,第"+index+"行数据姓名信息异常!"); |
| | | } |
| | | if(Objects.nonNull(idCardMap.get(model.getIdCard()))){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,第"+index+"行数据身份证号【"+model.getIdCard()+"】存在相同数据!"); |
| | | } |
| | | idCardMap.put(model.getIdCard(), model.getIdCard()); |
| | | index = index + Constants.ONE; |
| | | if(CollectionUtils.isNotEmpty(list)){ |
| | | Optional<Member> memberOptional= list.stream().filter(m->m.getIdcardNo().equals(model.getIdCard())).findFirst(); |