虫情设备实时数据
This commit is contained in:
parent
00165f5123
commit
1be9b59b0c
@ -2,7 +2,7 @@ package com.fastbee.data.controller.media;
|
|||||||
|
|
||||||
import com.fastbee.common.core.controller.BaseController;
|
import com.fastbee.common.core.controller.BaseController;
|
||||||
import com.fastbee.common.core.domain.AjaxResult;
|
import com.fastbee.common.core.domain.AjaxResult;
|
||||||
import com.fastbee.device.api.yingshiyun.service.YingshiyunService;
|
import com.fastbee.deviceData.api.yingshiyun.service.YingshiyunService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
@ -32,6 +32,10 @@
|
|||||||
<groupId>com.fastbee</groupId>
|
<groupId>com.fastbee</groupId>
|
||||||
<artifactId>fastbee-common</artifactId>
|
<artifactId>fastbee-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-context</artifactId>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
@ -1,4 +1,4 @@
|
|||||||
package com.fastbee.device.api.renke.constant;
|
package com.fastbee.deviceData.api.renke.constant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 建大仁科设备类型常量
|
* 建大仁科设备类型常量
|
@ -1,4 +1,4 @@
|
|||||||
package com.fastbee.device.api.renke.service;
|
package com.fastbee.deviceData.api.renke.service;
|
||||||
|
|
||||||
import cn.hutool.http.HttpRequest;
|
import cn.hutool.http.HttpRequest;
|
||||||
import cn.hutool.http.HttpResponse;
|
import cn.hutool.http.HttpResponse;
|
@ -1,4 +1,4 @@
|
|||||||
package com.fastbee.device.api.renke.service;
|
package com.fastbee.deviceData.api.renke.service;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.fastbee.device.api.renke.service;
|
package com.fastbee.deviceData.api.renke.service;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.fastbee.device.api.yingshiyun.service;
|
package com.fastbee.deviceData.api.yingshiyun.service;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.http.HttpRequest;
|
import cn.hutool.http.HttpRequest;
|
@ -0,0 +1,90 @@
|
|||||||
|
package com.fastbee.deviceData.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.fastbee.common.annotation.Excel;
|
||||||
|
import com.fastbee.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 气象设备实时数据对象 iot_device_realtimedata_meteorology
|
||||||
|
*
|
||||||
|
* @author kerwincui
|
||||||
|
* @date 2024-11-08
|
||||||
|
*/
|
||||||
|
@ApiModel(value = "DeviceRealtimedataMeteorology",description = "气象设备实时数据 iot_device_realtimedata_meteorology")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("iot_device_realtimedata_meteorology")
|
||||||
|
public class DeviceRealtimedataMeteorology extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 节点编号 */
|
||||||
|
private Long nodeId;
|
||||||
|
|
||||||
|
/** 节点名称 */
|
||||||
|
@Excel(name = "节点名称")
|
||||||
|
@ApiModelProperty("节点名称")
|
||||||
|
private String nodeName;
|
||||||
|
|
||||||
|
/** 节点类型 -- 节点类型 --1:模拟量1使能模拟量2使能 --2:模拟量1使能模拟量2禁用 --3:模拟量1禁用模拟量2使能 --4:浮点型设备--5:开关量型设备 --6:32位有符号整形 --7:32位无符号整形--8:遥调设备 */
|
||||||
|
@Excel(name = "节点类型 -- 节点类型 --1:模拟量1使能模拟量2使能 --2:模拟量1使能模拟量2禁用 --3:模拟量1禁用模拟量2使能 --4:浮点型设备--5:开关量型设备 --6:32位有符号整形 --7:32位无符号整形--8:遥调设备")
|
||||||
|
@ApiModelProperty("节点类型 -- 节点类型 --1:模拟量1使能模拟量2使能 --2:模拟量1使能模拟量2禁用 --3:模拟量1禁用模拟量2使能 --4:浮点型设备--5:开关量型设备 --6:32位有符号整形 --7:32位无符号整形--8:遥调设备")
|
||||||
|
private Long nodeType;
|
||||||
|
|
||||||
|
/** 模拟量1名称 */
|
||||||
|
@Excel(name = "模拟量1名称")
|
||||||
|
@ApiModelProperty("模拟量1名称")
|
||||||
|
private String temName;
|
||||||
|
|
||||||
|
/** 模拟量1单位 */
|
||||||
|
@Excel(name = "模拟量1单位")
|
||||||
|
@ApiModelProperty("模拟量1单位")
|
||||||
|
private String temUnit;
|
||||||
|
|
||||||
|
/** 模拟量1原值 */
|
||||||
|
@Excel(name = "模拟量1原值")
|
||||||
|
@ApiModelProperty("模拟量1原值")
|
||||||
|
private Long temValue;
|
||||||
|
|
||||||
|
/** 模拟量1显示值 */
|
||||||
|
@Excel(name = "模拟量1显示值")
|
||||||
|
@ApiModelProperty("模拟量1显示值")
|
||||||
|
private String temValueStr;
|
||||||
|
|
||||||
|
/** 报警等级, -- 报警等级 --0:正常--1:超上限报警 --2:超下限报警 --3:开关闭合报警 --4:开关断开报警 --5:遥调报警 */
|
||||||
|
@Excel(name = "报警等级, -- 报警等级 --0:正常--1:超上限报警 --2:超下限报警 --3:开关闭合报警 --4:开关断开报警 --5:遥调报警")
|
||||||
|
@ApiModelProperty("报警等级, -- 报警等级 --0:正常--1:超上限报警 --2:超下限报警 --3:开关闭合报警 --4:开关断开报警 --5:遥调报警")
|
||||||
|
private Long temAlarmStatus;
|
||||||
|
|
||||||
|
/** 模拟量2名称 */
|
||||||
|
@Excel(name = "模拟量2名称")
|
||||||
|
@ApiModelProperty("模拟量2名称")
|
||||||
|
private String humName;
|
||||||
|
|
||||||
|
/** 模拟量2单位 */
|
||||||
|
@Excel(name = "模拟量2单位")
|
||||||
|
@ApiModelProperty("模拟量2单位")
|
||||||
|
private String humUnit;
|
||||||
|
|
||||||
|
/** 模拟量2原值 */
|
||||||
|
@Excel(name = "模拟量2原值")
|
||||||
|
@ApiModelProperty("模拟量2原值")
|
||||||
|
private Long humValue;
|
||||||
|
|
||||||
|
/** 模拟量2显示值 */
|
||||||
|
@Excel(name = "模拟量2显示值")
|
||||||
|
@ApiModelProperty("模拟量2显示值")
|
||||||
|
private String humValueStr;
|
||||||
|
|
||||||
|
/** 报警等级 , --0:正常 --1:超上限报警 --2:超下限报警 */
|
||||||
|
@Excel(name = "报警等级 , --0:正常 --1:超上限报警 --2:超下限报警")
|
||||||
|
@ApiModelProperty("报警等级 , --0:正常 --1:超上限报警 --2:超下限报警")
|
||||||
|
private Long humAlarmStatus;
|
||||||
|
|
||||||
|
}
|
@ -1,5 +1,7 @@
|
|||||||
package com.fastbee.device.domain;
|
package com.fastbee.deviceData.domain;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -16,6 +18,7 @@ import com.fastbee.common.core.domain.BaseEntity;
|
|||||||
@ApiModel(value = "DeviceRealtimedataWorms",description = "虫情设备实时数据 iot_device_realtimedata_worms")
|
@ApiModel(value = "DeviceRealtimedataWorms",description = "虫情设备实时数据 iot_device_realtimedata_worms")
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("iot_device_realtimedata_worms")
|
||||||
public class DeviceRealtimedataWorms extends BaseEntity
|
public class DeviceRealtimedataWorms extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@ -112,5 +115,8 @@ private static final long serialVersionUID = 1L;
|
|||||||
@Excel(name = "设备状态", readConverterExp = "o=nline/offline")
|
@Excel(name = "设备状态", readConverterExp = "o=nline/offline")
|
||||||
@ApiModelProperty("设备状态")
|
@ApiModelProperty("设备状态")
|
||||||
private String status;
|
private String status;
|
||||||
|
/** 创建时间(online/offline) */
|
||||||
|
@Excel(name = "创建时间")
|
||||||
|
@ApiModelProperty("设备状态")
|
||||||
|
private DateTime createTime;
|
||||||
}
|
}
|
@ -0,0 +1,65 @@
|
|||||||
|
package com.fastbee.deviceData.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.fastbee.deviceData.domain.DeviceRealtimedataMeteorology;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 气象设备实时数据Mapper接口
|
||||||
|
*
|
||||||
|
* @author kerwincui
|
||||||
|
* @date 2024-11-08
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface DeviceRealtimedataMeteorologyMapper extends BaseMapper<DeviceRealtimedataMeteorology>
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询气象设备实时数据
|
||||||
|
*
|
||||||
|
* @param nodeId 气象设备实时数据主键
|
||||||
|
* @return 气象设备实时数据
|
||||||
|
*/
|
||||||
|
public DeviceRealtimedataMeteorology selectDeviceRealtimedataMeteorologyByNodeId(Long nodeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询气象设备实时数据列表
|
||||||
|
*
|
||||||
|
* @param deviceRealtimedataMeteorology 气象设备实时数据
|
||||||
|
* @return 气象设备实时数据集合
|
||||||
|
*/
|
||||||
|
public List<DeviceRealtimedataMeteorology> selectDeviceRealtimedataMeteorologyList(DeviceRealtimedataMeteorology deviceRealtimedataMeteorology);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增气象设备实时数据
|
||||||
|
*
|
||||||
|
* @param deviceRealtimedataMeteorology 气象设备实时数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertDeviceRealtimedataMeteorology(DeviceRealtimedataMeteorology deviceRealtimedataMeteorology);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改气象设备实时数据
|
||||||
|
*
|
||||||
|
* @param deviceRealtimedataMeteorology 气象设备实时数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateDeviceRealtimedataMeteorology(DeviceRealtimedataMeteorology deviceRealtimedataMeteorology);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除气象设备实时数据
|
||||||
|
*
|
||||||
|
* @param nodeId 气象设备实时数据主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDeviceRealtimedataMeteorologyByNodeId(Long nodeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除气象设备实时数据
|
||||||
|
*
|
||||||
|
* @param nodeIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDeviceRealtimedataMeteorologyByNodeIds(Long[] nodeIds);
|
||||||
|
}
|
@ -1,7 +1,10 @@
|
|||||||
package com.fastbee.device.mapper;
|
package com.fastbee.deviceData.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.fastbee.device.domain.DeviceRealtimedataWorms;
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.fastbee.deviceData.domain.DeviceRealtimedataWorms;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 虫情设备实时数据Mapper接口
|
* 虫情设备实时数据Mapper接口
|
||||||
@ -9,7 +12,8 @@ import com.fastbee.device.domain.DeviceRealtimedataWorms;
|
|||||||
* @author kerwincui
|
* @author kerwincui
|
||||||
* @date 2024-11-07
|
* @date 2024-11-07
|
||||||
*/
|
*/
|
||||||
public interface DeviceRealtimedataWormsMapper
|
@Mapper
|
||||||
|
public interface DeviceRealtimedataWormsMapper extends BaseMapper<DeviceRealtimedataWorms>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* 查询虫情设备实时数据
|
* 查询虫情设备实时数据
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.fastbee.deviceData.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.fastbee.deviceData.domain.DeviceRealtimedataMeteorology;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 气象设备实时数据Service接口
|
||||||
|
*
|
||||||
|
* @author kerwincui
|
||||||
|
* @date 2024-11-08
|
||||||
|
*/
|
||||||
|
public interface IDeviceRealtimedataMeteorologyService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询气象设备实时数据
|
||||||
|
*
|
||||||
|
* @param nodeId 气象设备实时数据主键
|
||||||
|
* @return 气象设备实时数据
|
||||||
|
*/
|
||||||
|
public DeviceRealtimedataMeteorology selectDeviceRealtimedataMeteorologyByNodeId(Long nodeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询气象设备实时数据列表
|
||||||
|
*
|
||||||
|
* @param deviceRealtimedataMeteorology 气象设备实时数据
|
||||||
|
* @return 气象设备实时数据集合
|
||||||
|
*/
|
||||||
|
public List<DeviceRealtimedataMeteorology> selectDeviceRealtimedataMeteorologyList(DeviceRealtimedataMeteorology deviceRealtimedataMeteorology);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增气象设备实时数据
|
||||||
|
*
|
||||||
|
* @param deviceRealtimedataMeteorology 气象设备实时数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertDeviceRealtimedataMeteorology(DeviceRealtimedataMeteorology deviceRealtimedataMeteorology);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改气象设备实时数据
|
||||||
|
*
|
||||||
|
* @param deviceRealtimedataMeteorology 气象设备实时数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateDeviceRealtimedataMeteorology(DeviceRealtimedataMeteorology deviceRealtimedataMeteorology);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除气象设备实时数据
|
||||||
|
*
|
||||||
|
* @param nodeIds 需要删除的气象设备实时数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDeviceRealtimedataMeteorologyByNodeIds(Long[] nodeIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除气象设备实时数据信息
|
||||||
|
*
|
||||||
|
* @param nodeId 气象设备实时数据主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteDeviceRealtimedataMeteorologyByNodeId(Long nodeId);
|
||||||
|
}
|
@ -1,7 +1,8 @@
|
|||||||
package com.fastbee.device.service;
|
package com.fastbee.deviceData.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.fastbee.device.domain.DeviceRealtimedataWorms;
|
import com.fastbee.deviceData.domain.DeviceRealtimedataWorms;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 虫情设备实时数据Service接口
|
* 虫情设备实时数据Service接口
|
||||||
@ -9,6 +10,7 @@ import com.fastbee.device.domain.DeviceRealtimedataWorms;
|
|||||||
* @author kerwincui
|
* @author kerwincui
|
||||||
* @date 2024-11-07
|
* @date 2024-11-07
|
||||||
*/
|
*/
|
||||||
|
@Mapper
|
||||||
public interface IDeviceRealtimedataWormsService
|
public interface IDeviceRealtimedataWormsService
|
||||||
{
|
{
|
||||||
/**
|
/**
|
@ -0,0 +1,95 @@
|
|||||||
|
package com.fastbee.deviceData.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.fastbee.common.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.fastbee.deviceData.mapper.DeviceRealtimedataMeteorologyMapper;
|
||||||
|
import com.fastbee.deviceData.domain.DeviceRealtimedataMeteorology;
|
||||||
|
import com.fastbee.deviceData.service.IDeviceRealtimedataMeteorologyService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 气象设备实时数据Service业务层处理
|
||||||
|
*
|
||||||
|
* @author kerwincui
|
||||||
|
* @date 2024-11-08
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DeviceRealtimedataMeteorologyServiceImpl implements IDeviceRealtimedataMeteorologyService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private DeviceRealtimedataMeteorologyMapper deviceRealtimedataMeteorologyMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询气象设备实时数据
|
||||||
|
*
|
||||||
|
* @param nodeId 气象设备实时数据主键
|
||||||
|
* @return 气象设备实时数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public DeviceRealtimedataMeteorology selectDeviceRealtimedataMeteorologyByNodeId(Long nodeId)
|
||||||
|
{
|
||||||
|
return deviceRealtimedataMeteorologyMapper.selectDeviceRealtimedataMeteorologyByNodeId(nodeId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询气象设备实时数据列表
|
||||||
|
*
|
||||||
|
* @param deviceRealtimedataMeteorology 气象设备实时数据
|
||||||
|
* @return 气象设备实时数据
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<DeviceRealtimedataMeteorology> selectDeviceRealtimedataMeteorologyList(DeviceRealtimedataMeteorology deviceRealtimedataMeteorology)
|
||||||
|
{
|
||||||
|
return deviceRealtimedataMeteorologyMapper.selectDeviceRealtimedataMeteorologyList(deviceRealtimedataMeteorology);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增气象设备实时数据
|
||||||
|
*
|
||||||
|
* @param deviceRealtimedataMeteorology 气象设备实时数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertDeviceRealtimedataMeteorology(DeviceRealtimedataMeteorology deviceRealtimedataMeteorology)
|
||||||
|
{
|
||||||
|
deviceRealtimedataMeteorology.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return deviceRealtimedataMeteorologyMapper.insert(deviceRealtimedataMeteorology);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改气象设备实时数据
|
||||||
|
*
|
||||||
|
* @param deviceRealtimedataMeteorology 气象设备实时数据
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateDeviceRealtimedataMeteorology(DeviceRealtimedataMeteorology deviceRealtimedataMeteorology)
|
||||||
|
{
|
||||||
|
return deviceRealtimedataMeteorologyMapper.updateDeviceRealtimedataMeteorology(deviceRealtimedataMeteorology);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除气象设备实时数据
|
||||||
|
*
|
||||||
|
* @param nodeIds 需要删除的气象设备实时数据主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteDeviceRealtimedataMeteorologyByNodeIds(Long[] nodeIds)
|
||||||
|
{
|
||||||
|
return deviceRealtimedataMeteorologyMapper.deleteDeviceRealtimedataMeteorologyByNodeIds(nodeIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除气象设备实时数据信息
|
||||||
|
*
|
||||||
|
* @param nodeId 气象设备实时数据主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteDeviceRealtimedataMeteorologyByNodeId(Long nodeId)
|
||||||
|
{
|
||||||
|
return deviceRealtimedataMeteorologyMapper.deleteDeviceRealtimedataMeteorologyByNodeId(nodeId);
|
||||||
|
}
|
||||||
|
}
|
@ -1,11 +1,11 @@
|
|||||||
package com.fastbee.device.service.impl;
|
package com.fastbee.deviceData.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.fastbee.device.mapper.DeviceRealtimedataWormsMapper;
|
import com.fastbee.deviceData.mapper.DeviceRealtimedataWormsMapper;
|
||||||
import com.fastbee.device.domain.DeviceRealtimedataWorms;
|
import com.fastbee.deviceData.domain.DeviceRealtimedataWorms;
|
||||||
import com.fastbee.device.service.IDeviceRealtimedataWormsService;
|
import com.fastbee.deviceData.service.IDeviceRealtimedataWormsService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 虫情设备实时数据Service业务层处理
|
* 虫情设备实时数据Service业务层处理
|
||||||
@ -52,7 +52,7 @@ public class DeviceRealtimedataWormsServiceImpl implements IDeviceRealtimedataWo
|
|||||||
@Override
|
@Override
|
||||||
public int insertDeviceRealtimedataWorms(DeviceRealtimedataWorms deviceRealtimedataWorms)
|
public int insertDeviceRealtimedataWorms(DeviceRealtimedataWorms deviceRealtimedataWorms)
|
||||||
{
|
{
|
||||||
return deviceRealtimedataWormsMapper.insertDeviceRealtimedataWorms(deviceRealtimedataWorms);
|
return deviceRealtimedataWormsMapper.insert(deviceRealtimedataWorms);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
@ -0,0 +1,117 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.fastbee.deviceData.mapper.DeviceRealtimedataMeteorologyMapper">
|
||||||
|
|
||||||
|
<resultMap type="DeviceRealtimedataMeteorology" id="DeviceRealtimedataMeteorologyResult">
|
||||||
|
<result property="nodeId" column="node_id" />
|
||||||
|
<result property="nodeName" column="node_name" />
|
||||||
|
<result property="nodeType" column="node_type" />
|
||||||
|
<result property="temName" column="tem_name" />
|
||||||
|
<result property="temUnit" column="tem_unit" />
|
||||||
|
<result property="temValue" column="tem_value" />
|
||||||
|
<result property="temValueStr" column="tem_value_str" />
|
||||||
|
<result property="temAlarmStatus" column="tem_alarm_status" />
|
||||||
|
<result property="humName" column="hum_name" />
|
||||||
|
<result property="humUnit" column="hum_unit" />
|
||||||
|
<result property="humValue" column="hum_value" />
|
||||||
|
<result property="humValueStr" column="hum_value_str" />
|
||||||
|
<result property="humAlarmStatus" column="hum_alarm_status" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectDeviceRealtimedataMeteorologyVo">
|
||||||
|
select node_id, node_name, node_type, tem_name, tem_unit, tem_value, tem_value_str, tem_alarm_status, hum_name, hum_unit, hum_value, hum_value_str, hum_alarm_status, create_time from iot_device_realtimedata_meteorology
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectDeviceRealtimedataMeteorologyList" parameterType="DeviceRealtimedataMeteorology" resultMap="DeviceRealtimedataMeteorologyResult">
|
||||||
|
<include refid="selectDeviceRealtimedataMeteorologyVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="nodeName != null and nodeName != ''"> and node_name like concat('%', #{nodeName}, '%')</if>
|
||||||
|
<if test="nodeType != null "> and node_type = #{nodeType}</if>
|
||||||
|
<if test="temName != null and temName != ''"> and tem_name like concat('%', #{temName}, '%')</if>
|
||||||
|
<if test="temUnit != null and temUnit != ''"> and tem_unit = #{temUnit}</if>
|
||||||
|
<if test="temValue != null "> and tem_value = #{temValue}</if>
|
||||||
|
<if test="temValueStr != null and temValueStr != ''"> and tem_value_str = #{temValueStr}</if>
|
||||||
|
<if test="temAlarmStatus != null "> and tem_alarm_status = #{temAlarmStatus}</if>
|
||||||
|
<if test="humName != null and humName != ''"> and hum_name like concat('%', #{humName}, '%')</if>
|
||||||
|
<if test="humUnit != null and humUnit != ''"> and hum_unit = #{humUnit}</if>
|
||||||
|
<if test="humValue != null "> and hum_value = #{humValue}</if>
|
||||||
|
<if test="humValueStr != null and humValueStr != ''"> and hum_value_str = #{humValueStr}</if>
|
||||||
|
<if test="humAlarmStatus != null "> and hum_alarm_status = #{humAlarmStatus}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectDeviceRealtimedataMeteorologyByNodeId" parameterType="Long" resultMap="DeviceRealtimedataMeteorologyResult">
|
||||||
|
<include refid="selectDeviceRealtimedataMeteorologyVo"/>
|
||||||
|
where node_id = #{nodeId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertDeviceRealtimedataMeteorology" parameterType="DeviceRealtimedataMeteorology">
|
||||||
|
insert into iot_device_realtimedata_meteorology
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="nodeId != null">node_id,</if>
|
||||||
|
<if test="nodeName != null">node_name,</if>
|
||||||
|
<if test="nodeType != null">node_type,</if>
|
||||||
|
<if test="temName != null">tem_name,</if>
|
||||||
|
<if test="temUnit != null">tem_unit,</if>
|
||||||
|
<if test="temValue != null">tem_value,</if>
|
||||||
|
<if test="temValueStr != null">tem_value_str,</if>
|
||||||
|
<if test="temAlarmStatus != null">tem_alarm_status,</if>
|
||||||
|
<if test="humName != null">hum_name,</if>
|
||||||
|
<if test="humUnit != null">hum_unit,</if>
|
||||||
|
<if test="humValue != null">hum_value,</if>
|
||||||
|
<if test="humValueStr != null">hum_value_str,</if>
|
||||||
|
<if test="humAlarmStatus != null">hum_alarm_status,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="nodeId != null">#{nodeId},</if>
|
||||||
|
<if test="nodeName != null">#{nodeName},</if>
|
||||||
|
<if test="nodeType != null">#{nodeType},</if>
|
||||||
|
<if test="temName != null">#{temName},</if>
|
||||||
|
<if test="temUnit != null">#{temUnit},</if>
|
||||||
|
<if test="temValue != null">#{temValue},</if>
|
||||||
|
<if test="temValueStr != null">#{temValueStr},</if>
|
||||||
|
<if test="temAlarmStatus != null">#{temAlarmStatus},</if>
|
||||||
|
<if test="humName != null">#{humName},</if>
|
||||||
|
<if test="humUnit != null">#{humUnit},</if>
|
||||||
|
<if test="humValue != null">#{humValue},</if>
|
||||||
|
<if test="humValueStr != null">#{humValueStr},</if>
|
||||||
|
<if test="humAlarmStatus != null">#{humAlarmStatus},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateDeviceRealtimedataMeteorology" parameterType="DeviceRealtimedataMeteorology">
|
||||||
|
update iot_device_realtimedata_meteorology
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="nodeName != null">node_name = #{nodeName},</if>
|
||||||
|
<if test="nodeType != null">node_type = #{nodeType},</if>
|
||||||
|
<if test="temName != null">tem_name = #{temName},</if>
|
||||||
|
<if test="temUnit != null">tem_unit = #{temUnit},</if>
|
||||||
|
<if test="temValue != null">tem_value = #{temValue},</if>
|
||||||
|
<if test="temValueStr != null">tem_value_str = #{temValueStr},</if>
|
||||||
|
<if test="temAlarmStatus != null">tem_alarm_status = #{temAlarmStatus},</if>
|
||||||
|
<if test="humName != null">hum_name = #{humName},</if>
|
||||||
|
<if test="humUnit != null">hum_unit = #{humUnit},</if>
|
||||||
|
<if test="humValue != null">hum_value = #{humValue},</if>
|
||||||
|
<if test="humValueStr != null">hum_value_str = #{humValueStr},</if>
|
||||||
|
<if test="humAlarmStatus != null">hum_alarm_status = #{humAlarmStatus},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
</trim>
|
||||||
|
where node_id = #{nodeId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteDeviceRealtimedataMeteorologyByNodeId" parameterType="Long">
|
||||||
|
delete from iot_device_realtimedata_meteorology where node_id = #{nodeId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteDeviceRealtimedataMeteorologyByNodeIds" parameterType="String">
|
||||||
|
delete from iot_device_realtimedata_meteorology where node_id in
|
||||||
|
<foreach item="nodeId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{nodeId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -160,6 +160,12 @@
|
|||||||
<groupId>com.fastbee</groupId>
|
<groupId>com.fastbee</groupId>
|
||||||
<artifactId>fastbee-waterele-service</artifactId>
|
<artifactId>fastbee-waterele-service</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fastbee</groupId>
|
||||||
|
<artifactId>fastbee-device-service</artifactId>
|
||||||
|
<version>3.8.5</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
@ -1,18 +1,20 @@
|
|||||||
package com.fastbee.iot.timer;
|
package com.fastbee.iot.timer;
|
||||||
|
|
||||||
import cn.hutool.http.HttpConfig;
|
import cn.hutool.core.date.DateTime;
|
||||||
import cn.hutool.http.HttpRequest;
|
import cn.hutool.http.HttpRequest;
|
||||||
import cn.hutool.http.HttpResponse;
|
import cn.hutool.http.HttpResponse;
|
||||||
|
|
||||||
import cn.hutool.json.JSONArray;
|
import cn.hutool.json.JSONArray;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.fastbee.common.core.redis.RedisCache;
|
import com.fastbee.deviceData.api.renke.constant.RenKeDeviceTypeConstant;
|
||||||
|
import com.fastbee.deviceData.domain.DeviceRealtimedataMeteorology;
|
||||||
|
import com.fastbee.deviceData.domain.DeviceRealtimedataWorms;
|
||||||
|
import com.fastbee.deviceData.service.impl.DeviceRealtimedataMeteorologyServiceImpl;
|
||||||
|
import com.fastbee.deviceData.service.impl.DeviceRealtimedataWormsServiceImpl;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@ -29,6 +31,11 @@ public class DeviceDateTask {
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private StringRedisTemplate stringRedisTemplate;
|
private StringRedisTemplate stringRedisTemplate;
|
||||||
|
@Autowired
|
||||||
|
private DeviceRealtimedataWormsServiceImpl deviceRealtimedataWormsServiceImpl;
|
||||||
|
@Autowired
|
||||||
|
private DeviceRealtimedataMeteorologyServiceImpl deviceRealtimedataMeteorologyServiceImpl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 在执行定时任务中出现了异常会终止调度,所以需要捕获异常以便于下一轮
|
* 在执行定时任务中出现了异常会终止调度,所以需要捕获异常以便于下一轮
|
||||||
* 执行,不会影响下一次执行
|
* 执行,不会影响下一次执行
|
||||||
@ -49,8 +56,28 @@ public class DeviceDateTask {
|
|||||||
JSONArray realtimeList = JSONUtil.parseArray(respBody.get("data"));
|
JSONArray realtimeList = JSONUtil.parseArray(respBody.get("data"));
|
||||||
System.err.println("设备实时数据:"+realtimeList);
|
System.err.println("设备实时数据:"+realtimeList);
|
||||||
//TODO 解析实时数据保存到数据库
|
//TODO 解析实时数据保存到数据库
|
||||||
|
for (Object jsonObject : realtimeList){
|
||||||
|
JSONObject josnConversion = (JSONObject) jsonObject;
|
||||||
|
if (RenKeDeviceTypeConstant.WORM.equals(josnConversion.get("deviceType"))){
|
||||||
|
JSONObject josnArray = JSONUtil.parseObj(josnConversion.get("data"));
|
||||||
|
DeviceRealtimedataWorms deviceRealtimedataWorms = JSONUtil.toBean(josnArray, DeviceRealtimedataWorms.class);
|
||||||
|
deviceRealtimedataWorms.setCreateTime(DateTime.now());
|
||||||
|
if(deviceRealtimedataWormsServiceImpl.insertDeviceRealtimedataWorms(deviceRealtimedataWorms)==1){
|
||||||
|
System.out.println("插入成功");
|
||||||
|
};
|
||||||
|
}else if (RenKeDeviceTypeConstant.MET.equals(josnConversion.get("deviceType"))){
|
||||||
|
JSONArray josnArray = JSONUtil.parseArray(josnConversion.get("data"));
|
||||||
|
for (Object json : josnArray){
|
||||||
|
DeviceRealtimedataMeteorology deviceRealtimedataMeteorology = JSONUtil.toBean((JSONObject) json, DeviceRealtimedataMeteorology.class);
|
||||||
|
deviceRealtimedataMeteorology.setCreateTime(DateTime.now());
|
||||||
|
if(deviceRealtimedataMeteorologyServiceImpl.insertDeviceRealtimedataMeteorology(deviceRealtimedataMeteorology)==1){
|
||||||
|
System.out.println("插入成功");
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private String getAuth(){
|
private String getAuth(){
|
||||||
@ -83,5 +110,7 @@ public class DeviceDateTask {
|
|||||||
System.err.println("请求获取到token:"+tokenObject.get("token").toString());
|
System.err.println("请求获取到token:"+tokenObject.get("token").toString());
|
||||||
return stringRedisTemplate.opsForValue().get("rkckth:user:token").toString();
|
return stringRedisTemplate.opsForValue().get("rkckth:user:token").toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user