!282 System 相关表请求响应参数优化
* update 更新 system 相关表接口 (sys_role) 新增 Bo | Vo 类, 更改请求以及响应参数 ;
* update 更新 system 相关表接口 (sys_notice, sys_post) 新增 Bo | Vo 类, 更改请求以及响应参数 ;
* update 更新 system 相关表接口 (sys_menu) 新增 Bo | Vo 类, 更改请求以及响应参数 ;
* update 更新 system 相关表接口 (sys_dict_data, sys_dict_type) 新增 Bo | Vo 类, 更改请求以及响应参数 ;
* update 更新 system 相关表接口 (sys_config, sys_dept) 新增 Bo | Vo 类, 更改请求以及响应参数 ;
| | |
| | | import com.ruoyi.common.mybatis.core.page.TableDataInfo; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.excel.utils.ExcelUtil; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.domain.bo.SysConfigBo; |
| | | import com.ruoyi.system.domain.vo.SysConfigVo; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | */ |
| | | @SaCheckPermission("system:config:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<SysConfig> list(SysConfig config, PageQuery pageQuery) { |
| | | public TableDataInfo<SysConfigVo> list(SysConfigBo config, PageQuery pageQuery) { |
| | | return configService.selectPageConfigList(config, pageQuery); |
| | | } |
| | | |
| | |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.EXPORT) |
| | | @SaCheckPermission("system:config:export") |
| | | @PostMapping("/export") |
| | | public void export(SysConfig config, HttpServletResponse response) { |
| | | List<SysConfig> list = configService.selectConfigList(config); |
| | | ExcelUtil.exportExcel(list, "åæ°æ°æ®", SysConfig.class, response); |
| | | public void export(SysConfigBo config, HttpServletResponse response) { |
| | | List<SysConfigVo> list = configService.selectConfigList(config); |
| | | ExcelUtil.exportExcel(list, "åæ°æ°æ®", SysConfigVo.class, response); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @SaCheckPermission("system:config:query") |
| | | @GetMapping(value = "/{configId}") |
| | | public R<SysConfig> getInfo(@PathVariable Long configId) { |
| | | public R<SysConfigVo> getInfo(@PathVariable Long configId) { |
| | | return R.ok(configService.selectConfigById(configId)); |
| | | } |
| | | |
| | |
| | | @SaCheckPermission("system:config:add") |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<Void> add(@Validated @RequestBody SysConfig config) { |
| | | public R<Void> add(@Validated @RequestBody SysConfigBo config) { |
| | | if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) { |
| | | return R.fail("æ°å¢åæ°'" + config.getConfigName() + "'失败ï¼åæ°é®åå·²åå¨"); |
| | | } |
| | |
| | | @SaCheckPermission("system:config:edit") |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<Void> edit(@Validated @RequestBody SysConfig config) { |
| | | public R<Void> edit(@Validated @RequestBody SysConfigBo config) { |
| | | if (UserConstants.NOT_UNIQUE.equals(configService.checkConfigKeyUnique(config))) { |
| | | return R.fail("ä¿®æ¹åæ°'" + config.getConfigName() + "'失败ï¼åæ°é®åå·²åå¨"); |
| | | } |
| | |
| | | @SaCheckPermission("system:config:edit") |
| | | @Log(title = "åæ°ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/updateByKey") |
| | | public R<Void> updateByKey(@RequestBody SysConfig config) { |
| | | public R<Void> updateByKey(@RequestBody SysConfigBo config) { |
| | | configService.updateConfig(config); |
| | | return R.ok(); |
| | | } |
| | |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.web.core.BaseController; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.domain.SysDept; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.system.domain.bo.SysDeptBo; |
| | | import com.ruoyi.system.domain.vo.SysDeptVo; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | */ |
| | | @SaCheckPermission("system:dept:list") |
| | | @GetMapping("/list") |
| | | public R<List<SysDept>> list(SysDept dept) { |
| | | List<SysDept> depts = deptService.selectDeptList(dept); |
| | | public R<List<SysDeptVo>> list(SysDeptBo dept) { |
| | | List<SysDeptVo> depts = deptService.selectDeptList(dept); |
| | | return R.ok(depts); |
| | | } |
| | | |
| | |
| | | */ |
| | | @SaCheckPermission("system:dept:list") |
| | | @GetMapping("/list/exclude/{deptId}") |
| | | public R<List<SysDept>> excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) { |
| | | List<SysDept> depts = deptService.selectDeptList(new SysDept()); |
| | | public R<List<SysDeptVo>> excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) { |
| | | List<SysDeptVo> depts = deptService.selectDeptList(new SysDeptBo()); |
| | | depts.removeIf(d -> d.getDeptId().equals(deptId) |
| | | || ArrayUtil.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")); |
| | | return R.ok(depts); |
| | |
| | | */ |
| | | @SaCheckPermission("system:dept:query") |
| | | @GetMapping(value = "/{deptId}") |
| | | public R<SysDept> getInfo(@PathVariable Long deptId) { |
| | | public R<SysDeptVo> getInfo(@PathVariable Long deptId) { |
| | | deptService.checkDeptDataScope(deptId); |
| | | return R.ok(deptService.selectDeptById(deptId)); |
| | | } |
| | |
| | | @SaCheckPermission("system:dept:add") |
| | | @Log(title = "é¨é¨ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<Void> add(@Validated @RequestBody SysDept dept) { |
| | | public R<Void> add(@Validated @RequestBody SysDeptBo dept) { |
| | | if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) { |
| | | return R.fail("æ°å¢é¨é¨'" + dept.getDeptName() + "'失败ï¼é¨é¨åç§°å·²åå¨"); |
| | | } |
| | |
| | | @SaCheckPermission("system:dept:edit") |
| | | @Log(title = "é¨é¨ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<Void> edit(@Validated @RequestBody SysDept dept) { |
| | | public R<Void> edit(@Validated @RequestBody SysDeptBo dept) { |
| | | Long deptId = dept.getDeptId(); |
| | | deptService.checkDeptDataScope(deptId); |
| | | if (UserConstants.NOT_UNIQUE.equals(deptService.checkDeptNameUnique(dept))) { |
| | |
| | | import com.ruoyi.common.mybatis.core.page.TableDataInfo; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.excel.utils.ExcelUtil; |
| | | import com.ruoyi.system.domain.bo.SysDictDataBo; |
| | | import com.ruoyi.system.domain.vo.SysDictDataVo; |
| | | import com.ruoyi.system.service.ISysDictDataService; |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | */ |
| | | @SaCheckPermission("system:dict:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<SysDictData> list(SysDictData dictData, PageQuery pageQuery) { |
| | | public TableDataInfo<SysDictDataVo> list(SysDictDataBo dictData, PageQuery pageQuery) { |
| | | return dictDataService.selectPageDictDataList(dictData, pageQuery); |
| | | } |
| | | |
| | |
| | | @Log(title = "åå
¸æ°æ®", businessType = BusinessType.EXPORT) |
| | | @SaCheckPermission("system:dict:export") |
| | | @PostMapping("/export") |
| | | public void export(SysDictData dictData, HttpServletResponse response) { |
| | | List<SysDictData> list = dictDataService.selectDictDataList(dictData); |
| | | ExcelUtil.exportExcel(list, "åå
¸æ°æ®", SysDictData.class, response); |
| | | public void export(SysDictDataBo dictData, HttpServletResponse response) { |
| | | List<SysDictDataVo> list = dictDataService.selectDictDataList(dictData); |
| | | ExcelUtil.exportExcel(list, "åå
¸æ°æ®", SysDictDataVo.class, response); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @SaCheckPermission("system:dict:query") |
| | | @GetMapping(value = "/{dictCode}") |
| | | public R<SysDictData> getInfo(@PathVariable Long dictCode) { |
| | | public R<SysDictDataVo> getInfo(@PathVariable Long dictCode) { |
| | | return R.ok(dictDataService.selectDictDataById(dictCode)); |
| | | } |
| | | |
| | |
| | | * @param dictType åå
¸ç±»å |
| | | */ |
| | | @GetMapping(value = "/type/{dictType}") |
| | | public R<List<SysDictData>> dictType(@PathVariable String dictType) { |
| | | List<SysDictData> data = dictTypeService.selectDictDataByType(dictType); |
| | | public R<List<SysDictDataVo>> dictType(@PathVariable String dictType) { |
| | | List<SysDictDataVo> data = dictTypeService.selectDictDataByType(dictType); |
| | | if (ObjectUtil.isNull(data)) { |
| | | data = new ArrayList<>(); |
| | | } |
| | |
| | | @SaCheckPermission("system:dict:add") |
| | | @Log(title = "åå
¸æ°æ®", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<Void> add(@Validated @RequestBody SysDictData dict) { |
| | | public R<Void> add(@Validated @RequestBody SysDictDataBo dict) { |
| | | dictDataService.insertDictData(dict); |
| | | return R.ok(); |
| | | } |
| | |
| | | @SaCheckPermission("system:dict:edit") |
| | | @Log(title = "åå
¸æ°æ®", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<Void> edit(@Validated @RequestBody SysDictData dict) { |
| | | public R<Void> edit(@Validated @RequestBody SysDictDataBo dict) { |
| | | dictDataService.updateDictData(dict); |
| | | return R.ok(); |
| | | } |
| | |
| | | import com.ruoyi.common.mybatis.core.page.TableDataInfo; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.excel.utils.ExcelUtil; |
| | | import com.ruoyi.system.domain.bo.SysDictTypeBo; |
| | | import com.ruoyi.system.domain.vo.SysDictTypeVo; |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | */ |
| | | @SaCheckPermission("system:dict:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<SysDictType> list(SysDictType dictType, PageQuery pageQuery) { |
| | | public TableDataInfo<SysDictTypeVo> list(SysDictTypeBo dictType, PageQuery pageQuery) { |
| | | return dictTypeService.selectPageDictTypeList(dictType, pageQuery); |
| | | } |
| | | |
| | |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.EXPORT) |
| | | @SaCheckPermission("system:dict:export") |
| | | @PostMapping("/export") |
| | | public void export(SysDictType dictType, HttpServletResponse response) { |
| | | List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); |
| | | ExcelUtil.exportExcel(list, "åå
¸ç±»å", SysDictType.class, response); |
| | | public void export(SysDictTypeBo dictType, HttpServletResponse response) { |
| | | List<SysDictTypeVo> list = dictTypeService.selectDictTypeList(dictType); |
| | | ExcelUtil.exportExcel(list, "åå
¸ç±»å", SysDictTypeVo.class, response); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @SaCheckPermission("system:dict:query") |
| | | @GetMapping(value = "/{dictId}") |
| | | public R<SysDictType> getInfo(@PathVariable Long dictId) { |
| | | public R<SysDictTypeVo> getInfo(@PathVariable Long dictId) { |
| | | return R.ok(dictTypeService.selectDictTypeById(dictId)); |
| | | } |
| | | |
| | |
| | | @SaCheckPermission("system:dict:add") |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<Void> add(@Validated @RequestBody SysDictType dict) { |
| | | public R<Void> add(@Validated @RequestBody SysDictTypeBo dict) { |
| | | if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) { |
| | | return R.fail("æ°å¢åå
¸'" + dict.getDictName() + "'失败ï¼åå
¸ç±»åå·²åå¨"); |
| | | } |
| | |
| | | @SaCheckPermission("system:dict:edit") |
| | | @Log(title = "åå
¸ç±»å", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<Void> edit(@Validated @RequestBody SysDictType dict) { |
| | | public R<Void> edit(@Validated @RequestBody SysDictTypeBo dict) { |
| | | if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) { |
| | | return R.fail("ä¿®æ¹åå
¸'" + dict.getDictName() + "'失败ï¼åå
¸ç±»åå·²åå¨"); |
| | | } |
| | |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.satoken.utils.LoginHelper; |
| | | import com.ruoyi.system.domain.SysMenu; |
| | | import com.ruoyi.system.domain.bo.SysMenuBo; |
| | | import com.ruoyi.system.domain.vo.SysMenuVo; |
| | | import com.ruoyi.system.service.ISysMenuService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | */ |
| | | @SaCheckPermission("system:menu:query") |
| | | @GetMapping(value = "/{menuId}") |
| | | public R<SysMenu> getInfo(@PathVariable Long menuId) { |
| | | public R<SysMenuVo> getInfo(@PathVariable Long menuId) { |
| | | return R.ok(menuService.selectMenuById(menuId)); |
| | | } |
| | | |
| | |
| | | @SaCheckPermission("system:menu:add") |
| | | @Log(title = "èå管ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<Void> add(@Validated @RequestBody SysMenu menu) { |
| | | public R<Void> add(@Validated @RequestBody SysMenuBo menu) { |
| | | if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) { |
| | | return R.fail("æ°å¢èå'" + menu.getMenuName() + "'失败ï¼èååç§°å·²åå¨"); |
| | | } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) { |
| | |
| | | @SaCheckPermission("system:menu:edit") |
| | | @Log(title = "èå管ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<Void> edit(@Validated @RequestBody SysMenu menu) { |
| | | public R<Void> edit(@Validated @RequestBody SysMenuBo menu) { |
| | | if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) { |
| | | return R.fail("ä¿®æ¹èå'" + menu.getMenuName() + "'失败ï¼èååç§°å·²åå¨"); |
| | | } else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) { |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.mybatis.core.page.TableDataInfo; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | import com.ruoyi.system.domain.bo.SysNoticeBo; |
| | | import com.ruoyi.system.domain.vo.SysNoticeVo; |
| | | import com.ruoyi.system.service.ISysNoticeService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | */ |
| | | @SaCheckPermission("system:notice:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<SysNotice> list(SysNotice notice, PageQuery pageQuery) { |
| | | public TableDataInfo<SysNoticeVo> list(SysNoticeBo notice, PageQuery pageQuery) { |
| | | return noticeService.selectPageNoticeList(notice, pageQuery); |
| | | } |
| | | |
| | |
| | | */ |
| | | @SaCheckPermission("system:notice:query") |
| | | @GetMapping(value = "/{noticeId}") |
| | | public R<SysNotice> getInfo(@PathVariable Long noticeId) { |
| | | public R<SysNoticeVo> getInfo(@PathVariable Long noticeId) { |
| | | return R.ok(noticeService.selectNoticeById(noticeId)); |
| | | } |
| | | |
| | |
| | | @SaCheckPermission("system:notice:add") |
| | | @Log(title = "éç¥å
Œ", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<Void> add(@Validated @RequestBody SysNotice notice) { |
| | | public R<Void> add(@Validated @RequestBody SysNoticeBo notice) { |
| | | return toAjax(noticeService.insertNotice(notice)); |
| | | } |
| | | |
| | |
| | | @SaCheckPermission("system:notice:edit") |
| | | @Log(title = "éç¥å
Œ", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<Void> edit(@Validated @RequestBody SysNotice notice) { |
| | | public R<Void> edit(@Validated @RequestBody SysNoticeBo notice) { |
| | | return toAjax(noticeService.updateNotice(notice)); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.common.mybatis.core.page.TableDataInfo; |
| | | import com.ruoyi.common.log.enums.BusinessType; |
| | | import com.ruoyi.common.excel.utils.ExcelUtil; |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import com.ruoyi.system.domain.bo.SysPostBo; |
| | | import com.ruoyi.system.domain.vo.SysPostVo; |
| | | import com.ruoyi.system.service.ISysPostService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | */ |
| | | @SaCheckPermission("system:post:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<SysPost> list(SysPost post, PageQuery pageQuery) { |
| | | public TableDataInfo<SysPostVo> list(SysPostBo post, PageQuery pageQuery) { |
| | | return postService.selectPagePostList(post, pageQuery); |
| | | } |
| | | |
| | |
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.EXPORT) |
| | | @SaCheckPermission("system:post:export") |
| | | @PostMapping("/export") |
| | | public void export(SysPost post, HttpServletResponse response) { |
| | | List<SysPost> list = postService.selectPostList(post); |
| | | ExcelUtil.exportExcel(list, "å²ä½æ°æ®", SysPost.class, response); |
| | | public void export(SysPostBo post, HttpServletResponse response) { |
| | | List<SysPostVo> list = postService.selectPostList(post); |
| | | ExcelUtil.exportExcel(list, "å²ä½æ°æ®", SysPostVo.class, response); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @SaCheckPermission("system:post:query") |
| | | @GetMapping(value = "/{postId}") |
| | | public R<SysPost> getInfo(@PathVariable Long postId) { |
| | | public R<SysPostVo> getInfo(@PathVariable Long postId) { |
| | | return R.ok(postService.selectPostById(postId)); |
| | | } |
| | | |
| | |
| | | @SaCheckPermission("system:post:add") |
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<Void> add(@Validated @RequestBody SysPost post) { |
| | | public R<Void> add(@Validated @RequestBody SysPostBo post) { |
| | | if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) { |
| | | return R.fail("æ°å¢å²ä½'" + post.getPostName() + "'失败ï¼å²ä½åç§°å·²åå¨"); |
| | | } else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) { |
| | |
| | | @SaCheckPermission("system:post:edit") |
| | | @Log(title = "å²ä½ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<Void> edit(@Validated @RequestBody SysPost post) { |
| | | public R<Void> edit(@Validated @RequestBody SysPostBo post) { |
| | | if (UserConstants.NOT_UNIQUE.equals(postService.checkPostNameUnique(post))) { |
| | | return R.fail("ä¿®æ¹å²ä½'" + post.getPostName() + "'失败ï¼å²ä½åç§°å·²åå¨"); |
| | | } else if (UserConstants.NOT_UNIQUE.equals(postService.checkPostCodeUnique(post))) { |
| | |
| | | * è·åå²ä½éæ©æ¡å表 |
| | | */ |
| | | @GetMapping("/optionselect") |
| | | public R<List<SysPost>> optionselect() { |
| | | List<SysPost> posts = postService.selectPostAll(); |
| | | public R<List<SysPostVo>> optionselect() { |
| | | List<SysPostVo> posts = postService.selectPostAll(); |
| | | return R.ok(posts); |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.mybatis.core.page.TableDataInfo; |
| | | import com.ruoyi.common.satoken.utils.LoginHelper; |
| | | import com.ruoyi.system.domain.SysDept; |
| | | import com.ruoyi.system.domain.SysRole; |
| | | import com.ruoyi.system.domain.SysUser; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.domain.bo.SysRoleBo; |
| | | import com.ruoyi.system.domain.vo.SysRoleVo; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | |
| | | */ |
| | | @SaCheckPermission("system:role:list") |
| | | @GetMapping("/list") |
| | | public TableDataInfo<SysRole> list(SysRole role, PageQuery pageQuery) { |
| | | public TableDataInfo<SysRoleVo> list(SysRoleBo role, PageQuery pageQuery) { |
| | | return roleService.selectPageRoleList(role, pageQuery); |
| | | } |
| | | |
| | |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.EXPORT) |
| | | @SaCheckPermission("system:role:export") |
| | | @PostMapping("/export") |
| | | public void export(SysRole role, HttpServletResponse response) { |
| | | List<SysRole> list = roleService.selectRoleList(role); |
| | | ExcelUtil.exportExcel(list, "è§è²æ°æ®", SysRole.class, response); |
| | | public void export(SysRoleBo role, HttpServletResponse response) { |
| | | List<SysRoleVo> list = roleService.selectRoleList(role); |
| | | ExcelUtil.exportExcel(list, "è§è²æ°æ®", SysRoleVo.class, response); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @SaCheckPermission("system:role:query") |
| | | @GetMapping(value = "/{roleId}") |
| | | public R<SysRole> getInfo(@PathVariable Long roleId) { |
| | | public R<SysRoleVo> getInfo(@PathVariable Long roleId) { |
| | | roleService.checkRoleDataScope(roleId); |
| | | return R.ok(roleService.selectRoleById(roleId)); |
| | | } |
| | |
| | | @SaCheckPermission("system:role:add") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | public R<Void> add(@Validated @RequestBody SysRole role) { |
| | | public R<Void> add(@Validated @RequestBody SysRoleBo role) { |
| | | if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) { |
| | | return R.fail("æ°å¢è§è²'" + role.getRoleName() + "'失败ï¼è§è²åç§°å·²åå¨"); |
| | | } else if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) { |
| | |
| | | @SaCheckPermission("system:role:edit") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | public R<Void> edit(@Validated @RequestBody SysRole role) { |
| | | public R<Void> edit(@Validated @RequestBody SysRoleBo role) { |
| | | roleService.checkRoleAllowed(role); |
| | | roleService.checkRoleDataScope(role.getRoleId()); |
| | | if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) { |
| | |
| | | @SaCheckPermission("system:role:edit") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/dataScope") |
| | | public R<Void> dataScope(@RequestBody SysRole role) { |
| | | public R<Void> dataScope(@RequestBody SysRoleBo role) { |
| | | roleService.checkRoleAllowed(role); |
| | | roleService.checkRoleDataScope(role.getRoleId()); |
| | | return toAjax(roleService.authDataScope(role)); |
| | |
| | | @SaCheckPermission("system:role:edit") |
| | | @Log(title = "è§è²ç®¡ç", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus") |
| | | public R<Void> changeStatus(@RequestBody SysRole role) { |
| | | public R<Void> changeStatus(@RequestBody SysRoleBo role) { |
| | | roleService.checkRoleAllowed(role); |
| | | roleService.checkRoleDataScope(role.getRoleId()); |
| | | return toAjax(roleService.updateRoleStatus(role)); |
| | |
| | | */ |
| | | @SaCheckPermission("system:role:query") |
| | | @GetMapping("/optionselect") |
| | | public R<List<SysRole>> optionselect() { |
| | | public R<List<SysRoleVo>> optionselect() { |
| | | return R.ok(roleService.selectRoleAll()); |
| | | } |
| | | |
| | |
| | | import com.ruoyi.system.domain.SysDept; |
| | | import com.ruoyi.system.domain.SysRole; |
| | | import com.ruoyi.system.domain.SysUser; |
| | | import com.ruoyi.system.domain.vo.SysRoleVo; |
| | | import com.ruoyi.system.domain.vo.SysUserExportVo; |
| | | import com.ruoyi.system.domain.vo.SysUserImportVo; |
| | | import com.ruoyi.system.listener.SysUserImportListener; |
| | |
| | | public R<Map<String, Object>> getInfo(@PathVariable(value = "userId", required = false) Long userId) { |
| | | userService.checkUserDataScope(userId); |
| | | Map<String, Object> ajax = new HashMap<>(); |
| | | List<SysRole> roles = roleService.selectRoleAll(); |
| | | List<SysRoleVo> roles = roleService.selectRoleAll(); |
| | | ajax.put("roles", LoginHelper.isAdmin(userId) ? roles : StreamUtils.filter(roles, r -> !r.isAdmin())); |
| | | ajax.put("posts", postService.selectPostAll()); |
| | | if (ObjectUtil.isNotNull(userId)) { |
| | |
| | | @GetMapping("/authRole/{userId}") |
| | | public R<Map<String, Object>> authRole(@PathVariable Long userId) { |
| | | SysUser user = userService.selectUserById(userId); |
| | | List<SysRole> roles = roleService.selectRolesByUserId(userId); |
| | | List<SysRoleVo> roles = roleService.selectRolesByUserId(userId); |
| | | return R.ok(Map.of( |
| | | "user", user, |
| | | "roles", LoginHelper.isAdmin(userId) ? roles : StreamUtils.filter(roles, r -> !r.isAdmin()) |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.mybatis.core.domain.BaseEntity; |
| | | import com.ruoyi.common.excel.annotation.ExcelDictFormat; |
| | | import com.ruoyi.common.excel.convert.ExcelDictConvert; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.Size; |
| | | |
| | | /** |
| | | * åæ°é
置表 sys_config |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("sys_config") |
| | | @ExcelIgnoreUnannotated |
| | | public class SysConfig extends BaseEntity { |
| | | |
| | | /** |
| | | * åæ°ä¸»é® |
| | | */ |
| | | @ExcelProperty(value = "忰䏻é®") |
| | | @TableId(value = "config_id") |
| | | private Long configId; |
| | | |
| | | /** |
| | | * åæ°åç§° |
| | | */ |
| | | @ExcelProperty(value = "åæ°åç§°") |
| | | @NotBlank(message = "åæ°åç§°ä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 100, message = "åæ°åç§°ä¸è½è¶
è¿{max}个å符") |
| | | private String configName; |
| | | |
| | | /** |
| | | * åæ°é®å |
| | | */ |
| | | @ExcelProperty(value = "åæ°é®å") |
| | | @NotBlank(message = "åæ°é®åé¿åº¦ä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 100, message = "åæ°é®åé¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String configKey; |
| | | |
| | | /** |
| | | * åæ°é®å¼ |
| | | */ |
| | | @ExcelProperty(value = "åæ°é®å¼") |
| | | @NotBlank(message = "åæ°é®å¼ä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 500, message = "åæ°é®å¼é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String configValue; |
| | | |
| | | /** |
| | | * ç³»ç»å
ç½®ï¼Yæ¯ Nå¦ï¼ |
| | | */ |
| | | @ExcelProperty(value = "ç³»ç»å
ç½®", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "sys_yes_no") |
| | | private String configType; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * é¨é¨åç§° |
| | | */ |
| | | @NotBlank(message = "é¨é¨åç§°ä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 30, message = "é¨é¨åç§°é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String deptName; |
| | | |
| | | /** |
| | | * æ¾ç¤ºé¡ºåº |
| | | */ |
| | | @NotNull(message = "æ¾ç¤ºé¡ºåºä¸è½ä¸ºç©º") |
| | | private Integer orderNum; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * èç³»çµè¯ |
| | | */ |
| | | @Size(min = 0, max = 11, message = "èç³»çµè¯é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String phone; |
| | | |
| | | /** |
| | | * é®ç®± |
| | | */ |
| | | @Email(message = "é®ç®±æ ¼å¼ä¸æ£ç¡®") |
| | | @Size(min = 0, max = 50, message = "é®ç®±é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String email; |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.mybatis.core.domain.BaseEntity; |
| | | import com.ruoyi.common.excel.annotation.ExcelDictFormat; |
| | | import com.ruoyi.common.excel.convert.ExcelDictConvert; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.Size; |
| | | |
| | | /** |
| | | * åå
¸æ°æ®è¡¨ sys_dict_data |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("sys_dict_data") |
| | | @ExcelIgnoreUnannotated |
| | | public class SysDictData extends BaseEntity { |
| | | |
| | | /** |
| | | * åå
¸ç¼ç |
| | | */ |
| | | @ExcelProperty(value = "åå
¸ç¼ç ") |
| | | @TableId(value = "dict_code") |
| | | private Long dictCode; |
| | | |
| | | /** |
| | | * åå
¸æåº |
| | | */ |
| | | @ExcelProperty(value = "åå
¸æåº") |
| | | private Integer dictSort; |
| | | |
| | | /** |
| | | * åå
¸æ ç¾ |
| | | */ |
| | | @ExcelProperty(value = "åå
¸æ ç¾") |
| | | @NotBlank(message = "åå
¸æ ç¾ä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 100, message = "åå
¸æ ç¾é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String dictLabel; |
| | | |
| | | /** |
| | | * åå
¸é®å¼ |
| | | */ |
| | | @ExcelProperty(value = "åå
¸é®å¼") |
| | | @NotBlank(message = "åå
¸é®å¼ä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 100, message = "åå
¸é®å¼é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String dictValue; |
| | | |
| | | /** |
| | | * åå
¸ç±»å |
| | | */ |
| | | @ExcelProperty(value = "åå
¸ç±»å") |
| | | @NotBlank(message = "åå
¸ç±»åä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 100, message = "åå
¸ç±»åé¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String dictType; |
| | | |
| | | /** |
| | | * æ ·å¼å±æ§ï¼å
¶ä»æ ·å¼æ©å±ï¼ |
| | | */ |
| | | @Size(min = 0, max = 100, message = "æ ·å¼å±æ§é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String cssClass; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * æ¯å¦é»è®¤ï¼Yæ¯ Nå¦ï¼ |
| | | */ |
| | | @ExcelProperty(value = "æ¯å¦é»è®¤", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "sys_yes_no") |
| | | private String isDefault; |
| | | |
| | | /** |
| | | * ç¶æï¼0æ£å¸¸ 1åç¨ï¼ |
| | | */ |
| | | @ExcelProperty(value = "ç¶æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "sys_normal_disable") |
| | | private String status; |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.mybatis.core.domain.BaseEntity; |
| | | import com.ruoyi.common.excel.annotation.ExcelDictFormat; |
| | | import com.ruoyi.common.excel.convert.ExcelDictConvert; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.Pattern; |
| | | import jakarta.validation.constraints.Size; |
| | | |
| | | /** |
| | | * åå
¸ç±»å表 sys_dict_type |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("sys_dict_type") |
| | | @ExcelIgnoreUnannotated |
| | | public class SysDictType extends BaseEntity { |
| | | |
| | | /** |
| | | * åå
¸ä¸»é® |
| | | */ |
| | | @ExcelProperty(value = "åå
¸ä¸»é®") |
| | | @TableId(value = "dict_id") |
| | | private Long dictId; |
| | | |
| | | /** |
| | | * åå
¸åç§° |
| | | */ |
| | | @ExcelProperty(value = "åå
¸åç§°") |
| | | @NotBlank(message = "åå
¸åç§°ä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 100, message = "åå
¸ç±»ååç§°é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String dictName; |
| | | |
| | | /** |
| | | * åå
¸ç±»å |
| | | */ |
| | | @ExcelProperty(value = "åå
¸ç±»å") |
| | | @NotBlank(message = "åå
¸ç±»åä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 100, message = "åå
¸ç±»åç±»åé¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "åå
¸ç±»åå¿
须以忝å¼å¤´ï¼ä¸åªè½ä¸ºï¼å°ååæ¯ï¼æ°åï¼ä¸æ»çº¿ï¼") |
| | | private String dictType; |
| | | |
| | | /** |
| | | * ç¶æï¼0æ£å¸¸ 1åç¨ï¼ |
| | | */ |
| | | @ExcelProperty(value = "ç¶æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "sys_normal_disable") |
| | | private String status; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * èååç§° |
| | | */ |
| | | @NotBlank(message = "èååç§°ä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 50, message = "èååç§°é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String menuName; |
| | | |
| | | /** |
| | | * æ¾ç¤ºé¡ºåº |
| | | */ |
| | | @NotNull(message = "æ¾ç¤ºé¡ºåºä¸è½ä¸ºç©º") |
| | | private Integer orderNum; |
| | | |
| | | /** |
| | | * è·¯ç±å°å |
| | | */ |
| | | @Size(min = 0, max = 200, message = "è·¯ç±å°åä¸è½è¶
è¿{max}个å符") |
| | | private String path; |
| | | |
| | | /** |
| | | * ç»ä»¶è·¯å¾ |
| | | */ |
| | | @Size(min = 0, max = 200, message = "ç»ä»¶è·¯å¾ä¸è½è¶
è¿{max}个å符") |
| | | private String component; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * ç±»åï¼Mç®å½ Cèå Fæé®ï¼ |
| | | */ |
| | | @NotBlank(message = "èåç±»åä¸è½ä¸ºç©º") |
| | | private String menuType; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * æéå符串 |
| | | */ |
| | | @JsonInclude(JsonInclude.Include.NON_NULL) |
| | | @Size(min = 0, max = 100, message = "æéæ è¯é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String perms; |
| | | |
| | | /** |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.mybatis.core.domain.BaseEntity; |
| | | import com.ruoyi.common.core.xss.Xss; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.Size; |
| | | |
| | | |
| | | /** |
| | |
| | | /** |
| | | * å
¬åæ é¢ |
| | | */ |
| | | @Xss(message = "å
¬åæ é¢ä¸è½å
å«èæ¬å符") |
| | | @NotBlank(message = "å
¬åæ é¢ä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 50, message = "å
¬åæ é¢ä¸è½è¶
è¿{max}个å符") |
| | | private String noticeTitle; |
| | | |
| | | /** |
| | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("sys_post") |
| | | @ExcelIgnoreUnannotated |
| | | public class SysPost extends BaseEntity { |
| | | |
| | | /** |
| | | * å²ä½åºå· |
| | | */ |
| | | @ExcelProperty(value = "å²ä½åºå·") |
| | | @TableId(value = "post_id") |
| | | private Long postId; |
| | | |
| | | /** |
| | | * å²ä½ç¼ç |
| | | */ |
| | | @ExcelProperty(value = "å²ä½ç¼ç ") |
| | | @NotBlank(message = "å²ä½ç¼ç ä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 64, message = "å²ä½ç¼ç é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String postCode; |
| | | |
| | | /** |
| | | * å²ä½åç§° |
| | | */ |
| | | @ExcelProperty(value = "å²ä½åç§°") |
| | | @NotBlank(message = "å²ä½åç§°ä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 50, message = "å²ä½åç§°é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String postName; |
| | | |
| | | /** |
| | | * å²ä½æåº |
| | | */ |
| | | @ExcelProperty(value = "å²ä½æåº") |
| | | @NotNull(message = "æ¾ç¤ºé¡ºåºä¸è½ä¸ºç©º") |
| | | private Integer postSort; |
| | | |
| | | /** |
| | | * ç¶æï¼0æ£å¸¸ 1åç¨ï¼ |
| | | */ |
| | | @ExcelProperty(value = "ç¶æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "sys_normal_disable") |
| | | private String status; |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.system.domain; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.mybatis.core.domain.BaseEntity; |
| | | import com.ruoyi.common.excel.annotation.ExcelDictFormat; |
| | | import com.ruoyi.common.excel.convert.ExcelDictConvert; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.Size; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.NoArgsConstructor; |
| | |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @TableName("sys_role") |
| | | @ExcelIgnoreUnannotated |
| | | public class SysRole extends BaseEntity { |
| | | |
| | | /** |
| | | * è§è²ID |
| | | */ |
| | | @ExcelProperty(value = "è§è²åºå·") |
| | | @TableId(value = "role_id") |
| | | private Long roleId; |
| | | |
| | | /** |
| | | * è§è²åç§° |
| | | */ |
| | | @ExcelProperty(value = "è§è²åç§°") |
| | | @NotBlank(message = "è§è²åç§°ä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 30, message = "è§è²åç§°é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String roleName; |
| | | |
| | | /** |
| | | * è§è²æé |
| | | */ |
| | | @ExcelProperty(value = "è§è²æé") |
| | | @NotBlank(message = "æéå符ä¸è½ä¸ºç©º") |
| | | @Size(min = 0, max = 100, message = "æéå符é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String roleKey; |
| | | |
| | | /** |
| | | * è§è²æåº |
| | | */ |
| | | @ExcelProperty(value = "è§è²æåº") |
| | | @NotNull(message = "æ¾ç¤ºé¡ºåºä¸è½ä¸ºç©º") |
| | | private Integer roleSort; |
| | | |
| | | /** |
| | | * æ°æ®èå´ï¼1ï¼æææ°æ®æéï¼2ï¼èªå®ä¹æ°æ®æéï¼3ï¼æ¬é¨é¨æ°æ®æéï¼4ï¼æ¬é¨é¨å以䏿°æ®æéï¼5ï¼ä»
æ¬äººæ°æ®æéï¼ |
| | | */ |
| | | @ExcelProperty(value = "æ°æ®èå´", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(readConverterExp = "1=æææ°æ®æé,2=èªå®ä¹æ°æ®æé,3=æ¬é¨é¨æ°æ®æé,4=æ¬é¨é¨å以䏿°æ®æé,5=ä»
æ¬äººæ°æ®æé") |
| | | private String dataScope; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * è§è²ç¶æï¼0æ£å¸¸ 1åç¨ï¼ |
| | | */ |
| | | @ExcelProperty(value = "è§è²ç¶æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "sys_normal_disable") |
| | | private String status; |
| | | |
| | | /** |
| | |
| | | this.roleId = roleId; |
| | | } |
| | | |
| | | public boolean isAdmin() { |
| | | return UserConstants.SUPER_ADMIN_ID.equals(this.roleId); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.bo; |
| | | |
| | | import com.ruoyi.common.core.validate.AddGroup; |
| | | import com.ruoyi.common.core.validate.EditGroup; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import jakarta.validation.constraints.*; |
| | | |
| | | import com.ruoyi.common.mybatis.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * åæ°é
ç½®ä¸å¡å¯¹è±¡ sys_config |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-01-31 |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class SysConfigBo extends BaseEntity { |
| | | |
| | | /** |
| | | * åæ°ä¸»é® |
| | | */ |
| | | @NotNull(message = "忰䏻é®ä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long configId; |
| | | |
| | | /** |
| | | * åæ°åç§° |
| | | */ |
| | | @NotBlank(message = "åæ°åç§°ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 0, max = 100, message = "åæ°åç§°ä¸è½è¶
è¿{max}个å符") |
| | | private String configName; |
| | | |
| | | /** |
| | | * åæ°é®å |
| | | */ |
| | | @NotBlank(message = "åæ°é®åä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 0, max = 100, message = "åæ°é®åé¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String configKey; |
| | | |
| | | /** |
| | | * åæ°é®å¼ |
| | | */ |
| | | @NotBlank(message = "åæ°é®å¼ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 0, max = 500, message = "åæ°é®å¼é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String configValue; |
| | | |
| | | /** |
| | | * ç³»ç»å
ç½®ï¼Yæ¯ Nå¦ï¼ |
| | | */ |
| | | private String configType; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.bo; |
| | | |
| | | import com.ruoyi.common.core.validate.AddGroup; |
| | | import com.ruoyi.common.core.validate.EditGroup; |
| | | import com.ruoyi.common.mybatis.core.domain.TreeEntity; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import jakarta.validation.constraints.*; |
| | | |
| | | /** |
| | | * é¨é¨ä¸å¡å¯¹è±¡ sys_dept |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-01-31 |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class SysDeptBo extends TreeEntity<SysDeptBo> { |
| | | |
| | | /** |
| | | * é¨é¨id |
| | | */ |
| | | @NotNull(message = "é¨é¨idä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long deptId; |
| | | |
| | | /** |
| | | * é¨é¨åç§° |
| | | */ |
| | | @NotBlank(message = "é¨é¨åç§°ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 0, max = 30, message = "é¨é¨åç§°é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String deptName; |
| | | |
| | | /** |
| | | * æ¾ç¤ºé¡ºåº |
| | | */ |
| | | @NotNull(message = "æ¾ç¤ºé¡ºåºä¸è½ä¸ºç©º") |
| | | private Long orderNum; |
| | | |
| | | /** |
| | | * è´è´£äºº |
| | | */ |
| | | private String leader; |
| | | |
| | | /** |
| | | * èç³»çµè¯ |
| | | */ |
| | | @Size(min = 0, max = 11, message = "èç³»çµè¯é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String phone; |
| | | |
| | | /** |
| | | * é®ç®± |
| | | */ |
| | | @Email(message = "é®ç®±æ ¼å¼ä¸æ£ç¡®") |
| | | @Size(min = 0, max = 50, message = "é®ç®±é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String email; |
| | | |
| | | /** |
| | | * é¨é¨ç¶æï¼0æ£å¸¸ 1åç¨ï¼ |
| | | */ |
| | | private String status; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.bo; |
| | | |
| | | import com.ruoyi.common.core.validate.AddGroup; |
| | | import com.ruoyi.common.core.validate.EditGroup; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import jakarta.validation.constraints.*; |
| | | |
| | | import com.ruoyi.common.mybatis.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * åå
¸æ°æ®ä¸å¡å¯¹è±¡ sys_dict_data |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-02-01 |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class SysDictDataBo extends BaseEntity { |
| | | |
| | | /** |
| | | * åå
¸ç¼ç |
| | | */ |
| | | @NotNull(message = "åå
¸ç¼ç ä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long dictCode; |
| | | |
| | | /** |
| | | * åå
¸æåº |
| | | */ |
| | | private Integer dictSort; |
| | | |
| | | /** |
| | | * åå
¸æ ç¾ |
| | | */ |
| | | @NotBlank(message = "åå
¸æ ç¾ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 0, max = 100, message = "åå
¸æ ç¾é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String dictLabel; |
| | | |
| | | /** |
| | | * åå
¸é®å¼ |
| | | */ |
| | | @NotBlank(message = "åå
¸é®å¼ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 0, max = 100, message = "åå
¸é®å¼é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String dictValue; |
| | | |
| | | /** |
| | | * åå
¸ç±»å |
| | | */ |
| | | @NotBlank(message = "åå
¸ç±»åä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 0, max = 100, message = "åå
¸ç±»åé¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String dictType; |
| | | |
| | | /** |
| | | * æ ·å¼å±æ§ï¼å
¶ä»æ ·å¼æ©å±ï¼ |
| | | */ |
| | | @Size(min = 0, max = 100, message = "æ ·å¼å±æ§é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String cssClass; |
| | | |
| | | /** |
| | | * è¡¨æ ¼åæ¾æ ·å¼ |
| | | */ |
| | | private String listClass; |
| | | |
| | | /** |
| | | * æ¯å¦é»è®¤ï¼Yæ¯ Nå¦ï¼ |
| | | */ |
| | | private String isDefault; |
| | | |
| | | /** |
| | | * ç¶æï¼0æ£å¸¸ 1åç¨ï¼ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * å建é¨é¨ |
| | | */ |
| | | private Long createDept; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.bo; |
| | | |
| | | import com.ruoyi.common.core.validate.AddGroup; |
| | | import com.ruoyi.common.core.validate.EditGroup; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import jakarta.validation.constraints.*; |
| | | |
| | | import com.ruoyi.common.mybatis.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * åå
¸ç±»åä¸å¡å¯¹è±¡ sys_dict_type |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-02-01 |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class SysDictTypeBo extends BaseEntity { |
| | | |
| | | /** |
| | | * åå
¸ä¸»é® |
| | | */ |
| | | @NotNull(message = "åå
¸ä¸»é®ä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long dictId; |
| | | |
| | | /** |
| | | * åå
¸åç§° |
| | | */ |
| | | @NotBlank(message = "åå
¸åç§°ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 0, max = 100, message = "åå
¸ç±»ååç§°é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String dictName; |
| | | |
| | | /** |
| | | * åå
¸ç±»å |
| | | */ |
| | | @NotBlank(message = "åå
¸ç±»åä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 0, max = 100, message = "åå
¸ç±»åç±»åé¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | @Pattern(regexp = "^[a-z][a-z0-9_]*$", message = "åå
¸ç±»åå¿
须以忝å¼å¤´ï¼ä¸åªè½ä¸ºï¼å°ååæ¯ï¼æ°åï¼ä¸æ»çº¿ï¼") |
| | | private String dictType; |
| | | |
| | | /** |
| | | * ç¶æï¼0æ£å¸¸ 1åç¨ï¼ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * å建é¨é¨ |
| | | */ |
| | | private Long createDept; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.bo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonInclude; |
| | | import com.ruoyi.common.core.validate.AddGroup; |
| | | import com.ruoyi.common.core.validate.EditGroup; |
| | | import com.ruoyi.common.mybatis.core.domain.TreeEntity; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import jakarta.validation.constraints.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.ruoyi.common.mybatis.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * èåæéä¸å¡å¯¹è±¡ sys_menu |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-02-01 |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class SysMenuBo extends TreeEntity<SysMenuBo> { |
| | | |
| | | /** |
| | | * èåID |
| | | */ |
| | | @NotNull(message = "èåIDä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long menuId; |
| | | |
| | | /** |
| | | * èååç§° |
| | | */ |
| | | @NotBlank(message = "èååç§°ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 0, max = 50, message = "èååç§°é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String menuName; |
| | | |
| | | /** |
| | | * æ¾ç¤ºé¡ºåº |
| | | */ |
| | | @NotNull(message = "æ¾ç¤ºé¡ºåºä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Integer orderNum; |
| | | |
| | | /** |
| | | * è·¯ç±å°å |
| | | */ |
| | | @Size(min = 0, max = 200, message = "è·¯ç±å°åä¸è½è¶
è¿{max}个å符") |
| | | private String path; |
| | | |
| | | /** |
| | | * ç»ä»¶è·¯å¾ |
| | | */ |
| | | @Size(min = 0, max = 200, message = "ç»ä»¶è·¯å¾ä¸è½è¶
è¿{max}个å符") |
| | | private String component; |
| | | |
| | | /** |
| | | * è·¯ç±åæ° |
| | | */ |
| | | private String queryParam; |
| | | |
| | | /** |
| | | * æ¯å¦ä¸ºå¤é¾ï¼0æ¯ 1å¦ï¼ |
| | | */ |
| | | private Integer isFrame; |
| | | |
| | | /** |
| | | * æ¯å¦ç¼åï¼0ç¼å 1ä¸ç¼åï¼ |
| | | */ |
| | | private Integer isCache; |
| | | |
| | | /** |
| | | * èåç±»åï¼Mç®å½ Cèå Fæé®ï¼ |
| | | */ |
| | | @NotBlank(message = "èåç±»åä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String menuType; |
| | | |
| | | /** |
| | | * æ¾ç¤ºç¶æï¼0æ¾ç¤º 1éèï¼ |
| | | */ |
| | | private String visible; |
| | | |
| | | /** |
| | | * èåç¶æï¼0æ£å¸¸ 1åç¨ï¼ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * æéæ è¯ |
| | | */ |
| | | @JsonInclude(JsonInclude.Include.NON_NULL) |
| | | @Size(min = 0, max = 100, message = "æéæ è¯é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String perms; |
| | | |
| | | /** |
| | | * èå徿 |
| | | */ |
| | | private String icon; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.bo; |
| | | |
| | | import com.ruoyi.common.core.validate.AddGroup; |
| | | import com.ruoyi.common.core.validate.EditGroup; |
| | | import com.ruoyi.common.core.xss.Xss; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import jakarta.validation.constraints.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.ruoyi.common.mybatis.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * éç¥å
¬åä¸å¡å¯¹è±¡ sys_notice |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-02-01 |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class SysNoticeBo extends BaseEntity { |
| | | |
| | | /** |
| | | * å
ŒID |
| | | */ |
| | | @NotNull(message = "å
¬åIDä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long noticeId; |
| | | |
| | | /** |
| | | * å
¬åæ é¢ |
| | | */ |
| | | @Xss(message = "å
¬åæ é¢ä¸è½å
å«èæ¬å符") |
| | | @NotBlank(message = "å
¬åæ é¢ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 0, max = 50, message = "å
¬åæ é¢ä¸è½è¶
è¿{max}个å符") |
| | | private String noticeTitle; |
| | | |
| | | /** |
| | | * å
¬åç±»åï¼1éç¥ 2å
¬åï¼ |
| | | */ |
| | | private String noticeType; |
| | | |
| | | /** |
| | | * å
¬åå
容 |
| | | */ |
| | | private String noticeContent; |
| | | |
| | | /** |
| | | * å
¬åç¶æï¼0æ£å¸¸ 1å
³éï¼ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.bo; |
| | | |
| | | import com.ruoyi.common.core.validate.AddGroup; |
| | | import com.ruoyi.common.core.validate.EditGroup; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import jakarta.validation.constraints.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.ruoyi.common.mybatis.core.domain.BaseEntity; |
| | | |
| | | /** |
| | | * å²ä½ä¿¡æ¯ä¸å¡å¯¹è±¡ sys_post |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-02-01 |
| | | */ |
| | | |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class SysPostBo extends BaseEntity { |
| | | |
| | | /** |
| | | * å²ä½ID |
| | | */ |
| | | @NotNull(message = "å²ä½IDä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long postId; |
| | | |
| | | /** |
| | | * å²ä½ç¼ç |
| | | */ |
| | | @NotBlank(message = "å²ä½ç¼ç ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 0, max = 64, message = "å²ä½ç¼ç é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String postCode; |
| | | |
| | | /** |
| | | * å²ä½åç§° |
| | | */ |
| | | @NotBlank(message = "å²ä½åç§°ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 0, max = 50, message = "å²ä½åç§°é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String postName; |
| | | |
| | | /** |
| | | * æ¾ç¤ºé¡ºåº |
| | | */ |
| | | @NotNull(message = "æ¾ç¤ºé¡ºåºä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Integer postSort; |
| | | |
| | | /** |
| | | * ç¶æï¼0æ£å¸¸ 1åç¨ï¼ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.bo; |
| | | |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.core.validate.AddGroup; |
| | | import com.ruoyi.common.core.validate.EditGroup; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import jakarta.validation.constraints.*; |
| | | |
| | | import com.ruoyi.common.mybatis.core.domain.BaseEntity; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | /** |
| | | * è§è²ä¿¡æ¯ä¸å¡å¯¹è±¡ sys_role |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-02-01 |
| | | */ |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class SysRoleBo extends BaseEntity { |
| | | |
| | | /** |
| | | * è§è²ID |
| | | */ |
| | | @NotNull(message = "è§è²IDä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long roleId; |
| | | |
| | | /** |
| | | * è§è²åç§° |
| | | */ |
| | | @NotBlank(message = "è§è²åç§°ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 0, max = 30, message = "è§è²åç§°é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String roleName; |
| | | |
| | | /** |
| | | * è§è²æéå符串 |
| | | */ |
| | | @NotBlank(message = "è§è²æéå符串ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | @Size(min = 0, max = 100, message = "æéå符é¿åº¦ä¸è½è¶
è¿{max}个å符") |
| | | private String roleKey; |
| | | |
| | | /** |
| | | * æ¾ç¤ºé¡ºåº |
| | | */ |
| | | @NotNull(message = "æ¾ç¤ºé¡ºåºä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private Integer roleSort; |
| | | |
| | | /** |
| | | * æ°æ®èå´ï¼1ï¼å
¨é¨æ°æ®æé 2ï¼èªå®æ°æ®æé 3ï¼æ¬é¨é¨æ°æ®æé 4ï¼æ¬é¨é¨å以䏿°æ®æéï¼ |
| | | */ |
| | | private String dataScope; |
| | | |
| | | /** |
| | | * èåæ éæ©é¡¹æ¯å¦å
³èæ¾ç¤º |
| | | */ |
| | | private Boolean menuCheckStrictly; |
| | | |
| | | /** |
| | | * é¨é¨æ 鿩项æ¯å¦å
³èæ¾ç¤º |
| | | */ |
| | | private Boolean deptCheckStrictly; |
| | | |
| | | /** |
| | | * è§è²ç¶æï¼0æ£å¸¸ 1åç¨ï¼ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | public SysRoleBo(Long roleId) { |
| | | this.roleId = roleId; |
| | | } |
| | | |
| | | public boolean isAdmin() { |
| | | return UserConstants.SUPER_ADMIN_ID.equals(this.roleId); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.bo; |
| | | |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.core.validate.AddGroup; |
| | | import com.ruoyi.common.core.validate.EditGroup; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import jakarta.validation.constraints.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.ruoyi.common.mybatis.core.domain.BaseEntity; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | /** |
| | | * ç¨æ·ä¿¡æ¯ä¸å¡å¯¹è±¡ sys_user |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-02-01 |
| | | */ |
| | | |
| | | @Data |
| | | @NoArgsConstructor |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class SysUserBo extends BaseEntity { |
| | | |
| | | /** |
| | | * ç¨æ·ID |
| | | */ |
| | | @NotNull(message = "ç¨æ·IDä¸è½ä¸ºç©º", groups = { EditGroup.class }) |
| | | private Long userId; |
| | | |
| | | /** |
| | | * é¨é¨ID |
| | | */ |
| | | private Long deptId; |
| | | |
| | | /** |
| | | * ç¨æ·è´¦å· |
| | | */ |
| | | @NotBlank(message = "ç¨æ·è´¦å·ä¸è½ä¸ºç©º", groups = { AddGroup.class, EditGroup.class }) |
| | | private String userName; |
| | | |
| | | /** |
| | | * ç¨æ·æµç§° |
| | | */ |
| | | private String nickName; |
| | | |
| | | /** |
| | | * ç¨æ·ç±»åï¼sys_userç³»ç»ç¨æ·ï¼ |
| | | */ |
| | | private String userType; |
| | | |
| | | /** |
| | | * ç¨æ·é®ç®± |
| | | */ |
| | | private String email; |
| | | |
| | | /** |
| | | * ææºå·ç |
| | | */ |
| | | private String phonenumber; |
| | | |
| | | /** |
| | | * ç¨æ·æ§å«ï¼0ç· 1女 2æªç¥ï¼ |
| | | */ |
| | | private String sex; |
| | | |
| | | /** |
| | | * 头åå°å |
| | | */ |
| | | private String avatar; |
| | | |
| | | /** |
| | | * å¯ç |
| | | */ |
| | | private String password; |
| | | |
| | | /** |
| | | * å¸å·ç¶æï¼0æ£å¸¸ 1åç¨ï¼ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * æåç»å½IP |
| | | */ |
| | | private String loginIp; |
| | | |
| | | /** |
| | | * æåç»å½æ¶é´ |
| | | */ |
| | | private Date loginDate; |
| | | |
| | | /** |
| | | * å建é¨é¨ |
| | | */ |
| | | private Long createDept; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * è§è²ç» |
| | | */ |
| | | private Long[] roleIds; |
| | | |
| | | /** |
| | | * å²ä½ç» |
| | | */ |
| | | private Long[] postIds; |
| | | |
| | | /** |
| | | * æ°æ®æé å½åè§è²ID |
| | | */ |
| | | private Long roleId; |
| | | |
| | | public SysUserBo(Long userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public boolean isAdmin() { |
| | | return UserConstants.SUPER_ADMIN_ID.equals(this.userId); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.ruoyi.common.excel.annotation.ExcelDictFormat; |
| | | import com.ruoyi.common.excel.convert.ExcelDictConvert; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * åæ°é
ç½®è§å¾å¯¹è±¡ sys_config |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-01-31 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class SysConfigVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * åæ°ä¸»é® |
| | | */ |
| | | @ExcelProperty(value = "忰䏻é®") |
| | | private Long configId; |
| | | |
| | | /** |
| | | * åæ°åç§° |
| | | */ |
| | | @ExcelProperty(value = "åæ°åç§°") |
| | | private String configName; |
| | | |
| | | /** |
| | | * åæ°é®å |
| | | */ |
| | | @ExcelProperty(value = "åæ°é®å") |
| | | private String configKey; |
| | | |
| | | /** |
| | | * åæ°é®å¼ |
| | | */ |
| | | @ExcelProperty(value = "åæ°é®å¼") |
| | | private String configValue; |
| | | |
| | | /** |
| | | * ç³»ç»å
ç½®ï¼Yæ¯ Nå¦ï¼ |
| | | */ |
| | | @ExcelProperty(value = "ç³»ç»å
ç½®", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "sys_yes_no") |
| | | private String configType; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.ruoyi.common.excel.annotation.ExcelDictFormat; |
| | | import com.ruoyi.common.excel.convert.ExcelDictConvert; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * é¨é¨è§å¾å¯¹è±¡ sys_dept |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-01-31 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class SysDeptVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * é¨é¨id |
| | | */ |
| | | @ExcelProperty(value = "é¨é¨id") |
| | | private Long deptId; |
| | | |
| | | /** |
| | | * ç¶é¨é¨id |
| | | */ |
| | | private Long parentId; |
| | | |
| | | /** |
| | | * ç¶é¨é¨åç§° |
| | | */ |
| | | private String parentName; |
| | | |
| | | /** |
| | | * ç¥çº§å表 |
| | | */ |
| | | private String ancestors; |
| | | |
| | | /** |
| | | * é¨é¨åç§° |
| | | */ |
| | | @ExcelProperty(value = "é¨é¨åç§°") |
| | | private String deptName; |
| | | |
| | | /** |
| | | * æ¾ç¤ºé¡ºåº |
| | | */ |
| | | private Long orderNum; |
| | | |
| | | /** |
| | | * è´è´£äºº |
| | | */ |
| | | @ExcelProperty(value = "è´è´£äºº") |
| | | private String leader; |
| | | |
| | | /** |
| | | * èç³»çµè¯ |
| | | */ |
| | | @ExcelProperty(value = "èç³»çµè¯") |
| | | private String phone; |
| | | |
| | | /** |
| | | * é®ç®± |
| | | */ |
| | | @ExcelProperty(value = "é®ç®±") |
| | | private String email; |
| | | |
| | | /** |
| | | * é¨é¨ç¶æï¼0æ£å¸¸ 1åç¨ï¼ |
| | | */ |
| | | @ExcelProperty(value = "é¨é¨ç¶æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "sys_normal_disable") |
| | | private String status; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.ruoyi.common.excel.annotation.ExcelDictFormat; |
| | | import com.ruoyi.common.excel.convert.ExcelDictConvert; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * åå
¸æ°æ®è§å¾å¯¹è±¡ sys_dict_data |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-02-01 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class SysDictDataVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * åå
¸ç¼ç |
| | | */ |
| | | @ExcelProperty(value = "åå
¸ç¼ç ") |
| | | private Long dictCode; |
| | | |
| | | /** |
| | | * åå
¸æåº |
| | | */ |
| | | @ExcelProperty(value = "åå
¸æåº") |
| | | private Integer dictSort; |
| | | |
| | | /** |
| | | * åå
¸æ ç¾ |
| | | */ |
| | | @ExcelProperty(value = "åå
¸æ ç¾") |
| | | private String dictLabel; |
| | | |
| | | /** |
| | | * åå
¸é®å¼ |
| | | */ |
| | | @ExcelProperty(value = "åå
¸é®å¼") |
| | | private String dictValue; |
| | | |
| | | /** |
| | | * åå
¸ç±»å |
| | | */ |
| | | @ExcelProperty(value = "åå
¸ç±»å") |
| | | private String dictType; |
| | | |
| | | /** |
| | | * æ ·å¼å±æ§ï¼å
¶ä»æ ·å¼æ©å±ï¼ |
| | | */ |
| | | private String cssClass; |
| | | |
| | | /** |
| | | * è¡¨æ ¼åæ¾æ ·å¼ |
| | | */ |
| | | private String listClass; |
| | | |
| | | /** |
| | | * æ¯å¦é»è®¤ï¼Yæ¯ Nå¦ï¼ |
| | | */ |
| | | @ExcelProperty(value = "æ¯å¦é»è®¤", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "sys_yes_no") |
| | | private String isDefault; |
| | | |
| | | /** |
| | | * ç¶æï¼0æ£å¸¸ 1åç¨ï¼ |
| | | */ |
| | | @ExcelProperty(value = "ç¶æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "sys_normal_disable") |
| | | private String status; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.ruoyi.common.excel.annotation.ExcelDictFormat; |
| | | import com.ruoyi.common.excel.convert.ExcelDictConvert; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * åå
¸ç±»åè§å¾å¯¹è±¡ sys_dict_type |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-02-01 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class SysDictTypeVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * åå
¸ä¸»é® |
| | | */ |
| | | @ExcelProperty(value = "åå
¸ä¸»é®") |
| | | private Long dictId; |
| | | |
| | | /** |
| | | * åå
¸åç§° |
| | | */ |
| | | @ExcelProperty(value = "åå
¸åç§°") |
| | | private String dictName; |
| | | |
| | | /** |
| | | * åå
¸ç±»å |
| | | */ |
| | | @ExcelProperty(value = "åå
¸ç±»å") |
| | | private String dictType; |
| | | |
| | | /** |
| | | * ç¶æï¼0æ£å¸¸ 1åç¨ï¼ |
| | | */ |
| | | @ExcelProperty(value = "ç¶æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "sys_normal_disable") |
| | | private String status; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.vo; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | |
| | | /** |
| | | * èåæéè§å¾å¯¹è±¡ sys_menu |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-02-01 |
| | | */ |
| | | @Data |
| | | public class SysMenuVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * èåID |
| | | */ |
| | | private Long menuId; |
| | | |
| | | /** |
| | | * èååç§° |
| | | */ |
| | | private String menuName; |
| | | |
| | | /** |
| | | * ç¶èåID |
| | | */ |
| | | private Long parentId; |
| | | |
| | | /** |
| | | * æ¾ç¤ºé¡ºåº |
| | | */ |
| | | private Integer orderNum; |
| | | |
| | | /** |
| | | * è·¯ç±å°å |
| | | */ |
| | | private String path; |
| | | |
| | | /** |
| | | * ç»ä»¶è·¯å¾ |
| | | */ |
| | | private String component; |
| | | |
| | | /** |
| | | * è·¯ç±åæ° |
| | | */ |
| | | private String queryParam; |
| | | |
| | | /** |
| | | * æ¯å¦ä¸ºå¤é¾ï¼0æ¯ 1å¦ï¼ |
| | | */ |
| | | private String isFrame; |
| | | |
| | | /** |
| | | * æ¯å¦ç¼åï¼0ç¼å 1ä¸ç¼åï¼ |
| | | */ |
| | | private String isCache; |
| | | |
| | | /** |
| | | * èåç±»åï¼Mç®å½ Cèå Fæé®ï¼ |
| | | */ |
| | | private String menuType; |
| | | |
| | | /** |
| | | * æ¾ç¤ºç¶æï¼0æ¾ç¤º 1éèï¼ |
| | | */ |
| | | private String visible; |
| | | |
| | | /** |
| | | * èåç¶æï¼0æ£å¸¸ 1åç¨ï¼ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * æéæ è¯ |
| | | */ |
| | | private String perms; |
| | | |
| | | /** |
| | | * èå徿 |
| | | */ |
| | | private String icon; |
| | | |
| | | /** |
| | | * å建é¨é¨ |
| | | */ |
| | | private Long createDept; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | private Date createTime; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.ruoyi.common.excel.annotation.ExcelDictFormat; |
| | | import com.ruoyi.common.excel.convert.ExcelDictConvert; |
| | | import com.ruoyi.common.translation.annotation.Translation; |
| | | import com.ruoyi.common.translation.constant.TransConstant; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | |
| | | /** |
| | | * éç¥å
¬åè§å¾å¯¹è±¡ sys_notice |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-02-01 |
| | | */ |
| | | @Data |
| | | public class SysNoticeVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * å
ŒID |
| | | */ |
| | | private Long noticeId; |
| | | |
| | | /** |
| | | * å
¬åæ é¢ |
| | | */ |
| | | private String noticeTitle; |
| | | |
| | | /** |
| | | * å
¬åç±»åï¼1éç¥ 2å
¬åï¼ |
| | | */ |
| | | private String noticeType; |
| | | |
| | | /** |
| | | * å
¬åå
容 |
| | | */ |
| | | private String noticeContent; |
| | | |
| | | /** |
| | | * å
¬åç¶æï¼0æ£å¸¸ 1å
³éï¼ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * å建è
|
| | | */ |
| | | @Translation(type = TransConstant.USER_ID_TO_NAME) |
| | | private Long createBy; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | private Date createTime; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.ruoyi.common.excel.annotation.ExcelDictFormat; |
| | | import com.ruoyi.common.excel.convert.ExcelDictConvert; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | |
| | | |
| | | /** |
| | | * å²ä½ä¿¡æ¯è§å¾å¯¹è±¡ sys_post |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-02-01 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class SysPostVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * å²ä½ID |
| | | */ |
| | | @ExcelProperty(value = "å²ä½åºå·") |
| | | private Long postId; |
| | | |
| | | /** |
| | | * å²ä½ç¼ç |
| | | */ |
| | | @ExcelProperty(value = "å²ä½ç¼ç ") |
| | | private String postCode; |
| | | |
| | | /** |
| | | * å²ä½åç§° |
| | | */ |
| | | @ExcelProperty(value = "å²ä½åç§°") |
| | | private String postName; |
| | | |
| | | /** |
| | | * æ¾ç¤ºé¡ºåº |
| | | */ |
| | | @ExcelProperty(value = "å²ä½æåº") |
| | | private Integer postSort; |
| | | |
| | | /** |
| | | * ç¶æï¼0æ£å¸¸ 1åç¨ï¼ |
| | | */ |
| | | @ExcelProperty(value = "ç¶æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "sys_normal_disable") |
| | | private String status; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.vo; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.excel.annotation.ExcelDictFormat; |
| | | import com.ruoyi.common.excel.convert.ExcelDictConvert; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * è§è²ä¿¡æ¯è§å¾å¯¹è±¡ sys_role |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-02-01 |
| | | */ |
| | | @Data |
| | | @ExcelIgnoreUnannotated |
| | | public class SysRoleVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * è§è²ID |
| | | */ |
| | | @ExcelProperty(value = "è§è²åºå·") |
| | | private Long roleId; |
| | | |
| | | /** |
| | | * è§è²åç§° |
| | | */ |
| | | @ExcelProperty(value = "è§è²åç§°") |
| | | private String roleName; |
| | | |
| | | /** |
| | | * è§è²æéå符串 |
| | | */ |
| | | @ExcelProperty(value = "è§è²æé") |
| | | private String roleKey; |
| | | |
| | | /** |
| | | * æ¾ç¤ºé¡ºåº |
| | | */ |
| | | @ExcelProperty(value = "è§è²æåº") |
| | | private Integer roleSort; |
| | | |
| | | /** |
| | | * æ°æ®èå´ï¼1ï¼å
¨é¨æ°æ®æé 2ï¼èªå®æ°æ®æé 3ï¼æ¬é¨é¨æ°æ®æé 4ï¼æ¬é¨é¨å以䏿°æ®æéï¼ |
| | | */ |
| | | @ExcelProperty(value = "æ°æ®èå´", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(readConverterExp = "1=æææ°æ®æé,2=èªå®ä¹æ°æ®æé,3=æ¬é¨é¨æ°æ®æé,4=æ¬é¨é¨å以䏿°æ®æé,5=ä»
æ¬äººæ°æ®æé") |
| | | private String dataScope; |
| | | |
| | | /** |
| | | * èåæ éæ©é¡¹æ¯å¦å
³èæ¾ç¤º |
| | | */ |
| | | @ExcelProperty(value = "èåæ éæ©é¡¹æ¯å¦å
³èæ¾ç¤º") |
| | | private Boolean menuCheckStrictly; |
| | | |
| | | /** |
| | | * é¨é¨æ 鿩项æ¯å¦å
³èæ¾ç¤º |
| | | */ |
| | | @ExcelProperty(value = "é¨é¨æ 鿩项æ¯å¦å
³èæ¾ç¤º") |
| | | private Boolean deptCheckStrictly; |
| | | |
| | | /** |
| | | * è§è²ç¶æï¼0æ£å¸¸ 1åç¨ï¼ |
| | | */ |
| | | @ExcelProperty(value = "è§è²ç¶æ", converter = ExcelDictConvert.class) |
| | | @ExcelDictFormat(dictType = "sys_normal_disable") |
| | | private String status; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ExcelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @ExcelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * ç¨æ·æ¯å¦å卿¤è§è²æ è¯ é»è®¤ä¸åå¨ |
| | | */ |
| | | private boolean flag = false; |
| | | |
| | | /** |
| | | * è§è²èåæé |
| | | */ |
| | | private Set<String> permissions; |
| | | |
| | | public boolean isAdmin() { |
| | | return UserConstants.SUPER_ADMIN_ID.equals(this.roleId); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.ruoyi.system.domain.vo; |
| | | |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serial; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * ç¨æ·ä¿¡æ¯è§å¾å¯¹è±¡ sys_user |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-02-01 |
| | | */ |
| | | @Data |
| | | public class SysUserVo implements Serializable { |
| | | |
| | | @Serial |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ç¨æ·ID |
| | | */ |
| | | private Long userId; |
| | | |
| | | /** |
| | | * é¨é¨ID |
| | | */ |
| | | private Long deptId; |
| | | |
| | | /** |
| | | * ç¨æ·è´¦å· |
| | | */ |
| | | private String userName; |
| | | |
| | | /** |
| | | * ç¨æ·æµç§° |
| | | */ |
| | | private String nickName; |
| | | |
| | | /** |
| | | * ç¨æ·ç±»åï¼sys_userç³»ç»ç¨æ·ï¼ |
| | | */ |
| | | private String userType; |
| | | |
| | | /** |
| | | * ç¨æ·é®ç®± |
| | | */ |
| | | private String email; |
| | | |
| | | /** |
| | | * ææºå·ç |
| | | */ |
| | | private String phonenumber; |
| | | |
| | | /** |
| | | * ç¨æ·æ§å«ï¼0ç· 1女 2æªç¥ï¼ |
| | | */ |
| | | private String sex; |
| | | |
| | | /** |
| | | * 头åå°å |
| | | */ |
| | | private String avatar; |
| | | |
| | | /** |
| | | * å¯ç |
| | | */ |
| | | private String password; |
| | | |
| | | /** |
| | | * å¸å·ç¶æï¼0æ£å¸¸ 1åç¨ï¼ |
| | | */ |
| | | private String status; |
| | | |
| | | /** |
| | | * æåç»å½IP |
| | | */ |
| | | private String loginIp; |
| | | |
| | | /** |
| | | * æåç»å½æ¶é´ |
| | | */ |
| | | private Date loginDate; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | private String remark; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * é¨é¨å¯¹è±¡ |
| | | */ |
| | | private SysDeptVo dept; |
| | | |
| | | /** |
| | | * è§è²å¯¹è±¡ |
| | | */ |
| | | private List<SysRoleVo> roles; |
| | | |
| | | /** |
| | | * è§è²ç» |
| | | */ |
| | | private Long[] roleIds; |
| | | |
| | | /** |
| | | * å²ä½ç» |
| | | */ |
| | | private Long[] postIds; |
| | | |
| | | /** |
| | | * æ°æ®æé å½åè§è²ID |
| | | */ |
| | | private Long roleId; |
| | | |
| | | public boolean isAdmin() { |
| | | return UserConstants.SUPER_ADMIN_ID.equals(this.userId); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.mybatis.core.mapper.BaseMapperPlus; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.domain.vo.SysConfigVo; |
| | | |
| | | /** |
| | | * åæ°é
ç½® æ°æ®å± |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | public interface SysConfigMapper extends BaseMapperPlus<SysConfigMapper, SysConfig, SysConfig> { |
| | | public interface SysConfigMapper extends BaseMapperPlus<SysConfigMapper, SysConfig, SysConfigVo> { |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.mybatis.annotation.DataPermission; |
| | | import com.ruoyi.common.mybatis.core.mapper.BaseMapperPlus; |
| | | import com.ruoyi.system.domain.SysDept; |
| | | import com.ruoyi.system.domain.vo.SysDeptVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | public interface SysDeptMapper extends BaseMapperPlus<SysDeptMapper, SysDept, SysDept> { |
| | | public interface SysDeptMapper extends BaseMapperPlus<SysDeptMapper, SysDept, SysDeptVo> { |
| | | |
| | | /** |
| | | * æ¥è¯¢é¨é¨ç®¡çæ°æ® |
| | |
| | | @DataPermission({ |
| | | @DataColumn(key = "deptName", value = "dept_id") |
| | | }) |
| | | List<SysDept> selectDeptList(@Param(Constants.WRAPPER) Wrapper<SysDept> queryWrapper); |
| | | List<SysDeptVo> selectDeptList(@Param(Constants.WRAPPER) Wrapper<SysDept> queryWrapper); |
| | | |
| | | /** |
| | | * æ ¹æ®è§è²IDæ¥è¯¢é¨é¨æ ä¿¡æ¯ |
| | |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.system.domain.SysDictData; |
| | | import com.ruoyi.common.mybatis.core.mapper.BaseMapperPlus; |
| | | import com.ruoyi.system.domain.vo.SysDictDataVo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | public interface SysDictDataMapper extends BaseMapperPlus<SysDictDataMapper, SysDictData, SysDictData> { |
| | | public interface SysDictDataMapper extends BaseMapperPlus<SysDictDataMapper, SysDictData, SysDictDataVo> { |
| | | |
| | | default List<SysDictData> selectDictDataByType(String dictType) { |
| | | return selectList( |
| | | default List<SysDictDataVo> selectDictDataByType(String dictType) { |
| | | return selectVoList( |
| | | new LambdaQueryWrapper<SysDictData>() |
| | | .eq(SysDictData::getStatus, UserConstants.DICT_NORMAL) |
| | | .eq(SysDictData::getDictType, dictType) |
| | |
| | | |
| | | import com.ruoyi.system.domain.SysDictType; |
| | | import com.ruoyi.common.mybatis.core.mapper.BaseMapperPlus; |
| | | import com.ruoyi.system.domain.vo.SysDictTypeVo; |
| | | |
| | | /** |
| | | * åå
¸è¡¨ æ°æ®å± |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | public interface SysDictTypeMapper extends BaseMapperPlus<SysDictTypeMapper, SysDictType, SysDictType> { |
| | | public interface SysDictTypeMapper extends BaseMapperPlus<SysDictTypeMapper, SysDictType, SysDictTypeVo> { |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.system.domain.SysMenu; |
| | | import com.ruoyi.common.mybatis.core.mapper.BaseMapperPlus; |
| | | import com.ruoyi.system.domain.vo.SysMenuVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | public interface SysMenuMapper extends BaseMapperPlus<SysMenuMapper, SysMenu, SysMenu> { |
| | | public interface SysMenuMapper extends BaseMapperPlus<SysMenuMapper, SysMenu, SysMenuVo> { |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·æææé |
| | |
| | | |
| | | import com.ruoyi.common.mybatis.core.mapper.BaseMapperPlus; |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | import com.ruoyi.system.domain.vo.SysNoticeVo; |
| | | |
| | | /** |
| | | * éç¥å
¬å表 æ°æ®å± |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | public interface SysNoticeMapper extends BaseMapperPlus<SysNoticeMapper, SysNotice, SysNotice> { |
| | | public interface SysNoticeMapper extends BaseMapperPlus<SysNoticeMapper, SysNotice, SysNoticeVo> { |
| | | |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.mybatis.core.mapper.BaseMapperPlus; |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import com.ruoyi.system.domain.vo.SysPostVo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | public interface SysPostMapper extends BaseMapperPlus<SysPostMapper, SysPost, SysPost> { |
| | | public interface SysPostMapper extends BaseMapperPlus<SysPostMapper, SysPost, SysPostVo> { |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·IDè·åå²ä½éæ©æ¡å表 |
| | |
| | | * @param userName ç¨æ·å |
| | | * @return ç»æ |
| | | */ |
| | | List<SysPost> selectPostsByUserName(String userName); |
| | | List<SysPostVo> selectPostsByUserName(String userName); |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.mybatis.annotation.DataPermission; |
| | | import com.ruoyi.system.domain.SysRole; |
| | | import com.ruoyi.common.mybatis.core.mapper.BaseMapperPlus; |
| | | import com.ruoyi.system.domain.vo.SysRoleVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | |
| | | * |
| | | * @author Lion Li |
| | | */ |
| | | public interface SysRoleMapper extends BaseMapperPlus<SysRoleMapper, SysRole, SysRole> { |
| | | public interface SysRoleMapper extends BaseMapperPlus<SysRoleMapper, SysRole, SysRoleVo> { |
| | | |
| | | @DataPermission({ |
| | | @DataColumn(key = "deptName", value = "d.dept_id") |
| | | }) |
| | | Page<SysRole> selectPageRoleList(@Param("page") Page<SysRole> page, @Param(Constants.WRAPPER) Wrapper<SysRole> queryWrapper); |
| | | Page<SysRoleVo> selectPageRoleList(@Param("page") Page<SysRole> page, @Param(Constants.WRAPPER) Wrapper<SysRole> queryWrapper); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¡ä»¶å页æ¥è¯¢è§è²æ°æ® |
| | |
| | | @DataPermission({ |
| | | @DataColumn(key = "deptName", value = "d.dept_id") |
| | | }) |
| | | List<SysRole> selectRoleList(@Param(Constants.WRAPPER) Wrapper<SysRole> queryWrapper); |
| | | List<SysRoleVo> selectRoleList(@Param(Constants.WRAPPER) Wrapper<SysRole> queryWrapper); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·IDæ¥è¯¢è§è² |
| | |
| | | * @param userId ç¨æ·ID |
| | | * @return è§è²å表 |
| | | */ |
| | | List<SysRole> selectRolePermissionByUserId(Long userId); |
| | | List<SysRoleVo> selectRolePermissionByUserId(Long userId); |
| | | |
| | | |
| | | /** |
| | |
| | | * @param userName ç¨æ·å |
| | | * @return è§è²å表 |
| | | */ |
| | | List<SysRole> selectRolesByUserName(String userName); |
| | | List<SysRoleVo> selectRolesByUserName(String userName); |
| | | |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.mybatis.core.page.PageQuery; |
| | | import com.ruoyi.common.mybatis.core.page.TableDataInfo; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.domain.bo.SysConfigBo; |
| | | import com.ruoyi.system.domain.vo.SysConfigVo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | public interface ISysConfigService { |
| | | |
| | | |
| | | TableDataInfo<SysConfig> selectPageConfigList(SysConfig config, PageQuery pageQuery); |
| | | TableDataInfo<SysConfigVo> selectPageConfigList(SysConfigBo config, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ¥è¯¢åæ°é
ç½®ä¿¡æ¯ |
| | |
| | | * @param configId åæ°é
ç½®ID |
| | | * @return åæ°é
ç½®ä¿¡æ¯ |
| | | */ |
| | | SysConfig selectConfigById(Long configId); |
| | | SysConfigVo selectConfigById(Long configId); |
| | | |
| | | /** |
| | | * æ ¹æ®é®åæ¥è¯¢åæ°é
ç½®ä¿¡æ¯ |
| | |
| | | * @param config åæ°é
ç½®ä¿¡æ¯ |
| | | * @return åæ°é
ç½®éå |
| | | */ |
| | | List<SysConfig> selectConfigList(SysConfig config); |
| | | List<SysConfigVo> selectConfigList(SysConfigBo config); |
| | | |
| | | /** |
| | | * æ°å¢åæ°é
ç½® |
| | | * |
| | | * @param config åæ°é
ç½®ä¿¡æ¯ |
| | | * @param bo åæ°é
ç½®ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | String insertConfig(SysConfig config); |
| | | String insertConfig(SysConfigBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹åæ°é
ç½® |
| | | * |
| | | * @param config åæ°é
ç½®ä¿¡æ¯ |
| | | * @param bo åæ°é
ç½®ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | String updateConfig(SysConfig config); |
| | | String updateConfig(SysConfigBo bo); |
| | | |
| | | /** |
| | | * æ¹éå é¤åæ°ä¿¡æ¯ |
| | |
| | | * @param config åæ°ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | String checkConfigKeyUnique(SysConfig config); |
| | | String checkConfigKeyUnique(SysConfigBo config); |
| | | |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.lang.tree.Tree; |
| | | import com.ruoyi.system.domain.SysDept; |
| | | import com.ruoyi.system.domain.bo.SysDeptBo; |
| | | import com.ruoyi.system.domain.vo.SysDeptVo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @param dept é¨é¨ä¿¡æ¯ |
| | | * @return é¨é¨ä¿¡æ¯éå |
| | | */ |
| | | List<SysDept> selectDeptList(SysDept dept); |
| | | List<SysDeptVo> selectDeptList(SysDeptBo dept); |
| | | |
| | | /** |
| | | * æ¥è¯¢é¨é¨æ ç»æä¿¡æ¯ |
| | |
| | | * @param deptId é¨é¨ID |
| | | * @return é¨é¨ä¿¡æ¯ |
| | | */ |
| | | SysDept selectDeptById(Long deptId); |
| | | SysDeptVo selectDeptById(Long deptId); |
| | | |
| | | /** |
| | | * æ ¹æ®IDæ¥è¯¢ææåé¨é¨æ°ï¼æ£å¸¸ç¶æï¼ |
| | |
| | | * @param dept é¨é¨ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | String checkDeptNameUnique(SysDept dept); |
| | | String checkDeptNameUnique(SysDeptBo dept); |
| | | |
| | | /** |
| | | * æ ¡éªé¨é¨æ¯å¦ææ°æ®æé |
| | |
| | | /** |
| | | * æ°å¢ä¿åé¨é¨ä¿¡æ¯ |
| | | * |
| | | * @param dept é¨é¨ä¿¡æ¯ |
| | | * @param bo é¨é¨ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | int insertDept(SysDept dept); |
| | | int insertDept(SysDeptBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åé¨é¨ä¿¡æ¯ |
| | | * |
| | | * @param dept é¨é¨ä¿¡æ¯ |
| | | * @param bo é¨é¨ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | int updateDept(SysDept dept); |
| | | int updateDept(SysDeptBo bo); |
| | | |
| | | /** |
| | | * å é¤é¨é¨ç®¡çä¿¡æ¯ |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.ruoyi.common.mybatis.core.page.PageQuery; |
| | | import com.ruoyi.system.domain.SysDictData; |
| | | import com.ruoyi.common.mybatis.core.page.TableDataInfo; |
| | | import com.ruoyi.system.domain.bo.SysDictDataBo; |
| | | import com.ruoyi.system.domain.vo.SysDictDataVo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | public interface ISysDictDataService { |
| | | |
| | | |
| | | TableDataInfo<SysDictData> selectPageDictDataList(SysDictData dictData, PageQuery pageQuery); |
| | | TableDataInfo<SysDictDataVo> selectPageDictDataList(SysDictDataBo dictData, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¡ä»¶å页æ¥è¯¢åå
¸æ°æ® |
| | |
| | | * @param dictData åå
¸æ°æ®ä¿¡æ¯ |
| | | * @return åå
¸æ°æ®éåä¿¡æ¯ |
| | | */ |
| | | List<SysDictData> selectDictDataList(SysDictData dictData); |
| | | List<SysDictDataVo> selectDictDataList(SysDictDataBo dictData); |
| | | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åååå
¸é®å¼æ¥è¯¢åå
¸æ°æ®ä¿¡æ¯ |
| | |
| | | * @param dictCode åå
¸æ°æ®ID |
| | | * @return åå
¸æ°æ® |
| | | */ |
| | | SysDictData selectDictDataById(Long dictCode); |
| | | SysDictDataVo selectDictDataById(Long dictCode); |
| | | |
| | | /** |
| | | * æ¹éå é¤åå
¸æ°æ®ä¿¡æ¯ |
| | |
| | | /** |
| | | * æ°å¢ä¿ååå
¸æ°æ®ä¿¡æ¯ |
| | | * |
| | | * @param dictData åå
¸æ°æ®ä¿¡æ¯ |
| | | * @param bo åå
¸æ°æ®ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | List<SysDictData> insertDictData(SysDictData dictData); |
| | | List<SysDictDataVo> insertDictData(SysDictDataBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿ååå
¸æ°æ®ä¿¡æ¯ |
| | | * |
| | | * @param dictData åå
¸æ°æ®ä¿¡æ¯ |
| | | * @param bo åå
¸æ°æ®ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | List<SysDictData> updateDictData(SysDictData dictData); |
| | | List<SysDictDataVo> updateDictData(SysDictDataBo bo); |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.ruoyi.common.mybatis.core.page.PageQuery; |
| | | import com.ruoyi.system.domain.SysDictData; |
| | | import com.ruoyi.system.domain.SysDictType; |
| | | import com.ruoyi.common.mybatis.core.page.TableDataInfo; |
| | | import com.ruoyi.system.domain.bo.SysDictTypeBo; |
| | | import com.ruoyi.system.domain.vo.SysDictDataVo; |
| | | import com.ruoyi.system.domain.vo.SysDictTypeVo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | public interface ISysDictTypeService { |
| | | |
| | | |
| | | TableDataInfo<SysDictType> selectPageDictTypeList(SysDictType dictType, PageQuery pageQuery); |
| | | TableDataInfo<SysDictTypeVo> selectPageDictTypeList(SysDictTypeBo dictType, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¡ä»¶å页æ¥è¯¢åå
¸ç±»å |
| | |
| | | * @param dictType åå
¸ç±»åä¿¡æ¯ |
| | | * @return åå
¸ç±»åéåä¿¡æ¯ |
| | | */ |
| | | List<SysDictType> selectDictTypeList(SysDictType dictType); |
| | | List<SysDictTypeVo> selectDictTypeList(SysDictTypeBo dictType); |
| | | |
| | | /** |
| | | * æ ¹æ®ææåå
¸ç±»å |
| | |
| | | * @param dictType åå
¸ç±»å |
| | | * @return åå
¸æ°æ®éåä¿¡æ¯ |
| | | */ |
| | | List<SysDictData> selectDictDataByType(String dictType); |
| | | List<SysDictDataVo> selectDictDataByType(String dictType); |
| | | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åIDæ¥è¯¢ä¿¡æ¯ |
| | |
| | | * @param dictId åå
¸ç±»åID |
| | | * @return åå
¸ç±»å |
| | | */ |
| | | SysDictType selectDictTypeById(Long dictId); |
| | | SysDictTypeVo selectDictTypeById(Long dictId); |
| | | |
| | | /** |
| | | * æ ¹æ®åå
¸ç±»åæ¥è¯¢ä¿¡æ¯ |
| | |
| | | * @param dictType åå
¸ç±»å |
| | | * @return åå
¸ç±»å |
| | | */ |
| | | SysDictType selectDictTypeByType(String dictType); |
| | | SysDictTypeVo selectDictTypeByType(String dictType); |
| | | |
| | | /** |
| | | * æ¹éå é¤åå
¸ä¿¡æ¯ |
| | |
| | | /** |
| | | * æ°å¢ä¿ååå
¸ç±»åä¿¡æ¯ |
| | | * |
| | | * @param dictType åå
¸ç±»åä¿¡æ¯ |
| | | * @param bo åå
¸ç±»åä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | List<SysDictData> insertDictType(SysDictType dictType); |
| | | List<SysDictTypeVo> insertDictType(SysDictTypeBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿ååå
¸ç±»åä¿¡æ¯ |
| | | * |
| | | * @param dictType åå
¸ç±»åä¿¡æ¯ |
| | | * @param bo åå
¸ç±»åä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | List<SysDictData> updateDictType(SysDictType dictType); |
| | | List<SysDictDataVo> updateDictType(SysDictTypeBo bo); |
| | | |
| | | /** |
| | | * æ ¡éªåå
¸ç±»åç§°æ¯å¦å¯ä¸ |
| | |
| | | * @param dictType åå
¸ç±»å |
| | | * @return ç»æ |
| | | */ |
| | | String checkDictTypeUnique(SysDictType dictType); |
| | | String checkDictTypeUnique(SysDictTypeBo dictType); |
| | | } |
| | |
| | | |
| | | import cn.hutool.core.lang.tree.Tree; |
| | | import com.ruoyi.system.domain.SysMenu; |
| | | import com.ruoyi.system.domain.bo.SysMenuBo; |
| | | import com.ruoyi.system.domain.vo.RouterVo; |
| | | import com.ruoyi.system.domain.vo.SysMenuVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | |
| | | * @param menuId èåID |
| | | * @return èåä¿¡æ¯ |
| | | */ |
| | | SysMenu selectMenuById(Long menuId); |
| | | SysMenuVo selectMenuById(Long menuId); |
| | | |
| | | /** |
| | | * æ¯å¦åå¨èååèç¹ |
| | |
| | | /** |
| | | * æ°å¢ä¿åèåä¿¡æ¯ |
| | | * |
| | | * @param menu èåä¿¡æ¯ |
| | | * @param bo èåä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | int insertMenu(SysMenu menu); |
| | | int insertMenu(SysMenuBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åèåä¿¡æ¯ |
| | | * |
| | | * @param menu èåä¿¡æ¯ |
| | | * @param bo èåä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | int updateMenu(SysMenu menu); |
| | | int updateMenu(SysMenuBo bo); |
| | | |
| | | /** |
| | | * å é¤èå管çä¿¡æ¯ |
| | |
| | | * @param menu èåä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | String checkMenuNameUnique(SysMenu menu); |
| | | String checkMenuNameUnique(SysMenuBo menu); |
| | | } |
| | |
| | | |
| | | import com.ruoyi.common.mybatis.core.page.PageQuery; |
| | | import com.ruoyi.common.mybatis.core.page.TableDataInfo; |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | import com.ruoyi.system.domain.bo.SysNoticeBo; |
| | | import com.ruoyi.system.domain.vo.SysNoticeVo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | public interface ISysNoticeService { |
| | | |
| | | |
| | | TableDataInfo<SysNotice> selectPageNoticeList(SysNotice notice, PageQuery pageQuery); |
| | | TableDataInfo<SysNoticeVo> selectPageNoticeList(SysNoticeBo notice, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ¥è¯¢å
¬åä¿¡æ¯ |
| | |
| | | * @param noticeId å
ŒID |
| | | * @return å
¬åä¿¡æ¯ |
| | | */ |
| | | SysNotice selectNoticeById(Long noticeId); |
| | | SysNoticeVo selectNoticeById(Long noticeId); |
| | | |
| | | /** |
| | | * æ¥è¯¢å
¬åå表 |
| | |
| | | * @param notice å
¬åä¿¡æ¯ |
| | | * @return å
¬åéå |
| | | */ |
| | | List<SysNotice> selectNoticeList(SysNotice notice); |
| | | List<SysNoticeVo> selectNoticeList(SysNoticeBo notice); |
| | | |
| | | /** |
| | | * æ°å¢å
Œ |
| | | * |
| | | * @param notice å
¬åä¿¡æ¯ |
| | | * @param bo å
¬åä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | int insertNotice(SysNotice notice); |
| | | int insertNotice(SysNoticeBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹å
Œ |
| | | * |
| | | * @param notice å
¬åä¿¡æ¯ |
| | | * @param bo å
¬åä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | int updateNotice(SysNotice notice); |
| | | int updateNotice(SysNoticeBo bo); |
| | | |
| | | /** |
| | | * å é¤å
¬åä¿¡æ¯ |
| | |
| | | |
| | | import com.ruoyi.common.mybatis.core.page.PageQuery; |
| | | import com.ruoyi.common.mybatis.core.page.TableDataInfo; |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import com.ruoyi.system.domain.bo.SysPostBo; |
| | | import com.ruoyi.system.domain.vo.SysPostVo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | public interface ISysPostService { |
| | | |
| | | |
| | | TableDataInfo<SysPost> selectPagePostList(SysPost post, PageQuery pageQuery); |
| | | TableDataInfo<SysPostVo> selectPagePostList(SysPostBo post, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ¥è¯¢å²ä½ä¿¡æ¯éå |
| | |
| | | * @param post å²ä½ä¿¡æ¯ |
| | | * @return å²ä½å表 |
| | | */ |
| | | List<SysPost> selectPostList(SysPost post); |
| | | List<SysPostVo> selectPostList(SysPostBo post); |
| | | |
| | | /** |
| | | * æ¥è¯¢ææå²ä½ |
| | | * |
| | | * @return å²ä½å表 |
| | | */ |
| | | List<SysPost> selectPostAll(); |
| | | List<SysPostVo> selectPostAll(); |
| | | |
| | | /** |
| | | * éè¿å²ä½IDæ¥è¯¢å²ä½ä¿¡æ¯ |
| | |
| | | * @param postId å²ä½ID |
| | | * @return è§è²å¯¹è±¡ä¿¡æ¯ |
| | | */ |
| | | SysPost selectPostById(Long postId); |
| | | SysPostVo selectPostById(Long postId); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·IDè·åå²ä½éæ©æ¡å表 |
| | |
| | | * @param post å²ä½ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | String checkPostNameUnique(SysPost post); |
| | | String checkPostNameUnique(SysPostBo post); |
| | | |
| | | /** |
| | | * æ ¡éªå²ä½ç¼ç |
| | |
| | | * @param post å²ä½ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | String checkPostCodeUnique(SysPost post); |
| | | String checkPostCodeUnique(SysPostBo post); |
| | | |
| | | /** |
| | | * éè¿å²ä½IDæ¥è¯¢å²ä½ä½¿ç¨æ°é |
| | |
| | | /** |
| | | * æ°å¢ä¿åå²ä½ä¿¡æ¯ |
| | | * |
| | | * @param post å²ä½ä¿¡æ¯ |
| | | * @param bo å²ä½ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | int insertPost(SysPost post); |
| | | int insertPost(SysPostBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åå²ä½ä¿¡æ¯ |
| | | * |
| | | * @param post å²ä½ä¿¡æ¯ |
| | | * @param bo å²ä½ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | int updatePost(SysPost post); |
| | | int updatePost(SysPostBo bo); |
| | | } |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import com.ruoyi.common.mybatis.core.page.PageQuery; |
| | | import com.ruoyi.system.domain.SysRole; |
| | | import com.ruoyi.common.mybatis.core.page.TableDataInfo; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.domain.bo.SysRoleBo; |
| | | import com.ruoyi.system.domain.vo.SysRoleVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Set; |
| | |
| | | public interface ISysRoleService { |
| | | |
| | | |
| | | TableDataInfo<SysRole> selectPageRoleList(SysRole role, PageQuery pageQuery); |
| | | TableDataInfo<SysRoleVo> selectPageRoleList(SysRoleBo role, PageQuery pageQuery); |
| | | |
| | | /** |
| | | * æ ¹æ®æ¡ä»¶å页æ¥è¯¢è§è²æ°æ® |
| | |
| | | * @param role è§è²ä¿¡æ¯ |
| | | * @return è§è²æ°æ®éåä¿¡æ¯ |
| | | */ |
| | | List<SysRole> selectRoleList(SysRole role); |
| | | List<SysRoleVo> selectRoleList(SysRoleBo role); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·IDæ¥è¯¢è§è²å表 |
| | |
| | | * @param userId ç¨æ·ID |
| | | * @return è§è²å表 |
| | | */ |
| | | List<SysRole> selectRolesByUserId(Long userId); |
| | | List<SysRoleVo> selectRolesByUserId(Long userId); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·IDæ¥è¯¢è§è²æé |
| | |
| | | * |
| | | * @return è§è²å表 |
| | | */ |
| | | List<SysRole> selectRoleAll(); |
| | | List<SysRoleVo> selectRoleAll(); |
| | | |
| | | /** |
| | | * æ ¹æ®ç¨æ·IDè·åè§è²éæ©æ¡å表 |
| | |
| | | * @param roleId è§è²ID |
| | | * @return è§è²å¯¹è±¡ä¿¡æ¯ |
| | | */ |
| | | SysRole selectRoleById(Long roleId); |
| | | SysRoleVo selectRoleById(Long roleId); |
| | | |
| | | /** |
| | | * æ ¡éªè§è²åç§°æ¯å¦å¯ä¸ |
| | |
| | | * @param role è§è²ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | String checkRoleNameUnique(SysRole role); |
| | | String checkRoleNameUnique(SysRoleBo role); |
| | | |
| | | /** |
| | | * æ ¡éªè§è²æéæ¯å¦å¯ä¸ |
| | |
| | | * @param role è§è²ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | String checkRoleKeyUnique(SysRole role); |
| | | String checkRoleKeyUnique(SysRoleBo role); |
| | | |
| | | /** |
| | | * æ ¡éªè§è²æ¯å¦å
许æä½ |
| | | * |
| | | * @param role è§è²ä¿¡æ¯ |
| | | */ |
| | | void checkRoleAllowed(SysRole role); |
| | | void checkRoleAllowed(SysRoleBo role); |
| | | |
| | | /** |
| | | * æ ¡éªè§è²æ¯å¦ææ°æ®æé |
| | |
| | | /** |
| | | * æ°å¢ä¿åè§è²ä¿¡æ¯ |
| | | * |
| | | * @param role è§è²ä¿¡æ¯ |
| | | * @param bo è§è²ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | int insertRole(SysRole role); |
| | | int insertRole(SysRoleBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åè§è²ä¿¡æ¯ |
| | | * |
| | | * @param role è§è²ä¿¡æ¯ |
| | | * @param bo è§è²ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | int updateRole(SysRole role); |
| | | int updateRole(SysRoleBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹è§è²ç¶æ |
| | | * |
| | | * @param role è§è²ä¿¡æ¯ |
| | | * @param bo è§è²ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | int updateRoleStatus(SysRole role); |
| | | int updateRoleStatus(SysRoleBo bo); |
| | | |
| | | /** |
| | | * ä¿®æ¹æ°æ®æéä¿¡æ¯ |
| | | * |
| | | * @param role è§è²ä¿¡æ¯ |
| | | * @param bo è§è²ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | int authDataScope(SysRole role); |
| | | int authDataScope(SysRoleBo bo); |
| | | |
| | | /** |
| | | * éè¿è§è²IDå é¤è§è² |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.convert.Convert; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.constant.CacheNames; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | |
| | | import com.ruoyi.common.redis.utils.CacheUtils; |
| | | import com.ruoyi.common.core.utils.SpringUtils; |
| | | import com.ruoyi.system.domain.SysConfig; |
| | | import com.ruoyi.system.domain.bo.SysConfigBo; |
| | | import com.ruoyi.system.domain.vo.SysConfigVo; |
| | | import com.ruoyi.system.mapper.SysConfigMapper; |
| | | import com.ruoyi.system.service.ISysConfigService; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | private final SysConfigMapper baseMapper; |
| | | |
| | | @Override |
| | | public TableDataInfo<SysConfig> selectPageConfigList(SysConfig config, PageQuery pageQuery) { |
| | | Map<String, Object> params = config.getParams(); |
| | | LambdaQueryWrapper<SysConfig> lqw = new LambdaQueryWrapper<SysConfig>() |
| | | .like(StringUtils.isNotBlank(config.getConfigName()), SysConfig::getConfigName, config.getConfigName()) |
| | | .eq(StringUtils.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType()) |
| | | .like(StringUtils.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey()) |
| | | .between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysConfig::getCreateTime, params.get("beginTime"), params.get("endTime")); |
| | | Page<SysConfig> page = baseMapper.selectPage(pageQuery.build(), lqw); |
| | | public TableDataInfo<SysConfigVo> selectPageConfigList(SysConfigBo config, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<SysConfig> lqw = buildQueryWrapper(config); |
| | | Page<SysConfigVo> page = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | @DS("master") |
| | | public SysConfig selectConfigById(Long configId) { |
| | | return baseMapper.selectById(configId); |
| | | public SysConfigVo selectConfigById(Long configId) { |
| | | return baseMapper.selectVoById(configId); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return åæ°é
ç½®éå |
| | | */ |
| | | @Override |
| | | public List<SysConfig> selectConfigList(SysConfig config) { |
| | | Map<String, Object> params = config.getParams(); |
| | | LambdaQueryWrapper<SysConfig> lqw = new LambdaQueryWrapper<SysConfig>() |
| | | .like(StringUtils.isNotBlank(config.getConfigName()), SysConfig::getConfigName, config.getConfigName()) |
| | | .eq(StringUtils.isNotBlank(config.getConfigType()), SysConfig::getConfigType, config.getConfigType()) |
| | | .like(StringUtils.isNotBlank(config.getConfigKey()), SysConfig::getConfigKey, config.getConfigKey()) |
| | | .between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysConfig::getCreateTime, params.get("beginTime"), params.get("endTime")); |
| | | return baseMapper.selectList(lqw); |
| | | public List<SysConfigVo> selectConfigList(SysConfigBo config) { |
| | | LambdaQueryWrapper<SysConfig> lqw = buildQueryWrapper(config); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<SysConfig> buildQueryWrapper(SysConfigBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<SysConfig> lqw = Wrappers.lambdaQuery(); |
| | | lqw.like(StringUtils.isNotBlank(bo.getConfigName()), SysConfig::getConfigName, bo.getConfigName()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getConfigType()), SysConfig::getConfigType, bo.getConfigType()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getConfigKey()), SysConfig::getConfigKey, bo.getConfigKey()); |
| | | lqw.between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysConfig::getCreateTime, params.get("beginTime"), params.get("endTime")); |
| | | return lqw; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢åæ°é
ç½® |
| | | * |
| | | * @param config åæ°é
ç½®ä¿¡æ¯ |
| | | * @param bo åæ°é
ç½®ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @CachePut(cacheNames = CacheNames.SYS_CONFIG, key = "#config.configKey") |
| | | @CachePut(cacheNames = CacheNames.SYS_CONFIG, key = "#bo.configKey") |
| | | @Override |
| | | public String insertConfig(SysConfig config) { |
| | | public String insertConfig(SysConfigBo bo) { |
| | | SysConfig config = BeanUtil.toBean(bo, SysConfig.class); |
| | | int row = baseMapper.insert(config); |
| | | if (row > 0) { |
| | | return config.getConfigValue(); |
| | |
| | | /** |
| | | * ä¿®æ¹åæ°é
ç½® |
| | | * |
| | | * @param config åæ°é
ç½®ä¿¡æ¯ |
| | | * @param bo åæ°é
ç½®ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @CachePut(cacheNames = CacheNames.SYS_CONFIG, key = "#config.configKey") |
| | | @CachePut(cacheNames = CacheNames.SYS_CONFIG, key = "#bo.configKey") |
| | | @Override |
| | | public String updateConfig(SysConfig config) { |
| | | public String updateConfig(SysConfigBo bo) { |
| | | int row = 0; |
| | | SysConfig config = BeanUtil.toBean(bo, SysConfig.class); |
| | | if (config.getConfigId() != null) { |
| | | SysConfig temp = baseMapper.selectById(config.getConfigId()); |
| | | if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) { |
| | |
| | | @Override |
| | | public void deleteConfigByIds(Long[] configIds) { |
| | | for (Long configId : configIds) { |
| | | SysConfig config = selectConfigById(configId); |
| | | SysConfig config = baseMapper.selectById(configId); |
| | | if (StringUtils.equals(UserConstants.YES, config.getConfigType())) { |
| | | throw new ServiceException(String.format("å
ç½®åæ°ã%1$sãä¸è½å é¤ ", config.getConfigKey())); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public void loadingConfigCache() { |
| | | List<SysConfig> configsList = selectConfigList(new SysConfig()); |
| | | List<SysConfigVo> configsList = selectConfigList(new SysConfigBo()); |
| | | configsList.forEach(config -> |
| | | CacheUtils.put(CacheNames.SYS_CONFIG, config.getConfigKey(), config.getConfigValue())); |
| | | } |
| | |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public String checkConfigKeyUnique(SysConfig config) { |
| | | public String checkConfigKeyUnique(SysConfigBo config) { |
| | | long configId = ObjectUtil.isNull(config.getConfigId()) ? -1L : config.getConfigId(); |
| | | SysConfig info = baseMapper.selectOne(new LambdaQueryWrapper<SysConfig>().eq(SysConfig::getConfigKey, config.getConfigKey())); |
| | | if (ObjectUtil.isNotNull(info) && info.getConfigId() != configId) { |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.convert.Convert; |
| | | import cn.hutool.core.lang.tree.Tree; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.system.domain.SysDept; |
| | | import com.ruoyi.system.domain.SysRole; |
| | |
| | | import com.ruoyi.common.satoken.utils.LoginHelper; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.TreeBuildUtils; |
| | | import com.ruoyi.system.domain.bo.SysDeptBo; |
| | | import com.ruoyi.system.domain.vo.SysDeptVo; |
| | | import com.ruoyi.system.mapper.SysDeptMapper; |
| | | import com.ruoyi.system.mapper.SysRoleMapper; |
| | | import com.ruoyi.system.mapper.SysUserMapper; |
| | |
| | | * @return é¨é¨ä¿¡æ¯éå |
| | | */ |
| | | @Override |
| | | public List<SysDept> selectDeptList(SysDept dept) { |
| | | LambdaQueryWrapper<SysDept> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(SysDept::getDelFlag, "0") |
| | | .eq(ObjectUtil.isNotNull(dept.getDeptId()), SysDept::getDeptId, dept.getDeptId()) |
| | | .eq(ObjectUtil.isNotNull(dept.getParentId()), SysDept::getParentId, dept.getParentId()) |
| | | .like(StringUtils.isNotBlank(dept.getDeptName()), SysDept::getDeptName, dept.getDeptName()) |
| | | .eq(StringUtils.isNotBlank(dept.getStatus()), SysDept::getStatus, dept.getStatus()) |
| | | .orderByAsc(SysDept::getParentId) |
| | | .orderByAsc(SysDept::getOrderNum); |
| | | public List<SysDeptVo> selectDeptList(SysDeptBo dept) { |
| | | LambdaQueryWrapper<SysDept> lqw = buildQueryWrapper(dept); |
| | | return baseMapper.selectDeptList(lqw); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public List<Tree<Long>> selectDeptTreeList(SysDept dept) { |
| | | List<SysDept> depts = this.selectDeptList(dept); |
| | | SysDeptBo bo = BeanUtil.toBean(dept, SysDeptBo.class); |
| | | LambdaQueryWrapper<SysDept> lqw = buildQueryWrapper(bo); |
| | | List<SysDept> depts = baseMapper.selectList(lqw); |
| | | return buildDeptTreeSelect(depts); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<SysDept> buildQueryWrapper(SysDeptBo bo) { |
| | | LambdaQueryWrapper<SysDept> lqw = Wrappers.lambdaQuery(); |
| | | lqw.eq(SysDept::getDelFlag, "0"); |
| | | lqw.eq(ObjectUtil.isNotNull(bo.getDeptId()), SysDept::getDeptId, bo.getDeptId()); |
| | | lqw.eq(ObjectUtil.isNotNull(bo.getParentId()), SysDept::getParentId, bo.getParentId()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getDeptName()), SysDept::getDeptName, bo.getDeptName()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysDept::getStatus, bo.getStatus()); |
| | | lqw.orderByAsc(SysDept::getParentId); |
| | | lqw.orderByAsc(SysDept::getOrderNum); |
| | | return lqw; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return é¨é¨ä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public SysDept selectDeptById(Long deptId) { |
| | | SysDept dept = baseMapper.selectById(deptId); |
| | | SysDept parentDept = baseMapper.selectOne(new LambdaQueryWrapper<SysDept>() |
| | | public SysDeptVo selectDeptById(Long deptId) { |
| | | SysDeptVo dept = baseMapper.selectVoById(deptId); |
| | | SysDeptVo parentDept = baseMapper.selectVoOne(new LambdaQueryWrapper<SysDept>() |
| | | .select(SysDept::getDeptName).eq(SysDept::getDeptId, dept.getParentId())); |
| | | dept.setParentName(ObjectUtil.isNotNull(parentDept) ? parentDept.getDeptName() : null); |
| | | return dept; |
| | |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public String checkDeptNameUnique(SysDept dept) { |
| | | public String checkDeptNameUnique(SysDeptBo dept) { |
| | | boolean exist = baseMapper.exists(new LambdaQueryWrapper<SysDept>() |
| | | .eq(SysDept::getDeptName, dept.getDeptName()) |
| | | .eq(SysDept::getParentId, dept.getParentId()) |
| | |
| | | @Override |
| | | public void checkDeptDataScope(Long deptId) { |
| | | if (!LoginHelper.isAdmin()) { |
| | | SysDept dept = new SysDept(); |
| | | SysDeptBo dept = new SysDeptBo(); |
| | | dept.setDeptId(deptId); |
| | | List<SysDept> depts = this.selectDeptList(dept); |
| | | List<SysDeptVo> depts = this.selectDeptList(dept); |
| | | if (CollUtil.isEmpty(depts)) { |
| | | throw new ServiceException("没ææé访é®é¨é¨æ°æ®ï¼"); |
| | | } |
| | |
| | | /** |
| | | * æ°å¢ä¿åé¨é¨ä¿¡æ¯ |
| | | * |
| | | * @param dept é¨é¨ä¿¡æ¯ |
| | | * @param bo é¨é¨ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertDept(SysDept dept) { |
| | | SysDept info = baseMapper.selectById(dept.getParentId()); |
| | | public int insertDept(SysDeptBo bo) { |
| | | SysDept info = baseMapper.selectById(bo.getParentId()); |
| | | // 妿ç¶èç¹ä¸ä¸ºæ£å¸¸ç¶æ,åä¸å
许æ°å¢åèç¹ |
| | | if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) { |
| | | throw new ServiceException("é¨é¨åç¨ï¼ä¸å
许æ°å¢"); |
| | | } |
| | | SysDept dept = BeanUtil.toBean(bo, SysDept.class); |
| | | dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); |
| | | return baseMapper.insert(dept); |
| | | } |
| | |
| | | /** |
| | | * ä¿®æ¹ä¿åé¨é¨ä¿¡æ¯ |
| | | * |
| | | * @param dept é¨é¨ä¿¡æ¯ |
| | | * @param bo é¨é¨ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateDept(SysDept dept) { |
| | | public int updateDept(SysDeptBo bo) { |
| | | SysDept dept = BeanUtil.toBean(bo, SysDept.class); |
| | | SysDept newParentDept = baseMapper.selectById(dept.getParentId()); |
| | | SysDept oldDept = baseMapper.selectById(dept.getDeptId()); |
| | | if (ObjectUtil.isNotNull(newParentDept) && ObjectUtil.isNotNull(oldDept)) { |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.constant.CacheNames; |
| | | import com.ruoyi.common.mybatis.core.page.PageQuery; |
| | |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.redis.utils.CacheUtils; |
| | | import com.ruoyi.system.domain.bo.SysDictDataBo; |
| | | import com.ruoyi.system.domain.vo.SysDictDataVo; |
| | | import com.ruoyi.system.mapper.SysDictDataMapper; |
| | | import com.ruoyi.system.service.ISysDictDataService; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | private final SysDictDataMapper baseMapper; |
| | | |
| | | @Override |
| | | public TableDataInfo<SysDictData> selectPageDictDataList(SysDictData dictData, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<SysDictData> lqw = new LambdaQueryWrapper<SysDictData>() |
| | | .eq(StringUtils.isNotBlank(dictData.getDictType()), SysDictData::getDictType, dictData.getDictType()) |
| | | .like(StringUtils.isNotBlank(dictData.getDictLabel()), SysDictData::getDictLabel, dictData.getDictLabel()) |
| | | .eq(StringUtils.isNotBlank(dictData.getStatus()), SysDictData::getStatus, dictData.getStatus()) |
| | | .orderByAsc(SysDictData::getDictSort); |
| | | Page<SysDictData> page = baseMapper.selectPage(pageQuery.build(), lqw); |
| | | public TableDataInfo<SysDictDataVo> selectPageDictDataList(SysDictDataBo dictData, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<SysDictData> lqw = buildQueryWrapper(dictData); |
| | | Page<SysDictDataVo> page = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | |
| | | * @return åå
¸æ°æ®éåä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public List<SysDictData> selectDictDataList(SysDictData dictData) { |
| | | return baseMapper.selectList(new LambdaQueryWrapper<SysDictData>() |
| | | .eq(StringUtils.isNotBlank(dictData.getDictType()), SysDictData::getDictType, dictData.getDictType()) |
| | | .like(StringUtils.isNotBlank(dictData.getDictLabel()), SysDictData::getDictLabel, dictData.getDictLabel()) |
| | | .eq(StringUtils.isNotBlank(dictData.getStatus()), SysDictData::getStatus, dictData.getStatus()) |
| | | .orderByAsc(SysDictData::getDictSort)); |
| | | public List<SysDictDataVo> selectDictDataList(SysDictDataBo dictData) { |
| | | LambdaQueryWrapper<SysDictData> lqw = buildQueryWrapper(dictData); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<SysDictData> buildQueryWrapper(SysDictDataBo bo) { |
| | | LambdaQueryWrapper<SysDictData> lqw = Wrappers.lambdaQuery(); |
| | | lqw.eq(bo.getDictSort() != null, SysDictData::getDictSort, bo.getDictSort()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getDictLabel()), SysDictData::getDictLabel, bo.getDictLabel()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getDictType()), SysDictData::getDictType, bo.getDictType()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysDictData::getStatus, bo.getStatus()); |
| | | lqw.orderByAsc(SysDictData::getDictSort); |
| | | return lqw; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return åå
¸æ°æ® |
| | | */ |
| | | @Override |
| | | public SysDictData selectDictDataById(Long dictCode) { |
| | | return baseMapper.selectById(dictCode); |
| | | public SysDictDataVo selectDictDataById(Long dictCode) { |
| | | return baseMapper.selectVoById(dictCode); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public void deleteDictDataByIds(Long[] dictCodes) { |
| | | for (Long dictCode : dictCodes) { |
| | | SysDictData data = selectDictDataById(dictCode); |
| | | SysDictData data = baseMapper.selectById(dictCode); |
| | | baseMapper.deleteById(dictCode); |
| | | CacheUtils.evict(CacheNames.SYS_DICT, data.getDictType()); |
| | | } |
| | |
| | | /** |
| | | * æ°å¢ä¿ååå
¸æ°æ®ä¿¡æ¯ |
| | | * |
| | | * @param data åå
¸æ°æ®ä¿¡æ¯ |
| | | * @param bo åå
¸æ°æ®ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#data.dictType") |
| | | @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#bo.dictType") |
| | | @Override |
| | | public List<SysDictData> insertDictData(SysDictData data) { |
| | | public List<SysDictDataVo> insertDictData(SysDictDataBo bo) { |
| | | SysDictData data = BeanUtil.toBean(bo, SysDictData.class); |
| | | int row = baseMapper.insert(data); |
| | | if (row > 0) { |
| | | return baseMapper.selectDictDataByType(data.getDictType()); |
| | |
| | | /** |
| | | * ä¿®æ¹ä¿ååå
¸æ°æ®ä¿¡æ¯ |
| | | * |
| | | * @param data åå
¸æ°æ®ä¿¡æ¯ |
| | | * @param bo åå
¸æ°æ®ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#data.dictType") |
| | | @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#bo.dictType") |
| | | @Override |
| | | public List<SysDictData> updateDictData(SysDictData data) { |
| | | public List<SysDictDataVo> updateDictData(SysDictDataBo bo) { |
| | | SysDictData data = BeanUtil.toBean(bo, SysDictData.class); |
| | | int row = baseMapper.updateById(data); |
| | | if (row > 0) { |
| | | return baseMapper.selectDictDataByType(data.getDictType()); |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import cn.dev33.satoken.context.SaHolder; |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.constant.CacheConstants; |
| | | import com.ruoyi.common.core.constant.CacheNames; |
| | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.redis.utils.CacheUtils; |
| | | import com.ruoyi.common.core.utils.SpringUtils; |
| | | import com.ruoyi.system.domain.bo.SysDictTypeBo; |
| | | import com.ruoyi.system.domain.vo.SysDictDataVo; |
| | | import com.ruoyi.system.domain.vo.SysDictTypeVo; |
| | | import com.ruoyi.system.mapper.SysDictDataMapper; |
| | | import com.ruoyi.system.mapper.SysDictTypeMapper; |
| | | import com.ruoyi.system.service.ISysDictTypeService; |
| | |
| | | private final SysDictDataMapper dictDataMapper; |
| | | |
| | | @Override |
| | | public TableDataInfo<SysDictType> selectPageDictTypeList(SysDictType dictType, PageQuery pageQuery) { |
| | | Map<String, Object> params = dictType.getParams(); |
| | | LambdaQueryWrapper<SysDictType> lqw = new LambdaQueryWrapper<SysDictType>() |
| | | .like(StringUtils.isNotBlank(dictType.getDictName()), SysDictType::getDictName, dictType.getDictName()) |
| | | .eq(StringUtils.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus()) |
| | | .like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType()) |
| | | .between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysDictType::getCreateTime, params.get("beginTime"), params.get("endTime")); |
| | | Page<SysDictType> page = baseMapper.selectPage(pageQuery.build(), lqw); |
| | | public TableDataInfo<SysDictTypeVo> selectPageDictTypeList(SysDictTypeBo dictType, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<SysDictType> lqw = buildQueryWrapper(dictType); |
| | | Page<SysDictTypeVo> page = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | |
| | | * @return åå
¸ç±»åéåä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public List<SysDictType> selectDictTypeList(SysDictType dictType) { |
| | | Map<String, Object> params = dictType.getParams(); |
| | | return baseMapper.selectList(new LambdaQueryWrapper<SysDictType>() |
| | | .like(StringUtils.isNotBlank(dictType.getDictName()), SysDictType::getDictName, dictType.getDictName()) |
| | | .eq(StringUtils.isNotBlank(dictType.getStatus()), SysDictType::getStatus, dictType.getStatus()) |
| | | .like(StringUtils.isNotBlank(dictType.getDictType()), SysDictType::getDictType, dictType.getDictType()) |
| | | .between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysDictType::getCreateTime, params.get("beginTime"), params.get("endTime"))); |
| | | public List<SysDictTypeVo> selectDictTypeList(SysDictTypeBo dictType) { |
| | | LambdaQueryWrapper<SysDictType> lqw = buildQueryWrapper(dictType); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<SysDictType> buildQueryWrapper(SysDictTypeBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | LambdaQueryWrapper<SysDictType> lqw = Wrappers.lambdaQuery(); |
| | | lqw.like(StringUtils.isNotBlank(bo.getDictName()), SysDictType::getDictName, bo.getDictName()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getDictType()), SysDictType::getDictType, bo.getDictType()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysDictType::getStatus, bo.getStatus()); |
| | | lqw.between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | SysDictType::getCreateTime, params.get("beginTime"), params.get("endTime")); |
| | | return lqw; |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Cacheable(cacheNames = CacheNames.SYS_DICT, key = "#dictType") |
| | | @Override |
| | | public List<SysDictData> selectDictDataByType(String dictType) { |
| | | List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dictType); |
| | | public List<SysDictDataVo> selectDictDataByType(String dictType) { |
| | | List<SysDictDataVo> dictDatas = dictDataMapper.selectDictDataByType(dictType); |
| | | if (CollUtil.isNotEmpty(dictDatas)) { |
| | | return dictDatas; |
| | | } |
| | |
| | | * @return åå
¸ç±»å |
| | | */ |
| | | @Override |
| | | public SysDictType selectDictTypeById(Long dictId) { |
| | | return baseMapper.selectById(dictId); |
| | | public SysDictTypeVo selectDictTypeById(Long dictId) { |
| | | return baseMapper.selectVoById(dictId); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Cacheable(cacheNames = CacheNames.SYS_DICT, key = "#dictType") |
| | | @Override |
| | | public SysDictType selectDictTypeByType(String dictType) { |
| | | return baseMapper.selectById(new LambdaQueryWrapper<SysDictType>().eq(SysDictType::getDictType, dictType)); |
| | | public SysDictTypeVo selectDictTypeByType(String dictType) { |
| | | return baseMapper.selectVoById(new LambdaQueryWrapper<SysDictType>().eq(SysDictType::getDictType, dictType)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Override |
| | | public void deleteDictTypeByIds(Long[] dictIds) { |
| | | for (Long dictId : dictIds) { |
| | | SysDictType dictType = selectDictTypeById(dictId); |
| | | SysDictType dictType = baseMapper.selectById(dictId); |
| | | if (dictDataMapper.exists(new LambdaQueryWrapper<SysDictData>() |
| | | .eq(SysDictData::getDictType, dictType.getDictType()))) { |
| | | throw new ServiceException(String.format("%1$så·²åé
,ä¸è½å é¤", dictType.getDictName())); |
| | |
| | | */ |
| | | @Override |
| | | public void loadingDictCache() { |
| | | List<SysDictData> dictDataList = dictDataMapper.selectList( |
| | | List<SysDictDataVo> dictDataList = dictDataMapper.selectVoList( |
| | | new LambdaQueryWrapper<SysDictData>().eq(SysDictData::getStatus, UserConstants.DICT_NORMAL)); |
| | | Map<String, List<SysDictData>> dictDataMap = StreamUtils.groupByKey(dictDataList, SysDictData::getDictType); |
| | | Map<String, List<SysDictDataVo>> dictDataMap = StreamUtils.groupByKey(dictDataList, SysDictDataVo::getDictType); |
| | | dictDataMap.forEach((k,v) -> { |
| | | List<SysDictData> dictList = StreamUtils.sorted(v, Comparator.comparing(SysDictData::getDictSort)); |
| | | List<SysDictDataVo> dictList = StreamUtils.sorted(v, Comparator.comparing(SysDictDataVo::getDictSort)); |
| | | CacheUtils.put(CacheNames.SYS_DICT, k, dictList); |
| | | }); |
| | | } |
| | |
| | | /** |
| | | * æ°å¢ä¿ååå
¸ç±»åä¿¡æ¯ |
| | | * |
| | | * @param dict åå
¸ç±»åä¿¡æ¯ |
| | | * @param bo åå
¸ç±»åä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#dict.dictType") |
| | | @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#bo.dictType") |
| | | @Override |
| | | public List<SysDictData> insertDictType(SysDictType dict) { |
| | | public List<SysDictTypeVo> insertDictType(SysDictTypeBo bo) { |
| | | SysDictType dict = BeanUtil.toBean(bo, SysDictType.class); |
| | | int row = baseMapper.insert(dict); |
| | | if (row > 0) { |
| | | return new ArrayList<>(); |
| | |
| | | /** |
| | | * ä¿®æ¹ä¿ååå
¸ç±»åä¿¡æ¯ |
| | | * |
| | | * @param dict åå
¸ç±»åä¿¡æ¯ |
| | | * @param bo åå
¸ç±»åä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#dict.dictType") |
| | | @CachePut(cacheNames = CacheNames.SYS_DICT, key = "#bo.dictType") |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public List<SysDictData> updateDictType(SysDictType dict) { |
| | | public List<SysDictDataVo> updateDictType(SysDictTypeBo bo) { |
| | | SysDictType dict = BeanUtil.toBean(bo, SysDictType.class); |
| | | SysDictType oldDict = baseMapper.selectById(dict.getDictId()); |
| | | dictDataMapper.update(null, new LambdaUpdateWrapper<SysDictData>() |
| | | .set(SysDictData::getDictType, dict.getDictType()) |
| | |
| | | /** |
| | | * æ ¡éªåå
¸ç±»åç§°æ¯å¦å¯ä¸ |
| | | * |
| | | * @param dict åå
¸ç±»å |
| | | * @param dictType åå
¸ç±»å |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public String checkDictTypeUnique(SysDictType dict) { |
| | | public String checkDictTypeUnique(SysDictTypeBo dictType) { |
| | | boolean exist = baseMapper.exists(new LambdaQueryWrapper<SysDictType>() |
| | | .eq(SysDictType::getDictType, dict.getDictType()) |
| | | .ne(ObjectUtil.isNotNull(dict.getDictId()), SysDictType::getDictId, dict.getDictId())); |
| | | .eq(SysDictType::getDictType, dictType.getDictType()) |
| | | .ne(ObjectUtil.isNotNull(dictType.getDictId()), SysDictType::getDictId, dictType.getDictId())); |
| | | if (exist) { |
| | | return UserConstants.NOT_UNIQUE; |
| | | } |
| | |
| | | @Override |
| | | public String getDictLabel(String dictType, String dictValue, String separator) { |
| | | // ä¼å
仿¬å°ç¼åè·å |
| | | List<SysDictData> datas = (List<SysDictData>) SaHolder.getStorage().get(CacheConstants.SYS_DICT_KEY + dictType); |
| | | List<SysDictDataVo> datas = (List<SysDictDataVo>) SaHolder.getStorage().get(CacheConstants.SYS_DICT_KEY + dictType); |
| | | if (ObjectUtil.isNull(datas)) { |
| | | datas = SpringUtils.getAopProxy(this).selectDictDataByType(dictType); |
| | | SaHolder.getStorage().set(CacheConstants.SYS_DICT_KEY + dictType, datas); |
| | | } |
| | | |
| | | Map<String, String> map = StreamUtils.toMap(datas, SysDictData::getDictValue, SysDictData::getDictLabel); |
| | | Map<String, String> map = StreamUtils.toMap(datas, SysDictDataVo::getDictValue, SysDictDataVo::getDictLabel); |
| | | if (StringUtils.containsAny(dictValue, separator)) { |
| | | return Arrays.stream(dictValue.split(separator)) |
| | | .map(v -> map.getOrDefault(v, StringUtils.EMPTY)) |
| | |
| | | @Override |
| | | public String getDictValue(String dictType, String dictLabel, String separator) { |
| | | // ä¼å
仿¬å°ç¼åè·å |
| | | List<SysDictData> datas = (List<SysDictData>) SaHolder.getStorage().get(CacheConstants.SYS_DICT_KEY + dictType); |
| | | List<SysDictDataVo> datas = (List<SysDictDataVo>) SaHolder.getStorage().get(CacheConstants.SYS_DICT_KEY + dictType); |
| | | if (ObjectUtil.isNull(datas)) { |
| | | datas = SpringUtils.getAopProxy(this).selectDictDataByType(dictType); |
| | | SaHolder.getStorage().set(CacheConstants.SYS_DICT_KEY + dictType, datas); |
| | | } |
| | | |
| | | Map<String, String> map = StreamUtils.toMap(datas, SysDictData::getDictLabel, SysDictData::getDictValue); |
| | | Map<String, String> map = StreamUtils.toMap(datas, SysDictDataVo::getDictLabel, SysDictDataVo::getDictValue); |
| | | if (StringUtils.containsAny(dictLabel, separator)) { |
| | | return Arrays.stream(dictLabel.split(separator)) |
| | | .map(l -> map.getOrDefault(l, StringUtils.EMPTY)) |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.lang.tree.Tree; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | |
| | | import com.ruoyi.system.domain.SysMenu; |
| | | import com.ruoyi.system.domain.SysRole; |
| | | import com.ruoyi.system.domain.SysRoleMenu; |
| | | import com.ruoyi.system.domain.bo.SysMenuBo; |
| | | import com.ruoyi.system.domain.vo.MetaVo; |
| | | import com.ruoyi.system.domain.vo.RouterVo; |
| | | import com.ruoyi.system.domain.vo.SysMenuVo; |
| | | import com.ruoyi.system.mapper.SysMenuMapper; |
| | | import com.ruoyi.system.mapper.SysRoleMapper; |
| | | import com.ruoyi.system.mapper.SysRoleMenuMapper; |
| | |
| | | * @return èåä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public SysMenu selectMenuById(Long menuId) { |
| | | return baseMapper.selectById(menuId); |
| | | public SysMenuVo selectMenuById(Long menuId) { |
| | | return baseMapper.selectVoById(menuId); |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * æ°å¢ä¿åèåä¿¡æ¯ |
| | | * |
| | | * @param menu èåä¿¡æ¯ |
| | | * @param bo èåä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertMenu(SysMenu menu) { |
| | | public int insertMenu(SysMenuBo bo) { |
| | | SysMenu menu = BeanUtil.toBean(bo, SysMenu.class); |
| | | return baseMapper.insert(menu); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åèåä¿¡æ¯ |
| | | * |
| | | * @param menu èåä¿¡æ¯ |
| | | * @param bo èåä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateMenu(SysMenu menu) { |
| | | public int updateMenu(SysMenuBo bo) { |
| | | SysMenu menu = BeanUtil.toBean(bo, SysMenu.class); |
| | | return baseMapper.updateById(menu); |
| | | } |
| | | |
| | |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public String checkMenuNameUnique(SysMenu menu) { |
| | | public String checkMenuNameUnique(SysMenuBo menu) { |
| | | boolean exist = baseMapper.exists(new LambdaQueryWrapper<SysMenu>() |
| | | .eq(SysMenu::getMenuName, menu.getMenuName()) |
| | | .eq(SysMenu::getParentId, menu.getParentId()) |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.mybatis.core.page.PageQuery; |
| | | import com.ruoyi.common.mybatis.core.page.TableDataInfo; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.system.domain.SysNotice; |
| | | import com.ruoyi.system.domain.bo.SysNoticeBo; |
| | | import com.ruoyi.system.domain.vo.SysNoticeVo; |
| | | import com.ruoyi.system.mapper.SysNoticeMapper; |
| | | import com.ruoyi.system.service.ISysNoticeService; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | private final SysNoticeMapper baseMapper; |
| | | |
| | | @Override |
| | | public TableDataInfo<SysNotice> selectPageNoticeList(SysNotice notice, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<SysNotice> lqw = new LambdaQueryWrapper<SysNotice>() |
| | | .like(StringUtils.isNotBlank(notice.getNoticeTitle()), SysNotice::getNoticeTitle, notice.getNoticeTitle()) |
| | | .eq(StringUtils.isNotBlank(notice.getNoticeType()), SysNotice::getNoticeType, notice.getNoticeType()) |
| | | .like(ObjectUtil.isNotNull(notice.getCreateBy()), SysNotice::getCreateBy, notice.getCreateBy()); |
| | | Page<SysNotice> page = baseMapper.selectPage(pageQuery.build(), lqw); |
| | | public TableDataInfo<SysNoticeVo> selectPageNoticeList(SysNoticeBo notice, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<SysNotice> lqw = buildQueryWrapper(notice); |
| | | Page<SysNoticeVo> page = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | |
| | | * @return å
¬åä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public SysNotice selectNoticeById(Long noticeId) { |
| | | return baseMapper.selectById(noticeId); |
| | | public SysNoticeVo selectNoticeById(Long noticeId) { |
| | | return baseMapper.selectVoById(noticeId); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return å
¬åéå |
| | | */ |
| | | @Override |
| | | public List<SysNotice> selectNoticeList(SysNotice notice) { |
| | | return baseMapper.selectList(new LambdaQueryWrapper<SysNotice>() |
| | | .like(StringUtils.isNotBlank(notice.getNoticeTitle()), SysNotice::getNoticeTitle, notice.getNoticeTitle()) |
| | | .eq(StringUtils.isNotBlank(notice.getNoticeType()), SysNotice::getNoticeType, notice.getNoticeType()) |
| | | .like(ObjectUtil.isNotNull(notice.getCreateBy()), SysNotice::getCreateBy, notice.getCreateBy())); |
| | | public List<SysNoticeVo> selectNoticeList(SysNoticeBo notice) { |
| | | LambdaQueryWrapper<SysNotice> lqw = buildQueryWrapper(notice); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<SysNotice> buildQueryWrapper(SysNoticeBo bo) { |
| | | LambdaQueryWrapper<SysNotice> lqw = Wrappers.lambdaQuery(); |
| | | lqw.like(StringUtils.isNotBlank(bo.getNoticeTitle()), SysNotice::getNoticeTitle, bo.getNoticeTitle()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getNoticeType()), SysNotice::getNoticeType, bo.getNoticeType()); |
| | | lqw.eq(ObjectUtil.isNotNull(bo.getCreateBy()), SysNotice::getCreateBy, bo.getCreateBy()); |
| | | return lqw; |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢å
Œ |
| | | * |
| | | * @param notice å
¬åä¿¡æ¯ |
| | | * @param bo å
¬åä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertNotice(SysNotice notice) { |
| | | public int insertNotice(SysNoticeBo bo) { |
| | | SysNotice notice = BeanUtil.toBean(bo, SysNotice.class); |
| | | return baseMapper.insert(notice); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹å
Œ |
| | | * |
| | | * @param notice å
¬åä¿¡æ¯ |
| | | * @param bo å
¬åä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateNotice(SysNotice notice) { |
| | | public int updateNotice(SysNoticeBo bo) { |
| | | SysNotice notice = BeanUtil.toBean(bo, SysNotice.class); |
| | | return baseMapper.updateById(notice); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.mybatis.core.page.PageQuery; |
| | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.system.domain.SysPost; |
| | | import com.ruoyi.system.domain.SysUserPost; |
| | | import com.ruoyi.system.domain.bo.SysPostBo; |
| | | import com.ruoyi.system.domain.vo.SysPostVo; |
| | | import com.ruoyi.system.mapper.SysPostMapper; |
| | | import com.ruoyi.system.mapper.SysUserPostMapper; |
| | | import com.ruoyi.system.service.ISysPostService; |
| | |
| | | private final SysUserPostMapper userPostMapper; |
| | | |
| | | @Override |
| | | public TableDataInfo<SysPost> selectPagePostList(SysPost post, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<SysPost> lqw = new LambdaQueryWrapper<SysPost>() |
| | | .like(StringUtils.isNotBlank(post.getPostCode()), SysPost::getPostCode, post.getPostCode()) |
| | | .eq(StringUtils.isNotBlank(post.getStatus()), SysPost::getStatus, post.getStatus()) |
| | | .like(StringUtils.isNotBlank(post.getPostName()), SysPost::getPostName, post.getPostName()); |
| | | Page<SysPost> page = baseMapper.selectPage(pageQuery.build(), lqw); |
| | | public TableDataInfo<SysPostVo> selectPagePostList(SysPostBo post, PageQuery pageQuery) { |
| | | LambdaQueryWrapper<SysPost> lqw = buildQueryWrapper(post); |
| | | Page<SysPostVo> page = baseMapper.selectVoPage(pageQuery.build(), lqw); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | |
| | | * @return å²ä½ä¿¡æ¯éå |
| | | */ |
| | | @Override |
| | | public List<SysPost> selectPostList(SysPost post) { |
| | | return baseMapper.selectList(new LambdaQueryWrapper<SysPost>() |
| | | .like(StringUtils.isNotBlank(post.getPostCode()), SysPost::getPostCode, post.getPostCode()) |
| | | .eq(StringUtils.isNotBlank(post.getStatus()), SysPost::getStatus, post.getStatus()) |
| | | .like(StringUtils.isNotBlank(post.getPostName()), SysPost::getPostName, post.getPostName())); |
| | | public List<SysPostVo> selectPostList(SysPostBo post) { |
| | | LambdaQueryWrapper<SysPost> lqw = buildQueryWrapper(post); |
| | | return baseMapper.selectVoList(lqw); |
| | | } |
| | | |
| | | private LambdaQueryWrapper<SysPost> buildQueryWrapper(SysPostBo bo) { |
| | | LambdaQueryWrapper<SysPost> lqw = Wrappers.lambdaQuery(); |
| | | lqw.like(StringUtils.isNotBlank(bo.getPostCode()), SysPost::getPostCode, bo.getPostCode()); |
| | | lqw.like(StringUtils.isNotBlank(bo.getPostName()), SysPost::getPostName, bo.getPostName()); |
| | | lqw.eq(StringUtils.isNotBlank(bo.getStatus()), SysPost::getStatus, bo.getStatus()); |
| | | lqw.orderByAsc(SysPost::getPostSort); |
| | | return lqw; |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return å²ä½å表 |
| | | */ |
| | | @Override |
| | | public List<SysPost> selectPostAll() { |
| | | return baseMapper.selectList(); |
| | | public List<SysPostVo> selectPostAll() { |
| | | return baseMapper.selectVoList(new QueryWrapper<>()); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return è§è²å¯¹è±¡ä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public SysPost selectPostById(Long postId) { |
| | | return baseMapper.selectById(postId); |
| | | public SysPostVo selectPostById(Long postId) { |
| | | return baseMapper.selectVoById(postId); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public String checkPostNameUnique(SysPost post) { |
| | | public String checkPostNameUnique(SysPostBo post) { |
| | | boolean exist = baseMapper.exists(new LambdaQueryWrapper<SysPost>() |
| | | .eq(SysPost::getPostName, post.getPostName()) |
| | | .ne(ObjectUtil.isNotNull(post.getPostId()), SysPost::getPostId, post.getPostId())); |
| | |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public String checkPostCodeUnique(SysPost post) { |
| | | public String checkPostCodeUnique(SysPostBo post) { |
| | | boolean exist = baseMapper.exists(new LambdaQueryWrapper<SysPost>() |
| | | .eq(SysPost::getPostCode, post.getPostCode()) |
| | | .ne(ObjectUtil.isNotNull(post.getPostId()), SysPost::getPostId, post.getPostId())); |
| | |
| | | @Override |
| | | public int deletePostByIds(Long[] postIds) { |
| | | for (Long postId : postIds) { |
| | | SysPost post = selectPostById(postId); |
| | | SysPost post = baseMapper.selectById(postId); |
| | | if (countUserPostById(postId) > 0) { |
| | | throw new ServiceException(String.format("%1$så·²åé
,ä¸è½å é¤", post.getPostName())); |
| | | } |
| | |
| | | /** |
| | | * æ°å¢ä¿åå²ä½ä¿¡æ¯ |
| | | * |
| | | * @param post å²ä½ä¿¡æ¯ |
| | | * @param bo å²ä½ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int insertPost(SysPost post) { |
| | | public int insertPost(SysPostBo bo) { |
| | | SysPost post = BeanUtil.toBean(bo, SysPost.class); |
| | | return baseMapper.insert(post); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹ä¿åå²ä½ä¿¡æ¯ |
| | | * |
| | | * @param post å²ä½ä¿¡æ¯ |
| | | * @param bo å²ä½ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updatePost(SysPost post) { |
| | | public int updatePost(SysPostBo bo) { |
| | | SysPost post = BeanUtil.toBean(bo, SysPost.class); |
| | | return baseMapper.updateById(post); |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | |
| | | import com.ruoyi.system.domain.SysRoleDept; |
| | | import com.ruoyi.system.domain.SysRoleMenu; |
| | | import com.ruoyi.system.domain.SysUserRole; |
| | | import com.ruoyi.system.domain.bo.SysRoleBo; |
| | | import com.ruoyi.system.domain.vo.SysRoleVo; |
| | | import com.ruoyi.system.mapper.SysRoleDeptMapper; |
| | | import com.ruoyi.system.mapper.SysRoleMapper; |
| | | import com.ruoyi.system.mapper.SysRoleMenuMapper; |
| | |
| | | private final SysRoleDeptMapper roleDeptMapper; |
| | | |
| | | @Override |
| | | public TableDataInfo<SysRole> selectPageRoleList(SysRole role, PageQuery pageQuery) { |
| | | Page<SysRole> page = baseMapper.selectPageRoleList(pageQuery.build(), this.buildQueryWrapper(role)); |
| | | public TableDataInfo<SysRoleVo> selectPageRoleList(SysRoleBo role, PageQuery pageQuery) { |
| | | Page<SysRoleVo> page = baseMapper.selectPageRoleList(pageQuery.build(), this.buildQueryWrapper(role)); |
| | | return TableDataInfo.build(page); |
| | | } |
| | | |
| | |
| | | * @return è§è²æ°æ®éåä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public List<SysRole> selectRoleList(SysRole role) { |
| | | public List<SysRoleVo> selectRoleList(SysRoleBo role) { |
| | | return baseMapper.selectRoleList(this.buildQueryWrapper(role)); |
| | | } |
| | | |
| | | private Wrapper<SysRole> buildQueryWrapper(SysRole role) { |
| | | Map<String, Object> params = role.getParams(); |
| | | private Wrapper<SysRole> buildQueryWrapper(SysRoleBo bo) { |
| | | Map<String, Object> params = bo.getParams(); |
| | | QueryWrapper<SysRole> wrapper = Wrappers.query(); |
| | | wrapper.eq("r.del_flag", UserConstants.ROLE_NORMAL) |
| | | .eq(ObjectUtil.isNotNull(role.getRoleId()), "r.role_id", role.getRoleId()) |
| | | .like(StringUtils.isNotBlank(role.getRoleName()), "r.role_name", role.getRoleName()) |
| | | .eq(StringUtils.isNotBlank(role.getStatus()), "r.status", role.getStatus()) |
| | | .like(StringUtils.isNotBlank(role.getRoleKey()), "r.role_key", role.getRoleKey()) |
| | | .eq(ObjectUtil.isNotNull(bo.getRoleId()), "r.role_id", bo.getRoleId()) |
| | | .like(StringUtils.isNotBlank(bo.getRoleName()), "r.role_name", bo.getRoleName()) |
| | | .eq(StringUtils.isNotBlank(bo.getStatus()), "r.status", bo.getStatus()) |
| | | .like(StringUtils.isNotBlank(bo.getRoleKey()), "r.role_key", bo.getRoleKey()) |
| | | .between(params.get("beginTime") != null && params.get("endTime") != null, |
| | | "r.create_time", params.get("beginTime"), params.get("endTime")) |
| | | .orderByAsc("r.role_sort"); |
| | |
| | | * @return è§è²å表 |
| | | */ |
| | | @Override |
| | | public List<SysRole> selectRolesByUserId(Long userId) { |
| | | List<SysRole> userRoles = baseMapper.selectRolePermissionByUserId(userId); |
| | | List<SysRole> roles = selectRoleAll(); |
| | | for (SysRole role : roles) { |
| | | for (SysRole userRole : userRoles) { |
| | | public List<SysRoleVo> selectRolesByUserId(Long userId) { |
| | | List<SysRoleVo> userRoles = baseMapper.selectRolePermissionByUserId(userId); |
| | | List<SysRoleVo> roles = selectRoleAll(); |
| | | for (SysRoleVo role : roles) { |
| | | for (SysRoleVo userRole : userRoles) { |
| | | if (role.getRoleId().longValue() == userRole.getRoleId().longValue()) { |
| | | role.setFlag(true); |
| | | break; |
| | |
| | | */ |
| | | @Override |
| | | public Set<String> selectRolePermissionByUserId(Long userId) { |
| | | List<SysRole> perms = baseMapper.selectRolePermissionByUserId(userId); |
| | | List<SysRoleVo> perms = baseMapper.selectRolePermissionByUserId(userId); |
| | | Set<String> permsSet = new HashSet<>(); |
| | | for (SysRole perm : perms) { |
| | | for (SysRoleVo perm : perms) { |
| | | if (ObjectUtil.isNotNull(perm)) { |
| | | permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(","))); |
| | | } |
| | |
| | | * @return è§è²å表 |
| | | */ |
| | | @Override |
| | | public List<SysRole> selectRoleAll() { |
| | | return this.selectRoleList(new SysRole()); |
| | | public List<SysRoleVo> selectRoleAll() { |
| | | return this.selectRoleList(new SysRoleBo()); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return è§è²å¯¹è±¡ä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public SysRole selectRoleById(Long roleId) { |
| | | return baseMapper.selectById(roleId); |
| | | public SysRoleVo selectRoleById(Long roleId) { |
| | | return baseMapper.selectVoById(roleId); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public String checkRoleNameUnique(SysRole role) { |
| | | public String checkRoleNameUnique(SysRoleBo role) { |
| | | boolean exist = baseMapper.exists(new LambdaQueryWrapper<SysRole>() |
| | | .eq(SysRole::getRoleName, role.getRoleName()) |
| | | .ne(ObjectUtil.isNotNull(role.getRoleId()), SysRole::getRoleId, role.getRoleId())); |
| | |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public String checkRoleKeyUnique(SysRole role) { |
| | | public String checkRoleKeyUnique(SysRoleBo role) { |
| | | boolean exist = baseMapper.exists(new LambdaQueryWrapper<SysRole>() |
| | | .eq(SysRole::getRoleKey, role.getRoleKey()) |
| | | .ne(ObjectUtil.isNotNull(role.getRoleId()), SysRole::getRoleId, role.getRoleId())); |
| | |
| | | * @param role è§è²ä¿¡æ¯ |
| | | */ |
| | | @Override |
| | | public void checkRoleAllowed(SysRole role) { |
| | | public void checkRoleAllowed(SysRoleBo role) { |
| | | if (ObjectUtil.isNotNull(role.getRoleId()) && role.isAdmin()) { |
| | | throw new ServiceException("ä¸å
许æä½è¶
级管çåè§è²"); |
| | | } |
| | |
| | | @Override |
| | | public void checkRoleDataScope(Long roleId) { |
| | | if (!LoginHelper.isAdmin()) { |
| | | SysRole role = new SysRole(); |
| | | SysRoleBo role = new SysRoleBo(); |
| | | role.setRoleId(roleId); |
| | | List<SysRole> roles = this.selectRoleList(role); |
| | | List<SysRoleVo> roles = this.selectRoleList(role); |
| | | if (CollUtil.isEmpty(roles)) { |
| | | throw new ServiceException("没ææé访é®è§è²æ°æ®ï¼"); |
| | | } |
| | |
| | | /** |
| | | * æ°å¢ä¿åè§è²ä¿¡æ¯ |
| | | * |
| | | * @param role è§è²ä¿¡æ¯ |
| | | * @param bo è§è²ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int insertRole(SysRole role) { |
| | | public int insertRole(SysRoleBo bo) { |
| | | SysRole role = BeanUtil.toBean(bo, SysRole.class); |
| | | // æ°å¢è§è²ä¿¡æ¯ |
| | | baseMapper.insert(role); |
| | | return insertRoleMenu(role); |
| | |
| | | /** |
| | | * ä¿®æ¹ä¿åè§è²ä¿¡æ¯ |
| | | * |
| | | * @param role è§è²ä¿¡æ¯ |
| | | * @param bo è§è²ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int updateRole(SysRole role) { |
| | | public int updateRole(SysRoleBo bo) { |
| | | SysRole role = BeanUtil.toBean(bo, SysRole.class); |
| | | // ä¿®æ¹è§è²ä¿¡æ¯ |
| | | baseMapper.updateById(role); |
| | | // å é¤è§è²ä¸èåå
³è |
| | |
| | | /** |
| | | * ä¿®æ¹è§è²ç¶æ |
| | | * |
| | | * @param role è§è²ä¿¡æ¯ |
| | | * @param bo è§è²ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public int updateRoleStatus(SysRole role) { |
| | | public int updateRoleStatus(SysRoleBo bo) { |
| | | SysRole role = BeanUtil.toBean(bo, SysRole.class); |
| | | return baseMapper.updateById(role); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹æ°æ®æéä¿¡æ¯ |
| | | * |
| | | * @param role è§è²ä¿¡æ¯ |
| | | * @param bo è§è²ä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int authDataScope(SysRole role) { |
| | | public int authDataScope(SysRoleBo bo) { |
| | | SysRole role = BeanUtil.toBean(bo, SysRole.class); |
| | | // ä¿®æ¹è§è²ä¿¡æ¯ |
| | | baseMapper.updateById(role); |
| | | // å é¤è§è²ä¸é¨é¨å
³è |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int deleteRoleByIds(Long[] roleIds) { |
| | | for (Long roleId : roleIds) { |
| | | checkRoleAllowed(new SysRole(roleId)); |
| | | checkRoleAllowed(new SysRoleBo(roleId)); |
| | | checkRoleDataScope(roleId); |
| | | SysRole role = selectRoleById(roleId); |
| | | SysRole role = baseMapper.selectById(roleId); |
| | | if (countUserRoleByRoleId(roleId) > 0) { |
| | | throw new ServiceException(String.format("%1$så·²åé
,ä¸è½å é¤", role.getRoleName())); |
| | | } |
| | |
| | | import com.ruoyi.common.mybatis.helper.DataBaseHelper; |
| | | import com.ruoyi.common.satoken.utils.LoginHelper; |
| | | import com.ruoyi.system.domain.*; |
| | | import com.ruoyi.system.domain.vo.SysPostVo; |
| | | import com.ruoyi.system.domain.vo.SysRoleVo; |
| | | import com.ruoyi.system.mapper.*; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | */ |
| | | @Override |
| | | public String selectUserRoleGroup(String userName) { |
| | | List<SysRole> list = roleMapper.selectRolesByUserName(userName); |
| | | List<SysRoleVo> list = roleMapper.selectRolesByUserName(userName); |
| | | if (CollUtil.isEmpty(list)) { |
| | | return StringUtils.EMPTY; |
| | | } |
| | | return StreamUtils.join(list, SysRole::getRoleName); |
| | | return StreamUtils.join(list, SysRoleVo::getRoleName); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public String selectUserPostGroup(String userName) { |
| | | List<SysPost> list = postMapper.selectPostsByUserName(userName); |
| | | List<SysPostVo> list = postMapper.selectPostsByUserName(userName); |
| | | if (CollUtil.isEmpty(list)) { |
| | | return StringUtils.EMPTY; |
| | | } |
| | | return StreamUtils.join(list, SysPost::getPostName); |
| | | return StreamUtils.join(list, SysPostVo::getPostName); |
| | | } |
| | | |
| | | /** |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.SysDeptMapper"> |
| | | |
| | | <resultMap type="com.ruoyi.system.domain.SysDept" id="SysDeptResult"> |
| | | <resultMap type="com.ruoyi.system.domain.vo.SysDeptVo" id="SysDeptResult"> |
| | | </resultMap> |
| | | |
| | | <select id="selectDeptList" resultMap="SysDeptResult"> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.SysPostMapper"> |
| | | |
| | | <resultMap type="com.ruoyi.system.domain.SysPost" id="SysPostResult"> |
| | | <resultMap type="com.ruoyi.system.domain.vo.SysPostVo" id="SysPostResult"> |
| | | </resultMap> |
| | | |
| | | <select id="selectPostListByUserId" parameterType="Long" resultType="Long"> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.system.mapper.SysRoleMapper"> |
| | | |
| | | <resultMap type="com.ruoyi.system.domain.SysRole" id="SysRoleResult"> |
| | | <resultMap type="com.ruoyi.system.domain.vo.SysRoleVo" id="SysRoleResult"> |
| | | </resultMap> |
| | | |
| | | <sql id="selectRoleVo"> |