Browse Source

预警列表

dev
zxc 4 years ago
parent
commit
0dca38f956
  1. 7
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java
  2. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  3. 66
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  4. 19
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

7
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java

@ -1,6 +1,7 @@
package com.epmet.dto.result;
import com.epmet.commons.tools.constant.NumConstant;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -39,6 +40,9 @@ public class PersonWarnRightListResultDTO implements Serializable {
*/
private String gridName;
@JsonIgnore
private String gridId;
/**
* 姓名
*/
@ -49,6 +53,9 @@ public class PersonWarnRightListResultDTO implements Serializable {
*/
private String family;
@JsonIgnore
private String homeId;
/**
* 电话
*/

2
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -231,4 +231,6 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
List<VolunteerDistributionResultDTO.Distribution> listIcResiInfosByUserIds(@Param("userIds") List<String> userIds);
Map<String, String> getCategoryListMap(@Param("icUserId") String icUserId);
List<Map<String,Object>> selectResiUsers(@Param("types")List<String> types,@Param("orgId")String orgId);
}

66
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -1099,7 +1099,71 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
*/
@Override
public PersonWarnRightListResultDTO personWarnRightList(PersonWarnRightListFormDTO formDTO, TokenDto tokenDto) {
return null;
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
if (null == staffInfo){
throw new EpmetException(String.format("未查询到此工作人员信息%s",tokenDto.getUserId()));
}
Result<List<CustomerCategoryShowAndWarnListResultDTO>> configListResult = operCustomizeOpenFeignClient.getCustomerCategoryShowAndWarnList(tokenDto.getCustomerId());
if (!configListResult.success()){
throw new EpmetException("查询居民分类配置失败...");
}
PersonWarnRightListResultDTO result = new PersonWarnRightListResultDTO();
if (CollectionUtils.isEmpty(configListResult.getData())){
return result;
}
List<CustomerCategoryShowAndWarnListResultDTO> configList = configListResult.getData();
PageInfo<Map<String, Object>> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectResiUsers(configList.stream().map(m -> m.getColumnName()).collect(Collectors.toList()), staffInfo.getAgencyId()));
List<Map<String, Object>> list = pageInfo.getList();
if (CollectionUtils.isEmpty(list)) {
return result;
}
result.setTotal(Integer.valueOf(String.valueOf(pageInfo.getTotal())));
List<PersonWarnRightListResultDTO.PersonWarnRightList> userList = disposeCategory(list, configList);
Result<List<HouseInfoDTO>> houseInfosResult = govOrgOpenFeignClient.queryListHouseInfo(userList.stream().distinct().map(m -> m.getHomeId()).collect(Collectors.toSet()));
if (!houseInfosResult.success()){
throw new EpmetException("查询房屋信息失败...");
}
List<HouseInfoDTO> houseInfos = houseInfosResult.getData();
userList.forEach(u -> houseInfos.stream().filter(h -> h.getHomeId().equals(u.getHomeId())).forEach(h -> {
String name = h.getNeighborHoodName()+h.getBuildingName()+h.getUnitName()+h.getHouseName();
u.setFamily(name);
}));
result.setList(userList);
return result;
}
/**
* @Description 居民分类 网格名 处理
* @param list
* @param configList
* @author zxc
* @date 2022/1/18 3:22 下午
*/
public List<PersonWarnRightListResultDTO.PersonWarnRightList> disposeCategory(List<Map<String, Object>> list,List<CustomerCategoryShowAndWarnListResultDTO> configList){
List<PersonWarnRightListResultDTO.PersonWarnRightList> userList = new ArrayList<>();
list.forEach(l -> {
PersonWarnRightListResultDTO.PersonWarnRightList dto = ConvertUtils.mapToEntity(l, PersonWarnRightListResultDTO.PersonWarnRightList.class);
// 分类名字
List<String> types = new ArrayList<>();
configList.forEach(c -> {
l.forEach((k,v) -> {
if (c.getColumnName().equals(k) && null != v && v.equals(NumConstant.ONE_STR)){
types.add(c.getLabel());
}
});
});
// 只显示有类别的居民
if (CollectionUtils.isNotEmpty(types)){
dto.setType(types);
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(dto.getGridId());
if (null == gridInfo){
throw new EpmetException(String.format("查询网格信息失败%s",dto.getGridId()));
}
dto.setGridName(gridInfo.getGridNamePath());
userList.add(dto);
}
});
return userList;
}
/**

19
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -540,5 +540,24 @@
del_flag = '0'
AND id = #{icUserId}
</select>
<select id="selectResiUsers" resultType="java.util.Map">
SELECT
ID AS userId,
GRID_ID AS gridId,
HOME_ID AS homeId,
`NAME` AS name,
MOBILE AS mobile,
<foreach collection="types" item="t" separator=",">
${t}
</foreach>
FROM ic_resi_user
WHERE DEL_FLAG = 0
AND CONCAT(PIDS,':',AGENCY_ID) LIKE CONCAT('%',#{orgId},'%')
AND(
<foreach collection="types" item="t" separator="OR">
(${t} IS NOT NULL AND ${t} != 0)
</foreach>)
ORDER BY CREATED_TIME DESC
</select>
</mapper>

Loading…
Cancel
Save