From 76f9ff7c796d2707255e485cd9a26f8e2bfc5bfd Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080@qq.com> Date: Fri, 8 Sep 2023 17:15:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=87=E8=B4=A7=E6=89=AB?= =?UTF-8?q?=E7=A0=81=E4=B8=8B=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../distribution/vo/StockListInfoListVO.java | 3 + .../feign/IWarehouseUpdownGoodsClient.java | 10 ++ .../DistributionStockupAppController.java | 30 +++++- .../mapper/DistributionStockListMapper.xml | 10 +- .../mapper/DistributionStockupMapper.xml | 2 +- .../service/IDistributionAsyncService.java | 5 + .../impl/DistributionAsyncServiceImpl.java | 79 ++++++++++++++++ .../impl/DistributionStockupServiceImpl.java | 10 ++ .../DistrilbutionBillLadingServiceImpl.java | 91 +++---------------- .../feign/WarehouseUpdownGoodsClient.java | 16 ++++ 10 files changed, 170 insertions(+), 86 deletions(-) diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/StockListInfoListVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/StockListInfoListVO.java index 8487a508d..cc27836e8 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/StockListInfoListVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/StockListInfoListVO.java @@ -3,11 +3,14 @@ package com.logpm.distribution.vo; import lombok.Data; import java.io.Serializable; +import java.util.Date; @Data public class StockListInfoListVO implements Serializable { private String packageCode; private String name; + private Date createTime; + } 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 096b7c9fc..840c91100 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 @@ -17,9 +17,12 @@ package com.logpm.warehouse.feign; +import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity; import org.springblade.common.constant.ModuleNameConstant; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; /** @@ -35,6 +38,7 @@ public interface IWarehouseUpdownGoodsClient { String API_PREFIX = "updownGoods/client"; String TOP = API_PREFIX + "/top"; + String SELECTSTOCKLISTOWE = API_PREFIX + "/selectStockListOwe"; // /** // *查询包条 @@ -63,4 +67,10 @@ public interface IWarehouseUpdownGoodsClient { */ @GetMapping(TOP + "/selectCountByArea") Integer selectCountByArea(@RequestParam("ids") String ids); + + /** + *查询某个库存品所在的库位 + */ + @PostMapping(SELECTSTOCKLISTOWE) + Long selectStockListOwe(@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 f6ef6cc0a..ecb6bec4b 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 @@ -16,6 +16,8 @@ */ package com.logpm.distribution.appcontroller; + +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -26,12 +28,16 @@ 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.WarehouseUpdownGoodsEntity; +import com.logpm.warehouse.feign.IWarehouseUpdownGoodsClient; +import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.RabbitConstant; +import org.springblade.common.constant.stockup.StockupStatusConstant; import org.springblade.common.utils.CommonUtil; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.secure.utils.AuthUtil; @@ -67,6 +73,8 @@ public class DistributionStockupAppController extends BladeController { private final IDistributionStockArticleService distributionStockArticleService; private final IDistributionParcelListService distributionParcelListService; private final IDistributionReservationPackageService distributionReservationPackageService; + private final IWarehouseUpdownTypeClient warehouseUpdownTypeClient; + private final IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient; private final RabbitTemplate rabbitTemplate; private final IDistributionStockListService iDistributionStockListService; @@ -130,7 +138,6 @@ public class DistributionStockupAppController extends BladeController { /** * 对象转map * @param object - * @return * @throws IllegalAccessException */ public static Map convertObjectToMap(Object object) throws IllegalAccessException { @@ -424,6 +431,11 @@ public class DistributionStockupAppController extends BladeController { .eq(DistributionParcelListEntity::getOrderCode, stockupDTO.getOrderCode()) ); entity.setParcelListId(one.getId()); + //修改包件备货状态 + one.setOrderPackageStockupStatus(StockupStatusConstant.yibeihuo.getValue()); + //todo 待下架操作 + warehouseUpdownTypeClient.downPackage(stockupDTO.getPacketBarCode()); + distributionParcelListService.updateById(one); }else{ entity.setReservationId(reservationId); } @@ -521,6 +533,22 @@ public class DistributionStockupAppController extends BladeController { if(ObjectUtils.isNotNull(byId.getMarketId())){ entity.setMarketId(byId.getMarketId()); entity.setMaterialId(byId.getMaterialId()); + //查询库位id + WarehouseUpdownGoodsEntity updownGoods = new WarehouseUpdownGoodsEntity(); + updownGoods.setAssociationId(byId.getId()); + updownGoods.setMarketId(byId.getMarketId()); + updownGoods.setIncomingBatch(byId.getIncomingBatch()); + Long l = warehouseUpdownGoodsClient.selectStockListOwe(updownGoods); + //todo 待下架操作 + JSONObject jsonObject = new JSONObject(); + jsonObject.put("marketId",byId.getMarketId()); + jsonObject.put("materialCode",byId.getMarketCode()); + jsonObject.put("incomingBatch",byId.getIncomingBatch()); + jsonObject.put("enterNum",1); + jsonObject.put("allocationId",l); + List list = new ArrayList<>(); + list.add(jsonObject); + warehouseUpdownTypeClient.downStock(list); } entity.setConditions("0"); entity.setType(2); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml index f763f9c6f..26d4ecf7a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml @@ -220,22 +220,22 @@