|
|
|
@ -1235,27 +1235,45 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
* @param surveyRecordDTO |
|
|
|
|
*/ |
|
|
|
|
private void chuLiFang(AftersalesWorkOrderDTO aftersalesWorkOrderDTO, BasicdataWarehouseEntity myCurrentWarehouse, BladeUser user, List<AftersalesProcessorEntity> list, AftersaleSurveyRecordDTO surveyRecordDTO) { |
|
|
|
|
aftersalesWorkOrderDTO.getProcessorEntityList().forEach( i ->{ |
|
|
|
|
Optional<AftersalesProcessorEntity> first = list.stream().filter(a -> a.getBusinessId().equals(i.getBusinessId())).findFirst(); |
|
|
|
|
if(!aftersalesWorkOrderDTO.getProcessorEntityList().isEmpty()){ |
|
|
|
|
aftersalesWorkOrderDTO.getProcessorEntityList().forEach( i ->{ |
|
|
|
|
Optional<AftersalesProcessorEntity> 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<AftersalesProcessorEntity> 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); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|