|
|
|
@ -258,7 +258,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
aftersalesWorkOrder.getProcessorEntityList().forEach(i ->{ |
|
|
|
|
AftersalesProcessorEntity processor = addProcessor(aftersalesWorkOrder, myCurrentWarehouse, i); |
|
|
|
|
list.add(processor); |
|
|
|
|
//添加记录
|
|
|
|
|
//添加指派记录
|
|
|
|
|
if(ProcessorTypesOfStatusConstant.chulifang.getValue().equals(i.getTypesOf())){ |
|
|
|
|
//处理方
|
|
|
|
|
addSurveRecord(aftersalesWorkOrder, user, i); |
|
|
|
@ -372,6 +372,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public boolean addCompletionEnd(List<AftersalesWorkOrderDTO> aftersalesWorkOrder) { |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
if(ObjectUtil.isNull(aftersalesWorkOrder)){ |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
@ -385,6 +386,16 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
if(ObjectUtils.isNotNull(v.getCompletionRecipientEntities())){ |
|
|
|
|
completionRecipientService.saveBatch(v.getCompletionRecipientEntities()); |
|
|
|
|
} |
|
|
|
|
//添加跟踪记录
|
|
|
|
|
AftersaleSurveyRecordEntity surveyRecordEntity = new AftersaleSurveyRecordEntity(); |
|
|
|
|
AftersaleSurveyRecordDTO aftersaleSurveyRecordDTO = changName(v, user); |
|
|
|
|
BeanUtil.copyProperties(aftersaleSurveyRecordDTO,surveyRecordEntity); |
|
|
|
|
surveyRecordEntity.setTypesOf("1"); |
|
|
|
|
surveyRecordEntity.setDifference("3"); |
|
|
|
|
surveyRecordEntity.setWorkOrderId(v.getId()); |
|
|
|
|
String collect = v.getCompletionRecordEntities().stream().map(AftersalesCompletionRecordEntity::getIndemnitor).collect(Collectors.joining(",")); |
|
|
|
|
surveyRecordEntity.setProcessingResults(collect); |
|
|
|
|
aftersaleSurveyRecordService.save(surveyRecordEntity); |
|
|
|
|
}); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
@ -584,6 +595,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public R updateAssignCustomerService(AftersalesWorkOrderDTO aftersalesWorkOrderDTO) { |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
for (Long i : aftersalesWorkOrderDTO.getAssignList()) { |
|
|
|
|
//查询有没有指派过
|
|
|
|
|
AftersalesWorkOrderEntity workOrderEntity = baseMapper.selectById(i); |
|
|
|
@ -596,6 +608,15 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
aftersalesWorkOrder.setCustomerServiceName(aftersalesWorkOrderDTO.getCustomerServiceName()); |
|
|
|
|
aftersalesWorkOrder.setId(i); |
|
|
|
|
baseMapper.updateById(aftersalesWorkOrder); |
|
|
|
|
//添加跟踪数据
|
|
|
|
|
AftersaleSurveyRecordEntity surveyRecordEntity = new AftersaleSurveyRecordEntity(); |
|
|
|
|
AftersaleSurveyRecordDTO aftersaleSurveyRecordDTO = changName(aftersalesWorkOrderDTO, user); |
|
|
|
|
BeanUtil.copyProperties(aftersaleSurveyRecordDTO ,surveyRecordEntity); |
|
|
|
|
surveyRecordEntity.setDifference("3"); |
|
|
|
|
surveyRecordEntity.setTypesOf("1"); |
|
|
|
|
surveyRecordEntity.setWorkOrderId(i); |
|
|
|
|
surveyRecordEntity.setProcessingResults("指派客服"); |
|
|
|
|
aftersaleSurveyRecordService.save(surveyRecordEntity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return R.success("操作成功!!"); |
|
|
|
@ -799,6 +820,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
@Override |
|
|
|
|
public boolean updateArbitrate(AftersalesWorkOrderDTO aftersalesWorkOrder) { |
|
|
|
|
List<AftersalesArbitrationOrderEntity> arbitrationOrderList = new ArrayList<>(); |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
aftersalesWorkOrder.getAssignList().forEach(i ->{ |
|
|
|
|
AftersalesWorkOrderEntity aftersalesWorkOrderEntity = new AftersalesWorkOrderEntity(); |
|
|
|
|
aftersalesWorkOrderEntity.setId(i); |
|
|
|
@ -810,10 +832,20 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
aftersalesArbitrationOrderEntity.setOperateType("正常"); |
|
|
|
|
aftersalesArbitrationOrderEntity.setTypesOf(WorkOrderTypesOfStatusConstant.kaiqi.getValue()); |
|
|
|
|
arbitrationOrderList.add(aftersalesArbitrationOrderEntity); |
|
|
|
|
//添加跟踪记录
|
|
|
|
|
AftersaleSurveyRecordEntity surveyRecordEntity = new AftersaleSurveyRecordEntity(); |
|
|
|
|
AftersaleSurveyRecordDTO aftersaleSurveyRecordDTO = changName(aftersalesWorkOrder, user); |
|
|
|
|
BeanUtil.copyProperties(aftersaleSurveyRecordDTO,surveyRecordEntity); |
|
|
|
|
surveyRecordEntity.setDifference("3"); |
|
|
|
|
surveyRecordEntity.setTypesOf("1"); |
|
|
|
|
surveyRecordEntity.setWorkOrderId(i); |
|
|
|
|
surveyRecordEntity.setProcessingResults("申请仲裁"); |
|
|
|
|
aftersaleSurveyRecordService.save(surveyRecordEntity); |
|
|
|
|
}); |
|
|
|
|
if(!arbitrationOrderList.isEmpty()){ |
|
|
|
|
//添加仲裁记录
|
|
|
|
|
aftersalesArbitrationOrderService.saveBatch(arbitrationOrderList); |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
@ -824,7 +856,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public boolean addArbitrateEnd(AftersalesWorkOrderDTO aftersalesWorkOrder) { |
|
|
|
|
|
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
for (Long l : aftersalesWorkOrder.getAssignList()) { |
|
|
|
|
//查询工单的状态
|
|
|
|
|
AftersalesWorkOrderEntity workOrderEntity = baseMapper.selectById(l); |
|
|
|
@ -853,6 +885,17 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
lambdaUpdateWrapper.set(AftersalesArbitrationOrderEntity::getOperateType,"客服完结"); |
|
|
|
|
lambdaUpdateWrapper.set(AftersalesArbitrationOrderEntity::getTypesOf,WorkOrderTypesOfStatusConstant.jeishu.getValue()); |
|
|
|
|
aftersalesArbitrationOrderService.update(lambdaUpdateWrapper); |
|
|
|
|
|
|
|
|
|
//添加跟踪记录
|
|
|
|
|
AftersaleSurveyRecordEntity surveyRecordEntity = new AftersaleSurveyRecordEntity(); |
|
|
|
|
AftersaleSurveyRecordDTO aftersaleSurveyRecordDTO = changName(aftersalesWorkOrder, user); |
|
|
|
|
BeanUtil.copyProperties(aftersaleSurveyRecordDTO,surveyRecordEntity); |
|
|
|
|
surveyRecordEntity.setDifference("3"); |
|
|
|
|
surveyRecordEntity.setTypesOf("1"); |
|
|
|
|
surveyRecordEntity.setWorkOrderId(l); |
|
|
|
|
surveyRecordEntity.setProcessingResults("客服仲裁完结"); |
|
|
|
|
aftersaleSurveyRecordService.save(surveyRecordEntity); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
@ -888,8 +931,18 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
public boolean savaSurveyRecord(AftersalesWorkOrderDTO aftersalesWorkOrderDTO) { |
|
|
|
|
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
//查询处理方信息
|
|
|
|
|
AftersalesProcessorEntity one = aftersalesProcessorService.getOne(Wrappers.<AftersalesProcessorEntity>query().lambda() |
|
|
|
|
.eq(AftersalesProcessorEntity::getBusinessName, myCurrentWarehouse.getName()) |
|
|
|
|
.eq(AftersalesProcessorEntity::getWorkOrderId,aftersalesWorkOrderDTO.getId()) |
|
|
|
|
.eq(AftersalesProcessorEntity::getBusinessId, myCurrentWarehouse.getId()) |
|
|
|
|
.eq(AftersalesProcessorEntity::getTypesOf, ProcessorTypesOfStatusConstant.chulifang.getValue()) |
|
|
|
|
); |
|
|
|
|
if(ObjectUtils.isNull(one)){ |
|
|
|
|
throw new ServiceException("处理方信息不存在!!"); |
|
|
|
|
} |
|
|
|
|
//修改处理方 处理状态
|
|
|
|
|
updateProcessor(myCurrentWarehouse); |
|
|
|
|
updateProcessor(ProcessorProcessingStatusStatusConstant.yichuli.getValue(),one); |
|
|
|
|
|
|
|
|
|
//查询所有处理方
|
|
|
|
|
List<AftersalesProcessorEntity> list = aftersalesProcessorService.list(Wrappers.<AftersalesProcessorEntity>query().lambda() |
|
|
|
@ -903,7 +956,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
|
|
|
|
|
if(first.isPresent()){ |
|
|
|
|
//修改处理方 处理状态
|
|
|
|
|
updateProcessor(myCurrentWarehouse); |
|
|
|
|
updateProcessor(ProcessorProcessingStatusStatusConstant.daichuli.getValue(),first.get()); |
|
|
|
|
}else{ |
|
|
|
|
//不存在 添加处理方信息
|
|
|
|
|
AftersalesProcessorEntity processor = addProcessor(aftersalesWorkOrderDTO, myCurrentWarehouse, i); |
|
|
|
@ -920,8 +973,10 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
} |
|
|
|
|
//添加回复信息
|
|
|
|
|
AftersaleSurveyRecordDTO surveyRecordDTO = aftersalesWorkOrderDTO.getSurveyRecordDTO(); |
|
|
|
|
|
|
|
|
|
AftersaleSurveyRecordEntity surveyRecordEntity = new AftersaleSurveyRecordEntity(); |
|
|
|
|
BeanUtil.copyProperties(surveyRecordDTO,surveyRecordEntity); |
|
|
|
|
surveyRecordEntity.setProcessorId(one.getId()); |
|
|
|
|
surveyRecordEntity.setDifference("1"); |
|
|
|
|
aftersaleSurveyRecordService.save(surveyRecordEntity); |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
@ -952,17 +1007,26 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yichuli.getValue()); |
|
|
|
|
baseMapper.updateById(workOrderEntity); |
|
|
|
|
//修改处理方提交结果
|
|
|
|
|
LambdaUpdateWrapper<AftersalesProcessorEntity> q = new LambdaUpdateWrapper<>(); |
|
|
|
|
q.eq(AftersalesProcessorEntity::getBusinessName,myCurrentWarehouse.getName()); |
|
|
|
|
q.eq(AftersalesProcessorEntity::getBusinessId,myCurrentWarehouse.getId()); |
|
|
|
|
q.eq(AftersalesProcessorEntity::getTypesOf,ProcessorTypesOfStatusConstant.chulifang.getValue()); |
|
|
|
|
q.set(AftersalesProcessorEntity::getProcessingStatus,ProcessorProcessingStatusStatusConstant.tijiaofang.getValue()); |
|
|
|
|
aftersalesProcessorService.update(q); |
|
|
|
|
//添加处理结果
|
|
|
|
|
AftersalesProcessorEntity one = aftersalesProcessorService.getOne(Wrappers.<AftersalesProcessorEntity>query().lambda() |
|
|
|
|
.eq(AftersalesProcessorEntity::getWorkOrderId, aftersalesWorkOrderDTO.getId()) |
|
|
|
|
.eq(AftersalesProcessorEntity::getBusinessName, myCurrentWarehouse.getName()) |
|
|
|
|
.eq(AftersalesProcessorEntity::getBusinessId, myCurrentWarehouse.getId()) |
|
|
|
|
.eq(AftersalesProcessorEntity::getTypesOf, ProcessorTypesOfStatusConstant.chulifang.getValue()) |
|
|
|
|
); |
|
|
|
|
if(ObjectUtils.isNull(one)){ |
|
|
|
|
throw new ServiceException("处理方信息不存在!!"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
AftersalesProcessorEntity processor = new AftersalesProcessorEntity(); |
|
|
|
|
processor.setProcessingStatus(ProcessorProcessingStatusStatusConstant.tijiaofang.getValue()); |
|
|
|
|
processor.setId(one.getId()); |
|
|
|
|
aftersalesProcessorService.updateById(processor); |
|
|
|
|
|
|
|
|
|
//添加操作记录
|
|
|
|
|
// AftersaleSurveyRecordDTO aftersaleSurveyRecordDTO = new AftersaleSurveyRecordDTO();
|
|
|
|
|
AftersaleSurveyRecordDTO aftersaleSurveyRecordDTO = changName(aftersalesWorkOrderDTO, user); |
|
|
|
|
aftersaleSurveyRecordDTO.setTypesOf("1"); |
|
|
|
|
// aftersaleSurveyRecordDTO.setContent();
|
|
|
|
|
aftersaleSurveyRecordDTO.setProcessingResults(aftersalesProcessingResultsDTO.getResultType()); |
|
|
|
|
aftersaleSurveyRecordDTO.setDifference("3"); |
|
|
|
|
aftersaleSurveyRecordDTO.setWorkOrderId(aftersalesWorkOrderDTO.getId()); |
|
|
|
|
aftersaleSurveyRecordDTO.setFollowWarehouseId(myCurrentWarehouse.getId()); |
|
|
|
@ -1023,6 +1087,25 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
return workOrderVO; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 查询理赔集合 |
|
|
|
|
* @param aftersalesWorkOrder |
|
|
|
|
* @param page |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public IPage<AftersalesSettlementEntity> getListSettlement(Map<String, Object> aftersalesWorkOrder, IPage<Object> page) { |
|
|
|
|
AftersalesSettlementEntity aftersalesSettlementEntity = JSONObject.parseObject(JSONObject.toJSONString(aftersalesWorkOrder), AftersalesSettlementEntity.class); |
|
|
|
|
IPage<AftersalesSettlementEntity> iPage = baseMapper.getListSettlement(page,aftersalesSettlementEntity); |
|
|
|
|
iPage.getRecords().forEach(i ->{ |
|
|
|
|
i.setWorkOrderTypeName( DictBizCache.getValue(DictBizConstant.PC_WORK_ORDER,i.getWorkOrderType())); |
|
|
|
|
i.setDiscoveryNodeName( DictBizCache.getValue(DictBizConstant.PC_DISCOVERY_NODE,i.getDiscoveryNode())); |
|
|
|
|
i.setResulTypeName( DictBizCache.getValue(DictBizConstant.RESULT_HANDLING,i.getResulType())); |
|
|
|
|
i.setWorkOrderStatusName(DictBizCache.getValue(DictBizConstant.WORK_ORDER_STATUS,i.getWorkOrderStatus())); |
|
|
|
|
}); |
|
|
|
|
return iPage; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 添加处理处理方信息 |
|
|
|
|
* @param aftersalesWorkOrderDTO |
|
|
|
@ -1066,16 +1149,14 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 修改处理方状态 |
|
|
|
|
* @param myCurrentWarehouse |
|
|
|
|
* @param type |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private Boolean updateProcessor(BasicdataWarehouseEntity myCurrentWarehouse) { |
|
|
|
|
LambdaUpdateWrapper<AftersalesProcessorEntity> q = new LambdaUpdateWrapper<>(); |
|
|
|
|
q.eq(AftersalesProcessorEntity::getBusinessName,myCurrentWarehouse.getName()); |
|
|
|
|
q.eq(AftersalesProcessorEntity::getBusinessId,myCurrentWarehouse.getId()); |
|
|
|
|
q.eq(AftersalesProcessorEntity::getTypesOf,ProcessorTypesOfStatusConstant.chulifang.getValue()); |
|
|
|
|
q.set(AftersalesProcessorEntity::getProcessingStatus, ProcessorProcessingStatusStatusConstant.yichuli.getValue()); |
|
|
|
|
return aftersalesProcessorService.update(q); |
|
|
|
|
private Boolean updateProcessor(String type,AftersalesProcessorEntity one) { |
|
|
|
|
AftersalesProcessorEntity processor = new AftersalesProcessorEntity(); |
|
|
|
|
processor.setId(one.getId()); |
|
|
|
|
processor.setProcessingStatus(type); |
|
|
|
|
return aftersalesProcessorService.updateById(processor); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|