大棚关联用户
parent
78311a1396
commit
14f9770c2c
|
|
@ -7,6 +7,8 @@ import com.agri.framework.interceptor.FrontendControlHandler;
|
||||||
import com.agri.framework.interceptor.FrontendOnlineHandler;
|
import com.agri.framework.interceptor.FrontendOnlineHandler;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.core.env.Environment;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
@ -41,6 +43,8 @@ public class MqttMessageDispatcher {
|
||||||
@Resource
|
@Resource
|
||||||
private FrontendOnlineHandler frontendOnlineHandler;
|
private FrontendOnlineHandler frontendOnlineHandler;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private Environment env;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 前端在线心跳处理器
|
* 前端在线心跳处理器
|
||||||
|
|
@ -58,7 +62,7 @@ public class MqttMessageDispatcher {
|
||||||
public void handleMessage(String topic, String payload) {
|
public void handleMessage(String topic, String payload) {
|
||||||
try {
|
try {
|
||||||
// log.info("【MQTT接收】topic={}, payload={}", topic, payload);
|
// log.info("【MQTT接收】topic={}, payload={}", topic, payload);
|
||||||
|
if (env.acceptsProfiles("dev")) return;
|
||||||
// 设备状态主题:dtu/{deviceId}/up
|
// 设备状态主题:dtu/{deviceId}/up
|
||||||
if (topic.matches("dtu/\\w+/\\w+")) {
|
if (topic.matches("dtu/\\w+/\\w+")) {
|
||||||
deviceStatusHandler.handle(topic, payload);
|
deviceStatusHandler.handle(topic, payload);
|
||||||
|
|
@ -76,4 +80,4 @@ public class MqttMessageDispatcher {
|
||||||
log.error("【MQTT消息处理异常】topic={}", topic, e);
|
log.error("【MQTT消息处理异常】topic={}", topic, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,23 @@
|
||||||
package com.agri.system.controller;
|
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.annotation.Log;
|
||||||
import com.agri.common.core.controller.BaseController;
|
import com.agri.common.core.controller.BaseController;
|
||||||
import com.agri.common.core.domain.AjaxResult;
|
import com.agri.common.core.domain.AjaxResult;
|
||||||
|
import com.agri.common.core.page.TableDataInfo;
|
||||||
import com.agri.common.enums.BusinessType;
|
import com.agri.common.enums.BusinessType;
|
||||||
|
import com.agri.common.utils.poi.ExcelUtil;
|
||||||
import com.agri.system.domain.SysDtuRemark;
|
import com.agri.system.domain.SysDtuRemark;
|
||||||
import com.agri.system.service.ISysDtuRemarkService;
|
import com.agri.system.service.ISysDtuRemarkService;
|
||||||
import com.agri.common.utils.poi.ExcelUtil;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import com.agri.common.core.page.TableDataInfo;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dtu设备备注Controller
|
* dtu设备备注Controller
|
||||||
*
|
*
|
||||||
* @author lld
|
* @author lld
|
||||||
* @date 2026-01-21
|
* @date 2026-01-21
|
||||||
*/
|
*/
|
||||||
|
|
@ -57,7 +56,7 @@ public class SysDtuRemarkController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 获取dtu设备备注详细信息
|
* 获取dtu设备备注详细信息
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('assets:remark:query')")
|
@PreAuthorize("@ss.hasPermi('assets:remark:list')")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
{
|
{
|
||||||
|
|
@ -101,7 +100,7 @@ public class SysDtuRemarkController extends BaseController
|
||||||
/**
|
/**
|
||||||
* 获取dtu设备备注详细信息
|
* 获取dtu设备备注详细信息
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('assets:remark:query')")
|
@PreAuthorize("@ss.hasPermi('assets:remark:list')")
|
||||||
@GetMapping(value = "/getDtuByImei")
|
@GetMapping(value = "/getDtuByImei")
|
||||||
public AjaxResult getDtuByImei(@RequestParam("imei") String imei)
|
public AjaxResult getDtuByImei(@RequestParam("imei") String imei)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.agri.system.mapper.SysAgriInfoMapper">
|
<mapper namespace="com.agri.system.mapper.SysAgriInfoMapper">
|
||||||
|
|
||||||
<resultMap type="SysAgriInfo" id="SysAgriInfoResult">
|
<resultMap type="SysAgriInfo" id="SysAgriInfoResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
<result property="imei" column="imei" />
|
<result property="imei" column="imei" />
|
||||||
|
|
@ -43,13 +43,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
user_agri.user_id
|
user_agri.user_id
|
||||||
FROM
|
FROM
|
||||||
sys_agri_info agri
|
sys_agri_info agri
|
||||||
LEFT JOIN sys_user_agri user_agri ON user_agri.agri_id = agri.id
|
LEFT JOIN sys_user_agri user_agri ON user_agri.agri_id = agri.imei
|
||||||
<if test="userId != null"> and user_agri.user_id = #{userId}</if>
|
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectSysAgriInfoList" parameterType="SysAgriInfo" resultMap="SysAgriInfoResult">
|
<select id="selectSysAgriInfoList" parameterType="SysAgriInfo" resultMap="SysAgriInfoResult">
|
||||||
<include refid="selectSysAgriInfoVo"/>
|
<include refid="selectSysAgriInfoVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="imei != null and imei != ''"> and imei = #{imei}</if>
|
<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="agriName != null and agriName != ''"> and agri_name like concat('%', #{agriName}, '%')</if>
|
||||||
<if test="userId != null "> and user_id = #{userId}</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>
|
<if test="isDeleted != null "> and is_deleted = #{isDeleted}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectSysAgriInfoById" parameterType="Long" resultMap="SysAgriInfoResult">
|
<select id="selectSysAgriInfoById" parameterType="Long" resultMap="SysAgriInfoResult">
|
||||||
<include refid="selectSysAgriInfoVo"/>
|
<include refid="selectSysAgriInfoVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
|
|
@ -125,7 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteSysAgriInfoByIds" parameterType="String">
|
<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=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
@ -134,8 +133,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="findAgriByUser" parameterType="SysAgriInfo" resultMap="SysAgriInfoResult">
|
<select id="findAgriByUser" parameterType="SysAgriInfo" resultMap="SysAgriInfoResult">
|
||||||
<include refid="agriUserVo"/>
|
<include refid="agriUserVo"/>
|
||||||
|
<if test="userId == null"> and user_agri.user_id is null </if>
|
||||||
<where>
|
<where>
|
||||||
is_deleted = 0
|
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="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="agriName != null and agriName != ''"> and agri.agri_name like concat('%', #{agriName}, '%')</if>
|
||||||
<if test="alarmStatus != null "> and agri.alarm_status = #{alarmStatus}</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>
|
<if test="isDeleted != null "> and agri.is_deleted = #{isDeleted}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue