1.技术监督:国网上送接口修改
This commit is contained in:
@@ -108,10 +108,19 @@ public class StatisticsOfTransientIndicatorssServiceImpl implements StatisticsOf
|
||||
return Collections.emptyList();
|
||||
}
|
||||
for (RStatOrgVO rStatOrgVO : result) {
|
||||
rStatOrgVO.setEventMeasurementRatioAverage(String.valueOf(Double.parseDouble(
|
||||
df.format(((rStatOrgVO.getEventMeasurementAverage() * 1.0) / (rStatOrgVO.getEffectiveMeasurementAverage() * 1.0)) * 100))));
|
||||
rStatOrgVO.setEventMeasurementRatioAccrued(String.valueOf(Double.parseDouble(
|
||||
df.format(((rStatOrgVO.getEventMeasurementAccrued() * 1.0) / (rStatOrgVO.getEffectiveMeasurementAccrued() * 1.0)) * 100))));
|
||||
if(rStatOrgVO.getEventMeasurementAverage()!=0&&rStatOrgVO.getEffectiveMeasurementAverage()!=0){
|
||||
rStatOrgVO.setEventMeasurementRatioAverage(String.valueOf(Double.parseDouble(
|
||||
df.format(((rStatOrgVO.getEventMeasurementAverage() * 1.0) / (rStatOrgVO.getEffectiveMeasurementAverage() * 1.0)) * 100))));
|
||||
}else{
|
||||
rStatOrgVO.setEventMeasurementRatioAverage("0");
|
||||
}
|
||||
if(rStatOrgVO.getEventMeasurementAccrued()!=0&&rStatOrgVO.getEffectiveMeasurementAccrued()!=0){
|
||||
rStatOrgVO.setEventMeasurementRatioAccrued(String.valueOf(Double.parseDouble(
|
||||
df.format(((rStatOrgVO.getEventMeasurementAccrued() * 1.0) / (rStatOrgVO.getEffectiveMeasurementAccrued() * 1.0)) * 100))));
|
||||
}else{
|
||||
rStatOrgVO.setEventMeasurementRatioAccrued("0");
|
||||
}
|
||||
|
||||
}
|
||||
// 匹配单位名称
|
||||
Map<String, DeptDTO> deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, DeptDTO -> DeptDTO));
|
||||
@@ -186,8 +195,17 @@ public class StatisticsOfTransientIndicatorssServiceImpl implements StatisticsOf
|
||||
rStatEventOrgVO.setEffectiveMeasurementAccrued(pos.get(0).getEffectiveMeasurementAccrued());
|
||||
rStatEventOrgVO.setEventMeasurementAverage(pos.get(0).getEventMeasurementAverage());
|
||||
rStatEventOrgVO.setEventMeasurementAccrued(pos.get(0).getEventMeasurementAccrued());
|
||||
rStatEventOrgVO.setEventMeasurementRatioAverage(Double.parseDouble(df.format((pos.get(0).getEventMeasurementAverage() * 1.0) / (pos.get(0).getEffectiveMeasurementAverage() * 1.0))) * 100);
|
||||
rStatEventOrgVO.setEventMeasurementRatioAccrued(Double.parseDouble(df.format((pos.get(0).getEventMeasurementAccrued() * 1.0) / (pos.get(0).getEffectiveMeasurementAccrued() * 1.0))) * 100);
|
||||
|
||||
if(rStatEventOrgVO.getEventMeasurementAverage()!=0&&rStatEventOrgVO.getEffectiveMeasurementAverage()!=0){
|
||||
rStatEventOrgVO.setEventMeasurementRatioAverage(Double.parseDouble(df.format((pos.get(0).getEventMeasurementAverage() * 1.0) / (pos.get(0).getEffectiveMeasurementAverage() * 1.0))) * 100);
|
||||
}else{
|
||||
rStatEventOrgVO.setEventMeasurementRatioAverage(0.0);
|
||||
}
|
||||
if(rStatEventOrgVO.getEventMeasurementAccrued()!=0&&rStatEventOrgVO.getEffectiveMeasurementAccrued()!=0){
|
||||
rStatEventOrgVO.setEventMeasurementRatioAccrued(Double.parseDouble(df.format((pos.get(0).getEventMeasurementAccrued() * 1.0) / (pos.get(0).getEffectiveMeasurementAccrued() * 1.0))) * 100);
|
||||
}else{
|
||||
rStatEventOrgVO.setEventMeasurementRatioAccrued(0.0);
|
||||
}
|
||||
rStatEventOrgVO.setDataType(pos.get(0).getDataType());
|
||||
}
|
||||
// 暂态指标赋值
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.process.service.impl;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
@@ -177,7 +178,9 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
|
||||
|
||||
//TODO 调用国网接口
|
||||
// Map map = postStatsUrl(getUrl(1), null, supvPlanList);
|
||||
|
||||
JSONArray objects = new JSONArray(Collections.singletonList(supvPlanList));
|
||||
String s = objects.toString();
|
||||
log.info(Thread.currentThread().getName() + "获取返回体 推送技术监督工作计划:" + s + "结束----!");
|
||||
for(SupvPlan supvPlan: supvPlanList){
|
||||
SupvPlan supvPlanPO = new SupvPlan();
|
||||
supvPlanPO.setPlanId(supvPlan.getPlanId());
|
||||
@@ -231,7 +234,9 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
|
||||
// 目前一个问题对应一个措施,上送一个问题需要调用问题接口和整改措施接口
|
||||
// Map map = postStatsUrl(getUrl(2), null, supvProblemList);
|
||||
// Map map = postStatsUrl(getUrl(3), null, supvProblemList);
|
||||
|
||||
JSONArray objects = new JSONArray(Collections.singletonList(supvProblemList));
|
||||
String s = objects.toString();
|
||||
log.info(Thread.currentThread().getName() + "获取返回体 推送技术监督实施问题:" + s + "结束----!");
|
||||
for(SupvProblem supvProblem:supvProblemList){
|
||||
SupvProblem supvProblemPO = new SupvProblem();
|
||||
supvProblemPO.setProblemId(supvProblem.getProblemId());
|
||||
@@ -244,11 +249,14 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
|
||||
@Override
|
||||
public boolean pushFile(List<String> busIds) throws IOException {
|
||||
LambdaQueryWrapper<SupvFile> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(SupvFile::getBusiId,busIds);
|
||||
lambdaQueryWrapper.in(SupvFile::getBusiId,busIds);
|
||||
List<SupvFile> supvFiles = supvFileMapper.selectList(lambdaQueryWrapper);
|
||||
if(supvFiles.size()>100){
|
||||
throw new BusinessException("一次最多上送100条数据");
|
||||
}
|
||||
JSONArray objects = new JSONArray(Collections.singletonList(supvFiles));
|
||||
String s = objects.toString();
|
||||
log.info(Thread.currentThread().getName() + "获取返回体 推送附件接口:" + s + "结束----!");
|
||||
//TODO 调用上送接口
|
||||
// for (SupvFile supvFile : supvFiles) {
|
||||
// Map map = postFileUrl(getUrl(4), null, supvFile);
|
||||
@@ -259,7 +267,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
|
||||
@Override
|
||||
public boolean pushMonthReportStatistic(List<String> monthReportId) {
|
||||
LambdaQueryWrapper<SupvReportM> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(SupvReportM::getMonthReportId,monthReportId);
|
||||
lambdaQueryWrapper.in(SupvReportM::getMonthReportId,monthReportId);
|
||||
List<SupvReportM> supvReportMList = supvReportMMapper.selectList(lambdaQueryWrapper);
|
||||
|
||||
if(supvReportMList.size()>100){
|
||||
@@ -267,7 +275,9 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
|
||||
}
|
||||
//TODO 调用上送接口
|
||||
// Map map = postStatsUrl(getUrl(5), null, supvReportMList);
|
||||
|
||||
JSONArray objects = new JSONArray(Collections.singletonList(supvReportMList));
|
||||
String s = objects.toString();
|
||||
log.info(Thread.currentThread().getName() + "获取返回体 推送技术监督月报统计数据接口:" + s + "结束----!");
|
||||
for(SupvReportM supvReportM : supvReportMList){
|
||||
SupvReportM supvReportMPO = new SupvReportM();
|
||||
supvReportMPO.setMonthReportId(supvReportM.getMonthReportId());
|
||||
@@ -297,7 +307,9 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
|
||||
|
||||
//TODO
|
||||
// Map map = postStatsUrl(getUrl(6), null, supvPlanList);
|
||||
|
||||
JSONArray objects = new JSONArray(Collections.singletonList(supvPlanList));
|
||||
String s = objects.toString();
|
||||
log.info(Thread.currentThread().getName() + "获取返回体 取消电能质量技术监督工作计划接口:" + s + "结束----!");
|
||||
for(SupvPlan supvPlan : supvPlanList) {
|
||||
supvPlan.setIsUploadHead(2);
|
||||
supvPlanMapper.updateById(supvPlan);
|
||||
@@ -396,7 +408,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
|
||||
* @return
|
||||
*/
|
||||
public static String getUrl(Integer type){
|
||||
String url="http://ip:port";
|
||||
String url="http://25.36.214.86:32234";
|
||||
|
||||
switch (type){
|
||||
case 1:
|
||||
|
||||
Reference in New Issue
Block a user