From d57100f2aa6048dec0ee98fd2d8f08ff7f42bd3e Mon Sep 17 00:00:00 2001 From: liao Date: Tue, 28 Nov 2023 10:50:55 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=A0=87=E5=87=86=E5=BE=81=E6=B1=82?= =?UTF-8?q?=E6=84=8F=E8=A7=81=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...cessFbStandardConsultationServiceImpl.java | 132 +++++++++++++++++- 1 file changed, 128 insertions(+), 4 deletions(-) diff --git a/laws-modules/src/main/java/com/jero/modules/activiti/process/fb/service/impl/ProcessFbStandardConsultationServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/activiti/process/fb/service/impl/ProcessFbStandardConsultationServiceImpl.java index 4f46216b..69743255 100644 --- a/laws-modules/src/main/java/com/jero/modules/activiti/process/fb/service/impl/ProcessFbStandardConsultationServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/activiti/process/fb/service/impl/ProcessFbStandardConsultationServiceImpl.java @@ -239,8 +239,6 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl processFbConsultationLists = businessInfoDTO.getProcessFbConsultationLists(); if (StringUtils.isBlank(taskId)) { // 法规工程师发起 saveOrUpdate(processFbStandardConsultation); @@ -248,21 +246,25 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl processInfoVO) { + ProcessFbStandardConsultationVO businessInfoDTO = processInfoVO.getBusinessInfoDTO(); // 全部业务信息 + String designEngineerId = businessInfoDTO.getProcessFbConsultationUserLink().getDesignEngineerId(); + + if (StringUtils.isBlank(designEngineerId)) return; + + String taskId = processInfoVO.getBasicTaskInfoDTO().getTaskId(); + Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); + + String userLinkId = task.getFormKey(); + ProcessFbConsultationUserLink processFbConsultationUserLink = processFbConsultationUserLinkService.getById(userLinkId); + + List designEngineerIdList = Arrays.asList(designEngineerId.split(",")); + List userLinkList = new ArrayList<>(); + + designEngineerIdList.forEach(designEngineer -> { + ProcessFbConsultationUserLink userLink = new ProcessFbConsultationUserLink(); + userLink.setUserType("1"); + userLink.setBusinessId(processFbConsultationUserLink.getBusinessId()); + userLink.setDepartLeaderId(processFbConsultationUserLink.getDepartLeaderId()); + userLink.setModuleOwnerId(processFbConsultationUserLink.getModuleOwnerId()); + userLink.setDesignEngineerId(designEngineer); + userLinkList.add(userLink); + }); + + processFbConsultationUserLinkService.removeById(userLinkId); // 先删除 + processFbConsultationUserLinkService.saveBatch(userLinkList, userLinkList.size()); // 后新增 + } + + /** * @Author: liao * @Date: 2023/11/21 9:39 @@ -500,6 +537,19 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl processInfoVO) { + ProcessFbStandardConsultationVO businessInfoDTO = processInfoVO.getBusinessInfoDTO(); // 全部业务信息 + List processFbConsultationLists = businessInfoDTO.getProcessFbConsultationLists(); + if (CollectionUtils.isNotEmpty(processFbConsultationLists)) { + processFbConsultationListService.updateBatchById(processFbConsultationLists); // 更新业务信息 + } + } + /** * @Author: liao * @Date: 2023/11/16 15:46 @@ -536,6 +586,38 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl processInfoVO) { + ProcessFbStandardConsultationVO businessInfoDTO = processInfoVO.getBusinessInfoDTO(); // 全部业务信息 + List processFbConsultationLists = businessInfoDTO.getProcessFbConsultationLists(); + String businessId = processInfoVO.getBusinessId(); + + String taskId = processInfoVO.getBasicTaskInfoDTO().getTaskId(); + Task task = taskService.createTaskQuery().taskId(taskId).singleResult(); + + String userLinkId = task.getFormKey(); + + // 先删除存储的数据 + LambdaQueryWrapper removeWrapper = new LambdaQueryWrapper<>(); + removeWrapper.eq(ProcessFbConsultationList::getUserLinkId, userLinkId); + processFbConsultationListService.remove(removeWrapper); + + String designEngineerName = CurrentUserUtil.getRealName() + "(" + CurrentUserUtil.getUsername() + ")"; + // 保存业务信息 + if (CollectionUtils.isNotEmpty(processFbConsultationLists)) { + processFbConsultationLists.forEach(consultation -> { + consultation.setUserLinkId(userLinkId); + consultation.setBusinessId(businessId); + consultation.setDesignEngineerName(designEngineerName); + }); + processFbConsultationListService.saveBatch(processFbConsultationLists, processFbConsultationLists.size()); + } + } + /** * @Author: liao * @Date: 2023/11/14 9:35 @@ -597,6 +679,48 @@ public class ProcessFbStandardConsultationServiceImpl extends ServiceImpl processInfoVO) { + ProcessFbStandardConsultationVO businessInfoDTO = processInfoVO.getBusinessInfoDTO(); // 全部业务信息 + ProcessFbConsultationUserLink userLink = businessInfoDTO.getProcessFbConsultationUserLink(); // 业务分派信息 + + LambdaQueryWrapper removeWrapper = new LambdaQueryWrapper<>(); + removeWrapper.eq(ProcessFbConsultationUserLink::getBusinessId, processInfoVO.getBusinessId()); + removeWrapper.eq(ProcessFbConsultationUserLink::getDepartLeaderId, CurrentUserUtil.getId()); + processFbConsultationUserLinkService.remove(removeWrapper); // 删除原先存储的关联 + + List linkList = new ArrayList<>(); + if ("1".equals(userLink.getUserType())) { // 模块负责人 + if (StringUtils.isBlank(userLink.getModuleOwnerId())) return; + List moduleOwnerIds = Arrays.asList(userLink.getModuleOwnerId().split(",")); + moduleOwnerIds.forEach(moduleOwnerId -> { + ProcessFbConsultationUserLink link = new ProcessFbConsultationUserLink(); + link.setUserType("1"); + link.setBusinessId(processInfoVO.getBusinessId()); + link.setDepartLeaderId(CurrentUserUtil.getId()); + link.setModuleOwnerId(moduleOwnerId); + linkList.add(link); + }); + processFbConsultationUserLinkService.saveBatch(linkList, linkList.size()); + } else { // 设计工程师 + if (StringUtils.isBlank(userLink.getDesignEngineerId())) return; + List designEngineerIds = Arrays.asList(userLink.getDesignEngineerId().split(",")); + designEngineerIds.forEach(designEngineerId -> { + ProcessFbConsultationUserLink link = new ProcessFbConsultationUserLink(); + link.setUserType("2"); + link.setBusinessId(processInfoVO.getBusinessId()); + link.setDepartLeaderId(CurrentUserUtil.getId()); + link.setDesignEngineerId(designEngineerId); + linkList.add(link); + }); + processFbConsultationUserLinkService.saveBatch(linkList, linkList.size()); + } + } + /** * @Author: liao * @Date: 2023/11/17 15:09