mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
update 优化代码生成 insertByBo 方法 针对返回主键优化
This commit is contained in:
@ -75,7 +75,11 @@ public class TestDemoServiceImpl extends ServicePlusImpl<TestDemoMapper, TestDem
|
||||
public Boolean insertByBo(TestDemoBo bo) {
|
||||
TestDemo add = BeanUtil.toBean(bo, TestDemo.class);
|
||||
validEntityBeforeSave(add);
|
||||
return save(add);
|
||||
boolean flag = save(add);
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -54,7 +54,11 @@ public class TestTreeServiceImpl extends ServicePlusImpl<TestTreeMapper, TestTre
|
||||
public Boolean insertByBo(TestTreeBo bo) {
|
||||
TestTree add = BeanUtil.toBean(bo, TestTree.class);
|
||||
validEntityBeforeSave(add);
|
||||
return save(add);
|
||||
boolean flag = save(add);
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user