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 08a30f064..2d44917de 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 @@ -40,6 +40,7 @@ public interface IWarehouseUpdownGoodsClient { String TOP = API_PREFIX + "/top"; String SELECTSTOCKLISTOWE = API_PREFIX + "/selectStockListOwe"; String LOCATIONINFORMATION = API_PREFIX + "/locationInformation"; + String LOCATIONSTOCKLISTINFORMATION = API_PREFIX + "/locationStockListInformation"; // /** // *查询包条 @@ -79,4 +80,7 @@ public interface IWarehouseUpdownGoodsClient { */ @PostMapping(LOCATIONINFORMATION) WarehouseUpdownGoodsEntity getLocationInformation(@RequestBody WarehouseUpdownGoodsEntity updownGoodsEntity); + + @PostMapping(LOCATIONSTOCKLISTINFORMATION) + WarehouseUpdownGoodsEntity getLocationStockListInformation(@RequestBody WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity); } 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 278f23c18..ef88e4b45 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 @@ -26,6 +26,7 @@ import com.logpm.basicdata.feign.IBasicdataGoodsAreaClient; import com.logpm.distribution.bean.Resp; import com.logpm.distribution.dto.app.StockupDTO; import com.logpm.distribution.entity.*; +import com.logpm.distribution.mapper.DistributionStockListMapper; import com.logpm.distribution.service.*; import com.logpm.distribution.vo.*; import com.logpm.warehouse.entity.WarehouseGoodsAllocationEntity; @@ -87,6 +88,7 @@ public class DistributionStockupAppController extends BladeController { private final IWarehouseUpdownGoodsClient warehouseUpdownGoodsClient; private final IWarehouseUpdownGoodsLogClient warehouseUpdownGoodsLogClient; private final IWarehouseGoodsAllocationClient warehouseGoodsAllocationClient; + private IWarehouseUpdownTypeClient warehouseUpdownTypeClient; private IDistributionAsyncService distributionAsyncService; private final RabbitTemplate rabbitTemplate; @@ -323,7 +325,7 @@ public class DistributionStockupAppController extends BladeController { DistributionStockupStockListInfoVO infoVO = distributionStockupService.selectStockListInfoSelf(reservationId, stockListId,allocationId); return R.data(infoVO); } else { - DistributionStockupStockListInfoVO infoVO = distributionStockupService.selectStockListInfo(reservationId, stockListId); + DistributionStockupStockListInfoVO infoVO = distributionStockupService.selectStockListInfo(reservationId, stockListId,allocationId); return R.data(infoVO); } @@ -381,8 +383,15 @@ public class DistributionStockupAppController extends BladeController { log.warn("############备货库存品ID为空:{}",stockupDTO.getDeliveryDetailsId()); return R.fail(3002, "备货库存品ID不能为空"); } - List list = distributionStockupService.getLocationSelection(stockupDTO); - return R.data(list); + List list = distributionStockupService.getLocationSelection(stockupDTO); + if(!list.isEmpty()){ + return R.data(list); + } + List listMarket = distributionStockupService.getLocationMarketSelection(stockupDTO); + if(!listMarket.isEmpty()){ + return R.data(listMarket); + } + return R.data(null); } @@ -558,6 +567,7 @@ public class DistributionStockupAppController extends BladeController { String packetBarCode = stockupDTO.getPacketBarCode(); // String stockupArea = stockupDTO.getStockupArea();//备货区 Long stockupId = stockupDTO.getStockupId();//备货区 + Long allocationId = stockupDTO.getAllocationId();//备货区 Integer stockPrint = stockupDTO.getStockPrint(); // 库存 if (StringUtil.isBlank(packetBarCode)) { @@ -580,6 +590,10 @@ public class DistributionStockupAppController extends BladeController { log.warn("##################stockupScan: 库存品扫码,类型为空"); return R.fail("库存品扫码:类型不能为空"); } + if (Objects.isNull(allocationId)) { + log.warn("##################allocationId: 货位ID为空!"); + return R.fail("货位ID不能为空"); + } Integer i = distributionStockupService.selectPackagePrint(stockupDTO); switch (i) { @@ -592,7 +606,8 @@ public class DistributionStockupAppController extends BladeController { //先保存扫码包件信息,后续由队列来出来余下补充信息 DistributionStockEntity entity = new DistributionStockEntity(); entity.setCoding(packetBarCode); -// entity.setStockupArea(stockupArea); + DistributionStockupEntity byId1 = distributionStockupService.getById(stockupId); + entity.setStockupArea(byId1.getStockupArea()); entity.setStockupId(stockupId); if(stockupEntity.getTypeService().equals("3")){ entity.setBillLadingId(reservationId); @@ -606,24 +621,31 @@ 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); -// if(!ObjectUtils.isNull(l)){ -// //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); -// } + WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity(); + warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId()); + warehouseUpdownGoodsEntity.setIncomingBatch(byId.getIncomingBatch()); + warehouseUpdownGoodsEntity.setMarketId(byId.getMarketId()); + warehouseUpdownGoodsEntity.setAssociationType("4"); + WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity); + if(!ObjectUtils.isNull(locationInformation)){ + entity.setAllocationTitle(locationInformation.getPositionCode()); + entity.setAllocationId(stockupDTO.getAllocationId()); + //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",stockupDTO.getAllocationId()); + List list = new ArrayList<>(); + list.add(jsonObject); + R r = warehouseUpdownTypeClient.downStock(list); + log.debug("下架状态:{}",r.getMsg()); + }else{ + return R.fail(3002,"本货位的物料已为0,请更换货位继续!!"); + } + }else{ + return R.fail(3002,"物料信息查询失败,请联系TJJ!!"); } entity.setConditions("0"); entity.setType(2); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java index a313d4400..7bcd849a0 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java @@ -43,7 +43,7 @@ public class StockupDTO implements Serializable { private String cargoUnit;//单位 private Long userId;//当前操作人 - private String deliveryDetailsId;//当前操作人 + private String deliveryDetailsId;//订单库存ID //扫码参数 private Integer scanType;//备货扫码类型 1 包件 2库存品 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml index 9c58e8b21..73e754a28 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml @@ -217,29 +217,24 @@ +