pms代码合并
This commit is contained in:
@@ -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<List<PwPmsMonitorDTO>> getPwSubsetMonitorList(@RequestBody @Validated PwPmsMonitorParam pwPmsMonitorParam) {
|
||||
String methodDescribe = getMethodDescribe("getPwSubsetMonitorList");
|
||||
List<PwPmsMonitorDTO> monitorList = iPwMonitorService.getPwSubsetMonitorList(pwPmsMonitorParam);
|
||||
if (CollectionUtil.isEmpty(monitorList)) {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.NO_DATA, null, methodDescribe);
|
||||
} else {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitorList, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取分布式光伏配网所有监测点信息
|
||||
*
|
||||
|
||||
@@ -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<List<OverviewVO.AlarmVO>> getAlarmProportion(@RequestBody OverviewParam.OverviewDateParam param) {
|
||||
String methodDescribe = getMethodDescribe("getAlarmProportion");
|
||||
List<OverviewVO.AlarmVO> 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<List<OverviewVO.AreaAlarmCountVO>> getAlarmRating(@RequestBody OverviewParam.OverviewDateParam param) {
|
||||
String methodDescribe = getMethodDescribe("getAlarmRating");
|
||||
List<OverviewVO.AreaAlarmCountVO> 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<List<?>> getWorkOrder(@RequestBody OverviewParam.OverviewDateParam param) {
|
||||
// String methodDescribe = getMethodDescribe("getWorkOrder");
|
||||
// List<?> groups = overviewService.getWorkOrder(param);
|
||||
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, groups, methodDescribe);
|
||||
// }
|
||||
}
|
||||
@@ -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<List<OverviewVO>> getMapDisplay(@RequestBody OverviewParam param) {
|
||||
String methodDescribe = getMethodDescribe("getMapDisplay");
|
||||
List<OverviewVO> 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<Map<String, List<DistributionMonitorVO>>> getMonitorDistributed(@RequestBody OverviewParam param) {
|
||||
String methodDescribe = getMethodDescribe("getMonitorDistributed");
|
||||
Map<String, List<DistributionMonitorVO>> monitorDistributed = overviewService.getMonitorDistributed(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitorDistributed, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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;
|
||||
@@ -166,9 +167,9 @@ public class PmsGeneratrixController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/getGeneratrixList")
|
||||
@ApiOperation("获取所有母线下拉框使用")
|
||||
public HttpResult<List<Generatrix>> getGeneratrixList() {
|
||||
public HttpResult<List<Generatrix>> getGeneratrixList(@RequestBody PmsBaseParam pmsBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("getGeneratrixList");
|
||||
List<Generatrix> result = pmsGeneratrixService.getGeneratrixList();
|
||||
List<Generatrix> result = pmsGeneratrixService.getGeneratrixList(pmsBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -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<List<GeneratrixWire>> getGeneratrixWireList() {
|
||||
public HttpResult<List<GeneratrixWire>> getGeneratrixWireList(@RequestBody PmsBaseParam pmsBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("getGeneratrixWireList");
|
||||
List<GeneratrixWire> result = iGeneratrixWireService.getGeneratrixWireList();
|
||||
List<GeneratrixWire> result = iGeneratrixWireService.getGeneratrixWireList(pmsBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -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<List<StatationStat>> getstatationStatList() {
|
||||
public HttpResult<List<StatationStat>> getstatationStatList(@RequestBody @Validated PmsBaseParam pmsBaseParam) {
|
||||
String methodDescribe = getMethodDescribe("getstatationStatList");
|
||||
List<StatationStat> result = statationStatService.getStatationStatList();
|
||||
List<StatationStat> result = statationStatService.getStatationStatList(pmsBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -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<List<PmsTerminal>> getTerminalSelectList(){
|
||||
public HttpResult<List<PmsTerminal>> getTerminalSelectList(@RequestBody PmsBaseParam pmsBaseParam){
|
||||
String methodDescribe = getMethodDescribe("getTerminalSelectList");
|
||||
List<PmsTerminal> res = iTerminalService.getTerminalSelectList();
|
||||
List<PmsTerminal> res = iTerminalService.getTerminalSelectList(pmsBaseParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,res,methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<OverviewVO> selectYoY(@Param("orgIds") List<String> orgId,@Param("param") OverviewParam param);
|
||||
|
||||
/**
|
||||
* 查询配网所有信息
|
||||
* @return
|
||||
*/
|
||||
List<DistributionMonitorVO> selectListAll(@Param("orgIds") List<String> orgId);
|
||||
}
|
||||
@@ -16,6 +16,7 @@ public interface SpecialAnalysisMapper {
|
||||
|
||||
/**
|
||||
* 专项分析-地图数据展示
|
||||
*
|
||||
* @param deptIdList 部门集合(Code)
|
||||
* @param monitorTags 监测标签(字典)
|
||||
* @return
|
||||
@@ -25,6 +26,7 @@ public interface SpecialAnalysisMapper {
|
||||
|
||||
/**
|
||||
* 同比环比数据(风电场,光伏电站,冶炼负荷)
|
||||
*
|
||||
* @param deptIdList
|
||||
* @param param
|
||||
* @return
|
||||
@@ -34,6 +36,7 @@ public interface SpecialAnalysisMapper {
|
||||
|
||||
/**
|
||||
* 专项分析-地图数据展示
|
||||
*
|
||||
* @param deptIdList 部门集合(Code)
|
||||
* @return
|
||||
*/
|
||||
@@ -42,6 +45,7 @@ public interface SpecialAnalysisMapper {
|
||||
|
||||
/**
|
||||
* 地图展示数据-按电压展示数据(电气铁路)
|
||||
*
|
||||
* @param deptIdList 部门集合(Code)
|
||||
* @param param
|
||||
* @return
|
||||
@@ -51,6 +55,7 @@ public interface SpecialAnalysisMapper {
|
||||
|
||||
/**
|
||||
* 地图展示数据-按接线类型展示(电气化铁路)
|
||||
*
|
||||
* @param deptIdList
|
||||
* @param param
|
||||
* @return
|
||||
|
||||
@@ -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<SpecialMonitor> {
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.njcn.device.pms.mapper.majornetwork.OverviewMapper">
|
||||
|
||||
<select id="selectYoY" resultType="com.njcn.device.pms.pojo.vo.OverviewVO">
|
||||
|
||||
SELECT
|
||||
ta.Monitor_Sort as monitorSort,
|
||||
SUM(ta.num) as sumNum,
|
||||
IFNULL(SUM(tb.num),0) as ytbSumNum,
|
||||
IFNULL(SUM(tc.num),0) as yhbSumNum,
|
||||
ifnull(round((SUM(ta.num)-SUM(tb.num))/SUM(tb.num)*100,2),0) as sameNum,
|
||||
ifnull(round((SUM(ta.num)-SUM(tc.num))/SUM(tc.num)*100,2),0) as ringNum
|
||||
FROM (
|
||||
SELECT
|
||||
t.Monitor_Sort,
|
||||
year(t.Created_Date) as yy,
|
||||
month(t.Created_Date) as mm,
|
||||
COUNT(*) as num
|
||||
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
b.Monitor_Sort,
|
||||
b.Created_Date
|
||||
FROM
|
||||
(
|
||||
( SELECT id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_client
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND Is_Up_To_Grid = 1 AND STATUS = 1
|
||||
</where>
|
||||
) UNION ALL
|
||||
( SELECT id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_generation_user
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND Is_Up_To_Grid = 1 AND STATUS = 1
|
||||
</where>
|
||||
) UNION ALL
|
||||
( SELECT id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_distributionarea
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND Is_Up_To_Grid = 1 AND STATUS = 1
|
||||
</where>
|
||||
|
||||
) UNION ALL
|
||||
( SELECT id, Operation_Id, Powerr_Id, Line_Id FROM pms_monitor
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND Is_Up_To_Grid = 1 AND STATUS = 1
|
||||
</where>
|
||||
|
||||
)
|
||||
) t
|
||||
INNER JOIN pms_distribution_monitor b ON t.id = b.Monitor_Id
|
||||
|
||||
)t
|
||||
|
||||
GROUP BY t.Monitor_Sort,yy,mm
|
||||
) ta
|
||||
-- 同比:上年同月
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
t.Monitor_Sort,
|
||||
year(t.Created_Date) as yy,
|
||||
month(t.Created_Date) as mm,
|
||||
COUNT(*) as num
|
||||
|
||||
FROM (
|
||||
SELECT
|
||||
b.Monitor_Sort,
|
||||
b.Created_Date
|
||||
FROM
|
||||
(
|
||||
( SELECT id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_client
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND Is_Up_To_Grid = 1 AND STATUS = 1
|
||||
</where>
|
||||
) UNION ALL
|
||||
( SELECT id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_generation_user
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND Is_Up_To_Grid = 1 AND STATUS = 1
|
||||
</where>
|
||||
) UNION ALL
|
||||
( SELECT id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_distributionarea
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND Is_Up_To_Grid = 1 AND STATUS = 1
|
||||
</where>
|
||||
|
||||
) UNION ALL
|
||||
( SELECT id, Operation_Id, Powerr_Id, Line_Id FROM pms_monitor
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND Is_Up_To_Grid = 1 AND STATUS = 1
|
||||
</where>
|
||||
|
||||
)
|
||||
) t
|
||||
INNER JOIN pms_distribution_monitor b ON t.id = b.Monitor_Id
|
||||
|
||||
)t
|
||||
|
||||
GROUP BY t.Monitor_Sort,yy,mm
|
||||
) tb
|
||||
ON tb.mm = ta.mm and tb.yy = ta.yy-1 and tb.Monitor_Sort = ta.Monitor_Sort
|
||||
|
||||
-- 环比:上月
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
t.Monitor_Sort,
|
||||
year(t.Created_Date) as yy,
|
||||
month(t.Created_Date) as mm,
|
||||
COUNT(*) as num
|
||||
|
||||
FROM (
|
||||
SELECT
|
||||
b.Monitor_Sort,
|
||||
b.Created_Date
|
||||
FROM
|
||||
(
|
||||
( SELECT id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_client
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND Is_Up_To_Grid = 1 AND STATUS = 1
|
||||
</where>
|
||||
) UNION ALL
|
||||
( SELECT id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_generation_user
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND Is_Up_To_Grid = 1 AND STATUS = 1
|
||||
</where>
|
||||
) UNION ALL
|
||||
( SELECT id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_distributionarea
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND Is_Up_To_Grid = 1 AND STATUS = 1
|
||||
</where>
|
||||
|
||||
) UNION ALL
|
||||
( SELECT id, Operation_Id, Powerr_Id, Line_Id FROM pms_monitor
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND Is_Up_To_Grid = 1 AND STATUS = 1
|
||||
</where>
|
||||
|
||||
)
|
||||
) t
|
||||
INNER JOIN pms_distribution_monitor b ON t.id = b.Monitor_Id
|
||||
|
||||
)t
|
||||
|
||||
GROUP BY t.Monitor_Sort,yy,mm
|
||||
) tc
|
||||
ON ( (tc.yy = ta.yy and tc.mm = ta.mm - 1 and tc.Monitor_Sort = ta.Monitor_Sort)
|
||||
OR
|
||||
(tc.yy=ta.yy - 1 AND tc.mm = 12 AND ta.mm = 1 and tc.Monitor_Sort = ta.Monitor_Sort)
|
||||
)
|
||||
|
||||
<where>
|
||||
<if test="param.year != null and param.year!=''">
|
||||
AND ta.yy = #{param.year}
|
||||
</if>
|
||||
<if test="param.month != null and param.month.size > 0">
|
||||
AND ta.mm IN
|
||||
<foreach collection='param.month' item='item' index="index" open='(' separator=',' close=')'>
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
</where>
|
||||
|
||||
GROUP BY ta.Monitor_Sort;
|
||||
|
||||
</select>
|
||||
<select id="selectListAll" resultType="com.njcn.device.pms.pojo.vo.DistributionMonitorVO">
|
||||
SELECT
|
||||
t.org_id as orgNo,
|
||||
pss.Longitude as longitude,
|
||||
pss.Latitude as latitude,
|
||||
b.*
|
||||
FROM
|
||||
(
|
||||
( SELECT id,org_id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_client
|
||||
<where>
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND Is_Up_To_Grid = 1 AND STATUS = 1
|
||||
</where>
|
||||
) UNION ALL
|
||||
( SELECT id,org_id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_generation_user
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND Is_Up_To_Grid = 1 AND STATUS = 1
|
||||
</where>
|
||||
) UNION ALL
|
||||
( SELECT id,org_id, Operation_Id, Power_Station_Id, Line_Id FROM pms_power_distributionarea
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND Is_Up_To_Grid = 1 AND STATUS = 1
|
||||
</where>
|
||||
|
||||
) UNION ALL
|
||||
( SELECT id,org_id, Operation_Id, Powerr_Id, Line_Id FROM pms_monitor
|
||||
<where>
|
||||
|
||||
org_id IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
AND Is_Up_To_Grid = 1 AND STATUS = 1
|
||||
</where>
|
||||
|
||||
)
|
||||
) t
|
||||
INNER JOIN pms_distribution_monitor b ON t.id = b.Monitor_Id and b.Status=1
|
||||
LEFT JOIN pms_statation_stat pss on t.Power_Station_Id=pss.Power_Id
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -26,4 +26,11 @@ public interface IPwMonitorService {
|
||||
* @return
|
||||
*/
|
||||
List<PwPmsMonitorDTO> getPwPhotovoltaicMonitorList(PwPmsMonitorParam pwPmsMonitorParam);
|
||||
|
||||
/**
|
||||
* 获取子集配网所有监测点信息
|
||||
* @param pwPmsMonitorParam
|
||||
* @return
|
||||
*/
|
||||
List<PwPmsMonitorDTO> getPwSubsetMonitorList(PwPmsMonitorParam pwPmsMonitorParam);
|
||||
}
|
||||
|
||||
@@ -88,10 +88,10 @@ public class IPwMonitorServiceImpl implements IPwMonitorService {
|
||||
@Override
|
||||
public List<PwPmsMonitorDTO> getPwPhotovoltaicMonitorList(PwPmsMonitorParam pwPmsMonitorParam) {
|
||||
//定义待返回终端信息
|
||||
List<PwPmsMonitorDTO> pwPmsMonitorDTOS = new ArrayList<>();
|
||||
List<Dept> deptInfos = deptFeignClient.getDirectSonSelf(pwPmsMonitorParam.getOrgId()).getData();
|
||||
// 过滤出传入id的子单位id
|
||||
List<String> 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<PwPmsMonitorDTO> getPwSubsetMonitorList(PwPmsMonitorParam pwPmsMonitorParam) {
|
||||
//定义待返回终端信息
|
||||
List<PwPmsMonitorDTO> pwPmsMonitorDTOS = new ArrayList<>();
|
||||
List<DeptDTO> deptInfos = deptFeignClient.getDeptDescendantIndexes(pwPmsMonitorParam.getOrgId(), Stream.of(0, 1).collect(Collectors.toList())).getData();
|
||||
// 过滤出传入id的子单位id
|
||||
List<DeptDTO> directDeptInfos = deptInfos.stream()
|
||||
.filter(deptDTO -> deptDTO.getPid().equals(pwPmsMonitorParam.getOrgId()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (CollectionUtil.isEmpty(directDeptInfos)) {
|
||||
//没有直接子部门,获取当前部门所有信息
|
||||
List<DeptDTO> 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<String> deptCodes = directDeptInfos.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
List<PwPmsMonitorDTO> pwMonitorDataList = pwMonitorMapper.getPwMonitorDataList(deptCodes, pwPmsMonitorParam);
|
||||
pwPmsMonitorDTOS.addAll(pwMonitorDataList);
|
||||
}
|
||||
return pwPmsMonitorDTOS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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<PwRStatAccountCheckDataVO> getPwQualityCheckOfAccountData(StatisticsBizBaseParam param) {
|
||||
// 获取单位的子单位id
|
||||
List<PmsGeneralDeviceDTO> data = getDeptIds(param);
|
||||
if (CollUtil.isEmpty(data)) {
|
||||
// List<PmsGeneralDeviceDTO> data = getDeptIds(param);
|
||||
// if (CollUtil.isEmpty(data)) {
|
||||
// return Collections.emptyList();
|
||||
// }
|
||||
// // 取出单位id
|
||||
// List<String> deptIds = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList());
|
||||
/*获取直接下属子单位*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
// 取出单位id
|
||||
List<String> deptIds = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList());
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
Map<String, DeptDTO> 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<String, PmsGeneralDeviceDTO> dataMap = getDataMap(data);
|
||||
// Map<String, PmsGeneralDeviceDTO> 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<RStatTargetCheckDataVO> getPwMonitoringIndexDataQualityVerification(StatisticsBizBaseParam param) {
|
||||
// 获取单位的子单位id
|
||||
List<PmsGeneralDeviceDTO> data = getDeptIds(param);
|
||||
if (CollUtil.isEmpty(data)) {
|
||||
// List<PmsGeneralDeviceDTO> data = getDeptIds(param);
|
||||
// if (CollUtil.isEmpty(data)) {
|
||||
// return Collections.emptyList();
|
||||
// }
|
||||
// // 取出单位id
|
||||
// List<String> deptIds = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList());
|
||||
/*获取直接下属子单位*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
// 取出单位id
|
||||
List<String> deptIds = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList());
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
Map<String, DeptDTO> 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<String, PmsGeneralDeviceDTO> dataMap = getDataMap(data);
|
||||
// Map<String, PmsGeneralDeviceDTO> 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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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<PwRQualityParameterVO> getPwLedgerDataQualityStat(StatisticsBizBaseParam param) {
|
||||
// 获取单位的子单位信息
|
||||
List<PmsGeneralDeviceDTO> data = getDeptInfo(param);
|
||||
if (CollUtil.isEmpty(data)) {
|
||||
// List<PmsGeneralDeviceDTO> data = getDeptInfo(param);
|
||||
// if (CollUtil.isEmpty(data)) {
|
||||
// return Collections.emptyList();
|
||||
// }
|
||||
/*获取直接下属子单位*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<String> deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
Map<String, DeptDTO> deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO));
|
||||
|
||||
// 获取配网字典id
|
||||
String distributionPoint = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData().getId();
|
||||
// 获取单位id
|
||||
List<String> deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList());
|
||||
// // 获取单位id
|
||||
// List<String> deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList());
|
||||
// 获取配网数据质量-台账数据质量统计
|
||||
List<RQualityParameterPO> pos = rQualityParameterMapper.getLedgerDataQualityStat(param, deptIdList, distributionPoint);
|
||||
if (CollUtil.isEmpty(pos)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
//将单位信息转为map集合 key: 单位id value: 单位实体
|
||||
Map<String, PmsGeneralDeviceDTO> dataMap = getDataMap(data);
|
||||
// Map<String, PmsGeneralDeviceDTO> 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<PwRDnOperatingVO> getPwMonitoringIndexDataQualityStat(StatisticsBizBaseParam param) {
|
||||
// 获取单位的子单位信息
|
||||
List<PmsGeneralDeviceDTO> data = getDeptInfo(param);
|
||||
if (CollUtil.isEmpty(data)) {
|
||||
// List<PmsGeneralDeviceDTO> data = getDeptInfo(param);
|
||||
// if (CollUtil.isEmpty(data)) {
|
||||
// return Collections.emptyList();
|
||||
// }
|
||||
/*获取直接下属子单位*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<String> deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
Map<String, DeptDTO> deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO));
|
||||
|
||||
// 创建集合封装数据
|
||||
List<PwRDnOperatingVO> 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<String, PmsGeneralDeviceDTO> dataMap = getDataMap(data);
|
||||
// Map<String, PmsGeneralDeviceDTO> 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<RQualityParameterPollVO> getPwSummaryStatOfMonitoringIndexDataQualityProblems(StatisticsBizBaseParam param) {
|
||||
// 获取单位的子单位信息
|
||||
List<PmsGeneralDeviceDTO> data = getDeptInfo(param);
|
||||
if (CollUtil.isEmpty(data)) {
|
||||
// List<PmsGeneralDeviceDTO> data = getDeptInfo(param);
|
||||
// if (CollUtil.isEmpty(data)) {
|
||||
// return Collections.emptyList();
|
||||
// }
|
||||
// // 取出单位id
|
||||
// List<String> deptIds = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList());
|
||||
/*获取直接下属子单位*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
// 取出单位id
|
||||
List<String> deptIds = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList());
|
||||
List<String> deptIds = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
Map<String, DeptDTO> 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<String, PmsGeneralDeviceDTO> dataMap = getDataMap(data);
|
||||
// Map<String, PmsGeneralDeviceDTO> 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");
|
||||
|
||||
@@ -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<String> voltageLevelParamList = StringUtils.isNotBlank(rMpMonitorAlarmCountMParam.getVoltageLevel()) ? Arrays.asList(rMpMonitorAlarmCountMParam.getVoltageLevel().split(",")) : null; //电压等级
|
||||
String monitorName = rMpMonitorAlarmCountMParam.getMeasurementPointName(); //监测点名称
|
||||
|
||||
//获取所有子部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
// //获取所有子部门信息
|
||||
// List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
// if (CollUtil.isEmpty(deptDTOList)) {
|
||||
// throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
// }
|
||||
// //将单位信息转为map集合 key: 单位id value: 单位实体
|
||||
// Map<String, DeptDTO> deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO));
|
||||
/*获取下级子部门信息*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
return Collections.emptyList();
|
||||
}
|
||||
//将单位信息转为map集合 key: 单位id value: 单位实体
|
||||
List<String> orgCodeList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
Map<String, DeptDTO> deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO));
|
||||
|
||||
//获取配网id
|
||||
@@ -100,7 +109,8 @@ implements PwRMpMonitorAlarmCountMService {
|
||||
|
||||
//根据监测点idList等条件查询【监测点告警月统计】表数据
|
||||
LambdaQueryWrapper<RMpMonitorAlarmCountM> 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);
|
||||
|
||||
@@ -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<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
// //获取所有子部门信息
|
||||
// List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
// if (CollUtil.isEmpty(deptDTOList)) {
|
||||
// throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
// }
|
||||
// //单位id集合
|
||||
// List<String> orgCodeList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
// //将单位信息转为map集合 key: 单位id value: 单位实体
|
||||
// Map<String, DeptDTO> deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO));
|
||||
/*获取下级子部门信息*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
return Collections.emptyList();
|
||||
}
|
||||
//单位id集合
|
||||
List<String> orgCodeList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
//将单位信息转为map集合 key: 单位id value: 单位实体
|
||||
Map<String, DeptDTO> deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO));
|
||||
|
||||
//获取配网id
|
||||
String dataType = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData().getId();
|
||||
|
||||
|
||||
@@ -51,7 +51,9 @@ public class RDnOperatingIndexMServiceImpl extends ServiceImpl<RDnOperatingIndex
|
||||
String endTime = pwRDnOperatingParam.getEndTime(); //结束时间
|
||||
|
||||
//获取所有子部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
// List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
/*获取下一级子部门信息*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
}
|
||||
|
||||
@@ -44,7 +44,9 @@ public class RDnOperatingYServiceImpl extends ServiceImpl<RDnOperatingYMapper, R
|
||||
String endTime = pwRDnOperatingParam.getEndTime(); //结束时间
|
||||
|
||||
//获取所有子部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
// List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
/*获取下一级子部门信息*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
}
|
||||
|
||||
@@ -74,14 +74,21 @@ public class RStatPwAlarmCountWServiceImpl extends ServiceImpl<RStatPwAlarmCount
|
||||
String startTime = rStatPwAlarmCountWParam.getStartTime(); //开始时间
|
||||
String endTime = rStatPwAlarmCountWParam.getEndTime(); //结束时间
|
||||
|
||||
//获取所有子部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
// //获取所有子部门信息
|
||||
// List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
// if (CollUtil.isEmpty(deptDTOList)) {
|
||||
// throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
// }
|
||||
// //单位code集合
|
||||
// List<String> orgCodeList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
// //将单位信息转为map集合 key: 单位id value: 单位实体
|
||||
// Map<String, String> deptNameMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, DeptDTO::getName));
|
||||
/*获取下级子部门信息*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
return Collections.emptyList();
|
||||
}
|
||||
//单位code集合
|
||||
List<String> orgCodeList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
//将单位信息转为map集合 key: 单位id value: 单位实体
|
||||
Map<String, String> deptNameMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, DeptDTO::getName));
|
||||
|
||||
//设置数据库查询条件
|
||||
|
||||
@@ -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<GeneratrixWire> {
|
||||
* 查询线路列表
|
||||
* @author cdf
|
||||
* @date 2022/10/25
|
||||
* @param baseParam 基础参数
|
||||
* @param pmsBaseParam 基础参数
|
||||
* @return boolean
|
||||
*/
|
||||
List<GeneratrixWire> getGeneratrixWireList();
|
||||
List<GeneratrixWire> getGeneratrixWireList(PmsBaseParam pmsBaseParam);
|
||||
|
||||
/**
|
||||
* 分页查询线路列表
|
||||
|
||||
@@ -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<Generatrix> {
|
||||
* @author cdf
|
||||
* @date 2022/10/25
|
||||
*/
|
||||
List<Generatrix> getGeneratrixList();
|
||||
List<Generatrix> getGeneratrixList(PmsBaseParam pmsBaseParam);
|
||||
|
||||
/**
|
||||
* 查询母线列表
|
||||
|
||||
@@ -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<PowerDistributio
|
||||
*/
|
||||
List<PowerDistributionarea> getPowerDistributionList(PowerDistributionareaParam powerDistributionareaParam);
|
||||
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
* @return
|
||||
|
||||
@@ -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<StatationStat> {
|
||||
* @author cdf
|
||||
* @date 2022/10/25
|
||||
*/
|
||||
List<StatationStat> getStatationStatList();
|
||||
List<StatationStat> getStatationStatList(PmsBaseParam pmsBaseParam);
|
||||
|
||||
/**
|
||||
* 查询电站列表
|
||||
|
||||
@@ -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<PmsTerminal> {
|
||||
|
||||
/**
|
||||
* 查询所有
|
||||
* @param baseParam
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
List<PmsTerminal> getTerminalSelectList();
|
||||
List<PmsTerminal> getTerminalSelectList(PmsBaseParam pmsBaseParam);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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<OverviewVO> getMonitorYoY(OverviewParam param);
|
||||
|
||||
/**
|
||||
* 告警监测点占比
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<OverviewVO.AlarmVO> getAlarmProportion(OverviewParam.OverviewDateParam param);
|
||||
|
||||
|
||||
/**
|
||||
* 监测点分布
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
Map<String, List<DistributionMonitorVO>> getMonitorDistributed(OverviewParam param);
|
||||
|
||||
/**
|
||||
* 告警评级
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<OverviewVO.AreaAlarmCountVO> getAlarmRating(OverviewParam.OverviewDateParam param);
|
||||
|
||||
/**
|
||||
* 工单转换率/处置率
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<?> getWorkOrder(OverviewParam.OverviewDateParam param);
|
||||
}
|
||||
@@ -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<String, List<SpecialAnalysisMonitorVO.SpecialAnalysisRailwayVO>> getDisplayRailway();
|
||||
|
||||
/**
|
||||
* 地图展示数据-按电压展示数据(电气化铁路)
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@@ -44,6 +48,7 @@ public interface SpecialAnalysisService {
|
||||
|
||||
/**
|
||||
* 地图展示数据-按接线类型展示(电气化铁路)
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
|
||||
@@ -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<RStatAccountCheckDataVO> getQualityCheckOfAccountData(StatisticsBizBaseParam param) {
|
||||
// 获取当前用户的部门的子部门信息
|
||||
List<PmsGeneralDeviceDTO> data = getPmsGeneralDeviceDTOList(param);
|
||||
if (CollUtil.isEmpty(data)) {
|
||||
// List<PmsGeneralDeviceDTO> data = getPmsGeneralDeviceDTOList(param);
|
||||
// if (CollUtil.isEmpty(data)) {
|
||||
// return Collections.emptyList();
|
||||
// }
|
||||
// List<String> deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList());
|
||||
/*获取下级子部门信息*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<String> deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList());
|
||||
List<String> deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
Map<String, DeptDTO> deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO));
|
||||
|
||||
// 创建集合封装查询数据
|
||||
List<RStatAccountCheckDataVO> result = new ArrayList<>();
|
||||
// 获取主网字典id
|
||||
@@ -84,9 +95,9 @@ public class DataQualityCheckServiceImpl implements DataQualityCheckService {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
//将单位信息转为map集合 key: 单位id value: 单位实体
|
||||
Map<String, PmsGeneralDeviceDTO> dataMap = getDataMap(data);
|
||||
// Map<String, PmsGeneralDeviceDTO> 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<RStatTargetCheckDataVO> getMonitoringIndexDataQualityVerification(StatisticsBizBaseParam param) {
|
||||
// 获取当前用户的部门的子部门信息
|
||||
List<PmsGeneralDeviceDTO> data = getPmsGeneralDeviceDTOList(param);
|
||||
if (CollUtil.isEmpty(data)) {
|
||||
// List<PmsGeneralDeviceDTO> data = getPmsGeneralDeviceDTOList(param);
|
||||
// if (CollUtil.isEmpty(data)) {
|
||||
// return Collections.emptyList();
|
||||
// }
|
||||
// List<String> deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList());
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<String> deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList());
|
||||
List<String> deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
Map<String, DeptDTO> 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<String, PmsGeneralDeviceDTO> dataMap = getDataMap(data);
|
||||
// Map<String, PmsGeneralDeviceDTO> 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());
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,17 @@ public class DataQualityDetailsServiceImpl implements DataQualityDetailsService
|
||||
@Override
|
||||
public List<RStatMeasurementAccountDetailVO> getQualityProblemsOfMonitoringPointAccountData(DataQualityDetailsParam param) {
|
||||
// 获取单位下的子单位信息
|
||||
List<PmsGeneralDeviceDTO> data = getDeptInfo(param);
|
||||
List<PmsGeneralDeviceDTO> data1 = getDeptInfo(param);
|
||||
/*获取下级子部门信息*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<String> deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
/*过滤单位只留下直接下属单位*/
|
||||
List<PmsGeneralDeviceDTO> 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<RStatTractionStationAccountDetailVO> getTractionPlatformAccountDataQualityProblem(DataQualityDetailsParam param) {
|
||||
// 获取单位下的子单位信息
|
||||
List<PmsGeneralDeviceDTO> data = getDeptInfo(param);
|
||||
List<PmsGeneralDeviceDTO> data1 = getDeptInfo(param);
|
||||
/*获取下级子部门信息*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<String> deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
/*过滤单位只留下直接下属单位*/
|
||||
List<PmsGeneralDeviceDTO> 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<RStatTargetDetailVO> getRStatTargetDetail(DataQualityDetailsParam param) {
|
||||
// 获取单位下的子单位信息
|
||||
List<PmsGeneralDeviceDTO> data = getDeptInfo(param);
|
||||
List<PmsGeneralDeviceDTO> data1 = getDeptInfo(param);
|
||||
/*获取下级子部门信息*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<String> deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
/*过滤单位只留下直接下属单位*/
|
||||
List<PmsGeneralDeviceDTO> data = data1.stream ( ).
|
||||
filter (t -> deptIdList.contains (t.getIndex ( ))).
|
||||
collect (Collectors.toList ( ));
|
||||
if (CollUtil.isEmpty(data)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -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<RQualityParameterVO> getLedgerDataQualityStat(StatisticsBizBaseParam param) {
|
||||
// 获取当前用户的部门的子部门信息
|
||||
List<PmsGeneralDeviceDTO> data = getPmsGeneralDeviceDTOList(param);
|
||||
if (CollUtil.isEmpty(data)) {
|
||||
// // 获取当前用户的部门的子部门信息
|
||||
// List<PmsGeneralDeviceDTO> data = getPmsGeneralDeviceDTOList(param);
|
||||
|
||||
/*获取下级子部门信息*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<String> deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
//将单位信息转为map集合 key: 单位code value: 单位实体
|
||||
Map<String, DeptDTO> deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO));
|
||||
|
||||
|
||||
// 获取主网字典id
|
||||
String mainnetPoint = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData().getId();
|
||||
// 获取主网数据质量-台账数据质量统计
|
||||
List<RQualityParameterPO> 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<String, PmsGeneralDeviceDTO> dataMap = getDataMap(data);
|
||||
// //将单位信息转为map集合 key: 单位id value: 单位实体
|
||||
// Map<String, PmsGeneralDeviceDTO> 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<ROperatingIndexVO> getMonitoringIndexDataQualityStat(StatisticsBizBaseParam param) {
|
||||
// 获取当前用户的部门的子部门信息
|
||||
List<PmsGeneralDeviceDTO> data = getPmsGeneralDeviceDTOList(param);
|
||||
if (CollUtil.isEmpty(data)) {
|
||||
|
||||
|
||||
// // 获取当前用户的部门的子部门信息
|
||||
// List<PmsGeneralDeviceDTO> data = getPmsGeneralDeviceDTOList(param);
|
||||
// // 取出单位id
|
||||
// List<String> deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList());
|
||||
//单位code集合
|
||||
/*获取下级子部门信息*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
// 取出单位id
|
||||
List<String> deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList());
|
||||
List<String> deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
Map<String, DeptDTO> deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO));
|
||||
|
||||
//将单位信息转为map集合 key: 单位id value: 单位实体
|
||||
// Map<String, PmsGeneralDeviceDTO> dataMap = getDataMap(data);
|
||||
//将单位信息转为map集合 key: 单位code value: 单位实体
|
||||
|
||||
// 创建集合封装返回数据
|
||||
List<ROperatingIndexVO> result = new ArrayList<>();
|
||||
// 获取主网数据质量-监测指标数据质量统计
|
||||
@@ -123,12 +147,12 @@ public class DataQualityStatServiceImpl implements DataQualityStatService {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
//将单位信息转为map集合 key: 单位id value: 单位实体
|
||||
Map<String, PmsGeneralDeviceDTO> 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<RQualityParameterPollVO> getSummaryStatOfMonitoringIndexDataQualityProblems(StatisticsBizBaseParam param) {
|
||||
// 获取当前用户的部门的子部门信息
|
||||
List<PmsGeneralDeviceDTO> data = getPmsGeneralDeviceDTOList(param);
|
||||
if (CollUtil.isEmpty(data)) {
|
||||
// List<PmsGeneralDeviceDTO> data = getPmsGeneralDeviceDTOList(param);
|
||||
// if (CollUtil.isEmpty(data)) {
|
||||
// return Collections.emptyList();
|
||||
// }
|
||||
// List<String> deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList());
|
||||
/*获取下级子部门信息*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (param.getId ()).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
List<String> deptIdList = data.stream().map(PmsGeneralDeviceDTO::getIndex).collect(Collectors.toList());
|
||||
List<String> deptIdList = deptDTOList.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
Map<String, DeptDTO> deptDTOMap = deptDTOList.stream().collect(Collectors.toMap(DeptDTO::getCode, deptDTO -> deptDTO));
|
||||
|
||||
// 获取主网字典id
|
||||
String mainnetPoint = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData().getId();
|
||||
// 获取主网数据质量-监测指标数据质量问题汇总统计
|
||||
List<RQualityParameterPO> pos = rQualityParameterMapper.getLedgerDataQualityStat(param, deptIdList, mainnetPoint);
|
||||
// 将单位信息转为map集合 key: 单位id value: 单位实体
|
||||
Map<String, PmsGeneralDeviceDTO> dataMap = getDataMap(data);
|
||||
// // 将单位信息转为map集合 key: 单位id value: 单位实体
|
||||
// Map<String, PmsGeneralDeviceDTO> 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)
|
||||
|
||||
@@ -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<GeneratrixWireMapper, Genera
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GeneratrixWire> getGeneratrixWireList() {
|
||||
public List<GeneratrixWire> getGeneratrixWireList(PmsBaseParam pmsBaseParam) {
|
||||
LambdaQueryWrapper<GeneratrixWire> 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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<MonitorMapper, Monitor> impl
|
||||
|
||||
private final PmsGeneratrixMapper generatrixMapper;
|
||||
|
||||
private final GeneratrixWireMapper generatrixWireMapper;
|
||||
private final SpecialMonitorMapper specialMonitorMapper;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -144,7 +143,13 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
@Override
|
||||
public Page<Monitor> getAllMonitorPageList(BaseParam baseParam) {
|
||||
LambdaQueryWrapper<Monitor> 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<MonitorMapper, Monitor> 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<String> monitorIds) {
|
||||
return this.removeByIds(monitorIds);
|
||||
this.removeByIds(monitorIds);
|
||||
specialMonitorMapper.deleteBatchIds(monitorIds);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -209,6 +234,21 @@ public class MonitorServiceImpl extends ServiceImpl<MonitorMapper, Monitor> impl
|
||||
|
||||
private void checkParam(MonitorParam monitorParam,boolean update){
|
||||
|
||||
//校验同一单位下面不能有同名1类监测点
|
||||
LambdaQueryWrapper<Monitor> 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<MonitorMapper, Monitor> 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());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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<OverviewVO> getMonitorYoY(OverviewParam param) {
|
||||
List<OverviewVO> overviewVOS=new ArrayList<>();
|
||||
|
||||
//获取监测点类别集合(配网1-2-3类监测点)
|
||||
List<DictData> lineData = dicDataFeignClient.getDicDataByTypeCode(
|
||||
DicDataTypeEnum.LINE_SORT.getCode()).getData();
|
||||
|
||||
//获取部门数据
|
||||
List<String> deptListCode = getDeptListCode(param.getId());
|
||||
if(CollectionUtil.isNotEmpty(deptListCode)){
|
||||
|
||||
overviewVOS = overviewMapper.selectYoY(deptListCode, param);
|
||||
Map<String, OverviewVO> voMap = overviewVOS.stream().
|
||||
collect(Collectors.toMap(OverviewVO::getMonitorSort, Function.identity()));
|
||||
|
||||
//不存在监测点赋值初始值
|
||||
List<DictData> 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<OverviewVO.AlarmVO> getAlarmProportion(OverviewParam.OverviewDateParam param) {
|
||||
List<OverviewVO.AlarmVO> alarmVOS=new ArrayList<>();
|
||||
//获取部门数据
|
||||
List<String> deptListCode = getDeptListCode(param.getId());
|
||||
DictData data = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
|
||||
|
||||
//获取监测点类别集合(配网1-2-3类监测点)
|
||||
List<DictData> lineData = dicDataFeignClient.getDicDataByTypeCode(
|
||||
DicDataTypeEnum.LINE_SORT.getCode()).getData();
|
||||
|
||||
if(CollectionUtil.isNotEmpty(deptListCode)){
|
||||
//数据统计(配网监测点)
|
||||
List<DistributionMonitorVO> distributionMonitors = overviewMapper.selectListAll(deptListCode);
|
||||
Map<String, DistributionMonitorVO> distributionMonitorMap =
|
||||
distributionMonitors.stream().collect(Collectors.toMap(DistributionMonitorVO::getMonitorId, Function.identity()));
|
||||
|
||||
//数据 key:监测点类别 value:数量
|
||||
Map<String, Long> map = distributionMonitors.stream().collect(Collectors.groupingBy(dm -> dm.getMonitorSort(), Collectors.counting()));
|
||||
|
||||
//获取数据库数据
|
||||
List<RMpMonitorAlarmCountM> list = rMpMonitorAlarmCountMService.list(new LambdaQueryWrapper<RMpMonitorAlarmCountM>()
|
||||
.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<OverviewVO.MonitorAlarmCountVO> 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<String, List<OverviewVO.MonitorAlarmCountVO>> 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<String, OverviewVO.AlarmVO> voMap = alarmVOS.stream()
|
||||
.collect(Collectors.toMap(OverviewVO.AlarmVO::getMonitorSort, Function.identity()));
|
||||
List<DictData> 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<String, List<DistributionMonitorVO>> getMonitorDistributed(OverviewParam param) {
|
||||
Map<String, List<DistributionMonitorVO>> info =new LinkedHashMap<>();
|
||||
//获取监测点类别集合(配网1-2-3类监测点)
|
||||
List<DictData> lineData = dicDataFeignClient.getDicDataByTypeCode(
|
||||
DicDataTypeEnum.LINE_SORT.getCode()).getData();
|
||||
for (DictData dictData : lineData) {
|
||||
info.put(dictData.getId(),new ArrayList<>());
|
||||
}
|
||||
//获取部门数据
|
||||
List<DeptDTO> subDeptListCode = getSubDeptListCode(param.getId());
|
||||
List<String> deptListCode = subDeptListCode.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
if(CollectionUtil.isNotEmpty(deptListCode)){
|
||||
//获取所有配网监测点信息
|
||||
List<DistributionMonitorVO> distributionMonitors = overviewMapper.selectListAll(deptListCode);
|
||||
info.putAll(distributionMonitors.stream().collect(Collectors.groupingBy(DistributionMonitorVO::getMonitorSort)));
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OverviewVO.AreaAlarmCountVO> getAlarmRating(OverviewParam.OverviewDateParam param) {
|
||||
List<DeptDTO> subDeptListCode = getSubDeptListCode(param.getId());
|
||||
List<String> deptListCode = subDeptListCode.stream().map(DeptDTO::getCode).collect(Collectors.toList());
|
||||
Map<String, DeptDTO> deptMap = subDeptListCode.stream().collect(Collectors.toMap(DeptDTO::getCode, Function.identity()));
|
||||
|
||||
//查询配网信息
|
||||
DictData dictData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
|
||||
|
||||
List<RStatAreaAlarmCountM> list = rStatAreaAlarmCountMService.list(new LambdaQueryWrapper<RStatAreaAlarmCountM>()
|
||||
.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<OverviewVO.AreaAlarmCountVO> 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<OverviewVO.AlarmVO> getWorkOrder(OverviewParam.OverviewDateParam param) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 当前部门通用方法
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
public List<String> 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<DeptDTO> getSubDeptListCode(String deptId){
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(deptId, WebUtil.filterDeptType()).getData();
|
||||
//获取子部门
|
||||
List<DeptDTO> directDeptInfos = deptDTOList.stream()
|
||||
.filter(deptDTO -> deptDTO.getPid().equals(deptId))
|
||||
.collect(Collectors.toList());
|
||||
if (CollectionUtil.isEmpty(directDeptInfos)) {
|
||||
//没有直接子部门,获取当前部门所有信息
|
||||
List<DeptDTO> dept = deptDTOList.stream()
|
||||
.filter(deptDTO -> deptDTO.getId().equals(deptId))
|
||||
.collect(Collectors.toList());
|
||||
return dept;
|
||||
}
|
||||
return directDeptInfos;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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<PmsGeneratrixMapper, G
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Generatrix> getGeneratrixList() {
|
||||
public List<Generatrix> getGeneratrixList(PmsBaseParam pmsBaseParam) {
|
||||
LambdaQueryWrapper<Generatrix> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
if(StrUtil.isNotBlank(pmsBaseParam.getStationId())){
|
||||
lambdaQueryWrapper.eq(Generatrix::getStatationId,pmsBaseParam.getStationId());
|
||||
}
|
||||
lambdaQueryWrapper.orderByAsc(Generatrix::getCreateTime);
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
@@ -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<PowerDistribut
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据id查询
|
||||
* @author hany
|
||||
|
||||
@@ -70,7 +70,9 @@ public class RMpDevEvaluateDetailServiceImpl extends ServiceImpl<RMpDevEvaluateD
|
||||
// pmsDeviceInfoWithInOrg.get(0);
|
||||
|
||||
//获取所有子部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
// List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
/*获取下级子部门信息*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
}
|
||||
|
||||
@@ -59,7 +59,9 @@ public class RMpDevSolveDetailServiceImpl extends ServiceImpl<RMpDevSolveDetailM
|
||||
String endTime = rMpDevAbnormalManageParam.getEndTime(); //结束时间
|
||||
|
||||
//获取所有子部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
// List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
/*获取下一级子部门信息*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
}
|
||||
@@ -302,7 +304,9 @@ public class RMpDevSolveDetailServiceImpl extends ServiceImpl<RMpDevSolveDetailM
|
||||
|
||||
/**根据条件查询终端**/
|
||||
//获取所有子部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
// List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
/*获取下级子部门信息*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
}
|
||||
|
||||
@@ -43,7 +43,9 @@ public class ROperatingIndexMServiceImpl extends ServiceImpl<ROperatingIndexMMap
|
||||
String endTime = rOperatingIndexParam.getEndTime(); //结束时间
|
||||
|
||||
//获取所有子部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
// List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
/*获取下一级子部门信息*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
}
|
||||
|
||||
@@ -42,8 +42,10 @@ public class ROperatingIndexYServiceImpl extends ServiceImpl<ROperatingIndexYMap
|
||||
String startTime = rOperatingIndexParam.getStartTime(); //开始时间
|
||||
String endTime = rOperatingIndexParam.getEndTime(); //结束时间
|
||||
|
||||
//获取所有子部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
// //获取所有子部门信息
|
||||
// List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
/*获取下一级子部门信息*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
}
|
||||
|
||||
@@ -52,7 +52,9 @@ public class RStatDevSignalDServiceImpl extends ServiceImpl<RStatDevSignalDMappe
|
||||
}
|
||||
|
||||
//获取所有子部门信息
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
// List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(id, WebUtil.filterDeptType()).getData();
|
||||
/*获取下一级子部门信息*/
|
||||
List<DeptDTO> deptDTOList = deptFeignClient.getDepSonDetailByDeptId (id).getData ( );
|
||||
if (CollUtil.isEmpty(deptDTOList)) {
|
||||
throw new BusinessException(CommonResponseEnum.NO_DATA, "部门不存在");
|
||||
}
|
||||
|
||||
@@ -64,8 +64,8 @@ public class SpecialAnalysisServiceImpl implements SpecialAnalysisService {
|
||||
}
|
||||
//1.获取原始数据(参数1,部门id。参数2,监测点标签字典id集合)
|
||||
List<SpecialAnalysisMonitorVO.SpecialAnalysisVO> infoList = specialAnalysisMapper.selectList(deptIds, data.getId());
|
||||
//获取部门区域
|
||||
|
||||
//获取部门区域
|
||||
if (CollectionUtil.isNotEmpty(infoList)) {
|
||||
infoList.stream().forEach(info -> {
|
||||
if (voltageLevelMap.containsKey(info.getVoltageLevel())) {
|
||||
@@ -74,7 +74,9 @@ public class SpecialAnalysisServiceImpl implements SpecialAnalysisService {
|
||||
}
|
||||
});
|
||||
Map<String, List<SpecialAnalysisMonitorVO.SpecialAnalysisVO>> listMap =
|
||||
infoList.stream().collect(Collectors.groupingBy(SpecialAnalysisMonitorVO.SpecialAnalysisVO::getOrgName));
|
||||
infoList.stream().collect(Collectors.groupingBy(r->
|
||||
r.getOrgName().replace("供电公司","市")
|
||||
));
|
||||
vo.setSpecialAnalysisVOList(listMap);
|
||||
|
||||
//2.根据电压等级分组显示数据
|
||||
|
||||
@@ -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<StatationStatMapper, S
|
||||
|
||||
private final StatationStatMapper statationStatMapper;
|
||||
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
/**
|
||||
* 获取指定的变电站信息
|
||||
*
|
||||
@@ -72,7 +77,6 @@ public class StatationStatServiceImpl extends ServiceImpl<StatationStatMapper, S
|
||||
|
||||
@Override
|
||||
public boolean updateStatationStat(StatationStatParam statationStatParam) {
|
||||
|
||||
//校验同一单位下不能出现同名电站
|
||||
LambdaQueryWrapper<StatationStat> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(StatationStat::getOrgId,statationStatParam.getOrgId())
|
||||
@@ -99,9 +103,14 @@ public class StatationStatServiceImpl extends ServiceImpl<StatationStatMapper, S
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StatationStat> getStatationStatList() {
|
||||
public List<StatationStat> getStatationStatList(PmsBaseParam pmsBaseParam) {
|
||||
LambdaQueryWrapper<StatationStat> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.orderByDesc(StatationStat::getCreateTime);
|
||||
if(StrUtil.isNotBlank(pmsBaseParam.getDeptId())){
|
||||
List<String> deptCodes = deptFeignClient.getDepSonSelfCodetByDeptId(pmsBaseParam.getDeptId()).getData();
|
||||
lambdaQueryWrapper.in(StatationStat::getOrgId,deptCodes);
|
||||
}
|
||||
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
|
||||
@@ -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<TerminalMapper, PmsTerminal
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PmsTerminal> getTerminalSelectList() {
|
||||
public List<PmsTerminal> getTerminalSelectList(PmsBaseParam pmsBaseParam) {
|
||||
LambdaQueryWrapper<PmsTerminal> 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<String> deptCodes = deptFeignClient.getDepSonSelfCodetByDeptId(pmsBaseParam.getDeptId()).getData();
|
||||
lambdaQueryWrapper.in(PmsTerminal::getOrgId,deptCodes);
|
||||
}
|
||||
return this.list(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user