高低电压穿越及有功功率趋势算法
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package com.njcn.prepare.harmonic.api.event;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.prepare.harmonic.api.event.fallback.RActivePowerRangeFeignClientFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
/**
|
||||
* 有功功率趋势Feign客户端
|
||||
* @author guofeihu
|
||||
* @date 2024-08-22
|
||||
*/
|
||||
@FeignClient(
|
||||
value = ServerInfo.PREPARE_BOOT,//对应模块名
|
||||
path = "/rActivePowerRange",//对应controller请求类
|
||||
fallbackFactory = RActivePowerRangeFeignClientFallbackFactory.class//服务降级处理类
|
||||
)
|
||||
public interface RActivePowerRangeFeignClient {
|
||||
|
||||
@PostMapping("/record")
|
||||
HttpResult<Boolean> record();
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.njcn.prepare.harmonic.api.event;
|
||||
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.prepare.harmonic.api.event.fallback.SpThroughFeignClientFallbackFactory;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
|
||||
/**
|
||||
* 高低电压穿越Feign客户端
|
||||
* @author guofeihu
|
||||
* @date 2024-08-22
|
||||
*/
|
||||
@FeignClient(
|
||||
value = ServerInfo.PREPARE_BOOT,//对应模块名
|
||||
path = "/spThrough",//对应controller请求类
|
||||
fallbackFactory = SpThroughFeignClientFallbackFactory.class//服务降级处理类
|
||||
)
|
||||
public interface SpThroughFeignClient {
|
||||
|
||||
@PostMapping("/record")
|
||||
HttpResult<Boolean> record();
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.njcn.prepare.harmonic.api.event.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.prepare.harmonic.api.event.RActivePowerRangeFeignClient;
|
||||
import com.njcn.prepare.harmonic.utils.PrepareEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 有功功率趋势熔断降级
|
||||
* @author guofeihu
|
||||
* @date 2024-08-22
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class RActivePowerRangeFeignClientFallbackFactory implements FallbackFactory<RActivePowerRangeFeignClient> {
|
||||
|
||||
@Override
|
||||
public RActivePowerRangeFeignClient create(Throwable throwable) {
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException)throwable.getCause();
|
||||
exceptionEnum = PrepareEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new RActivePowerRangeFeignClient() {
|
||||
@Override
|
||||
public HttpResult<Boolean> record() {
|
||||
log.error("{}异常,降级处理,异常为:{}", "有功功率趋势记录: ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.njcn.prepare.harmonic.api.event.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.prepare.harmonic.api.event.SpThroughFeignClient;
|
||||
import com.njcn.prepare.harmonic.utils.PrepareEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 高低电压穿越熔断降级
|
||||
* @author guofeihu
|
||||
* @date 2024-08-22
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class SpThroughFeignClientFallbackFactory implements FallbackFactory<SpThroughFeignClient> {
|
||||
|
||||
@Override
|
||||
public SpThroughFeignClient create(Throwable throwable) {
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (throwable.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException)throwable.getCause();
|
||||
exceptionEnum = PrepareEnumUtil.getExceptionEnum(businessException.getResult());
|
||||
}
|
||||
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new SpThroughFeignClient() {
|
||||
@Override
|
||||
public HttpResult<Boolean> record() {
|
||||
log.error("{}异常,降级处理,异常为:{}", "高低电压穿越记录: ", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
package com.njcn.prepare.harmonic.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import java.time.LocalDate;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 有功功率趋势 实体类
|
||||
* @author guofeihu
|
||||
* @since 2024-08-20
|
||||
*/
|
||||
@Data
|
||||
@TableName("r_active_power_range")
|
||||
public class RActivePowerRangePO extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 监测点ID
|
||||
*/
|
||||
private String lineId;
|
||||
|
||||
/**
|
||||
* 日期(天)
|
||||
*/
|
||||
private LocalDate timeId;
|
||||
|
||||
/**
|
||||
* 0%~10%区间时间Json
|
||||
*/
|
||||
private String minsTime0;
|
||||
|
||||
/**
|
||||
* 0%~10%区间个数
|
||||
*/
|
||||
private Integer minsNum0;
|
||||
|
||||
/**
|
||||
* 0%~10%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot0;
|
||||
|
||||
/**
|
||||
* 10%~20%区间时间Json
|
||||
*/
|
||||
private String minsTime1;
|
||||
|
||||
/**
|
||||
* 10%~20%区间个数
|
||||
*/
|
||||
private Integer minsNum1;
|
||||
|
||||
/**
|
||||
* 10%~20%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot1;
|
||||
|
||||
/**
|
||||
* 20%~30%区间时间Json
|
||||
*/
|
||||
private String minsTime2;
|
||||
|
||||
/**
|
||||
* 20%~30%区间个数
|
||||
*/
|
||||
private Integer minsNum2;
|
||||
|
||||
/**
|
||||
* 20%~30%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot2;
|
||||
|
||||
/**
|
||||
* 30%~40%区间时间Json
|
||||
*/
|
||||
private String minsTime3;
|
||||
|
||||
/**
|
||||
* 30%~40%区间个数
|
||||
*/
|
||||
private Integer minsNum3;
|
||||
|
||||
/**
|
||||
* 30%~40%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot3;
|
||||
|
||||
/**
|
||||
* 40%~50%区间时间Json
|
||||
*/
|
||||
private String minsTime4;
|
||||
|
||||
/**
|
||||
* 40%~50%区间个数
|
||||
*/
|
||||
private Integer minsNum4;
|
||||
|
||||
/**
|
||||
* 40%~50%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot4;
|
||||
|
||||
/**
|
||||
* 50%~60%区间时间Json
|
||||
*/
|
||||
private String minsTime5;
|
||||
|
||||
/**
|
||||
* 50%~60%区间个数
|
||||
*/
|
||||
private Integer minsNum5;
|
||||
|
||||
/**
|
||||
* 50%~60%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot5;
|
||||
|
||||
/**
|
||||
* 60%~70%区间时间Json
|
||||
*/
|
||||
private String minsTime6;
|
||||
|
||||
/**
|
||||
* 60%~70%区间个数
|
||||
*/
|
||||
private Integer minsNum6;
|
||||
|
||||
/**
|
||||
* 60%~70%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot6;
|
||||
|
||||
/**
|
||||
* 70%~80%区间时间Json
|
||||
*/
|
||||
private String minsTime7;
|
||||
|
||||
/**
|
||||
* 70%~80%区间个数
|
||||
*/
|
||||
private Integer minsNum7;
|
||||
|
||||
/**
|
||||
* 70%~80%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot7;
|
||||
|
||||
/**
|
||||
* 80%~90%区间时间Json
|
||||
*/
|
||||
private String minsTime8;
|
||||
|
||||
/**
|
||||
* 80%~90%区间个数
|
||||
*/
|
||||
private Integer minsNum8;
|
||||
|
||||
/**
|
||||
* 80%~90%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot8;
|
||||
|
||||
/**
|
||||
* 90%~100%区间时间Json
|
||||
*/
|
||||
private String minsTime9;
|
||||
|
||||
/**
|
||||
* 90%~100%区间个数
|
||||
*/
|
||||
private Integer minsNum9;
|
||||
|
||||
/**
|
||||
* 90%~100%区间是否越限
|
||||
*/
|
||||
private Integer isOrNot9;
|
||||
|
||||
/**
|
||||
* 状态:0-删除 1-正常
|
||||
*/
|
||||
private Integer state;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.njcn.prepare.harmonic.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 高低电压穿越 实体类
|
||||
* @author guofeihu
|
||||
* @since 2024-08-22
|
||||
*/
|
||||
@Data
|
||||
@TableName("sp_through")
|
||||
public class SpThroughPO 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;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.njcn.prepare.harmonic.controller.event;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.prepare.harmonic.pojo.po.RActivePowerRangePO;
|
||||
import com.njcn.prepare.harmonic.service.mysql.event.RActivePowerRangeService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 有功功率趋势 前端控制器
|
||||
* @author guofeihu
|
||||
* @date 2024/8/21
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/rActivePowerRange")
|
||||
@Api(tags = "有功功率趋势")
|
||||
@AllArgsConstructor
|
||||
public class RActivePowerRangeController extends BaseController {
|
||||
|
||||
private final RActivePowerRangeService rActivePowerRangeService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/record")
|
||||
@ApiOperation("有功功率趋势记录(用于定时任务)")
|
||||
public HttpResult<Boolean> record() {
|
||||
String methodDescribe = getMethodDescribe("record");
|
||||
rActivePowerRangeService.record();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getDataByLineIds")
|
||||
@ApiOperation("根据监测点ID集合获取有功功率趋势信息")
|
||||
public HttpResult<List<RActivePowerRangePO>> getDataByLineIds(@RequestBody List<String> lineIds) {
|
||||
String methodDescribe = getMethodDescribe("getDataByLineIds");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rActivePowerRangeService.getDataByLineIds(lineIds), methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.njcn.prepare.harmonic.controller.event;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.OperateType;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.prepare.harmonic.pojo.po.SpThroughPO;
|
||||
import com.njcn.prepare.harmonic.service.mysql.event.SpThroughService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 高低电压穿越 前端控制器
|
||||
* @author guofeihu
|
||||
* @date 2024/8/21
|
||||
*/
|
||||
@Validated
|
||||
@Slf4j
|
||||
@RestController
|
||||
@RequestMapping("/spThrough")
|
||||
@Api(tags = "高低电压穿越")
|
||||
@AllArgsConstructor
|
||||
public class SpThroughController extends BaseController {
|
||||
|
||||
private final SpThroughService spThroughService;
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.ADD)
|
||||
@PostMapping("/record")
|
||||
@ApiOperation("高低电压穿越记录(用于定时任务)")
|
||||
public HttpResult<Boolean> record() {
|
||||
String methodDescribe = getMethodDescribe("record");
|
||||
spThroughService.record();
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType = OperateType.QUERY)
|
||||
@PostMapping("/getDataByLineIds")
|
||||
@ApiOperation("根据监测点ID集合获取高低电压穿越信息")
|
||||
public HttpResult<List<SpThroughPO>> getDataByLineIds(@RequestBody List<String> lineIds) {
|
||||
String methodDescribe = getMethodDescribe("getDataByLineIds");
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, spThroughService.getDataByLineIds(lineIds), methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.njcn.prepare.harmonic.mapper.mysql.event;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.prepare.harmonic.pojo.po.RActivePowerRangePO;
|
||||
|
||||
/**
|
||||
* 有功功率趋势 Mapper 接口
|
||||
* @author guofeihu
|
||||
* @since 2024-08-20
|
||||
*/
|
||||
public interface RActivePowerRangeMapper extends MppBaseMapper<RActivePowerRangePO> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.njcn.prepare.harmonic.mapper.mysql.event;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.base.MppBaseMapper;
|
||||
import com.njcn.prepare.harmonic.pojo.po.SpThroughPO;
|
||||
|
||||
/**
|
||||
* 高低电压穿越 Mapper 接口
|
||||
* @author guofeihu
|
||||
* @since 2024-08-22
|
||||
*/
|
||||
public interface SpThroughMapper extends MppBaseMapper<SpThroughPO> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.prepare.harmonic.mapper.mysql.event.RActivePowerRangeMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="com.njcn.prepare.harmonic.pojo.po.RActivePowerRangePO">
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="line_id" jdbcType="VARCHAR" property="lineId" />
|
||||
<result column="time_id" jdbcType="DATE" property="timeId"/>
|
||||
<result column="mins_time0" jdbcType="VARCHAR" property="minsTime0" />
|
||||
<result column="mins_num0" jdbcType="INTEGER" property="minsNum0" />
|
||||
<result column="is_or_not0" jdbcType="INTEGER" property="isOrNot0" />
|
||||
<result column="mins_time1" jdbcType="VARCHAR" property="minsTime1" />
|
||||
<result column="mins_num1" jdbcType="INTEGER" property="minsNum1" />
|
||||
<result column="is_or_not1" jdbcType="INTEGER" property="isOrNot1" />
|
||||
<result column="mins_time2" jdbcType="VARCHAR" property="minsTime2" />
|
||||
<result column="mins_num2" jdbcType="INTEGER" property="minsNum2" />
|
||||
<result column="is_or_not2" jdbcType="INTEGER" property="isOrNot2" />
|
||||
<result column="mins_time3" jdbcType="VARCHAR" property="minsTime3" />
|
||||
<result column="mins_num3" jdbcType="INTEGER" property="minsNum3" />
|
||||
<result column="is_or_not3" jdbcType="INTEGER" property="isOrNot3" />
|
||||
<result column="mins_time4" jdbcType="VARCHAR" property="minsTime4" />
|
||||
<result column="mins_num4" jdbcType="INTEGER" property="minsNum4" />
|
||||
<result column="is_or_not4" jdbcType="INTEGER" property="isOrNot4" />
|
||||
<result column="mins_time5" jdbcType="VARCHAR" property="minsTime5" />
|
||||
<result column="mins_num5" jdbcType="INTEGER" property="minsNum5" />
|
||||
<result column="is_or_not5" jdbcType="INTEGER" property="isOrNot5" />
|
||||
<result column="mins_time6" jdbcType="VARCHAR" property="minsTime6" />
|
||||
<result column="mins_num6" jdbcType="INTEGER" property="minsNum6" />
|
||||
<result column="is_or_not6" jdbcType="INTEGER" property="isOrNot6" />
|
||||
<result column="mins_time7" jdbcType="VARCHAR" property="minsTime7" />
|
||||
<result column="mins_num7" jdbcType="INTEGER" property="minsNum7" />
|
||||
<result column="is_or_not7" jdbcType="INTEGER" property="isOrNot7" />
|
||||
<result column="mins_time8" jdbcType="VARCHAR" property="minsTime8" />
|
||||
<result column="mins_num8" jdbcType="INTEGER" property="minsNum8" />
|
||||
<result column="is_or_not8" jdbcType="INTEGER" property="isOrNot8" />
|
||||
<result column="mins_time9" jdbcType="VARCHAR" property="minsTime9" />
|
||||
<result column="mins_num9" jdbcType="INTEGER" property="minsNum9" />
|
||||
<result column="is_or_not9" jdbcType="INTEGER" property="isOrNot9" />
|
||||
<result column="state" jdbcType="INTEGER" property="state" />
|
||||
</resultMap>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.prepare.harmonic.mapper.mysql.event.SpThroughMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.njcn.prepare.harmonic.service.mysql.Impl.event;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.prepare.harmonic.mapper.mysql.event.RActivePowerRangeMapper;
|
||||
import com.njcn.prepare.harmonic.pojo.po.RActivePowerRangePO;
|
||||
import com.njcn.prepare.harmonic.service.mysql.event.RActivePowerRangeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 有功功率趋势 服务实现类
|
||||
* @author guofeihu
|
||||
* @since 2024-08-22
|
||||
*/
|
||||
@Service
|
||||
public class RActivePowerRangeServiceImpl extends MppServiceImpl<RActivePowerRangeMapper, RActivePowerRangePO> implements RActivePowerRangeService {
|
||||
|
||||
@Override
|
||||
public void record() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RActivePowerRangePO> getDataByLineIds(List<String> lineIds) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.njcn.prepare.harmonic.service.mysql.Impl.event;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
import com.njcn.prepare.harmonic.mapper.mysql.event.SpThroughMapper;
|
||||
import com.njcn.prepare.harmonic.pojo.po.SpThroughPO;
|
||||
import com.njcn.prepare.harmonic.service.mysql.event.SpThroughService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 高低电压穿越 服务实现类
|
||||
* @author guofeihu
|
||||
* @since 2024-08-22
|
||||
*/
|
||||
@Service
|
||||
public class SpThroughServiceImpl extends MppServiceImpl<SpThroughMapper, SpThroughPO> implements SpThroughService {
|
||||
|
||||
@Override
|
||||
public void record() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SpThroughPO> getDataByLineIds(List<String> lineIds) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.prepare.harmonic.service.mysql.event;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.prepare.harmonic.pojo.po.RActivePowerRangePO;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 有功功率趋势 服务类
|
||||
* @author guofeihu
|
||||
* @since 2024-08-22
|
||||
*/
|
||||
public interface RActivePowerRangeService extends IMppService<RActivePowerRangePO> {
|
||||
|
||||
/**
|
||||
* 有功功率趋势记录(用于定时任务)
|
||||
*/
|
||||
void record();
|
||||
|
||||
/**
|
||||
* 根据监测点ID集合获取有功功率趋势信息
|
||||
*/
|
||||
List<RActivePowerRangePO> getDataByLineIds(List<String> lineIds);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.prepare.harmonic.service.mysql.event;
|
||||
|
||||
import com.github.jeffreyning.mybatisplus.service.IMppService;
|
||||
import com.njcn.prepare.harmonic.pojo.po.SpThroughPO;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 高低电压穿越 服务类
|
||||
* @author guofeihu
|
||||
* @since 2024-08-22
|
||||
*/
|
||||
public interface SpThroughService extends IMppService<SpThroughPO> {
|
||||
|
||||
/**
|
||||
* 高低电压穿越记录(用于定时任务)
|
||||
*/
|
||||
void record();
|
||||
|
||||
/**
|
||||
* 根据监测点ID集合获取高低电压穿越信息
|
||||
*/
|
||||
List<SpThroughPO> getDataByLineIds(List<String> lineIds);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import com.njcn.prepare.harmonic.api.event.RActivePowerRangeFeignClient;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 有功功率趋势算法执行定时任务
|
||||
* @author guofeihu
|
||||
* @date 2024/8/21
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class RActivePowerRangeTaskRunner implements TimerTaskRunner {
|
||||
|
||||
private final RActivePowerRangeFeignClient rActivePowerRangeFeignClient;
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
rActivePowerRangeFeignClient.record();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import com.njcn.prepare.harmonic.api.event.SpThroughFeignClient;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 高低电压穿越算法执行定时任务
|
||||
* @author guofeihu
|
||||
* @date 2024/8/21
|
||||
*/
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class SpThroughTaskRunner implements TimerTaskRunner {
|
||||
|
||||
private final SpThroughFeignClient spThroughFeignClient;
|
||||
|
||||
@Override
|
||||
public void action(String date) {
|
||||
spThroughFeignClient.record();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user