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("添加成功!"); }