|
|
|
@ -1119,6 +1119,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public Boolean updateBillPackeg(DistrilbutionBillLadingDTO distrilbutionBillLading) { |
|
|
|
|
List<Long> packageIds = new ArrayList<>(); |
|
|
|
|
List<Long> finalPackageIds = packageIds; |
|
|
|
|
distrilbutionBillLading.getBillPackageEntityList().stream().collect(Collectors.groupingBy(DistrilbutionBillPackageEntity::getStockArticleId)) |
|
|
|
|
.forEach((k, v) -> { |
|
|
|
|
List<DistrilbutionBillPackageEntity> list = distrilbutionBillPackageService.list(Wrappers.<DistrilbutionBillPackageEntity>query().lambda() |
|
|
|
@ -1153,7 +1155,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
billPackageEntity.setPacketNumber(1); |
|
|
|
|
billPackageEntity.setPacketBarStatus(1); |
|
|
|
|
packageEntityList.add(billPackageEntity); |
|
|
|
|
|
|
|
|
|
finalPackageIds.add(i.getParceListId()); |
|
|
|
|
}); |
|
|
|
|
distrilbutionBillPackageService.saveBatch(packageEntityList); |
|
|
|
|
List<Long> collect = packageEntityList.stream().map(i -> i.getParceListId()).collect(Collectors.toList()); |
|
|
|
@ -1176,10 +1178,30 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
.in("id", collect) |
|
|
|
|
.set("order_package_reservation_status", OrderPackageReservationStatusConstant.daiyuyue.getValue()) |
|
|
|
|
); |
|
|
|
|
packageIds.addAll(collect); |
|
|
|
|
if (!update) { |
|
|
|
|
throw new ServiceException("修改失败!!!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//维护订单状态
|
|
|
|
|
if (!packageIds.isEmpty()){ |
|
|
|
|
//查询所有的包件
|
|
|
|
|
packageIds = packageIds.stream().distinct().collect(Collectors.toList()); |
|
|
|
|
List<DistributionParcelListEntity> distributionParcelListEntities = distributionParcelListService.listByIds(packageIds); |
|
|
|
|
String orderCodes = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getOrderCode).collect(Collectors.joining(",")); |
|
|
|
|
List<Long> warehouseIds = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getWarehouseId).distinct().collect(Collectors.toList()); |
|
|
|
|
if (!warehouseIds.isEmpty()){ |
|
|
|
|
if (warehouseIds.size() == 1){ |
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(orderCodes,warehouseIds.get(0)); |
|
|
|
|
}else { |
|
|
|
|
log.error("#################自提订制品包件缺失warehouseId错误warehouseIds:{}",warehouseIds); |
|
|
|
|
throw new ServiceException("修改失败!!!"); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
log.error("#################自提订制品包件缺失warehouseId信息packageIds:{}",packageIds); |
|
|
|
|
throw new ServiceException("修改失败!!!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1252,6 +1274,14 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl<Distrilb
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = collect.get(i.getStockArticleId()).get(0); |
|
|
|
|
if (Func.isNotEmpty(stockArticleEntity)){ |
|
|
|
|
distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId()); |
|
|
|
|
}else { |
|
|
|
|
log.error("#########################修改自提单维护订单数据错误orderId:{}",i.getStockArticleId()); |
|
|
|
|
throw new RuntimeException("修改自提单维护订单数据错误"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
if (!longs.isEmpty()) { |
|
|
|
|
// distributionZeroPackageService.deleteLogic(longs);
|
|
|
|
|