From 3349307474a5aa56472fde9a63b3fb8a9478d3c0 Mon Sep 17 00:00:00 2001 From: wanggeng <450292408@qq.com> Date: Tue, 26 Oct 2021 11:27:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BD=91=E6=A0=BC=E5=91=98?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/AssessmentServiceImpl.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/cm/systemcity/service/assessment/impl/AssessmentServiceImpl.java b/src/main/java/com/cm/systemcity/service/assessment/impl/AssessmentServiceImpl.java index 2a43e28..3e7eb57 100644 --- a/src/main/java/com/cm/systemcity/service/assessment/impl/AssessmentServiceImpl.java +++ b/src/main/java/com/cm/systemcity/service/assessment/impl/AssessmentServiceImpl.java @@ -17,6 +17,7 @@ import com.cm.common.pojo.ListPage; import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; +import com.cm.common.utils.ArrayListUtil; import com.cm.common.utils.DateUtil; import com.cm.common.utils.HashMapUtil; import com.cm.common.utils.UUIDUtil; @@ -119,7 +120,24 @@ public class AssessmentServiceImpl extends BaseService implements IAssessmentSer String showDay = params.get("showDay").toString(); LOG.debug("5级网格员列表"); params.put("communityBossLevel", "4"); - List communityBossPOs = communityBossService.listPO(params); + List communityBossPOs = ArrayListUtil.deepClone(communityBossService.listPO(params), CommunityBossPO.class); + // 去除存在多个片区的网格长 + for (int i = 0; i < communityBossPOs.size(); i++) { + CommunityBossPO communityBossPO = communityBossPOs.get(i); + boolean isExist = false; + for (int j = i + 1; j < communityBossPOs.size(); j++) { + CommunityBossPO nextCommunityBossPO = communityBossPOs.get(j); + if (StringUtils.equals(communityBossPO.getCommunityBossUserId(), nextCommunityBossPO.getCommunityBossUserId())) { + isExist = true; + break; + } + } + if (isExist) { + communityBossPOs.remove(i); + i--; + } + } + // 网格用户列表 Set userIdSet = new HashSet<>(); for (CommunityBossPO communityBossPO : communityBossPOs) {