jiangping
2024-06-19 af9932d1d6fe3bd56799dcd8b4d76dc993c5c1db
server/service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
@@ -385,11 +385,11 @@
        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,
@@ -416,6 +416,7 @@
            }
        }
        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+"行数据身份证信息异常!");
@@ -426,6 +427,10 @@
            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();