1.谐波普测相关功能提交

This commit is contained in:
cdf
2024-04-08 09:31:41 +08:00
parent a3928ab8c6
commit 2512a861bb
8 changed files with 128 additions and 45 deletions

View File

@@ -17,8 +17,7 @@ public enum AuditProcessEnum {
WaitAudit(1,"待审核"), WaitAudit(1,"待审核"),
AuditPass(2,"审核通过"), AuditPass(2,"审核通过"),
AuditRefuse(3,"审核未通过"), AuditRefuse(3,"审核未通过"),
Release(4,"发布"), Release(4,"完成")
Finish(5,"已完成")
; ;

View File

@@ -34,7 +34,7 @@ public class FlowableAss{
private String proIndex; private String proIndex;
/** /**
* 步骤主键 * 每个流程唯一id,
*/ */
private String execIndex; private String execIndex;

View File

@@ -1,6 +1,7 @@
package com.njcn.process.pojo.po; package com.njcn.process.pojo.po;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.github.jeffreyning.mybatisplus.anno.MppMultiId; import com.github.jeffreyning.mybatisplus.anno.MppMultiId;
@@ -83,7 +84,7 @@ public class RGeneralSurveyPlanPO {
private String leader; private String leader;
/** /**
* 计划状态(0:新建 1:待审核 2:审核未通过 3:已发布 4:已完成) * 计划状态(0:新建 1:待审核 2:审核未通过 3.审核未通过 4:已完成)
*/ */
@TableField(value = "status") @TableField(value = "status")
private int status; private int status;

View File

@@ -137,6 +137,17 @@ public class RGeneralSurveyPlanController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVOS, methodDescribe);
} }
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryPlanOne")
@ApiOperation("查询普测计划详情")
@ApiImplicitParam(name = "planId", value = "计划id", required = true)
public HttpResult<RGeneralSurveyPlanVO> queryPlanOne(@RequestParam("planId")String planId) {
String methodDescribe = getMethodDescribe("queryPlanOne");
RGeneralSurveyPlanVO rGeneralSurveyPlanVO = rGeneralSurveyPlanPOService.queryPlanOne( planId);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, rGeneralSurveyPlanVO, methodDescribe);
}
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/queryPlanAudit") @PostMapping("/queryPlanAudit")
@ApiOperation("查询普测计划-审核页面") @ApiOperation("查询普测计划-审核页面")
@@ -281,4 +292,19 @@ public class RGeneralSurveyPlanController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
} }
/**
* 删除新建驳回的计划
* @author cdf
* @date 2024/4/7
*/
@ApiOperation("删除计划")
@PostMapping(value = "deletePlan")
@ApiImplicitParam(name = "planIds", value = "实体参数", required = true)
public HttpResult<Boolean> deletePlan(@RequestBody List<String> planIds) {
String methodDescribe = getMethodDescribe("deletePlan");
rGeneralSurveyPlanPOService.deletePlan(planIds);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);
}
} }

View File

@@ -72,7 +72,7 @@ public class FlowInstanceController extends BaseController {
String methodDescribe = getMethodDescribe("delete"); String methodDescribe = getMethodDescribe("delete");
flowInstanceService.delete(instanceIds,"测试删除666"); flowInstanceService.delete(instanceIds,"测试删除");
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe); return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, true, methodDescribe);

View File

