diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java index ed10442..81d30f0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java @@ -42,6 +42,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 位置类型(内圈 inner | 外圈 outer) */ @ApiModelProperty(value = "位置类型(内圈 inner | 外圈 outer)") @@ -78,12 +84,30 @@ private Date lastPicTime; /** + * 上次加热时间 + */ + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** * 首次报警时间(连续3次手动确认则报警) */ @ApiModelProperty(value = "首次报警时间(连续3次手动确认则报警)") private Date firstWarnDatetime; /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + + /** *同步状态(成功 success | 失败 fail) */ @ApiModelProperty(value = "同步状态(成功 success | 失败 fail)") diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java index ed10442..81d30f0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java @@ -42,6 +42,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 位置类型(内圈 inner | 外圈 outer) */ @ApiModelProperty(value = "位置类型(内圈 inner | 外圈 outer)") @@ -78,12 +84,30 @@ private Date lastPicTime; /** + * 上次加热时间 + */ + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** * 首次报警时间(连续3次手动确认则报警) */ @ApiModelProperty(value = "首次报警时间(连续3次手动确认则报警)") private Date firstWarnDatetime; /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + + /** *同步状态(成功 success | 失败 fail) */ @ApiModelProperty(value = "同步状态(成功 success | 失败 fail)") diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java index aa66656..60c7270 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java @@ -155,4 +155,11 @@ @ApiModelProperty(value = "摄像头") private String camera; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java index ed10442..81d30f0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java @@ -42,6 +42,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 位置类型(内圈 inner | 外圈 outer) */ @ApiModelProperty(value = "位置类型(内圈 inner | 外圈 outer)") @@ -78,12 +84,30 @@ private Date lastPicTime; /** + * 上次加热时间 + */ + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** * 首次报警时间(连续3次手动确认则报警) */ @ApiModelProperty(value = "首次报警时间(连续3次手动确认则报警)") private Date firstWarnDatetime; /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + + /** *同步状态(成功 success | 失败 fail) */ @ApiModelProperty(value = "同步状态(成功 success | 失败 fail)") diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java index aa66656..60c7270 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java @@ -155,4 +155,11 @@ @ApiModelProperty(value = "摄像头") private String camera; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java index 891532b..9ddb017 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java @@ -1,12 +1,11 @@ package com.newfiber.termite.domain; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.newfiber.common.core.web.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; @@ -91,4 +90,11 @@ private Date uptime; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java index ed10442..81d30f0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java @@ -42,6 +42,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 位置类型(内圈 inner | 外圈 outer) */ @ApiModelProperty(value = "位置类型(内圈 inner | 外圈 outer)") @@ -78,12 +84,30 @@ private Date lastPicTime; /** + * 上次加热时间 + */ + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** * 首次报警时间(连续3次手动确认则报警) */ @ApiModelProperty(value = "首次报警时间(连续3次手动确认则报警)") private Date firstWarnDatetime; /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + + /** *同步状态(成功 success | 失败 fail) */ @ApiModelProperty(value = "同步状态(成功 success | 失败 fail)") diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java index aa66656..60c7270 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java @@ -155,4 +155,11 @@ @ApiModelProperty(value = "摄像头") private String camera; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java index 891532b..9ddb017 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java @@ -1,12 +1,11 @@ package com.newfiber.termite.domain; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.newfiber.common.core.web.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; @@ -91,4 +90,11 @@ private Date uptime; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java index 3605283..b45a3af 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java @@ -1,5 +1,6 @@ package com.newfiber.termite.domain.dto; +import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; import java.util.Date; import lombok.Data; @@ -9,6 +10,32 @@ @ApiModelProperty(value = "设备编号", required = true) private String sn; + /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java index ed10442..81d30f0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java @@ -42,6 +42,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 位置类型(内圈 inner | 外圈 outer) */ @ApiModelProperty(value = "位置类型(内圈 inner | 外圈 outer)") @@ -78,12 +84,30 @@ private Date lastPicTime; /** + * 上次加热时间 + */ + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** * 首次报警时间(连续3次手动确认则报警) */ @ApiModelProperty(value = "首次报警时间(连续3次手动确认则报警)") private Date firstWarnDatetime; /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + + /** *同步状态(成功 success | 失败 fail) */ @ApiModelProperty(value = "同步状态(成功 success | 失败 fail)") diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java index aa66656..60c7270 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java @@ -155,4 +155,11 @@ @ApiModelProperty(value = "摄像头") private String camera; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java index 891532b..9ddb017 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java @@ -1,12 +1,11 @@ package com.newfiber.termite.domain; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.newfiber.common.core.web.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; @@ -91,4 +90,11 @@ private Date uptime; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java index 3605283..b45a3af 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java @@ -1,5 +1,6 @@ package com.newfiber.termite.domain.dto; +import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; import java.util.Date; import lombok.Data; @@ -9,6 +10,32 @@ @ApiModelProperty(value = "设备编号", required = true) private String sn; + /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java index 0d887c1..1c8a2d3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 设备信息对象 ter_device_info @@ -38,4 +36,5 @@ private String warnFlag; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java index ed10442..81d30f0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java @@ -42,6 +42,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 位置类型(内圈 inner | 外圈 outer) */ @ApiModelProperty(value = "位置类型(内圈 inner | 外圈 outer)") @@ -78,12 +84,30 @@ private Date lastPicTime; /** + * 上次加热时间 + */ + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** * 首次报警时间(连续3次手动确认则报警) */ @ApiModelProperty(value = "首次报警时间(连续3次手动确认则报警)") private Date firstWarnDatetime; /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + + /** *同步状态(成功 success | 失败 fail) */ @ApiModelProperty(value = "同步状态(成功 success | 失败 fail)") diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java index aa66656..60c7270 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java @@ -155,4 +155,11 @@ @ApiModelProperty(value = "摄像头") private String camera; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java index 891532b..9ddb017 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java @@ -1,12 +1,11 @@ package com.newfiber.termite.domain; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.newfiber.common.core.web.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; @@ -91,4 +90,11 @@ private Date uptime; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java index 3605283..b45a3af 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java @@ -1,5 +1,6 @@ package com.newfiber.termite.domain.dto; +import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; import java.util.Date; import lombok.Data; @@ -9,6 +10,32 @@ @ApiModelProperty(value = "设备编号", required = true) private String sn; + /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java index 0d887c1..1c8a2d3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 设备信息对象 ter_device_info @@ -38,4 +36,5 @@ private String warnFlag; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java index d13cd46..a224b2d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; +import java.util.Date; import lombok.Data; /** @@ -21,6 +22,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 白蚁识别结果开始日期 */ @ApiModelProperty(value = "白蚁识别结果开始日期(yyyy-MM-dd HH:mm:ss)") @@ -32,6 +39,26 @@ @ApiModelProperty(value = "白蚁识别结果结束日期(yyyy-MM-dd HH:mm:ss)") private String antEndDate; + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java index ed10442..81d30f0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java @@ -42,6 +42,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 位置类型(内圈 inner | 外圈 outer) */ @ApiModelProperty(value = "位置类型(内圈 inner | 外圈 outer)") @@ -78,12 +84,30 @@ private Date lastPicTime; /** + * 上次加热时间 + */ + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** * 首次报警时间(连续3次手动确认则报警) */ @ApiModelProperty(value = "首次报警时间(连续3次手动确认则报警)") private Date firstWarnDatetime; /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + + /** *同步状态(成功 success | 失败 fail) */ @ApiModelProperty(value = "同步状态(成功 success | 失败 fail)") diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java index aa66656..60c7270 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java @@ -155,4 +155,11 @@ @ApiModelProperty(value = "摄像头") private String camera; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java index 891532b..9ddb017 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java @@ -1,12 +1,11 @@ package com.newfiber.termite.domain; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.newfiber.common.core.web.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; @@ -91,4 +90,11 @@ private Date uptime; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java index 3605283..b45a3af 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java @@ -1,5 +1,6 @@ package com.newfiber.termite.domain.dto; +import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; import java.util.Date; import lombok.Data; @@ -9,6 +10,32 @@ @ApiModelProperty(value = "设备编号", required = true) private String sn; + /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java index 0d887c1..1c8a2d3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 设备信息对象 ter_device_info @@ -38,4 +36,5 @@ private String warnFlag; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java index d13cd46..a224b2d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; +import java.util.Date; import lombok.Data; /** @@ -21,6 +22,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 白蚁识别结果开始日期 */ @ApiModelProperty(value = "白蚁识别结果开始日期(yyyy-MM-dd HH:mm:ss)") @@ -32,6 +39,26 @@ @ApiModelProperty(value = "白蚁识别结果结束日期(yyyy-MM-dd HH:mm:ss)") private String antEndDate; + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java index e9bf91f..381c1e8 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 白蚁防治数据对象 ter_device_monitoring_data_realtime @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,69 +47,10 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; - /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * 软件版本 - */ - @ApiModelProperty(value = "软件版本") - private String software; - - /** - * 硬件版本 - */ - @ApiModelProperty(value = "硬件版本") - private String hardware; - - /** - * 电压 - */ - @ApiModelProperty(value = "电压") - private String voltage; - - /** - * 温度 - */ - @ApiModelProperty(value = "温度") - private String temperature; - - /** - * - */ - @ApiModelProperty(value = "") - private String rssi; - - /** - * - */ - @ApiModelProperty(value = "") - private String ap; - - /** - * - */ - @ApiModelProperty(value = "") - private String camera; - + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java index ed10442..81d30f0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java @@ -42,6 +42,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 位置类型(内圈 inner | 外圈 outer) */ @ApiModelProperty(value = "位置类型(内圈 inner | 外圈 outer)") @@ -78,12 +84,30 @@ private Date lastPicTime; /** + * 上次加热时间 + */ + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** * 首次报警时间(连续3次手动确认则报警) */ @ApiModelProperty(value = "首次报警时间(连续3次手动确认则报警)") private Date firstWarnDatetime; /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + + /** *同步状态(成功 success | 失败 fail) */ @ApiModelProperty(value = "同步状态(成功 success | 失败 fail)") diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java index aa66656..60c7270 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java @@ -155,4 +155,11 @@ @ApiModelProperty(value = "摄像头") private String camera; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java index 891532b..9ddb017 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java @@ -1,12 +1,11 @@ package com.newfiber.termite.domain; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.newfiber.common.core.web.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; @@ -91,4 +90,11 @@ private Date uptime; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java index 3605283..b45a3af 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java @@ -1,5 +1,6 @@ package com.newfiber.termite.domain.dto; +import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; import java.util.Date; import lombok.Data; @@ -9,6 +10,32 @@ @ApiModelProperty(value = "设备编号", required = true) private String sn; + /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java index 0d887c1..1c8a2d3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 设备信息对象 ter_device_info @@ -38,4 +36,5 @@ private String warnFlag; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java index d13cd46..a224b2d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; +import java.util.Date; import lombok.Data; /** @@ -21,6 +22,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 白蚁识别结果开始日期 */ @ApiModelProperty(value = "白蚁识别结果开始日期(yyyy-MM-dd HH:mm:ss)") @@ -32,6 +39,26 @@ @ApiModelProperty(value = "白蚁识别结果结束日期(yyyy-MM-dd HH:mm:ss)") private String antEndDate; + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java index e9bf91f..381c1e8 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 白蚁防治数据对象 ter_device_monitoring_data_realtime @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,69 +47,10 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; - /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * 软件版本 - */ - @ApiModelProperty(value = "软件版本") - private String software; - - /** - * 硬件版本 - */ - @ApiModelProperty(value = "硬件版本") - private String hardware; - - /** - * 电压 - */ - @ApiModelProperty(value = "电压") - private String voltage; - - /** - * 温度 - */ - @ApiModelProperty(value = "温度") - private String temperature; - - /** - * - */ - @ApiModelProperty(value = "") - private String rssi; - - /** - * - */ - @ApiModelProperty(value = "") - private String ap; - - /** - * - */ - @ApiModelProperty(value = "") - private String camera; - + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java index 4c1839f..c1fb126 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 告警记录对象 ter_monitoring_warn_record @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,39 +47,16 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * - */ - @ApiModelProperty(value = "") - private String remark; - - /** * */ @ApiModelProperty(value = "") private String status; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java index ed10442..81d30f0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java @@ -42,6 +42,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 位置类型(内圈 inner | 外圈 outer) */ @ApiModelProperty(value = "位置类型(内圈 inner | 外圈 outer)") @@ -78,12 +84,30 @@ private Date lastPicTime; /** + * 上次加热时间 + */ + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** * 首次报警时间(连续3次手动确认则报警) */ @ApiModelProperty(value = "首次报警时间(连续3次手动确认则报警)") private Date firstWarnDatetime; /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + + /** *同步状态(成功 success | 失败 fail) */ @ApiModelProperty(value = "同步状态(成功 success | 失败 fail)") diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java index aa66656..60c7270 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java @@ -155,4 +155,11 @@ @ApiModelProperty(value = "摄像头") private String camera; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java index 891532b..9ddb017 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java @@ -1,12 +1,11 @@ package com.newfiber.termite.domain; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.newfiber.common.core.web.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; @@ -91,4 +90,11 @@ private Date uptime; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java index 3605283..b45a3af 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java @@ -1,5 +1,6 @@ package com.newfiber.termite.domain.dto; +import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; import java.util.Date; import lombok.Data; @@ -9,6 +10,32 @@ @ApiModelProperty(value = "设备编号", required = true) private String sn; + /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java index 0d887c1..1c8a2d3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 设备信息对象 ter_device_info @@ -38,4 +36,5 @@ private String warnFlag; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java index d13cd46..a224b2d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; +import java.util.Date; import lombok.Data; /** @@ -21,6 +22,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 白蚁识别结果开始日期 */ @ApiModelProperty(value = "白蚁识别结果开始日期(yyyy-MM-dd HH:mm:ss)") @@ -32,6 +39,26 @@ @ApiModelProperty(value = "白蚁识别结果结束日期(yyyy-MM-dd HH:mm:ss)") private String antEndDate; + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java index e9bf91f..381c1e8 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 白蚁防治数据对象 ter_device_monitoring_data_realtime @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,69 +47,10 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; - /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * 软件版本 - */ - @ApiModelProperty(value = "软件版本") - private String software; - - /** - * 硬件版本 - */ - @ApiModelProperty(value = "硬件版本") - private String hardware; - - /** - * 电压 - */ - @ApiModelProperty(value = "电压") - private String voltage; - - /** - * 温度 - */ - @ApiModelProperty(value = "温度") - private String temperature; - - /** - * - */ - @ApiModelProperty(value = "") - private String rssi; - - /** - * - */ - @ApiModelProperty(value = "") - private String ap; - - /** - * - */ - @ApiModelProperty(value = "") - private String camera; - + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java index 4c1839f..c1fb126 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 告警记录对象 ter_monitoring_warn_record @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,39 +47,16 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * - */ - @ApiModelProperty(value = "") - private String remark; - - /** * */ @ApiModelProperty(value = "") private String status; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java index 43bf747..b2ac56e 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java @@ -26,7 +26,7 @@ private Integer warnProjectCount; @ApiModelProperty(value = "告警设备总数") - private Integer warnDeviceCount; + private Long warnDeviceCount; private List projectStatisticDetailList; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java index ed10442..81d30f0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java @@ -42,6 +42,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 位置类型(内圈 inner | 外圈 outer) */ @ApiModelProperty(value = "位置类型(内圈 inner | 外圈 outer)") @@ -78,12 +84,30 @@ private Date lastPicTime; /** + * 上次加热时间 + */ + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** * 首次报警时间(连续3次手动确认则报警) */ @ApiModelProperty(value = "首次报警时间(连续3次手动确认则报警)") private Date firstWarnDatetime; /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + + /** *同步状态(成功 success | 失败 fail) */ @ApiModelProperty(value = "同步状态(成功 success | 失败 fail)") diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java index aa66656..60c7270 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java @@ -155,4 +155,11 @@ @ApiModelProperty(value = "摄像头") private String camera; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java index 891532b..9ddb017 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java @@ -1,12 +1,11 @@ package com.newfiber.termite.domain; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.newfiber.common.core.web.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; @@ -91,4 +90,11 @@ private Date uptime; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java index 3605283..b45a3af 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java @@ -1,5 +1,6 @@ package com.newfiber.termite.domain.dto; +import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; import java.util.Date; import lombok.Data; @@ -9,6 +10,32 @@ @ApiModelProperty(value = "设备编号", required = true) private String sn; + /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java index 0d887c1..1c8a2d3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 设备信息对象 ter_device_info @@ -38,4 +36,5 @@ private String warnFlag; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java index d13cd46..a224b2d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; +import java.util.Date; import lombok.Data; /** @@ -21,6 +22,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 白蚁识别结果开始日期 */ @ApiModelProperty(value = "白蚁识别结果开始日期(yyyy-MM-dd HH:mm:ss)") @@ -32,6 +39,26 @@ @ApiModelProperty(value = "白蚁识别结果结束日期(yyyy-MM-dd HH:mm:ss)") private String antEndDate; + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java index e9bf91f..381c1e8 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 白蚁防治数据对象 ter_device_monitoring_data_realtime @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,69 +47,10 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; - /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * 软件版本 - */ - @ApiModelProperty(value = "软件版本") - private String software; - - /** - * 硬件版本 - */ - @ApiModelProperty(value = "硬件版本") - private String hardware; - - /** - * 电压 - */ - @ApiModelProperty(value = "电压") - private String voltage; - - /** - * 温度 - */ - @ApiModelProperty(value = "温度") - private String temperature; - - /** - * - */ - @ApiModelProperty(value = "") - private String rssi; - - /** - * - */ - @ApiModelProperty(value = "") - private String ap; - - /** - * - */ - @ApiModelProperty(value = "") - private String camera; - + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java index 4c1839f..c1fb126 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 告警记录对象 ter_monitoring_warn_record @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,39 +47,16 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * - */ - @ApiModelProperty(value = "") - private String remark; - - /** * */ @ApiModelProperty(value = "") private String status; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java index 43bf747..b2ac56e 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java @@ -26,7 +26,7 @@ private Integer warnProjectCount; @ApiModelProperty(value = "告警设备总数") - private Integer warnDeviceCount; + private Long warnDeviceCount; private List projectStatisticDetailList; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java index 034ef2e..ffce1f9 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java @@ -2,7 +2,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.Date; -import lombok.AllArgsConstructor; import lombok.Data; /** @@ -36,8 +35,8 @@ private Integer deviceCount; @ApiModelProperty(value = "实时告警设备总数") - private Integer warnCountRealtime; + private Long warnCountRealtime; @ApiModelProperty(value = "历史告警设备总数") - private Integer warnCountHistory; + private Long warnCountHistory; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java index ed10442..81d30f0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java @@ -42,6 +42,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 位置类型(内圈 inner | 外圈 outer) */ @ApiModelProperty(value = "位置类型(内圈 inner | 外圈 outer)") @@ -78,12 +84,30 @@ private Date lastPicTime; /** + * 上次加热时间 + */ + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** * 首次报警时间(连续3次手动确认则报警) */ @ApiModelProperty(value = "首次报警时间(连续3次手动确认则报警)") private Date firstWarnDatetime; /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + + /** *同步状态(成功 success | 失败 fail) */ @ApiModelProperty(value = "同步状态(成功 success | 失败 fail)") diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java index aa66656..60c7270 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java @@ -155,4 +155,11 @@ @ApiModelProperty(value = "摄像头") private String camera; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java index 891532b..9ddb017 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java @@ -1,12 +1,11 @@ package com.newfiber.termite.domain; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.newfiber.common.core.web.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; @@ -91,4 +90,11 @@ private Date uptime; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java index 3605283..b45a3af 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java @@ -1,5 +1,6 @@ package com.newfiber.termite.domain.dto; +import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; import java.util.Date; import lombok.Data; @@ -9,6 +10,32 @@ @ApiModelProperty(value = "设备编号", required = true) private String sn; + /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java index 0d887c1..1c8a2d3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 设备信息对象 ter_device_info @@ -38,4 +36,5 @@ private String warnFlag; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java index d13cd46..a224b2d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; +import java.util.Date; import lombok.Data; /** @@ -21,6 +22,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 白蚁识别结果开始日期 */ @ApiModelProperty(value = "白蚁识别结果开始日期(yyyy-MM-dd HH:mm:ss)") @@ -32,6 +39,26 @@ @ApiModelProperty(value = "白蚁识别结果结束日期(yyyy-MM-dd HH:mm:ss)") private String antEndDate; + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java index e9bf91f..381c1e8 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 白蚁防治数据对象 ter_device_monitoring_data_realtime @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,69 +47,10 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; - /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * 软件版本 - */ - @ApiModelProperty(value = "软件版本") - private String software; - - /** - * 硬件版本 - */ - @ApiModelProperty(value = "硬件版本") - private String hardware; - - /** - * 电压 - */ - @ApiModelProperty(value = "电压") - private String voltage; - - /** - * 温度 - */ - @ApiModelProperty(value = "温度") - private String temperature; - - /** - * - */ - @ApiModelProperty(value = "") - private String rssi; - - /** - * - */ - @ApiModelProperty(value = "") - private String ap; - - /** - * - */ - @ApiModelProperty(value = "") - private String camera; - + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java index 4c1839f..c1fb126 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 告警记录对象 ter_monitoring_warn_record @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,39 +47,16 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * - */ - @ApiModelProperty(value = "") - private String remark; - - /** * */ @ApiModelProperty(value = "") private String status; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java index 43bf747..b2ac56e 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java @@ -26,7 +26,7 @@ private Integer warnProjectCount; @ApiModelProperty(value = "告警设备总数") - private Integer warnDeviceCount; + private Long warnDeviceCount; private List projectStatisticDetailList; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java index 034ef2e..ffce1f9 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java @@ -2,7 +2,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.Date; -import lombok.AllArgsConstructor; import lombok.Data; /** @@ -36,8 +35,8 @@ private Integer deviceCount; @ApiModelProperty(value = "实时告警设备总数") - private Integer warnCountRealtime; + private Long warnCountRealtime; @ApiModelProperty(value = "历史告警设备总数") - private Integer warnCountHistory; + private Long warnCountHistory; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java index c2e75ee..b16357f 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java @@ -1,10 +1,9 @@ package com.newfiber.termite.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import java.util.List; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; import com.newfiber.termite.domain.DeviceInfo; -import com.newfiber.termite.domain.response.statistic.ProjectStatistic; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; +import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -34,6 +33,4 @@ DeviceInfo selectOneById(@Param("id") Long id); - List selectProjectSitesDetails(List projectCodes); - } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java index ed10442..81d30f0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java @@ -42,6 +42,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 位置类型(内圈 inner | 外圈 outer) */ @ApiModelProperty(value = "位置类型(内圈 inner | 外圈 outer)") @@ -78,12 +84,30 @@ private Date lastPicTime; /** + * 上次加热时间 + */ + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** * 首次报警时间(连续3次手动确认则报警) */ @ApiModelProperty(value = "首次报警时间(连续3次手动确认则报警)") private Date firstWarnDatetime; /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + + /** *同步状态(成功 success | 失败 fail) */ @ApiModelProperty(value = "同步状态(成功 success | 失败 fail)") diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java index aa66656..60c7270 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java @@ -155,4 +155,11 @@ @ApiModelProperty(value = "摄像头") private String camera; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java index 891532b..9ddb017 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java @@ -1,12 +1,11 @@ package com.newfiber.termite.domain; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.newfiber.common.core.web.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; @@ -91,4 +90,11 @@ private Date uptime; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java index 3605283..b45a3af 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java @@ -1,5 +1,6 @@ package com.newfiber.termite.domain.dto; +import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; import java.util.Date; import lombok.Data; @@ -9,6 +10,32 @@ @ApiModelProperty(value = "设备编号", required = true) private String sn; + /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java index 0d887c1..1c8a2d3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 设备信息对象 ter_device_info @@ -38,4 +36,5 @@ private String warnFlag; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java index d13cd46..a224b2d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; +import java.util.Date; import lombok.Data; /** @@ -21,6 +22,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 白蚁识别结果开始日期 */ @ApiModelProperty(value = "白蚁识别结果开始日期(yyyy-MM-dd HH:mm:ss)") @@ -32,6 +39,26 @@ @ApiModelProperty(value = "白蚁识别结果结束日期(yyyy-MM-dd HH:mm:ss)") private String antEndDate; + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java index e9bf91f..381c1e8 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 白蚁防治数据对象 ter_device_monitoring_data_realtime @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,69 +47,10 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; - /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * 软件版本 - */ - @ApiModelProperty(value = "软件版本") - private String software; - - /** - * 硬件版本 - */ - @ApiModelProperty(value = "硬件版本") - private String hardware; - - /** - * 电压 - */ - @ApiModelProperty(value = "电压") - private String voltage; - - /** - * 温度 - */ - @ApiModelProperty(value = "温度") - private String temperature; - - /** - * - */ - @ApiModelProperty(value = "") - private String rssi; - - /** - * - */ - @ApiModelProperty(value = "") - private String ap; - - /** - * - */ - @ApiModelProperty(value = "") - private String camera; - + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java index 4c1839f..c1fb126 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 告警记录对象 ter_monitoring_warn_record @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,39 +47,16 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * - */ - @ApiModelProperty(value = "") - private String remark; - - /** * */ @ApiModelProperty(value = "") private String status; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java index 43bf747..b2ac56e 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java @@ -26,7 +26,7 @@ private Integer warnProjectCount; @ApiModelProperty(value = "告警设备总数") - private Integer warnDeviceCount; + private Long warnDeviceCount; private List projectStatisticDetailList; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java index 034ef2e..ffce1f9 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java @@ -2,7 +2,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.Date; -import lombok.AllArgsConstructor; import lombok.Data; /** @@ -36,8 +35,8 @@ private Integer deviceCount; @ApiModelProperty(value = "实时告警设备总数") - private Integer warnCountRealtime; + private Long warnCountRealtime; @ApiModelProperty(value = "历史告警设备总数") - private Integer warnCountHistory; + private Long warnCountHistory; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java index c2e75ee..b16357f 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java @@ -1,10 +1,9 @@ package com.newfiber.termite.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import java.util.List; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; import com.newfiber.termite.domain.DeviceInfo; -import com.newfiber.termite.domain.response.statistic.ProjectStatistic; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; +import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -34,6 +33,4 @@ DeviceInfo selectOneById(@Param("id") Long id); - List selectProjectSitesDetails(List projectCodes); - } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java index 07abda1..0e46e76 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java @@ -88,6 +88,7 @@ @Override public boolean update(TermiteDataUpRequest termiteDateUpRequest) { UpdateWrapper updateWrapper = new UpdateWrapper(). + set(StringUtils.isNotBlank(termiteDateUpRequest.getDeviceType()), "device_type", termiteDateUpRequest.getDeviceType()). set(StringUtils.isNotBlank(termiteDateUpRequest.getSoftware()), "software", termiteDateUpRequest.getSoftware()). set(StringUtils.isNotBlank(termiteDateUpRequest.getHardware()), "hardware", termiteDateUpRequest.getHardware()). set(StringUtils.isNotBlank(termiteDateUpRequest.getVoltage()), "voltage", termiteDateUpRequest.getVoltage()). @@ -102,6 +103,9 @@ set(StringUtils.isNotBlank(termiteDateUpRequest.getLteIccid()), "lte_iccid", termiteDateUpRequest.getLteIccid()). set(StringUtils.isNotBlank(termiteDateUpRequest.getLteCpos()), "lte_cpos", termiteDateUpRequest.getLteCpos()). set(null != termiteDateUpRequest.getLastPicTime(), "last_pic_time", termiteDateUpRequest.getLastPicTime()). + set(null != termiteDateUpRequest.getLastHeatTime(), "last_heat_time", termiteDateUpRequest.getLastHeatTime()). + set(null != termiteDateUpRequest.getLastMedicateTime(), "last_medicate_time", termiteDateUpRequest.getLastMedicateTime()). + set(StringUtils.isNotBlank(termiteDateUpRequest.getDruging()), "druging", termiteDateUpRequest.getDruging()). set("sync_state", EDeviceSyncState.success.getCode()). eq("sn", termiteDateUpRequest.getSn()); update(updateWrapper); diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java index ed10442..81d30f0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java @@ -42,6 +42,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 位置类型(内圈 inner | 外圈 outer) */ @ApiModelProperty(value = "位置类型(内圈 inner | 外圈 outer)") @@ -78,12 +84,30 @@ private Date lastPicTime; /** + * 上次加热时间 + */ + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** * 首次报警时间(连续3次手动确认则报警) */ @ApiModelProperty(value = "首次报警时间(连续3次手动确认则报警)") private Date firstWarnDatetime; /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + + /** *同步状态(成功 success | 失败 fail) */ @ApiModelProperty(value = "同步状态(成功 success | 失败 fail)") diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java index aa66656..60c7270 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java @@ -155,4 +155,11 @@ @ApiModelProperty(value = "摄像头") private String camera; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java index 891532b..9ddb017 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java @@ -1,12 +1,11 @@ package com.newfiber.termite.domain; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.newfiber.common.core.web.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; @@ -91,4 +90,11 @@ private Date uptime; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java index 3605283..b45a3af 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java @@ -1,5 +1,6 @@ package com.newfiber.termite.domain.dto; +import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; import java.util.Date; import lombok.Data; @@ -9,6 +10,32 @@ @ApiModelProperty(value = "设备编号", required = true) private String sn; + /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java index 0d887c1..1c8a2d3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 设备信息对象 ter_device_info @@ -38,4 +36,5 @@ private String warnFlag; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java index d13cd46..a224b2d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; +import java.util.Date; import lombok.Data; /** @@ -21,6 +22,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 白蚁识别结果开始日期 */ @ApiModelProperty(value = "白蚁识别结果开始日期(yyyy-MM-dd HH:mm:ss)") @@ -32,6 +39,26 @@ @ApiModelProperty(value = "白蚁识别结果结束日期(yyyy-MM-dd HH:mm:ss)") private String antEndDate; + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java index e9bf91f..381c1e8 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 白蚁防治数据对象 ter_device_monitoring_data_realtime @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,69 +47,10 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; - /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * 软件版本 - */ - @ApiModelProperty(value = "软件版本") - private String software; - - /** - * 硬件版本 - */ - @ApiModelProperty(value = "硬件版本") - private String hardware; - - /** - * 电压 - */ - @ApiModelProperty(value = "电压") - private String voltage; - - /** - * 温度 - */ - @ApiModelProperty(value = "温度") - private String temperature; - - /** - * - */ - @ApiModelProperty(value = "") - private String rssi; - - /** - * - */ - @ApiModelProperty(value = "") - private String ap; - - /** - * - */ - @ApiModelProperty(value = "") - private String camera; - + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java index 4c1839f..c1fb126 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 告警记录对象 ter_monitoring_warn_record @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,39 +47,16 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * - */ - @ApiModelProperty(value = "") - private String remark; - - /** * */ @ApiModelProperty(value = "") private String status; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java index 43bf747..b2ac56e 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java @@ -26,7 +26,7 @@ private Integer warnProjectCount; @ApiModelProperty(value = "告警设备总数") - private Integer warnDeviceCount; + private Long warnDeviceCount; private List projectStatisticDetailList; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java index 034ef2e..ffce1f9 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java @@ -2,7 +2,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.Date; -import lombok.AllArgsConstructor; import lombok.Data; /** @@ -36,8 +35,8 @@ private Integer deviceCount; @ApiModelProperty(value = "实时告警设备总数") - private Integer warnCountRealtime; + private Long warnCountRealtime; @ApiModelProperty(value = "历史告警设备总数") - private Integer warnCountHistory; + private Long warnCountHistory; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java index c2e75ee..b16357f 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java @@ -1,10 +1,9 @@ package com.newfiber.termite.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import java.util.List; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; import com.newfiber.termite.domain.DeviceInfo; -import com.newfiber.termite.domain.response.statistic.ProjectStatistic; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; +import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -34,6 +33,4 @@ DeviceInfo selectOneById(@Param("id") Long id); - List selectProjectSitesDetails(List projectCodes); - } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java index 07abda1..0e46e76 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java @@ -88,6 +88,7 @@ @Override public boolean update(TermiteDataUpRequest termiteDateUpRequest) { UpdateWrapper updateWrapper = new UpdateWrapper(). + set(StringUtils.isNotBlank(termiteDateUpRequest.getDeviceType()), "device_type", termiteDateUpRequest.getDeviceType()). set(StringUtils.isNotBlank(termiteDateUpRequest.getSoftware()), "software", termiteDateUpRequest.getSoftware()). set(StringUtils.isNotBlank(termiteDateUpRequest.getHardware()), "hardware", termiteDateUpRequest.getHardware()). set(StringUtils.isNotBlank(termiteDateUpRequest.getVoltage()), "voltage", termiteDateUpRequest.getVoltage()). @@ -102,6 +103,9 @@ set(StringUtils.isNotBlank(termiteDateUpRequest.getLteIccid()), "lte_iccid", termiteDateUpRequest.getLteIccid()). set(StringUtils.isNotBlank(termiteDateUpRequest.getLteCpos()), "lte_cpos", termiteDateUpRequest.getLteCpos()). set(null != termiteDateUpRequest.getLastPicTime(), "last_pic_time", termiteDateUpRequest.getLastPicTime()). + set(null != termiteDateUpRequest.getLastHeatTime(), "last_heat_time", termiteDateUpRequest.getLastHeatTime()). + set(null != termiteDateUpRequest.getLastMedicateTime(), "last_medicate_time", termiteDateUpRequest.getLastMedicateTime()). + set(StringUtils.isNotBlank(termiteDateUpRequest.getDruging()), "druging", termiteDateUpRequest.getDruging()). set("sync_state", EDeviceSyncState.success.getCode()). eq("sn", termiteDateUpRequest.getSn()); update(updateWrapper); diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java index 9aafdba..fa9c693 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java @@ -2,23 +2,34 @@ import com.newfiber.termite.domain.DeviceInfo; import com.newfiber.termite.domain.DeviceMonitoringData; +import com.newfiber.termite.domain.DeviceMonitoringDataRealtime; +import com.newfiber.termite.domain.MonitoringWarnRecord; import com.newfiber.termite.domain.ProjectInfo; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; +import com.newfiber.termite.domain.request.deviceMonitoringDataRealtime.DeviceMonitoringDataRealtimeQueryRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordQueryRequest; import com.newfiber.termite.domain.request.statistic.ProjectStatisticRequest; import com.newfiber.termite.domain.request.statistic.SiteWarnDailySeqStatisticRequest; import com.newfiber.termite.domain.request.statistic.SiteWarnTotalCountStatisticRequest; import com.newfiber.termite.domain.response.statistic.ProjectStatistic; +import com.newfiber.termite.domain.response.statistic.ProjectStatisticDetail; import com.newfiber.termite.domain.response.statistic.SiteDailyWarnCount; import com.newfiber.termite.domain.response.statistic.SiteTotalWarnCount; import com.newfiber.termite.enums.EExistsAnt; -import com.newfiber.termite.mapper.DeviceInfoMapper; -import com.newfiber.termite.mapper.ProjectInfoMapper; +import com.newfiber.termite.service.IDeviceInfoService; +import com.newfiber.termite.service.IDeviceMonitoringDataRealtimeService; import com.newfiber.termite.service.IDeviceMonitoringDataService; +import com.newfiber.termite.service.IMonitoringWarnRecordService; import com.newfiber.termite.service.IProjectInfoService; import com.newfiber.termite.service.IStatisticsService; - -import java.util.*; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.Optional; +import java.util.Set; +import java.util.TreeMap; import java.util.stream.Collectors; import javax.annotation.Resource; import org.springframework.stereotype.Service; @@ -35,13 +46,16 @@ private IDeviceMonitoringDataService deviceMonitoringDataService; @Resource - private IProjectInfoService projectInfoService; - + private IDeviceMonitoringDataRealtimeService deviceMonitoringDataRealtimeService; @Resource - private DeviceInfoMapper deviceInfoMapper; + private IProjectInfoService projectInfoService; + @Resource + private IDeviceInfoService deviceInfoService; + @Resource + private IMonitoringWarnRecordService monitoringWarnRecordService; @Override public Map> warnDailySeqStatistic(SiteWarnDailySeqStatisticRequest request) { @@ -114,26 +128,61 @@ @Override public ProjectStatistic projectWarnTotalCountStatistic(ProjectStatisticRequest request) { ProjectStatistic projectStatistic = new ProjectStatistic(); - Set list = projectInfoService.getUserProjectList(request.getUserId()); - //获取项目中的每个站点编号 - List projectCodes = list.stream().map(ProjectInfo::getProjectCode).collect(Collectors.toList()); - //查询站点的设备信息 - List deviceInfoList = deviceInfoMapper.selectProjectSitesDetails(projectCodes); - //获取站点中的所有sn - List deviceSns = deviceInfoList.stream().map(DeviceInfo::getSn).collect(Collectors.toList()); + List projectStatisticDetailList = new ArrayList<>(); + // 项目信息 + Set projectInfoSet = projectInfoService.getUserProjectList(request.getUserId()); + List projectCodeList = projectInfoSet.stream().map(ProjectInfo::getProjectCode).collect(Collectors.toList()); + // 设备信息 + DeviceInfoQueryRequest deviceInfoQueryRequest = new DeviceInfoQueryRequest(); + deviceInfoQueryRequest.setProjectCodeList(projectCodeList); + List deviceInfoList = deviceInfoService.selectList(deviceInfoQueryRequest); + // TODO 历史告警 MonitoringWarnRecordQueryRequest monitoringWarnRecordQueryRequest = new MonitoringWarnRecordQueryRequest(); + monitoringWarnRecordQueryRequest.setProjectCodeList(projectCodeList); + List monitoringWarnRecordList = monitoringWarnRecordService.selectList(monitoringWarnRecordQueryRequest); + // 实时监测数据 + DeviceMonitoringDataRealtimeQueryRequest deviceMonitoringDataRealtimeQueryRequest = new DeviceMonitoringDataRealtimeQueryRequest(); + deviceMonitoringDataRealtimeQueryRequest.setProjectCodeList(projectCodeList); + List deviceMonitoringDataRealtimeList = deviceMonitoringDataRealtimeService.selectList(deviceMonitoringDataRealtimeQueryRequest); + long warnDeviceCount = 0L; + int warnProjectCount = 0; + for(ProjectInfo projectInfo : projectInfoSet){ + List projectDeviceInfoList = deviceInfoList.stream().filter(t -> + t.getProjectCode().equals(projectInfo.getProjectCode())).collect(Collectors.toList()); + List projectMonitoringWarnRecordList = monitoringWarnRecordList.stream().filter(t -> + t.getProjectCode().equals(projectInfo.getProjectCode())).collect(Collectors.toList()); + List projectDeviceMonitoringDataRealtimeList = deviceMonitoringDataRealtimeList.stream().filter(t -> + t.getProjectCode().equals(projectInfo.getProjectCode())).collect(Collectors.toList()); + long warnCountRealtime = projectDeviceMonitoringDataRealtimeList.stream().filter(t -> t.getYesnoant().equals(EExistsAnt.True.getCode())).map(DeviceMonitoringDataRealtime::getSn).distinct().count(); + ProjectStatisticDetail projectStatisticDetail = new ProjectStatisticDetail(); + projectStatisticDetail.setProjectCode(projectInfo.getProjectCode()); + projectStatisticDetail.setProjectName(projectInfo.getProjectName()); + projectStatisticDetail.setDeviceCount(projectDeviceInfoList.size()); + projectStatisticDetail.setWarnCountRealtime(warnCountRealtime); + projectStatisticDetail.setWarnCountHistory(projectMonitoringWarnRecordList.stream().map(MonitoringWarnRecord::getSn).distinct().count()); + Optional firstWarnDatetimeDevice = projectDeviceInfoList.stream().max(Comparator.comparing(DeviceInfo::getFirstWarnDatetime)); + firstWarnDatetimeDevice.ifPresent(deviceInfo -> projectStatisticDetail.setFirstWarnDatetime(deviceInfo.getFirstWarnDatetime())); + + projectStatisticDetailList.add(projectStatisticDetail); + + if(warnCountRealtime > 0) warnProjectCount = warnProjectCount + 1; + warnDeviceCount = warnDeviceCount + warnCountRealtime; + } projectStatistic.setDeviceCount(deviceInfoList.size()); - projectStatistic.setProjectCount(list.size()); + projectStatistic.setProjectCount(projectInfoSet.size()); + projectStatistic.setWarnProjectCount(warnProjectCount); + projectStatistic.setWarnDeviceCount(warnDeviceCount); + projectStatistic.setProjectStatisticDetailList(projectStatisticDetailList); return projectStatistic; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java index ed10442..81d30f0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java @@ -42,6 +42,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 位置类型(内圈 inner | 外圈 outer) */ @ApiModelProperty(value = "位置类型(内圈 inner | 外圈 outer)") @@ -78,12 +84,30 @@ private Date lastPicTime; /** + * 上次加热时间 + */ + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** * 首次报警时间(连续3次手动确认则报警) */ @ApiModelProperty(value = "首次报警时间(连续3次手动确认则报警)") private Date firstWarnDatetime; /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + + /** *同步状态(成功 success | 失败 fail) */ @ApiModelProperty(value = "同步状态(成功 success | 失败 fail)") diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java index aa66656..60c7270 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java @@ -155,4 +155,11 @@ @ApiModelProperty(value = "摄像头") private String camera; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java index 891532b..9ddb017 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java @@ -1,12 +1,11 @@ package com.newfiber.termite.domain; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.newfiber.common.core.web.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; @@ -91,4 +90,11 @@ private Date uptime; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java index 3605283..b45a3af 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java @@ -1,5 +1,6 @@ package com.newfiber.termite.domain.dto; +import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; import java.util.Date; import lombok.Data; @@ -9,6 +10,32 @@ @ApiModelProperty(value = "设备编号", required = true) private String sn; + /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java index 0d887c1..1c8a2d3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 设备信息对象 ter_device_info @@ -38,4 +36,5 @@ private String warnFlag; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java index d13cd46..a224b2d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; +import java.util.Date; import lombok.Data; /** @@ -21,6 +22,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 白蚁识别结果开始日期 */ @ApiModelProperty(value = "白蚁识别结果开始日期(yyyy-MM-dd HH:mm:ss)") @@ -32,6 +39,26 @@ @ApiModelProperty(value = "白蚁识别结果结束日期(yyyy-MM-dd HH:mm:ss)") private String antEndDate; + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java index e9bf91f..381c1e8 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 白蚁防治数据对象 ter_device_monitoring_data_realtime @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,69 +47,10 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; - /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * 软件版本 - */ - @ApiModelProperty(value = "软件版本") - private String software; - - /** - * 硬件版本 - */ - @ApiModelProperty(value = "硬件版本") - private String hardware; - - /** - * 电压 - */ - @ApiModelProperty(value = "电压") - private String voltage; - - /** - * 温度 - */ - @ApiModelProperty(value = "温度") - private String temperature; - - /** - * - */ - @ApiModelProperty(value = "") - private String rssi; - - /** - * - */ - @ApiModelProperty(value = "") - private String ap; - - /** - * - */ - @ApiModelProperty(value = "") - private String camera; - + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java index 4c1839f..c1fb126 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 告警记录对象 ter_monitoring_warn_record @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,39 +47,16 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * - */ - @ApiModelProperty(value = "") - private String remark; - - /** * */ @ApiModelProperty(value = "") private String status; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java index 43bf747..b2ac56e 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java @@ -26,7 +26,7 @@ private Integer warnProjectCount; @ApiModelProperty(value = "告警设备总数") - private Integer warnDeviceCount; + private Long warnDeviceCount; private List projectStatisticDetailList; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java index 034ef2e..ffce1f9 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java @@ -2,7 +2,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.Date; -import lombok.AllArgsConstructor; import lombok.Data; /** @@ -36,8 +35,8 @@ private Integer deviceCount; @ApiModelProperty(value = "实时告警设备总数") - private Integer warnCountRealtime; + private Long warnCountRealtime; @ApiModelProperty(value = "历史告警设备总数") - private Integer warnCountHistory; + private Long warnCountHistory; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java index c2e75ee..b16357f 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java @@ -1,10 +1,9 @@ package com.newfiber.termite.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import java.util.List; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; import com.newfiber.termite.domain.DeviceInfo; -import com.newfiber.termite.domain.response.statistic.ProjectStatistic; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; +import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -34,6 +33,4 @@ DeviceInfo selectOneById(@Param("id") Long id); - List selectProjectSitesDetails(List projectCodes); - } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java index 07abda1..0e46e76 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java @@ -88,6 +88,7 @@ @Override public boolean update(TermiteDataUpRequest termiteDateUpRequest) { UpdateWrapper updateWrapper = new UpdateWrapper(). + set(StringUtils.isNotBlank(termiteDateUpRequest.getDeviceType()), "device_type", termiteDateUpRequest.getDeviceType()). set(StringUtils.isNotBlank(termiteDateUpRequest.getSoftware()), "software", termiteDateUpRequest.getSoftware()). set(StringUtils.isNotBlank(termiteDateUpRequest.getHardware()), "hardware", termiteDateUpRequest.getHardware()). set(StringUtils.isNotBlank(termiteDateUpRequest.getVoltage()), "voltage", termiteDateUpRequest.getVoltage()). @@ -102,6 +103,9 @@ set(StringUtils.isNotBlank(termiteDateUpRequest.getLteIccid()), "lte_iccid", termiteDateUpRequest.getLteIccid()). set(StringUtils.isNotBlank(termiteDateUpRequest.getLteCpos()), "lte_cpos", termiteDateUpRequest.getLteCpos()). set(null != termiteDateUpRequest.getLastPicTime(), "last_pic_time", termiteDateUpRequest.getLastPicTime()). + set(null != termiteDateUpRequest.getLastHeatTime(), "last_heat_time", termiteDateUpRequest.getLastHeatTime()). + set(null != termiteDateUpRequest.getLastMedicateTime(), "last_medicate_time", termiteDateUpRequest.getLastMedicateTime()). + set(StringUtils.isNotBlank(termiteDateUpRequest.getDruging()), "druging", termiteDateUpRequest.getDruging()). set("sync_state", EDeviceSyncState.success.getCode()). eq("sn", termiteDateUpRequest.getSn()); update(updateWrapper); diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java index 9aafdba..fa9c693 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java @@ -2,23 +2,34 @@ import com.newfiber.termite.domain.DeviceInfo; import com.newfiber.termite.domain.DeviceMonitoringData; +import com.newfiber.termite.domain.DeviceMonitoringDataRealtime; +import com.newfiber.termite.domain.MonitoringWarnRecord; import com.newfiber.termite.domain.ProjectInfo; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; +import com.newfiber.termite.domain.request.deviceMonitoringDataRealtime.DeviceMonitoringDataRealtimeQueryRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordQueryRequest; import com.newfiber.termite.domain.request.statistic.ProjectStatisticRequest; import com.newfiber.termite.domain.request.statistic.SiteWarnDailySeqStatisticRequest; import com.newfiber.termite.domain.request.statistic.SiteWarnTotalCountStatisticRequest; import com.newfiber.termite.domain.response.statistic.ProjectStatistic; +import com.newfiber.termite.domain.response.statistic.ProjectStatisticDetail; import com.newfiber.termite.domain.response.statistic.SiteDailyWarnCount; import com.newfiber.termite.domain.response.statistic.SiteTotalWarnCount; import com.newfiber.termite.enums.EExistsAnt; -import com.newfiber.termite.mapper.DeviceInfoMapper; -import com.newfiber.termite.mapper.ProjectInfoMapper; +import com.newfiber.termite.service.IDeviceInfoService; +import com.newfiber.termite.service.IDeviceMonitoringDataRealtimeService; import com.newfiber.termite.service.IDeviceMonitoringDataService; +import com.newfiber.termite.service.IMonitoringWarnRecordService; import com.newfiber.termite.service.IProjectInfoService; import com.newfiber.termite.service.IStatisticsService; - -import java.util.*; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.Optional; +import java.util.Set; +import java.util.TreeMap; import java.util.stream.Collectors; import javax.annotation.Resource; import org.springframework.stereotype.Service; @@ -35,13 +46,16 @@ private IDeviceMonitoringDataService deviceMonitoringDataService; @Resource - private IProjectInfoService projectInfoService; - + private IDeviceMonitoringDataRealtimeService deviceMonitoringDataRealtimeService; @Resource - private DeviceInfoMapper deviceInfoMapper; + private IProjectInfoService projectInfoService; + @Resource + private IDeviceInfoService deviceInfoService; + @Resource + private IMonitoringWarnRecordService monitoringWarnRecordService; @Override public Map> warnDailySeqStatistic(SiteWarnDailySeqStatisticRequest request) { @@ -114,26 +128,61 @@ @Override public ProjectStatistic projectWarnTotalCountStatistic(ProjectStatisticRequest request) { ProjectStatistic projectStatistic = new ProjectStatistic(); - Set list = projectInfoService.getUserProjectList(request.getUserId()); - //获取项目中的每个站点编号 - List projectCodes = list.stream().map(ProjectInfo::getProjectCode).collect(Collectors.toList()); - //查询站点的设备信息 - List deviceInfoList = deviceInfoMapper.selectProjectSitesDetails(projectCodes); - //获取站点中的所有sn - List deviceSns = deviceInfoList.stream().map(DeviceInfo::getSn).collect(Collectors.toList()); + List projectStatisticDetailList = new ArrayList<>(); + // 项目信息 + Set projectInfoSet = projectInfoService.getUserProjectList(request.getUserId()); + List projectCodeList = projectInfoSet.stream().map(ProjectInfo::getProjectCode).collect(Collectors.toList()); + // 设备信息 + DeviceInfoQueryRequest deviceInfoQueryRequest = new DeviceInfoQueryRequest(); + deviceInfoQueryRequest.setProjectCodeList(projectCodeList); + List deviceInfoList = deviceInfoService.selectList(deviceInfoQueryRequest); + // TODO 历史告警 MonitoringWarnRecordQueryRequest monitoringWarnRecordQueryRequest = new MonitoringWarnRecordQueryRequest(); + monitoringWarnRecordQueryRequest.setProjectCodeList(projectCodeList); + List monitoringWarnRecordList = monitoringWarnRecordService.selectList(monitoringWarnRecordQueryRequest); + // 实时监测数据 + DeviceMonitoringDataRealtimeQueryRequest deviceMonitoringDataRealtimeQueryRequest = new DeviceMonitoringDataRealtimeQueryRequest(); + deviceMonitoringDataRealtimeQueryRequest.setProjectCodeList(projectCodeList); + List deviceMonitoringDataRealtimeList = deviceMonitoringDataRealtimeService.selectList(deviceMonitoringDataRealtimeQueryRequest); + long warnDeviceCount = 0L; + int warnProjectCount = 0; + for(ProjectInfo projectInfo : projectInfoSet){ + List projectDeviceInfoList = deviceInfoList.stream().filter(t -> + t.getProjectCode().equals(projectInfo.getProjectCode())).collect(Collectors.toList()); + List projectMonitoringWarnRecordList = monitoringWarnRecordList.stream().filter(t -> + t.getProjectCode().equals(projectInfo.getProjectCode())).collect(Collectors.toList()); + List projectDeviceMonitoringDataRealtimeList = deviceMonitoringDataRealtimeList.stream().filter(t -> + t.getProjectCode().equals(projectInfo.getProjectCode())).collect(Collectors.toList()); + long warnCountRealtime = projectDeviceMonitoringDataRealtimeList.stream().filter(t -> t.getYesnoant().equals(EExistsAnt.True.getCode())).map(DeviceMonitoringDataRealtime::getSn).distinct().count(); + ProjectStatisticDetail projectStatisticDetail = new ProjectStatisticDetail(); + projectStatisticDetail.setProjectCode(projectInfo.getProjectCode()); + projectStatisticDetail.setProjectName(projectInfo.getProjectName()); + projectStatisticDetail.setDeviceCount(projectDeviceInfoList.size()); + projectStatisticDetail.setWarnCountRealtime(warnCountRealtime); + projectStatisticDetail.setWarnCountHistory(projectMonitoringWarnRecordList.stream().map(MonitoringWarnRecord::getSn).distinct().count()); + Optional firstWarnDatetimeDevice = projectDeviceInfoList.stream().max(Comparator.comparing(DeviceInfo::getFirstWarnDatetime)); + firstWarnDatetimeDevice.ifPresent(deviceInfo -> projectStatisticDetail.setFirstWarnDatetime(deviceInfo.getFirstWarnDatetime())); + + projectStatisticDetailList.add(projectStatisticDetail); + + if(warnCountRealtime > 0) warnProjectCount = warnProjectCount + 1; + warnDeviceCount = warnDeviceCount + warnCountRealtime; + } projectStatistic.setDeviceCount(deviceInfoList.size()); - projectStatistic.setProjectCount(list.size()); + projectStatistic.setProjectCount(projectInfoSet.size()); + projectStatistic.setWarnProjectCount(warnProjectCount); + projectStatistic.setWarnDeviceCount(warnDeviceCount); + projectStatistic.setProjectStatisticDetailList(projectStatisticDetailList); return projectStatistic; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java index d3ec829..2e5ca2a 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java @@ -200,7 +200,7 @@ img = img.pressText("时间:" + DateUtil.format(existedDeviceMonitoringData.getUptime(), "yyyy-MM-dd HH:mm"), Color.WHITE, font, 0, 1100, 1f); url = CosUtil.putFile(ImgUtil.toStream(img.getImg(), FileUtil.extName(image.getName())), FileUploadUtils.extractFilename(image)); }else{ - url = CosUtil.putFile(image); + url = existedDeviceMonitoringData.getRtpitcu(); } return url; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java index ed10442..81d30f0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java @@ -42,6 +42,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 位置类型(内圈 inner | 外圈 outer) */ @ApiModelProperty(value = "位置类型(内圈 inner | 外圈 outer)") @@ -78,12 +84,30 @@ private Date lastPicTime; /** + * 上次加热时间 + */ + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** * 首次报警时间(连续3次手动确认则报警) */ @ApiModelProperty(value = "首次报警时间(连续3次手动确认则报警)") private Date firstWarnDatetime; /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + + /** *同步状态(成功 success | 失败 fail) */ @ApiModelProperty(value = "同步状态(成功 success | 失败 fail)") diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java index aa66656..60c7270 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java @@ -155,4 +155,11 @@ @ApiModelProperty(value = "摄像头") private String camera; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java index 891532b..9ddb017 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java @@ -1,12 +1,11 @@ package com.newfiber.termite.domain; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.newfiber.common.core.web.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; @@ -91,4 +90,11 @@ private Date uptime; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java index 3605283..b45a3af 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java @@ -1,5 +1,6 @@ package com.newfiber.termite.domain.dto; +import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; import java.util.Date; import lombok.Data; @@ -9,6 +10,32 @@ @ApiModelProperty(value = "设备编号", required = true) private String sn; + /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java index 0d887c1..1c8a2d3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 设备信息对象 ter_device_info @@ -38,4 +36,5 @@ private String warnFlag; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java index d13cd46..a224b2d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; +import java.util.Date; import lombok.Data; /** @@ -21,6 +22,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 白蚁识别结果开始日期 */ @ApiModelProperty(value = "白蚁识别结果开始日期(yyyy-MM-dd HH:mm:ss)") @@ -32,6 +39,26 @@ @ApiModelProperty(value = "白蚁识别结果结束日期(yyyy-MM-dd HH:mm:ss)") private String antEndDate; + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java index e9bf91f..381c1e8 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 白蚁防治数据对象 ter_device_monitoring_data_realtime @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,69 +47,10 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; - /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * 软件版本 - */ - @ApiModelProperty(value = "软件版本") - private String software; - - /** - * 硬件版本 - */ - @ApiModelProperty(value = "硬件版本") - private String hardware; - - /** - * 电压 - */ - @ApiModelProperty(value = "电压") - private String voltage; - - /** - * 温度 - */ - @ApiModelProperty(value = "温度") - private String temperature; - - /** - * - */ - @ApiModelProperty(value = "") - private String rssi; - - /** - * - */ - @ApiModelProperty(value = "") - private String ap; - - /** - * - */ - @ApiModelProperty(value = "") - private String camera; - + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java index 4c1839f..c1fb126 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 告警记录对象 ter_monitoring_warn_record @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,39 +47,16 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * - */ - @ApiModelProperty(value = "") - private String remark; - - /** * */ @ApiModelProperty(value = "") private String status; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java index 43bf747..b2ac56e 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java @@ -26,7 +26,7 @@ private Integer warnProjectCount; @ApiModelProperty(value = "告警设备总数") - private Integer warnDeviceCount; + private Long warnDeviceCount; private List projectStatisticDetailList; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java index 034ef2e..ffce1f9 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java @@ -2,7 +2,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.Date; -import lombok.AllArgsConstructor; import lombok.Data; /** @@ -36,8 +35,8 @@ private Integer deviceCount; @ApiModelProperty(value = "实时告警设备总数") - private Integer warnCountRealtime; + private Long warnCountRealtime; @ApiModelProperty(value = "历史告警设备总数") - private Integer warnCountHistory; + private Long warnCountHistory; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java index c2e75ee..b16357f 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java @@ -1,10 +1,9 @@ package com.newfiber.termite.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import java.util.List; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; import com.newfiber.termite.domain.DeviceInfo; -import com.newfiber.termite.domain.response.statistic.ProjectStatistic; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; +import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -34,6 +33,4 @@ DeviceInfo selectOneById(@Param("id") Long id); - List selectProjectSitesDetails(List projectCodes); - } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java index 07abda1..0e46e76 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java @@ -88,6 +88,7 @@ @Override public boolean update(TermiteDataUpRequest termiteDateUpRequest) { UpdateWrapper updateWrapper = new UpdateWrapper(). + set(StringUtils.isNotBlank(termiteDateUpRequest.getDeviceType()), "device_type", termiteDateUpRequest.getDeviceType()). set(StringUtils.isNotBlank(termiteDateUpRequest.getSoftware()), "software", termiteDateUpRequest.getSoftware()). set(StringUtils.isNotBlank(termiteDateUpRequest.getHardware()), "hardware", termiteDateUpRequest.getHardware()). set(StringUtils.isNotBlank(termiteDateUpRequest.getVoltage()), "voltage", termiteDateUpRequest.getVoltage()). @@ -102,6 +103,9 @@ set(StringUtils.isNotBlank(termiteDateUpRequest.getLteIccid()), "lte_iccid", termiteDateUpRequest.getLteIccid()). set(StringUtils.isNotBlank(termiteDateUpRequest.getLteCpos()), "lte_cpos", termiteDateUpRequest.getLteCpos()). set(null != termiteDateUpRequest.getLastPicTime(), "last_pic_time", termiteDateUpRequest.getLastPicTime()). + set(null != termiteDateUpRequest.getLastHeatTime(), "last_heat_time", termiteDateUpRequest.getLastHeatTime()). + set(null != termiteDateUpRequest.getLastMedicateTime(), "last_medicate_time", termiteDateUpRequest.getLastMedicateTime()). + set(StringUtils.isNotBlank(termiteDateUpRequest.getDruging()), "druging", termiteDateUpRequest.getDruging()). set("sync_state", EDeviceSyncState.success.getCode()). eq("sn", termiteDateUpRequest.getSn()); update(updateWrapper); diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java index 9aafdba..fa9c693 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java @@ -2,23 +2,34 @@ import com.newfiber.termite.domain.DeviceInfo; import com.newfiber.termite.domain.DeviceMonitoringData; +import com.newfiber.termite.domain.DeviceMonitoringDataRealtime; +import com.newfiber.termite.domain.MonitoringWarnRecord; import com.newfiber.termite.domain.ProjectInfo; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; +import com.newfiber.termite.domain.request.deviceMonitoringDataRealtime.DeviceMonitoringDataRealtimeQueryRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordQueryRequest; import com.newfiber.termite.domain.request.statistic.ProjectStatisticRequest; import com.newfiber.termite.domain.request.statistic.SiteWarnDailySeqStatisticRequest; import com.newfiber.termite.domain.request.statistic.SiteWarnTotalCountStatisticRequest; import com.newfiber.termite.domain.response.statistic.ProjectStatistic; +import com.newfiber.termite.domain.response.statistic.ProjectStatisticDetail; import com.newfiber.termite.domain.response.statistic.SiteDailyWarnCount; import com.newfiber.termite.domain.response.statistic.SiteTotalWarnCount; import com.newfiber.termite.enums.EExistsAnt; -import com.newfiber.termite.mapper.DeviceInfoMapper; -import com.newfiber.termite.mapper.ProjectInfoMapper; +import com.newfiber.termite.service.IDeviceInfoService; +import com.newfiber.termite.service.IDeviceMonitoringDataRealtimeService; import com.newfiber.termite.service.IDeviceMonitoringDataService; +import com.newfiber.termite.service.IMonitoringWarnRecordService; import com.newfiber.termite.service.IProjectInfoService; import com.newfiber.termite.service.IStatisticsService; - -import java.util.*; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.Optional; +import java.util.Set; +import java.util.TreeMap; import java.util.stream.Collectors; import javax.annotation.Resource; import org.springframework.stereotype.Service; @@ -35,13 +46,16 @@ private IDeviceMonitoringDataService deviceMonitoringDataService; @Resource - private IProjectInfoService projectInfoService; - + private IDeviceMonitoringDataRealtimeService deviceMonitoringDataRealtimeService; @Resource - private DeviceInfoMapper deviceInfoMapper; + private IProjectInfoService projectInfoService; + @Resource + private IDeviceInfoService deviceInfoService; + @Resource + private IMonitoringWarnRecordService monitoringWarnRecordService; @Override public Map> warnDailySeqStatistic(SiteWarnDailySeqStatisticRequest request) { @@ -114,26 +128,61 @@ @Override public ProjectStatistic projectWarnTotalCountStatistic(ProjectStatisticRequest request) { ProjectStatistic projectStatistic = new ProjectStatistic(); - Set list = projectInfoService.getUserProjectList(request.getUserId()); - //获取项目中的每个站点编号 - List projectCodes = list.stream().map(ProjectInfo::getProjectCode).collect(Collectors.toList()); - //查询站点的设备信息 - List deviceInfoList = deviceInfoMapper.selectProjectSitesDetails(projectCodes); - //获取站点中的所有sn - List deviceSns = deviceInfoList.stream().map(DeviceInfo::getSn).collect(Collectors.toList()); + List projectStatisticDetailList = new ArrayList<>(); + // 项目信息 + Set projectInfoSet = projectInfoService.getUserProjectList(request.getUserId()); + List projectCodeList = projectInfoSet.stream().map(ProjectInfo::getProjectCode).collect(Collectors.toList()); + // 设备信息 + DeviceInfoQueryRequest deviceInfoQueryRequest = new DeviceInfoQueryRequest(); + deviceInfoQueryRequest.setProjectCodeList(projectCodeList); + List deviceInfoList = deviceInfoService.selectList(deviceInfoQueryRequest); + // TODO 历史告警 MonitoringWarnRecordQueryRequest monitoringWarnRecordQueryRequest = new MonitoringWarnRecordQueryRequest(); + monitoringWarnRecordQueryRequest.setProjectCodeList(projectCodeList); + List monitoringWarnRecordList = monitoringWarnRecordService.selectList(monitoringWarnRecordQueryRequest); + // 实时监测数据 + DeviceMonitoringDataRealtimeQueryRequest deviceMonitoringDataRealtimeQueryRequest = new DeviceMonitoringDataRealtimeQueryRequest(); + deviceMonitoringDataRealtimeQueryRequest.setProjectCodeList(projectCodeList); + List deviceMonitoringDataRealtimeList = deviceMonitoringDataRealtimeService.selectList(deviceMonitoringDataRealtimeQueryRequest); + long warnDeviceCount = 0L; + int warnProjectCount = 0; + for(ProjectInfo projectInfo : projectInfoSet){ + List projectDeviceInfoList = deviceInfoList.stream().filter(t -> + t.getProjectCode().equals(projectInfo.getProjectCode())).collect(Collectors.toList()); + List projectMonitoringWarnRecordList = monitoringWarnRecordList.stream().filter(t -> + t.getProjectCode().equals(projectInfo.getProjectCode())).collect(Collectors.toList()); + List projectDeviceMonitoringDataRealtimeList = deviceMonitoringDataRealtimeList.stream().filter(t -> + t.getProjectCode().equals(projectInfo.getProjectCode())).collect(Collectors.toList()); + long warnCountRealtime = projectDeviceMonitoringDataRealtimeList.stream().filter(t -> t.getYesnoant().equals(EExistsAnt.True.getCode())).map(DeviceMonitoringDataRealtime::getSn).distinct().count(); + ProjectStatisticDetail projectStatisticDetail = new ProjectStatisticDetail(); + projectStatisticDetail.setProjectCode(projectInfo.getProjectCode()); + projectStatisticDetail.setProjectName(projectInfo.getProjectName()); + projectStatisticDetail.setDeviceCount(projectDeviceInfoList.size()); + projectStatisticDetail.setWarnCountRealtime(warnCountRealtime); + projectStatisticDetail.setWarnCountHistory(projectMonitoringWarnRecordList.stream().map(MonitoringWarnRecord::getSn).distinct().count()); + Optional firstWarnDatetimeDevice = projectDeviceInfoList.stream().max(Comparator.comparing(DeviceInfo::getFirstWarnDatetime)); + firstWarnDatetimeDevice.ifPresent(deviceInfo -> projectStatisticDetail.setFirstWarnDatetime(deviceInfo.getFirstWarnDatetime())); + + projectStatisticDetailList.add(projectStatisticDetail); + + if(warnCountRealtime > 0) warnProjectCount = warnProjectCount + 1; + warnDeviceCount = warnDeviceCount + warnCountRealtime; + } projectStatistic.setDeviceCount(deviceInfoList.size()); - projectStatistic.setProjectCount(list.size()); + projectStatistic.setProjectCount(projectInfoSet.size()); + projectStatistic.setWarnProjectCount(warnProjectCount); + projectStatistic.setWarnDeviceCount(warnDeviceCount); + projectStatistic.setProjectStatisticDetailList(projectStatisticDetailList); return projectStatistic; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java index d3ec829..2e5ca2a 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java @@ -200,7 +200,7 @@ img = img.pressText("时间:" + DateUtil.format(existedDeviceMonitoringData.getUptime(), "yyyy-MM-dd HH:mm"), Color.WHITE, font, 0, 1100, 1f); url = CosUtil.putFile(ImgUtil.toStream(img.getImg(), FileUtil.extName(image.getName())), FileUploadUtils.extractFilename(image)); }else{ - url = CosUtil.putFile(image); + url = existedDeviceMonitoringData.getRtpitcu(); } return url; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceInfoMapper.xml b/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceInfoMapper.xml index 4c7a89b..2d6f8f3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceInfoMapper.xml +++ b/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceInfoMapper.xml @@ -10,6 +10,7 @@ + @@ -17,7 +18,10 @@ + + + @@ -36,6 +40,7 @@ , t.category , t.project_code , t.sn + , t.device_type , t.location_type , t.location , t.initialpictu @@ -43,7 +48,10 @@ , t.lonandlat , t.del_flag , t.last_pic_time + , t.last_heat_time + , t.last_medicate_time , t.first_warn_datetime + , t.druging , t.software , t.hardware , t.voltage @@ -69,6 +77,13 @@ and t.first_warn_datetime is not null + + + and tpi.project_code in + + #{projectCode} + + @@ -94,21 +109,4 @@ - - - - diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java index ed10442..81d30f0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceInfo.java @@ -42,6 +42,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 位置类型(内圈 inner | 外圈 outer) */ @ApiModelProperty(value = "位置类型(内圈 inner | 外圈 outer)") @@ -78,12 +84,30 @@ private Date lastPicTime; /** + * 上次加热时间 + */ + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** * 首次报警时间(连续3次手动确认则报警) */ @ApiModelProperty(value = "首次报警时间(连续3次手动确认则报警)") private Date firstWarnDatetime; /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + + /** *同步状态(成功 success | 失败 fail) */ @ApiModelProperty(value = "同步状态(成功 success | 失败 fail)") diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java index aa66656..60c7270 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/DeviceMonitoringDataRealtime.java @@ -155,4 +155,11 @@ @ApiModelProperty(value = "摄像头") private String camera; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java index 891532b..9ddb017 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/MonitoringWarnRecord.java @@ -1,12 +1,11 @@ package com.newfiber.termite.domain; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import com.newfiber.common.core.web.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import com.fasterxml.jackson.annotation.JsonFormat; import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; @@ -91,4 +90,11 @@ private Date uptime; + /** + * 项目编号 + */ + @TableField(exist = false) + @ApiModelProperty(value = "项目编号") + private String projectCode; + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java index 3605283..b45a3af 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/TermiteDataUpRequest.java @@ -1,5 +1,6 @@ package com.newfiber.termite.domain.dto; +import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; import java.util.Date; import lombok.Data; @@ -9,6 +10,32 @@ @ApiModelProperty(value = "设备编号", required = true) private String sn; + /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java index 0d887c1..1c8a2d3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 设备信息对象 ter_device_info @@ -38,4 +36,5 @@ private String warnFlag; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java index d13cd46..a224b2d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceInfo/DeviceInfoStateSyncRequest.java @@ -2,6 +2,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; +import java.util.Date; import lombok.Data; /** @@ -21,6 +22,12 @@ private String sn; /** + * 设备类型(4G/WiFi) + */ + @ApiModelProperty(value = "设备类型(4G/WiFi)") + private String deviceType; + + /** * 白蚁识别结果开始日期 */ @ApiModelProperty(value = "白蚁识别结果开始日期(yyyy-MM-dd HH:mm:ss)") @@ -32,6 +39,26 @@ @ApiModelProperty(value = "白蚁识别结果结束日期(yyyy-MM-dd HH:mm:ss)") private String antEndDate; + /** + * 上次加热时间 + */ + @JsonProperty("last_heat_time") + @ApiModelProperty(value = "上次加热时间") + private Date lastHeatTime; + + /** + * 上次投药时间 + */ + @JsonProperty("last_medicate_time") + @ApiModelProperty(value = "上次投药时间") + private Date lastMedicateTime; + + /** + * 是否投过药(1是 | 2 否) + */ + @ApiModelProperty(value = "是否投过药(1是 | 2 否)") + private String druging; + @ApiModelProperty(value = "软件版本") private String software; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java index e9bf91f..381c1e8 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/deviceMonitoringDataRealtime/DeviceMonitoringDataRealtimeQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 白蚁防治数据对象 ter_device_monitoring_data_realtime @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,69 +47,10 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; - /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * 软件版本 - */ - @ApiModelProperty(value = "软件版本") - private String software; - - /** - * 硬件版本 - */ - @ApiModelProperty(value = "硬件版本") - private String hardware; - - /** - * 电压 - */ - @ApiModelProperty(value = "电压") - private String voltage; - - /** - * 温度 - */ - @ApiModelProperty(value = "温度") - private String temperature; - - /** - * - */ - @ApiModelProperty(value = "") - private String rssi; - - /** - * - */ - @ApiModelProperty(value = "") - private String ap; - - /** - * - */ - @ApiModelProperty(value = "") - private String camera; - + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java index 4c1839f..c1fb126 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/request/monitoringWarnRecord/MonitoringWarnRecordQueryRequest.java @@ -2,11 +2,9 @@ import com.newfiber.common.core.web.request.BaseQueryRequest; import io.swagger.annotations.ApiModelProperty; +import java.util.List; import lombok.Data; -import com.fasterxml.jackson.annotation.JsonFormat; import lombok.EqualsAndHashCode; -import java.util.Date; -import com.fasterxml.jackson.annotation.JsonFormat; /** * 告警记录对象 ter_monitoring_warn_record @@ -37,18 +35,6 @@ private String yesnoant; /** - * 目前照片 - */ - @ApiModelProperty(value = "目前照片") - private String rtpitcu; - - /** - * 识别后照片 - */ - @ApiModelProperty(value = "识别后照片") - private String idenpitcu; - - /** * 确认是否属实 */ @ApiModelProperty(value = "确认是否属实") @@ -61,39 +47,16 @@ private String druing; /** - * 投药时间 - */ - @ApiModelProperty(value = "投药时间") - private Date druingDatetime; - - /** * 是否加热(1是 | 2否) */ @ApiModelProperty(value = "是否加热(1是 | 2否)") private String heating; /** - * 加热时间 - */ - @ApiModelProperty(value = "加热时间") - private Date heatingDatetime; - - /** - * 上传时间 - */ - @ApiModelProperty(value = "上传时间") - private Date uptime; - - /** - * - */ - @ApiModelProperty(value = "") - private String remark; - - /** * */ @ApiModelProperty(value = "") private String status; + private List projectCodeList; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java index 43bf747..b2ac56e 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatistic.java @@ -26,7 +26,7 @@ private Integer warnProjectCount; @ApiModelProperty(value = "告警设备总数") - private Integer warnDeviceCount; + private Long warnDeviceCount; private List projectStatisticDetailList; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java index 034ef2e..ffce1f9 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/statistic/ProjectStatisticDetail.java @@ -2,7 +2,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.Date; -import lombok.AllArgsConstructor; import lombok.Data; /** @@ -36,8 +35,8 @@ private Integer deviceCount; @ApiModelProperty(value = "实时告警设备总数") - private Integer warnCountRealtime; + private Long warnCountRealtime; @ApiModelProperty(value = "历史告警设备总数") - private Integer warnCountHistory; + private Long warnCountHistory; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java index c2e75ee..b16357f 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/DeviceInfoMapper.java @@ -1,10 +1,9 @@ package com.newfiber.termite.mapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import java.util.List; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; import com.newfiber.termite.domain.DeviceInfo; -import com.newfiber.termite.domain.response.statistic.ProjectStatistic; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; +import java.util.List; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -34,6 +33,4 @@ DeviceInfo selectOneById(@Param("id") Long id); - List selectProjectSitesDetails(List projectCodes); - } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java index 07abda1..0e46e76 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/DeviceInfoServiceImpl.java @@ -88,6 +88,7 @@ @Override public boolean update(TermiteDataUpRequest termiteDateUpRequest) { UpdateWrapper updateWrapper = new UpdateWrapper(). + set(StringUtils.isNotBlank(termiteDateUpRequest.getDeviceType()), "device_type", termiteDateUpRequest.getDeviceType()). set(StringUtils.isNotBlank(termiteDateUpRequest.getSoftware()), "software", termiteDateUpRequest.getSoftware()). set(StringUtils.isNotBlank(termiteDateUpRequest.getHardware()), "hardware", termiteDateUpRequest.getHardware()). set(StringUtils.isNotBlank(termiteDateUpRequest.getVoltage()), "voltage", termiteDateUpRequest.getVoltage()). @@ -102,6 +103,9 @@ set(StringUtils.isNotBlank(termiteDateUpRequest.getLteIccid()), "lte_iccid", termiteDateUpRequest.getLteIccid()). set(StringUtils.isNotBlank(termiteDateUpRequest.getLteCpos()), "lte_cpos", termiteDateUpRequest.getLteCpos()). set(null != termiteDateUpRequest.getLastPicTime(), "last_pic_time", termiteDateUpRequest.getLastPicTime()). + set(null != termiteDateUpRequest.getLastHeatTime(), "last_heat_time", termiteDateUpRequest.getLastHeatTime()). + set(null != termiteDateUpRequest.getLastMedicateTime(), "last_medicate_time", termiteDateUpRequest.getLastMedicateTime()). + set(StringUtils.isNotBlank(termiteDateUpRequest.getDruging()), "druging", termiteDateUpRequest.getDruging()). set("sync_state", EDeviceSyncState.success.getCode()). eq("sn", termiteDateUpRequest.getSn()); update(updateWrapper); diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java index 9aafdba..fa9c693 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/StatisticsServiceImpl.java @@ -2,23 +2,34 @@ import com.newfiber.termite.domain.DeviceInfo; import com.newfiber.termite.domain.DeviceMonitoringData; +import com.newfiber.termite.domain.DeviceMonitoringDataRealtime; +import com.newfiber.termite.domain.MonitoringWarnRecord; import com.newfiber.termite.domain.ProjectInfo; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; +import com.newfiber.termite.domain.request.deviceMonitoringDataRealtime.DeviceMonitoringDataRealtimeQueryRequest; import com.newfiber.termite.domain.request.monitoringWarnRecord.MonitoringWarnRecordQueryRequest; import com.newfiber.termite.domain.request.statistic.ProjectStatisticRequest; import com.newfiber.termite.domain.request.statistic.SiteWarnDailySeqStatisticRequest; import com.newfiber.termite.domain.request.statistic.SiteWarnTotalCountStatisticRequest; import com.newfiber.termite.domain.response.statistic.ProjectStatistic; +import com.newfiber.termite.domain.response.statistic.ProjectStatisticDetail; import com.newfiber.termite.domain.response.statistic.SiteDailyWarnCount; import com.newfiber.termite.domain.response.statistic.SiteTotalWarnCount; import com.newfiber.termite.enums.EExistsAnt; -import com.newfiber.termite.mapper.DeviceInfoMapper; -import com.newfiber.termite.mapper.ProjectInfoMapper; +import com.newfiber.termite.service.IDeviceInfoService; +import com.newfiber.termite.service.IDeviceMonitoringDataRealtimeService; import com.newfiber.termite.service.IDeviceMonitoringDataService; +import com.newfiber.termite.service.IMonitoringWarnRecordService; import com.newfiber.termite.service.IProjectInfoService; import com.newfiber.termite.service.IStatisticsService; - -import java.util.*; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Map; import java.util.Map.Entry; +import java.util.Optional; +import java.util.Set; +import java.util.TreeMap; import java.util.stream.Collectors; import javax.annotation.Resource; import org.springframework.stereotype.Service; @@ -35,13 +46,16 @@ private IDeviceMonitoringDataService deviceMonitoringDataService; @Resource - private IProjectInfoService projectInfoService; - + private IDeviceMonitoringDataRealtimeService deviceMonitoringDataRealtimeService; @Resource - private DeviceInfoMapper deviceInfoMapper; + private IProjectInfoService projectInfoService; + @Resource + private IDeviceInfoService deviceInfoService; + @Resource + private IMonitoringWarnRecordService monitoringWarnRecordService; @Override public Map> warnDailySeqStatistic(SiteWarnDailySeqStatisticRequest request) { @@ -114,26 +128,61 @@ @Override public ProjectStatistic projectWarnTotalCountStatistic(ProjectStatisticRequest request) { ProjectStatistic projectStatistic = new ProjectStatistic(); - Set list = projectInfoService.getUserProjectList(request.getUserId()); - //获取项目中的每个站点编号 - List projectCodes = list.stream().map(ProjectInfo::getProjectCode).collect(Collectors.toList()); - //查询站点的设备信息 - List deviceInfoList = deviceInfoMapper.selectProjectSitesDetails(projectCodes); - //获取站点中的所有sn - List deviceSns = deviceInfoList.stream().map(DeviceInfo::getSn).collect(Collectors.toList()); + List projectStatisticDetailList = new ArrayList<>(); + // 项目信息 + Set projectInfoSet = projectInfoService.getUserProjectList(request.getUserId()); + List projectCodeList = projectInfoSet.stream().map(ProjectInfo::getProjectCode).collect(Collectors.toList()); + // 设备信息 + DeviceInfoQueryRequest deviceInfoQueryRequest = new DeviceInfoQueryRequest(); + deviceInfoQueryRequest.setProjectCodeList(projectCodeList); + List deviceInfoList = deviceInfoService.selectList(deviceInfoQueryRequest); + // TODO 历史告警 MonitoringWarnRecordQueryRequest monitoringWarnRecordQueryRequest = new MonitoringWarnRecordQueryRequest(); + monitoringWarnRecordQueryRequest.setProjectCodeList(projectCodeList); + List monitoringWarnRecordList = monitoringWarnRecordService.selectList(monitoringWarnRecordQueryRequest); + // 实时监测数据 + DeviceMonitoringDataRealtimeQueryRequest deviceMonitoringDataRealtimeQueryRequest = new DeviceMonitoringDataRealtimeQueryRequest(); + deviceMonitoringDataRealtimeQueryRequest.setProjectCodeList(projectCodeList); + List deviceMonitoringDataRealtimeList = deviceMonitoringDataRealtimeService.selectList(deviceMonitoringDataRealtimeQueryRequest); + long warnDeviceCount = 0L; + int warnProjectCount = 0; + for(ProjectInfo projectInfo : projectInfoSet){ + List projectDeviceInfoList = deviceInfoList.stream().filter(t -> + t.getProjectCode().equals(projectInfo.getProjectCode())).collect(Collectors.toList()); + List projectMonitoringWarnRecordList = monitoringWarnRecordList.stream().filter(t -> + t.getProjectCode().equals(projectInfo.getProjectCode())).collect(Collectors.toList()); + List projectDeviceMonitoringDataRealtimeList = deviceMonitoringDataRealtimeList.stream().filter(t -> + t.getProjectCode().equals(projectInfo.getProjectCode())).collect(Collectors.toList()); + long warnCountRealtime = projectDeviceMonitoringDataRealtimeList.stream().filter(t -> t.getYesnoant().equals(EExistsAnt.True.getCode())).map(DeviceMonitoringDataRealtime::getSn).distinct().count(); + ProjectStatisticDetail projectStatisticDetail = new ProjectStatisticDetail(); + projectStatisticDetail.setProjectCode(projectInfo.getProjectCode()); + projectStatisticDetail.setProjectName(projectInfo.getProjectName()); + projectStatisticDetail.setDeviceCount(projectDeviceInfoList.size()); + projectStatisticDetail.setWarnCountRealtime(warnCountRealtime); + projectStatisticDetail.setWarnCountHistory(projectMonitoringWarnRecordList.stream().map(MonitoringWarnRecord::getSn).distinct().count()); + Optional firstWarnDatetimeDevice = projectDeviceInfoList.stream().max(Comparator.comparing(DeviceInfo::getFirstWarnDatetime)); + firstWarnDatetimeDevice.ifPresent(deviceInfo -> projectStatisticDetail.setFirstWarnDatetime(deviceInfo.getFirstWarnDatetime())); + + projectStatisticDetailList.add(projectStatisticDetail); + + if(warnCountRealtime > 0) warnProjectCount = warnProjectCount + 1; + warnDeviceCount = warnDeviceCount + warnCountRealtime; + } projectStatistic.setDeviceCount(deviceInfoList.size()); - projectStatistic.setProjectCount(list.size()); + projectStatistic.setProjectCount(projectInfoSet.size()); + projectStatistic.setWarnProjectCount(warnProjectCount); + projectStatistic.setWarnDeviceCount(warnDeviceCount); + projectStatistic.setProjectStatisticDetailList(projectStatisticDetailList); return projectStatistic; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java index d3ec829..2e5ca2a 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/impl/TermiteServiceImpl.java @@ -200,7 +200,7 @@ img = img.pressText("时间:" + DateUtil.format(existedDeviceMonitoringData.getUptime(), "yyyy-MM-dd HH:mm"), Color.WHITE, font, 0, 1100, 1f); url = CosUtil.putFile(ImgUtil.toStream(img.getImg(), FileUtil.extName(image.getName())), FileUploadUtils.extractFilename(image)); }else{ - url = CosUtil.putFile(image); + url = existedDeviceMonitoringData.getRtpitcu(); } return url; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceInfoMapper.xml b/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceInfoMapper.xml index 4c7a89b..2d6f8f3 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceInfoMapper.xml +++ b/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceInfoMapper.xml @@ -10,6 +10,7 @@ + @@ -17,7 +18,10 @@ + + + @@ -36,6 +40,7 @@ , t.category , t.project_code , t.sn + , t.device_type , t.location_type , t.location , t.initialpictu @@ -43,7 +48,10 @@ , t.lonandlat , t.del_flag , t.last_pic_time + , t.last_heat_time + , t.last_medicate_time , t.first_warn_datetime + , t.druging , t.software , t.hardware , t.voltage @@ -69,6 +77,13 @@ and t.first_warn_datetime is not null + + + and tpi.project_code in + + #{projectCode} + + @@ -94,21 +109,4 @@ - - - - diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceMonitoringDataRealtimeMapper.xml b/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceMonitoringDataRealtimeMapper.xml index 33fa449..2466b8c 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceMonitoringDataRealtimeMapper.xml +++ b/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceMonitoringDataRealtimeMapper.xml @@ -18,6 +18,7 @@ + @@ -34,6 +35,7 @@ , t.heating , t.heating_datetime , t.uptime + , tpi.project_code @@ -46,10 +48,18 @@ and t.yesnoant = #{request.yesnoant} + + + and tpi.project_code in + + #{projectCode} + + - + left join ter_device_info di on t.sn = di.sn + left join ter_project_info tpi on di.project_code = tpi.project_code - - - - diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceMonitoringDataRealtimeMapper.xml b/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceMonitoringDataRealtimeMapper.xml index 33fa449..2466b8c 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceMonitoringDataRealtimeMapper.xml +++ b/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/DeviceMonitoringDataRealtimeMapper.xml @@ -18,6 +18,7 @@ + @@ -34,6 +35,7 @@ , t.heating , t.heating_datetime , t.uptime + , tpi.project_code @@ -46,10 +48,18 @@ and t.yesnoant = #{request.yesnoant} + + + and tpi.project_code in + + #{projectCode} + + - + left join ter_device_info di on t.sn = di.sn + left join ter_project_info tpi on di.project_code = tpi.project_code