两级贯通接口开发
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package com.njcn.device.pms.api;
|
package com.njcn.device.pms.api;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.common.pojo.constant.ServerInfo;
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.device.pms.api.fallback.MonitorClientFallbackFactory;
|
import com.njcn.device.pms.api.fallback.MonitorClientFallbackFactory;
|
||||||
@@ -8,6 +9,7 @@ import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
|||||||
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
|
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
|
||||||
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
|
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
|
||||||
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
|
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
|
||||||
|
import com.njcn.device.pms.pojo.param.TerminalQueryParam;
|
||||||
import com.njcn.device.pms.pojo.po.Monitor;
|
import com.njcn.device.pms.pojo.po.Monitor;
|
||||||
import com.njcn.device.pms.pojo.vo.MonitorVO;
|
import com.njcn.device.pms.pojo.vo.MonitorVO;
|
||||||
import com.njcn.device.biz.pojo.po.Overlimit;
|
import com.njcn.device.biz.pojo.po.Overlimit;
|
||||||
@@ -68,6 +70,10 @@ public interface MonitorClient {
|
|||||||
HttpResult<List<Monitor>> getMonitorList(@RequestBody List<String> monitorIds);
|
HttpResult<List<Monitor>> getMonitorList(@RequestBody List<String> monitorIds);
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("getMonitorPage")
|
||||||
|
HttpResult<Page<Monitor>> getMonitorPage(@RequestBody TerminalQueryParam baseParam);
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* 获取台账和终端信息(波形专用)
|
* 获取台账和终端信息(波形专用)
|
||||||
* @author wr
|
* @author wr
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.njcn.device.pms.api;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.njcn.common.pojo.constant.ServerInfo;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.device.pms.api.fallback.PmsMidLedgerClientFallbackFactory;
|
||||||
|
import com.njcn.device.pms.api.fallback.StatationStatClientFallbackFactory;
|
||||||
|
import com.njcn.device.pms.pojo.dto.PmsStatationStatInfoDTO;
|
||||||
|
import com.njcn.device.pms.pojo.param.PmsBaseParam;
|
||||||
|
import com.njcn.device.pms.pojo.param.PmsStatationStatInfoParam;
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsMidLedger;
|
||||||
|
import com.njcn.device.pms.pojo.po.StatationStat;
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author yzh
|
||||||
|
* @date 2022/10/18
|
||||||
|
*/
|
||||||
|
@FeignClient(value = ServerInfo.DEVICE,
|
||||||
|
path = "/pms/pmsMidLedger",
|
||||||
|
contextId = "pms/pmsMidLedger",
|
||||||
|
fallbackFactory = PmsMidLedgerClientFallbackFactory.class)
|
||||||
|
public interface PmsMidLedgerClient {
|
||||||
|
|
||||||
|
@PostMapping("getPmsMidLedgerList")
|
||||||
|
HttpResult<List<PmsMidLedger>> getPmsMidLedgerList(@RequestBody List<String> ids);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.njcn.device.pms.api.fallback;
|
package com.njcn.device.pms.api.fallback;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
@@ -9,6 +10,7 @@ import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO;
|
|||||||
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
|
import com.njcn.device.pms.pojo.param.MonitorTerminalParam;
|
||||||
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
|
import com.njcn.device.pms.pojo.param.PmsMonitorInfoParam;
|
||||||
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
|
import com.njcn.device.pms.pojo.param.PmsMonitorParam;
|
||||||
|
import com.njcn.device.pms.pojo.param.TerminalQueryParam;
|
||||||
import com.njcn.device.pms.pojo.po.Monitor;
|
import com.njcn.device.pms.pojo.po.Monitor;
|
||||||
import com.njcn.device.pms.pojo.vo.MonitorVO;
|
import com.njcn.device.pms.pojo.vo.MonitorVO;
|
||||||
import com.njcn.device.pms.utils.PmsDeviceEnumUtil;
|
import com.njcn.device.pms.utils.PmsDeviceEnumUtil;
|
||||||
@@ -62,6 +64,12 @@ public class MonitorClientFallbackFactory implements FallbackFactory<MonitorClie
|
|||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<Page<Monitor>> getMonitorPage(TerminalQueryParam baseParam) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "分页获取主网监测点数据 ", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HttpResult<MonitorVO> getMonitorTerminal(MonitorTerminalParam param) {
|
public HttpResult<MonitorVO> getMonitorTerminal(MonitorTerminalParam param) {
|
||||||
log.error("{}异常,降级处理,异常为:{}", "获取台账和终端信息(波形专用) ", throwable.toString());
|
log.error("{}异常,降级处理,异常为:{}", "获取台账和终端信息(波形专用) ", throwable.toString());
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.njcn.device.pms.api.fallback;
|
||||||
|
|
||||||
|
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.pms.api.PmsMidLedgerClient;
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsMidLedger;
|
||||||
|
import com.njcn.device.pms.utils.PmsDeviceEnumUtil;
|
||||||
|
import feign.hystrix.FallbackFactory;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author yzh
|
||||||
|
* @date 2022/10/18
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Component
|
||||||
|
public class PmsMidLedgerClientFallbackFactory implements FallbackFactory<PmsMidLedgerClient> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PmsMidLedgerClient create(Throwable throwable) {
|
||||||
|
//判断抛出异常是否为解码器抛出的业务异常
|
||||||
|
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||||
|
if (throwable.getCause() instanceof BusinessException) {
|
||||||
|
BusinessException businessException = (BusinessException) throwable.getCause();
|
||||||
|
exceptionEnum = PmsDeviceEnumUtil.getExceptionEnum(businessException.getResult());
|
||||||
|
}
|
||||||
|
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||||
|
return new PmsMidLedgerClient() {
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<PmsMidLedger>> getPmsMidLedgerList(List<String> ids) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}", "获取中台电站母线信息", throwable.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModelProperty;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pqs
|
* pqs
|
||||||
*
|
*
|
||||||
@@ -38,4 +40,6 @@ public class TerminalQueryParam extends BaseParam {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "主网上送标识")
|
@ApiModelProperty(value = "主网上送标识")
|
||||||
private Integer monitorUploadStatus;
|
private Integer monitorUploadStatus;
|
||||||
|
|
||||||
|
private List<String> monitorIds;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.njcn.device.pms.pojo.po;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.njcn.db.bo.BaseEntity;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -47,6 +48,26 @@ public class PmsMidLedger extends BaseEntity {
|
|||||||
@TableField(value = "SectionId")
|
@TableField(value = "SectionId")
|
||||||
private String SectionId;
|
private String SectionId;
|
||||||
|
|
||||||
|
@TableField(value = "cityOrg")
|
||||||
|
private String cityOrg;
|
||||||
|
|
||||||
|
@TableField(value = "cityOrgName")
|
||||||
|
private String cityOrgName;
|
||||||
|
|
||||||
|
@TableField(value = "maintCrew")
|
||||||
|
private String maintCrew;
|
||||||
|
|
||||||
|
@TableField(value = "maintCrewName")
|
||||||
|
private String maintCrewName;
|
||||||
|
|
||||||
|
private String OperationId;
|
||||||
|
|
||||||
|
private String OperationName;
|
||||||
|
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private LocalDateTime OperationDate;
|
||||||
|
|
||||||
|
private String AssetNo;
|
||||||
/**
|
/**
|
||||||
* 名称
|
* 名称
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.njcn.device.pms.controller.ledgerManger;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
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.pms.pojo.po.PmsMidLedger;
|
||||||
|
import com.njcn.device.pms.service.ledgerManger.IPmsMidLedgerService;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
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.RestController;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 变电站-母线数据中间表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-05-14
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("pms/pmsMidLedger")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class PmsMidLedgerController extends BaseController {
|
||||||
|
|
||||||
|
private final IPmsMidLedgerService iPmsMidLedgerService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取中台电站母线信息
|
||||||
|
* @author cdf
|
||||||
|
* @date 2024/5/14
|
||||||
|
*/
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getPmsMidLedgerList")
|
||||||
|
@ApiOperation("获取中台电站母线信息")
|
||||||
|
@ApiImplicitParam(name = "ids",value = "母线电站编号",required = true)
|
||||||
|
public HttpResult<List<PmsMidLedger>> getPmsMidLedgerList(@RequestBody List<String> ids){
|
||||||
|
String methodDescribe = getMethodDescribe("getPmsMidLedgerList");
|
||||||
|
List<PmsMidLedger> result = iPmsMidLedgerService.list(new LambdaQueryWrapper<PmsMidLedger>().in(PmsMidLedger::getId,ids));
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@@ -138,6 +138,16 @@ public class PmsMonitorController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getMonitorPage")
|
||||||
|
@ApiOperation("获取所有主网监测点(或者指定监测点编号查询)")
|
||||||
|
@ApiImplicitParam(name = "monitorIds",value = "主网监测点编号",required = true)
|
||||||
|
public HttpResult<Page<Monitor>> getMonitorPage(@RequestBody TerminalQueryParam baseParam) {
|
||||||
|
String methodDescribe = getMethodDescribe("getMonitorPage");
|
||||||
|
Page<Monitor> monitor= monitorService.getMonitorPage(baseParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitor, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件获取所有主网监测点
|
* 根据条件获取所有主网监测点
|
||||||
* @author cdf
|
* @author cdf
|
||||||
@@ -310,6 +320,9 @@ public class PmsMonitorController extends BaseController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException {
|
public static void main(String[] args) throws IOException {
|
||||||
/*try {
|
/*try {
|
||||||
// 创建一个临时文件,前缀为"temp_",后缀为".txt",存储在默认的临时文件夹中
|
// 创建一个临时文件,前缀为"temp_",后缀为".txt",存储在默认的临时文件夹中
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.njcn.device.pms.service.ledgerManger;
|
||||||
|
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsMidLedger;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 变电站-母线数据中间表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-05-14
|
||||||
|
*/
|
||||||
|
public interface IPmsMidLedgerService extends IService<PmsMidLedger> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.njcn.device.pms.service.ledgerManger.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.device.pms.mapper.majornetwork.PmsMidLedgerMapper;
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsMidLedger;
|
||||||
|
import com.njcn.device.pms.service.ledgerManger.IPmsMidLedgerService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 变电站-母线数据中间表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author hongawen
|
||||||
|
* @since 2024-05-14
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PmsMidLedgerServiceImpl extends ServiceImpl<PmsMidLedgerMapper, PmsMidLedger> implements IPmsMidLedgerService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -82,6 +82,9 @@ public interface IMonitorService extends IService<Monitor> {
|
|||||||
|
|
||||||
List<Monitor> getMonitorList(List<String> monitorIds);
|
List<Monitor> getMonitorList(List<String> monitorIds);
|
||||||
|
|
||||||
|
|
||||||
|
Page<Monitor> getMonitorPage(TerminalQueryParam baseParam);
|
||||||
|
|
||||||
List<Monitor> getMonitorListByParam(MonitorParam monitorParam);
|
List<Monitor> getMonitorListByParam(MonitorParam monitorParam);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -292,6 +292,16 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
|||||||
return monitorList;
|
return monitorList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<Monitor> getMonitorPage(TerminalQueryParam baseParam) {
|
||||||
|
LambdaQueryWrapper<Monitor> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(Monitor::getStatus, DataStateEnum.ENABLE.getCode());
|
||||||
|
lambdaQueryWrapper.in(Monitor::getId, baseParam.getMonitorIds());
|
||||||
|
Page<Monitor> page = this.page(new Page<>(PageFactory.getPageNum(baseParam),PageFactory.getPageSize(baseParam)),lambdaQueryWrapper);
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Monitor> getMonitorListByParam(MonitorParam monitorParam) {
|
public List<Monitor> getMonitorListByParam(MonitorParam monitorParam) {
|
||||||
LambdaQueryWrapper<Monitor> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Monitor> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class RDimUpDTO {
|
public class RDimUpDTO {
|
||||||
|
|
||||||
|
private String busId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 中台母线编号
|
* 中台母线编号
|
||||||
*/
|
*/
|
||||||
@@ -25,4 +27,6 @@ public class RDimUpDTO {
|
|||||||
* 监测母线有效监测点ids
|
* 监测母线有效监测点ids
|
||||||
*/
|
*/
|
||||||
private String effectIds;
|
private String effectIds;
|
||||||
|
|
||||||
|
private Double v;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,4 +35,45 @@ public class DimBusBarVO {
|
|||||||
|
|
||||||
private Integer busEfectiveMnitorNum;
|
private Integer busEfectiveMnitorNum;
|
||||||
private String busEffectiveMonitors;
|
private String busEffectiveMonitors;
|
||||||
|
|
||||||
|
private Integer harmonicNum;
|
||||||
|
private String indexAvgValue;
|
||||||
|
private String monitorId;
|
||||||
|
private String monitorName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class DimBusBarMonitorVO{
|
||||||
|
private String id;
|
||||||
|
private String busId;
|
||||||
|
private String busName;
|
||||||
|
private String busVoltageLevel;
|
||||||
|
private String busVoltageLevelName;
|
||||||
|
private String cityOrg;
|
||||||
|
private String cityOrgName;
|
||||||
|
|
||||||
|
private Integer actualCollectNum;
|
||||||
|
private Float dataFullRate;
|
||||||
|
private Integer expectCollectNum;
|
||||||
|
private String statDate;
|
||||||
|
private String status;
|
||||||
|
private String statusName;
|
||||||
|
private String whetherOptimal;
|
||||||
|
private String whetherOptimalName;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private String maintOrg;
|
||||||
|
private String maintOrgName;
|
||||||
|
private String monitorId;
|
||||||
|
private String monitorName;
|
||||||
|
|
||||||
|
private String stationId;
|
||||||
|
private String stationName;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,5 +70,15 @@ public class EvaluationDownController extends BaseController {
|
|||||||
return new PmsHttpResult<>(0, page);
|
return new PmsHttpResult<>(0, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getMonitorListByBus")
|
||||||
|
@ApiOperation("国网上送-接收总部基准水平评估监测母线下有效监测点详情下穿接口")
|
||||||
|
@ApiImplicitParam(name = "param", value = "实体参数", required = true)
|
||||||
|
public PmsHttpResult<Page<DimBusBarVO.DimBusBarMonitorVO>> getMonitorListByBus(@RequestBody DimBusBarParam param) {
|
||||||
|
String methodDescribe = getMethodDescribe("getMonitorListByBus");
|
||||||
|
Page<DimBusBarVO.DimBusBarMonitorVO> page = evaluationDataService.getMonitorListByBus(param);
|
||||||
|
return new PmsHttpResult<>(0, page);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,4 +57,8 @@
|
|||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import org.apache.ibatis.annotations.Param;
|
|||||||
*/
|
*/
|
||||||
public interface RUploadEvaluationDataDMapper extends BaseMapper<RUploadEvaluationDataD> {
|
public interface RUploadEvaluationDataDMapper extends BaseMapper<RUploadEvaluationDataD> {
|
||||||
|
|
||||||
public Page<DimBusBarVO> getBaseEvaOnlineBusDetail(@Param("page") Page<DimBusBarVO> page, @Param("param") DimBusBarParam param);
|
Page<DimBusBarVO> getBaseEvaOnlineBusDetail(@Param("page") Page<DimBusBarVO> page, @Param("param") DimBusBarParam param);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,4 +44,6 @@ public interface IEvaluationDataService extends IService<RUploadEvaluationDataD>
|
|||||||
|
|
||||||
Page<DimBusBarVO> getBusListByVoltageLevel(DimBusBarParam param);
|
Page<DimBusBarVO> getBusListByVoltageLevel(DimBusBarParam param);
|
||||||
|
|
||||||
|
Page<DimBusBarVO.DimBusBarMonitorVO> getMonitorListByBus(DimBusBarParam param);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollUtil;
|
|||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.date.DatePattern;
|
import cn.hutool.core.date.DatePattern;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
@@ -15,6 +16,11 @@ import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.device.pms.api.MonitorClient;
|
||||||
|
import com.njcn.device.pms.api.PmsMidLedgerClient;
|
||||||
|
import com.njcn.device.pms.pojo.param.TerminalQueryParam;
|
||||||
|
import com.njcn.device.pms.pojo.po.Monitor;
|
||||||
|
import com.njcn.device.pms.pojo.po.PmsMidLedger;
|
||||||
import com.njcn.harmonic.mapper.upload.*;
|
import com.njcn.harmonic.mapper.upload.*;
|
||||||
import com.njcn.harmonic.pojo.dto.upload.PqEvaluationCreateDTO;
|
import com.njcn.harmonic.pojo.dto.upload.PqEvaluationCreateDTO;
|
||||||
import com.njcn.harmonic.pojo.dto.upload.RDimUpDTO;
|
import com.njcn.harmonic.pojo.dto.upload.RDimUpDTO;
|
||||||
@@ -76,6 +82,12 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
|
|||||||
|
|
||||||
private final RDimBusUpYMapper rDimBusUpYMapper;
|
private final RDimBusUpYMapper rDimBusUpYMapper;
|
||||||
|
|
||||||
|
private final MonitorClient monitorClient;
|
||||||
|
|
||||||
|
private final PmsMidLedgerClient pmsMidLedgerClient;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<UploadEvaluationDataVo> getEvaluationData(UploadDataParam param) {
|
public Page<UploadEvaluationDataVo> getEvaluationData(UploadDataParam param) {
|
||||||
@@ -208,17 +220,11 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
|
|||||||
temBusIds = new ArrayList<>(Arrays.asList(pmsRunStatisticD.getRunBusIds().split(StrUtil.COMMA)));
|
temBusIds = new ArrayList<>(Arrays.asList(pmsRunStatisticD.getRunBusIds().split(StrUtil.COMMA)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//稳态指标条件筛选
|
//稳态指标条件筛选
|
||||||
if (StrUtil.isNotBlank(param.getIndexType())) {
|
QueryWrapper<RDimBusUpD> queryWrapper = new QueryWrapper<>();
|
||||||
QueryWrapper<RDimBusUpD> queryWrapper = new QueryWrapper<>();
|
this.harmTarget(param, temBusIds, queryWrapper);
|
||||||
this.harmTarget(param,temBusIds, queryWrapper);
|
List<RDimBusUpD> rDimBusUpDList = rDimBusUpDMapper.selectList(queryWrapper);
|
||||||
List<RDimBusUpD> rDimBusUpDList = rDimBusUpDMapper.selectList(queryWrapper);
|
temBusIds = rDimBusUpDList.stream().map(RDimBusUpD::getMidBusId).distinct().collect(Collectors.toList());
|
||||||
if (CollectionUtil.isEmpty(rDimBusUpDList)) {
|
|
||||||
return new Page<>();
|
|
||||||
}
|
|
||||||
temBusIds = rDimBusUpDList.stream().map(RDimBusUpD::getMidBusId).distinct().collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
} else if (param.getStatType().equals(DicDataEnum.STATISTICAL_TYPE_M.getCode())) {
|
} else if (param.getStatType().equals(DicDataEnum.STATISTICAL_TYPE_M.getCode())) {
|
||||||
//具体日期投运,监测台账查询
|
//具体日期投运,监测台账查询
|
||||||
LambdaQueryWrapper<PmsRunStatisticM> dayLam = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PmsRunStatisticM> dayLam = new LambdaQueryWrapper<>();
|
||||||
@@ -233,16 +239,11 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
|
|||||||
}
|
}
|
||||||
|
|
||||||
//稳态指标条件筛选
|
//稳态指标条件筛选
|
||||||
if (StrUtil.isNotBlank(param.getIndexType())) {
|
|
||||||
QueryWrapper<RDimBusUpM> queryWrapper = new QueryWrapper<>();
|
|
||||||
this.harmTarget(param,temBusIds, queryWrapper);
|
|
||||||
List<RDimBusUpM> rDimBusUpMList = rDimBusUpMMapper.selectList(queryWrapper);
|
|
||||||
if (CollectionUtil.isEmpty(rDimBusUpMList)) {
|
|
||||||
return new Page<>();
|
|
||||||
}
|
|
||||||
temBusIds = rDimBusUpMList.stream().map(RDimBusUpM::getMidBusId).distinct().collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
QueryWrapper<RDimBusUpM> queryWrapper = new QueryWrapper<>();
|
||||||
|
this.harmTarget(param, temBusIds, queryWrapper);
|
||||||
|
List<RDimBusUpM> rDimBusUpMList = rDimBusUpMMapper.selectList(queryWrapper);
|
||||||
|
temBusIds = rDimBusUpMList.stream().map(RDimBusUpM::getMidBusId).distinct().collect(Collectors.toList());
|
||||||
} else if (param.getStatType().equals(DicDataEnum.STATISTICAL_TYPE_Y.getCode())) {
|
} else if (param.getStatType().equals(DicDataEnum.STATISTICAL_TYPE_Y.getCode())) {
|
||||||
|
|
||||||
//具体日期投运,监测台账查询
|
//具体日期投运,监测台账查询
|
||||||
@@ -258,17 +259,15 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
|
|||||||
}
|
}
|
||||||
|
|
||||||
//稳态指标条件筛选
|
//稳态指标条件筛选
|
||||||
if (StrUtil.isNotBlank(param.getIndexType())) {
|
|
||||||
QueryWrapper<RDimBusUpY> queryWrapper = new QueryWrapper<>();
|
|
||||||
this.harmTarget(param,temBusIds, queryWrapper);
|
|
||||||
List<RDimBusUpY> rDimBusUpYList = rDimBusUpYMapper.selectList(queryWrapper);
|
|
||||||
if (CollectionUtil.isEmpty(rDimBusUpYList)) {
|
|
||||||
return new Page<>();
|
|
||||||
}
|
|
||||||
temBusIds = rDimBusUpYList.stream().map(RDimBusUpY::getMidBusId).distinct().collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
QueryWrapper<RDimBusUpY> queryWrapper = new QueryWrapper<>();
|
||||||
|
this.harmTarget(param, temBusIds, queryWrapper);
|
||||||
|
List<RDimBusUpY> rDimBusUpYList = rDimBusUpYMapper.selectList(queryWrapper);
|
||||||
|
temBusIds = rDimBusUpYList.stream().map(RDimBusUpY::getMidBusId).distinct().collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
if (CollectionUtil.isEmpty(temBusIds)) {
|
||||||
|
return new Page<>();
|
||||||
|
}
|
||||||
param.setOnlineBusIds(temBusIds);
|
param.setOnlineBusIds(temBusIds);
|
||||||
if (CollectionUtil.isEmpty(temBusIds)) {
|
if (CollectionUtil.isEmpty(temBusIds)) {
|
||||||
return new Page<>();
|
return new Page<>();
|
||||||
@@ -279,7 +278,6 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
|
|||||||
@Override
|
@Override
|
||||||
public Page<DimBusBarVO> getBaseEvaMonitorBusDetail(DimBusBarParam param) {
|
public Page<DimBusBarVO> getBaseEvaMonitorBusDetail(DimBusBarParam param) {
|
||||||
List<String> temBusIds = new ArrayList<>();
|
List<String> temBusIds = new ArrayList<>();
|
||||||
|
|
||||||
List<RDimUpDTO> rDimUpDTOList = new ArrayList<>();
|
List<RDimUpDTO> rDimUpDTOList = new ArrayList<>();
|
||||||
|
|
||||||
LocalDate begin = LocalDate.parse(param.getStartTime());
|
LocalDate begin = LocalDate.parse(param.getStartTime());
|
||||||
@@ -292,82 +290,23 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
|
|||||||
} else if (DicDataEnum.STATISTICAL_TYPE_Y.getCode().equals(statisticType)) {
|
} else if (DicDataEnum.STATISTICAL_TYPE_Y.getCode().equals(statisticType)) {
|
||||||
temBusIds = getOnlineBusIds(param.getNodeId(), begin, PmsRunStatisticY.class);
|
temBusIds = getOnlineBusIds(param.getNodeId(), begin, PmsRunStatisticY.class);
|
||||||
}
|
}
|
||||||
|
temBusIds = this.busTargetAss(param, temBusIds, rDimUpDTOList);
|
||||||
|
|
||||||
if (StrUtil.isNotBlank(param.getIndexType())) {
|
|
||||||
if (DicDataEnum.STATISTICAL_TYPE_D.getCode().equals(statisticType)) {
|
|
||||||
QueryWrapper<RDimBusUpD> queryWrapper = new QueryWrapper<>();
|
|
||||||
this.harmTarget(param,temBusIds, queryWrapper);
|
|
||||||
List<RDimBusUpD> rDimBusUpDList = rDimBusUpDMapper.selectList(queryWrapper);
|
|
||||||
if (CollectionUtil.isEmpty(rDimBusUpDList)) {
|
|
||||||
return new Page<>();
|
|
||||||
}
|
|
||||||
rDimBusUpDList.stream().filter(it->it.getPhasicType().equals("A")).forEach(it->{
|
|
||||||
RDimUpDTO rDimUpDTO = new RDimUpDTO();
|
|
||||||
rDimUpDTO.setBusMidId(it.getMidBusId());
|
|
||||||
rDimUpDTO.setEffectId(it.getEffectId());
|
|
||||||
rDimUpDTO.setEffectIds(it.getEffectIds());
|
|
||||||
rDimUpDTOList.add(rDimUpDTO);
|
|
||||||
});
|
|
||||||
temBusIds = rDimBusUpDList.stream().map(RDimBusUpD::getMidBusId).distinct().collect(Collectors.toList());
|
|
||||||
this.harmTarget(param, temBusIds, queryWrapper);
|
|
||||||
} else if (DicDataEnum.STATISTICAL_TYPE_M.getCode().equals(statisticType)) {
|
|
||||||
QueryWrapper<RDimBusUpM> queryWrapper = new QueryWrapper<>();
|
|
||||||
this.harmTarget(param,temBusIds, queryWrapper);
|
|
||||||
List<RDimBusUpM> rDimBusUpMList = rDimBusUpMMapper.selectList(queryWrapper);
|
|
||||||
if (CollectionUtil.isEmpty(rDimBusUpMList)) {
|
|
||||||
return new Page<>();
|
|
||||||
}
|
|
||||||
rDimBusUpMList.stream().filter(it->it.getPhasicType().equals("A")).forEach(it->{
|
|
||||||
RDimUpDTO rDimUpDTO = new RDimUpDTO();
|
|
||||||
rDimUpDTO.setBusMidId(it.getMidBusId());
|
|
||||||
rDimUpDTO.setEffectId(it.getEffectId());
|
|
||||||
rDimUpDTO.setEffectIds(it.getEffectIds());
|
|
||||||
rDimUpDTOList.add(rDimUpDTO);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (CollectionUtil.isEmpty(rDimBusUpMList)) {
|
|
||||||
return new Page<>();
|
|
||||||
}
|
|
||||||
temBusIds = rDimBusUpMList.stream().map(RDimBusUpM::getMidBusId).distinct().collect(Collectors.toList());
|
|
||||||
} else if (DicDataEnum.STATISTICAL_TYPE_Y.getCode().equals(statisticType)) {
|
|
||||||
QueryWrapper<RDimBusUpY> queryWrapper = new QueryWrapper<>();
|
|
||||||
this.harmTarget(param,temBusIds, queryWrapper);
|
|
||||||
List<RDimBusUpY> rDimBusUpYList = rDimBusUpYMapper.selectList(queryWrapper);
|
|
||||||
if (CollectionUtil.isEmpty(rDimBusUpYList)) {
|
|
||||||
return new Page<>();
|
|
||||||
}
|
|
||||||
rDimBusUpYList.stream().filter(it->it.getPhasicType().equals("A")).forEach(it->{
|
|
||||||
RDimUpDTO rDimUpDTO = new RDimUpDTO();
|
|
||||||
rDimUpDTO.setBusMidId(it.getMidBusId());
|
|
||||||
rDimUpDTO.setEffectId(it.getEffectId());
|
|
||||||
rDimUpDTO.setEffectIds(it.getEffectIds());
|
|
||||||
rDimUpDTOList.add(rDimUpDTO);
|
|
||||||
});
|
|
||||||
|
|
||||||
if (CollectionUtil.isEmpty(rDimBusUpYList)) {
|
|
||||||
return new Page<>();
|
|
||||||
}
|
|
||||||
temBusIds = rDimBusUpYList.stream().map(RDimBusUpY::getMidBusId).distinct().collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
param.setOnlineBusIds(temBusIds);
|
|
||||||
if (CollectionUtil.isEmpty(temBusIds)) {
|
if (CollectionUtil.isEmpty(temBusIds)) {
|
||||||
return new Page<>();
|
return new Page<>();
|
||||||
}
|
}
|
||||||
|
param.setOnlineBusIds(temBusIds);
|
||||||
Page<DimBusBarVO> page = this.baseMapper.getBaseEvaOnlineBusDetail(new Page<>(param.getPageNum(), param.getPageSize()), param);
|
Page<DimBusBarVO> page = this.baseMapper.getBaseEvaOnlineBusDetail(new Page<>(param.getPageNum(), param.getPageSize()), param);
|
||||||
if(CollectionUtil.isNotEmpty(page.getRecords())){
|
if (CollectionUtil.isNotEmpty(page.getRecords())) {
|
||||||
Map<String,RDimUpDTO> map = rDimUpDTOList.stream().collect(Collectors.toMap(RDimUpDTO::getBusMidId,Function.identity()));
|
Map<String, RDimUpDTO> map = rDimUpDTOList.stream().collect(Collectors.toMap(RDimUpDTO::getBusMidId, Function.identity()));
|
||||||
page.getRecords().forEach(it->{
|
page.getRecords().forEach(it -> {
|
||||||
it.setBusEfectiveMnitorNum(map.containsKey(it.getAstId())?map.get(it.getAstId()).getEffectIds().split(StrUtil.COMMA).length:0);
|
it.setBusEfectiveMnitorNum(map.containsKey(it.getAstId()) ? map.get(it.getAstId()).getEffectIds().split(StrUtil.COMMA).length : 0);
|
||||||
it.setBusEffectiveMonitors(map.containsKey(it.getAstId())?map.get(it.getAstId()).getEffectIds():null);
|
it.setBusEffectiveMonitors(map.containsKey(it.getAstId()) ? map.get(it.getAstId()).getEffectIds() : null);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<DimBusBarVO> getBusListByVoltageLevel(DimBusBarParam param) {
|
public Page<DimBusBarVO> getBusListByVoltageLevel(DimBusBarParam param) {
|
||||||
List<String> temBusIds = new ArrayList<>();
|
List<String> temBusIds = new ArrayList<>();
|
||||||
@@ -384,7 +323,141 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
|
|||||||
} else if (DicDataEnum.STATISTICAL_TYPE_Y.getCode().equals(statisticType)) {
|
} else if (DicDataEnum.STATISTICAL_TYPE_Y.getCode().equals(statisticType)) {
|
||||||
temBusIds = getOnlineBusIds(param.getNodeId(), begin, PmsRunStatisticY.class);
|
temBusIds = getOnlineBusIds(param.getNodeId(), begin, PmsRunStatisticY.class);
|
||||||
}
|
}
|
||||||
return null;
|
temBusIds = this.busTargetAss(param, temBusIds, rDimUpDTOList);
|
||||||
|
if (CollectionUtil.isEmpty(temBusIds)) {
|
||||||
|
return new Page<>();
|
||||||
|
}
|
||||||
|
param.setOnlineBusIds(temBusIds);
|
||||||
|
Page<DimBusBarVO> page = this.baseMapper.getBaseEvaOnlineBusDetail(new Page<>(param.getPageNum(), param.getPageSize()), param);
|
||||||
|
if (CollectionUtil.isNotEmpty(page.getRecords())) {
|
||||||
|
Map<String, RDimUpDTO> map = rDimUpDTOList.stream().collect(Collectors.toMap(RDimUpDTO::getBusMidId, Function.identity()));
|
||||||
|
page.getRecords().forEach(it -> {
|
||||||
|
if (map.containsKey(it.getAstId())) {
|
||||||
|
RDimUpDTO rDimUpDTO = map.get(it.getAstId());
|
||||||
|
it.setBusEfectiveMnitorNum(rDimUpDTO.getEffectIds().split(StrUtil.COMMA).length);
|
||||||
|
it.setMonitorId(rDimUpDTO.getEffectId());
|
||||||
|
it.setIndexAvgValue(rDimUpDTO.getV().toString());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<DimBusBarVO.DimBusBarMonitorVO> getMonitorListByBus(DimBusBarParam param) {
|
||||||
|
if(StrUtil.isBlank(param.getBusId())){
|
||||||
|
return new Page<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
Page<DimBusBarVO.DimBusBarMonitorVO> result = new Page<>(param.getPageNum(),param.getPageSize());
|
||||||
|
|
||||||
|
List<RDimUpDTO> rDimUpDTOList = new ArrayList<>();
|
||||||
|
List<String> midBusIds = this.busTargetAss(param, Stream.of(param.getBusId()).collect(Collectors.toList()), rDimUpDTOList);
|
||||||
|
List<PmsMidLedger> pmsMidLedgerList = pmsMidLedgerClient.getPmsMidLedgerList(midBusIds).getData();
|
||||||
|
if(CollectionUtil.isEmpty(pmsMidLedgerList)){
|
||||||
|
return new Page<>();
|
||||||
|
}
|
||||||
|
Map<String,PmsMidLedger> midLedgerMap = pmsMidLedgerList.stream().collect(Collectors.toMap(PmsMidLedger::getId,Function.identity()));
|
||||||
|
List<String> effectIds = rDimUpDTOList.stream().map(RDimUpDTO::getEffectIds).filter(Objects::nonNull).collect(Collectors.toList());
|
||||||
|
|
||||||
|
List<String> effectId = rDimUpDTOList.stream().map(RDimUpDTO::getEffectId).filter(Objects::nonNull).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
|
Map<String,RDimUpDTO> busMap = rDimUpDTOList.stream().collect(Collectors.toMap(RDimUpDTO::getBusId,Function.identity()));
|
||||||
|
|
||||||
|
List<String> monitorIds = new ArrayList<>();
|
||||||
|
effectIds.forEach(it-> monitorIds.addAll(Arrays.asList(it.split(StrUtil.COMMA))));
|
||||||
|
|
||||||
|
TerminalQueryParam terminalQueryParam = new TerminalQueryParam();
|
||||||
|
terminalQueryParam.setMonitorIds(monitorIds);
|
||||||
|
Page<Monitor> page = monitorClient.getMonitorPage(terminalQueryParam).getData();
|
||||||
|
List<DimBusBarVO.DimBusBarMonitorVO> temList = new ArrayList<>();
|
||||||
|
page.getRecords().forEach(it->{
|
||||||
|
DimBusBarVO.DimBusBarMonitorVO tem = new DimBusBarVO.DimBusBarMonitorVO();
|
||||||
|
tem.setMonitorId(it.getMonitorId());
|
||||||
|
RDimUpDTO rDimUpDTO = busMap.get(it.getLineId());
|
||||||
|
PmsMidLedger pmsMidLedger = midLedgerMap.get(rDimUpDTO.getBusMidId());
|
||||||
|
tem.setBusId(pmsMidLedger.getId());
|
||||||
|
tem.setBusName(pmsMidLedger.getName());
|
||||||
|
tem.setId(IdUtil.simpleUUID());
|
||||||
|
tem.setCityOrg(pmsMidLedger.getCityOrg());
|
||||||
|
tem.setCityOrgName(pmsMidLedger.getCityOrgName());
|
||||||
|
tem.setMaintOrg(pmsMidLedger.getSectionId());
|
||||||
|
tem.setMaintOrgName(pmsMidLedger.getSection());
|
||||||
|
tem.setStatDate(param.getStatDate());
|
||||||
|
tem.setStatus("01");
|
||||||
|
tem.setStatusName("投运");
|
||||||
|
|
||||||
|
if(effectId.contains(it.getId())){
|
||||||
|
tem.setWhetherOptimal("是");
|
||||||
|
tem.setWhetherOptimalName(it.getName());
|
||||||
|
}
|
||||||
|
tem.setMonitorName(it.getName());
|
||||||
|
temList.add(tem);
|
||||||
|
});
|
||||||
|
result.setTotal(page.getTotal());
|
||||||
|
result.setRecords(temList);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据稳态指标筛选符合条件的母线
|
||||||
|
*
|
||||||
|
* @author cdf
|
||||||
|
* @date 2024/5/14
|
||||||
|
*/
|
||||||
|
private List<String> busTargetAss(DimBusBarParam param, List<String> temBusIds, List<RDimUpDTO> rDimUpDTOList) {
|
||||||
|
String statisticType = param.getStatType();
|
||||||
|
if (DicDataEnum.STATISTICAL_TYPE_D.getCode().equals(statisticType)) {
|
||||||
|
QueryWrapper<RDimBusUpD> queryWrapper = new QueryWrapper<>();
|
||||||
|
this.harmTarget(param, temBusIds, queryWrapper);
|
||||||
|
List<RDimBusUpD> rDimBusUpDList = rDimBusUpDMapper.selectList(queryWrapper);
|
||||||
|
Map<String,List<RDimBusUpD>> map = rDimBusUpDList.stream().collect(Collectors.groupingBy(RDimBusUpD::getBusId));
|
||||||
|
map.forEach((key,val)->{
|
||||||
|
RDimUpDTO rDimUpDTO = new RDimUpDTO();
|
||||||
|
rDimUpDTO.setBusMidId(val.get(0).getMidBusId());
|
||||||
|
rDimUpDTO.setEffectId(val.get(0).getEffectId());
|
||||||
|
rDimUpDTO.setEffectIds(val.get(0).getEffectIds());
|
||||||
|
rDimUpDTO.setBusId(val.get(0).getBusId());
|
||||||
|
rDimUpDTO.setV(val.stream().mapToDouble(RDimBusUpD::getV).filter(it->it!=3.14159).average().orElse(3.14159));
|
||||||
|
rDimUpDTOList.add(rDimUpDTO);
|
||||||
|
});
|
||||||
|
|
||||||
|
temBusIds = rDimBusUpDList.stream().map(RDimBusUpD::getMidBusId).distinct().collect(Collectors.toList());
|
||||||
|
this.harmTarget(param, temBusIds, queryWrapper);
|
||||||
|
} else if (DicDataEnum.STATISTICAL_TYPE_M.getCode().equals(statisticType)) {
|
||||||
|
QueryWrapper<RDimBusUpM> queryWrapper = new QueryWrapper<>();
|
||||||
|
this.harmTarget(param, temBusIds, queryWrapper);
|
||||||
|
List<RDimBusUpM> rDimBusUpMList = rDimBusUpMMapper.selectList(queryWrapper);
|
||||||
|
Map<String,List<RDimBusUpM>> map = rDimBusUpMList.stream().collect(Collectors.groupingBy(RDimBusUpM::getBusId));
|
||||||
|
map.forEach((key,val)->{
|
||||||
|
RDimUpDTO rDimUpDTO = new RDimUpDTO();
|
||||||
|
rDimUpDTO.setBusMidId(val.get(0).getMidBusId());
|
||||||
|
rDimUpDTO.setBusId(val.get(0).getBusId());
|
||||||
|
rDimUpDTO.setEffectId(val.get(0).getEffectId());
|
||||||
|
rDimUpDTO.setEffectIds(val.get(0).getEffectIds());
|
||||||
|
rDimUpDTO.setV(val.stream().mapToDouble(RDimBusUpM::getV).filter(it->it!=3.14159).average().orElse(3.14159));
|
||||||
|
rDimUpDTOList.add(rDimUpDTO);
|
||||||
|
});
|
||||||
|
temBusIds = rDimBusUpMList.stream().map(RDimBusUpM::getMidBusId).distinct().collect(Collectors.toList());
|
||||||
|
} else if (DicDataEnum.STATISTICAL_TYPE_Y.getCode().equals(statisticType)) {
|
||||||
|
QueryWrapper<RDimBusUpY> queryWrapper = new QueryWrapper<>();
|
||||||
|
this.harmTarget(param, temBusIds, queryWrapper);
|
||||||
|
List<RDimBusUpY> rDimBusUpYList = rDimBusUpYMapper.selectList(queryWrapper);
|
||||||
|
Map<String,List<RDimBusUpY>> map = rDimBusUpYList.stream().collect(Collectors.groupingBy(RDimBusUpY::getBusId));
|
||||||
|
map.forEach((key,val)->{
|
||||||
|
RDimUpDTO rDimUpDTO = new RDimUpDTO();
|
||||||
|
rDimUpDTO.setBusMidId(val.get(0).getMidBusId());
|
||||||
|
rDimUpDTO.setBusId(val.get(0).getBusId());
|
||||||
|
rDimUpDTO.setEffectId(val.get(0).getEffectId());
|
||||||
|
rDimUpDTO.setEffectIds(val.get(0).getEffectIds());
|
||||||
|
rDimUpDTO.setV(val.stream().mapToDouble(RDimBusUpY::getV).filter(it->it!=3.14159).average().orElse(3.14159));
|
||||||
|
rDimUpDTOList.add(rDimUpDTO);
|
||||||
|
});
|
||||||
|
temBusIds = rDimBusUpYList.stream().map(RDimBusUpY::getMidBusId).distinct().collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
return temBusIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -395,9 +468,9 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
|
|||||||
if (PmsRunStatisticD.class.equals(clazz)) {
|
if (PmsRunStatisticD.class.equals(clazz)) {
|
||||||
pmsRunStatistic = pmsRunStatisticDMapper.selectOne((QueryWrapper<PmsRunStatisticD>) dayLam);
|
pmsRunStatistic = pmsRunStatisticDMapper.selectOne((QueryWrapper<PmsRunStatisticD>) dayLam);
|
||||||
} else if (PmsRunStatisticM.class.equals(clazz)) {
|
} else if (PmsRunStatisticM.class.equals(clazz)) {
|
||||||
pmsRunStatistic = pmsRunStatisticMMapper.selectOne((QueryWrapper<PmsRunStatisticM>)dayLam);
|
pmsRunStatistic = pmsRunStatisticMMapper.selectOne((QueryWrapper<PmsRunStatisticM>) dayLam);
|
||||||
} else if (PmsRunStatisticY.class.equals(clazz)) {
|
} else if (PmsRunStatisticY.class.equals(clazz)) {
|
||||||
pmsRunStatistic = pmsRunStatisticYMapper.selectOne((QueryWrapper<PmsRunStatisticY>)dayLam);
|
pmsRunStatistic = pmsRunStatisticYMapper.selectOne((QueryWrapper<PmsRunStatisticY>) dayLam);
|
||||||
}
|
}
|
||||||
if (Objects.nonNull(pmsRunStatistic)) {
|
if (Objects.nonNull(pmsRunStatistic)) {
|
||||||
String onlineBusMidIds = null;
|
String onlineBusMidIds = null;
|
||||||
@@ -416,7 +489,7 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void harmTarget(DimBusBarParam param,List<String> temBusIds, QueryWrapper queryWrapper) {
|
private void harmTarget(DimBusBarParam param, List<String> temBusIds, QueryWrapper queryWrapper) {
|
||||||
//稳态指标条件筛选
|
//稳态指标条件筛选
|
||||||
String target = "", harmV = "";
|
String target = "", harmV = "";
|
||||||
switch (param.getIndexType()) {
|
switch (param.getIndexType()) {
|
||||||
@@ -436,25 +509,24 @@ public class REvaluationDataServiceImpl extends ServiceImpl<RUploadEvaluationDat
|
|||||||
target = "harm_v";
|
target = "harm_v";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
queryWrapper.select("statistic_date", "phasic_type", "bus_id", "mid_bus_id","effect_id","effect_ids","voltage_level","v");
|
queryWrapper.select("statistic_date", "phasic_type", "bus_id", "mid_bus_id", "effect_id", "effect_ids", "voltage_level", "v");
|
||||||
if (CollectionUtil.isNotEmpty(param.getSeqs())) {
|
if (CollectionUtil.isNotEmpty(param.getSeqs())) {
|
||||||
queryWrapper.in("phasic_type", param.getSeqs());
|
queryWrapper.in("phasic_type", param.getSeqs());
|
||||||
}
|
}
|
||||||
queryWrapper.in("mid_bus_id",temBusIds);
|
queryWrapper.in("mid_bus_id", temBusIds);
|
||||||
queryWrapper.eq("statistic_date", LocalDate.parse(param.getStartTime()));
|
queryWrapper.eq("statistic_date", LocalDate.parse(param.getStartTime()));
|
||||||
if (param.getIndexType().equals("05")) {
|
|
||||||
harmV = "uharm_" + param.getHarmonicNum() + "_overtime";
|
if (StrUtil.isNotBlank(param.getIndexType())) {
|
||||||
queryWrapper.gt(harmV, 0);
|
if (param.getIndexType().equals("05")) {
|
||||||
} else {
|
harmV = "uharm_" + param.getHarmonicNum() + "_overtime";
|
||||||
queryWrapper.gt(target, 0);
|
queryWrapper.gt(harmV, 0);
|
||||||
|
} else {
|
||||||
|
queryWrapper.gt(target, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前单位的层级
|
* 获取当前单位的层级
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user