1.审批流程中审批不通过会造成俩条数据bug解决

2.解决公共方法,变电站信息台账数据量不准确问题,增加变电数据判断
3.技术监督-干扰源治理验收报告逻辑校验
4.技术监督-台账联调,增加治理验收和入网评估报告验证
This commit is contained in:
wr
2024-07-24 09:43:06 +08:00
parent a9aa0785da
commit 67ad03ddbe
13 changed files with 169 additions and 54 deletions

View File

@@ -305,10 +305,13 @@ public class BpmProcessInstanceServiceImpl implements IBpmProcessInstanceService
// 3. 发送流程实例的状态事件 // 3. 发送流程实例的状态事件
// 注意:此时如果去查询 ProcessInstance 的话,字段是不全的,所以去查询了 HistoricProcessInstance // 注意:此时如果去查询 ProcessInstance 的话,字段是不全的,所以去查询了 HistoricProcessInstance
// 在审核不通过时,会触该信息,设置在审核通过时,才发送
if(BpmProcessInstanceStatusEnum.APPROVE.getStatus()==processInstanceStatus){
HistoricProcessInstance processInstance = getHistoricProcessInstance(instance.getId()); HistoricProcessInstance processInstance = getHistoricProcessInstance(instance.getId());
processInstanceEventPublisher.sendProcessInstanceResultEvent( processInstanceEventPublisher.sendProcessInstanceResultEvent(
BpmProcessInstanceConvert.INSTANCE.buildProcessInstanceStatusEvent(this, processInstance, processInstanceStatus)); BpmProcessInstanceConvert.INSTANCE.buildProcessInstanceStatusEvent(this, processInstance, processInstanceStatus));
} }
}
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)

View File

@@ -555,4 +555,6 @@ public interface LineMapper extends BaseMapper<Line> {
List<LineDetailVO.noDataLineInfo> getNoDataLine(@Param("time")String time); List<LineDetailVO.noDataLineInfo> getNoDataLine(@Param("time")String time);
List<ReportLineInfoVo> getReportLineInfo(@Param("ids")List<String> ids); List<ReportLineInfoVo> getReportLineInfo(@Param("ids")List<String> ids);
List<Line> getSubByCondition(@Param("subIds") List<String> subIds, @Param("scale") List<SimpleDTO> scale);
} }

View File

@@ -268,7 +268,8 @@
pq_line t1 , pq_line t1 ,
pq_line_detail t2 pq_line_detail t2
where where
t1.id = t2.id t1.state = 1
and t1.id = t2.id
and and
t1.id in t1.id in
<foreach collection="ids" separator="," open="(" close=")" item="item"> <foreach collection="ids" separator="," open="(" close=")" item="item">
@@ -1723,4 +1724,24 @@
</if> </if>
</where> </where>
</select> </select>
<select id="getSubByCondition" resultType="com.njcn.device.pq.pojo.po.Line">
select
t1.*
from
pq_line t1 ,
pq_substation t2
where
t1.id = t2.id
and
t1.id in
<foreach collection="subIds" separator="," open="(" close=")" item="item">
#{item}
</foreach>
<if test="scale!=null and scale.size()!=0">
AND t2.scale in
<foreach collection="scale" open="(" close=")" item="item" separator=",">
#{item.id}
</foreach>
</if>
</select>
</mapper> </mapper>

View File

