yanyang #28

Merged
yanyang merged 2 commits from yanyang into master 2023-03-24 11:21:39 +08:00
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.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);
//更新角色菜单关系

View File

@ -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);
//更新角色用户关系