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 == 2 "> and laa.types_of in ('0','1','2') </if>
</where>
Order by laa.create_time desc
Order by lawo.create_time,laa.create_time desc
</select>
</mapper>

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

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

Loading…
Cancel
Save