Merge pull request 'yanyang' (#28) from yanyang into master

Reviewed-on: #28
This commit is contained in:
闫阳 2023-03-24 11:21:38 +08:00
當前提交 045688f123
共有 2 個文件被更改,包括 6 次插入4 次删除

查看文件

@ -21,6 +21,7 @@ import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.sql.Timestamp;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -90,7 +91,8 @@ public class SysRoleServiceImpl extends BaseServiceImpl<SysRoleDao, SysRoleEntit
SysRoleEntity entity = ConvertUtils.sourceToTarget(dto, SysRoleEntity.class);
//保存角色
BaseSupportUtils.setCommonField(entity);
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
entity.setCreateDate(timestamp);
insert(entity);
//保存角色菜单关系
@ -106,7 +108,6 @@ public class SysRoleServiceImpl extends BaseServiceImpl<SysRoleDao, SysRoleEntit
SysRoleEntity entity = ConvertUtils.sourceToTarget(dto, SysRoleEntity.class);
//更新角色
BaseSupportUtils.setUpdateCommonField(entity);
updateById(entity);
//更新角色菜单关系

查看文件

@ -22,6 +22,7 @@ import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.sql.Timestamp;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -99,7 +100,8 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
//保存用户
entity.setSuperAdmin(SuperAdminEnum.NO.value());
BaseSupportUtils.setCommonField(entity);
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
entity.setCreateDate(timestamp);
insert(entity);
//保存角色用户关系
@ -120,7 +122,6 @@ public class SysUserServiceImpl extends BaseServiceImpl<SysUserDao, SysUserEntit
}
//更新用户
BaseSupportUtils.setUpdateCommonField(entity);
updateById(entity);
//更新角色用户关系