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 af16013b2..74929194e 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 @@ -69,7 +69,7 @@ public interface IDistributionStockArticleClient { void addHandQuantity(@RequestParam("id") Long id,@RequestParam("num") int num); @GetMapping(API_PREFIX + "/findByOrderSelfNum") - DistributionStockArticleEntity findByOrderSelfNum(@RequestParam String waybillNo); + DistributionStockArticleEntity findByOrderSelfNum(@RequestParam String orderCode,@RequestParam Long warehouseId); @GetMapping(API_PREFIX + "/deleteById") void deleteById(@RequestParam Long orderId); @@ -77,8 +77,8 @@ public interface IDistributionStockArticleClient { @GetMapping(API_PREFIX + "/submitHandQuantity") void submitHandQuantity(@RequestParam Integer allNum,@RequestParam Long articleId); - @GetMapping(API_PREFIX + "/likeOrderSelfNumbering") - List likeOrderSelfNumbering(@RequestParam String orderSelfNum); + @GetMapping(API_PREFIX + "/findListByOrderCodeLike") + List findListByOrderCodeLike(@RequestParam String orderCode); @GetMapping(API_PREFIX + "/findStockArticleByOrderCode") DistributionStockArticleEntity findStockArticleByOrderCode(@RequestParam String orderCode); 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 7f8f9df67..639986d33 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 @@ -98,9 +98,10 @@ public class DistributionStockArticleClient implements IDistributionStockArticle } @Override - public DistributionStockArticleEntity findByOrderSelfNum(String waybillNo) { + public DistributionStockArticleEntity findByOrderSelfNum(String orderCode,Long warehouseId) { QueryWrapper queryWrapper = new QueryWrapper<>(); - queryWrapper.eq("waybill_number",waybillNo); + queryWrapper.eq("order_code",orderCode) + .eq("warehouse_id",warehouseId); return distributionStockArticleService.getOne(queryWrapper); } @@ -127,9 +128,8 @@ public class DistributionStockArticleClient implements IDistributionStockArticle } @Override - @GetMapping(API_PREFIX + "/likeOrderSelfNumbering") - public List likeOrderSelfNumbering(String orderSelfNum) { - return distributionStockArticleService.likeOrderSelfNumbering(orderSelfNum); + public List findListByOrderCodeLike(String orderCode) { + return distributionStockArticleService.findListByOrderCodeLike(orderCode); } @Override 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 1140d0fd6..d974cd400 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 @@ -177,4 +177,6 @@ public interface DistributionStockArticleMapper extends BaseMapper getOrderListByWaybill(@Param("waybillNumber") String waybillNumber); + + List findListByOrderCodeLike(@Param("orderCode") String orderCode); } 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 49488b181..88cbb17d0 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 @@ -66,7 +66,14 @@ + + + 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 8fe7de884..e884a75e6 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 @@ -227,4 +227,6 @@ public interface IDistributionStockArticleService extends BaseService findListByOrderCodeLike(String orderCode); } 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 f3bbf326f..c0b38fea3 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 @@ -1729,6 +1729,11 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl findListByOrderCodeLike(String orderCode) { + return baseMapper.findListByOrderCodeLike(orderCode); + } + @Override public DistributionStockArticleEntity findZeroByOrderCodeAndWarehouseId(String orderCode, Long warehouseId) { diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java index 915324f7f..c6b513c97 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java @@ -716,11 +716,12 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService { String waybillNo = warehouseWaybill.getWaybillNo(); Long waybillId = warehouseWaybill.getId(); String destinationWarehouse = warehouseWaybill.getDestinationWarehouseName();//目的仓 + Long destinationWarehouseId = warehouseWaybill.getDestinationWarehouseId(); Integer totalCount = warehouseWaybill.getTotalCount();//订单总数量 Integer stockCount = warehouseWaybill.getStockCount();//订单在库数量 String consignee = warehouseWaybill.getConsignee(); - BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.findByName(destinationWarehouse); - DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleClient.findByOrderSelfNum(waybillNo); + BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(destinationWarehouseId); + DistributionStockArticleEntity distributionStockArticleEntity = distributionStockArticleClient.findByOrderSelfNum(waybillNo,destinationWarehouseId); BasicdataClientEntity clientEntity = basicdataClientClient.findByName(consignee); Date date = new Date(); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml index 6fa9fdd01..37cb5259f 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadScanMapper.xml @@ -350,7 +350,7 @@ left join logpm_distribution_parcel_list ldpl on ldpl.order_package_code = ltcls.scan_code and ldpl.warehouse_id = ltcls.from_warehouse_id where ltcls.load_id = #{loadId} and ltcls.warehouse_id = #{warehouseId} - and ltcls.order_code = #{ordeCode} + and ltcls.order_code = #{orderCode} and ltcls.waybill_no = #{waybillNo} group by ldpl.firsts @@ -362,7 +362,7 @@ left join logpm_distribution_parcel_list ldpl on ldpl.order_package_code = ltcls.scan_code and ldpl.warehouse_id = ltcls.from_warehouse_id where ltcls.load_id = #{loadId} and (ltcls.final_node_id = #{warehouseId} or ltcls.unload_node_id = #{warehouseId}) - and ltcls.order_code = #{ordeCode} + and ltcls.order_code = #{orderCode} and ltcls.waybill_no = #{waybillNo} group by ldpl.firsts 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 bf9ffd283..be3e44246 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 @@ -726,6 +726,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl waybillNoList; + } 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 6b90127fb..661c79b82 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 @@ -151,6 +151,12 @@ #{item} + + and (departure_warehouse_id = #{param.warehouseId} or destination_warehouse_id = #{param.warehouseId}) + + + and waybill_no = #{param.waybillNo} + order by create_time desc 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 8e8dcac17..199dc18b7 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 @@ -181,11 +181,12 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl products = splitOrderDTO.getProducts(); + for (ProductDTO product : products) { + total = total+ product.getSplitNum(); + } + } + + if(handQuantity < total){ + log.warn("##############splitOrder: 在库件数不足"); + throw new CustomerException(405,"在库件数不足"); + } + + String orderCode = distributionStockArticleEntity.getOrderCode(); Long orderId = distributionStockArticleEntity.getId(); Long warehouseId = distributionStockArticleEntity.getWarehouseId(); List submitList = new ArrayList<>(); - List articleList = distributionStockArticleClient.likeOrderSelfNumbering(orderSelfNum); - List parcelListEntityList = distributionParcelListClient.findEntityListByOrderCode(orderSelfNum, warehouseId); + List articleList = distributionStockArticleClient.findListByOrderCodeLike(orderCode); + List parcelListEntityList = distributionParcelListClient.findEntityListByOrderCode(orderCode, 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(); BeanUtil.copyProperties(distributionStockArticleEntity, entity); + entity.setId(null); entity.setOrderCode(entity.getOrderCode() + "-" + size); entity.setCustomerName(splitOrderDTO.getCustomerPerson()); entity.setCustomerTelephone(splitOrderDTO.getCustomerMobile()); @@ -444,6 +459,7 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl