From 2c0268f7d94b7da87d4c4bd07f65f490bcd02278 Mon Sep 17 00:00:00 2001 From: x_z Date: Sun, 9 Oct 2022 21:10:03 +0800 Subject: [PATCH] =?UTF-8?q?1.=E6=B7=BB=E5=8A=A0=E6=A0=B9=E6=8D=AE=E5=AE=A2?= =?UTF-8?q?=E6=88=B7ID=E6=9F=A5=E8=AF=A2=E5=90=AF=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E5=9E=9B=E5=8F=B7=E8=A7=84=E5=88=99=E7=9A=84=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/basic/StockRulesController.java | 15 +++++++++++++++ .../admin/service/basic/StockRulesService.java | 16 +++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/udi/admin/controller/basic/StockRulesController.java b/src/main/java/com/glxp/udi/admin/controller/basic/StockRulesController.java index e74094b..e23f822 100644 --- a/src/main/java/com/glxp/udi/admin/controller/basic/StockRulesController.java +++ b/src/main/java/com/glxp/udi/admin/controller/basic/StockRulesController.java @@ -87,4 +87,19 @@ public class StockRulesController { return ResultVOUtils.success("删除成功"); } + /** + * 根据客户ID查询当前启用的垛号生成规则 + * + * @param customerId + * @return + */ + @GetMapping("/udims/stockRules/getEnableStockRule") + public BaseResponse getEnableStockRule(String customerId) { + if (StrUtil.isBlank(customerId)) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); + } + StockRulesEntity stockRulesEntity = stockRulesService.getEnableStockRule(customerId); + return ResultVOUtils.success(stockRulesEntity); + } + } diff --git a/src/main/java/com/glxp/udi/admin/service/basic/StockRulesService.java b/src/main/java/com/glxp/udi/admin/service/basic/StockRulesService.java index 8dbf270..4027a80 100644 --- a/src/main/java/com/glxp/udi/admin/service/basic/StockRulesService.java +++ b/src/main/java/com/glxp/udi/admin/service/basic/StockRulesService.java @@ -80,9 +80,23 @@ public class StockRulesService { /** * 删除建垛规则 * - * @param id + * @param id 规则ID */ public void delete(String id) { stockRulesDao.deleteById(id); } + + /** + * 根据客户ID查询当前启用的垛号生成规则 + * + * @param customerId 客户ID + * @return + */ + public StockRulesEntity getEnableStockRule(String customerId) { + StockRulesEntity stockRulesEntity = stockRulesDao.selectOne(new QueryWrapper() + .eq(StockRulesEntity.COL_CUSTOMERID, customerId) + .eq(StockRulesEntity.COL_STATUS, 1)); + return stockRulesEntity; + } + }