修改网格员重复问题

This commit is contained in:
wanggeng 2021-10-26 11:27:02 +08:00
parent 2cf0035470
commit 3349307474

View File

@ -17,6 +17,7 @@ import com.cm.common.pojo.ListPage;
import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResult;
import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultData;
import com.cm.common.result.SuccessResultList; import com.cm.common.result.SuccessResultList;
import com.cm.common.utils.ArrayListUtil;
import com.cm.common.utils.DateUtil; import com.cm.common.utils.DateUtil;
import com.cm.common.utils.HashMapUtil; import com.cm.common.utils.HashMapUtil;
import com.cm.common.utils.UUIDUtil; import com.cm.common.utils.UUIDUtil;
@ -119,7 +120,24 @@ public class AssessmentServiceImpl extends BaseService implements IAssessmentSer
String showDay = params.get("showDay").toString(); String showDay = params.get("showDay").toString();
LOG.debug("5级网格员列表"); LOG.debug("5级网格员列表");
params.put("communityBossLevel", "4"); params.put("communityBossLevel", "4");
List<CommunityBossPO> communityBossPOs = communityBossService.listPO(params); List<CommunityBossPO> 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<String> userIdSet = new HashSet<>(); Set<String> userIdSet = new HashSet<>();
for (CommunityBossPO communityBossPO : communityBossPOs) { for (CommunityBossPO communityBossPO : communityBossPOs) {