1.技术监督功能干扰源用户代码提交

This commit is contained in:
cdf
2024-04-10 18:53:57 +08:00
parent c348b24b51
commit ec1e8eb04a
20 changed files with 229 additions and 37 deletions

View File

@@ -104,4 +104,7 @@ public interface LoadTypeUserManageService {
*/
Boolean delLoadTypeUserPlan(List<String> ids);
Boolean submitAuditUser(LoadTypeUserCheckParam loadTypeUserCheckParam);
}

View File

@@ -25,7 +25,7 @@ public interface IFlowDefinitionService {
* @param variables 流程变量
* @return
*/
String startProcessInstanceById(String procDefId,String thsIndex, Map<String, Object> variables);
String startProcessInstanceById(String procDefId,String thsIndex,Integer type, Map<String, Object> variables);

View File

@@ -6,6 +6,7 @@ import cn.hutool.core.lang.UUID;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -18,12 +19,14 @@ import com.njcn.device.pms.api.DistributionMonitorClient;
import com.njcn.oss.utils.FileStorageUtil;
import com.njcn.process.constant.Param;
import com.njcn.process.enums.AuditProcessEnum;
import com.njcn.process.enums.ThsFlowTypeEnum;
import com.njcn.process.mapper.FlowFormAssMapper;
import com.njcn.process.mapper.FlowableAssMapper;
import com.njcn.process.mapper.LoadTypeUserManageMapper;
import com.njcn.process.pojo.param.*;
import com.njcn.process.pojo.po.FlowFormAss;
import com.njcn.process.pojo.po.FlowableAss;
import com.njcn.process.pojo.po.RGeneralSurveyPlanPO;
import com.njcn.process.pojo.po.RLoadTypeUserManage;
import com.njcn.process.pojo.vo.LoadTypeRelationExcel;
import com.njcn.process.pojo.vo.LoadTypeUserExcel;
@@ -33,6 +36,7 @@ import com.njcn.process.service.LoadTypeUserManageService;
import com.njcn.process.service.flowable.IFlowDefinitionService;
import com.njcn.process.service.flowable.IFlowInstanceService;
import com.njcn.process.service.flowable.IFlowTaskService;
import com.njcn.process.utils.FlowableUtils;
import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.enums.DicDataEnum;
import com.njcn.system.enums.DicDataTypeEnum;
@@ -102,14 +106,16 @@ public class LoadTypeUserManageServiceImpl extends ServiceImpl<LoadTypeUserManag
Page<RLoadTypeUserManageVO> page = new Page<>(loadTypeUserSearchParam.getPageNum(), loadTypeUserSearchParam.getPageSize());
List<String> ids=deptFeignClient.getDepSonIdtByDeptId (loadTypeUserSearchParam.getOrgNo()).getData ( );
Integer checkType = loadTypeUserSearchParam.getCheckType();
String aStatus = null;
Integer aStatus = null;
//0表示不是审核信息 1标识审核信息
String checkPerson = null;
if(checkType==1){
ids=ids.stream().filter(x->!x.contains(loadTypeUserSearchParam.getOrgNo())).collect(Collectors.toList());
aStatus = dicDataFeignClient.getDicDataByCode(DicDataEnum.FINISH.getCode()).getData().getId();
aStatus = AuditProcessEnum.WaitAudit.getStatus();
checkPerson = RequestUtil.getUserIndex();
}
//干扰源用户信息录入
Page<RLoadTypeUserManageVO> loadTypeUserPage = loadTypeUserManageMapper.getLoadTypeUserPage(page, loadTypeUserSearchParam,ids,aStatus);
Page<RLoadTypeUserManageVO> loadTypeUserPage = loadTypeUserManageMapper.getLoadTypeUserPage(page, loadTypeUserSearchParam,ids,aStatus,aStatus,checkPerson,checkPerson);
//查询审核,创建用户信息
List<String> personList = new ArrayList<>();
@@ -117,7 +123,7 @@ public class LoadTypeUserManageServiceImpl extends ServiceImpl<LoadTypeUserManag
if(StrUtil.isNotBlank(it.getACheckPerson())){
personList.add(it.getACheckPerson());
}
if(StrUtil.isNotBlank(it.getACheckPerson())){
if(StrUtil.isNotBlank(it.getICheckPerson())){
personList.add(it.getICheckPerson());
}
if(StrUtil.isNotBlank(it.getCreateBy())){
@@ -136,8 +142,8 @@ public class LoadTypeUserManageServiceImpl extends ServiceImpl<LoadTypeUserManag
if(StrUtil.isNotBlank(rLoadTypeUserManageVO.getACheckPerson())){
rLoadTypeUserManageVO.setACheckPersonName(userMap.get(rLoadTypeUserManageVO.getACheckPerson()).getName());
}
if(StrUtil.isNotBlank(rLoadTypeUserManageVO.getICheckPersonName())){
rLoadTypeUserManageVO.setICheckPersonName(userMap.get(rLoadTypeUserManageVO.getICheckPersonName()).getName());
if(StrUtil.isNotBlank(rLoadTypeUserManageVO.getICheckPerson())){
rLoadTypeUserManageVO.setICheckPersonName(userMap.get(rLoadTypeUserManageVO.getICheckPerson()).getName());
}
if(StrUtil.isNotBlank(rLoadTypeUserManageVO.getCreateBy())){
rLoadTypeUserManageVO.setCreateByName(userMap.get(rLoadTypeUserManageVO.getCreateBy()).getName());
@@ -166,8 +172,11 @@ public class LoadTypeUserManageServiceImpl extends ServiceImpl<LoadTypeUserManag
}
if (rLoadTypeUserManageVO.getAFilePath() != null) {
String aFile = fileStorageUtil.getFileUrl(rLoadTypeUserManageVO.getAFilePath());
rLoadTypeUserManageVO.setIFile(aFile);
rLoadTypeUserManageVO.setAFile(aFile);
}
rLoadTypeUserManageVO.setOrgName(deptFeignClient.getDeptById(rLoadTypeUserManage.getOrgNo()).getData().getName());
return rLoadTypeUserManageVO;
}
@@ -193,7 +202,7 @@ public class LoadTypeUserManageServiceImpl extends ServiceImpl<LoadTypeUserManag
//绑定工作流
//开始流程
FlowFormAss flowFormAss = flowFormAssMapper.selectOne(new LambdaQueryWrapper<FlowFormAss>().eq(FlowFormAss::getFormId, 2));
/*FlowFormAss flowFormAss = flowFormAssMapper.selectOne(new LambdaQueryWrapper<FlowFormAss>().eq(FlowFormAss::getFormId, 2));
if (Objects.isNull(flowFormAss)) {
throw new BusinessException("当前功能未绑定流程,请先绑定流程");
}
@@ -205,7 +214,7 @@ public class LoadTypeUserManageServiceImpl extends ServiceImpl<LoadTypeUserManag
flowTaskVo.setTaskId(task.getId());
flowTaskVo.setInstanceId(processId);
flowTaskVo.setComment(RequestUtil.getUserNickname() + "发起录入干扰源用户申请");
iFlowTaskService.complete(flowTaskVo);
iFlowTaskService.complete(flowTaskVo);*/
return true;
}
@@ -228,8 +237,8 @@ public class LoadTypeUserManageServiceImpl extends ServiceImpl<LoadTypeUserManag
rLoadTypeUserManage.setIFilePath(fileStorageUtil.uploadMultipart(multipartFile,OssPath.LOAD_TYPE_USER));
rLoadTypeUserManage.setIFilePathName(multipartFile.getOriginalFilename());
rLoadTypeUserManage.setIUploadTime(new Date());
rLoadTypeUserManage.setIIsFileUpload(rLoadTypeUserManage.getIFilePath()!=null?1:0);
}
rLoadTypeUserManage.setIIsFileUpload(rLoadTypeUserManage.getIFilePath()!=null?1:0);
loadTypeUserManageMapper.updateById(rLoadTypeUserManage);
return true;
}
@@ -437,19 +446,19 @@ public class LoadTypeUserManageServiceImpl extends ServiceImpl<LoadTypeUserManag
@Override
@Transactional(rollbackFor = {Exception.class})
public Boolean checkLoadTypeUserI(LoadTypeUserCheckParam loadTypeUserCheckParam) {
boolean result = true;
UpdateWrapper<RLoadTypeUserManage> updateWrapper = new UpdateWrapper();
updateWrapper.eq("id", loadTypeUserCheckParam.getId());
updateWrapper.set("i_check_comment", loadTypeUserCheckParam.getCheckComment());
updateWrapper.set("i_check_person", loadTypeUserCheckParam.getCheckPerson());
DictData fail = dicDataFeignClient.getDicDataByCode(DicDataEnum.FAILED.getCode()).getData();
DictData finish = dicDataFeignClient.getDicDataByCode(DicDataEnum.FINISH.getCode()).getData();
updateWrapper.set("i_status", Objects.equals("1", loadTypeUserCheckParam.getCheckResult()) ? finish.getId() : fail.getId());
updateWrapper.set("i_status", Objects.equals("1", loadTypeUserCheckParam.getCheckResult()) ? AuditProcessEnum.AuditPass.getStatus() :AuditProcessEnum.AuditRefuse.getStatus());
int i = loadTypeUserManageMapper.update(null, updateWrapper);
result = i == 1;
return result;
//流程审核
FlowableAss flowableAss = flowableAssMapper.selectOne(new LambdaQueryWrapper<FlowableAss>().eq(FlowableAss::getType, ThsFlowTypeEnum.rLoadTypeUser.getCode()).eq(FlowableAss::getThsIndex,loadTypeUserCheckParam.getId()));
if(Objects.isNull(flowableAss)){
throw new BusinessException("当前功能未绑定流程,请联系管理员处理");
}
FlowableUtils.dealAuditResult(flowableAss,loadTypeUserCheckParam.getCheckResult(),iFlowTaskService,loadTypeUserCheckParam.getCheckComment());
return true;
}
/**
@@ -498,6 +507,73 @@ public class LoadTypeUserManageServiceImpl extends ServiceImpl<LoadTypeUserManag
return true;
}
@Override
public Boolean submitAuditUser(LoadTypeUserCheckParam loadTypeUserCheckParam) {
String userId = RequestUtil.getUserIndex();
List<String> ids = loadTypeUserCheckParam.getIds();
Integer count = this.lambdaQuery().in(RLoadTypeUserManage::getId, ids).eq(RLoadTypeUserManage::getCreateBy, userId).count();
if (count != ids.size()) {
throw new BusinessException("只可以操作自己创建的计划!");
}
this.update(new LambdaUpdateWrapper<RLoadTypeUserManage>()
.in(RLoadTypeUserManage::getId, ids)
.set(RLoadTypeUserManage::getIStatus, AuditProcessEnum.WaitAudit.getStatus()).set(RLoadTypeUserManage::getICheckPerson, loadTypeUserCheckParam.getCheckPerson())
);
//绑定工作流
Map<String, Object> map = new HashMap<>();
//map.put("applyUser",userId);
for (String planId : ids) {
//需要判断那些流程已经启动,已经启动的则为驳回后的再次提交审核
FlowableAss flowableAss = flowableAssMapper.selectOne(new LambdaQueryWrapper<FlowableAss>().eq(FlowableAss::getThsIndex, planId));
if (Objects.nonNull(flowableAss)) {
//不为空则认为是驳回后的重新发起
Task task = iFlowTaskService.getTask(flowableAss.getExecIndex());
FlowTaskVo flowTaskVo = new FlowTaskVo();
flowTaskVo.setTaskId(task.getId());
flowTaskVo.setAssignee(userId);
flowTaskVo.setComment(RequestUtil.getUserNickname() + "重新发起新建干扰源用户申请");
iFlowTaskService.complete(flowTaskVo);
Task taskNext = iFlowTaskService.getTask(flowableAss.getExecIndex());
FlowTaskVo flowTaskVoNext = new FlowTaskVo();
flowTaskVoNext.setTaskId(taskNext.getId());
flowTaskVoNext.setAssignee(loadTypeUserCheckParam.getCheckPerson());
iFlowTaskService.toNextTaskUser(flowTaskVoNext);
} else {
//开始流程
FlowFormAss flowFormAss = flowFormAssMapper.selectOne(new LambdaQueryWrapper<FlowFormAss>().eq(FlowFormAss::getFormId, 2));
if (Objects.isNull(flowFormAss)) {
throw new BusinessException("当前功能未绑定流程,请先绑定流程");
}
String processId = iFlowDefinitionService.startProcessInstanceById(flowFormAss.getDefinitionId(), planId,ThsFlowTypeEnum.rLoadTypeUser.getCode(), map);
Task task = iFlowTaskService.getTask(processId);
FlowTaskVo flowTaskVo = new FlowTaskVo();
flowTaskVo.setTaskId(task.getId());
flowTaskVo.setInstanceId(processId);
flowTaskVo.setComment(RequestUtil.getUserNickname() + "发起新建干扰源用户申请");
iFlowTaskService.complete(flowTaskVo);
Task taskReport = iFlowTaskService.getTask(processId);
FlowTaskVo flowTaskVoReport = new FlowTaskVo();
flowTaskVoReport.setTaskId(taskReport.getId());
flowTaskVoReport.setAssignee(userId);
flowTaskVoReport.setComment(RequestUtil.getUserNickname() + "填报了预测评估报告");
iFlowTaskService.complete(flowTaskVoReport);
Task taskNext = iFlowTaskService.getTask(processId);
FlowTaskVo flowTaskVoNext = new FlowTaskVo();
flowTaskVoNext.setTaskId(taskNext.getId());
flowTaskVoNext.setAssignee(loadTypeUserCheckParam.getCheckPerson());
iFlowTaskService.toNextTaskUser(flowTaskVoNext);
}
}
return true;
}
/**
* @Description: 干扰源用户报告状态,待审核无法修改信息
* @param id

View File

@@ -19,6 +19,7 @@ import com.njcn.oss.constant.OssPath;
import com.njcn.oss.enums.OssResponseEnum;
import com.njcn.oss.utils.FileStorageUtil;
import com.njcn.process.enums.AuditProcessEnum;
import com.njcn.process.enums.ThsFlowTypeEnum;
import com.njcn.process.mapper.*;
import com.njcn.process.pojo.param.*;
import com.njcn.process.pojo.po.*;
@@ -492,14 +493,15 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
//处理流程
FlowableAss flowableAss = flowableAssMapper.selectOne(new LambdaQueryWrapper<FlowableAss>().eq(FlowableAss::getThsIndex, rGeneralSurveyPlanChcekParm.getPlanNo()));
if(Objects.isNull(flowableAss)){
throw new BusinessException("当前功能未绑定流程,请联系管理员处理");
}
String auditResult = Objects.equals("1", rGeneralSurveyPlanChcekParm.getCheckResult()) ? "同意" : "拒绝";
Task task = iFlowTaskService.getTask(flowableAss.getExecIndex());
FlowTaskVo flowTaskVo = new FlowTaskVo();
flowTaskVo.setTaskId(task.getId());
flowTaskVo.setComment(RequestUtil.getUserNickname() + auditResult + " 编号为" + rGeneralSurveyPlanChcekParm.getPlanNo() + "的计划,理由:" + rGeneralSurveyPlanChcekParm.getCheckComment());
if (Objects.equals("0", rGeneralSurveyPlanChcekParm.getCheckResult())) {
//拒绝,则回退到申请步骤
iFlowTaskService.taskReject(flowTaskVo);
@@ -749,7 +751,7 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
throw new BusinessException("当前功能未绑定流程,请先绑定流程");
}
String processId = iFlowDefinitionService.startProcessInstanceById(flowFormAss.getDefinitionId(), planId, map);
String processId = iFlowDefinitionService.startProcessInstanceById(flowFormAss.getDefinitionId(), planId, ThsFlowTypeEnum.rGeneralSurvey.getCode(), map);
Task task = iFlowTaskService.getTask(processId);
FlowTaskVo flowTaskVo = new FlowTaskVo();
flowTaskVo.setTaskId(task.getId());

View File

@@ -282,7 +282,7 @@ public class ThsSuperviseServiceImpl extends ServiceImpl<ThsSuperviseMapper, Ths
} else {
proInId = "flow_yzep99kb:2:6358e099-dcba-11ed-8026-b07b253cdad9";
}
iFlowDefinitionService.startProcessInstanceById(proInId, thsSupervise.getSupIndex(), mapParam);
iFlowDefinitionService.startProcessInstanceById(proInId, thsSupervise.getSupIndex(),55, mapParam);
}
/**

View File

@@ -70,7 +70,7 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
*/
@Override
@Transactional(rollbackFor = Exception.class)
public String startProcessInstanceById(String procDefId,String thsIndex, Map<String, Object> variables) {
public String startProcessInstanceById(String procDefId,String thsIndex,Integer type, Map<String, Object> variables) {
try {
ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(procDefId)
.latestVersion().singleResult();
@@ -87,6 +87,7 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
flowableAss.setThsIndex(thsIndex);
flowableAss.setProIndex(res.getDeploymentId());
flowableAss.setExecIndex(res.getProcessInstanceId());
flowableAss.setType(type);
flowableAssMapper.insert(flowableAss);
return res.getProcessInstanceId();

View File

@@ -2,6 +2,7 @@ package com.njcn.process.service.impl.flowable;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.process.factory.FlowServiceFactory;
import com.njcn.process.pojo.vo.flowable.FlowTaskVo;
@@ -90,7 +91,7 @@ public class FlowInstanceServiceImpl extends FlowServiceFactory implements IFlow
HistoricProcessInstance historicProcessInstance =
historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
if (Objects.isNull(historicProcessInstance)) {
throw new FlowableObjectNotFoundException("流程实例不存在: " + processInstanceId);
throw new BusinessException("流程实例不存在: " + processInstanceId);
}
return historicProcessInstance;
}

View File

@@ -201,6 +201,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
flowTask.setFinishTime(hisIns.getEndTime());
flowTask.setProcInsId(hisIns.getId());
FlowableAss flowableAss = flowableAssMapper.selectOne(new LambdaQueryWrapper<FlowableAss>().eq(FlowableAss::getExecIndex,hisIns.getId()));
flowTask.setFormAssId(flowableAss.getThsIndex());
// 计算耗时
if (Objects.nonNull(hisIns.getEndTime())) {
long time = hisIns.getEndTime().getTime() - hisIns.getStartTime().getTime();
@@ -340,6 +342,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
FlowTaskDto flowTask = new FlowTaskDto();
flowTask.setFormAssId(flowableAss.getThsIndex());
flowTask.setFormType(flowableAss.getType());
// 当前流程信息
flowTask.setTaskId(task.getId());
flowTask.setTaskDefKey(task.getTaskDefinitionKey());