mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-10-31 10:18:42 +08:00 
			
		
		
		
	迁移登陆日志完成
开始迁移参数配置
This commit is contained in:
		| @@ -1,6 +1,7 @@ | |||||||
| package com.ruoyi.web.controller.system; | package com.ruoyi.web.controller.system; | ||||||
|  |  | ||||||
| import java.util.List; | import java.util.List; | ||||||
|  |  | ||||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||||
| import org.springframework.security.access.prepost.PreAuthorize; | import org.springframework.security.access.prepost.PreAuthorize; | ||||||
| import org.springframework.validation.annotation.Validated; | import org.springframework.validation.annotation.Validated; | ||||||
| @@ -31,8 +32,8 @@ import com.ruoyi.system.service.ISysConfigService; | |||||||
|  */ |  */ | ||||||
| @RestController | @RestController | ||||||
| @RequestMapping("/system/config") | @RequestMapping("/system/config") | ||||||
| public class SysConfigController extends BaseController | public class SysConfigController extends BaseController { | ||||||
| { |  | ||||||
|     @Autowired |     @Autowired | ||||||
|     private ISysConfigService configService; |     private ISysConfigService configService; | ||||||
|  |  | ||||||
| @@ -41,8 +42,7 @@ public class SysConfigController extends BaseController | |||||||
|      */ |      */ | ||||||
|     @PreAuthorize("@ss.hasPermi('system:config:list')") |     @PreAuthorize("@ss.hasPermi('system:config:list')") | ||||||
|     @GetMapping("/list") |     @GetMapping("/list") | ||||||
|     public TableDataInfo list(SysConfig config) |     public TableDataInfo list(SysConfig config) { | ||||||
|     { |  | ||||||
|         startPage(); |         startPage(); | ||||||
|         List<SysConfig> list = configService.selectConfigList(config); |         List<SysConfig> list = configService.selectConfigList(config); | ||||||
|         return getDataTable(list); |         return getDataTable(list); | ||||||
| @@ -51,8 +51,7 @@ public class SysConfigController extends BaseController | |||||||
|     @Log(title = "参数管理", businessType = BusinessType.EXPORT) |     @Log(title = "参数管理", businessType = BusinessType.EXPORT) | ||||||
|     @PreAuthorize("@ss.hasPermi('system:config:export')") |     @PreAuthorize("@ss.hasPermi('system:config:export')") | ||||||
|     @GetMapping("/export") |     @GetMapping("/export") | ||||||
|     public AjaxResult export(SysConfig config) |     public AjaxResult export(SysConfig config) { | ||||||
|     { |  | ||||||
|         List<SysConfig> list = configService.selectConfigList(config); |         List<SysConfig> list = configService.selectConfigList(config); | ||||||
|         ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class); |         ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class); | ||||||
|         return util.exportExcel(list, "参数数据"); |         return util.exportExcel(list, "参数数据"); | ||||||
| @@ -63,8 +62,7 @@ public class SysConfigController extends BaseController | |||||||
|      */ |      */ | ||||||
|     @PreAuthorize("@ss.hasPermi('system:config:query')") |     @PreAuthorize("@ss.hasPermi('system:config:query')") | ||||||
|     @GetMapping(value = "/{configId}") |     @GetMapping(value = "/{configId}") | ||||||
|     public AjaxResult getInfo(@PathVariable Long configId) |     public AjaxResult getInfo(@PathVariable Long configId) { | ||||||
|     { |  | ||||||
|         return AjaxResult.success(configService.selectConfigById(configId)); |         return AjaxResult.success(configService.selectConfigById(configId)); | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -72,8 +70,7 @@ public class SysConfigController extends BaseController | |||||||
|      * 根据参数键名查询参数值 |      * 根据参数键名查询参数值 | ||||||
|      */ |      */ | ||||||
|     @GetMapping(value = "/configKey/{configKey}") |     @GetMapping(value = "/configKey/{configKey}") | ||||||
|     public AjaxResult getConfigKey(@PathVariable String configKey) |     public AjaxResult getConfigKey(@PathVariable String configKey) { | ||||||
|     { |  | ||||||
|         return AjaxResult.success(configService.selectConfigByKey(configKey)); |         return AjaxResult.success(configService.selectConfigByKey(configKey)); | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -84,10 +81,8 @@ public class SysConfigController extends BaseController | |||||||
|     @Log(title = "参数管理", businessType = BusinessType.INSERT) |     @Log(title = "参数管理", businessType = BusinessType.INSERT) | ||||||
|     @PostMapping |     @PostMapping | ||||||
|     @RepeatSubmit |     @RepeatSubmit | ||||||
|     public AjaxResult add(@Validated @RequestBody SysConfig config) |     public AjaxResult add(@Validated @RequestBody SysConfig config) { | ||||||
|     { |         if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) { | ||||||
|         if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) |  | ||||||
|         { |  | ||||||
|             return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); |             return AjaxResult.error("新增参数'" + config.getConfigName() + "'失败,参数键名已存在"); | ||||||
|         } |         } | ||||||
|         config.setCreateBy(SecurityUtils.getUsername()); |         config.setCreateBy(SecurityUtils.getUsername()); | ||||||
| @@ -100,10 +95,8 @@ public class SysConfigController extends BaseController | |||||||
|     @PreAuthorize("@ss.hasPermi('system:config:edit')") |     @PreAuthorize("@ss.hasPermi('system:config:edit')") | ||||||
|     @Log(title = "参数管理", businessType = BusinessType.UPDATE) |     @Log(title = "参数管理", businessType = BusinessType.UPDATE) | ||||||
|     @PutMapping |     @PutMapping | ||||||
|     public AjaxResult edit(@Validated @RequestBody SysConfig config) |     public AjaxResult edit(@Validated @RequestBody SysConfig config) { | ||||||
|     { |         if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) { | ||||||
|         if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) |  | ||||||
|         { |  | ||||||
|             return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); |             return AjaxResult.error("修改参数'" + config.getConfigName() + "'失败,参数键名已存在"); | ||||||
|         } |         } | ||||||
|         config.setUpdateBy(SecurityUtils.getUsername()); |         config.setUpdateBy(SecurityUtils.getUsername()); | ||||||
| @@ -116,20 +109,8 @@ public class SysConfigController extends BaseController | |||||||
|     @PreAuthorize("@ss.hasPermi('system:config:remove')") |     @PreAuthorize("@ss.hasPermi('system:config:remove')") | ||||||
|     @Log(title = "参数管理", businessType = BusinessType.DELETE) |     @Log(title = "参数管理", businessType = BusinessType.DELETE) | ||||||
|     @DeleteMapping("/{configIds}") |     @DeleteMapping("/{configIds}") | ||||||
|     public AjaxResult remove(@PathVariable Long[] configIds) |     public AjaxResult remove(@PathVariable Long[] configIds) { | ||||||
|     { |  | ||||||
|         return toAjax(configService.deleteConfigByIds(configIds)); |         return toAjax(configService.deleteConfigByIds(configIds)); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 清空缓存 |  | ||||||
|      */ |  | ||||||
|     @PreAuthorize("@ss.hasPermi('system:config:remove')") |  | ||||||
|     @Log(title = "参数管理", businessType = BusinessType.CLEAN) |  | ||||||
|     @DeleteMapping("/clearCache") |  | ||||||
|     public AjaxResult clearCache() |  | ||||||
|     { |  | ||||||
|         configService.clearCache(); |  | ||||||
|         return AjaxResult.success(); |  | ||||||
|     } |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,61 +0,0 @@ | |||||||
| package com.ruoyi.system.domain; |  | ||||||
|  |  | ||||||
| import javax.validation.constraints.NotBlank; |  | ||||||
| import javax.validation.constraints.Size; |  | ||||||
| import org.apache.commons.lang3.builder.ToStringBuilder; |  | ||||||
| import org.apache.commons.lang3.builder.ToStringStyle; |  | ||||||
| import com.ruoyi.common.annotation.Excel; |  | ||||||
| import com.ruoyi.common.annotation.Excel.ColumnType; |  | ||||||
| import com.ruoyi.common.core.domain.BaseEntity; |  | ||||||
|  |  | ||||||
| /** |  | ||||||
|  * 参数配置表 sys_config |  | ||||||
|  * |  | ||||||
|  * @author ruoyi |  | ||||||
|  */ |  | ||||||
| public class SysConfig extends BaseEntity |  | ||||||
| { |  | ||||||
|     private static final long serialVersionUID = 1L; |  | ||||||
|  |  | ||||||
|     /** 参数主键 */ |  | ||||||
|     @Excel(name = "参数主键", cellType = ColumnType.NUMERIC) |  | ||||||
|     private Long configId; |  | ||||||
|  |  | ||||||
|     /** 参数名称 */ |  | ||||||
|     @Excel(name = "参数名称") |  | ||||||
|     private String configName; |  | ||||||
|  |  | ||||||
|     /** 参数键名 */ |  | ||||||
|     @Excel(name = "参数键名") |  | ||||||
|     private String configKey; |  | ||||||
|  |  | ||||||
|     /** 参数键值 */ |  | ||||||
|     @Excel(name = "参数键值") |  | ||||||
|     private String configValue; |  | ||||||
|  |  | ||||||
|     /** 系统内置(Y是 N否) */ |  | ||||||
|     @Excel(name = "系统内置", readConverterExp = "Y=是,N=否") |  | ||||||
|     private String configType; |  | ||||||
|  |  | ||||||
|     @NotBlank(message = "参数名称不能为空") |  | ||||||
|     @Size(min = 0, max = 100, message = "参数名称不能超过100个字符") |  | ||||||
|     public String getConfigName() |  | ||||||
|     { |  | ||||||
|         return configName; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     @NotBlank(message = "参数键名长度不能为空") |  | ||||||
|     @Size(min = 0, max = 100, message = "参数键名长度不能超过100个字符") |  | ||||||
|     public String getConfigKey() |  | ||||||
|     { |  | ||||||
|         return configKey; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     @NotBlank(message = "参数键值不能为空") |  | ||||||
|     @Size(min = 0, max = 500, message = "参数键值长度不能超过500个字符") |  | ||||||
|     public String getConfigValue() |  | ||||||
|     { |  | ||||||
|         return configValue; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
| } |  | ||||||
| @@ -1,73 +0,0 @@ | |||||||
| package com.ruoyi.system.service; |  | ||||||
|  |  | ||||||
| import java.util.List; |  | ||||||
| import com.ruoyi.system.domain.SysConfig; |  | ||||||
|  |  | ||||||
| /** |  | ||||||
|  * 参数配置 服务层 |  | ||||||
|  *  |  | ||||||
|  * @author ruoyi |  | ||||||
|  */ |  | ||||||
| public interface ISysConfigService |  | ||||||
| { |  | ||||||
|     /** |  | ||||||
|      * 查询参数配置信息 |  | ||||||
|      *  |  | ||||||
|      * @param configId 参数配置ID |  | ||||||
|      * @return 参数配置信息 |  | ||||||
|      */ |  | ||||||
|     public SysConfig selectConfigById(Long configId); |  | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 根据键名查询参数配置信息 |  | ||||||
|      *  |  | ||||||
|      * @param configKey 参数键名 |  | ||||||
|      * @return 参数键值 |  | ||||||
|      */ |  | ||||||
|     public String selectConfigByKey(String configKey); |  | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 查询参数配置列表 |  | ||||||
|      *  |  | ||||||
|      * @param config 参数配置信息 |  | ||||||
|      * @return 参数配置集合 |  | ||||||
|      */ |  | ||||||
|     public List<SysConfig> selectConfigList(SysConfig config); |  | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 新增参数配置 |  | ||||||
|      *  |  | ||||||
|      * @param config 参数配置信息 |  | ||||||
|      * @return 结果 |  | ||||||
|      */ |  | ||||||
|     public int insertConfig(SysConfig config); |  | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 修改参数配置 |  | ||||||
|      *  |  | ||||||
|      * @param config 参数配置信息 |  | ||||||
|      * @return 结果 |  | ||||||
|      */ |  | ||||||
|     public int updateConfig(SysConfig config); |  | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 批量删除参数信息 |  | ||||||
|      *  |  | ||||||
|      * @param configIds 需要删除的参数ID |  | ||||||
|      * @return 结果 |  | ||||||
|      */ |  | ||||||
|     public int deleteConfigByIds(Long[] configIds); |  | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 清空缓存数据 |  | ||||||
|      */ |  | ||||||
|     public void clearCache(); |  | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 校验参数键名是否唯一 |  | ||||||
|      *  |  | ||||||
|      * @param config 参数信息 |  | ||||||
|      * @return 结果 |  | ||||||
|      */ |  | ||||||
|     public String checkConfigKeyUnique(SysConfig config); |  | ||||||
| } |  | ||||||
| @@ -1,40 +0,0 @@ | |||||||
| package com.ruoyi.system.service; |  | ||||||
|  |  | ||||||
| import java.util.List; |  | ||||||
| import com.ruoyi.system.domain.SysLogininfor; |  | ||||||
|  |  | ||||||
| /** |  | ||||||
|  * 系统访问日志情况信息 服务层 |  | ||||||
|  *  |  | ||||||
|  * @author ruoyi |  | ||||||
|  */ |  | ||||||
| public interface ISysLogininforService |  | ||||||
| { |  | ||||||
|     /** |  | ||||||
|      * 新增系统登录日志 |  | ||||||
|      *  |  | ||||||
|      * @param logininfor 访问日志对象 |  | ||||||
|      */ |  | ||||||
|     public void insertLogininfor(SysLogininfor logininfor); |  | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 查询系统登录日志集合 |  | ||||||
|      *  |  | ||||||
|      * @param logininfor 访问日志对象 |  | ||||||
|      * @return 登录记录集合 |  | ||||||
|      */ |  | ||||||
|     public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor); |  | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 批量删除系统登录日志 |  | ||||||
|      *  |  | ||||||
|      * @param infoIds 需要删除的登录日志ID |  | ||||||
|      * @return |  | ||||||
|      */ |  | ||||||
|     public int deleteLogininforByIds(Long[] infoIds); |  | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 清空系统登录日志 |  | ||||||
|      */ |  | ||||||
|     public void cleanLogininfor(); |  | ||||||
| } |  | ||||||
| @@ -1,61 +0,0 @@ | |||||||
| package com.ruoyi.system.service.impl; |  | ||||||
|  |  | ||||||
| import java.util.List; |  | ||||||
|  |  | ||||||
| import org.springframework.beans.factory.annotation.Autowired; |  | ||||||
| import org.springframework.stereotype.Service; |  | ||||||
| import com.ruoyi.system.domain.SysLogininfor; |  | ||||||
| import com.ruoyi.system.mapper.SysLogininforMapper; |  | ||||||
| import com.ruoyi.system.service.ISysLogininforService; |  | ||||||
|  |  | ||||||
| /** |  | ||||||
|  * 系统访问日志情况信息 服务层处理 |  | ||||||
|  * |  | ||||||
|  * @author ruoyi |  | ||||||
|  */ |  | ||||||
| @Service |  | ||||||
| public class SysLogininforServiceImpl implements ISysLogininforService { |  | ||||||
|  |  | ||||||
|     @Autowired |  | ||||||
|     private SysLogininforMapper logininforMapper; |  | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 新增系统登录日志 |  | ||||||
|      * |  | ||||||
|      * @param logininfor 访问日志对象 |  | ||||||
|      */ |  | ||||||
|     @Override |  | ||||||
|     public void insertLogininfor(SysLogininfor logininfor) { |  | ||||||
|         logininforMapper.insertLogininfor(logininfor); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 查询系统登录日志集合 |  | ||||||
|      * |  | ||||||
|      * @param logininfor 访问日志对象 |  | ||||||
|      * @return 登录记录集合 |  | ||||||
|      */ |  | ||||||
|     @Override |  | ||||||
|     public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor) { |  | ||||||
|         return logininforMapper.selectLogininforList(logininfor); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 批量删除系统登录日志 |  | ||||||
|      * |  | ||||||
|      * @param infoIds 需要删除的登录日志ID |  | ||||||
|      * @return |  | ||||||
|      */ |  | ||||||
|     @Override |  | ||||||
|     public int deleteLogininforByIds(Long[] infoIds) { |  | ||||||
|         return logininforMapper.deleteLogininforByIds(infoIds); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 清空系统登录日志 |  | ||||||
|      */ |  | ||||||
|     @Override |  | ||||||
|     public void cleanLogininfor() { |  | ||||||
|         logininforMapper.cleanLogininfor(); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @@ -1,54 +0,0 @@ | |||||||
| package com.ruoyi.system.service.impl; |  | ||||||
|  |  | ||||||
| import java.util.List; |  | ||||||
|  |  | ||||||
| import org.springframework.beans.factory.annotation.Autowired; |  | ||||||
| import org.springframework.stereotype.Service; |  | ||||||
| import com.ruoyi.system.domain.SysOperLog; |  | ||||||
| import com.ruoyi.system.mapper.SysOperLogMapper; |  | ||||||
| import com.ruoyi.system.service.ISysOperLogService; |  | ||||||
|  |  | ||||||
| /** |  | ||||||
|  * 操作日志 服务层处理 |  | ||||||
|  * |  | ||||||
|  * @author ruoyi |  | ||||||
|  */ |  | ||||||
| @Service |  | ||||||
| public class SysOperLogServiceImpl implements ISysOperLogService { |  | ||||||
|     @Autowired |  | ||||||
|     private SysOperLogMapper operLogMapper; |  | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 新增操作日志 |  | ||||||
|      * |  | ||||||
|      * @param operLog 操作日志对象 |  | ||||||
|      */ |  | ||||||
|     @Override |  | ||||||
|     public void insertOperlog(SysOperLog operLog) { |  | ||||||
|         operLogMapper.insertOperlog(operLog); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 查询系统操作日志集合 |  | ||||||
|      * |  | ||||||
|      * @param operLog 操作日志对象 |  | ||||||
|      * @return 操作日志集合 |  | ||||||
|      */ |  | ||||||
|     @Override |  | ||||||
|     public List<SysOperLog> selectOperLogList(SysOperLog operLog) { |  | ||||||
|         return operLogMapper.selectOperLogList(operLog); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|  |  | ||||||
|     /** |  | ||||||
|      * 查询操作日志详细 |  | ||||||
|      * |  | ||||||
|      * @param operId 操作ID |  | ||||||
|      * @return 操作日志对象 |  | ||||||
|      */ |  | ||||||
|     @Override |  | ||||||
|     public SysOperLog selectOperLogById(Long operId) { |  | ||||||
|         return operLogMapper.selectOperLogById(operId); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
| } |  | ||||||
| @@ -1,112 +0,0 @@ | |||||||
| <?xml version="1.0" encoding="UTF-8" ?> |  | ||||||
| <!DOCTYPE mapper |  | ||||||
| PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |  | ||||||
| "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |  | ||||||
| <mapper namespace="com.ruoyi.system.mapper.SysConfigMapper"> |  | ||||||
|      |  | ||||||
|     <resultMap type="SysConfig" id="SysConfigResult"> |  | ||||||
|     	<id     property="configId"      column="config_id"      /> |  | ||||||
|         <result property="configName"    column="config_name"    /> |  | ||||||
|         <result property="configKey"     column="config_key"     /> |  | ||||||
|         <result property="configValue"   column="config_value"   /> |  | ||||||
|         <result property="configType"    column="config_type"    /> |  | ||||||
|         <result property="createBy"      column="create_by"      /> |  | ||||||
|         <result property="createTime"    column="create_time"    /> |  | ||||||
|         <result property="updateBy"      column="update_by"      /> |  | ||||||
|         <result property="updateTime"    column="update_time"    /> |  | ||||||
|     </resultMap> |  | ||||||
|      |  | ||||||
|     <sql id="selectConfigVo"> |  | ||||||
|         select config_id, config_name, config_key, config_value, config_type, create_by, create_time, update_by, update_time, remark  |  | ||||||
| 		from sys_config |  | ||||||
|     </sql> |  | ||||||
|      |  | ||||||
|     <!-- 查询条件 --> |  | ||||||
| 	<sql id="sqlwhereSearch"> |  | ||||||
| 		<where> |  | ||||||
| 			<if test="configId !=null"> |  | ||||||
| 				and config_id = #{configId} |  | ||||||
| 			</if> |  | ||||||
| 			<if test="configKey !=null and configKey != ''"> |  | ||||||
| 				and config_key = #{configKey} |  | ||||||
| 			</if> |  | ||||||
| 		</where> |  | ||||||
| 	</sql> |  | ||||||
|      |  | ||||||
|     <select id="selectConfig" parameterType="SysConfig" resultMap="SysConfigResult"> |  | ||||||
|         <include refid="selectConfigVo"/> |  | ||||||
|         <include refid="sqlwhereSearch"/> |  | ||||||
|     </select> |  | ||||||
|      |  | ||||||
|     <select id="selectConfigList" parameterType="SysConfig" resultMap="SysConfigResult"> |  | ||||||
|         <include refid="selectConfigVo"/> |  | ||||||
|         <where> |  | ||||||
| 			<if test="configName != null and configName != ''"> |  | ||||||
| 				AND config_name like concat('%', #{configName}, '%') |  | ||||||
| 			</if> |  | ||||||
| 			<if test="configType != null and configType != ''"> |  | ||||||
| 				AND config_type = #{configType} |  | ||||||
| 			</if> |  | ||||||
| 			<if test="configKey != null and configKey != ''"> |  | ||||||
| 				AND config_key like concat('%', #{configKey}, '%') |  | ||||||
| 			</if> |  | ||||||
| 			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> |  | ||||||
| 				and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') |  | ||||||
| 			</if> |  | ||||||
| 			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> |  | ||||||
| 				and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') |  | ||||||
| 			</if> |  | ||||||
| 		</where> |  | ||||||
|     </select> |  | ||||||
|      |  | ||||||
|     <select id="checkConfigKeyUnique" parameterType="String" resultMap="SysConfigResult"> |  | ||||||
|         <include refid="selectConfigVo"/> |  | ||||||
|         where config_key = #{configKey} limit 1 |  | ||||||
|     </select> |  | ||||||
|      |  | ||||||
|     <insert id="insertConfig" parameterType="SysConfig"> |  | ||||||
|         insert into sys_config ( |  | ||||||
| 			<if test="configName != null and configName != '' ">config_name,</if> |  | ||||||
| 			<if test="configKey != null and configKey != '' ">config_key,</if> |  | ||||||
| 			<if test="configValue != null and configValue != '' ">config_value,</if> |  | ||||||
| 			<if test="configType != null and configType != '' ">config_type,</if> |  | ||||||
| 			<if test="createBy != null and createBy != ''">create_by,</if> |  | ||||||
| 			<if test="remark != null and remark != ''">remark,</if> |  | ||||||
|  			create_time |  | ||||||
|         )values( |  | ||||||
| 			<if test="configName != null and configName != ''">#{configName},</if> |  | ||||||
| 			<if test="configKey != null and configKey != ''">#{configKey},</if> |  | ||||||
| 			<if test="configValue != null and configValue != ''">#{configValue},</if> |  | ||||||
| 			<if test="configType != null and configType != ''">#{configType},</if> |  | ||||||
| 			<if test="createBy != null and createBy != ''">#{createBy},</if> |  | ||||||
| 			<if test="remark != null and remark != ''">#{remark},</if> |  | ||||||
|  			sysdate() |  | ||||||
| 		) |  | ||||||
|     </insert> |  | ||||||
| 	  |  | ||||||
|     <update id="updateConfig" parameterType="SysConfig"> |  | ||||||
|         update sys_config  |  | ||||||
|         <set> |  | ||||||
|             <if test="configName != null and configName != ''">config_name = #{configName},</if> |  | ||||||
|             <if test="configKey != null and configKey != ''">config_key = #{configKey},</if> |  | ||||||
|             <if test="configValue != null and configValue != ''">config_value = #{configValue},</if> |  | ||||||
|             <if test="configType != null and configType != ''">config_type = #{configType},</if> |  | ||||||
|             <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |  | ||||||
|             <if test="remark != null">remark = #{remark},</if> |  | ||||||
|  			update_time = sysdate() |  | ||||||
|         </set> |  | ||||||
|         where config_id = #{configId} |  | ||||||
|     </update> |  | ||||||
| 	 |  | ||||||
|     <delete id="deleteConfigById" parameterType="Long"> |  | ||||||
|         delete from sys_config where config_id = #{configId} |  | ||||||
|     </delete> |  | ||||||
|      |  | ||||||
|     <delete id="deleteConfigByIds" parameterType="Long"> |  | ||||||
|         delete from sys_config where config_id in  |  | ||||||
|         <foreach item="configId" collection="array" open="(" separator="," close=")"> |  | ||||||
|         	#{configId} |  | ||||||
|         </foreach> |  | ||||||
|     </delete> |  | ||||||
|      |  | ||||||
| </mapper> |  | ||||||
| @@ -1,57 +0,0 @@ | |||||||
| <?xml version="1.0" encoding="UTF-8" ?> |  | ||||||
| <!DOCTYPE mapper |  | ||||||
| PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |  | ||||||
| "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |  | ||||||
| <mapper namespace="com.ruoyi.system.mapper.SysLogininforMapper"> |  | ||||||
|  |  | ||||||
| 	<resultMap type="SysLogininfor" id="SysLogininforResult"> |  | ||||||
| 		<id     property="infoId"        column="info_id"           /> |  | ||||||
| 		<result property="userName"      column="user_name"         /> |  | ||||||
| 		<result property="status"        column="status"            /> |  | ||||||
| 		<result property="ipaddr"        column="ipaddr"            /> |  | ||||||
| 		<result property="loginLocation" column="login_location"    /> |  | ||||||
| 		<result property="browser"       column="browser"           /> |  | ||||||
| 		<result property="os"            column="os"                /> |  | ||||||
| 		<result property="msg"           column="msg"               /> |  | ||||||
| 		<result property="loginTime"     column="login_time"        /> |  | ||||||
| 	</resultMap> |  | ||||||
|  |  | ||||||
| 	<insert id="insertLogininfor" parameterType="SysLogininfor"> |  | ||||||
| 		insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time) |  | ||||||
| 		values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, sysdate()) |  | ||||||
| 	</insert> |  | ||||||
| 	 |  | ||||||
| 	<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult"> |  | ||||||
| 		select info_id, user_name, ipaddr, login_location, browser, os, status, msg, login_time from sys_logininfor |  | ||||||
| 		<where> |  | ||||||
| 			<if test="ipaddr != null and ipaddr != ''"> |  | ||||||
| 				AND ipaddr like concat('%', #{ipaddr}, '%') |  | ||||||
| 			</if> |  | ||||||
| 			<if test="status != null and status != ''"> |  | ||||||
| 				AND status = #{status} |  | ||||||
| 			</if> |  | ||||||
| 			<if test="userName != null and userName != ''"> |  | ||||||
| 				AND user_name like concat('%', #{userName}, '%') |  | ||||||
| 			</if> |  | ||||||
| 			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> |  | ||||||
| 				and date_format(login_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') |  | ||||||
| 			</if> |  | ||||||
| 			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> |  | ||||||
| 				and date_format(login_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') |  | ||||||
| 			</if> |  | ||||||
| 		</where> |  | ||||||
| 		order by info_id desc |  | ||||||
| 	</select> |  | ||||||
| 	 |  | ||||||
| 	<delete id="deleteLogininforByIds" parameterType="Long"> |  | ||||||
|  		delete from sys_logininfor where info_id in |  | ||||||
|  		<foreach collection="array" item="infoId" open="(" separator="," close=")"> |  | ||||||
|  			#{infoId} |  | ||||||
|         </foreach>  |  | ||||||
|  	</delete> |  | ||||||
|      |  | ||||||
|     <update id="cleanLogininfor"> |  | ||||||
|         truncate table sys_logininfor |  | ||||||
|     </update> |  | ||||||
|      |  | ||||||
| </mapper>  |  | ||||||
| @@ -1,39 +0,0 @@ | |||||||
| <?xml version="1.0" encoding="UTF-8" ?> |  | ||||||
| <!DOCTYPE mapper |  | ||||||
| PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |  | ||||||
| "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |  | ||||||
| <mapper namespace="com.ruoyi.system.mapper.SysOperLogMapper"> |  | ||||||
|  |  | ||||||
| 	<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult"> |  | ||||||
| 		<include refid="selectOperLogVo"/> |  | ||||||
| 		<where> |  | ||||||
| 			<if test="title != null and title != ''"> |  | ||||||
| 				AND title like concat('%', #{title}, '%') |  | ||||||
| 			</if> |  | ||||||
| 			<if test="businessType != null and businessType != ''"> |  | ||||||
| 				AND business_type = #{businessType} |  | ||||||
| 			</if> |  | ||||||
| 			<if test="businessTypes != null and businessTypes.length > 0"> |  | ||||||
| 			    AND business_type in |  | ||||||
| 			    <foreach collection="businessTypes" item="businessType" open="(" separator="," close=")"> |  | ||||||
| 		 			#{businessType} |  | ||||||
| 		        </foreach> |  | ||||||
| 			</if> |  | ||||||
| 			<if test="status != null"> |  | ||||||
| 				AND status = #{status} |  | ||||||
| 			</if> |  | ||||||
| 			<if test="operName != null and operName != ''"> |  | ||||||
| 				AND oper_name like concat('%', #{operName}, '%') |  | ||||||
| 			</if> |  | ||||||
| 			<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> |  | ||||||
| 				and date_format(oper_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') |  | ||||||
| 			</if> |  | ||||||
| 			<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> |  | ||||||
| 				and date_format(oper_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') |  | ||||||
| 			</if> |  | ||||||
| 		</where> |  | ||||||
| 		order by oper_id desc |  | ||||||
| 	</select> |  | ||||||
|  |  | ||||||
|  |  | ||||||
| </mapper> |  | ||||||
| @@ -1,6 +1,6 @@ | |||||||
| package cn.iocoder.dashboard.framework.excel.core.annotations; | package cn.iocoder.dashboard.framework.excel.core.annotations; | ||||||
|  |  | ||||||
| import cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum; | import cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum; | ||||||
|  |  | ||||||
| import java.lang.annotation.*; | import java.lang.annotation.*; | ||||||
|  |  | ||||||
| @@ -14,6 +14,6 @@ import java.lang.annotation.*; | |||||||
| @Inherited | @Inherited | ||||||
| public @interface DictFormat { | public @interface DictFormat { | ||||||
|  |  | ||||||
|     DictTypeEnum value(); |     SysDictTypeEnum value(); | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -5,7 +5,7 @@ import cn.hutool.core.convert.Convert; | |||||||
| import cn.iocoder.dashboard.framework.dict.core.util.DictUtils; | import cn.iocoder.dashboard.framework.dict.core.util.DictUtils; | ||||||
| import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; | import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; | ||||||
| import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO; | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO; | ||||||
| import cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum; | import cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum; | ||||||
| import com.alibaba.excel.converters.Converter; | import com.alibaba.excel.converters.Converter; | ||||||
| import com.alibaba.excel.enums.CellDataTypeEnum; | import com.alibaba.excel.enums.CellDataTypeEnum; | ||||||
| import com.alibaba.excel.metadata.CellData; | import com.alibaba.excel.metadata.CellData; | ||||||
| @@ -30,7 +30,7 @@ public class DictConvert implements Converter<Object> { | |||||||
|     public Object convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, |     public Object convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, | ||||||
|                                     GlobalConfiguration globalConfiguration) { |                                     GlobalConfiguration globalConfiguration) { | ||||||
|         // 使用字典解析 |         // 使用字典解析 | ||||||
|         DictTypeEnum type = getType(contentProperty); |         SysDictTypeEnum type = getType(contentProperty); | ||||||
|         String label = cellData.getStringValue(); |         String label = cellData.getStringValue(); | ||||||
|         SysDictDataDO dictData = DictUtils.parseDictDataFromCache(type.getValue(), label); |         SysDictDataDO dictData = DictUtils.parseDictDataFromCache(type.getValue(), label); | ||||||
|         if (dictData == null) { |         if (dictData == null) { | ||||||
| @@ -46,7 +46,7 @@ public class DictConvert implements Converter<Object> { | |||||||
|     public CellData<String> convertToExcelData(Object object, ExcelContentProperty contentProperty, |     public CellData<String> convertToExcelData(Object object, ExcelContentProperty contentProperty, | ||||||
|                                        GlobalConfiguration globalConfiguration) { |                                        GlobalConfiguration globalConfiguration) { | ||||||
|         // 使用字典格式化 |         // 使用字典格式化 | ||||||
|         DictTypeEnum type = getType(contentProperty); |         SysDictTypeEnum type = getType(contentProperty); | ||||||
|         String value = String.valueOf(object); |         String value = String.valueOf(object); | ||||||
|         SysDictDataDO dictData = DictUtils.getDictDataFromCache(type.getValue(), value); |         SysDictDataDO dictData = DictUtils.getDictDataFromCache(type.getValue(), value); | ||||||
|         if (dictData == null) { |         if (dictData == null) { | ||||||
| @@ -57,7 +57,7 @@ public class DictConvert implements Converter<Object> { | |||||||
|         return new CellData<>(dictData.getLabel()); |         return new CellData<>(dictData.getLabel()); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     private static DictTypeEnum getType(ExcelContentProperty contentProperty) { |     private static SysDictTypeEnum getType(ExcelContentProperty contentProperty) { | ||||||
|         return contentProperty.getField().getAnnotation(DictFormat.class).value(); |         return contentProperty.getField().getAnnotation(DictFormat.class).value(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -0,0 +1,27 @@ | |||||||
|  | package cn.iocoder.dashboard.modules.system.controller.config; | ||||||
|  |  | ||||||
|  | import io.swagger.annotations.Api; | ||||||
|  | import org.springframework.web.bind.annotation.RequestMapping; | ||||||
|  | import org.springframework.web.bind.annotation.RestController; | ||||||
|  |  | ||||||
|  | @Api(tags = "参数配置") | ||||||
|  | @RestController | ||||||
|  | @RequestMapping("/system/config") | ||||||
|  | public class SysConfigController { | ||||||
|  |  | ||||||
|  | //    private SpringValueRegistry | ||||||
|  | // | ||||||
|  | //    @Value("demo.test") | ||||||
|  | //    private String demo; | ||||||
|  | // | ||||||
|  | //    @GetMapping("/demo") | ||||||
|  | //    public String demo() { | ||||||
|  | //        return demo; | ||||||
|  | //    } | ||||||
|  | // | ||||||
|  | //    @PostMapping("/demo") | ||||||
|  | //    public void setDemo() { | ||||||
|  | // | ||||||
|  | //    } | ||||||
|  |  | ||||||
|  | } | ||||||
| @@ -0,0 +1,42 @@ | |||||||
|  | package cn.iocoder.dashboard.modules.system.controller.config.vo; | ||||||
|  |  | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  |  | ||||||
|  | import javax.validation.constraints.NotBlank; | ||||||
|  | import javax.validation.constraints.NotEmpty; | ||||||
|  | import javax.validation.constraints.Size; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * 参数配置 Base VO,提供给添加、修改、详细的子 VO 使用 | ||||||
|  |  * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class SysConfigBaseVO { | ||||||
|  |  | ||||||
|  |     @ApiModelProperty(value = "参数分组", required = true, example = "biz") | ||||||
|  |     @NotEmpty(message = "参数分组不能为空") | ||||||
|  |     @Size(max = 100, message = "参数名称不能超过50个字符") | ||||||
|  |     private String group; | ||||||
|  |  | ||||||
|  |     @ApiModelProperty(value = "参数名称", required = true, example = "数据库名") | ||||||
|  |     @NotBlank(message = "参数名称不能为空") | ||||||
|  |     @Size(max = 100, message = "参数名称不能超过100个字符") | ||||||
|  |     private String name; | ||||||
|  |  | ||||||
|  |     @ApiModelProperty(value = "参数键值", required = true, example = "1024") | ||||||
|  |     @NotBlank(message = "参数键值不能为空") | ||||||
|  |     @Size(max = 500, message = "参数键值长度不能超过500个字符") | ||||||
|  |     private String value; | ||||||
|  |  | ||||||
|  |     @ApiModelProperty(value = "参数类型", required = true, example = "1", notes = "参见 SysConfigTypeEnum 枚举") | ||||||
|  |     private String type; | ||||||
|  |  | ||||||
|  |     @ApiModelProperty(value = "是否敏感", required = true, example = "true") | ||||||
|  |     @NotBlank(message = "是否敏感不能为空") | ||||||
|  |     private Boolean sensitive; | ||||||
|  |  | ||||||
|  |     @ApiModelProperty(value = "备注", example = "备注一下很帅气!") | ||||||
|  |     private String remark; | ||||||
|  |  | ||||||
|  | } | ||||||
| @@ -0,0 +1,22 @@ | |||||||
|  | package cn.iocoder.dashboard.modules.system.controller.config.vo; | ||||||
|  |  | ||||||
|  | import cn.iocoder.dashboard.modules.system.controller.dept.vo.dept.SysDeptBaseVO; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.EqualsAndHashCode; | ||||||
|  |  | ||||||
|  | import javax.validation.constraints.NotBlank; | ||||||
|  | import javax.validation.constraints.Size; | ||||||
|  |  | ||||||
|  | @ApiModel("参数配置创建 Request VO") | ||||||
|  | @Data | ||||||
|  | @EqualsAndHashCode(callSuper = true) | ||||||
|  | public class SysConfigCreateReqVO extends SysDeptBaseVO { | ||||||
|  |  | ||||||
|  |     @ApiModelProperty(value = "参数键名", required = true, example = "yunai.db.username") | ||||||
|  |     @NotBlank(message = "参数键名长度不能为空") | ||||||
|  |     @Size(max = 100, message = "参数键名长度不能超过100个字符") | ||||||
|  |     private String key; | ||||||
|  |  | ||||||
|  | } | ||||||
| @@ -0,0 +1,41 @@ | |||||||
|  | package cn.iocoder.dashboard.modules.system.controller.config.vo; | ||||||
|  |  | ||||||
|  | import com.alibaba.excel.annotation.ExcelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  |  | ||||||
|  | import java.util.Date; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * 参数配置 Excel 导出响应 VO | ||||||
|  |  */ | ||||||
|  | @Data | ||||||
|  | public class SysConfigExcelVO { | ||||||
|  |  | ||||||
|  |     @ExcelProperty("参数配置序号") | ||||||
|  |     private Long id; | ||||||
|  |  | ||||||
|  |     @ExcelProperty("参数键名") | ||||||
|  |     private String key; | ||||||
|  |  | ||||||
|  |     @ExcelProperty("参数分组") | ||||||
|  |     private String group; | ||||||
|  |  | ||||||
|  |     @ExcelProperty("参数名称") | ||||||
|  |     private String name; | ||||||
|  |  | ||||||
|  |     @ExcelProperty("参数键值") | ||||||
|  |     private String value; | ||||||
|  |  | ||||||
|  |     @ExcelProperty("参数类型") | ||||||
|  |     private String type; | ||||||
|  |  | ||||||
|  |     @ExcelProperty("是否敏感") | ||||||
|  |     private Boolean sensitive; | ||||||
|  |  | ||||||
|  |     @ExcelProperty("备注") | ||||||
|  |     private String remark; | ||||||
|  |  | ||||||
|  |     @ExcelProperty("创建时间") | ||||||
|  |     private Date createTime; | ||||||
|  |  | ||||||
|  | } | ||||||
| @@ -0,0 +1,28 @@ | |||||||
|  | package cn.iocoder.dashboard.modules.system.controller.config.vo; | ||||||
|  |  | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.EqualsAndHashCode; | ||||||
|  |  | ||||||
|  | import javax.validation.constraints.NotBlank; | ||||||
|  | import javax.validation.constraints.Size; | ||||||
|  | import java.util.Date; | ||||||
|  |  | ||||||
|  | @ApiModel("参数配置信息 Response VO") | ||||||
|  | @Data | ||||||
|  | @EqualsAndHashCode(callSuper = true) | ||||||
|  | public class SysConfigRespVO extends SysConfigBaseVO { | ||||||
|  |  | ||||||
|  |     @ApiModelProperty(value = "参数配置序号", required = true, example = "1024") | ||||||
|  |     private Long id; | ||||||
|  |  | ||||||
|  |     @ApiModelProperty(value = "参数键名", required = true, example = "yunai.db.username") | ||||||
|  |     @NotBlank(message = "参数键名长度不能为空") | ||||||
|  |     @Size(max = 100, message = "参数键名长度不能超过100个字符") | ||||||
|  |     private String key; | ||||||
|  |  | ||||||
|  |     @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") | ||||||
|  |     private Date createTime; | ||||||
|  |  | ||||||
|  | } | ||||||
| @@ -0,0 +1,20 @@ | |||||||
|  | package cn.iocoder.dashboard.modules.system.controller.config.vo; | ||||||
|  |  | ||||||
|  | import cn.iocoder.dashboard.modules.system.controller.dept.vo.dept.SysDeptBaseVO; | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | import lombok.EqualsAndHashCode; | ||||||
|  |  | ||||||
|  | import javax.validation.constraints.NotNull; | ||||||
|  |  | ||||||
|  | @ApiModel("参数配置创建 Request VO") | ||||||
|  | @Data | ||||||
|  | @EqualsAndHashCode(callSuper = true) | ||||||
|  | public class SysConfigUpdateReqVO extends SysDeptBaseVO { | ||||||
|  |  | ||||||
|  |     @ApiModelProperty(value = "参数配置序号", required = true, example = "1024") | ||||||
|  |     @NotNull(message = "参数配置编号不能为空") | ||||||
|  |     private Long id; | ||||||
|  |  | ||||||
|  | } | ||||||
| @@ -1,8 +1,12 @@ | |||||||
| package cn.iocoder.dashboard.modules.system.controller.dept.vo.post; | package cn.iocoder.dashboard.modules.system.controller.dept.vo.post; | ||||||
|  |  | ||||||
|  | import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; | ||||||
|  | import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; | ||||||
| import com.alibaba.excel.annotation.ExcelProperty; | import com.alibaba.excel.annotation.ExcelProperty; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
|  |  | ||||||
|  | import static cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum.SYS_COMMON_STATUS; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * 岗位 Excel 导出响应 VO |  * 岗位 Excel 导出响应 VO | ||||||
|  */ |  */ | ||||||
| @@ -21,9 +25,8 @@ public class SysPostExcelVO { | |||||||
|     @ExcelProperty("岗位排序") |     @ExcelProperty("岗位排序") | ||||||
|     private String sort; |     private String sort; | ||||||
|  |  | ||||||
| //    @ExcelProperty(value = "状态", converter = DictConvert.class) |     @ExcelProperty(value = "状态", converter = DictConvert.class) | ||||||
| //    @DictFormat(SYS_COMMON_STATUS) |     @DictFormat(SYS_COMMON_STATUS) | ||||||
|     @ExcelProperty(value = "状态") |  | ||||||
|     private String status; |     private String status; | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -5,7 +5,7 @@ import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; | |||||||
| import com.alibaba.excel.annotation.ExcelProperty; | import com.alibaba.excel.annotation.ExcelProperty; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
|  |  | ||||||
| import static cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum.SYS_COMMON_STATUS; | import static cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum.SYS_COMMON_STATUS; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * 字典数据 Excel 导出响应 VO |  * 字典数据 Excel 导出响应 VO | ||||||
|   | |||||||
| @@ -5,7 +5,7 @@ import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; | |||||||
| import com.alibaba.excel.annotation.ExcelProperty; | import com.alibaba.excel.annotation.ExcelProperty; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
|  |  | ||||||
| import static cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum.SYS_COMMON_STATUS; | import static cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum.SYS_COMMON_STATUS; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * 字典类型 Excel 导出响应 VO |  * 字典类型 Excel 导出响应 VO | ||||||
|   | |||||||
| @@ -2,6 +2,9 @@ package cn.iocoder.dashboard.modules.system.controller.logger; | |||||||
|  |  | ||||||
| import cn.iocoder.dashboard.common.pojo.CommonResult; | import cn.iocoder.dashboard.common.pojo.CommonResult; | ||||||
| import cn.iocoder.dashboard.common.pojo.PageResult; | import cn.iocoder.dashboard.common.pojo.PageResult; | ||||||
|  | import cn.iocoder.dashboard.framework.excel.core.util.ExcelUtils; | ||||||
|  | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogExcelVO; | ||||||
|  | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogExportReqVO; | ||||||
| import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogPageReqVO; | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogPageReqVO; | ||||||
| import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogRespVO; | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogRespVO; | ||||||
| import cn.iocoder.dashboard.modules.system.convert.logger.SysLoginLogConvert; | import cn.iocoder.dashboard.modules.system.convert.logger.SysLoginLogConvert; | ||||||
| @@ -15,6 +18,9 @@ import org.springframework.web.bind.annotation.RequestMapping; | |||||||
| import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||||
|  |  | ||||||
| import javax.annotation.Resource; | import javax.annotation.Resource; | ||||||
|  | import javax.servlet.http.HttpServletResponse; | ||||||
|  | import java.io.IOException; | ||||||
|  | import java.util.List; | ||||||
|  |  | ||||||
| @Api(tags = "登陆日志 API") | @Api(tags = "登陆日志 API") | ||||||
| @RestController | @RestController | ||||||
| @@ -32,13 +38,17 @@ public class SysLoginLogController { | |||||||
|         return CommonResult.success(SysLoginLogConvert.INSTANCE.convertPage(page)); |         return CommonResult.success(SysLoginLogConvert.INSTANCE.convertPage(page)); | ||||||
|     } |     } | ||||||
|  |  | ||||||
| //    @GetMapping("/export") |     @ApiOperation("导出登陆日志 Excel") | ||||||
| ////    @Log(title = "登录日志", businessType = BusinessType.EXPORT) |     @GetMapping("/export") | ||||||
| ////    @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") | //    @Log(title = "登录日志", businessType = BusinessType.EXPORT) | ||||||
| //    public void exportLoginLog(SysLogininfor logininfor) { | //    @PreAuthorize("@ss.hasPermi('monitor:logininfor:export')") | ||||||
| //        List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); |     public void exportLoginLog(HttpServletResponse response, @Validated SysLoginLogExportReqVO reqVO) throws IOException { | ||||||
| //        ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class); |         List<SysLoginLogDO> list = loginLogService.getLoginLogList(reqVO); | ||||||
| //        return util.exportExcel(list, "登录日志"); |         // 拼接数据 | ||||||
| //    } |         List<SysLoginLogExcelVO> excelDataList = SysLoginLogConvert.INSTANCE.convertList(list); | ||||||
|  |         // 输出 | ||||||
|  |         ExcelUtils.write(response, "登陆日志.xls", "数据列表", | ||||||
|  |                 SysLoginLogExcelVO.class, excelDataList); | ||||||
|  |     } | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ package cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog; | |||||||
|  |  | ||||||
| import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; | import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; | ||||||
| import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; | import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; | ||||||
| import cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum; | import cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum; | ||||||
| import com.alibaba.excel.annotation.ExcelProperty; | import com.alibaba.excel.annotation.ExcelProperty; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
|  |  | ||||||
| @@ -17,14 +17,11 @@ public class SysLoginLogExcelVO { | |||||||
|     @ExcelProperty("日志主键") |     @ExcelProperty("日志主键") | ||||||
|     private Long id; |     private Long id; | ||||||
|  |  | ||||||
|     @ExcelProperty("用户编号") |  | ||||||
|     private Long userId; |  | ||||||
|  |  | ||||||
|     @ExcelProperty("用户账号") |     @ExcelProperty("用户账号") | ||||||
|     private String username; |     private String username; | ||||||
|  |  | ||||||
|     @ExcelProperty(value = "登陆结果", converter = DictConvert.class) |     @ExcelProperty(value = "登陆结果", converter = DictConvert.class) | ||||||
|     @DictFormat(DictTypeEnum.SYS_LOGIN_RESULT) |     @DictFormat(SysDictTypeEnum.SYS_LOGIN_RESULT) | ||||||
|     private Integer result; |     private Integer result; | ||||||
|  |  | ||||||
|     @ExcelProperty("登陆 IP") |     @ExcelProperty("登陆 IP") | ||||||
|   | |||||||
| @@ -0,0 +1,33 @@ | |||||||
|  | package cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog; | ||||||
|  |  | ||||||
|  | import io.swagger.annotations.ApiModel; | ||||||
|  | import io.swagger.annotations.ApiModelProperty; | ||||||
|  | import lombok.Data; | ||||||
|  | import org.springframework.format.annotation.DateTimeFormat; | ||||||
|  |  | ||||||
|  | import java.util.Date; | ||||||
|  |  | ||||||
|  | import static cn.iocoder.dashboard.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | ||||||
|  |  | ||||||
|  | @ApiModel("登陆日志分页列表 Request VO") | ||||||
|  | @Data | ||||||
|  | public class SysLoginLogExportReqVO { | ||||||
|  |  | ||||||
|  |     @ApiModelProperty(value = "用户 IP", example = "127.0.0.1", notes = "模拟匹配") | ||||||
|  |     private String userIp; | ||||||
|  |  | ||||||
|  |     @ApiModelProperty(value = "用户账号", example = "芋道", notes = "模拟匹配") | ||||||
|  |     private String username; | ||||||
|  |  | ||||||
|  |     @ApiModelProperty(value = "操作状态", example = "true") | ||||||
|  |     private Boolean status; | ||||||
|  |  | ||||||
|  |     @ApiModelProperty(value = "开始时间", example = "2020-10-24") | ||||||
|  |     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||||
|  |     private Date beginTime; | ||||||
|  |  | ||||||
|  |     @ApiModelProperty(value = "结束时间", example = "2020-10-24") | ||||||
|  |     @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | ||||||
|  |     private Date endTime; | ||||||
|  |  | ||||||
|  | } | ||||||
| @@ -2,7 +2,7 @@ package cn.iocoder.dashboard.modules.system.controller.logger.vo.operatelog; | |||||||
|  |  | ||||||
| import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; | import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; | ||||||
| import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; | import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; | ||||||
| import cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum; | import cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum; | ||||||
| import com.alibaba.excel.annotation.ExcelProperty; | import com.alibaba.excel.annotation.ExcelProperty; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
|  |  | ||||||
| @@ -24,7 +24,7 @@ public class SysOperateLogExcelVO { | |||||||
|     private String name; |     private String name; | ||||||
|  |  | ||||||
|     @ExcelProperty(value = "操作类型", converter = DictConvert.class) |     @ExcelProperty(value = "操作类型", converter = DictConvert.class) | ||||||
|     @DictFormat(DictTypeEnum.SYS_OPERATE_TYPE) |     @DictFormat(SysDictTypeEnum.SYS_OPERATE_TYPE) | ||||||
|     private String type; |     private String type; | ||||||
|  |  | ||||||
|     @ExcelProperty("操作人") |     @ExcelProperty("操作人") | ||||||
|   | |||||||
| @@ -4,7 +4,6 @@ import cn.iocoder.dashboard.common.pojo.PageParam; | |||||||
| import io.swagger.annotations.ApiModel; | import io.swagger.annotations.ApiModel; | ||||||
| import io.swagger.annotations.ApiModelProperty; | import io.swagger.annotations.ApiModelProperty; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
| import lombok.EqualsAndHashCode; |  | ||||||
| import org.springframework.format.annotation.DateTimeFormat; | import org.springframework.format.annotation.DateTimeFormat; | ||||||
|  |  | ||||||
| import java.util.Date; | import java.util.Date; | ||||||
| @@ -13,7 +12,6 @@ import static cn.iocoder.dashboard.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOU | |||||||
|  |  | ||||||
| @ApiModel("操作日志分页列表 Request VO") | @ApiModel("操作日志分页列表 Request VO") | ||||||
| @Data | @Data | ||||||
| @EqualsAndHashCode(callSuper = true) |  | ||||||
| public class SysOperateLogPageReqVO extends PageParam { | public class SysOperateLogPageReqVO extends PageParam { | ||||||
|  |  | ||||||
|     @ApiModelProperty(value = "操作模块", example = "订单", notes = "模拟匹配") |     @ApiModelProperty(value = "操作模块", example = "订单", notes = "模拟匹配") | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ package cn.iocoder.dashboard.modules.system.controller.permission.vo.role; | |||||||
|  |  | ||||||
| import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; | import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; | ||||||
| import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; | import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; | ||||||
| import cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum; | import cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum; | ||||||
| import com.alibaba.excel.annotation.ExcelProperty; | import com.alibaba.excel.annotation.ExcelProperty; | ||||||
| import lombok.Data; | import lombok.Data; | ||||||
|  |  | ||||||
| @@ -28,7 +28,7 @@ public class SysRoleExcelVO { | |||||||
|     private Integer dataScope; |     private Integer dataScope; | ||||||
|  |  | ||||||
|     @ExcelProperty(value = "角色状态", converter = DictConvert.class) |     @ExcelProperty(value = "角色状态", converter = DictConvert.class) | ||||||
|     @DictFormat(DictTypeEnum.SYS_COMMON_STATUS) |     @DictFormat(SysDictTypeEnum.SYS_COMMON_STATUS) | ||||||
|     private String status; |     private String status; | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -7,8 +7,8 @@ import lombok.Data; | |||||||
|  |  | ||||||
| import java.util.Date; | import java.util.Date; | ||||||
|  |  | ||||||
| import static cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum.SYS_COMMON_STATUS; | import static cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum.SYS_COMMON_STATUS; | ||||||
| import static cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum.SYS_USER_SEX; | import static cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum.SYS_USER_SEX; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * 用户 Excel 导出 VO |  * 用户 Excel 导出 VO | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ package cn.iocoder.dashboard.modules.system.controller.user.vo.user; | |||||||
|  |  | ||||||
| import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; | import cn.iocoder.dashboard.framework.excel.core.annotations.DictFormat; | ||||||
| import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; | import cn.iocoder.dashboard.framework.excel.core.convert.DictConvert; | ||||||
| import cn.iocoder.dashboard.modules.system.enums.dict.DictTypeEnum; | import cn.iocoder.dashboard.modules.system.enums.dict.SysDictTypeEnum; | ||||||
| import com.alibaba.excel.annotation.ExcelProperty; | import com.alibaba.excel.annotation.ExcelProperty; | ||||||
| import lombok.AllArgsConstructor; | import lombok.AllArgsConstructor; | ||||||
| import lombok.Builder; | import lombok.Builder; | ||||||
| @@ -34,11 +34,11 @@ public class SysUserImportExcelVO { | |||||||
|     private String mobile; |     private String mobile; | ||||||
|  |  | ||||||
|     @ExcelProperty(value = "用户性别", converter = DictConvert.class) |     @ExcelProperty(value = "用户性别", converter = DictConvert.class) | ||||||
|     @DictFormat(DictTypeEnum.SYS_USER_SEX) |     @DictFormat(SysDictTypeEnum.SYS_USER_SEX) | ||||||
|     private Integer sex; |     private Integer sex; | ||||||
|  |  | ||||||
|     @ExcelProperty(value = "账号状态", converter = DictConvert.class) |     @ExcelProperty(value = "账号状态", converter = DictConvert.class) | ||||||
|     @DictFormat(DictTypeEnum.SYS_COMMON_STATUS) |     @DictFormat(SysDictTypeEnum.SYS_COMMON_STATUS) | ||||||
|     private Integer status; |     private Integer status; | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -2,11 +2,14 @@ package cn.iocoder.dashboard.modules.system.convert.logger; | |||||||
|  |  | ||||||
| import cn.iocoder.dashboard.common.pojo.PageResult; | import cn.iocoder.dashboard.common.pojo.PageResult; | ||||||
| import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogCreateReqVO; | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogCreateReqVO; | ||||||
|  | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogExcelVO; | ||||||
| import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogRespVO; | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogRespVO; | ||||||
| import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.logger.SysLoginLogDO; | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.logger.SysLoginLogDO; | ||||||
| import org.mapstruct.Mapper; | import org.mapstruct.Mapper; | ||||||
| import org.mapstruct.factory.Mappers; | import org.mapstruct.factory.Mappers; | ||||||
|  |  | ||||||
|  | import java.util.List; | ||||||
|  |  | ||||||
| @Mapper | @Mapper | ||||||
| public interface SysLoginLogConvert { | public interface SysLoginLogConvert { | ||||||
|  |  | ||||||
| @@ -16,4 +19,6 @@ public interface SysLoginLogConvert { | |||||||
|  |  | ||||||
|     PageResult<SysLoginLogRespVO> convertPage(PageResult<SysLoginLogDO> page); |     PageResult<SysLoginLogRespVO> convertPage(PageResult<SysLoginLogDO> page); | ||||||
|  |  | ||||||
|  |     List<SysLoginLogExcelVO> convertList(List<SysLoginLogDO> list); | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -3,11 +3,14 @@ package cn.iocoder.dashboard.modules.system.dal.mysql.dao.logger; | |||||||
| import cn.iocoder.dashboard.common.pojo.PageResult; | import cn.iocoder.dashboard.common.pojo.PageResult; | ||||||
| import cn.iocoder.dashboard.framework.mybatis.core.mapper.BaseMapperX; | import cn.iocoder.dashboard.framework.mybatis.core.mapper.BaseMapperX; | ||||||
| import cn.iocoder.dashboard.framework.mybatis.core.query.QueryWrapperX; | import cn.iocoder.dashboard.framework.mybatis.core.query.QueryWrapperX; | ||||||
|  | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogExportReqVO; | ||||||
| import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogPageReqVO; | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogPageReqVO; | ||||||
| import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.logger.SysLoginLogDO; | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.logger.SysLoginLogDO; | ||||||
| import cn.iocoder.dashboard.modules.system.enums.logger.SysLoginResultEnum; | import cn.iocoder.dashboard.modules.system.enums.logger.SysLoginResultEnum; | ||||||
| import org.apache.ibatis.annotations.Mapper; | import org.apache.ibatis.annotations.Mapper; | ||||||
|  |  | ||||||
|  | import java.util.List; | ||||||
|  |  | ||||||
| @Mapper | @Mapper | ||||||
| public interface SysLoginLogMapper extends BaseMapperX<SysLoginLogDO> { | public interface SysLoginLogMapper extends BaseMapperX<SysLoginLogDO> { | ||||||
|  |  | ||||||
| @@ -25,4 +28,18 @@ public interface SysLoginLogMapper extends BaseMapperX<SysLoginLogDO> { | |||||||
|         return selectPage(reqVO, query); |         return selectPage(reqVO, query); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     default List<SysLoginLogDO> selectList(SysLoginLogExportReqVO reqVO) { | ||||||
|  |         QueryWrapperX<SysLoginLogDO> query = new QueryWrapperX<SysLoginLogDO>() | ||||||
|  |                 .likeIfPresent("user_ip", reqVO.getUserIp()) | ||||||
|  |                 .likeIfPresent("username", reqVO.getUsername()) | ||||||
|  |                 .betweenIfPresent("create_time", reqVO.getBeginTime(), reqVO.getEndTime()); | ||||||
|  |         if (Boolean.TRUE.equals(reqVO.getStatus())) { | ||||||
|  |             query.eq("result", SysLoginResultEnum.SUCCESS.getResult()); | ||||||
|  |         } else if (Boolean.FALSE.equals(reqVO.getStatus())) { | ||||||
|  |             query.gt("result", SysLoginResultEnum.SUCCESS.getResult()); | ||||||
|  |         } | ||||||
|  |         query.orderByDesc("id"); // 降序 | ||||||
|  |         return selectList(query); | ||||||
|  |     } | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -0,0 +1,52 @@ | |||||||
|  | package cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.config; | ||||||
|  |  | ||||||
|  | import cn.iocoder.dashboard.framework.mybatis.core.dataobject.BaseDO; | ||||||
|  | import cn.iocoder.dashboard.modules.system.enums.config.SysConfigTypeEnum; | ||||||
|  | import com.baomidou.mybatisplus.annotation.TableName; | ||||||
|  |  | ||||||
|  | /** | ||||||
|  |  * 参数配置表 | ||||||
|  |  * | ||||||
|  |  * @author ruoyi | ||||||
|  |  */ | ||||||
|  | @TableName("sys_config") | ||||||
|  | public class SysConfigDO extends BaseDO { | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 参数主键 | ||||||
|  |      */ | ||||||
|  |     private Long id; | ||||||
|  |     /** | ||||||
|  |      * 参数分组 | ||||||
|  |      */ | ||||||
|  |     private String group; | ||||||
|  |     /** | ||||||
|  |      * 参数名称 | ||||||
|  |      */ | ||||||
|  |     private String name; | ||||||
|  |     /** | ||||||
|  |      * 参数键名 | ||||||
|  |      */ | ||||||
|  |     private String key; | ||||||
|  |     /** | ||||||
|  |      * 参数键值 | ||||||
|  |      */ | ||||||
|  |     private String value; | ||||||
|  |     /** | ||||||
|  |      * 参数类型 | ||||||
|  |      * | ||||||
|  |      * 枚举 {@link SysConfigTypeEnum} | ||||||
|  |      */ | ||||||
|  |     private String type; | ||||||
|  |     /** | ||||||
|  |      * 是否敏感 | ||||||
|  |      * | ||||||
|  |      * 对于敏感配置,需要管理权限才能查看 | ||||||
|  |      */ | ||||||
|  |     private Boolean sensitive; | ||||||
|  |     /** | ||||||
|  |      * 备注 | ||||||
|  |      */ | ||||||
|  |     private String remark; | ||||||
|  |  | ||||||
|  | } | ||||||
| @@ -4,7 +4,7 @@ import cn.iocoder.dashboard.common.enums.CommonStatusEnum; | |||||||
| import cn.iocoder.dashboard.framework.mybatis.core.dataobject.BaseDO; | import cn.iocoder.dashboard.framework.mybatis.core.dataobject.BaseDO; | ||||||
| import cn.iocoder.dashboard.framework.security.core.enums.DataScopeEnum; | import cn.iocoder.dashboard.framework.security.core.enums.DataScopeEnum; | ||||||
| import cn.iocoder.dashboard.modules.system.enums.permission.RoleCodeEnum; | import cn.iocoder.dashboard.modules.system.enums.permission.RoleCodeEnum; | ||||||
| import cn.iocoder.dashboard.modules.system.enums.permission.RoleTypeEnum; | import cn.iocoder.dashboard.modules.system.enums.permission.SysRoleTypeEnum; | ||||||
| import com.baomidou.mybatisplus.annotation.TableField; | import com.baomidou.mybatisplus.annotation.TableField; | ||||||
| import com.baomidou.mybatisplus.annotation.TableId; | import com.baomidou.mybatisplus.annotation.TableId; | ||||||
| import com.baomidou.mybatisplus.annotation.TableName; | import com.baomidou.mybatisplus.annotation.TableName; | ||||||
| @@ -52,7 +52,7 @@ public class SysRoleDO extends BaseDO { | |||||||
|     /** |     /** | ||||||
|      * 角色类型 |      * 角色类型 | ||||||
|      * |      * | ||||||
|      * 枚举 {@link RoleTypeEnum} |      * 枚举 {@link SysRoleTypeEnum} | ||||||
|      */ |      */ | ||||||
|     private Integer type; |     private Integer type; | ||||||
|     /** |     /** | ||||||
|   | |||||||
| @@ -0,0 +1,21 @@ | |||||||
|  | package cn.iocoder.dashboard.modules.system.enums.config; | ||||||
|  |  | ||||||
|  | import lombok.AllArgsConstructor; | ||||||
|  | import lombok.Getter; | ||||||
|  |  | ||||||
|  | @Getter | ||||||
|  | @AllArgsConstructor | ||||||
|  | public enum SysConfigTypeEnum { | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 系统配置 | ||||||
|  |      */ | ||||||
|  |     SYSTEM(1), | ||||||
|  |     /** | ||||||
|  |      * 自定义配置 | ||||||
|  |      */ | ||||||
|  |     CUSTOM(2); | ||||||
|  |  | ||||||
|  |     private final Integer type; | ||||||
|  |  | ||||||
|  | } | ||||||
| @@ -8,7 +8,7 @@ import lombok.Getter; | |||||||
|  */ |  */ | ||||||
| @Getter | @Getter | ||||||
| @AllArgsConstructor | @AllArgsConstructor | ||||||
| public enum DictTypeEnum { | public enum SysDictTypeEnum { | ||||||
| 
 | 
 | ||||||
|     SYS_USER_SEX("sys_user_sex"), // 用户性别 |     SYS_USER_SEX("sys_user_sex"), // 用户性别 | ||||||
|     SYS_COMMON_STATUS("sys_common_status"), // 系统状态 |     SYS_COMMON_STATUS("sys_common_status"), // 系统状态 | ||||||
| @@ -5,7 +5,7 @@ import lombok.Getter; | |||||||
| 
 | 
 | ||||||
| @Getter | @Getter | ||||||
| @AllArgsConstructor | @AllArgsConstructor | ||||||
| public enum RoleTypeEnum { | public enum SysRoleTypeEnum { | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * 内置角色 |      * 内置角色 | ||||||
| @@ -2,9 +2,12 @@ package cn.iocoder.dashboard.modules.system.service.logger; | |||||||
|  |  | ||||||
| import cn.iocoder.dashboard.common.pojo.PageResult; | import cn.iocoder.dashboard.common.pojo.PageResult; | ||||||
| import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogCreateReqVO; | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogCreateReqVO; | ||||||
|  | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogExportReqVO; | ||||||
| import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogPageReqVO; | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogPageReqVO; | ||||||
| import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.logger.SysLoginLogDO; | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.logger.SysLoginLogDO; | ||||||
|  |  | ||||||
|  | import java.util.List; | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * 登陆日志 Service 接口 |  * 登陆日志 Service 接口 | ||||||
|  */ |  */ | ||||||
| @@ -25,4 +28,12 @@ public interface SysLoginLogService { | |||||||
|      */ |      */ | ||||||
|     PageResult<SysLoginLogDO> getLoginLogPage(SysLoginLogPageReqVO reqVO); |     PageResult<SysLoginLogDO> getLoginLogPage(SysLoginLogPageReqVO reqVO); | ||||||
|  |  | ||||||
|  |     /** | ||||||
|  |      * 获得登陆日志列表 | ||||||
|  |      * | ||||||
|  |      * @param reqVO 列表条件 | ||||||
|  |      * @return 登陆日志列表 | ||||||
|  |      */ | ||||||
|  |     List<SysLoginLogDO> getLoginLogList(SysLoginLogExportReqVO reqVO); | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollUtil; | |||||||
| import cn.hutool.core.util.StrUtil; | import cn.hutool.core.util.StrUtil; | ||||||
| import cn.iocoder.dashboard.common.pojo.PageResult; | import cn.iocoder.dashboard.common.pojo.PageResult; | ||||||
| import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogCreateReqVO; | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogCreateReqVO; | ||||||
|  | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogExportReqVO; | ||||||
| import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogPageReqVO; | import cn.iocoder.dashboard.modules.system.controller.logger.vo.loginlog.SysLoginLogPageReqVO; | ||||||
| import cn.iocoder.dashboard.modules.system.convert.logger.SysLoginLogConvert; | import cn.iocoder.dashboard.modules.system.convert.logger.SysLoginLogConvert; | ||||||
| import cn.iocoder.dashboard.modules.system.dal.mysql.dao.logger.SysLoginLogMapper; | import cn.iocoder.dashboard.modules.system.dal.mysql.dao.logger.SysLoginLogMapper; | ||||||
| @@ -15,6 +16,7 @@ import org.springframework.stereotype.Service; | |||||||
|  |  | ||||||
| import javax.annotation.Resource; | import javax.annotation.Resource; | ||||||
| import java.util.Collection; | import java.util.Collection; | ||||||
|  | import java.util.List; | ||||||
|  |  | ||||||
| import static cn.iocoder.dashboard.util.collection.CollectionUtils.convertSet; | import static cn.iocoder.dashboard.util.collection.CollectionUtils.convertSet; | ||||||
|  |  | ||||||
| @@ -41,4 +43,9 @@ public class SysLoginLogServiceImpl implements SysLoginLogService { | |||||||
|         return loginLogMapper.selectPage(reqVO); |         return loginLogMapper.selectPage(reqVO); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     @Override | ||||||
|  |     public List<SysLoginLogDO> getLoginLogList(SysLoginLogExportReqVO reqVO) { | ||||||
|  |         return loginLogMapper.selectList(reqVO); | ||||||
|  |     } | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -12,7 +12,7 @@ import cn.iocoder.dashboard.modules.system.convert.permission.SysRoleConvert; | |||||||
| import cn.iocoder.dashboard.modules.system.dal.mysql.dao.permission.SysRoleMapper; | import cn.iocoder.dashboard.modules.system.dal.mysql.dao.permission.SysRoleMapper; | ||||||
| import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission.SysRoleDO; | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.permission.SysRoleDO; | ||||||
| import cn.iocoder.dashboard.modules.system.enums.permission.RoleCodeEnum; | import cn.iocoder.dashboard.modules.system.enums.permission.RoleCodeEnum; | ||||||
| import cn.iocoder.dashboard.modules.system.enums.permission.RoleTypeEnum; | import cn.iocoder.dashboard.modules.system.enums.permission.SysRoleTypeEnum; | ||||||
| import cn.iocoder.dashboard.modules.system.service.permission.SysPermissionService; | import cn.iocoder.dashboard.modules.system.service.permission.SysPermissionService; | ||||||
| import cn.iocoder.dashboard.modules.system.service.permission.SysRoleService; | import cn.iocoder.dashboard.modules.system.service.permission.SysRoleService; | ||||||
| import com.baomidou.mybatisplus.core.metadata.IPage; | import com.baomidou.mybatisplus.core.metadata.IPage; | ||||||
| @@ -101,7 +101,7 @@ public class SysRoleServiceImpl implements SysRoleService { | |||||||
|         checkDuplicateRole(reqVO.getName(), reqVO.getCode(), null); |         checkDuplicateRole(reqVO.getName(), reqVO.getCode(), null); | ||||||
|         // 插入到数据库 |         // 插入到数据库 | ||||||
|         SysRoleDO role = SysRoleConvert.INSTANCE.convert(reqVO); |         SysRoleDO role = SysRoleConvert.INSTANCE.convert(reqVO); | ||||||
|         role.setType(RoleTypeEnum.CUSTOM.getType()); |         role.setType(SysRoleTypeEnum.CUSTOM.getType()); | ||||||
|         role.setStatus(CommonStatusEnum.ENABLE.getStatus()); |         role.setStatus(CommonStatusEnum.ENABLE.getStatus()); | ||||||
|         roleMapper.insert(role); |         roleMapper.insert(role); | ||||||
|         // 返回 |         // 返回 | ||||||
| @@ -207,7 +207,7 @@ public class SysRoleServiceImpl implements SysRoleService { | |||||||
|             throw ServiceExceptionUtil.exception(ROLE_NOT_EXISTS); |             throw ServiceExceptionUtil.exception(ROLE_NOT_EXISTS); | ||||||
|         } |         } | ||||||
|         // 内置角色,不允许删除 |         // 内置角色,不允许删除 | ||||||
|         if (RoleTypeEnum.SYSTEM.getType().equals(roleDO.getType())) { |         if (SysRoleTypeEnum.SYSTEM.getType().equals(roleDO.getType())) { | ||||||
|             throw ServiceExceptionUtil.exception(ROLE_CAN_NOT_UPDATE_SYSTEM_TYPE_ROLE); |             throw ServiceExceptionUtil.exception(ROLE_CAN_NOT_UPDATE_SYSTEM_TYPE_ROLE); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 YunaiV
					YunaiV