pms代码调整
This commit is contained in:
@@ -126,7 +126,7 @@ public class CommTerminalGeneralClientFallbackFactory implements FallbackFactory
|
||||
|
||||
@Override
|
||||
public HttpResult<LineDevGetDTO> getMonitorDetail(String lineId) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取监测点详细信息集合", throwable.toString());
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取监测点详细信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DeptGetDeviceDTO extends DeptGetBase {
|
||||
|
||||
@ApiModelProperty(name = "deviceList",value = "装置信息")
|
||||
@ApiModelProperty(name = "deviceList",value = "主网装置信息")
|
||||
private List<LineDevGetDTO> deviceList;
|
||||
|
||||
@ApiModelProperty(name = "pwDeviceList",value = "配网装置信息")
|
||||
|
||||
@@ -41,7 +41,8 @@ public class COverlimitUtil {
|
||||
* @param powerFlag 0.用户侧 1.电网侧
|
||||
* @param lineType 0.主网 1.配网 需要注意配网目前没有四种容量,谐波电流幅值限值,负序电流限值无法计算默认-3.14159
|
||||
*/
|
||||
public static Overlimit globalAssemble(Float voltageLevel, Float protocolCapacity, Float devCapacity, Float shortCapacity, Integer powerFlag, Integer lineType) {
|
||||
public static Overlimit globalAssemble(Float voltageLevel, Float protocolCapacity, Float devCapacity,
|
||||
Float shortCapacity, Integer powerFlag, Integer lineType) {
|
||||
Overlimit overlimit = new Overlimit();
|
||||
voltageDeviation(overlimit,voltageLevel);
|
||||
frequency(overlimit);
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.njcn.device.pms.pojo.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* pqs
|
||||
* 监测点信息
|
||||
* @author cdf
|
||||
* @date 2023/9/27
|
||||
*/
|
||||
@Data
|
||||
public class StationExpendMonitorVO {
|
||||
|
||||
private String stationId;
|
||||
|
||||
private String monitorId;
|
||||
|
||||
private String monitorName;
|
||||
|
||||
private String orgName;
|
||||
|
||||
private String objType;
|
||||
|
||||
private String terminalName;
|
||||
|
||||
private String voltageLevel;
|
||||
|
||||
private BigDecimal limitRate;
|
||||
|
||||
private Integer isLimit;
|
||||
}
|
||||
@@ -11,8 +11,10 @@ import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.biz.pojo.po.PqsDeviceUnit;
|
||||
import com.njcn.device.pms.pojo.po.DistributionMonitor;
|
||||
import com.njcn.device.pms.pojo.po.Monitor;
|
||||
import com.njcn.device.pms.service.ledgerManger.CommTerminalService;
|
||||
import com.njcn.device.pms.service.majornetwork.IDistributionMonitorService;
|
||||
import com.njcn.device.pms.service.majornetwork.IMonitorService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -43,6 +45,7 @@ public class CommTerminalController extends BaseController {
|
||||
|
||||
private final IMonitorService monitorService;
|
||||
|
||||
private final IDistributionMonitorService iDistributionMonitorService;
|
||||
|
||||
private final CommTerminalService commTerminalService;
|
||||
|
||||
@@ -309,24 +312,17 @@ public class CommTerminalController extends BaseController {
|
||||
|
||||
|
||||
/**
|
||||
* 通过监测点获取监测点数据单位
|
||||
* 根据监测点id获取监测点详情
|
||||
* @author cdf
|
||||
* @date 2023/9/21
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getMonitorDetail")
|
||||
@ApiOperation("根据监测点id获取数据单位")
|
||||
@ApiOperation("根据监测点id获取监测点详情")
|
||||
@ApiImplicitParam(name = "lineId", value = "实体", required = true)
|
||||
public HttpResult<LineDevGetDTO> getMonitorDetail(@RequestParam("lineId") String lineId) {
|
||||
String methodDescribe = getMethodDescribe("getMonitorDetail");
|
||||
Monitor monitor = monitorService.getById(lineId);
|
||||
if(Objects.isNull(monitor)){
|
||||
throw new BusinessException("未查询到监测点信息");
|
||||
}
|
||||
LineDevGetDTO lineDevGetDTO = new LineDevGetDTO();
|
||||
lineDevGetDTO.setPointName(monitor.getName());
|
||||
lineDevGetDTO.setInterval(monitor.getStatisticalInterval());
|
||||
lineDevGetDTO.setDevId(monitor.getTerminalId());
|
||||
LineDevGetDTO lineDevGetDTO = commTerminalService.getMonitorDetail(lineId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, lineDevGetDTO, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.pms.pojo.dto.PmsLedgerStaticDTO;
|
||||
import com.njcn.device.pms.pojo.param.SubstationExpendParam;
|
||||
import com.njcn.device.pms.pojo.vo.StationExpendMonitorVO;
|
||||
import com.njcn.device.pms.pojo.vo.SubstationExpendVO;
|
||||
import com.njcn.device.pms.pojo.po.SubstationExpend;
|
||||
import com.njcn.device.pms.service.ISubstationExpendService;
|
||||
@@ -20,11 +21,8 @@ import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
@@ -142,5 +140,20 @@ public class SubstationExpendController extends BaseController {
|
||||
boolean save = substationExpendService.removeByIds(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,save, methodDescribe);
|
||||
}
|
||||
|
||||
/**
|
||||
* 点击电站展示所属监测点信息
|
||||
* @author cdf
|
||||
* @date 2023/9/27
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getSubStationMonitor")
|
||||
@ApiOperation("点击电站展示所属监测点信息")
|
||||
public HttpResult<List<StationExpendMonitorVO>> getSubStationMonitor(@RequestParam("stationId") String stationId) {
|
||||
String methodDescribe = getMethodDescribe("getSubStationMonitor");
|
||||
List<StationExpendMonitorVO> list = substationExpendService.getSubStationMonitor(stationId);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,list, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -102,4 +102,6 @@ public interface DistributionMonitorMapper extends MppBaseMapper<DistributionMon
|
||||
List<PwPmsMonitorDTO> pwMonitorAreaDetailInfo(@Param("monitorIds") List<String> monitorIds);
|
||||
|
||||
List<String> getBaseDisMonitorIds(@Param("list")List<String> list,@Param("monitorSortIds")List<String> monitorSortIds);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.device.pms.pojo.dto.PmsLedgerStaticDTO;
|
||||
import com.njcn.device.pms.pojo.param.SubstationExpendParam;
|
||||
import com.njcn.device.pms.pojo.vo.StationExpendMonitorVO;
|
||||
import com.njcn.device.pms.pojo.vo.SubstationExpendVO;
|
||||
import com.njcn.device.pms.pojo.po.SubstationExpend;
|
||||
import com.njcn.device.pq.pojo.param.CommunicateParam;
|
||||
@@ -49,4 +50,6 @@ public interface ISubstationExpendService extends IService<SubstationExpend> {
|
||||
* @return
|
||||
*/
|
||||
Boolean updateSubstation(SubstationExpend param);
|
||||
|
||||
List<StationExpendMonitorVO> getSubStationMonitor(String stationId);
|
||||
}
|
||||
|
||||
@@ -16,11 +16,15 @@ import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.device.pms.enums.PmsDeviceResponseEnum;
|
||||
import com.njcn.device.pms.mapper.SubstationExpendMapper;
|
||||
import com.njcn.device.pms.mapper.majornetwork.DistributionMonitorMapper;
|
||||
import com.njcn.device.pms.mapper.majornetwork.MonitorMapper;
|
||||
import com.njcn.device.pms.pojo.dto.PmsGeneralDeviceDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PmsLedgerStaticDTO;
|
||||
import com.njcn.device.pms.pojo.dto.PmsSimpleDTO;
|
||||
import com.njcn.device.pms.pojo.param.PmsDeviceInfoParam;
|
||||
import com.njcn.device.pms.pojo.param.SubstationExpendParam;
|
||||
import com.njcn.device.pms.pojo.po.DistributionMonitor;
|
||||
import com.njcn.device.pms.pojo.po.Monitor;
|
||||
import com.njcn.device.pms.pojo.vo.StationExpendMonitorVO;
|
||||
import com.njcn.device.pms.pojo.vo.SubstationExpendVO;
|
||||
import com.njcn.device.pms.pojo.po.PmsTerminal;
|
||||
import com.njcn.device.pms.pojo.po.SubstationExpend;
|
||||
@@ -77,6 +81,8 @@ public class SubstationExpendServiceImpl extends ServiceImpl<SubstationExpendMap
|
||||
|
||||
private final PqsCommunicateMapper pqsCommunicateMapper;
|
||||
|
||||
private final MonitorMapper monitorMapper;
|
||||
|
||||
@Override
|
||||
public Map<String, List<SubstationExpendVO>> getSubstationExpendInfo(StatisticsBizBaseParam param) {
|
||||
Map<String, List<SubstationExpendVO>> map = new HashMap<>();
|
||||
@@ -317,8 +323,17 @@ public class SubstationExpendServiceImpl extends ServiceImpl<SubstationExpendMap
|
||||
throw new BusinessException(PmsDeviceResponseEnum.ORG_ITEM_EMPTY);
|
||||
}
|
||||
param.setDeptId(data.getCode());
|
||||
boolean save = this.save(param);
|
||||
return save;
|
||||
|
||||
//判断此电站是否绑定pms电站表里的电站
|
||||
if(StrUtil.isNotBlank(param.getSubstationId())){
|
||||
LambdaQueryWrapper<SubstationExpend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(SubstationExpend::getSubstationId,param.getSubstationId());
|
||||
int count = this.count(lambdaQueryWrapper);
|
||||
if(count>0){
|
||||
throw new BusinessException("关联电站已被绑定!");
|
||||
}
|
||||
}
|
||||
return this.save(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -329,10 +344,42 @@ public class SubstationExpendServiceImpl extends ServiceImpl<SubstationExpendMap
|
||||
throw new BusinessException(PmsDeviceResponseEnum.ORG_ITEM_EMPTY);
|
||||
}
|
||||
param.setDeptId(data.getCode());
|
||||
//判断此电站是否绑定pms电站表里的电站
|
||||
if(StrUtil.isNotBlank(param.getSubstationId())){
|
||||
LambdaQueryWrapper<SubstationExpend> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(SubstationExpend::getSubstationId,param.getSubstationId())
|
||||
.ne(SubstationExpend::getId,param.getId());
|
||||
int count = this.count(lambdaQueryWrapper);
|
||||
if(count>0){
|
||||
throw new BusinessException("关联电站已被绑定!");
|
||||
}
|
||||
}
|
||||
boolean b = this.updateById(param);
|
||||
return b;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StationExpendMonitorVO> getSubStationMonitor(String stationId) {
|
||||
List<StationExpendMonitorVO> substationExpendVOList = new ArrayList<>();
|
||||
SubstationExpend substationExpend = this.getById(stationId);
|
||||
if(Objects.nonNull(substationExpend)) {
|
||||
if(StrUtil.isNotBlank(substationExpend.getSubstationId())){
|
||||
LambdaQueryWrapper<Monitor> monitorLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
monitorLambdaQueryWrapper.eq(Monitor::getPowerrId, substationExpend.getSubstationId());
|
||||
List<Monitor> monitorList = monitorMapper.selectList(monitorLambdaQueryWrapper);
|
||||
monitorList.forEach(item -> {
|
||||
StationExpendMonitorVO stationExpendMonitorVO = new StationExpendMonitorVO();
|
||||
stationExpendMonitorVO.setStationId(stationId);
|
||||
stationExpendMonitorVO.setMonitorId(item.getId());
|
||||
stationExpendMonitorVO.setMonitorName(item.getName());
|
||||
stationExpendMonitorVO.setObjType(item.getMonitorTag());
|
||||
substationExpendVOList.add(stationExpendMonitorVO);
|
||||
});
|
||||
}
|
||||
}
|
||||
return substationExpendVOList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 名称重复校验
|
||||
*/
|
||||
|
||||
@@ -90,6 +90,6 @@ public interface CommTerminalService {
|
||||
List<CommLineDetailDTO> getRunMonitorList();
|
||||
|
||||
|
||||
|
||||
LineDevGetDTO getMonitorDetail(String monitorId);
|
||||
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.njcn.common.pojo.enums.common.ServerEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.EnumUtils;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.biz.pojo.dto.*;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
|
||||
@@ -543,4 +544,61 @@ public class CommTerminalServiceImpl implements CommTerminalService {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单个监测点信息
|
||||
* @author cdf
|
||||
* @date 2023/10/12
|
||||
*/
|
||||
@Override
|
||||
public LineDevGetDTO getMonitorDetail(String monitorId) {
|
||||
LineDevGetDTO lineDevGetDTO = new LineDevGetDTO();
|
||||
|
||||
Monitor monitor = monitorMapper.selectById(monitorId);
|
||||
if(Objects.nonNull(monitor)){
|
||||
lineDevGetDTO.setPointName(monitor.getName());
|
||||
lineDevGetDTO.setInterval(monitor.getStatisticalInterval());
|
||||
lineDevGetDTO.setDevId(monitor.getTerminalId());
|
||||
lineDevGetDTO.setVoltageLevel(monitor.getVoltageLevel());
|
||||
return lineDevGetDTO;
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<DistributionMonitor> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(DistributionMonitor::getMonitorId,monitorId);
|
||||
DistributionMonitor distributionMonitor = distributionMonitorMapper.selectOne(lambdaQueryWrapper);
|
||||
if(Objects.nonNull(distributionMonitor)){
|
||||
DictData dictDataSort = dicDataFeignClient.getDicDataById(distributionMonitor.getMonitorSort()).getData();
|
||||
|
||||
if(DicDataEnum.TWO_LINE.getCode().equals(dictDataSort.getCode())){
|
||||
//二类
|
||||
PowerDistributionarea powerDistributionarea = powerDistributionareaMapper.selectById(monitorId);
|
||||
if(Objects.nonNull(powerDistributionarea)){
|
||||
lineDevGetDTO.setPointName(powerDistributionarea.getName());
|
||||
lineDevGetDTO.setInterval(distributionMonitor.getStatisticalInterval());
|
||||
lineDevGetDTO.setDevId(distributionMonitor.getTerminalId());
|
||||
lineDevGetDTO.setVoltageLevel(powerDistributionarea.getVoltageLevel());
|
||||
return lineDevGetDTO;
|
||||
}
|
||||
}else if(DicDataEnum.THREE_LINE.getCode().equals(dictDataSort.getCode())){
|
||||
if(distributionMonitor.getIfPowerUser() == 1){
|
||||
//发电用户
|
||||
PowerGenerationUser powerGenerationUser = powerGenerationUserMapper.selectById(monitorId);
|
||||
lineDevGetDTO.setPointName(powerGenerationUser.getName());
|
||||
lineDevGetDTO.setInterval(distributionMonitor.getStatisticalInterval());
|
||||
lineDevGetDTO.setDevId(distributionMonitor.getTerminalId());
|
||||
lineDevGetDTO.setVoltageLevel(powerGenerationUser.getVoltageLevel());
|
||||
return lineDevGetDTO;
|
||||
}else {
|
||||
PowerClient powerClient = powerClientMapper.selectById(monitorId);
|
||||
lineDevGetDTO.setPointName(powerClient.getName());
|
||||
lineDevGetDTO.setInterval(distributionMonitor.getStatisticalInterval());
|
||||
lineDevGetDTO.setDevId(distributionMonitor.getTerminalId());
|
||||
lineDevGetDTO.setVoltageLevel(powerClient.getVoltageLevel());
|
||||
return lineDevGetDTO;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -379,7 +379,7 @@ public enum DicDataEnum {
|
||||
|
||||
|
||||
/**
|
||||
* 治理数据模型
|
||||
* 数据模型
|
||||
*/
|
||||
APF("APF","Apf"),
|
||||
DVR("DVR","Dvr"),
|
||||
@@ -395,6 +395,7 @@ public enum DicDataEnum {
|
||||
SET("定值","Set"),
|
||||
INSET("内部定值","InSet"),
|
||||
CTRL("控制","Ctrl"),
|
||||
TARGET_LIMIT("指标越限判断模板","target_limit"),
|
||||
/**
|
||||
* 暂降原因
|
||||
*/
|
||||
|
||||
@@ -74,7 +74,7 @@ public enum DicDataTypeEnum {
|
||||
ALARM_LEVEL("警告级别","Alarm_Level"),
|
||||
|
||||
|
||||
CS_DATA_TYPE("治理数据模型", "Cs_Data_Type"),
|
||||
CS_DATA_TYPE("数据模型类别", "Cs_Data_Type"),
|
||||
|
||||
|
||||
//pms
|
||||
|
||||
Reference in New Issue
Block a user