From 29d6f6c634337474ef773e597efe6b6cf1a70dcf Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Tue, 17 Dec 2024 16:32:57 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A2=9E=E8=82=8C=E8=87=AA=E6=8F=90=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E7=9A=84=E5=8F=96=E6=B6=88=E4=BD=9C=E4=B8=9A=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E6=B6=88=E6=81=AF=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/BasicdataVehicleEntity.java | 3 +- .../DistrilbutionBillLadingServiceImpl.java | 147 ++++++++++++------ 2 files changed, 101 insertions(+), 49 deletions(-) diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehicleEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehicleEntity.java index 1467a7bc3..1b195dcb7 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehicleEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehicleEntity.java @@ -319,5 +319,6 @@ public class BasicdataVehicleEntity extends TenantEntity { @ApiModelProperty(value = "预留5") private String reserve5; - + @ApiModelProperty(value = "车型id") + private Long vehicleModelId; } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java index 1be7a2dfb..bdfc5fb70 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java @@ -21,6 +21,7 @@ import cn.hutool.core.date.DateUtil; import cn.hutool.json.JSONUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.Wrapper; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; @@ -600,10 +601,36 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(DistrilbutionBillPackageEntity::getBillLadingId, distrilbutionBillLading.getId()); + wrapper.ne(DistrilbutionBillPackageEntity::getPacketBarStatus, 2);// 不查询取消的 + List list = distrilbutionBillPackageService.list(wrapper); + packageEntityList.addAll(list); // 将目前修改后的包件加入集合中 + + // 查询自提任务的零担 + LambdaQueryWrapper lambdaQueryWrapper =new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(DistributionReservationZeroPackageEntity::getReservationId, distrilbutionBillLading.getId()); + lambdaQueryWrapper.ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, 2); + List list1 = distributionZeroPackageService.list(lambdaQueryWrapper); + zeroPackageEntityList.addAll(list1); + + // 查询库存 + + LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); + wrapper1.eq(DistributionDeliveryDetailsEntity::getBillLadingId, distrilbutionBillLading.getId()); + wrapper1.ne(DistributionDeliveryDetailsEntity::getInventoryStatus, 2); + List list2 = distributionDeliveryDetailsService.list(wrapper1); + detailsEntities.addAll(list2); + } else { //设置lockey String lockKey = "lock:" + distrilbutionBillLading.getStockArticleId(); @@ -1047,14 +1074,17 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl deliveryOfPickupPlanFeiVOList = new ArrayList<>(); - listEntity.forEach(t -> { - DeliveryOfPickupPlanFeiVO deliveryOfPickupPlanFeiVO = new DeliveryOfPickupPlanFeiVO(); - deliveryOfPickupPlanFeiVO.setCost(t.getCost()); - String deliveryType = DictBizCache.getValue("deliveryType", deliveryOfPickupPlanFeiVO.getCost()); - deliveryOfPickupPlanFeiVO.setCostName(deliveryType); - deliveryOfPickupPlanFeiVO.setMoney(t.getMoney()); - deliveryOfPickupPlanFeiVOList.add(deliveryOfPickupPlanFeiVO); - }); + if(listEntity!=null){ + listEntity.forEach(t -> { + DeliveryOfPickupPlanFeiVO deliveryOfPickupPlanFeiVO = new DeliveryOfPickupPlanFeiVO(); + deliveryOfPickupPlanFeiVO.setCost(t.getCost()); + String deliveryType = DictBizCache.getValue("deliveryType", deliveryOfPickupPlanFeiVO.getCost()); + deliveryOfPickupPlanFeiVO.setCostName(deliveryType); + deliveryOfPickupPlanFeiVO.setMoney(t.getMoney()); + deliveryOfPickupPlanFeiVOList.add(deliveryOfPickupPlanFeiVO); + }); + + } deliveryOfPickupPlanVO.setDeliveryOfPickupPlanFeiVOList(deliveryOfPickupPlanFeiVOList); @@ -1065,61 +1095,72 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl zeroPackageEntityList, List packageDataList) { - zeroPackageEntityList.forEach(t -> { - PackageData packageData = new PackageData(); - packageData.setPackageType(PackageTypeEnums.LTL); - packageData.setNumber(t.getQuantity()); - DistributionParcelListEntity byId = distributionParcelListService.getById(t.getParcelListId()); - if (Func.isNotEmpty(byId)) { - packageData.setOrderCode(byId.getOrderCode()); - if (Func.isEmpty(byId.getBrandName())) { - DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(byId.getStockArticleId()); - if (ObjectUtils.isNotNull(stockArticleEntity)) { - packageData.setBrand(stockArticleEntity.getBrand()); + if(zeroPackageEntityList!=null){ + zeroPackageEntityList.forEach(t -> { + + PackageData packageData = new PackageData(); + packageData.setPackageType(PackageTypeEnums.LTL); + packageData.setNumber(t.getQuantity()); + DistributionParcelListEntity byId = distributionParcelListService.getById(t.getParcelListId()); + if (Func.isNotEmpty(byId)) { + packageData.setOrderCode(byId.getOrderCode()); + if (Func.isEmpty(byId.getBrandName())) { + DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(byId.getStockArticleId()); + if (ObjectUtils.isNotNull(stockArticleEntity)) { + packageData.setBrand(stockArticleEntity.getBrand()); + } + } else { + packageData.setBrand(byId.getBrandName()); } - } else { - packageData.setBrand(byId.getBrandName()); + packageData.setWaybillNumber(byId.getWaybillNumber()); } - packageData.setWaybillNumber(byId.getWaybillNumber()); - } - packageData.setProductName(t.getCategoryName()); - packageDataList.add(packageData); + packageData.setProductName(t.getCategoryName()); + packageDataList.add(packageData); + + }); + } + - }); } private void buildPackageDataByStockExtracted(List detailsEntities, List packageDataList) { - detailsEntities.forEach(t -> { - PackageData packageData = new PackageData(); - Long stockListId = t.getStockListId(); - DistributionStockListEntity byId = distributionStockListService.getById(stockListId); - if (byId != null) { - packageData.setPickupBatch(byId.getIncomingBatch()); - packageData.setBrand(byId.getBrandName()); - packageData.setMaterialName(byId.getDescriptionGoods()); - packageData.setMallName(byId.getMarketName()); - packageData.setMaterialCode(byId.getCargoNumber()); - packageData.setNumber(t.getQuantity()); - packageData.setPackageType(PackageTypeEnums.INV); + if(detailsEntities!=null){ + detailsEntities.forEach(t -> { + PackageData packageData = new PackageData(); + Long stockListId = t.getStockListId(); + DistributionStockListEntity byId = distributionStockListService.getById(stockListId); + if (byId != null) { + packageData.setPickupBatch(byId.getIncomingBatch()); + packageData.setBrand(byId.getBrandName()); + packageData.setMaterialName(byId.getDescriptionGoods()); + packageData.setMallName(byId.getMarketName()); + packageData.setMaterialCode(byId.getCargoNumber()); + packageData.setNumber(t.getQuantity()); + packageData.setPackageType(PackageTypeEnums.INV); - } - packageDataList.add(packageData); + } + packageDataList.add(packageData); + + }); + } - }); } private void buildPackageByBillPackageExtracted(List packageEntityList, List packageDataList) { - packageEntityList.forEach(t -> { - PackageData packageData = new PackageData(); - packageData.setPackageCode(t.getPacketBarCode()); - packageData.setNumber(1); - packageData.setPackageType(PackageTypeEnums.CMP); - packageDataList.add(packageData); + if(packageEntityList!=null){ + packageEntityList.forEach(t -> { + PackageData packageData = new PackageData(); + packageData.setPackageCode(t.getPacketBarCode()); + packageData.setNumber(1); + packageData.setPackageType(PackageTypeEnums.CMP); + packageDataList.add(packageData); + + }); + } - }); } @@ -1252,12 +1293,22 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl