Browse Source

[fix]

基础资料 角色管理
修改角色管理插入mapper方法,修改创建时间赋值语句;
修改角色管理新增controller方法,新增设置当前时间为创建时间语句;
dev
王晓迪 1 month ago
parent
commit
6179fbd6de
  1. 2
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
  2. 4
      ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml

2
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java

@ -7,6 +7,7 @@ import java.util.stream.Collectors;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.ruoyi.common.core.domain.Ztree; import com.ruoyi.common.core.domain.Ztree;
import com.ruoyi.common.core.domain.entity.vo.ExportRoleMenuVo; import com.ruoyi.common.core.domain.entity.vo.ExportRoleMenuVo;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.SysSalesShippingInform; import com.ruoyi.system.domain.SysSalesShippingInform;
import com.ruoyi.system.service.ISysMenuService; import com.ruoyi.system.service.ISysMenuService;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@ -105,6 +106,7 @@ public class SysRoleController extends BaseController
return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在"); return error("新增角色'" + role.getRoleName() + "'失败,角色权限已存在");
} }
role.setCreateBy(ShiroUtils.getLoginName()); role.setCreateBy(ShiroUtils.getLoginName());
role.setCreateTime(DateUtils.getNowDate());
AuthorizationUtils.clearAllCachedAuthorizationInfo(); AuthorizationUtils.clearAllCachedAuthorizationInfo();
return toAjax(roleService.insertRole(role)); return toAjax(roleService.insertRole(role));

4
ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml

@ -122,7 +122,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">status,</if> <if test="status != null and status != ''">status,</if>
<if test="remark != null and remark != ''">remark,</if> <if test="remark != null and remark != ''">remark,</if>
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
create_time <if test="createTime != null">create_time</if>
)values( )values(
<if test="roleId != null and roleId != 0">#{roleId},</if> <if test="roleId != null and roleId != 0">#{roleId},</if>
<if test="roleName != null and roleName != ''">#{roleName},</if> <if test="roleName != null and roleName != ''">#{roleName},</if>
@ -132,7 +132,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">#{status},</if> <if test="status != null and status != ''">#{status},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
sysdate() <if test="createTime != null">#{createTime},</if>
) )
</insert> </insert>

Loading…
Cancel
Save