From 6eed92ee31ddc2a37830306210c407f355b54a68 Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Tue, 5 Nov 2024 19:05:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E9=94=99=E8=AF=AF=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zc/business/constant/RedisStreamConstants.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/zc-business/src/main/java/com/zc/business/constant/RedisStreamConstants.java b/zc-business/src/main/java/com/zc/business/constant/RedisStreamConstants.java index c1a102da..164aa588 100644 --- a/zc-business/src/main/java/com/zc/business/constant/RedisStreamConstants.java +++ b/zc-business/src/main/java/com/zc/business/constant/RedisStreamConstants.java @@ -10,7 +10,7 @@ public class RedisStreamConstants { */ public static class DeviceOnline { public final static String KEY = "device:online"; - public final static String GROUP = "group1"; + public final static String GROUP = "group2"; public final static String CONSUMER = "consumer1"; } @@ -19,7 +19,7 @@ public class RedisStreamConstants { */ public static class DeviceOffline { public final static String KEY = "device:offline"; - public final static String GROUP = "group1"; + public final static String GROUP = "group2"; public final static String CONSUMER = "consumer1"; } @@ -28,7 +28,7 @@ public class RedisStreamConstants { */ public static class DeviceEvent { public final static String KEY = "device:event"; - public final static String GROUP = "group1"; + public final static String GROUP = "group2"; public final static String CONSUMER = "consumer1"; } @@ -37,7 +37,7 @@ public class RedisStreamConstants { */ public static class DevicePropertyReport { public final static String KEY = "device:property:report"; - public final static String GROUP = "group1"; + public final static String GROUP = "group2"; public final static String CONSUMER = "consumer1"; } @@ -46,7 +46,7 @@ public class RedisStreamConstants { */ public static class DevicePropertyReadReply { public final static String KEY = "device:property:read:reply"; - public final static String GROUP = "group1"; + public final static String GROUP = "group2"; public final static String CONSUMER = "consumer1"; } @@ -56,7 +56,7 @@ public class RedisStreamConstants { */ public static class DevicePropertyWriteReply { public final static String KEY = "device:property:write:reply"; - public final static String GROUP = "group1"; + public final static String GROUP = "group2"; public final static String CONSUMER = "consumer1"; } @@ -65,7 +65,7 @@ public class RedisStreamConstants { */ public static class DeviceFunctionReply { public final static String KEY = "device:function:reply"; - public final static String GROUP = "group1"; + public final static String GROUP = "group2"; public final static String CONSUMER = "consumer1"; } From 522f7c4e3548967834ca3328c168c6598376bea7 Mon Sep 17 00:00:00 2001 From: wangsixiang <2970484253@qq.com> Date: Thu, 7 Nov 2024 08:36:29 +0800 Subject: [PATCH 2/2] =?UTF-8?q?id=E8=8E=B7=E5=8F=96=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/zc/business/controller/DcDeviceController.java | 9 ++++++++- .../main/java/com/zc/business/mapper/DcDeviceMapper.java | 3 +++ .../java/com/zc/business/service/IDcDeviceService.java | 3 +++ .../zc/business/service/impl/DcDeviceServiceImpl.java | 6 ++++++ .../main/resources/mapper/business/DcDeviceMapper.xml | 3 +++ 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java b/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java index e5d25f7b..76c5857c 100644 --- a/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java +++ b/zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java @@ -80,7 +80,14 @@ public class DcDeviceController extends BaseController { private ISysConfigService configService; //*********************************设备增删改查****************************************** - + //根据设备id查询设备信息 + @PostMapping("/getDeviceById") + public AjaxResult getDeviceById(@RequestBody DcDevice dcDevice) { + if (dcDevice==null||dcDevice.getIotDeviceId()==null){ + return AjaxResult.error("参数异常"); + } + return AjaxResult.success(dcDeviceService.getDcDeviceById(dcDevice.getIotDeviceId())); + } /** * 分页查询设备列表 * diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcDeviceMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcDeviceMapper.java index f1e845dc..b2e7ce3e 100644 --- a/zc-business/src/main/java/com/zc/business/mapper/DcDeviceMapper.java +++ b/zc-business/src/main/java/com/zc/business/mapper/DcDeviceMapper.java @@ -42,4 +42,7 @@ public interface DcDeviceMapper extends BaseMapper { //获取收费站摄像头 List selectTollStationCamPile(@Param("direction") String direction,@Param("startMileage") String startMileage,@Param("endMileage") String endMileage); + + //获取设备信息 + DcDevice getDcDeviceById(@Param("iotDeviceId") String iotDeviceId); } diff --git a/zc-business/src/main/java/com/zc/business/service/IDcDeviceService.java b/zc-business/src/main/java/com/zc/business/service/IDcDeviceService.java index fe5f8fb4..acffb060 100644 --- a/zc-business/src/main/java/com/zc/business/service/IDcDeviceService.java +++ b/zc-business/src/main/java/com/zc/business/service/IDcDeviceService.java @@ -8,6 +8,7 @@ import com.zc.business.domain.DcEvent; import com.zc.business.domain.DcStakeMark; import com.zc.common.core.httpclient.exception.HttpException; import io.swagger.v3.oas.models.security.SecurityScheme; +import org.apache.ibatis.annotations.Param; import sun.reflect.generics.tree.VoidDescriptor; import java.io.IOException; @@ -129,4 +130,6 @@ public interface IDcDeviceService extends IService { Integer updateTollStationCameraStatus(DcDevice dcDevice); //获取附近收费站摄像头 List selectTollStationCamPile(String direction, String startMileage, String endMileage); + //获取设备信息 + DcDevice getDcDeviceById(@Param("iotDeviceId") String iotDeviceId); } diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java index 3d6cd0f0..3a52d5e0 100644 --- a/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java +++ b/zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java @@ -24,6 +24,7 @@ import com.zc.business.service.IMiddleDatabaseService; import com.zc.common.core.httpclient.OkHttp; import com.zc.common.core.httpclient.exception.HttpException; import okhttp3.Response; +import org.apache.ibatis.annotations.Param; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.util.StringUtils; @@ -659,5 +660,10 @@ public class DcDeviceServiceImpl extends ServiceImpl i public List selectTollStationCamPile(String direction, String startMileage, String endMileage) { return dcDeviceMapper.selectTollStationCamPile(direction, startMileage, endMileage); } + //获取设备信息 + @Override + public DcDevice getDcDeviceById(String iotDeviceId) { + return dcDeviceMapper.getDcDeviceById(iotDeviceId); + } } diff --git a/zc-business/src/main/resources/mapper/business/DcDeviceMapper.xml b/zc-business/src/main/resources/mapper/business/DcDeviceMapper.xml index 86178157..e2f37ba6 100644 --- a/zc-business/src/main/resources/mapper/business/DcDeviceMapper.xml +++ b/zc-business/src/main/resources/mapper/business/DcDeviceMapper.xml @@ -199,4 +199,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where !ISNULL(t1.iot_device_id) and t1.device_type = '1' and (t1.facilities_type = '5'|| t1.facilities_type = '4') and t2.mileage >= #{startMileage} and t2.mileage <= #{endMileage} +