|
|
|
@ -281,60 +281,60 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl<Trunk
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
QueryWrapper<TrunklineBillladingWaybillEntity> billladingWaybillEntityQueryWrapper = new QueryWrapper<>(); |
|
|
|
|
billladingWaybillEntityQueryWrapper.in("waybill_no",waybillNoSet) |
|
|
|
|
.eq("billlading_id",billladingId) |
|
|
|
|
.eq("is_deleted",0); |
|
|
|
|
|
|
|
|
|
List<TrunklineBillladingWaybillEntity> billladingWaybillEntityList = trunklineBillladingWaybillService.list(billladingWaybillEntityQueryWrapper); |
|
|
|
|
|
|
|
|
|
//把billladingWaybillEntityList转化成waybillNo为key的Map
|
|
|
|
|
Map<String, TrunklineBillladingWaybillEntity> billladingWaybillEntityMap = billladingWaybillEntityList.stream().collect(Collectors.toMap(TrunklineBillladingWaybillEntity::getWaybillNo, Function.identity())); |
|
|
|
|
|
|
|
|
|
List<TrunklineBillladingWaybillEntity> addList = new ArrayList<>(); |
|
|
|
|
List<TrunklineBillladingWaybillEntity> updateList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
final TrunklineBillladingWaybillEntity[] noWaybillData = {trunklineBillladingWaybillService.findNoWaybillNoData(billladingId)}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
waybillNoSet.forEach(waybillNo -> { |
|
|
|
|
Integer integer = waybillNoMNumMap.get(waybillNo); |
|
|
|
|
TrunklineBillladingWaybillEntity billladingWaybillEntity = billladingWaybillEntityMap.get(waybillNo); |
|
|
|
|
if(Objects.isNull(billladingWaybillEntity)){ |
|
|
|
|
//查询是否有一条无运单的数据
|
|
|
|
|
if(Objects.isNull(noWaybillData[0])){ |
|
|
|
|
noWaybillData[0] = new TrunklineBillladingWaybillEntity(); |
|
|
|
|
noWaybillData[0].setWarehouseId(warehouseId); |
|
|
|
|
noWaybillData[0].setWarehouseName(warehouseEntity.getName()); |
|
|
|
|
noWaybillData[0].setBillladingId(billladingId); |
|
|
|
|
noWaybillData[0].setBilladingCode(trunklineBillladingEntity.getBillladingCode()); |
|
|
|
|
noWaybillData[0].setWaybillNo("————"); |
|
|
|
|
noWaybillData[0].setRealNum(integer); |
|
|
|
|
noWaybillData[0].setRealWeight(BigDecimal.ZERO); |
|
|
|
|
noWaybillData[0].setRealVolume(BigDecimal.ZERO); |
|
|
|
|
}else{ |
|
|
|
|
Integer realNum = noWaybillData[0].getRealNum(); |
|
|
|
|
noWaybillData[0].setRealNum(realNum+integer); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
Integer realNum = billladingWaybillEntity.getRealNum(); |
|
|
|
|
billladingWaybillEntity.setRealNum(realNum + integer); |
|
|
|
|
updateList.add(billladingWaybillEntity); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
addList.add(noWaybillData[0]); |
|
|
|
|
|
|
|
|
|
trunklineBillladingWaybillService.saveBatch(addList); |
|
|
|
|
trunklineBillladingWaybillService.updateBatchById(updateList); |
|
|
|
|
|
|
|
|
|
TrunklineBillladingEntity billladingEntity = trunklineBillladingService.getById(billladingId); |
|
|
|
|
if(!Objects.isNull(billladingEntity)){ |
|
|
|
|
int realNum = billladingEntity.getRealNum(); |
|
|
|
|
Integer all = waybillNoMNumMap.values().stream().reduce(Integer::sum).get(); |
|
|
|
|
billladingEntity.setRealNum(realNum+all); |
|
|
|
|
trunklineBillladingService.updateById(billladingEntity); |
|
|
|
|
} |
|
|
|
|
// QueryWrapper<TrunklineBillladingWaybillEntity> billladingWaybillEntityQueryWrapper = new QueryWrapper<>();
|
|
|
|
|
// billladingWaybillEntityQueryWrapper.in("waybill_no",waybillNoSet)
|
|
|
|
|
// .eq("billlading_id",billladingId)
|
|
|
|
|
// .eq("is_deleted",0);
|
|
|
|
|
//
|
|
|
|
|
// List<TrunklineBillladingWaybillEntity> billladingWaybillEntityList = trunklineBillladingWaybillService.list(billladingWaybillEntityQueryWrapper);
|
|
|
|
|
//
|
|
|
|
|
// //把billladingWaybillEntityList转化成waybillNo为key的Map
|
|
|
|
|
// Map<String, TrunklineBillladingWaybillEntity> billladingWaybillEntityMap = billladingWaybillEntityList.stream().collect(Collectors.toMap(TrunklineBillladingWaybillEntity::getWaybillNo, Function.identity()));
|
|
|
|
|
//
|
|
|
|
|
// List<TrunklineBillladingWaybillEntity> addList = new ArrayList<>();
|
|
|
|
|
// List<TrunklineBillladingWaybillEntity> updateList = new ArrayList<>();
|
|
|
|
|
//
|
|
|
|
|
// final TrunklineBillladingWaybillEntity[] noWaybillData = {trunklineBillladingWaybillService.findNoWaybillNoData(billladingId)};
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// waybillNoSet.forEach(waybillNo -> {
|
|
|
|
|
// Integer integer = waybillNoMNumMap.get(waybillNo);
|
|
|
|
|
// TrunklineBillladingWaybillEntity billladingWaybillEntity = billladingWaybillEntityMap.get(waybillNo);
|
|
|
|
|
// if(Objects.isNull(billladingWaybillEntity)){
|
|
|
|
|
// //查询是否有一条无运单的数据
|
|
|
|
|
// if(Objects.isNull(noWaybillData[0])){
|
|
|
|
|
// noWaybillData[0] = new TrunklineBillladingWaybillEntity();
|
|
|
|
|
// noWaybillData[0].setWarehouseId(warehouseId);
|
|
|
|
|
// noWaybillData[0].setWarehouseName(warehouseEntity.getName());
|
|
|
|
|
// noWaybillData[0].setBillladingId(billladingId);
|
|
|
|
|
// noWaybillData[0].setBilladingCode(trunklineBillladingEntity.getBillladingCode());
|
|
|
|
|
// noWaybillData[0].setWaybillNo("————");
|
|
|
|
|
// noWaybillData[0].setRealNum(integer);
|
|
|
|
|
// noWaybillData[0].setRealWeight(BigDecimal.ZERO);
|
|
|
|
|
// noWaybillData[0].setRealVolume(BigDecimal.ZERO);
|
|
|
|
|
// }else{
|
|
|
|
|
// Integer realNum = noWaybillData[0].getRealNum();
|
|
|
|
|
// noWaybillData[0].setRealNum(realNum+integer);
|
|
|
|
|
// }
|
|
|
|
|
// }else{
|
|
|
|
|
// Integer realNum = billladingWaybillEntity.getRealNum();
|
|
|
|
|
// billladingWaybillEntity.setRealNum(realNum + integer);
|
|
|
|
|
// updateList.add(billladingWaybillEntity);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
//
|
|
|
|
|
// addList.add(noWaybillData[0]);
|
|
|
|
|
//
|
|
|
|
|
// trunklineBillladingWaybillService.saveBatch(addList);
|
|
|
|
|
// trunklineBillladingWaybillService.updateBatchById(updateList);
|
|
|
|
|
//
|
|
|
|
|
// TrunklineBillladingEntity billladingEntity = trunklineBillladingService.getById(billladingId);
|
|
|
|
|
// if(!Objects.isNull(billladingEntity)){
|
|
|
|
|
// int realNum = billladingEntity.getRealNum();
|
|
|
|
|
// Integer all = waybillNoMNumMap.values().stream().reduce(Integer::sum).get();
|
|
|
|
|
// billladingEntity.setRealNum(realNum+all);
|
|
|
|
|
// trunklineBillladingService.updateById(billladingEntity);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
waybillEntityMap.keySet().forEach(waybillNo -> { |
|
|
|
@ -367,8 +367,10 @@ public class TrunklineBillladingPackageServiceImpl extends BaseServiceImpl<Trunk
|
|
|
|
|
warehouseWaybillClient.updateList(warehouseWaybillEntities); |
|
|
|
|
|
|
|
|
|
//根据提货单id重新计算每个运单的费用
|
|
|
|
|
trunklineBillladingWaybillService.updateBillladingFeeByBillladingId(trunklineBillladingEntity); |
|
|
|
|
// trunklineBillladingWaybillService.updateBillladingFeeByBillladingId(trunklineBillladingEntity);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//--------------------------------------分割线------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
// QueryWrapper<TrunklineBillladingPackageEntity> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
// queryWrapper.eq("order_package_code",orderPackageCode);
|
|
|
|
|