| | |
| | | */
|
| | | public static final String extractFilename(MultipartFile file)
|
| | | {
|
| | | String fileName = file.getOriginalFilename();
|
| | | String extension = getExtension(file);
|
| | | fileName = DateUtils.datePath() + "/" + IdUtils.fastUUID() + "." + extension;
|
| | | return fileName;
|
| | | return DateUtils.datePath() + "/" + IdUtils.fastUUID() + "." + getExtension(file);
|
| | | }
|
| | |
|
| | | public static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
|
| | |
| | | package com.ruoyi.common.utils.file;
|
| | |
|
| | | import java.io.ByteArrayInputStream;
|
| | | import java.io.ByteArrayOutputStream;
|
| | | import java.io.FileInputStream;
|
| | | import java.io.InputStream;
|
| | | import java.net.URL;
|
| | |
| | | public static byte[] readFile(String url)
|
| | | {
|
| | | InputStream in = null;
|
| | | ByteArrayOutputStream baos = null;
|
| | | try
|
| | | {
|
| | | if (url.startsWith("http"))
|
| | |
| | | finally
|
| | | {
|
| | | IOUtils.closeQuietly(in);
|
| | | IOUtils.closeQuietly(baos);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | public List<SysUser> selectUserList(SysUser sysUser);
|
| | |
|
| | | /**
|
| | | * 根据条件分页查询未已配用户角色列表
|
| | | * 根据条件分页查询已配用户角色列表
|
| | | *
|
| | | * @param user 用户信息
|
| | | * @return 用户信息集合信息
|
| | |
| | | * 批量选择授权用户角色
|
| | | *
|
| | | * @param roleId 角色ID
|
| | | * @param userIds 需要删除的用户数据ID
|
| | | * @param userIds 需要授权的用户数据ID
|
| | | * @return 结果
|
| | | */
|
| | | @Override
|
| | |
| | | </resultMap>
|
| | |
|
| | | <sql id="selectMenuVo">
|
| | | select menu_id, menu_name, parent_id, order_num, path, component, query, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time |
| | | select menu_id, menu_name, parent_id, order_num, path, component, `query`, is_frame, is_cache, menu_type, visible, status, ifnull(perms,'') as perms, icon, create_time |
| | | from sys_menu
|
| | | </sql>
|
| | |
|
| | |
| | | </select>
|
| | |
|
| | | <select id="selectMenuTreeAll" resultMap="SysMenuResult">
|
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
| | | from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0
|
| | | order by m.parent_id, m.order_num
|
| | | </select>
|
| | |
|
| | | <select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult">
|
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
| | | from sys_menu m
|
| | | left join sys_role_menu rm on m.menu_id = rm.menu_id
|
| | | left join sys_user_role ur on rm.role_id = ur.role_id
|
| | |
| | | </select>
|
| | |
|
| | | <select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
|
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.query, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
| | | from sys_menu m
|
| | | left join sys_role_menu rm on m.menu_id = rm.menu_id
|
| | | left join sys_user_role ur on rm.role_id = ur.role_id
|