diff --git a/src/main/java/com/lq/cms/web/sys/UserController.java b/src/main/java/com/lq/cms/web/sys/UserController.java index 5e8cde3..8787bcb 100755 --- a/src/main/java/com/lq/cms/web/sys/UserController.java +++ b/src/main/java/com/lq/cms/web/sys/UserController.java @@ -92,7 +92,7 @@ public class UserController { Date nowTime =new Date(); AjaxResult ajaxResult = new AjaxResult(); SysUser sysUser = new SysUser(); - BeanUtil.copyNotNull(vo,sysUser); + BeanUtil.copyNotNull(sysUser,vo); sysUser.setCreateTime(nowTime); sysUser.setPassword(Md5Util.getMd5(sysUser.getPassword())); sysUser.setUpdateTime(nowTime); diff --git a/src/main/java/com/lq/code/service/BaseService.java b/src/main/java/com/lq/code/service/BaseService.java index e5ac2f5..724a09a 100755 --- a/src/main/java/com/lq/code/service/BaseService.java +++ b/src/main/java/com/lq/code/service/BaseService.java @@ -10,8 +10,17 @@ import java.util.List; */ public interface BaseService { - BaseDao getBaseDao(); - + /** + * 注入 baseDao + * @return + */ + BaseDao getBaseDao(); + + /** + * 通过ID查找数据 + * @param id + * @return + */ default T findOne(Long id){ return getBaseDao().findOne(id); } @@ -32,17 +41,17 @@ public interface BaseService { getBaseDao().delete(id); } - @Transactional + @Transactional(rollbackFor = Exception.class) default void batchSave(List entitylist){ getBaseDao().batchSave(entitylist); } - @Transactional + @Transactional(rollbackFor = Exception.class) default void batchUpdate(List entitylist){ getBaseDao().batchSave(entitylist); } - @Transactional + @Transactional(rollbackFor = Exception.class) default void batchDelete(List entitylist){ getBaseDao().batchDelete(entitylist); }