| | |
| | | if (Objects.isNull(project)) { |
| | | throw new RuntimeException("项目不存在"); |
| | | } |
| | | SysUser user = sysUserService.selectUserById(project.getCreateBy()); |
| | | if (Objects.isNull(user)) { |
| | | SysDept dept = deptService.selectDeptById(project.getProjectOwnerUnit()); |
| | | if (Objects.isNull(dept)) { |
| | | throw new RuntimeException("项目业主单位不存在"); |
| | | } |
| | | String processInsId = this.startPro(form.getProjectId(), form.getProcessDefId(), user.getDeptId()); |
| | | String processInsId = this.startPro(form.getProjectId(), form.getProcessDefId(), dept.getDeptId()); |
| | | new LambdaUpdateChainWrapper<>(baseMapper) |
| | | .eq(ProjectProcess::getProjectId, form.getProjectId()) |
| | | .set(ProjectProcess::getProcessDefId, form.getProcessDefId()) |
| | | .set(ProjectProcess::getProcessInsId, processInsId) |
| | | .set(ProjectProcess::getDataLaunch, project.getCreateBy()) |
| | | .set(ProjectProcess::getDataLaunch, project.getProjectOwnerUnit()) |
| | | .update(); |
| | | |
| | | return Result.ok("流程变更成功"); |
| | |
| | | if (Objects.isNull(project)) { |
| | | throw new RuntimeException("项目不存在"); |
| | | } |
| | | SysUser user = sysUserService.selectUserById(project.getCreateBy()); |
| | | if (Objects.isNull(user)) { |
| | | SysDept dept = deptService.selectDeptById(project.getProjectOwnerUnit()); |
| | | if (Objects.isNull(dept)) { |
| | | throw new RuntimeException("项目业主单位不存在"); |
| | | } |
| | | String processInsId = this.startPro(projectId, processDefId, user.getDeptId()); |
| | | String processInsId = this.startPro(projectId, processDefId, dept.getDeptId()); |
| | | ProjectProcess entity = new ProjectProcess(); |
| | | entity.setProjectId(projectId); |
| | | entity.setProcessDefId(processDefId); |
| | | entity.setProcessInsId(processInsId); |
| | | entity.setDataLaunch(project.getCreateBy()); |
| | | entity.setDataLaunch(project.getProjectOwnerUnit()); |
| | | baseMapper.insert(entity); |
| | | |
| | | return Result.ok("流程启动成功"); |