diff --git a/agri-framework/src/main/java/com/agri/framework/web/dispatcher/MqttMessageDispatcher.java b/agri-framework/src/main/java/com/agri/framework/web/dispatcher/MqttMessageDispatcher.java index e22d38a..a5ec5bc 100644 --- a/agri-framework/src/main/java/com/agri/framework/web/dispatcher/MqttMessageDispatcher.java +++ b/agri-framework/src/main/java/com/agri/framework/web/dispatcher/MqttMessageDispatcher.java @@ -7,6 +7,8 @@ import com.agri.framework.interceptor.FrontendControlHandler; import com.agri.framework.interceptor.FrontendOnlineHandler; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; import javax.annotation.Resource; @@ -41,6 +43,8 @@ public class MqttMessageDispatcher { @Resource private FrontendOnlineHandler frontendOnlineHandler; + @Autowired + private Environment env; /** * 前端在线心跳处理器 @@ -58,7 +62,7 @@ public class MqttMessageDispatcher { public void handleMessage(String topic, String payload) { try { // log.info("【MQTT接收】topic={}, payload={}", topic, payload); - + if (env.acceptsProfiles("dev")) return; // 设备状态主题:dtu/{deviceId}/up if (topic.matches("dtu/\\w+/\\w+")) { deviceStatusHandler.handle(topic, payload); @@ -76,4 +80,4 @@ public class MqttMessageDispatcher { log.error("【MQTT消息处理异常】topic={}", topic, e); } } -} \ No newline at end of file +} diff --git a/agri-system/src/main/java/com/agri/system/controller/SysDtuRemarkController.java b/agri-system/src/main/java/com/agri/system/controller/SysDtuRemarkController.java index 552a734..86383c2 100644 --- a/agri-system/src/main/java/com/agri/system/controller/SysDtuRemarkController.java +++ b/agri-system/src/main/java/com/agri/system/controller/SysDtuRemarkController.java @@ -1,24 +1,23 @@ package com.agri.system.controller; -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -import org.apache.ibatis.ognl.ObjectElementsAccessor; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; import com.agri.common.annotation.Log; import com.agri.common.core.controller.BaseController; import com.agri.common.core.domain.AjaxResult; +import com.agri.common.core.page.TableDataInfo; import com.agri.common.enums.BusinessType; +import com.agri.common.utils.poi.ExcelUtil; import com.agri.system.domain.SysDtuRemark; import com.agri.system.service.ISysDtuRemarkService; -import com.agri.common.utils.poi.ExcelUtil; -import com.agri.common.core.page.TableDataInfo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * dtu设备备注Controller - * + * * @author lld * @date 2026-01-21 */ @@ -57,7 +56,7 @@ public class SysDtuRemarkController extends BaseController /** * 获取dtu设备备注详细信息 */ - @PreAuthorize("@ss.hasPermi('assets:remark:query')") + @PreAuthorize("@ss.hasPermi('assets:remark:list')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { @@ -101,7 +100,7 @@ public class SysDtuRemarkController extends BaseController /** * 获取dtu设备备注详细信息 */ - @PreAuthorize("@ss.hasPermi('assets:remark:query')") + @PreAuthorize("@ss.hasPermi('assets:remark:list')") @GetMapping(value = "/getDtuByImei") public AjaxResult getDtuByImei(@RequestParam("imei") String imei) { diff --git a/agri-system/src/main/resources/mapper/system/SysAgriInfoMapper.xml b/agri-system/src/main/resources/mapper/system/SysAgriInfoMapper.xml index 1963b7d..71078b9 100644 --- a/agri-system/src/main/resources/mapper/system/SysAgriInfoMapper.xml +++ b/agri-system/src/main/resources/mapper/system/SysAgriInfoMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -43,13 +43,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" user_agri.user_id FROM sys_agri_info agri - LEFT JOIN sys_user_agri user_agri ON user_agri.agri_id = agri.id - and user_agri.user_id = #{userId} + LEFT JOIN sys_user_agri user_agri ON user_agri.agri_id = agri.imei - + + and user_agri.user_id is null is_deleted = 0 + and user_agri.user_id = #{userId} and agri.imei = #{imei} and agri.agri_name like concat('%', #{agriName}, '%') and agri.alarm_status = #{alarmStatus} @@ -145,4 +146,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and agri.is_deleted = #{isDeleted} - \ No newline at end of file +