1.变压器bug修改。

2.冀北首页变压器统计相关业务代码提交
This commit is contained in:
wr
2023-08-09 19:11:21 +08:00
parent 5670524153
commit dc15bd5d20
14 changed files with 205 additions and 42 deletions

View File

@@ -103,7 +103,6 @@ public class PqsTransformerServiceImpl extends ServiceImpl<PqsTransformerMapper,
public Boolean insertTransformer(PqsTransformerParam.TransformerAddParam param) {
List<PqsTransformer> list = this.list(new LambdaQueryWrapper<PqsTransformer>()
.eq(PqsTransformer::getTfName, param.getTfName())
);
if (CollectionUtil.isNotEmpty(list)) {
throw new BusinessException(PvDeviceResponseEnum.TRANSFORMER_NAME_REPEAT);
@@ -168,7 +167,20 @@ public class PqsTransformerServiceImpl extends ServiceImpl<PqsTransformerMapper,
ass.setTfIndex(param.getTfIndex());
ass.setLogicBefore(param.getUpNode());
ass.setLogicNext(param.getDownNode());
fly = iPqsTflgassService.save(ass);
PqsTflgass tflgass = iPqsTflgassService.getOne(new LambdaQueryWrapper<PqsTflgass>()
.eq(PqsTflgass::getTfIndex, param.getTfIndex())
.or(wrapper ->
wrapper.eq(PqsTflgass::getLogicBefore, param.getUpNode())
.eq(PqsTflgass::getLogicNext, param.getDownNode())
)
);
if(ObjectUtil.isNotNull(tflgass)){
throw new BusinessException(PvDeviceResponseEnum.TRANSFORMER_NAME_REPEAT);
}else{
fly = iPqsTflgassService.save(ass);
}
} else {
one.setLogicBefore(param.getUpNode());
one.setLogicNext(param.getDownNode());

View File

@@ -49,7 +49,9 @@ public class SubstationExpendServiceImpl implements ISubstationExpendService {
List<String> terminalIds = generalDeviceDTOS.stream().flatMap(dto -> dto.getDeviceIndexes().stream()).collect(Collectors.toList());
List<CommunicateVO.PVCommunicateVO> info = new ArrayList<>();
InfluxQueryWrapper influxQueryWrapper = new InfluxQueryWrapper(PqsCommunicate.class);
influxQueryWrapper.between(InfluxDBTableConstant.TIME, DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())), DateUtil.beginOfDay(DateUtil.parse(param.getSearchEndTime())));
influxQueryWrapper.between(InfluxDBTableConstant.TIME,
DateUtil.beginOfDay(DateUtil.parse(param.getSearchBeginTime())).toString(),
DateUtil.beginOfDay(DateUtil.parse(param.getSearchEndTime()))).toString();
if (CollUtil.isNotEmpty(terminalIds)) {
influxQueryWrapper.or(PqsCommunicate::getDevId, terminalIds);
}