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
commit 045688f123
2 changed files with 6 additions and 4 deletions

View File

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

View File

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