代码合并终
This commit is contained in:
@@ -55,13 +55,4 @@ public class PwOverviewController extends BaseController {
|
||||
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);
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -43,9 +43,9 @@ public class OverviewController extends BaseController {
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("监测点统计")
|
||||
@ApiImplicitParam(name = "param", value = "条件参数", required = true)
|
||||
public HttpResult<List<OverviewVO>> getMapDisplay(@RequestBody OverviewParam param) {
|
||||
public HttpResult<OverviewVO> getMapDisplay(@RequestBody OverviewParam param) {
|
||||
String methodDescribe = getMethodDescribe("getMapDisplay");
|
||||
List<OverviewVO> monitorYoY = overviewService.getMonitorYoY(param);
|
||||
OverviewVO monitorYoY = overviewService.getMonitorYoY(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, monitorYoY, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,11 +21,24 @@ public interface OverviewMapper {
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<OverviewVO> selectYoY(@Param("orgIds") List<String> orgId,@Param("param") OverviewParam param);
|
||||
List<OverviewVO.MonitorObject> selectYoY(@Param("orgIds") List<String> orgId,@Param("param") OverviewParam param);
|
||||
|
||||
/**
|
||||
* 查询配网所有信息
|
||||
* @param orgId
|
||||
* @return
|
||||
*/
|
||||
List<DistributionMonitorVO> selectListAll(@Param("orgIds") List<String> orgId);
|
||||
|
||||
/**
|
||||
* 分布式光伏查询监测点用户和容量
|
||||
* @param orgId
|
||||
* @param levelOne 低电压字典
|
||||
* @param levelTwo 中电压字典
|
||||
* @return
|
||||
*/
|
||||
List<OverviewVO.PhotoVoltaicVoltage> selectPhotovoltaicUser(@Param("orgIds") List<String> orgId,
|
||||
@Param("levelOne") List<String> levelOne,
|
||||
@Param("levelTwo") List<String> levelTwo);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!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 id="selectYoY" resultType="com.njcn.device.pms.pojo.vo.OverviewVO$MonitorObject">
|
||||
|
||||
SELECT
|
||||
ta.Monitor_Sort as monitorSort,
|
||||
@@ -275,4 +275,47 @@
|
||||
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>
|
||||
<select id="selectPhotovoltaicUser" resultType="com.njcn.device.pms.pojo.vo.OverviewVO$PhotoVoltaicVoltage">
|
||||
(select
|
||||
1 AS type,
|
||||
count(*) AS num,
|
||||
IFNULL( sum( installed_capacity ), 0 ) AS Capacity
|
||||
from
|
||||
f_cons_power
|
||||
<where>
|
||||
section IN
|
||||
<foreach collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
and voltage_level IN
|
||||
<foreach collection="levelOne" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</where>
|
||||
)
|
||||
UNION ALL
|
||||
(
|
||||
select
|
||||
2 AS type,
|
||||
count(*) AS num,
|
||||
IFNULL( sum( installed_capacity ), 0 ) AS Capacity
|
||||
from
|
||||
f_cons_power
|
||||
<where>
|
||||
section IN
|
||||
<foreach
|
||||
collection="orgIds" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
and voltage_level IN
|
||||
<foreach collection="levelTwo" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
|
||||
</where>
|
||||
)
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -51,7 +51,7 @@
|
||||
|
||||
FROM
|
||||
pms_generatrix_wire AS pg
|
||||
LEFT JOIN pms_statation_stat AS pss ON pg.station_id = pss.Power_Id
|
||||
LEFT JOIN pms_statation_stat AS pss ON pg.station = pss.Power_Id
|
||||
WHERE
|
||||
pg.`Status` = 1
|
||||
AND pss.`Status` = 1
|
||||
|
||||
@@ -22,7 +22,7 @@ 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.web.utils.WebUtil;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
@@ -20,7 +20,7 @@ public interface OverviewService {
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<OverviewVO> getMonitorYoY(OverviewParam param);
|
||||
OverviewVO getMonitorYoY(OverviewParam param);
|
||||
|
||||
/**
|
||||
* 告警监测点占比
|
||||
@@ -44,10 +44,4 @@ public interface OverviewService {
|
||||
*/
|
||||
List<OverviewVO.AreaAlarmCountVO> getAlarmRating(OverviewParam.OverviewDateParam param);
|
||||
|
||||
/**
|
||||
* 工单转换率/处置率
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<?> getWorkOrder(OverviewParam.OverviewDateParam param);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ 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 io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -46,11 +47,11 @@ public class OverviewServiceImpl implements OverviewService {
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private final RMpMonitorAlarmCountMService rMpMonitorAlarmCountMService;
|
||||
private final RStatAreaAlarmCountMService rStatAreaAlarmCountMService;
|
||||
private static final String XIONG_AN_CITY="雄安新区";
|
||||
|
||||
@Override
|
||||
public List<OverviewVO> getMonitorYoY(OverviewParam param) {
|
||||
List<OverviewVO> overviewVOS=new ArrayList<>();
|
||||
|
||||
public OverviewVO getMonitorYoY(OverviewParam param) {
|
||||
OverviewVO vos=new OverviewVO();
|
||||
//获取监测点类别集合(配网1-2-3类监测点)
|
||||
List<DictData> lineData = dicDataFeignClient.getDicDataByTypeCode(
|
||||
DicDataTypeEnum.LINE_SORT.getCode()).getData();
|
||||
@@ -59,17 +60,17 @@ public class OverviewServiceImpl implements OverviewService {
|
||||
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<OverviewVO.MonitorObject> overviewVOS = overviewMapper.selectYoY(deptListCode, param);
|
||||
Map<String, OverviewVO.MonitorObject> voMap = overviewVOS.stream().
|
||||
collect(Collectors.toMap(OverviewVO.MonitorObject::getMonitorSort, Function.identity()));
|
||||
|
||||
//不存在监测点赋值初始值
|
||||
List<DictData> notMeasurementList = lineData.stream().filter(r -> !voMap.containsKey(r.getId()))
|
||||
.collect(Collectors.toList());
|
||||
if(CollectionUtil.isNotEmpty(notMeasurementList)){
|
||||
OverviewVO overviewVO;
|
||||
OverviewVO.MonitorObject overviewVO;
|
||||
for (DictData notData : notMeasurementList) {
|
||||
overviewVO=new OverviewVO();
|
||||
overviewVO=new OverviewVO.MonitorObject();
|
||||
overviewVO.setMonitorSort(notData.getId());
|
||||
overviewVO.setSumNum("0");
|
||||
overviewVO.setYtbSumNum("0");
|
||||
@@ -79,9 +80,45 @@ public class OverviewServiceImpl implements OverviewService {
|
||||
overviewVOS.add(overviewVO);
|
||||
}
|
||||
}
|
||||
//获取电压字典
|
||||
List<DictData> voltageData = dicDataFeignClient.getDicDataByTypeCode(
|
||||
DicDataTypeEnum.DEV_VOLTAGE.getCode()).getData();
|
||||
//低压字典
|
||||
List<String> lowPressure=new ArrayList<>();
|
||||
//中压字典
|
||||
List<String> inPressure=new ArrayList<>();
|
||||
for (DictData voltageDatum : voltageData) {
|
||||
if(DicDataEnum.AC_380V.getCode().equals( voltageDatum.getCode())&&"0.38".equals(voltageDatum.getValue())){
|
||||
lowPressure.add(voltageDatum.getId());
|
||||
}
|
||||
if(DicDataEnum.DY_380V.getCode().equals( voltageDatum.getCode())&&"0.38".equals(voltageDatum.getValue())){
|
||||
lowPressure.add(voltageDatum.getId());
|
||||
}
|
||||
if(DicDataEnum.DY_10KV.getCode().equals( voltageDatum.getCode())){
|
||||
inPressure.add(voltageDatum.getId());
|
||||
}
|
||||
}
|
||||
//查询分布式光伏概览用户数量和装机容量
|
||||
List<OverviewVO.PhotoVoltaicVoltage> voltageList = overviewMapper.selectPhotovoltaicUser(deptListCode, lowPressure, inPressure);
|
||||
//光伏用户
|
||||
OverviewVO.PhotovoltaicUser photovoltaicUser=new OverviewVO.PhotovoltaicUser();
|
||||
//装机容量
|
||||
OverviewVO.PhotovoltaicCapacity photovoltaicCapacity=new OverviewVO.PhotovoltaicCapacity();
|
||||
for (OverviewVO.PhotoVoltaicVoltage value : voltageList) {
|
||||
if("1".equals(value.getType())){
|
||||
photovoltaicUser.setLowPressure(value.getNum());
|
||||
photovoltaicCapacity.setLowCapacity(value.getCapacity());
|
||||
}else{
|
||||
photovoltaicUser.setHighPressure(value.getNum());
|
||||
photovoltaicCapacity.setHighCapacity(value.getCapacity());
|
||||
}
|
||||
|
||||
}
|
||||
vos.setMonitorObjects(overviewVOS);
|
||||
vos.setPhotovoltaicUser(photovoltaicUser);
|
||||
vos.setPhotovoltaicCapacity(photovoltaicCapacity);
|
||||
}
|
||||
return overviewVOS;
|
||||
return vos;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -220,7 +257,13 @@ public class OverviewServiceImpl implements OverviewService {
|
||||
if(deptMap.containsKey(alarmCountMVO.getOrgNo())){
|
||||
alarmCountVO=new OverviewVO.AreaAlarmCountVO();
|
||||
String name = deptMap.get(alarmCountMVO.getOrgNo()).getName();
|
||||
alarmCountVO.setOrgName(name.replace("供电公司","市"));
|
||||
|
||||
String replace = name.replace("供电公司","");
|
||||
if(XIONG_AN_CITY.equals(replace)){
|
||||
alarmCountVO.setOrgName(XIONG_AN_CITY);
|
||||
}else{
|
||||
alarmCountVO.setOrgName(replace+"市");
|
||||
}
|
||||
alarmCountVO.setEventTypeGrade(alarmCountMVO.getEventTypeGrade());
|
||||
alarmCountVO.setHarmonicTypeGrade(alarmCountMVO.getHarmonicTypeGrade());
|
||||
alarmCountMVOS.add(alarmCountVO);
|
||||
@@ -230,12 +273,6 @@ public class OverviewServiceImpl implements OverviewService {
|
||||
return alarmCountMVOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OverviewVO.AlarmVO> getWorkOrder(OverviewParam.OverviewDateParam param) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 当前部门通用方法
|
||||
|
||||
@@ -32,6 +32,7 @@ public class SpecialAnalysisServiceImpl implements SpecialAnalysisService {
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
private final SpecialAnalysisMapper specialAnalysisMapper;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
private static final String XIONG_AN_CITY="雄安新区";
|
||||
|
||||
@Override
|
||||
public SpecialAnalysisMonitorVO getMonitorList(SpecialAnalysisParam param) {
|
||||
@@ -72,11 +73,19 @@ public class SpecialAnalysisServiceImpl implements SpecialAnalysisService {
|
||||
String name = voltageLevelMap.get(info.getVoltageLevel());
|
||||
info.setVoltageLevel(name);
|
||||
}
|
||||
String replace = info.getOrgName().replace("供电公司本部","");
|
||||
if(XIONG_AN_CITY.equals(replace)){
|
||||
info.setOrgName(XIONG_AN_CITY);
|
||||
}else{
|
||||
info.setOrgName(replace+"市");
|
||||
}
|
||||
|
||||
});
|
||||
Map<String, List<SpecialAnalysisMonitorVO.SpecialAnalysisVO>> listMap =
|
||||
infoList.stream().collect(Collectors.groupingBy(r->
|
||||
r.getOrgName().replace("供电公司","市")
|
||||
r.getOrgName()
|
||||
));
|
||||
|
||||
vo.setSpecialAnalysisVOList(listMap);
|
||||
|
||||
//2.根据电压等级分组显示数据
|
||||
|
||||
Reference in New Issue
Block a user