Browse Source

修改工单创建可以追加记录

single_db
caoyizhong 1 year ago
parent
commit
8331dcdfbf
  1. 3
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  2. 28
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

3
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java

@ -198,9 +198,6 @@ public class AftersalesWorkOrderController extends BladeController {
if(ObjectUtils.isNull(aftersalesWorkOrderDTO.getId())){
throw new ServiceException("异常工单ID不能为空");
}
if(ObjectUtils.isNull(aftersalesWorkOrderDTO.getProcessorEntityList())){
throw new ServiceException("处理方信息不能为空");
}
return R.status(aftersalesWorkOrderService.savaSurveyRecord(aftersalesWorkOrderDTO));
}

28
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

@ -305,9 +305,11 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
list.add(processor);
}
aftersalesProcessorService.save(processor);
AftersalesReplyingPartyEntity replyingPartyEntity = getPartyEntity(aftersalesWorkOrder, processor, aftersaleSurveyRecord);
//添加待回复信息
aftersalesReplyingPartyService.save(replyingPartyEntity);
if(ProcessorTypesOfStatusConstant.chulifang.getValue().equals(i.getTypesOf())){
AftersalesReplyingPartyEntity replyingPartyEntity = getPartyEntity(aftersalesWorkOrder, processor, aftersaleSurveyRecord);
//添加待回复信息
aftersalesReplyingPartyService.save(replyingPartyEntity);
}
});
}
@ -1176,20 +1178,26 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
AftersaleSurveyRecordDTO surveyRecordDTO = aftersalesWorkOrderDTO.getSurveyRecordDTO();
AftersaleSurveyRecordEntity surveyRecordEntity = new AftersaleSurveyRecordEntity();
BeanUtil.copyProperties(surveyRecordDTO,surveyRecordEntity);
// surveyRecordEntity.setProcessorId(processor1.getId());
if(one.isPresent()){
surveyRecordEntity.setProcessorId(one.get().getId());
}
surveyRecordEntity.setDifference("1");
surveyRecordEntity.setAddPeople(user.getUserName());
surveyRecordEntity.setAddDepartment(myCurrentWarehouse.getName());
aftersaleSurveyRecordService.save(surveyRecordEntity);
//是否处理
if(!one.isPresent()){
AftersalesProcessorEntity processor1 = one.get();
//不是处理方
if(aftersalesWorkOrderDTO.getProcessorEntityList().isEmpty()){
//没有 全部
List<AftersalesProcessorEntity> collect = list.stream().filter(i -> "1".equals(i.getProcessingStatus())).collect(Collectors.toList());
//添加待回复信息
collect.forEach( i ->{
getPartyEntity(aftersalesWorkOrderDTO,i,surveyRecordDTO);
AftersalesReplyingPartyEntity replyingPartyEntity = getPartyEntity(aftersalesWorkOrderDTO,i,surveyRecordEntity);
//添加待回复信息
aftersalesReplyingPartyService.save(replyingPartyEntity);
});
}else{
@ -1207,6 +1215,8 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
updateWrapper.eq("processor_id",processor1.getId());
updateWrapper.eq("difference","1");
updateWrapper.set("difference","2");
updateWrapper.set("processed_by_id",user.getUserId());
updateWrapper.set("processed_by_name",user.getUserName());
aftersalesReplyingPartyService.update(updateWrapper);
//添加或修改新的处理方
@ -1242,7 +1252,9 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
//添加指定处理结果
//处理方
addSurveRecord(aftersalesWorkOrderDTO, user, i);
getPartyEntity(aftersalesWorkOrderDTO,i,surveyRecordDTO);
AftersalesReplyingPartyEntity replyingPartyEntity = getPartyEntity(aftersalesWorkOrderDTO,i,surveyRecordDTO);
//添加待回复信息
aftersalesReplyingPartyService.save(replyingPartyEntity);
});
}

Loading…
Cancel
Save