大棚关联用户
parent
78311a1396
commit
14f9770c2c
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.agri.system.mapper.SysAgriInfoMapper">
|
||||
|
||||
|
||||
<resultMap type="SysAgriInfo" id="SysAgriInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="imei" column="imei" />
|
||||
|
|
@ -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
|
||||
<if test="userId != null"> and user_agri.user_id = #{userId}</if>
|
||||
LEFT JOIN sys_user_agri user_agri ON user_agri.agri_id = agri.imei
|
||||
</sql>
|
||||
|
||||
<select id="selectSysAgriInfoList" parameterType="SysAgriInfo" resultMap="SysAgriInfoResult">
|
||||
<include refid="selectSysAgriInfoVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="imei != null and imei != ''"> and imei = #{imei}</if>
|
||||
<if test="agriName != null and agriName != ''"> and agri_name like concat('%', #{agriName}, '%')</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
|
|
@ -60,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="isDeleted != null "> and is_deleted = #{isDeleted}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectSysAgriInfoById" parameterType="Long" resultMap="SysAgriInfoResult">
|
||||
<include refid="selectSysAgriInfoVo"/>
|
||||
where id = #{id}
|
||||
|
|
@ -125,7 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<delete id="deleteSysAgriInfoByIds" parameterType="String">
|
||||
delete from sys_agri_info where id in
|
||||
delete from sys_agri_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
|
@ -134,8 +133,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="findAgriByUser" parameterType="SysAgriInfo" resultMap="SysAgriInfoResult">
|
||||
<include refid="agriUserVo"/>
|
||||
<if test="userId == null"> and user_agri.user_id is null </if>
|
||||
<where>
|
||||
is_deleted = 0
|
||||
<if test="userId != null"> and user_agri.user_id = #{userId}</if>
|
||||
<if test="imei != null and imei != ''"> and agri.imei = #{imei}</if>
|
||||
<if test="agriName != null and agriName != ''"> and agri.agri_name like concat('%', #{agriName}, '%')</if>
|
||||
<if test="alarmStatus != null "> and agri.alarm_status = #{alarmStatus}</if>
|
||||
|
|
@ -145,4 +146,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="isDeleted != null "> and agri.is_deleted = #{isDeleted}</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue