电能质量问题监测点超标新增需求
This commit is contained in:
@@ -3,7 +3,7 @@ package com.njcn.device.biz.commApi;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.biz.commApi.fallback.CommLineClientFallbackFactory;
|
||||
import com.njcn.device.biz.commApi.fallback.CommTerminalGeneralClientFallbackFactory;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -42,4 +42,9 @@ public interface CommLineClient {
|
||||
*/
|
||||
@PostMapping("/getLineDetailBatch")
|
||||
HttpResult<List<LineDTO>> getLineDetailBatch(@RequestParam("ids") List<String> ids);
|
||||
|
||||
|
||||
|
||||
@GetMapping("/getLineAllDetail")
|
||||
LineALLInfoDTO getLineAllDetail(@RequestParam("id") String id);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.device.biz.commApi.CommLineClient;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.utils.DeviceEnumUtil;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
@@ -43,6 +44,12 @@ public class CommLineClientFallbackFactory implements FallbackFactory<CommLineCl
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LineALLInfoDTO getLineAllDetail(String id) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "获取监测点信息", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.njcn.device.biz.pojo.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2024/4/7 16:41【需求编号】
|
||||
*超标监测点详情(本次用于超标监测点后续接口需要其他字段,自行修改)
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class LineALLInfoDTO {
|
||||
//监测点本身信息
|
||||
@ApiModelProperty(value = "监测点本身信息",name = "lineDTO")
|
||||
private LineLineDTO lineLineDTO;
|
||||
|
||||
@ApiModelProperty(value = "监测点母线信息",name = "lineBusbarDTO")
|
||||
private LineBusbarDTO lineBusbarDTO;
|
||||
|
||||
@ApiModelProperty(value = "监测点设备信息",name = "lineDeviceDTO")
|
||||
private LineDeviceDTO lineDeviceDTO;
|
||||
|
||||
@ApiModelProperty(value = "监测点电站信息",name = "lineSubStationDTO")
|
||||
private LineSubStationDTO lineSubStationDTO;
|
||||
|
||||
@ApiModelProperty(value = "监测点部门信息",name = "lineDeptDTO")
|
||||
private LineDeptDTO lineDeptDTO;
|
||||
|
||||
|
||||
|
||||
|
||||
@Data
|
||||
public static class LineLineDTO {
|
||||
@ApiModelProperty(name = "lineId",value = "监测点id")
|
||||
private String lineId;
|
||||
@ApiModelProperty(name = "linename",value = "监测点名称")
|
||||
private String linename;
|
||||
@ApiModelProperty(name = "num",value = "线路号")
|
||||
private Integer num;
|
||||
@ApiModelProperty(name = "objName",value = "监测点对象名称")
|
||||
private String objName;
|
||||
@ApiModelProperty(name = "loadType",value = "监测对象类型")
|
||||
private String loadType;
|
||||
@ApiModelProperty(name = "voltageLevel",value = "电压等级")
|
||||
private String voltageLevel;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class LineBusbarDTO {
|
||||
|
||||
@ApiModelProperty(name = "lineId",value = "母线id")
|
||||
private String busBarId;
|
||||
@ApiModelProperty(name = "linename",value = "母线名称")
|
||||
private String busBarName;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class LineDeviceDTO {
|
||||
|
||||
@ApiModelProperty(name = "deviceId",value = "设备id")
|
||||
private String deviceId;
|
||||
@ApiModelProperty(name = "deviceName",value = "设备名称")
|
||||
private String deviceName;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class LineSubStationDTO {
|
||||
@ApiModelProperty(name = "subStationId",value = "电站id")
|
||||
private String subStationId;
|
||||
@ApiModelProperty(name = "subStationName",value = "电站名称")
|
||||
private String subStationName;
|
||||
|
||||
|
||||
}
|
||||
@Data
|
||||
public static class LineDeptDTO {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
package com.njcn.device.pms.controller.ledgerManger;
|
||||
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.biz.commApi.fallback.CommTerminalGeneralClientFallbackFactory;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.pms.service.majornetwork.IMonitorService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -14,7 +13,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
@@ -43,6 +41,15 @@ public class CommLineController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getLineAllDetail")
|
||||
@ApiOperation("获取监测点id取超标监测点信息")
|
||||
public HttpResult<LineALLInfoDTO> getLineAllDetail(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getLineAllDetail");
|
||||
LineALLInfoDTO result = monitorService.getLineAllDetail(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineDetailBatch")
|
||||
@ApiOperation("批量获取监测点信息")
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.common.pojo.dto.SimpleDTO;
|
||||
import com.njcn.device.biz.pojo.dto.DeptGetChildrenDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.pms.pojo.dto.PmsMonitorBaseDTO;
|
||||
@@ -197,4 +198,6 @@ public interface IMonitorService extends IService<Monitor> {
|
||||
* @date 2024/2/26
|
||||
*/
|
||||
List<Dept> existMonitorDeptTree();
|
||||
|
||||
LineALLInfoDTO getLineAllDetail(String id);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
|
||||
import com.njcn.device.biz.pojo.dto.DeptGetChildrenDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.param.DeptGetLineParam;
|
||||
import com.njcn.device.biz.pojo.po.DeviceBak;
|
||||
@@ -612,6 +613,43 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
return deptList.stream().filter(it->monitorList.contains(it.getCode())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public LineALLInfoDTO getLineAllDetail(String id) {
|
||||
LineALLInfoDTO lineALLInfoDTO = new LineALLInfoDTO();
|
||||
Monitor monitor = this.getBaseMapper().selectById(id);
|
||||
|
||||
PmsTerminal pmsTerminal = terminalMapper.selectById(monitor.getTerminalId());
|
||||
//处理监测点信息
|
||||
LineALLInfoDTO.LineLineDTO lineLineDTO = new LineALLInfoDTO.LineLineDTO();
|
||||
lineLineDTO.setLineId(monitor.getId());
|
||||
lineLineDTO.setLinename(monitor.getLineName());
|
||||
lineLineDTO.setObjName(monitor.getMonitorObjectName());
|
||||
lineLineDTO.setLoadType(dicDataFeignClient.getDicDataById(monitor.getMonitorTag()).getData().getName());
|
||||
//电压使用母线电压
|
||||
lineLineDTO.setVoltageLevel(dicDataFeignClient.getDicDataById(monitor.getVoltageLevel()).getData().getName());
|
||||
lineALLInfoDTO.setLineLineDTO(lineLineDTO);
|
||||
//处理母线信息
|
||||
LineALLInfoDTO.LineBusbarDTO lineBusbarDTO = new LineALLInfoDTO.LineBusbarDTO();
|
||||
lineBusbarDTO.setBusBarId(monitor.getLineId());
|
||||
lineBusbarDTO.setBusBarName(monitor.getLineName());
|
||||
lineALLInfoDTO.setLineBusbarDTO(lineBusbarDTO);
|
||||
//处理设备信息
|
||||
LineALLInfoDTO.LineDeviceDTO lineDeviceDTO = new LineALLInfoDTO.LineDeviceDTO();
|
||||
lineDeviceDTO.setDeviceId(monitor.getTerminalId());
|
||||
lineDeviceDTO.setDeviceName(pmsTerminal.getName());
|
||||
lineALLInfoDTO.setLineDeviceDTO(lineDeviceDTO);
|
||||
//处理电站信息
|
||||
LineALLInfoDTO.LineSubStationDTO lineSubStationDTO = new LineALLInfoDTO.LineSubStationDTO();
|
||||
lineSubStationDTO.setSubStationId(monitor.getPowerrId());
|
||||
lineSubStationDTO.setSubStationName(monitor.getPowerrName());
|
||||
|
||||
lineALLInfoDTO.setLineSubStationDTO(lineSubStationDTO);
|
||||
//todo 处理部门信息后续需要部门信息在添加
|
||||
|
||||
|
||||
return lineALLInfoDTO;
|
||||
}
|
||||
|
||||
|
||||
private String dealDataBatchUpdate(List<PmsLedgerExcel> pmsLedgerExcelList) {
|
||||
List<PmsLedgerExcel> oracleTerminalExcelMsg = new ArrayList<>();
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.pq.service.LineService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -40,6 +41,15 @@ public class CommLineController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/getLineAllDetail")
|
||||
@ApiOperation("获取监测点id取超标监测点信息")
|
||||
public HttpResult<LineALLInfoDTO> getLineAllDetail(@RequestParam("id") String id) {
|
||||
String methodDescribe = getMethodDescribe("getLineAllDetail");
|
||||
LineALLInfoDTO result = lineService.getLineAllDetail(id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getLineDetailBatch")
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.device.pq.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionLineDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionParamDTO;
|
||||
import com.njcn.device.pq.pojo.dto.PollutionSubstationDTO;
|
||||
@@ -205,4 +206,6 @@ public interface LineService {
|
||||
* @Date: 2023/11/8 15:46
|
||||
*/
|
||||
List<LineDetailVO.Detail> getLineDetailByIds(List<String> ids);
|
||||
|
||||
LineALLInfoDTO getLineAllDetail(String id);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.njcn.common.utils.EnumUtils;
|
||||
import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.biz.pojo.dto.LineDTO;
|
||||
import com.njcn.device.biz.pojo.dto.LineALLInfoDTO;
|
||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||
import com.njcn.device.pq.enums.LineBaseEnum;
|
||||
import com.njcn.device.pq.pojo.dto.GeneralDeviceDTO;
|
||||
@@ -552,6 +553,84 @@ public class LineServiceImpl extends ServiceImpl<LineMapper, Line> implements Li
|
||||
return details;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LineALLInfoDTO getLineAllDetail(String id) {
|
||||
LineALLInfoDTO lineALLInfoDTO = new LineALLInfoDTO();
|
||||
//根据id查询当前信息的pids
|
||||
List<String> pids = Arrays.asList(this.baseMapper.selectById(id).getPids().split(","));
|
||||
List<String> list = new ArrayList(pids);
|
||||
list.add(id);
|
||||
List<LineDataVO> lineDataVOList = this.baseMapper.getLineDetail(list);
|
||||
LineDetailDataVO lineDetailDataVO = new LineDetailDataVO();
|
||||
|
||||
String areaId = "",gdId="",subStationId = "", devId = "", voId = "",lineId="",
|
||||
areaName = "",gdName="",subStationName = "", devName = "", voName = "",lineName="";
|
||||
for (LineDataVO lineDataVO : lineDataVOList) {
|
||||
switch (lineDataVO.getLevel()) {
|
||||
case 1:
|
||||
areaId = lineDataVO.getId();
|
||||
areaName = lineDataVO.getName();
|
||||
break;
|
||||
case 2:
|
||||
gdId = lineDataVO.getId();
|
||||
gdName = lineDataVO.getName();
|
||||
break;
|
||||
case 3:
|
||||
subStationId = lineDataVO.getId();
|
||||
subStationName = lineDataVO.getName();
|
||||
break;
|
||||
case 4:
|
||||
devId = lineDataVO.getId();
|
||||
devName = lineDataVO.getName();
|
||||
break;
|
||||
case 5:
|
||||
voId = lineDataVO.getId();
|
||||
voName = lineDataVO.getName();
|
||||
break;
|
||||
case 6:
|
||||
lineId = lineDataVO.getId();
|
||||
lineName = lineDataVO.getName();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
LineDetail lineDetail = lineDetailMapper.selectById(id);
|
||||
Voltage voltage = voltageMapper.selectById(voId);
|
||||
Device device = deviceMapper.selectById(devId);
|
||||
Substation substation = substationMapper.selectById(subStationId);
|
||||
//处理监测点信息
|
||||
LineALLInfoDTO.LineLineDTO lineLineDTO = new LineALLInfoDTO.LineLineDTO();
|
||||
lineLineDTO.setLineId(lineId);
|
||||
lineLineDTO.setLinename(lineName);
|
||||
lineLineDTO.setNum(lineDetail.getNum());
|
||||
lineLineDTO.setObjName(lineDetail.getObjName());
|
||||
lineLineDTO.setLoadType(dicDataFeignClient.getDicDataById(lineDetail.getLoadType()).getData().getName());
|
||||
//电压使用母线电压
|
||||
lineLineDTO.setVoltageLevel(dicDataFeignClient.getDicDataById(voltage.getScale()).getData().getName());
|
||||
lineALLInfoDTO.setLineLineDTO(lineLineDTO);
|
||||
//处理母线信息
|
||||
LineALLInfoDTO.LineBusbarDTO lineBusbarDTO = new LineALLInfoDTO.LineBusbarDTO();
|
||||
lineBusbarDTO.setBusBarId(voId);
|
||||
lineBusbarDTO.setBusBarName(voName);
|
||||
lineALLInfoDTO.setLineBusbarDTO(lineBusbarDTO);
|
||||
//处理设备信息
|
||||
LineALLInfoDTO.LineDeviceDTO lineDeviceDTO = new LineALLInfoDTO.LineDeviceDTO();
|
||||
lineDeviceDTO.setDeviceId(devId);
|
||||
lineDeviceDTO.setDeviceName(devName);
|
||||
lineALLInfoDTO.setLineDeviceDTO(lineDeviceDTO);
|
||||
//处理电站信息
|
||||
LineALLInfoDTO.LineSubStationDTO lineSubStationDTO = new LineALLInfoDTO.LineSubStationDTO();
|
||||
lineSubStationDTO.setSubStationId(subStationId);
|
||||
lineSubStationDTO.setSubStationName(subStationName);
|
||||
|
||||
lineALLInfoDTO.setLineSubStationDTO(lineSubStationDTO);
|
||||
//todo 处理部门信息后续需要部门信息在添加
|
||||
|
||||
return lineALLInfoDTO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Overlimit> getOverLimitByList(PollutionParamDTO pollutionParamDTO) {
|
||||
return overlimitMapper.selectBatchIds(pollutionParamDTO.getLineList());
|
||||
|
||||
Reference in New Issue
Block a user