Commit f7f27c96933b41de9eb08e0b0d8f8286eea2c5e8
1 parent
ba6c879e
开始迁移字典类型模块
Showing
60 changed files
with
590 additions
and
3176 deletions
ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java deleted
| 1 | -package com.ruoyi; | ||
| 2 | - | ||
| 3 | -import org.springframework.boot.builder.SpringApplicationBuilder; | ||
| 4 | -import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; | ||
| 5 | - | ||
| 6 | -/** | ||
| 7 | - * web容器中进行部署 | ||
| 8 | - * | ||
| 9 | - * @author ruoyi | ||
| 10 | - */ | ||
| 11 | -public class RuoYiServletInitializer extends SpringBootServletInitializer | ||
| 12 | -{ | ||
| 13 | - @Override | ||
| 14 | - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) | ||
| 15 | - { | ||
| 16 | - return application.sources(RuoYiApplication.class); | ||
| 17 | - } | ||
| 18 | -} |
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java deleted
| 1 | -package com.ruoyi.web.controller.system; | ||
| 2 | - | ||
| 3 | -import java.util.ArrayList; | ||
| 4 | -import java.util.List; | ||
| 5 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 6 | -import org.springframework.security.access.prepost.PreAuthorize; | ||
| 7 | -import org.springframework.validation.annotation.Validated; | ||
| 8 | -import org.springframework.web.bind.annotation.DeleteMapping; | ||
| 9 | -import org.springframework.web.bind.annotation.GetMapping; | ||
| 10 | -import org.springframework.web.bind.annotation.PathVariable; | ||
| 11 | -import org.springframework.web.bind.annotation.PostMapping; | ||
| 12 | -import org.springframework.web.bind.annotation.PutMapping; | ||
| 13 | -import org.springframework.web.bind.annotation.RequestBody; | ||
| 14 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
| 15 | -import org.springframework.web.bind.annotation.RestController; | ||
| 16 | -import com.ruoyi.common.annotation.Log; | ||
| 17 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 18 | -import com.ruoyi.common.core.domain.AjaxResult; | ||
| 19 | -import com.ruoyi.common.core.domain.entity.SysDictData; | ||
| 20 | -import com.ruoyi.common.core.page.TableDataInfo; | ||
| 21 | -import com.ruoyi.common.enums.BusinessType; | ||
| 22 | -import com.ruoyi.common.utils.SecurityUtils; | ||
| 23 | -import com.ruoyi.common.utils.StringUtils; | ||
| 24 | -import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 25 | -import com.ruoyi.system.service.ISysDictDataService; | ||
| 26 | -import com.ruoyi.system.service.ISysDictTypeService; | ||
| 27 | - | ||
| 28 | -/** | ||
| 29 | - * 数据字典信息 | ||
| 30 | - * | ||
| 31 | - * @author ruoyi | ||
| 32 | - */ | ||
| 33 | -@RestController | ||
| 34 | -@RequestMapping("/system/dict/data") | ||
| 35 | -public class SysDictDataController extends BaseController | ||
| 36 | -{ | ||
| 37 | - @Autowired | ||
| 38 | - private ISysDictDataService dictDataService; | ||
| 39 | - | ||
| 40 | - @Autowired | ||
| 41 | - private ISysDictTypeService dictTypeService; | ||
| 42 | - | ||
| 43 | - @PreAuthorize("@ss.hasPermi('system:dict:list')") | ||
| 44 | - @GetMapping("/list") | ||
| 45 | - public TableDataInfo list(SysDictData dictData) | ||
| 46 | - { | ||
| 47 | - startPage(); | ||
| 48 | - List<SysDictData> list = dictDataService.selectDictDataList(dictData); | ||
| 49 | - return getDataTable(list); | ||
| 50 | - } | ||
| 51 | - | ||
| 52 | - @Log(title = "字典数据", businessType = BusinessType.EXPORT) | ||
| 53 | - @PreAuthorize("@ss.hasPermi('system:dict:export')") | ||
| 54 | - @GetMapping("/export") | ||
| 55 | - public AjaxResult export(SysDictData dictData) | ||
| 56 | - { | ||
| 57 | - List<SysDictData> list = dictDataService.selectDictDataList(dictData); | ||
| 58 | - ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class); | ||
| 59 | - return util.exportExcel(list, "字典数据"); | ||
| 60 | - } | ||
| 61 | - | ||
| 62 | - /** | ||
| 63 | - * 查询字典数据详细 | ||
| 64 | - */ | ||
| 65 | - @PreAuthorize("@ss.hasPermi('system:dict:query')") | ||
| 66 | - @GetMapping(value = "/{dictCode}") | ||
| 67 | - public AjaxResult getInfo(@PathVariable Long dictCode) | ||
| 68 | - { | ||
| 69 | - return AjaxResult.success(dictDataService.selectDictDataById(dictCode)); | ||
| 70 | - } | ||
| 71 | - | ||
| 72 | - /** | ||
| 73 | - * 根据字典类型查询字典数据信息 | ||
| 74 | - */ | ||
| 75 | - @GetMapping(value = "/type/{dictType}") | ||
| 76 | - public AjaxResult dictType(@PathVariable String dictType) | ||
| 77 | - { | ||
| 78 | - List<SysDictData> data = dictTypeService.selectDictDataByType(dictType); | ||
| 79 | - if (StringUtils.isNull(data)) | ||
| 80 | - { | ||
| 81 | - data = new ArrayList<SysDictData>(); | ||
| 82 | - } | ||
| 83 | - return AjaxResult.success(data); | ||
| 84 | - } | ||
| 85 | - | ||
| 86 | - /** | ||
| 87 | - * 新增字典类型 | ||
| 88 | - */ | ||
| 89 | - @PreAuthorize("@ss.hasPermi('system:dict:add')") | ||
| 90 | - @Log(title = "字典数据", businessType = BusinessType.INSERT) | ||
| 91 | - @PostMapping | ||
| 92 | - public AjaxResult add(@Validated @RequestBody SysDictData dict) | ||
| 93 | - { | ||
| 94 | - dict.setCreateBy(SecurityUtils.getUsername()); | ||
| 95 | - return toAjax(dictDataService.insertDictData(dict)); | ||
| 96 | - } | ||
| 97 | - | ||
| 98 | - /** | ||
| 99 | - * 修改保存字典类型 | ||
| 100 | - */ | ||
| 101 | - @PreAuthorize("@ss.hasPermi('system:dict:edit')") | ||
| 102 | - @Log(title = "字典数据", businessType = BusinessType.UPDATE) | ||
| 103 | - @PutMapping | ||
| 104 | - public AjaxResult edit(@Validated @RequestBody SysDictData dict) | ||
| 105 | - { | ||
| 106 | - dict.setUpdateBy(SecurityUtils.getUsername()); | ||
| 107 | - return toAjax(dictDataService.updateDictData(dict)); | ||
| 108 | - } | ||
| 109 | - | ||
| 110 | - /** | ||
| 111 | - * 删除字典类型 | ||
| 112 | - */ | ||
| 113 | - @PreAuthorize("@ss.hasPermi('system:dict:remove')") | ||
| 114 | - @Log(title = "字典类型", businessType = BusinessType.DELETE) | ||
| 115 | - @DeleteMapping("/{dictCodes}") | ||
| 116 | - public AjaxResult remove(@PathVariable Long[] dictCodes) | ||
| 117 | - { | ||
| 118 | - return toAjax(dictDataService.deleteDictDataByIds(dictCodes)); | ||
| 119 | - } | ||
| 120 | -} |
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java deleted
| 1 | -package com.ruoyi.web.controller.system; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 5 | -import org.springframework.security.access.prepost.PreAuthorize; | ||
| 6 | -import org.springframework.validation.annotation.Validated; | ||
| 7 | -import org.springframework.web.bind.annotation.DeleteMapping; | ||
| 8 | -import org.springframework.web.bind.annotation.GetMapping; | ||
| 9 | -import org.springframework.web.bind.annotation.PathVariable; | ||
| 10 | -import org.springframework.web.bind.annotation.PostMapping; | ||
| 11 | -import org.springframework.web.bind.annotation.PutMapping; | ||
| 12 | -import org.springframework.web.bind.annotation.RequestBody; | ||
| 13 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
| 14 | -import org.springframework.web.bind.annotation.RestController; | ||
| 15 | -import com.ruoyi.common.annotation.Log; | ||
| 16 | -import com.ruoyi.common.constant.UserConstants; | ||
| 17 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 18 | -import com.ruoyi.common.core.domain.AjaxResult; | ||
| 19 | -import com.ruoyi.common.core.domain.entity.SysDictType; | ||
| 20 | -import com.ruoyi.common.core.page.TableDataInfo; | ||
| 21 | -import com.ruoyi.common.enums.BusinessType; | ||
| 22 | -import com.ruoyi.common.utils.SecurityUtils; | ||
| 23 | -import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 24 | -import com.ruoyi.system.service.ISysDictTypeService; | ||
| 25 | - | ||
| 26 | -/** | ||
| 27 | - * 数据字典信息 | ||
| 28 | - * | ||
| 29 | - * @author ruoyi | ||
| 30 | - */ | ||
| 31 | -@RestController | ||
| 32 | -@RequestMapping("/system/dict/type") | ||
| 33 | -public class SysDictTypeController extends BaseController | ||
| 34 | -{ | ||
| 35 | - @Autowired | ||
| 36 | - private ISysDictTypeService dictTypeService; | ||
| 37 | - | ||
| 38 | - @PreAuthorize("@ss.hasPermi('system:dict:list')") | ||
| 39 | - @GetMapping("/list") | ||
| 40 | - public TableDataInfo list(SysDictType dictType) | ||
| 41 | - { | ||
| 42 | - startPage(); | ||
| 43 | - List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); | ||
| 44 | - return getDataTable(list); | ||
| 45 | - } | ||
| 46 | - | ||
| 47 | - @Log(title = "字典类型", businessType = BusinessType.EXPORT) | ||
| 48 | - @PreAuthorize("@ss.hasPermi('system:dict:export')") | ||
| 49 | - @GetMapping("/export") | ||
| 50 | - public AjaxResult export(SysDictType dictType) | ||
| 51 | - { | ||
| 52 | - List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); | ||
| 53 | - ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class); | ||
| 54 | - return util.exportExcel(list, "字典类型"); | ||
| 55 | - } | ||
| 56 | - | ||
| 57 | - /** | ||
| 58 | - * 查询字典类型详细 | ||
| 59 | - */ | ||
| 60 | - @PreAuthorize("@ss.hasPermi('system:dict:query')") | ||
| 61 | - @GetMapping(value = "/{dictId}") | ||
| 62 | - public AjaxResult getInfo(@PathVariable Long dictId) | ||
| 63 | - { | ||
| 64 | - return AjaxResult.success(dictTypeService.selectDictTypeById(dictId)); | ||
| 65 | - } | ||
| 66 | - | ||
| 67 | - /** | ||
| 68 | - * 新增字典类型 | ||
| 69 | - */ | ||
| 70 | - @PreAuthorize("@ss.hasPermi('system:dict:add')") | ||
| 71 | - @Log(title = "字典类型", businessType = BusinessType.INSERT) | ||
| 72 | - @PostMapping | ||
| 73 | - public AjaxResult add(@Validated @RequestBody SysDictType dict) | ||
| 74 | - { | ||
| 75 | - if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) | ||
| 76 | - { | ||
| 77 | - return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); | ||
| 78 | - } | ||
| 79 | - dict.setCreateBy(SecurityUtils.getUsername()); | ||
| 80 | - return toAjax(dictTypeService.insertDictType(dict)); | ||
| 81 | - } | ||
| 82 | - | ||
| 83 | - /** | ||
| 84 | - * 修改字典类型 | ||
| 85 | - */ | ||
| 86 | - @PreAuthorize("@ss.hasPermi('system:dict:edit')") | ||
| 87 | - @Log(title = "字典类型", businessType = BusinessType.UPDATE) | ||
| 88 | - @PutMapping | ||
| 89 | - public AjaxResult edit(@Validated @RequestBody SysDictType dict) | ||
| 90 | - { | ||
| 91 | - if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) | ||
| 92 | - { | ||
| 93 | - return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); | ||
| 94 | - } | ||
| 95 | - dict.setUpdateBy(SecurityUtils.getUsername()); | ||
| 96 | - return toAjax(dictTypeService.updateDictType(dict)); | ||
| 97 | - } | ||
| 98 | - | ||
| 99 | - /** | ||
| 100 | - * 删除字典类型 | ||
| 101 | - */ | ||
| 102 | - @PreAuthorize("@ss.hasPermi('system:dict:remove')") | ||
| 103 | - @Log(title = "字典类型", businessType = BusinessType.DELETE) | ||
| 104 | - @DeleteMapping("/{dictIds}") | ||
| 105 | - public AjaxResult remove(@PathVariable Long[] dictIds) | ||
| 106 | - { | ||
| 107 | - return toAjax(dictTypeService.deleteDictTypeByIds(dictIds)); | ||
| 108 | - } | ||
| 109 | - | ||
| 110 | - /** | ||
| 111 | - * 清空缓存 | ||
| 112 | - */ | ||
| 113 | - @PreAuthorize("@ss.hasPermi('system:dict:remove')") | ||
| 114 | - @Log(title = "字典类型", businessType = BusinessType.CLEAN) | ||
| 115 | - @DeleteMapping("/clearCache") | ||
| 116 | - public AjaxResult clearCache() | ||
| 117 | - { | ||
| 118 | - dictTypeService.clearCache(); | ||
| 119 | - return AjaxResult.success(); | ||
| 120 | - } | ||
| 121 | - | ||
| 122 | - /** | ||
| 123 | - * 获取字典选择框列表 | ||
| 124 | - */ | ||
| 125 | - @GetMapping("/optionselect") | ||
| 126 | - public AjaxResult optionselect() | ||
| 127 | - { | ||
| 128 | - List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll(); | ||
| 129 | - return AjaxResult.success(dictTypes); | ||
| 130 | - } | ||
| 131 | -} |
ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java deleted
| 1 | -package com.ruoyi.web.controller.tool; | ||
| 2 | - | ||
| 3 | -import java.util.ArrayList; | ||
| 4 | -import java.util.LinkedHashMap; | ||
| 5 | -import java.util.List; | ||
| 6 | -import java.util.Map; | ||
| 7 | -import org.springframework.web.bind.annotation.DeleteMapping; | ||
| 8 | -import org.springframework.web.bind.annotation.GetMapping; | ||
| 9 | -import org.springframework.web.bind.annotation.PathVariable; | ||
| 10 | -import org.springframework.web.bind.annotation.PostMapping; | ||
| 11 | -import org.springframework.web.bind.annotation.PutMapping; | ||
| 12 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
| 13 | -import org.springframework.web.bind.annotation.RestController; | ||
| 14 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 15 | -import com.ruoyi.common.core.domain.AjaxResult; | ||
| 16 | -import com.ruoyi.common.utils.StringUtils; | ||
| 17 | -import io.swagger.annotations.Api; | ||
| 18 | -import io.swagger.annotations.ApiImplicitParam; | ||
| 19 | -import io.swagger.annotations.ApiModel; | ||
| 20 | -import io.swagger.annotations.ApiModelProperty; | ||
| 21 | -import io.swagger.annotations.ApiOperation; | ||
| 22 | - | ||
| 23 | -/** | ||
| 24 | - * swagger 用户测试方法 | ||
| 25 | - * | ||
| 26 | - * @author ruoyi | ||
| 27 | - */ | ||
| 28 | -@Api("用户信息管理") | ||
| 29 | -@RestController | ||
| 30 | -@RequestMapping("/test/user") | ||
| 31 | -public class TestController extends BaseController | ||
| 32 | -{ | ||
| 33 | - private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>(); | ||
| 34 | - { | ||
| 35 | - users.put(1, new UserEntity(1, "admin", "admin123", "15888888888")); | ||
| 36 | - users.put(2, new UserEntity(2, "ry", "admin123", "15666666666")); | ||
| 37 | - } | ||
| 38 | - | ||
| 39 | - @ApiOperation("获取用户列表") | ||
| 40 | - @GetMapping("/list") | ||
| 41 | - public AjaxResult userList() | ||
| 42 | - { | ||
| 43 | - List<UserEntity> userList = new ArrayList<UserEntity>(users.values()); | ||
| 44 | - return AjaxResult.success(userList); | ||
| 45 | - } | ||
| 46 | - | ||
| 47 | - @ApiOperation("获取用户详细") | ||
| 48 | - @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path") | ||
| 49 | - @GetMapping("/{userId}") | ||
| 50 | - public AjaxResult getUser(@PathVariable Integer userId) | ||
| 51 | - { | ||
| 52 | - if (!users.isEmpty() && users.containsKey(userId)) | ||
| 53 | - { | ||
| 54 | - return AjaxResult.success(users.get(userId)); | ||
| 55 | - } | ||
| 56 | - else | ||
| 57 | - { | ||
| 58 | - return AjaxResult.error("用户不存在"); | ||
| 59 | - } | ||
| 60 | - } | ||
| 61 | - | ||
| 62 | - @ApiOperation("新增用户") | ||
| 63 | - @ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity") | ||
| 64 | - @PostMapping("/save") | ||
| 65 | - public AjaxResult save(UserEntity user) | ||
| 66 | - { | ||
| 67 | - if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) | ||
| 68 | - { | ||
| 69 | - return AjaxResult.error("用户ID不能为空"); | ||
| 70 | - } | ||
| 71 | - return AjaxResult.success(users.put(user.getUserId(), user)); | ||
| 72 | - } | ||
| 73 | - | ||
| 74 | - @ApiOperation("更新用户") | ||
| 75 | - @ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity") | ||
| 76 | - @PutMapping("/update") | ||
| 77 | - public AjaxResult update(UserEntity user) | ||
| 78 | - { | ||
| 79 | - if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) | ||
| 80 | - { | ||
| 81 | - return AjaxResult.error("用户ID不能为空"); | ||
| 82 | - } | ||
| 83 | - if (users.isEmpty() || !users.containsKey(user.getUserId())) | ||
| 84 | - { | ||
| 85 | - return AjaxResult.error("用户不存在"); | ||
| 86 | - } | ||
| 87 | - users.remove(user.getUserId()); | ||
| 88 | - return AjaxResult.success(users.put(user.getUserId(), user)); | ||
| 89 | - } | ||
| 90 | - | ||
| 91 | - @ApiOperation("删除用户信息") | ||
| 92 | - @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path") | ||
| 93 | - @DeleteMapping("/{userId}") | ||
| 94 | - public AjaxResult delete(@PathVariable Integer userId) | ||
| 95 | - { | ||
| 96 | - if (!users.isEmpty() && users.containsKey(userId)) | ||
| 97 | - { | ||
| 98 | - users.remove(userId); | ||
| 99 | - return AjaxResult.success(); | ||
| 100 | - } | ||
| 101 | - else | ||
| 102 | - { | ||
| 103 | - return AjaxResult.error("用户不存在"); | ||
| 104 | - } | ||
| 105 | - } | ||
| 106 | -} | ||
| 107 | - | ||
| 108 | -@ApiModel("用户实体") | ||
| 109 | -class UserEntity | ||
| 110 | -{ | ||
| 111 | - @ApiModelProperty("用户ID") | ||
| 112 | - private Integer userId; | ||
| 113 | - | ||
| 114 | - @ApiModelProperty("用户名称") | ||
| 115 | - private String username; | ||
| 116 | - | ||
| 117 | - @ApiModelProperty("用户密码") | ||
| 118 | - private String password; | ||
| 119 | - | ||
| 120 | - @ApiModelProperty("用户手机") | ||
| 121 | - private String mobile; | ||
| 122 | - | ||
| 123 | - public UserEntity() | ||
| 124 | - { | ||
| 125 | - | ||
| 126 | - } | ||
| 127 | - | ||
| 128 | - public UserEntity(Integer userId, String username, String password, String mobile) | ||
| 129 | - { | ||
| 130 | - this.userId = userId; | ||
| 131 | - this.username = username; | ||
| 132 | - this.password = password; | ||
| 133 | - this.mobile = mobile; | ||
| 134 | - } | ||
| 135 | - | ||
| 136 | - public Integer getUserId() | ||
| 137 | - { | ||
| 138 | - return userId; | ||
| 139 | - } | ||
| 140 | - | ||
| 141 | - public void setUserId(Integer userId) | ||
| 142 | - { | ||
| 143 | - this.userId = userId; | ||
| 144 | - } | ||
| 145 | - | ||
| 146 | - public String getUsername() | ||
| 147 | - { | ||
| 148 | - return username; | ||
| 149 | - } | ||
| 150 | - | ||
| 151 | - public void setUsername(String username) | ||
| 152 | - { | ||
| 153 | - this.username = username; | ||
| 154 | - } | ||
| 155 | - | ||
| 156 | - public String getPassword() | ||
| 157 | - { | ||
| 158 | - return password; | ||
| 159 | - } | ||
| 160 | - | ||
| 161 | - public void setPassword(String password) | ||
| 162 | - { | ||
| 163 | - this.password = password; | ||
| 164 | - } | ||
| 165 | - | ||
| 166 | - public String getMobile() | ||
| 167 | - { | ||
| 168 | - return mobile; | ||
| 169 | - } | ||
| 170 | - | ||
| 171 | - public void setMobile(String mobile) | ||
| 172 | - { | ||
| 173 | - this.mobile = mobile; | ||
| 174 | - } | ||
| 175 | -} |
ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8" ?> | ||
| 2 | -<!DOCTYPE configuration | ||
| 3 | -PUBLIC "-//mybatis.org//DTD Config 3.0//EN" | ||
| 4 | -"http://mybatis.org/dtd/mybatis-3-config.dtd"> | ||
| 5 | -<configuration> | ||
| 6 | - | ||
| 7 | - <settings> | ||
| 8 | - <setting name="cacheEnabled" value="true" /> <!-- 全局映射器启用缓存 --> | ||
| 9 | - <setting name="useGeneratedKeys" value="true" /> <!-- 允许 JDBC 支持自动生成主键 --> | ||
| 10 | - <setting name="defaultExecutorType" value="REUSE" /> <!-- 配置默认的执行器 --> | ||
| 11 | - <setting name="logImpl" value="SLF4J" /> <!-- 指定 MyBatis 所用日志的具体实现 --> | ||
| 12 | - <!-- <setting name="mapUnderscoreToCamelCase" value="true"/> 驼峰式命名 --> | ||
| 13 | - </settings> | ||
| 14 | - | ||
| 15 | -</configuration> |
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java deleted
| 1 | -package com.ruoyi.framework.web.service; | ||
| 2 | - | ||
| 3 | -import java.util.HashSet; | ||
| 4 | -import java.util.Set; | ||
| 5 | - | ||
| 6 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 7 | -import org.springframework.stereotype.Component; | ||
| 8 | -import com.ruoyi.common.core.domain.entity.SysUser; | ||
| 9 | -import com.ruoyi.system.service.ISysMenuService; | ||
| 10 | -import com.ruoyi.system.service.ISysRoleService; | ||
| 11 | - | ||
| 12 | -/** | ||
| 13 | - * 用户权限处理 | ||
| 14 | - * | ||
| 15 | - * @author ruoyi | ||
| 16 | - */ | ||
| 17 | -@Component | ||
| 18 | -public class SysPermissionService { | ||
| 19 | - @Autowired | ||
| 20 | - private ISysRoleService roleService; | ||
| 21 | - | ||
| 22 | - @Autowired | ||
| 23 | - private ISysMenuService menuService; | ||
| 24 | - | ||
| 25 | - /** | ||
| 26 | - * 获取角色数据权限 | ||
| 27 | - * | ||
| 28 | - * @param user 用户信息 | ||
| 29 | - * @return 角色权限信息 | ||
| 30 | - */ | ||
| 31 | - public Set<String> getRolePermission(SysUser user) { | ||
| 32 | - Set<String> roles = new HashSet<String>(); | ||
| 33 | - // 管理员拥有所有权限 | ||
| 34 | - if (user.isAdmin()) { | ||
| 35 | - roles.add("admin"); | ||
| 36 | - } else { | ||
| 37 | - roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId())); | ||
| 38 | - } | ||
| 39 | - return roles; | ||
| 40 | - } | ||
| 41 | - | ||
| 42 | - /** | ||
| 43 | - * 获取菜单数据权限 | ||
| 44 | - * | ||
| 45 | - * @param user 用户信息 | ||
| 46 | - * @return 菜单权限信息 | ||
| 47 | - */ | ||
| 48 | - public Set<String> getMenuPermission(SysUser user) { | ||
| 49 | - Set<String> perms = new HashSet<String>(); | ||
| 50 | - // 管理员拥有所有权限 | ||
| 51 | - if (user.isAdmin()) { | ||
| 52 | - perms.add("*:*:*"); | ||
| 53 | - } else { | ||
| 54 | - perms.addAll(getMenuPermissionmenuService.selectMenuPermsByUserId(user.getUserId())); | ||
| 55 | - } | ||
| 56 | - return perms; | ||
| 57 | - } | ||
| 58 | -} |
ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java
| @@ -10,7 +10,7 @@ import com.ruoyi.common.utils.StringUtils; | @@ -10,7 +10,7 @@ import com.ruoyi.common.utils.StringUtils; | ||
| 10 | 10 | ||
| 11 | /** | 11 | /** |
| 12 | * 业务表 gen_table | 12 | * 业务表 gen_table |
| 13 | - * | 13 | + * |
| 14 | * @author ruoyi | 14 | * @author ruoyi |
| 15 | */ | 15 | */ |
| 16 | public class GenTable extends BaseEntity | 16 | public class GenTable extends BaseEntity |
| @@ -86,206 +86,6 @@ public class GenTable extends BaseEntity | @@ -86,206 +86,6 @@ public class GenTable extends BaseEntity | ||
| 86 | /** 上级菜单名称字段 */ | 86 | /** 上级菜单名称字段 */ |
| 87 | private String parentMenuName; | 87 | private String parentMenuName; |
| 88 | 88 | ||
| 89 | - public Long getTableId() | ||
| 90 | - { | ||
| 91 | - return tableId; | ||
| 92 | - } | ||
| 93 | - | ||
| 94 | - public void setTableId(Long tableId) | ||
| 95 | - { | ||
| 96 | - this.tableId = tableId; | ||
| 97 | - } | ||
| 98 | - | ||
| 99 | - public String getTableName() | ||
| 100 | - { | ||
| 101 | - return tableName; | ||
| 102 | - } | ||
| 103 | - | ||
| 104 | - public void setTableName(String tableName) | ||
| 105 | - { | ||
| 106 | - this.tableName = tableName; | ||
| 107 | - } | ||
| 108 | - | ||
| 109 | - public String getTableComment() | ||
| 110 | - { | ||
| 111 | - return tableComment; | ||
| 112 | - } | ||
| 113 | - | ||
| 114 | - public void setTableComment(String tableComment) | ||
| 115 | - { | ||
| 116 | - this.tableComment = tableComment; | ||
| 117 | - } | ||
| 118 | - | ||
| 119 | - public String getClassName() | ||
| 120 | - { | ||
| 121 | - return className; | ||
| 122 | - } | ||
| 123 | - | ||
| 124 | - public void setClassName(String className) | ||
| 125 | - { | ||
| 126 | - this.className = className; | ||
| 127 | - } | ||
| 128 | - | ||
| 129 | - public String getTplCategory() | ||
| 130 | - { | ||
| 131 | - return tplCategory; | ||
| 132 | - } | ||
| 133 | - | ||
| 134 | - public void setTplCategory(String tplCategory) | ||
| 135 | - { | ||
| 136 | - this.tplCategory = tplCategory; | ||
| 137 | - } | ||
| 138 | - | ||
| 139 | - public String getPackageName() | ||
| 140 | - { | ||
| 141 | - return packageName; | ||
| 142 | - } | ||
| 143 | - | ||
| 144 | - public void setPackageName(String packageName) | ||
| 145 | - { | ||
| 146 | - this.packageName = packageName; | ||
| 147 | - } | ||
| 148 | - | ||
| 149 | - public String getModuleName() | ||
| 150 | - { | ||
| 151 | - return moduleName; | ||
| 152 | - } | ||
| 153 | - | ||
| 154 | - public void setModuleName(String moduleName) | ||
| 155 | - { | ||
| 156 | - this.moduleName = moduleName; | ||
| 157 | - } | ||
| 158 | - | ||
| 159 | - public String getBusinessName() | ||
| 160 | - { | ||
| 161 | - return businessName; | ||
| 162 | - } | ||
| 163 | - | ||
| 164 | - public void setBusinessName(String businessName) | ||
| 165 | - { | ||
| 166 | - this.businessName = businessName; | ||
| 167 | - } | ||
| 168 | - | ||
| 169 | - public String getFunctionName() | ||
| 170 | - { | ||
| 171 | - return functionName; | ||
| 172 | - } | ||
| 173 | - | ||
| 174 | - public void setFunctionName(String functionName) | ||
| 175 | - { | ||
| 176 | - this.functionName = functionName; | ||
| 177 | - } | ||
| 178 | - | ||
| 179 | - public String getFunctionAuthor() | ||
| 180 | - { | ||
| 181 | - return functionAuthor; | ||
| 182 | - } | ||
| 183 | - | ||
| 184 | - public void setFunctionAuthor(String functionAuthor) | ||
| 185 | - { | ||
| 186 | - this.functionAuthor = functionAuthor; | ||
| 187 | - } | ||
| 188 | - | ||
| 189 | - public String getGenType() | ||
| 190 | - { | ||
| 191 | - return genType; | ||
| 192 | - } | ||
| 193 | - | ||
| 194 | - public void setGenType(String genType) | ||
| 195 | - { | ||
| 196 | - this.genType = genType; | ||
| 197 | - } | ||
| 198 | - | ||
| 199 | - public String getGenPath() | ||
| 200 | - { | ||
| 201 | - return genPath; | ||
| 202 | - } | ||
| 203 | - | ||
| 204 | - public void setGenPath(String genPath) | ||
| 205 | - { | ||
| 206 | - this.genPath = genPath; | ||
| 207 | - } | ||
| 208 | - | ||
| 209 | - public GenTableColumn getPkColumn() | ||
| 210 | - { | ||
| 211 | - return pkColumn; | ||
| 212 | - } | ||
| 213 | - | ||
| 214 | - public void setPkColumn(GenTableColumn pkColumn) | ||
| 215 | - { | ||
| 216 | - this.pkColumn = pkColumn; | ||
| 217 | - } | ||
| 218 | - | ||
| 219 | - public List<GenTableColumn> getColumns() | ||
| 220 | - { | ||
| 221 | - return columns; | ||
| 222 | - } | ||
| 223 | - | ||
| 224 | - public void setColumns(List<GenTableColumn> columns) | ||
| 225 | - { | ||
| 226 | - this.columns = columns; | ||
| 227 | - } | ||
| 228 | - | ||
| 229 | - public String getOptions() | ||
| 230 | - { | ||
| 231 | - return options; | ||
| 232 | - } | ||
| 233 | - | ||
| 234 | - public void setOptions(String options) | ||
| 235 | - { | ||
| 236 | - this.options = options; | ||
| 237 | - } | ||
| 238 | - | ||
| 239 | - public String getTreeCode() | ||
| 240 | - { | ||
| 241 | - return treeCode; | ||
| 242 | - } | ||
| 243 | - | ||
| 244 | - public void setTreeCode(String treeCode) | ||
| 245 | - { | ||
| 246 | - this.treeCode = treeCode; | ||
| 247 | - } | ||
| 248 | - | ||
| 249 | - public String getTreeParentCode() | ||
| 250 | - { | ||
| 251 | - return treeParentCode; | ||
| 252 | - } | ||
| 253 | - | ||
| 254 | - public void setTreeParentCode(String treeParentCode) | ||
| 255 | - { | ||
| 256 | - this.treeParentCode = treeParentCode; | ||
| 257 | - } | ||
| 258 | - | ||
| 259 | - public String getTreeName() | ||
| 260 | - { | ||
| 261 | - return treeName; | ||
| 262 | - } | ||
| 263 | - | ||
| 264 | - public void setTreeName(String treeName) | ||
| 265 | - { | ||
| 266 | - this.treeName = treeName; | ||
| 267 | - } | ||
| 268 | - | ||
| 269 | - public String getParentMenuId() | ||
| 270 | - { | ||
| 271 | - return parentMenuId; | ||
| 272 | - } | ||
| 273 | - | ||
| 274 | - public void setParentMenuId(String parentMenuId) | ||
| 275 | - { | ||
| 276 | - this.parentMenuId = parentMenuId; | ||
| 277 | - } | ||
| 278 | - | ||
| 279 | - public String getParentMenuName() | ||
| 280 | - { | ||
| 281 | - return parentMenuName; | ||
| 282 | - } | ||
| 283 | - | ||
| 284 | - public void setParentMenuName(String parentMenuName) | ||
| 285 | - { | ||
| 286 | - this.parentMenuName = parentMenuName; | ||
| 287 | - } | ||
| 288 | - | ||
| 289 | public boolean isTree() | 89 | public boolean isTree() |
| 290 | { | 90 | { |
| 291 | return isTree(this.tplCategory); | 91 | return isTree(this.tplCategory); |
| @@ -320,4 +120,4 @@ public class GenTable extends BaseEntity | @@ -320,4 +120,4 @@ public class GenTable extends BaseEntity | ||
| 320 | } | 120 | } |
| 321 | return StringUtils.equalsAnyIgnoreCase(javaField, GenConstants.BASE_ENTITY); | 121 | return StringUtils.equalsAnyIgnoreCase(javaField, GenConstants.BASE_ENTITY); |
| 322 | } | 122 | } |
| 323 | -} | ||
| 324 | \ No newline at end of file | 123 | \ No newline at end of file |
| 124 | +} |
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java
| 1 | package com.ruoyi.system.mapper; | 1 | package com.ruoyi.system.mapper; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | + | ||
| 4 | import com.ruoyi.system.domain.SysConfig; | 5 | import com.ruoyi.system.domain.SysConfig; |
| 5 | 6 | ||
| 6 | /** | 7 | /** |
| 7 | * 参数配置 数据层 | 8 | * 参数配置 数据层 |
| 8 | - * | 9 | + * |
| 9 | * @author ruoyi | 10 | * @author ruoyi |
| 10 | */ | 11 | */ |
| 11 | -public interface SysConfigMapper | ||
| 12 | -{ | 12 | +public interface SysConfigMapper { |
| 13 | /** | 13 | /** |
| 14 | * 查询参数配置信息 | 14 | * 查询参数配置信息 |
| 15 | - * | 15 | + * |
| 16 | * @param config 参数配置信息 | 16 | * @param config 参数配置信息 |
| 17 | * @return 参数配置信息 | 17 | * @return 参数配置信息 |
| 18 | */ | 18 | */ |
| @@ -20,7 +20,7 @@ public interface SysConfigMapper | @@ -20,7 +20,7 @@ public interface SysConfigMapper | ||
| 20 | 20 | ||
| 21 | /** | 21 | /** |
| 22 | * 查询参数配置列表 | 22 | * 查询参数配置列表 |
| 23 | - * | 23 | + * |
| 24 | * @param config 参数配置信息 | 24 | * @param config 参数配置信息 |
| 25 | * @return 参数配置集合 | 25 | * @return 参数配置集合 |
| 26 | */ | 26 | */ |
| @@ -28,7 +28,7 @@ public interface SysConfigMapper | @@ -28,7 +28,7 @@ public interface SysConfigMapper | ||
| 28 | 28 | ||
| 29 | /** | 29 | /** |
| 30 | * 根据键名查询参数配置信息 | 30 | * 根据键名查询参数配置信息 |
| 31 | - * | 31 | + * |
| 32 | * @param configKey 参数键名 | 32 | * @param configKey 参数键名 |
| 33 | * @return 参数配置信息 | 33 | * @return 参数配置信息 |
| 34 | */ | 34 | */ |
| @@ -36,7 +36,7 @@ public interface SysConfigMapper | @@ -36,7 +36,7 @@ public interface SysConfigMapper | ||
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | * 新增参数配置 | 38 | * 新增参数配置 |
| 39 | - * | 39 | + * |
| 40 | * @param config 参数配置信息 | 40 | * @param config 参数配置信息 |
| 41 | * @return 结果 | 41 | * @return 结果 |
| 42 | */ | 42 | */ |
| @@ -44,7 +44,7 @@ public interface SysConfigMapper | @@ -44,7 +44,7 @@ public interface SysConfigMapper | ||
| 44 | 44 | ||
| 45 | /** | 45 | /** |
| 46 | * 修改参数配置 | 46 | * 修改参数配置 |
| 47 | - * | 47 | + * |
| 48 | * @param config 参数配置信息 | 48 | * @param config 参数配置信息 |
| 49 | * @return 结果 | 49 | * @return 结果 |
| 50 | */ | 50 | */ |
| @@ -52,7 +52,7 @@ public interface SysConfigMapper | @@ -52,7 +52,7 @@ public interface SysConfigMapper | ||
| 52 | 52 | ||
| 53 | /** | 53 | /** |
| 54 | * 删除参数配置 | 54 | * 删除参数配置 |
| 55 | - * | 55 | + * |
| 56 | * @param configId 参数ID | 56 | * @param configId 参数ID |
| 57 | * @return 结果 | 57 | * @return 结果 |
| 58 | */ | 58 | */ |
| @@ -60,7 +60,7 @@ public interface SysConfigMapper | @@ -60,7 +60,7 @@ public interface SysConfigMapper | ||
| 60 | 60 | ||
| 61 | /** | 61 | /** |
| 62 | * 批量删除参数信息 | 62 | * 批量删除参数信息 |
| 63 | - * | 63 | + * |
| 64 | * @param configIds 需要删除的参数ID | 64 | * @param configIds 需要删除的参数ID |
| 65 | * @return 结果 | 65 | * @return 结果 |
| 66 | */ | 66 | */ |
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java deleted
| 1 | -package com.ruoyi.system.mapper; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | -import org.apache.ibatis.annotations.Param; | ||
| 5 | -import com.ruoyi.common.core.domain.entity.SysDept; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * 部门管理 数据层 | ||
| 9 | - * | ||
| 10 | - * @author ruoyi | ||
| 11 | - */ | ||
| 12 | -public interface SysDeptMapper | ||
| 13 | -{ | ||
| 14 | - /** | ||
| 15 | - * 查询部门管理数据 | ||
| 16 | - * | ||
| 17 | - * @param dept 部门信息 | ||
| 18 | - * @return 部门信息集合 | ||
| 19 | - */ | ||
| 20 | - public List<SysDept> selectDeptList(SysDept dept); | ||
| 21 | - | ||
| 22 | - /** | ||
| 23 | - * 根据角色ID查询部门树信息 | ||
| 24 | - * | ||
| 25 | - * @param roleId 角色ID | ||
| 26 | - * @param deptCheckStrictly 部门树选择项是否关联显示 | ||
| 27 | - * @return 选中部门列表 | ||
| 28 | - */ | ||
| 29 | - public List<Integer> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly); | ||
| 30 | - | ||
| 31 | - /** | ||
| 32 | - * 根据部门ID查询信息 | ||
| 33 | - * | ||
| 34 | - * @param deptId 部门ID | ||
| 35 | - * @return 部门信息 | ||
| 36 | - */ | ||
| 37 | - public SysDept selectDeptById(Long deptId); | ||
| 38 | - | ||
| 39 | - /** | ||
| 40 | - * 根据ID查询所有子部门 | ||
| 41 | - * | ||
| 42 | - * @param deptId 部门ID | ||
| 43 | - * @return 部门列表 | ||
| 44 | - */ | ||
| 45 | - public List<SysDept> selectChildrenDeptById(Long deptId); | ||
| 46 | - | ||
| 47 | - /** | ||
| 48 | - * 根据ID查询所有子部门(正常状态) | ||
| 49 | - * | ||
| 50 | - * @param deptId 部门ID | ||
| 51 | - * @return 子部门数 | ||
| 52 | - */ | ||
| 53 | - public int selectNormalChildrenDeptById(Long deptId); | ||
| 54 | - | ||
| 55 | - /** | ||
| 56 | - * 是否存在子节点 | ||
| 57 | - * | ||
| 58 | - * @param deptId 部门ID | ||
| 59 | - * @return 结果 | ||
| 60 | - */ | ||
| 61 | - public int hasChildByDeptId(Long deptId); | ||
| 62 | - | ||
| 63 | - /** | ||
| 64 | - * 查询部门是否存在用户 | ||
| 65 | - * | ||
| 66 | - * @param deptId 部门ID | ||
| 67 | - * @return 结果 | ||
| 68 | - */ | ||
| 69 | - public int checkDeptExistUser(Long deptId); | ||
| 70 | - | ||
| 71 | - /** | ||
| 72 | - * 校验部门名称是否唯一 | ||
| 73 | - * | ||
| 74 | - * @param deptName 部门名称 | ||
| 75 | - * @param parentId 父部门ID | ||
| 76 | - * @return 结果 | ||
| 77 | - */ | ||
| 78 | - public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId); | ||
| 79 | - | ||
| 80 | - /** | ||
| 81 | - * 新增部门信息 | ||
| 82 | - * | ||
| 83 | - * @param dept 部门信息 | ||
| 84 | - * @return 结果 | ||
| 85 | - */ | ||
| 86 | - public int insertDept(SysDept dept); | ||
| 87 | - | ||
| 88 | - /** | ||
| 89 | - * 修改部门信息 | ||
| 90 | - * | ||
| 91 | - * @param dept 部门信息 | ||
| 92 | - * @return 结果 | ||
| 93 | - */ | ||
| 94 | - public int updateDept(SysDept dept); | ||
| 95 | - | ||
| 96 | - /** | ||
| 97 | - * 修改所在部门的父级部门状态 | ||
| 98 | - * | ||
| 99 | - * @param dept 部门 | ||
| 100 | - */ | ||
| 101 | - public void updateDeptStatus(SysDept dept); | ||
| 102 | - | ||
| 103 | - /** | ||
| 104 | - * 修改子元素关系 | ||
| 105 | - * | ||
| 106 | - * @param depts 子元素 | ||
| 107 | - * @return 结果 | ||
| 108 | - */ | ||
| 109 | - public int updateDeptChildren(@Param("depts") List<SysDept> depts); | ||
| 110 | - | ||
| 111 | - /** | ||
| 112 | - * 删除部门管理信息 | ||
| 113 | - * | ||
| 114 | - * @param deptId 部门ID | ||
| 115 | - * @return 结果 | ||
| 116 | - */ | ||
| 117 | - public int deleteDeptById(Long deptId); | ||
| 118 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java deleted
| 1 | -package com.ruoyi.system.mapper; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | -import org.apache.ibatis.annotations.Param; | ||
| 5 | -import com.ruoyi.common.core.domain.entity.SysDictData; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * 字典表 数据层 | ||
| 9 | - * | ||
| 10 | - * @author ruoyi | ||
| 11 | - */ | ||
| 12 | -public interface SysDictDataMapper | ||
| 13 | -{ | ||
| 14 | - /** | ||
| 15 | - * 根据条件分页查询字典数据 | ||
| 16 | - * | ||
| 17 | - * @param dictData 字典数据信息 | ||
| 18 | - * @return 字典数据集合信息 | ||
| 19 | - */ | ||
| 20 | - public List<SysDictData> selectDictDataList(SysDictData dictData); | ||
| 21 | - | ||
| 22 | - /** | ||
| 23 | - * 根据字典类型查询字典数据 | ||
| 24 | - * | ||
| 25 | - * @param dictType 字典类型 | ||
| 26 | - * @return 字典数据集合信息 | ||
| 27 | - */ | ||
| 28 | - public List<SysDictData> selectDictDataByType(String dictType); | ||
| 29 | - | ||
| 30 | - /** | ||
| 31 | - * 根据字典类型和字典键值查询字典数据信息 | ||
| 32 | - * | ||
| 33 | - * @param dictType 字典类型 | ||
| 34 | - * @param dictValue 字典键值 | ||
| 35 | - * @return 字典标签 | ||
| 36 | - */ | ||
| 37 | - public String selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue); | ||
| 38 | - | ||
| 39 | - /** | ||
| 40 | - * 根据字典数据ID查询信息 | ||
| 41 | - * | ||
| 42 | - * @param dictCode 字典数据ID | ||
| 43 | - * @return 字典数据 | ||
| 44 | - */ | ||
| 45 | - public SysDictData selectDictDataById(Long dictCode); | ||
| 46 | - | ||
| 47 | - /** | ||
| 48 | - * 查询字典数据 | ||
| 49 | - * | ||
| 50 | - * @param dictType 字典类型 | ||
| 51 | - * @return 字典数据 | ||
| 52 | - */ | ||
| 53 | - public int countDictDataByType(String dictType); | ||
| 54 | - | ||
| 55 | - /** | ||
| 56 | - * 通过字典ID删除字典数据信息 | ||
| 57 | - * | ||
| 58 | - * @param dictCode 字典数据ID | ||
| 59 | - * @return 结果 | ||
| 60 | - */ | ||
| 61 | - public int deleteDictDataById(Long dictCode); | ||
| 62 | - | ||
| 63 | - /** | ||
| 64 | - * 批量删除字典数据信息 | ||
| 65 | - * | ||
| 66 | - * @param dictCodes 需要删除的字典数据ID | ||
| 67 | - * @return 结果 | ||
| 68 | - */ | ||
| 69 | - public int deleteDictDataByIds(Long[] dictCodes); | ||
| 70 | - | ||
| 71 | - /** | ||
| 72 | - * 新增字典数据信息 | ||
| 73 | - * | ||
| 74 | - * @param dictData 字典数据信息 | ||
| 75 | - * @return 结果 | ||
| 76 | - */ | ||
| 77 | - public int insertDictData(SysDictData dictData); | ||
| 78 | - | ||
| 79 | - /** | ||
| 80 | - * 修改字典数据信息 | ||
| 81 | - * | ||
| 82 | - * @param dictData 字典数据信息 | ||
| 83 | - * @return 结果 | ||
| 84 | - */ | ||
| 85 | - public int updateDictData(SysDictData dictData); | ||
| 86 | - | ||
| 87 | - /** | ||
| 88 | - * 同步修改字典类型 | ||
| 89 | - * | ||
| 90 | - * @param oldDictType 旧字典类型 | ||
| 91 | - * @param newDictType 新旧字典类型 | ||
| 92 | - * @return 结果 | ||
| 93 | - */ | ||
| 94 | - public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType); | ||
| 95 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java deleted
| 1 | -package com.ruoyi.system.mapper; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | -import org.apache.ibatis.annotations.Mapper; | ||
| 5 | -import com.ruoyi.common.core.domain.entity.SysDictType; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * 字典表 数据层 | ||
| 9 | - * | ||
| 10 | - * @author ruoyi | ||
| 11 | - */ | ||
| 12 | -@Mapper | ||
| 13 | -public interface SysDictTypeMapper | ||
| 14 | -{ | ||
| 15 | - /** | ||
| 16 | - * 根据条件分页查询字典类型 | ||
| 17 | - * | ||
| 18 | - * @param dictType 字典类型信息 | ||
| 19 | - * @return 字典类型集合信息 | ||
| 20 | - */ | ||
| 21 | - public List<SysDictType> selectDictTypeList(SysDictType dictType); | ||
| 22 | - | ||
| 23 | - /** | ||
| 24 | - * 根据所有字典类型 | ||
| 25 | - * | ||
| 26 | - * @return 字典类型集合信息 | ||
| 27 | - */ | ||
| 28 | - public List<SysDictType> selectDictTypeAll(); | ||
| 29 | - | ||
| 30 | - /** | ||
| 31 | - * 根据字典类型ID查询信息 | ||
| 32 | - * | ||
| 33 | - * @param dictId 字典类型ID | ||
| 34 | - * @return 字典类型 | ||
| 35 | - */ | ||
| 36 | - public SysDictType selectDictTypeById(Long dictId); | ||
| 37 | - | ||
| 38 | - /** | ||
| 39 | - * 根据字典类型查询信息 | ||
| 40 | - * | ||
| 41 | - * @param dictType 字典类型 | ||
| 42 | - * @return 字典类型 | ||
| 43 | - */ | ||
| 44 | - public SysDictType selectDictTypeByType(String dictType); | ||
| 45 | - | ||
| 46 | - /** | ||
| 47 | - * 通过字典ID删除字典信息 | ||
| 48 | - * | ||
| 49 | - * @param dictId 字典ID | ||
| 50 | - * @return 结果 | ||
| 51 | - */ | ||
| 52 | - public int deleteDictTypeById(Long dictId); | ||
| 53 | - | ||
| 54 | - /** | ||
| 55 | - * 批量删除字典类型信息 | ||
| 56 | - * | ||
| 57 | - * @param dictIds 需要删除的字典ID | ||
| 58 | - * @return 结果 | ||
| 59 | - */ | ||
| 60 | - public int deleteDictTypeByIds(Long[] dictIds); | ||
| 61 | - | ||
| 62 | - /** | ||
| 63 | - * 新增字典类型信息 | ||
| 64 | - * | ||
| 65 | - * @param dictType 字典类型信息 | ||
| 66 | - * @return 结果 | ||
| 67 | - */ | ||
| 68 | - public int insertDictType(SysDictType dictType); | ||
| 69 | - | ||
| 70 | - /** | ||
| 71 | - * 修改字典类型信息 | ||
| 72 | - * | ||
| 73 | - * @param dictType 字典类型信息 | ||
| 74 | - * @return 结果 | ||
| 75 | - */ | ||
| 76 | - public int updateDictType(SysDictType dictType); | ||
| 77 | - | ||
| 78 | - /** | ||
| 79 | - * 校验字典类型称是否唯一 | ||
| 80 | - * | ||
| 81 | - * @param dictType 字典类型 | ||
| 82 | - * @return 结果 | ||
| 83 | - */ | ||
| 84 | - public SysDictType checkDictTypeUnique(String dictType); | ||
| 85 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java
| 1 | package com.ruoyi.system.mapper; | 1 | package com.ruoyi.system.mapper; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | + | ||
| 4 | import com.ruoyi.system.domain.SysLogininfor; | 5 | import com.ruoyi.system.domain.SysLogininfor; |
| 5 | 6 | ||
| 6 | /** | 7 | /** |
| 7 | * 系统访问日志情况信息 数据层 | 8 | * 系统访问日志情况信息 数据层 |
| 8 | - * | 9 | + * |
| 9 | * @author ruoyi | 10 | * @author ruoyi |
| 10 | */ | 11 | */ |
| 11 | -public interface SysLogininforMapper | ||
| 12 | -{ | 12 | +public interface SysLogininforMapper { |
| 13 | /** | 13 | /** |
| 14 | * 新增系统登录日志 | 14 | * 新增系统登录日志 |
| 15 | - * | 15 | + * |
| 16 | * @param logininfor 访问日志对象 | 16 | * @param logininfor 访问日志对象 |
| 17 | */ | 17 | */ |
| 18 | public void insertLogininfor(SysLogininfor logininfor); | 18 | public void insertLogininfor(SysLogininfor logininfor); |
| 19 | 19 | ||
| 20 | /** | 20 | /** |
| 21 | * 查询系统登录日志集合 | 21 | * 查询系统登录日志集合 |
| 22 | - * | 22 | + * |
| 23 | * @param logininfor 访问日志对象 | 23 | * @param logininfor 访问日志对象 |
| 24 | * @return 登录记录集合 | 24 | * @return 登录记录集合 |
| 25 | */ | 25 | */ |
| @@ -27,7 +27,7 @@ public interface SysLogininforMapper | @@ -27,7 +27,7 @@ public interface SysLogininforMapper | ||
| 27 | 27 | ||
| 28 | /** | 28 | /** |
| 29 | * 批量删除系统登录日志 | 29 | * 批量删除系统登录日志 |
| 30 | - * | 30 | + * |
| 31 | * @param infoIds 需要删除的登录日志ID | 31 | * @param infoIds 需要删除的登录日志ID |
| 32 | * @return 结果 | 32 | * @return 结果 |
| 33 | */ | 33 | */ |
| @@ -35,7 +35,7 @@ public interface SysLogininforMapper | @@ -35,7 +35,7 @@ public interface SysLogininforMapper | ||
| 35 | 35 | ||
| 36 | /** | 36 | /** |
| 37 | * 清空系统登录日志 | 37 | * 清空系统登录日志 |
| 38 | - * | 38 | + * |
| 39 | * @return 结果 | 39 | * @return 结果 |
| 40 | */ | 40 | */ |
| 41 | public int cleanLogininfor(); | 41 | public int cleanLogininfor(); |
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java deleted
| 1 | -package com.ruoyi.system.mapper; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | - | ||
| 5 | -import org.apache.ibatis.annotations.Param; | ||
| 6 | -import com.ruoyi.common.core.domain.entity.SysMenu; | ||
| 7 | - | ||
| 8 | -/** | ||
| 9 | - * 菜单表 数据层 | ||
| 10 | - * | ||
| 11 | - * @author ruoyi | ||
| 12 | - */ | ||
| 13 | -public interface SysMenuMapper { | ||
| 14 | - | ||
| 15 | - /** | ||
| 16 | - * 根据用户查询系统菜单列表 | ||
| 17 | - * | ||
| 18 | - * @param menu 菜单信息 | ||
| 19 | - * @return 菜单列表 | ||
| 20 | - */ | ||
| 21 | - public List<SysMenu> selectMenuListByUserId(SysMenu menu); | ||
| 22 | - | ||
| 23 | - /** | ||
| 24 | - * 根据用户ID查询权限 | ||
| 25 | - * | ||
| 26 | - * @param userId 用户ID | ||
| 27 | - * @return 权限列表 | ||
| 28 | - */ | ||
| 29 | - public List<String> selectMenuPermsByUserId(Long userId); | ||
| 30 | - | ||
| 31 | - /** | ||
| 32 | - * 根据用户ID查询菜单 | ||
| 33 | - * | ||
| 34 | - * @return 菜单列表 | ||
| 35 | - */ | ||
| 36 | - public List<SysMenu> selectMenuTreeAll(); | ||
| 37 | - | ||
| 38 | - /** | ||
| 39 | - * 根据用户ID查询菜单 | ||
| 40 | - * | ||
| 41 | - * @param userId 用户ID | ||
| 42 | - * @return 菜单列表 | ||
| 43 | - */ | ||
| 44 | - public List<SysMenu> selectMenuTreeByUserId(Long userId); | ||
| 45 | - | ||
| 46 | - /** | ||
| 47 | - * 根据角色ID查询菜单树信息 | ||
| 48 | - * | ||
| 49 | - * @param roleId 角色ID | ||
| 50 | - * @param menuCheckStrictly 菜单树选择项是否关联显示 | ||
| 51 | - * @return 选中菜单列表 | ||
| 52 | - */ | ||
| 53 | - public List<Integer> selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly); | ||
| 54 | - | ||
| 55 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java
| 1 | package com.ruoyi.system.mapper; | 1 | package com.ruoyi.system.mapper; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | + | ||
| 4 | import com.ruoyi.system.domain.SysNotice; | 5 | import com.ruoyi.system.domain.SysNotice; |
| 5 | 6 | ||
| 6 | /** | 7 | /** |
| 7 | * 通知公告表 数据层 | 8 | * 通知公告表 数据层 |
| 8 | - * | 9 | + * |
| 9 | * @author ruoyi | 10 | * @author ruoyi |
| 10 | */ | 11 | */ |
| 11 | -public interface SysNoticeMapper | ||
| 12 | -{ | 12 | +public interface SysNoticeMapper { |
| 13 | /** | 13 | /** |
| 14 | * 查询公告信息 | 14 | * 查询公告信息 |
| 15 | - * | 15 | + * |
| 16 | * @param noticeId 公告ID | 16 | * @param noticeId 公告ID |
| 17 | * @return 公告信息 | 17 | * @return 公告信息 |
| 18 | */ | 18 | */ |
| @@ -20,7 +20,7 @@ public interface SysNoticeMapper | @@ -20,7 +20,7 @@ public interface SysNoticeMapper | ||
| 20 | 20 | ||
| 21 | /** | 21 | /** |
| 22 | * 查询公告列表 | 22 | * 查询公告列表 |
| 23 | - * | 23 | + * |
| 24 | * @param notice 公告信息 | 24 | * @param notice 公告信息 |
| 25 | * @return 公告集合 | 25 | * @return 公告集合 |
| 26 | */ | 26 | */ |
| @@ -28,7 +28,7 @@ public interface SysNoticeMapper | @@ -28,7 +28,7 @@ public interface SysNoticeMapper | ||
| 28 | 28 | ||
| 29 | /** | 29 | /** |
| 30 | * 新增公告 | 30 | * 新增公告 |
| 31 | - * | 31 | + * |
| 32 | * @param notice 公告信息 | 32 | * @param notice 公告信息 |
| 33 | * @return 结果 | 33 | * @return 结果 |
| 34 | */ | 34 | */ |
| @@ -36,7 +36,7 @@ public interface SysNoticeMapper | @@ -36,7 +36,7 @@ public interface SysNoticeMapper | ||
| 36 | 36 | ||
| 37 | /** | 37 | /** |
| 38 | * 修改公告 | 38 | * 修改公告 |
| 39 | - * | 39 | + * |
| 40 | * @param notice 公告信息 | 40 | * @param notice 公告信息 |
| 41 | * @return 结果 | 41 | * @return 结果 |
| 42 | */ | 42 | */ |
| @@ -44,7 +44,7 @@ public interface SysNoticeMapper | @@ -44,7 +44,7 @@ public interface SysNoticeMapper | ||
| 44 | 44 | ||
| 45 | /** | 45 | /** |
| 46 | * 批量删除公告 | 46 | * 批量删除公告 |
| 47 | - * | 47 | + * |
| 48 | * @param noticeId 公告ID | 48 | * @param noticeId 公告ID |
| 49 | * @return 结果 | 49 | * @return 结果 |
| 50 | */ | 50 | */ |
| @@ -52,7 +52,7 @@ public interface SysNoticeMapper | @@ -52,7 +52,7 @@ public interface SysNoticeMapper | ||
| 52 | 52 | ||
| 53 | /** | 53 | /** |
| 54 | * 批量删除公告信息 | 54 | * 批量删除公告信息 |
| 55 | - * | 55 | + * |
| 56 | * @param noticeIds 需要删除的公告ID | 56 | * @param noticeIds 需要删除的公告ID |
| 57 | * @return 结果 | 57 | * @return 结果 |
| 58 | */ | 58 | */ |
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java
| 1 | package com.ruoyi.system.mapper; | 1 | package com.ruoyi.system.mapper; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | + | ||
| 4 | import com.ruoyi.system.domain.SysOperLog; | 5 | import com.ruoyi.system.domain.SysOperLog; |
| 5 | 6 | ||
| 6 | /** | 7 | /** |
| 7 | * 操作日志 数据层 | 8 | * 操作日志 数据层 |
| 8 | - * | 9 | + * |
| 9 | * @author ruoyi | 10 | * @author ruoyi |
| 10 | */ | 11 | */ |
| 11 | -public interface SysOperLogMapper | ||
| 12 | -{ | 12 | +public interface SysOperLogMapper { |
| 13 | /** | 13 | /** |
| 14 | * 新增操作日志 | 14 | * 新增操作日志 |
| 15 | - * | 15 | + * |
| 16 | * @param operLog 操作日志对象 | 16 | * @param operLog 操作日志对象 |
| 17 | */ | 17 | */ |
| 18 | public void insertOperlog(SysOperLog operLog); | 18 | public void insertOperlog(SysOperLog operLog); |
| 19 | 19 | ||
| 20 | /** | 20 | /** |
| 21 | * 查询系统操作日志集合 | 21 | * 查询系统操作日志集合 |
| 22 | - * | 22 | + * |
| 23 | * @param operLog 操作日志对象 | 23 | * @param operLog 操作日志对象 |
| 24 | * @return 操作日志集合 | 24 | * @return 操作日志集合 |
| 25 | */ | 25 | */ |
| @@ -27,7 +27,7 @@ public interface SysOperLogMapper | @@ -27,7 +27,7 @@ public interface SysOperLogMapper | ||
| 27 | 27 | ||
| 28 | /** | 28 | /** |
| 29 | * 批量删除系统操作日志 | 29 | * 批量删除系统操作日志 |
| 30 | - * | 30 | + * |
| 31 | * @param operIds 需要删除的操作日志ID | 31 | * @param operIds 需要删除的操作日志ID |
| 32 | * @return 结果 | 32 | * @return 结果 |
| 33 | */ | 33 | */ |
| @@ -35,7 +35,7 @@ public interface SysOperLogMapper | @@ -35,7 +35,7 @@ public interface SysOperLogMapper | ||
| 35 | 35 | ||
| 36 | /** | 36 | /** |
| 37 | * 查询操作日志详细 | 37 | * 查询操作日志详细 |
| 38 | - * | 38 | + * |
| 39 | * @param operId 操作ID | 39 | * @param operId 操作ID |
| 40 | * @return 操作日志对象 | 40 | * @return 操作日志对象 |
| 41 | */ | 41 | */ |
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java deleted
| 1 | -package com.ruoyi.system.mapper; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | -import com.ruoyi.system.domain.SysPost; | ||
| 5 | - | ||
| 6 | -/** | ||
| 7 | - * 岗位信息 数据层 | ||
| 8 | - * | ||
| 9 | - * @author ruoyi | ||
| 10 | - */ | ||
| 11 | -public interface SysPostMapper | ||
| 12 | -{ | ||
| 13 | - /** | ||
| 14 | - * 查询岗位数据集合 | ||
| 15 | - * | ||
| 16 | - * @param post 岗位信息 | ||
| 17 | - * @return 岗位数据集合 | ||
| 18 | - */ | ||
| 19 | - public List<SysPost> selectPostList(SysPost post); | ||
| 20 | - | ||
| 21 | - /** | ||
| 22 | - * 查询所有岗位 | ||
| 23 | - * | ||
| 24 | - * @return 岗位列表 | ||
| 25 | - */ | ||
| 26 | - public List<SysPost> selectPostAll(); | ||
| 27 | - | ||
| 28 | - /** | ||
| 29 | - * 通过岗位ID查询岗位信息 | ||
| 30 | - * | ||
| 31 | - * @param postId 岗位ID | ||
| 32 | - * @return 角色对象信息 | ||
| 33 | - */ | ||
| 34 | - public SysPost selectPostById(Long postId); | ||
| 35 | - | ||
| 36 | - /** | ||
| 37 | - * 根据用户ID获取岗位选择框列表 | ||
| 38 | - * | ||
| 39 | - * @param userId 用户ID | ||
| 40 | - * @return 选中岗位ID列表 | ||
| 41 | - */ | ||
| 42 | - public List<Integer> selectPostListByUserId(Long userId); | ||
| 43 | - | ||
| 44 | - /** | ||
| 45 | - * 查询用户所属岗位组 | ||
| 46 | - * | ||
| 47 | - * @param userName 用户名 | ||
| 48 | - * @return 结果 | ||
| 49 | - */ | ||
| 50 | - public List<SysPost> selectPostsByUserName(String userName); | ||
| 51 | - | ||
| 52 | - /** | ||
| 53 | - * 删除岗位信息 | ||
| 54 | - * | ||
| 55 | - * @param postId 岗位ID | ||
| 56 | - * @return 结果 | ||
| 57 | - */ | ||
| 58 | - public int deletePostById(Long postId); | ||
| 59 | - | ||
| 60 | - /** | ||
| 61 | - * 批量删除岗位信息 | ||
| 62 | - * | ||
| 63 | - * @param postIds 需要删除的岗位ID | ||
| 64 | - * @return 结果 | ||
| 65 | - */ | ||
| 66 | - public int deletePostByIds(Long[] postIds); | ||
| 67 | - | ||
| 68 | - /** | ||
| 69 | - * 修改岗位信息 | ||
| 70 | - * | ||
| 71 | - * @param post 岗位信息 | ||
| 72 | - * @return 结果 | ||
| 73 | - */ | ||
| 74 | - public int updatePost(SysPost post); | ||
| 75 | - | ||
| 76 | - /** | ||
| 77 | - * 新增岗位信息 | ||
| 78 | - * | ||
| 79 | - * @param post 岗位信息 | ||
| 80 | - * @return 结果 | ||
| 81 | - */ | ||
| 82 | - public int insertPost(SysPost post); | ||
| 83 | - | ||
| 84 | - /** | ||
| 85 | - * 校验岗位名称 | ||
| 86 | - * | ||
| 87 | - * @param postName 岗位名称 | ||
| 88 | - * @return 结果 | ||
| 89 | - */ | ||
| 90 | - public SysPost checkPostNameUnique(String postName); | ||
| 91 | - | ||
| 92 | - /** | ||
| 93 | - * 校验岗位编码 | ||
| 94 | - * | ||
| 95 | - * @param postCode 岗位编码 | ||
| 96 | - * @return 结果 | ||
| 97 | - */ | ||
| 98 | - public SysPost checkPostCodeUnique(String postCode); | ||
| 99 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java deleted
| 1 | -package com.ruoyi.system.mapper; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | -import com.ruoyi.system.domain.SysRoleDept; | ||
| 5 | - | ||
| 6 | -/** | ||
| 7 | - * 角色与部门关联表 数据层 | ||
| 8 | - * | ||
| 9 | - * @author ruoyi | ||
| 10 | - */ | ||
| 11 | -public interface SysRoleDeptMapper | ||
| 12 | -{ | ||
| 13 | - /** | ||
| 14 | - * 通过角色ID删除角色和部门关联 | ||
| 15 | - * | ||
| 16 | - * @param roleId 角色ID | ||
| 17 | - * @return 结果 | ||
| 18 | - */ | ||
| 19 | - public int deleteRoleDeptByRoleId(Long roleId); | ||
| 20 | - | ||
| 21 | - /** | ||
| 22 | - * 批量删除角色部门关联信息 | ||
| 23 | - * | ||
| 24 | - * @param ids 需要删除的数据ID | ||
| 25 | - * @return 结果 | ||
| 26 | - */ | ||
| 27 | - public int deleteRoleDept(Long[] ids); | ||
| 28 | - | ||
| 29 | - /** | ||
| 30 | - * 查询部门使用数量 | ||
| 31 | - * | ||
| 32 | - * @param deptId 部门ID | ||
| 33 | - * @return 结果 | ||
| 34 | - */ | ||
| 35 | - public int selectCountRoleDeptByDeptId(Long deptId); | ||
| 36 | - | ||
| 37 | - /** | ||
| 38 | - * 批量新增角色部门信息 | ||
| 39 | - * | ||
| 40 | - * @param roleDeptList 角色部门列表 | ||
| 41 | - * @return 结果 | ||
| 42 | - */ | ||
| 43 | - public int batchRoleDept(List<SysRoleDept> roleDeptList); | ||
| 44 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java deleted
| 1 | -package com.ruoyi.system.mapper; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | - | ||
| 5 | -import com.ruoyi.common.core.domain.entity.SysRole; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * 角色表 数据层 | ||
| 9 | - * | ||
| 10 | - * @author ruoyi | ||
| 11 | - */ | ||
| 12 | -public interface SysRoleMapper { | ||
| 13 | - | ||
| 14 | - /** | ||
| 15 | - * 根据条件分页查询角色数据 | ||
| 16 | - * | ||
| 17 | - * @param role 角色信息 | ||
| 18 | - * @return 角色数据集合信息 | ||
| 19 | - */ | ||
| 20 | - public List<SysRole> selectRoleList(SysRole role); | ||
| 21 | - | ||
| 22 | - /** | ||
| 23 | - * 根据用户ID查询角色 | ||
| 24 | - * | ||
| 25 | - * @param userId 用户ID | ||
| 26 | - * @return 角色列表 | ||
| 27 | - */ | ||
| 28 | - public List<SysRole> selectRolePermissionByUserId(Long userId); | ||
| 29 | - | ||
| 30 | - /** | ||
| 31 | - * 根据用户ID获取角色选择框列表 | ||
| 32 | - * | ||
| 33 | - * @param userId 用户ID | ||
| 34 | - * @return 选中角色ID列表 | ||
| 35 | - */ | ||
| 36 | - public List<Integer> selectRoleListByUserId(Long userId); | ||
| 37 | - | ||
| 38 | - /** | ||
| 39 | - * 根据用户ID查询角色 | ||
| 40 | - * | ||
| 41 | - * @param userName 用户名 | ||
| 42 | - * @return 角色列表 | ||
| 43 | - */ | ||
| 44 | - public List<SysRole> selectRolesByUserName(String userName); | ||
| 45 | - | ||
| 46 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java deleted
| 1 | -package com.ruoyi.system.mapper; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | -import org.apache.ibatis.annotations.Param; | ||
| 5 | -import com.ruoyi.common.core.domain.entity.SysUser; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * 用户表 数据层 | ||
| 9 | - * | ||
| 10 | - * @author ruoyi | ||
| 11 | - */ | ||
| 12 | -public interface SysUserMapper | ||
| 13 | -{ | ||
| 14 | - /** | ||
| 15 | - * 根据条件分页查询用户列表 | ||
| 16 | - * | ||
| 17 | - * @param sysUser 用户信息 | ||
| 18 | - * @return 用户信息集合信息 | ||
| 19 | - */ | ||
| 20 | - public List<SysUser> selectUserList(SysUser sysUser); | ||
| 21 | - | ||
| 22 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java deleted
| 1 | -package com.ruoyi.system.mapper; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | -import com.ruoyi.system.domain.SysUserPost; | ||
| 5 | - | ||
| 6 | -/** | ||
| 7 | - * 用户与岗位关联表 数据层 | ||
| 8 | - * | ||
| 9 | - * @author ruoyi | ||
| 10 | - */ | ||
| 11 | -public interface SysUserPostMapper | ||
| 12 | -{ | ||
| 13 | - /** | ||
| 14 | - * 通过用户ID删除用户和岗位关联 | ||
| 15 | - * | ||
| 16 | - * @param userId 用户ID | ||
| 17 | - * @return 结果 | ||
| 18 | - */ | ||
| 19 | - public int deleteUserPostByUserId(Long userId); | ||
| 20 | - | ||
| 21 | - /** | ||
| 22 | - * 通过岗位ID查询岗位使用数量 | ||
| 23 | - * | ||
| 24 | - * @param postId 岗位ID | ||
| 25 | - * @return 结果 | ||
| 26 | - */ | ||
| 27 | - public int countUserPostById(Long postId); | ||
| 28 | - | ||
| 29 | - /** | ||
| 30 | - * 批量删除用户和岗位关联 | ||
| 31 | - * | ||
| 32 | - * @param ids 需要删除的数据ID | ||
| 33 | - * @return 结果 | ||
| 34 | - */ | ||
| 35 | - public int deleteUserPost(Long[] ids); | ||
| 36 | - | ||
| 37 | - /** | ||
| 38 | - * 批量新增用户岗位信息 | ||
| 39 | - * | ||
| 40 | - * @param userPostList 用户角色列表 | ||
| 41 | - * @return 结果 | ||
| 42 | - */ | ||
| 43 | - public int batchUserPost(List<SysUserPost> userPostList); | ||
| 44 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java deleted
| 1 | -package com.ruoyi.system.service; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | -import com.ruoyi.common.core.domain.entity.SysDictData; | ||
| 5 | - | ||
| 6 | -/** | ||
| 7 | - * 字典 业务层 | ||
| 8 | - * | ||
| 9 | - * @author ruoyi | ||
| 10 | - */ | ||
| 11 | -public interface ISysDictDataService | ||
| 12 | -{ | ||
| 13 | - /** | ||
| 14 | - * 根据条件分页查询字典数据 | ||
| 15 | - * | ||
| 16 | - * @param dictData 字典数据信息 | ||
| 17 | - * @return 字典数据集合信息 | ||
| 18 | - */ | ||
| 19 | - public List<SysDictData> selectDictDataList(SysDictData dictData); | ||
| 20 | - | ||
| 21 | - /** | ||
| 22 | - * 根据字典类型和字典键值查询字典数据信息 | ||
| 23 | - * | ||
| 24 | - * @param dictType 字典类型 | ||
| 25 | - * @param dictValue 字典键值 | ||
| 26 | - * @return 字典标签 | ||
| 27 | - */ | ||
| 28 | - public String selectDictLabel(String dictType, String dictValue); | ||
| 29 | - | ||
| 30 | - /** | ||
| 31 | - * 根据字典数据ID查询信息 | ||
| 32 | - * | ||
| 33 | - * @param dictCode 字典数据ID | ||
| 34 | - * @return 字典数据 | ||
| 35 | - */ | ||
| 36 | - public SysDictData selectDictDataById(Long dictCode); | ||
| 37 | - | ||
| 38 | - /** | ||
| 39 | - * 批量删除字典数据信息 | ||
| 40 | - * | ||
| 41 | - * @param dictCodes 需要删除的字典数据ID | ||
| 42 | - * @return 结果 | ||
| 43 | - */ | ||
| 44 | - public int deleteDictDataByIds(Long[] dictCodes); | ||
| 45 | - | ||
| 46 | - /** | ||
| 47 | - * 新增保存字典数据信息 | ||
| 48 | - * | ||
| 49 | - * @param dictData 字典数据信息 | ||
| 50 | - * @return 结果 | ||
| 51 | - */ | ||
| 52 | - public int insertDictData(SysDictData dictData); | ||
| 53 | - | ||
| 54 | - /** | ||
| 55 | - * 修改保存字典数据信息 | ||
| 56 | - * | ||
| 57 | - * @param dictData 字典数据信息 | ||
| 58 | - * @return 结果 | ||
| 59 | - */ | ||
| 60 | - public int updateDictData(SysDictData dictData); | ||
| 61 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java deleted
| 1 | -package com.ruoyi.system.service; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | -import com.ruoyi.common.core.domain.entity.SysDictData; | ||
| 5 | -import com.ruoyi.common.core.domain.entity.SysDictType; | ||
| 6 | - | ||
| 7 | -/** | ||
| 8 | - * 字典 业务层 | ||
| 9 | - * | ||
| 10 | - * @author ruoyi | ||
| 11 | - */ | ||
| 12 | -public interface ISysDictTypeService | ||
| 13 | -{ | ||
| 14 | - /** | ||
| 15 | - * 根据条件分页查询字典类型 | ||
| 16 | - * | ||
| 17 | - * @param dictType 字典类型信息 | ||
| 18 | - * @return 字典类型集合信息 | ||
| 19 | - */ | ||
| 20 | - public List<SysDictType> selectDictTypeList(SysDictType dictType); | ||
| 21 | - | ||
| 22 | - /** | ||
| 23 | - * 根据所有字典类型 | ||
| 24 | - * | ||
| 25 | - * @return 字典类型集合信息 | ||
| 26 | - */ | ||
| 27 | - public List<SysDictType> selectDictTypeAll(); | ||
| 28 | - | ||
| 29 | - /** | ||
| 30 | - * 根据字典类型查询字典数据 | ||
| 31 | - * | ||
| 32 | - * @param dictType 字典类型 | ||
| 33 | - * @return 字典数据集合信息 | ||
| 34 | - */ | ||
| 35 | - public List<SysDictData> selectDictDataByType(String dictType); | ||
| 36 | - | ||
| 37 | - /** | ||
| 38 | - * 根据字典类型ID查询信息 | ||
| 39 | - * | ||
| 40 | - * @param dictId 字典类型ID | ||
| 41 | - * @return 字典类型 | ||
| 42 | - */ | ||
| 43 | - public SysDictType selectDictTypeById(Long dictId); | ||
| 44 | - | ||
| 45 | - /** | ||
| 46 | - * 根据字典类型查询信息 | ||
| 47 | - * | ||
| 48 | - * @param dictType 字典类型 | ||
| 49 | - * @return 字典类型 | ||
| 50 | - */ | ||
| 51 | - public SysDictType selectDictTypeByType(String dictType); | ||
| 52 | - | ||
| 53 | - /** | ||
| 54 | - * 批量删除字典信息 | ||
| 55 | - * | ||
| 56 | - * @param dictIds 需要删除的字典ID | ||
| 57 | - * @return 结果 | ||
| 58 | - */ | ||
| 59 | - public int deleteDictTypeByIds(Long[] dictIds); | ||
| 60 | - | ||
| 61 | - /** | ||
| 62 | - * 清空缓存数据 | ||
| 63 | - */ | ||
| 64 | - public void clearCache(); | ||
| 65 | - | ||
| 66 | - /** | ||
| 67 | - * 新增保存字典类型信息 | ||
| 68 | - * | ||
| 69 | - * @param dictType 字典类型信息 | ||
| 70 | - * @return 结果 | ||
| 71 | - */ | ||
| 72 | - public int insertDictType(SysDictType dictType); | ||
| 73 | - | ||
| 74 | - /** | ||
| 75 | - * 修改保存字典类型信息 | ||
| 76 | - * | ||
| 77 | - * @param dictType 字典类型信息 | ||
| 78 | - * @return 结果 | ||
| 79 | - */ | ||
| 80 | - public int updateDictType(SysDictType dictType); | ||
| 81 | - | ||
| 82 | - /** | ||
| 83 | - * 校验字典类型称是否唯一 | ||
| 84 | - * | ||
| 85 | - * @param dictType 字典类型 | ||
| 86 | - * @return 结果 | ||
| 87 | - */ | ||
| 88 | - public String checkDictTypeUnique(SysDictType dictType); | ||
| 89 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java deleted
| 1 | -package com.ruoyi.system.service; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | -import java.util.Set; | ||
| 5 | -import com.ruoyi.common.core.domain.TreeSelect; | ||
| 6 | -import com.ruoyi.common.core.domain.entity.SysMenu; | ||
| 7 | -import com.ruoyi.system.domain.vo.RouterVo; | ||
| 8 | - | ||
| 9 | -/** | ||
| 10 | - * 菜单 业务层 | ||
| 11 | - * | ||
| 12 | - * @author ruoyi | ||
| 13 | - */ | ||
| 14 | -public interface ISysMenuService | ||
| 15 | -{ | ||
| 16 | - /** | ||
| 17 | - * 根据用户查询系统菜单列表 | ||
| 18 | - * | ||
| 19 | - * @param userId 用户ID | ||
| 20 | - * @return 菜单列表 | ||
| 21 | - */ | ||
| 22 | - public List<SysMenu> selectMenuList(Long userId); | ||
| 23 | - | ||
| 24 | - /** | ||
| 25 | - * 根据用户查询系统菜单列表 | ||
| 26 | - * | ||
| 27 | - * @param menu 菜单信息 | ||
| 28 | - * @param userId 用户ID | ||
| 29 | - * @return 菜单列表 | ||
| 30 | - */ | ||
| 31 | - public List<SysMenu> selectMenuList(SysMenu menu, Long userId); | ||
| 32 | - | ||
| 33 | - /** | ||
| 34 | - * 根据用户ID查询权限 | ||
| 35 | - * | ||
| 36 | - * @param userId 用户ID | ||
| 37 | - * @return 权限列表 | ||
| 38 | - */ | ||
| 39 | - public Set<String> selectMenuPermsByUserId(Long userId); | ||
| 40 | - | ||
| 41 | - /** | ||
| 42 | - * 查询菜单是否存在角色 | ||
| 43 | - * | ||
| 44 | - * @param menuId 菜单ID | ||
| 45 | - * @return 结果 true 存在 false 不存在 | ||
| 46 | - */ | ||
| 47 | - public boolean checkMenuExistRole(Long menuId); | ||
| 48 | - | ||
| 49 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java deleted
| 1 | -package com.ruoyi.system.service; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | -import com.ruoyi.system.domain.SysPost; | ||
| 5 | - | ||
| 6 | -/** | ||
| 7 | - * 岗位信息 服务层 | ||
| 8 | - * | ||
| 9 | - * @author ruoyi | ||
| 10 | - */ | ||
| 11 | -public interface ISysPostService | ||
| 12 | -{ | ||
| 13 | - /** | ||
| 14 | - * 查询岗位信息集合 | ||
| 15 | - * | ||
| 16 | - * @param post 岗位信息 | ||
| 17 | - * @return 岗位列表 | ||
| 18 | - */ | ||
| 19 | - public List<SysPost> selectPostList(SysPost post); | ||
| 20 | - | ||
| 21 | - /** | ||
| 22 | - * 查询所有岗位 | ||
| 23 | - * | ||
| 24 | - * @return 岗位列表 | ||
| 25 | - */ | ||
| 26 | - public List<SysPost> selectPostAll(); | ||
| 27 | - | ||
| 28 | - /** | ||
| 29 | - * 通过岗位ID查询岗位信息 | ||
| 30 | - * | ||
| 31 | - * @param postId 岗位ID | ||
| 32 | - * @return 角色对象信息 | ||
| 33 | - */ | ||
| 34 | - public SysPost selectPostById(Long postId); | ||
| 35 | - | ||
| 36 | - /** | ||
| 37 | - * 根据用户ID获取岗位选择框列表 | ||
| 38 | - * | ||
| 39 | - * @param userId 用户ID | ||
| 40 | - * @return 选中岗位ID列表 | ||
| 41 | - */ | ||
| 42 | - public List<Integer> selectPostListByUserId(Long userId); | ||
| 43 | - | ||
| 44 | - /** | ||
| 45 | - * 校验岗位名称 | ||
| 46 | - * | ||
| 47 | - * @param post 岗位信息 | ||
| 48 | - * @return 结果 | ||
| 49 | - */ | ||
| 50 | - public String checkPostNameUnique(SysPost post); | ||
| 51 | - | ||
| 52 | - /** | ||
| 53 | - * 校验岗位编码 | ||
| 54 | - * | ||
| 55 | - * @param post 岗位信息 | ||
| 56 | - * @return 结果 | ||
| 57 | - */ | ||
| 58 | - public String checkPostCodeUnique(SysPost post); | ||
| 59 | - | ||
| 60 | - /** | ||
| 61 | - * 通过岗位ID查询岗位使用数量 | ||
| 62 | - * | ||
| 63 | - * @param postId 岗位ID | ||
| 64 | - * @return 结果 | ||
| 65 | - */ | ||
| 66 | - public int countUserPostById(Long postId); | ||
| 67 | - | ||
| 68 | - /** | ||
| 69 | - * 删除岗位信息 | ||
| 70 | - * | ||
| 71 | - * @param postId 岗位ID | ||
| 72 | - * @return 结果 | ||
| 73 | - */ | ||
| 74 | - public int deletePostById(Long postId); | ||
| 75 | - | ||
| 76 | - /** | ||
| 77 | - * 批量删除岗位信息 | ||
| 78 | - * | ||
| 79 | - * @param postIds 需要删除的岗位ID | ||
| 80 | - * @return 结果 | ||
| 81 | - * @throws Exception 异常 | ||
| 82 | - */ | ||
| 83 | - public int deletePostByIds(Long[] postIds); | ||
| 84 | - | ||
| 85 | - /** | ||
| 86 | - * 新增保存岗位信息 | ||
| 87 | - * | ||
| 88 | - * @param post 岗位信息 | ||
| 89 | - * @return 结果 | ||
| 90 | - */ | ||
| 91 | - public int insertPost(SysPost post); | ||
| 92 | - | ||
| 93 | - /** | ||
| 94 | - * 修改保存岗位信息 | ||
| 95 | - * | ||
| 96 | - * @param post 岗位信息 | ||
| 97 | - * @return 结果 | ||
| 98 | - */ | ||
| 99 | - public int updatePost(SysPost post); | ||
| 100 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java deleted
| 1 | -package com.ruoyi.system.service; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | -import java.util.Set; | ||
| 5 | - | ||
| 6 | -import com.ruoyi.common.core.domain.entity.SysRole; | ||
| 7 | - | ||
| 8 | -/** | ||
| 9 | - * 角色业务层 | ||
| 10 | - * | ||
| 11 | - * @author ruoyi | ||
| 12 | - */ | ||
| 13 | -public interface ISysRoleService { | ||
| 14 | - | ||
| 15 | - /** | ||
| 16 | - * 根据用户ID查询角色 | ||
| 17 | - * | ||
| 18 | - * @param userId 用户ID | ||
| 19 | - * @return 权限列表 | ||
| 20 | - */ | ||
| 21 | - public Set<String> selectRolePermissionByUserId(Long userId); | ||
| 22 | - | ||
| 23 | - /** | ||
| 24 | - * 修改数据权限信息 | ||
| 25 | - * | ||
| 26 | - * @param role 角色信息 | ||
| 27 | - * @return 结果 | ||
| 28 | - */ | ||
| 29 | - public int authDataScope(SysRole role); | ||
| 30 | - | ||
| 31 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java
| @@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl; | @@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl; | ||
| 3 | import java.util.Collection; | 3 | import java.util.Collection; |
| 4 | import java.util.List; | 4 | import java.util.List; |
| 5 | import javax.annotation.PostConstruct; | 5 | import javax.annotation.PostConstruct; |
| 6 | + | ||
| 6 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
| 8 | import com.ruoyi.common.annotation.DataSource; | 9 | import com.ruoyi.common.annotation.DataSource; |
| @@ -19,12 +20,11 @@ import com.ruoyi.system.service.ISysConfigService; | @@ -19,12 +20,11 @@ import com.ruoyi.system.service.ISysConfigService; | ||
| 19 | 20 | ||
| 20 | /** | 21 | /** |
| 21 | * 参数配置 服务层实现 | 22 | * 参数配置 服务层实现 |
| 22 | - * | 23 | + * |
| 23 | * @author ruoyi | 24 | * @author ruoyi |
| 24 | */ | 25 | */ |
| 25 | @Service | 26 | @Service |
| 26 | -public class SysConfigServiceImpl implements ISysConfigService | ||
| 27 | -{ | 27 | +public class SysConfigServiceImpl implements ISysConfigService { |
| 28 | @Autowired | 28 | @Autowired |
| 29 | private SysConfigMapper configMapper; | 29 | private SysConfigMapper configMapper; |
| 30 | 30 | ||
| @@ -35,25 +35,22 @@ public class SysConfigServiceImpl implements ISysConfigService | @@ -35,25 +35,22 @@ public class SysConfigServiceImpl implements ISysConfigService | ||
| 35 | * 项目启动时,初始化参数到缓存 | 35 | * 项目启动时,初始化参数到缓存 |
| 36 | */ | 36 | */ |
| 37 | @PostConstruct | 37 | @PostConstruct |
| 38 | - public void init() | ||
| 39 | - { | 38 | + public void init() { |
| 40 | List<SysConfig> configsList = configMapper.selectConfigList(new SysConfig()); | 39 | List<SysConfig> configsList = configMapper.selectConfigList(new SysConfig()); |
| 41 | - for (SysConfig config : configsList) | ||
| 42 | - { | 40 | + for (SysConfig config : configsList) { |
| 43 | redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); | 41 | redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); |
| 44 | } | 42 | } |
| 45 | } | 43 | } |
| 46 | 44 | ||
| 47 | /** | 45 | /** |
| 48 | * 查询参数配置信息 | 46 | * 查询参数配置信息 |
| 49 | - * | 47 | + * |
| 50 | * @param configId 参数配置ID | 48 | * @param configId 参数配置ID |
| 51 | * @return 参数配置信息 | 49 | * @return 参数配置信息 |
| 52 | */ | 50 | */ |
| 53 | @Override | 51 | @Override |
| 54 | @DataSource(DataSourceType.MASTER) | 52 | @DataSource(DataSourceType.MASTER) |
| 55 | - public SysConfig selectConfigById(Long configId) | ||
| 56 | - { | 53 | + public SysConfig selectConfigById(Long configId) { |
| 57 | SysConfig config = new SysConfig(); | 54 | SysConfig config = new SysConfig(); |
| 58 | config.setConfigId(configId); | 55 | config.setConfigId(configId); |
| 59 | return configMapper.selectConfig(config); | 56 | return configMapper.selectConfig(config); |
| @@ -61,23 +58,20 @@ public class SysConfigServiceImpl implements ISysConfigService | @@ -61,23 +58,20 @@ public class SysConfigServiceImpl implements ISysConfigService | ||
| 61 | 58 | ||
| 62 | /** | 59 | /** |
| 63 | * 根据键名查询参数配置信息 | 60 | * 根据键名查询参数配置信息 |
| 64 | - * | 61 | + * |
| 65 | * @param configKey 参数key | 62 | * @param configKey 参数key |
| 66 | * @return 参数键值 | 63 | * @return 参数键值 |
| 67 | */ | 64 | */ |
| 68 | @Override | 65 | @Override |
| 69 | - public String selectConfigByKey(String configKey) | ||
| 70 | - { | 66 | + public String selectConfigByKey(String configKey) { |
| 71 | String configValue = Convert.toStr(redisCache.getCacheObject(getCacheKey(configKey))); | 67 | String configValue = Convert.toStr(redisCache.getCacheObject(getCacheKey(configKey))); |
| 72 | - if (StringUtils.isNotEmpty(configValue)) | ||
| 73 | - { | 68 | + if (StringUtils.isNotEmpty(configValue)) { |
| 74 | return configValue; | 69 | return configValue; |
| 75 | } | 70 | } |
| 76 | SysConfig config = new SysConfig(); | 71 | SysConfig config = new SysConfig(); |
| 77 | config.setConfigKey(configKey); | 72 | config.setConfigKey(configKey); |
| 78 | SysConfig retConfig = configMapper.selectConfig(config); | 73 | SysConfig retConfig = configMapper.selectConfig(config); |
| 79 | - if (StringUtils.isNotNull(retConfig)) | ||
| 80 | - { | 74 | + if (StringUtils.isNotNull(retConfig)) { |
| 81 | redisCache.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue()); | 75 | redisCache.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue()); |
| 82 | return retConfig.getConfigValue(); | 76 | return retConfig.getConfigValue(); |
| 83 | } | 77 | } |
| @@ -86,28 +80,25 @@ public class SysConfigServiceImpl implements ISysConfigService | @@ -86,28 +80,25 @@ public class SysConfigServiceImpl implements ISysConfigService | ||
| 86 | 80 | ||
| 87 | /** | 81 | /** |
| 88 | * 查询参数配置列表 | 82 | * 查询参数配置列表 |
| 89 | - * | 83 | + * |
| 90 | * @param config 参数配置信息 | 84 | * @param config 参数配置信息 |
| 91 | * @return 参数配置集合 | 85 | * @return 参数配置集合 |
| 92 | */ | 86 | */ |
| 93 | @Override | 87 | @Override |
| 94 | - public List<SysConfig> selectConfigList(SysConfig config) | ||
| 95 | - { | 88 | + public List<SysConfig> selectConfigList(SysConfig config) { |
| 96 | return configMapper.selectConfigList(config); | 89 | return configMapper.selectConfigList(config); |
| 97 | } | 90 | } |
| 98 | 91 | ||
| 99 | /** | 92 | /** |
| 100 | * 新增参数配置 | 93 | * 新增参数配置 |
| 101 | - * | 94 | + * |
| 102 | * @param config 参数配置信息 | 95 | * @param config 参数配置信息 |
| 103 | * @return 结果 | 96 | * @return 结果 |
| 104 | */ | 97 | */ |
| 105 | @Override | 98 | @Override |
| 106 | - public int insertConfig(SysConfig config) | ||
| 107 | - { | 99 | + public int insertConfig(SysConfig config) { |
| 108 | int row = configMapper.insertConfig(config); | 100 | int row = configMapper.insertConfig(config); |
| 109 | - if (row > 0) | ||
| 110 | - { | 101 | + if (row > 0) { |
| 111 | redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); | 102 | redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); |
| 112 | } | 103 | } |
| 113 | return row; | 104 | return row; |
| @@ -115,16 +106,14 @@ public class SysConfigServiceImpl implements ISysConfigService | @@ -115,16 +106,14 @@ public class SysConfigServiceImpl implements ISysConfigService | ||
| 115 | 106 | ||
| 116 | /** | 107 | /** |
| 117 | * 修改参数配置 | 108 | * 修改参数配置 |
| 118 | - * | 109 | + * |
| 119 | * @param config 参数配置信息 | 110 | * @param config 参数配置信息 |
| 120 | * @return 结果 | 111 | * @return 结果 |
| 121 | */ | 112 | */ |
| 122 | @Override | 113 | @Override |
| 123 | - public int updateConfig(SysConfig config) | ||
| 124 | - { | 114 | + public int updateConfig(SysConfig config) { |
| 125 | int row = configMapper.updateConfig(config); | 115 | int row = configMapper.updateConfig(config); |
| 126 | - if (row > 0) | ||
| 127 | - { | 116 | + if (row > 0) { |
| 128 | redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); | 117 | redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); |
| 129 | } | 118 | } |
| 130 | return row; | 119 | return row; |
| @@ -132,24 +121,20 @@ public class SysConfigServiceImpl implements ISysConfigService | @@ -132,24 +121,20 @@ public class SysConfigServiceImpl implements ISysConfigService | ||
| 132 | 121 | ||
| 133 | /** | 122 | /** |
| 134 | * 批量删除参数信息 | 123 | * 批量删除参数信息 |
| 135 | - * | 124 | + * |
| 136 | * @param configIds 需要删除的参数ID | 125 | * @param configIds 需要删除的参数ID |
| 137 | * @return 结果 | 126 | * @return 结果 |
| 138 | */ | 127 | */ |
| 139 | @Override | 128 | @Override |
| 140 | - public int deleteConfigByIds(Long[] configIds) | ||
| 141 | - { | ||
| 142 | - for (Long configId : configIds) | ||
| 143 | - { | 129 | + public int deleteConfigByIds(Long[] configIds) { |
| 130 | + for (Long configId : configIds) { | ||
| 144 | SysConfig config = selectConfigById(configId); | 131 | SysConfig config = selectConfigById(configId); |
| 145 | - if (StringUtils.equals(UserConstants.YES, config.getConfigType())) | ||
| 146 | - { | 132 | + if (StringUtils.equals(UserConstants.YES, config.getConfigType())) { |
| 147 | throw new CustomException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey())); | 133 | throw new CustomException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey())); |
| 148 | } | 134 | } |
| 149 | } | 135 | } |
| 150 | int count = configMapper.deleteConfigByIds(configIds); | 136 | int count = configMapper.deleteConfigByIds(configIds); |
| 151 | - if (count > 0) | ||
| 152 | - { | 137 | + if (count > 0) { |
| 153 | Collection<String> keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*"); | 138 | Collection<String> keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*"); |
| 154 | redisCache.deleteObject(keys); | 139 | redisCache.deleteObject(keys); |
| 155 | } | 140 | } |
| @@ -160,25 +145,22 @@ public class SysConfigServiceImpl implements ISysConfigService | @@ -160,25 +145,22 @@ public class SysConfigServiceImpl implements ISysConfigService | ||
| 160 | * 清空缓存数据 | 145 | * 清空缓存数据 |
| 161 | */ | 146 | */ |
| 162 | @Override | 147 | @Override |
| 163 | - public void clearCache() | ||
| 164 | - { | 148 | + public void clearCache() { |
| 165 | Collection<String> keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*"); | 149 | Collection<String> keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*"); |
| 166 | redisCache.deleteObject(keys); | 150 | redisCache.deleteObject(keys); |
| 167 | } | 151 | } |
| 168 | 152 | ||
| 169 | /** | 153 | /** |
| 170 | * 校验参数键名是否唯一 | 154 | * 校验参数键名是否唯一 |
| 171 | - * | 155 | + * |
| 172 | * @param config 参数配置信息 | 156 | * @param config 参数配置信息 |
| 173 | * @return 结果 | 157 | * @return 结果 |
| 174 | */ | 158 | */ |
| 175 | @Override | 159 | @Override |
| 176 | - public String checkConfigKeyUnique(SysConfig config) | ||
| 177 | - { | 160 | + public String checkConfigKeyUnique(SysConfig config) { |
| 178 | Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId(); | 161 | Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId(); |
| 179 | SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey()); | 162 | SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey()); |
| 180 | - if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) | ||
| 181 | - { | 163 | + if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) { |
| 182 | return UserConstants.NOT_UNIQUE; | 164 | return UserConstants.NOT_UNIQUE; |
| 183 | } | 165 | } |
| 184 | return UserConstants.UNIQUE; | 166 | return UserConstants.UNIQUE; |
| @@ -186,12 +168,11 @@ public class SysConfigServiceImpl implements ISysConfigService | @@ -186,12 +168,11 @@ public class SysConfigServiceImpl implements ISysConfigService | ||
| 186 | 168 | ||
| 187 | /** | 169 | /** |
| 188 | * 设置cache key | 170 | * 设置cache key |
| 189 | - * | 171 | + * |
| 190 | * @param configKey 参数键 | 172 | * @param configKey 参数键 |
| 191 | * @return 缓存键key | 173 | * @return 缓存键key |
| 192 | */ | 174 | */ |
| 193 | - private String getCacheKey(String configKey) | ||
| 194 | - { | 175 | + private String getCacheKey(String configKey) { |
| 195 | return Constants.SYS_CONFIG_KEY + configKey; | 176 | return Constants.SYS_CONFIG_KEY + configKey; |
| 196 | } | 177 | } |
| 197 | } | 178 | } |
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java
| 1 | package com.ruoyi.system.service.impl; | 1 | package com.ruoyi.system.service.impl; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | + | ||
| 4 | import org.springframework.beans.factory.annotation.Autowired; | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 5 | import org.springframework.stereotype.Service; | 6 | import org.springframework.stereotype.Service; |
| 6 | import com.ruoyi.common.core.domain.entity.SysDictData; | 7 | import com.ruoyi.common.core.domain.entity.SysDictData; |
| @@ -10,64 +11,59 @@ import com.ruoyi.system.service.ISysDictDataService; | @@ -10,64 +11,59 @@ import com.ruoyi.system.service.ISysDictDataService; | ||
| 10 | 11 | ||
| 11 | /** | 12 | /** |
| 12 | * 字典 业务层处理 | 13 | * 字典 业务层处理 |
| 13 | - * | 14 | + * |
| 14 | * @author ruoyi | 15 | * @author ruoyi |
| 15 | */ | 16 | */ |
| 16 | @Service | 17 | @Service |
| 17 | -public class SysDictDataServiceImpl implements ISysDictDataService | ||
| 18 | -{ | 18 | +public class SysDictDataServiceImpl implements ISysDictDataService { |
| 19 | + | ||
| 19 | @Autowired | 20 | @Autowired |
| 20 | private SysDictDataMapper dictDataMapper; | 21 | private SysDictDataMapper dictDataMapper; |
| 21 | 22 | ||
| 22 | /** | 23 | /** |
| 23 | * 根据条件分页查询字典数据 | 24 | * 根据条件分页查询字典数据 |
| 24 | - * | 25 | + * |
| 25 | * @param dictData 字典数据信息 | 26 | * @param dictData 字典数据信息 |
| 26 | * @return 字典数据集合信息 | 27 | * @return 字典数据集合信息 |
| 27 | */ | 28 | */ |
| 28 | @Override | 29 | @Override |
| 29 | - public List<SysDictData> selectDictDataList(SysDictData dictData) | ||
| 30 | - { | 30 | + public List<SysDictData> selectDictDataList(SysDictData dictData) { |
| 31 | return dictDataMapper.selectDictDataList(dictData); | 31 | return dictDataMapper.selectDictDataList(dictData); |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | /** | 34 | /** |
| 35 | * 根据字典类型和字典键值查询字典数据信息 | 35 | * 根据字典类型和字典键值查询字典数据信息 |
| 36 | - * | ||
| 37 | - * @param dictType 字典类型 | 36 | + * |
| 37 | + * @param dictType 字典类型 | ||
| 38 | * @param dictValue 字典键值 | 38 | * @param dictValue 字典键值 |
| 39 | * @return 字典标签 | 39 | * @return 字典标签 |
| 40 | */ | 40 | */ |
| 41 | @Override | 41 | @Override |
| 42 | - public String selectDictLabel(String dictType, String dictValue) | ||
| 43 | - { | 42 | + public String selectDictLabel(String dictType, String dictValue) { |
| 44 | return dictDataMapper.selectDictLabel(dictType, dictValue); | 43 | return dictDataMapper.selectDictLabel(dictType, dictValue); |
| 45 | } | 44 | } |
| 46 | 45 | ||
| 47 | /** | 46 | /** |
| 48 | * 根据字典数据ID查询信息 | 47 | * 根据字典数据ID查询信息 |
| 49 | - * | 48 | + * |
| 50 | * @param dictCode 字典数据ID | 49 | * @param dictCode 字典数据ID |
| 51 | * @return 字典数据 | 50 | * @return 字典数据 |
| 52 | */ | 51 | */ |
| 53 | @Override | 52 | @Override |
| 54 | - public SysDictData selectDictDataById(Long dictCode) | ||
| 55 | - { | 53 | + public SysDictData selectDictDataById(Long dictCode) { |
| 56 | return dictDataMapper.selectDictDataById(dictCode); | 54 | return dictDataMapper.selectDictDataById(dictCode); |
| 57 | } | 55 | } |
| 58 | 56 | ||
| 59 | /** | 57 | /** |
| 60 | * 批量删除字典数据信息 | 58 | * 批量删除字典数据信息 |
| 61 | - * | 59 | + * |
| 62 | * @param dictCodes 需要删除的字典数据ID | 60 | * @param dictCodes 需要删除的字典数据ID |
| 63 | * @return 结果 | 61 | * @return 结果 |
| 64 | */ | 62 | */ |
| 65 | @Override | 63 | @Override |
| 66 | - public int deleteDictDataByIds(Long[] dictCodes) | ||
| 67 | - { | 64 | + public int deleteDictDataByIds(Long[] dictCodes) { |
| 68 | int row = dictDataMapper.deleteDictDataByIds(dictCodes); | 65 | int row = dictDataMapper.deleteDictDataByIds(dictCodes); |
| 69 | - if (row > 0) | ||
| 70 | - { | 66 | + if (row > 0) { |
| 71 | DictUtils.clearDictCache(); | 67 | DictUtils.clearDictCache(); |
| 72 | } | 68 | } |
| 73 | return row; | 69 | return row; |
| @@ -75,16 +71,14 @@ public class SysDictDataServiceImpl implements ISysDictDataService | @@ -75,16 +71,14 @@ public class SysDictDataServiceImpl implements ISysDictDataService | ||
| 75 | 71 | ||
| 76 | /** | 72 | /** |
| 77 | * 新增保存字典数据信息 | 73 | * 新增保存字典数据信息 |
| 78 | - * | 74 | + * |
| 79 | * @param dictData 字典数据信息 | 75 | * @param dictData 字典数据信息 |
| 80 | * @return 结果 | 76 | * @return 结果 |
| 81 | */ | 77 | */ |
| 82 | @Override | 78 | @Override |
| 83 | - public int insertDictData(SysDictData dictData) | ||
| 84 | - { | 79 | + public int insertDictData(SysDictData dictData) { |
| 85 | int row = dictDataMapper.insertDictData(dictData); | 80 | int row = dictDataMapper.insertDictData(dictData); |
| 86 | - if (row > 0) | ||
| 87 | - { | 81 | + if (row > 0) { |
| 88 | DictUtils.clearDictCache(); | 82 | DictUtils.clearDictCache(); |
| 89 | } | 83 | } |
| 90 | return row; | 84 | return row; |
| @@ -92,16 +86,14 @@ public class SysDictDataServiceImpl implements ISysDictDataService | @@ -92,16 +86,14 @@ public class SysDictDataServiceImpl implements ISysDictDataService | ||
| 92 | 86 | ||
| 93 | /** | 87 | /** |
| 94 | * 修改保存字典数据信息 | 88 | * 修改保存字典数据信息 |
| 95 | - * | 89 | + * |
| 96 | * @param dictData 字典数据信息 | 90 | * @param dictData 字典数据信息 |
| 97 | * @return 结果 | 91 | * @return 结果 |
| 98 | */ | 92 | */ |
| 99 | @Override | 93 | @Override |
| 100 | - public int updateDictData(SysDictData dictData) | ||
| 101 | - { | 94 | + public int updateDictData(SysDictData dictData) { |
| 102 | int row = dictDataMapper.updateDictData(dictData); | 95 | int row = dictDataMapper.updateDictData(dictData); |
| 103 | - if (row > 0) | ||
| 104 | - { | 96 | + if (row > 0) { |
| 105 | DictUtils.clearDictCache(); | 97 | DictUtils.clearDictCache(); |
| 106 | } | 98 | } |
| 107 | return row; | 99 | return row; |
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java
| @@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl; | @@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl; | ||
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | import javax.annotation.PostConstruct; | 4 | import javax.annotation.PostConstruct; |
| 5 | + | ||
| 5 | import org.springframework.beans.factory.annotation.Autowired; | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 6 | import org.springframework.stereotype.Service; | 7 | import org.springframework.stereotype.Service; |
| 7 | import org.springframework.transaction.annotation.Transactional; | 8 | import org.springframework.transaction.annotation.Transactional; |
| @@ -17,12 +18,11 @@ import com.ruoyi.system.service.ISysDictTypeService; | @@ -17,12 +18,11 @@ import com.ruoyi.system.service.ISysDictTypeService; | ||
| 17 | 18 | ||
| 18 | /** | 19 | /** |
| 19 | * 字典 业务层处理 | 20 | * 字典 业务层处理 |
| 20 | - * | 21 | + * |
| 21 | * @author ruoyi | 22 | * @author ruoyi |
| 22 | */ | 23 | */ |
| 23 | @Service | 24 | @Service |
| 24 | -public class SysDictTypeServiceImpl implements ISysDictTypeService | ||
| 25 | -{ | 25 | +public class SysDictTypeServiceImpl implements ISysDictTypeService { |
| 26 | @Autowired | 26 | @Autowired |
| 27 | private SysDictTypeMapper dictTypeMapper; | 27 | private SysDictTypeMapper dictTypeMapper; |
| 28 | 28 | ||
| @@ -33,11 +33,9 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService | @@ -33,11 +33,9 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService | ||
| 33 | * 项目启动时,初始化字典到缓存 | 33 | * 项目启动时,初始化字典到缓存 |
| 34 | */ | 34 | */ |
| 35 | @PostConstruct | 35 | @PostConstruct |
| 36 | - public void init() | ||
| 37 | - { | 36 | + public void init() { |
| 38 | List<SysDictType> dictTypeList = dictTypeMapper.selectDictTypeAll(); | 37 | List<SysDictType> dictTypeList = dictTypeMapper.selectDictTypeAll(); |
| 39 | - for (SysDictType dictType : dictTypeList) | ||
| 40 | - { | 38 | + for (SysDictType dictType : dictTypeList) { |
| 41 | List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType()); | 39 | List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType()); |
| 42 | DictUtils.setDictCache(dictType.getDictType(), dictDatas); | 40 | DictUtils.setDictCache(dictType.getDictType(), dictDatas); |
| 43 | } | 41 | } |
| @@ -45,44 +43,39 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService | @@ -45,44 +43,39 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService | ||
| 45 | 43 | ||
| 46 | /** | 44 | /** |
| 47 | * 根据条件分页查询字典类型 | 45 | * 根据条件分页查询字典类型 |
| 48 | - * | 46 | + * |
| 49 | * @param dictType 字典类型信息 | 47 | * @param dictType 字典类型信息 |
| 50 | * @return 字典类型集合信息 | 48 | * @return 字典类型集合信息 |
| 51 | */ | 49 | */ |
| 52 | @Override | 50 | @Override |
| 53 | - public List<SysDictType> selectDictTypeList(SysDictType dictType) | ||
| 54 | - { | 51 | + public List<SysDictType> selectDictTypeList(SysDictType dictType) { |
| 55 | return dictTypeMapper.selectDictTypeList(dictType); | 52 | return dictTypeMapper.selectDictTypeList(dictType); |
| 56 | } | 53 | } |
| 57 | 54 | ||
| 58 | /** | 55 | /** |
| 59 | * 根据所有字典类型 | 56 | * 根据所有字典类型 |
| 60 | - * | 57 | + * |
| 61 | * @return 字典类型集合信息 | 58 | * @return 字典类型集合信息 |
| 62 | */ | 59 | */ |
| 63 | @Override | 60 | @Override |
| 64 | - public List<SysDictType> selectDictTypeAll() | ||
| 65 | - { | 61 | + public List<SysDictType> selectDictTypeAll() { |
| 66 | return dictTypeMapper.selectDictTypeAll(); | 62 | return dictTypeMapper.selectDictTypeAll(); |
| 67 | } | 63 | } |
| 68 | 64 | ||
| 69 | /** | 65 | /** |
| 70 | * 根据字典类型查询字典数据 | 66 | * 根据字典类型查询字典数据 |
| 71 | - * | 67 | + * |
| 72 | * @param dictType 字典类型 | 68 | * @param dictType 字典类型 |
| 73 | * @return 字典数据集合信息 | 69 | * @return 字典数据集合信息 |
| 74 | */ | 70 | */ |
| 75 | @Override | 71 | @Override |
| 76 | - public List<SysDictData> selectDictDataByType(String dictType) | ||
| 77 | - { | 72 | + public List<SysDictData> selectDictDataByType(String dictType) { |
| 78 | List<SysDictData> dictDatas = DictUtils.getDictCache(dictType); | 73 | List<SysDictData> dictDatas = DictUtils.getDictCache(dictType); |
| 79 | - if (StringUtils.isNotEmpty(dictDatas)) | ||
| 80 | - { | 74 | + if (StringUtils.isNotEmpty(dictDatas)) { |
| 81 | return dictDatas; | 75 | return dictDatas; |
| 82 | } | 76 | } |
| 83 | dictDatas = dictDataMapper.selectDictDataByType(dictType); | 77 | dictDatas = dictDataMapper.selectDictDataByType(dictType); |
| 84 | - if (StringUtils.isNotEmpty(dictDatas)) | ||
| 85 | - { | 78 | + if (StringUtils.isNotEmpty(dictDatas)) { |
| 86 | DictUtils.setDictCache(dictType, dictDatas); | 79 | DictUtils.setDictCache(dictType, dictDatas); |
| 87 | return dictDatas; | 80 | return dictDatas; |
| 88 | } | 81 | } |
| @@ -91,74 +84,58 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService | @@ -91,74 +84,58 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService | ||
| 91 | 84 | ||
| 92 | /** | 85 | /** |
| 93 | * 根据字典类型ID查询信息 | 86 | * 根据字典类型ID查询信息 |
| 94 | - * | 87 | + * |
| 95 | * @param dictId 字典类型ID | 88 | * @param dictId 字典类型ID |
| 96 | * @return 字典类型 | 89 | * @return 字典类型 |
| 97 | */ | 90 | */ |
| 98 | @Override | 91 | @Override |
| 99 | - public SysDictType selectDictTypeById(Long dictId) | ||
| 100 | - { | 92 | + public SysDictType selectDictTypeById(Long dictId) { |
| 101 | return dictTypeMapper.selectDictTypeById(dictId); | 93 | return dictTypeMapper.selectDictTypeById(dictId); |
| 102 | } | 94 | } |
| 103 | 95 | ||
| 104 | /** | 96 | /** |
| 105 | * 根据字典类型查询信息 | 97 | * 根据字典类型查询信息 |
| 106 | - * | 98 | + * |
| 107 | * @param dictType 字典类型 | 99 | * @param dictType 字典类型 |
| 108 | * @return 字典类型 | 100 | * @return 字典类型 |
| 109 | */ | 101 | */ |
| 110 | @Override | 102 | @Override |
| 111 | - public SysDictType selectDictTypeByType(String dictType) | ||
| 112 | - { | 103 | + public SysDictType selectDictTypeByType(String dictType) { |
| 113 | return dictTypeMapper.selectDictTypeByType(dictType); | 104 | return dictTypeMapper.selectDictTypeByType(dictType); |
| 114 | } | 105 | } |
| 115 | 106 | ||
| 116 | /** | 107 | /** |
| 117 | * 批量删除字典类型信息 | 108 | * 批量删除字典类型信息 |
| 118 | - * | 109 | + * |
| 119 | * @param dictIds 需要删除的字典ID | 110 | * @param dictIds 需要删除的字典ID |
| 120 | * @return 结果 | 111 | * @return 结果 |
| 121 | */ | 112 | */ |
| 122 | @Override | 113 | @Override |
| 123 | - public int deleteDictTypeByIds(Long[] dictIds) | ||
| 124 | - { | ||
| 125 | - for (Long dictId : dictIds) | ||
| 126 | - { | 114 | + public int deleteDictTypeByIds(Long[] dictIds) { |
| 115 | + for (Long dictId : dictIds) { | ||
| 127 | SysDictType dictType = selectDictTypeById(dictId); | 116 | SysDictType dictType = selectDictTypeById(dictId); |
| 128 | - if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) | ||
| 129 | - { | 117 | + if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) { |
| 130 | throw new CustomException(String.format("%1$s已分配,不能删除", dictType.getDictName())); | 118 | throw new CustomException(String.format("%1$s已分配,不能删除", dictType.getDictName())); |
| 131 | } | 119 | } |
| 132 | } | 120 | } |
| 133 | int count = dictTypeMapper.deleteDictTypeByIds(dictIds); | 121 | int count = dictTypeMapper.deleteDictTypeByIds(dictIds); |
| 134 | - if (count > 0) | ||
| 135 | - { | 122 | + if (count > 0) { |
| 136 | DictUtils.clearDictCache(); | 123 | DictUtils.clearDictCache(); |
| 137 | } | 124 | } |
| 138 | return count; | 125 | return count; |
| 139 | } | 126 | } |
| 140 | 127 | ||
| 141 | - /** | ||
| 142 | - * 清空缓存数据 | ||
| 143 | - */ | ||
| 144 | - @Override | ||
| 145 | - public void clearCache() | ||
| 146 | - { | ||
| 147 | - DictUtils.clearDictCache(); | ||
| 148 | - } | ||
| 149 | 128 | ||
| 150 | /** | 129 | /** |
| 151 | * 新增保存字典类型信息 | 130 | * 新增保存字典类型信息 |
| 152 | - * | 131 | + * |
| 153 | * @param dictType 字典类型信息 | 132 | * @param dictType 字典类型信息 |
| 154 | * @return 结果 | 133 | * @return 结果 |
| 155 | */ | 134 | */ |
| 156 | @Override | 135 | @Override |
| 157 | - public int insertDictType(SysDictType dictType) | ||
| 158 | - { | 136 | + public int insertDictType(SysDictType dictType) { |
| 159 | int row = dictTypeMapper.insertDictType(dictType); | 137 | int row = dictTypeMapper.insertDictType(dictType); |
| 160 | - if (row > 0) | ||
| 161 | - { | 138 | + if (row > 0) { |
| 162 | DictUtils.clearDictCache(); | 139 | DictUtils.clearDictCache(); |
| 163 | } | 140 | } |
| 164 | return row; | 141 | return row; |
| @@ -166,19 +143,17 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService | @@ -166,19 +143,17 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService | ||
| 166 | 143 | ||
| 167 | /** | 144 | /** |
| 168 | * 修改保存字典类型信息 | 145 | * 修改保存字典类型信息 |
| 169 | - * | 146 | + * |
| 170 | * @param dictType 字典类型信息 | 147 | * @param dictType 字典类型信息 |
| 171 | * @return 结果 | 148 | * @return 结果 |
| 172 | */ | 149 | */ |
| 173 | @Override | 150 | @Override |
| 174 | @Transactional | 151 | @Transactional |
| 175 | - public int updateDictType(SysDictType dictType) | ||
| 176 | - { | 152 | + public int updateDictType(SysDictType dictType) { |
| 177 | SysDictType oldDict = dictTypeMapper.selectDictTypeById(dictType.getDictId()); | 153 | SysDictType oldDict = dictTypeMapper.selectDictTypeById(dictType.getDictId()); |
| 178 | dictDataMapper.updateDictDataType(oldDict.getDictType(), dictType.getDictType()); | 154 | dictDataMapper.updateDictDataType(oldDict.getDictType(), dictType.getDictType()); |
| 179 | int row = dictTypeMapper.updateDictType(dictType); | 155 | int row = dictTypeMapper.updateDictType(dictType); |
| 180 | - if (row > 0) | ||
| 181 | - { | 156 | + if (row > 0) { |
| 182 | DictUtils.clearDictCache(); | 157 | DictUtils.clearDictCache(); |
| 183 | } | 158 | } |
| 184 | return row; | 159 | return row; |
| @@ -186,17 +161,15 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService | @@ -186,17 +161,15 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService | ||
| 186 | 161 | ||
| 187 | /** | 162 | /** |
| 188 | * 校验字典类型称是否唯一 | 163 | * 校验字典类型称是否唯一 |
| 189 | - * | 164 | + * |
| 190 | * @param dict 字典类型 | 165 | * @param dict 字典类型 |
| 191 | * @return 结果 | 166 | * @return 结果 |
| 192 | */ | 167 | */ |
| 193 | @Override | 168 | @Override |
| 194 | - public String checkDictTypeUnique(SysDictType dict) | ||
| 195 | - { | 169 | + public String checkDictTypeUnique(SysDictType dict) { |
| 196 | Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId(); | 170 | Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId(); |
| 197 | SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType()); | 171 | SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType()); |
| 198 | - if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) | ||
| 199 | - { | 172 | + if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) { |
| 200 | return UserConstants.NOT_UNIQUE; | 173 | return UserConstants.NOT_UNIQUE; |
| 201 | } | 174 | } |
| 202 | return UserConstants.UNIQUE; | 175 | return UserConstants.UNIQUE; |
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java
| 1 | package com.ruoyi.system.service.impl; | 1 | package com.ruoyi.system.service.impl; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | + | ||
| 4 | import org.springframework.beans.factory.annotation.Autowired; | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 5 | import org.springframework.stereotype.Service; | 6 | import org.springframework.stereotype.Service; |
| 6 | import com.ruoyi.system.domain.SysLogininfor; | 7 | import com.ruoyi.system.domain.SysLogininfor; |
| @@ -9,48 +10,44 @@ import com.ruoyi.system.service.ISysLogininforService; | @@ -9,48 +10,44 @@ import com.ruoyi.system.service.ISysLogininforService; | ||
| 9 | 10 | ||
| 10 | /** | 11 | /** |
| 11 | * 系统访问日志情况信息 服务层处理 | 12 | * 系统访问日志情况信息 服务层处理 |
| 12 | - * | 13 | + * |
| 13 | * @author ruoyi | 14 | * @author ruoyi |
| 14 | */ | 15 | */ |
| 15 | @Service | 16 | @Service |
| 16 | -public class SysLogininforServiceImpl implements ISysLogininforService | ||
| 17 | -{ | 17 | +public class SysLogininforServiceImpl implements ISysLogininforService { |
| 18 | 18 | ||
| 19 | @Autowired | 19 | @Autowired |
| 20 | private SysLogininforMapper logininforMapper; | 20 | private SysLogininforMapper logininforMapper; |
| 21 | 21 | ||
| 22 | /** | 22 | /** |
| 23 | * 新增系统登录日志 | 23 | * 新增系统登录日志 |
| 24 | - * | 24 | + * |
| 25 | * @param logininfor 访问日志对象 | 25 | * @param logininfor 访问日志对象 |
| 26 | */ | 26 | */ |
| 27 | @Override | 27 | @Override |
| 28 | - public void insertLogininfor(SysLogininfor logininfor) | ||
| 29 | - { | 28 | + public void insertLogininfor(SysLogininfor logininfor) { |
| 30 | logininforMapper.insertLogininfor(logininfor); | 29 | logininforMapper.insertLogininfor(logininfor); |
| 31 | } | 30 | } |
| 32 | 31 | ||
| 33 | /** | 32 | /** |
| 34 | * 查询系统登录日志集合 | 33 | * 查询系统登录日志集合 |
| 35 | - * | 34 | + * |
| 36 | * @param logininfor 访问日志对象 | 35 | * @param logininfor 访问日志对象 |
| 37 | * @return 登录记录集合 | 36 | * @return 登录记录集合 |
| 38 | */ | 37 | */ |
| 39 | @Override | 38 | @Override |
| 40 | - public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor) | ||
| 41 | - { | 39 | + public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor) { |
| 42 | return logininforMapper.selectLogininforList(logininfor); | 40 | return logininforMapper.selectLogininforList(logininfor); |
| 43 | } | 41 | } |
| 44 | 42 | ||
| 45 | /** | 43 | /** |
| 46 | * 批量删除系统登录日志 | 44 | * 批量删除系统登录日志 |
| 47 | - * | 45 | + * |
| 48 | * @param infoIds 需要删除的登录日志ID | 46 | * @param infoIds 需要删除的登录日志ID |
| 49 | * @return | 47 | * @return |
| 50 | */ | 48 | */ |
| 51 | @Override | 49 | @Override |
| 52 | - public int deleteLogininforByIds(Long[] infoIds) | ||
| 53 | - { | 50 | + public int deleteLogininforByIds(Long[] infoIds) { |
| 54 | return logininforMapper.deleteLogininforByIds(infoIds); | 51 | return logininforMapper.deleteLogininforByIds(infoIds); |
| 55 | } | 52 | } |
| 56 | 53 | ||
| @@ -58,8 +55,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService | @@ -58,8 +55,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService | ||
| 58 | * 清空系统登录日志 | 55 | * 清空系统登录日志 |
| 59 | */ | 56 | */ |
| 60 | @Override | 57 | @Override |
| 61 | - public void cleanLogininfor() | ||
| 62 | - { | 58 | + public void cleanLogininfor() { |
| 63 | logininforMapper.cleanLogininfor(); | 59 | logininforMapper.cleanLogininfor(); |
| 64 | } | 60 | } |
| 65 | } | 61 | } |
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java deleted
| 1 | -package com.ruoyi.system.service.impl; | ||
| 2 | - | ||
| 3 | -import java.util.ArrayList; | ||
| 4 | -import java.util.Arrays; | ||
| 5 | -import java.util.HashSet; | ||
| 6 | -import java.util.Iterator; | ||
| 7 | -import java.util.LinkedList; | ||
| 8 | -import java.util.List; | ||
| 9 | -import java.util.Set; | ||
| 10 | -import java.util.stream.Collectors; | ||
| 11 | - | ||
| 12 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 13 | -import org.springframework.stereotype.Service; | ||
| 14 | -import com.ruoyi.common.constant.UserConstants; | ||
| 15 | -import com.ruoyi.common.core.domain.TreeSelect; | ||
| 16 | -import com.ruoyi.common.core.domain.entity.SysMenu; | ||
| 17 | -import com.ruoyi.common.core.domain.entity.SysRole; | ||
| 18 | -import com.ruoyi.common.core.domain.entity.SysUser; | ||
| 19 | -import com.ruoyi.common.utils.SecurityUtils; | ||
| 20 | -import com.ruoyi.common.utils.StringUtils; | ||
| 21 | -import com.ruoyi.system.domain.vo.MetaVo; | ||
| 22 | -import com.ruoyi.system.domain.vo.RouterVo; | ||
| 23 | -import com.ruoyi.system.mapper.SysMenuMapper; | ||
| 24 | -import com.ruoyi.system.mapper.SysRoleMapper; | ||
| 25 | -import com.ruoyi.system.mapper.SysRoleMenuMapper; | ||
| 26 | -import com.ruoyi.system.service.ISysMenuService; | ||
| 27 | - | ||
| 28 | -/** | ||
| 29 | - * 菜单 业务层处理 | ||
| 30 | - * | ||
| 31 | - * @author ruoyi | ||
| 32 | - */ | ||
| 33 | -@Service | ||
| 34 | -public class SysMenuServiceImpl implements ISysMenuService { | ||
| 35 | - | ||
| 36 | - /** | ||
| 37 | - * 根据用户查询系统菜单列表 | ||
| 38 | - * | ||
| 39 | - * @param userId 用户ID | ||
| 40 | - * @return 菜单列表 | ||
| 41 | - */ | ||
| 42 | - @Override | ||
| 43 | - public List<SysMenu> selectMenuList(Long userId) { | ||
| 44 | - return selectMenuList(new SysMenu(), userId); | ||
| 45 | - } | ||
| 46 | - | ||
| 47 | - /** | ||
| 48 | - * 查询系统菜单列表 | ||
| 49 | - * | ||
| 50 | - * @param menu 菜单信息 | ||
| 51 | - * @return 菜单列表 | ||
| 52 | - */ | ||
| 53 | - @Override | ||
| 54 | - public List<SysMenu> selectMenuList(SysMenu menu, Long userId) { | ||
| 55 | - List<SysMenu> menuList = null; | ||
| 56 | - // 管理员显示所有菜单信息 | ||
| 57 | - if (SysUser.isAdmin(userId)) { | ||
| 58 | - menuList = menuMapper.selectMenuList(menu); | ||
| 59 | - } else { | ||
| 60 | - menu.getParams().put("userId", userId); | ||
| 61 | - menuList = menuMapper.selectMenuListByUserId(menu); | ||
| 62 | - } | ||
| 63 | - return menuList; | ||
| 64 | - } | ||
| 65 | - | ||
| 66 | - /** | ||
| 67 | - * 根据用户ID查询权限 | ||
| 68 | - * | ||
| 69 | - * @param userId 用户ID | ||
| 70 | - * @return 权限列表 | ||
| 71 | - */ | ||
| 72 | - @Override | ||
| 73 | - public Set<String> selectMenuPermsByUserId(Long userId) { | ||
| 74 | - List<String> perms = menuMapper.selectMenuPermsByUserId(userId); | ||
| 75 | - Set<String> permsSet = new HashSet<>(); | ||
| 76 | - for (String perm : perms) { | ||
| 77 | - if (StringUtils.isNotEmpty(perm)) { | ||
| 78 | - permsSet.addAll(Arrays.asList(perm.trim().split(","))); | ||
| 79 | - } | ||
| 80 | - } | ||
| 81 | - return permsSet; | ||
| 82 | - } | ||
| 83 | - | ||
| 84 | - /** | ||
| 85 | - * 根据用户ID查询菜单 | ||
| 86 | - * | ||
| 87 | - * @param userId 用户名称 | ||
| 88 | - * @return 菜单列表 | ||
| 89 | - */ | ||
| 90 | - @Override | ||
| 91 | - public List<SysMenu> selectMenuTreeByUserId(Long userId) { | ||
| 92 | - List<SysMenu> menus = null; | ||
| 93 | - if (SecurityUtils.isAdmin(userId)) { | ||
| 94 | - menus = menuMapper.selectMenuTreeAll(); | ||
| 95 | - } else { | ||
| 96 | - menus = menuMapper.selectMenuTreeByUserId(userId); | ||
| 97 | - } | ||
| 98 | - return getChildPerms(menus, 0); | ||
| 99 | - } | ||
| 100 | - | ||
| 101 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java
| 1 | package com.ruoyi.system.service.impl; | 1 | package com.ruoyi.system.service.impl; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | + | ||
| 4 | import org.springframework.beans.factory.annotation.Autowired; | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 5 | import org.springframework.stereotype.Service; | 6 | import org.springframework.stereotype.Service; |
| 6 | import com.ruoyi.system.domain.SysNotice; | 7 | import com.ruoyi.system.domain.SysNotice; |
| @@ -9,84 +10,77 @@ import com.ruoyi.system.service.ISysNoticeService; | @@ -9,84 +10,77 @@ import com.ruoyi.system.service.ISysNoticeService; | ||
| 9 | 10 | ||
| 10 | /** | 11 | /** |
| 11 | * 公告 服务层实现 | 12 | * 公告 服务层实现 |
| 12 | - * | 13 | + * |
| 13 | * @author ruoyi | 14 | * @author ruoyi |
| 14 | */ | 15 | */ |
| 15 | @Service | 16 | @Service |
| 16 | -public class SysNoticeServiceImpl implements ISysNoticeService | ||
| 17 | -{ | 17 | +public class SysNoticeServiceImpl implements ISysNoticeService { |
| 18 | @Autowired | 18 | @Autowired |
| 19 | private SysNoticeMapper noticeMapper; | 19 | private SysNoticeMapper noticeMapper; |
| 20 | 20 | ||
| 21 | /** | 21 | /** |
| 22 | * 查询公告信息 | 22 | * 查询公告信息 |
| 23 | - * | 23 | + * |
| 24 | * @param noticeId 公告ID | 24 | * @param noticeId 公告ID |
| 25 | * @return 公告信息 | 25 | * @return 公告信息 |
| 26 | */ | 26 | */ |
| 27 | @Override | 27 | @Override |
| 28 | - public SysNotice selectNoticeById(Long noticeId) | ||
| 29 | - { | 28 | + public SysNotice selectNoticeById(Long noticeId) { |
| 30 | return noticeMapper.selectNoticeById(noticeId); | 29 | return noticeMapper.selectNoticeById(noticeId); |
| 31 | } | 30 | } |
| 32 | 31 | ||
| 33 | /** | 32 | /** |
| 34 | * 查询公告列表 | 33 | * 查询公告列表 |
| 35 | - * | 34 | + * |
| 36 | * @param notice 公告信息 | 35 | * @param notice 公告信息 |
| 37 | * @return 公告集合 | 36 | * @return 公告集合 |
| 38 | */ | 37 | */ |
| 39 | @Override | 38 | @Override |
| 40 | - public List<SysNotice> selectNoticeList(SysNotice notice) | ||
| 41 | - { | 39 | + public List<SysNotice> selectNoticeList(SysNotice notice) { |
| 42 | return noticeMapper.selectNoticeList(notice); | 40 | return noticeMapper.selectNoticeList(notice); |
| 43 | } | 41 | } |
| 44 | 42 | ||
| 45 | /** | 43 | /** |
| 46 | * 新增公告 | 44 | * 新增公告 |
| 47 | - * | 45 | + * |
| 48 | * @param notice 公告信息 | 46 | * @param notice 公告信息 |
| 49 | * @return 结果 | 47 | * @return 结果 |
| 50 | */ | 48 | */ |
| 51 | @Override | 49 | @Override |
| 52 | - public int insertNotice(SysNotice notice) | ||
| 53 | - { | 50 | + public int insertNotice(SysNotice notice) { |
| 54 | return noticeMapper.insertNotice(notice); | 51 | return noticeMapper.insertNotice(notice); |
| 55 | } | 52 | } |
| 56 | 53 | ||
| 57 | /** | 54 | /** |
| 58 | * 修改公告 | 55 | * 修改公告 |
| 59 | - * | 56 | + * |
| 60 | * @param notice 公告信息 | 57 | * @param notice 公告信息 |
| 61 | * @return 结果 | 58 | * @return 结果 |
| 62 | */ | 59 | */ |
| 63 | @Override | 60 | @Override |
| 64 | - public int updateNotice(SysNotice notice) | ||
| 65 | - { | 61 | + public int updateNotice(SysNotice notice) { |
| 66 | return noticeMapper.updateNotice(notice); | 62 | return noticeMapper.updateNotice(notice); |
| 67 | } | 63 | } |
| 68 | 64 | ||
| 69 | /** | 65 | /** |
| 70 | * 删除公告对象 | 66 | * 删除公告对象 |
| 71 | - * | 67 | + * |
| 72 | * @param noticeId 公告ID | 68 | * @param noticeId 公告ID |
| 73 | * @return 结果 | 69 | * @return 结果 |
| 74 | */ | 70 | */ |
| 75 | @Override | 71 | @Override |
| 76 | - public int deleteNoticeById(Long noticeId) | ||
| 77 | - { | 72 | + public int deleteNoticeById(Long noticeId) { |
| 78 | return noticeMapper.deleteNoticeById(noticeId); | 73 | return noticeMapper.deleteNoticeById(noticeId); |
| 79 | } | 74 | } |
| 80 | 75 | ||
| 81 | /** | 76 | /** |
| 82 | * 批量删除公告信息 | 77 | * 批量删除公告信息 |
| 83 | - * | 78 | + * |
| 84 | * @param noticeIds 需要删除的公告ID | 79 | * @param noticeIds 需要删除的公告ID |
| 85 | * @return 结果 | 80 | * @return 结果 |
| 86 | */ | 81 | */ |
| 87 | @Override | 82 | @Override |
| 88 | - public int deleteNoticeByIds(Long[] noticeIds) | ||
| 89 | - { | 83 | + public int deleteNoticeByIds(Long[] noticeIds) { |
| 90 | return noticeMapper.deleteNoticeByIds(noticeIds); | 84 | return noticeMapper.deleteNoticeByIds(noticeIds); |
| 91 | } | 85 | } |
| 92 | } | 86 | } |
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java
| 1 | package com.ruoyi.system.service.impl; | 1 | package com.ruoyi.system.service.impl; |
| 2 | 2 | ||
| 3 | import java.util.List; | 3 | import java.util.List; |
| 4 | + | ||
| 4 | import org.springframework.beans.factory.annotation.Autowired; | 5 | import org.springframework.beans.factory.annotation.Autowired; |
| 5 | import org.springframework.stereotype.Service; | 6 | import org.springframework.stereotype.Service; |
| 6 | import com.ruoyi.system.domain.SysOperLog; | 7 | import com.ruoyi.system.domain.SysOperLog; |
| @@ -9,59 +10,54 @@ import com.ruoyi.system.service.ISysOperLogService; | @@ -9,59 +10,54 @@ import com.ruoyi.system.service.ISysOperLogService; | ||
| 9 | 10 | ||
| 10 | /** | 11 | /** |
| 11 | * 操作日志 服务层处理 | 12 | * 操作日志 服务层处理 |
| 12 | - * | 13 | + * |
| 13 | * @author ruoyi | 14 | * @author ruoyi |
| 14 | */ | 15 | */ |
| 15 | @Service | 16 | @Service |
| 16 | -public class SysOperLogServiceImpl implements ISysOperLogService | ||
| 17 | -{ | 17 | +public class SysOperLogServiceImpl implements ISysOperLogService { |
| 18 | @Autowired | 18 | @Autowired |
| 19 | private SysOperLogMapper operLogMapper; | 19 | private SysOperLogMapper operLogMapper; |
| 20 | 20 | ||
| 21 | /** | 21 | /** |
| 22 | * 新增操作日志 | 22 | * 新增操作日志 |
| 23 | - * | 23 | + * |
| 24 | * @param operLog 操作日志对象 | 24 | * @param operLog 操作日志对象 |
| 25 | */ | 25 | */ |
| 26 | @Override | 26 | @Override |
| 27 | - public void insertOperlog(SysOperLog operLog) | ||
| 28 | - { | 27 | + public void insertOperlog(SysOperLog operLog) { |
| 29 | operLogMapper.insertOperlog(operLog); | 28 | operLogMapper.insertOperlog(operLog); |
| 30 | } | 29 | } |
| 31 | 30 | ||
| 32 | /** | 31 | /** |
| 33 | * 查询系统操作日志集合 | 32 | * 查询系统操作日志集合 |
| 34 | - * | 33 | + * |
| 35 | * @param operLog 操作日志对象 | 34 | * @param operLog 操作日志对象 |
| 36 | * @return 操作日志集合 | 35 | * @return 操作日志集合 |
| 37 | */ | 36 | */ |
| 38 | @Override | 37 | @Override |
| 39 | - public List<SysOperLog> selectOperLogList(SysOperLog operLog) | ||
| 40 | - { | 38 | + public List<SysOperLog> selectOperLogList(SysOperLog operLog) { |
| 41 | return operLogMapper.selectOperLogList(operLog); | 39 | return operLogMapper.selectOperLogList(operLog); |
| 42 | } | 40 | } |
| 43 | 41 | ||
| 44 | /** | 42 | /** |
| 45 | * 批量删除系统操作日志 | 43 | * 批量删除系统操作日志 |
| 46 | - * | 44 | + * |
| 47 | * @param operIds 需要删除的操作日志ID | 45 | * @param operIds 需要删除的操作日志ID |
| 48 | * @return 结果 | 46 | * @return 结果 |
| 49 | */ | 47 | */ |
| 50 | @Override | 48 | @Override |
| 51 | - public int deleteOperLogByIds(Long[] operIds) | ||
| 52 | - { | 49 | + public int deleteOperLogByIds(Long[] operIds) { |
| 53 | return operLogMapper.deleteOperLogByIds(operIds); | 50 | return operLogMapper.deleteOperLogByIds(operIds); |
| 54 | } | 51 | } |
| 55 | 52 | ||
| 56 | /** | 53 | /** |
| 57 | * 查询操作日志详细 | 54 | * 查询操作日志详细 |
| 58 | - * | 55 | + * |
| 59 | * @param operId 操作ID | 56 | * @param operId 操作ID |
| 60 | * @return 操作日志对象 | 57 | * @return 操作日志对象 |
| 61 | */ | 58 | */ |
| 62 | @Override | 59 | @Override |
| 63 | - public SysOperLog selectOperLogById(Long operId) | ||
| 64 | - { | 60 | + public SysOperLog selectOperLogById(Long operId) { |
| 65 | return operLogMapper.selectOperLogById(operId); | 61 | return operLogMapper.selectOperLogById(operId); |
| 66 | } | 62 | } |
| 67 | 63 | ||
| @@ -69,8 +65,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService | @@ -69,8 +65,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService | ||
| 69 | * 清空操作日志 | 65 | * 清空操作日志 |
| 70 | */ | 66 | */ |
| 71 | @Override | 67 | @Override |
| 72 | - public void cleanOperLog() | ||
| 73 | - { | 68 | + public void cleanOperLog() { |
| 74 | operLogMapper.cleanOperLog(); | 69 | operLogMapper.cleanOperLog(); |
| 75 | } | 70 | } |
| 76 | } | 71 | } |
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java deleted
| 1 | -package com.ruoyi.system.service.impl; | ||
| 2 | - | ||
| 3 | -import java.util.List; | ||
| 4 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 5 | -import org.springframework.stereotype.Service; | ||
| 6 | -import com.ruoyi.common.constant.UserConstants; | ||
| 7 | -import com.ruoyi.common.exception.CustomException; | ||
| 8 | -import com.ruoyi.common.utils.StringUtils; | ||
| 9 | -import com.ruoyi.system.domain.SysPost; | ||
| 10 | -import com.ruoyi.system.mapper.SysPostMapper; | ||
| 11 | -import com.ruoyi.system.mapper.SysUserPostMapper; | ||
| 12 | -import com.ruoyi.system.service.ISysPostService; | ||
| 13 | - | ||
| 14 | -/** | ||
| 15 | - * 岗位信息 服务层处理 | ||
| 16 | - * | ||
| 17 | - * @author ruoyi | ||
| 18 | - */ | ||
| 19 | -@Service | ||
| 20 | -public class SysPostServiceImpl implements ISysPostService | ||
| 21 | -{ | ||
| 22 | - @Autowired | ||
| 23 | - private SysPostMapper postMapper; | ||
| 24 | - | ||
| 25 | - @Autowired | ||
| 26 | - private SysUserPostMapper userPostMapper; | ||
| 27 | - | ||
| 28 | - /** | ||
| 29 | - * 查询岗位信息集合 | ||
| 30 | - * | ||
| 31 | - * @param post 岗位信息 | ||
| 32 | - * @return 岗位信息集合 | ||
| 33 | - */ | ||
| 34 | - @Override | ||
| 35 | - public List<SysPost> selectPostList(SysPost post) | ||
| 36 | - { | ||
| 37 | - return postMapper.selectPostList(post); | ||
| 38 | - } | ||
| 39 | - | ||
| 40 | - /** | ||
| 41 | - * 查询所有岗位 | ||
| 42 | - * | ||
| 43 | - * @return 岗位列表 | ||
| 44 | - */ | ||
| 45 | - @Override | ||
| 46 | - public List<SysPost> selectPostAll() | ||
| 47 | - { | ||
| 48 | - return postMapper.selectPostAll(); | ||
| 49 | - } | ||
| 50 | - | ||
| 51 | - /** | ||
| 52 | - * 通过岗位ID查询岗位信息 | ||
| 53 | - * | ||
| 54 | - * @param postId 岗位ID | ||
| 55 | - * @return 角色对象信息 | ||
| 56 | - */ | ||
| 57 | - @Override | ||
| 58 | - public SysPost selectPostById(Long postId) | ||
| 59 | - { | ||
| 60 | - return postMapper.selectPostById(postId); | ||
| 61 | - } | ||
| 62 | - | ||
| 63 | - /** | ||
| 64 | - * 根据用户ID获取岗位选择框列表 | ||
| 65 | - * | ||
| 66 | - * @param userId 用户ID | ||
| 67 | - * @return 选中岗位ID列表 | ||
| 68 | - */ | ||
| 69 | - @Override | ||
| 70 | - public List<Integer> selectPostListByUserId(Long userId) | ||
| 71 | - { | ||
| 72 | - return postMapper.selectPostListByUserId(userId); | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | - /** | ||
| 76 | - * 校验岗位名称是否唯一 | ||
| 77 | - * | ||
| 78 | - * @param post 岗位信息 | ||
| 79 | - * @return 结果 | ||
| 80 | - */ | ||
| 81 | - @Override | ||
| 82 | - public String checkPostNameUnique(SysPost post) | ||
| 83 | - { | ||
| 84 | - Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); | ||
| 85 | - SysPost info = postMapper.checkPostNameUnique(post.getPostName()); | ||
| 86 | - if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) | ||
| 87 | - { | ||
| 88 | - return UserConstants.NOT_UNIQUE; | ||
| 89 | - } | ||
| 90 | - return UserConstants.UNIQUE; | ||
| 91 | - } | ||
| 92 | - | ||
| 93 | - /** | ||
| 94 | - * 校验岗位编码是否唯一 | ||
| 95 | - * | ||
| 96 | - * @param post 岗位信息 | ||
| 97 | - * @return 结果 | ||
| 98 | - */ | ||
| 99 | - @Override | ||
| 100 | - public String checkPostCodeUnique(SysPost post) | ||
| 101 | - { | ||
| 102 | - Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); | ||
| 103 | - SysPost info = postMapper.checkPostCodeUnique(post.getPostCode()); | ||
| 104 | - if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) | ||
| 105 | - { | ||
| 106 | - return UserConstants.NOT_UNIQUE; | ||
| 107 | - } | ||
| 108 | - return UserConstants.UNIQUE; | ||
| 109 | - } | ||
| 110 | - | ||
| 111 | - /** | ||
| 112 | - * 通过岗位ID查询岗位使用数量 | ||
| 113 | - * | ||
| 114 | - * @param postId 岗位ID | ||
| 115 | - * @return 结果 | ||
| 116 | - */ | ||
| 117 | - @Override | ||
| 118 | - public int countUserPostById(Long postId) | ||
| 119 | - { | ||
| 120 | - return userPostMapper.countUserPostById(postId); | ||
| 121 | - } | ||
| 122 | - | ||
| 123 | - /** | ||
| 124 | - * 删除岗位信息 | ||
| 125 | - * | ||
| 126 | - * @param postId 岗位ID | ||
| 127 | - * @return 结果 | ||
| 128 | - */ | ||
| 129 | - @Override | ||
| 130 | - public int deletePostById(Long postId) | ||
| 131 | - { | ||
| 132 | - return postMapper.deletePostById(postId); | ||
| 133 | - } | ||
| 134 | - | ||
| 135 | - /** | ||
| 136 | - * 批量删除岗位信息 | ||
| 137 | - * | ||
| 138 | - * @param postIds 需要删除的岗位ID | ||
| 139 | - * @return 结果 | ||
| 140 | - * @throws Exception 异常 | ||
| 141 | - */ | ||
| 142 | - @Override | ||
| 143 | - public int deletePostByIds(Long[] postIds) | ||
| 144 | - { | ||
| 145 | - for (Long postId : postIds) | ||
| 146 | - { | ||
| 147 | - SysPost post = selectPostById(postId); | ||
| 148 | - if (countUserPostById(postId) > 0) | ||
| 149 | - { | ||
| 150 | - throw new CustomException(String.format("%1$s已分配,不能删除", post.getPostName())); | ||
| 151 | - } | ||
| 152 | - } | ||
| 153 | - return postMapper.deletePostByIds(postIds); | ||
| 154 | - } | ||
| 155 | - | ||
| 156 | - /** | ||
| 157 | - * 新增保存岗位信息 | ||
| 158 | - * | ||
| 159 | - * @param post 岗位信息 | ||
| 160 | - * @return 结果 | ||
| 161 | - */ | ||
| 162 | - @Override | ||
| 163 | - public int insertPost(SysPost post) | ||
| 164 | - { | ||
| 165 | - return postMapper.insertPost(post); | ||
| 166 | - } | ||
| 167 | - | ||
| 168 | - /** | ||
| 169 | - * 修改保存岗位信息 | ||
| 170 | - * | ||
| 171 | - * @param post 岗位信息 | ||
| 172 | - * @return 结果 | ||
| 173 | - */ | ||
| 174 | - @Override | ||
| 175 | - public int updatePost(SysPost post) | ||
| 176 | - { | ||
| 177 | - return postMapper.updatePost(post); | ||
| 178 | - } | ||
| 179 | -} |
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java
| @@ -8,24 +8,21 @@ import com.ruoyi.system.service.ISysUserOnlineService; | @@ -8,24 +8,21 @@ import com.ruoyi.system.service.ISysUserOnlineService; | ||
| 8 | 8 | ||
| 9 | /** | 9 | /** |
| 10 | * 在线用户 服务层处理 | 10 | * 在线用户 服务层处理 |
| 11 | - * | 11 | + * |
| 12 | * @author ruoyi | 12 | * @author ruoyi |
| 13 | */ | 13 | */ |
| 14 | @Service | 14 | @Service |
| 15 | -public class SysUserOnlineServiceImpl implements ISysUserOnlineService | ||
| 16 | -{ | 15 | +public class SysUserOnlineServiceImpl implements ISysUserOnlineService { |
| 17 | /** | 16 | /** |
| 18 | * 通过登录地址查询信息 | 17 | * 通过登录地址查询信息 |
| 19 | - * | 18 | + * |
| 20 | * @param ipaddr 登录地址 | 19 | * @param ipaddr 登录地址 |
| 21 | - * @param user 用户信息 | 20 | + * @param user 用户信息 |
| 22 | * @return 在线用户信息 | 21 | * @return 在线用户信息 |
| 23 | */ | 22 | */ |
| 24 | @Override | 23 | @Override |
| 25 | - public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user) | ||
| 26 | - { | ||
| 27 | - if (StringUtils.equals(ipaddr, user.getIpaddr())) | ||
| 28 | - { | 24 | + public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user) { |
| 25 | + if (StringUtils.equals(ipaddr, user.getIpaddr())) { | ||
| 29 | return loginUserToUserOnline(user); | 26 | return loginUserToUserOnline(user); |
| 30 | } | 27 | } |
| 31 | return null; | 28 | return null; |
| @@ -33,16 +30,14 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService | @@ -33,16 +30,14 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService | ||
| 33 | 30 | ||
| 34 | /** | 31 | /** |
| 35 | * 通过用户名称查询信息 | 32 | * 通过用户名称查询信息 |
| 36 | - * | 33 | + * |
| 37 | * @param userName 用户名称 | 34 | * @param userName 用户名称 |
| 38 | - * @param user 用户信息 | 35 | + * @param user 用户信息 |
| 39 | * @return 在线用户信息 | 36 | * @return 在线用户信息 |
| 40 | */ | 37 | */ |
| 41 | @Override | 38 | @Override |
| 42 | - public SysUserOnline selectOnlineByUserName(String userName, LoginUser user) | ||
| 43 | - { | ||
| 44 | - if (StringUtils.equals(userName, user.getUsername())) | ||
| 45 | - { | 39 | + public SysUserOnline selectOnlineByUserName(String userName, LoginUser user) { |
| 40 | + if (StringUtils.equals(userName, user.getUsername())) { | ||
| 46 | return loginUserToUserOnline(user); | 41 | return loginUserToUserOnline(user); |
| 47 | } | 42 | } |
| 48 | return null; | 43 | return null; |
| @@ -50,17 +45,15 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService | @@ -50,17 +45,15 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService | ||
| 50 | 45 | ||
| 51 | /** | 46 | /** |
| 52 | * 通过登录地址/用户名称查询信息 | 47 | * 通过登录地址/用户名称查询信息 |
| 53 | - * | ||
| 54 | - * @param ipaddr 登录地址 | 48 | + * |
| 49 | + * @param ipaddr 登录地址 | ||
| 55 | * @param userName 用户名称 | 50 | * @param userName 用户名称 |
| 56 | - * @param user 用户信息 | 51 | + * @param user 用户信息 |
| 57 | * @return 在线用户信息 | 52 | * @return 在线用户信息 |
| 58 | */ | 53 | */ |
| 59 | @Override | 54 | @Override |
| 60 | - public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user) | ||
| 61 | - { | ||
| 62 | - if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) | ||
| 63 | - { | 55 | + public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user) { |
| 56 | + if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) { | ||
| 64 | return loginUserToUserOnline(user); | 57 | return loginUserToUserOnline(user); |
| 65 | } | 58 | } |
| 66 | return null; | 59 | return null; |
| @@ -68,15 +61,13 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService | @@ -68,15 +61,13 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService | ||
| 68 | 61 | ||
| 69 | /** | 62 | /** |
| 70 | * 设置在线用户信息 | 63 | * 设置在线用户信息 |
| 71 | - * | 64 | + * |
| 72 | * @param user 用户信息 | 65 | * @param user 用户信息 |
| 73 | * @return 在线用户 | 66 | * @return 在线用户 |
| 74 | */ | 67 | */ |
| 75 | @Override | 68 | @Override |
| 76 | - public SysUserOnline loginUserToUserOnline(LoginUser user) | ||
| 77 | - { | ||
| 78 | - if (StringUtils.isNull(user) || StringUtils.isNull(user.getUser())) | ||
| 79 | - { | 69 | + public SysUserOnline loginUserToUserOnline(LoginUser user) { |
| 70 | + if (StringUtils.isNull(user) || StringUtils.isNull(user.getUser())) { | ||
| 80 | return null; | 71 | return null; |
| 81 | } | 72 | } |
| 82 | SysUserOnline sysUserOnline = new SysUserOnline(); | 73 | SysUserOnline sysUserOnline = new SysUserOnline(); |
| @@ -87,8 +78,7 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService | @@ -87,8 +78,7 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService | ||
| 87 | sysUserOnline.setBrowser(user.getBrowser()); | 78 | sysUserOnline.setBrowser(user.getBrowser()); |
| 88 | sysUserOnline.setOs(user.getOs()); | 79 | sysUserOnline.setOs(user.getOs()); |
| 89 | sysUserOnline.setLoginTime(user.getLoginTime()); | 80 | sysUserOnline.setLoginTime(user.getLoginTime()); |
| 90 | - if (StringUtils.isNotNull(user.getUser().getDept())) | ||
| 91 | - { | 81 | + if (StringUtils.isNotNull(user.getUser().getDept())) { |
| 92 | sysUserOnline.setDeptName(user.getUser().getDept().getDeptName()); | 82 | sysUserOnline.setDeptName(user.getUser().getDept().getDeptName()); |
| 93 | } | 83 | } |
| 94 | return sysUserOnline; | 84 | return sysUserOnline; |
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8" ?> | ||
| 2 | -<!DOCTYPE mapper | ||
| 3 | -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 4 | -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 5 | -<mapper namespace="com.ruoyi.system.mapper.SysDeptMapper"> | ||
| 6 | - | ||
| 7 | - <resultMap type="SysDept" id="SysDeptResult"> | ||
| 8 | - <id property="deptId" column="dept_id" /> | ||
| 9 | - <result property="parentId" column="parent_id" /> | ||
| 10 | - <result property="ancestors" column="ancestors" /> | ||
| 11 | - <result property="deptName" column="dept_name" /> | ||
| 12 | - <result property="orderNum" column="order_num" /> | ||
| 13 | - <result property="leader" column="leader" /> | ||
| 14 | - <result property="phone" column="phone" /> | ||
| 15 | - <result property="email" column="email" /> | ||
| 16 | - <result property="status" column="status" /> | ||
| 17 | - <result property="delFlag" column="del_flag" /> | ||
| 18 | - <result property="parentName" column="parent_name" /> | ||
| 19 | - <result property="createBy" column="create_by" /> | ||
| 20 | - <result property="createTime" column="create_time" /> | ||
| 21 | - <result property="updateBy" column="update_by" /> | ||
| 22 | - <result property="updateTime" column="update_time" /> | ||
| 23 | - </resultMap> | ||
| 24 | - | ||
| 25 | - <sql id="selectDeptVo"> | ||
| 26 | - select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time | ||
| 27 | - from sys_dept d | ||
| 28 | - </sql> | ||
| 29 | - | ||
| 30 | - <select id="selectDeptList" parameterType="SysDept" resultMap="SysDeptResult"> | ||
| 31 | - <include refid="selectDeptVo"/> | ||
| 32 | - where d.del_flag = '0' | ||
| 33 | - <if test="parentId != null and parentId != 0"> | ||
| 34 | - AND parent_id = #{parentId} | ||
| 35 | - </if> | ||
| 36 | - <if test="deptName != null and deptName != ''"> | ||
| 37 | - AND dept_name like concat('%', #{deptName}, '%') | ||
| 38 | - </if> | ||
| 39 | - <if test="status != null and status != ''"> | ||
| 40 | - AND status = #{status} | ||
| 41 | - </if> | ||
| 42 | - <!-- 数据范围过滤 --> | ||
| 43 | - ${params.dataScope} | ||
| 44 | - order by d.parent_id, d.order_num | ||
| 45 | - </select> | ||
| 46 | - | ||
| 47 | - <select id="selectDeptListByRoleId" resultType="Integer"> | ||
| 48 | - select d.dept_id | ||
| 49 | - from sys_dept d | ||
| 50 | - left join sys_role_dept rd on d.dept_id = rd.dept_id | ||
| 51 | - where rd.role_id = #{roleId} | ||
| 52 | - <if test="deptCheckStrictly"> | ||
| 53 | - and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId}) | ||
| 54 | - </if> | ||
| 55 | - order by d.parent_id, d.order_num | ||
| 56 | - </select> | ||
| 57 | - | ||
| 58 | - <select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult"> | ||
| 59 | - <include refid="selectDeptVo"/> | ||
| 60 | - where dept_id = #{deptId} | ||
| 61 | - </select> | ||
| 62 | - | ||
| 63 | - <select id="checkDeptExistUser" parameterType="Long" resultType="int"> | ||
| 64 | - select count(1) from sys_user where dept_id = #{deptId} and del_flag = '0' | ||
| 65 | - </select> | ||
| 66 | - | ||
| 67 | - <select id="hasChildByDeptId" parameterType="Long" resultType="int"> | ||
| 68 | - select count(1) from sys_dept | ||
| 69 | - where del_flag = '0' and parent_id = #{deptId} limit 1 | ||
| 70 | - </select> | ||
| 71 | - | ||
| 72 | - <select id="selectChildrenDeptById" parameterType="Long" resultMap="SysDeptResult"> | ||
| 73 | - select * from sys_dept where find_in_set(#{deptId}, ancestors) | ||
| 74 | - </select> | ||
| 75 | - | ||
| 76 | - <select id="selectNormalChildrenDeptById" parameterType="Long" resultType="int"> | ||
| 77 | - select count(*) from sys_dept where status = 0 and del_flag = '0' and find_in_set(#{deptId}, ancestors) | ||
| 78 | - </select> | ||
| 79 | - | ||
| 80 | - <select id="checkDeptNameUnique" resultMap="SysDeptResult"> | ||
| 81 | - <include refid="selectDeptVo"/> | ||
| 82 | - where dept_name=#{deptName} and parent_id = #{parentId} limit 1 | ||
| 83 | - </select> | ||
| 84 | - | ||
| 85 | - <insert id="insertDept" parameterType="SysDept"> | ||
| 86 | - insert into sys_dept( | ||
| 87 | - <if test="deptId != null and deptId != 0">dept_id,</if> | ||
| 88 | - <if test="parentId != null and parentId != 0">parent_id,</if> | ||
| 89 | - <if test="deptName != null and deptName != ''">dept_name,</if> | ||
| 90 | - <if test="ancestors != null and ancestors != ''">ancestors,</if> | ||
| 91 | - <if test="orderNum != null and orderNum != ''">order_num,</if> | ||
| 92 | - <if test="leader != null and leader != ''">leader,</if> | ||
| 93 | - <if test="phone != null and phone != ''">phone,</if> | ||
| 94 | - <if test="email != null and email != ''">email,</if> | ||
| 95 | - <if test="status != null">status,</if> | ||
| 96 | - <if test="createBy != null and createBy != ''">create_by,</if> | ||
| 97 | - create_time | ||
| 98 | - )values( | ||
| 99 | - <if test="deptId != null and deptId != 0">#{deptId},</if> | ||
| 100 | - <if test="parentId != null and parentId != 0">#{parentId},</if> | ||
| 101 | - <if test="deptName != null and deptName != ''">#{deptName},</if> | ||
| 102 | - <if test="ancestors != null and ancestors != ''">#{ancestors},</if> | ||
| 103 | - <if test="orderNum != null and orderNum != ''">#{orderNum},</if> | ||
| 104 | - <if test="leader != null and leader != ''">#{leader},</if> | ||
| 105 | - <if test="phone != null and phone != ''">#{phone},</if> | ||
| 106 | - <if test="email != null and email != ''">#{email},</if> | ||
| 107 | - <if test="status != null">#{status},</if> | ||
| 108 | - <if test="createBy != null and createBy != ''">#{createBy},</if> | ||
| 109 | - sysdate() | ||
| 110 | - ) | ||
| 111 | - </insert> | ||
| 112 | - | ||
| 113 | - <update id="updateDept" parameterType="SysDept"> | ||
| 114 | - update sys_dept | ||
| 115 | - <set> | ||
| 116 | - <if test="parentId != null and parentId != 0">parent_id = #{parentId},</if> | ||
| 117 | - <if test="deptName != null and deptName != ''">dept_name = #{deptName},</if> | ||
| 118 | - <if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if> | ||
| 119 | - <if test="orderNum != null and orderNum != ''">order_num = #{orderNum},</if> | ||
| 120 | - <if test="leader != null">leader = #{leader},</if> | ||
| 121 | - <if test="phone != null">phone = #{phone},</if> | ||
| 122 | - <if test="email != null">email = #{email},</if> | ||
| 123 | - <if test="status != null and status != ''">status = #{status},</if> | ||
| 124 | - <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> | ||
| 125 | - update_time = sysdate() | ||
| 126 | - </set> | ||
| 127 | - where dept_id = #{deptId} | ||
| 128 | - </update> | ||
| 129 | - | ||
| 130 | - <update id="updateDeptChildren" parameterType="java.util.List"> | ||
| 131 | - update sys_dept set ancestors = | ||
| 132 | - <foreach collection="depts" item="item" index="index" | ||
| 133 | - separator=" " open="case dept_id" close="end"> | ||
| 134 | - when #{item.deptId} then #{item.ancestors} | ||
| 135 | - </foreach> | ||
| 136 | - where dept_id in | ||
| 137 | - <foreach collection="depts" item="item" index="index" | ||
| 138 | - separator="," open="(" close=")"> | ||
| 139 | - #{item.deptId} | ||
| 140 | - </foreach> | ||
| 141 | - </update> | ||
| 142 | - | ||
| 143 | - <update id="updateDeptStatus" parameterType="SysDept"> | ||
| 144 | - update sys_dept | ||
| 145 | - <set> | ||
| 146 | - <if test="status != null and status != ''">status = #{status},</if> | ||
| 147 | - <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> | ||
| 148 | - update_time = sysdate() | ||
| 149 | - </set> | ||
| 150 | - where dept_id in (${ancestors}) | ||
| 151 | - </update> | ||
| 152 | - | ||
| 153 | - <delete id="deleteDeptById" parameterType="Long"> | ||
| 154 | - update sys_dept set del_flag = '2' where dept_id = #{deptId} | ||
| 155 | - </delete> | ||
| 156 | - | ||
| 157 | -</mapper> | ||
| 158 | \ No newline at end of file | 0 | \ No newline at end of file |
ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8" ?> | ||
| 2 | -<!DOCTYPE mapper | ||
| 3 | -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 4 | -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 5 | -<mapper namespace="com.ruoyi.system.mapper.SysDictDataMapper"> | ||
| 6 | - | ||
| 7 | - <resultMap type="SysDictData" id="SysDictDataResult"> | ||
| 8 | - <id property="dictCode" column="dict_code" /> | ||
| 9 | - <result property="dictSort" column="dict_sort" /> | ||
| 10 | - <result property="dictLabel" column="dict_label" /> | ||
| 11 | - <result property="dictValue" column="dict_value" /> | ||
| 12 | - <result property="dictType" column="dict_type" /> | ||
| 13 | - <result property="cssClass" column="css_class" /> | ||
| 14 | - <result property="listClass" column="list_class" /> | ||
| 15 | - <result property="isDefault" column="is_default" /> | ||
| 16 | - <result property="status" column="status" /> | ||
| 17 | - <result property="createBy" column="create_by" /> | ||
| 18 | - <result property="createTime" column="create_time" /> | ||
| 19 | - <result property="updateBy" column="update_by" /> | ||
| 20 | - <result property="updateTime" column="update_time" /> | ||
| 21 | - </resultMap> | ||
| 22 | - | ||
| 23 | - <sql id="selectDictDataVo"> | ||
| 24 | - select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark | ||
| 25 | - from sys_dict_data | ||
| 26 | - </sql> | ||
| 27 | - | ||
| 28 | - <select id="selectDictDataList" parameterType="SysDictData" resultMap="SysDictDataResult"> | ||
| 29 | - <include refid="selectDictDataVo"/> | ||
| 30 | - <where> | ||
| 31 | - <if test="dictType != null and dictType != ''"> | ||
| 32 | - AND dict_type = #{dictType} | ||
| 33 | - </if> | ||
| 34 | - <if test="dictLabel != null and dictLabel != ''"> | ||
| 35 | - AND dict_label like concat('%', #{dictLabel}, '%') | ||
| 36 | - </if> | ||
| 37 | - <if test="status != null and status != ''"> | ||
| 38 | - AND status = #{status} | ||
| 39 | - </if> | ||
| 40 | - </where> | ||
| 41 | - order by dict_sort asc | ||
| 42 | - </select> | ||
| 43 | - | ||
| 44 | - <select id="selectDictDataByType" parameterType="SysDictData" resultMap="SysDictDataResult"> | ||
| 45 | - <include refid="selectDictDataVo"/> | ||
| 46 | - where status = '0' and dict_type = #{dictType} order by dict_sort asc | ||
| 47 | - </select> | ||
| 48 | - | ||
| 49 | - <select id="selectDictLabel" resultType="String"> | ||
| 50 | - select dict_label from sys_dict_data | ||
| 51 | - where dict_type = #{dictType} and dict_value = #{dictValue} | ||
| 52 | - </select> | ||
| 53 | - | ||
| 54 | - <select id="selectDictDataById" parameterType="Long" resultMap="SysDictDataResult"> | ||
| 55 | - <include refid="selectDictDataVo"/> | ||
| 56 | - where dict_code = #{dictCode} | ||
| 57 | - </select> | ||
| 58 | - | ||
| 59 | - <select id="countDictDataByType" resultType="Integer"> | ||
| 60 | - select count(1) from sys_dict_data where dict_type=#{dictType} | ||
| 61 | - </select> | ||
| 62 | - | ||
| 63 | - <delete id="deleteDictDataById" parameterType="Long"> | ||
| 64 | - delete from sys_dict_data where dict_code = #{dictCode} | ||
| 65 | - </delete> | ||
| 66 | - | ||
| 67 | - <delete id="deleteDictDataByIds" parameterType="Long"> | ||
| 68 | - delete from sys_dict_data where dict_code in | ||
| 69 | - <foreach collection="array" item="dictCode" open="(" separator="," close=")"> | ||
| 70 | - #{dictCode} | ||
| 71 | - </foreach> | ||
| 72 | - </delete> | ||
| 73 | - | ||
| 74 | - <update id="updateDictData" parameterType="SysDictData"> | ||
| 75 | - update sys_dict_data | ||
| 76 | - <set> | ||
| 77 | - <if test="dictSort != null">dict_sort = #{dictSort},</if> | ||
| 78 | - <if test="dictLabel != null and dictLabel != ''">dict_label = #{dictLabel},</if> | ||
| 79 | - <if test="dictValue != null and dictValue != ''">dict_value = #{dictValue},</if> | ||
| 80 | - <if test="dictType != null and dictType != ''">dict_type = #{dictType},</if> | ||
| 81 | - <if test="cssClass != null">css_class = #{cssClass},</if> | ||
| 82 | - <if test="listClass != null">list_class = #{listClass},</if> | ||
| 83 | - <if test="isDefault != null and isDefault != ''">is_default = #{isDefault},</if> | ||
| 84 | - <if test="status != null">status = #{status},</if> | ||
| 85 | - <if test="remark != null">remark = #{remark},</if> | ||
| 86 | - <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> | ||
| 87 | - update_time = sysdate() | ||
| 88 | - </set> | ||
| 89 | - where dict_code = #{dictCode} | ||
| 90 | - </update> | ||
| 91 | - | ||
| 92 | - <update id="updateDictDataType" parameterType="String"> | ||
| 93 | - update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType} | ||
| 94 | - </update> | ||
| 95 | - | ||
| 96 | - <insert id="insertDictData" parameterType="SysDictData"> | ||
| 97 | - insert into sys_dict_data( | ||
| 98 | - <if test="dictSort != null">dict_sort,</if> | ||
| 99 | - <if test="dictLabel != null and dictLabel != ''">dict_label,</if> | ||
| 100 | - <if test="dictValue != null and dictValue != ''">dict_value,</if> | ||
| 101 | - <if test="dictType != null and dictType != ''">dict_type,</if> | ||
| 102 | - <if test="cssClass != null and cssClass != ''">css_class,</if> | ||
| 103 | - <if test="listClass != null and listClass != ''">list_class,</if> | ||
| 104 | - <if test="isDefault != null and isDefault != ''">is_default,</if> | ||
| 105 | - <if test="status != null">status,</if> | ||
| 106 | - <if test="remark != null and remark != ''">remark,</if> | ||
| 107 | - <if test="createBy != null and createBy != ''">create_by,</if> | ||
| 108 | - create_time | ||
| 109 | - )values( | ||
| 110 | - <if test="dictSort != null">#{dictSort},</if> | ||
| 111 | - <if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if> | ||
| 112 | - <if test="dictValue != null and dictValue != ''">#{dictValue},</if> | ||
| 113 | - <if test="dictType != null and dictType != ''">#{dictType},</if> | ||
| 114 | - <if test="cssClass != null and cssClass != ''">#{cssClass},</if> | ||
| 115 | - <if test="listClass != null and listClass != ''">#{listClass},</if> | ||
| 116 | - <if test="isDefault != null and isDefault != ''">#{isDefault},</if> | ||
| 117 | - <if test="status != null">#{status},</if> | ||
| 118 | - <if test="remark != null and remark != ''">#{remark},</if> | ||
| 119 | - <if test="createBy != null and createBy != ''">#{createBy},</if> | ||
| 120 | - sysdate() | ||
| 121 | - ) | ||
| 122 | - </insert> | ||
| 123 | - | ||
| 124 | -</mapper> | ||
| 125 | \ No newline at end of file | 0 | \ No newline at end of file |
ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8" ?> | ||
| 2 | -<!DOCTYPE mapper | ||
| 3 | -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 4 | -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 5 | -<mapper namespace="com.ruoyi.system.mapper.SysDictTypeMapper"> | ||
| 6 | - | ||
| 7 | - <resultMap type="SysDictType" id="SysDictTypeResult"> | ||
| 8 | - <id property="dictId" column="dict_id" /> | ||
| 9 | - <result property="dictName" column="dict_name" /> | ||
| 10 | - <result property="dictType" column="dict_type" /> | ||
| 11 | - <result property="status" column="status" /> | ||
| 12 | - <result property="createBy" column="create_by" /> | ||
| 13 | - <result property="createTime" column="create_time" /> | ||
| 14 | - <result property="updateBy" column="update_by" /> | ||
| 15 | - <result property="updateTime" column="update_time" /> | ||
| 16 | - </resultMap> | ||
| 17 | - | ||
| 18 | - <sql id="selectDictTypeVo"> | ||
| 19 | - select dict_id, dict_name, dict_type, status, create_by, create_time, remark | ||
| 20 | - from sys_dict_type | ||
| 21 | - </sql> | ||
| 22 | - | ||
| 23 | - <select id="selectDictTypeList" parameterType="SysDictType" resultMap="SysDictTypeResult"> | ||
| 24 | - <include refid="selectDictTypeVo"/> | ||
| 25 | - <where> | ||
| 26 | - <if test="dictName != null and dictName != ''"> | ||
| 27 | - AND dict_name like concat('%', #{dictName}, '%') | ||
| 28 | - </if> | ||
| 29 | - <if test="status != null and status != ''"> | ||
| 30 | - AND status = #{status} | ||
| 31 | - </if> | ||
| 32 | - <if test="dictType != null and dictType != ''"> | ||
| 33 | - AND dict_type like concat('%', #{dictType}, '%') | ||
| 34 | - </if> | ||
| 35 | - <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> | ||
| 36 | - and date_format(create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') | ||
| 37 | - </if> | ||
| 38 | - <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> | ||
| 39 | - and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') | ||
| 40 | - </if> | ||
| 41 | - </where> | ||
| 42 | - </select> | ||
| 43 | - | ||
| 44 | - <select id="selectDictTypeAll" resultMap="SysDictTypeResult"> | ||
| 45 | - <include refid="selectDictTypeVo"/> | ||
| 46 | - </select> | ||
| 47 | - | ||
| 48 | - <select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult"> | ||
| 49 | - <include refid="selectDictTypeVo"/> | ||
| 50 | - where dict_id = #{dictId} | ||
| 51 | - </select> | ||
| 52 | - | ||
| 53 | - <select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult"> | ||
| 54 | - <include refid="selectDictTypeVo"/> | ||
| 55 | - where dict_type = #{dictType} | ||
| 56 | - </select> | ||
| 57 | - | ||
| 58 | - <select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult"> | ||
| 59 | - <include refid="selectDictTypeVo"/> | ||
| 60 | - where dict_type = #{dictType} limit 1 | ||
| 61 | - </select> | ||
| 62 | - | ||
| 63 | - <delete id="deleteDictTypeById" parameterType="Long"> | ||
| 64 | - delete from sys_dict_type where dict_id = #{dictId} | ||
| 65 | - </delete> | ||
| 66 | - | ||
| 67 | - <delete id="deleteDictTypeByIds" parameterType="Long"> | ||
| 68 | - delete from sys_dict_type where dict_id in | ||
| 69 | - <foreach collection="array" item="dictId" open="(" separator="," close=")"> | ||
| 70 | - #{dictId} | ||
| 71 | - </foreach> | ||
| 72 | - </delete> | ||
| 73 | - | ||
| 74 | - <update id="updateDictType" parameterType="SysDictType"> | ||
| 75 | - update sys_dict_type | ||
| 76 | - <set> | ||
| 77 | - <if test="dictName != null and dictName != ''">dict_name = #{dictName},</if> | ||
| 78 | - <if test="dictType != null and dictType != ''">dict_type = #{dictType},</if> | ||
| 79 | - <if test="status != null">status = #{status},</if> | ||
| 80 | - <if test="remark != null">remark = #{remark},</if> | ||
| 81 | - <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> | ||
| 82 | - update_time = sysdate() | ||
| 83 | - </set> | ||
| 84 | - where dict_id = #{dictId} | ||
| 85 | - </update> | ||
| 86 | - | ||
| 87 | - <insert id="insertDictType" parameterType="SysDictType"> | ||
| 88 | - insert into sys_dict_type( | ||
| 89 | - <if test="dictName != null and dictName != ''">dict_name,</if> | ||
| 90 | - <if test="dictType != null and dictType != ''">dict_type,</if> | ||
| 91 | - <if test="status != null">status,</if> | ||
| 92 | - <if test="remark != null and remark != ''">remark,</if> | ||
| 93 | - <if test="createBy != null and createBy != ''">create_by,</if> | ||
| 94 | - create_time | ||
| 95 | - )values( | ||
| 96 | - <if test="dictName != null and dictName != ''">#{dictName},</if> | ||
| 97 | - <if test="dictType != null and dictType != ''">#{dictType},</if> | ||
| 98 | - <if test="status != null">#{status},</if> | ||
| 99 | - <if test="remark != null and remark != ''">#{remark},</if> | ||
| 100 | - <if test="createBy != null and createBy != ''">#{createBy},</if> | ||
| 101 | - sysdate() | ||
| 102 | - ) | ||
| 103 | - </insert> | ||
| 104 | - | ||
| 105 | -</mapper> | ||
| 106 | \ No newline at end of file | 0 | \ No newline at end of file |
ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8" ?> | ||
| 2 | -<!DOCTYPE mapper | ||
| 3 | - PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 4 | - "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 5 | -<mapper namespace="com.ruoyi.system.mapper.SysMenuMapper"> | ||
| 6 | - | ||
| 7 | - <select id="selectMenuTreeAll" resultMap="SysMenuResult"> | ||
| 8 | - select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, 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 | ||
| 9 | - from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0 | ||
| 10 | - order by m.parent_id, m.order_num | ||
| 11 | - </select> | ||
| 12 | - | ||
| 13 | - <select id="selectMenuListByUserId" parameterType="SysMenu" resultMap="SysMenuResult"> | ||
| 14 | - select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, 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 | ||
| 15 | - from sys_menu m | ||
| 16 | - left join sys_role_menu rm on m.menu_id = rm.menu_id | ||
| 17 | - left join sys_user_role ur on rm.role_id = ur.role_id | ||
| 18 | - left join sys_role ro on ur.role_id = ro.role_id | ||
| 19 | - where ur.user_id = #{params.userId} | ||
| 20 | - <if test="menuName != null and menuName != ''"> | ||
| 21 | - AND menu_name like concat('%', #{menuName}, '%') | ||
| 22 | - </if> | ||
| 23 | - <if test="visible != null and visible != ''"> | ||
| 24 | - AND visible = #{visible} | ||
| 25 | - </if> | ||
| 26 | - <if test="status != null and status != ''"> | ||
| 27 | - AND status = #{status} | ||
| 28 | - </if> | ||
| 29 | - order by m.parent_id, m.order_num | ||
| 30 | - </select> | ||
| 31 | - | ||
| 32 | - <select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult"> | ||
| 33 | - select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, 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 | ||
| 34 | - from sys_menu m | ||
| 35 | - left join sys_role_menu rm on m.menu_id = rm.menu_id | ||
| 36 | - left join sys_user_role ur on rm.role_id = ur.role_id | ||
| 37 | - left join sys_role ro on ur.role_id = ro.role_id | ||
| 38 | - left join sys_user u on ur.user_id = u.user_id | ||
| 39 | - where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0 | ||
| 40 | - order by m.parent_id, m.order_num | ||
| 41 | - </select> | ||
| 42 | - | ||
| 43 | - <select id="selectMenuListByRoleId" resultType="Integer"> | ||
| 44 | - select m.menu_id | ||
| 45 | - from sys_menu m | ||
| 46 | - left join sys_role_menu rm on m.menu_id = rm.menu_id | ||
| 47 | - where rm.role_id = #{roleId} | ||
| 48 | - <if test="menuCheckStrictly"> | ||
| 49 | - and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id = rm.menu_id and rm.role_id = #{roleId}) | ||
| 50 | - </if> | ||
| 51 | - order by m.parent_id, m.order_num | ||
| 52 | - </select> | ||
| 53 | - | ||
| 54 | - <select id="selectMenuPermsByUserId" parameterType="Long" resultType="String"> | ||
| 55 | - select distinct m.perms | ||
| 56 | - from sys_menu m | ||
| 57 | - left join sys_role_menu rm on m.menu_id = rm.menu_id | ||
| 58 | - left join sys_user_role ur on rm.role_id = ur.role_id | ||
| 59 | - left join sys_role r on r.role_id = ur.role_id | ||
| 60 | - where m.status = '0' and r.status = '0' and ur.user_id = #{userId} | ||
| 61 | - </select> | ||
| 62 | - | ||
| 63 | -</mapper> |
ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8" ?> | ||
| 2 | -<!DOCTYPE mapper | ||
| 3 | -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 4 | -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 5 | -<mapper namespace="com.ruoyi.system.mapper.SysPostMapper"> | ||
| 6 | - | ||
| 7 | - <resultMap type="SysPost" id="SysPostResult"> | ||
| 8 | - <id property="postId" column="post_id" /> | ||
| 9 | - <result property="postCode" column="post_code" /> | ||
| 10 | - <result property="postName" column="post_name" /> | ||
| 11 | - <result property="postSort" column="post_sort" /> | ||
| 12 | - <result property="status" column="status" /> | ||
| 13 | - <result property="createBy" column="create_by" /> | ||
| 14 | - <result property="createTime" column="create_time" /> | ||
| 15 | - <result property="updateBy" column="update_by" /> | ||
| 16 | - <result property="updateTime" column="update_time" /> | ||
| 17 | - <result property="remark" column="remark" /> | ||
| 18 | - </resultMap> | ||
| 19 | - | ||
| 20 | - <sql id="selectPostVo"> | ||
| 21 | - select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark | ||
| 22 | - from sys_post | ||
| 23 | - </sql> | ||
| 24 | - | ||
| 25 | - <select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult"> | ||
| 26 | - <include refid="selectPostVo"/> | ||
| 27 | - <where> | ||
| 28 | - <if test="postCode != null and postCode != ''"> | ||
| 29 | - AND post_code like concat('%', #{postCode}, '%') | ||
| 30 | - </if> | ||
| 31 | - <if test="status != null and status != ''"> | ||
| 32 | - AND status = #{status} | ||
| 33 | - </if> | ||
| 34 | - <if test="postName != null and postName != ''"> | ||
| 35 | - AND post_name like concat('%', #{postName}, '%') | ||
| 36 | - </if> | ||
| 37 | - </where> | ||
| 38 | - </select> | ||
| 39 | - | ||
| 40 | - <select id="selectPostAll" resultMap="SysPostResult"> | ||
| 41 | - <include refid="selectPostVo"/> | ||
| 42 | - </select> | ||
| 43 | - | ||
| 44 | - <select id="selectPostById" parameterType="Long" resultMap="SysPostResult"> | ||
| 45 | - <include refid="selectPostVo"/> | ||
| 46 | - where post_id = #{postId} | ||
| 47 | - </select> | ||
| 48 | - | ||
| 49 | - <select id="selectPostListByUserId" parameterType="Long" resultType="Integer"> | ||
| 50 | - select p.post_id | ||
| 51 | - from sys_post p | ||
| 52 | - left join sys_user_post up on up.post_id = p.post_id | ||
| 53 | - left join sys_user u on u.user_id = up.user_id | ||
| 54 | - where u.user_id = #{userId} | ||
| 55 | - </select> | ||
| 56 | - | ||
| 57 | - <select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult"> | ||
| 58 | - select p.post_id, p.post_name, p.post_code | ||
| 59 | - from sys_post p | ||
| 60 | - left join sys_user_post up on up.post_id = p.post_id | ||
| 61 | - left join sys_user u on u.user_id = up.user_id | ||
| 62 | - where u.user_name = #{userName} | ||
| 63 | - </select> | ||
| 64 | - | ||
| 65 | - <select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult"> | ||
| 66 | - <include refid="selectPostVo"/> | ||
| 67 | - where post_name=#{postName} limit 1 | ||
| 68 | - </select> | ||
| 69 | - | ||
| 70 | - <select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult"> | ||
| 71 | - <include refid="selectPostVo"/> | ||
| 72 | - where post_code=#{postCode} limit 1 | ||
| 73 | - </select> | ||
| 74 | - | ||
| 75 | - <update id="updatePost" parameterType="SysPost"> | ||
| 76 | - update sys_post | ||
| 77 | - <set> | ||
| 78 | - <if test="postCode != null and postCode != ''">post_code = #{postCode},</if> | ||
| 79 | - <if test="postName != null and postName != ''">post_name = #{postName},</if> | ||
| 80 | - <if test="postSort != null and postSort != ''">post_sort = #{postSort},</if> | ||
| 81 | - <if test="status != null and status != ''">status = #{status},</if> | ||
| 82 | - <if test="remark != null">remark = #{remark},</if> | ||
| 83 | - <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> | ||
| 84 | - update_time = sysdate() | ||
| 85 | - </set> | ||
| 86 | - where post_id = #{postId} | ||
| 87 | - </update> | ||
| 88 | - | ||
| 89 | - <insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId"> | ||
| 90 | - insert into sys_post( | ||
| 91 | - <if test="postId != null and postId != 0">post_id,</if> | ||
| 92 | - <if test="postCode != null and postCode != ''">post_code,</if> | ||
| 93 | - <if test="postName != null and postName != ''">post_name,</if> | ||
| 94 | - <if test="postSort != null and postSort != ''">post_sort,</if> | ||
| 95 | - <if test="status != null and status != ''">status,</if> | ||
| 96 | - <if test="remark != null and remark != ''">remark,</if> | ||
| 97 | - <if test="createBy != null and createBy != ''">create_by,</if> | ||
| 98 | - create_time | ||
| 99 | - )values( | ||
| 100 | - <if test="postId != null and postId != 0">#{postId},</if> | ||
| 101 | - <if test="postCode != null and postCode != ''">#{postCode},</if> | ||
| 102 | - <if test="postName != null and postName != ''">#{postName},</if> | ||
| 103 | - <if test="postSort != null and postSort != ''">#{postSort},</if> | ||
| 104 | - <if test="status != null and status != ''">#{status},</if> | ||
| 105 | - <if test="remark != null and remark != ''">#{remark},</if> | ||
| 106 | - <if test="createBy != null and createBy != ''">#{createBy},</if> | ||
| 107 | - sysdate() | ||
| 108 | - ) | ||
| 109 | - </insert> | ||
| 110 | - | ||
| 111 | - <delete id="deletePostById" parameterType="Long"> | ||
| 112 | - delete from sys_post where post_id = #{postId} | ||
| 113 | - </delete> | ||
| 114 | - | ||
| 115 | - <delete id="deletePostByIds" parameterType="Long"> | ||
| 116 | - delete from sys_post where post_id in | ||
| 117 | - <foreach collection="array" item="postId" open="(" separator="," close=")"> | ||
| 118 | - #{postId} | ||
| 119 | - </foreach> | ||
| 120 | - </delete> | ||
| 121 | - | ||
| 122 | -</mapper> | ||
| 123 | \ No newline at end of file | 0 | \ No newline at end of file |
ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8" ?> | ||
| 2 | -<!DOCTYPE mapper | ||
| 3 | -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 4 | -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 5 | -<mapper namespace="com.ruoyi.system.mapper.SysRoleDeptMapper"> | ||
| 6 | - | ||
| 7 | - <resultMap type="SysRoleDept" id="SysRoleDeptResult"> | ||
| 8 | - <result property="roleId" column="role_id" /> | ||
| 9 | - <result property="deptId" column="dept_id" /> | ||
| 10 | - </resultMap> | ||
| 11 | - | ||
| 12 | - <delete id="deleteRoleDeptByRoleId" parameterType="Long"> | ||
| 13 | - delete from sys_role_dept where role_id=#{roleId} | ||
| 14 | - </delete> | ||
| 15 | - | ||
| 16 | - <select id="selectCountRoleDeptByDeptId" resultType="Integer"> | ||
| 17 | - select count(1) from sys_role_dept where dept_id=#{deptId} | ||
| 18 | - </select> | ||
| 19 | - | ||
| 20 | - <delete id="deleteRoleDept" parameterType="Long"> | ||
| 21 | - delete from sys_role_dept where role_id in | ||
| 22 | - <foreach collection="array" item="roleId" open="(" separator="," close=")"> | ||
| 23 | - #{roleId} | ||
| 24 | - </foreach> | ||
| 25 | - </delete> | ||
| 26 | - | ||
| 27 | - <insert id="batchRoleDept"> | ||
| 28 | - insert into sys_role_dept(role_id, dept_id) values | ||
| 29 | - <foreach item="item" index="index" collection="list" separator=","> | ||
| 30 | - (#{item.roleId},#{item.deptId}) | ||
| 31 | - </foreach> | ||
| 32 | - </insert> | ||
| 33 | - | ||
| 34 | -</mapper> | ||
| 35 | \ No newline at end of file | 0 | \ No newline at end of file |
ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8" ?> | ||
| 2 | -<!DOCTYPE mapper | ||
| 3 | -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 4 | -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 5 | -<mapper namespace="com.ruoyi.system.mapper.SysRoleMapper"> | ||
| 6 | - | ||
| 7 | - <resultMap type="SysRole" id="SysRoleResult"> | ||
| 8 | - <id property="roleId" column="role_id" /> | ||
| 9 | - <result property="roleName" column="role_name" /> | ||
| 10 | - <result property="roleKey" column="role_key" /> | ||
| 11 | - <result property="roleSort" column="role_sort" /> | ||
| 12 | - <result property="dataScope" column="data_scope" /> | ||
| 13 | - <result property="menuCheckStrictly" column="menu_check_strictly" /> | ||
| 14 | - <result property="deptCheckStrictly" column="dept_check_strictly" /> | ||
| 15 | - <result property="status" column="status" /> | ||
| 16 | - <result property="delFlag" column="del_flag" /> | ||
| 17 | - <result property="createBy" column="create_by" /> | ||
| 18 | - <result property="createTime" column="create_time" /> | ||
| 19 | - <result property="updateBy" column="update_by" /> | ||
| 20 | - <result property="updateTime" column="update_time" /> | ||
| 21 | - <result property="remark" column="remark" /> | ||
| 22 | - </resultMap> | ||
| 23 | - | ||
| 24 | - <sql id="selectRoleVo"> | ||
| 25 | - select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly, | ||
| 26 | - r.status, r.del_flag, r.create_time, r.remark | ||
| 27 | - from sys_role r | ||
| 28 | - left join sys_user_role ur on ur.role_id = r.role_id | ||
| 29 | - left join sys_user u on u.user_id = ur.user_id | ||
| 30 | - left join sys_dept d on u.dept_id = d.dept_id | ||
| 31 | - </sql> | ||
| 32 | - | ||
| 33 | - <select id="selectRoleList" parameterType="SysRole" resultMap="SysRoleResult"> | ||
| 34 | - <include refid="selectRoleVo"/> | ||
| 35 | - where r.del_flag = '0' | ||
| 36 | - <if test="roleName != null and roleName != ''"> | ||
| 37 | - AND r.role_name like concat('%', #{roleName}, '%') | ||
| 38 | - </if> | ||
| 39 | - <if test="status != null and status != ''"> | ||
| 40 | - AND r.status = #{status} | ||
| 41 | - </if> | ||
| 42 | - <if test="roleKey != null and roleKey != ''"> | ||
| 43 | - AND r.role_key like concat('%', #{roleKey}, '%') | ||
| 44 | - </if> | ||
| 45 | - <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> | ||
| 46 | - and date_format(r.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') | ||
| 47 | - </if> | ||
| 48 | - <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> | ||
| 49 | - and date_format(r.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') | ||
| 50 | - </if> | ||
| 51 | - <!-- 数据范围过滤 --> | ||
| 52 | - ${params.dataScope} | ||
| 53 | - order by r.role_sort | ||
| 54 | - </select> | ||
| 55 | - | ||
| 56 | - <select id="selectRolePermissionByUserId" parameterType="Long" resultMap="SysRoleResult"> | ||
| 57 | - <include refid="selectRoleVo"/> | ||
| 58 | - WHERE r.del_flag = '0' and ur.user_id = #{userId} | ||
| 59 | - </select> | ||
| 60 | - | ||
| 61 | - <select id="selectRoleAll" resultMap="SysRoleResult"> | ||
| 62 | - <include refid="selectRoleVo"/> | ||
| 63 | - </select> | ||
| 64 | - | ||
| 65 | - <select id="selectRoleListByUserId" parameterType="Long" resultType="Integer"> | ||
| 66 | - select r.role_id | ||
| 67 | - from sys_role r | ||
| 68 | - left join sys_user_role ur on ur.role_id = r.role_id | ||
| 69 | - left join sys_user u on u.user_id = ur.user_id | ||
| 70 | - where u.user_id = #{userId} | ||
| 71 | - </select> | ||
| 72 | - | ||
| 73 | - <select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult"> | ||
| 74 | - <include refid="selectRoleVo"/> | ||
| 75 | - where r.role_id = #{roleId} | ||
| 76 | - </select> | ||
| 77 | - | ||
| 78 | - <select id="selectRolesByUserName" parameterType="String" resultMap="SysRoleResult"> | ||
| 79 | - <include refid="selectRoleVo"/> | ||
| 80 | - WHERE r.del_flag = '0' and u.user_name = #{userName} | ||
| 81 | - </select> | ||
| 82 | - | ||
| 83 | - <select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult"> | ||
| 84 | - <include refid="selectRoleVo"/> | ||
| 85 | - where r.role_name=#{roleName} limit 1 | ||
| 86 | - </select> | ||
| 87 | - | ||
| 88 | - <select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult"> | ||
| 89 | - <include refid="selectRoleVo"/> | ||
| 90 | - where r.role_key=#{roleKey} limit 1 | ||
| 91 | - </select> | ||
| 92 | - | ||
| 93 | - <insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId"> | ||
| 94 | - insert into sys_role( | ||
| 95 | - <if test="roleId != null and roleId != 0">role_id,</if> | ||
| 96 | - <if test="roleName != null and roleName != ''">role_name,</if> | ||
| 97 | - <if test="roleKey != null and roleKey != ''">role_key,</if> | ||
| 98 | - <if test="roleSort != null and roleSort != ''">role_sort,</if> | ||
| 99 | - <if test="dataScope != null and dataScope != ''">data_scope,</if> | ||
| 100 | - <if test="menuCheckStrictly != null">menu_check_strictly,</if> | ||
| 101 | - <if test="deptCheckStrictly != null">dept_check_strictly,</if> | ||
| 102 | - <if test="status != null and status != ''">status,</if> | ||
| 103 | - <if test="remark != null and remark != ''">remark,</if> | ||
| 104 | - <if test="createBy != null and createBy != ''">create_by,</if> | ||
| 105 | - create_time | ||
| 106 | - )values( | ||
| 107 | - <if test="roleId != null and roleId != 0">#{roleId},</if> | ||
| 108 | - <if test="roleName != null and roleName != ''">#{roleName},</if> | ||
| 109 | - <if test="roleKey != null and roleKey != ''">#{roleKey},</if> | ||
| 110 | - <if test="roleSort != null and roleSort != ''">#{roleSort},</if> | ||
| 111 | - <if test="dataScope != null and dataScope != ''">#{dataScope},</if> | ||
| 112 | - <if test="menuCheckStrictly != null">#{menuCheckStrictly},</if> | ||
| 113 | - <if test="deptCheckStrictly != null">#{deptCheckStrictly},</if> | ||
| 114 | - <if test="status != null and status != ''">#{status},</if> | ||
| 115 | - <if test="remark != null and remark != ''">#{remark},</if> | ||
| 116 | - <if test="createBy != null and createBy != ''">#{createBy},</if> | ||
| 117 | - sysdate() | ||
| 118 | - ) | ||
| 119 | - </insert> | ||
| 120 | - | ||
| 121 | - <update id="updateRole" parameterType="SysRole"> | ||
| 122 | - update sys_role | ||
| 123 | - <set> | ||
| 124 | - <if test="roleName != null and roleName != ''">role_name = #{roleName},</if> | ||
| 125 | - <if test="roleKey != null and roleKey != ''">role_key = #{roleKey},</if> | ||
| 126 | - <if test="roleSort != null and roleSort != ''">role_sort = #{roleSort},</if> | ||
| 127 | - <if test="dataScope != null and dataScope != ''">data_scope = #{dataScope},</if> | ||
| 128 | - <if test="menuCheckStrictly != null">menu_check_strictly = #{menuCheckStrictly},</if> | ||
| 129 | - <if test="deptCheckStrictly != null">dept_check_strictly = #{deptCheckStrictly},</if> | ||
| 130 | - <if test="status != null and status != ''">status = #{status},</if> | ||
| 131 | - <if test="remark != null">remark = #{remark},</if> | ||
| 132 | - <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> | ||
| 133 | - update_time = sysdate() | ||
| 134 | - </set> | ||
| 135 | - where role_id = #{roleId} | ||
| 136 | - </update> | ||
| 137 | - | ||
| 138 | - <update id="updateRoleStatus" parameterType="SysRole"> | ||
| 139 | - update sys_user set status = #{status} where user_id = #{userId} | ||
| 140 | - </update> | ||
| 141 | - | ||
| 142 | - <delete id="deleteRoleById" parameterType="Long"> | ||
| 143 | - delete from sys_role where role_id = #{roleId} | ||
| 144 | - </delete> | ||
| 145 | - | ||
| 146 | - <delete id="deleteRoleByIds" parameterType="Long"> | ||
| 147 | - update sys_role set del_flag = '2' where role_id in | ||
| 148 | - <foreach collection="array" item="roleId" open="(" separator="," close=")"> | ||
| 149 | - #{roleId} | ||
| 150 | - </foreach> | ||
| 151 | - </delete> | ||
| 152 | - | ||
| 153 | -</mapper> | ||
| 154 | \ No newline at end of file | 0 | \ No newline at end of file |
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8" ?> | ||
| 2 | -<!DOCTYPE mapper | ||
| 3 | -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 4 | -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 5 | -<mapper namespace="com.ruoyi.system.mapper.SysUserMapper"> | ||
| 6 | - | ||
| 7 | - <resultMap type="SysUser" id="SysUserResult"> | ||
| 8 | - <id property="userId" column="user_id" /> | ||
| 9 | - <result property="deptId" column="dept_id" /> | ||
| 10 | - <result property="userName" column="user_name" /> | ||
| 11 | - <result property="nickName" column="nick_name" /> | ||
| 12 | - <result property="email" column="email" /> | ||
| 13 | - <result property="phonenumber" column="phonenumber" /> | ||
| 14 | - <result property="sex" column="sex" /> | ||
| 15 | - <result property="avatar" column="avatar" /> | ||
| 16 | - <result property="password" column="password" /> | ||
| 17 | - <result property="status" column="status" /> | ||
| 18 | - <result property="delFlag" column="del_flag" /> | ||
| 19 | - <result property="loginIp" column="login_ip" /> | ||
| 20 | - <result property="loginDate" column="login_date" /> | ||
| 21 | - <result property="createBy" column="create_by" /> | ||
| 22 | - <result property="createTime" column="create_time" /> | ||
| 23 | - <result property="updateBy" column="update_by" /> | ||
| 24 | - <result property="updateTime" column="update_time" /> | ||
| 25 | - <result property="remark" column="remark" /> | ||
| 26 | - <association property="dept" column="dept_id" javaType="SysDept" resultMap="deptResult" /> | ||
| 27 | - <collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> | ||
| 28 | - </resultMap> | ||
| 29 | - | ||
| 30 | - <resultMap id="deptResult" type="SysDept"> | ||
| 31 | - <id property="deptId" column="dept_id" /> | ||
| 32 | - <result property="parentId" column="parent_id" /> | ||
| 33 | - <result property="deptName" column="dept_name" /> | ||
| 34 | - <result property="orderNum" column="order_num" /> | ||
| 35 | - <result property="leader" column="leader" /> | ||
| 36 | - <result property="status" column="dept_status" /> | ||
| 37 | - </resultMap> | ||
| 38 | - | ||
| 39 | - <resultMap id="RoleResult" type="SysRole"> | ||
| 40 | - <id property="roleId" column="role_id" /> | ||
| 41 | - <result property="roleName" column="role_name" /> | ||
| 42 | - <result property="roleKey" column="role_key" /> | ||
| 43 | - <result property="roleSort" column="role_sort" /> | ||
| 44 | - <result property="dataScope" column="data_scope" /> | ||
| 45 | - <result property="status" column="role_status" /> | ||
| 46 | - </resultMap> | ||
| 47 | - | ||
| 48 | - <sql id="selectUserVo"> | ||
| 49 | - select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, | ||
| 50 | - d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status, | ||
| 51 | - r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status | ||
| 52 | - from sys_user u | ||
| 53 | - left join sys_dept d on u.dept_id = d.dept_id | ||
| 54 | - left join sys_user_role ur on u.user_id = ur.user_id | ||
| 55 | - left join sys_role r on r.role_id = ur.role_id | ||
| 56 | - </sql> | ||
| 57 | - | ||
| 58 | - <select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult"> | ||
| 59 | - select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u | ||
| 60 | - left join sys_dept d on u.dept_id = d.dept_id | ||
| 61 | - where u.del_flag = '0' | ||
| 62 | - <if test="userName != null and userName != ''"> | ||
| 63 | - AND u.user_name like concat('%', #{userName}, '%') | ||
| 64 | - </if> | ||
| 65 | - <if test="status != null and status != ''"> | ||
| 66 | - AND u.status = #{status} | ||
| 67 | - </if> | ||
| 68 | - <if test="phonenumber != null and phonenumber != ''"> | ||
| 69 | - AND u.phonenumber like concat('%', #{phonenumber}, '%') | ||
| 70 | - </if> | ||
| 71 | - <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 --> | ||
| 72 | - AND date_format(u.create_time,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d') | ||
| 73 | - </if> | ||
| 74 | - <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 --> | ||
| 75 | - AND date_format(u.create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d') | ||
| 76 | - </if> | ||
| 77 | - <if test="deptId != null and deptId != 0"> | ||
| 78 | - AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors) )) | ||
| 79 | - </if> | ||
| 80 | - <!-- 数据范围过滤 --> | ||
| 81 | - ${params.dataScope} | ||
| 82 | - </select> | ||
| 83 | - | ||
| 84 | - <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult"> | ||
| 85 | - <include refid="selectUserVo"/> | ||
| 86 | - where u.user_name = #{userName} | ||
| 87 | - </select> | ||
| 88 | - | ||
| 89 | - <select id="selectUserById" parameterType="Long" resultMap="SysUserResult"> | ||
| 90 | - <include refid="selectUserVo"/> | ||
| 91 | - where u.user_id = #{userId} | ||
| 92 | - </select> | ||
| 93 | - | ||
| 94 | - <select id="checkUserNameUnique" parameterType="String" resultType="int"> | ||
| 95 | - select count(1) from sys_user where user_name = #{userName} limit 1 | ||
| 96 | - </select> | ||
| 97 | - | ||
| 98 | - <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult"> | ||
| 99 | - select user_id, phonenumber from sys_user where phonenumber = #{phonenumber} limit 1 | ||
| 100 | - </select> | ||
| 101 | - | ||
| 102 | - <select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult"> | ||
| 103 | - select user_id, email from sys_user where email = #{email} limit 1 | ||
| 104 | - </select> | ||
| 105 | - | ||
| 106 | - <insert id="insertUser" parameterType="SysUser" useGeneratedKeys="true" keyProperty="userId"> | ||
| 107 | - insert into sys_user( | ||
| 108 | - <if test="userId != null and userId != 0">user_id,</if> | ||
| 109 | - <if test="deptId != null and deptId != 0">dept_id,</if> | ||
| 110 | - <if test="userName != null and userName != ''">user_name,</if> | ||
| 111 | - <if test="nickName != null and nickName != ''">nick_name,</if> | ||
| 112 | - <if test="email != null and email != ''">email,</if> | ||
| 113 | - <if test="avatar != null and avatar != ''">avatar,</if> | ||
| 114 | - <if test="phonenumber != null and phonenumber != ''">phonenumber,</if> | ||
| 115 | - <if test="sex != null and sex != ''">sex,</if> | ||
| 116 | - <if test="password != null and password != ''">password,</if> | ||
| 117 | - <if test="status != null and status != ''">status,</if> | ||
| 118 | - <if test="createBy != null and createBy != ''">create_by,</if> | ||
| 119 | - <if test="remark != null and remark != ''">remark,</if> | ||
| 120 | - create_time | ||
| 121 | - )values( | ||
| 122 | - <if test="userId != null and userId != ''">#{userId},</if> | ||
| 123 | - <if test="deptId != null and deptId != ''">#{deptId},</if> | ||
| 124 | - <if test="userName != null and userName != ''">#{userName},</if> | ||
| 125 | - <if test="nickName != null and nickName != ''">#{nickName},</if> | ||
| 126 | - <if test="email != null and email != ''">#{email},</if> | ||
| 127 | - <if test="avatar != null and avatar != ''">#{avatar},</if> | ||
| 128 | - <if test="phonenumber != null and phonenumber != ''">#{phonenumber},</if> | ||
| 129 | - <if test="sex != null and sex != ''">#{sex},</if> | ||
| 130 | - <if test="password != null and password != ''">#{password},</if> | ||
| 131 | - <if test="status != null and status != ''">#{status},</if> | ||
| 132 | - <if test="createBy != null and createBy != ''">#{createBy},</if> | ||
| 133 | - <if test="remark != null and remark != ''">#{remark},</if> | ||
| 134 | - sysdate() | ||
| 135 | - ) | ||
| 136 | - </insert> | ||
| 137 | - | ||
| 138 | - <update id="updateUser" parameterType="SysUser"> | ||
| 139 | - update sys_user | ||
| 140 | - <set> | ||
| 141 | - <if test="deptId != null and deptId != 0">dept_id = #{deptId},</if> | ||
| 142 | - <if test="userName != null and userName != ''">user_name = #{userName},</if> | ||
| 143 | - <if test="nickName != null and nickName != ''">nick_name = #{nickName},</if> | ||
| 144 | - <if test="email != null ">email = #{email},</if> | ||
| 145 | - <if test="phonenumber != null ">phonenumber = #{phonenumber},</if> | ||
| 146 | - <if test="sex != null and sex != ''">sex = #{sex},</if> | ||
| 147 | - <if test="avatar != null and avatar != ''">avatar = #{avatar},</if> | ||
| 148 | - <if test="password != null and password != ''">password = #{password},</if> | ||
| 149 | - <if test="status != null and status != ''">status = #{status},</if> | ||
| 150 | - <if test="loginIp != null and loginIp != ''">login_ip = #{loginIp},</if> | ||
| 151 | - <if test="loginDate != null">login_date = #{loginDate},</if> | ||
| 152 | - <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> | ||
| 153 | - <if test="remark != null">remark = #{remark},</if> | ||
| 154 | - update_time = sysdate() | ||
| 155 | - </set> | ||
| 156 | - where user_id = #{userId} | ||
| 157 | - </update> | ||
| 158 | - | ||
| 159 | - <update id="updateUserStatus" parameterType="SysUser"> | ||
| 160 | - update sys_user set status = #{status} where user_id = #{userId} | ||
| 161 | - </update> | ||
| 162 | - | ||
| 163 | - <update id="updateUserAvatar" parameterType="SysUser"> | ||
| 164 | - update sys_user set avatar = #{avatar} where user_name = #{userName} | ||
| 165 | - </update> | ||
| 166 | - | ||
| 167 | - <update id="resetUserPwd" parameterType="SysUser"> | ||
| 168 | - update sys_user set password = #{password} where user_name = #{userName} | ||
| 169 | - </update> | ||
| 170 | - | ||
| 171 | - <delete id="deleteUserById" parameterType="Long"> | ||
| 172 | - delete from sys_user where user_id = #{userId} | ||
| 173 | - </delete> | ||
| 174 | - | ||
| 175 | - <delete id="deleteUserByIds" parameterType="Long"> | ||
| 176 | - update sys_user set del_flag = '2' where user_id in | ||
| 177 | - <foreach collection="array" item="userId" open="(" separator="," close=")"> | ||
| 178 | - #{userId} | ||
| 179 | - </foreach> | ||
| 180 | - </delete> | ||
| 181 | - | ||
| 182 | -</mapper> | ||
| 183 | \ No newline at end of file | 0 | \ No newline at end of file |
ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8" ?> | ||
| 2 | -<!DOCTYPE mapper | ||
| 3 | -PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | ||
| 4 | -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | ||
| 5 | -<mapper namespace="com.ruoyi.system.mapper.SysUserPostMapper"> | ||
| 6 | - | ||
| 7 | - <resultMap type="SysUserPost" id="SysUserPostResult"> | ||
| 8 | - <result property="userId" column="user_id" /> | ||
| 9 | - <result property="postId" column="post_id" /> | ||
| 10 | - </resultMap> | ||
| 11 | - | ||
| 12 | - <delete id="deleteUserPostByUserId" parameterType="Long"> | ||
| 13 | - delete from sys_user_post where user_id=#{userId} | ||
| 14 | - </delete> | ||
| 15 | - | ||
| 16 | - <select id="countUserPostById" resultType="Integer"> | ||
| 17 | - select count(1) from sys_user_post where post_id=#{postId} | ||
| 18 | - </select> | ||
| 19 | - | ||
| 20 | - <delete id="deleteUserPost" parameterType="Long"> | ||
| 21 | - delete from sys_user_post where user_id in | ||
| 22 | - <foreach collection="array" item="userId" open="(" separator="," close=")"> | ||
| 23 | - #{userId} | ||
| 24 | - </foreach> | ||
| 25 | - </delete> | ||
| 26 | - | ||
| 27 | - <insert id="batchUserPost"> | ||
| 28 | - insert into sys_user_post(user_id, post_id) values | ||
| 29 | - <foreach item="item" index="index" collection="list" separator=","> | ||
| 30 | - (#{item.userId},#{item.postId}) | ||
| 31 | - </foreach> | ||
| 32 | - </insert> | ||
| 33 | - | ||
| 34 | -</mapper> | ||
| 35 | \ No newline at end of file | 0 | \ No newline at end of file |
src/main/java/cn/iocoder/dashboard/framework/dict/core/service/DictDataFrameworkService.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.framework.dict.core.service; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO; | ||
| 4 | + | ||
| 5 | +import java.util.List; | ||
| 6 | + | ||
| 7 | +public interface DictDataFrameworkService { | ||
| 8 | + | ||
| 9 | + /** | ||
| 10 | + * 获得指定的字典数据,从缓存中 | ||
| 11 | + * | ||
| 12 | + * @param type 字典类型 | ||
| 13 | + * @param value 字典数据值 | ||
| 14 | + * @return 字典数据 | ||
| 15 | + */ | ||
| 16 | + SysDictDataDO getDictDataFromCache(String type, String value); | ||
| 17 | + | ||
| 18 | + /** | ||
| 19 | + * 解析获得指定的字典数据,从缓存中 | ||
| 20 | + * | ||
| 21 | + * @param type 字典类型 | ||
| 22 | + * @param label 字典数据标签 | ||
| 23 | + * @return 字典数据 | ||
| 24 | + */ | ||
| 25 | + SysDictDataDO parseDictDataFromCache(String type, String label); | ||
| 26 | + | ||
| 27 | + /** | ||
| 28 | + * 获得指定类型的字典数据,从缓存中 | ||
| 29 | + * | ||
| 30 | + * @param type 字典类型 | ||
| 31 | + * @return 字典数据列表 | ||
| 32 | + */ | ||
| 33 | + List<SysDictDataDO> listDictDatasFromCache(String type); | ||
| 34 | + | ||
| 35 | +} |
src/main/java/cn/iocoder/dashboard/framework/dict/core/util/DictUtils.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.framework.dict.core.util; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.dashboard.framework.dict.core.service.DictDataFrameworkService; | ||
| 4 | +import lombok.extern.slf4j.Slf4j; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * 字典工具类 | ||
| 8 | + */ | ||
| 9 | +@Slf4j | ||
| 10 | +public class DictUtils { | ||
| 11 | + | ||
| 12 | + private static DictDataFrameworkService service; | ||
| 13 | + | ||
| 14 | + public static void init(DictDataFrameworkService service) { | ||
| 15 | + DictUtils.service = service; | ||
| 16 | + log.info("[init][初始化 DictUtils 成功]"); | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | +} |
src/main/java/cn/iocoder/dashboard/framework/dict/package-info.java
0 → 100644
src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/SysDictDataController.java
| 1 | package cn.iocoder.dashboard.modules.system.controller.dict; | 1 | package cn.iocoder.dashboard.modules.system.controller.dict; |
| 2 | 2 | ||
| 3 | import cn.iocoder.dashboard.common.pojo.CommonResult; | 3 | import cn.iocoder.dashboard.common.pojo.CommonResult; |
| 4 | -import cn.iocoder.dashboard.modules.system.controller.dict.vo.SysDataDictSimpleVO; | 4 | +import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDataDictSimpleVO; |
| 5 | import cn.iocoder.dashboard.modules.system.convert.dict.SysDictDataConvert; | 5 | import cn.iocoder.dashboard.modules.system.convert.dict.SysDictDataConvert; |
| 6 | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO; | 6 | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO; |
| 7 | import cn.iocoder.dashboard.modules.system.service.dict.SysDictDataService; | 7 | import cn.iocoder.dashboard.modules.system.service.dict.SysDictDataService; |
| @@ -16,7 +16,7 @@ import java.util.List; | @@ -16,7 +16,7 @@ import java.util.List; | ||
| 16 | 16 | ||
| 17 | import static cn.iocoder.dashboard.common.pojo.CommonResult.success; | 17 | import static cn.iocoder.dashboard.common.pojo.CommonResult.success; |
| 18 | 18 | ||
| 19 | -@Api(tags = "数据字典 API") | 19 | +@Api(tags = "字典数据 API") |
| 20 | @RestController | 20 | @RestController |
| 21 | @RequestMapping("/system/dict-data") | 21 | @RequestMapping("/system/dict-data") |
| 22 | public class SysDictDataController { | 22 | public class SysDictDataController { |
| @@ -32,4 +32,74 @@ public class SysDictDataController { | @@ -32,4 +32,74 @@ public class SysDictDataController { | ||
| 32 | return success(SysDictDataConvert.INSTANCE.convertList(list)); | 32 | return success(SysDictDataConvert.INSTANCE.convertList(list)); |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | +// @PreAuthorize("@ss.hasPermi('system:dict:list')") | ||
| 36 | +// @GetMapping("/list") | ||
| 37 | +// public TableDataInfo list(SysDictData dictData) { | ||
| 38 | +// startPage(); | ||
| 39 | +// List<SysDictData> list = dictDataService.selectDictDataList(dictData); | ||
| 40 | +// return getDataTable(list); | ||
| 41 | +// } | ||
| 42 | +// | ||
| 43 | +// @Log(title = "字典数据", businessType = BusinessType.EXPORT) | ||
| 44 | +// @PreAuthorize("@ss.hasPermi('system:dict:export')") | ||
| 45 | +// @GetMapping("/export") | ||
| 46 | +// public AjaxResult export(SysDictData dictData) { | ||
| 47 | +// List<SysDictData> list = dictDataService.selectDictDataList(dictData); | ||
| 48 | +// ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class); | ||
| 49 | +// return util.exportExcel(list, "字典数据"); | ||
| 50 | +// } | ||
| 51 | +// | ||
| 52 | +// /** | ||
| 53 | +// * 查询字典数据详细 | ||
| 54 | +// */ | ||
| 55 | +// @PreAuthorize("@ss.hasPermi('system:dict:query')") | ||
| 56 | +// @GetMapping(value = "/{dictCode}") | ||
| 57 | +// public AjaxResult getInfo(@PathVariable Long dictCode) { | ||
| 58 | +// return AjaxResult.success(dictDataService.selectDictDataById(dictCode)); | ||
| 59 | +// } | ||
| 60 | +// | ||
| 61 | +// /** | ||
| 62 | +// * 根据字典类型查询字典数据信息 | ||
| 63 | +// */ | ||
| 64 | +// @GetMapping(value = "/type/{dictType}") | ||
| 65 | +// public AjaxResult dictType(@PathVariable String dictType) { | ||
| 66 | +// List<SysDictData> data = dictTypeService.selectDictDataByType(dictType); | ||
| 67 | +// if (StringUtils.isNull(data)) { | ||
| 68 | +// data = new ArrayList<SysDictData>(); | ||
| 69 | +// } | ||
| 70 | +// return AjaxResult.success(data); | ||
| 71 | +// } | ||
| 72 | +// | ||
| 73 | +// /** | ||
| 74 | +// * 新增字典类型 | ||
| 75 | +// */ | ||
| 76 | +// @PreAuthorize("@ss.hasPermi('system:dict:add')") | ||
| 77 | +// @Log(title = "字典数据", businessType = BusinessType.INSERT) | ||
| 78 | +// @PostMapping | ||
| 79 | +// public AjaxResult add(@Validated @RequestBody SysDictData dict) { | ||
| 80 | +// dict.setCreateBy(SecurityUtils.getUsername()); | ||
| 81 | +// return toAjax(dictDataService.insertDictData(dict)); | ||
| 82 | +// } | ||
| 83 | +// | ||
| 84 | +// /** | ||
| 85 | +// * 修改保存字典类型 | ||
| 86 | +// */ | ||
| 87 | +// @PreAuthorize("@ss.hasPermi('system:dict:edit')") | ||
| 88 | +// @Log(title = "字典数据", businessType = BusinessType.UPDATE) | ||
| 89 | +// @PutMapping | ||
| 90 | +// public AjaxResult edit(@Validated @RequestBody SysDictData dict) { | ||
| 91 | +// dict.setUpdateBy(SecurityUtils.getUsername()); | ||
| 92 | +// return toAjax(dictDataService.updateDictData(dict)); | ||
| 93 | +// } | ||
| 94 | +// | ||
| 95 | +// /** | ||
| 96 | +// * 删除字典类型 | ||
| 97 | +// */ | ||
| 98 | +// @PreAuthorize("@ss.hasPermi('system:dict:remove')") | ||
| 99 | +// @Log(title = "字典类型", businessType = BusinessType.DELETE) | ||
| 100 | +// @DeleteMapping("/{dictCodes}") | ||
| 101 | +// public AjaxResult remove(@PathVariable Long[] dictCodes) { | ||
| 102 | +// return toAjax(dictDataService.deleteDictDataByIds(dictCodes)); | ||
| 103 | +// } | ||
| 104 | + | ||
| 35 | } | 105 | } |
src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/SysDictTypeController.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.controller.dict; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.dashboard.common.pojo.CommonResult; | ||
| 4 | +import cn.iocoder.dashboard.common.pojo.PageResult; | ||
| 5 | +import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeCreateReqVO; | ||
| 6 | +import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypePageReqVO; | ||
| 7 | +import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeRespVO; | ||
| 8 | +import cn.iocoder.dashboard.modules.system.controller.user.vo.user.SysUserUpdateReqVO; | ||
| 9 | +import cn.iocoder.dashboard.modules.system.convert.dict.SysDictTypeConvert; | ||
| 10 | +import cn.iocoder.dashboard.modules.system.service.dict.SysDictTypeService; | ||
| 11 | +import io.swagger.annotations.Api; | ||
| 12 | +import io.swagger.annotations.ApiImplicitParam; | ||
| 13 | +import io.swagger.annotations.ApiOperation; | ||
| 14 | +import org.springframework.validation.annotation.Validated; | ||
| 15 | +import org.springframework.web.bind.annotation.*; | ||
| 16 | + | ||
| 17 | +import javax.annotation.Resource; | ||
| 18 | + | ||
| 19 | +import static cn.iocoder.dashboard.common.pojo.CommonResult.success; | ||
| 20 | + | ||
| 21 | +@Api(tags = "字典类型 API") | ||
| 22 | +@RestController | ||
| 23 | +@RequestMapping("/system/dict-type") | ||
| 24 | +public class SysDictTypeController { | ||
| 25 | + | ||
| 26 | + @Resource | ||
| 27 | + private SysDictTypeService dictTypeService; | ||
| 28 | + | ||
| 29 | + @ApiOperation("/page") | ||
| 30 | + @GetMapping("/list") | ||
| 31 | +// @PreAuthorize("@ss.hasPermi('system:dict:list')") | ||
| 32 | + public CommonResult<PageResult<SysDictTypeRespVO>> pageDictTypes(@Validated SysDictTypePageReqVO reqVO) { | ||
| 33 | + return success(SysDictTypeConvert.INSTANCE.convertPage(dictTypeService.pageDictTypes(reqVO))); | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + @ApiOperation("/查询字典详细") | ||
| 37 | + @ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024") | ||
| 38 | + @GetMapping(value = "/get") | ||
| 39 | +// @PreAuthorize("@ss.hasPermi('system:dict:query')") | ||
| 40 | + public CommonResult<SysDictTypeRespVO> getDictType(@RequestParam("id") Long id) { | ||
| 41 | + return success(SysDictTypeConvert.INSTANCE.convert(dictTypeService.getDictType(id))); | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + @ApiOperation("新增字典类型") | ||
| 45 | + @PostMapping("/create") | ||
| 46 | +// @PreAuthorize("@ss.hasPermi('system:dict:add')") | ||
| 47 | +// @Log(title = "字典类型", businessType = BusinessType.INSERT) | ||
| 48 | + public CommonResult<Long> createDictType(@Validated @RequestBody SysDictTypeCreateReqVO reqVO) { | ||
| 49 | + Long dictTypeId = dictTypeService.createDictType(reqVO); | ||
| 50 | + return success(dictTypeId); | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + @ApiOperation("修改字典类型") | ||
| 54 | + @PostMapping("update") | ||
| 55 | +// @PreAuthorize("@ss.hasPermi('system:dict:edit')") | ||
| 56 | +// @Log(title = "字典类型", businessType = BusinessType.UPDATE) | ||
| 57 | + public CommonResult<Boolean> updateDictType(@Validated @RequestBody SysUserUpdateReqVO reqVO) { | ||
| 58 | + dictTypeService.updateDictType(reqVO); | ||
| 59 | + return success(true); | ||
| 60 | + } | ||
| 61 | + | ||
| 62 | + @ApiOperation("删除字典类型") | ||
| 63 | + @ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024") | ||
| 64 | + @PostMapping("/delete") | ||
| 65 | +// @PreAuthorize("@ss.hasPermi('system:dict:remove')") | ||
| 66 | + public CommonResult<Boolean> deleteDictType(Long id) { | ||
| 67 | + dictTypeService.deleteDictType(id); | ||
| 68 | + return success(true); | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + | ||
| 72 | +// /** | ||
| 73 | +// * 获取字典选择框列表 | ||
| 74 | +// */ | ||
| 75 | +// @GetMapping("/optionselect") | ||
| 76 | +// public AjaxResult optionselect() { | ||
| 77 | +// List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll(); | ||
| 78 | +// return AjaxResult.success(dictTypes); | ||
| 79 | +// } | ||
| 80 | + | ||
| 81 | + // | ||
| 82 | +// @Log(title = "字典类型", businessType = BusinessType.EXPORT) | ||
| 83 | +// @PreAuthorize("@ss.hasPermi('system:dict:export')") | ||
| 84 | +// @GetMapping("/export") | ||
| 85 | +// public AjaxResult export(SysDictType dictType) { | ||
| 86 | +// List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); | ||
| 87 | +// ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class); | ||
| 88 | +// return util.exportExcel(list, "字典类型"); | ||
| 89 | +// } | ||
| 90 | + | ||
| 91 | +} |
src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/SysDataDictSimpleVO.java renamed to src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/data/SysDataDictSimpleVO.java
| 1 | -package cn.iocoder.dashboard.modules.system.controller.dict.vo; | 1 | +package cn.iocoder.dashboard.modules.system.controller.dict.vo.data; |
| 2 | 2 | ||
| 3 | import io.swagger.annotations.ApiModel; | 3 | import io.swagger.annotations.ApiModel; |
| 4 | import io.swagger.annotations.ApiModelProperty; | 4 | import io.swagger.annotations.ApiModelProperty; |
src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeBaseVO.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.controller.dict.vo.type; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.dashboard.framework.excel.Excel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +import javax.validation.constraints.NotBlank; | ||
| 8 | +import javax.validation.constraints.Size; | ||
| 9 | + | ||
| 10 | +/** | ||
| 11 | + * 字典类型 Base VO,提供给添加、修改、详细的子 VO 使用 | ||
| 12 | + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | ||
| 13 | + */ | ||
| 14 | +@Data | ||
| 15 | +public class SysDictTypeBaseVO { | ||
| 16 | + | ||
| 17 | + @ApiModelProperty(value = "字典名称", required = true, example = "性别") | ||
| 18 | + @NotBlank(message = "字典名称不能为空") | ||
| 19 | + @Size(max = 100, message = "字典类型名称长度不能超过100个字符") | ||
| 20 | + private String name; | ||
| 21 | + | ||
| 22 | + @ApiModelProperty(value = "字典类型", required = true, example = "sys_common_sex") | ||
| 23 | + @NotBlank(message = "字典类型不能为空") | ||
| 24 | + @Size(max = 100, message = "字典类型类型长度不能超过100个字符") | ||
| 25 | + private String type; | ||
| 26 | + | ||
| 27 | + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") | ||
| 28 | + @NotBlank(message = "状态不能为空") | ||
| 29 | + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") | ||
| 30 | + private Integer status; | ||
| 31 | + | ||
| 32 | +} |
src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeCreateReqVO.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.controller.dict.vo.type; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import lombok.Data; | ||
| 5 | +import lombok.EqualsAndHashCode; | ||
| 6 | + | ||
| 7 | +@ApiModel("字典类型创建 Request VO") | ||
| 8 | +@Data | ||
| 9 | +@EqualsAndHashCode(callSuper = true) | ||
| 10 | +public class SysDictTypeCreateReqVO extends SysDictTypeBaseVO { | ||
| 11 | +} |
src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeExcelRespVO.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.controller.dict.vo.type; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.dashboard.framework.excel.Excel; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +/** | ||
| 7 | + * 字典类型 Excel 导出响应 VO | ||
| 8 | + */ | ||
| 9 | +@Data | ||
| 10 | +public class SysDictTypeExcelRespVO { | ||
| 11 | + | ||
| 12 | + @Excel(name = "字典主键", cellType = Excel.ColumnType.NUMERIC) | ||
| 13 | + private Long id; | ||
| 14 | + | ||
| 15 | + @Excel(name = "字典名称") | ||
| 16 | + private String name; | ||
| 17 | + | ||
| 18 | + @Excel(name = "字典类型") | ||
| 19 | + private String type; | ||
| 20 | + | ||
| 21 | + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") | ||
| 22 | + private Integer status; | ||
| 23 | + | ||
| 24 | +} |
src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypePageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.controller.dict.vo.type; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.Data; | ||
| 6 | + | ||
| 7 | +@ApiModel("字典类型分页列表 Request VO") | ||
| 8 | +@Data | ||
| 9 | +public class SysDictTypePageReqVO { | ||
| 10 | + | ||
| 11 | + @ApiModelProperty(value = "字典类型名称", example = "芋道", notes = "模糊匹配") | ||
| 12 | + private String name; | ||
| 13 | + | ||
| 14 | + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") | ||
| 15 | + private Integer status; | ||
| 16 | + | ||
| 17 | +} |
src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeRespVO.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.controller.dict.vo.type; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.AllArgsConstructor; | ||
| 6 | +import lombok.Data; | ||
| 7 | +import lombok.EqualsAndHashCode; | ||
| 8 | +import lombok.NoArgsConstructor; | ||
| 9 | + | ||
| 10 | +import java.util.Date; | ||
| 11 | + | ||
| 12 | +@ApiModel("字典类型信息 Response VO") | ||
| 13 | +@Data | ||
| 14 | +@NoArgsConstructor | ||
| 15 | +@AllArgsConstructor | ||
| 16 | +@EqualsAndHashCode(callSuper = true) | ||
| 17 | +public class SysDictTypeRespVO extends SysDictTypeBaseVO { | ||
| 18 | + | ||
| 19 | + @ApiModelProperty(value = "字典类型编号", required = true, example = "1024") | ||
| 20 | + private Integer id; | ||
| 21 | + | ||
| 22 | + @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") | ||
| 23 | + private Date createTime; | ||
| 24 | + | ||
| 25 | +} |
src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeSimpleRespVO.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.controller.dict.vo.type; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.AllArgsConstructor; | ||
| 6 | +import lombok.Data; | ||
| 7 | +import lombok.NoArgsConstructor; | ||
| 8 | + | ||
| 9 | +@ApiModel("字典类型精简信息 Response VO") | ||
| 10 | +@Data | ||
| 11 | +@NoArgsConstructor | ||
| 12 | +@AllArgsConstructor | ||
| 13 | +public class SysDictTypeSimpleRespVO { | ||
| 14 | + | ||
| 15 | + @ApiModelProperty(value = "字典类型编号", required = true, example = "1024") | ||
| 16 | + private Integer id; | ||
| 17 | + | ||
| 18 | + @ApiModelProperty(value = "字典类型名称", required = true, example = "芋道") | ||
| 19 | + private String name; | ||
| 20 | + | ||
| 21 | +} |
src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeUpdateReqVO.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.controller.dict.vo.type; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import io.swagger.annotations.ApiModelProperty; | ||
| 5 | +import lombok.Data; | ||
| 6 | +import lombok.EqualsAndHashCode; | ||
| 7 | + | ||
| 8 | +import javax.validation.constraints.NotNull; | ||
| 9 | + | ||
| 10 | +@ApiModel("字典类型更新 Request VO") | ||
| 11 | +@Data | ||
| 12 | +@EqualsAndHashCode(callSuper = true) | ||
| 13 | +public class SysDictTypeUpdateReqVO extends SysDictTypeBaseVO { | ||
| 14 | + | ||
| 15 | + @ApiModelProperty(value = "字典类型编号", required = true, example = "1024") | ||
| 16 | + @NotNull(message = "字典类型编号不能为空") | ||
| 17 | + private Long id; | ||
| 18 | + | ||
| 19 | +} |
src/main/java/cn/iocoder/dashboard/modules/system/convert/dict/SysDictDataConvert.java
| 1 | package cn.iocoder.dashboard.modules.system.convert.dict; | 1 | package cn.iocoder.dashboard.modules.system.convert.dict; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.dashboard.modules.system.controller.dict.vo.SysDataDictSimpleVO; | 3 | +import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDataDictSimpleVO; |
| 4 | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO; | 4 | import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO; |
| 5 | import org.mapstruct.Mapper; | 5 | import org.mapstruct.Mapper; |
| 6 | import org.mapstruct.factory.Mappers; | 6 | import org.mapstruct.factory.Mappers; |
src/main/java/cn/iocoder/dashboard/modules/system/convert/dict/SysDictTypeConvert.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.convert.dict; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.dashboard.common.pojo.PageResult; | ||
| 4 | +import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeRespVO; | ||
| 5 | +import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictTypeDO; | ||
| 6 | +import org.mapstruct.Mapper; | ||
| 7 | +import org.mapstruct.factory.Mappers; | ||
| 8 | + | ||
| 9 | +@Mapper | ||
| 10 | +public interface SysDictTypeConvert { | ||
| 11 | + | ||
| 12 | + SysDictTypeConvert INSTANCE = Mappers.getMapper(SysDictTypeConvert.class); | ||
| 13 | + | ||
| 14 | + PageResult<SysDictTypeRespVO> convertPage(PageResult<SysDictTypeDO> bean); | ||
| 15 | + | ||
| 16 | + SysDictTypeRespVO convert(SysDictTypeDO bean); | ||
| 17 | + | ||
| 18 | +} |
src/main/java/cn/iocoder/dashboard/modules/system/dal/mysql/dataobject/dict/SysDictTypeDO.java
| 1 | package cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict; | 1 | package cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict; |
| 2 | 2 | ||
| 3 | import cn.iocoder.dashboard.common.enums.CommonStatusEnum; | 3 | import cn.iocoder.dashboard.common.enums.CommonStatusEnum; |
| 4 | -import cn.iocoder.dashboard.framework.excel.Excel; | ||
| 5 | import cn.iocoder.dashboard.framework.mybatis.core.dataobject.BaseDO; | 4 | import cn.iocoder.dashboard.framework.mybatis.core.dataobject.BaseDO; |
| 6 | import com.baomidou.mybatisplus.annotation.TableField; | 5 | import com.baomidou.mybatisplus.annotation.TableField; |
| 7 | import com.baomidou.mybatisplus.annotation.TableId; | 6 | import com.baomidou.mybatisplus.annotation.TableId; |
| @@ -9,9 +8,6 @@ import com.baomidou.mybatisplus.annotation.TableName; | @@ -9,9 +8,6 @@ import com.baomidou.mybatisplus.annotation.TableName; | ||
| 9 | import lombok.Data; | 8 | import lombok.Data; |
| 10 | import lombok.EqualsAndHashCode; | 9 | import lombok.EqualsAndHashCode; |
| 11 | 10 | ||
| 12 | -import javax.validation.constraints.NotBlank; | ||
| 13 | -import javax.validation.constraints.Size; | ||
| 14 | - | ||
| 15 | /** | 11 | /** |
| 16 | * 字典类型表 | 12 | * 字典类型表 |
| 17 | * | 13 | * |
| @@ -26,29 +22,21 @@ public class SysDictTypeDO extends BaseDO { | @@ -26,29 +22,21 @@ public class SysDictTypeDO extends BaseDO { | ||
| 26 | * 字典主键 | 22 | * 字典主键 |
| 27 | */ | 23 | */ |
| 28 | @TableId | 24 | @TableId |
| 29 | - @Excel(name = "字典主键", cellType = Excel.ColumnType.NUMERIC) | ||
| 30 | private Long id; | 25 | private Long id; |
| 31 | /** | 26 | /** |
| 32 | * 字典名称 | 27 | * 字典名称 |
| 33 | */ | 28 | */ |
| 34 | - @Excel(name = "字典名称") | ||
| 35 | - @NotBlank(message = "字典名称不能为空") | ||
| 36 | - @Size(max = 100, message = "字典类型名称长度不能超过100个字符") | ||
| 37 | private String name; | 29 | private String name; |
| 38 | /** | 30 | /** |
| 39 | * 字典类型 | 31 | * 字典类型 |
| 40 | */ | 32 | */ |
| 41 | @TableField("dict_type") | 33 | @TableField("dict_type") |
| 42 | - @Excel(name = "字典类型") | ||
| 43 | - @NotBlank(message = "字典类型不能为空") | ||
| 44 | - @Size(max = 100, message = "字典类型类型长度不能超过100个字符") | ||
| 45 | private String type; | 34 | private String type; |
| 46 | /** | 35 | /** |
| 47 | * 状态 | 36 | * 状态 |
| 48 | * | 37 | * |
| 49 | * 枚举 {@link CommonStatusEnum} | 38 | * 枚举 {@link CommonStatusEnum} |
| 50 | */ | 39 | */ |
| 51 | - @Excel(name = "状态", readConverterExp = "0=正常,1=停用") | ||
| 52 | private Integer status; | 40 | private Integer status; |
| 53 | 41 | ||
| 54 | } | 42 | } |
src/main/java/cn/iocoder/dashboard/modules/system/service/dict/SysDictTypeService.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.service.dict; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.dashboard.common.pojo.PageResult; | ||
| 4 | +import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeCreateReqVO; | ||
| 5 | +import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypePageReqVO; | ||
| 6 | +import cn.iocoder.dashboard.modules.system.controller.user.vo.user.SysUserUpdateReqVO; | ||
| 7 | +import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictTypeDO; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * 字典类型 Service 接口 | ||
| 11 | + * | ||
| 12 | + * @author 芋道源码 | ||
| 13 | + */ | ||
| 14 | +public interface SysDictTypeService { | ||
| 15 | + | ||
| 16 | + PageResult<SysDictTypeDO> pageDictTypes(SysDictTypePageReqVO reqVO); | ||
| 17 | + | ||
| 18 | + SysDictTypeDO getDictType(Long id); | ||
| 19 | + | ||
| 20 | + Long createDictType(SysDictTypeCreateReqVO reqVO); | ||
| 21 | + | ||
| 22 | + void updateDictType(SysUserUpdateReqVO reqVO); | ||
| 23 | + | ||
| 24 | + void deleteDictType(Long id); | ||
| 25 | + | ||
| 26 | +} |