工作流程审核不通过、预告警单处理、终端周期检测等需求
1、提交了主pom,因为需要引入达梦数据量; 2、提交了gateway的配置文件,因为部分接口没有添加到权限中,待后续增加后再注释
This commit is contained in:
@@ -3,11 +3,14 @@ package com.njcn.supervision.service.device;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||
import com.njcn.bpm.pojo.vo.TodoVO;
|
||||
import com.njcn.bpm.service.IBpmService;
|
||||
import com.njcn.supervision.pojo.param.device.CheckDeviceParam;
|
||||
import com.njcn.supervision.pojo.po.device.CheckDevice;
|
||||
import com.njcn.supervision.pojo.vo.device.CheckDeviceVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 终端周期检测表 服务类
|
||||
@@ -41,4 +44,6 @@ public interface ICheckDeviceService extends IBpmService<CheckDevice> {
|
||||
* 取消
|
||||
*/
|
||||
String cancel(BpmProcessInstanceCancelParam cancelReqVO);
|
||||
|
||||
List<TodoVO> getTodoBusiness();
|
||||
}
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
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.LocalDateTimeUtil;
|
||||
import cn.hutool.core.text.StrPool;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
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.extension.plugins.pagination.Page;
|
||||
import com.github.jeffreyning.mybatisplus.service.MppServiceImpl;
|
||||
@@ -15,6 +18,8 @@ import com.njcn.bpm.enums.BpmTaskStatusEnum;
|
||||
import com.njcn.bpm.pojo.dto.BpmInstanceInfo;
|
||||
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||
import com.njcn.bpm.pojo.vo.TodoVO;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.db.constant.DbConstant;
|
||||
import com.njcn.device.biz.commApi.CommTerminalGeneralClient;
|
||||
import com.njcn.device.biz.pojo.dto.LineDevGetDTO;
|
||||
@@ -40,10 +45,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -121,12 +123,12 @@ public class CheckDeviceServiceImpl extends MppServiceImpl<CheckDeviceMapper, Ch
|
||||
queryWrapper.orderBy(true, param.getOrderBy().equalsIgnoreCase(DbConstant.ASC), StrUtil.toUnderlineCase(param.getSortBy()));
|
||||
} else {
|
||||
//默认根据逾期天数排序
|
||||
queryWrapper.orderBy(true, false, "A.overdue_day");
|
||||
queryWrapper.orderBy(true, false, "A.overdue_day").orderBy(true, false, "A.status");
|
||||
}
|
||||
queryWrapper.and(wrapper ->
|
||||
wrapper.isNull("A.status")
|
||||
.or()
|
||||
.eq(ObjUtil.isNotNull(param.getStatus()),"A.status", param.getStatus())
|
||||
.eq(ObjUtil.isNotNull(param.getStatus()), "A.status", param.getStatus())
|
||||
);
|
||||
if (!Objects.isNull(param.getState())) {
|
||||
queryWrapper.eq("A.state", param.getState());
|
||||
@@ -156,6 +158,7 @@ public class CheckDeviceServiceImpl extends MppServiceImpl<CheckDeviceMapper, Ch
|
||||
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||
String processInstanceId = bpmProcessFeignClient.createProcessInstance(RequestUtil.getUserIndex(), bpmProcessInstanceCreateReqDTO).getData();
|
||||
// 将工作流的编号,更新到流程单中
|
||||
checkDevice.setState(1);
|
||||
checkDevice.setProcessInstanceId(processInstanceId);
|
||||
checkDevice.setDescription(param.getDescription());
|
||||
checkDevice.setCreateBy(RequestUtil.getUserIndex());
|
||||
@@ -200,25 +203,69 @@ public class CheckDeviceServiceImpl extends MppServiceImpl<CheckDeviceMapper, Ch
|
||||
return checkDevice.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TodoVO> getTodoBusiness() {
|
||||
List<TodoVO> todoVOList = new ArrayList<>();
|
||||
QueryWrapper<CheckDeviceVo> queryWrapper = new QueryWrapper<>();
|
||||
DeptGetLineParam deptGetLineParam = new DeptGetLineParam();
|
||||
deptGetLineParam.setDeptId(RequestUtil.getDeptIndex());
|
||||
List<String> devList = commTerminalGeneralClient.deptGetDevice(deptGetLineParam)
|
||||
.getData()
|
||||
.stream()
|
||||
.flatMap(item -> item.getDeviceList().stream())
|
||||
.map(LineDevGetDTO::getDevId)
|
||||
.distinct()
|
||||
.collect(Collectors.toList());
|
||||
if (CollUtil.isNotEmpty(devList)) {
|
||||
queryWrapper.in("A.device_id", devList);
|
||||
}else{
|
||||
return new ArrayList<>();
|
||||
}
|
||||
//查询出今天之前要待检的终端
|
||||
queryWrapper.le("A.check_time", LocalDate.now())
|
||||
.eq("A.state", 0);
|
||||
List<CheckDeviceVo> checkDeviceVoList = this.baseMapper.selectVOList(queryWrapper);
|
||||
if (CollUtil.isNotEmpty(checkDeviceVoList)) {
|
||||
todoVOList = checkDeviceVoList.stream().map(item -> {
|
||||
TodoVO todoVO = new TodoVO();
|
||||
todoVO.setId(item.getId());
|
||||
todoVO.setTaskName("终端周期定检");
|
||||
todoVO.setTaskContent("变电站:".concat(item.getSubstation())
|
||||
.concat(",装置:").concat(item.getDeviceName())
|
||||
.concat(",本次定检时间为:").concat(LocalDateTimeUtil.format(item.getThisTimeCheck(),DatePattern.NORM_DATE_PATTERN))
|
||||
.concat(",逾期:").concat(String.valueOf(item.getOverdueDay()))
|
||||
.concat("天")
|
||||
);
|
||||
todoVO.setStartUser("系统扫描");
|
||||
todoVO.setTaskCreateTime(item.getCreateTime());
|
||||
todoVO.setSource(3);
|
||||
todoVO.setRoutePath("");
|
||||
return todoVO;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
return todoVOList;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateProcessStatus(String businessId, Integer status) {
|
||||
//流程状态整改
|
||||
CheckDevice checkDevice = this.baseMapper.selectById(businessId);
|
||||
checkDevice.setStatus(status);
|
||||
checkDevice.setState(1);
|
||||
checkDevice.setState(2);
|
||||
this.updateById(checkDevice);
|
||||
//修改pq_device定检时间和下次定检时间 5年
|
||||
String nowCheckTime = checkDevice.getNowCheckTime().format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||
String nextCheckTime = checkDevice.getNowCheckTime().plusYears(5).format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATE_PATTERN));
|
||||
deviceFeignClient.updateDevCheckTime(checkDevice.getDeviceId(),nowCheckTime,nextCheckTime);
|
||||
deviceFeignClient.updateDevCheckTime(checkDevice.getDeviceId(), nowCheckTime, nextCheckTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BpmInstanceInfo getInstanceInfo(String businessId) {
|
||||
BpmInstanceInfo bpmInstanceInfo= null;
|
||||
BpmInstanceInfo bpmInstanceInfo = null;
|
||||
CheckDeviceVo checkDevice = this.getInfoById(businessId);
|
||||
if(ObjUtil.isNotNull(checkDevice)) {
|
||||
if (ObjUtil.isNotNull(checkDevice)) {
|
||||
bpmInstanceInfo = new BpmInstanceInfo();
|
||||
bpmInstanceInfo.setHistoryInstanceId(checkDevice.getHistoryInstanceId());
|
||||
String sign = checkDevice.getDept()
|
||||
@@ -230,4 +277,20 @@ public class CheckDeviceServiceImpl extends MppServiceImpl<CheckDeviceMapper, Ch
|
||||
}
|
||||
return bpmInstanceInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getAllRejectInstanceIds() {
|
||||
Set<String> rejectInstanceIds = new HashSet<>();
|
||||
// 查询所有走了流程,但是流程状态为不通过的流程实例id
|
||||
LambdaQueryWrapper<CheckDevice> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(CheckDevice::getCreateBy, RequestUtil.getUserIndex())
|
||||
.eq(CheckDevice::getStatus, BpmProcessInstanceStatusEnum.REJECT.getStatus())
|
||||
.select(CheckDevice::getProcessInstanceId);
|
||||
List<CheckDevice> checkDevices = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
List<String> result = checkDevices.stream().map(CheckDevice::getProcessInstanceId).collect(Collectors.toList());
|
||||
if(CollectionUtil.isNotEmpty(result)){
|
||||
rejectInstanceIds.addAll(result);
|
||||
}
|
||||
return rejectInstanceIds;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,6 +266,23 @@ public class QuitRunningDeviceServiceImpl extends ServiceImpl<QuitRunningDeviceM
|
||||
return bpmInstanceInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getAllRejectInstanceIds() {
|
||||
Set<String> rejectInstanceIds = new HashSet<>();
|
||||
//查询当前用户创建的createBy的流程审核不通过的
|
||||
LambdaQueryWrapper<QuitRunningDevice> deviceLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
deviceLambdaQueryWrapper.eq(QuitRunningDevice::getCreateBy, RequestUtil.getUserIndex())
|
||||
.eq(QuitRunningDevice::getStatus, BpmProcessInstanceStatusEnum.REJECT.getStatus())
|
||||
.eq(QuitRunningDevice::getState, DataStateEnum.ENABLE.getCode())
|
||||
.select(QuitRunningDevice::getProcessInstanceId);
|
||||
List<QuitRunningDevice> quitRunningDevices = this.baseMapper.selectList(deviceLambdaQueryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(quitRunningDevices)) {
|
||||
List<String> result = quitRunningDevices.stream().map(QuitRunningDevice::getProcessInstanceId).collect(Collectors.toList());
|
||||
rejectInstanceIds.addAll(result);
|
||||
}
|
||||
return rejectInstanceIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public QuitRunningDeviceVO getVOById(String id) {
|
||||
QuitRunningDevice quitRunningDevice = this.baseMapper.selectById(id);
|
||||
|
||||
@@ -40,6 +40,7 @@ import com.njcn.supervision.mapper.device.SupervisionDevMainReportPOMapper;
|
||||
import com.njcn.supervision.pojo.dto.SupervisionDevMainReportExcel;
|
||||
import com.njcn.supervision.pojo.param.device.SupervisionDevMainReportParam;
|
||||
import com.njcn.supervision.pojo.param.device.SupervisionTempDeviceReportParam;
|
||||
import com.njcn.supervision.pojo.po.device.QuitRunningDevice;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport;
|
||||
import com.njcn.supervision.pojo.po.user.UserReportPO;
|
||||
@@ -265,6 +266,23 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
return bpmInstanceInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getAllRejectInstanceIds() {
|
||||
Set<String> rejectInstanceIds = new HashSet<>();
|
||||
//查询当前用户创建的createBy的流程审核不通过的
|
||||
LambdaQueryWrapper<SupervisionDevMainReportPO> supervisionDevMainReportPOLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
supervisionDevMainReportPOLambdaQueryWrapper.eq(SupervisionDevMainReportPO::getCreateBy, RequestUtil.getUserIndex())
|
||||
.eq(SupervisionDevMainReportPO::getStatus, BpmProcessInstanceStatusEnum.REJECT.getStatus())
|
||||
.eq(SupervisionDevMainReportPO::getState, DataStateEnum.ENABLE.getCode())
|
||||
.select(SupervisionDevMainReportPO::getProcessInstanceId);
|
||||
List<SupervisionDevMainReportPO> supervisionDevMainReportPOS = this.baseMapper.selectList(supervisionDevMainReportPOLambdaQueryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(supervisionDevMainReportPOS)) {
|
||||
List<String> result = supervisionDevMainReportPOS.stream().map(SupervisionDevMainReportPO::getProcessInstanceId).collect(Collectors.toList());
|
||||
rejectInstanceIds.addAll(result);
|
||||
}
|
||||
return rejectInstanceIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String cancelDevMainReport(BpmProcessInstanceCancelParam cancelReqVO) {
|
||||
//准备取消该流程,需要远程调用接口
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.njcn.supervision.enums.UserNatureEnum;
|
||||
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.po.device.SupervisionDevMainReportPO;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
||||
@@ -329,6 +330,22 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
return bpmInstanceInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getAllRejectInstanceIds() {
|
||||
Set<String> rejectInstanceIds = new HashSet<>();
|
||||
LambdaQueryWrapper<SupervisionTempLineDebugPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(SupervisionTempLineDebugPO::getCreateBy, RequestUtil.getUserIndex())
|
||||
.eq(SupervisionTempLineDebugPO::getStatus, BpmProcessInstanceStatusEnum.REJECT.getStatus())
|
||||
.eq(SupervisionTempLineDebugPO::getState, DataStateEnum.ENABLE.getCode())
|
||||
.select(SupervisionTempLineDebugPO::getProcessInstanceId);
|
||||
List<SupervisionTempLineDebugPO> supervisionTempLineDebugPOS = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(supervisionTempLineDebugPOS)) {
|
||||
List<String> result = supervisionTempLineDebugPOS.stream().map(SupervisionTempLineDebugPO::getProcessInstanceId).collect(Collectors.toList());
|
||||
rejectInstanceIds.addAll(result);
|
||||
}
|
||||
return rejectInstanceIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* @Description: 临时表台账数据同步到实际表中
|
||||
* @Param:
|
||||
|
||||
@@ -231,6 +231,23 @@ public class SupervisionTempLineReportServiceImpl extends ServiceImpl<Supervisio
|
||||
return bpmInstanceInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getAllRejectInstanceIds() {
|
||||
Set<String> rejectInstanceIds = new HashSet<>();
|
||||
//查询当前用户创建的createBy的流程审核不通过的
|
||||
LambdaQueryWrapper<SupervisionTempLineReport> supervisionTempLineReportLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
supervisionTempLineReportLambdaQueryWrapper.eq(SupervisionTempLineReport::getCreateBy, RequestUtil.getUserIndex())
|
||||
.eq(SupervisionTempLineReport::getStatus, BpmProcessInstanceStatusEnum.REJECT.getStatus())
|
||||
.eq(SupervisionTempLineReport::getState, DataStateEnum.ENABLE.getCode())
|
||||
.select(SupervisionTempLineReport::getProcessInstanceId);
|
||||
List<SupervisionTempLineReport> supervisionTempLineReports = this.baseMapper.selectList(supervisionTempLineReportLambdaQueryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(supervisionTempLineReports)) {
|
||||
List<String> result = supervisionTempLineReports.stream().map(SupervisionTempLineReport::getProcessInstanceId).collect(Collectors.toList());
|
||||
rejectInstanceIds.addAll(result);
|
||||
}
|
||||
return rejectInstanceIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String cancelTempLineReport(BpmProcessInstanceCancelParam cancelReqVO) {
|
||||
//准备取消该流程,需要远程调用接口
|
||||
|
||||
@@ -37,6 +37,7 @@ import com.njcn.supervision.enums.SupervisionUserStatusEnum;
|
||||
import com.njcn.supervision.mapper.device.SupervisionTempLineReportMapper;
|
||||
import com.njcn.supervision.mapper.device.SupervisionTempLineRunTestMapper;
|
||||
import com.njcn.supervision.pojo.param.device.SupervisionTempLineRunTestParam;
|
||||
import com.njcn.supervision.pojo.po.device.CheckDevice;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineRunTestPO;
|
||||
import com.njcn.supervision.pojo.po.device.TempLineRunTestWarning;
|
||||
@@ -360,6 +361,23 @@ public class SupervisionTempLineRunTestServiceImpl extends ServiceImpl<Supervisi
|
||||
return bpmInstanceInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getAllRejectInstanceIds() {
|
||||
Set<String> rejectInstanceIds = new HashSet<>();
|
||||
// 查询所有走了流程,但是流程状态为不通过的流程实例id
|
||||
LambdaQueryWrapper<SupervisionTempLineRunTestPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(SupervisionTempLineRunTestPO::getCreateBy, RequestUtil.getUserIndex())
|
||||
.eq(SupervisionTempLineRunTestPO::getStatus, BpmProcessInstanceStatusEnum.REJECT.getStatus())
|
||||
.eq(SupervisionTempLineRunTestPO::getState, DataStateEnum.ENABLE.getCode())
|
||||
.select(SupervisionTempLineRunTestPO::getProcessInstanceId);
|
||||
List<SupervisionTempLineRunTestPO> supervisionTempLineRunTestPOList = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
List<String> result = supervisionTempLineRunTestPOList.stream().map(SupervisionTempLineRunTestPO::getProcessInstanceId).collect(Collectors.toList());
|
||||
if(CollectionUtil.isNotEmpty(result)){
|
||||
rejectInstanceIds.addAll(result);
|
||||
}
|
||||
return rejectInstanceIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SupervisionTempLineRunTestVO getRunTestById(String id) {
|
||||
return this.baseMapper.getRunTestInfo(id);
|
||||
@@ -406,4 +424,5 @@ public class SupervisionTempLineRunTestServiceImpl extends ServiceImpl<Supervisi
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.supervision.service.leaflet;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||
import com.njcn.bpm.pojo.vo.TodoVO;
|
||||
import com.njcn.bpm.service.IBpmService;
|
||||
import com.njcn.harmonic.pojo.dto.RMpPartHarmonicDetailDTO;
|
||||
import com.njcn.supervision.pojo.param.leaflet.WarningLeafletParam;
|
||||
@@ -58,4 +59,5 @@ public interface IWarningLeafletService extends IBpmService<WarningLeaflet> {
|
||||
|
||||
Boolean deleteWarningLeaflet(List<String> supervisionId);
|
||||
|
||||
List<TodoVO> getTodoBusiness();
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
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.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -18,6 +19,7 @@ import com.njcn.bpm.enums.BpmTaskStatusEnum;
|
||||
import com.njcn.bpm.pojo.dto.BpmInstanceInfo;
|
||||
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||
import com.njcn.bpm.pojo.vo.TodoVO;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.harmonic.pojo.dto.RMpPartHarmonicDetailDTO;
|
||||
@@ -25,6 +27,7 @@ import com.njcn.oss.utils.FileStorageUtil;
|
||||
import com.njcn.supervision.enums.*;
|
||||
import com.njcn.supervision.mapper.leaflet.WarningLeafletMapper;
|
||||
import com.njcn.supervision.pojo.param.leaflet.WarningLeafletParam;
|
||||
import com.njcn.supervision.pojo.po.device.CheckDevice;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineDebugPO;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineRunTestPO;
|
||||
import com.njcn.supervision.pojo.po.device.TempLineRunTestWarning;
|
||||
@@ -89,7 +92,7 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
* 不创建工作流,只是创建一个告警单,需要待用户反馈后才会进入流程
|
||||
*/
|
||||
@Override
|
||||
public String createLeaflet(String name, String deptId, String code, String id, Integer problemType, Integer leaflet, String issueDetail,String reformAdvice,String filePath) {
|
||||
public String createLeaflet(String name, String deptId, String code, String id, Integer problemType, Integer leaflet, String issueDetail, String reformAdvice, String filePath) {
|
||||
WarningLeaflet warningLeaflet = new WarningLeaflet();
|
||||
warningLeaflet.setLeafletName(name);
|
||||
warningLeaflet.setDeptId(deptId);
|
||||
@@ -141,7 +144,7 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
if (deptMap.containsKey(x.getDutyOrgId())) {
|
||||
x.setDutyOrgName(deptMap.get(x.getDutyOrgId()));
|
||||
}
|
||||
if (!Objects.isNull(x.getFilePath())){
|
||||
if (!Objects.isNull(x.getFilePath())) {
|
||||
x.setFilePath(fileStorageUtil.getFileUrl(x.getFilePath()));
|
||||
}
|
||||
});
|
||||
@@ -157,14 +160,14 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
warningLeaflet.setTakeStep(warningLeafletUpdateParam.getTakeStep());
|
||||
warningLeaflet.setReportPath(warningLeafletUpdateParam.getReportPath());
|
||||
//设置状态
|
||||
if(Objects.equals(warningLeafletUpdateParam.getSaveOrCheckflag(),"1")){
|
||||
if (Objects.equals(warningLeafletUpdateParam.getSaveOrCheckflag(), "1")) {
|
||||
warningLeaflet.setStatus(BpmTaskStatusEnum.WAIT.getStatus());
|
||||
|
||||
}else {
|
||||
} else {
|
||||
warningLeaflet.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
|
||||
}
|
||||
if(Objects.equals(warningLeafletUpdateParam.getSaveOrCheckflag(),"2")) {
|
||||
if (Objects.equals(warningLeafletUpdateParam.getSaveOrCheckflag(), "2")) {
|
||||
// 发起 BPM 流程
|
||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||
@@ -176,7 +179,7 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
// 将工作流的编号,更新到流程单中
|
||||
warningLeaflet.setProcessInstanceId(processInstanceId);
|
||||
}
|
||||
|
||||
warningLeaflet.setCreateBy(RequestUtil.getUserIndex());
|
||||
this.baseMapper.updateById(warningLeaflet);
|
||||
}
|
||||
|
||||
@@ -206,6 +209,7 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
warningLeaflet.setProcessInstanceId(processInstanceId);
|
||||
//保存历史流程id列表
|
||||
warningLeaflet.setHistoryInstanceId(historyInstanceIds);
|
||||
warningLeaflet.setCreateBy(RequestUtil.getUserIndex());
|
||||
this.baseMapper.updateById(warningLeaflet);
|
||||
return warningLeaflet.getId();
|
||||
}
|
||||
@@ -214,7 +218,7 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
public WarningLeafletVO getVOById(String id) {
|
||||
WarningLeaflet warningLeaflet = this.getById(id);
|
||||
WarningLeafletVO warningLeafletVO = new WarningLeafletVO();
|
||||
if (!Objects.isNull(warningLeaflet)){
|
||||
if (!Objects.isNull(warningLeaflet)) {
|
||||
BeanUtil.copyProperties(warningLeaflet, warningLeafletVO);
|
||||
if (StrUtil.isNotBlank(warningLeaflet.getDeptId())) {
|
||||
Dept dept = deptFeignClient.getDeptById(warningLeaflet.getDeptId()).getData();
|
||||
@@ -227,7 +231,7 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
//查询谐波普测,获取该普测计划上传的文件
|
||||
//查询到现场测试超标附件地址
|
||||
TempLineRunTestWarning byId = lineRunTestWarningService.getById(problemId);
|
||||
if(Objects.nonNull(byId)){
|
||||
if (Objects.nonNull(byId)) {
|
||||
warningLeafletVO.setProblemPath(byId.getTestRunReport());
|
||||
}
|
||||
}
|
||||
@@ -247,12 +251,12 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
if (Objects.nonNull(warningLeafletVO.getId())) {
|
||||
bpmInstanceInfo.setHistoryInstanceId(warningLeafletVO.getHistoryInstanceId());
|
||||
String type = "告警单";
|
||||
if(warningLeafletVO.getLeafletType() == 1){
|
||||
if (warningLeafletVO.getLeafletType() == 1) {
|
||||
type = "预警单";
|
||||
}
|
||||
String sign = "问题来源于".concat(ProblemTypeEnum.getNameByCode(warningLeafletVO.getProblemType()))
|
||||
.concat(",由单位")
|
||||
.concat(StrUtil.isBlank(warningLeafletVO.getDeptName())?"":warningLeafletVO.getDeptName())
|
||||
.concat(StrUtil.isBlank(warningLeafletVO.getDeptName()) ? "" : warningLeafletVO.getDeptName())
|
||||
.concat("负责的")
|
||||
.concat(warningLeafletVO.getLeafletName())
|
||||
.concat(type);
|
||||
@@ -261,6 +265,23 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
return bpmInstanceInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getAllRejectInstanceIds() {
|
||||
Set<String> rejectInstanceIds = new HashSet<>();
|
||||
// 查询所有走了流程,但是流程状态为不通过的流程实例id
|
||||
LambdaQueryWrapper<WarningLeaflet> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(WarningLeaflet::getCreateBy, RequestUtil.getUserIndex())
|
||||
.eq(WarningLeaflet::getStatus, BpmProcessInstanceStatusEnum.REJECT.getStatus())
|
||||
.eq(WarningLeaflet::getState, DataStateEnum.ENABLE.getCode())
|
||||
.select(WarningLeaflet::getProcessInstanceId);
|
||||
List<WarningLeaflet> warningLeaflets = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
List<String> result = warningLeaflets.stream().map(WarningLeaflet::getProcessInstanceId).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(result)) {
|
||||
rejectInstanceIds.addAll(result);
|
||||
}
|
||||
return rejectInstanceIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<WarningLeafletVO> alarmPageData(WarningLeafletParam.WarningLeafletQueryParam warningLeafletQueryParam) {
|
||||
QueryWrapper<WarningLeafletVO> warningLeafletVOQueryWrapper = new QueryWrapper<>();
|
||||
@@ -302,14 +323,14 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
if (record.getProblemType().equals(ProblemTypeEnum.SITE_TEST.getCode()) && StrUtil.isNotBlank(record.getProblemId())) {
|
||||
//查询到现场测试超标附件地址
|
||||
TempLineRunTestWarning byId = lineRunTestWarningService.getById(record.getProblemId());
|
||||
if(Objects.nonNull(byId)){
|
||||
if (Objects.nonNull(byId)) {
|
||||
record.setProblemPath(byId.getTestRunReport());
|
||||
}
|
||||
}
|
||||
if (deptMap.containsKey(record.getDutyOrgId())) {
|
||||
record.setDutyOrgName(deptMap.get(record.getDutyOrgId()));
|
||||
}
|
||||
if (!Objects.isNull(record.getFilePath())){
|
||||
if (!Objects.isNull(record.getFilePath())) {
|
||||
record.setFilePath(fileStorageUtil.getFileUrl(record.getFilePath()));
|
||||
}
|
||||
}
|
||||
@@ -386,14 +407,14 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
if (record.getProblemType().equals(ProblemTypeEnum.SITE_TEST.getCode()) && StrUtil.isNotBlank(record.getProblemId())) {
|
||||
//查询到现场测试超标附件地址
|
||||
TempLineRunTestWarning byId = lineRunTestWarningService.getById(record.getProblemId());
|
||||
if(Objects.nonNull(byId)){
|
||||
if (Objects.nonNull(byId)) {
|
||||
record.setProblemPath(byId.getTestRunReport());
|
||||
}
|
||||
}
|
||||
if (deptMap.containsKey(record.getDutyOrgId())) {
|
||||
record.setDutyOrgName(deptMap.get(record.getDutyOrgId()));
|
||||
}
|
||||
if (!Objects.isNull(record.getFilePath())){
|
||||
if (!Objects.isNull(record.getFilePath())) {
|
||||
record.setFilePath(fileStorageUtil.getFileUrl(record.getFilePath()));
|
||||
}
|
||||
}
|
||||
@@ -415,6 +436,43 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
.in(WarningLeaflet::getId, supervisionId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TodoVO> getTodoBusiness() {
|
||||
List<TodoVO> todoVOList = new ArrayList<>();
|
||||
QueryWrapper<WarningLeafletVO> queryWrapper = new QueryWrapper<>();
|
||||
List<String> deptIds = deptFeignClient.getDepSonIdtByDeptId(RequestUtil.getDeptIndex()).getData();
|
||||
if(CollectionUtil.isEmpty(deptIds)){
|
||||
return todoVOList;
|
||||
}
|
||||
queryWrapper.in("supervision_warning_leaflet.dept_id", deptIds)
|
||||
.eq("supervision_warning_leaflet.status", 5)
|
||||
.eq("supervision_warning_leaflet.state", DataStateEnum.ENABLE.getCode())
|
||||
.orderByDesc("supervision_warning_leaflet.Update_Time");
|
||||
List<WarningLeafletVO> warningLeafletVOList = this.baseMapper.getTodoBusiness(queryWrapper);
|
||||
if(CollectionUtil.isNotEmpty(warningLeafletVOList)){
|
||||
todoVOList = warningLeafletVOList.stream().map(item -> {
|
||||
TodoVO todoVO = new TodoVO();
|
||||
String title = "预警单";
|
||||
Integer tabValue = 3;
|
||||
if(item.getLeafletType()==2){
|
||||
title = "告警单";
|
||||
tabValue = 4;
|
||||
}
|
||||
todoVO.setTaskName(title);
|
||||
String problemType = ProblemTypeEnum.getNameByCode(item.getProblemType());
|
||||
todoVO.setTaskContent(item.getLeafletName());
|
||||
todoVO.setStartUser(problemType);
|
||||
todoVO.setId(item.getId());
|
||||
todoVO.setTaskCreateTime(item.getCreateTime());
|
||||
todoVO.setSource(3);
|
||||
todoVO.setRoutePath("");
|
||||
todoVO.setTabValue(tabValue);
|
||||
return todoVO;
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
return todoVOList;
|
||||
}
|
||||
|
||||
|
||||
private String assembleOverLimitInfo(RMpPartHarmonicDetailDTO rMpPartHarmonicDetailDTO) {
|
||||
String info = "";
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.njcn.supervision.service.plan.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
@@ -22,6 +23,7 @@ import com.njcn.common.utils.PubUtils;
|
||||
import com.njcn.supervision.enums.SupervisionKeyEnum;
|
||||
import com.njcn.supervision.mapper.plan.SupervisionPlanPOMapper;
|
||||
import com.njcn.supervision.pojo.param.plan.SupervisionPlanParam;
|
||||
import com.njcn.supervision.pojo.po.device.CheckDevice;
|
||||
import com.njcn.supervision.pojo.po.plan.SupervisionPlanPO;
|
||||
import com.njcn.supervision.pojo.po.plan.SupervisionProblemPO;
|
||||
import com.njcn.supervision.pojo.vo.plan.SupervisionPlanVO;
|
||||
@@ -41,10 +43,7 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
@@ -379,6 +378,23 @@ public class SupervisionPlanPOServiceImpl extends ServiceImpl<SupervisionPlanPOM
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getAllRejectInstanceIds() {
|
||||
Set<String> rejectInstanceIds = new HashSet<>();
|
||||
// 查询所有走了流程,但是流程状态为不通过的流程实例id
|
||||
LambdaQueryWrapper<SupervisionPlanPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(SupervisionPlanPO::getCreateBy, RequestUtil.getUserIndex())
|
||||
.eq(SupervisionPlanPO::getStatus, BpmProcessInstanceStatusEnum.REJECT.getStatus())
|
||||
.eq(SupervisionPlanPO::getState, DataStateEnum.ENABLE.getCode())
|
||||
.select(SupervisionPlanPO::getProcessInstanceId);
|
||||
List<SupervisionPlanPO> supervisionPlanPOS = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
List<String> result = supervisionPlanPOS.stream().map(SupervisionPlanPO::getProcessInstanceId).collect(Collectors.toList());
|
||||
if(CollectionUtil.isNotEmpty(result)){
|
||||
rejectInstanceIds.addAll(result);
|
||||
}
|
||||
return rejectInstanceIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
|
||||
@@ -327,6 +327,14 @@ public class SupervisionGeneralSurveyPlanPOServiceImpl extends ServiceImpl<Super
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 该流程暂时没有在页面体现出来
|
||||
*/
|
||||
@Override
|
||||
public Set<String> getAllRejectInstanceIds() {
|
||||
return new HashSet<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String cancelGeneralSurvey(BpmProcessInstanceCancelParam cancelReqVO) {
|
||||
//准备取消该流程,需要远程调用接口
|
||||
|
||||
@@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.text.StrPool;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
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.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -25,6 +26,7 @@ import com.njcn.supervision.enums.SupervisionKeyEnum;
|
||||
import com.njcn.supervision.enums.SupervisionResponseEnum;
|
||||
import com.njcn.supervision.mapper.survey.SurveyPlanMapper;
|
||||
import com.njcn.supervision.pojo.param.survey.SurveyPlanParam;
|
||||
import com.njcn.supervision.pojo.po.device.CheckDevice;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineRunTestPO;
|
||||
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
|
||||
@@ -275,6 +277,23 @@ public class SurveyPlanServiceImpl extends ServiceImpl<SurveyPlanMapper, SurveyP
|
||||
return bpmInstanceInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getAllRejectInstanceIds() {
|
||||
Set<String> rejectInstanceIds = new HashSet<>();
|
||||
// 查询所有走了流程,但是流程状态为不通过的流程实例id
|
||||
LambdaQueryWrapper<SurveyPlan> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(SurveyPlan::getCreateBy, RequestUtil.getUserIndex())
|
||||
.eq(SurveyPlan::getStatus, BpmProcessInstanceStatusEnum.REJECT.getStatus())
|
||||
.eq(SurveyPlan::getState, DataStateEnum.ENABLE.getCode())
|
||||
.select(SurveyPlan::getProcessInstanceId);
|
||||
List<SurveyPlan> surveyPlanList = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
List<String> result = surveyPlanList.stream().map(SurveyPlan::getProcessInstanceId).collect(Collectors.toList());
|
||||
if(CollectionUtil.isNotEmpty(result)){
|
||||
rejectInstanceIds.addAll(result);
|
||||
}
|
||||
return rejectInstanceIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SurveyPlanVO getVOById(String id) {
|
||||
SurveyPlan surveyPlan = this.baseMapper.selectById(id);
|
||||
|
||||
@@ -29,6 +29,7 @@ import com.njcn.supervision.enums.*;
|
||||
import com.njcn.supervision.mapper.survey.SurveyTestMapper;
|
||||
import com.njcn.supervision.pojo.param.leaflet.WarningAddParam;
|
||||
import com.njcn.supervision.pojo.param.survey.SurveyTestParam;
|
||||
import com.njcn.supervision.pojo.po.device.CheckDevice;
|
||||
import com.njcn.supervision.pojo.po.leaflet.WarningLeaflet;
|
||||
import com.njcn.supervision.pojo.po.survey.SurveyPlan;
|
||||
import com.njcn.supervision.pojo.po.survey.SurveyTest;
|
||||
@@ -230,6 +231,7 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
|
||||
|
||||
}
|
||||
surveyTest.setState(DataStateEnum.ENABLE.getCode());
|
||||
surveyTest.setCreateBy(RequestUtil.getUserIndex());
|
||||
// surveyTest.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
this.updateById(surveyTest);
|
||||
// 发起 BPM 流程
|
||||
@@ -328,6 +330,23 @@ public class SurveyTestServiceImpl extends ServiceImpl<SurveyTestMapper, SurveyT
|
||||
return bpmInstanceInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getAllRejectInstanceIds() {
|
||||
Set<String> rejectInstanceIds = new HashSet<>();
|
||||
// 查询所有走了流程,但是流程状态为不通过的流程实例id
|
||||
LambdaQueryWrapper<SurveyTest> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(SurveyTest::getCreateBy, RequestUtil.getUserIndex())
|
||||
.eq(SurveyTest::getStatus, BpmProcessInstanceStatusEnum.REJECT.getStatus())
|
||||
.eq(SurveyTest::getState, DataStateEnum.ENABLE.getCode())
|
||||
.select(SurveyTest::getProcessInstanceId);
|
||||
List<SurveyTest> surveyTestList = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
List<String> result = surveyTestList.stream().map(SurveyTest::getProcessInstanceId).collect(Collectors.toList());
|
||||
if(CollectionUtil.isNotEmpty(result)){
|
||||
rejectInstanceIds.addAll(result);
|
||||
}
|
||||
return rejectInstanceIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SurveyTestVO getVOById(String id) {
|
||||
SurveyTestVO surveyTestVO = new SurveyTestVO();
|
||||
|
||||
@@ -31,4 +31,5 @@ public interface IUserReportNormalService extends IBpmService<UserReportNormalPO
|
||||
|
||||
String cancelUserReport(BpmProcessInstanceCancelParam cancelReqVO);
|
||||
|
||||
UserReportVO.UserReportListVO getUserReportByFangAnId(String id);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,8 @@ public interface UserReportPOService extends IBpmService<UserReportPO> {
|
||||
|
||||
Page<UserReportVO> getUserReport(UserReportParam.UserReportQueryParam userReportQueryParam);
|
||||
|
||||
UserReportVO getUserReportById(String id);
|
||||
|
||||
Boolean removeUserReport(List<String> ids);
|
||||
|
||||
UserReportVO.UserReportListVO getVOById(String id);
|
||||
|
||||
@@ -29,10 +29,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@@ -117,6 +114,15 @@ public class UserReportDeleteServiceImpl extends ServiceImpl<UserReportPOMapper,
|
||||
return bpmInstanceInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 该流程不需要了 by 吴瑞
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public Set<String> getAllRejectInstanceIds() {
|
||||
return new HashSet<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public String addEditor(UserReportParam userReportParam) {
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.njcn.supervision.service.user.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -15,15 +16,17 @@ import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||
import com.njcn.supervision.enums.SupervisionKeyEnum;
|
||||
import com.njcn.supervision.enums.UserNatureEnum;
|
||||
import com.njcn.supervision.mapper.user.UserReportNormalMapper;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportNormalParam;
|
||||
import com.njcn.supervision.pojo.po.user.UserReportNormalPO;
|
||||
import com.njcn.supervision.pojo.po.user.UserReportPO;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
||||
import com.njcn.supervision.pojo.po.user.*;
|
||||
import com.njcn.supervision.pojo.vo.user.UserReportVO;
|
||||
import com.njcn.supervision.service.user.IUserReportNormalService;
|
||||
import com.njcn.supervision.service.user.UserReportPOService;
|
||||
import com.njcn.supervision.service.user.*;
|
||||
import com.njcn.supervision.utils.InstanceUtil;
|
||||
import com.njcn.user.api.DeptFeignClient;
|
||||
import com.njcn.user.api.UserFeignClient;
|
||||
import com.njcn.user.pojo.vo.UserVO;
|
||||
import com.njcn.web.factory.PageFactory;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -49,8 +52,12 @@ public class UserReportNormalServiceImpl extends ServiceImpl<UserReportNormalMap
|
||||
|
||||
|
||||
private final BpmProcessFeignClient bpmProcessFeignClient;
|
||||
private final UserReportProjectPOService userReportProjectPOService;
|
||||
private final UserReportSubstationPOService userReportSubstationPOService;
|
||||
private final UserReportSensitivePOService userReportSensitivePOService;
|
||||
private final UserReportPOService userReportPOService;
|
||||
private final UserFeignClient userFeignClient;
|
||||
private final DeptFeignClient deptFeignClient;
|
||||
|
||||
|
||||
@Override
|
||||
@@ -66,6 +73,7 @@ public class UserReportNormalServiceImpl extends ServiceImpl<UserReportNormalMap
|
||||
userReportNormalPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||
|
||||
}
|
||||
userReportNormalPO.setCreateBy(RequestUtil.getUserIndex());
|
||||
this.saveOrUpdate(userReportNormalPO);
|
||||
userReportNormalPO = this.getById(userReportNormalPO.getId());
|
||||
if (Objects.equals(userReportNormalParam.getSaveOrCheckflag(), "2")) {
|
||||
@@ -188,6 +196,24 @@ public class UserReportNormalServiceImpl extends ServiceImpl<UserReportNormalMap
|
||||
return bpmInstanceInfo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Set<String> getAllRejectInstanceIds() {
|
||||
Set<String> rejectInstanceIds = new HashSet<>();
|
||||
//查询当前用户创建的createBy的流程审核不通过的
|
||||
LambdaQueryWrapper<UserReportNormalPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(UserReportNormalPO::getCreateBy, RequestUtil.getUserIndex())
|
||||
.eq(UserReportNormalPO::getStatus, BpmProcessInstanceStatusEnum.REJECT.getStatus())
|
||||
.eq(UserReportNormalPO::getState, DataStateEnum.ENABLE.getCode())
|
||||
.select(UserReportNormalPO::getProcessInstanceId);
|
||||
List<UserReportNormalPO> userReportNormalPOList = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
if (CollectionUtil.isNotEmpty(userReportNormalPOList)) {
|
||||
List<String> result = userReportNormalPOList.stream().map(UserReportNormalPO::getProcessInstanceId).collect(Collectors.toList());
|
||||
rejectInstanceIds.addAll(result);
|
||||
}
|
||||
return rejectInstanceIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String cancelUserReport(BpmProcessInstanceCancelParam cancelReqVO) {
|
||||
//准备取消该流程,需要远程调用接口
|
||||
@@ -201,4 +227,58 @@ public class UserReportNormalServiceImpl extends ServiceImpl<UserReportNormalMap
|
||||
this.updateById(userReportNormalPO);
|
||||
return userReportNormalPO.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserReportVO.UserReportListVO getUserReportByFangAnId(String id) {
|
||||
UserReportNormalPO userReportNormalServiceById = this.getById(id);
|
||||
UserReportVO.UserReportListVO userReportVO = new UserReportVO.UserReportListVO();
|
||||
UserReportPO userReportPO = userReportPOService.getById(userReportNormalServiceById.getUserReportId());
|
||||
//复制基础信息
|
||||
BeanUtil.copyProperties(userReportPO, userReportVO);
|
||||
//处理特殊字段,用户名、部门名
|
||||
UserVO userVO = userFeignClient.getUserById(userReportPO.getReporter()).getData();
|
||||
userReportVO.setReporter(userVO.getName());
|
||||
userReportVO.setOrgName(deptFeignClient.getDeptById(userReportPO.getOrgId()).getData().getName());
|
||||
/*
|
||||
根据用户性质获取自己特有的字段,此处需要特殊处理
|
||||
1、每个附件需要返回文件名称以及可以预览的url
|
||||
todo...by黄正剑
|
||||
*/
|
||||
if (
|
||||
CollectionUtil.newArrayList(
|
||||
UserNatureEnum.BUILD_POWER_GRID.getCode(),
|
||||
UserNatureEnum.EXTEND_POWER_GRID.getCode()
|
||||
).contains(userReportPO.getUserType())) {
|
||||
//电网工程类用户额外数据
|
||||
UserReportProjectPO byId = userReportProjectPOService.getById(userReportNormalServiceById.getUserReportId());
|
||||
userReportVO.setUserReportProjectPO(byId);
|
||||
|
||||
} 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(userReportPO.getUserType())) {
|
||||
//非线性负荷用户 & 新能源发电站用户
|
||||
UserReportSubstationPO byId = userReportSubstationPOService.getById(userReportNormalServiceById.getUserReportId());
|
||||
userReportSubstationPOService.saveOrUpdate(byId);
|
||||
userReportVO.setUserReportSubstationPO(byId);
|
||||
} else if (UserNatureEnum.SENSITIVE_USER.getCode().equals(userReportPO.getUserType())) {
|
||||
// 敏感及重要用户
|
||||
UserReportSensitivePO byId = userReportSensitivePOService.getById(userReportNormalServiceById.getUserReportId());
|
||||
userReportVO.setUserReportSensitivePO(byId);
|
||||
}
|
||||
List<UserReportNormalPO> list = this.baseMapper.selectList(new LambdaQueryWrapper<UserReportNormalPO>()
|
||||
.eq(UserReportNormalPO::getUserReportId, userReportNormalServiceById.getUserReportId())
|
||||
.eq(UserReportNormalPO::getStatus, BpmTaskStatusEnum.APPROVE.getStatus())
|
||||
.eq(UserReportNormalPO::getState, DataStateEnum.ENABLE.getCode())
|
||||
.orderByDesc(UserReportNormalPO::getCreateTime)
|
||||
);
|
||||
Optional<String> netInReport = list.stream().filter(x -> 0 == x.getType()).map(UserReportNormalPO::getReportUrl).findFirst();
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ import com.njcn.supervision.mapper.user.UserReportPOMapper;
|
||||
import com.njcn.supervision.pojo.dto.SensitiveReportExcel;
|
||||
import com.njcn.supervision.pojo.dto.SensitiveUserSExcel;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||
import com.njcn.supervision.pojo.po.device.CheckDevice;
|
||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
||||
import com.njcn.supervision.pojo.po.user.*;
|
||||
import com.njcn.supervision.pojo.vo.user.UserReportVO;
|
||||
@@ -335,6 +336,14 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(userReportQueryParam), PageFactory.getPageSize(userReportQueryParam)), userReportVOQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserReportVO getUserReportById(String id) {
|
||||
QueryWrapper<UserReportVO> userReportVOQueryWrapper = new QueryWrapper<>();
|
||||
userReportVOQueryWrapper.eq("supervision_user_report.id", id);
|
||||
return this.baseMapper.getUserReportById(userReportVOQueryWrapper);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean removeUserReport(List<String> ids) {
|
||||
this.lambdaUpdate().set(UserReportPO::getState, 0).in(UserReportPO::getId, ids).update();
|
||||
@@ -413,6 +422,23 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
return bpmInstanceInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getAllRejectInstanceIds() {
|
||||
Set<String> rejectInstanceIds = new HashSet<>();
|
||||
// 查询所有走了流程,但是流程状态为不通过的流程实例id
|
||||
LambdaQueryWrapper<UserReportPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(UserReportPO::getCreateBy, RequestUtil.getUserIndex())
|
||||
.eq(UserReportPO::getStatus, BpmProcessInstanceStatusEnum.REJECT.getStatus())
|
||||
.eq(UserReportPO::getState, DataStateEnum.ENABLE.getCode())
|
||||
.select(UserReportPO::getProcessInstanceId);
|
||||
List<UserReportPO> userReportPOList = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
List<String> result = userReportPOList.stream().map(UserReportPO::getProcessInstanceId).collect(Collectors.toList());
|
||||
if(CollectionUtil.isNotEmpty(result)){
|
||||
rejectInstanceIds.addAll(result);
|
||||
}
|
||||
return rejectInstanceIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<UserReportVO> getUserReportList() {
|
||||
String deptIndex = RequestUtil.getDeptIndex();
|
||||
|
||||
@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.bpm.api.BpmProcessFeignClient;
|
||||
import com.njcn.bpm.enums.BpmProcessInstanceStatusEnum;
|
||||
@@ -18,6 +19,7 @@ import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.supervision.enums.*;
|
||||
import com.njcn.supervision.mapper.user.UserReportRenewalMapper;
|
||||
import com.njcn.supervision.pojo.param.user.UserReportParam;
|
||||
import com.njcn.supervision.pojo.po.device.CheckDevice;
|
||||
import com.njcn.supervision.pojo.po.user.*;
|
||||
import com.njcn.supervision.service.user.*;
|
||||
import com.njcn.supervision.utils.InstanceUtil;
|
||||
@@ -31,9 +33,8 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -82,6 +83,23 @@ public class UserReportRenewalServiceImpl extends ServiceImpl<UserReportRenewalM
|
||||
return new BpmInstanceInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getAllRejectInstanceIds() {
|
||||
Set<String> rejectInstanceIds = new HashSet<>();
|
||||
// 查询所有走了流程,但是流程状态为不通过的流程实例id
|
||||
LambdaQueryWrapper<UserReportRenewalPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(UserReportRenewalPO::getCreateBy, RequestUtil.getUserIndex())
|
||||
.eq(UserReportRenewalPO::getStatus, BpmProcessInstanceStatusEnum.REJECT.getStatus())
|
||||
.eq(UserReportRenewalPO::getState, DataStateEnum.ENABLE.getCode())
|
||||
.select(UserReportRenewalPO::getProcessInstanceId);
|
||||
List<UserReportRenewalPO> userReportRenewalPOList = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||
List<String> result = userReportRenewalPOList.stream().map(UserReportRenewalPO::getProcessInstanceId).collect(Collectors.toList());
|
||||
if(CollectionUtil.isNotEmpty(result)){
|
||||
rejectInstanceIds.addAll(result);
|
||||
}
|
||||
return rejectInstanceIds;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public UserReportRenewalPO getUserReportUpdateById(String id) {
|
||||
@@ -143,6 +161,7 @@ public class UserReportRenewalServiceImpl extends ServiceImpl<UserReportRenewalM
|
||||
po.setId(userReportParam.getId());
|
||||
po.setUserReportMessage(userReport);
|
||||
po.setState(DataStateEnum.ENABLE.getCode());
|
||||
userReportPO.setCreateBy(RequestUtil.getUserIndex());
|
||||
if (this.saveOrUpdate(po)) {
|
||||
return userReportParam.getId();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user