@@ -6,6 +6,7 @@ import com.njcn.minioss.bo.MinIoUploadResDTO;
import com.njcn.process.pojo.param.*; import com.njcn.process.pojo.param.*;
import com.njcn.process.pojo.po.RGeneralSurveyPlanPO; import com.njcn.process.pojo.po.RGeneralSurveyPlanPO;
import com.njcn.process.pojo.vo.*; import com.njcn.process.pojo.vo.*;
import liquibase.pro.packaged.S;
import java.util.List; import java.util.List;
@@ -37,6 +38,9 @@ public interface RGeneralSurveyPlanPOService extends IMppService<RGeneralSurveyP
*/ */
IPage<RGeneralSurveyPlanVO> query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm, List<String> statusList, String type); IPage<RGeneralSurveyPlanVO> query(RGeneralSurveyPlanQueryParm rGeneralSurveyPlanQueryParm, List<String> statusList, String type);
RGeneralSurveyPlanVO queryPlanOne(String planId);
/** /**
* @Description: surveyResultUpload * @Description: surveyResultUpload
* @Param: [surveyResultUploadParam] * @Param: [surveyResultUploadParam]
@@ -106,4 +110,7 @@ public interface RGeneralSurveyPlanPOService extends IMppService<RGeneralSurveyP
Boolean submitAuditUser(RGeneralSurveyPlanAuditUserParam rGeneralSurveyPlanAuditUserParam); Boolean submitAuditUser(RGeneralSurveyPlanAuditUserParam rGeneralSurveyPlanAuditUserParam);
Boolean deletePlan(List<String> planIds);
} }

View File

@@ -27,6 +27,7 @@ import com.njcn.process.pojo.vo.flowable.FlowTaskVo;
import com.njcn.process.service.RGeneralSurveyPlanDetailService; import com.njcn.process.service.RGeneralSurveyPlanDetailService;
import com.njcn.process.service.RGeneralSurveyPlanPOService; import com.njcn.process.service.RGeneralSurveyPlanPOService;
import com.njcn.process.service.flowable.IFlowDefinitionService; 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.service.flowable.IFlowTaskService;
import com.njcn.process.service.impl.flowable.FlowDefinitionServiceImpl; import com.njcn.process.service.impl.flowable.FlowDefinitionServiceImpl;
@@ -35,6 +36,7 @@ import com.njcn.user.api.UserFeignClient;
import com.njcn.user.pojo.po.Dept; import com.njcn.user.pojo.po.Dept;
import com.njcn.user.pojo.po.User; import com.njcn.user.pojo.po.User;
import com.njcn.user.pojo.vo.PvTerminalTreeVO; import com.njcn.user.pojo.vo.PvTerminalTreeVO;
import com.njcn.user.pojo.vo.UserVO;
import com.njcn.web.utils.RequestUtil; import com.njcn.web.utils.RequestUtil;
import liquibase.pro.packaged.S; import liquibase.pro.packaged.S;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@@ -75,6 +77,8 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
private final IFlowDefinitionService iFlowDefinitionService; private final IFlowDefinitionService iFlowDefinitionService;
private final IFlowInstanceService iFlowInstanceService;
private final IFlowTaskService iFlowTaskService; private final IFlowTaskService iFlowTaskService;
private final UserFeignClient userFeignClient; private final UserFeignClient userFeignClient;
@@ -111,7 +115,6 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
rGeneralSurveyPlanPO.setCreatePerson(RequestUtil.getUserIndex()); rGeneralSurveyPlanPO.setCreatePerson(RequestUtil.getUserIndex());
RGeneralSurveyPlanPO generalSurveyPlanPO = this.getOne(new LambdaQueryWrapper<RGeneralSurveyPlanPO>() RGeneralSurveyPlanPO generalSurveyPlanPO = this.getOne(new LambdaQueryWrapper<RGeneralSurveyPlanPO>()
.eq(RGeneralSurveyPlanPO::getPlanNo, rGeneralSurveyPlanAddParm.getPlanNo())); .eq(RGeneralSurveyPlanPO::getPlanNo, rGeneralSurveyPlanAddParm.getPlanNo()));
@@ -252,6 +255,37 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
return returnpage; return returnpage;
} }
@Override
public RGeneralSurveyPlanVO queryPlanOne(String planId) {
RGeneralSurveyPlanPO rGeneralSurveyPlanPO = this.getOne(new LambdaQueryWrapper<RGeneralSurveyPlanPO>().eq(RGeneralSurveyPlanPO::getPlanNo, planId));
LambdaQueryWrapper<RGeneralSurveyPlanDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(RGeneralSurveyPlanDetail::getPlanNo, planId);
List<RGeneralSurveyPlanDetail> rGeneralSurveyPlanDetails = rGeneralSurveyPlanDetailMapper.selectList(lambdaQueryWrapper);
RGeneralSurveyPlanVO rGeneralSurveyPlanVO = new RGeneralSurveyPlanVO();
BeanUtils.copyProperties(rGeneralSurveyPlanPO, rGeneralSurveyPlanVO);
rGeneralSurveyPlanVO.setSubCount(rGeneralSurveyPlanDetails.size());
rGeneralSurveyPlanVO.setSubIds(rGeneralSurveyPlanDetails.stream().map(RGeneralSurveyPlanDetail::getSubId).collect(Collectors.toList()));
rGeneralSurveyPlanVO.setIsFileUpload(ObjectUtil.isNull(rGeneralSurveyPlanPO.getIsFileUpload()) ? 0 : rGeneralSurveyPlanPO.getIsFileUpload());
Dept dept = deptFeignClient.getDeptById(rGeneralSurveyPlanPO.getOrgNo()).getData();
UserVO user = userFeignClient.getUserById(rGeneralSurveyPlanPO.getCreatePerson()).getData();
rGeneralSurveyPlanVO.setOrgName(dept.getName()); //单位名称
rGeneralSurveyPlanVO.setCreatePersonName(user.getName());
if (StrUtil.isNotBlank(rGeneralSurveyPlanPO.getCheckPerson())) {
UserVO checkUser = userFeignClient.getUserById(rGeneralSurveyPlanPO.getCheckPerson()).getData();
rGeneralSurveyPlanVO.setCheckPerson(checkUser.getName());
}
return rGeneralSurveyPlanVO;
}
/** /**
* @param surveyResultUploadParam * @param surveyResultUploadParam
* @Description: surveyResultUpload * @Description: surveyResultUpload
@@ -448,33 +482,23 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
FlowableAss flowableAss = flowableAssMapper.selectOne(new LambdaQueryWrapper<FlowableAss>().eq(FlowableAss::getThsIndex, rGeneralSurveyPlanChcekParm.getPlanNo())); FlowableAss flowableAss = flowableAssMapper.selectOne(new LambdaQueryWrapper<FlowableAss>().eq(FlowableAss::getThsIndex, rGeneralSurveyPlanChcekParm.getPlanNo()));
String auditResult = Objects.equals("1", rGeneralSurveyPlanChcekParm.getCheckResult()) ? "同意" : "拒绝"; 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())) { if (Objects.equals("0", rGeneralSurveyPlanChcekParm.getCheckResult())) {
//拒绝,则回退到申请步骤 //拒绝,则回退到申请步骤
Task task = iFlowTaskService.getTask(flowableAss.getExecIndex());
FlowTaskVo flowTaskVo = new FlowTaskVo();
flowTaskVo.setTaskId(task.getId());
flowTaskVo.setComment(rGeneralSurveyPlanChcekParm.getCheckComment());
iFlowTaskService.taskReject(flowTaskVo); iFlowTaskService.taskReject(flowTaskVo);
} else { } else {
Task task = iFlowTaskService.getTask(flowableAss.getExecIndex()); //同意
FlowTaskVo flowTaskVo = new FlowTaskVo();
flowTaskVo.setTaskId(task.getId());
flowTaskVo.setInstanceId(flowableAss.getExecIndex()); flowTaskVo.setInstanceId(flowableAss.getExecIndex());
flowTaskVo.setComment(RequestUtil.getUserNickname() + auditResult+"编号为"+rGeneralSurveyPlanChcekParm.getPlanNo()+"的计划,结论:"+rGeneralSurveyPlanChcekParm.getCheckComment());
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("auditFlag", 1); map.put("auditFlag", 1);
flowTaskVo.setVariables(map); flowTaskVo.setVariables(map);
iFlowTaskService.complete(flowTaskVo); iFlowTaskService.complete(flowTaskVo);
} }
return result; return result;
} }
@@ -718,7 +742,6 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
FlowTaskVo flowTaskVo = new FlowTaskVo(); FlowTaskVo flowTaskVo = new FlowTaskVo();
flowTaskVo.setTaskId(task.getId()); flowTaskVo.setTaskId(task.getId());
flowTaskVo.setInstanceId(processId); flowTaskVo.setInstanceId(processId);
flowTaskVo.setAssignee(RequestUtil.getUserIndex());
flowTaskVo.setComment(RequestUtil.getUserNickname() + "发起普测计划申请"); flowTaskVo.setComment(RequestUtil.getUserNickname() + "发起普测计划申请");
iFlowTaskService.complete(flowTaskVo); iFlowTaskService.complete(flowTaskVo);
@@ -734,6 +757,33 @@ public class RGeneralSurveyPlanPOServiceImpl extends MppServiceImpl<RGeneralSurv
return true; return true;
} }
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean deletePlan(List<String> planIds) {
//判断是否满足删除条件
long count = this.lambdaQuery().in(RGeneralSurveyPlanPO::getPlanNo, planIds).notIn(RGeneralSurveyPlanPO::getStatus, Stream.of(AuditProcessEnum.New.getStatus(), AuditProcessEnum.AuditRefuse.getStatus()).collect(Collectors.toList())).count();
if (count > 0) {
throw new BusinessException("无法删除新建和未通过状态之外的计划");
}
this.remove(new LambdaQueryWrapper<RGeneralSurveyPlanPO>().in(RGeneralSurveyPlanPO::getPlanNo, planIds));
//删除相关的电站关联信息
rGeneralSurveyPlanDetailMapper.delete(new LambdaQueryWrapper<RGeneralSurveyPlanDetail>().in(RGeneralSurveyPlanDetail::getPlanNo, planIds));
//删除同时如果是驳回状态需要同时删除流程
for (String plan : planIds) {
FlowableAss flowableAss = flowableAssMapper.selectOne(new LambdaQueryWrapper<FlowableAss>().eq(FlowableAss::getThsIndex, plan));
if (Objects.nonNull(flowableAss)) {
iFlowInstanceService.delete(flowableAss.getExecIndex(), "测试删除");
flowableAssMapper.deleteById(flowableAss.getThsIndex());
}
}
return true;
}
public List<DeptSubstationVO> recursion(DeptSubstationVO result, String orgdid) { public List<DeptSubstationVO> recursion(DeptSubstationVO result, String orgdid) {
List<DeptSubstationVO> deptSubstationVOList = new ArrayList<>(); List<DeptSubstationVO> deptSubstationVOList = new ArrayList<>();
if (Objects.equals(result.getId(), orgdid)) { if (Objects.equals(result.getId(), orgdid)) {

View File

@@ -88,7 +88,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
try { try {
List<FlowViewerDto> flowViewerList = new ArrayList<>(); List<FlowViewerDto> flowViewerList = new ArrayList<>();
// 获取已经完成的节点 // 获取已经完成的节点
List<HistoricActivityInstance> listFinished = historyService.createHistoricActivityInstanceQuery() /* List<HistoricActivityInstance> listFinished = historyService.createHistoricActivityInstanceQuery()
.processInstanceId(procInsId) .processInstanceId(procInsId)
.finished() .finished()
.list(); .list();
@@ -99,7 +99,7 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
flowViewerDto.setKey(s.getActivityId()); flowViewerDto.setKey(s.getActivityId());
flowViewerDto.setCompleted(true); flowViewerDto.setCompleted(true);
flowViewerList.add(flowViewerDto); flowViewerList.add(flowViewerDto);
}); });*/
// 获取代办节点 // 获取代办节点
List<HistoricActivityInstance> listUnFinished = historyService.createHistoricActivityInstanceQuery() List<HistoricActivityInstance> listUnFinished = historyService.createHistoricActivityInstanceQuery()
@@ -225,11 +225,11 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
flowTask.setTaskName(taskList.get(0).getName()); flowTask.setTaskName(taskList.get(0).getName());
if (StringUtils.isNotBlank(taskList.get(0).getAssignee())) { if (StringUtils.isNotBlank(taskList.get(0).getAssignee())) {
// 当前任务节点办理人信息 // 当前任务节点办理人信息
List<User> userList = userFeignClient.getUserByIdList(Stream.of(taskList.get(0).getAssignee()).collect(Collectors.toList())).getData(); UserVO user = userFeignClient.getUserById(taskList.get(0).getAssignee()).getData();
if (CollectionUtil.isNotEmpty(userList)) { if (Objects.nonNull(user)) {
flowTask.setAssigneeId(userList.get(0).getId()); flowTask.setAssigneeId(user.getId());
flowTask.setAssigneeName(userList.get(0).getName()); flowTask.setAssigneeName(user.getName());
flowTask.setAssigneeDeptName(Objects.nonNull(userList.get(0).getDeptId()) ? userList.get(0).getDeptId() : ""); flowTask.setAssigneeDeptName(user.getDeptName());
} }
} }
} else { } else {