mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-18 00:45:55 +08:00
设备摘要bug修复
This commit is contained in:
@@ -34,9 +34,6 @@ public class EmqxService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IDeviceService deviceService;
|
private IDeviceService deviceService;
|
||||||
|
|
||||||
// @Autowired
|
|
||||||
// private IDeviceLogService deviceLogService;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ILogService logService;
|
private ILogService logService;
|
||||||
|
|
||||||
@@ -133,11 +130,6 @@ public class EmqxService {
|
|||||||
Device device = JSON.parseObject(message, Device.class);
|
Device device = JSON.parseObject(message, Device.class);
|
||||||
device.setProductId(productId);
|
device.setProductId(productId);
|
||||||
device.setSerialNumber(deviceNum);
|
device.setSerialNumber(deviceNum);
|
||||||
// 未采用设备定位则清空定位,定位方式(1=ip自动定位,2=设备定位,3=自定义)
|
|
||||||
if(device.getLocationWay()!=2){
|
|
||||||
device.setLatitude(null);
|
|
||||||
device.setLongitude(null);
|
|
||||||
}
|
|
||||||
deviceService.reportDevice(device);
|
deviceService.reportDevice(device);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("接收设备信息,解析数据时异常 message={}", e.getMessage());
|
logger.error("接收设备信息,解析数据时异常 message={}", e.getMessage());
|
||||||
|
|||||||
@@ -825,6 +825,11 @@ public class DeviceServiceImpl implements IDeviceService {
|
|||||||
@Override
|
@Override
|
||||||
public int reportDevice(Device device) {
|
public int reportDevice(Device device) {
|
||||||
Device deviceEntity=deviceMapper.selectDeviceBySerialNumber(device.getSerialNumber());
|
Device deviceEntity=deviceMapper.selectDeviceBySerialNumber(device.getSerialNumber());
|
||||||
|
// 未采用设备定位则清空定位,定位方式(1=ip自动定位,2=设备定位,3=自定义)
|
||||||
|
if(deviceEntity.getLocationWay()!=2){
|
||||||
|
device.setLatitude(null);
|
||||||
|
device.setLongitude(null);
|
||||||
|
}
|
||||||
int result=0;
|
int result=0;
|
||||||
if(deviceEntity!=null){
|
if(deviceEntity!=null){
|
||||||
// 更新设备信息
|
// 更新设备信息
|
||||||
|
|||||||
@@ -316,6 +316,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
<if test="remark != null">remark,</if>
|
<if test="remark != null">remark,</if>
|
||||||
<if test="imgUrl != null">img_url,</if>
|
<if test="imgUrl != null">img_url,</if>
|
||||||
|
<if test="summary != null">summary,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
||||||
@@ -344,6 +345,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="updateTime != null">#{updateTime},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
<if test="remark != null">#{remark},</if>
|
<if test="remark != null">#{remark},</if>
|
||||||
<if test="imgUrl != null">#{imgUrl},</if>
|
<if test="imgUrl != null">#{imgUrl},</if>
|
||||||
|
<if test="summary != null">#{summary},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
@@ -376,6 +378,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
<if test="imgUrl != null">img_url = #{imgUrl},</if>
|
<if test="imgUrl != null">img_url = #{imgUrl},</if>
|
||||||
|
<if test="summary != null">summary = #{summary},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where device_id = #{deviceId}
|
where device_id = #{deviceId}
|
||||||
</update>
|
</update>
|
||||||
@@ -428,6 +431,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
<if test="imgUrl != null">img_url = #{imgUrl},</if>
|
<if test="imgUrl != null">img_url = #{imgUrl},</if>
|
||||||
|
<if test="summary != null">summary = #{summary},</if>
|
||||||
</trim>
|
</trim>
|
||||||
where serial_number = #{serialNumber}
|
where serial_number = #{serialNumber}
|
||||||
</update>
|
</update>
|
||||||
|
|||||||
Reference in New Issue
Block a user