Browse Source

人员预警变动

release
zxc 4 years ago
parent
commit
dd5f9e18f2
  1. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonWarnRightListFormDTO.java
  2. 3
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/PersonWarnRightListResultDTO.java
  3. 24
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/PersonWarnRightListFormDTO.java

@ -22,4 +22,6 @@ public class PersonWarnRightListFormDTO implements Serializable {
@NotNull(message = "pageSize不能为空",groups = PersonWarnRightListForm.class)
private Integer pageSize;
private String categoryCode;
}

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

@ -35,6 +35,9 @@ public class PersonWarnRightListResultDTO implements Serializable {
*/
private List<String> type;
@JsonIgnore
private String sortString;
/**
* 所属网格
*/

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

@ -1186,8 +1186,19 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
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<CustomerCategoryShowAndWarnListResultDTO> configListOrigin = configListResult.getData();
List<CustomerCategoryShowAndWarnListResultDTO> configList = new ArrayList<>();
if (StringUtils.isNotBlank(formDTO.getCategoryCode())){
for (CustomerCategoryShowAndWarnListResultDTO c : configListOrigin) {
if (c.getColumnName().equals(formDTO.getCategoryCode())){
configList.add(c);
}
}
}else {
configList = configListOrigin;
}
List<CustomerCategoryShowAndWarnListResultDTO> finalConfigList = configList;
PageInfo<Map<String, Object>> pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectResiUsers(finalConfigList.stream().map(m -> m.getColumnName()).collect(Collectors.toList()), staffInfo.getAgencyId()));
List<Map<String, Object>> list = pageInfo.getList();
if (CollectionUtils.isEmpty(list)) {
return result;
@ -1200,7 +1211,14 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
}
List<HouseInfoDTO> houseInfos = houseInfosResult.getData();
userList.forEach(u -> houseInfos.stream().filter(h -> h.getHomeId().equals(u.getHomeId())).forEach(h -> u.setFamily(h.getAllName())));
result.setList(userList);
// 类型+网格+家庭 排序
userList.forEach(u -> {
String types = u.getType().stream().map(String::valueOf).collect(Collectors.joining("、"));
String s = types + u.getGridName() + u.getFamily();
u.setSortString(s);
});
List<PersonWarnRightListResultDTO.PersonWarnRightList> finalResult = userList.stream().sorted(Comparator.comparing(PersonWarnRightListResultDTO.PersonWarnRightList::getSortString)).collect(Collectors.toList());
result.setList(finalResult);
return result;
}

Loading…
Cancel
Save