河北国网上报接口调整
This commit is contained in:
@@ -186,6 +186,12 @@ spring:
|
|||||||
filters:
|
filters:
|
||||||
- SwaggerHeaderFilter
|
- SwaggerHeaderFilter
|
||||||
- StripPrefix=1
|
- StripPrefix=1
|
||||||
|
#河北国网总部调用省侧接口,路径总部统一规定
|
||||||
|
- id: hb_pms_down
|
||||||
|
uri: lb://harmonic-boot
|
||||||
|
predicates:
|
||||||
|
- Path=/IndexAnalysis/**
|
||||||
|
|
||||||
|
|
||||||
#项目日志的配置
|
#项目日志的配置
|
||||||
logging:
|
logging:
|
||||||
@@ -233,9 +239,7 @@ whitelist:
|
|||||||
- /user-boot/**
|
- /user-boot/**
|
||||||
- /harmonic-boot/**
|
- /harmonic-boot/**
|
||||||
- /user-boot/user/listAllUserByDeptId
|
- /user-boot/user/listAllUserByDeptId
|
||||||
- /harmonic-boot/IndexAnalysis/BenchmarkLevelEva/getBaseEvaOnlineBusDetail
|
- /IndexAnalysis/**
|
||||||
|
|
||||||
|
|
||||||
mqtt:
|
mqtt:
|
||||||
client-id: @artifactId@${random.value}
|
client-id: @artifactId@${random.value}
|
||||||
|
|
||||||
|
|||||||
@@ -26,4 +26,13 @@ public class UploadDataParam extends BaseParam {
|
|||||||
@NotBlank(message = "时间维度不可为空")
|
@NotBlank(message = "时间维度不可为空")
|
||||||
private String dataType;
|
private String dataType;
|
||||||
|
|
||||||
|
@ApiModelProperty("电压等级")
|
||||||
|
private String voltageLevel;
|
||||||
|
|
||||||
|
@ApiModelProperty("指标类型")
|
||||||
|
private String targetType;
|
||||||
|
|
||||||
|
@ApiModelProperty("谐波次数")
|
||||||
|
private Integer harmCount;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,10 +14,7 @@ import io.swagger.annotations.ApiImplicitParam;
|
|||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pqs
|
* pqs
|
||||||
@@ -91,5 +88,14 @@ public class EvaluationDownController extends BaseController {
|
|||||||
return new PmsHttpResult<>(0, page);
|
return new PmsHttpResult<>(0, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@GetMapping("/test")
|
||||||
|
@ApiOperation("国网上送-测试")
|
||||||
|
public PmsHttpResult<PmsPage<DimBusBarVO.DimBusBarMonitorVoltageVO>> test() {
|
||||||
|
String methodDescribe = getMethodDescribe("test");
|
||||||
|
return new PmsHttpResult<>(0, new PmsPage<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -562,6 +562,10 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
lambdaQueryWrapper.eq(StrUtil.isNotBlank(param.getVoltageLevel()),RUploadEvaluationDataD::getVoltageLevel,param.getVoltageLevel())
|
||||||
|
.eq(StrUtil.isNotBlank(param.getTargetType()),RUploadEvaluationDataD::getIndexType,param.getTargetType())
|
||||||
|
.eq(StrUtil.isNotBlank(param.getTargetType())&¶m.getTargetType().equals("05"),RUploadEvaluationDataD::getHarmonicNum,param.getHarmCount());
|
||||||
|
|
||||||
return lambdaQueryWrapper;
|
return lambdaQueryWrapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ public class RUploadEvaluationDataDServiceImpl extends MppServiceImpl<RUploadEva
|
|||||||
|
|
||||||
RUploadEvaluationDataD dto0 = this.getLineNum(busBarDto, item2.getVoltageLevel());
|
RUploadEvaluationDataD dto0 = this.getLineNum(busBarDto, item2.getVoltageLevel());
|
||||||
//电压
|
//电压
|
||||||
double sd1 = this.getDimVoltageDataSd(item2.getVoltageLevel(), Objects.isNull(rDimVoltageD) ? defaultValue : rDimVoltageD.getV()*Math.sqrt(3), calculatedParam.getDataDate(), item.getLineBaseList(), UploadEnum.INDEX_TYPE_01.getCode(), null);
|
double sd1 = this.getDimVoltageDataSd(item2.getVoltageLevel(), Objects.isNull(rDimVoltageD) ? defaultValue : rDimVoltageD.getV(), calculatedParam.getDataDate(), item.getLineBaseList(), UploadEnum.INDEX_TYPE_01.getCode(), null);
|
||||||
RUploadEvaluationDataD dto11 = this.channelData(rUploadEvaluationDataD, Objects.isNull(rDimVoltageD) ? defaultValue : rDimVoltageD.getV(), sd1, UploadEnum.INDEX_TYPE_01.getCode(), 0, item2.getVoltageLevel(), dto0);
|
RUploadEvaluationDataD dto11 = this.channelData(rUploadEvaluationDataD, Objects.isNull(rDimVoltageD) ? defaultValue : rDimVoltageD.getV(), sd1, UploadEnum.INDEX_TYPE_01.getCode(), 0, item2.getVoltageLevel(), dto0);
|
||||||
result.add(dto11);
|
result.add(dto11);
|
||||||
//长时间闪变
|
//长时间闪变
|
||||||
|
|||||||
@@ -332,7 +332,8 @@ public class RUploadPointStatisticalDataDServiceImpl extends MppServiceImpl<RUpl
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<RStatIntegrityD> deptRStatIntegrityDList = rStatIntegrityDList.stream().filter(it->runMonitorIds.contains(it.getLineIndex())).collect(toList());
|
List<RStatIntegrityD> deptRStatIntegrityDList = rStatIntegrityDList.stream().filter(it->runMonitorIds.contains(it.getLineIndex())).collect(toList());
|
||||||
|
int due = deptRStatIntegrityDList.stream().mapToInt(RStatIntegrityD::getDueTime).sum();
|
||||||
|
int real = deptRStatIntegrityDList.stream().mapToInt(RStatIntegrityD::getRealTime).sum();
|
||||||
|
|
||||||
mapKey.forEach((key, val) -> {
|
mapKey.forEach((key, val) -> {
|
||||||
|
|
||||||
@@ -353,54 +354,9 @@ public class RUploadPointStatisticalDataDServiceImpl extends MppServiceImpl<RUpl
|
|||||||
rUploadPointStatisticalDataD.setRunTerminalNum(runDevIds.size());
|
rUploadPointStatisticalDataD.setRunTerminalNum(runDevIds.size());
|
||||||
rUploadPointStatisticalDataD.setRunMonitorNum(runMonitorIds.size());
|
rUploadPointStatisticalDataD.setRunMonitorNum(runMonitorIds.size());
|
||||||
rUploadPointStatisticalDataD.setOnlineMonitorNum(onlineMonitorIds.size());
|
rUploadPointStatisticalDataD.setOnlineMonitorNum(onlineMonitorIds.size());
|
||||||
int due = deptRStatIntegrityDList.stream().mapToInt(RStatIntegrityD::getDueTime).sum();
|
|
||||||
int real = deptRStatIntegrityDList.stream().mapToInt(RStatIntegrityD::getRealTime).sum();
|
|
||||||
rUploadPointStatisticalDataD.setExpectCollectNum(due);
|
|
||||||
rUploadPointStatisticalDataD.setActualCollectNum(real);
|
|
||||||
double rate = deptRStatIntegrityDList.size() == 0 ? 0d : BigDecimal.valueOf(rUploadPointStatisticalDataD.getOnlineMonitorNum() * 100.0 / rUploadPointStatisticalDataD.getRunMonitorNum()).setScale(4, RoundingMode.HALF_UP).doubleValue();
|
|
||||||
rUploadPointStatisticalDataD.setOnlineMonitorRate(rate>100 ? 100:rate);
|
|
||||||
if (due == 0 || real == 0) {
|
|
||||||
rUploadPointStatisticalDataD.setDataFullRate(BigDecimal.valueOf(0).setScale(4, RoundingMode.HALF_UP).doubleValue());
|
|
||||||
} else {
|
|
||||||
double inVal = BigDecimal.valueOf(real * 100.0 / due).setScale(4, RoundingMode.HALF_UP).doubleValue();
|
|
||||||
rUploadPointStatisticalDataD.setDataFullRate(inVal>100?100:inVal);
|
|
||||||
}
|
|
||||||
|
|
||||||
List<LineDTO> keyItem;
|
assDataRate(deptRStatIntegrityDList,due,real,rUploadPointStatisticalDataD);
|
||||||
if(key.equals("9999")){
|
assStationType(key,val,lineDTOList,dictDataMap,rUploadPointStatisticalDataD);
|
||||||
//其他
|
|
||||||
keyItem = lineDTOList.stream().filter(o -> !val.contains(o.getObjType())).collect(toList());
|
|
||||||
}else {
|
|
||||||
keyItem = lineDTOList.stream().filter(o -> val.contains(o.getObjType())).collect(toList());
|
|
||||||
}
|
|
||||||
long pointCount = keyItem.stream().map(LineDTO::getLineId).distinct().count();
|
|
||||||
rUploadPointStatisticalDataD.setStationMonitorNum((int) pointCount);
|
|
||||||
switch (key) {
|
|
||||||
case "2100":
|
|
||||||
rUploadPointStatisticalDataD.setStationType(dictDataMap.get(DicDataEnum.Trans_Sub.getCode()).getId());
|
|
||||||
break;
|
|
||||||
case "1200":
|
|
||||||
rUploadPointStatisticalDataD.setStationType(dictDataMap.get(DicDataEnum.Converter.getCode()).getId());
|
|
||||||
break;
|
|
||||||
case "1300":
|
|
||||||
rUploadPointStatisticalDataD.setStationType(dictDataMap.get(DicDataEnum.Ele_Railways.getCode()).getId());
|
|
||||||
break;
|
|
||||||
case "1401":
|
|
||||||
rUploadPointStatisticalDataD.setStationType(dictDataMap.get(DicDataEnum.Wind_Farms.getCode()).getId());
|
|
||||||
break;
|
|
||||||
case "1402":
|
|
||||||
rUploadPointStatisticalDataD.setStationType(dictDataMap.get(DicDataEnum.Power_Station.getCode()).getId());
|
|
||||||
break;
|
|
||||||
case "2300":
|
|
||||||
rUploadPointStatisticalDataD.setStationType(dictDataMap.get(DicDataEnum.Smelting_Load.getCode()).getId());
|
|
||||||
break;
|
|
||||||
case "2400":
|
|
||||||
rUploadPointStatisticalDataD.setStationType(dictDataMap.get(DicDataEnum.Imp_Users.getCode()).getId());
|
|
||||||
break;
|
|
||||||
case "9999":
|
|
||||||
rUploadPointStatisticalDataD.setStationType(dictDataMap.get(DicDataEnum.Station_Other.getCode()).getId());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
resultPO.add(rUploadPointStatisticalDataD);
|
resultPO.add(rUploadPointStatisticalDataD);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -492,23 +448,30 @@ public class RUploadPointStatisticalDataDServiceImpl extends MppServiceImpl<RUpl
|
|||||||
rUploadPointStatisticalDataD.setUploadStatus(Integer.parseInt(UploadEnum.UPLOAD_STATUS_0.getCode()));
|
rUploadPointStatisticalDataD.setUploadStatus(Integer.parseInt(UploadEnum.UPLOAD_STATUS_0.getCode()));
|
||||||
//fixme 主配网标识文档中没有,先随便定义一个,后期调整
|
//fixme 主配网标识文档中没有,先随便定义一个,后期调整
|
||||||
rUploadPointStatisticalDataD.setDistributionFlag(UploadEnum.DISTRIBUTION_FLAG_01.getCode());
|
rUploadPointStatisticalDataD.setDistributionFlag(UploadEnum.DISTRIBUTION_FLAG_01.getCode());
|
||||||
//fixme over
|
|
||||||
judgeLevel(dept.getLevel(), rUploadPointStatisticalDataD, dept.getCode(), dept.getName(), deptList, deptMap);
|
|
||||||
|
|
||||||
rUploadPointStatisticalDataD.setRunTerminalNum(runDevIds.size());
|
rUploadPointStatisticalDataD.setRunTerminalNum(runDevIds.size());
|
||||||
rUploadPointStatisticalDataD.setRunMonitorNum(runMonitorIds.size());
|
rUploadPointStatisticalDataD.setRunMonitorNum(runMonitorIds.size());
|
||||||
rUploadPointStatisticalDataD.setOnlineMonitorNum(onlineMonitorIds.size());
|
rUploadPointStatisticalDataD.setOnlineMonitorNum(onlineMonitorIds.size());
|
||||||
rUploadPointStatisticalDataD.setExpectCollectNum(due);
|
//fixme over
|
||||||
rUploadPointStatisticalDataD.setActualCollectNum(real);
|
judgeLevel(dept.getLevel(), rUploadPointStatisticalDataD, dept.getCode(), dept.getName(), deptList, deptMap);
|
||||||
double rate = deptRStatIntegrityDList.size() == 0 ? 0d : BigDecimal.valueOf(rUploadPointStatisticalDataD.getOnlineMonitorNum() * 100.0 / rUploadPointStatisticalDataD.getRunMonitorNum()).setScale(4, RoundingMode.HALF_UP).doubleValue();
|
|
||||||
rUploadPointStatisticalDataD.setOnlineMonitorRate(rate>100 ? 100:rate);
|
|
||||||
if (due == 0 || real == 0) {
|
assDataRate(deptRStatIntegrityDList,due,real,rUploadPointStatisticalDataD);
|
||||||
rUploadPointStatisticalDataD.setDataFullRate(BigDecimal.valueOf(0).setScale(4, RoundingMode.HALF_UP).doubleValue());
|
assStationType(key,val,lineDTOList,dictDataMap,rUploadPointStatisticalDataD);
|
||||||
} else {
|
resultPO.add(rUploadPointStatisticalDataD);
|
||||||
double inVal = BigDecimal.valueOf(real * 100.0 / due).setScale(4, RoundingMode.HALF_UP).doubleValue();
|
});
|
||||||
rUploadPointStatisticalDataD.setDataFullRate(inVal>100?100:inVal);
|
});
|
||||||
|
|
||||||
|
this.saveOrUpdateBatchByMultiId(resultPO);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组装所属场站
|
||||||
|
* @author cdf
|
||||||
|
* @date 2024/5/30
|
||||||
|
*/
|
||||||
|
private void assStationType(String key,List<String> val,List<LineDTO> lineDTOList,Map<String, DictData> dictDataMap,RUploadPointStatisticalDataD rUploadPointStatisticalDataD){
|
||||||
List<LineDTO> keyItem;
|
List<LineDTO> keyItem;
|
||||||
if(key.equals("9999")){
|
if(key.equals("9999")){
|
||||||
//其他
|
//其他
|
||||||
@@ -544,15 +507,36 @@ public class RUploadPointStatisticalDataDServiceImpl extends MppServiceImpl<RUpl
|
|||||||
rUploadPointStatisticalDataD.setStationType(dictDataMap.get(DicDataEnum.Station_Other.getCode()).getId());
|
rUploadPointStatisticalDataD.setStationType(dictDataMap.get(DicDataEnum.Station_Other.getCode()).getId());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
resultPO.add(rUploadPointStatisticalDataD);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
this.saveOrUpdateBatchByMultiId(resultPO);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 数据完整性赋值
|
||||||
|
* @author cdf
|
||||||
|
* @date 2024/5/30
|
||||||
|
*/
|
||||||
|
private void assDataRate(List<RStatIntegrityD> deptRStatIntegrityDList,int due,int real,RUploadPointStatisticalDataD rUploadPointStatisticalDataD){
|
||||||
|
rUploadPointStatisticalDataD.setExpectCollectNum(due);
|
||||||
|
rUploadPointStatisticalDataD.setActualCollectNum(real);
|
||||||
|
BigDecimal onlineMonitorRate = BigDecimal.ZERO;
|
||||||
|
if (deptRStatIntegrityDList.size() != 0) {
|
||||||
|
BigDecimal onlineMonitorNum = BigDecimal.valueOf(rUploadPointStatisticalDataD.getOnlineMonitorNum());
|
||||||
|
BigDecimal runMonitorNum = BigDecimal.valueOf(rUploadPointStatisticalDataD.getRunMonitorNum());
|
||||||
|
onlineMonitorRate = onlineMonitorNum.multiply(BigDecimal.valueOf(100))
|
||||||
|
.divide(runMonitorNum, 4, RoundingMode.HALF_UP);
|
||||||
|
onlineMonitorRate = onlineMonitorRate.min(BigDecimal.valueOf(100)); // 确保不超过100
|
||||||
|
}
|
||||||
|
rUploadPointStatisticalDataD.setOnlineMonitorRate(onlineMonitorRate.doubleValue());
|
||||||
|
|
||||||
|
BigDecimal dataFullRate = BigDecimal.ZERO;
|
||||||
|
if (due != 0 && real != 0) {
|
||||||
|
BigDecimal realValue = BigDecimal.valueOf(real);
|
||||||
|
BigDecimal dueValue = BigDecimal.valueOf(due);
|
||||||
|
dataFullRate = realValue.multiply(BigDecimal.valueOf(100))
|
||||||
|
.divide(dueValue, 4, RoundingMode.HALF_UP);
|
||||||
|
dataFullRate = dataFullRate.min(BigDecimal.valueOf(100)); // 确保不超过100
|
||||||
|
}
|
||||||
|
rUploadPointStatisticalDataD.setDataFullRate(dataFullRate.doubleValue());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param calculatedParam
|
* @param calculatedParam
|
||||||
|
|||||||
Reference in New Issue
Block a user