1.定时任务重试代码提交
2.pmsbug修改
This commit is contained in:
@@ -34,13 +34,13 @@ public class GwMonitorPushClientFallbackFactory implements FallbackFactory<GwMon
|
||||
@Override
|
||||
public HttpResult<String> timeTaskPushMonitor(List<String> ids) {
|
||||
log.error("{}异常,降级处理,异常为:{}", LocalDate.now()+"定时推送主网监测点", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
return new HttpResult<>(CommonResponseEnum.FAIL.getCode(),CommonResponseEnum.FAIL.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Object> pushMonitorOverLimit(List<String> ids) {
|
||||
log.error("{}异常,降级处理,异常为:{}", LocalDate.now()+"定时推送主网监测点限值", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
return new HttpResult<>(CommonResponseEnum.FAIL.getCode(),CommonResponseEnum.FAIL.getMessage());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class MonitorSendClientFallbackFactory implements FallbackFactory<Monitor
|
||||
@Override
|
||||
public HttpResult<String> windSend(MonitorParam.Info param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "国网五类台账上送接口", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
return new HttpResult<>(CommonResponseEnum.FAIL.getCode(),CommonResponseEnum.FAIL.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -20,123 +20,45 @@
|
||||
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
b.Monitor_Sort,
|
||||
b.Created_Date
|
||||
FROM
|
||||
(
|
||||
( SELECT id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_client
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND STATUS = 1
|
||||
</where>
|
||||
) UNION ALL
|
||||
( SELECT id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_generation_user
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND STATUS = 1
|
||||
</where>
|
||||
) UNION ALL
|
||||
( SELECT id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_distributionarea
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND STATUS = 1
|
||||
</where>
|
||||
|
||||
) UNION ALL
|
||||
( SELECT id, Operation_Id, Powerr_Id, Line_Id FROM pms_monitor
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND STATUS = 1
|
||||
</where>
|
||||
|
||||
)
|
||||
) t
|
||||
INNER JOIN pms_distribution_monitor b ON t.id = b.Monitor_Id
|
||||
|
||||
)t
|
||||
|
||||
GROUP BY t.Monitor_Sort,yy,mm
|
||||
SELECT
|
||||
b.Monitor_Sort,
|
||||
b.Created_Date
|
||||
FROM
|
||||
pms_distribution_monitor b
|
||||
<where>
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND STATUS = 1
|
||||
</where>
|
||||
)t
|
||||
GROUP BY t.Monitor_Sort,yy,mm
|
||||
) ta
|
||||
-- 同比:上年同月
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
t.Monitor_Sort,
|
||||
year(t.Created_Date) as yy,
|
||||
month(t.Created_Date) as mm,
|
||||
COUNT(*) as num
|
||||
|
||||
FROM (
|
||||
SELECT
|
||||
b.Monitor_Sort,
|
||||
b.Created_Date
|
||||
SELECT
|
||||
t.Monitor_Sort,
|
||||
year(t.Created_Date) as yy,
|
||||
month(t.Created_Date) as mm,
|
||||
COUNT(*) as num
|
||||
FROM
|
||||
(
|
||||
( SELECT id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_client
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND STATUS = 1
|
||||
</where>
|
||||
) UNION ALL
|
||||
( SELECT id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_generation_user
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND STATUS = 1
|
||||
</where>
|
||||
) UNION ALL
|
||||
( SELECT id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_distributionarea
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND STATUS = 1
|
||||
</where>
|
||||
|
||||
) UNION ALL
|
||||
( SELECT id, Operation_Id, Powerr_Id, Line_Id FROM pms_monitor
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND STATUS = 1
|
||||
</where>
|
||||
|
||||
)
|
||||
) t
|
||||
INNER JOIN pms_distribution_monitor b ON t.id = b.Monitor_Id
|
||||
|
||||
SELECT
|
||||
b.Monitor_Sort,
|
||||
b.Created_Date
|
||||
FROM
|
||||
pms_distribution_monitor b
|
||||
<where>
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND STATUS = 1
|
||||
</where>
|
||||
)t
|
||||
|
||||
GROUP BY t.Monitor_Sort,yy,mm
|
||||
) tb
|
||||
GROUP BY t.Monitor_Sort,yy,mm
|
||||
) tb
|
||||
ON tb.mm = ta.mm and tb.yy = ta.yy-1 and tb.Monitor_Sort = ta.Monitor_Sort
|
||||
|
||||
-- 环比:上月
|
||||
@@ -146,66 +68,26 @@
|
||||
year(t.Created_Date) as yy,
|
||||
month(t.Created_Date) as mm,
|
||||
COUNT(*) as num
|
||||
|
||||
FROM (
|
||||
SELECT
|
||||
b.Monitor_Sort,
|
||||
b.Created_Date
|
||||
FROM
|
||||
(
|
||||
( SELECT id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_client
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND STATUS = 1
|
||||
</where>
|
||||
) UNION ALL
|
||||
( SELECT id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_generation_user
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND STATUS = 1
|
||||
</where>
|
||||
) UNION ALL
|
||||
( SELECT id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_distributionarea
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND STATUS = 1
|
||||
</where>
|
||||
|
||||
) UNION ALL
|
||||
( SELECT id, Operation_Id, Powerr_Id, Line_Id FROM pms_monitor
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND STATUS = 1
|
||||
</where>
|
||||
|
||||
)
|
||||
) t
|
||||
INNER JOIN pms_distribution_monitor b ON t.id = b.Monitor_Id
|
||||
|
||||
)t
|
||||
|
||||
GROUP BY t.Monitor_Sort,yy,mm
|
||||
) tc
|
||||
ON ( (tc.yy = ta.yy and tc.mm = ta.mm - 1 and tc.Monitor_Sort = ta.Monitor_Sort)
|
||||
OR
|
||||
(tc.yy=ta.yy - 1 AND tc.mm = 12 AND ta.mm = 1 and tc.Monitor_Sort = ta.Monitor_Sort)
|
||||
)
|
||||
SELECT
|
||||
b.Monitor_Sort,
|
||||
b.Created_Date
|
||||
FROM
|
||||
pms_distribution_monitor b
|
||||
<where>
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND STATUS = 1
|
||||
</where>
|
||||
)t
|
||||
GROUP BY t.Monitor_Sort,yy,mm
|
||||
) tc
|
||||
ON ( (tc.yy = ta.yy and tc.mm = ta.mm - 1 and tc.Monitor_Sort = ta.Monitor_Sort)
|
||||
OR
|
||||
(tc.yy=ta.yy - 1 AND tc.mm = 12 AND ta.mm = 1 and tc.Monitor_Sort = ta.Monitor_Sort)
|
||||
)
|
||||
|
||||
<where>
|
||||
<if test="param.year != null and param.year!=''">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.njcn.device.pms.service.majornetwork.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
@@ -113,15 +114,15 @@ public class RMpDevEvaluateDetailServiceImpl extends ServiceImpl<RMpDevEvaluateD
|
||||
//终端有效接入率
|
||||
double devEffectiveRate = list.stream().filter(item -> terminalMap.get(item.getDeviceId()).getOrgId().equals(key))
|
||||
.mapToDouble(RMpDevEvaluateDetail::getDevEffectiveRate).average().orElse(0);
|
||||
rMpDevEvaluateDetailVO.setDevEffectiveRate(devEffectiveRate);
|
||||
rMpDevEvaluateDetailVO.setDevEffectiveRate(NumberUtil.round(devEffectiveRate,2).doubleValue());
|
||||
//终端指标完整率
|
||||
double devTargetRate = list.stream().filter(item -> terminalMap.get(item.getDeviceId()).getOrgId().equals(key))
|
||||
.mapToDouble(RMpDevEvaluateDetail::getDevTargetRate).average().orElse(0);
|
||||
rMpDevEvaluateDetailVO.setDevTargetRate(devTargetRate);
|
||||
rMpDevEvaluateDetailVO.setDevTargetRate(NumberUtil.round(devTargetRate,2).doubleValue());
|
||||
//终端数据完整率
|
||||
double devDataRate = list.stream().filter(item -> terminalMap.get(item.getDeviceId()).getOrgId().equals(key))
|
||||
.mapToDouble(RMpDevEvaluateDetail::getDevDataRate).average().orElse(0);
|
||||
rMpDevEvaluateDetailVO.setDevDataRate(devDataRate);
|
||||
rMpDevEvaluateDetailVO.setDevDataRate(NumberUtil.round(devDataRate,2).doubleValue());
|
||||
//综合评价
|
||||
rMpDevEvaluateDetailVO.setAssessment(Double.parseDouble(df.format((devEffectiveRate + devTargetRate + devDataRate) / 3.0)));
|
||||
|
||||
@@ -187,15 +188,15 @@ public class RMpDevEvaluateDetailServiceImpl extends ServiceImpl<RMpDevEvaluateD
|
||||
//终端有效接入率
|
||||
double devEffectiveRate = list.stream().filter(item -> terminalMap.get(item.getDeviceId()).getManufacture().equals(key))
|
||||
.mapToDouble(RMpDevEvaluateDetail::getDevEffectiveRate).average().orElse(0);
|
||||
rMpDevEvaluateDetailVO.setDevEffectiveRate(devEffectiveRate);
|
||||
rMpDevEvaluateDetailVO.setDevEffectiveRate(NumberUtil.round(devEffectiveRate,2).doubleValue());
|
||||
//终端指标完整率
|
||||
double devTargetRate = list.stream().filter(item -> terminalMap.get(item.getDeviceId()).getManufacture().equals(key))
|
||||
.mapToDouble(RMpDevEvaluateDetail::getDevTargetRate).average().orElse(0);
|
||||
rMpDevEvaluateDetailVO.setDevTargetRate(devTargetRate);
|
||||
rMpDevEvaluateDetailVO.setDevTargetRate(NumberUtil.round(devTargetRate,2).doubleValue());
|
||||
//终端数据完整率
|
||||
double devDataRate = list.stream().filter(item -> terminalMap.get(item.getDeviceId()).getManufacture().equals(key))
|
||||
.mapToDouble(RMpDevEvaluateDetail::getDevDataRate).average().orElse(0);
|
||||
rMpDevEvaluateDetailVO.setDevDataRate(devDataRate);
|
||||
rMpDevEvaluateDetailVO.setDevDataRate(NumberUtil.round(devDataRate,2).doubleValue());
|
||||
//综合评价
|
||||
rMpDevEvaluateDetailVO.setAssessment(Double.parseDouble(df.format((devEffectiveRate + devTargetRate + devDataRate) / 3.0)));
|
||||
|
||||
@@ -256,15 +257,15 @@ public class RMpDevEvaluateDetailServiceImpl extends ServiceImpl<RMpDevEvaluateD
|
||||
//终端有效接入率
|
||||
double devEffectiveRate = list.stream().filter(item -> terminalMap.get(item.getDeviceId()).getDeviceModel().equals(key))
|
||||
.mapToDouble(RMpDevEvaluateDetail::getDevEffectiveRate).average().orElse(0);
|
||||
rMpDevEvaluateDetailVO.setDevEffectiveRate(devEffectiveRate);
|
||||
rMpDevEvaluateDetailVO.setDevEffectiveRate(NumberUtil.round(devEffectiveRate,2).doubleValue());
|
||||
//终端指标完整率
|
||||
double devTargetRate = list.stream().filter(item -> terminalMap.get(item.getDeviceId()).getDeviceModel().equals(key))
|
||||
.mapToDouble(RMpDevEvaluateDetail::getDevTargetRate).average().orElse(0);
|
||||
rMpDevEvaluateDetailVO.setDevTargetRate(devTargetRate);
|
||||
rMpDevEvaluateDetailVO.setDevTargetRate(NumberUtil.round(devTargetRate,2).doubleValue());
|
||||
//终端数据完整率
|
||||
double devDataRate = list.stream().filter(item -> terminalMap.get(item.getDeviceId()).getDeviceModel().equals(key))
|
||||
.mapToDouble(RMpDevEvaluateDetail::getDevDataRate).average().orElse(0);
|
||||
rMpDevEvaluateDetailVO.setDevDataRate(devDataRate);
|
||||
rMpDevEvaluateDetailVO.setDevDataRate(NumberUtil.round(devDataRate,2).doubleValue());
|
||||
//综合评价
|
||||
rMpDevEvaluateDetailVO.setAssessment(Double.parseDouble(df.format((devEffectiveRate + devTargetRate + devDataRate) / 3.0)));
|
||||
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
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.DeviceTreeClientFallbackFactory;
|
||||
import com.njcn.device.pq.api.fallback.LineIntegrityClientFallbackFactory;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.device.pq.pojo.vo.AlarmStrategyVO;
|
||||
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 springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -31,4 +36,14 @@ public interface LineIntegrityClient {
|
||||
*/
|
||||
@PostMapping("/getIntegrityByLineIds")
|
||||
HttpResult<List<RStatIntegrityD>> getIntegrityByLineIds(@RequestBody List<String> lineIds, @RequestParam("startTime")String startTime, @RequestParam("endTime")String endTime);
|
||||
|
||||
/**
|
||||
* @Description: 通过监测点集合查询总监测点数据完整性
|
||||
* @param param
|
||||
* @return: com.njcn.common.pojo.response.HttpResult<java.lang.Float>
|
||||
* @Author: wr
|
||||
* @Date: 2024/1/8 14:06
|
||||
*/
|
||||
@PostMapping("/getTotalIntegrityByLineIds")
|
||||
HttpResult<Float> getTotalIntegrityByLineIds(@RequestBody LineBaseQueryParam param);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import com.njcn.device.pq.api.AlarmClient;
|
||||
import com.njcn.device.pq.api.LineIntegrityClient;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.device.pq.pojo.vo.AlarmStrategyVO;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
@@ -39,6 +40,12 @@ public class LineIntegrityClientFallbackFactory implements FallbackFactory<LineI
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Float> getTotalIntegrityByLineIds(LineBaseQueryParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "通过监测点集合查询总监测点数据完整性", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pq.pojo.param.DeviceInfoParam;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.param.LineIntegrityDataParam;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.device.pq.pojo.vo.LineIntegrityDataVO;
|
||||
@@ -101,4 +102,18 @@ public class LineIntegrityDataController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,integrityDataOfLine,methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 通过监测点集合查询总监测点数据完整性
|
||||
* @param param
|
||||
* @Author: wr
|
||||
* @Date: 2024/1/8 13:58
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getTotalIntegrityByLineIds")
|
||||
@ApiOperation("通过监测点集合查询总监测点数据完整性")
|
||||
public HttpResult<Float> getTotalIntegrityByLineIds(@RequestBody LineBaseQueryParam param) {
|
||||
String methodDescribe = getMethodDescribe("getTotalIntegrityByLineIds");
|
||||
Float integrity = irStatIntegrityDService.getTotalIntegrityByLineIds(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, integrity, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,4 +39,13 @@ public interface RStatIntegrityDMapper extends BaseMapper<RStatIntegrityD> {
|
||||
List<RStatIntegrityVO> getOnIntegrityByIds(@Param("param") OnlineRateParam param);
|
||||
|
||||
List<RStatIntegrityVO> getOnIntegrityByIdsAndTime (@Param("list")List<String> lineIds,@Param("startTime")String startTime,@Param("endTime")String endTime);
|
||||
|
||||
/**
|
||||
* @Description: 通过监测点集合查询总监测点数据完整性
|
||||
* @param param
|
||||
* @return: java.lang.Float
|
||||
* @Author: wr
|
||||
* @Date: 2024/1/8 14:01
|
||||
*/
|
||||
Float selectTotalIntegrityByLineIds(@Param("param") LineBaseQueryParam param);
|
||||
}
|
||||
|
||||
@@ -63,4 +63,24 @@
|
||||
</where>
|
||||
group by line_index ;
|
||||
</select>
|
||||
<select id="selectTotalIntegrityByLineIds" resultType="java.lang.Float">
|
||||
select
|
||||
ROUND( sum(real_time)/sum(due_time)*100,2) as integrityRate
|
||||
from
|
||||
r_stat_integrity_d
|
||||
<where>
|
||||
<if test="param!=null and param.lineIds != null and param.ids.lineIds > 0">
|
||||
AND line_index IN
|
||||
<foreach collection='param.lineIds' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test=" param.startTime != null and param.startTime !=''">
|
||||
AND time_id >= #{param.startTime}
|
||||
</if>
|
||||
<if test="param.endTime != null and param.endTime != ''">
|
||||
AND time_id <= #{param.endTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.device.pq.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
|
||||
/**
|
||||
@@ -14,6 +15,11 @@ import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
*/
|
||||
public interface IRStatIntegrityDService extends IService<RStatIntegrityD> {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 通过监测点集合查询总监测点数据完整性
|
||||
* @param param
|
||||
* @Author: wr
|
||||
* @Date: 2024/1/8 13:59
|
||||
*/
|
||||
Float getTotalIntegrityByLineIds(LineBaseQueryParam param);
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.device.pq.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.device.pq.mapper.RStatIntegrityDMapper;
|
||||
import com.njcn.device.pq.pojo.param.LineBaseQueryParam;
|
||||
import com.njcn.device.pq.pojo.po.RStatIntegrityD;
|
||||
import com.njcn.device.pq.service.IRStatIntegrityDService;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -18,4 +19,8 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class RStatIntegrityDServiceImpl extends ServiceImpl<RStatIntegrityDMapper, RStatIntegrityD> implements IRStatIntegrityDService {
|
||||
|
||||
@Override
|
||||
public Float getTotalIntegrityByLineIds(LineBaseQueryParam param) {
|
||||
return this.baseMapper.selectTotalIntegrityByLineIds(param);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class PqTypicalSourceFallbackFactory implements FallbackFactory<PqTypical
|
||||
@Override
|
||||
public HttpResult<String> send(UploadParam uploadParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "国网上送-典型源荷指标统计数据", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
return new HttpResult<>(CommonResponseEnum.FAIL.getCode(),CommonResponseEnum.FAIL.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -31,19 +31,19 @@ public class UploadGwDataFallbackFactory implements FallbackFactory<UploadGwData
|
||||
@Override
|
||||
public HttpResult<String> uploadPointStatisticalData(UploadParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "国网上送-主配网监测点统计数据", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
return new HttpResult<>(CommonResponseEnum.FAIL.getCode(),CommonResponseEnum.FAIL.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> uploadSubstationStatisticalData(UploadParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "国网上送-变电站监测统计数据", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
return new HttpResult<>(CommonResponseEnum.FAIL.getCode(),CommonResponseEnum.FAIL.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<String> uploadEvaluationData(UploadParam param) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "国网上送-母线基准水平评估数据", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
return new HttpResult<>(CommonResponseEnum.FAIL.getCode(),CommonResponseEnum.FAIL.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -24,25 +25,25 @@ public class RStatOrgPvVO implements Serializable {
|
||||
* 潮流倒送
|
||||
*/
|
||||
@ApiModelProperty(name = "flowReversal", value = "潮流倒送")
|
||||
private List<FlowReversal> flowReversal;
|
||||
private List<FlowReversal> flowReversal=new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 电压越限
|
||||
*/
|
||||
@ApiModelProperty(name = "voltageOutOfLimit", value = "电压越限")
|
||||
private List<VoltageOutOfLimit> voltageOutOfLimit;
|
||||
private List<VoltageOutOfLimit> voltageOutOfLimit=new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 光伏渗透率
|
||||
*/
|
||||
@ApiModelProperty(name = "pvPermeability", value = "光伏渗透率")
|
||||
private List<PvPermeability> pvPermeability;
|
||||
private List<PvPermeability> pvPermeability=new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 低功率因素
|
||||
*/
|
||||
@ApiModelProperty(name = "lowPowerFactor", value = "低功率因素")
|
||||
private List<LowPowerFactor> lowPowerFactor;
|
||||
private List<LowPowerFactor> lowPowerFactor=new ArrayList<>();
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
||||
@@ -166,7 +166,9 @@ public class TimersServiceImpl extends ServiceImpl<TimersMapper, Timers> impleme
|
||||
int retryCount = 0; // 重试次数计数器
|
||||
while (retryCount < maxRetryCount) {
|
||||
try {
|
||||
System.out.println("重试机制:"+(retryCount+1));
|
||||
timerTaskRunner.action();
|
||||
System.out.println("成功重试机制:"+(retryCount+1));
|
||||
return; // 任务执行成功,跳出循环
|
||||
} catch (Exception e) {
|
||||
// 处理异常
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.api.MonitorSendClient;
|
||||
import com.njcn.device.pms.pojo.param.MonitorParam;
|
||||
import com.njcn.system.service.SysDicTreePOService;
|
||||
@@ -25,6 +26,9 @@ public class MonitorSendOtherUserTaskRunner implements TimerTaskRunner {
|
||||
MonitorParam.Info param4 = new MonitorParam.Info();
|
||||
param4.setObjType(sysDicTreePOService.queryByCode("2300").getId());
|
||||
param4.setFiy(true);
|
||||
monitorSendClient.windSend(param4);
|
||||
String code = monitorSendClient.windSend(param4).getCode();
|
||||
if(code.equals("A0002")){
|
||||
throw new BusinessException("失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.api.MonitorSendClient;
|
||||
import com.njcn.device.pms.pojo.param.MonitorParam;
|
||||
import com.njcn.system.service.SysDicTreePOService;
|
||||
@@ -25,6 +26,9 @@ public class MonitorSendPhotovoltaicTaskRunner implements TimerTaskRunner {
|
||||
MonitorParam.Info param1 = new MonitorParam.Info();
|
||||
param1.setObjType(sysDicTreePOService.queryByCode("1402").getId());
|
||||
param1.setFiy(true);
|
||||
monitorSendClient.windSend(param1);
|
||||
String code = monitorSendClient.windSend(param1).getCode();
|
||||
if(code.equals("A0002")){
|
||||
throw new BusinessException("失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.api.MonitorSendClient;
|
||||
import com.njcn.device.pms.pojo.param.MonitorParam;
|
||||
import com.njcn.system.service.SysDicTreePOService;
|
||||
@@ -25,6 +26,9 @@ public class MonitorSendTaskRunner implements TimerTaskRunner {
|
||||
MonitorParam.Info param = new MonitorParam.Info();
|
||||
param.setObjType(sysDicTreePOService.queryByCode("1401").getId());
|
||||
param.setFiy(true);
|
||||
monitorSendClient.windSend(param);
|
||||
String code = monitorSendClient.windSend(param).getCode();
|
||||
if(code.equals("A0002")){
|
||||
throw new BusinessException("失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.api.MonitorSendClient;
|
||||
import com.njcn.device.pms.pojo.param.MonitorParam;
|
||||
import com.njcn.system.service.SysDicTreePOService;
|
||||
@@ -25,6 +26,9 @@ public class MonitorSendTractionStationTaskRunner implements TimerTaskRunner {
|
||||
MonitorParam.Info param3 = new MonitorParam.Info();
|
||||
param3.setObjType(sysDicTreePOService.queryByCode("1300").getId());
|
||||
param3.setFiy(true);
|
||||
monitorSendClient.windSend(param3);
|
||||
String code = monitorSendClient.windSend(param3).getCode();
|
||||
if(code.equals("A0002")){
|
||||
throw new BusinessException("失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.api.MonitorSendClient;
|
||||
import com.njcn.device.pms.pojo.param.MonitorParam;
|
||||
import com.njcn.system.service.SysDicTreePOService;
|
||||
@@ -25,6 +26,9 @@ public class MonitorUserSendTaskRunner implements TimerTaskRunner {
|
||||
MonitorParam.Info param2 = new MonitorParam.Info();
|
||||
param2.setObjType(sysDicTreePOService.queryByCode("2400").getId());
|
||||
param2.setFiy(true);
|
||||
monitorSendClient.windSend(param2);
|
||||
String code = monitorSendClient.windSend(param2).getCode();
|
||||
if(code.equals("A0002")){
|
||||
throw new BusinessException("失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.api.GwMonitorPushFeignClient;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -20,6 +21,9 @@ public class PmsMonitorLimitSendTaskRunner implements TimerTaskRunner {
|
||||
|
||||
@Override
|
||||
public void action() {
|
||||
gwMonitorPushFeignClient.pushMonitorOverLimit(new ArrayList<>());
|
||||
String code = gwMonitorPushFeignClient.pushMonitorOverLimit(new ArrayList<>()).getCode();
|
||||
if(code.equals("A0002")){
|
||||
throw new BusinessException("失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.system.timer.tasks;
|
||||
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.pms.api.GwMonitorPushFeignClient;
|
||||
import com.njcn.device.pms.api.MonitorSendClient;
|
||||
import com.njcn.device.pms.pojo.param.MonitorParam;
|
||||
@@ -23,6 +24,9 @@ public class PmsMonitorSendTaskRunner implements TimerTaskRunner {
|
||||
|
||||
@Override
|
||||
public void action() {
|
||||
gwMonitorPushFeignClient.timeTaskPushMonitor(new ArrayList<>());
|
||||
String code = gwMonitorPushFeignClient.timeTaskPushMonitor(new ArrayList<>()).getCode();
|
||||
if(code.equals("A0002")){
|
||||
throw new BusinessException("失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.system.timer.tasks;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.harmonic.api.PqTypicalSourceFeignClient;
|
||||
import com.njcn.harmonic.pojo.param.UploadParam;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
@@ -24,6 +25,9 @@ public class PqTypicalSourceTaskRunner implements TimerTaskRunner {
|
||||
public void action() {
|
||||
UploadParam param=new UploadParam();
|
||||
param.setTime(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
||||
pqTypicalSourceFeignClient.send(param);
|
||||
String code = pqTypicalSourceFeignClient.send(param).getCode();
|
||||
if(code.equals("A0002")){
|
||||
throw new BusinessException("失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.system.timer.tasks;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.harmonic.api.UploadGwDataFeignClient;
|
||||
import com.njcn.harmonic.pojo.param.UploadParam;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
@@ -25,6 +26,9 @@ public class UploadGwTaskEvaluationRunner implements TimerTaskRunner {
|
||||
public void action() {
|
||||
UploadParam param = new UploadParam();
|
||||
param.setTime(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
||||
uploadGwDataFeignClient.uploadEvaluationData(param);
|
||||
String code = uploadGwDataFeignClient.uploadEvaluationData(param).getCode();
|
||||
if(code.equals("A0002")){
|
||||
throw new BusinessException("失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.system.timer.tasks;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.harmonic.api.UploadGwDataFeignClient;
|
||||
import com.njcn.harmonic.pojo.param.UploadParam;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
@@ -25,6 +26,9 @@ public class UploadGwTaskRunner implements TimerTaskRunner {
|
||||
public void action() {
|
||||
UploadParam param = new UploadParam();
|
||||
param.setTime(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
||||
uploadGwDataFeignClient.uploadPointStatisticalData(param);
|
||||
String code = uploadGwDataFeignClient.uploadPointStatisticalData(param).getCode();
|
||||
if(code.equals("A0002")){
|
||||
throw new BusinessException("失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.system.timer.tasks;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.harmonic.api.UploadGwDataFeignClient;
|
||||
import com.njcn.harmonic.pojo.param.UploadParam;
|
||||
import com.njcn.system.timer.TimerTaskRunner;
|
||||
@@ -25,6 +26,9 @@ public class UploadGwTaskSubstationRunner implements TimerTaskRunner {
|
||||
public void action() {
|
||||
UploadParam param = new UploadParam();
|
||||
param.setTime(DateUtil.yesterday().toString(DatePattern.NORM_DATE_PATTERN));
|
||||
uploadGwDataFeignClient.uploadSubstationStatisticalData(param);
|
||||
String code = uploadGwDataFeignClient.uploadSubstationStatisticalData(param).getCode();
|
||||
if(code.equals("A0002")){
|
||||
throw new BusinessException("失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ runTake:
|
||||
#最大重试次数
|
||||
maxRetryCount: 10
|
||||
#等待时间(毫秒)
|
||||
delayTime: 5000
|
||||
delayTime: 25000
|
||||
|
||||
mqtt:
|
||||
client-id: @artifactId@${random.value}
|
||||
|
||||
Reference in New Issue
Block a user