From 2df696b07d0ffdf7829d4d9cd3da23162dec8799 Mon Sep 17 00:00:00 2001
From: aijinhui <aijinhui>
Date: 星期五, 23 二月 2024 14:04:38 +0800
Subject: [PATCH] 更新
---
ard-work/src/main/resources/mapper/alarmpoints/ArdAlarmpointsWellMapper.xml | 11 +++++
ard-work/src/main/java/com/ruoyi/alarmpoints/well/mapper/ArdAlarmpointsWellMapper.java | 5 ++
ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java | 23 ++++-------
ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java | 73 ++++++++++++++++++------------------
ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttConsumerCallback.java | 8 ++--
5 files changed, 65 insertions(+), 55 deletions(-)
diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/well/mapper/ArdAlarmpointsWellMapper.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/well/mapper/ArdAlarmpointsWellMapper.java
index 87e7bd6..b6f8a26 100644
--- a/ard-work/src/main/java/com/ruoyi/alarmpoints/well/mapper/ArdAlarmpointsWellMapper.java
+++ b/ard-work/src/main/java/com/ruoyi/alarmpoints/well/mapper/ArdAlarmpointsWellMapper.java
@@ -5,6 +5,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWell;
import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWellDeptVo;
+import com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWellParam;
import com.ruoyi.common.annotation.DataScope;
@@ -22,6 +23,8 @@
* @return 浜曠鐞�
*/
public ArdAlarmpointsWell selectArdAlarmpointsWellById(String id);
+
+
/**
* 鏌ヨ浜曠鐞�
@@ -98,4 +101,6 @@
List<ArdAlarmpointsWellDeptVo> wellListDept(List<Long> deptList);
+ List<ArdAlarmpointsWell> conditionList(ArdAlarmpointsWellParam ardAlarmpointsWellParam);
+
}
diff --git a/ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java b/ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java
index 5d1b0f7..e6cc1d2 100644
--- a/ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java
+++ b/ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java
@@ -291,21 +291,14 @@
Integer pageNum = ardAlarmpointsWellParam.getPageNum();
Integer pageSize = ardAlarmpointsWellParam.getPageSize();
PageHelper.startPage(pageNum, pageSize);
- QueryWrapper<ArdAlarmpointsWell> queryWrapper = new QueryWrapper<>();
- queryWrapper.in("dept_id", ardAlarmpointsWellParam.getDeptList())
- .like(!StringUtils.isBlank(ardAlarmpointsWellParam.getWellId()), "well_id", ardAlarmpointsWellParam.getWellId());
-// .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getWellNumber()),"well_number",ardAlarmpointsWellParam.getWellNumber())
-// .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getOilProduction()),"oil_production",ardAlarmpointsWellParam.getOilProduction())
-// .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getWellBlock()),"well_block",ardAlarmpointsWellParam.getWellBlock())
-// .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getDisplacementMode()),"displacement_mode",ardAlarmpointsWellParam.getDisplacementMode())
-// .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getSurroundingEnvironment()),"surrounding_environment",ardAlarmpointsWellParam.getSurroundingEnvironment())
-// .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getWellType()),"well_type",ardAlarmpointsWellParam.getWellType())
-// .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getInstalledLoad()),"installed_load",ardAlarmpointsWellParam.getInstalledLoad())
-// .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getMeteringStation()),"metering_station",ardAlarmpointsWellParam.getMeteringStation())
-// .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getTransferStation()),"transfer_station",ardAlarmpointsWellParam.getTransferStation())
-// .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getDehydrationStation()),"dehydration_station",ardAlarmpointsWellParam.getDehydrationStation())
-// .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getRunStatus()),"run_status",ardAlarmpointsWellParam.getRunStatus());
- List<ArdAlarmpointsWell> list = ardAlarmpointsWellMapper.selectList(queryWrapper);
+// QueryWrapper<ArdAlarmpointsWell> queryWrapper = new QueryWrapper<>();
+// queryWrapper.select("id","altitude","metering_station","displacement_mode","latitude","dehydration_station",
+// "well_type","production_date","well_id","transfer_station","oil_production","run_status","longitude",
+// "installed_load","dept_id","user_id","surrounding_environment","well_number","well_block")
+// .eq(!StringUtils.isBlank(ardAlarmpointsWellParam.getWellId()), "well_id", ardAlarmpointsWellParam.getWellId())
+// .in("dept_id", ardAlarmpointsWellParam.getDeptList());
+// List<ArdAlarmpointsWell> list = ardAlarmpointsWellMapper.selectList(queryWrapper);
+ List<ArdAlarmpointsWell> list = ardAlarmpointsWellMapper.conditionList(ardAlarmpointsWellParam);
return new PageInfo<>(list);
}
diff --git a/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java b/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java
index 83c365d..bf31f63 100644
--- a/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java
+++ b/ard-work/src/main/java/com/ruoyi/sy/gps31/PushClientImplPosition.java
@@ -177,42 +177,7 @@
}
}
//杞﹁締鏈夊�间紭鍏堝垽鏂槸鍚︿负鎵嬪姩娣诲姞杞﹁締
- if(ardAccessFence.getIsAlarm()==1){
- //1涓烘墜鍔ㄦ坊鍔犺溅杈嗘棤闇�鎶ヨ淇℃伅锛屾洿鏂颁綅缃嵆鍙�
- ardAccessFence.setLng(lng);
- ardAccessFence.setLat(lat);
- ardAccessFenceService.updAccess(ardAccessFence);
- }else if(ardAccessFence.getIsAlarm() == 2){
- //2涓烘墜鍔ㄦ坊鍔犳姤璀﹁溅杈嗘湁鎶ヨ锛屾墍鍦ㄥ洿鏍忓悕绉拌祴null,鎺掓煡鎶ヨ淇℃伅,鍙渶澶勭悊璺笂鎯呭喌
- ardAccessFence.setNowWallName(null);
- //濡傛灉鍦ㄨ矾涓婂垽鏂潗鏍囨槸鍚︿笌涓婃涓�鏍�
- if(ardAccessFence.getLng().equals(lng) && ardAccessFence.getLat().equals(lat)){
- if(timeType){
- Date nowTime = sdf.parse(time);
- Date lastTime = sdf.parse(ardAccessFence.getLastTime());
- Long diff = (nowTime.getTime() - lastTime.getTime())/1000;
- ArdAccessNum list = accessNumService.queryNum();
- if(list!=null){
- int alarm = list.getAlarm();
- if(diff>=alarm){
- //鎶ヨ瀛楁涓�1鎻愮ず鎶ヨ
- ardAccessFence.setIsWarning(1);
- ardAccessFence.setAlarmLat(lat);
- ardAccessFence.setAlarmLng(lng);
- ardAccessFenceService.updAccess(ardAccessFence);
- }
- }
- }else {
- log.debug(carId+"鍙疯溅瀹氫綅鏃堕棿涓虹┖");
- }
- }else {
- //濡傛灉涓嶄竴鏍锋洿鏂板潗鏍�
- ardAccessFence.setLat(lat);
- ardAccessFence.setLng(lng);
- ardAccessFence.setLastTime(time);
- ardAccessFenceService.updAccess(ardAccessFence);
- }
- }else if(ardAccessFence.getIsAlarm() == 0 || ardAccessFence.getIsAlarm() == null){
+ if(ardAccessFence.getIsAlarm() == 0 || ardAccessFence.getIsAlarm() == null){
//杞﹁締闈炴墜鍔ㄦ坊鍔犳暟鎹紝鍒ゆ柇鏄惁鏈夎繘鍏ュ洿鏍廔D
if(ardAccessFence.getIntoShipmentId()==null){
//娌℃湁杩涘叆瑁呮补鐐癸紝璧嬪�肩粡绾害
@@ -368,6 +333,42 @@
}
}
}
+ }else
+ if(ardAccessFence.getIsAlarm()==1){
+ //1涓烘墜鍔ㄦ坊鍔犺溅杈嗘棤闇�鎶ヨ淇℃伅锛屾洿鏂颁綅缃嵆鍙�
+ ardAccessFence.setLng(lng);
+ ardAccessFence.setLat(lat);
+ ardAccessFenceService.updAccess(ardAccessFence);
+ }else if(ardAccessFence.getIsAlarm() == 2){
+ //2涓烘墜鍔ㄦ坊鍔犳姤璀﹁溅杈嗘湁鎶ヨ锛屾墍鍦ㄥ洿鏍忓悕绉拌祴null,鎺掓煡鎶ヨ淇℃伅,鍙渶澶勭悊璺笂鎯呭喌
+ ardAccessFence.setNowWallName(null);
+ //濡傛灉鍦ㄨ矾涓婂垽鏂潗鏍囨槸鍚︿笌涓婃涓�鏍�
+ if(ardAccessFence.getLng().equals(lng) && ardAccessFence.getLat().equals(lat)){
+ if(timeType){
+ Date nowTime = sdf.parse(time);
+ Date lastTime = sdf.parse(ardAccessFence.getLastTime());
+ Long diff = (nowTime.getTime() - lastTime.getTime())/1000;
+ ArdAccessNum list = accessNumService.queryNum();
+ if(list!=null){
+ int alarm = list.getAlarm();
+ if(diff>=alarm){
+ //鎶ヨ瀛楁涓�1鎻愮ず鎶ヨ
+ ardAccessFence.setIsWarning(1);
+ ardAccessFence.setAlarmLat(lat);
+ ardAccessFence.setAlarmLng(lng);
+ ardAccessFenceService.updAccess(ardAccessFence);
+ }
+ }
+ }else {
+ log.debug(carId+"鍙疯溅瀹氫綅鏃堕棿涓虹┖");
+ }
+ }else {
+ //濡傛灉涓嶄竴鏍锋洿鏂板潗鏍�
+ ardAccessFence.setLat(lat);
+ ardAccessFence.setLng(lng);
+ ardAccessFence.setLastTime(time);
+ ardAccessFenceService.updAccess(ardAccessFence);
+ }
}
}
//娓呮筏缁撴潫------------
diff --git a/ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttConsumerCallback.java b/ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttConsumerCallback.java
index e811055..f89b53d 100644
--- a/ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttConsumerCallback.java
+++ b/ard-work/src/main/java/com/ruoyi/utils/mqtt/MqttConsumerCallback.java
@@ -38,13 +38,13 @@
*/
@Override
public void connectionLost(Throwable cause) {
- log.info("MQTT杩炴帴鏂紑锛屽彂璧烽噸杩�......");
+// log.info("MQTT杩炴帴鏂紑锛屽彂璧烽噸杩�......");
while (!client.isConnected()) {
try {
Thread.sleep(10000);
if (null != client && !client.isConnected()) {
client.reconnect();
- log.error("灏濊瘯閲嶆柊杩炴帴");
+// log.error("灏濊瘯閲嶆柊杩炴帴");
} else {
client.connect(options);
log.error("灏濊瘯寤虹珛鏂拌繛鎺�");
@@ -112,8 +112,8 @@
if (null != topic && null != qos) {
if (client.isConnected()) {
client.subscribe(topic, qos);
- log.info("mqtt杩炴帴鎴愬姛" );
- log.info("璁㈤槄涓婚:" + Arrays.toString(topic));
+// log.info("mqtt杩炴帴鎴愬姛" );
+// log.info("璁㈤槄涓婚:" + Arrays.toString(topic));
} else {
log.info("mqtt杩炴帴澶辫触");
}
diff --git a/ard-work/src/main/resources/mapper/alarmpoints/ArdAlarmpointsWellMapper.xml b/ard-work/src/main/resources/mapper/alarmpoints/ArdAlarmpointsWellMapper.xml
index 3a40ea3..938f638 100644
--- a/ard-work/src/main/resources/mapper/alarmpoints/ArdAlarmpointsWellMapper.xml
+++ b/ard-work/src/main/resources/mapper/alarmpoints/ArdAlarmpointsWellMapper.xml
@@ -258,4 +258,15 @@
#{item}
</foreach>
</select>
+
+
+ <select id="conditionList" parameterType="List"
+ resultType="com.ruoyi.alarmpoints.well.domain.ArdAlarmpointsWellDeptVo">
+ Select * from ard_alarmpoints_well well
+ where WHERE well.well_id = #{wellId}
+ and well.dept_id in
+ <foreach collection="list" index="index" item="item" open="(" separator="," close=")">
+ #{item}
+ </foreach>
+ </select>
</mapper>
--
Gitblit v1.9.3