From f08d6766549e7e1b09c64b4f72701d90ee360b38 Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080> Date: Wed, 20 Dec 2023 19:17:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E5=8D=95=E7=BC=96?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/AftersalesWorkOrderDTO.java | 11 ++- .../impl/AftersalesWorkOrderServiceImpl.java | 67 ++++++++++++++++--- 2 files changed, 68 insertions(+), 10 deletions(-) diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderDTO.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderDTO.java index 7d738d3ec..6afa9d4a2 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderDTO.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/dto/AftersalesWorkOrderDTO.java @@ -67,6 +67,15 @@ public class AftersalesWorkOrderDTO extends AftersalesWorkOrderEntity { * 异常工单完结处理结果赔款方 */ private List completionRecordEntities; + /** + * 取消异常工单完结处理结果受款方 + */ + private List unCompletionRecipientEntities; + + /** + * 取消异常工单完结处理结果赔款方 + */ + private List unCompletionRecordEntities; /** * 工单指派 ID @@ -85,7 +94,7 @@ public class AftersalesWorkOrderDTO extends AftersalesWorkOrderEntity { /** * 取消预计责任人 */ - private List unPersonResponsibleDTO; + private List unPersonResponsibleDTO; /** * * 调查经过 diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java index 295acb2ab..04fe56911 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java @@ -205,7 +205,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl list = new ArrayList<>(); +// List list = new ArrayList<>(); aftersalesWorkOrder.getUnProcessorEntityList().forEach(i ->{ AftersalesProcessorEntity processorEntity = new AftersalesProcessorEntity(); processorEntity.setId(i); @@ -224,19 +224,37 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl collect = aftersalesWorkOrder.getCompletionRecipientEntities().stream().filter(i -> ObjectUtils.isNotNull(i.getId())).collect(Collectors.toList()); + List collect1 = aftersalesWorkOrder.getCompletionRecipientEntities().stream().filter(i -> ObjectUtils.isNull(i.getId())).collect(Collectors.toList()); + if(!collect.isEmpty()){ + //修改 + collect.forEach(i ->{ + completionRecipientService.updateById(i); + }); + + } + if(!collect1.isEmpty()){ + //添加 + completionRecipientService.saveBatch(collect1); + } + } //添加完结赔款方数据 if(ObjectUtils.isNotNull(aftersalesWorkOrder.getCompletionRecordEntities())){ - completionRecordService.saveBatch(aftersalesWorkOrder.getCompletionRecordEntities()); + + List collect = aftersalesWorkOrder.getCompletionRecordEntities().stream().filter(i -> ObjectUtils.isNotNull(i.getId())).collect(Collectors.toList()); + List collect1 = aftersalesWorkOrder.getCompletionRecordEntities().stream().filter(i -> ObjectUtils.isNull(i.getId())).collect(Collectors.toList()); + if(!collect.isEmpty()){ + //修改 + collect.forEach(i ->{ + completionRecordService.updateById(i); + }); + } + if(!collect1.isEmpty()){ + //添加 + completionRecordService.saveBatch(collect1); + } +// completionRecordService.saveBatch(aftersalesWorkOrder.getCompletionRecordEntities()); } return true; } @@ -761,6 +805,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl processorVOS = new ArrayList<>(); List list = aftersalesProcessorService.list(Wrappers.query().lambda() .eq(AftersalesProcessorEntity::getWorkOrderId, aftersalesWorkOrder.getId()) + .apply("conditions in (1,2)") ); List processorVOS = list.stream().map( i ->{ @@ -1378,7 +1423,11 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl