From f6dfee86e66a6335791d484f6dfc57a9d639b4ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=A8=E6=9C=A8c?= <857448963@qq.com> Date: Fri, 13 Jan 2023 09:37:30 +0800 Subject: [PATCH] =?UTF-8?q?pms=E4=BB=A3=E7=A0=81=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../distribution/PwMonitorController.java | 21 ++ .../distribution/PwOverviewController.java | 67 +++++ .../majornetwork/OverviewController.java | 62 ++++ .../majornetwork/PmsGeneratrixController.java | 17 +- .../PmsGeneratrixWireController.java | 5 +- .../PmsStatationStatController.java | 5 +- .../majornetwork/PmsTerminalController.java | 5 +- .../PowerDistributionareaController.java | 1 + .../SpecialAnalysisController.java | 10 +- .../mapper/majornetwork/OverviewMapper.java | 31 ++ .../majornetwork/SpecialAnalysisMapper.java | 15 +- .../majornetwork/SpecialMonitorMapper.java | 13 + .../majornetwork/mapping/OverviewMapper.xml | 278 ++++++++++++++++++ .../distribution/IPwMonitorService.java | 7 + .../impl/IPwMonitorServiceImpl.java | 34 ++- .../impl/PwDataQualityCheckServiceImpl.java | 44 ++- .../impl/PwDataQualityStatServiceImpl.java | 66 +++-- .../PwRMpMonitorAlarmCountMServiceImpl.java | 20 +- .../PwRStatAreaAlarmCountMServiceImpl.java | 19 +- .../impl/RDnOperatingIndexMServiceImpl.java | 4 +- .../impl/RDnOperatingYServiceImpl.java | 4 +- .../impl/RStatPwAlarmCountWServiceImpl.java | 17 +- .../majornetwork/IGeneratrixWireService.java | 5 +- .../majornetwork/IPmsGeneratrixService.java | 15 +- .../IPowerDistributionareaService.java | 2 + .../majornetwork/IStatationStatService.java | 3 +- .../majornetwork/ITerminalService.java | 5 +- .../service/majornetwork/OverviewService.java | 53 ++++ .../majornetwork/SpecialAnalysisService.java | 7 +- .../impl/DataQualityCheckServiceImpl.java | 39 ++- .../impl/DataQualityDetailsServiceImpl.java | 36 ++- .../impl/DataQualityStatServiceImpl.java | 74 +++-- .../majornetwork/impl/GeneratrixWireImpl.java | 9 +- .../majornetwork/impl/MonitorServiceImpl.java | 67 ++++- .../impl/OverviewServiceImpl.java | 275 +++++++++++++++++ .../impl/PmsGeneratrixServiceImpl.java | 11 +- .../PowerDistributionareaServiceImpl.java | 3 + .../impl/RMpDevEvaluateDetailServiceImpl.java | 4 +- .../impl/RMpDevSolveDetailServiceImpl.java | 8 +- .../impl/ROperatingIndexMServiceImpl.java | 4 +- .../impl/ROperatingIndexYServiceImpl.java | 6 +- .../impl/RStatDevSignalDServiceImpl.java | 4 +- .../impl/SpecialAnalysisServiceImpl.java | 46 +-- .../impl/StatationStatServiceImpl.java | 13 +- .../impl/TerminalServiceImpl.java | 7 +- 45 files changed, 1266 insertions(+), 175 deletions(-) create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/distribution/PwOverviewController.java create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/OverviewController.java create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/OverviewMapper.java create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/SpecialMonitorMapper.java create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/mapping/OverviewMapper.xml create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/OverviewService.java create mode 100644 pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/OverviewServiceImpl.java diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/distribution/PwMonitorController.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/distribution/PwMonitorController.java index bb4067d47..c2347cad8 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/distribution/PwMonitorController.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/distribution/PwMonitorController.java @@ -60,6 +60,27 @@ public class PwMonitorController extends BaseController { } } + /** + * 获取配网所有监测点信息 + * + * @param pwPmsMonitorParam 参数条件 + * @return 配网所有监测点信息 + */ + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @PostMapping("/getPwSubsetMonitorList") + @ApiOperation("获取子集配网所有监测点信息") + @ApiImplicitParam(name = "pwPmsMonitorParam",value = "获取子集配网所有监测点信息条件",required = true) + public HttpResult> getPwSubsetMonitorList(@RequestBody @Validated PwPmsMonitorParam pwPmsMonitorParam) { + String methodDescribe = getMethodDescribe("getPwSubsetMonitorList"); + List monitorList = iPwMonitorService.getPwSubsetMonitorList(pwPmsMonitorParam); + if (CollectionUtil.isEmpty(monitorList)) { + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe); + } else { + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitorList, methodDescribe); + } + } + + /** * 获取分布式光伏配网所有监测点信息 * diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/distribution/PwOverviewController.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/distribution/PwOverviewController.java new file mode 100644 index 000000000..7c9c9206e --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/distribution/PwOverviewController.java @@ -0,0 +1,67 @@ +package com.njcn.device.pms.controller.distribution; + +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.param.OverviewParam; +import com.njcn.device.pms.pojo.vo.OverviewVO; +import com.njcn.device.pms.service.majornetwork.OverviewService; +import com.njcn.web.controller.BaseController; +import io.swagger.annotations.Api; +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 java.util.List; + +/** + * <分布式光伏概览> + * + * @author wr + * @createTime: 2022-12-29 + */ +@RestController +@RequestMapping("/pwOverview") +@Api(tags = "分布式光伏概览") +@RequiredArgsConstructor +public class PwOverviewController extends BaseController { + + private final OverviewService overviewService; + + + @PostMapping("/getAlarmProportion") + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @ApiOperation("告警监测点数占比") + @ApiImplicitParam(name = "param", value = "条件参数", required = true) + public HttpResult> getAlarmProportion(@RequestBody OverviewParam.OverviewDateParam param) { + String methodDescribe = getMethodDescribe("getAlarmProportion"); + List monitorYoY = overviewService.getAlarmProportion(param); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitorYoY, methodDescribe); + } + + @PostMapping("/getAlarmRating") + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @ApiOperation("告警评级") + @ApiImplicitParam(name = "param", value = "条件参数", required = true) + public HttpResult> getAlarmRating(@RequestBody OverviewParam.OverviewDateParam param) { + String methodDescribe = getMethodDescribe("getAlarmRating"); + List groupVOS = overviewService.getAlarmRating(param); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, groupVOS, methodDescribe); + } + +// @PostMapping("/getWorkOrder") +// @OperateInfo(info = LogEnum.BUSINESS_COMMON) +// @ApiOperation("工单转换率/处置率") +// @ApiImplicitParam(name = "param", value = "条件参数", required = true) +// public HttpResult> getWorkOrder(@RequestBody OverviewParam.OverviewDateParam param) { +// String methodDescribe = getMethodDescribe("getWorkOrder"); +// List groups = overviewService.getWorkOrder(param); +// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, groups, methodDescribe); +// } +} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/OverviewController.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/OverviewController.java new file mode 100644 index 000000000..a56c1cda6 --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/OverviewController.java @@ -0,0 +1,62 @@ +package com.njcn.device.pms.controller.majornetwork; + +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.param.OverviewParam; +import com.njcn.device.pms.pojo.vo.DistributionMonitorVO; +import com.njcn.device.pms.pojo.vo.OverviewVO; +import com.njcn.device.pms.service.majornetwork.OverviewService; +import com.njcn.web.controller.BaseController; +import io.swagger.annotations.Api; +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.RestController; + +import java.util.List; +import java.util.Map; + +/** + * <分布式光伏概览> + * + * @author wr + * @createTime: 2022-12-29 + */ +@RestController +@RequestMapping("/overview") +@Slf4j +@Api(tags = "分布式光伏概览") +@RequiredArgsConstructor +public class OverviewController extends BaseController { + + private final OverviewService overviewService; + + + @PostMapping("/getMapDisplay") + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @ApiOperation("监测点统计") + @ApiImplicitParam(name = "param", value = "条件参数", required = true) + public HttpResult> getMapDisplay(@RequestBody OverviewParam param) { + String methodDescribe = getMethodDescribe("getMapDisplay"); + List monitorYoY = overviewService.getMonitorYoY(param); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitorYoY, methodDescribe); + } + + @PostMapping("/getMonitorDistributed") + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @ApiOperation("监测点分布") + @ApiImplicitParam(name = "param", value = "条件参数", required = true) + public HttpResult>> getMonitorDistributed(@RequestBody OverviewParam param) { + String methodDescribe = getMethodDescribe("getMonitorDistributed"); + Map> monitorDistributed = overviewService.getMonitorDistributed(param); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitorDistributed, methodDescribe); + } + +} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PmsGeneratrixController.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PmsGeneratrixController.java index c80d90564..6f12d2a03 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PmsGeneratrixController.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PmsGeneratrixController.java @@ -13,6 +13,7 @@ import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationSonDTO; import com.njcn.device.pms.pojo.dto.PmsGeneratrixDTO; import com.njcn.device.pms.pojo.param.ConditionParam; import com.njcn.device.pms.pojo.param.GeneratrixParam; +import com.njcn.device.pms.pojo.param.PmsBaseParam; import com.njcn.device.pms.pojo.param.PmsGeneratrixParam; import com.njcn.device.pms.pojo.po.Generatrix; import com.njcn.device.pms.service.majornetwork.IPmsGeneratrixService; @@ -86,13 +87,13 @@ public class PmsGeneratrixController extends BaseController { } } - /** - * @Description: 普测计划页面调用根据条件查询母线信息 - * @Param: [param] - * @return: com.njcn.common.pojo.response.HttpResult> + /** + * @Description: 普测计划页面调用根据条件查询母线信息 + * @Param: [param] + * @return: com.njcn.common.pojo.response.HttpResult> * @Author: clam - * @Date: 2022/12/5 - */ + * @Date: 2022/12/5 + */ @OperateInfo(info = LogEnum.BUSINESS_COMMON) @PostMapping("/getGeneratrixByCondition") @ApiOperation("普测计划页面调用根据条件查询母线信息") @@ -166,9 +167,9 @@ public class PmsGeneratrixController extends BaseController { @OperateInfo(info = LogEnum.BUSINESS_COMMON) @PostMapping("/getGeneratrixList") @ApiOperation("获取所有母线下拉框使用") - public HttpResult> getGeneratrixList() { + public HttpResult> getGeneratrixList(@RequestBody PmsBaseParam pmsBaseParam) { String methodDescribe = getMethodDescribe("getGeneratrixList"); - List result = pmsGeneratrixService.getGeneratrixList(); + List result = pmsGeneratrixService.getGeneratrixList(pmsBaseParam); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PmsGeneratrixWireController.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PmsGeneratrixWireController.java index 518322753..a5eeac7c0 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PmsGeneratrixWireController.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PmsGeneratrixWireController.java @@ -8,6 +8,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.pms.pojo.param.GeneratrixWireParam; +import com.njcn.device.pms.pojo.param.PmsBaseParam; import com.njcn.device.pms.pojo.po.GeneratrixWire; import com.njcn.device.pms.service.majornetwork.IGeneratrixWireService; import com.njcn.web.controller.BaseController; @@ -97,9 +98,9 @@ public class PmsGeneratrixWireController extends BaseController { @OperateInfo(info = LogEnum.BUSINESS_COMMON) @PostMapping("/getGeneratrixWireList") @ApiOperation("获取所有线路下拉框使用") - public HttpResult> getGeneratrixWireList() { + public HttpResult> getGeneratrixWireList(@RequestBody PmsBaseParam pmsBaseParam) { String methodDescribe = getMethodDescribe("getGeneratrixWireList"); - List result = iGeneratrixWireService.getGeneratrixWireList(); + List result = iGeneratrixWireService.getGeneratrixWireList(pmsBaseParam); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PmsStatationStatController.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PmsStatationStatController.java index 4cbf6693d..5e28d29f7 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PmsStatationStatController.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PmsStatationStatController.java @@ -9,6 +9,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.pms.pojo.dto.PmsStatationStatInfoDTO; +import com.njcn.device.pms.pojo.param.PmsBaseParam; import com.njcn.device.pms.pojo.param.StatationStatParam; import com.njcn.device.pms.pojo.param.PmsStatationStatInfoParam; import com.njcn.device.pms.pojo.po.StatationStat; @@ -126,9 +127,9 @@ public class PmsStatationStatController extends BaseController { @OperateInfo(info = LogEnum.BUSINESS_COMMON) @PostMapping("/getstatationStatList") @ApiOperation("获取电站列表") - public HttpResult> getstatationStatList() { + public HttpResult> getstatationStatList(@RequestBody @Validated PmsBaseParam pmsBaseParam) { String methodDescribe = getMethodDescribe("getstatationStatList"); - List result = statationStatService.getStatationStatList(); + List result = statationStatService.getStatationStatList(pmsBaseParam); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PmsTerminalController.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PmsTerminalController.java index 6f76f99a3..6db7dbb9d 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PmsTerminalController.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PmsTerminalController.java @@ -9,6 +9,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.common.utils.LogUtil; +import com.njcn.device.pms.pojo.param.PmsBaseParam; import com.njcn.device.pms.pojo.param.PmsTerminalParam; import com.njcn.device.pms.pojo.po.PmsTerminal; import com.njcn.device.pms.pojo.vo.PmsTerminalVO; @@ -59,9 +60,9 @@ public class PmsTerminalController extends BaseController { @OperateInfo(info = LogEnum.BUSINESS_COMMON) @PostMapping("getTerminalSelectList") @ApiOperation("查询监测终端台账所有信息") - public HttpResult> getTerminalSelectList(){ + public HttpResult> getTerminalSelectList(@RequestBody PmsBaseParam pmsBaseParam){ String methodDescribe = getMethodDescribe("getTerminalSelectList"); - List res = iTerminalService.getTerminalSelectList(); + List res = iTerminalService.getTerminalSelectList(pmsBaseParam); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,res,methodDescribe); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PowerDistributionareaController.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PowerDistributionareaController.java index 9c98fd761..6969c05a3 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PowerDistributionareaController.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/PowerDistributionareaController.java @@ -9,6 +9,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.common.utils.LogUtil; +import com.njcn.device.pms.pojo.param.PmsBaseParam; import com.njcn.device.pms.pojo.param.PowerDistributionareaParam; import com.njcn.device.pms.pojo.po.PowerDistributionarea; import com.njcn.device.pms.pojo.vo.PowerDistributionareaVO; diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/SpecialAnalysisController.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/SpecialAnalysisController.java index 871e1b258..17cea16bc 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/SpecialAnalysisController.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/controller/majornetwork/SpecialAnalysisController.java @@ -50,7 +50,7 @@ public class SpecialAnalysisController extends BaseController { @ApiImplicitParam(name = "param", value = "条件参数", required = true) public HttpResult getMapDisplay(@RequestBody SpecialAnalysisParam param) { String methodDescribe = getMethodDescribe("getMapDisplay"); - SpecialAnalysisMonitorVO sm= specialAnalysisService.getMonitorList(param); + SpecialAnalysisMonitorVO sm = specialAnalysisService.getMonitorList(param); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, sm, methodDescribe); } @@ -78,9 +78,9 @@ public class SpecialAnalysisController extends BaseController { @PostMapping("/getDisplayRailway") @OperateInfo(info = LogEnum.BUSINESS_COMMON) @ApiOperation("地图展示数据-地图监测点(电气化铁路)") - public HttpResult>> getDisplayRailway() { + public HttpResult>> getDisplayRailway() { String methodDescribe = getMethodDescribe("getDisplayRailway"); - Map> sm= specialAnalysisService.getDisplayRailway(); + Map> sm = specialAnalysisService.getDisplayRailway(); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, sm, methodDescribe); } @@ -96,7 +96,7 @@ public class SpecialAnalysisController extends BaseController { @ApiImplicitParam(name = "param", value = "条件参数", required = true) public HttpResult> getMapDisplayRailway(@RequestBody SpecialAnalysisParam.CompareParam param) { String methodDescribe = getMethodDescribe("getMapDisplayRailway"); - List sm= specialAnalysisService.getMapDisplayRailway(param); + List sm = specialAnalysisService.getMapDisplayRailway(param); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, sm, methodDescribe); } @@ -112,7 +112,7 @@ public class SpecialAnalysisController extends BaseController { @ApiImplicitParam(name = "param", value = "条件参数", required = true) public HttpResult> getWiringTypeRailway(@RequestBody SpecialAnalysisParam.CompareDateParam param) { String methodDescribe = getMethodDescribe("getWiringTypeRailway"); - List sm= specialAnalysisService.getWiringTypeRailway(param); + List sm = specialAnalysisService.getWiringTypeRailway(param); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, sm, methodDescribe); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/OverviewMapper.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/OverviewMapper.java new file mode 100644 index 000000000..030887223 --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/OverviewMapper.java @@ -0,0 +1,31 @@ +package com.njcn.device.pms.mapper.majornetwork; + +import com.njcn.device.pms.pojo.param.OverviewParam; +import com.njcn.device.pms.pojo.vo.DistributionMonitorVO; +import com.njcn.device.pms.pojo.vo.OverviewVO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * <分布式光伏概览> + * + * @author wr + * @createTime: 2022-12-29 + */ +public interface OverviewMapper { + + /** + * 监测点同环比 + * @param orgId + * @param param + * @return + */ + List selectYoY(@Param("orgIds") List orgId,@Param("param") OverviewParam param); + + /** + * 查询配网所有信息 + * @return + */ + List selectListAll(@Param("orgIds") List orgId); +} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/SpecialAnalysisMapper.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/SpecialAnalysisMapper.java index d95c85ad3..30e9aea57 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/SpecialAnalysisMapper.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/SpecialAnalysisMapper.java @@ -16,24 +16,27 @@ public interface SpecialAnalysisMapper { /** * 专项分析-地图数据展示 - * @param deptIdList 部门集合(Code) + * + * @param deptIdList 部门集合(Code) * @param monitorTags 监测标签(字典) * @return */ List selectList(@Param("deptIdList") List deptIdList, - @Param("monitorTags") String monitorTags); + @Param("monitorTags") String monitorTags); /** * 同比环比数据(风电场,光伏电站,冶炼负荷) + * * @param deptIdList * @param param * @return */ SpecialAnalysisMonitorVO.CompareDetailVO selectYoYList(@Param("deptIdList") List deptIdList, - @Param("param")SpecialAnalysisParam.CompareDateParam param); + @Param("param") SpecialAnalysisParam.CompareDateParam param); /** * 专项分析-地图数据展示 + * * @param deptIdList 部门集合(Code) * @return */ @@ -42,19 +45,21 @@ public interface SpecialAnalysisMapper { /** * 地图展示数据-按电压展示数据(电气铁路) + * * @param deptIdList 部门集合(Code) * @param param * @return */ List selectMapDisplayRailway(@Param("deptIdList") List deptIdList, - @Param("param")SpecialAnalysisParam.CompareParam param); + @Param("param") SpecialAnalysisParam.CompareParam param); /** * 地图展示数据-按接线类型展示(电气化铁路) + * * @param deptIdList * @param param * @return */ List selectWiringTypeRailway(@Param("deptIdList") List deptIdList, - @Param("param")SpecialAnalysisParam.CompareDateParam param); + @Param("param") SpecialAnalysisParam.CompareDateParam param); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/SpecialMonitorMapper.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/SpecialMonitorMapper.java new file mode 100644 index 000000000..32e529205 --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/SpecialMonitorMapper.java @@ -0,0 +1,13 @@ +package com.njcn.device.pms.mapper.majornetwork; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.device.pms.pojo.po.SpecialMonitor; + +/** + * pms-device + * + * @author cdf + * @date 2023/1/11 + */ +public interface SpecialMonitorMapper extends BaseMapper { +} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/mapping/OverviewMapper.xml b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/mapping/OverviewMapper.xml new file mode 100644 index 000000000..368ac9ad9 --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/mapper/majornetwork/mapping/OverviewMapper.xml @@ -0,0 +1,278 @@ + + + + + + + \ No newline at end of file diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/IPwMonitorService.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/IPwMonitorService.java index 73f96fb6e..dd74648e1 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/IPwMonitorService.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/IPwMonitorService.java @@ -26,4 +26,11 @@ public interface IPwMonitorService { * @return */ List getPwPhotovoltaicMonitorList(PwPmsMonitorParam pwPmsMonitorParam); + + /** + * 获取子集配网所有监测点信息 + * @param pwPmsMonitorParam + * @return + */ + List getPwSubsetMonitorList(PwPmsMonitorParam pwPmsMonitorParam); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/IPwMonitorServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/IPwMonitorServiceImpl.java index d0abfbe68..dbbda5f4a 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/IPwMonitorServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/IPwMonitorServiceImpl.java @@ -88,10 +88,10 @@ public class IPwMonitorServiceImpl implements IPwMonitorService { @Override public List getPwPhotovoltaicMonitorList(PwPmsMonitorParam pwPmsMonitorParam) { //定义待返回终端信息 - List pwPmsMonitorDTOS = new ArrayList<>(); List deptInfos = deptFeignClient.getDirectSonSelf(pwPmsMonitorParam.getOrgId()).getData(); // 过滤出传入id的子单位id List deptIdList = deptInfos.stream() + .filter(r-> !r.getId().equals(pwPmsMonitorParam.getOrgId())) .map(Dept::getCode) .distinct() .collect(Collectors.toList()); @@ -99,5 +99,37 @@ public class IPwMonitorServiceImpl implements IPwMonitorService { return pwMonitorMapper.getPwPhotovoltaicMonitorList(deptIdList, pwPmsMonitorParam); } + + @Override + public List getPwSubsetMonitorList(PwPmsMonitorParam pwPmsMonitorParam) { + //定义待返回终端信息 + List pwPmsMonitorDTOS = new ArrayList<>(); + List deptInfos = deptFeignClient.getDeptDescendantIndexes(pwPmsMonitorParam.getOrgId(), Stream.of(0, 1).collect(Collectors.toList())).getData(); + // 过滤出传入id的子单位id + List directDeptInfos = deptInfos.stream() + .filter(deptDTO -> deptDTO.getPid().equals(pwPmsMonitorParam.getOrgId())) + .collect(Collectors.toList()); + + if (CollectionUtil.isEmpty(directDeptInfos)) { + //没有直接子部门,获取当前部门所有信息 + List dept = deptInfos.stream() + .filter(deptDTO -> deptDTO.getId().equals(pwPmsMonitorParam.getOrgId())) + .collect(Collectors.toList()); + //获取monitor详细数据 + pwPmsMonitorDTOS = pwMonitorMapper.getPwMonitorDataList(Collections.singletonList(dept.get(0).getCode()), pwPmsMonitorParam); + if (CollUtil.isEmpty(pwPmsMonitorDTOS)) { + PwPmsMonitorDTO pwPmsMonitorDTO = new PwPmsMonitorDTO(); + pwPmsMonitorDTO.setOrgId(dept.get(0).getCode()); + pwPmsMonitorDTO.setOrgName(dept.get(0).getArea()); + pwPmsMonitorDTOS.add(pwPmsMonitorDTO); + } + } else { + // 遍历子单位id + List deptCodes = directDeptInfos.stream().map(DeptDTO::getCode).collect(Collectors.toList()); + List pwMonitorDataList = pwMonitorMapper.getPwMonitorDataList(deptCodes, pwPmsMonitorParam); + pwPmsMonitorDTOS.addAll(pwMonitorDataList); + } + return pwPmsMonitorDTOS; + } } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/PwDataQualityCheckServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/PwDataQualityCheckServiceImpl.java index 3b061f3f5..b484bb38e 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/PwDataQualityCheckServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/PwDataQualityCheckServiceImpl.java @@ -15,6 +15,8 @@ import com.njcn.device.pms.service.distribution.PwDataQualityCheckService; import com.njcn.device.pms.service.majornetwork.IPmsGeneralDeviceService; import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.enums.DicDataEnum; +import com.njcn.user.api.DeptFeignClient; +import com.njcn.user.pojo.dto.DeptDTO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -40,6 +42,8 @@ public class PwDataQualityCheckServiceImpl implements PwDataQualityCheckService private final DicDataFeignClient dicDataFeignClient; + private final DeptFeignClient deptFeignClient; + private final PwDataQualityCheckMapper pwDataQualityCheckMapper; private final PwRStatTargetCheckDataMapper pwRStatTargetCheckDataMapper; @@ -55,12 +59,20 @@ public class PwDataQualityCheckServiceImpl implements PwDataQualityCheckService @Override public List getPwQualityCheckOfAccountData(StatisticsBizBaseParam param) { // 获取单位的子单位id - List data = getDeptIds(param); - if (CollUtil.isEmpty(data)) { +// List data = getDeptIds(param); +// if (CollUtil.isEmpty(data)) { +// return Collections.emptyList(); +// } +// // 取出单位id +// List deptIds = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList()); + /*获取直接下属子单位*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( ); + if (CollUtil.isEmpty(deptDTOList)) { return Collections.emptyList(); } - // 取出单位id - List deptIds = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList()); + List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); + Map deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO)); + // 获取配网字典信息 String distributionPoint = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData().getId(); // 创建集合封装返回数据 @@ -86,10 +98,10 @@ public class PwDataQualityCheckServiceImpl implements PwDataQualityCheckService return Collections.emptyList(); } //将单位信息转为map集合 key: 单位id value: 单位实体 - Map dataMap = getDataMap(data); +// Map dataMap = getDataMap(data); // 属性赋值 return result.stream().peek(vo -> { - vo.setOrgName(dataMap.get(vo.getOrgNo()).getName()); + vo.setOrgName(deptDTOMap.get(vo.getOrgNo()).getName()); }).collect(Collectors.toList()); } @@ -104,12 +116,20 @@ public class PwDataQualityCheckServiceImpl implements PwDataQualityCheckService @Override public List getPwMonitoringIndexDataQualityVerification(StatisticsBizBaseParam param) { // 获取单位的子单位id - List data = getDeptIds(param); - if (CollUtil.isEmpty(data)) { +// List data = getDeptIds(param); +// if (CollUtil.isEmpty(data)) { +// return Collections.emptyList(); +// } +// // 取出单位id +// List deptIds = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList()); + /*获取直接下属子单位*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( ); + if (CollUtil.isEmpty(deptDTOList)) { return Collections.emptyList(); } - // 取出单位id - List deptIds = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList()); + List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); + Map deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO)); + // 获取配网字典信息 String distributionPoint = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData().getId(); // 创建集合封装返回数据 @@ -135,10 +155,10 @@ public class PwDataQualityCheckServiceImpl implements PwDataQualityCheckService return Collections.emptyList(); } //将单位信息转为map集合 key: 单位id value: 单位实体 - Map dataMap = getDataMap(data); +// Map dataMap = getDataMap(data); // 属性赋值 return result.stream().peek(vo -> { - vo.setOrgName(dataMap.get(vo.getOrgNo()).getName()); + vo.setOrgName(deptDTOMap.get(vo.getOrgNo()).getName()); }).collect(Collectors.toList()); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/PwDataQualityStatServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/PwDataQualityStatServiceImpl.java index 7f0b1612f..af3f058b6 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/PwDataQualityStatServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/PwDataQualityStatServiceImpl.java @@ -17,6 +17,8 @@ import com.njcn.device.pms.service.distribution.PwDataQualityStatService; import com.njcn.device.pms.service.majornetwork.IPmsGeneralDeviceService; import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.enums.DicDataEnum; +import com.njcn.user.api.DeptFeignClient; +import com.njcn.user.pojo.dto.DeptDTO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; @@ -45,6 +47,8 @@ public class PwDataQualityStatServiceImpl implements PwDataQualityStatService { private final DicDataFeignClient dicDataFeignClient; + private final DeptFeignClient deptFeignClient; + private final PwROperatingIndexMapper rOperatingIndexMapper; private final RQualityParameterMapper rQualityParameterMapper; @@ -62,26 +66,34 @@ public class PwDataQualityStatServiceImpl implements PwDataQualityStatService { @Override public List getPwLedgerDataQualityStat(StatisticsBizBaseParam param) { // 获取单位的子单位信息 - List data = getDeptInfo(param); - if (CollUtil.isEmpty(data)) { +// List data = getDeptInfo(param); +// if (CollUtil.isEmpty(data)) { +// return Collections.emptyList(); +// } + /*获取直接下属子单位*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( ); + if (CollUtil.isEmpty(deptDTOList)) { return Collections.emptyList(); } + List deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); + Map deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO)); + // 获取配网字典id String distributionPoint = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData().getId(); - // 获取单位id - List deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList()); +// // 获取单位id +// List deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList()); // 获取配网数据质量-台账数据质量统计 List pos = rQualityParameterMapper.getLedgerDataQualityStat(param, deptIdList, distributionPoint); if (CollUtil.isEmpty(pos)) { return Collections.emptyList(); } //将单位信息转为map集合 key: 单位id value: 单位实体 - Map dataMap = getDataMap(data); +// Map dataMap = getDataMap(data); // 属性赋值 return pos.stream().map(po -> { PwRQualityParameterVO vo = new PwRQualityParameterVO(); BeanUtils.copyProperties(po, vo); - vo.setOrgName(dataMap.get(vo.getOrgNo()).getName()); + vo.setOrgName(deptDTOMap.get(vo.getOrgNo()).getName()); vo.setMeasurementCompleteQuantity(Double.toString( Integer.parseInt(po.getMeasurementCount()) * Double.parseDouble(po.getMonitoringIntegrityRate()) )); @@ -100,10 +112,18 @@ public class PwDataQualityStatServiceImpl implements PwDataQualityStatService { @Override public List getPwMonitoringIndexDataQualityStat(StatisticsBizBaseParam param) { // 获取单位的子单位信息 - List data = getDeptInfo(param); - if (CollUtil.isEmpty(data)) { +// List data = getDeptInfo(param); +// if (CollUtil.isEmpty(data)) { +// return Collections.emptyList(); +// } + /*获取直接下属子单位*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( ); + if (CollUtil.isEmpty(deptDTOList)) { return Collections.emptyList(); } + List deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); + Map deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO)); + // 创建集合封装数据 List result = new ArrayList<>(); // 日期条件 @@ -111,17 +131,17 @@ public class PwDataQualityStatServiceImpl implements PwDataQualityStatService { // 年 case BizParamConstant.STAT_BIZ_YEAR: result = rOperatingIndexMapper.getYearInfo(param, - data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList())); + deptIdList); break; // 季 case BizParamConstant.STAT_BIZ_QUARTER: result = rOperatingIndexMapper.getSeasonInfo(param, - data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList())); + deptIdList); break; // 月 case BizParamConstant.STAT_BIZ_MONTH: result = rOperatingIndexMapper.getMonthInfo(param, - data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList())); + deptIdList); break; default: break; @@ -130,10 +150,10 @@ public class PwDataQualityStatServiceImpl implements PwDataQualityStatService { return Collections.emptyList(); } //将单位信息转为map集合 key: 单位id value: 单位实体 - Map dataMap = getDataMap(data); +// Map dataMap = getDataMap(data); // 属性赋值 return result.stream().peek(vo -> { - vo.setOrgName(dataMap.get(vo.getOrgNo()).getName()); + vo.setOrgName(deptDTOMap.get(vo.getOrgNo()).getName()); }).collect(Collectors.toList()); } @@ -149,12 +169,20 @@ public class PwDataQualityStatServiceImpl implements PwDataQualityStatService { @Override public List getPwSummaryStatOfMonitoringIndexDataQualityProblems(StatisticsBizBaseParam param) { // 获取单位的子单位信息 - List data = getDeptInfo(param); - if (CollUtil.isEmpty(data)) { +// List data = getDeptInfo(param); +// if (CollUtil.isEmpty(data)) { +// return Collections.emptyList(); +// } +// // 取出单位id +// List deptIds = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList()); + /*获取直接下属子单位*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( ); + if (CollUtil.isEmpty(deptDTOList)) { return Collections.emptyList(); } - // 取出单位id - List deptIds = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList()); + List deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); + Map deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO)); + // 获取配网字典id String distributionPoint = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData().getId(); // 获取配网数据质量-监测指标数据质量问题汇总统计 @@ -163,12 +191,12 @@ public class PwDataQualityStatServiceImpl implements PwDataQualityStatService { return Collections.emptyList(); } //将单位信息转为map集合 key: 单位id value: 单位实体 - Map dataMap = getDataMap(data); +// Map dataMap = getDataMap(data); return pos.stream().map(po -> { RQualityParameterPollVO vo = new RQualityParameterPollVO(); BeanUtils.copyProperties(po, vo); vo.setOrgId(po.getOrgNo()); - vo.setOrgName(dataMap.get(vo.getOrgId()).getName()); + vo.setOrgName(deptDTOMap.get(vo.getOrgId()).getName()); vo.setProblemProportion(Double.parseDouble(df.format((po.getProblem() * 1.0) / (po.getEffectiveAccessMeasurementCount() * 1.0))) * 100); if (po.getProblemYearOnYear() == null) { vo.setProblemYearOnYear("3.14159"); diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/PwRMpMonitorAlarmCountMServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/PwRMpMonitorAlarmCountMServiceImpl.java index 3a6f9e2ef..25caae285 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/PwRMpMonitorAlarmCountMServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/PwRMpMonitorAlarmCountMServiceImpl.java @@ -12,6 +12,7 @@ import com.njcn.device.pms.pojo.param.PmsMonitorParam; import com.njcn.device.pms.pojo.param.PwPmsMonitorParam; import com.njcn.device.pms.pojo.param.RMpMonitorAlarmCountMParam; import com.njcn.device.pms.pojo.po.RMpMonitorAlarmCountM; +import com.njcn.device.pms.pojo.po.RStatAreaAlarmCountM; import com.njcn.device.pms.pojo.vo.PwRMpMonitorAlarmCountMVO; import com.njcn.device.pms.service.distribution.PwRMpMonitorAlarmCountMService; import com.njcn.device.pms.service.majornetwork.IMonitorService; @@ -28,6 +29,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -71,12 +73,19 @@ implements PwRMpMonitorAlarmCountMService { // List voltageLevelParamList = StringUtils.isNotBlank(rMpMonitorAlarmCountMParam.getVoltageLevel()) ? Arrays.asList(rMpMonitorAlarmCountMParam.getVoltageLevel().split(",")) : null; //电压等级 String monitorName = rMpMonitorAlarmCountMParam.getMeasurementPointName(); //监测点名称 - //获取所有子部门信息 - List deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); +// //获取所有子部门信息 +// List deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); +// if (CollUtil.isEmpty(deptDTOList)) { +// throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在"); +// } +// //将单位信息转为map集合 key: 单位id value: 单位实体 +// Map deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO)); + /*获取下级子部门信息*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( ); if (CollUtil.isEmpty(deptDTOList)) { - throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在"); + return Collections.emptyList(); } - //将单位信息转为map集合 key: 单位id value: 单位实体 + List orgCodeList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); Map deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO)); //获取配网id @@ -100,7 +109,8 @@ implements PwRMpMonitorAlarmCountMService { //根据监测点idList等条件查询【监测点告警月统计】表数据 LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); - lambdaQueryWrapper.in(RMpMonitorAlarmCountM::getMeasurementPointId, monitorIdList) + lambdaQueryWrapper.in(CollUtil.isNotEmpty(orgCodeList), RMpMonitorAlarmCountM::getOrgNo, orgCodeList) + .in(RMpMonitorAlarmCountM::getMeasurementPointId, monitorIdList) .ge(RMpMonitorAlarmCountM::getDataDate, startTime) .le(RMpMonitorAlarmCountM::getDataDate, endTime) .eq(RMpMonitorAlarmCountM::getDataType, dataType); diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/PwRStatAreaAlarmCountMServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/PwRStatAreaAlarmCountMServiceImpl.java index d85279a4c..839fafb92 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/PwRStatAreaAlarmCountMServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/PwRStatAreaAlarmCountMServiceImpl.java @@ -21,6 +21,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Map; import java.util.stream.Collectors; @@ -55,15 +56,23 @@ implements PwRStatAreaAlarmCountMService{ } String startTime = rStatAreaAlarmCountMParam.getStartTime(); //开始时间 yyyy-MM-dd String endTime = rStatAreaAlarmCountMParam.getEndTime(); //截止时间 yyyy-MM-dd - //获取所有子部门信息 - List deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); +// //获取所有子部门信息 +// List deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); +// if (CollUtil.isEmpty(deptDTOList)) { +// throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在"); +// } +// //单位id集合 +// List orgCodeList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); +// //将单位信息转为map集合 key: 单位id value: 单位实体 +// Map deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO)); + /*获取下级子部门信息*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( ); if (CollUtil.isEmpty(deptDTOList)) { - throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在"); + return Collections.emptyList(); } - //单位id集合 List orgCodeList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - //将单位信息转为map集合 key: 单位id value: 单位实体 Map deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO)); + //获取配网id String dataType = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData().getId(); diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/RDnOperatingIndexMServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/RDnOperatingIndexMServiceImpl.java index cac125f9d..d6dec8344 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/RDnOperatingIndexMServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/RDnOperatingIndexMServiceImpl.java @@ -51,7 +51,9 @@ public class RDnOperatingIndexMServiceImpl extends ServiceImpl deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); +// List deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); + /*获取下一级子部门信息*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( ); if (CollUtil.isEmpty(deptDTOList)) { throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在"); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/RDnOperatingYServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/RDnOperatingYServiceImpl.java index a8a88681f..b6a8dbd84 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/RDnOperatingYServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/RDnOperatingYServiceImpl.java @@ -44,7 +44,9 @@ public class RDnOperatingYServiceImpl extends ServiceImpl deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); +// List deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); + /*获取下一级子部门信息*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( ); if (CollUtil.isEmpty(deptDTOList)) { throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在"); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/RStatPwAlarmCountWServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/RStatPwAlarmCountWServiceImpl.java index b68fef1d8..50f78fca8 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/RStatPwAlarmCountWServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/distribution/impl/RStatPwAlarmCountWServiceImpl.java @@ -74,14 +74,21 @@ public class RStatPwAlarmCountWServiceImpl extends ServiceImpl deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); +// //获取所有子部门信息 +// List deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); +// if (CollUtil.isEmpty(deptDTOList)) { +// throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在"); +// } +// //单位code集合 +// List orgCodeList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); +// //将单位信息转为map集合 key: 单位id value: 单位实体 +// Map deptNameMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, DeptDTO::getName)); + /*获取下级子部门信息*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( ); if (CollUtil.isEmpty(deptDTOList)) { - throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在"); + return Collections.emptyList(); } - //单位code集合 List orgCodeList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); - //将单位信息转为map集合 key: 单位id value: 单位实体 Map deptNameMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, DeptDTO::getName)); //设置数据库查询条件 diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IGeneratrixWireService.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IGeneratrixWireService.java index 7f5a983f5..e5d3bf918 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IGeneratrixWireService.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IGeneratrixWireService.java @@ -3,6 +3,7 @@ package com.njcn.device.pms.service.majornetwork; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.njcn.device.pms.pojo.param.GeneratrixWireParam; +import com.njcn.device.pms.pojo.param.PmsBaseParam; import com.njcn.device.pms.pojo.po.GeneratrixWire; import com.njcn.web.pojo.param.BaseParam; @@ -56,10 +57,10 @@ public interface IGeneratrixWireService extends IService { * 查询线路列表 * @author cdf * @date 2022/10/25 - * @param baseParam 基础参数 + * @param pmsBaseParam 基础参数 * @return boolean */ - List getGeneratrixWireList(); + List getGeneratrixWireList(PmsBaseParam pmsBaseParam); /** * 分页查询线路列表 diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPmsGeneratrixService.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPmsGeneratrixService.java index de13332a4..c0e73e5a8 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPmsGeneratrixService.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPmsGeneratrixService.java @@ -7,6 +7,7 @@ import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationSonDTO; import com.njcn.device.pms.pojo.dto.PmsGeneratrixDTO; import com.njcn.device.pms.pojo.param.ConditionParam; import com.njcn.device.pms.pojo.param.GeneratrixParam; +import com.njcn.device.pms.pojo.param.PmsBaseParam; import com.njcn.device.pms.pojo.param.PmsGeneratrixParam; import com.njcn.device.pms.pojo.po.Generatrix; import com.njcn.web.pojo.param.BaseParam; @@ -75,7 +76,7 @@ public interface IPmsGeneratrixService extends IService { * @author cdf * @date 2022/10/25 */ - List getGeneratrixList(); + List getGeneratrixList(PmsBaseParam pmsBaseParam); /** * 查询母线列表 @@ -96,12 +97,12 @@ public interface IPmsGeneratrixService extends IService { * @date 2022/11/3 */ List getGeneratrixAndPowerStationInfo(PmsGeneratrixParam param); - /** - * @Description: 普测计划页面调用根据条件查询母线信息 - * @Param: [param] - * @return: java.util.List + /** + * @Description: 普测计划页面调用根据条件查询母线信息 + * @Param: [param] + * @return: java.util.List * @Author: clam - * @Date: 2022/12/5 - */ + * @Date: 2022/12/5 + */ List getGeneratrixByCondition(ConditionParam param); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPowerDistributionareaService.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPowerDistributionareaService.java index e69a8b873..59f406e08 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPowerDistributionareaService.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IPowerDistributionareaService.java @@ -2,6 +2,7 @@ package com.njcn.device.pms.service.majornetwork; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; +import com.njcn.device.pms.pojo.param.PmsBaseParam; import com.njcn.device.pms.pojo.param.PowerDistributionareaParam; import com.njcn.device.pms.pojo.po.PowerDistributionarea; import com.njcn.device.pms.pojo.vo.PowerDistributionareaVO; @@ -34,6 +35,7 @@ public interface IPowerDistributionareaService extends IService getPowerDistributionList(PowerDistributionareaParam powerDistributionareaParam); + /** * 根据id查询 * @return diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IStatationStatService.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IStatationStatService.java index 74a8ca20a..caeeda664 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IStatationStatService.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/IStatationStatService.java @@ -3,6 +3,7 @@ package com.njcn.device.pms.service.majornetwork; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import com.njcn.device.pms.pojo.dto.PmsStatationStatInfoDTO; +import com.njcn.device.pms.pojo.param.PmsBaseParam; import com.njcn.device.pms.pojo.param.StatationStatParam; import com.njcn.device.pms.pojo.param.PmsStatationStatInfoParam; import com.njcn.device.pms.pojo.po.StatationStat; @@ -77,7 +78,7 @@ public interface IStatationStatService extends IService { * @author cdf * @date 2022/10/25 */ - List getStatationStatList(); + List getStatationStatList(PmsBaseParam pmsBaseParam); /** * 查询电站列表 diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/ITerminalService.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/ITerminalService.java index 9b6738dfd..b4092dbcb 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/ITerminalService.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/ITerminalService.java @@ -2,6 +2,7 @@ package com.njcn.device.pms.service.majornetwork; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; +import com.njcn.device.pms.pojo.param.PmsBaseParam; import com.njcn.device.pms.pojo.param.PmsTerminalParam; import com.njcn.device.pms.pojo.po.PmsTerminal; import com.njcn.web.pojo.param.BaseParam; @@ -26,10 +27,10 @@ public interface ITerminalService extends IService { /** * 查询所有 - * @param baseParam + * @param * @return */ - List getTerminalSelectList(); + List getTerminalSelectList(PmsBaseParam pmsBaseParam); diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/OverviewService.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/OverviewService.java new file mode 100644 index 000000000..e243815ca --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/OverviewService.java @@ -0,0 +1,53 @@ +package com.njcn.device.pms.service.majornetwork; + +import com.njcn.device.pms.pojo.param.OverviewParam; +import com.njcn.device.pms.pojo.vo.DistributionMonitorVO; +import com.njcn.device.pms.pojo.vo.OverviewVO; + +import java.util.List; +import java.util.Map; + +/** + * <分布式光伏概览业务> + * + * @author wr + * @createTime: 2022-12-29 + */ +public interface OverviewService { + + /** + * 监测点同环比 + * @param param + * @return + */ + List getMonitorYoY(OverviewParam param); + + /** + * 告警监测点占比 + * @param param + * @return + */ + List getAlarmProportion(OverviewParam.OverviewDateParam param); + + + /** + * 监测点分布 + * @param param + * @return + */ + Map> getMonitorDistributed(OverviewParam param); + + /** + * 告警评级 + * @param param + * @return + */ + List getAlarmRating(OverviewParam.OverviewDateParam param); + + /** + * 工单转换率/处置率 + * @param param + * @return + */ + List getWorkOrder(OverviewParam.OverviewDateParam param); +} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/SpecialAnalysisService.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/SpecialAnalysisService.java index 6f3efd98f..46d8766fe 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/SpecialAnalysisService.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/SpecialAnalysisService.java @@ -17,6 +17,7 @@ public interface SpecialAnalysisService { /** * 专项分析-地图数据展示(风电场,光伏电站,冶炼负荷) + * * @param param * @return */ @@ -24,6 +25,7 @@ public interface SpecialAnalysisService { /** * 同比环比数据(风电场,光伏电站,冶炼负荷) + * * @param param * @return */ @@ -31,12 +33,14 @@ public interface SpecialAnalysisService { /** * 专项分析-地图数据展示(电气化铁路) + * * @return */ - Map> getDisplayRailway(); + Map> getDisplayRailway(); /** * 地图展示数据-按电压展示数据(电气化铁路) + * * @param param * @return */ @@ -44,6 +48,7 @@ public interface SpecialAnalysisService { /** * 地图展示数据-按接线类型展示(电气化铁路) + * * @param param * @return */ diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/DataQualityCheckServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/DataQualityCheckServiceImpl.java index c1185ed8d..95b4681f7 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/DataQualityCheckServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/DataQualityCheckServiceImpl.java @@ -14,6 +14,8 @@ import com.njcn.device.pms.service.majornetwork.DataQualityCheckService; import com.njcn.device.pms.service.majornetwork.IPmsGeneralDeviceService; import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.enums.DicDataEnum; +import com.njcn.user.api.DeptFeignClient; +import com.njcn.user.pojo.dto.DeptDTO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -42,6 +44,7 @@ public class DataQualityCheckServiceImpl implements DataQualityCheckService { private final RStatTargetCheckDataMapper rStatTargetCheckDataMapper; private final DicDataFeignClient dicDataFeignClient; + private final DeptFeignClient deptFeignClient; /** * 获取主网数据质量-台帐类数据质量核查 @@ -54,11 +57,19 @@ public class DataQualityCheckServiceImpl implements DataQualityCheckService { @Override public List getQualityCheckOfAccountData(StatisticsBizBaseParam param) { // 获取当前用户的部门的子部门信息 - List data = getPmsGeneralDeviceDTOList(param); - if (CollUtil.isEmpty(data)) { +// List data = getPmsGeneralDeviceDTOList(param); +// if (CollUtil.isEmpty(data)) { +// return Collections.emptyList(); +// } +// List deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList()); + /*获取下级子部门信息*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( ); + if (CollUtil.isEmpty(deptDTOList)) { return Collections.emptyList(); } - List deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList()); + List deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); + Map deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO)); + // 创建集合封装查询数据 List result = new ArrayList<>(); // 获取主网字典id @@ -84,9 +95,9 @@ public class DataQualityCheckServiceImpl implements DataQualityCheckService { return Collections.emptyList(); } //将单位信息转为map集合 key: 单位id value: 单位实体 - Map dataMap = getDataMap(data); +// Map dataMap = getDataMap(data); return result.stream().peek(vo -> { - vo.setOrgName(dataMap.get(vo.getOrgNo()).getName()); + vo.setOrgName(deptDTOMap.get(vo.getOrgNo()).getName()); }).collect(Collectors.toList()); } @@ -101,11 +112,19 @@ public class DataQualityCheckServiceImpl implements DataQualityCheckService { @Override public List getMonitoringIndexDataQualityVerification(StatisticsBizBaseParam param) { // 获取当前用户的部门的子部门信息 - List data = getPmsGeneralDeviceDTOList(param); - if (CollUtil.isEmpty(data)) { +// List data = getPmsGeneralDeviceDTOList(param); +// if (CollUtil.isEmpty(data)) { +// return Collections.emptyList(); +// } +// List deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList()); + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( ); + if (CollUtil.isEmpty(deptDTOList)) { return Collections.emptyList(); } - List deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList()); + List deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); + Map deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO)); + + // 获取主网字典id String mainnetPoint = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData().getId(); // 创建集合封装数据 @@ -131,9 +150,9 @@ public class DataQualityCheckServiceImpl implements DataQualityCheckService { return Collections.emptyList(); } //将单位信息转为map集合 key: 单位id value: 单位实体 - Map dataMap = getDataMap(data); +// Map dataMap = getDataMap(data); return result.stream().peek(vo -> { - vo.setOrgName(dataMap.get(vo.getOrgNo()).getName()); + vo.setOrgName(deptDTOMap.get(vo.getOrgNo()).getName()); }).collect(Collectors.toList()); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/DataQualityDetailsServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/DataQualityDetailsServiceImpl.java index cc2f4c53d..09006c563 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/DataQualityDetailsServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/DataQualityDetailsServiceImpl.java @@ -74,7 +74,17 @@ public class DataQualityDetailsServiceImpl implements DataQualityDetailsService @Override public List getQualityProblemsOfMonitoringPointAccountData(DataQualityDetailsParam param) { // 获取单位下的子单位信息 - List data = getDeptInfo(param); + List data1 = getDeptInfo(param); + /*获取下级子部门信息*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( ); + if (CollUtil.isEmpty(deptDTOList)) { + return Collections.emptyList(); + } + List deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); + /*过滤单位只留下直接下属单位*/ + List data = data1.stream ( ). + filter (t -> deptIdList.contains (t.getIndex ( ))). + collect (Collectors.toList ( )); if (CollUtil.isEmpty(data)) { return Collections.emptyList(); } @@ -131,7 +141,17 @@ public class DataQualityDetailsServiceImpl implements DataQualityDetailsService @Override public List getTractionPlatformAccountDataQualityProblem(DataQualityDetailsParam param) { // 获取单位下的子单位信息 - List data = getDeptInfo(param); + List data1 = getDeptInfo(param); + /*获取下级子部门信息*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( ); + if (CollUtil.isEmpty(deptDTOList)) { + return Collections.emptyList(); + } + List deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); + /*过滤单位只留下直接下属单位*/ + List data = data1.stream ( ). + filter (t -> deptIdList.contains (t.getIndex ( ))). + collect (Collectors.toList ( )); if (CollUtil.isEmpty(data)) { return Collections.emptyList(); } @@ -185,7 +205,17 @@ public class DataQualityDetailsServiceImpl implements DataQualityDetailsService @Override public List getRStatTargetDetail(DataQualityDetailsParam param) { // 获取单位下的子单位信息 - List data = getDeptInfo(param); + List data1 = getDeptInfo(param); + /*获取下级子部门信息*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( ); + if (CollUtil.isEmpty(deptDTOList)) { + return Collections.emptyList(); + } + List deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); + /*过滤单位只留下直接下属单位*/ + List data = data1.stream ( ). + filter (t -> deptIdList.contains (t.getIndex ( ))). + collect (Collectors.toList ( )); if (CollUtil.isEmpty(data)) { return Collections.emptyList(); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/DataQualityStatServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/DataQualityStatServiceImpl.java index 030371609..a909e669d 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/DataQualityStatServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/DataQualityStatServiceImpl.java @@ -17,6 +17,8 @@ import com.njcn.device.pms.service.majornetwork.DataQualityStatService; import com.njcn.device.pms.service.majornetwork.IPmsGeneralDeviceService; import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.enums.DicDataEnum; +import com.njcn.user.api.DeptFeignClient; +import com.njcn.user.pojo.dto.DeptDTO; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; @@ -48,6 +50,8 @@ public class DataQualityStatServiceImpl implements DataQualityStatService { private final ROperatingIndexMapper rOperatingIndexMapper; + private final DeptFeignClient deptFeignClient; + private final DecimalFormat df = new DecimalFormat("###.00"); /** @@ -60,29 +64,37 @@ public class DataQualityStatServiceImpl implements DataQualityStatService { */ @Override public List getLedgerDataQualityStat(StatisticsBizBaseParam param) { - // 获取当前用户的部门的子部门信息 - List data = getPmsGeneralDeviceDTOList(param); - if (CollUtil.isEmpty(data)) { +// // 获取当前用户的部门的子部门信息 +// List data = getPmsGeneralDeviceDTOList(param); + + /*获取下级子部门信息*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( ); + if (CollUtil.isEmpty(deptDTOList)) { return Collections.emptyList(); } + List deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); + //将单位信息转为map集合 key: 单位code value: 单位实体 + Map deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO)); + + // 获取主网字典id String mainnetPoint = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData().getId(); // 获取主网数据质量-台账数据质量统计 List pos = rQualityParameterMapper.getLedgerDataQualityStat( param, - data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList()), + deptIdList, mainnetPoint ); if (CollUtil.isEmpty(pos)) { return Collections.emptyList(); } - //将单位信息转为map集合 key: 单位id value: 单位实体 - Map dataMap = getDataMap(data); +// //将单位信息转为map集合 key: 单位id value: 单位实体 +// Map dataMap = getDataMap(data); // 属性赋值 return pos.stream().map(po -> { RQualityParameterVO vo = new RQualityParameterVO(); BeanUtils.copyProperties(po, vo); - vo.setOrgName(dataMap.get(vo.getOrgNo()).getName()); + vo.setOrgName(deptDTOMap.get(vo.getOrgNo()).getName()); return vo; }).collect(Collectors.toList()); } @@ -97,13 +109,25 @@ public class DataQualityStatServiceImpl implements DataQualityStatService { */ @Override public List getMonitoringIndexDataQualityStat(StatisticsBizBaseParam param) { - // 获取当前用户的部门的子部门信息 - List data = getPmsGeneralDeviceDTOList(param); - if (CollUtil.isEmpty(data)) { + + +// // 获取当前用户的部门的子部门信息 +// List data = getPmsGeneralDeviceDTOList(param); +// // 取出单位id +// List deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList()); + //单位code集合 + /*获取下级子部门信息*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( ); + if (CollUtil.isEmpty(deptDTOList)) { return Collections.emptyList(); } - // 取出单位id - List deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList()); + List deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); + Map deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO)); + + //将单位信息转为map集合 key: 单位id value: 单位实体 +// Map dataMap = getDataMap(data); + //将单位信息转为map集合 key: 单位code value: 单位实体 + // 创建集合封装返回数据 List result = new ArrayList<>(); // 获取主网数据质量-监测指标数据质量统计 @@ -123,12 +147,12 @@ public class DataQualityStatServiceImpl implements DataQualityStatService { default: break; } - //将单位信息转为map集合 key: 单位id value: 单位实体 - Map dataMap = getDataMap(data); + + // 处理数据 // 计算有效接入率【有效接入监测点数量/在运监测点数】 return result.stream().peek(vo -> { - vo.setOrgName(dataMap.get(vo.getOrgNo()).getName()); + vo.setOrgName(deptDTOMap.get(vo.getOrgNo()).getName()); vo.setEffectiveAccessRate( Double.parseDouble( df.format((vo.getEffectiveAccessMeasurementCount() * 1.0) @@ -148,23 +172,31 @@ public class DataQualityStatServiceImpl implements DataQualityStatService { @Override public List getSummaryStatOfMonitoringIndexDataQualityProblems(StatisticsBizBaseParam param) { // 获取当前用户的部门的子部门信息 - List data = getPmsGeneralDeviceDTOList(param); - if (CollUtil.isEmpty(data)) { +// List data = getPmsGeneralDeviceDTOList(param); +// if (CollUtil.isEmpty(data)) { +// return Collections.emptyList(); +// } +// List deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList()); + /*获取下级子部门信息*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( ); + if (CollUtil.isEmpty(deptDTOList)) { return Collections.emptyList(); } - List deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList()); + List deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList()); + Map deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO)); + // 获取主网字典id String mainnetPoint = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData().getId(); // 获取主网数据质量-监测指标数据质量问题汇总统计 List pos = rQualityParameterMapper.getLedgerDataQualityStat(param, deptIdList, mainnetPoint); - // 将单位信息转为map集合 key: 单位id value: 单位实体 - Map dataMap = getDataMap(data); +// // 将单位信息转为map集合 key: 单位id value: 单位实体 +// Map dataMap = getDataMap(data); // 属性赋值 return pos.stream().map(po -> { RQualityParameterPollVO vo = new RQualityParameterPollVO(); BeanUtils.copyProperties(po, vo); vo.setOrgId(po.getOrgNo()); - vo.setOrgName(dataMap.get(vo.getOrgId()).getName()); + vo.setOrgName(deptDTOMap.get(vo.getOrgId()).getName()); vo.setProblemProportion( Double.parseDouble( df.format((po.getProblem() * 1.0) diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/GeneratrixWireImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/GeneratrixWireImpl.java index 579fa7739..908a79ea2 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/GeneratrixWireImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/GeneratrixWireImpl.java @@ -12,6 +12,7 @@ import com.njcn.device.pms.enums.PmsDeviceResponseEnum; import com.njcn.device.pms.mapper.majornetwork.GeneratrixWireMapper; import com.njcn.device.pms.mapper.majornetwork.PmsGeneratrixMapper; import com.njcn.device.pms.pojo.param.GeneratrixWireParam; +import com.njcn.device.pms.pojo.param.PmsBaseParam; import com.njcn.device.pms.pojo.po.Generatrix; import com.njcn.device.pms.pojo.po.GeneratrixWire; import com.njcn.device.pms.service.majornetwork.IGeneratrixWireService; @@ -73,9 +74,13 @@ public class GeneratrixWireImpl extends ServiceImpl getGeneratrixWireList() { + public List getGeneratrixWireList(PmsBaseParam pmsBaseParam) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); - lambdaQueryWrapper.orderByAsc(GeneratrixWire::getCreateTime); + if(StrUtil.isNotBlank(pmsBaseParam.getGeneratrixId())){ + lambdaQueryWrapper.eq(GeneratrixWire::getGeneratrixId,pmsBaseParam.getGeneratrixId()); + } + lambdaQueryWrapper.eq(GeneratrixWire::getStatus,DataStateEnum.ENABLE.getCode()) + .orderByAsc(GeneratrixWire::getCreateTime); return this.list(lambdaQueryWrapper); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/MonitorServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/MonitorServiceImpl.java index e773d784c..f3acda9ed 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/MonitorServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/MonitorServiceImpl.java @@ -9,10 +9,7 @@ import com.njcn.common.pojo.dto.SimpleDTO; import com.njcn.common.pojo.enums.common.DataStateEnum; import com.njcn.common.pojo.exception.BusinessException; import com.njcn.device.pms.enums.PmsDeviceResponseEnum; -import com.njcn.device.pms.mapper.majornetwork.MonitorMapper; -import com.njcn.device.pms.mapper.majornetwork.OverlimitMapper; -import com.njcn.device.pms.mapper.majornetwork.GeneratrixWireMapper; -import com.njcn.device.pms.mapper.majornetwork.PmsGeneratrixMapper; +import com.njcn.device.pms.mapper.majornetwork.*; import com.njcn.device.pms.pojo.dto.PmsMonitorBaseDTO; import com.njcn.device.pms.pojo.dto.PmsMonitorDTO; import com.njcn.device.pms.pojo.dto.PmsMonitorInfoDTO; @@ -23,6 +20,7 @@ import com.njcn.device.pms.pojo.param.PmsMonitorParam; import com.njcn.device.pms.pojo.po.Generatrix; import com.njcn.device.pms.pojo.po.GeneratrixWire; import com.njcn.device.pms.pojo.po.Monitor; +import com.njcn.device.pms.pojo.po.SpecialMonitor; import com.njcn.device.pms.pojo.vo.PmsMonitorVO; import com.njcn.device.pms.service.majornetwork.IMonitorService; import com.njcn.user.api.DeptFeignClient; @@ -38,6 +36,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; @@ -67,7 +66,7 @@ public class MonitorServiceImpl extends ServiceImpl impl private final PmsGeneratrixMapper generatrixMapper; - private final GeneratrixWireMapper generatrixWireMapper; + private final SpecialMonitorMapper specialMonitorMapper; @Override @@ -144,7 +143,13 @@ public class MonitorServiceImpl extends ServiceImpl impl @Override public Page getAllMonitorPageList(BaseParam baseParam) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); - lambdaQueryWrapper.eq(Monitor::getStatus,DataStateEnum.ENABLE.getCode()) + lambdaQueryWrapper + .like(StrUtil.isNotBlank(baseParam.getSearchValue()),Monitor::getName,baseParam.getSearchValue()) + .or(StrUtil.isNotBlank(baseParam.getSearchValue())) + .like(StrUtil.isNotBlank(baseParam.getSearchValue()),Monitor::getId,baseParam.getSearchValue()) + .or(StrUtil.isNotBlank(baseParam.getSearchValue())) + .like(StrUtil.isNotBlank(baseParam.getSearchValue()),Monitor::getOrgName,baseParam.getSearchValue()) + .eq(Monitor::getStatus,DataStateEnum.ENABLE.getCode()) .orderByDesc(Monitor::getCreateTime); return this.page(new Page<>(PageFactory.getPageNum(baseParam),PageFactory.getPageSize(baseParam)),lambdaQueryWrapper); } @@ -176,29 +181,49 @@ public class MonitorServiceImpl extends ServiceImpl impl } @Override + @Transactional(rollbackFor = Exception.class) public boolean addMonitor(MonitorParam monitorParam) { - checkParam(monitorParam,false); Monitor monitor = new Monitor(); BeanUtils.copyProperties(monitorParam,monitor); checkOther(monitorParam,monitor,false); monitor.setStatus(DataStateEnum.ENABLE.getCode()); - return this.save(monitor); + + //新增监测点同时新增pms_special_monitor + this.save(monitor); + SpecialMonitor specialMonitor = new SpecialMonitor(); + specialMonitor.setId(monitor.getId()); + specialMonitor.setCapacity(100f); + specialMonitor.setType(1); + specialMonitorMapper.insert(specialMonitor); + return true; } @Override + @Transactional(rollbackFor = Exception.class) public boolean updateMonitor(MonitorParam monitorParam) { checkParam(monitorParam,true); Monitor monitor = new Monitor(); BeanUtils.copyProperties(monitorParam,monitor); checkOther(monitorParam,monitor,true); - return this.updateById(monitor); + this.updateById(monitor); + + //修改监测点同时修改pms_special_monitor + SpecialMonitor specialMonitor = new SpecialMonitor(); + specialMonitor.setId(monitor.getId()); + specialMonitor.setCapacity(100f); + specialMonitor.setType(1); + specialMonitorMapper.updateById(specialMonitor); + return true; + } @Override public boolean delMonitor(List monitorIds) { - return this.removeByIds(monitorIds); + this.removeByIds(monitorIds); + specialMonitorMapper.deleteBatchIds(monitorIds); + return true; } @Override @@ -209,6 +234,21 @@ public class MonitorServiceImpl extends ServiceImpl impl private void checkParam(MonitorParam monitorParam,boolean update){ + //校验同一单位下面不能有同名1类监测点 + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(Monitor::getName,monitorParam.getName()) + .eq(Monitor::getOrgId,monitorParam.getOrgId()) + .eq(Monitor::getStatus,DataStateEnum.ENABLE.getCode()); + + if(update){ + lambdaQueryWrapper.ne(Monitor::getId,monitorParam.getId()); + } + + int count = this.count(lambdaQueryWrapper); + if(count>0){ + throw new BusinessException(PmsDeviceResponseEnum.DEPT_MONITOR_REPEAT); + } + //校验电压等级数据 DictData voltageDic = dicDataFeignClient.getDicDataById(monitorParam.getVoltageLevel()).getData(); if(Objects.isNull(voltageDic)){ @@ -277,16 +317,11 @@ public class MonitorServiceImpl extends ServiceImpl impl throw new BusinessException(PmsDeviceResponseEnum.VOLTAGE_EMPTY); } - //校验线路 - GeneratrixWire generatrixWire = generatrixWireMapper.selectById(monitorParam.getLineId()); - if(Objects.isNull(generatrixWire)){ - throw new BusinessException(PmsDeviceResponseEnum.LINE_EMPTY); - } monitor.setOperationName(dept.getName()); monitor.setOperationName(deptOp.getName()); monitor.setGeneratrixName(generatrix.getGeneratrixName()); - monitor.setLineName(generatrixWire.getWireName()); + } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/OverviewServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/OverviewServiceImpl.java new file mode 100644 index 000000000..c625928a1 --- /dev/null +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/OverviewServiceImpl.java @@ -0,0 +1,275 @@ +package com.njcn.device.pms.service.majornetwork.impl; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.njcn.device.pms.mapper.majornetwork.OverviewMapper; +import com.njcn.device.pms.pojo.param.OverviewParam; +import com.njcn.device.pms.pojo.po.RMpMonitorAlarmCountM; +import com.njcn.device.pms.pojo.po.RStatAreaAlarmCountM; +import com.njcn.device.pms.pojo.vo.DistributionMonitorVO; +import com.njcn.device.pms.pojo.vo.OverviewVO; +import com.njcn.device.pms.service.majornetwork.OverviewService; +import com.njcn.device.pms.service.majornetwork.RMpMonitorAlarmCountMService; +import com.njcn.device.pms.service.majornetwork.RStatAreaAlarmCountMService; +import com.njcn.system.api.DicDataFeignClient; +import com.njcn.system.enums.DicDataEnum; +import com.njcn.system.enums.DicDataTypeEnum; +import com.njcn.system.pojo.po.DictData; +import com.njcn.user.api.DeptFeignClient; +import com.njcn.user.pojo.dto.DeptDTO; +import com.njcn.user.pojo.po.Dept; +import com.njcn.web.utils.WebUtil; +import lombok.RequiredArgsConstructor; +import org.apache.commons.lang.StringUtils; +import org.springframework.stereotype.Service; + +import java.text.DecimalFormat; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * <分布式光伏概览业务> + * + * @author wr + * @createTime: 2022-12-29 + */ +@Service +@RequiredArgsConstructor +public class OverviewServiceImpl implements OverviewService { + + + private final OverviewMapper overviewMapper; + private final DeptFeignClient deptFeignClient; + private final DicDataFeignClient dicDataFeignClient; + private final RMpMonitorAlarmCountMService rMpMonitorAlarmCountMService; + private final RStatAreaAlarmCountMService rStatAreaAlarmCountMService; + + @Override + public List getMonitorYoY(OverviewParam param) { + List overviewVOS=new ArrayList<>(); + + //获取监测点类别集合(配网1-2-3类监测点) + List lineData = dicDataFeignClient.getDicDataByTypeCode( + DicDataTypeEnum.LINE_SORT.getCode()).getData(); + + //获取部门数据 + List deptListCode = getDeptListCode(param.getId()); + if(CollectionUtil.isNotEmpty(deptListCode)){ + + overviewVOS = overviewMapper.selectYoY(deptListCode, param); + Map voMap = overviewVOS.stream(). + collect(Collectors.toMap(OverviewVO::getMonitorSort, Function.identity())); + + //不存在监测点赋值初始值 + List notMeasurementList = lineData.stream().filter(r -> !voMap.containsKey(r.getId())) + .collect(Collectors.toList()); + if(CollectionUtil.isNotEmpty(notMeasurementList)){ + OverviewVO overviewVO; + for (DictData notData : notMeasurementList) { + overviewVO=new OverviewVO(); + overviewVO.setMonitorSort(notData.getId()); + overviewVO.setSumNum("0"); + overviewVO.setYtbSumNum("0"); + overviewVO.setYhbSumNum("0"); + overviewVO.setSameNum("10"); + overviewVO.setRingNum("-50"); + overviewVOS.add(overviewVO); + } + } + + } + return overviewVOS; + } + + @Override + public List getAlarmProportion(OverviewParam.OverviewDateParam param) { + List alarmVOS=new ArrayList<>(); + //获取部门数据 + List deptListCode = getDeptListCode(param.getId()); + DictData data = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData(); + + //获取监测点类别集合(配网1-2-3类监测点) + List lineData = dicDataFeignClient.getDicDataByTypeCode( + DicDataTypeEnum.LINE_SORT.getCode()).getData(); + + if(CollectionUtil.isNotEmpty(deptListCode)){ + //数据统计(配网监测点) + List distributionMonitors = overviewMapper.selectListAll(deptListCode); + Map distributionMonitorMap = + distributionMonitors.stream().collect(Collectors.toMap(DistributionMonitorVO::getMonitorId, Function.identity())); + + //数据 key:监测点类别 value:数量 + Map map = distributionMonitors.stream().collect(Collectors.groupingBy(dm -> dm.getMonitorSort(), Collectors.counting())); + + //获取数据库数据 + List list = rMpMonitorAlarmCountMService.list(new LambdaQueryWrapper() + .in(RMpMonitorAlarmCountM::getOrgNo, deptListCode) + .eq(RMpMonitorAlarmCountM::getDataType,data.getId()) + .ge(StringUtils.isNotBlank(param.getStartTime()), RMpMonitorAlarmCountM::getDataDate, param.getStartTime()) + .le(StringUtils.isNotBlank(param.getEndTime()), RMpMonitorAlarmCountM::getDataDate, param.getEndTime()) + ); + //为数据添加监测点类型类型(1-2-3监测点) + List info=new ArrayList<>(); + OverviewVO.MonitorAlarmCountVO monitorAlarmCountVO; + for (RMpMonitorAlarmCountM rMpMonitorAlarmCountM : list) { + //添加监测点的类型 + if(distributionMonitorMap.containsKey(rMpMonitorAlarmCountM.getMeasurementPointId())){ + monitorAlarmCountVO = BeanUtil.copyProperties(rMpMonitorAlarmCountM, OverviewVO.MonitorAlarmCountVO.class); + DistributionMonitorVO distributionMonitor = distributionMonitorMap.get(rMpMonitorAlarmCountM.getMeasurementPointId()); + monitorAlarmCountVO.setMonitorSort(distributionMonitor.getMonitorSort()); + info.add(monitorAlarmCountVO); + } + } + //根据数据类型进行分组 + Map> listMap = info.stream() + .collect(Collectors.groupingBy(OverviewVO.MonitorAlarmCountVO::getMonitorSort)); + + listMap.forEach((key,value)->{ + //谐波电压,闪变,三项不平横 + Integer vAlarmInfo=0, flickerAlarmInfo=0, unbalanceAlarmInfo=0; + + for (OverviewVO.MonitorAlarmCountVO alarmCountVO : value) { + if(alarmCountVO.getVAlarmInfo()==1){ + vAlarmInfo=vAlarmInfo+1; + } + if(alarmCountVO.getFlickerAlarmInfo()==1){ + flickerAlarmInfo=flickerAlarmInfo+1; + } + if(alarmCountVO.getUnbalanceAlarmInfo()==1){ + unbalanceAlarmInfo=unbalanceAlarmInfo+1; + } + } + DecimalFormat df = new DecimalFormat("###.00"); + Float vAlarm = Float.parseFloat( + df.format(vAlarmInfo / (map.get(key) * 1.0))); + Float flickerAlarm = Float.parseFloat( + df.format(flickerAlarmInfo / (map.get(key) * 1.0))); + Float unbalanceAlarm = Float.parseFloat( + df.format(unbalanceAlarmInfo / (map.get(key) * 1.0))); + //计算占比 + OverviewVO.AlarmVO alarmVO=new OverviewVO.AlarmVO(); + alarmVO.setMonitorSort(key); + alarmVO.setVAlarm(vAlarm); + alarmVO.setFlickerAlarm(flickerAlarm); + alarmVO.setUnbalanceAlarm(unbalanceAlarm); + alarmVOS.add(alarmVO); + + }); + //判断不存在监测点集合 + Map voMap = alarmVOS.stream() + .collect(Collectors.toMap(OverviewVO.AlarmVO::getMonitorSort, Function.identity())); + List notMeasurementList = lineData.stream().filter(r -> !voMap.containsKey(r.getId())) + .collect(Collectors.toList()); + if(CollectionUtil.isNotEmpty(notMeasurementList)){ + OverviewVO.AlarmVO overviewVO; + for (DictData notData : notMeasurementList) { + overviewVO=new OverviewVO.AlarmVO(); + overviewVO.setMonitorSort(notData.getId()); + overviewVO.setVAlarm(0.0f); + overviewVO.setFlickerAlarm(0.0f); + overviewVO.setUnbalanceAlarm(0.0f); + alarmVOS.add(overviewVO); + } + } + + } + return alarmVOS; + } + + @Override + public Map> getMonitorDistributed(OverviewParam param) { + Map> info =new LinkedHashMap<>(); + //获取监测点类别集合(配网1-2-3类监测点) + List lineData = dicDataFeignClient.getDicDataByTypeCode( + DicDataTypeEnum.LINE_SORT.getCode()).getData(); + for (DictData dictData : lineData) { + info.put(dictData.getId(),new ArrayList<>()); + } + //获取部门数据 + List subDeptListCode = getSubDeptListCode(param.getId()); + List deptListCode = subDeptListCode.stream().map(DeptDTO::getCode).collect(Collectors.toList()); + if(CollectionUtil.isNotEmpty(deptListCode)){ + //获取所有配网监测点信息 + List distributionMonitors = overviewMapper.selectListAll(deptListCode); + info.putAll(distributionMonitors.stream().collect(Collectors.groupingBy(DistributionMonitorVO::getMonitorSort))); + } + return info; + } + + @Override + public List getAlarmRating(OverviewParam.OverviewDateParam param) { + List subDeptListCode = getSubDeptListCode(param.getId()); + List deptListCode = subDeptListCode.stream().map(DeptDTO::getCode).collect(Collectors.toList()); + Map deptMap = subDeptListCode.stream().collect(Collectors.toMap(DeptDTO::getCode, Function.identity())); + + //查询配网信息 + DictData dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData(); + + List list = rStatAreaAlarmCountMService.list(new LambdaQueryWrapper() + .in(RStatAreaAlarmCountM::getOrgNo, deptListCode) + .eq(RStatAreaAlarmCountM::getDataType, dictData.getId()) + .ge(StringUtils.isNotBlank(param.getStartTime()), RStatAreaAlarmCountM::getDataDate, param.getStartTime()) + .le(StringUtils.isNotBlank(param.getEndTime()), RStatAreaAlarmCountM::getDataDate, param.getEndTime()) + ); + List alarmCountMVOS= new ArrayList<>(); + OverviewVO.AreaAlarmCountVO alarmCountVO; + for (RStatAreaAlarmCountM alarmCountMVO : list) { + if(deptMap.containsKey(alarmCountMVO.getOrgNo())){ + alarmCountVO=new OverviewVO.AreaAlarmCountVO(); + String name = deptMap.get(alarmCountMVO.getOrgNo()).getName(); + alarmCountVO.setOrgName(name.replace("供电公司","市")); + alarmCountVO.setEventTypeGrade(alarmCountMVO.getEventTypeGrade()); + alarmCountVO.setHarmonicTypeGrade(alarmCountMVO.getHarmonicTypeGrade()); + alarmCountMVOS.add(alarmCountVO); + } + } + + return alarmCountMVOS; + } + + @Override + public List getWorkOrder(OverviewParam.OverviewDateParam param) { + + return null; + } + + + /** + * 当前部门通用方法 + * @param id + * @return + */ + public List getDeptListCode(String id){ + //获取部门数据 + Dept data = deptFeignClient.getDeptById(id).getData(); + if(ObjectUtil.isNotNull(data)){ + return Arrays.asList(data.getCode()); + } + return new ArrayList<>(); + } + + /** + * 当前部门下子部门通用方法 + * @param deptId + * @return + */ + public List getSubDeptListCode(String deptId){ + List deptDTOList = deptFeignClient.getDeptDescendantIndexes(deptId, WebUtil.filterDeptType()).getData(); + //获取子部门 + List directDeptInfos = deptDTOList.stream() + .filter(deptDTO -> deptDTO.getPid().equals(deptId)) + .collect(Collectors.toList()); + if (CollectionUtil.isEmpty(directDeptInfos)) { + //没有直接子部门,获取当前部门所有信息 + List dept = deptDTOList.stream() + .filter(deptDTO -> deptDTO.getId().equals(deptId)) + .collect(Collectors.toList()); + return dept; + } + return directDeptInfos; + } + +} diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PmsGeneratrixServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PmsGeneratrixServiceImpl.java index 0c99af7a5..e5041f831 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PmsGeneratrixServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PmsGeneratrixServiceImpl.java @@ -13,10 +13,7 @@ import com.njcn.device.pms.mapper.majornetwork.StatationStatMapper; import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationDTO; import com.njcn.device.pms.pojo.dto.GeneratrixAndPowerStationSonDTO; import com.njcn.device.pms.pojo.dto.PmsGeneratrixDTO; -import com.njcn.device.pms.pojo.param.ConditionParam; -import com.njcn.device.pms.pojo.param.GeneratrixParam; -import com.njcn.device.pms.pojo.param.GeneratrixWireParam; -import com.njcn.device.pms.pojo.param.PmsGeneratrixParam; +import com.njcn.device.pms.pojo.param.*; import com.njcn.device.pms.pojo.po.Generatrix; import com.njcn.device.pms.pojo.po.GeneratrixWire; import com.njcn.device.pms.pojo.po.StatationStat; @@ -32,6 +29,7 @@ import org.springframework.stereotype.Service; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** * @author yzh @@ -100,8 +98,11 @@ public class PmsGeneratrixServiceImpl extends ServiceImpl getGeneratrixList() { + public List getGeneratrixList(PmsBaseParam pmsBaseParam) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + if(StrUtil.isNotBlank(pmsBaseParam.getStationId())){ + lambdaQueryWrapper.eq(Generatrix::getStatationId,pmsBaseParam.getStationId()); + } lambdaQueryWrapper.orderByAsc(Generatrix::getCreateTime); return this.list(lambdaQueryWrapper); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PowerDistributionareaServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PowerDistributionareaServiceImpl.java index 257154c19..526e3bad5 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PowerDistributionareaServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/PowerDistributionareaServiceImpl.java @@ -8,6 +8,7 @@ import com.njcn.common.pojo.enums.common.DataStateEnum; import com.njcn.common.pojo.exception.BusinessException; import com.njcn.device.pms.enums.PmsDeviceResponseEnum; import com.njcn.device.pms.mapper.majornetwork.PowerDistributionareaMapper; +import com.njcn.device.pms.pojo.param.PmsBaseParam; import com.njcn.device.pms.pojo.param.PowerDistributionareaParam; import com.njcn.device.pms.pojo.po.PowerClient; import com.njcn.device.pms.pojo.po.PowerDistributionarea; @@ -75,6 +76,8 @@ public class PowerDistributionareaServiceImpl extends ServiceImpl deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); +// List deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); + /*获取下级子部门信息*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( ); if (CollUtil.isEmpty(deptDTOList)) { throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在"); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/RMpDevSolveDetailServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/RMpDevSolveDetailServiceImpl.java index bbf387cf7..881aa799a 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/RMpDevSolveDetailServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/RMpDevSolveDetailServiceImpl.java @@ -59,7 +59,9 @@ public class RMpDevSolveDetailServiceImpl extends ServiceImpl deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); +// List deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); + /*获取下一级子部门信息*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( ); if (CollUtil.isEmpty(deptDTOList)) { throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在"); } @@ -302,7 +304,9 @@ public class RMpDevSolveDetailServiceImpl extends ServiceImpl deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); +// List deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); + /*获取下级子部门信息*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( ); if (CollUtil.isEmpty(deptDTOList)) { throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在"); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/ROperatingIndexMServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/ROperatingIndexMServiceImpl.java index 87b78d282..f708bd053 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/ROperatingIndexMServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/ROperatingIndexMServiceImpl.java @@ -43,7 +43,9 @@ public class ROperatingIndexMServiceImpl extends ServiceImpl deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); +// List deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); + /*获取下一级子部门信息*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( ); if (CollUtil.isEmpty(deptDTOList)) { throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在"); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/ROperatingIndexYServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/ROperatingIndexYServiceImpl.java index 548a58423..4508592c3 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/ROperatingIndexYServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/ROperatingIndexYServiceImpl.java @@ -42,8 +42,10 @@ public class ROperatingIndexYServiceImpl extends ServiceImpl deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); +// //获取所有子部门信息 +// List deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); + /*获取下一级子部门信息*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( ); if (CollUtil.isEmpty(deptDTOList)) { throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在"); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/RStatDevSignalDServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/RStatDevSignalDServiceImpl.java index add3ea064..677681cca 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/RStatDevSignalDServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/RStatDevSignalDServiceImpl.java @@ -52,7 +52,9 @@ public class RStatDevSignalDServiceImpl extends ServiceImpl deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); +// List deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData(); + /*获取下一级子部门信息*/ + List deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( ); if (CollUtil.isEmpty(deptDTOList)) { throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在"); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/SpecialAnalysisServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/SpecialAnalysisServiceImpl.java index d0d7b8d55..7120edd6e 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/SpecialAnalysisServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/SpecialAnalysisServiceImpl.java @@ -36,7 +36,7 @@ public class SpecialAnalysisServiceImpl implements SpecialAnalysisService { @Override public SpecialAnalysisMonitorVO getMonitorList(SpecialAnalysisParam param) { //初始化对象 - SpecialAnalysisMonitorVO vo=new SpecialAnalysisMonitorVO(); + SpecialAnalysisMonitorVO vo = new SpecialAnalysisMonitorVO(); //获取电压等级的字典 List voltageLevelList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData(); @@ -51,7 +51,7 @@ public class SpecialAnalysisServiceImpl implements SpecialAnalysisService { switch (param.getType()) { //光伏电站 case 1: - data = dicDataFeignClient.getDicDataByCode(DicDataEnum.POWER_STATION.getCode()).getData(); + data = dicDataFeignClient.getDicDataByCode(DicDataEnum.POWER_STATION.getCode()).getData(); break; //冶炼负荷 case 2: @@ -64,31 +64,33 @@ public class SpecialAnalysisServiceImpl implements SpecialAnalysisService { } //1.获取原始数据(参数1,部门id。参数2,监测点标签字典id集合) List infoList = specialAnalysisMapper.selectList(deptIds, data.getId()); - //获取部门区域 - if(CollectionUtil.isNotEmpty(infoList)){ - infoList.stream().forEach(info->{ - if(voltageLevelMap.containsKey(info.getVoltageLevel())){ + //获取部门区域 + if (CollectionUtil.isNotEmpty(infoList)) { + infoList.stream().forEach(info -> { + if (voltageLevelMap.containsKey(info.getVoltageLevel())) { String name = voltageLevelMap.get(info.getVoltageLevel()); info.setVoltageLevel(name); } }); Map> listMap = - infoList.stream().collect(Collectors.groupingBy(SpecialAnalysisMonitorVO.SpecialAnalysisVO::getOrgName)); + infoList.stream().collect(Collectors.groupingBy(r-> + r.getOrgName().replace("供电公司","市") + )); vo.setSpecialAnalysisVOList(listMap); //2.根据电压等级分组显示数据 Map map = infoList.stream().collect(Collectors.groupingBy(su -> su.getVoltageLevel(), Collectors.counting())); - List> maps=new ArrayList<>(); + List> maps = new ArrayList<>(); Map newMap; for (String key : map.keySet()) { - newMap=new HashMap<>(); - newMap.put("name",key); - newMap.put("value",map.get(key).toString()); + newMap = new HashMap<>(); + newMap.put("name", key); + newMap.put("value", map.get(key).toString()); maps.add(newMap); } vo.setVoltageLevelMap(maps); - }else{ + } else { vo.setSpecialAnalysisVOList(new HashMap<>()); vo.setVoltageLevelMap(new ArrayList<>()); } @@ -96,15 +98,15 @@ public class SpecialAnalysisServiceImpl implements SpecialAnalysisService { } @Override - public SpecialAnalysisMonitorVO.CompareDetailVO getYoYList(SpecialAnalysisParam.CompareDateParam param) { + public SpecialAnalysisMonitorVO.CompareDetailVO getYoYList(SpecialAnalysisParam.CompareDateParam param) { //获取部门信息 List deptList = deptFeignClient.getSpecialDeptList().getData(); List deptIds = deptList.stream().map(Dept::getCode).collect(Collectors.toList()); - return specialAnalysisMapper.selectYoYList(deptIds,param); + return specialAnalysisMapper.selectYoYList(deptIds, param); } @Override - public Map> getDisplayRailway() { + public Map> getDisplayRailway() { // 获取部门信息 List deptList = deptFeignClient.getSpecialDeptList().getData(); List deptIds = deptList.stream().map(Dept::getCode).collect(Collectors.toList()); @@ -115,15 +117,15 @@ public class SpecialAnalysisServiceImpl implements SpecialAnalysisService { Map voltageLevelMap = voltageLevelList.stream().collect(Collectors.toMap(DictData::getId, DictData::getName)); List specialAnalysisRailwayVOS = specialAnalysisMapper.selectRailwayList(deptIds); - if(CollUtil.isNotEmpty(specialAnalysisRailwayVOS)){ - specialAnalysisRailwayVOS.stream().forEach(info->{ - if(voltageLevelMap.containsKey(info.getVoltageLevel())){ + if (CollUtil.isNotEmpty(specialAnalysisRailwayVOS)) { + specialAnalysisRailwayVOS.stream().forEach(info -> { + if (voltageLevelMap.containsKey(info.getVoltageLevel())) { String name = voltageLevelMap.get(info.getVoltageLevel()); info.setVoltageLevel(name); } }); - return specialAnalysisRailwayVOS.stream().collect( - Collectors.groupingBy(SpecialAnalysisMonitorVO.SpecialAnalysisRailwayVO::getRailwayLineName)); + return specialAnalysisRailwayVOS.stream().collect( + Collectors.groupingBy(SpecialAnalysisMonitorVO.SpecialAnalysisRailwayVO::getRailwayLineName)); } return new HashMap<>(); } @@ -152,7 +154,7 @@ public class SpecialAnalysisServiceImpl implements SpecialAnalysisService { //处理主节点不存在的集合 List notMeasurementList = lineData.stream().filter(r -> !detailMap.containsKey(r.getId())) .collect(Collectors.toList()); - SpecialAnalysisMonitorVO.WiringTypeDetail wiringTypeDetail ; + SpecialAnalysisMonitorVO.WiringTypeDetail wiringTypeDetail; for (DictData notData : notMeasurementList) { wiringTypeDetail = new SpecialAnalysisMonitorVO.WiringTypeDetail(); wiringTypeDetail.setConnetGroupWay(notData.getId()); @@ -162,7 +164,7 @@ public class SpecialAnalysisServiceImpl implements SpecialAnalysisService { wiringTypeDetail.setRate99("0"); wiringTypeRailway.add(wiringTypeDetail); } - if(CollUtil.isNotEmpty(wiringTypeRailway)){ + if (CollUtil.isNotEmpty(wiringTypeRailway)) { return wiringTypeRailway; } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/StatationStatServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/StatationStatServiceImpl.java index 28f694756..ced2ebffb 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/StatationStatServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/StatationStatServiceImpl.java @@ -1,5 +1,6 @@ package com.njcn.device.pms.service.majornetwork.impl; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.njcn.common.pojo.enums.common.DataStateEnum; @@ -7,12 +8,14 @@ import com.njcn.common.pojo.exception.BusinessException; import com.njcn.device.pms.enums.PmsDeviceResponseEnum; import com.njcn.device.pms.mapper.majornetwork.StatationStatMapper; import com.njcn.device.pms.pojo.dto.PmsStatationStatInfoDTO; +import com.njcn.device.pms.pojo.param.PmsBaseParam; import com.njcn.device.pms.pojo.param.StatationStatParam; import com.njcn.device.pms.pojo.param.PmsStatationStatInfoParam; import com.njcn.device.pms.pojo.po.StatationStat; import com.njcn.device.pms.pojo.vo.StatationStatVO; import com.njcn.device.pms.service.majornetwork.IStatationStatService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.njcn.user.api.DeptFeignClient; import com.njcn.web.factory.PageFactory; import com.njcn.web.pojo.param.BaseParam; import lombok.RequiredArgsConstructor; @@ -36,6 +39,8 @@ public class StatationStatServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(StatationStat::getOrgId,statationStatParam.getOrgId()) @@ -99,9 +103,14 @@ public class StatationStatServiceImpl extends ServiceImpl getStatationStatList() { + public List getStatationStatList(PmsBaseParam pmsBaseParam) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.orderByDesc(StatationStat::getCreateTime); + if(StrUtil.isNotBlank(pmsBaseParam.getDeptId())){ + List deptCodes = deptFeignClient.getDepSonSelfCodetByDeptId(pmsBaseParam.getDeptId()).getData(); + lambdaQueryWrapper.in(StatationStat::getOrgId,deptCodes); + } + return this.list(lambdaQueryWrapper); } diff --git a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/TerminalServiceImpl.java b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/TerminalServiceImpl.java index 9ec4ccc8b..fc54e3e41 100644 --- a/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/TerminalServiceImpl.java +++ b/pqs-device/pms-device/pms-device-boot/src/main/java/com/njcn/device/pms/service/majornetwork/impl/TerminalServiceImpl.java @@ -8,6 +8,7 @@ import com.njcn.common.pojo.exception.BusinessException; import com.njcn.device.pms.enums.PmsDeviceResponseEnum; import com.njcn.device.pms.mapper.majornetwork.StatationStatMapper; import com.njcn.device.pms.mapper.majornetwork.TerminalMapper; +import com.njcn.device.pms.pojo.param.PmsBaseParam; import com.njcn.device.pms.pojo.param.PmsTerminalParam; import com.njcn.device.pms.pojo.po.PmsTerminal; import com.njcn.device.pms.pojo.po.StatationStat; @@ -62,11 +63,15 @@ public class TerminalServiceImpl extends ServiceImpl getTerminalSelectList() { + public List getTerminalSelectList(PmsBaseParam pmsBaseParam) { LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.select(PmsTerminal::getName,PmsTerminal::getOrgId,PmsTerminal::getOrgName,PmsTerminal::getId); lambdaQueryWrapper.eq(PmsTerminal::getStatus,DataStateEnum.ENABLE.getCode()) .orderByDesc(PmsTerminal::getCreateTime); + if(StrUtil.isNotBlank(pmsBaseParam.getDeptId())){ + List deptCodes = deptFeignClient.getDepSonSelfCodetByDeptId(pmsBaseParam.getDeptId()).getData(); + lambdaQueryWrapper.in(PmsTerminal::getOrgId,deptCodes); + } return this.list(lambdaQueryWrapper); }