谐波模块:部分业务influxdb转mysql
This commit is contained in:
@@ -1,11 +1,18 @@
|
||||
package com.njcn.device.pq.api;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.pq.api.fallback.GeneralDeviceInfoClientFallbackFactory;
|
||||
import com.njcn.device.pq.pojo.bo.BaseLineInfo;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.OnlineRate;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
@@ -95,4 +102,11 @@ public interface GeneralDeviceInfoClient {
|
||||
@PostMapping("/getBaseLineInfo")
|
||||
HttpResult<List<BaseLineInfo>> getBaseLineInfo(@RequestBody List<String> lineIndex);
|
||||
|
||||
/**
|
||||
* 终端在线率(谐波专用)
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/getOnlineRateByDevIds")
|
||||
HttpResult<List<RStatOnlinerateVO>> getOnlineRateByDevIds(@RequestBody OnlineRateParam param);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.pq.api.fallback.LineFeignClientFallbackFactory;
|
||||
import com.njcn.device.pq.pojo.dto.*;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.pq.pojo.po.Overlimit;
|
||||
@@ -297,4 +298,10 @@ public interface LineFeignClient {
|
||||
*/
|
||||
@PostMapping("/getLineCountBySubstation")
|
||||
HttpResult<Integer> getLineCountBySubstation(@RequestParam("subIndex") String subIndex);
|
||||
|
||||
/**
|
||||
* 监测点数据完整率(谐波专用)
|
||||
*/
|
||||
@PostMapping("/getOnIntegrityByIds")
|
||||
HttpResult<List<RStatIntegrityVO>> getOnIntegrityByIds(@RequestBody OnlineRateParam param);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,9 @@ import com.njcn.device.pq.api.GeneralDeviceInfoClient;
|
||||
import com.njcn.device.pq.pojo.bo.BaseLineInfo;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.OnlineRate;
|
||||
import com.njcn.device.pq.pojo.vo.RStatOnlinerateVO;
|
||||
import com.njcn.device.pq.utils.DeviceEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -78,6 +81,12 @@ public class GeneralDeviceInfoClientFallbackFactory implements FallbackFactory<G
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取监测点及以上层的基础信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<RStatOnlinerateVO>> getOnlineRateByDevIds(OnlineRateParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取终端在线率(谐波专用)", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.pq.api.LineFeignClient;
|
||||
import com.njcn.device.pq.pojo.dto.*;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.OnlineRateParam;
|
||||
import com.njcn.device.pq.pojo.po.Line;
|
||||
import com.njcn.device.pq.pojo.po.LineDetail;
|
||||
import com.njcn.device.pq.pojo.po.Overlimit;
|
||||
@@ -219,6 +220,13 @@ public class LineFeignClientFallbackFactory implements FallbackFactory<LineFeign
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<RStatIntegrityVO>> getOnIntegrityByIds(OnlineRateParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取监测点数据完整率(谐波专用): ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.njcn.device.pq.pojo.param;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author wr
|
||||
* @createTime: 2023-04-03
|
||||
*/
|
||||
@Data
|
||||
@ApiModel
|
||||
public class OnlineRateParam {
|
||||
|
||||
@ApiModelProperty(name = "ids", value = "设备id")
|
||||
private List<String> ids;
|
||||
|
||||
@ApiModelProperty(name = "startTime", value = "开始时间")
|
||||
private String startTime;
|
||||
|
||||
@ApiModelProperty(name = "endTime", value = "结束时间")
|
||||
private String endTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.njcn.device.pq.pojo.vo;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 数据完整性日表
|
||||
* </p>
|
||||
*
|
||||
* @author wr
|
||||
* @since 2023-04-03
|
||||
*/
|
||||
@Data
|
||||
public class RStatIntegrityVO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private LocalDateTime timeId;
|
||||
|
||||
private String lineIndex;
|
||||
|
||||
private Integer dueTime;
|
||||
|
||||
private Integer realTime;
|
||||
|
||||
private Double integrityRate;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.njcn.device.pq.pojo.vo;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <功能描述>
|
||||
*
|
||||
* @author wr
|
||||
* @createTime: 2023-04-03
|
||||
*/
|
||||
@Data
|
||||
public class RStatOnlinerateVO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private LocalDateTime timeId;
|
||||
|
||||
private String devIndex;
|
||||
|
||||
private Integer onlineMin;
|
||||
|
||||
private Integer offlineMin;
|
||||
|
||||
private Integer onlineRate;
|
||||
}
|
||||
Reference in New Issue
Block a user