[update]增加产品修改

master
NH-LHG 1 year ago
parent f96aaa9a76
commit 4fdcd769ec

@ -73,6 +73,11 @@ public class GoodsController extends JeecgController<Goods, IGoodsService> {
//@RequiresPermissions("erp:goods:add") //@RequiresPermissions("erp:goods:add")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<String> add(@RequestBody Goods goods) { public Result<String> add(@RequestBody Goods goods) {
Goods goodsInfo = goodsService.getOne(
new QueryWrapper<Goods>()
.select("max(id)")
);
goods.setId(goodsInfo.getId()+1);
goodsService.save(goods); goodsService.save(goods);
return Result.OK("添加成功!"); return Result.OK("添加成功!");
} }

Loading…
Cancel
Save