1.优化暂降报告
This commit is contained in:
@@ -935,12 +935,12 @@ public class EventReportServiceImpl implements EventReportService {
|
|||||||
//添加detail
|
//添加detail
|
||||||
for (EventDetail detail : info) {
|
for (EventDetail detail : info) {
|
||||||
for (DictData data : reasonData) {
|
for (DictData data : reasonData) {
|
||||||
if (detail.getAdvanceReason().equals(data.getId())) {
|
if (data.getId().equals(detail.getAdvanceReason())) {
|
||||||
detail.setAdvanceReason(data.getName());
|
detail.setAdvanceReason(data.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (DictData data : typeData) {
|
for (DictData data : typeData) {
|
||||||
if (detail.getAdvanceType().equals(data.getId())) {
|
if (data.getId().equals(detail.getAdvanceType())) {
|
||||||
detail.setAdvanceType(data.getName());
|
detail.setAdvanceType(data.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -961,13 +961,13 @@ public class EventReportServiceImpl implements EventReportService {
|
|||||||
for (EventDetail detail : info) {
|
for (EventDetail detail : info) {
|
||||||
for (DictData data : reasonData) {
|
for (DictData data : reasonData) {
|
||||||
reasonMap.put(data.getName(), 0);
|
reasonMap.put(data.getName(), 0);
|
||||||
if (detail.getAdvanceReason().equals(data.getId())) {
|
if (data.getId().equals(detail.getAdvanceReason())) {
|
||||||
detail.setAdvanceReason(data.getName());
|
detail.setAdvanceReason(data.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (DictData data : typeData) {
|
for (DictData data : typeData) {
|
||||||
typeMap.put(data.getName(), 0);
|
typeMap.put(data.getName(), 0);
|
||||||
if (detail.getAdvanceType().equals(data.getId())) {
|
if (data.getId().equals(detail.getAdvanceType())) {
|
||||||
detail.setAdvanceType(data.getName());
|
detail.setAdvanceType(data.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -500,6 +500,7 @@ public class ReportServiceImpl implements ReportService {
|
|||||||
return page;
|
return page;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<PmsMonitorDTO> getMonitorList(String orgID) {
|
private List<PmsMonitorDTO> getMonitorList(String orgID) {
|
||||||
//获取所有子部门信息
|
//获取所有子部门信息
|
||||||
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(orgID, WebUtil.filterDeptType()).getData();
|
List<DeptDTO> deptDTOList = deptFeignClient.getDeptDescendantIndexes(orgID, WebUtil.filterDeptType()).getData();
|
||||||
@@ -514,6 +515,7 @@ public class ReportServiceImpl implements ReportService {
|
|||||||
List<PmsMonitorDTO> monitorList = monitorClient.getMonitorInfoListByCond(pmsMonitorParam).getData(); //监测点信息
|
List<PmsMonitorDTO> monitorList = monitorClient.getMonitorInfoListByCond(pmsMonitorParam).getData(); //监测点信息
|
||||||
return monitorList;
|
return monitorList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 暂降次数统计
|
* 暂降次数统计
|
||||||
*
|
*
|
||||||
@@ -651,6 +653,7 @@ public class ReportServiceImpl implements ReportService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成暂态报告xlsx
|
* 生成暂态报告xlsx
|
||||||
|
*
|
||||||
* @param businessParam
|
* @param businessParam
|
||||||
* @return
|
* @return
|
||||||
* @throws TemplateException
|
* @throws TemplateException
|
||||||
@@ -2080,31 +2083,21 @@ public class ReportServiceImpl implements ReportService {
|
|||||||
List<DictData> eventTypeList = type.getData();
|
List<DictData> eventTypeList = type.getData();
|
||||||
|
|
||||||
for (WaveTypeVO waveTypeVO : eventDetailList) {
|
for (WaveTypeVO waveTypeVO : eventDetailList) {
|
||||||
if (waveTypeVO.getAdvanceReason() != null) {
|
|
||||||
for (DictData dictData : eventReasonList) {
|
for (DictData dictData : eventReasonList) {
|
||||||
//将字典数据id与VO中属性eventReason对应的字符串进行比较
|
//将字典数据id与VO中属性eventReason对应的字符串进行比较
|
||||||
if (waveTypeVO.getAdvanceReason().equals(dictData.getId())) {
|
if (dictData.getId().equals(waveTypeVO.getAdvanceReason())) {
|
||||||
waveTypeVO.setAdvanceReason(dictData.getName());
|
waveTypeVO.setAdvanceReason(dictData.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
//抛出异常,当前暂态原因为空
|
|
||||||
throw new BusinessException(EventResponseEnum.EVENT_REASON_NOT_FOUND);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (WaveTypeVO waveTypeVO : eventDetailList) {
|
for (WaveTypeVO waveTypeVO : eventDetailList) {
|
||||||
if (waveTypeVO.getAdvanceType() != null) {
|
|
||||||
for (DictData dictData : eventTypeList) {
|
for (DictData dictData : eventTypeList) {
|
||||||
//将字典数据id与VO中属性eventType对应的字符串进行比较
|
//将字典数据id与VO中属性eventType对应的字符串进行比较
|
||||||
if (waveTypeVO.getAdvanceType().equals(dictData.getId())) {
|
if (dictData.getId().equals(waveTypeVO.getAdvanceType())) {
|
||||||
waveTypeVO.setAdvanceType(dictData.getName());
|
waveTypeVO.setAdvanceType(dictData.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
//抛出异常,当前暂态类型为空
|
|
||||||
throw new BusinessException(EventResponseEnum.EVENT_TYPE_NOT_FOUND);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
page = BeanUtil.copyProperties(pageInfo, Page.class);
|
page = BeanUtil.copyProperties(pageInfo, Page.class);
|
||||||
@@ -4739,7 +4732,9 @@ public class ReportServiceImpl implements ReportService {
|
|||||||
Map<String, Integer> resultMap = new HashMap<>();
|
Map<String, Integer> resultMap = new HashMap<>();
|
||||||
|
|
||||||
//优化数据(根据暂降原因,进行分组统计有多少条数据,key:暂降原因id,value:次数)
|
//优化数据(根据暂降原因,进行分组统计有多少条数据,key:暂降原因id,value:次数)
|
||||||
Map<String, Long> reasonMapCount = eventDetailList.stream().collect(Collectors.groupingBy(EventDetailNew::getAdvanceReason, Collectors.counting()));
|
Map<String, Long> reasonMapCount = eventDetailList.stream()
|
||||||
|
.filter(x -> StrUtil.isNotBlank(x.getAdvanceReason()))
|
||||||
|
.collect(Collectors.groupingBy(EventDetailNew::getAdvanceReason, Collectors.counting()));
|
||||||
//将数据重新整合为(key:暂降原因的名称,value:暂降原因测次数)
|
//将数据重新整合为(key:暂降原因的名称,value:暂降原因测次数)
|
||||||
reasonMap.forEach((key, value) -> {
|
reasonMap.forEach((key, value) -> {
|
||||||
if (reasonMapCount.containsKey(key)) {
|
if (reasonMapCount.containsKey(key)) {
|
||||||
@@ -7468,8 +7463,6 @@ public class ReportServiceImpl implements ReportService {
|
|||||||
AreaTableParam areaTableParam = new AreaTableParam();
|
AreaTableParam areaTableParam = new AreaTableParam();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//创建结果集合
|
//创建结果集合
|
||||||
List<EventDetailNew> info = eventDetailList;
|
List<EventDetailNew> info = eventDetailList;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.njcn.system.controller;
|
package com.njcn.system.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.constant.OperateType;
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
@@ -22,6 +23,7 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@@ -165,10 +167,13 @@ public class EventTemplateController extends BaseController{
|
|||||||
@PostMapping("/selectReleation")
|
@PostMapping("/selectReleation")
|
||||||
@ApiOperation("根据模板id查询关系")
|
@ApiOperation("根据模板id查询关系")
|
||||||
@ApiImplicitParam(name = "id", value = "角色索引", required = true)
|
@ApiImplicitParam(name = "id", value = "角色索引", required = true)
|
||||||
public HttpResult<List<EventReportDictVO>> selectRelation(@RequestParam @Validated String id) {
|
public HttpResult<List<EventReportDictVO>> selectRelation(@RequestParam(required = false,name = "id") String id) {
|
||||||
String methodDescribe = getMethodDescribe("selectRelation");
|
String methodDescribe = getMethodDescribe("selectRelation");
|
||||||
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, id);
|
LogUtil.njcnDebug(log, "{},查询数据为:{}", methodDescribe, id);
|
||||||
List<EventReportDictVO> res = iEventTemplateService.selectRelation(id);
|
List<EventReportDictVO> res = new ArrayList<>();
|
||||||
|
if (StrUtil.isNotBlank(id)) {
|
||||||
|
res.addAll(iEventTemplateService.selectRelation(id)) ;
|
||||||
|
}
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, res, methodDescribe);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user