diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml index 279ef3eb9..c2f1a373c 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml @@ -51,10 +51,11 @@ 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 9269e6c4a..1afc66d36 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 @@ -1235,27 +1235,45 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl list, AftersaleSurveyRecordDTO surveyRecordDTO) { - aftersalesWorkOrderDTO.getProcessorEntityList().forEach( i ->{ - Optional first = list.stream().filter(a -> a.getBusinessId().equals(i.getBusinessId())).findFirst(); + if(!aftersalesWorkOrderDTO.getProcessorEntityList().isEmpty()){ + aftersalesWorkOrderDTO.getProcessorEntityList().forEach( i ->{ + Optional first = list.stream().filter(a -> a.getBusinessId().equals(i.getBusinessId())).findFirst(); - if(first.isPresent()){ - //修改处理方 处理状态 - updateProcessor(ProcessorProcessingStatusStatusConstant.daichuli.getValue(),first.get()); - }else{ - //不存在 添加处理方信息 - AftersalesProcessorEntity processor = addProcessor(aftersalesWorkOrderDTO, myCurrentWarehouse, i); - processor.setConditions(ProcessorConditionsStatusConstant.xinzeng.getValue()); - processor.setAssignTime(new Date()); - //添加处理方 - aftersalesProcessorService.save(processor); - } - //添加指定处理结果 - //处理方 - addSurveRecord(aftersalesWorkOrderDTO, user, i); - AftersalesReplyingPartyEntity replyingPartyEntity = getPartyEntity(aftersalesWorkOrderDTO,i,surveyRecordDTO); + if(first.isPresent()){ + //修改处理方 处理状态 + updateProcessor(ProcessorProcessingStatusStatusConstant.daichuli.getValue(),first.get()); + }else{ + //不存在 添加处理方信息 + AftersalesProcessorEntity processor = addProcessor(aftersalesWorkOrderDTO, myCurrentWarehouse, i); + processor.setConditions(ProcessorConditionsStatusConstant.xinzeng.getValue()); + processor.setAssignTime(new Date()); + //添加处理方 + aftersalesProcessorService.save(processor); + } + //添加指定处理结果 + //处理方 + addSurveRecord(aftersalesWorkOrderDTO, user, i); + AftersalesReplyingPartyEntity replyingPartyEntity = getPartyEntity(aftersalesWorkOrderDTO,i,surveyRecordDTO); + //添加待回复信息 + aftersalesReplyingPartyService.save(replyingPartyEntity); + }); + + }else{ + //没有 全部 + List collect = list.stream().filter(i -> "1".equals(i.getProcessingStatus())).collect(Collectors.toList()); //添加待回复信息 - aftersalesReplyingPartyService.save(replyingPartyEntity); - }); + collect.forEach( i ->{ + //修改处理方 处理状态 + updateProcessor(ProcessorProcessingStatusStatusConstant.daichuli.getValue(),i); + //添加指定处理结果 + addSurveRecord(aftersalesWorkOrderDTO, user, i); + AftersalesReplyingPartyEntity replyingPartyEntity = getPartyEntity(aftersalesWorkOrderDTO,i,surveyRecordDTO); + //添加待回复信息 + aftersalesReplyingPartyService.save(replyingPartyEntity); + }); + } + + } /**