用能系统优化
This commit is contained in:
@@ -43,6 +43,18 @@
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||
<version>4.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-dysmsapi</artifactId>
|
||||
<version>1.1.0</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package com.njcn.energy.pojo.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.energy.pojo.api.fallback.EleAirStrategyFallbackFactory;
|
||||
import com.njcn.energy.pojo.api.fallback.EleOnlineRateFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
@@ -24,6 +22,6 @@ public interface EleAirStrategyFeignClient {
|
||||
* @date 2022/4/22
|
||||
*/
|
||||
@GetMapping("dealAirStrategyId")
|
||||
HttpResult<Boolean> dealAirStrategyId(@RequestParam("operation") String operation);
|
||||
void dealAirStrategyId(@RequestParam("operation") String operation);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package com.njcn.energy.pojo.api;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.energy.pojo.api.fallback.EleOnlineRateFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
|
||||
/**
|
||||
@@ -23,12 +21,12 @@ public interface EnergyStatisticFeignClient {
|
||||
* @date 2022/4/22
|
||||
*/
|
||||
@GetMapping("electricCalJob")
|
||||
HttpResult<Boolean> electricCalJob();
|
||||
void electricCalJob();
|
||||
|
||||
@GetMapping("eleOnlineRateJob")
|
||||
HttpResult<Boolean> eleOnlineRateJobHandler();
|
||||
void eleOnlineRateJobHandler();
|
||||
|
||||
@GetMapping("eleIntegrityJob")
|
||||
HttpResult<Boolean> eleIntegrityJobHandler();
|
||||
void eleIntegrityJobHandler();
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.njcn.energy.pojo.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.energy.pojo.api.EleAirStrategyFeignClient;
|
||||
import com.njcn.energy.pojo.utils.EnergyEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
@@ -33,7 +32,7 @@ public class EleAirStrategyFallbackFactory implements FallbackFactory<EleAirStra
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new EleAirStrategyFeignClient() {
|
||||
@Override
|
||||
public HttpResult<Boolean> dealAirStrategyId(String operation) {
|
||||
public void dealAirStrategyId(String operation) {
|
||||
log.error("{}异常,降级处理,异常为:{}","空调控制策略数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@ package com.njcn.energy.pojo.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.energy.pojo.api.EleAirStrategyFeignClient;
|
||||
import com.njcn.energy.pojo.api.EnergyStatisticFeignClient;
|
||||
import com.njcn.energy.pojo.utils.EnergyEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
@@ -34,19 +32,19 @@ public class EnergyStatisticFallbackFactory implements FallbackFactory<EnergySta
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new EnergyStatisticFeignClient() {
|
||||
@Override
|
||||
public HttpResult<Boolean> electricCalJob() {
|
||||
public void electricCalJob() {
|
||||
log.error("{}异常,降级处理,异常为:{}","调度统计电量增量",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Boolean> eleOnlineRateJobHandler() {
|
||||
public void eleOnlineRateJobHandler() {
|
||||
log.error("{}异常,降级处理,异常为:{}","用能终端在线率数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Boolean> eleIntegrityJobHandler() {
|
||||
public void eleIntegrityJobHandler() {
|
||||
log.error("{}异常,降级处理,异常为:{}","用能数据完整性数据",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.njcn.energy.pojo.constant;
|
||||
|
||||
public interface SmsConstant {
|
||||
|
||||
String DEFAULT_CONNECT_TIME_OUT = "sun.net.client.defaultConnectTimeout";
|
||||
String DEFAULT_READ_TIME_OUT = "sun.net.client.defaultReadTimeout";
|
||||
//短信API产品名称(短信产品名固定,无需修改)
|
||||
String PRODUCT = "Dysmsapi";
|
||||
//短信API产品域名(接口地址固定,无需修改)
|
||||
String DOMAIN = "dysmsapi.aliyuncs.com";
|
||||
//accessKeyId
|
||||
String ACCESS_KEY_ID = "LTAI4FxsR76x2dq3w9c5puUe";
|
||||
//accessKeySecret
|
||||
String ACCESS_KEY_SECRET = "GxkTR8fsrvHtixTlD9UPmOGli35tZs";
|
||||
//短信所属地
|
||||
String LOCATION = "cn-hangzhou";
|
||||
//签名
|
||||
String SGIN = "灿能云";
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.energy.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author: cdf
|
||||
* @CreateTime: 2025-05-12
|
||||
* @Description: 光伏异常短信策略
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "pv_power_strategy")
|
||||
public class PvPowerStrategy {
|
||||
|
||||
private String id;
|
||||
|
||||
private Double alarmVal;
|
||||
|
||||
private String sendPhone;
|
||||
}
|
||||
Reference in New Issue
Block a user