From 50c04f9209b6ff0cdeaf8c9a7d27333dabcc1c58 Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080@qq.com> Date: Wed, 20 Sep 2023 16:58:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=87=E8=B4=A7=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E8=87=AA=E6=8F=90=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/DistributionStockEntity.java | 8 ++ .../vo/DistributionStockupSelfVO.java | 1 + .../vo/DistributionStockupVO.java | 1 + .../feign/IWarehouseUpdownGoodsClient.java | 6 + .../DistributionStockupAppController.java | 19 ++- .../mapper/DistributionParcelListMapper.java | 3 + .../mapper/DistributionParcelListMapper.xml | 25 +++- .../mapper/DistributionStockMapper.xml | 4 +- .../mapper/DistrilbutionBillStockMapper.java | 2 +- .../mapper/DistrilbutionBillStockMapper.xml | 4 +- .../IDistributionParcelListService.java | 7 + .../IDistrilbutionBillStockService.java | 2 +- .../DistributionParcelListServiceImpl.java | 5 + .../impl/DistributionStockServiceImpl.java | 2 +- .../impl/DistributionStockupServiceImpl.java | 131 +++++++++++++----- .../DistrilbutionBillStockServiceImpl.java | 2 +- .../feign/WarehouseUpdownGoodsClient.java | 11 +- 17 files changed, 183 insertions(+), 50 deletions(-) diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java index 81bf71fd6..07f4a88ac 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockEntity.java @@ -159,6 +159,14 @@ public class DistributionStockEntity extends TenantEntity { @ApiModelProperty(value = "备货区") private String stockupArea; + /** + * 货位Id + */ + @ApiModelProperty(value = "货位Id") + private Long allocationId; + + @ApiModelProperty(value = "货位名称") + private String allocationTitle; @ApiModelProperty(value = "备货区Id") private Long stockupId; diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupSelfVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupSelfVO.java index f4f5372d2..33a660f71 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupSelfVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupSelfVO.java @@ -21,6 +21,7 @@ public class DistributionStockupSelfVO { private Long lwugId; // 货位ID private Long ldsId; // 扫码ID private Long allocationId; // 货位ID + private Long parcelListId; // 包件ID } diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupVO.java index f7d0f394d..14c7f3ab5 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockupVO.java @@ -41,6 +41,7 @@ public class DistributionStockupVO extends DistributionStockupEntity { private String warehouseName; //仓库名称 //备货人 private String stockupUser; + private Long stockupId; private String stockupStatusName; //备货状态 private String stockupStatus; diff --git a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownGoodsClient.java b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownGoodsClient.java index 840c91100..08a30f064 100644 --- a/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownGoodsClient.java +++ b/blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/feign/IWarehouseUpdownGoodsClient.java @@ -39,6 +39,7 @@ public interface IWarehouseUpdownGoodsClient { String API_PREFIX = "updownGoods/client"; String TOP = API_PREFIX + "/top"; String SELECTSTOCKLISTOWE = API_PREFIX + "/selectStockListOwe"; + String LOCATIONINFORMATION = API_PREFIX + "/locationInformation"; // /** // *查询包条 @@ -73,4 +74,9 @@ public interface IWarehouseUpdownGoodsClient { */ @PostMapping(SELECTSTOCKLISTOWE) Long selectStockListOwe(@RequestBody WarehouseUpdownGoodsEntity updownGoodsEntity); + /** + * 查询某个库存品所在的库位 + */ + @PostMapping(LOCATIONINFORMATION) + WarehouseUpdownGoodsEntity getLocationInformation(@RequestBody WarehouseUpdownGoodsEntity updownGoodsEntity); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java index df2403323..247ccbaa2 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java @@ -28,7 +28,9 @@ import com.logpm.distribution.dto.app.StockupDTO; import com.logpm.distribution.entity.*; import com.logpm.distribution.service.*; import com.logpm.distribution.vo.*; +import com.logpm.warehouse.entity.WarehouseGoodsAllocationEntity; import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity; +import com.logpm.warehouse.feign.IWarehouseGoodsAllocationClient; import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient; import com.logpm.warehouse.feign.IWarehouseUpdownGoodsLogClient; import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient; @@ -83,6 +85,7 @@ public class DistributionStockupAppController extends BladeController { private final IDistributionReservationPackageService distributionReservationPackageService; private final IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient; private final IWarehouseUpdownGoodsLogClient warehouseUpdownGoodsLogClient; + private final IWarehouseGoodsAllocationClient warehouseGoodsAllocationClient; private IDistributionAsyncService distributionAsyncService; private final RabbitTemplate rabbitTemplate; @@ -447,13 +450,16 @@ public class DistributionStockupAppController extends BladeController { .eq(DistributionParcelListEntity::getOrderPackageCode, stockupDTO.getPacketBarCode()) ); entity.setOrderSelfNumbering(one.getOrderCode()); + entity.setStockArticle(one.getStockArticleId()); entity.setCoding(packetBarCode); -// entity.setStockupArea(stockupArea); +// entity.setStockupArea(stockupArea); entity.setStockupId(stockupId); + entity.setParcelListId(one.getId()); if (distributionStockupEntity.getTypeService().equals("3")) { entity.setBillLadingId(reservationId); + DistributionStockupEntity byId = distributionStockupService.getById(stockupId); + entity.setStockupArea(byId.getStockupArea()); - entity.setParcelListId(one.getId()); //修改包件备货状态 one.setOrderPackageStockupStatus(StockupStatusConstant.yibeihuo.getValue()); //todo 待下架操作 @@ -462,6 +468,15 @@ public class DistributionStockupAppController extends BladeController { }else{ entity.setReservationId(reservationId); } + if(ObjectUtils.isNotNull(stockupDTO.getAllocationId())){ +// warehouseUpdownGoodsClient.selectMsgBywrap(); + WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity(); + warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId()); + warehouseUpdownGoodsEntity.setAssociationValue(stockupDTO.getPacketBarCode()); + WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationInformation(warehouseUpdownGoodsEntity); + entity.setAllocationTitle(locationInformation.getPositionCode()); + entity.setAllocationId(stockupDTO.getAllocationId()); + } entity.setConditions("0"); entity.setType(2); distributionStockService.save(entity); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java index d1044914d..dd4850544 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.java @@ -91,6 +91,9 @@ public interface DistributionParcelListMapper extends BaseMapper selectOrderInfoSelfList(@Param("param") StockupDTO stockupDTO); + + List selectOrderInfoSelfAllocationList(@Param("param") StockupDTO stockupDTO); + List selectOrderInfoAllocationList(@Param("param") StockupDTO stockupDTO); List findALLNoUpShelfPackageByOrderCode(@Param("orderCode") String orderCode,@Param("orderCode") Long warehouseId); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml index e5c04c779..ac4172d1d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml @@ -180,6 +180,29 @@ + select lwugl.position_code,lwugl.allocation_id from logpm_distribution_stock lds - LEFT JOIN logpm_warehouse_updown_goods_log lwugl on lds.parcel_list_id = lwugl.association_id and lwugl.binding_type = 2 and lwugl.create_time >= DATE_SUB(NOW(), INTERVAL 1 HOUR) + LEFT JOIN logpm_warehouse_updown_goods_log lwugl on lds.parcel_list_id = lwugl.association_id and lwugl.binding_type = 2 and lwugl.create_time >= DATE_SUB(NOW(), INTERVAL 10 MINUTE) where lds.reservation_id = #{reservationId} and lds.stockup_id = #{stockupId} and lds.parcel_list_id = #{parcelListId} GROUP BY lwugl.create_time ,lwugl.position_code,lwugl.allocation_id LIMIT 1 @@ -107,7 +107,7 @@