From 70eb051b54b835edb3f93e701e5d07a1d21045e6 Mon Sep 17 00:00:00 2001 From: 罗yu 元桥 <2376770955@qq.com> Date: 星期五, 07 五月 2021 18:15:18 +0800 Subject: [PATCH] Merge branch 'test' into 'master' --- springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java index 1e970ec..680a4ca 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java @@ -16,6 +16,7 @@ import com.panzhihua.common.service.community.CommunityService; import com.panzhihua.common.utlis.AgeUtils; import com.panzhihua.common.utlis.IdCardUtil; +import com.panzhihua.common.utlis.ListUtils; import com.panzhihua.common.utlis.StringUtils; import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; @@ -24,6 +25,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * @description: 实有人口导入监听 @@ -183,6 +185,7 @@ vo.getUserTagStr().add(headData.get(i).substring(0,headData.get(i).indexOf("("))); } } + voList.add(vo); index++; } @@ -195,7 +198,9 @@ // }else{ // throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList)); // } - R r = communityService.listSavePopulationServeExcelVO(voList, communityId); + //根据list中的IdCard城市来去重 + List<ComMngPopulationServeExcelVO> newVoList = voList.stream().filter(ListUtils.distinctByKey(ComMngPopulationServeExcelVO::getCardNo)).collect(Collectors.toList()); + R r = communityService.listSavePopulationServeExcelVO(newVoList, communityId); if (!R.isOk(r)) { String errMsg = r.getMsg(); List<ComMngPopulationImportErrorVO> errorList = JSON.parseArray(errMsg,ComMngPopulationImportErrorVO.class); -- Gitblit v1.7.1