代码bug修改
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.njcn.web.config;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.njcn.web.pojo.annotation.DateTimeStrValid;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
@@ -21,7 +22,7 @@ public class DateTimeValidator implements ConstraintValidator<DateTimeStrValid,
|
||||
|
||||
@Override
|
||||
public boolean isValid(String value, ConstraintValidatorContext context) {
|
||||
if (value == null) {
|
||||
if (StrUtil.isBlank(value)) {
|
||||
return true;
|
||||
}
|
||||
String format = dateTime.format();
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.device.biz.pojo.dto;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
@@ -22,6 +23,11 @@ public class LineDevGetDTO {
|
||||
*/
|
||||
private String pointId;
|
||||
|
||||
/**
|
||||
* 装置监测点索引集合
|
||||
*/
|
||||
private List<String> monitorIds;
|
||||
|
||||
/**
|
||||
* 监测点电压等级
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.njcn.device.pms.pojo.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/7/10
|
||||
*/
|
||||
@Data
|
||||
public class MonitorDevInfoDTO {
|
||||
|
||||
private String monitorId;
|
||||
|
||||
private String terminalId;
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.njcn.device.pms.pojo.dto;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author hongawen
|
||||
@@ -42,6 +43,8 @@ public class PmsMonitorBaseDTO implements Serializable {
|
||||
*/
|
||||
private String terminalId;
|
||||
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
|
||||
/***
|
||||
* 监测线路名称
|
||||
|
||||
@@ -135,7 +135,23 @@ public class CommTerminalController extends BaseController {
|
||||
public HttpResult<List<DeptGetDeviceDTO>> deptGetDevice(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
||||
TimeInterval timer = new TimeInterval();
|
||||
String methodDescribe = getMethodDescribe("deptGetDevice");
|
||||
List<DeptGetDeviceDTO> result = commTerminalService.deptGetDevice(deptGetLineParam);
|
||||
List<DeptGetDeviceDTO> result = commTerminalService.deptGetDevice(deptGetLineParam,0);
|
||||
log.info("运行时长" + timer.intervalRestart());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据单位获取单位下的装置以及装置下的监测点
|
||||
* @author cdf
|
||||
* @date 2023/5/10
|
||||
*/
|
||||
@PostMapping("deptGetDeviceAndMonitor")
|
||||
@ApiOperation("根据单位获取装置以及监测点")
|
||||
@ApiImplicitParam(name = "deptGetDeviceAndMonitor", value = "请求体", required = true)
|
||||
public HttpResult<List<DeptGetDeviceDTO>> deptGetDeviceAndMonitor(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
||||
TimeInterval timer = new TimeInterval();
|
||||
String methodDescribe = getMethodDescribe("deptGetDeviceAndMonitor");
|
||||
List<DeptGetDeviceDTO> result = commTerminalService.deptGetDevice(deptGetLineParam,1);
|
||||
log.info("运行时长" + timer.intervalRestart());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -75,4 +75,11 @@ public interface MonitorMapper extends BaseMapper<Monitor> {
|
||||
* @return MonitorVO
|
||||
*/
|
||||
MonitorVO getPwMonitorTerminal(@Param("id")String id);
|
||||
|
||||
|
||||
/**
|
||||
* 获取主网监测点装置信息
|
||||
* @author cdf
|
||||
* @date 2023/7/10
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -268,7 +268,7 @@
|
||||
|
||||
<select id="getDisMonitorAllList" resultType="com.njcn.device.pms.pojo.dto.PmsMonitorBaseDTO">
|
||||
SELECT
|
||||
t.org_id orgId,t.id monitorId,b.Terminal_Id terminalId,t.Voltage_Level voltageLevel,t.powerrId,t.Line_Id,t.lineType
|
||||
t.Update_Time,t.org_id orgId,t.id monitorId,b.Terminal_Id terminalId,t.Voltage_Level voltageLevel,t.powerrId,t.Line_Id,t.lineType
|
||||
FROM
|
||||
(
|
||||
(
|
||||
@@ -291,6 +291,7 @@
|
||||
WHERE STATUS = 1 )
|
||||
) t
|
||||
INNER JOIN pms_distribution_monitor b ON t.id = b.Monitor_Id
|
||||
left join pms_terminal ter on b.Terminal_Id = ter.id
|
||||
<where>
|
||||
<if test="type == 1">
|
||||
powerrId = #{subId}
|
||||
|
||||
@@ -57,7 +57,7 @@ public interface CommTerminalService {
|
||||
* @author cdf
|
||||
* @date 2023/5/10
|
||||
*/
|
||||
List<DeptGetDeviceDTO> deptGetDevice(DeptGetLineParam deptGetLineParam);
|
||||
List<DeptGetDeviceDTO> deptGetDevice(DeptGetLineParam deptGetLineParam,Integer type);
|
||||
|
||||
/**
|
||||
* 根据单位获取所有装置
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.device.pms.service.ledgerManger.impl;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.enums.common.ServerEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
@@ -29,9 +30,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@@ -76,12 +75,9 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
private final PowerGenerationUserMapper powerGenerationUserMapper;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 基础获取单位信息
|
||||
*
|
||||
* @author cdf
|
||||
* @date 2023/5/10
|
||||
*/
|
||||
@@ -116,11 +112,11 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
List<DictData> voltageDic = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
||||
Map<String, DictData> mapVoltage = voltageDic.stream().collect(Collectors.toMap(DictData::getId, Function.identity()));
|
||||
//监测点状态
|
||||
DictData dictData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.LINE_STATE.getName(),DicDataEnum.RUN.getName()).getData();
|
||||
List<Monitor> monitorList = monitorMapper.selectList(new LambdaQueryWrapper<Monitor>().eq(Monitor::getStatus,1).eq(Monitor::getMonitorState,dictData.getId()));
|
||||
DictData dictData = dicDataFeignClient.getDicDataByNameAndTypeName(DicDataTypeEnum.LINE_STATE.getName(), DicDataEnum.RUN.getName()).getData();
|
||||
List<Monitor> monitorList = monitorMapper.selectList(new LambdaQueryWrapper<Monitor>().eq(Monitor::getStatus, 1).eq(Monitor::getMonitorState, dictData.getId()));
|
||||
Map<String, List<Monitor>> map = monitorList.stream().collect(Collectors.groupingBy(Monitor::getOrgId));
|
||||
|
||||
List<PmsMonitorBaseDTO> pmsMonitorBaseDTOList =distributionMonitorMapper.getDisMonitorAllList(null,0);
|
||||
List<PmsMonitorBaseDTO> pmsMonitorBaseDTOList = distributionMonitorMapper.getDisMonitorAllList(null, 0);
|
||||
Map<String, List<PmsMonitorBaseDTO>> mapPms = pmsMonitorBaseDTOList.stream().collect(Collectors.groupingBy(PmsMonitorBaseDTO::getOrgId));
|
||||
|
||||
temDept.forEach(item -> {
|
||||
@@ -134,7 +130,7 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
List<LineDevGetDTO> lineListPw = new ArrayList<>();
|
||||
deptIds.forEach(i -> {
|
||||
if (map.containsKey(i)) {
|
||||
map.get(i).forEach(it->{
|
||||
map.get(i).forEach(it -> {
|
||||
LineDevGetDTO lineDevGetDTO = new LineDevGetDTO();
|
||||
lineDevGetDTO.setPointId(it.getId());
|
||||
lineDevGetDTO.setInterval(it.getStatisticalInterval());
|
||||
@@ -146,7 +142,7 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
});
|
||||
}
|
||||
if (mapPms.containsKey(i)) {
|
||||
mapPms.get(i).forEach(it->{
|
||||
mapPms.get(i).forEach(it -> {
|
||||
LineDevGetDTO lineDevGetDTOPms = new LineDevGetDTO();
|
||||
lineDevGetDTOPms.setPointId(it.getMonitorId());
|
||||
lineDevGetDTOPms.setInterval(10);
|
||||
@@ -171,10 +167,10 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
public List<DeptGetSubStationDTO> deptSubStation(DeptGetLineParam deptGetLineParam) {
|
||||
List<DeptGetSubStationDTO> result = new ArrayList<>();
|
||||
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
|
||||
List<StatationStat> statationStatList = statationStatMapper.selectList(new LambdaQueryWrapper<StatationStat>().eq(StatationStat::getStatus,1));
|
||||
List<StatationStat> statationStatList = statationStatMapper.selectList(new LambdaQueryWrapper<StatationStat>().eq(StatationStat::getStatus, 1));
|
||||
Map<String, List<StatationStat>> map = statationStatList.stream().collect(Collectors.groupingBy(StatationStat::getOrgId));
|
||||
|
||||
List<PmsMonitorBaseDTO> pmsMonitorBaseDTOList =distributionMonitorMapper.getDisMonitorAllList(null,0);
|
||||
List<PmsMonitorBaseDTO> pmsMonitorBaseDTOList = distributionMonitorMapper.getDisMonitorAllList(null, 0);
|
||||
Map<String, List<PmsMonitorBaseDTO>> mapPms = pmsMonitorBaseDTOList.stream().collect(Collectors.groupingBy(PmsMonitorBaseDTO::getOrgId));
|
||||
|
||||
|
||||
@@ -212,7 +208,7 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
List<GeneratrixWire> generatrixWireList = pmsGeneratrixWireMapper.getGeneratrixWireList();
|
||||
Map<String, List<GeneratrixWire>> map = generatrixWireList.stream().collect(Collectors.groupingBy(GeneratrixWire::getOrgId));
|
||||
|
||||
List<PmsMonitorBaseDTO> pmsMonitorBaseDTOList =distributionMonitorMapper.getDisMonitorAllList(null,0);
|
||||
List<PmsMonitorBaseDTO> pmsMonitorBaseDTOList = distributionMonitorMapper.getDisMonitorAllList(null, 0);
|
||||
Map<String, List<PmsMonitorBaseDTO>> mapPms = pmsMonitorBaseDTOList.stream().collect(Collectors.groupingBy(PmsMonitorBaseDTO::getOrgId));
|
||||
|
||||
|
||||
@@ -242,17 +238,36 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeptGetDeviceDTO> deptGetDevice(DeptGetLineParam deptGetLineParam) {
|
||||
public List<DeptGetDeviceDTO> deptGetDevice(DeptGetLineParam deptGetLineParam, Integer type) {
|
||||
List<DeptGetDeviceDTO> result = new ArrayList<>();
|
||||
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
|
||||
|
||||
List<PmsTerminal> pmsTerminalList = terminalMapper.selectList(new LambdaQueryWrapper<PmsTerminal>().eq(PmsTerminal::getStatus,1));
|
||||
Map<String, List<PmsTerminal>> map = pmsTerminalList.stream().collect(Collectors.groupingBy(PmsTerminal::getOrgId));
|
||||
List<Monitor> monitorList = monitorMapper.selectList(new LambdaQueryWrapper<Monitor>().select(Monitor::getId, Monitor::getTerminalId, Monitor::getOrgId).eq(Monitor::getStatus, 1));
|
||||
List<String> terminalIds = monitorList.stream().map(Monitor::getTerminalId).distinct().collect(Collectors.toList());
|
||||
LambdaQueryWrapper<PmsTerminal> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(PmsTerminal::getId, terminalIds);
|
||||
List<PmsTerminal> pmsTerminals = terminalMapper.selectList(lambdaQueryWrapper);
|
||||
Map<String, List<PmsTerminal>> map = pmsTerminals.stream().collect(Collectors.groupingBy(PmsTerminal::getOrgId));
|
||||
|
||||
List<PmsMonitorBaseDTO> pmsMonitorBaseDTOList =distributionMonitorMapper.getDisMonitorAllList(null,0);
|
||||
Map<String, List<PmsMonitorBaseDTO>> mapPms = pmsMonitorBaseDTOList.stream().collect(Collectors.groupingBy(PmsMonitorBaseDTO::getOrgId));
|
||||
List<PmsMonitorBaseDTO> pmsMonitorBaseDTOList = distributionMonitorMapper.getDisMonitorAllList(null, 0);
|
||||
List<String> pwTerminalIds = pmsMonitorBaseDTOList.stream().map(PmsMonitorBaseDTO::getTerminalId).distinct().collect(Collectors.toList());
|
||||
lambdaQueryWrapper.clear();
|
||||
lambdaQueryWrapper.in(PmsTerminal::getId, pwTerminalIds);
|
||||
List<PmsTerminal> pwPmsTerminals = terminalMapper.selectList(lambdaQueryWrapper);
|
||||
Map<String, List<PmsTerminal>> mapPms = pwPmsTerminals.stream().collect(Collectors.groupingBy(PmsTerminal::getOrgId));
|
||||
|
||||
Map<String, List<Monitor>> monitorMap = new HashMap<>();
|
||||
Map<String, List<PmsMonitorBaseDTO>> pwMonitorMap = new HashMap<>();
|
||||
if (type == 1) {
|
||||
//获取装置接入的监测点
|
||||
monitorMap = monitorList.stream().collect(Collectors.groupingBy(Monitor::getTerminalId));
|
||||
pwMonitorMap = pmsMonitorBaseDTOList.stream().collect(Collectors.groupingBy(PmsMonitorBaseDTO::getTerminalId));
|
||||
|
||||
|
||||
}
|
||||
|
||||
Map<String, List<Monitor>> finalMonitorMap = monitorMap;
|
||||
Map<String, List<PmsMonitorBaseDTO>> finalPwMonitorMap = pwMonitorMap;
|
||||
temDept.forEach(item -> {
|
||||
DeptGetDeviceDTO deptGetDeviceDTO = new DeptGetDeviceDTO();
|
||||
deptGetDeviceDTO.setUnitId(item.getUnitId());
|
||||
@@ -264,21 +279,31 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
List<LineDevGetDTO> devGetDTOListPw = new ArrayList<>();
|
||||
deptIds.forEach(i -> {
|
||||
if (map.containsKey(i)) {
|
||||
map.get(i).forEach(dev->{
|
||||
map.get(i).forEach(dev -> {
|
||||
LineDevGetDTO lineDevGetDTO = new LineDevGetDTO();
|
||||
lineDevGetDTO.setDevId(dev.getId());
|
||||
lineDevGetDTO.setType(1);
|
||||
lineDevGetDTO.setType(0);
|
||||
lineDevGetDTO.setUpdateTime(dev.getUpdateTime());
|
||||
if(type == 1) {
|
||||
if (finalMonitorMap.containsKey(dev.getId())) {
|
||||
lineDevGetDTO.setMonitorIds(finalMonitorMap.get(dev.getId()).stream().map(Monitor::getId).distinct().collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
devGetDTOList.add(lineDevGetDTO);
|
||||
});
|
||||
}
|
||||
|
||||
if (mapPms.containsKey(i)) {
|
||||
mapPms.get(i).forEach(dev->{
|
||||
mapPms.get(i).forEach(dev -> {
|
||||
LineDevGetDTO lineDevGetDTO = new LineDevGetDTO();
|
||||
lineDevGetDTO.setDevId(dev.getTerminalId());
|
||||
lineDevGetDTO.setDevId(dev.getId());
|
||||
lineDevGetDTO.setType(1);
|
||||
|
||||
lineDevGetDTO.setUpdateTime(dev.getUpdateTime());
|
||||
if(type == 1) {
|
||||
if (finalPwMonitorMap.containsKey(dev.getId())) {
|
||||
lineDevGetDTO.setMonitorIds(finalMonitorMap.get(dev.getId()).stream().map(Monitor::getId).distinct().collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
devGetDTOListPw.add(lineDevGetDTO);
|
||||
});
|
||||
}
|
||||
@@ -294,18 +319,18 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
@Override
|
||||
public LineDevGetBandDTO substationGetLine(String substationId) {
|
||||
LineDevGetBandDTO result = new LineDevGetBandDTO();
|
||||
List<Monitor> monitorList = monitorMapper.selectList(new LambdaQueryWrapper<Monitor>().eq(Monitor::getStatus,1).eq(Monitor::getPowerrId,substationId));
|
||||
List<PmsMonitorBaseDTO> pmsMonitorBaseDTOList =distributionMonitorMapper.getDisMonitorAllList(substationId,1);
|
||||
assLineDev(result,monitorList,pmsMonitorBaseDTOList);
|
||||
List<Monitor> monitorList = monitorMapper.selectList(new LambdaQueryWrapper<Monitor>().eq(Monitor::getStatus, 1).eq(Monitor::getPowerrId, substationId));
|
||||
List<PmsMonitorBaseDTO> pmsMonitorBaseDTOList = distributionMonitorMapper.getDisMonitorAllList(substationId, 1);
|
||||
assLineDev(result, monitorList, pmsMonitorBaseDTOList);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LineDevGetBandDTO busBarGetLine(String busBarId) {
|
||||
LineDevGetBandDTO result = new LineDevGetBandDTO();
|
||||
List<PmsMonitorBaseDTO> pmsMonitorBaseDTOList =distributionMonitorMapper.getDisMonitorAllList(busBarId,1);
|
||||
List<Monitor> monitorList = monitorMapper.selectList(new LambdaQueryWrapper<Monitor>().eq(Monitor::getStatus,1).eq(Monitor::getLineId,busBarId));
|
||||
assLineDev(result,monitorList,pmsMonitorBaseDTOList);
|
||||
List<PmsMonitorBaseDTO> pmsMonitorBaseDTOList = distributionMonitorMapper.getDisMonitorAllList(busBarId, 1);
|
||||
List<Monitor> monitorList = monitorMapper.selectList(new LambdaQueryWrapper<Monitor>().eq(Monitor::getStatus, 1).eq(Monitor::getLineId, busBarId));
|
||||
assLineDev(result, monitorList, pmsMonitorBaseDTOList);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -313,14 +338,14 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
/**
|
||||
* 组装信息
|
||||
*/
|
||||
private void assLineDev(LineDevGetBandDTO result,List<Monitor> monitorList,List<PmsMonitorBaseDTO> pmsMonitorBaseDTOList){
|
||||
private void assLineDev(LineDevGetBandDTO result, List<Monitor> monitorList, List<PmsMonitorBaseDTO> pmsMonitorBaseDTOList) {
|
||||
List<DictData> voltageDic = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
||||
Map<String, DictData> mapVoltage = voltageDic.stream().collect(Collectors.toMap(DictData::getId, Function.identity()));
|
||||
|
||||
if(CollectionUtil.isNotEmpty(monitorList)){
|
||||
if (CollectionUtil.isNotEmpty(monitorList)) {
|
||||
List<LineDevGetDTO> temZw = new ArrayList<>();
|
||||
|
||||
monitorList.forEach(item->{
|
||||
monitorList.forEach(item -> {
|
||||
LineDevGetDTO lineDevGetDTO = new LineDevGetDTO();
|
||||
lineDevGetDTO.setPointId(item.getId());
|
||||
lineDevGetDTO.setType(1);
|
||||
@@ -331,9 +356,9 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
result.setZwList(temZw);
|
||||
}
|
||||
|
||||
if(CollectionUtil.isNotEmpty(pmsMonitorBaseDTOList)){
|
||||
if (CollectionUtil.isNotEmpty(pmsMonitorBaseDTOList)) {
|
||||
List<LineDevGetDTO> temPw = new ArrayList<>();
|
||||
pmsMonitorBaseDTOList.forEach(item->{
|
||||
pmsMonitorBaseDTOList.forEach(item -> {
|
||||
LineDevGetDTO lineDevGetDTO = new LineDevGetDTO();
|
||||
lineDevGetDTO.setPointId(item.getMonitorId());
|
||||
lineDevGetDTO.setType(1);
|
||||
@@ -418,41 +443,40 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String updatePmsOverLimit() {
|
||||
List<DictData> dictDataList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
||||
Map<String, DictData> map = dictDataList.stream().collect(Collectors.toMap(DictData::getId,Function.identity()));
|
||||
Map<String, DictData> map = dictDataList.stream().collect(Collectors.toMap(DictData::getId, Function.identity()));
|
||||
|
||||
List<Monitor> monitorList = monitorMapper.selectList(new LambdaQueryWrapper<>());
|
||||
|
||||
int count = 0;
|
||||
for (Monitor monitor : monitorList) {
|
||||
Float voltage = Float.parseFloat(map.get(monitor.getVoltageLevel()).getValue());
|
||||
Overlimit overlimit = COverlimitUtil.globalAssemble(voltage, monitor.getUserAgreementCapacity(), monitor.getPowerSupplyEqCapacity(), monitor.getMinShortCircuitCapacity(), 1, 0);
|
||||
overlimit.setId(monitor.getId());
|
||||
overlimitMapper.deleteById(monitor.getId());
|
||||
overlimitMapper.insert(overlimit);
|
||||
count++;
|
||||
Float voltage = Float.parseFloat(map.get(monitor.getVoltageLevel()).getValue());
|
||||
Overlimit overlimit = COverlimitUtil.globalAssemble(voltage, monitor.getUserAgreementCapacity(), monitor.getPowerSupplyEqCapacity(), monitor.getMinShortCircuitCapacity(), 1, 0);
|
||||
overlimit.setId(monitor.getId());
|
||||
overlimitMapper.deleteById(monitor.getId());
|
||||
overlimitMapper.insert(overlimit);
|
||||
count++;
|
||||
|
||||
}
|
||||
//二类监测点
|
||||
List<PowerDistributionarea> powerDistributionareaList = powerDistributionareaMapper.selectList(new LambdaQueryWrapper<>());
|
||||
int countArea = 0;
|
||||
for (PowerDistributionarea powerDistributionarea : powerDistributionareaList) {
|
||||
Float voltage = Float.parseFloat(map.get(powerDistributionarea.getVoltageLevel()).getValue());
|
||||
Overlimit overlimit = COverlimitUtil.globalAssemble(voltage, null, null, null, 1, 1);
|
||||
overlimit.setId(powerDistributionarea.getId());
|
||||
overlimitMapper.deleteById(powerDistributionarea.getId());
|
||||
overlimitMapper.insert(overlimit);
|
||||
Float voltage = Float.parseFloat(map.get(powerDistributionarea.getVoltageLevel()).getValue());
|
||||
Overlimit overlimit = COverlimitUtil.globalAssemble(voltage, null, null, null, 1, 1);
|
||||
overlimit.setId(powerDistributionarea.getId());
|
||||
overlimitMapper.deleteById(powerDistributionarea.getId());
|
||||
overlimitMapper.insert(overlimit);
|
||||
countArea++;
|
||||
}
|
||||
//三类监测
|
||||
List<PowerClient> powerClientList = powerClientMapper.selectList(new LambdaQueryWrapper<>());
|
||||
int countClient = 0;
|
||||
for (PowerClient powerClient : powerClientList) {
|
||||
Float voltage = Float.parseFloat(map.get(powerClient.getVoltageLevel()).getValue());
|
||||
Float voltage = Float.parseFloat(map.get(powerClient.getVoltageLevel()).getValue());
|
||||
Overlimit overlimit = COverlimitUtil.globalAssemble(voltage, null, null, null, 1, 1);
|
||||
overlimit.setId(powerClient.getId());
|
||||
overlimitMapper.deleteById(powerClient.getId());
|
||||
@@ -463,14 +487,14 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
List<PowerGenerationUser> powerGenerationUserList = powerGenerationUserMapper.selectList(new LambdaQueryWrapper<>());
|
||||
|
||||
for (PowerGenerationUser powerGenerationUser : powerGenerationUserList) {
|
||||
Float voltage = Float.parseFloat(map.get(powerGenerationUser.getVoltageLevel()).getValue());
|
||||
Float voltage = Float.parseFloat(map.get(powerGenerationUser.getVoltageLevel()).getValue());
|
||||
Overlimit overlimit = COverlimitUtil.globalAssemble(voltage, null, null, null, 1, 1);
|
||||
overlimit.setId(powerGenerationUser.getId());
|
||||
overlimitMapper.deleteById(powerGenerationUser.getId());
|
||||
overlimitMapper.insert(overlimit);
|
||||
countClient++;
|
||||
}
|
||||
return "主网监测点限值更新"+count+"个,台区限值更新"+countArea+"个,发电用电用户"+countClient+"个";
|
||||
return "主网监测点限值更新" + count + "个,台区限值更新" + countArea + "个,发电用电用户" + countClient + "个";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -131,11 +131,26 @@ public class CommTerminalController extends BaseController {
|
||||
public HttpResult<List<DeptGetDeviceDTO>> deptGetDevice(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
||||
TimeInterval timer = new TimeInterval();
|
||||
String methodDescribe = getMethodDescribe("deptGetDevice");
|
||||
List<DeptGetDeviceDTO> result = commTerminalService.deptGetDevice(deptGetLineParam);
|
||||
List<DeptGetDeviceDTO> result = commTerminalService.deptGetDevice(deptGetLineParam,0);
|
||||
log.info("运行时长" + timer.intervalRestart());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据单位获取单位下的装置以及装置下的监测点
|
||||
* @author cdf
|
||||
* @date 2023/5/10
|
||||
*/
|
||||
@PostMapping("deptGetDeviceAndMonitor")
|
||||
@ApiOperation("根据单位获取装置以及监测点")
|
||||
@ApiImplicitParam(name = "deptGetDeviceAndMonitor", value = "请求体", required = true)
|
||||
public HttpResult<List<DeptGetDeviceDTO>> deptGetDeviceAndMonitor(@RequestBody @Validated DeptGetLineParam deptGetLineParam) {
|
||||
TimeInterval timer = new TimeInterval();
|
||||
String methodDescribe = getMethodDescribe("deptGetDeviceAndMonitor");
|
||||
List<DeptGetDeviceDTO> result = commTerminalService.deptGetDevice(deptGetLineParam,1);
|
||||
log.info("运行时长" + timer.intervalRestart());
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据单站id获取监测点信息
|
||||
|
||||
@@ -57,7 +57,7 @@ public interface CommTerminalService {
|
||||
* @author cdf
|
||||
* @date 2023/5/10
|
||||
*/
|
||||
List<DeptGetDeviceDTO> deptGetDevice(DeptGetLineParam deptGetLineParam);
|
||||
List<DeptGetDeviceDTO> deptGetDevice(DeptGetLineParam deptGetLineParam,Integer type);
|
||||
|
||||
/**
|
||||
* 根据电站和母线id获取监测点信息
|
||||
|
||||
@@ -153,7 +153,7 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeptGetDeviceDTO> deptGetDevice(DeptGetLineParam deptGetLineParam) {
|
||||
public List<DeptGetDeviceDTO> deptGetDevice(DeptGetLineParam deptGetLineParam,Integer type) {
|
||||
List<DeptGetDeviceDTO> result = new ArrayList<>();
|
||||
List<DeptGetBase> temDept = getDeptChildrenByParent(deptGetLineParam);
|
||||
Map<String, List<LineDevGetDTO>> map = deptLineService.lineDevGet(filterDataTypeNew(deptGetLineParam.getServerName()),3);
|
||||
|
||||
@@ -108,7 +108,6 @@ public class SupvPlanParam extends BaseParam {
|
||||
* 计划执行开始时间
|
||||
*/
|
||||
@ApiModelProperty(value = "计划执行开始时间",required = true)
|
||||
@NotNull(message = "计划执行开始时间不可为空")
|
||||
@DateTimeStrValid(message = "计划执行开始时间格式有误")
|
||||
private String effectStartTime;
|
||||
|
||||
@@ -116,7 +115,6 @@ public class SupvPlanParam extends BaseParam {
|
||||
* 计划执行结束时间
|
||||
*/
|
||||
@ApiModelProperty(value = "计划执行结束时间",required = true)
|
||||
@NotNull(message = "计划执行结束时间不可为空")
|
||||
@DateTimeStrValid(message = "计划执行结束时间格式有误")
|
||||
private String effectEndTime;
|
||||
|
||||
@@ -132,7 +130,6 @@ public class SupvPlanParam extends BaseParam {
|
||||
*/
|
||||
@ApiModelProperty(value = "电能质量问题发生时间",required = true)
|
||||
@DateTimeStrValid(message = "电能质量问题发生时间格式有误",format = "yyyy-MM-dd HH:mm:ss")
|
||||
@NotBlank(message = "电能质量问题发生时间不可为空")
|
||||
private String problemOcTime;
|
||||
|
||||
/**
|
||||
|
||||
@@ -79,10 +79,20 @@ public class SupvPlanServiceImpl extends ServiceImpl<SupvPlanMapper, SupvPlan> i
|
||||
SupvPlan supvPlan = new SupvPlan();
|
||||
BeanUtil.copyProperties(supvPlanParam, supvPlan);
|
||||
supvPlan.setPlanSupvDate(PubUtils.localDateFormat(supvPlanParam.getPlanSupvDate()));
|
||||
supvPlan.setEffectEndTime(PubUtils.localDateFormat(supvPlanParam.getEffectEndTime()));
|
||||
supvPlan.setEffectStartTime(PubUtils.localDateFormat(supvPlanParam.getEffectStartTime()));
|
||||
supvPlan.setProblemOcTime(PubUtils.localDateTimeFormat(supvPlanParam.getProblemOcTime()));
|
||||
supvPlan.setReportIssueTime(PubUtils.localDateTimeFormat(supvPlanParam.getReportIssueTime()));
|
||||
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getEffectEndTime())) {
|
||||
supvPlan.setEffectEndTime(PubUtils.localDateFormat(supvPlanParam.getEffectEndTime()));
|
||||
}
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getEffectStartTime())) {
|
||||
supvPlan.setEffectStartTime(PubUtils.localDateFormat(supvPlanParam.getEffectStartTime()));
|
||||
}
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getProblemOcTime())) {
|
||||
supvPlan.setProblemOcTime(PubUtils.localDateTimeFormat(supvPlanParam.getProblemOcTime()));
|
||||
}
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getReportIssueTime())) {
|
||||
supvPlan.setReportIssueTime(PubUtils.localDateTimeFormat(supvPlanParam.getReportIssueTime()));
|
||||
}
|
||||
|
||||
supvPlan.setIsUploadHead(0);
|
||||
supvPlan.setPlanUserId(RequestUtil.getUserIndex());
|
||||
this.save(supvPlan);
|
||||
@@ -95,10 +105,18 @@ public class SupvPlanServiceImpl extends ServiceImpl<SupvPlanMapper, SupvPlan> i
|
||||
SupvPlan supvPlan = new SupvPlan();
|
||||
BeanUtil.copyProperties(supvPlanParam, supvPlan);
|
||||
supvPlan.setPlanSupvDate(PubUtils.localDateFormat(supvPlanParam.getPlanSupvDate()));
|
||||
supvPlan.setEffectEndTime(PubUtils.localDateFormat(supvPlanParam.getEffectEndTime()));
|
||||
supvPlan.setEffectStartTime(PubUtils.localDateFormat(supvPlanParam.getEffectStartTime()));
|
||||
supvPlan.setProblemOcTime(PubUtils.localDateTimeFormat(supvPlanParam.getProblemOcTime()));
|
||||
supvPlan.setReportIssueTime(PubUtils.localDateTimeFormat(supvPlanParam.getReportIssueTime()));
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getEffectEndTime())) {
|
||||
supvPlan.setEffectEndTime(PubUtils.localDateFormat(supvPlanParam.getEffectEndTime()));
|
||||
}
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getEffectStartTime())) {
|
||||
supvPlan.setEffectStartTime(PubUtils.localDateFormat(supvPlanParam.getEffectStartTime()));
|
||||
}
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getProblemOcTime())) {
|
||||
supvPlan.setProblemOcTime(PubUtils.localDateTimeFormat(supvPlanParam.getProblemOcTime()));
|
||||
}
|
||||
if(StrUtil.isNotBlank(supvPlanParam.getReportIssueTime())) {
|
||||
supvPlan.setReportIssueTime(PubUtils.localDateTimeFormat(supvPlanParam.getReportIssueTime()));
|
||||
}
|
||||
this.updateById(supvPlan);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user