1.解决pq公共方法查询监测点信息,母线,终端等信息
2.解决device模块swagger页面出不来问题 3.技术监督变电站台账接口增加 4.监测点试运行报告增加,间谐波电压和暂态列表
This commit is contained in:
@@ -6,6 +6,7 @@ import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.text.StrPool;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
@@ -83,7 +84,6 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final DeptLineFeignClient deptLineFeignClient;
|
||||
private final UserFeignClient userFeignClient;
|
||||
private final TerminalBaseClient terminalBaseClient;
|
||||
private final UserReportPOService userReportPOService;
|
||||
private final UserReportProjectPOService userReportProjectPOService;
|
||||
private final UserReportSubstationPOService userReportSubstationPOService;
|
||||
@@ -93,13 +93,63 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String addTempLineDebug(SupervisionTempLineDebugParam supervisionTempLineReportParam) {
|
||||
//获取临时监测点详情
|
||||
SupervisionTempLineReport tempLine = supervisionTempLineReportService.getById(supervisionTempLineReportParam.getId());
|
||||
//需要审核报告是否审核通过
|
||||
UserReportPO temp = userReportPOService.getById(tempLine.getUserId());
|
||||
//是否存在治理方案
|
||||
Integer needGovernance = 0;
|
||||
if (
|
||||
CollectionUtil.newArrayList(
|
||||
UserNatureEnum.BUILD_POWER_GRID.getCode(),
|
||||
UserNatureEnum.EXTEND_POWER_GRID.getCode()
|
||||
).contains(temp.getUserType())) {
|
||||
//电网工程类用户额外数据
|
||||
needGovernance = userReportProjectPOService.getById(temp.getId()).getNeedGovernance();
|
||||
} else if (
|
||||
CollectionUtil.newArrayList(
|
||||
UserNatureEnum.BUILD_NON_LINEAR_LOAD.getCode(),
|
||||
UserNatureEnum.EXTEND_NON_LINEAR_LOAD.getCode(),
|
||||
UserNatureEnum.BUILD_NEW_ENERGY_POWER_STATION.getCode(),
|
||||
UserNatureEnum.EXTEND_NEW_ENERGY_POWER_STATION.getCode()
|
||||
).contains(temp.getUserType())) {
|
||||
//非线性负荷用户 & 新能源发电站用户
|
||||
|
||||
needGovernance = userReportSubstationPOService.getById(temp.getId()).getNeedGovernance();
|
||||
} else if (UserNatureEnum.SENSITIVE_USER.getCode().equals(temp.getUserType())) {
|
||||
// 敏感及重要用户
|
||||
needGovernance = userReportSensitivePOService.getById(temp.getId()).getNeedGovernance();
|
||||
}
|
||||
//添加治理评估文件,需先判断入网评估是否审核通过
|
||||
List<UserReportNormalPO> list = userReportNormalMapper.selectList(new LambdaQueryWrapper<UserReportNormalPO>()
|
||||
.eq(UserReportNormalPO::getUserReportId, temp.getId())
|
||||
.eq(UserReportNormalPO::getState, DataStateEnum.ENABLE.getCode())
|
||||
.ne(UserReportNormalPO::getStatus, BpmTaskStatusEnum.CANCEL.getStatus())
|
||||
.orderByDesc(UserReportNormalPO::getCreateTime)
|
||||
);
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
Optional<UserReportNormalPO> netInReport = list.stream().filter(x -> 0 == x.getType()).findFirst();
|
||||
if(netInReport.isPresent()){
|
||||
if(netInReport.get().getStatus()!=2){
|
||||
throw new BusinessException("最新入网验收方案流程,暂未审核通过!");
|
||||
}
|
||||
}else{
|
||||
throw new BusinessException("请填写入网验收方案流程,审核通过后方可操作!");
|
||||
}
|
||||
if (needGovernance == 1) {
|
||||
Optional<UserReportNormalPO> governReport = list.stream().filter(x -> 1 == x.getType()).findFirst();
|
||||
if(governReport.isPresent()){
|
||||
if(governReport.get().getStatus()!=2){
|
||||
throw new BusinessException("最新治理工程验收方案流程,暂未审核通过!");
|
||||
}
|
||||
}else{
|
||||
throw new BusinessException("请填写治理工程验收方案流程,审核通过后方可操作!");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new BusinessException("请上传,入网设计方案或者治理工程验收方案");
|
||||
}
|
||||
|
||||
// SupervisionTempLineDebugPO byId = this.getById(supervisionTempLineReportParam.getId());
|
||||
// if(Objects.nonNull(byId)){
|
||||
// if(byId.getState() == 1) {
|
||||
// throw new BusinessException("该监测点已申请联调");
|
||||
// }
|
||||
// }
|
||||
SupervisionTempLineDebugPO supervisionTempLineDebugPO = new SupervisionTempLineDebugPO();
|
||||
BeanUtils.copyProperties(supervisionTempLineReportParam,supervisionTempLineDebugPO);
|
||||
//设置状态
|
||||
@@ -128,9 +178,6 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
supervisionTempLineDebugPO.setProcessInstanceId(processInstanceId);
|
||||
this.updateById(supervisionTempLineDebugPO);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -224,19 +271,22 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
SupervisionTempLineDebugVO supervisionTempLineDebugVO = new SupervisionTempLineDebugVO();
|
||||
SupervisionTempLineReport supervisionTempLineReport = supervisionTempLineReportService.getById(id);
|
||||
SupervisionTempLineDebugPO supervisionTempLineDebugPO = this.getById(id);
|
||||
supervisionTempLineDebugVO.setId(id);
|
||||
if(ObjectUtil.isNotNull(supervisionTempLineDebugPO)){
|
||||
supervisionTempLineDebugVO.setId(id);
|
||||
|
||||
supervisionTempLineDebugVO.setUserName(supervisionTempLineReport.getUserName());
|
||||
supervisionTempLineDebugVO.setConnectedBus(supervisionTempLineReport.getConnectedBus());
|
||||
supervisionTempLineDebugVO.setMonitoringTerminalCode(supervisionTempLineReport.getMonitoringTerminalCode());
|
||||
supervisionTempLineDebugVO.setMonitoringTerminalName(supervisionTempLineReport.getMonitoringTerminalName());
|
||||
supervisionTempLineDebugVO.setPowerSubstationName(supervisionTempLineReport.getPowerSubstationName());
|
||||
supervisionTempLineDebugVO.setUserName(supervisionTempLineReport.getUserName());
|
||||
supervisionTempLineDebugVO.setConnectedBus(supervisionTempLineReport.getConnectedBus());
|
||||
supervisionTempLineDebugVO.setMonitoringTerminalCode(supervisionTempLineReport.getMonitoringTerminalCode());
|
||||
supervisionTempLineDebugVO.setMonitoringTerminalName(supervisionTempLineReport.getMonitoringTerminalName());
|
||||
supervisionTempLineDebugVO.setPowerSubstationName(supervisionTempLineReport.getPowerSubstationName());
|
||||
|
||||
supervisionTempLineDebugVO.setLineId(supervisionTempLineReport.getLineId());
|
||||
supervisionTempLineDebugVO.setLineName(supervisionTempLineReport.getLineName());
|
||||
supervisionTempLineDebugVO.setReason(supervisionTempLineDebugPO.getReason());
|
||||
supervisionTempLineDebugVO.setProcessInstanceId(supervisionTempLineDebugPO.getProcessInstanceId());
|
||||
supervisionTempLineDebugVO.setStatus(supervisionTempLineDebugPO.getStatus());
|
||||
}
|
||||
|
||||
supervisionTempLineDebugVO.setLineId(supervisionTempLineReport.getLineId());
|
||||
supervisionTempLineDebugVO.setLineName(supervisionTempLineReport.getLineName());
|
||||
supervisionTempLineDebugVO.setReason(supervisionTempLineDebugPO.getReason());
|
||||
supervisionTempLineDebugVO.setProcessInstanceId(supervisionTempLineDebugPO.getProcessInstanceId());
|
||||
supervisionTempLineDebugVO.setStatus(supervisionTempLineDebugPO.getStatus());
|
||||
|
||||
return supervisionTempLineDebugVO;
|
||||
}
|
||||
@@ -251,13 +301,18 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
public BpmInstanceInfo getInstanceInfo(String businessId) {
|
||||
BpmInstanceInfo bpmInstanceInfo = new BpmInstanceInfo();
|
||||
SupervisionTempLineDebugVO supervisionTempLineDebugVO = this.getDetailTempLineDebug(businessId);
|
||||
bpmInstanceInfo.setHistoryInstanceId(supervisionTempLineDebugVO.getHistoryInstanceId());
|
||||
String sign = supervisionTempLineDebugVO.getPowerSubstationName()
|
||||
.concat(StrPool.SLASH)
|
||||
.concat(supervisionTempLineDebugVO.getMonitoringTerminalName())
|
||||
.concat(StrPool.SLASH)
|
||||
.concat(supervisionTempLineDebugVO.getLineName());
|
||||
bpmInstanceInfo.setInstanceSign(sign);
|
||||
if(ObjectUtil.isNotNull(supervisionTempLineDebugVO)){
|
||||
bpmInstanceInfo.setHistoryInstanceId(supervisionTempLineDebugVO.getHistoryInstanceId());
|
||||
String sign = "";
|
||||
if(StrUtil.isNotBlank(supervisionTempLineDebugVO.getPowerSubstationName())){
|
||||
sign = supervisionTempLineDebugVO.getPowerSubstationName()
|
||||
.concat(StrPool.SLASH)
|
||||
.concat(supervisionTempLineDebugVO.getMonitoringTerminalName())
|
||||
.concat(StrPool.SLASH)
|
||||
.concat(supervisionTempLineDebugVO.getLineName());
|
||||
}
|
||||
bpmInstanceInfo.setInstanceSign(sign);
|
||||
}
|
||||
return bpmInstanceInfo;
|
||||
}
|
||||
|
||||
@@ -276,61 +331,6 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
}
|
||||
//获取临时监测点详情
|
||||
SupervisionTempLineReport tempLine = supervisionTempLineReportService.getById(id);
|
||||
//需要审核报告是否审核通过
|
||||
UserReportPO temp = userReportPOService.getById(tempLine.getUserId());
|
||||
//是否存在治理方案
|
||||
Integer needGovernance = 0;
|
||||
if (
|
||||
CollectionUtil.newArrayList(
|
||||
UserNatureEnum.BUILD_POWER_GRID.getCode(),
|
||||
UserNatureEnum.EXTEND_POWER_GRID.getCode()
|
||||
).contains(temp.getUserType())) {
|
||||
//电网工程类用户额外数据
|
||||
needGovernance = userReportProjectPOService.getById(temp.getId()).getNeedGovernance();
|
||||
} else if (
|
||||
CollectionUtil.newArrayList(
|
||||
UserNatureEnum.BUILD_NON_LINEAR_LOAD.getCode(),
|
||||
UserNatureEnum.EXTEND_NON_LINEAR_LOAD.getCode(),
|
||||
UserNatureEnum.BUILD_NEW_ENERGY_POWER_STATION.getCode(),
|
||||
UserNatureEnum.EXTEND_NEW_ENERGY_POWER_STATION.getCode()
|
||||
).contains(temp.getUserType())) {
|
||||
//非线性负荷用户 & 新能源发电站用户
|
||||
|
||||
needGovernance = userReportSubstationPOService.getById(temp.getId()).getNeedGovernance();
|
||||
} else if (UserNatureEnum.SENSITIVE_USER.getCode().equals(temp.getUserType())) {
|
||||
// 敏感及重要用户
|
||||
needGovernance = userReportSensitivePOService.getById(temp.getId()).getNeedGovernance();
|
||||
}
|
||||
//添加治理评估文件,需先判断入网评估是否审核通过
|
||||
List<UserReportNormalPO> list = userReportNormalMapper.selectList(new LambdaQueryWrapper<UserReportNormalPO>()
|
||||
.eq(UserReportNormalPO::getUserReportId, temp.getId())
|
||||
.eq(UserReportNormalPO::getState, DataStateEnum.ENABLE.getCode())
|
||||
.ne(UserReportNormalPO::getStatus, BpmTaskStatusEnum.CANCEL.getStatus())
|
||||
.orderByDesc(UserReportNormalPO::getCreateTime)
|
||||
);
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
Optional<UserReportNormalPO> netInReport = list.stream().filter(x -> 0 == x.getType()).findFirst();
|
||||
if(netInReport.isPresent()){
|
||||
if(netInReport.get().getStatus()!=2){
|
||||
throw new BusinessException("最新入网验收方案流程,暂未审核通过!");
|
||||
}
|
||||
}else{
|
||||
throw new BusinessException("请填写入网验收方案流程,审核通过后方可操作!");
|
||||
}
|
||||
if (needGovernance == 1) {
|
||||
Optional<UserReportNormalPO> governReport = list.stream().filter(x -> 1 == x.getType()).findFirst();
|
||||
if(governReport.isPresent()){
|
||||
if(governReport.get().getStatus()!=2){
|
||||
throw new BusinessException("最新治理工程验收方案流程,暂未审核通过!");
|
||||
}
|
||||
}else{
|
||||
throw new BusinessException("请填写治理工程验收方案流程,审核通过后方可操作!");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new BusinessException("请上传,入网设计方案或者治理工程验收方案");
|
||||
}
|
||||
|
||||
//获取关联的设备信息
|
||||
SupervisionTempDeviceReport tempDevice = supervisionTempDeviceReportService.getById(tempLine.getMonitoringTerminalCode());
|
||||
SyncTerminalParam syncTerminalParam = new SyncTerminalParam();
|
||||
@@ -379,10 +379,10 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
syncTerminalParam.setSubVoltageParam(subVoltageParam);
|
||||
syncTerminalParam.setLineParam(lineParam);
|
||||
|
||||
String substation = terminalBaseClient.terminalSync(syncTerminalParam).getData();
|
||||
this.updateProcessStatus(id,5);
|
||||
tempDevice.setSubstation(substation);
|
||||
supervisionTempDeviceReportService.updateById(tempDevice);
|
||||
// String substation = terminalBaseClient.terminalSync(syncTerminalParam).getData();
|
||||
// this.updateProcessStatus(id,5);
|
||||
// tempDevice.setSubstation(substation);
|
||||
// supervisionTempDeviceReportService.updateById(tempDevice);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -253,7 +253,8 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
||||
LambdaQueryWrapper<SupervisionTempLineReport> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper
|
||||
.eq(SupervisionTempLineReport::getMonitoringTerminalCode, supervisionTempLineReportParam.getMonitoringTerminalCode())
|
||||
.and(wrapper -> wrapper.eq(SupervisionTempLineReport::getNum, supervisionTempLineReportParam.getNum()).or()
|
||||
.and(wrapper -> wrapper.eq(SupervisionTempLineReport::getNum, supervisionTempLineReportParam.getNum())
|
||||
.or()
|
||||
.eq(SupervisionTempLineReport::getLineName, supervisionTempLineReportParam.getLineName())
|
||||
)
|
||||
.eq(SupervisionTempLineReport::getState, DataStateEnum.ENABLE.getCode());
|
||||
|
||||
@@ -294,7 +294,7 @@ public class SupervisionTempLineRunTestServiceImpl extends ServiceImpl<Supervisi
|
||||
try {
|
||||
startTime = DateUtil.beginOfDay(DateUtil.parse(startTime)).toString();
|
||||
endTime = DateUtil.endOfDay(DateUtil.parse(endTime)).toString();
|
||||
String fileUrl = reportFeignClient.exportWorld(
|
||||
String fileUrl = reportFeignClient.exportModelJB(
|
||||
startTime,
|
||||
endTime,
|
||||
0,
|
||||
|
||||
Reference in New Issue
Block a user