@@ -132,6 +132,14 @@ public interface TerminalBaseService {
*/ */
List<Line> getVoltageByCondition(List<String> voltageIds, List<SimpleDTO> scale); List<Line> getVoltageByCondition(List<String> voltageIds, List<SimpleDTO> scale);
/**
* 查询变电站信息
*
* @param subIds 变电站索引
* @param scale 电压等级
*/
List<Line> getSubByCondition(List<String> subIds, List<SimpleDTO> scale);
/** /**
* 根据指定电压等级查询母线id * 根据指定电压等级查询母线id
* *

View File

@@ -434,8 +434,15 @@ public class GeneralDeviceService {
//再根据电压等级筛选合法母线信息 //再根据电压等级筛选合法母线信息
List<Line> voltages = terminalBaseService.getVoltageByCondition(voltageIds, List<Line> voltages = terminalBaseService.getVoltageByCondition(voltageIds,
deviceInfoParam.getScale()); deviceInfoParam.getScale());
//筛选出变电站id理论上监测点的pids中第四个id为变电站id 联查: pq_line t1 ,pq_substation t2
List<String> subIds = lines.stream().map(line -> {
String[] idsArray = line.getPids().split(",");
return idsArray[3];
}).collect(Collectors.toList());
List<Line> sub = terminalBaseService.getSubByCondition(subIds,
deviceInfoParam.getScale());
//筛选最终的数据 //筛选最终的数据
dealDeviceData(generalDeviceDTO, lines, devices, voltages); dealDeviceData(generalDeviceDTO, lines, devices, voltages, sub);
return generalDeviceDTO; return generalDeviceDTO;
} }
@@ -447,15 +454,18 @@ public class GeneralDeviceService {
* @param devices 筛选后的终端信息 * @param devices 筛选后的终端信息
* @param voltages 筛选后的母线信息 * @param voltages 筛选后的母线信息
*/ */
private void dealDeviceData(GeneralDeviceDTO generalDeviceDTO, List<Line> lines, List<Line> devices, List<Line> voltages) { private void dealDeviceData(GeneralDeviceDTO generalDeviceDTO, List<Line> lines, List<Line> devices, List<Line> voltages, List<Line> sub) {
List<String> gdIndexes = new ArrayList<>(), subIndexes = new ArrayList<>(), deviceIndexes = new ArrayList<>(), voltageIndexes = new ArrayList<>(), lineIndexes = new ArrayList<>(); List<String> gdIndexes = new ArrayList<>(), subIndexes = new ArrayList<>(), deviceIndexes = new ArrayList<>(), voltageIndexes = new ArrayList<>(), lineIndexes = new ArrayList<>();
List<String> devIds = devices.stream().map(Line::getId).distinct().collect(Collectors.toList()); List<String> devIds = devices.stream().map(Line::getId).distinct().collect(Collectors.toList());
List<String> volIds = voltages.stream().map(Line::getId).distinct().collect(Collectors.toList()); List<String> volIds = voltages.stream().map(Line::getId).distinct().collect(Collectors.toList());
List<String> subIds = sub.stream().map(Line::getId).distinct().collect(Collectors.toList());
for (Line line : lines) { for (Line line : lines) {
String[] idsArray = line.getPids().split(","); String[] idsArray = line.getPids().split(",");
//监测点同时满足条件筛选后的终端、母线信息,才是最终的结果 //监测点同时满足条件筛选后的终端、母线信息,才是最终的结果
if (devIds.contains(idsArray[LineBaseEnum.DEVICE_LEVEL.getCode()]) && if (devIds.contains(idsArray[LineBaseEnum.DEVICE_LEVEL.getCode()]) &&
volIds.contains(idsArray[LineBaseEnum.SUB_V_LEVEL.getCode()])) { volIds.contains(idsArray[LineBaseEnum.SUB_V_LEVEL.getCode()])&&
subIds.contains(idsArray[LineBaseEnum.SUB_LEVEL.getCode()])
) {
gdIndexes.add(idsArray[LineBaseEnum.GD_LEVEL.getCode()]); gdIndexes.add(idsArray[LineBaseEnum.GD_LEVEL.getCode()]);
subIndexes.add(idsArray[LineBaseEnum.SUB_LEVEL.getCode()]); subIndexes.add(idsArray[LineBaseEnum.SUB_LEVEL.getCode()]);
deviceIndexes.add(idsArray[LineBaseEnum.DEVICE_LEVEL.getCode()]); deviceIndexes.add(idsArray[LineBaseEnum.DEVICE_LEVEL.getCode()]);

View File

@@ -296,12 +296,14 @@ public class GridDiagramServiceImpl implements GridDiagramService {
//根据步进单位获取起始日期时间和结束日期时间的时间区间集合 //根据步进单位获取起始日期时间和结束日期时间的时间区间集合
List<DateTime> dateTimes = DateUtil.rangeToList(parse, DateUtil.parse(param.getSearchEndTime()), dateField); List<DateTime> dateTimes = DateUtil.rangeToList(parse, DateUtil.parse(param.getSearchEndTime()), dateField);
List<Date> times; List<Date> times;
//终端分布趋势
if (4 == type) { if (4 == type) {
List<String> devIDs = generalDeviceDTOList.stream().flatMap(x -> x.getDeviceIndexes().stream()).distinct().collect(Collectors.toList()); List<String> devIDs = generalDeviceDTOList.stream().flatMap(x -> x.getDeviceIndexes().stream()).distinct().collect(Collectors.toList());
List<Device> list = deviceService.list(new LambdaQueryWrapper<Device>().select(Device::getLoginTime).in(CollUtil.isNotEmpty(devIDs), Device::getId, devIDs).eq(Device::getRunFlag, 0)); List<Device> list = deviceService.list(new LambdaQueryWrapper<Device>().select(Device::getLoginTime).in(CollUtil.isNotEmpty(devIDs), Device::getId, devIDs).eq(Device::getRunFlag, 0));
times = list.stream().map(x -> Date.from(x.getLoginTime().atStartOfDay(ZoneId.systemDefault()).toInstant())).collect(Collectors.toList()); times = list.stream().map(x -> Date.from(x.getLoginTime().atStartOfDay(ZoneId.systemDefault()).toInstant())).collect(Collectors.toList());
} else { } else {
List<String> ids; List<String> ids;
//监测点分布趋势
if (type == 3) { if (type == 3) {
ids = generalDeviceDTOList.stream().flatMap(x -> x.getSubIndexes().stream()).distinct().collect(Collectors.toList()); ids = generalDeviceDTOList.stream().flatMap(x -> x.getSubIndexes().stream()).distinct().collect(Collectors.toList());
} else { } else {

View File

@@ -1491,6 +1491,11 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
return this.baseMapper.getVoltageByCondition(voltageIds, scale); return this.baseMapper.getVoltageByCondition(voltageIds, scale);
} }
@Override
public List<Line> getSubByCondition(List<String> subIds, List<SimpleDTO> scale) {
return this.baseMapper.getSubByCondition(subIds, scale);
}
@Override @Override
public List<String> getVoltageIdByScale(List<String> voltageIds, String scale) { public List<String> getVoltageIdByScale(List<String> voltageIds, String scale) {
return this.baseMapper.getVoltageIdByScale(voltageIds, scale); return this.baseMapper.getVoltageIdByScale(voltageIds, scale);

View File

@@ -162,6 +162,8 @@ public class UserReportVO {
private UserReportSubstationPO userReportSubstationPO; private UserReportSubstationPO userReportSubstationPO;
@ApiModelProperty(value = "true可以点击治理 false不可以点击治理 ")
private Boolean type;
@Data @Data

View File

@@ -1,10 +1,13 @@
package com.njcn.supervision.service.device.impl; package com.njcn.supervision.service.device.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DatePattern; import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.LocalDateTimeUtil; import cn.hutool.core.date.LocalDateTimeUtil;
import cn.hutool.core.text.StrPool; import cn.hutool.core.text.StrPool;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -22,17 +25,24 @@ import com.njcn.device.pq.api.TerminalBaseClient;
import com.njcn.device.pq.pojo.param.*; import com.njcn.device.pq.pojo.param.*;
import com.njcn.device.pq.pojo.po.Line; import com.njcn.device.pq.pojo.po.Line;
import com.njcn.supervision.enums.SupervisionKeyEnum; import com.njcn.supervision.enums.SupervisionKeyEnum;
import com.njcn.supervision.enums.UserNatureEnum;
import com.njcn.supervision.mapper.device.SupervisionTempLineDebugPOMapper; import com.njcn.supervision.mapper.device.SupervisionTempLineDebugPOMapper;
import com.njcn.supervision.mapper.user.UserReportNormalMapper;
import com.njcn.supervision.pojo.param.device.SupervisionTempLineDebugParam; import com.njcn.supervision.pojo.param.device.SupervisionTempLineDebugParam;
import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport; import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport;
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO; import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport; import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
import com.njcn.supervision.pojo.po.user.UserReportNormalPO;
import com.njcn.supervision.pojo.po.user.UserReportPO;
import com.njcn.supervision.pojo.vo.device.SupervisionDevMainReportVO; import com.njcn.supervision.pojo.vo.device.SupervisionDevMainReportVO;
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineDebugVO; import com.njcn.supervision.pojo.vo.device.SupervisionTempLineDebugVO;
import com.njcn.supervision.service.device.SupervisionDevMainReportPOService;
import com.njcn.supervision.service.device.SupervisionTempDeviceReportService; import com.njcn.supervision.service.device.SupervisionTempDeviceReportService;
import com.njcn.supervision.service.device.SupervisionTempLineDebugPOService; import com.njcn.supervision.service.device.SupervisionTempLineDebugPOService;
import com.njcn.supervision.service.device.SupervisionTempLineReportService; import com.njcn.supervision.service.device.SupervisionTempLineReportService;
import com.njcn.supervision.service.user.UserReportPOService;
import com.njcn.supervision.service.user.UserReportProjectPOService;
import com.njcn.supervision.service.user.UserReportSensitivePOService;
import com.njcn.supervision.service.user.UserReportSubstationPOService;
import com.njcn.supervision.utils.InstanceUtil; import com.njcn.supervision.utils.InstanceUtil;
import com.njcn.system.api.DicDataFeignClient; import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.api.DictTreeFeignClient; import com.njcn.system.api.DictTreeFeignClient;
@@ -66,20 +76,20 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
private final BpmProcessFeignClient bpmProcessFeignClient; private final BpmProcessFeignClient bpmProcessFeignClient;
private final DeptFeignClient deptFeignClient; private final DeptFeignClient deptFeignClient;
private final SupervisionTempLineReportService supervisionTempLineReportService; private final SupervisionTempLineReportService supervisionTempLineReportService;
private final SupervisionDevMainReportPOService supervisionDevMainReportPOService;
private final SupervisionTempDeviceReportService supervisionTempDeviceReportService; private final SupervisionTempDeviceReportService supervisionTempDeviceReportService;
private final LineFeignClient lineFeignClient; private final LineFeignClient lineFeignClient;
private final DictTreeFeignClient dictTreeFeignClient; private final DictTreeFeignClient dictTreeFeignClient;
private final DicDataFeignClient dicDataFeignClient; private final DicDataFeignClient dicDataFeignClient;
private final DeptLineFeignClient deptLineFeignClient; private final DeptLineFeignClient deptLineFeignClient;
private final UserFeignClient userFeignClient; private final UserFeignClient userFeignClient;
private final TerminalBaseClient terminalBaseClient; private final TerminalBaseClient terminalBaseClient;
private final UserReportPOService userReportPOService;
private final UserReportProjectPOService userReportProjectPOService;
private final UserReportSubstationPOService userReportSubstationPOService;
private final UserReportSensitivePOService userReportSensitivePOService;
private final UserReportNormalMapper userReportNormalMapper;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String addTempLineDebug(SupervisionTempLineDebugParam supervisionTempLineReportParam) { public String addTempLineDebug(SupervisionTempLineDebugParam supervisionTempLineReportParam) {
@@ -266,7 +276,60 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
} }
//获取临时监测点详情 //获取临时监测点详情
SupervisionTempLineReport tempLine = supervisionTempLineReportService.getById(id); SupervisionTempLineReport tempLine = supervisionTempLineReportService.getById(id);
//需要审核报告是否审核通过
UserReportPO temp = userReportPOService.getById(tempLine.getUserId());
//是否存在治理方案
Integer needGovernance = 0;
if (
CollectionUtil.newArrayList(
UserNatureEnum.BUILD_POWER_GRID.getCode(),
UserNatureEnum.EXTEND_POWER_GRID.getCode()
).contains(temp.getUserType())) {
//电网工程类用户额外数据
needGovernance = userReportProjectPOService.getById(temp.getId()).getNeedGovernance();
} else if (
CollectionUtil.newArrayList(
UserNatureEnum.BUILD_NON_LINEAR_LOAD.getCode(),
UserNatureEnum.EXTEND_NON_LINEAR_LOAD.getCode(),
UserNatureEnum.BUILD_NEW_ENERGY_POWER_STATION.getCode(),
UserNatureEnum.EXTEND_NEW_ENERGY_POWER_STATION.getCode()
).contains(temp.getUserType())) {
//非线性负荷用户 & 新能源发电站用户
needGovernance = userReportSubstationPOService.getById(temp.getId()).getNeedGovernance();
} else if (UserNatureEnum.SENSITIVE_USER.getCode().equals(temp.getUserType())) {
// 敏感及重要用户
needGovernance = userReportSensitivePOService.getById(temp.getId()).getNeedGovernance();
}
//添加治理评估文件,需先判断入网评估是否审核通过
List<UserReportNormalPO> list = userReportNormalMapper.selectList(new LambdaQueryWrapper<UserReportNormalPO>()
.eq(UserReportNormalPO::getUserReportId, temp.getId())
.eq(UserReportNormalPO::getState, DataStateEnum.ENABLE.getCode())
.ne(UserReportNormalPO::getStatus, BpmTaskStatusEnum.CANCEL.getStatus())
.orderByDesc(UserReportNormalPO::getCreateTime)
);
if (CollUtil.isNotEmpty(list)) {
Optional<UserReportNormalPO> netInReport = list.stream().filter(x -> 0 == x.getType()).findFirst();
if(netInReport.isPresent()){
if(netInReport.get().getStatus()!=2){
throw new BusinessException("最新入网验收方案流程,暂未审核通过!");
}
}else{
throw new BusinessException("请填写入网验收方案流程,审核通过后方可操作!");
}
if (needGovernance == 1) {
Optional<UserReportNormalPO> governReport = list.stream().filter(x -> 1 == x.getType()).findFirst();
if(governReport.isPresent()){
if(governReport.get().getStatus()!=2){
throw new BusinessException("最新治理工程验收方案流程,暂未审核通过!");
}
}else{
throw new BusinessException("请填写治理工程验收方案流程,审核通过后方可操作!");
}
}
} else {
throw new BusinessException("请上传,入网设计方案或者治理工程验收方案");
}
//获取关联的设备信息 //获取关联的设备信息
SupervisionTempDeviceReport tempDevice = supervisionTempDeviceReportService.getById(tempLine.getMonitoringTerminalCode()); SupervisionTempDeviceReport tempDevice = supervisionTempDeviceReportService.getById(tempLine.getMonitoringTerminalCode());

View File

@@ -361,7 +361,7 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
} }
warningLeafletVOQueryWrapper warningLeafletVOQueryWrapper
.eq("supervision_warning_leaflet.state", DataStateEnum.ENABLE.getCode()) .eq("supervision_warning_leaflet.state", DataStateEnum.ENABLE.getCode())
.in("supervision_warning_leaflet.status", Arrays.asList(3,4,5)) .ne("supervision_warning_leaflet.status", 2)
.orderByDesc("supervision_warning_leaflet.Update_Time"); .orderByDesc("supervision_warning_leaflet.Update_Time");
Page<WarningLeafletVO> warningLeafletVOPage = this.baseMapper.alarmPageData(new Page<>(PageFactory.getPageNum(warningLeafletQueryParam), PageFactory.getPageSize(warningLeafletQueryParam)), warningLeafletVOQueryWrapper); Page<WarningLeafletVO> warningLeafletVOPage = this.baseMapper.alarmPageData(new Page<>(PageFactory.getPageNum(warningLeafletQueryParam), PageFactory.getPageSize(warningLeafletQueryParam)), warningLeafletVOQueryWrapper);
//目前仅知道现场测试超标会有附件 //目前仅知道现场测试超标会有附件

View File

@@ -14,7 +14,6 @@ import com.njcn.bpm.pojo.dto.BpmInstanceInfo;
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO; import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam; import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
import com.njcn.common.pojo.enums.common.DataStateEnum; import com.njcn.common.pojo.enums.common.DataStateEnum;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.supervision.enums.SupervisionKeyEnum; import com.njcn.supervision.enums.SupervisionKeyEnum;
import com.njcn.supervision.mapper.user.UserReportNormalMapper; import com.njcn.supervision.mapper.user.UserReportNormalMapper;
import com.njcn.supervision.pojo.param.user.UserReportNormalParam; import com.njcn.supervision.pojo.param.user.UserReportNormalParam;
@@ -57,26 +56,6 @@ public class UserReportNormalServiceImpl extends ServiceImpl<UserReportNormalMap
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public String addUserNormal(UserReportNormalParam userReportNormalParam) { public String addUserNormal(UserReportNormalParam userReportNormalParam) {
//添加治理评估文件,需先判断入网评估是否审核通过
if (1 == userReportNormalParam.getType()) {
List<UserReportNormalPO> list = this.list(new LambdaQueryWrapper<UserReportNormalPO>()
.eq(UserReportNormalPO::getUserReportId, userReportNormalParam.getUserReportId())
.eq(UserReportNormalPO::getState, DataStateEnum.ENABLE.getCode())
.ne(UserReportNormalPO::getStatus, BpmTaskStatusEnum.CANCEL.getStatus())
.eq(UserReportNormalPO::getType, 0)
.orderByDesc(UserReportNormalPO::getCreateTime)
);
if(CollUtil.isNotEmpty(list)){
List<String> collect = list.stream().filter(x -> Objects.equals(x.getStatus(), BpmTaskStatusEnum.APPROVE.getStatus()))
.map(UserReportNormalPO::getId)
.collect(Collectors.toList());
if(CollUtil.isNotEmpty(collect)){
throw new BusinessException("入网方案申请未都通过!");
}
}else{
throw new BusinessException("请先进行入网方案申请!");
}
}
UserReportNormalPO userReportNormalPO = new UserReportNormalPO(); UserReportNormalPO userReportNormalPO = new UserReportNormalPO();
BeanUtil.copyProperties(userReportNormalParam, userReportNormalPO); BeanUtil.copyProperties(userReportNormalParam, userReportNormalPO);
userReportNormalPO.setState(DataStateEnum.ENABLE.getCode()); userReportNormalPO.setState(DataStateEnum.ENABLE.getCode());
@@ -143,13 +122,10 @@ public class UserReportNormalServiceImpl extends ServiceImpl<UserReportNormalMap
@Override @Override
public Page<UserReportVO.UserReportGoNetVO> userReportGoNetPage(UserReportNormalParam userReportNormalParam) { public Page<UserReportVO.UserReportGoNetVO> userReportGoNetPage(UserReportNormalParam userReportNormalParam) {
Page<UserReportVO.UserReportGoNetVO> pageResult = new Page<>(); Page<UserReportVO.UserReportGoNetVO> pageResult = new Page<>();
List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData(); List<String> colleaguesIds = userFeignClient.getColleaguesIdByUserId(RequestUtil.getUserIndex()).getData();
if (CollUtil.isEmpty(colleaguesIds)) { if (CollUtil.isEmpty(colleaguesIds)) {
return pageResult; return pageResult;
} }
LambdaQueryWrapper<UserReportNormalPO> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<UserReportNormalPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.orderByDesc(UserReportNormalPO::getCreateTime) lambdaQueryWrapper.orderByDesc(UserReportNormalPO::getCreateTime)
.eq(UserReportNormalPO::getType, userReportNormalParam.getType()) .eq(UserReportNormalPO::getType, userReportNormalParam.getType())

View File

@@ -361,8 +361,10 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
.eq(UserReportNormalPO::getState, DataStateEnum.ENABLE.getCode()) .eq(UserReportNormalPO::getState, DataStateEnum.ENABLE.getCode())
.orderByDesc(UserReportNormalPO::getCreateTime) .orderByDesc(UserReportNormalPO::getCreateTime)
); );
userReportVO.setNetInReport(list.stream().filter(x -> 0==x.getType()).map(UserReportNormalPO::getReportUrl).collect(Collectors.toList())); Optional<String> netInReport = list.stream().filter(x -> 0 == x.getType()).map(UserReportNormalPO::getReportUrl).findFirst();
userReportVO.setGovernReport(list.stream().filter(x -> 1==x.getType()).map(UserReportNormalPO::getReportUrl).collect(Collectors.toList())); Optional<String> governReport = list.stream().filter(x -> 1 == x.getType()).map(UserReportNormalPO::getReportUrl).findFirst();
userReportVO.setNetInReport(Arrays.asList(netInReport.isPresent() ? netInReport.get() : null));
userReportVO.setGovernReport(Arrays.asList(governReport.isPresent() ? governReport.get() : null));
return userReportVO; return userReportVO;
} }
@@ -462,8 +464,29 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
// 敏感及重要用户 // 敏感及重要用户
needGovernance = userReportSensitivePOService.getById(temp.getId()).getNeedGovernance(); needGovernance = userReportSensitivePOService.getById(temp.getId()).getNeedGovernance();
} }
temp.setNeedGovernance(needGovernance); temp.setNeedGovernance(needGovernance);
//添加治理评估文件,需先判断入网评估是否审核通过
Boolean type = true;
if (1 == temp.getNeedGovernance()) {
List<UserReportNormalPO> list = userReportNormalMapper.selectList(new LambdaQueryWrapper<UserReportNormalPO>()
.eq(UserReportNormalPO::getUserReportId, temp.getId())
.eq(UserReportNormalPO::getState, DataStateEnum.ENABLE.getCode())
.ne(UserReportNormalPO::getStatus, BpmTaskStatusEnum.CANCEL.getStatus())
.eq(UserReportNormalPO::getType, 0)
.orderByDesc(UserReportNormalPO::getCreateTime)
);
if (CollUtil.isNotEmpty(list)) {
List<String> collect = list.stream().filter(x -> !Objects.equals(x.getStatus(), BpmTaskStatusEnum.APPROVE.getStatus()))
.map(UserReportNormalPO::getId)
.collect(Collectors.toList());
if (CollUtil.isNotEmpty(collect)) {
type = false;
}
} else {
type = false;
}
}
temp.setType(type);
}); });
return page; return page;
} }