From af589d21490fefa66b9ded34497fda903fa9c5ae Mon Sep 17 00:00:00 2001 From: wangzhijiang <12345678> Date: Thu, 9 Mar 2023 15:00:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=B8=85=E5=8D=95-=E8=B4=A3?= =?UTF-8?q?=E4=BB=BB=E4=BA=BA=E8=BD=AC=E5=8A=9E=E6=8E=A5=E5=8F=A3=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ectCertificationInventoryEOController.java | 7 +++ ...rojectCertificationInventoryEOService.java | 7 +++ ...ctCertificationInventoryEOServiceImpl.java | 53 +++++++++++++++++++ 3 files changed, 67 insertions(+) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java index 613f8de45..e41ee60a8 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java @@ -227,4 +227,11 @@ public class ProjectCertificationInventoryEOController extends JeroController resetFlow(@RequestBody JSONObject json) { return this.projectCertificationInventoryEOService.resetFlow(json); } + + @AutoLog(value = "项目库-认证清单表-转办") + @ApiOperation(value="项目库-认证清单表-转办", notes="项目库-认证清单表-转办") + @PostMapping(value = "/transferTask") + public Result transferTask(@RequestBody JSONObject json) { + return this.projectCertificationInventoryEOService.transferTask(json); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java index 9ed7ac480..a912e8105 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java @@ -142,4 +142,11 @@ public interface IProjectCertificationInventoryEOService extends IService resetFlow(JSONObject json); + + /** + * 转办任务 + * @param json + * @return + */ + Result transferTask(JSONObject json); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index 9af255d98..9b8206178 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -1257,4 +1257,57 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl transferTask(JSONObject json) { + String ids = json.getString("ids"); + if(StringUtils.isEmpty(ids)){ + throw new JeroBootException("至少选择一条数据进行操作!"); + } + + String projectLibraryId = json.getString("projectLibraryId"); + String transferUserId = json.getString("transferUserId"); + ProjectLibraryBase projectLibraryBase = this.projectLibraryBaseService.getBaseMapper().selectById(projectLibraryId); + if(ObjectUtils.isEmpty(projectLibraryBase)){ + throw new JeroBootException("无法获取项目库信息,项目库id为:" + projectLibraryId + " 请联系管理员!"); + } + + LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + List idList = Arrays.asList(ids.split(",")); + + // 流程状态为 任务待确认、待提交、 审查退回 。 能转办 + List flowStatusList = new ArrayList<>(); + flowStatusList.add(CertificationInventoryFlowStatusEnum.TASK_TO_BE_CONFIRMED.getValue()); + flowStatusList.add(CertificationInventoryFlowStatusEnum.RESULTS_TO_BE_SUBMITTED.getValue()); + flowStatusList.add(CertificationInventoryFlowStatusEnum.REVIEW_AND_RETURN.getValue()); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().in(ProjectCertificationInventoryEO::getId,idList); + queryWrapper.lambda().in(ProjectCertificationInventoryEO::getFlowStatus,flowStatusList); + queryWrapper.lambda().in(ProjectCertificationInventoryEO::getDutyPerson,currentUser.getId()); + List projectCertificationInventoryEOList = this.list(queryWrapper); + + if(CollectionUtils.isEmpty(projectCertificationInventoryEOList)){ + throw new JeroBootException("至少选择一条数据流程状态为'任务待确认 或 结果待提交 或 审查退回'的数据进行转办操作!"); + } + + projectCertificationInventoryEOList.forEach(certificationInventory -> { + certificationInventory.setDutyPerson(transferUserId); + }); + this.updateBatchById(projectCertificationInventoryEOList); + + QueryWrapper detailQueryWrap = new QueryWrapper<>(); + detailQueryWrap.lambda().eq(ProcessInfoDetailEO::getProcessInfoId,projectLibraryId); + detailQueryWrap.lambda().eq(ProcessInfoDetailEO::getUserId,currentUser.getId()); + detailQueryWrap.lambda().in(ProcessInfoDetailEO::getProjectLawsInventoryId,idList); + List processInfoDetailEOList = this.processInfoDetailEOService.list(detailQueryWrap); + if(CollectionUtils.isNotEmpty(processInfoDetailEOList)){ + processInfoDetailEOList.forEach(detail -> { + detail.setUserId(transferUserId); + }); + this.processInfoDetailEOService.updateBatchById(processInfoDetailEOList); + } + + return Result.OK("转办成功!"); + } + }