1.冀北分布式光伏代码提交
2.审计日志管理代码提交修改 3.暂降推送日志,筛选添加
This commit is contained in:
@@ -8,6 +8,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.event.pojo.param.EventTypeParam;
|
||||
import com.njcn.event.pojo.param.REventMParam;
|
||||
import com.njcn.event.pojo.vo.RArrayVO;
|
||||
import com.njcn.event.pojo.vo.RStatEventMVO;
|
||||
@@ -18,9 +19,7 @@ import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -101,6 +100,13 @@ public class RStatEventOrgController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, getAllRStatEventOrgIcon, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getEventOrg")
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@ApiOperation("查询当前部门暂态指标信息")
|
||||
public HttpResult<List<RArrayVO>> getEventOrg(@RequestBody EventTypeParam param) {
|
||||
String methodDescribe = getMethodDescribe("getEventOrg");
|
||||
List<RArrayVO> list = rStatEventOrgMService.getEventOrg(param);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.event.mapper.majornetwork.RStatEventOrgMMapper;
|
||||
import com.njcn.event.pojo.param.EventTypeParam;
|
||||
import com.njcn.event.pojo.param.REventMParam;
|
||||
import com.njcn.event.pojo.po.RStatEventOrgM;
|
||||
import com.njcn.event.pojo.vo.RArrayVO;
|
||||
@@ -21,6 +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.user.pojo.po.Dept;
|
||||
import com.njcn.web.utils.WebUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -362,6 +364,66 @@ public class RStatEventOrgMServiceImpl extends ServiceImpl<RStatEventOrgMMapper,
|
||||
return arrayVOList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RArrayVO> getEventOrg(EventTypeParam param) {
|
||||
List<RArrayVO> info=new ArrayList<>();
|
||||
//获取当前部门信息
|
||||
Dept dept = deptFeignClient.getDeptById(param.getId()).getData();
|
||||
|
||||
List<DictData> eventTypeData = dicDataFeignClient.getDicDataByTypeCode(
|
||||
DicDataTypeEnum.EVENT_STATIS.getCode()).getData();
|
||||
Map<String, DictData> eventTypeMap = eventTypeData.stream()
|
||||
.collect(Collectors.toMap(DictData::getId, Function.identity()));
|
||||
|
||||
DictData distributionData=new DictData();
|
||||
//获取配网信息
|
||||
if(param.getPointType()==0){
|
||||
distributionData = dicDataFeignClient.getDicDataByCode(DicDataEnum.MAINNET_POINT.getCode()).getData();
|
||||
}else{
|
||||
distributionData = dicDataFeignClient.getDicDataByCode(DicDataEnum.DISTRIBUTION_POINT.getCode()).getData();
|
||||
}
|
||||
|
||||
List<RStatEventOrgM> rStatEventOrgMS = statEventOrgMMapper.selectList(new LambdaQueryWrapper<RStatEventOrgM>()
|
||||
.eq(RStatEventOrgM::getDataType, distributionData.getId())
|
||||
.in(RStatEventOrgM::getOrgNo, dept.getCode())
|
||||
.ge(StrUtil.isNotBlank(param.getStartTime()), RStatEventOrgM::getDataDate, param.getStartTime())
|
||||
.le(StrUtil.isNotBlank(param.getEndTime()), RStatEventOrgM::getDataDate, param.getEndTime())
|
||||
);
|
||||
Map<String, RStatEventOrgM> eventOrgMMap = rStatEventOrgMS.stream().collect(Collectors.toMap(RStatEventOrgM::getEventType, Function.identity(), (Key1, kye2) -> Key1));
|
||||
eventOrgMMap.forEach((key, value) -> {
|
||||
if (eventTypeMap.containsKey(key)) {
|
||||
RArrayVO arrayVO = new RArrayVO();
|
||||
DictData data = eventTypeMap.get(key);
|
||||
arrayVO.setRowName(data.getName());
|
||||
arrayVO.setSort(data.getSort());
|
||||
List<Object> a=new ArrayList<>();
|
||||
//累计超标占比
|
||||
a.add(value.getEventMeasurementRatioAccrued());
|
||||
a.add(100-value.getEventMeasurementRatioAccrued());
|
||||
a.add(value.getEventMeasurementAccrued());
|
||||
arrayVO.setColumns(a);
|
||||
info.add(arrayVO);
|
||||
}
|
||||
});
|
||||
|
||||
List<DictData> notEventOrg = eventTypeData.stream().filter(r -> !eventOrgMMap.containsKey(r.getId()))
|
||||
.collect(Collectors.toList());
|
||||
for (DictData dictData : notEventOrg) {
|
||||
RArrayVO arrayVO = new RArrayVO();
|
||||
arrayVO.setRowName(dictData.getName());
|
||||
arrayVO.setSort(dictData.getSort());
|
||||
List<Object> a=new ArrayList<>();
|
||||
//累计超标占比
|
||||
a.add(0);
|
||||
a.add(100);
|
||||
a.add(0);
|
||||
arrayVO.setColumns(a);
|
||||
info.add(arrayVO);
|
||||
}
|
||||
info.sort(Comparator.comparing(rStatEventMVO -> rStatEventMVO.getSort()));
|
||||
return info;
|
||||
}
|
||||
|
||||
/**
|
||||
* 便利赋值
|
||||
*
|
||||
|
||||
@@ -442,20 +442,24 @@ public class ReportServiceImpl implements ReportService {
|
||||
@Override
|
||||
public Page<DetailVO> getContinueTime(WaveTypeParam waveTypeParam) {
|
||||
List<String> lineIds =new ArrayList<>();
|
||||
String eventType="";
|
||||
List<DetailVO> result = new ArrayList<>();
|
||||
if(waveTypeParam.getType()==0){
|
||||
//pq系统
|
||||
List<GeneralDeviceDTO> deviceDTOList = generalDeviceInfoClient.getPracticalAllDeviceInfo(waveTypeParam).getData();
|
||||
lineIds =deviceDTOList.stream().flatMap(list -> list.getLineIndexes().stream()).collect(Collectors.toList());
|
||||
}else{
|
||||
}else if(waveTypeParam.getType()==1){
|
||||
//pms系统
|
||||
PmsDeviceInfoParam param=new PmsDeviceInfoParam();
|
||||
param.setDeptIndex(waveTypeParam.getDeptIndex());
|
||||
param.setStatisticalType(waveTypeParam.getStatisticalType());
|
||||
List<PmsGeneralDeviceDTO> data = pmsGeneralDeviceInfoClient.getPmsDeviceInfoWithInOrg(param).getData();
|
||||
lineIds =data.stream().flatMap(list -> list.getMonitorIdList().stream()).collect(Collectors.toList());
|
||||
eventType=dicDataFeignClient.getDicDataByCode(DicDataEnum.VOLTAGE_DIP.getCode()).getData().getId();
|
||||
}else{
|
||||
PmsDeviceInfoParam param=new PmsDeviceInfoParam();
|
||||
param.setDeptIndex(waveTypeParam.getDeptIndex());
|
||||
param.setStatisticalType(waveTypeParam.getStatisticalType());
|
||||
List<PmsGeneralDeviceDTO> data = pmsGeneralDeviceInfoClient.getPwPmsDeviceInfoWithOrgId(param).getData();
|
||||
lineIds =data.stream().flatMap(list -> list.getMonitorIdList().stream()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
if (CollectionUtil.isEmpty(lineIds)) {
|
||||
@@ -463,9 +467,10 @@ public class ReportServiceImpl implements ReportService {
|
||||
}
|
||||
Page<RmpEventDetailPO> pageInfo = eventDetailService.page(new Page<>(waveTypeParam.getPageNum(), waveTypeParam.getPageSize()), new LambdaQueryWrapper<RmpEventDetailPO>()
|
||||
.in(RmpEventDetailPO::getMeasurementPointId, lineIds)
|
||||
.eq(StrUtil.isNotBlank(eventType),RmpEventDetailPO::getEventType,eventType)
|
||||
.eq(StrUtil.isNotBlank(waveTypeParam.getStatisticalType().getId()),RmpEventDetailPO::getEventType,waveTypeParam.getStatisticalType().getId())
|
||||
.ge(StringUtils.isNotBlank(waveTypeParam.getSearchBeginTime()), RmpEventDetailPO::getStartTime,DateUtil.beginOfDay(DateUtil.parse(waveTypeParam.getSearchBeginTime())))
|
||||
.le(StringUtils.isNotBlank(waveTypeParam.getSearchEndTime()), RmpEventDetailPO::getStartTime, DateUtil.endOfDay(DateUtil.parse(waveTypeParam.getSearchEndTime())))
|
||||
.orderByDesc(RmpEventDetailPO::getStartTime)
|
||||
);
|
||||
List<EventDetailNew> info =BeanUtil.copyToList(pageInfo.getRecords(),EventDetailNew.class);
|
||||
if (CollectionUtil.isNotEmpty(info)) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.event.service.majornetwork;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.common.pojo.param.StatisticsBizBaseParam;
|
||||
import com.njcn.event.pojo.param.EventTypeParam;
|
||||
import com.njcn.event.pojo.param.REventMParam;
|
||||
import com.njcn.event.pojo.po.RStatEventOrgM;
|
||||
import com.njcn.event.pojo.vo.RArrayVO;
|
||||
@@ -50,4 +51,11 @@ public interface RStatEventOrgMService extends IService<RStatEventOrgM> {
|
||||
* @return
|
||||
*/
|
||||
List<RStatEventMVO> getPwRStatHarmonicOrgMIcon(REventMParam param);
|
||||
|
||||
/**
|
||||
* 根据当前单位查询当前信息
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
List<RArrayVO> getEventOrg(EventTypeParam param);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user