From e292b1d2492f9803b5fc3fbd595b7339db8d3fec Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080@qq.com> Date: Sat, 11 Nov 2023 11:56:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BA=93=E5=AD=98=E5=93=81?= =?UTF-8?q?=E6=89=AB=E6=8F=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionDeliveryListEntity.java | 6 ++ .../DistributionStockupAppController.java | 85 +++++++++++++------ .../mapper/DistributionDeliveryListMapper.xml | 3 +- 3 files changed, 68 insertions(+), 26 deletions(-) diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryListEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryListEntity.java index 1d29b482c..bb7408aa9 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryListEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionDeliveryListEntity.java @@ -260,6 +260,12 @@ public class DistributionDeliveryListEntity extends TenantEntity { @ApiModelProperty(value = "备注") private String remarks; + /** + * 客户名称 + */ + @ApiModelProperty(value = "客户名称") + private String clineName; + 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 5f025ec57..d604e0af6 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 @@ -48,6 +48,7 @@ import org.springblade.common.constant.stockup.StockupStatusConstant; import org.springblade.common.constant.stockup.StockupTypeStatusConstant; import org.springblade.common.utils.CommonUtil; import org.springblade.core.boot.ctrl.BladeController; +import org.springblade.core.log.exception.ServiceException; import org.springblade.core.redis.cache.BladeRedis; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; @@ -705,17 +706,41 @@ public class DistributionStockupAppController extends BladeController { } //判断是否可以继续备货 DistributionStockListEntity byId = iDistributionStockListService.getById(stockListId); - WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity(); - warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId()); - warehouseUpdownGoodsEntity.setIncomingBatch(byId.getIncomingBatch()); - warehouseUpdownGoodsEntity.setMarketId(byId.getMarketId()); - warehouseUpdownGoodsEntity.setAssociationId(byId.getMaterialId()); - warehouseUpdownGoodsEntity.setAssociationType("4"); - warehouseUpdownGoodsEntity.setWarehouseId(byId.getWarehouseId()); - List locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity); - if(locationInformation.isEmpty()){ - return Resp.scanFail("当前货位的库存品已为零,请更换货位继续!!", "当前货位的库存品已为零,请更换货位继续!!"); + List locationInformation ; + if(byId.getSourceType().equals("2")){ + //导入 + WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity(); + warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId()); + warehouseUpdownGoodsEntity.setIncomingBatch(byId.getIncomingBatch()); + warehouseUpdownGoodsEntity.setMarketId(byId.getMarketId()); + warehouseUpdownGoodsEntity.setAssociationId(byId.getMaterialId()); + warehouseUpdownGoodsEntity.setAssociationType("4"); + warehouseUpdownGoodsEntity.setWarehouseId(byId.getWarehouseId()); + locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity); + if(locationInformation.isEmpty()){ + return Resp.scanFail("当前货位的库存品已为零,请更换货位继续!!", "当前货位的库存品已为零,请更换货位继续!!"); + } + }else{ + //查询包件信息 + List list = distributionParcelListService.list(Wrappers.query().lambda() + .eq(DistributionParcelListEntity::getOrderPackageCode, packetBarCode) + .eq(DistributionParcelListEntity::getOrderCode, byId.getIncomingBatch()) + .eq(DistributionParcelListEntity::getWarehouseId, byId.getWarehouseId()) + ); + if(ObjectUtils.isNotNull(list) && list.size() > 1){ + throw new ServiceException("查询到重复包条信息!!"); + } + WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity(); + warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId()); + warehouseUpdownGoodsEntity.setAssociationId(list.get(0).getId()); + warehouseUpdownGoodsEntity.setAssociationType("4"); + warehouseUpdownGoodsEntity.setWarehouseId(byId.getWarehouseId()); + locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity); + if(locationInformation.isEmpty()){ + return Resp.scanFail("当前货位没有该包件信息!!", "当前货位没有该包件信息!!"); + } } + Integer i = distributionStockupService.selectPackagePrint(stockupDTO); switch (i) { case 1: @@ -750,20 +775,32 @@ public class DistributionStockupAppController extends BladeController { // warehouseUpdownGoodsEntity.setAssociationType("4"); // WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationStockListInformation(warehouseUpdownGoodsEntity); if(!locationInformation.isEmpty()){ - entity.setAllocationTitle(locationInformation.get(0).getPositionCode()); - entity.setAllocationId(stockupDTO.getAllocationId()); - //todo 待下架操作 - JSONObject jsonObject = new JSONObject(); - jsonObject.put("marketId",byId.getMarketId()); - jsonObject.put("materialCode",byId.getMarketCode()); - jsonObject.put("warehouseId",byId.getWarehouseId()); - 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()); + if(byId.getServiceType().equals("2")){ + //导入下架 + entity.setAllocationTitle(locationInformation.get(0).getPositionCode()); + entity.setAllocationId(stockupDTO.getAllocationId()); + //todo 待下架操作 + JSONObject jsonObject = new JSONObject(); + jsonObject.put("marketId",byId.getMarketId()); + jsonObject.put("materialCode",byId.getMarketCode()); + jsonObject.put("warehouseId",byId.getWarehouseId()); + 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); + if(r.getCode() != 200){ + log.debug("##########"+r.getMsg()); + return Resp.scanFail("下架失败,请联系管理员!!","下架失败,请联系管理员!!"); + } + }else{ + R r = warehouseUpdownTypeClient.downPackage(packetBarCode, byId.getWarehouseId()); + if(r.getCode() != 200){ + log.debug("##########"+r.getMsg()); + return Resp.scanFail("下架失败,请联系管理员!!","下架失败,请联系管理员!!"); + } + } }else{ return Resp.scanFail("本货位的物料已为0,请更换货位继续!!","本货位的物料已为0,请更换货位继续!!"); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml index a160712dd..53ffd586f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml @@ -190,8 +190,7 @@ WHERE lddl.id = lds.delivery_id ) scannedNumber - FROM - logpm_distribution_delivery_list lddl + FROM logpm_distribution_delivery_list lddl lddl.is_deleted = 0