From 2af1941a5c10f959688072a101e3df576cd94cfb Mon Sep 17 00:00:00 2001 From: "0.0" <1092404103.qq.com> Date: Mon, 25 Sep 2023 19:54:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E6=89=98=E7=9B=98?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BasicMaterialController.java | 16 ++++++++++++++++ .../api/WarehouseUpdownTypeApiController.java | 7 ++++++- .../WarehouseGoodsAllocationController.java | 6 +++--- .../WarehouseGoodsAllocationServiceImpl.java | 1 - .../impl/WarehouseUpdownTypeServiceImpl.java | 2 +- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicMaterialController.java b/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicMaterialController.java index b66206926..aec7feece 100644 --- a/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicMaterialController.java +++ b/blade-service/logpm-basic/src/main/java/com/logpm/basic/controller/BasicMaterialController.java @@ -45,6 +45,7 @@ import springfox.documentation.annotations.ApiIgnore; import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -175,6 +176,21 @@ public class BasicMaterialController extends BladeController { // queryWrapper.lambda().eq(BasicMaterialEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED); // List list = basicMaterialService.exportBasicMaterial(queryWrapper); List list = new ArrayList<>(); + //存入模板 + BasicMaterialExcel basicMaterialExcel = new BasicMaterialExcel(); + basicMaterialExcel.setProductCode("G21214471"); + basicMaterialExcel.setName("QD-U50863M-1RD9L2W-2芝华仕-圣多斯沙发-单右贵左双单无沙发组(单右电动/象牙白)"); + basicMaterialExcel.setSku("G21214471"); + basicMaterialExcel.setProperty("家配"); + basicMaterialExcel.setPackagingMaterial("纸箱"); + basicMaterialExcel.setPackingSpecification("OP-0322013-1.8慕思.苏斯西雅图软床排骨架条(通配)/1800*2000"); + basicMaterialExcel.setExtent("2260"); + basicMaterialExcel.setBreadth("1030"); + basicMaterialExcel.setAltitude("640"); + basicMaterialExcel.setVolume("1.489792"); + basicMaterialExcel.setLogpmUnit("1"); + basicMaterialExcel.setPackageNum("3"); + basicMaterialExcel.setWeight(BigDecimal.valueOf(0)); ExcelUtil.export(response, "物料基础信息数据模板" + DateUtil.time(), "物料基础信息数据模板表", list, BasicMaterialExcel.class); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java index ee1edb535..674c28d94 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseUpdownTypeApiController.java @@ -5,6 +5,7 @@ import com.logpm.basicdata.entity.BasicdataWarehouseEntity; import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.warehouse.dto.*; import com.logpm.warehouse.feign.WarehouseGoodsAllocationClient; +import com.logpm.warehouse.service.IWarehouseGoodsAllocationService; import com.logpm.warehouse.service.IWarehouseUpdownTypeService; import com.logpm.warehouse.vo.*; import io.swagger.annotations.Api; @@ -238,7 +239,11 @@ public class WarehouseUpdownTypeApiController { } //上架托盘维度 - return warehouseUpdownTypeService.upShelfTray(trayCode,allocationId,myCurrentWarehouse.getId()); + R r = warehouseUpdownTypeService.upShelfTray(trayCode, allocationId, myCurrentWarehouse.getId()); + if (r.getCode() == 200) { + warehouseGoodsAllocationClient.updateAllocationCache(allocationId.toString()); + } + return r; }catch (CustomerException e){ log.warn(e.message); return R.fail(e.code,e.message); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java index 94f89984f..cbb301266 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java @@ -295,9 +295,9 @@ public class WarehouseGoodsAllocationController extends BladeController { } //上架托盘 R r = warehouseUpdownTypeService.upShelfTray(trayCode, allocationId,myCurrentWarehouse.getId()); -// if (r.getCode() == 200) { -// warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString()); -// } + if (r.getCode() == 200) { + warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString()); + } return r; } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java index 60f077568..dffd66099 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseGoodsAllocationServiceImpl.java @@ -361,7 +361,6 @@ public class WarehouseGoodsAllocationServiceImpl extends BaseServiceImpl Date: Mon, 25 Sep 2023 21:05:57 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1.=E5=A4=87=E8=B4=A7=E5=8C=BA=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E4=B8=8A=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WarehouseGoodsAllocationController.java | 26 ++++++++++++++++++- .../WarehouseGoodsAllocationMapper.java | 3 +++ .../mapper/WarehouseGoodsAllocationMapper.xml | 4 +++ .../IWarehouseGoodsAllocationService.java | 4 +++ .../WarehouseGoodsAllocationServiceImpl.java | 6 +++++ 5 files changed, 42 insertions(+), 1 deletion(-) diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java index cbb301266..b8b9f13ec 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/WarehouseGoodsAllocationController.java @@ -206,6 +206,11 @@ public class WarehouseGoodsAllocationController extends BladeController { if (upShelfOrderList.size() == 0 || Objects.isNull(allocationId)) { return R.fail("参数不全"); } + //查询是否为备货区 + Boolean b = warehouseGoodsAllocationService.selectIsStocking(allocationId); + if (b){ + return R.fail("备货区不可上架"); + } //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); if(Objects.isNull(myCurrentWarehouse)){ @@ -230,7 +235,10 @@ public class WarehouseGoodsAllocationController extends BladeController { //取出服务号 List upShelfOrderList = updownTypeDTO.getUpShelfOrderList(); Long allocationId = updownTypeDTO.getAllocationId(); - + Boolean b = warehouseGoodsAllocationService.selectIsStocking(allocationId); + if (b){ + return R.fail("备货区不可上架"); + } //当前登录人选择的仓库 BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); if(Objects.isNull(myCurrentWarehouse)){ @@ -265,6 +273,10 @@ public class WarehouseGoodsAllocationController extends BladeController { if (upShelfPackageList.size() == 0 || Objects.isNull(allocationId)) { return R.fail("参数不全"); } + Boolean b = warehouseGoodsAllocationService.selectIsStocking(allocationId); + if (b){ + return R.fail("备货区不可上架"); + } BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); if(Objects.isNull(myCurrentWarehouse)){ return R.fail("仓库信息不能为空"); @@ -293,6 +305,10 @@ public class WarehouseGoodsAllocationController extends BladeController { if (Objects.isNull(myCurrentWarehouse)) { return R.fail("仓库信息不能为空"); } + Boolean b = warehouseGoodsAllocationService.selectIsStocking(allocationId); + if (b){ + return R.fail("备货区不可上架"); + } //上架托盘 R r = warehouseUpdownTypeService.upShelfTray(trayCode, allocationId,myCurrentWarehouse.getId()); if (r.getCode() == 200) { @@ -317,6 +333,10 @@ public class WarehouseGoodsAllocationController extends BladeController { if(Objects.isNull(myCurrentWarehouse)){ return R.fail("仓库信息不能为空"); } + Boolean b = warehouseGoodsAllocationService.selectIsStocking(allocationId); + if (b){ + return R.fail("备货区不可上架"); + } //查询该库位的货物信息 R r = warehouseUpdownTypeService.upShelfStockList(upShelfStockList, allocationId,myCurrentWarehouse.getId()); @@ -343,6 +363,10 @@ public class WarehouseGoodsAllocationController extends BladeController { if(Objects.isNull(myCurrentWarehouse)){ return R.fail("仓库信息为空"); } + Boolean b = warehouseGoodsAllocationService.selectIsStocking(allocationId); + if (b){ + return R.fail("备货区不可上架"); + } //查询该库位的货物信息 R r = warehouseUpdownTypeService.upShelfZeroOrder(upShelfZeroOrderList, allocationId,myCurrentWarehouse.getId()); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.java index 4040846e7..25cc11905 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.java @@ -164,4 +164,7 @@ public interface WarehouseGoodsAllocationMapper extends BaseMapper selectCargoSumId(); List AllWarehouse(); + + + List selectIsStocking(@Param("allocationId") Long allocationId); } diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.xml index 9aea256ca..36ad63588 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseGoodsAllocationMapper.xml @@ -319,6 +319,10 @@ WHERE is_deleted = 0 and enable_status = '1' + diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseGoodsAllocationService.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseGoodsAllocationService.java index 772579ca9..8f4317db6 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseGoodsAllocationService.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/IWarehouseGoodsAllocationService.java @@ -115,4 +115,8 @@ public interface IWarehouseGoodsAllocationService extends BaseService list = baseMapper.selectIsStocking(allocationId); + return null == list && list.isEmpty()?false:true; + } + public List getMyWatchWarehouseIds(){ //获取当前登录人仓库 List myWatchWarehouse = basicdataWarehouseClient.getMyWatchWarehouse();