1.监测点超标信息详情统计
2.终端在线率统计
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package com.njcn.dataProcess.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.dataProcess.api.fallback.DataOnlineRateFeignClientFallbackFactory;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDto;
|
||||
import com.njcn.dataProcess.pojo.dto.RStatOnlineRateDto;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/7 9:30
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.PLATFORM_DATA_PROCESSING_BOOT, path = "/dataOnlineRate", fallbackFactory = DataOnlineRateFeignClientFallbackFactory.class, contextId = "dataOnlineRate")
|
||||
public interface DataOnlineRateFeignClient {
|
||||
|
||||
@PostMapping("/batchInsertion")
|
||||
HttpResult<String> batchInsertion(@RequestBody List<RStatOnlineRateDto.Detail> dataIDTOList);
|
||||
|
||||
}
|
||||
@@ -21,19 +21,23 @@ import java.util.List;
|
||||
* @version 1.0.0
|
||||
* @date 2022年01月05日 15:11
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.PLATFORM_DATA_PROCESSING_BOOT, path = "/dataV", fallbackFactory = DataVFeignClientFallbackFactory.class, contextId = "dataV")
|
||||
@FeignClient(value = ServerInfo.PLATFORM_DATA_PROCESSING_BOOT, path = "/dataV", fallbackFactory = DataVFeignClientFallbackFactory.class, contextId = "dataV")
|
||||
public interface DataVFeignClient {
|
||||
|
||||
@PostMapping("/batchInsertion")
|
||||
HttpResult<String> batchInsertion(@RequestBody List<DataVDTO> dataVDTOList);
|
||||
|
||||
@PostMapping("/monitoringTime")
|
||||
HttpResult<List<LocalDateTime>> monitoringTime(@RequestParam("lineId") String lineId, @RequestParam("localData") String localData) ;
|
||||
HttpResult<List<LocalDateTime>> monitoringTime(@RequestParam("lineId") String lineId, @RequestParam("localData") String localData);
|
||||
|
||||
//获取原始数据
|
||||
@PostMapping("/getRawData")
|
||||
HttpResult<List<DataVDto>> getRawData(@RequestBody LineCountEvaluateParam lineParam);
|
||||
|
||||
//获取总条目数量
|
||||
@PostMapping("/getCountRawData")
|
||||
HttpResult<Integer> getCountRawData(@RequestBody LineCountEvaluateParam lineParam);
|
||||
|
||||
//获取算法基础数据
|
||||
@PostMapping("/getBaseData")
|
||||
HttpResult<List<CommonMinuteDto>> getBaseData(@RequestBody LineCountEvaluateParam lineParam);
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.njcn.dataProcess.api.fallback;
|
||||
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.dataProcess.api.DataOnlineRateFeignClient;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDto;
|
||||
import com.njcn.dataProcess.pojo.dto.RStatOnlineRateDto;
|
||||
import com.njcn.dataProcess.util.DataProcessingEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/7 9:30
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class DataOnlineRateFeignClientFallbackFactory implements FallbackFactory<DataOnlineRateFeignClient> {
|
||||
|
||||
|
||||
/**
|
||||
* 输出远程请求接口异常日志
|
||||
* @param cause RPC请求异常
|
||||
*/
|
||||
@Override
|
||||
public DataOnlineRateFeignClient create(Throwable cause) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if(cause.getCause() instanceof BusinessException){
|
||||
BusinessException businessException = (BusinessException) cause.getCause();
|
||||
exceptionEnum = DataProcessingEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new DataOnlineRateFeignClient() {
|
||||
@Override
|
||||
public HttpResult<String> batchInsertion(List<RStatOnlineRateDto.Detail> dataIDTOList) {
|
||||
log.error("{}异常,降级处理,异常为:{}","批量插入数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -60,6 +60,12 @@ public class DataVFeignClientFallbackFactory implements FallbackFactory<DataVFei
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Integer> getCountRawData(LineCountEvaluateParam lineParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}","获取总条目数量",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<CommonMinuteDto>> getBaseData(LineCountEvaluateParam lineParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}","获取算法基础数据",cause.toString());
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.njcn.dataProcess.pojo.dto;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
* @description
|
||||
@@ -11,10 +14,15 @@ import lombok.Data;
|
||||
@Data
|
||||
public class AbnormalData {
|
||||
|
||||
|
||||
/**
|
||||
* 超标时间
|
||||
*/
|
||||
private String time;
|
||||
/**
|
||||
* 相别
|
||||
*/
|
||||
private String phasic;
|
||||
|
||||
/**
|
||||
* 数据类型(最大值:max、最小值:min、平均值:avg、95值:cp95)
|
||||
@@ -29,4 +37,34 @@ public class AbnormalData {
|
||||
* 限值
|
||||
*/
|
||||
private float overLimitValue;
|
||||
|
||||
@Data
|
||||
public static class Json {
|
||||
|
||||
|
||||
/**
|
||||
* 相别
|
||||
*/
|
||||
@JSONField(ordinal = 1)
|
||||
private String phasic;
|
||||
|
||||
/**
|
||||
* 数据类型(最大值:max、最小值:min、平均值:avg、95值:cp95)
|
||||
*/
|
||||
@JSONField(ordinal = 2)
|
||||
private String valueType;
|
||||
|
||||
/**
|
||||
* 超标时间
|
||||
*/
|
||||
@JSONField(ordinal = 3)
|
||||
private String time;
|
||||
/**
|
||||
* 异常值
|
||||
*/
|
||||
@JSONField(ordinal = 4)
|
||||
private String value;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,24 +15,11 @@ public class DataLimitRateDetailDto implements Serializable {
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 数据类型,’A’表示A相,’B’表示B相,’C’表示C相,’’M’表示ABC三项总和,T’表示总
|
||||
*/
|
||||
private String phasicType;
|
||||
|
||||
/**
|
||||
* 合格率时间
|
||||
*/
|
||||
private LocalDate time;
|
||||
|
||||
/**
|
||||
* 总计算次数
|
||||
*/
|
||||
private Integer allTime;
|
||||
/**
|
||||
* 闪变总计算次数
|
||||
*/
|
||||
private Integer flickerAllTime;
|
||||
/**
|
||||
* 闪变越限次数
|
||||
*/
|
||||
|
||||
@@ -19,13 +19,6 @@ public class RStatLimitRateDetailD implements Serializable {
|
||||
@TableField(value = "my_index")
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 数据类型,’A’表示A相,’B’表示B相,’C’表示C相,’’M’表示ABC三项总和,T’表示总
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "phasic_type")
|
||||
private String phasicType;
|
||||
|
||||
/**
|
||||
* 合格率时间
|
||||
*/
|
||||
@@ -34,18 +27,6 @@ public class RStatLimitRateDetailD implements Serializable {
|
||||
@JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
|
||||
private LocalDate time;
|
||||
|
||||
/**
|
||||
* 总计算次数
|
||||
*/
|
||||
@TableField(value = "all_time")
|
||||
private Integer allTime;
|
||||
|
||||
/**
|
||||
* 闪变总计算次数
|
||||
*/
|
||||
@TableField(value = "flicker_all_time")
|
||||
private Integer flickerAllTime;
|
||||
|
||||
/**
|
||||
* 闪变越限次数
|
||||
*/
|
||||
|
||||
@@ -23,7 +23,7 @@ public class RStatOnlineRateD {
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "time_id")
|
||||
private LocalDateTime timeId;
|
||||
private String timeId;
|
||||
|
||||
/**
|
||||
* 装置id
|
||||
|
||||
Reference in New Issue
Block a user