fix(service): 修复电压等级获取和服务调用中的空指针异常
- 在CsEventUserPOServiceImpl中添加空值检查避免map.get返回null时的异常 - 移除CsGroupController中多余的空行 - 在CsGroupServiceImpl中引入PqGovernPlanFeignClient并重构敏感用户趋势数据查询逻辑 - 修改系统服务中EPD PQD树形结构构建的名称设置逻辑 - 更新PqGovernPlan服务接口增加治理类型参数支持 - 优化LineTargetServiceImpl中目标标签解析逻辑 - 在PqGovernPlanFeignClient中添加根据ID查询治理方案的接口方法 - 为PqGovernPlanClientFallbackFactory添加getById方法的降级处理 - 修复PqSensitiveUserServiceImpl中用户设备树构建的数据获取逻辑 - 重构RStatLimitRateDServiceImpl中限值统计结果分页和数据显示逻辑
This commit is contained in:
@@ -179,9 +179,5 @@ public class CsGroupController extends BaseController {
|
|||||||
Map<String,List<ThdDataVO>> result = csGroupService.sensitiveUserTrendData(param);
|
Map<String,List<ThdDataVO>> result = csGroupService.sensitiveUserTrendData(param);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,8 +39,10 @@ import com.njcn.csdevice.service.ICsLedgerService;
|
|||||||
import com.njcn.csdevice.util.InfluxDbParamUtil;
|
import com.njcn.csdevice.util.InfluxDbParamUtil;
|
||||||
import com.njcn.csdevice.utils.DataChangeUtil;
|
import com.njcn.csdevice.utils.DataChangeUtil;
|
||||||
import com.njcn.csharmonic.api.EventFeignClient;
|
import com.njcn.csharmonic.api.EventFeignClient;
|
||||||
|
import com.njcn.csharmonic.api.PqGovernPlanFeignClient;
|
||||||
import com.njcn.csharmonic.constant.HarmonicConstant;
|
import com.njcn.csharmonic.constant.HarmonicConstant;
|
||||||
import com.njcn.csharmonic.param.*;
|
import com.njcn.csharmonic.param.*;
|
||||||
|
import com.njcn.csharmonic.pojo.po.PqGovernPlan;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataTdVO;
|
||||||
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||||
import com.njcn.device.biz.mapper.OverLimitWlMapper;
|
import com.njcn.device.biz.mapper.OverLimitWlMapper;
|
||||||
@@ -51,7 +53,6 @@ import com.njcn.influx.pojo.dto.StatisticalDataDTO;
|
|||||||
import com.njcn.influx.service.CommonService;
|
import com.njcn.influx.service.CommonService;
|
||||||
import com.njcn.influx.service.EvtDataService;
|
import com.njcn.influx.service.EvtDataService;
|
||||||
import com.njcn.system.api.*;
|
import com.njcn.system.api.*;
|
||||||
import com.njcn.system.pojo.po.DictData;
|
|
||||||
import com.njcn.system.pojo.po.EleEpdPqd;
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
import com.njcn.system.pojo.po.EleEvtParm;
|
import com.njcn.system.pojo.po.EleEvtParm;
|
||||||
import com.njcn.system.pojo.vo.CsStatisticalSetVO;
|
import com.njcn.system.pojo.vo.CsStatisticalSetVO;
|
||||||
@@ -112,6 +113,7 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
private final String GRID_SIDE_DICT_CODE = "Grid_Side";
|
private final String GRID_SIDE_DICT_CODE = "Grid_Side";
|
||||||
private final String LOAD_SIDE_DICT_CODE = "Load_Side";
|
private final String LOAD_SIDE_DICT_CODE = "Load_Side";
|
||||||
private final CsLinePOService csLinePOService;
|
private final CsLinePOService csLinePOService;
|
||||||
|
private final PqGovernPlanFeignClient pqGovernPlanFeignClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
@@ -1336,12 +1338,10 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
}
|
}
|
||||||
result.put("before", new ArrayList<>());
|
result.put("before", new ArrayList<>());
|
||||||
result.put("after", new ArrayList<>());
|
result.put("after", new ArrayList<>());
|
||||||
String sensitiveUserId = param.getSensitiveUserId();
|
PqGovernPlan plan = pqGovernPlanFeignClient.getById(param.getSensitiveUserId()).getData();
|
||||||
List<CsLinePO> linePOList = csLineFeignClient.getLinesByDevList(Collections.singletonList(sensitiveUserId)).getData();
|
if (Objects.isNull(plan)) {
|
||||||
DictData loadSideDictData = dicDataFeignClient.getDicDataByCode(LOAD_SIDE_DICT_CODE).getData();
|
return result;
|
||||||
DictData gridSideDictData = dicDataFeignClient.getDicDataByCode(GRID_SIDE_DICT_CODE).getData();
|
}
|
||||||
CsLinePO gridSideLine = linePOList.stream().filter(linePO -> linePO.getPosition().equals(gridSideDictData.getId())).findFirst().orElse(null);
|
|
||||||
CsLinePO loadSideLine = linePOList.stream().filter(linePO -> linePO.getPosition().equals(loadSideDictData.getId())).findFirst().orElse(null);
|
|
||||||
TrendDataQueryParam trendDataQueryParam = new TrendDataQueryParam();
|
TrendDataQueryParam trendDataQueryParam = new TrendDataQueryParam();
|
||||||
trendDataQueryParam.setSearchBeginTime(param.getSearchBeginTime());
|
trendDataQueryParam.setSearchBeginTime(param.getSearchBeginTime());
|
||||||
trendDataQueryParam.setSearchEndTime(param.getSearchEndTime());
|
trendDataQueryParam.setSearchEndTime(param.getSearchEndTime());
|
||||||
@@ -1357,17 +1357,14 @@ public class CsGroupServiceImpl extends ServiceImpl<CsGroupMapper, CsGroup> impl
|
|||||||
return queryParam;
|
return queryParam;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
trendDataQueryParam.setList(indexList);
|
trendDataQueryParam.setList(indexList);
|
||||||
if (loadSideLine != null) {
|
//治理前
|
||||||
trendDataQueryParam.setLineId(loadSideLine.getLineId());
|
trendDataQueryParam.setLineId(plan.getGovernBefore());
|
||||||
List<ThdDataVO> thdDataList = this.trendData(trendDataQueryParam);
|
List<ThdDataVO> thdDataList1 = this.trendData(trendDataQueryParam);
|
||||||
result.put("before", thdDataList);
|
result.put("before", thdDataList1);
|
||||||
}
|
//治理后
|
||||||
if (gridSideLine != null) {
|
trendDataQueryParam.setLineId(plan.getGovernAfter());
|
||||||
trendDataQueryParam.setLineId(gridSideLine.getLineId());
|
List<ThdDataVO> thdDataList2 = this.trendData(trendDataQueryParam);
|
||||||
List<ThdDataVO> thdDataList = this.trendData(trendDataQueryParam);
|
result.put("after", thdDataList2);
|
||||||
result.put("after", thdDataList);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import org.springframework.cloud.openfeign.FeignClient;
|
|||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -27,4 +28,8 @@ public interface PqGovernPlanFeignClient {
|
|||||||
@ApiOperation("清空治理前后监测点数据")
|
@ApiOperation("清空治理前后监测点数据")
|
||||||
HttpResult<List<PqGovernPlan>> getListByMonitorPoint(@RequestBody List<String> ids);
|
HttpResult<List<PqGovernPlan>> getListByMonitorPoint(@RequestBody List<String> ids);
|
||||||
|
|
||||||
|
@GetMapping("/getById")
|
||||||
|
@ApiOperation("根据ID查询治理方案")
|
||||||
|
HttpResult<PqGovernPlan> getById(@RequestParam("id") String id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,12 @@ public class PqGovernPlanClientFallbackFactory implements FallbackFactory<PqGove
|
|||||||
log.error("{}异常,降级处理,异常为:{}","清空治理前后监测点数据异常",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","清空治理前后监测点数据异常",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<PqGovernPlan> getById(String id) {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","根据ID查询治理方案异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ public class PqGovernPlanController extends BaseController {
|
|||||||
@ApiImplicitParam(name = "ids", value = "监测点id集合", required = true)
|
@ApiImplicitParam(name = "ids", value = "监测点id集合", required = true)
|
||||||
public HttpResult<List<PqGovernPlan>> getListByMonitorPoint(@RequestBody List<String> ids) {
|
public HttpResult<List<PqGovernPlan>> getListByMonitorPoint(@RequestBody List<String> ids) {
|
||||||
String methodDescribe = getMethodDescribe("clearGovernPoints");
|
String methodDescribe = getMethodDescribe("clearGovernPoints");
|
||||||
List<PqGovernPlan> result = pqGovernPlanService.getListByMonitorPoint(ids);
|
List<PqGovernPlan> result = pqGovernPlanService.getListByMonitorPoint(ids,null);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,6 @@ public interface IPqGovernPlanService extends IService<PqGovernPlan> {
|
|||||||
* @param ids 监测点id集合
|
* @param ids 监测点id集合
|
||||||
* @return 治理方案列表
|
* @return 治理方案列表
|
||||||
*/
|
*/
|
||||||
List<PqGovernPlan> getListByMonitorPoint(List<String> ids);
|
List<PqGovernPlan> getListByMonitorPoint(List<String> ids, String governType);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -457,8 +457,10 @@ public class CsEventUserPOServiceImpl extends ServiceImpl<CsEventUserPOMapper, C
|
|||||||
temp.setEngineeringid(devDetail.getEngineeringid());
|
temp.setEngineeringid(devDetail.getEngineeringid());
|
||||||
temp.setEngineeringName(devDetail.getEngineeringName());
|
temp.setEngineeringName(devDetail.getEngineeringName());
|
||||||
if (ObjectUtil.isNotNull(temp.getLineId())) {
|
if (ObjectUtil.isNotNull(temp.getLineId())) {
|
||||||
|
if (!Objects.isNull(map.get(temp.getLineId()))) {
|
||||||
temp.setLineVoltage(map.get(temp.getLineId()).getVolGrade());
|
temp.setLineVoltage(map.get(temp.getLineId()).getVolGrade());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
EleEpdPqd ele = epdFeignClient.findByName(temp.getTag()).getData();
|
EleEpdPqd ele = epdFeignClient.findByName(temp.getTag()).getData();
|
||||||
if (Objects.isNull(ele)) {
|
if (Objects.isNull(ele)) {
|
||||||
temp.setShowName(temp.getTag());
|
temp.setShowName(temp.getTag());
|
||||||
|
|||||||
@@ -190,22 +190,9 @@ public class LineTargetServiceImpl implements ILineTargetService {
|
|||||||
String targetTag = null;
|
String targetTag = null;
|
||||||
String phasic = null;
|
String phasic = null;
|
||||||
String dataType = null;
|
String dataType = null;
|
||||||
// String[] tmepUidName = temp.split(" / ");
|
|
||||||
// if(tmepUidName.length==2){
|
|
||||||
// targetTag = tmepUidName[0];
|
|
||||||
// phasic = "T";
|
|
||||||
// dataType = tmepUidName[1];
|
|
||||||
// }else if (tmepUidName.length==3){
|
|
||||||
// targetTag = tmepUidName[0];
|
|
||||||
// phasic = tmepUidName[1];
|
|
||||||
// dataType = tmepUidName[2];
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (CollectionUtils.isEmpty(item.getUid()) || org.springframework.util.StringUtils.isEmpty(item.getLineId())){
|
if (CollectionUtils.isEmpty(item.getUid()) || org.springframework.util.StringUtils.isEmpty(item.getLineId())){
|
||||||
throw new BusinessException(CsSystemResponseEnum.BIND_TARGET_ERROR);
|
throw new BusinessException(CsSystemResponseEnum.BIND_TARGET_ERROR);
|
||||||
}
|
}
|
||||||
// List<String> tempUid = (List<String>) item.getUid().get(i);
|
|
||||||
|
|
||||||
if (item.getUid().get(i) instanceof List) {
|
if (item.getUid().get(i) instanceof List) {
|
||||||
List<?> rawList = (List<?>) item.getUid().get(i);
|
List<?> rawList = (List<?>) item.getUid().get(i);
|
||||||
List<String> tempUid = rawList.stream()
|
List<String> tempUid = rawList.stream()
|
||||||
@@ -214,8 +201,8 @@ public class LineTargetServiceImpl implements ILineTargetService {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
String s = tempUid.get(tempUid.size() - 1);
|
String s = tempUid.get(tempUid.size() - 1);
|
||||||
String[] tempTable = s.replace("$", "").split("#");
|
String[] tempTable = s.replace("$", "").split("#");
|
||||||
result.add(getLineRtDataNew(item.getId(),item.getLineId(),tempTable[3],tempTable[0],Objects.equals(tempTable[1],"T")?"T":tempTable[1],tempTable[2],temp,item.getUnit().get(i)));
|
phasic = Objects.equals(tempTable[1],"M") ? "T" : tempTable[1];
|
||||||
// result.add(getLineRtData(item.getId(),item.getLineId(),tempUid.get(3),tempUid.get(0),tempUid.get(1),tempUid.get(2).toUpperCase(),temp,"%"));
|
result.add(getLineRtDataNew(item.getId(),item.getLineId(),tempTable[3],tempTable[0],phasic,tempTable[2],temp,item.getUnit().get(i)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
@@ -130,11 +131,14 @@ public class PqGovernPlanServiceImpl extends ServiceImpl<PqGovernPlanMapper, PqG
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PqGovernPlan> getListByMonitorPoint(List<String> ids) {
|
public List<PqGovernPlan> getListByMonitorPoint(List<String> ids, String type) {
|
||||||
LambdaQueryWrapper<PqGovernPlan> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<PqGovernPlan> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.and(w -> w.in(PqGovernPlan::getGovernBefore, ids)
|
wrapper.and(w -> w.in(PqGovernPlan::getGovernBefore, ids)
|
||||||
.or()
|
.or()
|
||||||
.in(PqGovernPlan::getGovernAfter, ids));
|
.in(PqGovernPlan::getGovernAfter, ids));
|
||||||
|
if (!Objects.isNull(type)) {
|
||||||
|
wrapper.eq(PqGovernPlan::getGovernType, type);
|
||||||
|
}
|
||||||
return this.list(wrapper);
|
return this.list(wrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class PqSensitiveUserServiceImpl extends ServiceImpl<PqSensitiveUserMappe
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
//根据监测点获取用户
|
//根据监测点获取用户
|
||||||
List<PqGovernPlan> governPlans = pqGovernPlanService.getListByMonitorPoint(lineIds);
|
List<PqGovernPlan> governPlans = pqGovernPlanService.getListByMonitorPoint(lineIds,null);
|
||||||
if (CollUtil.isEmpty(governPlans)) {
|
if (CollUtil.isEmpty(governPlans)) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -115,7 +115,7 @@ public class PqSensitiveUserServiceImpl extends ServiceImpl<PqSensitiveUserMappe
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
//根据监测点获取用户
|
//根据监测点获取用户
|
||||||
List<PqGovernPlan> governPlans = pqGovernPlanService.getListByMonitorPoint(lineIds);
|
List<PqGovernPlan> governPlans = pqGovernPlanService.getListByMonitorPoint(lineIds,null);
|
||||||
if (CollUtil.isEmpty(governPlans)) {
|
if (CollUtil.isEmpty(governPlans)) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -146,31 +146,33 @@ public class PqSensitiveUserServiceImpl extends ServiceImpl<PqSensitiveUserMappe
|
|||||||
@Override
|
@Override
|
||||||
public Map<String, List<PqGovernPlan>> getUserDevTree(String type) {
|
public Map<String, List<PqGovernPlan>> getUserDevTree(String type) {
|
||||||
Map<String, List<PqGovernPlan>> map = new LinkedHashMap<>();
|
Map<String, List<PqGovernPlan>> map = new LinkedHashMap<>();
|
||||||
List<PqSensitiveUser> userList = this.list();
|
//根据用户获取监测点id
|
||||||
if (CollUtil.isNotEmpty(userList)) {
|
List<String> lineIds = csCommTerminalFeignClient.getLineIdsByUser(RequestUtil.getUserIndex()).getData();
|
||||||
|
if (CollUtil.isEmpty(lineIds)) {
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
//根据监测点id获取治理用户
|
||||||
String governType = Objects.equals(type, "apf") ? "harmonic" : "event";
|
String governType = Objects.equals(type, "apf") ? "harmonic" : "event";
|
||||||
LambdaQueryWrapper<PqGovernPlan> wrapper = new LambdaQueryWrapper<>();
|
List<PqGovernPlan> governPlans = pqGovernPlanService.getListByMonitorPoint(lineIds,governType);
|
||||||
wrapper.eq(PqGovernPlan::getGovernType, governType)
|
if (CollUtil.isEmpty(governPlans)) {
|
||||||
.orderByAsc(PqGovernPlan::getSort);
|
return map;
|
||||||
List<PqGovernPlan> planList = pqGovernPlanService.list(wrapper);
|
}
|
||||||
Map<String, List<PqGovernPlan>> planMap = new LinkedHashMap<>();
|
List<PqSensitiveUser> userList = this.list();
|
||||||
if (CollUtil.isNotEmpty(planList)) {
|
if (CollUtil.isEmpty(userList)) {
|
||||||
planMap = planList.stream()
|
return map;
|
||||||
.collect(Collectors.groupingBy(
|
}
|
||||||
|
Map<String, List<PqGovernPlan>> planMap = governPlans.stream().collect(Collectors.groupingBy(
|
||||||
PqGovernPlan::getPid,
|
PqGovernPlan::getPid,
|
||||||
LinkedHashMap::new,
|
LinkedHashMap::new,
|
||||||
Collectors.toList()
|
Collectors.toList()
|
||||||
));
|
));
|
||||||
}
|
Map<String, PqSensitiveUser> userMap = userList.stream().collect(Collectors.toMap(PqSensitiveUser::getId, item -> item));
|
||||||
Map<String, List<PqGovernPlan>> finalPlanMap = planMap;
|
planMap.forEach((k,v)->{
|
||||||
userList.forEach(item -> {
|
map.put(userMap.get(k).getName(), v);
|
||||||
map.put(item.getName(), finalPlanMap.get(item.getId()));
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void checkParam(PqSensitiveUserParam param,boolean update){
|
private void checkParam(PqSensitiveUserParam param,boolean update){
|
||||||
DictData data = dicDataFeignClient.getDicDataById(param.getLoadType()).getData();
|
DictData data = dicDataFeignClient.getDicDataById(param.getLoadType()).getData();
|
||||||
if(Objects.isNull(data)){
|
if(Objects.isNull(data)){
|
||||||
|
|||||||
@@ -177,26 +177,23 @@ public class RStatLimitRateDServiceImpl extends ServiceImpl<RStatLimitRateDMappe
|
|||||||
if (CollUtil.isEmpty(keywordsLineIds)) {
|
if (CollUtil.isEmpty(keywordsLineIds)) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
// 根据监测点Id分组,再分页
|
// 按监测点总数手动分页,确保没有数据的监测点也能展示
|
||||||
Page<RStatLimitRateDPO> ratePage = this.page(new Page<RStatLimitRateDPO>(param.getPageNum(), param.getPageSize()), new LambdaQueryWrapper<RStatLimitRateDPO>()
|
result.setTotal(keywordsLineIds.size());
|
||||||
.eq(RStatLimitRateDPO::getPhasicType, "T")
|
int fromIndex = (param.getPageNum() - 1) * param.getPageSize();
|
||||||
.ge(StrUtil.isNotBlank(param.getSearchBeginTime()), RStatLimitRateDPO::getTime, param.getSearchBeginTime())
|
if (fromIndex >= keywordsLineIds.size()) {
|
||||||
.le(StrUtil.isNotBlank(param.getSearchEndTime()), RStatLimitRateDPO::getTime, param.getSearchEndTime())
|
|
||||||
.in(RStatLimitRateDPO::getLineId, keywordsLineIds)
|
|
||||||
.groupBy(RStatLimitRateDPO::getLineId)
|
|
||||||
.select(RStatLimitRateDPO::getLineId)
|
|
||||||
);
|
|
||||||
BeanUtil.copyProperties(ratePage, result);
|
|
||||||
List<RStatLimitRateDPO> records = ratePage.getRecords();
|
|
||||||
if (CollUtil.isEmpty(records)) {
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
int toIndex = Math.min(fromIndex + param.getPageSize(), keywordsLineIds.size());
|
||||||
|
List<String> pageLineIds = new ArrayList<>(keywordsLineIds.subList(fromIndex, toIndex));
|
||||||
|
|
||||||
List<MainLineVO> list = new ArrayList<>();
|
List<MainLineVO> list = new ArrayList<>();
|
||||||
MainLineVO mainLineVO;
|
MainLineVO mainLineVO;
|
||||||
List<DevDetailDTO> devDetailDTOList = csCommTerminalFeignClient.getLedgerByLineId(keywordsLineIds).getData();
|
List<DevDetailDTO> devDetailDTOList = csCommTerminalFeignClient.getLedgerByLineId(pageLineIds).getData();
|
||||||
Map<String, DevDetailDTO> devDetailDTOMap = devDetailDTOList.stream().collect(Collectors.toMap(DevDetailDTO::getLineId, item -> item));
|
Map<String, DevDetailDTO> devDetailDTOMap = CollUtil.isEmpty(devDetailDTOList)
|
||||||
|
? Collections.emptyMap()
|
||||||
|
: devDetailDTOList.stream().collect(Collectors.toMap(DevDetailDTO::getLineId, item -> item));
|
||||||
//根据监测点获取治理方案
|
//根据监测点获取治理方案
|
||||||
List<PqGovernPlan> pqGovernPlans = pqGovernPlanFeignClient.getListByMonitorPoint(keywordsLineIds).getData();
|
List<PqGovernPlan> pqGovernPlans = pqGovernPlanFeignClient.getListByMonitorPoint(pageLineIds).getData();
|
||||||
Map<String, PqGovernPlan> pqGovernPlanMap1 = Collections.emptyMap();
|
Map<String, PqGovernPlan> pqGovernPlanMap1 = Collections.emptyMap();
|
||||||
Map<String, PqGovernPlan> pqGovernPlanMap2 = Collections.emptyMap();
|
Map<String, PqGovernPlan> pqGovernPlanMap2 = Collections.emptyMap();
|
||||||
if (CollUtil.isNotEmpty(pqGovernPlans)) {
|
if (CollUtil.isNotEmpty(pqGovernPlans)) {
|
||||||
@@ -204,14 +201,23 @@ public class RStatLimitRateDServiceImpl extends ServiceImpl<RStatLimitRateDMappe
|
|||||||
pqGovernPlanMap2 = pqGovernPlans.stream().collect(Collectors.toMap(PqGovernPlan::getGovernAfter, item -> item));
|
pqGovernPlanMap2 = pqGovernPlans.stream().collect(Collectors.toMap(PqGovernPlan::getGovernAfter, item -> item));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (RStatLimitRateDPO record : records) {
|
for (String lineId : pageLineIds) {
|
||||||
String lineId = record.getLineId();
|
|
||||||
mainLineVO = new MainLineVO();
|
mainLineVO = new MainLineVO();
|
||||||
mainLineVO.setLineId(lineId);
|
mainLineVO.setLineId(lineId);
|
||||||
mainLineVO.setEngineeringName(devDetailDTOMap.get(lineId).getEngineeringName());
|
DevDetailDTO devDetailDTO = devDetailDTOMap.get(lineId);
|
||||||
mainLineVO.setProjectName(devDetailDTOMap.get(lineId).getProjectName());
|
if (devDetailDTO != null) {
|
||||||
mainLineVO.setDevName(devDetailDTOMap.get(lineId).getEquipmentName());
|
mainLineVO.setEngineeringName(devDetailDTO.getEngineeringName());
|
||||||
mainLineVO.setLineName(devDetailDTOMap.get(lineId).getLineName());
|
mainLineVO.setProjectName(devDetailDTO.getProjectName());
|
||||||
|
mainLineVO.setDevName(devDetailDTO.getEquipmentName());
|
||||||
|
mainLineVO.setLineName(devDetailDTO.getLineName());
|
||||||
|
mainLineVO.setObjType(devDetailDTO.getObjType());
|
||||||
|
if (ObjectUtil.isNotNull(devDetailDTO.getObjType())) {
|
||||||
|
DictData dictData = dicDataFeignClient.getDicDataById(devDetailDTO.getObjType()).getData();
|
||||||
|
if (dictData != null) {
|
||||||
|
mainLineVO.setObjType(dictData.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
PqGovernPlan plan1 = pqGovernPlanMap1.get(lineId);
|
PqGovernPlan plan1 = pqGovernPlanMap1.get(lineId);
|
||||||
if (!Objects.isNull(plan1)) {
|
if (!Objects.isNull(plan1)) {
|
||||||
mainLineVO.setGovern(Objects.isNull(plan1.getGovernMethod()) ? "未治理" : plan1.getGovernMethod());
|
mainLineVO.setGovern(Objects.isNull(plan1.getGovernMethod()) ? "未治理" : plan1.getGovernMethod());
|
||||||
@@ -220,13 +226,6 @@ public class RStatLimitRateDServiceImpl extends ServiceImpl<RStatLimitRateDMappe
|
|||||||
if (!Objects.isNull(plan2)) {
|
if (!Objects.isNull(plan2)) {
|
||||||
mainLineVO.setGovern(Objects.isNull(plan2.getGovernMethod()) ? "未治理" : plan2.getGovernMethod());
|
mainLineVO.setGovern(Objects.isNull(plan2.getGovernMethod()) ? "未治理" : plan2.getGovernMethod());
|
||||||
}
|
}
|
||||||
mainLineVO.setObjType(devDetailDTOMap.get(lineId).getObjType());
|
|
||||||
if (ObjectUtil.isNotNull(devDetailDTOMap.get(lineId).getObjType())) {
|
|
||||||
DictData dictData = dicDataFeignClient.getDicDataById(devDetailDTOMap.get(lineId).getObjType()).getData();
|
|
||||||
if (dictData != null) {
|
|
||||||
mainLineVO.setObjType(dictData.getName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MainLineStatLimitRateDetailsQueryParam detailsQueryParam = new MainLineStatLimitRateDetailsQueryParam();
|
MainLineStatLimitRateDetailsQueryParam detailsQueryParam = new MainLineStatLimitRateDetailsQueryParam();
|
||||||
detailsQueryParam.setLineId(lineId);
|
detailsQueryParam.setLineId(lineId);
|
||||||
detailsQueryParam.setSearchBeginTime(param.getSearchBeginTime());
|
detailsQueryParam.setSearchBeginTime(param.getSearchBeginTime());
|
||||||
@@ -252,12 +251,13 @@ public class RStatLimitRateDServiceImpl extends ServiceImpl<RStatLimitRateDMappe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CollUtil.isEmpty(problemList)) {
|
if (CollUtil.isEmpty(detailsList)) {
|
||||||
|
mainLineVO.setProblems("暂无数据");
|
||||||
|
} else if (CollUtil.isEmpty(problemList)) {
|
||||||
mainLineVO.setProblems("所有指标都合格");
|
mainLineVO.setProblems("所有指标都合格");
|
||||||
} else {
|
} else {
|
||||||
mainLineVO.setProblems(CollUtil.join(problemList, "、"));
|
mainLineVO.setProblems(CollUtil.join(problemList, "、"));
|
||||||
}
|
}
|
||||||
|
|
||||||
list.add(mainLineVO);
|
list.add(mainLineVO);
|
||||||
}
|
}
|
||||||
result.setRecords(list);
|
result.setRecords(list);
|
||||||
|
|||||||
@@ -49,7 +49,11 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
|
|||||||
map.forEach((key, value) -> {
|
map.forEach((key, value) -> {
|
||||||
|
|
||||||
EleEpdTreeVO reportTreeVO = new EleEpdTreeVO();
|
EleEpdTreeVO reportTreeVO = new EleEpdTreeVO();
|
||||||
|
if (Objects.isNull(value.get(0).getOtherName())) {
|
||||||
reportTreeVO.setName(value.get(0).getName());
|
reportTreeVO.setName(value.get(0).getName());
|
||||||
|
} else {
|
||||||
|
reportTreeVO.setName(value.get(0).getOtherName());
|
||||||
|
}
|
||||||
reportTreeVO.setShowName(value.get(0).getShowName());
|
reportTreeVO.setShowName(value.get(0).getShowName());
|
||||||
|
|
||||||
//存在1-50次 2-50次情况
|
//存在1-50次 2-50次情况
|
||||||
@@ -57,7 +61,7 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
|
|||||||
List<EleEpdTreeVO> reHarm = new ArrayList<>();
|
List<EleEpdTreeVO> reHarm = new ArrayList<>();
|
||||||
for (int i = value.get(0).getHarmStart(); i <= value.get(0).getHarmEnd(); i++) {
|
for (int i = value.get(0).getHarmStart(); i <= value.get(0).getHarmEnd(); i++) {
|
||||||
EleEpdTreeVO reportTreeCount = new EleEpdTreeVO();
|
EleEpdTreeVO reportTreeCount = new EleEpdTreeVO();
|
||||||
reportTreeCount.setName(value.get(0).getName() + "_" + i);
|
reportTreeCount.setName(reportTreeVO.getName() + "_" + i);
|
||||||
reportTreeCount.setShowName(i + "次" + value.get(0).getShowName());
|
reportTreeCount.setShowName(i + "次" + value.get(0).getShowName());
|
||||||
reportTreeVO.setFlag(1);
|
reportTreeVO.setFlag(1);
|
||||||
assPhase(value, reportTreeCount, reportTreeCount.getName());
|
assPhase(value, reportTreeCount, reportTreeCount.getName());
|
||||||
@@ -65,7 +69,7 @@ public class EleEpdPqdServiceImpl extends ServiceImpl<EleEpdPqdMapper, EleEpdPqd
|
|||||||
}
|
}
|
||||||
reportTreeVO.setChildren(reHarm);
|
reportTreeVO.setChildren(reHarm);
|
||||||
} else {
|
} else {
|
||||||
assPhase(value, reportTreeVO, value.get(0).getName());
|
assPhase(value, reportTreeVO, reportTreeVO.getName());
|
||||||
}
|
}
|
||||||
tree.add(reportTreeVO);
|
tree.add(reportTreeVO);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user