diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnUserResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnUserResultDTO.java index 4cd3332dca..63d55d69c0 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnUserResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/IcStatsResiWarnUserResultDTO.java @@ -43,5 +43,6 @@ public class IcStatsResiWarnUserResultDTO implements Serializable { private String neighborhoodName; private String buildingName; private String residentNames; + private List userList; } \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserWarnNameListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserWarnNameListResultDTO.java new file mode 100644 index 0000000000..f1d6690b46 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserWarnNameListResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/1/24 10:25 上午 + * @DESC + */ +@Data +public class UserWarnNameListResultDTO implements Serializable { + + private static final long serialVersionUID = 6695538440686292540L; + + @JsonIgnore + private String buildingId; + + private String residentName; + + private String userId; +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java index aeb0c2ca82..086bf7ca0f 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcStatsResiWarnDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IcResiCategoryStatsConfigDTO; import com.epmet.dto.PersonWarnLeftPieDTO; +import com.epmet.dto.result.UserWarnNameListResultDTO; import com.epmet.entity.IcStatsResiWarnEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -43,6 +44,11 @@ public interface IcStatsResiWarnDao extends BaseDao { @Param("tableName") String tableName, @Param("columnName") String columnName); + List userWarnListDTO(@Param("customerId") String customerId, + @Param("buildingIdList") List buildingIdList, + @Param("tableName") String tableName, + @Param("columnName") String columnName); + Integer countListByLevelAndCol( @Param("customerId") String customerId, @Param("tableName") String tableName, diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java index 73044f21c4..1fddb41280 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserResiInfoDao.java @@ -78,6 +78,7 @@ public interface UserResiInfoDao extends BaseDao { * @date 2020/5/11 11:18 */ IssueInitiatorResultDTO selectIssueInitiator(IssueInitiatorFormDTO formDTO); + IssueInitiatorResultDTO issueInitiatorByBaseInfo(IssueInitiatorFormDTO formDTO); /** * @param userId diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java index 4d357ec43f..5947a62259 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StatsResiWarnServiceImpl.java @@ -159,12 +159,25 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { IcResiCategoryWarnConfigDTO icResiCategoryWarnConfigDTO = warnResult.getData(); //根据buildingID,tableName he columnName获取名字 - List> maps = icStatsResiWarnDao.userWarnList(customerId,buildingIdList, icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName()); - result.forEach(item->{ - item.setConfigId(configId); - List> buildingIds = maps.stream().filter(map -> item.getBuildingId().equals(map.get("buildingId"))).collect(Collectors.toList()); - item.setResidentNames(CollectionUtils.isEmpty(buildingIds)?"":buildingIds.get(0).get("residentNames")); - }); +// List> maps = icStatsResiWarnDao.userWarnList(customerId,buildingIdList, icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName()); + List dtos = icStatsResiWarnDao.userWarnListDTO(customerId, buildingIdList, icResiCategoryWarnConfigDTO.getTableName(), icResiCategoryWarnConfigDTO.getColumnName()); +// result.forEach(item->{ +// item.setConfigId(configId); +// List> buildingIds = maps.stream().filter(map -> item.getBuildingId().equals(map.get("buildingId"))).collect(Collectors.toList()); +// item.setResidentNames(CollectionUtils.isEmpty(buildingIds)?"":buildingIds.get(0).get("residentNames")); +// }); + if (!CollectionUtils.isEmpty(dtos)){ + Map> groupByBuild = dtos.stream().collect(Collectors.groupingBy(UserWarnNameListResultDTO::getBuildingId)); + result.forEach(item->{ + item.setConfigId(configId); + groupByBuild.forEach((k,v) -> { + if (item.getBuildingId().equals(k)){ + item.setUserList(v); + } + }); + }); + } + return mapResult; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index 017a0469df..ee80c0809d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -387,7 +387,9 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml index 102f9611ac..df1d830567 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserResiInfoDao.xml @@ -168,6 +168,34 @@ AND uw.del_flag = 0 + +