From 4fdcd769ec72415399c53a71f7631168ec47ad2c Mon Sep 17 00:00:00 2001 From: NH-LHG Date: Thu, 13 Jul 2023 09:29:55 +0800 Subject: [PATCH] =?UTF-8?q?[update]=E5=A2=9E=E5=8A=A0=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jeecg/modules/demo/erp/controller/GoodsController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/erp/controller/GoodsController.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/erp/controller/GoodsController.java index f6f4d2d..0868c6e 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/erp/controller/GoodsController.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/erp/controller/GoodsController.java @@ -73,6 +73,11 @@ public class GoodsController extends JeecgController { //@RequiresPermissions("erp:goods:add") @PostMapping(value = "/add") public Result add(@RequestBody Goods goods) { + Goods goodsInfo = goodsService.getOne( + new QueryWrapper() + .select("max(id)") + ); + goods.setId(goodsInfo.getId()+1); goodsService.save(goods); return Result.OK("添加成功!"); }