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
......
...@@ -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);
labelsLayerMarksDUserVillageSafDevInfoMap().then((res) => {
const mapData = res.data[18];
//this.goMap(getYhq, this.addDevice2, yhqUser, false); //液化气用户上图 //this.goMap(getYhq, this.addDevice2, yhqUser, false); //液化气用户上图
if (this.enterpriseId == -2) { if (this.enterpriseId == -2) {
// this.labelsLayerMarksDeviceUserGoMap(deviceUser, yhqUser, false); //用户上图 this.map.labelsLayerMarksDeviceUserGoMap(mapData, yhqUser, false);
this.labelsLayerMarksDeviceUserGoMap(
labelsLayerMarksDUserVillageSafDevInfoMap,
yhqUser,
false
); //用户上图
} }
// 用户要等一下 因为有报警数据 // 用户要等一下 因为有报警数据
this.labelsLayerMarksDetectorUserGoMap( const mapDataDetector = { 6: res.data[6], 61: res.data[61] };
labelsLayerMarksDUserVillageSafDevInfoMap, this.map.labelsLayerMarksDetectorUserList(
mapDataDetector,
User, User,
yhqUser, yhqUser,
false 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