Browse Source

售后BUG修复

visual
汤建军 3 months ago
parent
commit
132d6c9df7
  1. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml
  2. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml
  3. 82
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

2
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesAppealMapper.xml

@ -71,7 +71,7 @@
<if test="param.identifying != null and param.identifying == 1 "> and laa.types_of in ('0','1','2','3') </if> <if test="param.identifying != null and param.identifying == 1 "> and laa.types_of in ('0','1','2','3') </if>
<if test="param.identifying != null and param.identifying == 2 "> and laa.types_of in ('0','1','2') </if> <if test="param.identifying != null and param.identifying == 2 "> and laa.types_of in ('0','1','2') </if>
</where> </where>
Order by laa.create_time desc Order by lawo.create_time,laa.create_time desc
</select> </select>
</mapper> </mapper>

2
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml

@ -500,6 +500,8 @@
</where> </where>
GROUP BY GROUP BY
lawo.id lawo.id
ORDER BY
lawo.create_time DESC
</select> </select>
<select id="selectAllAftersalesWorkOrderList" <select id="selectAllAftersalesWorkOrderList"

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

@ -108,6 +108,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
private final AftersalesCustomerMallMapper aftersalesCustomerMallMapper; private final AftersalesCustomerMallMapper aftersalesCustomerMallMapper;
private final IUserSearchClient userSearchClient; private final IUserSearchClient userSearchClient;
private final IBasicdataStoreBusinessClient basicdataStoreBusinessClient; private final IBasicdataStoreBusinessClient basicdataStoreBusinessClient;
private final IAftersalesProcessingMoneyService aftersalesProcessingMoneyService;
// private final IAftersalesWorkOrderService aftersalesWorkOrderService; // private final IAftersalesWorkOrderService aftersalesWorkOrderService;
@Override @Override
@ -119,8 +120,8 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
@Override @Override
public List<AftersalesWorkOrderExcel> exportAftersalesWorkOrder(Map<String, Object> aftersalesWorkOrder) { public List<AftersalesWorkOrderExcel> exportAftersalesWorkOrder(Map<String, Object> aftersalesWorkOrder) {
String o = (String) aftersalesWorkOrder.get("ids"); String o = (String) aftersalesWorkOrder.get("ids");
if (!Objects.isNull(o)){ if (!Objects.isNull(o)) {
aftersalesWorkOrder.put("ids",o); aftersalesWorkOrder.put("ids", o);
} }
//查询用户角色信息 //查询用户角色信息
BladeUser user = AuthUtil.getUser(); BladeUser user = AuthUtil.getUser();
@ -354,17 +355,13 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}); });
} }
//添加处理结果
if (ObjectUtils.isNotNull(aftersalesWorkOrder.getAftersalesProcessingResultsDTO()) && ObjectUtils.isNotNull(aftersalesWorkOrder.getAftersalesProcessingResultsDTO().getCompensationMethod())) {
aftersalesWorkOrder.setWorkOrderStatus(WorkOrderStatusConstant.chulijeiguoyitianxei.getValue());
}
if (!Func.isEmpty(aftersalesWorkOrder.getVehicleRoute())) { if (!Func.isEmpty(aftersalesWorkOrder.getVehicleRoute())) {
if (aftersalesWorkOrder.getVehicleRoute().indexOf("&gt;") > 0) { if (aftersalesWorkOrder.getVehicleRoute().indexOf("&gt;") > 0) {
String string = aftersalesWorkOrder.getVehicleRoute().replaceAll("&gt;", ">"); String string = aftersalesWorkOrder.getVehicleRoute().replaceAll("&gt;", ">");
aftersalesWorkOrder.setVehicleRoute(string); aftersalesWorkOrder.setVehicleRoute(string);
} }
} }
baseMapper.insert(aftersalesWorkOrder); baseMapper.insert(aftersalesWorkOrder);
} else { } else {
//修改 //修改
@ -570,9 +567,10 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
// completionRecordService.saveBatch(aftersalesWorkOrder.getCompletionRecordEntities()); // completionRecordService.saveBatch(aftersalesWorkOrder.getCompletionRecordEntities());
} }
//添加处理结果 //添加处理结果
if (ObjectUtils.isNotNull(aftersalesWorkOrder.getAftersalesProcessingResultsDTO()) && ObjectUtils.isNotNull(aftersalesWorkOrder.getAftersalesProcessingResultsDTO().getCompensationMethod())) { if (ObjectUtils.isNotNull(aftersalesWorkOrder.getAftersalesProcessingResultsDTO())) {
addProcessingResults(aftersalesWorkOrder); addProcessingResults(aftersalesWorkOrder);
} }
return true; return true;
} }
@ -908,7 +906,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)) { if (Func.isEmpty(myCurrentWarehouse)) {
log.warn(">>>>myCurrentWarehouse {}",myCurrentWarehouse); log.warn(">>>>myCurrentWarehouse {}", myCurrentWarehouse);
} }
Optional<DictBiz> matchingDictBiz = warehouseType.stream() Optional<DictBiz> matchingDictBiz = warehouseType.stream()
@ -946,7 +944,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
// 查询收款方 // 查询收款方
LambdaQueryWrapper<AftersalesCompletionRecipientEntity> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<AftersalesCompletionRecipientEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.in(AftersalesCompletionRecipientEntity::getWorkOrderId,workOrderIds); queryWrapper.in(AftersalesCompletionRecipientEntity::getWorkOrderId, workOrderIds);
List<AftersalesCompletionRecipientEntity> list = completionRecipientService.list(queryWrapper); List<AftersalesCompletionRecipientEntity> list = completionRecipientService.list(queryWrapper);
// 收款方分组 // 收款方分组
@ -954,7 +952,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
// 查询赔款方 // 查询赔款方
LambdaQueryWrapper<AftersalesCompletionRecordEntity> queryWrapper1 = new LambdaQueryWrapper<>(); LambdaQueryWrapper<AftersalesCompletionRecordEntity> queryWrapper1 = new LambdaQueryWrapper<>();
queryWrapper1.in(AftersalesCompletionRecordEntity::getWorkOrderId,workOrderIds); queryWrapper1.in(AftersalesCompletionRecordEntity::getWorkOrderId, workOrderIds);
List<AftersalesCompletionRecordEntity> list1 = completionRecordService.list(queryWrapper1); List<AftersalesCompletionRecordEntity> list1 = completionRecordService.list(queryWrapper1);
// 赔款方付款分组 // 赔款方付款分组
Map<Long, List<AftersalesCompletionRecordEntity>> collect1 = list1.stream().collect(Collectors.groupingBy(AftersalesCompletionRecordEntity::getWorkOrderId)); Map<Long, List<AftersalesCompletionRecordEntity>> collect1 = list1.stream().collect(Collectors.groupingBy(AftersalesCompletionRecordEntity::getWorkOrderId));
@ -962,8 +960,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
IPage<AftersalesWorkOrderVO> data = AftersalesWorkOrderWrapper.build().pageVO(iPage); IPage<AftersalesWorkOrderVO> data = AftersalesWorkOrderWrapper.build().pageVO(iPage);
data.getRecords().forEach(i -> updateDepartStatus(i, user,myCurrentWarehouse,collect,collect1)); data.getRecords().forEach(i -> updateDepartStatus(i, user, myCurrentWarehouse, collect, collect1));
return data; return data;
@ -1081,8 +1078,8 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
} }
private void updateDepartStatus(AftersalesWorkOrderVO workOrder, BladeUser user, BasicdataWarehouseEntity myCurrentWarehouse private void updateDepartStatus(AftersalesWorkOrderVO workOrder, BladeUser user, BasicdataWarehouseEntity myCurrentWarehouse
,Map<Long, List<AftersalesCompletionRecipientEntity>> collect, Map<Long, List<AftersalesCompletionRecordEntity>> collect1 , Map<Long, List<AftersalesCompletionRecipientEntity>> collect, Map<Long, List<AftersalesCompletionRecordEntity>> collect1
) { ) {
if (ObjectUtils.isNotNull(workOrder.getCustomerServiceId())) { if (ObjectUtils.isNotNull(workOrder.getCustomerServiceId())) {
R<List<User>> listR = userSearchClient.listByUser(String.valueOf(workOrder.getCustomerServiceId())); R<List<User>> listR = userSearchClient.listByUser(String.valueOf(workOrder.getCustomerServiceId()));
if (ObjectUtils.isNotNull(listR.getData())) { if (ObjectUtils.isNotNull(listR.getData())) {
@ -1094,16 +1091,16 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
}); });
} }
} }
Long id =null; Long id = null;
if(ObjectUtils.isNotNull(myCurrentWarehouse)){ if (ObjectUtils.isNotNull(myCurrentWarehouse)) {
id=myCurrentWarehouse.getId(); id = myCurrentWarehouse.getId();
} }
workOrder.setTotalAmount(completionRecordService.getTotalMoney(workOrder)); workOrder.setTotalAmount(completionRecordService.getTotalMoney(workOrder));
if(myCurrentWarehouse!=null){ if (myCurrentWarehouse != null) {
List<AftersalesCompletionRecipientEntity> aftersalesCompletionRecipientEntities = collect.get(workOrder.getId()); List<AftersalesCompletionRecipientEntity> aftersalesCompletionRecipientEntities = collect.get(workOrder.getId());
if(ObjectUtils.isNotNull(aftersalesCompletionRecipientEntities)){ if (ObjectUtils.isNotNull(aftersalesCompletionRecipientEntities)) {
for (AftersalesCompletionRecipientEntity aftersalesProcessorEntity : aftersalesCompletionRecipientEntities) { for (AftersalesCompletionRecipientEntity aftersalesProcessorEntity : aftersalesCompletionRecipientEntities) {
if(myCurrentWarehouse.getId().equals(aftersalesProcessorEntity.getWarehouseId())){ if (myCurrentWarehouse.getId().equals(aftersalesProcessorEntity.getWarehouseId())) {
workOrder.setCanRepresentations(1); workOrder.setCanRepresentations(1);
break; break;
} }
@ -1111,9 +1108,9 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
} }
} }
List<AftersalesCompletionRecordEntity> aftersalesCompletionRecipientEntities1 = collect1.get(workOrder.getId()); List<AftersalesCompletionRecordEntity> aftersalesCompletionRecipientEntities1 = collect1.get(workOrder.getId());
if(ObjectUtils.isNotNull(aftersalesCompletionRecipientEntities1)){ if (ObjectUtils.isNotNull(aftersalesCompletionRecipientEntities1)) {
for (AftersalesCompletionRecordEntity aftersalesCompletionRecipientEntity : aftersalesCompletionRecipientEntities1) { for (AftersalesCompletionRecordEntity aftersalesCompletionRecipientEntity : aftersalesCompletionRecipientEntities1) {
if(myCurrentWarehouse.getId().equals(aftersalesCompletionRecipientEntity.getWarehouseId())){ if (myCurrentWarehouse.getId().equals(aftersalesCompletionRecipientEntity.getWarehouseId())) {
workOrder.setCanRepresentations(1); workOrder.setCanRepresentations(1);
break; break;
} }
@ -1304,18 +1301,11 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
Iterator<AftersalesProcessorEntity> iterator = list.iterator(); Iterator<AftersalesProcessorEntity> iterator = list.iterator();
while (iterator.hasNext()) { while (iterator.hasNext()) {
AftersalesProcessorEntity next = iterator.next(); AftersalesProcessorEntity next = iterator.next();
if (ProcessorProcessingStatusStatusConstant.daichuli.getValue().equals(next.getProcessingStatus()) AftersalesProcessorVO processorVO = new AftersalesProcessorVO();
|| ProcessorProcessingStatusStatusConstant.yichuli.getValue().equals(next.getProcessingStatus())) { BeanUtil.copyProperties(next, processorVO);
AftersalesProcessorVO processorVO = new AftersalesProcessorVO(); processorVOS.add(processorVO);
BeanUtil.copyProperties(next, processorVO);
processorVOS.add(processorVO);
} else {
iterator.remove();
}
} }
} }
aftersalesWorkOrderVO.setProcessorVOList(processorVOS); aftersalesWorkOrderVO.setProcessorVOList(processorVOS);
//查询包件 //查询包件
@ -1389,7 +1379,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
List<AftersalesPersonResponsibleEntity> list3 = aftersalesPersonResponsibleService.list(Wrappers.<AftersalesPersonResponsibleEntity>query().lambda() List<AftersalesPersonResponsibleEntity> list3 = aftersalesPersonResponsibleService.list(Wrappers.<AftersalesPersonResponsibleEntity>query().lambda()
.eq(AftersalesPersonResponsibleEntity::getWordOrderId, aftersalesWorkOrder.getId()) .eq(AftersalesPersonResponsibleEntity::getWordOrderId, aftersalesWorkOrder.getId())
); );
if (!list.isEmpty()) { if (!list3.isEmpty()) {
List<AftersalesPersonResponsibleVO> personResponsibleVOList = new ArrayList<>(); List<AftersalesPersonResponsibleVO> personResponsibleVOList = new ArrayList<>();
list3.forEach(i -> { list3.forEach(i -> {
AftersalesPersonResponsibleVO personResponsibleVO = new AftersalesPersonResponsibleVO(); AftersalesPersonResponsibleVO personResponsibleVO = new AftersalesPersonResponsibleVO();
@ -1884,27 +1874,41 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
if (byId.getWorkOrderStatus().equals(WorkOrderStatusConstant.yichuli.getValue())) { if (byId.getWorkOrderStatus().equals(WorkOrderStatusConstant.yichuli.getValue())) {
throw new ServiceException("当前异常工单已处理!"); throw new ServiceException("当前异常工单已处理!");
} }
//添加处理结果 //添加处理结果
AftersalesProcessingResultsDTO aftersalesProcessingResultsDTO = aftersalesWorkOrderDTO.getAftersalesProcessingResultsDTO(); AftersalesProcessingResultsDTO aftersalesProcessingResultsDTO = aftersalesWorkOrderDTO.getAftersalesProcessingResultsDTO();
aftersalesProcessingResultsDTO.setWorkOrderId(aftersalesWorkOrderDTO.getId()); aftersalesProcessingResultsDTO.setWorkOrderId(aftersalesWorkOrderDTO.getId());
if (ObjectUtils.isNotNull(aftersalesProcessingResultsDTO.getCompensationMethod())) {
//处理赔付方式
aftersalesProcessingResultsDTO.setCompensationMethod(aftersalesProcessingResultsDTO.getCompensationMethod());
}
aftersalesProcessingResultsDTO.setWarehouseId(aftersalesWorkOrderDTO.getWarehouseId());
aftersalesProcessingResultsService.ownSaveOrUpdate(aftersalesProcessingResultsDTO); aftersalesProcessingResultsService.ownSaveOrUpdate(aftersalesProcessingResultsDTO);
//修改异常工单处理信息! //修改异常工单处理信息!
AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity(); AftersalesWorkOrderEntity workOrderEntity = new AftersalesWorkOrderEntity();
workOrderEntity.setId(aftersalesWorkOrderDTO.getId()); workOrderEntity.setId(aftersalesWorkOrderDTO.getId());
// if(!byId.getWorkOrderStatus().equals(WorkOrderStatusConstant.lipeijineweichu.getValue())){
// workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.chulijeiguoyitianxei.getValue());
// }
//是否为已提交 //是否为已提交
if ("1".equals(aftersalesWorkOrderDTO.getResultIdentification())) { if ("1".equals(aftersalesWorkOrderDTO.getResultIdentification())) {
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yichuli.getValue()); workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.yichuli.getValue());
} else { } else {
if (!Objects.isNull(aftersalesProcessingResultsDTO.getResultType())) {
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.lipeijineweichu.getValue());
}
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.chulijeiguoyitianxei.getValue()); workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.chulijeiguoyitianxei.getValue());
} }
//是否为已提交 //是否为已提交
if ("1".equals(aftersalesWorkOrderDTO.getClaimIdentification())) { // if ("1".equals(aftersalesWorkOrderDTO.getClaimIdentification())) {
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.lipeijineweichu.getValue()); // workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.lipeijineweichu.getValue());
// }
if (!Objects.isNull(aftersalesWorkOrderDTO.getResultIdentification())) {
if ("2".equals(aftersalesWorkOrderDTO.getResultIdentification())) {
workOrderEntity.setWorkOrderStatus(WorkOrderStatusConstant.lipeijineweichu.getValue());
}
} }
workOrderEntity.setCompletionName(myCurrentWarehouse.getName()); workOrderEntity.setCompletionName(myCurrentWarehouse.getName());
workOrderEntity.setCompletionId(myCurrentWarehouse.getId()); workOrderEntity.setCompletionId(myCurrentWarehouse.getId());
baseMapper.updateById(workOrderEntity); baseMapper.updateById(workOrderEntity);

Loading…
Cancel
Save