diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java index 02bbf3795..0d293de12 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionStockArticleClient.java @@ -101,4 +101,7 @@ public interface IDistributionStockArticleClient { @GetMapping(API_PREFIX + "/findShelfNumByOrderCodeAndWarehouseId") Map findShelfNumByOrderCodeAndWarehouseId(@RequestParam String orderCode, @RequestParam Long warehouseId); + + @GetMapping(API_PREFIX + "/submitHandleNumByOrderId") + void submitHandleNumByOrderId(@RequestParam Integer subNum, @RequestParam Long articleId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java index 7ca004af3..049aaf615 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionStockArticleClient.java @@ -186,4 +186,9 @@ public class DistributionStockArticleClient implements IDistributionStockArticle return distributionStockArticleService.findShelfNumByOrderCodeAndWarehouseId(orderCode,warehouseId); } + @Override + public void submitHandleNumByOrderId(Integer subNum, Long articleId) { + distributionStockArticleService.submitHandleNumByOrderId(subNum,articleId); + } + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java index 7e1989161..f377861bf 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java @@ -115,4 +115,6 @@ public interface DistributionStockArticleMapper extends BaseMapper selectListGrounding(@Param("ids")List ids); Map findShelfNumByOrderCodeAndWarehouseId(@Param("orderCode")String orderCode, @Param("warehouseId")Long warehouseId); + + void submitHandleNumByOrderId(@Param("subNum") Integer subNum, @Param("articleId") Long articleId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml index 73e6a9cb9..e7b096db3 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml @@ -663,5 +663,11 @@ AND warehouse_id = #{warehouseId} + + update logpm_distribution_stock_article + set hand_quantity = hand_quantity - #{subNum} + where id = #{articleId} + and hand_quantity - #{subNum} >= 0 + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java index 56a3f9fa4..63fb3dd53 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java @@ -182,4 +182,6 @@ public interface IDistributionStockArticleService extends BaseService selectTemplate(List ids); Map findShelfNumByOrderCodeAndWarehouseId(String orderCode, Long warehouseId); + + void submitHandleNumByOrderId(Integer subNum, Long articleId); } 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 fdb474a8a..fc5c5a543 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 @@ -1241,6 +1241,11 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl 30) { 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 7e77cc81c..3be4b1940 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 @@ -395,6 +395,7 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl articleList = distributionStockArticleClient.likeOrderSelfNumbering(orderSelfNum); List parcelListEntityList = distributionParcelListClient.findEntityListByOrderCode(orderSelfNum, warehouseId); int size = articleList.size(); + Integer subNum = 0; for (int i = 0; i < splitOrderDTOList.size(); i++) { SplitOrderDTO splitOrderDTO = splitOrderDTOList.get(i); DistributionStockArticleEntity entity = new DistributionStockArticleEntity(); @@ -497,9 +498,13 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl