diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java index aabe201..fb04bd0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java @@ -2,10 +2,8 @@ import lombok.Data; -import java.util.List; - @Data public class SnAlarmStatisticDto { private String name; - private Integer value; + private Number value; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java index aabe201..fb04bd0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java @@ -2,10 +2,8 @@ import lombok.Data; -import java.util.List; - @Data public class SnAlarmStatisticDto { private String name; - private Integer value; + private Number value; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java index 642dad5..b0a20a5 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java @@ -21,22 +21,24 @@ private int electricity; /** - *设备编码 + *设备编码(RTU编号) */ private String mnNo; /** * 观测时间2 + * DateUtil.formatDateTime(new Date()) */ private String obDate; /** * 观测时间 + * DateUtil.format(new Date(), "yyMMddHHmm") */ private String obTime; /** - * 白蚁设备安装的点位顺序 + * 白蚁设备安装的点位顺序(自定义6位数) */ private String order; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java index aabe201..fb04bd0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java @@ -2,10 +2,8 @@ import lombok.Data; -import java.util.List; - @Data public class SnAlarmStatisticDto { private String name; - private Integer value; + private Number value; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java index 642dad5..b0a20a5 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java @@ -21,22 +21,24 @@ private int electricity; /** - *设备编码 + *设备编码(RTU编号) */ private String mnNo; /** * 观测时间2 + * DateUtil.formatDateTime(new Date()) */ private String obDate; /** * 观测时间 + * DateUtil.format(new Date(), "yyMMddHHmm") */ private String obTime; /** - * 白蚁设备安装的点位顺序 + * 白蚁设备安装的点位顺序(自定义6位数) */ private String order; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java index 92790c2..214e68d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java @@ -5,14 +5,16 @@ import com.newfiber.termite.domain.dto.AlarmDataDto; import com.newfiber.termite.domain.dto.DeviceInfoDto; import com.newfiber.termite.domain.dto.UnitInfoDto; -import com.newfiber.termite.domain.request.*; +import com.newfiber.termite.domain.request.DeviceInfoUpdateRequest; +import com.newfiber.termite.domain.request.TermiteHistoryQueryRequest; +import com.newfiber.termite.domain.request.TermiteInfoQueryRequest; +import com.newfiber.termite.domain.request.TermiteInfoSaveRequest; +import com.newfiber.termite.domain.request.TermiteInfoUpdateyRequest; import com.newfiber.termite.domain.response.DataUpResponse; import com.newfiber.termite.domain.response.TermiteInfoResponse; -import lombok.Data; -import org.apache.ibatis.annotations.Param; - import java.util.Date; import java.util.List; +import org.apache.ibatis.annotations.Param; public interface TermiteMapper extends BaseMapper { @@ -54,5 +56,6 @@ @Deprecated void updateDeviceLastUpTime(@Param("sn")String sn ,@Param("lastDate") String lastDate); + @Deprecated List queryDeviceData(@Param("projectCode")String projectCode); } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java index aabe201..fb04bd0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java @@ -2,10 +2,8 @@ import lombok.Data; -import java.util.List; - @Data public class SnAlarmStatisticDto { private String name; - private Integer value; + private Number value; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java index 642dad5..b0a20a5 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java @@ -21,22 +21,24 @@ private int electricity; /** - *设备编码 + *设备编码(RTU编号) */ private String mnNo; /** * 观测时间2 + * DateUtil.formatDateTime(new Date()) */ private String obDate; /** * 观测时间 + * DateUtil.format(new Date(), "yyMMddHHmm") */ private String obTime; /** - * 白蚁设备安装的点位顺序 + * 白蚁设备安装的点位顺序(自定义6位数) */ private String order; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java index 92790c2..214e68d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java @@ -5,14 +5,16 @@ import com.newfiber.termite.domain.dto.AlarmDataDto; import com.newfiber.termite.domain.dto.DeviceInfoDto; import com.newfiber.termite.domain.dto.UnitInfoDto; -import com.newfiber.termite.domain.request.*; +import com.newfiber.termite.domain.request.DeviceInfoUpdateRequest; +import com.newfiber.termite.domain.request.TermiteHistoryQueryRequest; +import com.newfiber.termite.domain.request.TermiteInfoQueryRequest; +import com.newfiber.termite.domain.request.TermiteInfoSaveRequest; +import com.newfiber.termite.domain.request.TermiteInfoUpdateyRequest; import com.newfiber.termite.domain.response.DataUpResponse; import com.newfiber.termite.domain.response.TermiteInfoResponse; -import lombok.Data; -import org.apache.ibatis.annotations.Param; - import java.util.Date; import java.util.List; +import org.apache.ibatis.annotations.Param; public interface TermiteMapper extends BaseMapper { @@ -54,5 +56,6 @@ @Deprecated void updateDeviceLastUpTime(@Param("sn")String sn ,@Param("lastDate") String lastDate); + @Deprecated List queryDeviceData(@Param("projectCode")String projectCode); } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java index 23e3f5c..9978857 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java @@ -1,13 +1,13 @@ package com.newfiber.termite.service; +import com.newfiber.termite.domain.DeviceInfo; import com.newfiber.termite.domain.dto.TermiteDataUpRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoSaveRequest; import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoStateSyncRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoUpdateRequest; import com.newfiber.termite.enums.EDeviceSyncState; import java.util.List; -import com.newfiber.termite.domain.DeviceInfo; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoSaveRequest; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoUpdateRequest; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; /** * 设备信息Service接口 @@ -88,4 +88,12 @@ */ List selectList(DeviceInfoQueryRequest request); + /** + * 列表查询设备信息 + * + * @param request 列表参数 + * @return 设备信息集合 + */ + List selectList(String projectCode); + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java index aabe201..fb04bd0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java @@ -2,10 +2,8 @@ import lombok.Data; -import java.util.List; - @Data public class SnAlarmStatisticDto { private String name; - private Integer value; + private Number value; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java index 642dad5..b0a20a5 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java @@ -21,22 +21,24 @@ private int electricity; /** - *设备编码 + *设备编码(RTU编号) */ private String mnNo; /** * 观测时间2 + * DateUtil.formatDateTime(new Date()) */ private String obDate; /** * 观测时间 + * DateUtil.format(new Date(), "yyMMddHHmm") */ private String obTime; /** - * 白蚁设备安装的点位顺序 + * 白蚁设备安装的点位顺序(自定义6位数) */ private String order; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java index 92790c2..214e68d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java @@ -5,14 +5,16 @@ import com.newfiber.termite.domain.dto.AlarmDataDto; import com.newfiber.termite.domain.dto.DeviceInfoDto; import com.newfiber.termite.domain.dto.UnitInfoDto; -import com.newfiber.termite.domain.request.*; +import com.newfiber.termite.domain.request.DeviceInfoUpdateRequest; +import com.newfiber.termite.domain.request.TermiteHistoryQueryRequest; +import com.newfiber.termite.domain.request.TermiteInfoQueryRequest; +import com.newfiber.termite.domain.request.TermiteInfoSaveRequest; +import com.newfiber.termite.domain.request.TermiteInfoUpdateyRequest; import com.newfiber.termite.domain.response.DataUpResponse; import com.newfiber.termite.domain.response.TermiteInfoResponse; -import lombok.Data; -import org.apache.ibatis.annotations.Param; - import java.util.Date; import java.util.List; +import org.apache.ibatis.annotations.Param; public interface TermiteMapper extends BaseMapper { @@ -54,5 +56,6 @@ @Deprecated void updateDeviceLastUpTime(@Param("sn")String sn ,@Param("lastDate") String lastDate); + @Deprecated List queryDeviceData(@Param("projectCode")String projectCode); } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java index 23e3f5c..9978857 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java @@ -1,13 +1,13 @@ package com.newfiber.termite.service; +import com.newfiber.termite.domain.DeviceInfo; import com.newfiber.termite.domain.dto.TermiteDataUpRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoSaveRequest; import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoStateSyncRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoUpdateRequest; import com.newfiber.termite.enums.EDeviceSyncState; import java.util.List; -import com.newfiber.termite.domain.DeviceInfo; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoSaveRequest; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoUpdateRequest; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; /** * 设备信息Service接口 @@ -88,4 +88,12 @@ */ List selectList(DeviceInfoQueryRequest request); + /** + * 列表查询设备信息 + * + * @param request 列表参数 + * @return 设备信息集合 + */ + List selectList(String projectCode); + } 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 2891a87..526364b 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 @@ -1,26 +1,26 @@ package com.newfiber.termite.service.impl; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.newfiber.common.core.exception.ServiceException; +import com.newfiber.common.core.web.domain.BaseEntity; +import com.newfiber.common.core.web.service.BaseServiceImpl; +import com.newfiber.termite.domain.DeviceInfo; import com.newfiber.termite.domain.dto.TermiteDataUpRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoSaveRequest; import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoStateSyncRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoUpdateRequest; import com.newfiber.termite.enums.EDeviceSyncState; +import com.newfiber.termite.mapper.DeviceInfoMapper; +import com.newfiber.termite.service.IDeviceInfoService; import java.util.List; import java.util.Optional; -import com.newfiber.common.core.web.domain.BaseEntity; -import com.newfiber.common.core.exception.ServiceException; -import com.newfiber.common.core.web.service.BaseServiceImpl; +import javax.annotation.Resource; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import org.springframework.transaction.annotation.Transactional; -import javax.annotation.Resource; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; -import com.newfiber.termite.mapper.DeviceInfoMapper; -import com.newfiber.termite.domain.DeviceInfo; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoSaveRequest; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoUpdateRequest; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; -import com.newfiber.termite.service.IDeviceInfoService; +import org.springframework.transaction.annotation.Transactional; /** * 设备信息Service业务层处理 @@ -119,4 +119,11 @@ return deviceInfoMapper.selectByCondition(request); } + @Override + public List selectList(String projectCode) { + DeviceInfoQueryRequest request = new DeviceInfoQueryRequest(); + request.setProjectCode(projectCode); + return deviceInfoMapper.selectByCondition(request); + } + } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java index aabe201..fb04bd0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java @@ -2,10 +2,8 @@ import lombok.Data; -import java.util.List; - @Data public class SnAlarmStatisticDto { private String name; - private Integer value; + private Number value; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java index 642dad5..b0a20a5 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java @@ -21,22 +21,24 @@ private int electricity; /** - *设备编码 + *设备编码(RTU编号) */ private String mnNo; /** * 观测时间2 + * DateUtil.formatDateTime(new Date()) */ private String obDate; /** * 观测时间 + * DateUtil.format(new Date(), "yyMMddHHmm") */ private String obTime; /** - * 白蚁设备安装的点位顺序 + * 白蚁设备安装的点位顺序(自定义6位数) */ private String order; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java index 92790c2..214e68d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java @@ -5,14 +5,16 @@ import com.newfiber.termite.domain.dto.AlarmDataDto; import com.newfiber.termite.domain.dto.DeviceInfoDto; import com.newfiber.termite.domain.dto.UnitInfoDto; -import com.newfiber.termite.domain.request.*; +import com.newfiber.termite.domain.request.DeviceInfoUpdateRequest; +import com.newfiber.termite.domain.request.TermiteHistoryQueryRequest; +import com.newfiber.termite.domain.request.TermiteInfoQueryRequest; +import com.newfiber.termite.domain.request.TermiteInfoSaveRequest; +import com.newfiber.termite.domain.request.TermiteInfoUpdateyRequest; import com.newfiber.termite.domain.response.DataUpResponse; import com.newfiber.termite.domain.response.TermiteInfoResponse; -import lombok.Data; -import org.apache.ibatis.annotations.Param; - import java.util.Date; import java.util.List; +import org.apache.ibatis.annotations.Param; public interface TermiteMapper extends BaseMapper { @@ -54,5 +56,6 @@ @Deprecated void updateDeviceLastUpTime(@Param("sn")String sn ,@Param("lastDate") String lastDate); + @Deprecated List queryDeviceData(@Param("projectCode")String projectCode); } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java index 23e3f5c..9978857 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java @@ -1,13 +1,13 @@ package com.newfiber.termite.service; +import com.newfiber.termite.domain.DeviceInfo; import com.newfiber.termite.domain.dto.TermiteDataUpRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoSaveRequest; import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoStateSyncRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoUpdateRequest; import com.newfiber.termite.enums.EDeviceSyncState; import java.util.List; -import com.newfiber.termite.domain.DeviceInfo; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoSaveRequest; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoUpdateRequest; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; /** * 设备信息Service接口 @@ -88,4 +88,12 @@ */ List selectList(DeviceInfoQueryRequest request); + /** + * 列表查询设备信息 + * + * @param request 列表参数 + * @return 设备信息集合 + */ + List selectList(String projectCode); + } 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 2891a87..526364b 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 @@ -1,26 +1,26 @@ package com.newfiber.termite.service.impl; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.newfiber.common.core.exception.ServiceException; +import com.newfiber.common.core.web.domain.BaseEntity; +import com.newfiber.common.core.web.service.BaseServiceImpl; +import com.newfiber.termite.domain.DeviceInfo; import com.newfiber.termite.domain.dto.TermiteDataUpRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoSaveRequest; import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoStateSyncRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoUpdateRequest; import com.newfiber.termite.enums.EDeviceSyncState; +import com.newfiber.termite.mapper.DeviceInfoMapper; +import com.newfiber.termite.service.IDeviceInfoService; import java.util.List; import java.util.Optional; -import com.newfiber.common.core.web.domain.BaseEntity; -import com.newfiber.common.core.exception.ServiceException; -import com.newfiber.common.core.web.service.BaseServiceImpl; +import javax.annotation.Resource; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import org.springframework.transaction.annotation.Transactional; -import javax.annotation.Resource; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; -import com.newfiber.termite.mapper.DeviceInfoMapper; -import com.newfiber.termite.domain.DeviceInfo; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoSaveRequest; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoUpdateRequest; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; -import com.newfiber.termite.service.IDeviceInfoService; +import org.springframework.transaction.annotation.Transactional; /** * 设备信息Service业务层处理 @@ -119,4 +119,11 @@ return deviceInfoMapper.selectByCondition(request); } + @Override + public List selectList(String projectCode) { + DeviceInfoQueryRequest request = new DeviceInfoQueryRequest(); + request.setProjectCode(projectCode); + return deviceInfoMapper.selectByCondition(request); + } + } 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 d88315b..eb05cff 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 @@ -16,7 +16,6 @@ import com.newfiber.termite.domain.OneByOneNow; import com.newfiber.termite.domain.Termite; import com.newfiber.termite.domain.dto.AlarmDataDto; -import com.newfiber.termite.domain.dto.DeviceInfoDto; import com.newfiber.termite.domain.dto.PhotoIdentifyDto; import com.newfiber.termite.domain.dto.SnAlarmStatisticDto; import com.newfiber.termite.domain.dto.TermiteDataUpRequest; @@ -101,6 +100,8 @@ @Resource private JingchuResourceConfig jingchuResourceConfig; + private final String JINGCHU_UPLOAD_API = "/waterDataTermites/insertDataBatch"; + @Transactional(rollbackFor = Exception.class) public DataUpResponse termiteDataup(TermiteDataUpRequest termiteDateUpRequest, MultipartFile image) throws Exception{ String date = DateUtil.formatDateTime(new Date()); @@ -166,9 +167,12 @@ jingChuUpload.setStatus(EBoolean.False.getIntValue()); } - HttpResponse httpResponse = HttpUtil.createPost(jingchuResourceConfig.getUrl()). - body(JSONObject.toJSONString(jingChuUpload)). + List jingChuUploadList = new ArrayList<>(); + jingChuUploadList.add(jingChuUpload); + HttpResponse httpResponse = HttpUtil.createPost(jingchuResourceConfig.getUrl().concat(JINGCHU_UPLOAD_API)). + body(JSONObject.toJSONString(jingChuUploadList)).timeout(1000). header("Authorization", jingchuResourceConfig.getToken()).execute(); + log.info("同步荆楚监测数据.请求:{},响应:{}", JSONObject.toJSONString(jingChuUpload), httpResponse.body()); } } @@ -291,12 +295,11 @@ public List querySnalarmStatistic(String projectCode){ List result = new ArrayList<>(); //查询所有站点的数据信息 - List snlist = termiteMapper.queryDeviceData(projectCode); - List alarmlist = termiteMapper.queryAlarmdata(projectCode); + List deviceInfoList = deviceInfoService.selectList(projectCode); AtomicInteger outlineflag = new AtomicInteger(0); - snlist.forEach(e->{ + deviceInfoList.forEach(e->{ Date date1 = new Date(); - if(e.getLastPicTime() !=null && !"".equals(e.getLastPicTime())){ + if(e.getLastPicTime() != null){ Date date2 =e.getLastPicTime(); double diff = Math.abs(date1.getTime()-date2.getTime()); double diffdays = diff/(1000l*60l*60l*24l); @@ -307,7 +310,7 @@ outlineflag.getAndIncrement(); } }); - int onlineflag = snlist.size()- outlineflag.get(); + int onlineflag = deviceInfoList.size()- outlineflag.get(); SnAlarmStatisticDto snAlarmStatisticDto =new SnAlarmStatisticDto(); snAlarmStatisticDto.setName("在线"); snAlarmStatisticDto.setValue(onlineflag); @@ -318,7 +321,7 @@ result.add(snAlarmStatisticDto2); SnAlarmStatisticDto snAlarmStatisticDto3 =new SnAlarmStatisticDto(); snAlarmStatisticDto3.setName("告警"); - snAlarmStatisticDto3.setValue(alarmlist.size()); + snAlarmStatisticDto3.setValue(deviceInfoList.stream().filter(t -> null != t.getFirstWarnDatetime()).count()); result.add(snAlarmStatisticDto3); return result; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java index aabe201..fb04bd0 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/dto/SnAlarmStatisticDto.java @@ -2,10 +2,8 @@ import lombok.Data; -import java.util.List; - @Data public class SnAlarmStatisticDto { private String name; - private Integer value; + private Number value; } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java index 642dad5..b0a20a5 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/domain/third/JingChuUpload.java @@ -21,22 +21,24 @@ private int electricity; /** - *设备编码 + *设备编码(RTU编号) */ private String mnNo; /** * 观测时间2 + * DateUtil.formatDateTime(new Date()) */ private String obDate; /** * 观测时间 + * DateUtil.format(new Date(), "yyMMddHHmm") */ private String obTime; /** - * 白蚁设备安装的点位顺序 + * 白蚁设备安装的点位顺序(自定义6位数) */ private String order; diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java index 92790c2..214e68d 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/mapper/TermiteMapper.java @@ -5,14 +5,16 @@ import com.newfiber.termite.domain.dto.AlarmDataDto; import com.newfiber.termite.domain.dto.DeviceInfoDto; import com.newfiber.termite.domain.dto.UnitInfoDto; -import com.newfiber.termite.domain.request.*; +import com.newfiber.termite.domain.request.DeviceInfoUpdateRequest; +import com.newfiber.termite.domain.request.TermiteHistoryQueryRequest; +import com.newfiber.termite.domain.request.TermiteInfoQueryRequest; +import com.newfiber.termite.domain.request.TermiteInfoSaveRequest; +import com.newfiber.termite.domain.request.TermiteInfoUpdateyRequest; import com.newfiber.termite.domain.response.DataUpResponse; import com.newfiber.termite.domain.response.TermiteInfoResponse; -import lombok.Data; -import org.apache.ibatis.annotations.Param; - import java.util.Date; import java.util.List; +import org.apache.ibatis.annotations.Param; public interface TermiteMapper extends BaseMapper { @@ -54,5 +56,6 @@ @Deprecated void updateDeviceLastUpTime(@Param("sn")String sn ,@Param("lastDate") String lastDate); + @Deprecated List queryDeviceData(@Param("projectCode")String projectCode); } diff --git a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java index 23e3f5c..9978857 100644 --- a/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java +++ b/newfiber-termites/newfiber-termites-dataup/src/main/java/com/newfiber/termite/service/IDeviceInfoService.java @@ -1,13 +1,13 @@ package com.newfiber.termite.service; +import com.newfiber.termite.domain.DeviceInfo; import com.newfiber.termite.domain.dto.TermiteDataUpRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoSaveRequest; import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoStateSyncRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoUpdateRequest; import com.newfiber.termite.enums.EDeviceSyncState; import java.util.List; -import com.newfiber.termite.domain.DeviceInfo; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoSaveRequest; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoUpdateRequest; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; /** * 设备信息Service接口 @@ -88,4 +88,12 @@ */ List selectList(DeviceInfoQueryRequest request); + /** + * 列表查询设备信息 + * + * @param request 列表参数 + * @return 设备信息集合 + */ + List selectList(String projectCode); + } 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 2891a87..526364b 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 @@ -1,26 +1,26 @@ package com.newfiber.termite.service.impl; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import com.newfiber.common.core.exception.ServiceException; +import com.newfiber.common.core.web.domain.BaseEntity; +import com.newfiber.common.core.web.service.BaseServiceImpl; +import com.newfiber.termite.domain.DeviceInfo; import com.newfiber.termite.domain.dto.TermiteDataUpRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoSaveRequest; import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoStateSyncRequest; +import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoUpdateRequest; import com.newfiber.termite.enums.EDeviceSyncState; +import com.newfiber.termite.mapper.DeviceInfoMapper; +import com.newfiber.termite.service.IDeviceInfoService; import java.util.List; import java.util.Optional; -import com.newfiber.common.core.web.domain.BaseEntity; -import com.newfiber.common.core.exception.ServiceException; -import com.newfiber.common.core.web.service.BaseServiceImpl; +import javax.annotation.Resource; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; -import org.springframework.transaction.annotation.Transactional; -import javax.annotation.Resource; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; -import com.newfiber.termite.mapper.DeviceInfoMapper; -import com.newfiber.termite.domain.DeviceInfo; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoSaveRequest; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoUpdateRequest; -import com.newfiber.termite.domain.request.deviceInfo.DeviceInfoQueryRequest; -import com.newfiber.termite.service.IDeviceInfoService; +import org.springframework.transaction.annotation.Transactional; /** * 设备信息Service业务层处理 @@ -119,4 +119,11 @@ return deviceInfoMapper.selectByCondition(request); } + @Override + public List selectList(String projectCode) { + DeviceInfoQueryRequest request = new DeviceInfoQueryRequest(); + request.setProjectCode(projectCode); + return deviceInfoMapper.selectByCondition(request); + } + } 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 d88315b..eb05cff 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 @@ -16,7 +16,6 @@ import com.newfiber.termite.domain.OneByOneNow; import com.newfiber.termite.domain.Termite; import com.newfiber.termite.domain.dto.AlarmDataDto; -import com.newfiber.termite.domain.dto.DeviceInfoDto; import com.newfiber.termite.domain.dto.PhotoIdentifyDto; import com.newfiber.termite.domain.dto.SnAlarmStatisticDto; import com.newfiber.termite.domain.dto.TermiteDataUpRequest; @@ -101,6 +100,8 @@ @Resource private JingchuResourceConfig jingchuResourceConfig; + private final String JINGCHU_UPLOAD_API = "/waterDataTermites/insertDataBatch"; + @Transactional(rollbackFor = Exception.class) public DataUpResponse termiteDataup(TermiteDataUpRequest termiteDateUpRequest, MultipartFile image) throws Exception{ String date = DateUtil.formatDateTime(new Date()); @@ -166,9 +167,12 @@ jingChuUpload.setStatus(EBoolean.False.getIntValue()); } - HttpResponse httpResponse = HttpUtil.createPost(jingchuResourceConfig.getUrl()). - body(JSONObject.toJSONString(jingChuUpload)). + List jingChuUploadList = new ArrayList<>(); + jingChuUploadList.add(jingChuUpload); + HttpResponse httpResponse = HttpUtil.createPost(jingchuResourceConfig.getUrl().concat(JINGCHU_UPLOAD_API)). + body(JSONObject.toJSONString(jingChuUploadList)).timeout(1000). header("Authorization", jingchuResourceConfig.getToken()).execute(); + log.info("同步荆楚监测数据.请求:{},响应:{}", JSONObject.toJSONString(jingChuUpload), httpResponse.body()); } } @@ -291,12 +295,11 @@ public List querySnalarmStatistic(String projectCode){ List result = new ArrayList<>(); //查询所有站点的数据信息 - List snlist = termiteMapper.queryDeviceData(projectCode); - List alarmlist = termiteMapper.queryAlarmdata(projectCode); + List deviceInfoList = deviceInfoService.selectList(projectCode); AtomicInteger outlineflag = new AtomicInteger(0); - snlist.forEach(e->{ + deviceInfoList.forEach(e->{ Date date1 = new Date(); - if(e.getLastPicTime() !=null && !"".equals(e.getLastPicTime())){ + if(e.getLastPicTime() != null){ Date date2 =e.getLastPicTime(); double diff = Math.abs(date1.getTime()-date2.getTime()); double diffdays = diff/(1000l*60l*60l*24l); @@ -307,7 +310,7 @@ outlineflag.getAndIncrement(); } }); - int onlineflag = snlist.size()- outlineflag.get(); + int onlineflag = deviceInfoList.size()- outlineflag.get(); SnAlarmStatisticDto snAlarmStatisticDto =new SnAlarmStatisticDto(); snAlarmStatisticDto.setName("在线"); snAlarmStatisticDto.setValue(onlineflag); @@ -318,7 +321,7 @@ result.add(snAlarmStatisticDto2); SnAlarmStatisticDto snAlarmStatisticDto3 =new SnAlarmStatisticDto(); snAlarmStatisticDto3.setName("告警"); - snAlarmStatisticDto3.setValue(alarmlist.size()); + snAlarmStatisticDto3.setValue(deviceInfoList.stream().filter(t -> null != t.getFirstWarnDatetime()).count()); result.add(snAlarmStatisticDto3); return result; } 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 0d504f9..bbe080d 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 @@ -72,7 +72,7 @@ - order by -tb.yesnoant desc + order by -tb.yesnoant desc, ta.create_time desc