From fd3e133a1a47dfd09bc9c39d7783880781896643 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Fri, 10 May 2024 19:18:37 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=9B=B4=E6=96=B0=E8=AE=A2=E5=8D=95=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=9B=B4=E6=96=B0=202.=E6=8F=90=E8=BF=87=E9=80=9A?= =?UTF-8?q?=E8=BF=87=E6=9A=82=E5=AD=98=E5=8D=95=E5=8C=85=E4=BB=B6=E7=A0=81?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=BF=90=E5=8D=95=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/IWarehouseWaybillClient.java | 4 ++ .../DistributionStockArticleServiceImpl.java | 67 ++++++++++--------- .../mapper/TrunklineAdvanceDetailMapper.xml | 1 + .../service/impl/OpenOrderServiceImpl.java | 5 +- .../impl/TrunklineCarsLoadServiceImpl.java | 8 ++- .../feign/WarehouseWaybillClient.java | 5 ++ .../mapper/WarehouseWaybillMapper.java | 3 + .../mapper/WarehouseWaybillMapper.xml | 10 +++ .../service/IWarehouseWaybillService.java | 2 + .../impl/WarehouseWaybillServiceImpl.java | 5 ++ 10 files changed, 75 insertions(+), 35 deletions(-) diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java index bf7f08f66..12e23cf76 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseWaybillClient.java @@ -83,4 +83,8 @@ public interface IWarehouseWaybillClient { @PostMapping(API_PREFIX + "/updateWaybillFreezeStatusByWaybillIds") void updateWaybillFreezeStatusByWaybillIds(@RequestBody List waybillIds); + + @GetMapping(API_PREFIX+"/findWaybillEntityByOrderPackageCode") + WarehouseWaybillEntity findWaybillEntityByOrderPackageCode(@RequestParam String orderPackageCode); + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java index 03d80f041..a5c239159 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java @@ -1472,26 +1472,14 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl 0 && reservationNum < totalNumber) { stockArticleEntity.setReservationStatus("20"); @@ -1531,13 +1515,32 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl 0 && groundingNum < totalNumber) { stockArticleEntity.setGroundingStatus("20"); } else { stockArticleEntity.setGroundingStatus("30"); } + + if(signNum.equals(0)){ + if(outNum.equals(0)){ + stockArticleEntity.setOrderStatus("20"); + }else{ + if(outNum.equals(totalNumber)){ + stockArticleEntity.setOrderStatus("40"); + }else{ + stockArticleEntity.setOrderStatus("30"); + } + } + }else{ + + if(signNum.equals(totalNumber)){ + stockArticleEntity.setOrderStatus("80"); + }else{ + stockArticleEntity.setOrderStatus("70"); + } + } } stockArticleEntity.setIncomingNum(incomingNum); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml index 2354dffcd..a64eb3e5f 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml @@ -33,6 +33,7 @@ ltad.system_type systemType, ltad.weight weight, ltad.volume volume, + ltad.advance_id advanceId, ltad.incoming_warehouse_name incomingWarehouseName from logpm_trunkline_advance_detail ltad left join logpm_trunkline_advance lta on lta.id = ltad.advance_id diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java index d2efce6b8..040e55aeb 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java @@ -30,6 +30,7 @@ import com.logpm.warehouse.entity.WarehouseWaybillEntity; import com.logpm.warehouse.feign.IWarehouseWaybillClient; import com.logpm.warehouse.feign.IWarehouseWaybillDetailClient; import com.logpm.warehouse.vo.WarehouseWaybillVO; +import io.seata.spring.annotation.GlobalTransactional; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springblade.common.constant.CodeNumConstant; @@ -329,7 +330,8 @@ public class OpenOrderServiceImpl implements IOpenOrderService { return R.success("验证成功"); } -// @Transactional(rollbackFor = ServiceException.class) + @GlobalTransactional + @Transactional(rollbackFor = Exception.class) @Override public R openWaybill(OpenOrderDTO openOrderDTO) { log.info("############openWaybill: 开单开始 openOrderDTO={}", openOrderDTO); @@ -460,6 +462,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { waybillEntity.setAbolishStatus(0); waybillEntity.setFreezeStatus(0); Long waybillId = warehouseWaybillClient.addEnntity(waybillEntity); + waybillEntity.setId(waybillId); if (!Objects.isNull(waybillId)) { log.info("#################openWaybill: 运单保存成功"); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index e061a4324..818fb12ee 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -3579,6 +3579,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl carsLoadScanEntities = loadScanEntityListHasDataNoTrayMap.get(e); + if(ObjectUtil.isNull(orderId)){ //没有id DistributionStockArticleEntity stockArticleEntity = stockArticleMap.get(e); @@ -3603,7 +3605,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl carsLoadScanEntities = loadScanEntityListHasDataNoTrayMap.get(e); + Long finalOrderId = orderId; carsLoadScanEntities.forEach(p -> { Long fromWarehouseId = p.getFromWarehouseId(); @@ -3697,6 +3699,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl { //判断是否有已经有order了 Long orderId = finalOrderCodes1.get(e); + List carsLoadScanList = carsLoadScanEntitiesMap.get(e); + if(ObjectUtil.isNull(orderId)){ //没有id DistributionStockArticleEntity stockArticleEntity = stockArticleMap.get(e); @@ -3720,7 +3724,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl carsLoadScanList = carsLoadScanEntitiesMap.get(e); + Long finalOrderId = orderId; carsLoadScanList.forEach(p -> { DistributionParcelListEntity parcelListEntity = parcelListMap.get(p.getScanCode()); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java index 57233e107..f0dc00988 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/feign/WarehouseWaybillClient.java @@ -104,4 +104,9 @@ public class WarehouseWaybillClient implements IWarehouseWaybillClient { .in("id",waybillIds); warehouseWaybillService.update(updateWrapper); } + + @Override + public WarehouseWaybillEntity findWaybillEntityByOrderPackageCode(String orderPackageCode) { + return warehouseWaybillService.findWaybillEntityByOrderPackageCode(orderPackageCode); + } } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java index 49bb389a9..9f1c12957 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.java @@ -58,4 +58,7 @@ public interface WarehouseWaybillMapper extends BaseMapper findWaybillBillladingList(@Param("waybillNo") String waybillNo,@Param("warehouseId") Long warehouseId); List findFreezeOrAbolishByWaybillNos(@Param("waybillNos") List waybillNos); + + WarehouseWaybillEntity findWaybillEntityByOrderPackageCode(@Param("orderPackageCode") String orderPackageCode); + } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml index 53547d8e9..03798b08f 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml @@ -300,4 +300,14 @@ + + + diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java index f82d0aba9..7776f388b 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseWaybillService.java @@ -69,4 +69,6 @@ public interface IWarehouseWaybillService extends BaseService printBatch(String ids, String tempId) throws Exception; List findFreezeOrAbolishByWaybillNos(List waybillNos); + + WarehouseWaybillEntity findWaybillEntityByOrderPackageCode(String orderPackageCode); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java index 8d5946f1d..5ac7d6d41 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java @@ -798,6 +798,11 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl warehouseWayBillDetails, BasicPrintTemplateEntity template) throws Exception { PrintPreviewVO printPreviewVO = new PrintPreviewVO(); String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl());