Commit d62febe5 authored by wanghao's avatar wanghao

1 基础信息维护-用户管理-燃气用户 大屏展示数据结构 接口联调

parent 53bb98eb
......@@ -36,6 +36,17 @@ public class TDetectorUserVillageSafetyDeviceInfoVo {
*/
private String address;
/**
* 用户的 经纬度
*/
private String userLongitude;
/**
* 用户的 经纬度
*/
private String userLatitude;
/**
* 村庄id
*/
......@@ -51,6 +62,16 @@ public class TDetectorUserVillageSafetyDeviceInfoVo {
*/
private String regionName;
/**
* 村的 经纬度
*/
private String longitude;
/**
* 村的 经纬度
*/
private String latitude;
/**
* 安全装置 id
*/
......
......@@ -266,12 +266,14 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
for (Map.Entry<Long, List<TDetectorUserVillageSafetyDeviceInfoVo>> longListEntry : collect1.entrySet()) {
Long key1 = longListEntry.getKey();
List<TDetectorUserVillageSafetyDeviceInfoVo> value1 = longListEntry.getValue();
// 先过滤掉 没有经纬度的
List<TDetectorUserVillageSafetyDeviceInfoVo> collect5 = value1.stream().filter(item -> item.getUserLatitude() != null && item.getUserLongitude() != null).collect(Collectors.toList());
// 过滤掉 没有装置的
List<TDetectorUserVillageSafetyDeviceInfoVo> collect2 = value1.stream().filter(item -> item.getGasUserSafetyDeviceId() == null).collect(Collectors.toList());
List<TDetectorUserVillageSafetyDeviceInfoVo> collect2 = collect5.stream().filter(item -> item.getGasUserSafetyDeviceId() == null).collect(Collectors.toList());
// 没有装置的 直接 封装用户数据
if (collect2.size() > 0) {
......@@ -282,13 +284,20 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
userListItem.put("nickName",tDetectorUserVillageSafetyDeviceInfoVo.getNickName());
userListItem.put("phone",tDetectorUserVillageSafetyDeviceInfoVo.getPhone());
userListItem.put("address",tDetectorUserVillageSafetyDeviceInfoVo.getAddress());
userListItem.put("longitude",tDetectorUserVillageSafetyDeviceInfoVo.getUserLongitude());
userListItem.put("latitude",tDetectorUserVillageSafetyDeviceInfoVo.getUserLatitude());
if ("2".equals(tDetectorUserVillageSafetyDeviceInfoVo.getUserType())) {
userListItem.put("iconType","61");
} else if ("4".equals(tDetectorUserVillageSafetyDeviceInfoVo.getUserType())) {
userListItem.put("iconType","18");
}
userListItem.put("safetyDeviceList",safetyDeviceMapList);
userList.add(userListItem);
}
}
// 过滤掉 有装置的
List<TDetectorUserVillageSafetyDeviceInfoVo> collect3 = value1.stream().filter(item -> item.getGasUserSafetyDeviceId() != null).collect(Collectors.toList());
List<TDetectorUserVillageSafetyDeviceInfoVo> collect3 = collect5.stream().filter(item -> item.getGasUserSafetyDeviceId() != null).collect(Collectors.toList());
if (collect3.size() > 0) {
......@@ -303,6 +312,8 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
userListItem.put("nickName",value2.get(0).getNickName() == null ? "" : value2.get(0).getNickName());
userListItem.put("phone",value2.get(0).getPhone() == null ? "" : value2.get(0).getPhone());
userListItem.put("address",value2.get(0).getAddress() == null ? "" : value2.get(0).getAddress());
userListItem.put("longitude",value2.get(0).getUserLongitude() == null ? "" : value2.get(0).getUserLongitude());
userListItem.put("latitude",value2.get(0).getUserLatitude() == null ? "" : value2.get(0).getUserLatitude());
userListItem.put("safetyDeviceList",safetyDeviceMapList);
userList.add(userListItem);
......@@ -420,8 +431,11 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
// 如果没关联村的就不展示了
List<TDetectorUserVillageSafetyDeviceInfoVo> collect = residentsUsers.stream().filter(item -> item.getVillageId() != null).collect(Collectors.toList());
// 村没有经纬度的就不展示了
List<TDetectorUserVillageSafetyDeviceInfoVo> collect5 = collect.stream().filter(item -> item.getLatitude() != null && item.getLongitude() != null).collect(Collectors.toList());
//按照 村id 分组
Map<Long, List<TDetectorUserVillageSafetyDeviceInfoVo>> collect1 = collect.stream().collect(Collectors.groupingBy(TDetectorUserVillageSafetyDeviceInfoVo::getVillageId));
Map<Long, List<TDetectorUserVillageSafetyDeviceInfoVo>> collect1 = collect5.stream().collect(Collectors.groupingBy(TDetectorUserVillageSafetyDeviceInfoVo::getVillageId));
for (Map.Entry<Long, List<TDetectorUserVillageSafetyDeviceInfoVo>> longListEntry : collect1.entrySet()) {
List<TDetectorUserVillageSafetyDeviceInfoVo> villageList = longListEntry.getValue();
......@@ -431,6 +445,9 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
villageMapListItem.put("villageId",key1);
villageMapListItem.put("villageName",villageList.get(0).getVillageName());
villageMapListItem.put("address",villageList.get(0).getRegionName());
villageMapListItem.put("longitude",villageList.get(0).getLongitude());
villageMapListItem.put("latitude",villageList.get(0).getLatitude());
villageMapListItem.put("iconType","6");
int userNum = 0;
int deviceNum = 0;
......
......@@ -306,9 +306,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dUser.nick_name as nickName,
dUser.phone,
dUser.address,
dUser.longitude as userLongitude,
dUser.latitude as userLatitude,
dUser.user_type as userType,
userVillage.f_village_id as villageId,
userVillage.f_village_name as villageName,
userVillage.longitude,
userVillage.latitude,
region.f_name AS regionName ,
safetyDeviceInfo.f_gasUser_safety_device_id as gasUserSafetyDeviceId,
safetyDeviceInfo.f_iot_no as iotNo,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment