Commit 9891d76e authored by wanghao's avatar wanghao

1 大屏端 用户点位加载优化

parent 085ec93e
...@@ -214,12 +214,6 @@ ...@@ -214,12 +214,6 @@
<artifactId>httpclient</artifactId> <artifactId>httpclient</artifactId>
<version>4.5.3</version> <version>4.5.3</version>
</dependency> </dependency>
<!-- 阿里巴巴获取json其中一段数据 发送http请求导入依赖-->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.9</version>
</dependency>
<!--ureport2--> <!--ureport2-->
<dependency> <dependency>
......
...@@ -35,6 +35,15 @@ public interface TDetectorUserMapper ...@@ -35,6 +35,15 @@ public interface TDetectorUserMapper
*/ */
public List<TDetectorUserVO> countTDetectorUser(TDetectorUser tDetectorUser); public List<TDetectorUserVO> countTDetectorUser(TDetectorUser tDetectorUser);
/**
* 查询 带有 设备 村庄的 燃气用户数据 只是居民用户
* @param tDetectorUser t
* @return l
*/
List<Map<String,Object>> queryDuserVilSafDevInfoOnlyResidents(TDetectorUser tDetectorUser);
List<TDetectorUserVillageSafetyDeviceInfoVo> queryDuserVilSafDevInfoOnlyResidentsInit(TDetectorUser tDetectorUser);
/** /**
* 查询 带有 设备 村庄的 燃气用户数据 * 查询 带有 设备 村庄的 燃气用户数据
* @param tDetectorUser t * @param tDetectorUser t
......
...@@ -37,8 +37,7 @@ import javax.sql.DataSource; ...@@ -37,8 +37,7 @@ import javax.sql.DataSource;
* @date 2022-02-07 * @date 2022-02-07
*/ */
@Service @Service
public class TDetectorUserServiceImpl implements ITDetectorUserService public class TDetectorUserServiceImpl implements ITDetectorUserService {
{
@Resource @Resource
private TDetectorUserMapper tDetectorUserMapper; private TDetectorUserMapper tDetectorUserMapper;
@Resource @Resource
...@@ -83,8 +82,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -83,8 +82,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
* @return 探测器用户 * @return 探测器用户
*/ */
@Override @Override
public List<TDetectorUserVO> detectorUserList(TDetectorUser tDetectorUser) public List<TDetectorUserVO> detectorUserList(TDetectorUser tDetectorUser) {
{
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
List<TDetectorUserVO> list = new ArrayList<>(); List<TDetectorUserVO> list = new ArrayList<>();
List<TDetectorUserVO> tDetectorUserList = tDetectorUserMapper.countTDetectorUser(tDetectorUser); List<TDetectorUserVO> tDetectorUserList = tDetectorUserMapper.countTDetectorUser(tDetectorUser);
...@@ -116,16 +114,18 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -116,16 +114,18 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
/** /**
* 查询探测器用户列表 地图使用 LabelMarker 标注的方式 * 查询探测器用户列表 地图使用 LabelMarker 标注的方式
*
* @param tDetectorUser tDetectorUser * @param tDetectorUser tDetectorUser
* @return r * @return r
*/ */
@Override @Override
public List<TDetectorUserVO> massMarksDetectorUserList(TDetectorUser tDetectorUser) { public List<TDetectorUserVO> massMarksDetectorUserList(TDetectorUser tDetectorUser) {
return tDetectorUserMapper.countTDetectorUserForMassMarks(tDetectorUser); return tDetectorUserMapper.countTDetectorUserForMassMarks(tDetectorUser);
} }
/** /**
* po 转 map * po 转 map
*
* @param obj o * @param obj o
* @return r * @return r
*/ */
...@@ -146,18 +146,19 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -146,18 +146,19 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
/** /**
* 查询探测器用户列表 地图使用 labelsLayerMarks 标注的方式 * 查询探测器用户列表 地图使用 labelsLayerMarks 标注的方式
*
* @param tDetectorUser tDetectorUser * @param tDetectorUser tDetectorUser
* @return r * @return r
*/ */
@Override @Override
public Map<String, List<TDetectorUserVO>> labelsLayerMarksDetectorUserList(TDetectorUser tDetectorUser) { public Map<String, List<TDetectorUserVO>> labelsLayerMarksDetectorUserList(TDetectorUser tDetectorUser) {
Map<String, List<TDetectorUserVO>> collect ; Map<String, List<TDetectorUserVO>> collect;
List<TDetectorUserVO> list = new ArrayList<>(); List<TDetectorUserVO> list = new ArrayList<>();
List<TDetectorUserVO> tDetectorUserList = tDetectorUserMapper.countTDetectorUser(tDetectorUser); List<TDetectorUserVO> tDetectorUserList = tDetectorUserMapper.countTDetectorUser(tDetectorUser);
if (tDetectorUserList.size() > 0) { if (tDetectorUserList.size() > 0) {
for(TDetectorUserVO user : tDetectorUserList){ for (TDetectorUserVO user : tDetectorUserList) {
TDetectorUserVO userVO = new TDetectorUserVO(); TDetectorUserVO userVO = new TDetectorUserVO();
BeanUtils.copyProperties(user, userVO); BeanUtils.copyProperties(user, userVO);
...@@ -165,7 +166,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -165,7 +166,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
newList.add(user); newList.add(user);
userVO.setDetectorCountList(newList); userVO.setDetectorCountList(newList);
if("1".equals(userVO.getUserType())) { if ("1".equals(userVO.getUserType())) {
userVO.setIconType("6"); userVO.setIconType("6");
} else if ("2".equals(userVO.getUserType())) { } else if ("2".equals(userVO.getUserType())) {
userVO.setIconType("61"); userVO.setIconType("61");
...@@ -186,6 +187,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -186,6 +187,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
/** /**
* 根据气瓶条码查询 气瓶详情和 气瓶追溯 * 根据气瓶条码查询 气瓶详情和 气瓶追溯
*
* @param code r * @param code r
* @return r * @return r
*/ */
...@@ -206,28 +208,27 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -206,28 +208,27 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
//最后两次的配送记录 //最后两次的配送记录
List<TLpgDeliveryRecord> lpgDeliveryRecords = tLpgDeliveryRecordMapper.queryAllByBottleCodeLimit2(code); List<TLpgDeliveryRecord> lpgDeliveryRecords = tLpgDeliveryRecordMapper.queryAllByBottleCodeLimit2(code);
List<Map<String,Object>> backToMessage = new ArrayList<>(); List<Map<String, Object>> backToMessage = new ArrayList<>();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
if (lpgAirChargeFiles.size() > 0) { if (lpgAirChargeFiles.size() > 0) {
TLpgAirChargeFiles tLpgAirChargeFiles = lpgAirChargeFiles.get(0); TLpgAirChargeFiles tLpgAirChargeFiles = lpgAirChargeFiles.get(0);
map.put("time",tLpgAirChargeFiles.getFillEndTime()); map.put("time", tLpgAirChargeFiles.getFillEndTime());
map.put("title","充装记录"); map.put("title", "充装记录");
sb.append("由充装单位为【").append(tLpgAirChargeFiles.getStationName()).append("】完成充装"); sb.append("由充装单位为【").append(tLpgAirChargeFiles.getStationName()).append("】完成充装");
map.put("message",sb.toString()); map.put("message", sb.toString());
backToMessage.add(map); backToMessage.add(map);
if(lpgAirChargeFiles.size() > 1) { if (lpgAirChargeFiles.size() > 1) {
TLpgAirChargeFiles tLpgAirChargeFiles1 = lpgAirChargeFiles.get(1); TLpgAirChargeFiles tLpgAirChargeFiles1 = lpgAirChargeFiles.get(1);
map = new HashMap<>(); map = new HashMap<>();
sb = new StringBuilder(); sb = new StringBuilder();
map.put("time",tLpgAirChargeFiles1.getFillEndTime()); map.put("time", tLpgAirChargeFiles1.getFillEndTime());
map.put("title","充装记录"); map.put("title", "充装记录");
sb.append("由充装单位为【").append(tLpgAirChargeFiles1.getStationName()).append("】完成充装"); sb.append("由充装单位为【").append(tLpgAirChargeFiles1.getStationName()).append("】完成充装");
map.put("message",sb.toString()); map.put("message", sb.toString());
backToMessage.add(map); backToMessage.add(map);
} }
} }
...@@ -238,10 +239,10 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -238,10 +239,10 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
sb = new StringBuilder(); sb = new StringBuilder();
TLpgDeliveryRecord lpgDeliveryRecord = lpgDeliveryRecords.get(0); TLpgDeliveryRecord lpgDeliveryRecord = lpgDeliveryRecords.get(0);
map.put("time",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,lpgDeliveryRecord.getDeliveryDate())); map.put("time", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, lpgDeliveryRecord.getDeliveryDate()));
map.put("title","配送记录"); map.put("title", "配送记录");
sb.append("由配送人员【").append(lpgDeliveryRecord.getDeliveryPerson()).append("】完成配送"); sb.append("由配送人员【").append(lpgDeliveryRecord.getDeliveryPerson()).append("】完成配送");
map.put("message",sb.toString()); map.put("message", sb.toString());
backToMessage.add(map); backToMessage.add(map);
if (lpgDeliveryRecords.size() > 1) { if (lpgDeliveryRecords.size() > 1) {
...@@ -250,17 +251,17 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -250,17 +251,17 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
sb = new StringBuilder(); sb = new StringBuilder();
TLpgDeliveryRecord lpgDeliveryRecord1 = lpgDeliveryRecords.get(1); TLpgDeliveryRecord lpgDeliveryRecord1 = lpgDeliveryRecords.get(1);
map.put("time",DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS,lpgDeliveryRecord1.getDeliveryDate())); map.put("time", DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, lpgDeliveryRecord1.getDeliveryDate()));
map.put("title","配送记录"); map.put("title", "配送记录");
sb.append("由配送人员【").append(lpgDeliveryRecord1.getDeliveryPerson()).append("】完成配送"); sb.append("由配送人员【").append(lpgDeliveryRecord1.getDeliveryPerson()).append("】完成配送");
map.put("message",sb.toString()); map.put("message", sb.toString());
backToMessage.add(map); backToMessage.add(map);
} }
} }
// backToMessage.sort(Comparator.comparing((Map<String, Object> mapitem) -> (Date) mapitem.get("time")).reversed()); // backToMessage.sort(Comparator.comparing((Map<String, Object> mapitem) -> (Date) mapitem.get("time")).reversed());
backToMessage.sort((a,b) ->DateUtil.parse(a.get("time").toString()).getTime() - DateUtil.parse(b.get("time").toString()).getTime() >= 0 ? -1 : 1); backToMessage.sort((a, b) -> DateUtil.parse(a.get("time").toString()).getTime() - DateUtil.parse(b.get("time").toString()).getTime() >= 0 ? -1 : 1);
lpgGasBottleFilesBackToVo.setBackToMessage(backToMessage); lpgGasBottleFilesBackToVo.setBackToMessage(backToMessage);
return lpgGasBottleFilesBackToVo; return lpgGasBottleFilesBackToVo;
...@@ -268,6 +269,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -268,6 +269,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
/** /**
* 获取探测器用户列表 大屏地图 labelsLayer 标注的方式 分页查询 居民用户 * 获取探测器用户列表 大屏地图 labelsLayer 标注的方式 分页查询 居民用户
*
* @param tDetectorUser t * @param tDetectorUser t
* @return r * @return r
*/ */
...@@ -284,13 +286,13 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -284,13 +286,13 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
tableDataInfo.setMsg("查询成功"); tableDataInfo.setMsg("查询成功");
if (tDetectorUser.getVillageId() == null) { if (tDetectorUser.getVillageId() == null) {
return tableDataInfo; return tableDataInfo;
} }
List<TDetectorUserVillageSafetyDeviceInfoVo> tDetectorUserVillageSafetyDeviceInfoVos = tDetectorUserMapper.queryDuserVilSafDevInfo(tDetectorUser); List<TDetectorUserVillageSafetyDeviceInfoVo> tDetectorUserVillageSafetyDeviceInfoVos = tDetectorUserMapper.queryDuserVilSafDevInfoOnlyResidentsInit(tDetectorUser);
// 数据封装 // 数据封装
List<Map<String, Object>> maps = residentsUserInitForPage(tDetectorUserVillageSafetyDeviceInfoVos); List<Map<String, Object>> maps = residentsUserInitForPage(tDetectorUserVillageSafetyDeviceInfoVos);
if (maps.size() > 0) { if (maps.size() > 0) {
...@@ -309,7 +311,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -309,7 +311,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
newList = fromIndex > total ? newList : maps.subList(fromIndex, toIndex); newList = fromIndex > total ? newList : maps.subList(fromIndex, toIndex);
tableDataInfo.setRows(newList); tableDataInfo.setRows(newList);
return tableDataInfo; return tableDataInfo;
} }
return tableDataInfo; return tableDataInfo;
...@@ -317,64 +319,78 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -317,64 +319,78 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
/** /**
* 查询探测器用户列表 地图使用 labelsLayerMarks 标注的方式 * 查询探测器用户列表 地图使用 labelsLayerMarks 标注的方式
*
* @param tDetectorUser tDetectorUser * @param tDetectorUser tDetectorUser
* @return r * @return r
*/ */
@Override @Override
public Map<Object, List<Map<String,Object>>> labelsLayerMarksDUserVillageSafDevInfoMap(TDetectorUser tDetectorUser) { public Map<Object, List<Map<String, Object>>> labelsLayerMarksDUserVillageSafDevInfoMap(TDetectorUser tDetectorUser) {
Map<Object, List<Map<String,Object>>> collect = new HashMap<>(); long start = System.currentTimeMillis();
// 20240904 居民用户特殊处理,带有 村 和 安全装置的概念, 工商业用户 和 餐饮用户 带有 安全装置概念 Map<Object, List<Map<String, Object>>> collect = new HashMap<>();
List<TDetectorUserVillageSafetyDeviceInfoVo> tDetectorUserVillageSafetyDeviceInfoVos = tDetectorUserMapper.queryDuserVilSafDevInfo(tDetectorUser);
if (tDetectorUserVillageSafetyDeviceInfoVos.size() > 0) { // 20240904 居民用户特殊处理,带有 村 和 安全装置的概念
// 居民用户集合 //居民用户处理
List<TDetectorUserVillageSafetyDeviceInfoVo> residentsUsers = tDetectorUserVillageSafetyDeviceInfoVos.stream().filter(item -> "1".equals(item.getUserType())).collect(Collectors.toList()); List<Map<String, Object>> list = tDetectorUserMapper.queryDuserVilSafDevInfoOnlyResidents(tDetectorUser);
if (residentsUsers.size() > 0) { List<Map<String, Object>> userMapList = new ArrayList<>();
// 居民用户 处理方式封装 for (Map<String, Object> map : list) {
List<Map<String,Object>> villageMapList = residentsUserInit(residentsUsers); map.put("userMapList",userMapList);
if (villageMapList.size() > 0) { }
collect.put("6",villageMapList); if (list.size() > 0) {
} collect.put("6", list);
} } else {
collect.put("6", new ArrayList<>());
}
// , 工商业用户 和 餐饮用户 带有 安全装置概念
List<TDetectorUserVillageSafetyDeviceInfoVo> tDetectorUserVillageSafetyDeviceInfoVos = tDetectorUserMapper.queryDuserVilSafDevInfo(tDetectorUser);
if (tDetectorUserVillageSafetyDeviceInfoVos.size() > 0) {
// 工商业用户 和 餐饮用户 // 工商业用户 和 餐饮用户
List<TDetectorUserVillageSafetyDeviceInfoVo> noResidentsUsers = tDetectorUserVillageSafetyDeviceInfoVos.stream().filter(item -> !"1".equals(item.getUserType())).collect(Collectors.toList()); Map<String, List<Map<String, Object>>> stringListMap = noResidentsUserInit(tDetectorUserVillageSafetyDeviceInfoVos);
if (noResidentsUsers.size() > 0) {
Map<String, List<Map<String, Object>>> stringListMap = noResidentsUserInit(noResidentsUsers);
if (stringListMap.size() > 0) { if (stringListMap.size() > 0) {
// 工商业用户 // 工商业用户
List<Map<String, Object>> maps = stringListMap.get("2"); List<Map<String, Object>> maps = stringListMap.get("2");
if (maps != null && maps.size() > 0) { if (maps != null && maps.size() > 0) {
collect.put("61",maps); collect.put("61", maps);
} } else {
collect.put("61", new ArrayList<>());
}
// 餐饮用户 // 餐饮用户
List<Map<String, Object>> maps1 = stringListMap.get("4"); List<Map<String, Object>> maps1 = stringListMap.get("4");
if (maps1 != null && maps1.size() > 0) { if (maps1 != null && maps1.size() > 0) {
collect.put("18",maps1); collect.put("18", maps1);
} } else {
collect.put("18", new ArrayList<>());
} }
} }
}else { } else {
collect = new HashMap<>(0); collect = new HashMap<>(0);
} }
long end = System.currentTimeMillis();
long jiange = end - start;
System.out.println("jiange ===" + jiange);
return collect; return collect;
} }
/** /**
* 居民用户 处理方式封装 * 居民用户 处理方式封装
*
* @param noResidentsUsers no * @param noResidentsUsers no
* @return m * @return m
*/ */
private Map<String,List<Map<String,Object>>> noResidentsUserInit(List<TDetectorUserVillageSafetyDeviceInfoVo> noResidentsUsers){ private Map<String, List<Map<String, Object>>> noResidentsUserInit(List<TDetectorUserVillageSafetyDeviceInfoVo> noResidentsUsers) {
Map<String,List<Map<String,Object>>> collect = new HashMap<>(); Map<String, List<Map<String, Object>>> collect = new HashMap<>();
SimpleDateFormat targetFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat targetFormat = new SimpleDateFormat("yyyy-MM-dd");
// 按照用户类型分组 // 按照用户类型分组
...@@ -384,11 +400,9 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -384,11 +400,9 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
for (Map.Entry<String, List<TDetectorUserVillageSafetyDeviceInfoVo>> stringListEntry : collectByType.entrySet()) { for (Map.Entry<String, List<TDetectorUserVillageSafetyDeviceInfoVo>> stringListEntry : collectByType.entrySet()) {
String key = stringListEntry.getKey(); String key = stringListEntry.getKey();
List<Map<String,Object>> userList = new ArrayList<>(); List<Map<String, Object>> userList = new ArrayList<>();
collect.put(key,userList);
collect.put(key, userList);
List<TDetectorUserVillageSafetyDeviceInfoVo> value = stringListEntry.getValue(); List<TDetectorUserVillageSafetyDeviceInfoVo> value = stringListEntry.getValue();
// 按照 userId 分组 // 按照 userId 分组
...@@ -398,39 +412,33 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -398,39 +412,33 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
List<TDetectorUserVillageSafetyDeviceInfoVo> value1 = longListEntry.getValue(); List<TDetectorUserVillageSafetyDeviceInfoVo> value1 = longListEntry.getValue();
// 先过滤掉 没有经纬度的
List<TDetectorUserVillageSafetyDeviceInfoVo> collect5 = value1.stream().filter(item -> item.getUserLatitude() != null && item.getUserLongitude() != null).collect(Collectors.toList());
// 再过滤掉没有 天然气类型的
List<TDetectorUserVillageSafetyDeviceInfoVo> collect6 = collect5.stream().filter(item -> item.getGasType() != null).collect(Collectors.toList());
// 过滤掉 没有装置的 // 过滤掉 没有装置的
List<TDetectorUserVillageSafetyDeviceInfoVo> collect2 = collect6.stream().filter(item -> item.getGasUserSafetyDeviceId() == null).collect(Collectors.toList()); List<TDetectorUserVillageSafetyDeviceInfoVo> collect2 = value1.stream().filter(item -> item.getGasUserSafetyDeviceId() == null).collect(Collectors.toList());
// 没有装置的 直接 封装用户数据 // 没有装置的 直接 封装用户数据
if (collect2.size() > 0) { if (collect2.size() > 0) {
for (TDetectorUserVillageSafetyDeviceInfoVo tDetectorUserVillageSafetyDeviceInfoVo : collect2) { for (TDetectorUserVillageSafetyDeviceInfoVo tDetectorUserVillageSafetyDeviceInfoVo : collect2) {
List<Map<String,Object>> safetyDeviceMapList= new ArrayList<>(); List<Map<String, Object>> safetyDeviceMapList = new ArrayList<>();
Map<String,Object> userListItem = new HashMap<>(); Map<String, Object> userListItem = new HashMap<>();
userListItem.put("userId",tDetectorUserVillageSafetyDeviceInfoVo.getUserId()); userListItem.put("userId", tDetectorUserVillageSafetyDeviceInfoVo.getUserId());
userListItem.put("nickName",tDetectorUserVillageSafetyDeviceInfoVo.getNickName()); userListItem.put("nickName", tDetectorUserVillageSafetyDeviceInfoVo.getNickName());
userListItem.put("phone",tDetectorUserVillageSafetyDeviceInfoVo.getPhone()); userListItem.put("phone", tDetectorUserVillageSafetyDeviceInfoVo.getPhone());
userListItem.put("address",tDetectorUserVillageSafetyDeviceInfoVo.getAddress()); userListItem.put("address", tDetectorUserVillageSafetyDeviceInfoVo.getAddress());
userListItem.put("longitude",tDetectorUserVillageSafetyDeviceInfoVo.getUserLongitude()); userListItem.put("longitude", tDetectorUserVillageSafetyDeviceInfoVo.getUserLongitude());
userListItem.put("gasType",tDetectorUserVillageSafetyDeviceInfoVo.getGasType()); userListItem.put("gasType", tDetectorUserVillageSafetyDeviceInfoVo.getGasType());
userListItem.put("latitude",tDetectorUserVillageSafetyDeviceInfoVo.getUserLatitude()); userListItem.put("latitude", tDetectorUserVillageSafetyDeviceInfoVo.getUserLatitude());
if ("2".equals(tDetectorUserVillageSafetyDeviceInfoVo.getUserType())) { if ("2".equals(tDetectorUserVillageSafetyDeviceInfoVo.getUserType())) {
userListItem.put("iconType","61"); userListItem.put("iconType", "61");
} else if ("4".equals(tDetectorUserVillageSafetyDeviceInfoVo.getUserType())) { } else if ("4".equals(tDetectorUserVillageSafetyDeviceInfoVo.getUserType())) {
userListItem.put("iconType","18"); userListItem.put("iconType", "18");
} }
userListItem.put("safetyDeviceList",safetyDeviceMapList); userListItem.put("safetyDeviceList", safetyDeviceMapList);
userList.add(userListItem); userList.add(userListItem);
} }
} }
// 过滤掉 有装置的 // 过滤掉 有装置的
List<TDetectorUserVillageSafetyDeviceInfoVo> collect3 = collect6.stream().filter(item -> item.getGasUserSafetyDeviceId() != null).collect(Collectors.toList()); List<TDetectorUserVillageSafetyDeviceInfoVo> collect3 = value1.stream().filter(item -> item.getGasUserSafetyDeviceId() != null).collect(Collectors.toList());
if (collect3.size() > 0) { if (collect3.size() > 0) {
...@@ -439,21 +447,21 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -439,21 +447,21 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
List<TDetectorUserVillageSafetyDeviceInfoVo> value2 = listEntry.getValue(); List<TDetectorUserVillageSafetyDeviceInfoVo> value2 = listEntry.getValue();
List<Map<String,Object>> safetyDeviceMapList= new ArrayList<>(); List<Map<String, Object>> safetyDeviceMapList = new ArrayList<>();
Map<String,Object> userListItem = new HashMap<>(); Map<String, Object> userListItem = new HashMap<>();
userListItem.put("userId",value2.get(0).getUserId()); userListItem.put("userId", value2.get(0).getUserId());
userListItem.put("nickName",value2.get(0).getNickName() == null ? "" : value2.get(0).getNickName()); 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("phone", value2.get(0).getPhone() == null ? "" : value2.get(0).getPhone());
userListItem.put("address",value2.get(0).getAddress() == null ? "" : value2.get(0).getAddress()); 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("longitude", value2.get(0).getUserLongitude() == null ? "" : value2.get(0).getUserLongitude());
userListItem.put("latitude",value2.get(0).getUserLatitude() == null ? "" : value2.get(0).getUserLatitude()); userListItem.put("latitude", value2.get(0).getUserLatitude() == null ? "" : value2.get(0).getUserLatitude());
userListItem.put("gasType",value2.get(0).getGasType() == null ? "" : value2.get(0).getGasType()); userListItem.put("gasType", value2.get(0).getGasType() == null ? "" : value2.get(0).getGasType());
if (value2.get(0).getUserType() != null && "2".equals(value2.get(0).getUserType())) { if (value2.get(0).getUserType() != null && "2".equals(value2.get(0).getUserType())) {
userListItem.put("iconType","61"); userListItem.put("iconType", "61");
} else if (value2.get(0).getUserType() != null && "4".equals(value2.get(0).getUserType())) { } else if (value2.get(0).getUserType() != null && "4".equals(value2.get(0).getUserType())) {
userListItem.put("iconType","18"); userListItem.put("iconType", "18");
} }
userListItem.put("safetyDeviceList",safetyDeviceMapList); userListItem.put("safetyDeviceList", safetyDeviceMapList);
userList.add(userListItem); userList.add(userListItem);
for (TDetectorUserVillageSafetyDeviceInfoVo tDetectorUserVillageSafetyDeviceInfoVo : value2) { for (TDetectorUserVillageSafetyDeviceInfoVo tDetectorUserVillageSafetyDeviceInfoVo : value2) {
...@@ -466,9 +474,9 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -466,9 +474,9 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
safetyDeviceMapItem.put("deviceInstallTime", tDetectorUserVillageSafetyDeviceInfoVo.getDeviceInstallTime()); safetyDeviceMapItem.put("deviceInstallTime", tDetectorUserVillageSafetyDeviceInfoVo.getDeviceInstallTime());
if (tDetectorUserVillageSafetyDeviceInfoVo.getDeviceInstallTime() != null) { if (tDetectorUserVillageSafetyDeviceInfoVo.getDeviceInstallTime() != null) {
String format = targetFormat.format(tDetectorUserVillageSafetyDeviceInfoVo.getDeviceInstallTime()); String format = targetFormat.format(tDetectorUserVillageSafetyDeviceInfoVo.getDeviceInstallTime());
safetyDeviceMapItem.put("deviceInstallTime",format); safetyDeviceMapItem.put("deviceInstallTime", format);
} else { } else {
safetyDeviceMapItem.put("deviceInstallTime",""); safetyDeviceMapItem.put("deviceInstallTime", "");
} }
safetyDeviceMapList.add(safetyDeviceMapItem); safetyDeviceMapList.add(safetyDeviceMapItem);
} }
...@@ -481,13 +489,14 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -481,13 +489,14 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
/** /**
* 居民用户 处理方式封装 提供分压查询功能了。 * 居民用户 处理方式封装 提供分压查询功能了。
*
* @param residentsUsers r * @param residentsUsers r
* @return m * @return m
*/ */
private List<Map<String,Object>> residentsUserInitForPage(List<TDetectorUserVillageSafetyDeviceInfoVo> residentsUsers) { private List<Map<String, Object>> residentsUserInitForPage(List<TDetectorUserVillageSafetyDeviceInfoVo> residentsUsers) {
//返回 userlist //返回 userlist
List<Map<String,Object>> userMapList= new ArrayList<>(); List<Map<String, Object>> userMapList = new ArrayList<>();
SimpleDateFormat targetFormat = new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat targetFormat = new SimpleDateFormat("yyyy-MM-dd");
if (residentsUsers.size() > 0) { if (residentsUsers.size() > 0) {
...@@ -511,25 +520,25 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -511,25 +520,25 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
// 按照 用户 分组 // 按照 用户 分组
Map<Long, List<TDetectorUserVillageSafetyDeviceInfoVo>> collect2 = villageList.stream().collect(Collectors.groupingBy(TDetectorUserVillageSafetyDeviceInfoVo::getUserId)); Map<Long, List<TDetectorUserVillageSafetyDeviceInfoVo>> collect2 = villageList.stream().collect(Collectors.groupingBy(TDetectorUserVillageSafetyDeviceInfoVo::getUserId));
if(collect2.size() > 0) { if (collect2.size() > 0) {
// 拿到用户数,并组装用户数据 // 拿到用户数,并组装用户数据
userNum = collect2.size(); userNum = collect2.size();
for (Map.Entry<Long, List<TDetectorUserVillageSafetyDeviceInfoVo>> listEntry : collect2.entrySet()) { for (Map.Entry<Long, List<TDetectorUserVillageSafetyDeviceInfoVo>> listEntry : collect2.entrySet()) {
List<Map<String,Object>> safetyDeviceMapList= new ArrayList<>(); List<Map<String, Object>> safetyDeviceMapList = new ArrayList<>();
List<String> gasBottleTitleList = new ArrayList<>(); List<String> gasBottleTitleList = new ArrayList<>();
List<TDetectorUserVillageSafetyDeviceInfoVo> userList = listEntry.getValue(); List<TDetectorUserVillageSafetyDeviceInfoVo> userList = listEntry.getValue();
Long key = listEntry.getKey(); Long key = listEntry.getKey();
// 封装用户数 // 封装用户数
Map<String,Object> userMapListItme = new HashMap<>(); Map<String, Object> userMapListItme = new HashMap<>();
userMapListItme.put("userId",key); userMapListItme.put("userId", key);
userMapListItme.put("nickName",userList.get(0).getNickName() == null ? "" : userList.get(0).getNickName()); userMapListItme.put("nickName", userList.get(0).getNickName() == null ? "" : userList.get(0).getNickName());
userMapListItme.put("phone",userList.get(0).getPhone() == null ? "" : userList.get(0).getPhone()); userMapListItme.put("phone", userList.get(0).getPhone() == null ? "" : userList.get(0).getPhone());
userMapListItme.put("address",userList.get(0).getAddress() == null ? "" : userList.get(0).getAddress()); userMapListItme.put("address", userList.get(0).getAddress() == null ? "" : userList.get(0).getAddress());
userMapListItme.put("safetyDeviceList",safetyDeviceMapList); userMapListItme.put("safetyDeviceList", safetyDeviceMapList);
// 过滤掉 没有 安全装置的 // 过滤掉 没有 安全装置的
List<TDetectorUserVillageSafetyDeviceInfoVo> collect4 = userList.stream().filter(item -> item.getGasUserSafetyDeviceId() != null).collect(Collectors.toList()); List<TDetectorUserVillageSafetyDeviceInfoVo> collect4 = userList.stream().filter(item -> item.getGasUserSafetyDeviceId() != null).collect(Collectors.toList());
...@@ -555,9 +564,9 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -555,9 +564,9 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
safetyDeviceMapItem.put("detctionMedium", tDetectorUserVillageSafetyDeviceInfoVo.getDetctionMedium()); safetyDeviceMapItem.put("detctionMedium", tDetectorUserVillageSafetyDeviceInfoVo.getDetctionMedium());
if (tDetectorUserVillageSafetyDeviceInfoVo.getDeviceInstallTime() != null) { if (tDetectorUserVillageSafetyDeviceInfoVo.getDeviceInstallTime() != null) {
String format = targetFormat.format(tDetectorUserVillageSafetyDeviceInfoVo.getDeviceInstallTime()); String format = targetFormat.format(tDetectorUserVillageSafetyDeviceInfoVo.getDeviceInstallTime());
safetyDeviceMapItem.put("deviceInstallTime",format); safetyDeviceMapItem.put("deviceInstallTime", format);
} else { } else {
safetyDeviceMapItem.put("deviceInstallTime",""); safetyDeviceMapItem.put("deviceInstallTime", "");
} }
safetyDeviceMapList.add(safetyDeviceMapItem); safetyDeviceMapList.add(safetyDeviceMapItem);
} }
...@@ -566,21 +575,21 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -566,21 +575,21 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
} }
// 封装 气瓶条码,只是气瓶条码,然后点击条码再查询详细数据 // 封装 气瓶条码,只是气瓶条码,然后点击条码再查询详细数据
userMapListItme.put("gasBottleTitleList",gasBottleTitleList); userMapListItme.put("gasBottleTitleList", gasBottleTitleList);
List<UserLinkGasBottleTitleDTO> userLinkGasBottleTitleDTOS1 = collect6.get(key); List<UserLinkGasBottleTitleDTO> userLinkGasBottleTitleDTOS1 = collect6.get(key);
if (userLinkGasBottleTitleDTOS1 != null && userLinkGasBottleTitleDTOS1.size() > 0) { if (userLinkGasBottleTitleDTOS1 != null && userLinkGasBottleTitleDTOS1.size() > 0) {
List<String> collect7 = userLinkGasBottleTitleDTOS1.stream().map(UserLinkGasBottleTitleDTO::getrCode).collect(Collectors.toList()); List<String> collect7 = userLinkGasBottleTitleDTOS1.stream().map(UserLinkGasBottleTitleDTO::getrCode).collect(Collectors.toList());
List<Map<String,Object>> gasBottleTitleMapList = new ArrayList<>(); List<Map<String, Object>> gasBottleTitleMapList = new ArrayList<>();
if (collect7.size() > 0) { if (collect7.size() > 0) {
for (String s : collect7) { for (String s : collect7) {
Map<String,Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
if (StringUtils.isNotBlank(s)) { if (StringUtils.isNotBlank(s)) {
map.put("code",s); map.put("code", s);
gasBottleTitleMapList.add(map); gasBottleTitleMapList.add(map);
} }
} }
} }
userMapListItme.put("gasBottleTitleList",gasBottleTitleMapList); userMapListItme.put("gasBottleTitleList", gasBottleTitleMapList);
} }
userMapList.add(userMapListItme); userMapList.add(userMapListItme);
} }
...@@ -592,13 +601,14 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -592,13 +601,14 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
/** /**
* 居民用户 处理方式封装 * 居民用户 处理方式封装
*
* @param residentsUsers r * @param residentsUsers r
* @return m * @return m
*/ */
private List<Map<String,Object>> residentsUserInit(List<TDetectorUserVillageSafetyDeviceInfoVo> residentsUsers) { private List<Map<String, Object>> residentsUserInit(List<TDetectorUserVillageSafetyDeviceInfoVo> residentsUsers) {
//遍历 村 集合 //遍历 村 集合
List<Map<String,Object>> villageMapList= new ArrayList<>(); List<Map<String, Object>> villageMapList = new ArrayList<>();
if (residentsUsers.size() > 0) { if (residentsUsers.size() > 0) {
// 如果没关联村的就不展示了 // 如果没关联村的就不展示了
...@@ -619,21 +629,21 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -619,21 +629,21 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
List<TDetectorUserVillageSafetyDeviceInfoVo> villageList = longListEntry.getValue(); List<TDetectorUserVillageSafetyDeviceInfoVo> villageList = longListEntry.getValue();
Long key1 = longListEntry.getKey(); Long key1 = longListEntry.getKey();
// 封装 村数据 // 封装 村数据
Map<String,Object> villageMapListItem = new HashMap<>(); Map<String, Object> villageMapListItem = new HashMap<>();
villageMapListItem.put("villageId",key1); villageMapListItem.put("villageId", key1);
villageMapListItem.put("villageName",villageList.get(0).getVillageName()); villageMapListItem.put("villageName", villageList.get(0).getVillageName());
villageMapListItem.put("address",villageList.get(0).getRegionName()); villageMapListItem.put("address", villageList.get(0).getRegionName());
villageMapListItem.put("longitude",villageList.get(0).getLongitude()); villageMapListItem.put("longitude", villageList.get(0).getLongitude());
villageMapListItem.put("latitude",villageList.get(0).getLatitude()); villageMapListItem.put("latitude", villageList.get(0).getLatitude());
villageMapListItem.put("iconType","6"); villageMapListItem.put("iconType", "6");
int userNum = 0; int userNum = 0;
int deviceNum = 0; int deviceNum = 0;
// 按照 用户 分组 // 按照 用户 分组
Map<Long, List<TDetectorUserVillageSafetyDeviceInfoVo>> collect2 = villageList.stream().collect(Collectors.groupingBy(TDetectorUserVillageSafetyDeviceInfoVo::getUserId)); Map<Long, List<TDetectorUserVillageSafetyDeviceInfoVo>> collect2 = villageList.stream().collect(Collectors.groupingBy(TDetectorUserVillageSafetyDeviceInfoVo::getUserId));
List<Map<String,Object>> userMapList= new ArrayList<>(); List<Map<String, Object>> userMapList = new ArrayList<>();
if(collect2.size() > 0) { if (collect2.size() > 0) {
// 拿到用户数,并组装用户数据 // 拿到用户数,并组装用户数据
userNum = collect2.size(); userNum = collect2.size();
...@@ -653,14 +663,14 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -653,14 +663,14 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
} }
} }
villageMapListItem.put("userNum",userNum); villageMapListItem.put("userNum", userNum);
villageMapListItem.put("deviceNum",deviceNum); villageMapListItem.put("deviceNum", deviceNum);
villageMapListItem.put("userMapList",userMapList); villageMapListItem.put("userMapList", userMapList);
List<UserLinkGasBottleIdDTO> userLinkGasBottleIdDTOS1 = collect7.get(key1); List<UserLinkGasBottleIdDTO> userLinkGasBottleIdDTOS1 = collect7.get(key1);
if (userLinkGasBottleIdDTOS1 != null && userLinkGasBottleIdDTOS1.size() > 0) { if (userLinkGasBottleIdDTOS1 != null && userLinkGasBottleIdDTOS1.size() > 0) {
villageMapListItem.put("gasBottle",userLinkGasBottleIdDTOS1.size()); villageMapListItem.put("gasBottle", userLinkGasBottleIdDTOS1.size());
} else { } else {
villageMapListItem.put("gasBottle",0); villageMapListItem.put("gasBottle", 0);
} }
villageMapList.add(villageMapListItem); villageMapList.add(villageMapListItem);
} }
...@@ -719,30 +729,29 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -719,30 +729,29 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
* @return 探测器用户 * @return 探测器用户
*/ */
@Override @Override
public List<Map> getDetectorUserAlarmList() public List<Map> getDetectorUserAlarmList() {
{
List<Map> list = new ArrayList<>(); List<Map> list = new ArrayList<>();
// 查询报警用户 // 查询报警用户
List<Map> userList = tDetectorUserMapper.getDetectorUserAlarmList(); List<Map> userList = tDetectorUserMapper.getDetectorUserAlarmList();
for(Map map : userList){ for (Map map : userList) {
map.put("iconType", "6"); map.put("iconType", "6");
list.add(map); list.add(map);
} }
// 查询报警设备 // 查询报警设备
List<Map> infoList = tDeviceInfoMapper.getDeviceInfoAlarmList(); List<Map> infoList = tDeviceInfoMapper.getDeviceInfoAlarmList();
for(Map map : infoList){ for (Map map : infoList) {
// deviceType:1阀门井 2调压箱 // deviceType:1阀门井 2调压箱
if(map.get("deviceType").equals("1")){ if (map.get("deviceType").equals("1")) {
map.put("iconType", "3"); map.put("iconType", "3");
} else if(map.get("deviceType").equals("2")){ } else if (map.get("deviceType").equals("2")) {
map.put("iconType", "2"); map.put("iconType", "2");
} }
list.add(map); list.add(map);
} }
// 查询报警场站 // 查询报警场站
List<Map> stationList = tSiteStationInfoMapper.getSiteStationAlarmList(); List<Map> stationList = tSiteStationInfoMapper.getSiteStationAlarmList();
for(Map map : stationList){ for (Map map : stationList) {
map.put("iconType", "4"); map.put("iconType", "4");
list.add(map); list.add(map);
} }
...@@ -757,13 +766,12 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -757,13 +766,12 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
* @return 探测器用户 * @return 探测器用户
*/ */
@Override @Override
public List<TDetectorUserVO> detectorUserAlarmList(TDetectorUser tDetectorUser) public List<TDetectorUserVO> detectorUserAlarmList(TDetectorUser tDetectorUser) {
{
List<TDetectorUserVO> list = new ArrayList<>(); List<TDetectorUserVO> list = new ArrayList<>();
List<TDetectorUserVO> tDetectorUserList = tDetectorUserMapper.countTDetectorUser(tDetectorUser); List<TDetectorUserVO> tDetectorUserList = tDetectorUserMapper.countTDetectorUser(tDetectorUser);
List<Object> initList = new ArrayList<>(); List<Object> initList = new ArrayList<>();
for(TDetectorUserVO user : tDetectorUserList) { for (TDetectorUserVO user : tDetectorUserList) {
TDetectorUserVO userVO = new TDetectorUserVO(); TDetectorUserVO userVO = new TDetectorUserVO();
BeanUtils.copyProperties(user, userVO); BeanUtils.copyProperties(user, userVO);
initList.add(userVO); initList.add(userVO);
...@@ -782,8 +790,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -782,8 +790,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
* @return 燃气用户 * @return 燃气用户
*/ */
@Override @Override
public List<TDetectorUser> selectTDetectorUser(TDetectorUser tDetectorUser) public List<TDetectorUser> selectTDetectorUser(TDetectorUser tDetectorUser) {
{
return tDetectorUserMapper.selectTDetectorUser(tDetectorUser); return tDetectorUserMapper.selectTDetectorUser(tDetectorUser);
} }
...@@ -794,8 +801,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -794,8 +801,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
* @return 燃气用户 * @return 燃气用户
*/ */
@Override @Override
public TDetectorUser selectTDetectorUserById(Long userId) public TDetectorUser selectTDetectorUserById(Long userId) {
{
return tDetectorUserMapper.selectTDetectorUserById(userId); return tDetectorUserMapper.selectTDetectorUserById(userId);
} }
...@@ -806,13 +812,13 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -806,13 +812,13 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
* @return 燃气用户 * @return 燃气用户
*/ */
@Override @Override
public List<TDetectorUser> selectTDetectorUserList(TDetectorUser tDetectorUser) public List<TDetectorUser> selectTDetectorUserList(TDetectorUser tDetectorUser) {
{
return tDetectorUserMapper.selectTDetectorUserList(tDetectorUser); return tDetectorUserMapper.selectTDetectorUserList(tDetectorUser);
} }
/** /**
* 查询导入的错误数据 * 查询导入的错误数据
*
* @return r * @return r
*/ */
@Override @Override
...@@ -821,23 +827,24 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -821,23 +827,24 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
LoginUser loginUser = SecurityUtils.getLoginUser(); LoginUser loginUser = SecurityUtils.getLoginUser();
String deptId = loginUser.getUser().getDeptId(); String deptId = loginUser.getUser().getDeptId();
return tDetectorUserMapper.queryErrorDetectorUserList(deptId,gasType); return tDetectorUserMapper.queryErrorDetectorUserList(deptId, gasType);
} }
@Override @Override
public List<TDetectorUser> queryByUserOwnIdAndEnterpriseIdForThirdParty(List<String> userOwnIds, String enterpriseId) { public List<TDetectorUser> queryByUserOwnIdAndEnterpriseIdForThirdParty(List<String> userOwnIds, String enterpriseId) {
return tDetectorUserMapper.queryByUserOwnIdAndEnterpriseIdForThirdParty(userOwnIds,enterpriseId); return tDetectorUserMapper.queryByUserOwnIdAndEnterpriseIdForThirdParty(userOwnIds, enterpriseId);
} }
/** /**
* 根据userOwnIds 和 enterpriseId 查询数据 * 根据userOwnIds 和 enterpriseId 查询数据
* @param userOwnIds u *
* @param userOwnIds u
* @param enterpriseId e * @param enterpriseId e
* @return r * @return r
*/ */
@Override @Override
public List<TDetectorUser> queryByUserOwnIdsAndEnterpriseId(List<String> userOwnIds, String enterpriseId) { public List<TDetectorUser> queryByUserOwnIdsAndEnterpriseId(List<String> userOwnIds, String enterpriseId) {
return tDetectorUserMapper.queryByUserOwnIdsAndEnterpriseId(userOwnIds,enterpriseId); return tDetectorUserMapper.queryByUserOwnIdsAndEnterpriseId(userOwnIds, enterpriseId);
} }
/** /**
...@@ -853,6 +860,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -853,6 +860,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
/** /**
* 查询燃气用户列表 - 导出使用 * 查询燃气用户列表 - 导出使用
*
* @param tDetectorUser t * @param tDetectorUser t
* @return r * @return r
*/ */
...@@ -862,9 +870,10 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -862,9 +870,10 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
} }
@Override @Override
public List<TDetectorUser> selectTDetectorListstatus(TDetectorUser tDetectorUser){ public List<TDetectorUser> selectTDetectorListstatus(TDetectorUser tDetectorUser) {
return tDetectorUserMapper.selectTDetectorListstatus(tDetectorUser); return tDetectorUserMapper.selectTDetectorListstatus(tDetectorUser);
} }
/** /**
* 新增燃气用户 * 新增燃气用户
* *
...@@ -872,8 +881,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -872,8 +881,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int insertTDetectorUser(TDetectorUser tDetectorUser) public int insertTDetectorUser(TDetectorUser tDetectorUser) {
{
return tDetectorUserMapper.insertTDetectorUser(tDetectorUser); return tDetectorUserMapper.insertTDetectorUser(tDetectorUser);
} }
...@@ -884,6 +892,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -884,6 +892,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
/** /**
* 批量插入 第三方传输来的数据 * 批量插入 第三方传输来的数据
*
* @param tYehuaqiUsers r * @param tYehuaqiUsers r
* @return r * @return r
*/ */
...@@ -894,6 +903,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -894,6 +903,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
/** /**
* 新增燃气用户 和 安全装置 * 新增燃气用户 和 安全装置
*
* @param gasUserAndSafetyDeviceVo gas * @param gasUserAndSafetyDeviceVo gas
* @return r * @return r
*/ */
...@@ -914,6 +924,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -914,6 +924,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
/** /**
* 修改燃气用户 和 安全装置 * 修改燃气用户 和 安全装置
*
* @param gasUserAndSafetyDeviceVo gas * @param gasUserAndSafetyDeviceVo gas
* @return r * @return r
*/ */
...@@ -939,6 +950,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -939,6 +950,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
/** /**
* 批量修改 * 批量修改
*
* @param list l * @param list l
* @return r * @return r
*/ */
...@@ -949,6 +961,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -949,6 +961,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
/** /**
* 根据用户id 集合删除 安全装置 * 根据用户id 集合删除 安全装置
*
* @param userIds u * @param userIds u
* @return * @return
*/ */
...@@ -964,8 +977,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -964,8 +977,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int updateTDetectorUser(TDetectorUser tDetectorUser) public int updateTDetectorUser(TDetectorUser tDetectorUser) {
{
tDetectorUser.setUpdateTime(DateUtils.getNowDate()); tDetectorUser.setUpdateTime(DateUtils.getNowDate());
return tDetectorUserMapper.updateTDetectorUser(tDetectorUser); return tDetectorUserMapper.updateTDetectorUser(tDetectorUser);
} }
...@@ -977,8 +989,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -977,8 +989,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteTDetectorUserByIds(Long[] userIds) public int deleteTDetectorUserByIds(Long[] userIds) {
{
return tDetectorUserMapper.deleteTDetectorUserByIds(userIds); return tDetectorUserMapper.deleteTDetectorUserByIds(userIds);
} }
...@@ -989,21 +1000,22 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -989,21 +1000,22 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteTDetectorUserById(Long userId) public int deleteTDetectorUserById(Long userId) {
{
return tDetectorUserMapper.deleteTDetectorUserById(userId); return tDetectorUserMapper.deleteTDetectorUserById(userId);
} }
/** /**
* 用户数量 * 用户数量
*
* @return * @return
*/ */
public Map<String,Object> selectUserNum(){ public Map<String, Object> selectUserNum() {
return tDetectorUserMapper.selectUserNum(); return tDetectorUserMapper.selectUserNum();
} }
/** /**
* 查询用户统计信息 * 查询用户统计信息
*
* @return * @return
*/ */
@Override @Override
...@@ -1013,25 +1025,27 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -1013,25 +1025,27 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
/** /**
* 获取用户安检信息 * 获取用户安检信息
*
* @param inspectVo * @param inspectVo
* @return * @return
*/ */
@Override @Override
public List<TDetectorUserInspectVo> getDetectorUserInspectInfo(TDetectorUserInspectVo inspectVo){ public List<TDetectorUserInspectVo> getDetectorUserInspectInfo(TDetectorUserInspectVo inspectVo) {
return tDetectorUserMapper.getDetectorUserInspectInfo(inspectVo); return tDetectorUserMapper.getDetectorUserInspectInfo(inspectVo);
} }
/** /**
* 燃气用户导入 * 燃气用户导入
* @param XmbhList 用户数据列表 *
* @param XmbhList 用户数据列表
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据 * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
* @param operName 操作用户 * @param operName 操作用户
* @param response * @param response
* @return * @return
*/ */
@Override @Override
public String importEmployedPeopleInfo(List<UserManageGasUserExportVo> XmbhList, Boolean isUpdateSupport, String operName, HttpServletResponse response) { public String importEmployedPeopleInfo(List<UserManageGasUserExportVo> XmbhList, Boolean isUpdateSupport, String operName, HttpServletResponse response) {
if(XmbhList.size() > 0) { if (XmbhList.size() > 0) {
for (UserManageGasUserExportVo userManageGasUserExportVo : XmbhList) { for (UserManageGasUserExportVo userManageGasUserExportVo : XmbhList) {
System.out.println(userManageGasUserExportVo.getLinkman()); System.out.println(userManageGasUserExportVo.getLinkman());
} }
...@@ -1042,6 +1056,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -1042,6 +1056,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
/** /**
* 处理解析好的 自定义模版的导入的数据 * 处理解析好的 自定义模版的导入的数据
*
* @param dataInfos d * @param dataInfos d
*/ */
@Override @Override
...@@ -1052,15 +1067,16 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -1052,15 +1067,16 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
/** /**
* 处理解析好的 自定义模版的导入的数据 多sheet * 处理解析好的 自定义模版的导入的数据 多sheet
* @param gasUserExportVos d 燃气用户数据 *
* @param safetyDeviceExportVos s 安全装置信息 * @param gasUserExportVos d 燃气用户数据
* @param safetyDeviceExportVos s 安全装置信息
* @param reImportOfIncorrectDataFlag r 错误数据重新导入标志 true 表示错误数据重新导入 * @param reImportOfIncorrectDataFlag r 错误数据重新导入标志 true 表示错误数据重新导入
*/ */
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void handleCustomMoreSheetImportData(List<UserManageGasUserExportVo> gasUserExportVos, public void handleCustomMoreSheetImportData(List<UserManageGasUserExportVo> gasUserExportVos,
List<UserManageSafetyDeviceExportVo> safetyDeviceExportVos, List<UserManageSafetyDeviceExportVo> safetyDeviceExportVos,
boolean updateSupport,boolean reImportOfIncorrectDataFlag,String gasType) { boolean updateSupport, boolean reImportOfIncorrectDataFlag, String gasType) {
List<TDetectorUser> successDataList = new ArrayList<>(); List<TDetectorUser> successDataList = new ArrayList<>();
...@@ -1084,15 +1100,15 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -1084,15 +1100,15 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
String beyondEnterpriseName = gasUserExportVo.getBeyondEnterpriseName(); String beyondEnterpriseName = gasUserExportVo.getBeyondEnterpriseName();
String villageName = gasUserExportVo.getVillageName(); String villageName = gasUserExportVo.getVillageName();
if(!reImportOfIncorrectDataFlag) { if (!reImportOfIncorrectDataFlag) {
if (StringUtils.isBlank(userOwnId)) { if (StringUtils.isBlank(userOwnId)) {
stringBuilder.append("用户自由id为空|"); stringBuilder.append("用户自由id为空|");
} }
} }
if ((StringUtils.isNotBlank(userType))){ if ((StringUtils.isNotBlank(userType))) {
if (!"1".equals(userType) && !"2".equals(userType)&& !"3".equals(userType)&& !"4".equals(userType)) { if (!"1".equals(userType) && !"2".equals(userType) && !"3".equals(userType) && !"4".equals(userType)) {
stringBuilder.append("用户类型数据没按提示录入|"); stringBuilder.append("用户类型数据没按提示录入|");
} }
} }
...@@ -1114,9 +1130,9 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -1114,9 +1130,9 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
TUserManageVillage tUserManageVillage = new TUserManageVillage(); TUserManageVillage tUserManageVillage = new TUserManageVillage();
tUserManageVillage.setfVillageName(villageName); tUserManageVillage.setfVillageName(villageName);
List<TUserManageVillage> tUserManageVillages = villageMapper.selectTUserManageVillageList(tUserManageVillage); List<TUserManageVillage> tUserManageVillages = villageMapper.selectTUserManageVillageList(tUserManageVillage);
if(tUserManageVillages == null || tUserManageVillages.size() == 0) { if (tUserManageVillages == null || tUserManageVillages.size() == 0) {
stringBuilder.append("居住区(村、庄)不存在|"); stringBuilder.append("居住区(村、庄)不存在|");
} else{ } else {
Long aLong = tUserManageVillages.get(0).getfVillageId(); Long aLong = tUserManageVillages.get(0).getfVillageId();
gasUserExportVo.setVillageId(aLong); gasUserExportVo.setVillageId(aLong);
} }
...@@ -1131,10 +1147,10 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -1131,10 +1147,10 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
tDetectorUserError.setErrorMsg(stringBuilder.toString()); tDetectorUserError.setErrorMsg(stringBuilder.toString());
stringBuilder = new StringBuilder(); stringBuilder = new StringBuilder();
errorDataList.add(tDetectorUserError); errorDataList.add(tDetectorUserError);
//正确数据 //正确数据
} else { } else {
TDetectorUser detectorUser = new TDetectorUser(); TDetectorUser detectorUser = new TDetectorUser();
BeanUtils.copyProperties(gasUserExportVo,detectorUser); BeanUtils.copyProperties(gasUserExportVo, detectorUser);
successDataList.add(detectorUser); successDataList.add(detectorUser);
} }
} }
...@@ -1146,13 +1162,13 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -1146,13 +1162,13 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
} }
//正确数据插入后 生成id,再关联 安全装置 //正确数据插入后 生成id,再关联 安全装置
if(successDataList.size() > 0) { if (successDataList.size() > 0) {
//成功的数据里面如果有 userId,那说明是要修改的 要做区分 //成功的数据里面如果有 userId,那说明是要修改的 要做区分
List<TDetectorUser> addCollect = successDataList.stream().filter(item -> item.getUserId() == null).collect(Collectors.toList()); List<TDetectorUser> addCollect = successDataList.stream().filter(item -> item.getUserId() == null).collect(Collectors.toList());
if(addCollect.size() > 0) { if (addCollect.size() > 0) {
tDetectorUserMapper.insertBatch(addCollect); tDetectorUserMapper.insertBatch(addCollect);
if(safetyDeviceList != null && safetyDeviceList.size() > 0) { if (safetyDeviceList != null && safetyDeviceList.size() > 0) {
List<TGasuserSafetyDeviceInfo> gasuserSafetyDeviceInfoList = new ArrayList<>(); List<TGasuserSafetyDeviceInfo> gasuserSafetyDeviceInfoList = new ArrayList<>();
//正确的 和 错误的 都是先出入 后 再统一处理 安全装置。 //正确的 和 错误的 都是先出入 后 再统一处理 安全装置。
...@@ -1197,17 +1213,17 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -1197,17 +1213,17 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
try (Connection conn = dataSource.getConnection()) { try (Connection conn = dataSource.getConnection()) {
PreparedStatement pstmt = conn.prepareStatement(sql); PreparedStatement pstmt = conn.prepareStatement(sql);
for (TDetectorUser detectorUser : updateCollect) { for (TDetectorUser detectorUser : updateCollect) {
pstmt.setString(1,detectorUser.getNickName()); pstmt.setString(1, detectorUser.getNickName());
pstmt.setString(2,detectorUser.getUserType()); pstmt.setString(2, detectorUser.getUserType());
pstmt.setString(3,detectorUser.getGasType()); pstmt.setString(3, detectorUser.getGasType());
pstmt.setLong(4,detectorUser.getVillageId()); pstmt.setLong(4, detectorUser.getVillageId());
pstmt.setString(5,detectorUser.getBeyondEnterpriseId()); pstmt.setString(5, detectorUser.getBeyondEnterpriseId());
pstmt.setString(6,detectorUser.getAddress()); pstmt.setString(6, detectorUser.getAddress());
pstmt.setString(7,detectorUser.getLinkman()); pstmt.setString(7, detectorUser.getLinkman());
pstmt.setString(8,detectorUser.getPhone()); pstmt.setString(8, detectorUser.getPhone());
pstmt.setString(9,detectorUser.getRemarks()); pstmt.setString(9, detectorUser.getRemarks());
pstmt.setString(10,null); pstmt.setString(10, null);
pstmt.setLong(11,detectorUser.getUserId()); pstmt.setLong(11, detectorUser.getUserId());
pstmt.addBatch(); pstmt.addBatch();
} }
pstmt.executeBatch(); pstmt.executeBatch();
...@@ -1220,6 +1236,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -1220,6 +1236,7 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
/** /**
* 根据企业id统计错误数据 * 根据企业id统计错误数据
*
* @return r * @return r
*/ */
@Override @Override
...@@ -1228,11 +1245,12 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -1228,11 +1245,12 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
LoginUser loginUser = SecurityUtils.getLoginUser(); LoginUser loginUser = SecurityUtils.getLoginUser();
String deptId = loginUser.getUser().getDeptId(); String deptId = loginUser.getUser().getDeptId();
return tDetectorUserMapper.countByBeyondEnterpriseId(deptId,gasType); return tDetectorUserMapper.countByBeyondEnterpriseId(deptId, gasType);
} }
/** /**
* 根据企业id 清除数据 * 根据企业id 清除数据
*
* @return r * @return r
*/ */
@Override @Override
...@@ -1240,6 +1258,6 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService ...@@ -1240,6 +1258,6 @@ public class TDetectorUserServiceImpl implements ITDetectorUserService
LoginUser loginUser = SecurityUtils.getLoginUser(); LoginUser loginUser = SecurityUtils.getLoginUser();
String deptId = loginUser.getUser().getDeptId(); String deptId = loginUser.getUser().getDeptId();
return tDetectorUserMapper.clearByBeyondEnterpriseId(deptId,gasType); return tDetectorUserMapper.clearByBeyondEnterpriseId(deptId, gasType);
} }
} }
...@@ -360,6 +360,65 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -360,6 +360,65 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<foreach collection="villageIds" close=")" separator="," open="(" item="item" index="i"> <foreach collection="villageIds" close=")" separator="," open="(" item="item" index="i">
#{item} #{item}
</foreach> </foreach>
</select>
<select id="queryDuserVilSafDevInfoOnlyResidents" resultType="map" parameterType="TDetectorUser">
SELECT
userVillage.f_village_id AS villageId,
userVillage.f_village_name AS villageName,
userVillage.longitude,
userVillage.latitude,
( SELECT count(*) FROM t_detector_user duser WHERE duser.f_village_id = villageId AND duser.user_type = 1 ) AS userNum,
(
SELECT
count(*)
FROM
t_gasuser_safety_device_info deviceinfo
LEFT JOIN t_detector_user duser ON deviceinfo.f_relation_gasUser_id = duser.user_id
WHERE
duser.f_village_id = villageId
AND duser.user_type = 1
AND ( deviceinfo.is_del = 0 OR deviceinfo.is_del IS NULL )
) AS deviceNum,
'6' AS iconType,
( SELECT count(*) FROM t_detector_user_link_gas_bottle userlinkgas LEFT JOIN t_detector_user duser ON userlinkgas.f_user_id = duser.user_id WHERE duser.f_village_id = villageId ) AS gasBottle
FROM
t_user_manage_village userVillage
WHERE
userVillage.longitude IS NOT NULL
AND userVillage.latitude IS NOT NULL
<if test="villageId != null and villageId != ''"> and duser.f_village_id = #{villageId}</if>
</select>
<select id="queryDuserVilSafDevInfoOnlyResidentsInit" resultType="TDetectorUserVillageSafetyDeviceInfoVo" parameterType="TDetectorUser">
SELECT
dUser.user_id as userId,
dUser.nick_name as nickName,
dUser.phone,
dUser.address,
dUser.longitude as userLongitude,
dUser.latitude as userLatitude,
dUser.user_type as userType,
dUser.gas_type as gasType,
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,
safetyDeviceInfo.f_device_name as deviceName,
safetyDeviceInfo.f_detection_medium as detctionMedium,
safetyDeviceInfo.f_device_install_time as deviceInstallTime
FROM
t_detector_user dUser
LEFT JOIN t_user_manage_village userVillage ON dUser.f_village_id = userVillage.f_village_id
LEFT JOIN t_gasuser_safety_device_info safetyDeviceInfo on safetyDeviceInfo.f_relation_gasUser_id = dUser.user_id
LEFT JOIN t_county_level_region region ON region.f_id = userVillage.f_region
<where> (safetyDeviceInfo.is_del = '0' or safetyDeviceInfo.is_del is null)
and dUser.user_type = 1
<if test="villageId != null and villageId != ''"> and dUser.f_village_id = #{villageId}</if>
</where>
</select> </select>
<select id="queryDuserVilSafDevInfo" resultType="TDetectorUserVillageSafetyDeviceInfoVo" parameterType="TDetectorUser"> <select id="queryDuserVilSafDevInfo" resultType="TDetectorUserVillageSafetyDeviceInfoVo" parameterType="TDetectorUser">
SELECT SELECT
...@@ -387,6 +446,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -387,6 +446,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN t_gasuser_safety_device_info safetyDeviceInfo on safetyDeviceInfo.f_relation_gasUser_id = dUser.user_id LEFT JOIN t_gasuser_safety_device_info safetyDeviceInfo on safetyDeviceInfo.f_relation_gasUser_id = dUser.user_id
LEFT JOIN t_county_level_region region ON region.f_id = userVillage.f_region LEFT JOIN t_county_level_region region ON region.f_id = userVillage.f_region
<where> (safetyDeviceInfo.is_del = '0' or safetyDeviceInfo.is_del is null) <where> (safetyDeviceInfo.is_del = '0' or safetyDeviceInfo.is_del is null)
and dUser.user_type in (2,3,4)
and dUser.longitude is not null and dUser.latitude is not null
and dUser.gas_type is not null
<if test="userId != null and userId != ''"> and dUser.user_id = #{userId}</if> <if test="userId != null and userId != ''"> and dUser.user_id = #{userId}</if>
<if test="villageId != null and villageId != ''"> and dUser.f_village_id = #{villageId}</if> <if test="villageId != null and villageId != ''"> and dUser.f_village_id = #{villageId}</if>
</where> </where>
......
...@@ -381,31 +381,48 @@ export default { ...@@ -381,31 +381,48 @@ export default {
this.labelsLayerMarksCzGoMap(getCz, Cz, false); this.labelsLayerMarksCzGoMap(getCz, Cz, false);
//监控 //监控
this.labelsLayerMarksVideoGoMap(getVideo, VideoView, false); this.labelsLayerMarksVideoGoMap(getVideo, VideoView, false);
//this.goMap(getYhq, this.addDevice2, yhqUser, false); //液化气用户上图
if (this.enterpriseId == -2) { labelsLayerMarksDUserVillageSafDevInfoMap().then((res) => {
// this.labelsLayerMarksDeviceUserGoMap(deviceUser, yhqUser, false); //用户上图 const mapData = res.data[18];
this.labelsLayerMarksDeviceUserGoMap( //this.goMap(getYhq, this.addDevice2, yhqUser, false); //液化气用户上图
labelsLayerMarksDUserVillageSafDevInfoMap, if (this.enterpriseId == -2) {
this.map.labelsLayerMarksDeviceUserGoMap(mapData, yhqUser, false);
}
// 用户要等一下 因为有报警数据
const mapDataDetector = { 6: res.data[6], 61: res.data[61] };
this.map.labelsLayerMarksDetectorUserList(
mapDataDetector,
User,
yhqUser, yhqUser,
false false
); //用户上图 );
}
// 用户要等一下 因为有报警数据
this.labelsLayerMarksDetectorUserGoMap(
labelsLayerMarksDUserVillageSafDevInfoMap,
User,
yhqUser,
false
).then((res) => {
// 先查一下,然后开启定时器
return;
this.userAlarm();
this.alarmTimer = setInterval(() => {
this.userAlarm();
// console.log("查询报警");
}, alarmtime);
}); });
// //this.goMap(getYhq, this.addDevice2, yhqUser, false); //液化气用户上图
// if (this.enterpriseId == -2) {
// // this.labelsLayerMarksDeviceUserGoMap(deviceUser, yhqUser, false); //用户上图
// this.labelsLayerMarksDeviceUserGoMap(
// labelsLayerMarksDUserVillageSafDevInfoMap,
// yhqUser,
// false
// ); //用户上图
// }
// // 用户要等一下 因为有报警数据
// this.labelsLayerMarksDetectorUserGoMap(
// labelsLayerMarksDUserVillageSafDevInfoMap,
// User,
// yhqUser,
// false
// ).then((res) => {
// // 先查一下,然后开启定时器
// return;
// this.userAlarm();
// this.alarmTimer = setInterval(() => {
// this.userAlarm();
// // console.log("查询报警");
// }, alarmtime);
// });
} }
this.currentTime(); this.currentTime();
this.$refs.mychild.choice(this.selarr); this.$refs.mychild.choice(this.selarr);
...@@ -639,7 +656,6 @@ export default { ...@@ -639,7 +656,6 @@ export default {
labelsLayerMarksDeviceUserGoMap(httpFunc, component, show) { labelsLayerMarksDeviceUserGoMap(httpFunc, component, show) {
return httpFunc().then((res) => { return httpFunc().then((res) => {
const mapData = res.data[18]; const mapData = res.data[18];
console.log("液化气用户用户", mapData);
this.map.labelsLayerMarksDeviceUserGoMap(mapData, component, show); this.map.labelsLayerMarksDeviceUserGoMap(mapData, component, show);
}); });
}, },
......
...@@ -556,10 +556,12 @@ export default { ...@@ -556,10 +556,12 @@ export default {
this.map = new EditorMap( this.map = new EditorMap(
"map", "map",
{ {
//center: path, center: path,
//mapStyle: "amap://styles/f71d3a3d73e14f5b2bf5508bf1411758", // mapStyle: "amap://styles/f71d3a3d73e14f5b2bf5508bf1411758",
center: [114.684979,38.038292],
zoom: 14.5, mapStyle: "amap://styles/f71d3a3d73e14f5b2bf5508bf1411758",
// center: [117.908541,39.688353],
zoom: 12,
}, },
this this
); );
......
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