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) {