新能源专项分析算法迁移
This commit is contained in:
@@ -1,14 +1,18 @@
|
||||
package com.njcn.dataProcess.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.dataProcess.api.fallback.DataLimitRateDetailFeignClientFallbackFactory;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDetailDto;
|
||||
import com.njcn.dataProcess.pojo.dto.DataLimitRateDto;
|
||||
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;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -17,7 +21,7 @@ import java.util.List;
|
||||
* @Author: wr
|
||||
* @Date: 2025/3/7 9:30
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.PLATFORM_DATA_PROCESSING_BOOT, path = "/dataLimitRateDetail", fallbackFactory = DataLimitRateDetailFeignClientFallbackFactory.class, contextId = "dataLimitRateDetail")
|
||||
@FeignClient(value = ServerInfo.PLATFORM_DATA_PROCESSING_BOOT, path = "/dataLimitRateDetail", fallbackFactory = DataLimitRateDetailFeignClientFallbackFactory.class, contextId = "dataLimitRateDetail")
|
||||
public interface DataLimitRateDetailFeignClient {
|
||||
|
||||
@PostMapping("/batchInsertion")
|
||||
@@ -26,4 +30,6 @@ public interface DataLimitRateDetailFeignClient {
|
||||
@PostMapping("/getRawData")
|
||||
HttpResult<List<DataLimitRateDetailDto>> getRawData(@RequestBody LineCountEvaluateParam lineParam);
|
||||
|
||||
@PostMapping("/getLimitRateDetailTime")
|
||||
HttpResult<List<String>> getLimitRateDetailTime(@RequestParam("id") String id, @RequestParam("time") String time);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
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.RmpEventFeignClientFallbackFactory;
|
||||
import com.njcn.dataProcess.api.fallback.SpThroughFeignClientFallbackFactory;
|
||||
import com.njcn.dataProcess.dto.RmpEventDetailDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.RActivePowerRangeDto;
|
||||
import com.njcn.dataProcess.pojo.dto.SpThroughDto;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022年01月05日 15:11
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.PLATFORM_DATA_PROCESSING_BOOT, path = "/specialAnalysis", fallbackFactory = SpThroughFeignClientFallbackFactory.class, contextId = "specialAnalysis")
|
||||
public interface SpThroughFeignClient {
|
||||
|
||||
@PostMapping("/batchInsertionThrough")
|
||||
HttpResult<String> batchInsertionThrough(@RequestBody List<SpThroughDto> dtoList);
|
||||
|
||||
@PostMapping("/batchInsertionPower")
|
||||
HttpResult<String> batchInsertionPower(@RequestBody List<RActivePowerRangeDto> dtoList);
|
||||
}
|
||||
@@ -50,6 +50,12 @@ public class DataLimitRateDetailFeignClientFallbackFactory implements FallbackFa
|
||||
log.error("{}异常,降级处理,异常为:{}","获取基础数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<List<String>> getLimitRateDetailTime(String id, String time) {
|
||||
log.error("{}异常,降级处理,异常为:{}","根据监测点id获取所有超标时间",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
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.RmpEventDetailFeignClient;
|
||||
import com.njcn.dataProcess.api.SpThroughFeignClient;
|
||||
import com.njcn.dataProcess.dto.RmpEventDetailDTO;
|
||||
import com.njcn.dataProcess.param.LineCountEvaluateParam;
|
||||
import com.njcn.dataProcess.pojo.dto.RActivePowerRangeDto;
|
||||
import com.njcn.dataProcess.pojo.dto.SpThroughDto;
|
||||
import com.njcn.dataProcess.util.DataProcessingEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author denghuajun
|
||||
* @version 1.0.0
|
||||
* @date 2022年01月05日 15:08
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class SpThroughFeignClientFallbackFactory implements FallbackFactory<SpThroughFeignClient> {
|
||||
|
||||
|
||||
/**
|
||||
* 输出远程请求接口异常日志
|
||||
* @param cause RPC请求异常
|
||||
*/
|
||||
@Override
|
||||
public SpThroughFeignClient 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 SpThroughFeignClient() {
|
||||
|
||||
@Override
|
||||
public HttpResult<String> batchInsertionThrough(List<SpThroughDto> dtoList) {
|
||||
log.error("{}异常,降级处理,异常为:{}","高低电压穿越批量插入",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> batchInsertionPower(List<RActivePowerRangeDto> dtoList) {
|
||||
log.error("{}异常,降级处理,异常为:{}","有功功率批量插入",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,6 @@ public class DataQualifiedDetail {
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
|
||||
/**
|
||||
* 合格率时间
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,180 @@
|
||||
package com.njcn.dataProcess.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 有功功率趋势
|
||||
* @Author: wr
|
||||
* @Date: 2025/4/1 19:33
|
||||
*/
|
||||
@Data
|
||||
public class RActivePowerRangeDto {
|
||||
|
||||
/**
|
||||
* 监测点ID
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 日期(天)
|
||||
*/
|
||||
private LocalDate timeId;
|
||||
|
||||
/**
|
||||
* 0%~10%区间时间Json
|
||||
*/
|
||||
private String minsTime0;
|
||||
|
||||
/**
|
||||
* 0%~10%区间个数
|
||||
*/
|
||||
private Integer minsNum0 = 0;
|
||||
|
||||
/**
|
||||
* 0%~10%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot0 = 0;
|
||||
|
||||
/**
|
||||
* 10%~20%区间时间Json
|
||||
*/
|
||||
private String minsTime1;
|
||||
|
||||
/**
|
||||
* 10%~20%区间个数
|
||||
*/
|
||||
private Integer minsNum1 = 0;
|
||||
|
||||
/**
|
||||
* 10%~20%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot1 = 0;
|
||||
|
||||
/**
|
||||
* 20%~30%区间时间Json
|
||||
*/
|
||||
private String minsTime2;
|
||||
|
||||
/**
|
||||
* 20%~30%区间个数
|
||||
*/
|
||||
private Integer minsNum2 = 0;
|
||||
|
||||
/**
|
||||
* 20%~30%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot2 = 0;
|
||||
|
||||
/**
|
||||
* 30%~40%区间时间Json
|
||||
*/
|
||||
private String minsTime3;
|
||||
|
||||
/**
|
||||
* 30%~40%区间个数
|
||||
*/
|
||||
private Integer minsNum3 = 0;
|
||||
|
||||
/**
|
||||
* 30%~40%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot3 = 0;
|
||||
|
||||
/**
|
||||
* 40%~50%区间时间Json
|
||||
*/
|
||||
private String minsTime4;
|
||||
|
||||
/**
|
||||
* 40%~50%区间个数
|
||||
*/
|
||||
private Integer minsNum4 = 0;
|
||||
|
||||
/**
|
||||
* 40%~50%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot4 = 0;
|
||||
|
||||
/**
|
||||
* 50%~60%区间时间Json
|
||||
*/
|
||||
private String minsTime5;
|
||||
|
||||
/**
|
||||
* 50%~60%区间个数
|
||||
*/
|
||||
private Integer minsNum5 = 0;
|
||||
|
||||
/**
|
||||
* 50%~60%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot5 = 0;
|
||||
|
||||
/**
|
||||
* 60%~70%区间时间Json
|
||||
*/
|
||||
private String minsTime6;
|
||||
|
||||
/**
|
||||
* 60%~70%区间个数
|
||||
*/
|
||||
private Integer minsNum6 = 0;
|
||||
|
||||
/**
|
||||
* 60%~70%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot6 = 0;
|
||||
|
||||
/**
|
||||
* 70%~80%区间时间Json
|
||||
*/
|
||||
private String minsTime7;
|
||||
|
||||
/**
|
||||
* 70%~80%区间个数
|
||||
*/
|
||||
private Integer minsNum7 = 0;
|
||||
|
||||
/**
|
||||
* 70%~80%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot7 = 0;
|
||||
|
||||
/**
|
||||
* 80%~90%区间时间Json
|
||||
*/
|
||||
private String minsTime8;
|
||||
|
||||
/**
|
||||
* 80%~90%区间个数
|
||||
*/
|
||||
private Integer minsNum8 = 0;
|
||||
|
||||
/**
|
||||
* 80%~90%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot8 = 0;
|
||||
|
||||
/**
|
||||
* 90%~100%区间时间Json
|
||||
*/
|
||||
private String minsTime9;
|
||||
|
||||
/**
|
||||
* 90%~100%区间个数
|
||||
*/
|
||||
private Integer minsNum9 = 0;
|
||||
|
||||
/**
|
||||
* 90%~100%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot9 = 0;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.dataProcess.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Description: 高低电压穿越 实体类
|
||||
* @Author: wr
|
||||
* @Date: 2025/4/1 15:55
|
||||
*/
|
||||
@Data
|
||||
public class SpThroughDto {
|
||||
|
||||
/**
|
||||
* 暂降事件ID
|
||||
*/
|
||||
private String eventId;
|
||||
|
||||
/**
|
||||
* 暂降类型(暂升、暂降)
|
||||
*/
|
||||
private String eventType;
|
||||
|
||||
/**
|
||||
* (关联Dic_tree表)变电站类型(风电场、光伏电站)
|
||||
*/
|
||||
private String stationType;
|
||||
|
||||
/**
|
||||
* 是否穿越
|
||||
*/
|
||||
private Integer isOrNot;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,225 @@
|
||||
package com.njcn.dataProcess.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 有功功率趋势
|
||||
* @Author: wr
|
||||
* @Date: 2025/4/1 19:33
|
||||
*/
|
||||
@Data
|
||||
@TableName("r_active_power_range")
|
||||
public class RActivePowerRange extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 日期(天)
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "time_id")
|
||||
private LocalDate timeId;
|
||||
|
||||
|
||||
/**
|
||||
* 监测点ID
|
||||
*/
|
||||
@MppMultiId
|
||||
@TableField(value = "line_id")
|
||||
private String lineId;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 0%~10%区间时间Json
|
||||
*/
|
||||
@TableField(value = "mins_time0")
|
||||
private String minsTime0;
|
||||
|
||||
/**
|
||||
* 0%~10%区间个数
|
||||
*/
|
||||
@TableField(value = "mins_num0")
|
||||
private Integer minsNum0 = 0;
|
||||
|
||||
/**
|
||||
* 0%~10%区间是否越限
|
||||
*/
|
||||
@TableField(value = "is_or_not0")
|
||||
private Integer isOrNot0 = 0;
|
||||
|
||||
/**
|
||||
* 10%~20%区间时间Json
|
||||
*/
|
||||
@TableField(value = "mins_time1")
|
||||
private String minsTime1;
|
||||
|
||||
/**
|
||||
* 10%~20%区间个数
|
||||
*/
|
||||
@TableField(value = "mins_num1")
|
||||
private Integer minsNum1 = 0;;
|
||||
|
||||
/**
|
||||
* 10%~20%区间是否越限
|
||||
*/
|
||||
@TableField(value = "is_or_not1")
|
||||
private Integer isOrNot1 = 0;
|
||||
|
||||
/**
|
||||
* 20%~30%区间时间Json
|
||||
*/
|
||||
@TableField(value = "mins_time2")
|
||||
private String minsTime2;
|
||||
|
||||
/**
|
||||
* 20%~30%区间个数
|
||||
*/
|
||||
@TableField(value = "mins_num2")
|
||||
private Integer minsNum2 = 0;;
|
||||
|
||||
/**
|
||||
* 20%~30%区间是否越限
|
||||
*/
|
||||
@TableField(value = "is_or_not2")
|
||||
private Integer isOrNot2 = 0;
|
||||
|
||||
/**
|
||||
* 30%~40%区间时间Json
|
||||
*/
|
||||
@TableField(value = "mins_time3")
|
||||
private String minsTime3;
|
||||
|
||||
/**
|
||||
* 30%~40%区间个数
|
||||
*/
|
||||
@TableField(value = "mins_num3")
|
||||
private Integer minsNum3 = 0;;
|
||||
|
||||
/**
|
||||
* 30%~40%区间是否越限
|
||||
*/
|
||||
@TableField(value = "is_or_not3")
|
||||
private Integer isOrNot3 = 0;
|
||||
|
||||
/**
|
||||
* 40%~50%区间时间Json
|
||||
*/
|
||||
@TableField(value = "mins_time4")
|
||||
private String minsTime4;
|
||||
|
||||
/**
|
||||
* 40%~50%区间个数
|
||||
*/
|
||||
@TableField(value = "mins_num4")
|
||||
private Integer minsNum4 = 0;;
|
||||
|
||||
/**
|
||||
* 40%~50%区间是否越限
|
||||
*/
|
||||
@TableField(value = "is_or_not4")
|
||||
private Integer isOrNot4 = 0;
|
||||
|
||||
/**
|
||||
* 50%~60%区间时间Json
|
||||
*/
|
||||
@TableField(value = "mins_time5")
|
||||
private String minsTime5;
|
||||
|
||||
/**
|
||||
* 50%~60%区间个数
|
||||
*/
|
||||
@TableField(value = "mins_num5")
|
||||
private Integer minsNum5 = 0;;
|
||||
|
||||
/**
|
||||
* 50%~60%区间是否越限
|
||||
*/
|
||||
@TableField(value = "is_or_not5")
|
||||
private Integer isOrNot5 = 0;
|
||||
|
||||
/**
|
||||
* 60%~70%区间时间Json
|
||||
*/
|
||||
@TableField(value = "mins_time6")
|
||||
private String minsTime6;
|
||||
|
||||
/**
|
||||
* 60%~70%区间个数
|
||||
*/
|
||||
@TableField(value = "mins_num6")
|
||||
private Integer minsNum6 = 0;;
|
||||
|
||||
/**
|
||||
* 60%~70%区间是否越限
|
||||
*/
|
||||
@TableField(value = "is_or_not6")
|
||||
private Integer isOrNot6 = 0;
|
||||
|
||||
/**
|
||||
* 70%~80%区间时间Json
|
||||
*/
|
||||
@TableField(value = "mins_time7")
|
||||
private String minsTime7;
|
||||
|
||||
/**
|
||||
* 70%~80%区间个数
|
||||
*/
|
||||
@TableField(value = "mins_num7")
|
||||
private Integer minsNum7 = 0;;
|
||||
|
||||
/**
|
||||
* 70%~80%区间是否越限
|
||||
*/
|
||||
@TableField(value = "is_or_not7")
|
||||
private Integer isOrNot7 = 0;
|
||||
|
||||
/**
|
||||
* 80%~90%区间时间Json
|
||||
*/
|
||||
@TableField(value = "mins_time8")
|
||||
private String minsTime8;
|
||||
|
||||
/**
|
||||
* 80%~90%区间个数
|
||||
*/
|
||||
@TableField(value = "mins_num8")
|
||||
private Integer minsNum8 = 0;;
|
||||
|
||||
/**
|
||||
* 80%~90%区间是否越限
|
||||
*/
|
||||
@TableField(value = "is_or_not8")
|
||||
private Integer isOrNot8 = 0;
|
||||
|
||||
/**
|
||||
* 90%~100%区间时间Json
|
||||
*/
|
||||
@TableField(value = "mins_time9")
|
||||
private String minsTime9;
|
||||
|
||||
/**
|
||||
* 90%~100%区间个数
|
||||
*/
|
||||
@TableField(value = "mins_num9")
|
||||
private Integer minsNum9 = 0;;
|
||||
|
||||
/**
|
||||
* 90%~100%区间是否越限
|
||||
*/
|
||||
@TableField(value = "is_or_not9")
|
||||
private Integer isOrNot9 = 0;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
@TableField(value = "state")
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.njcn.dataProcess.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @Description: 高低电压穿越 实体类
|
||||
* @Author: wr
|
||||
* @Date: 2025/4/1 15:55
|
||||
*/
|
||||
@Data
|
||||
@TableName("sp_through")
|
||||
public class SpThrough extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 暂降事件ID
|
||||
*/
|
||||
private String eventId;
|
||||
|
||||
/**
|
||||
* 暂降类型(暂升、暂降)
|
||||
*/
|
||||
private String eventType;
|
||||
|
||||
/**
|
||||
* (关联PQS_Dictionary表)变电站类型(风电场、光伏电站)
|
||||
*/
|
||||
private String stationType;
|
||||
|
||||
/**
|
||||
* 是否穿越
|
||||
*/
|
||||
private Integer isOrNot;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Boolean state;
|
||||
|
||||
/**
|
||||
* 创建时间(自定义)
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user