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 82e691b..fad0465 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 @@ -126,6 +126,12 @@ @ApiModelProperty(value = "服务商") private String lteCpos; + /** + * + */ + @ApiModelProperty(value = "4G信号质量") + private String lteCsq; + @ApiModelProperty(value = "防治图片最后上传同步时间") private Date lastSyncTime; 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 82e691b..fad0465 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 @@ -126,6 +126,12 @@ @ApiModelProperty(value = "服务商") private String lteCpos; + /** + * + */ + @ApiModelProperty(value = "4G信号质量") + private String lteCsq; + @ApiModelProperty(value = "防治图片最后上传同步时间") private Date lastSyncTime; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/TermiteInfoResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/TermiteInfoResponse.java index a6befa8..e58e27d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/TermiteInfoResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/TermiteInfoResponse.java @@ -81,4 +81,10 @@ @ApiModelProperty(value = "默认enable 加热-enable | 不加热-disabled") private String autoHeat; + /** + * 是否连拍 + */ + @ApiModelProperty(value = "是否连拍(true | false)") + private String continueCaptureFlag; + } \ No newline at end of file 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 82e691b..fad0465 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 @@ -126,6 +126,12 @@ @ApiModelProperty(value = "服务商") private String lteCpos; + /** + * + */ + @ApiModelProperty(value = "4G信号质量") + private String lteCsq; + @ApiModelProperty(value = "防治图片最后上传同步时间") private Date lastSyncTime; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/TermiteInfoResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/TermiteInfoResponse.java index a6befa8..e58e27d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/TermiteInfoResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/TermiteInfoResponse.java @@ -81,4 +81,10 @@ @ApiModelProperty(value = "默认enable 加热-enable | 不加热-disabled") private String autoHeat; + /** + * 是否连拍 + */ + @ApiModelProperty(value = "是否连拍(true | false)") + private String continueCaptureFlag; + } \ No newline at end of file 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 19b7dc9..e120aad 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 @@ -20,7 +20,11 @@ import com.newfiber.common.core.web.service.BaseServiceImpl; import com.newfiber.common.security.utils.ConfigUtils; import com.newfiber.termite.config.JingchuResourceConfig; -import com.newfiber.termite.domain.*; +import com.newfiber.termite.domain.DeviceInfo; +import com.newfiber.termite.domain.DeviceMonitoringData; +import com.newfiber.termite.domain.DeviceMonitoringDataRealtime; +import com.newfiber.termite.domain.OneByOneNow; +import com.newfiber.termite.domain.Termite; import com.newfiber.termite.domain.dto.PhotoIdentifyDto; import com.newfiber.termite.domain.dto.SnAlarmStatisticDto; import com.newfiber.termite.domain.dto.TermiteDataUpRequest; @@ -40,7 +44,12 @@ import com.newfiber.termite.domain.response.DataUpResponse; import com.newfiber.termite.domain.response.DeviceInfoStateSyncResponse; import com.newfiber.termite.domain.response.TermiteInfoResponse; -import com.newfiber.termite.enums.*; +import com.newfiber.termite.enums.EDeviceSyncState; +import com.newfiber.termite.enums.EDrugFlag; +import com.newfiber.termite.enums.EExecuteStatus; +import com.newfiber.termite.enums.EExistsAnt; +import com.newfiber.termite.enums.EHeatingFlag; +import com.newfiber.termite.enums.EIdentColle; import com.newfiber.termite.mapper.TermiteMapper; import com.newfiber.termite.service.IDeviceMonitoringSyncRecordService; import com.newfiber.termite.service.IMonitoringWarnRecordService; @@ -207,11 +216,19 @@ // 添加告警记录 monitoringWarnRecordService.insert(deviceMonitoringDataRealtime, existedDeviceMonitoringData); - - if(null == deviceInfo.getFirstWarnDatetime()){ - deviceInfo.setFirstWarnDatetime(existedDeviceMonitoringData.getUptime()); - deviceInfoService.updateById(deviceInfo); - } +// +// if(null == deviceInfo.getFirstWarnDatetime()){ +// DeviceMonitoringDataQueryRequest deviceMonitoringDataQueryRequest = new DeviceMonitoringDataQueryRequest(); +// deviceMonitoringDataQueryRequest.setSn(deviceInfo.getSn()); +// deviceMonitoringDataQueryRequest.setYesnoant(EExistsAnt.True.getCode()); +// deviceMonitoringDataQueryRequest.setOrderBy("date asc"); +// List deviceMonitoringDataList = deviceMonitoringDataService.selectList(deviceMonitoringDataQueryRequest); +// if(deviceMonitoringDataList.size() >= 3){ +// deviceInfo.setFirstWarnDatetime(existedDeviceMonitoringData.getUptime()); +// deviceInfoService.updateById(deviceInfo); +// } +// +// } } @@ -271,7 +288,7 @@ header("Authorization", jingchuResourceConfig.getToken()).execute(); jingchuUploadRecordService.insert(jingchuProjectConfig.getProjectCode(), jingchuDeviceConfig.getSn(), jingchuDeviceConfig.getOrder(), JSONObject.toJSONString(jingChuUpload), httpResponse.body()); -// log.info("同步荆楚监测数据.请求:{},响应:{}", JSONObject.toJSONString(jingChuUpload), httpResponse.body()); + log.info("同步荆楚监测数据.请求:{},响应:{}", JSONObject.toJSONString(jingChuUpload), httpResponse.body()); } } @@ -394,7 +411,7 @@ deviceMonitoringDataQueryRequest.setOrderBy("date asc"); List deviceMonitoringDataList = deviceMonitoringDataService.selectList(deviceMonitoringDataQueryRequest); if(deviceMonitoringDataList.size() >= 3){ - deviceInfo.setFirstWarnDatetime(DateUtil.parse(deviceMonitoringDataList.get(0).getDate())); + deviceInfo.setFirstWarnDatetime(DateUtil.parse(deviceMonitoringData.getDate())); deviceInfoService.updateById(deviceInfo); // 确认告警后,后续每次数据都传给荆楚 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 82e691b..fad0465 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 @@ -126,6 +126,12 @@ @ApiModelProperty(value = "服务商") private String lteCpos; + /** + * + */ + @ApiModelProperty(value = "4G信号质量") + private String lteCsq; + @ApiModelProperty(value = "防治图片最后上传同步时间") private Date lastSyncTime; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/TermiteInfoResponse.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/TermiteInfoResponse.java index a6befa8..e58e27d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/TermiteInfoResponse.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/response/TermiteInfoResponse.java @@ -81,4 +81,10 @@ @ApiModelProperty(value = "默认enable 加热-enable | 不加热-disabled") private String autoHeat; + /** + * 是否连拍 + */ + @ApiModelProperty(value = "是否连拍(true | false)") + private String continueCaptureFlag; + } \ No newline at end of file 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 19b7dc9..e120aad 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 @@ -20,7 +20,11 @@ import com.newfiber.common.core.web.service.BaseServiceImpl; import com.newfiber.common.security.utils.ConfigUtils; import com.newfiber.termite.config.JingchuResourceConfig; -import com.newfiber.termite.domain.*; +import com.newfiber.termite.domain.DeviceInfo; +import com.newfiber.termite.domain.DeviceMonitoringData; +import com.newfiber.termite.domain.DeviceMonitoringDataRealtime; +import com.newfiber.termite.domain.OneByOneNow; +import com.newfiber.termite.domain.Termite; import com.newfiber.termite.domain.dto.PhotoIdentifyDto; import com.newfiber.termite.domain.dto.SnAlarmStatisticDto; import com.newfiber.termite.domain.dto.TermiteDataUpRequest; @@ -40,7 +44,12 @@ import com.newfiber.termite.domain.response.DataUpResponse; import com.newfiber.termite.domain.response.DeviceInfoStateSyncResponse; import com.newfiber.termite.domain.response.TermiteInfoResponse; -import com.newfiber.termite.enums.*; +import com.newfiber.termite.enums.EDeviceSyncState; +import com.newfiber.termite.enums.EDrugFlag; +import com.newfiber.termite.enums.EExecuteStatus; +import com.newfiber.termite.enums.EExistsAnt; +import com.newfiber.termite.enums.EHeatingFlag; +import com.newfiber.termite.enums.EIdentColle; import com.newfiber.termite.mapper.TermiteMapper; import com.newfiber.termite.service.IDeviceMonitoringSyncRecordService; import com.newfiber.termite.service.IMonitoringWarnRecordService; @@ -207,11 +216,19 @@ // 添加告警记录 monitoringWarnRecordService.insert(deviceMonitoringDataRealtime, existedDeviceMonitoringData); - - if(null == deviceInfo.getFirstWarnDatetime()){ - deviceInfo.setFirstWarnDatetime(existedDeviceMonitoringData.getUptime()); - deviceInfoService.updateById(deviceInfo); - } +// +// if(null == deviceInfo.getFirstWarnDatetime()){ +// DeviceMonitoringDataQueryRequest deviceMonitoringDataQueryRequest = new DeviceMonitoringDataQueryRequest(); +// deviceMonitoringDataQueryRequest.setSn(deviceInfo.getSn()); +// deviceMonitoringDataQueryRequest.setYesnoant(EExistsAnt.True.getCode()); +// deviceMonitoringDataQueryRequest.setOrderBy("date asc"); +// List deviceMonitoringDataList = deviceMonitoringDataService.selectList(deviceMonitoringDataQueryRequest); +// if(deviceMonitoringDataList.size() >= 3){ +// deviceInfo.setFirstWarnDatetime(existedDeviceMonitoringData.getUptime()); +// deviceInfoService.updateById(deviceInfo); +// } +// +// } } @@ -271,7 +288,7 @@ header("Authorization", jingchuResourceConfig.getToken()).execute(); jingchuUploadRecordService.insert(jingchuProjectConfig.getProjectCode(), jingchuDeviceConfig.getSn(), jingchuDeviceConfig.getOrder(), JSONObject.toJSONString(jingChuUpload), httpResponse.body()); -// log.info("同步荆楚监测数据.请求:{},响应:{}", JSONObject.toJSONString(jingChuUpload), httpResponse.body()); + log.info("同步荆楚监测数据.请求:{},响应:{}", JSONObject.toJSONString(jingChuUpload), httpResponse.body()); } } @@ -394,7 +411,7 @@ deviceMonitoringDataQueryRequest.setOrderBy("date asc"); List deviceMonitoringDataList = deviceMonitoringDataService.selectList(deviceMonitoringDataQueryRequest); if(deviceMonitoringDataList.size() >= 3){ - deviceInfo.setFirstWarnDatetime(DateUtil.parse(deviceMonitoringDataList.get(0).getDate())); + deviceInfo.setFirstWarnDatetime(DateUtil.parse(deviceMonitoringData.getDate())); deviceInfoService.updateById(deviceInfo); // 确认告警后,后续每次数据都传给荆楚 diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/TermiteMapper.xml b/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/TermiteMapper.xml index 754f4f4..b4c681a 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/TermiteMapper.xml +++ b/newfiber-termites/newfiber-termites-dataup/src/main/resources/mapper/termite/TermiteMapper.xml @@ -24,6 +24,7 @@ tb.uptime, ta.status, case when TIMESTAMPDIFF(minute, uptime, now()) > 1440 then 0 else 1 end as onlineStatus, + case when tb.continue_capture_count > 0 then 'true' else 'false' end as continueCaptureFlag, ta.project_code as projectCode, th.project_name as projectName, ta.first_warn_datetime as firstWarnDatetime,