Browse Source

Merge remote-tracking branch 'origin/develop' into develop

develop
mengff 3 weeks ago
parent
commit
dbcade9dfa
  1. 14
      zc-business/src/main/java/com/zc/business/constant/RedisStreamConstants.java
  2. 9
      zc-business/src/main/java/com/zc/business/controller/DcDeviceController.java
  3. 3
      zc-business/src/main/java/com/zc/business/mapper/DcDeviceMapper.java
  4. 3
      zc-business/src/main/java/com/zc/business/service/IDcDeviceService.java
  5. 6
      zc-business/src/main/java/com/zc/business/service/impl/DcDeviceServiceImpl.java
  6. 3
      zc-business/src/main/resources/mapper/business/DcDeviceMapper.xml

14
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";
}

9
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()));
}
/**
* 分页查询设备列表
*

3
zc-business/src/main/java/com/zc/business/mapper/DcDeviceMapper.java

@ -42,4 +42,7 @@ public interface DcDeviceMapper extends BaseMapper<DcDevice> {
//获取收费站摄像头
List<DcDevice> selectTollStationCamPile(@Param("direction") String direction,@Param("startMileage") String startMileage,@Param("endMileage") String endMileage);
//获取设备信息
DcDevice getDcDeviceById(@Param("iotDeviceId") String iotDeviceId);
}

3
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<DcDevice> {
Integer updateTollStationCameraStatus(DcDevice dcDevice);
//获取附近收费站摄像头
List<DcDevice> selectTollStationCamPile(String direction, String startMileage, String endMileage);
//获取设备信息
DcDevice getDcDeviceById(@Param("iotDeviceId") String iotDeviceId);
}

6
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<DcDeviceMapper, DcDevice> i
public List<DcDevice> selectTollStationCamPile(String direction, String startMileage, String endMileage) {
return dcDeviceMapper.selectTollStationCamPile(direction, startMileage, endMileage);
}
//获取设备信息
@Override
public DcDevice getDcDeviceById(String iotDeviceId) {
return dcDeviceMapper.getDcDeviceById(iotDeviceId);
}
}

3
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 &lt;= #{endMileage}
</select>
<select id="getDcDeviceById" resultType="com.zc.business.domain.DcDevice">
select device_state from dc_device where iot_device_id=#{iotDeviceId}
</select>
</mapper>

Loading…
Cancel
Save