From cc6a7ff2477b9644ad3db4f67e4f4978c92c3b74 Mon Sep 17 00:00:00 2001 From: Zhu Zhonghua <zhonghua@qq.com> Date: 星期一, 07 四月 2025 17:14:50 +0800 Subject: [PATCH] 删除ruoyi文件 --- /dev/null | 53 ----------------------------------------------------- aps-gateway/src/main/resources/bootstrap.yml | 2 +- 2 files changed, 1 insertions(+), 54 deletions(-) diff --git a/aps-gateway/src/main/resources/bootstrap.yml b/aps-gateway/src/main/resources/bootstrap.yml index 18570fa..da946ea 100644 --- a/aps-gateway/src/main/resources/bootstrap.yml +++ b/aps-gateway/src/main/resources/bootstrap.yml @@ -28,7 +28,7 @@ eager: true transport: # 鎺у埗鍙板湴鍧� - dashboard: 127.0.0.1:8718 + dashboard: 192.168.50.160:8718 # nacos閰嶇疆鎸佷箙鍖� datasource: ds1: diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/RuoYiSystemApplication.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/RuoYiSystemApplication.java deleted file mode 100644 index 400976a..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/RuoYiSystemApplication.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.ruoyi.system; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import com.aps.common.security.annotation.EnableCustomConfig; -import com.aps.common.security.annotation.EnableRyFeignClients; - -/** - * 绯荤粺妯″潡 - * - * @author ruoyi - */ -@EnableCustomConfig -@EnableRyFeignClients -@SpringBootApplication -public class RuoYiSystemApplication -{ - public static void main(String[] args) - { - SpringApplication.run(RuoYiSystemApplication.class, args); - System.out.println("(鈾モ棤鈥库棤)锞夛緸 绯荤粺妯″潡鍚姩鎴愬姛 醿�(麓凇`醿�)锞� \n" + - " .-------. ____ __ \n" + - " | _ _ \\ \\ \\ / / \n" + - " | ( ' ) | \\ _. / ' \n" + - " |(_ o _) / _( )_ .' \n" + - " | (_,_).' __ ___(_ o _)' \n" + - " | |\\ \\ | || |(_,_)' \n" + - " | | \\ `' /| `-' / \n" + - " | | \\ / \\ / \n" + - " ''-' `'-' `-..-' "); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysConfigController.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysConfigController.java deleted file mode 100644 index d3636de..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysConfigController.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.ruoyi.system.controller; - -import java.util.List; -import jakarta.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.aps.common.core.utils.poi.ExcelUtil; -import com.aps.common.core.web.controller.BaseController; -import com.aps.common.core.web.domain.AjaxResult; -import com.aps.common.core.web.page.TableDataInfo; -import com.aps.common.log.annotation.Log; -import com.aps.common.log.enums.BusinessType; -import com.aps.common.security.annotation.RequiresPermissions; -import com.aps.common.security.utils.SecurityUtils; -import com.ruoyi.system.domain.SysConfig; -import com.ruoyi.system.service.ISysConfigService; - -/** - * 鍙傛暟閰嶇疆 淇℃伅鎿嶄綔澶勭悊 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/config") -public class SysConfigController extends BaseController -{ - @Autowired - private ISysConfigService configService; - - /** - * 鑾峰彇鍙傛暟閰嶇疆鍒楄〃 - */ - @RequiresPermissions("system:config:list") - @GetMapping("/list") - public TableDataInfo list(SysConfig config) - { - startPage(); - List<SysConfig> list = configService.selectConfigList(config); - return getDataTable(list); - } - - @Log(title = "鍙傛暟绠$悊", businessType = BusinessType.EXPORT) - @RequiresPermissions("system:config:export") - @PostMapping("/export") - public void export(HttpServletResponse response, SysConfig config) - { - List<SysConfig> list = configService.selectConfigList(config); - ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class); - util.exportExcel(response, list, "鍙傛暟鏁版嵁"); - } - - /** - * 鏍规嵁鍙傛暟缂栧彿鑾峰彇璇︾粏淇℃伅 - */ - @GetMapping(value = "/{configId}") - public AjaxResult getInfo(@PathVariable Long configId) - { - return success(configService.selectConfigById(configId)); - } - - /** - * 鏍规嵁鍙傛暟閿悕鏌ヨ鍙傛暟鍊� - */ - @GetMapping(value = "/configKey/{configKey}") - public AjaxResult getConfigKey(@PathVariable String configKey) - { - return success(configService.selectConfigByKey(configKey)); - } - - /** - * 鏂板鍙傛暟閰嶇疆 - */ - @RequiresPermissions("system:config:add") - @Log(title = "鍙傛暟绠$悊", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@Validated @RequestBody SysConfig config) - { - if (!configService.checkConfigKeyUnique(config)) - { - return error("鏂板鍙傛暟'" + config.getConfigName() + "'澶辫触锛屽弬鏁伴敭鍚嶅凡瀛樺湪"); - } - config.setCreateBy(SecurityUtils.getUsername()); - return toAjax(configService.insertConfig(config)); - } - - /** - * 淇敼鍙傛暟閰嶇疆 - */ - @RequiresPermissions("system:config:edit") - @Log(title = "鍙傛暟绠$悊", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@Validated @RequestBody SysConfig config) - { - if (!configService.checkConfigKeyUnique(config)) - { - return error("淇敼鍙傛暟'" + config.getConfigName() + "'澶辫触锛屽弬鏁伴敭鍚嶅凡瀛樺湪"); - } - config.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(configService.updateConfig(config)); - } - - /** - * 鍒犻櫎鍙傛暟閰嶇疆 - */ - @RequiresPermissions("system:config:remove") - @Log(title = "鍙傛暟绠$悊", businessType = BusinessType.DELETE) - @DeleteMapping("/{configIds}") - public AjaxResult remove(@PathVariable Long[] configIds) - { - configService.deleteConfigByIds(configIds); - return success(); - } - - /** - * 鍒锋柊鍙傛暟缂撳瓨 - */ - @RequiresPermissions("system:config:remove") - @Log(title = "鍙傛暟绠$悊", businessType = BusinessType.CLEAN) - @DeleteMapping("/refreshCache") - public AjaxResult refreshCache() - { - configService.resetConfigCache(); - return success(); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysDeptController.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysDeptController.java deleted file mode 100644 index 57605eb..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysDeptController.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.ruoyi.system.controller; - -import java.util.List; -import org.apache.commons.lang3.ArrayUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.aps.common.core.constant.UserConstants; -import com.aps.common.core.utils.StringUtils; -import com.aps.common.core.web.controller.BaseController; -import com.aps.common.core.web.domain.AjaxResult; -import com.aps.common.log.annotation.Log; -import com.aps.common.log.enums.BusinessType; -import com.aps.common.security.annotation.RequiresPermissions; -import com.aps.common.security.utils.SecurityUtils; -import com.aps.system.api.domain.SysDept; -import com.ruoyi.system.service.ISysDeptService; - -/** - * 閮ㄩ棬淇℃伅 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/dept") -public class SysDeptController extends BaseController -{ - @Autowired - private ISysDeptService deptService; - - /** - * 鑾峰彇閮ㄩ棬鍒楄〃 - */ - @RequiresPermissions("system:dept:list") - @GetMapping("/list") - public AjaxResult list(SysDept dept) - { - List<SysDept> depts = deptService.selectDeptList(dept); - return success(depts); - } - - /** - * 鏌ヨ閮ㄩ棬鍒楄〃锛堟帓闄よ妭鐐癸級 - */ - @RequiresPermissions("system:dept:list") - @GetMapping("/list/exclude/{deptId}") - public AjaxResult excludeChild(@PathVariable(value = "deptId", required = false) Long deptId) - { - List<SysDept> depts = deptService.selectDeptList(new SysDept()); - depts.removeIf(d -> d.getDeptId().intValue() == deptId || ArrayUtils.contains(StringUtils.split(d.getAncestors(), ","), deptId + "")); - return success(depts); - } - - /** - * 鏍规嵁閮ㄩ棬缂栧彿鑾峰彇璇︾粏淇℃伅 - */ - @RequiresPermissions("system:dept:query") - @GetMapping(value = "/{deptId}") - public AjaxResult getInfo(@PathVariable Long deptId) - { - deptService.checkDeptDataScope(deptId); - return success(deptService.selectDeptById(deptId)); - } - - /** - * 鏂板閮ㄩ棬 - */ - @RequiresPermissions("system:dept:add") - @Log(title = "閮ㄩ棬绠$悊", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@Validated @RequestBody SysDept dept) - { - if (!deptService.checkDeptNameUnique(dept)) - { - return error("鏂板閮ㄩ棬'" + dept.getDeptName() + "'澶辫触锛岄儴闂ㄥ悕绉板凡瀛樺湪"); - } - dept.setCreateBy(SecurityUtils.getUsername()); - return toAjax(deptService.insertDept(dept)); - } - - /** - * 淇敼閮ㄩ棬 - */ - @RequiresPermissions("system:dept:edit") - @Log(title = "閮ㄩ棬绠$悊", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@Validated @RequestBody SysDept dept) - { - Long deptId = dept.getDeptId(); - deptService.checkDeptDataScope(deptId); - if (!deptService.checkDeptNameUnique(dept)) - { - return error("淇敼閮ㄩ棬'" + dept.getDeptName() + "'澶辫触锛岄儴闂ㄥ悕绉板凡瀛樺湪"); - } - else if (dept.getParentId().equals(deptId)) - { - return error("淇敼閮ㄩ棬'" + dept.getDeptName() + "'澶辫触锛屼笂绾ч儴闂ㄤ笉鑳芥槸鑷繁"); - } - else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) - { - return error("璇ラ儴闂ㄥ寘鍚湭鍋滅敤鐨勫瓙閮ㄩ棬锛�"); - } - dept.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(deptService.updateDept(dept)); - } - - /** - * 鍒犻櫎閮ㄩ棬 - */ - @RequiresPermissions("system:dept:remove") - @Log(title = "閮ㄩ棬绠$悊", businessType = BusinessType.DELETE) - @DeleteMapping("/{deptId}") - public AjaxResult remove(@PathVariable Long deptId) - { - if (deptService.hasChildByDeptId(deptId)) - { - return warn("瀛樺湪涓嬬骇閮ㄩ棬,涓嶅厑璁稿垹闄�"); - } - if (deptService.checkDeptExistUser(deptId)) - { - return warn("閮ㄩ棬瀛樺湪鐢ㄦ埛,涓嶅厑璁稿垹闄�"); - } - deptService.checkDeptDataScope(deptId); - return toAjax(deptService.deleteDeptById(deptId)); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysDictDataController.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysDictDataController.java deleted file mode 100644 index beb4eb9..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysDictDataController.java +++ /dev/null @@ -1,122 +0,0 @@ -package com.ruoyi.system.controller; - -import java.util.ArrayList; -import java.util.List; -import jakarta.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.aps.common.core.utils.StringUtils; -import com.aps.common.core.utils.poi.ExcelUtil; -import com.aps.common.core.web.controller.BaseController; -import com.aps.common.core.web.domain.AjaxResult; -import com.aps.common.core.web.page.TableDataInfo; -import com.aps.common.log.annotation.Log; -import com.aps.common.log.enums.BusinessType; -import com.aps.common.security.annotation.RequiresPermissions; -import com.aps.common.security.utils.SecurityUtils; -import com.aps.system.api.domain.SysDictData; -import com.ruoyi.system.service.ISysDictDataService; -import com.ruoyi.system.service.ISysDictTypeService; - -/** - * 鏁版嵁瀛楀吀淇℃伅 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/dict/data") -public class SysDictDataController extends BaseController -{ - @Autowired - private ISysDictDataService dictDataService; - - @Autowired - private ISysDictTypeService dictTypeService; - - @RequiresPermissions("system:dict:list") - @GetMapping("/list") - public TableDataInfo list(SysDictData dictData) - { - startPage(); - List<SysDictData> list = dictDataService.selectDictDataList(dictData); - return getDataTable(list); - } - - @Log(title = "瀛楀吀鏁版嵁", businessType = BusinessType.EXPORT) - @RequiresPermissions("system:dict:export") - @PostMapping("/export") - public void export(HttpServletResponse response, SysDictData dictData) - { - List<SysDictData> list = dictDataService.selectDictDataList(dictData); - ExcelUtil<SysDictData> util = new ExcelUtil<SysDictData>(SysDictData.class); - util.exportExcel(response, list, "瀛楀吀鏁版嵁"); - } - - /** - * 鏌ヨ瀛楀吀鏁版嵁璇︾粏 - */ - @RequiresPermissions("system:dict:query") - @GetMapping(value = "/{dictCode}") - public AjaxResult getInfo(@PathVariable Long dictCode) - { - return success(dictDataService.selectDictDataById(dictCode)); - } - - /** - * 鏍规嵁瀛楀吀绫诲瀷鏌ヨ瀛楀吀鏁版嵁淇℃伅 - */ - @GetMapping(value = "/type/{dictType}") - public AjaxResult dictType(@PathVariable String dictType) - { - List<SysDictData> data = dictTypeService.selectDictDataByType(dictType); - if (StringUtils.isNull(data)) - { - data = new ArrayList<SysDictData>(); - } - return success(data); - } - - /** - * 鏂板瀛楀吀绫诲瀷 - */ - @RequiresPermissions("system:dict:add") - @Log(title = "瀛楀吀鏁版嵁", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@Validated @RequestBody SysDictData dict) - { - dict.setCreateBy(SecurityUtils.getUsername()); - return toAjax(dictDataService.insertDictData(dict)); - } - - /** - * 淇敼淇濆瓨瀛楀吀绫诲瀷 - */ - @RequiresPermissions("system:dict:edit") - @Log(title = "瀛楀吀鏁版嵁", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@Validated @RequestBody SysDictData dict) - { - dict.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(dictDataService.updateDictData(dict)); - } - - /** - * 鍒犻櫎瀛楀吀绫诲瀷 - */ - @RequiresPermissions("system:dict:remove") - @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.DELETE) - @DeleteMapping("/{dictCodes}") - public AjaxResult remove(@PathVariable Long[] dictCodes) - { - dictDataService.deleteDictDataByIds(dictCodes); - return success(); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysDictTypeController.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysDictTypeController.java deleted file mode 100644 index e5f9e75..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysDictTypeController.java +++ /dev/null @@ -1,132 +0,0 @@ -package com.ruoyi.system.controller; - -import java.util.List; -import jakarta.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.aps.common.core.utils.poi.ExcelUtil; -import com.aps.common.core.web.controller.BaseController; -import com.aps.common.core.web.domain.AjaxResult; -import com.aps.common.core.web.page.TableDataInfo; -import com.aps.common.log.annotation.Log; -import com.aps.common.log.enums.BusinessType; -import com.aps.common.security.annotation.RequiresPermissions; -import com.aps.common.security.utils.SecurityUtils; -import com.aps.system.api.domain.SysDictType; -import com.ruoyi.system.service.ISysDictTypeService; - -/** - * 鏁版嵁瀛楀吀淇℃伅 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/dict/type") -public class SysDictTypeController extends BaseController -{ - @Autowired - private ISysDictTypeService dictTypeService; - - @RequiresPermissions("system:dict:list") - @GetMapping("/list") - public TableDataInfo list(SysDictType dictType) - { - startPage(); - List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); - return getDataTable(list); - } - - @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.EXPORT) - @RequiresPermissions("system:dict:export") - @PostMapping("/export") - public void export(HttpServletResponse response, SysDictType dictType) - { - List<SysDictType> list = dictTypeService.selectDictTypeList(dictType); - ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class); - util.exportExcel(response, list, "瀛楀吀绫诲瀷"); - } - - /** - * 鏌ヨ瀛楀吀绫诲瀷璇︾粏 - */ - @RequiresPermissions("system:dict:query") - @GetMapping(value = "/{dictId}") - public AjaxResult getInfo(@PathVariable Long dictId) - { - return success(dictTypeService.selectDictTypeById(dictId)); - } - - /** - * 鏂板瀛楀吀绫诲瀷 - */ - @RequiresPermissions("system:dict:add") - @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@Validated @RequestBody SysDictType dict) - { - if (!dictTypeService.checkDictTypeUnique(dict)) - { - return error("鏂板瀛楀吀'" + dict.getDictName() + "'澶辫触锛屽瓧鍏哥被鍨嬪凡瀛樺湪"); - } - dict.setCreateBy(SecurityUtils.getUsername()); - return toAjax(dictTypeService.insertDictType(dict)); - } - - /** - * 淇敼瀛楀吀绫诲瀷 - */ - @RequiresPermissions("system:dict:edit") - @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@Validated @RequestBody SysDictType dict) - { - if (!dictTypeService.checkDictTypeUnique(dict)) - { - return error("淇敼瀛楀吀'" + dict.getDictName() + "'澶辫触锛屽瓧鍏哥被鍨嬪凡瀛樺湪"); - } - dict.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(dictTypeService.updateDictType(dict)); - } - - /** - * 鍒犻櫎瀛楀吀绫诲瀷 - */ - @RequiresPermissions("system:dict:remove") - @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.DELETE) - @DeleteMapping("/{dictIds}") - public AjaxResult remove(@PathVariable Long[] dictIds) - { - dictTypeService.deleteDictTypeByIds(dictIds); - return success(); - } - - /** - * 鍒锋柊瀛楀吀缂撳瓨 - */ - @RequiresPermissions("system:dict:remove") - @Log(title = "瀛楀吀绫诲瀷", businessType = BusinessType.CLEAN) - @DeleteMapping("/refreshCache") - public AjaxResult refreshCache() - { - dictTypeService.resetDictCache(); - return success(); - } - - /** - * 鑾峰彇瀛楀吀閫夋嫨妗嗗垪琛� - */ - @GetMapping("/optionselect") - public AjaxResult optionselect() - { - List<SysDictType> dictTypes = dictTypeService.selectDictTypeAll(); - return success(dictTypes); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysLogininforController.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysLogininforController.java deleted file mode 100644 index fa4f424..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysLogininforController.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.ruoyi.system.controller; - -import java.util.List; -import jakarta.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.aps.common.core.constant.CacheConstants; -import com.aps.common.core.utils.poi.ExcelUtil; -import com.aps.common.core.web.controller.BaseController; -import com.aps.common.core.web.domain.AjaxResult; -import com.aps.common.core.web.page.TableDataInfo; -import com.aps.common.log.annotation.Log; -import com.aps.common.log.enums.BusinessType; -import com.aps.common.redis.service.RedisService; -import com.aps.common.security.annotation.InnerAuth; -import com.aps.common.security.annotation.RequiresPermissions; -import com.aps.system.api.domain.SysLogininfor; -import com.ruoyi.system.service.ISysLogininforService; - -/** - * 绯荤粺璁块棶璁板綍 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/logininfor") -public class SysLogininforController extends BaseController -{ - @Autowired - private ISysLogininforService logininforService; - - @Autowired - private RedisService redisService; - - @RequiresPermissions("system:logininfor:list") - @GetMapping("/list") - public TableDataInfo list(SysLogininfor logininfor) - { - startPage(); - List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); - return getDataTable(list); - } - - @Log(title = "鐧诲綍鏃ュ織", businessType = BusinessType.EXPORT) - @RequiresPermissions("system:logininfor:export") - @PostMapping("/export") - public void export(HttpServletResponse response, SysLogininfor logininfor) - { - List<SysLogininfor> list = logininforService.selectLogininforList(logininfor); - ExcelUtil<SysLogininfor> util = new ExcelUtil<SysLogininfor>(SysLogininfor.class); - util.exportExcel(response, list, "鐧诲綍鏃ュ織"); - } - - @RequiresPermissions("system:logininfor:remove") - @Log(title = "鐧诲綍鏃ュ織", businessType = BusinessType.DELETE) - @DeleteMapping("/{infoIds}") - public AjaxResult remove(@PathVariable Long[] infoIds) - { - return toAjax(logininforService.deleteLogininforByIds(infoIds)); - } - - @RequiresPermissions("system:logininfor:remove") - @Log(title = "鐧诲綍鏃ュ織", businessType = BusinessType.DELETE) - @DeleteMapping("/clean") - public AjaxResult clean() - { - logininforService.cleanLogininfor(); - return success(); - } - - @RequiresPermissions("system:logininfor:unlock") - @Log(title = "璐︽埛瑙i攣", businessType = BusinessType.OTHER) - @GetMapping("/unlock/{userName}") - public AjaxResult unlock(@PathVariable("userName") String userName) - { - redisService.deleteObject(CacheConstants.PWD_ERR_CNT_KEY + userName); - return success(); - } - - @InnerAuth - @PostMapping - public AjaxResult add(@RequestBody SysLogininfor logininfor) - { - return toAjax(logininforService.insertLogininfor(logininfor)); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysMenuController.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysMenuController.java deleted file mode 100644 index 60dcbc1..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysMenuController.java +++ /dev/null @@ -1,159 +0,0 @@ -package com.ruoyi.system.controller; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.aps.common.core.constant.UserConstants; -import com.aps.common.core.utils.StringUtils; -import com.aps.common.core.web.controller.BaseController; -import com.aps.common.core.web.domain.AjaxResult; -import com.aps.common.log.annotation.Log; -import com.aps.common.log.enums.BusinessType; -import com.aps.common.security.annotation.RequiresPermissions; -import com.aps.common.security.utils.SecurityUtils; -import com.ruoyi.system.domain.SysMenu; -import com.ruoyi.system.service.ISysMenuService; - -/** - * 鑿滃崟淇℃伅 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/menu") -public class SysMenuController extends BaseController -{ - @Autowired - private ISysMenuService menuService; - - /** - * 鑾峰彇鑿滃崟鍒楄〃 - */ - @RequiresPermissions("system:menu:list") - @GetMapping("/list") - public AjaxResult list(SysMenu menu) - { - Long userId = SecurityUtils.getUserId(); - List<SysMenu> menus = menuService.selectMenuList(menu, userId); - return success(menus); - } - - /** - * 鏍规嵁鑿滃崟缂栧彿鑾峰彇璇︾粏淇℃伅 - */ - @RequiresPermissions("system:menu:query") - @GetMapping(value = "/{menuId}") - public AjaxResult getInfo(@PathVariable Long menuId) - { - return success(menuService.selectMenuById(menuId)); - } - - /** - * 鑾峰彇鑿滃崟涓嬫媺鏍戝垪琛� - */ - @GetMapping("/treeselect") - public AjaxResult treeselect(SysMenu menu) - { - Long userId = SecurityUtils.getUserId(); - List<SysMenu> menus = menuService.selectMenuList(menu, userId); - return success(menuService.buildMenuTreeSelect(menus)); - } - - /** - * 鍔犺浇瀵瑰簲瑙掕壊鑿滃崟鍒楄〃鏍� - */ - @GetMapping(value = "/roleMenuTreeselect/{roleId}") - public AjaxResult roleMenuTreeselect(@PathVariable("roleId") Long roleId) - { - Long userId = SecurityUtils.getUserId(); - List<SysMenu> menus = menuService.selectMenuList(userId); - AjaxResult ajax = AjaxResult.success(); - ajax.put("checkedKeys", menuService.selectMenuListByRoleId(roleId)); - ajax.put("menus", menuService.buildMenuTreeSelect(menus)); - return ajax; - } - - /** - * 鏂板鑿滃崟 - */ - @RequiresPermissions("system:menu:add") - @Log(title = "鑿滃崟绠$悊", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@Validated @RequestBody SysMenu menu) - { - if (!menuService.checkMenuNameUnique(menu)) - { - return error("鏂板鑿滃崟'" + menu.getMenuName() + "'澶辫触锛岃彍鍗曞悕绉板凡瀛樺湪"); - } - else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) - { - return error("鏂板鑿滃崟'" + menu.getMenuName() + "'澶辫触锛屽湴鍧�蹇呴』浠ttp(s)://寮�澶�"); - } - menu.setCreateBy(SecurityUtils.getUsername()); - return toAjax(menuService.insertMenu(menu)); - } - - /** - * 淇敼鑿滃崟 - */ - @RequiresPermissions("system:menu:edit") - @Log(title = "鑿滃崟绠$悊", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@Validated @RequestBody SysMenu menu) - { - if (!menuService.checkMenuNameUnique(menu)) - { - return error("淇敼鑿滃崟'" + menu.getMenuName() + "'澶辫触锛岃彍鍗曞悕绉板凡瀛樺湪"); - } - else if (UserConstants.YES_FRAME.equals(menu.getIsFrame()) && !StringUtils.ishttp(menu.getPath())) - { - return error("淇敼鑿滃崟'" + menu.getMenuName() + "'澶辫触锛屽湴鍧�蹇呴』浠ttp(s)://寮�澶�"); - } - else if (menu.getMenuId().equals(menu.getParentId())) - { - return error("淇敼鑿滃崟'" + menu.getMenuName() + "'澶辫触锛屼笂绾ц彍鍗曚笉鑳介�夋嫨鑷繁"); - } - menu.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(menuService.updateMenu(menu)); - } - - /** - * 鍒犻櫎鑿滃崟 - */ - @RequiresPermissions("system:menu:remove") - @Log(title = "鑿滃崟绠$悊", businessType = BusinessType.DELETE) - @DeleteMapping("/{menuId}") - public AjaxResult remove(@PathVariable("menuId") Long menuId) - { - if (menuService.hasChildByMenuId(menuId)) - { - return warn("瀛樺湪瀛愯彍鍗�,涓嶅厑璁稿垹闄�"); - } - if (menuService.checkMenuExistRole(menuId)) - { - return warn("鑿滃崟宸插垎閰�,涓嶅厑璁稿垹闄�"); - } - return toAjax(menuService.deleteMenuById(menuId)); - } - - /** - * 鑾峰彇璺敱淇℃伅 - * - * @return 璺敱淇℃伅 - */ - @GetMapping("getRouters") - public AjaxResult getRouters() - { - Long userId = SecurityUtils.getUserId(); - List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId); - return success(menuService.buildMenus(menus)); - } -} \ No newline at end of file diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysNoticeController.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysNoticeController.java deleted file mode 100644 index fb5db44..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysNoticeController.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.ruoyi.system.controller; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.aps.common.core.web.controller.BaseController; -import com.aps.common.core.web.domain.AjaxResult; -import com.aps.common.core.web.page.TableDataInfo; -import com.aps.common.log.annotation.Log; -import com.aps.common.log.enums.BusinessType; -import com.aps.common.security.annotation.RequiresPermissions; -import com.aps.common.security.utils.SecurityUtils; -import com.ruoyi.system.domain.SysNotice; -import com.ruoyi.system.service.ISysNoticeService; - -/** - * 鍏憡 淇℃伅鎿嶄綔澶勭悊 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/notice") -public class SysNoticeController extends BaseController -{ - @Autowired - private ISysNoticeService noticeService; - - /** - * 鑾峰彇閫氱煡鍏憡鍒楄〃 - */ - @RequiresPermissions("system:notice:list") - @GetMapping("/list") - public TableDataInfo list(SysNotice notice) - { - startPage(); - List<SysNotice> list = noticeService.selectNoticeList(notice); - return getDataTable(list); - } - - /** - * 鏍规嵁閫氱煡鍏憡缂栧彿鑾峰彇璇︾粏淇℃伅 - */ - @RequiresPermissions("system:notice:query") - @GetMapping(value = "/{noticeId}") - public AjaxResult getInfo(@PathVariable Long noticeId) - { - return success(noticeService.selectNoticeById(noticeId)); - } - - /** - * 鏂板閫氱煡鍏憡 - */ - @RequiresPermissions("system:notice:add") - @Log(title = "閫氱煡鍏憡", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@Validated @RequestBody SysNotice notice) - { - notice.setCreateBy(SecurityUtils.getUsername()); - return toAjax(noticeService.insertNotice(notice)); - } - - /** - * 淇敼閫氱煡鍏憡 - */ - @RequiresPermissions("system:notice:edit") - @Log(title = "閫氱煡鍏憡", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@Validated @RequestBody SysNotice notice) - { - notice.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(noticeService.updateNotice(notice)); - } - - /** - * 鍒犻櫎閫氱煡鍏憡 - */ - @RequiresPermissions("system:notice:remove") - @Log(title = "閫氱煡鍏憡", businessType = BusinessType.DELETE) - @DeleteMapping("/{noticeIds}") - public AjaxResult remove(@PathVariable Long[] noticeIds) - { - return toAjax(noticeService.deleteNoticeByIds(noticeIds)); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysOperlogController.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysOperlogController.java deleted file mode 100644 index 78dd6f2..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysOperlogController.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.ruoyi.system.controller; - -import java.util.List; -import jakarta.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.aps.common.core.utils.poi.ExcelUtil; -import com.aps.common.core.web.controller.BaseController; -import com.aps.common.core.web.domain.AjaxResult; -import com.aps.common.core.web.page.TableDataInfo; -import com.aps.common.log.annotation.Log; -import com.aps.common.log.enums.BusinessType; -import com.aps.common.security.annotation.InnerAuth; -import com.aps.common.security.annotation.RequiresPermissions; -import com.aps.system.api.domain.SysOperLog; -import com.ruoyi.system.service.ISysOperLogService; - -/** - * 鎿嶄綔鏃ュ織璁板綍 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/operlog") -public class SysOperlogController extends BaseController -{ - @Autowired - private ISysOperLogService operLogService; - - @RequiresPermissions("system:operlog:list") - @GetMapping("/list") - public TableDataInfo list(SysOperLog operLog) - { - startPage(); - List<SysOperLog> list = operLogService.selectOperLogList(operLog); - return getDataTable(list); - } - - @Log(title = "鎿嶄綔鏃ュ織", businessType = BusinessType.EXPORT) - @RequiresPermissions("system:operlog:export") - @PostMapping("/export") - public void export(HttpServletResponse response, SysOperLog operLog) - { - List<SysOperLog> list = operLogService.selectOperLogList(operLog); - ExcelUtil<SysOperLog> util = new ExcelUtil<SysOperLog>(SysOperLog.class); - util.exportExcel(response, list, "鎿嶄綔鏃ュ織"); - } - - @Log(title = "鎿嶄綔鏃ュ織", businessType = BusinessType.DELETE) - @RequiresPermissions("system:operlog:remove") - @DeleteMapping("/{operIds}") - public AjaxResult remove(@PathVariable Long[] operIds) - { - return toAjax(operLogService.deleteOperLogByIds(operIds)); - } - - @RequiresPermissions("system:operlog:remove") - @Log(title = "鎿嶄綔鏃ュ織", businessType = BusinessType.CLEAN) - @DeleteMapping("/clean") - public AjaxResult clean() - { - operLogService.cleanOperLog(); - return success(); - } - - @InnerAuth - @PostMapping - public AjaxResult add(@RequestBody SysOperLog operLog) - { - return toAjax(operLogService.insertOperlog(operLog)); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysPostController.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysPostController.java deleted file mode 100644 index 4ef1e16..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysPostController.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.ruoyi.system.controller; - -import java.util.List; -import jakarta.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.aps.common.core.utils.poi.ExcelUtil; -import com.aps.common.core.web.controller.BaseController; -import com.aps.common.core.web.domain.AjaxResult; -import com.aps.common.core.web.page.TableDataInfo; -import com.aps.common.log.annotation.Log; -import com.aps.common.log.enums.BusinessType; -import com.aps.common.security.annotation.RequiresPermissions; -import com.aps.common.security.utils.SecurityUtils; -import com.ruoyi.system.domain.SysPost; -import com.ruoyi.system.service.ISysPostService; - -/** - * 宀椾綅淇℃伅鎿嶄綔澶勭悊 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/post") -public class SysPostController extends BaseController -{ - @Autowired - private ISysPostService postService; - - /** - * 鑾峰彇宀椾綅鍒楄〃 - */ - @RequiresPermissions("system:post:list") - @GetMapping("/list") - public TableDataInfo list(SysPost post) - { - startPage(); - List<SysPost> list = postService.selectPostList(post); - return getDataTable(list); - } - - @Log(title = "宀椾綅绠$悊", businessType = BusinessType.EXPORT) - @RequiresPermissions("system:post:export") - @PostMapping("/export") - public void export(HttpServletResponse response, SysPost post) - { - List<SysPost> list = postService.selectPostList(post); - ExcelUtil<SysPost> util = new ExcelUtil<SysPost>(SysPost.class); - util.exportExcel(response, list, "宀椾綅鏁版嵁"); - } - - /** - * 鏍规嵁宀椾綅缂栧彿鑾峰彇璇︾粏淇℃伅 - */ - @RequiresPermissions("system:post:query") - @GetMapping(value = "/{postId}") - public AjaxResult getInfo(@PathVariable Long postId) - { - return success(postService.selectPostById(postId)); - } - - /** - * 鏂板宀椾綅 - */ - @RequiresPermissions("system:post:add") - @Log(title = "宀椾綅绠$悊", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@Validated @RequestBody SysPost post) - { - if (!postService.checkPostNameUnique(post)) - { - return error("鏂板宀椾綅'" + post.getPostName() + "'澶辫触锛屽矖浣嶅悕绉板凡瀛樺湪"); - } - else if (!postService.checkPostCodeUnique(post)) - { - return error("鏂板宀椾綅'" + post.getPostName() + "'澶辫触锛屽矖浣嶇紪鐮佸凡瀛樺湪"); - } - post.setCreateBy(SecurityUtils.getUsername()); - return toAjax(postService.insertPost(post)); - } - - /** - * 淇敼宀椾綅 - */ - @RequiresPermissions("system:post:edit") - @Log(title = "宀椾綅绠$悊", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@Validated @RequestBody SysPost post) - { - if (!postService.checkPostNameUnique(post)) - { - return error("淇敼宀椾綅'" + post.getPostName() + "'澶辫触锛屽矖浣嶅悕绉板凡瀛樺湪"); - } - else if (!postService.checkPostCodeUnique(post)) - { - return error("淇敼宀椾綅'" + post.getPostName() + "'澶辫触锛屽矖浣嶇紪鐮佸凡瀛樺湪"); - } - post.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(postService.updatePost(post)); - } - - /** - * 鍒犻櫎宀椾綅 - */ - @RequiresPermissions("system:post:remove") - @Log(title = "宀椾綅绠$悊", businessType = BusinessType.DELETE) - @DeleteMapping("/{postIds}") - public AjaxResult remove(@PathVariable Long[] postIds) - { - return toAjax(postService.deletePostByIds(postIds)); - } - - /** - * 鑾峰彇宀椾綅閫夋嫨妗嗗垪琛� - */ - @GetMapping("/optionselect") - public AjaxResult optionselect() - { - List<SysPost> posts = postService.selectPostAll(); - return success(posts); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysProfileController.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysProfileController.java deleted file mode 100644 index 71f0268..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysProfileController.java +++ /dev/null @@ -1,156 +0,0 @@ -package com.ruoyi.system.controller; - -import java.util.Arrays; -import java.util.Map; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; -import com.aps.common.core.domain.R; -import com.aps.common.core.utils.StringUtils; -import com.aps.common.core.utils.file.FileTypeUtils; -import com.aps.common.core.utils.file.MimeTypeUtils; -import com.aps.common.core.web.controller.BaseController; -import com.aps.common.core.web.domain.AjaxResult; -import com.aps.common.log.annotation.Log; -import com.aps.common.log.enums.BusinessType; -import com.aps.common.security.service.TokenService; -import com.aps.common.security.utils.SecurityUtils; -import com.aps.system.api.RemoteFileService; -import com.aps.system.api.domain.SysFile; -import com.aps.system.api.domain.SysUser; -import com.aps.system.api.model.LoginUser; -import com.ruoyi.system.service.ISysUserService; - -/** - * 涓汉淇℃伅 涓氬姟澶勭悊 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/user/profile") -public class SysProfileController extends BaseController -{ - @Autowired - private ISysUserService userService; - - @Autowired - private TokenService tokenService; - - @Autowired - private RemoteFileService remoteFileService; - - /** - * 涓汉淇℃伅 - */ - @GetMapping - public AjaxResult profile() - { - String username = SecurityUtils.getUsername(); - SysUser user = userService.selectUserByUserName(username); - AjaxResult ajax = AjaxResult.success(user); - ajax.put("roleGroup", userService.selectUserRoleGroup(username)); - ajax.put("postGroup", userService.selectUserPostGroup(username)); - return ajax; - } - - /** - * 淇敼鐢ㄦ埛 - */ - @Log(title = "涓汉淇℃伅", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult updateProfile(@RequestBody SysUser user) - { - LoginUser loginUser = SecurityUtils.getLoginUser(); - SysUser currentUser = loginUser.getSysUser(); - currentUser.setNickName(user.getNickName()); - currentUser.setEmail(user.getEmail()); - currentUser.setPhonenumber(user.getPhonenumber()); - currentUser.setSex(user.getSex()); - if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser)) - { - return error("淇敼鐢ㄦ埛'" + loginUser.getUsername() + "'澶辫触锛屾墜鏈哄彿鐮佸凡瀛樺湪"); - } - if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser)) - { - return error("淇敼鐢ㄦ埛'" + loginUser.getUsername() + "'澶辫触锛岄偖绠辫处鍙峰凡瀛樺湪"); - } - if (userService.updateUserProfile(currentUser)) - { - // 鏇存柊缂撳瓨鐢ㄦ埛淇℃伅 - tokenService.setLoginUser(loginUser); - return success(); - } - return error("淇敼涓汉淇℃伅寮傚父锛岃鑱旂郴绠$悊鍛�"); - } - - /** - * 閲嶇疆瀵嗙爜 - */ - @Log(title = "涓汉淇℃伅", businessType = BusinessType.UPDATE) - @PutMapping("/updatePwd") - public AjaxResult updatePwd(@RequestBody Map<String, String> params) - { - String oldPassword = params.get("oldPassword"); - String newPassword = params.get("newPassword"); - LoginUser loginUser = SecurityUtils.getLoginUser(); - String userName = loginUser.getUsername(); - String password = loginUser.getSysUser().getPassword(); - if (!SecurityUtils.matchesPassword(oldPassword, password)) - { - return error("淇敼瀵嗙爜澶辫触锛屾棫瀵嗙爜閿欒"); - } - if (SecurityUtils.matchesPassword(newPassword, password)) - { - return error("鏂板瘑鐮佷笉鑳戒笌鏃у瘑鐮佺浉鍚�"); - } - newPassword = SecurityUtils.encryptPassword(newPassword); - if (userService.resetUserPwd(userName, newPassword) > 0) - { - // 鏇存柊缂撳瓨鐢ㄦ埛瀵嗙爜 - loginUser.getSysUser().setPassword(newPassword); - tokenService.setLoginUser(loginUser); - return success(); - } - return error("淇敼瀵嗙爜寮傚父锛岃鑱旂郴绠$悊鍛�"); - } - - /** - * 澶村儚涓婁紶 - */ - @Log(title = "鐢ㄦ埛澶村儚", businessType = BusinessType.UPDATE) - @PostMapping("/avatar") - public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) - { - if (!file.isEmpty()) - { - LoginUser loginUser = SecurityUtils.getLoginUser(); - String extension = FileTypeUtils.getExtension(file); - if (!StringUtils.equalsAnyIgnoreCase(extension, MimeTypeUtils.IMAGE_EXTENSION)) - { - return error("鏂囦欢鏍煎紡涓嶆纭紝璇蜂笂浼�" + Arrays.toString(MimeTypeUtils.IMAGE_EXTENSION) + "鏍煎紡"); - } - R<SysFile> fileResult = remoteFileService.upload(file); - if (StringUtils.isNull(fileResult) || StringUtils.isNull(fileResult.getData())) - { - return error("鏂囦欢鏈嶅姟寮傚父锛岃鑱旂郴绠$悊鍛�"); - } - String url = fileResult.getData().getUrl(); - if (userService.updateUserAvatar(loginUser.getUsername(), url)) - { - AjaxResult ajax = AjaxResult.success(); - ajax.put("imgUrl", url); - // 鏇存柊缂撳瓨鐢ㄦ埛澶村儚 - loginUser.getSysUser().setAvatar(url); - tokenService.setLoginUser(loginUser); - return ajax; - } - } - return error("涓婁紶鍥剧墖寮傚父锛岃鑱旂郴绠$悊鍛�"); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysRoleController.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysRoleController.java deleted file mode 100644 index bc47691..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysRoleController.java +++ /dev/null @@ -1,239 +0,0 @@ -package com.ruoyi.system.controller; - -import java.util.List; -import jakarta.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.aps.common.core.utils.poi.ExcelUtil; -import com.aps.common.core.web.controller.BaseController; -import com.aps.common.core.web.domain.AjaxResult; -import com.aps.common.core.web.page.TableDataInfo; -import com.aps.common.log.annotation.Log; -import com.aps.common.log.enums.BusinessType; -import com.aps.common.security.annotation.RequiresPermissions; -import com.aps.common.security.utils.SecurityUtils; -import com.aps.system.api.domain.SysDept; -import com.aps.system.api.domain.SysRole; -import com.aps.system.api.domain.SysUser; -import com.ruoyi.system.domain.SysUserRole; -import com.ruoyi.system.service.ISysDeptService; -import com.ruoyi.system.service.ISysRoleService; -import com.ruoyi.system.service.ISysUserService; - -/** - * 瑙掕壊淇℃伅 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/role") -public class SysRoleController extends BaseController -{ - @Autowired - private ISysRoleService roleService; - - @Autowired - private ISysUserService userService; - - @Autowired - private ISysDeptService deptService; - - @RequiresPermissions("system:role:list") - @GetMapping("/list") - public TableDataInfo list(SysRole role) - { - startPage(); - List<SysRole> list = roleService.selectRoleList(role); - return getDataTable(list); - } - - @Log(title = "瑙掕壊绠$悊", businessType = BusinessType.EXPORT) - @RequiresPermissions("system:role:export") - @PostMapping("/export") - public void export(HttpServletResponse response, SysRole role) - { - List<SysRole> list = roleService.selectRoleList(role); - ExcelUtil<SysRole> util = new ExcelUtil<SysRole>(SysRole.class); - util.exportExcel(response, list, "瑙掕壊鏁版嵁"); - } - - /** - * 鏍规嵁瑙掕壊缂栧彿鑾峰彇璇︾粏淇℃伅 - */ - @RequiresPermissions("system:role:query") - @GetMapping(value = "/{roleId}") - public AjaxResult getInfo(@PathVariable Long roleId) - { - roleService.checkRoleDataScope(roleId); - return success(roleService.selectRoleById(roleId)); - } - - /** - * 鏂板瑙掕壊 - */ - @RequiresPermissions("system:role:add") - @Log(title = "瑙掕壊绠$悊", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@Validated @RequestBody SysRole role) - { - if (!roleService.checkRoleNameUnique(role)) - { - return error("鏂板瑙掕壊'" + role.getRoleName() + "'澶辫触锛岃鑹插悕绉板凡瀛樺湪"); - } - else if (!roleService.checkRoleKeyUnique(role)) - { - return error("鏂板瑙掕壊'" + role.getRoleName() + "'澶辫触锛岃鑹叉潈闄愬凡瀛樺湪"); - } - role.setCreateBy(SecurityUtils.getUsername()); - return toAjax(roleService.insertRole(role)); - - } - - /** - * 淇敼淇濆瓨瑙掕壊 - */ - @RequiresPermissions("system:role:edit") - @Log(title = "瑙掕壊绠$悊", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@Validated @RequestBody SysRole role) - { - roleService.checkRoleAllowed(role); - roleService.checkRoleDataScope(role.getRoleId()); - if (!roleService.checkRoleNameUnique(role)) - { - return error("淇敼瑙掕壊'" + role.getRoleName() + "'澶辫触锛岃鑹插悕绉板凡瀛樺湪"); - } - else if (!roleService.checkRoleKeyUnique(role)) - { - return error("淇敼瑙掕壊'" + role.getRoleName() + "'澶辫触锛岃鑹叉潈闄愬凡瀛樺湪"); - } - role.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(roleService.updateRole(role)); - } - - /** - * 淇敼淇濆瓨鏁版嵁鏉冮檺 - */ - @RequiresPermissions("system:role:edit") - @Log(title = "瑙掕壊绠$悊", businessType = BusinessType.UPDATE) - @PutMapping("/dataScope") - public AjaxResult dataScope(@RequestBody SysRole role) - { - roleService.checkRoleAllowed(role); - roleService.checkRoleDataScope(role.getRoleId()); - return toAjax(roleService.authDataScope(role)); - } - - /** - * 鐘舵�佷慨鏀� - */ - @RequiresPermissions("system:role:edit") - @Log(title = "瑙掕壊绠$悊", businessType = BusinessType.UPDATE) - @PutMapping("/changeStatus") - public AjaxResult changeStatus(@RequestBody SysRole role) - { - roleService.checkRoleAllowed(role); - roleService.checkRoleDataScope(role.getRoleId()); - role.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(roleService.updateRoleStatus(role)); - } - - /** - * 鍒犻櫎瑙掕壊 - */ - @RequiresPermissions("system:role:remove") - @Log(title = "瑙掕壊绠$悊", businessType = BusinessType.DELETE) - @DeleteMapping("/{roleIds}") - public AjaxResult remove(@PathVariable Long[] roleIds) - { - return toAjax(roleService.deleteRoleByIds(roleIds)); - } - - /** - * 鑾峰彇瑙掕壊閫夋嫨妗嗗垪琛� - */ - @RequiresPermissions("system:role:query") - @GetMapping("/optionselect") - public AjaxResult optionselect() - { - return success(roleService.selectRoleAll()); - } - /** - * 鏌ヨ宸插垎閰嶇敤鎴疯鑹插垪琛� - */ - @RequiresPermissions("system:role:list") - @GetMapping("/authUser/allocatedList") - public TableDataInfo allocatedList(SysUser user) - { - startPage(); - List<SysUser> list = userService.selectAllocatedList(user); - return getDataTable(list); - } - - /** - * 鏌ヨ鏈垎閰嶇敤鎴疯鑹插垪琛� - */ - @RequiresPermissions("system:role:list") - @GetMapping("/authUser/unallocatedList") - public TableDataInfo unallocatedList(SysUser user) - { - startPage(); - List<SysUser> list = userService.selectUnallocatedList(user); - return getDataTable(list); - } - - /** - * 鍙栨秷鎺堟潈鐢ㄦ埛 - */ - @RequiresPermissions("system:role:edit") - @Log(title = "瑙掕壊绠$悊", businessType = BusinessType.GRANT) - @PutMapping("/authUser/cancel") - public AjaxResult cancelAuthUser(@RequestBody SysUserRole userRole) - { - return toAjax(roleService.deleteAuthUser(userRole)); - } - - /** - * 鎵归噺鍙栨秷鎺堟潈鐢ㄦ埛 - */ - @RequiresPermissions("system:role:edit") - @Log(title = "瑙掕壊绠$悊", businessType = BusinessType.GRANT) - @PutMapping("/authUser/cancelAll") - public AjaxResult cancelAuthUserAll(Long roleId, Long[] userIds) - { - return toAjax(roleService.deleteAuthUsers(roleId, userIds)); - } - - /** - * 鎵归噺閫夋嫨鐢ㄦ埛鎺堟潈 - */ - @RequiresPermissions("system:role:edit") - @Log(title = "瑙掕壊绠$悊", businessType = BusinessType.GRANT) - @PutMapping("/authUser/selectAll") - public AjaxResult selectAuthUserAll(Long roleId, Long[] userIds) - { - roleService.checkRoleDataScope(roleId); - return toAjax(roleService.insertAuthUsers(roleId, userIds)); - } - - /** - * 鑾峰彇瀵瑰簲瑙掕壊閮ㄩ棬鏍戝垪琛� - */ - @RequiresPermissions("system:role:query") - @GetMapping(value = "/deptTree/{roleId}") - public AjaxResult deptTree(@PathVariable("roleId") Long roleId) - { - AjaxResult ajax = AjaxResult.success(); - ajax.put("checkedKeys", deptService.selectDeptListByRoleId(roleId)); - ajax.put("depts", deptService.selectDeptTreeList(new SysDept())); - return ajax; - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysUserController.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysUserController.java deleted file mode 100644 index d622841..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysUserController.java +++ /dev/null @@ -1,351 +0,0 @@ -package com.ruoyi.system.controller; - -import java.io.IOException; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; -import jakarta.servlet.http.HttpServletResponse; -import org.apache.commons.lang3.ArrayUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; -import com.aps.common.core.domain.R; -import com.aps.common.core.utils.StringUtils; -import com.aps.common.core.utils.poi.ExcelUtil; -import com.aps.common.core.web.controller.BaseController; -import com.aps.common.core.web.domain.AjaxResult; -import com.aps.common.core.web.page.TableDataInfo; -import com.aps.common.log.annotation.Log; -import com.aps.common.log.enums.BusinessType; -import com.aps.common.security.annotation.InnerAuth; -import com.aps.common.security.annotation.RequiresPermissions; -import com.aps.common.security.service.TokenService; -import com.aps.common.security.utils.SecurityUtils; -import com.aps.system.api.domain.SysDept; -import com.aps.system.api.domain.SysRole; -import com.aps.system.api.domain.SysUser; -import com.aps.system.api.model.LoginUser; -import com.ruoyi.system.service.ISysConfigService; -import com.ruoyi.system.service.ISysDeptService; -import com.ruoyi.system.service.ISysPermissionService; -import com.ruoyi.system.service.ISysPostService; -import com.ruoyi.system.service.ISysRoleService; -import com.ruoyi.system.service.ISysUserService; - -/** - * 鐢ㄦ埛淇℃伅 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/user") -public class SysUserController extends BaseController -{ - @Autowired - private ISysUserService userService; - - @Autowired - private ISysRoleService roleService; - - @Autowired - private ISysDeptService deptService; - - @Autowired - private ISysPostService postService; - - @Autowired - private ISysPermissionService permissionService; - - @Autowired - private ISysConfigService configService; - - @Autowired - private TokenService tokenService; - - /** - * 鑾峰彇鐢ㄦ埛鍒楄〃 - */ - @RequiresPermissions("system:user:list") - @GetMapping("/list") - public TableDataInfo list(SysUser user) - { - startPage(); - List<SysUser> list = userService.selectUserList(user); - return getDataTable(list); - } - - @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.EXPORT) - @RequiresPermissions("system:user:export") - @PostMapping("/export") - public void export(HttpServletResponse response, SysUser user) - { - List<SysUser> list = userService.selectUserList(user); - ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); - util.exportExcel(response, list, "鐢ㄦ埛鏁版嵁"); - } - - @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.IMPORT) - @RequiresPermissions("system:user:import") - @PostMapping("/importData") - public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception - { - ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); - List<SysUser> userList = util.importExcel(file.getInputStream()); - String operName = SecurityUtils.getUsername(); - String message = userService.importUser(userList, updateSupport, operName); - return success(message); - } - - @PostMapping("/importTemplate") - public void importTemplate(HttpServletResponse response) throws IOException - { - ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class); - util.importTemplateExcel(response, "鐢ㄦ埛鏁版嵁"); - } - - /** - * 鑾峰彇褰撳墠鐢ㄦ埛淇℃伅 - */ - @InnerAuth - @GetMapping("/info/{username}") - public R<LoginUser> info(@PathVariable("username") String username) - { - SysUser sysUser = userService.selectUserByUserName(username); - if (StringUtils.isNull(sysUser)) - { - return R.fail("鐢ㄦ埛鍚嶆垨瀵嗙爜閿欒"); - } - // 瑙掕壊闆嗗悎 - Set<String> roles = permissionService.getRolePermission(sysUser); - // 鏉冮檺闆嗗悎 - Set<String> permissions = permissionService.getMenuPermission(sysUser); - LoginUser sysUserVo = new LoginUser(); - sysUserVo.setSysUser(sysUser); - sysUserVo.setRoles(roles); - sysUserVo.setPermissions(permissions); - return R.ok(sysUserVo); - } - - /** - * 娉ㄥ唽鐢ㄦ埛淇℃伅 - */ - @InnerAuth - @PostMapping("/register") - public R<Boolean> register(@RequestBody SysUser sysUser) - { - String username = sysUser.getUserName(); - if (!("true".equals(configService.selectConfigByKey("sys.account.registerUser")))) - { - return R.fail("褰撳墠绯荤粺娌℃湁寮�鍚敞鍐屽姛鑳斤紒"); - } - if (!userService.checkUserNameUnique(sysUser)) - { - return R.fail("淇濆瓨鐢ㄦ埛'" + username + "'澶辫触锛屾敞鍐岃处鍙峰凡瀛樺湪"); - } - return R.ok(userService.registerUser(sysUser)); - } - - /** - *璁板綍鐢ㄦ埛鐧诲綍IP鍦板潃鍜岀櫥褰曟椂闂� - */ - @InnerAuth - @PutMapping("/recordlogin") - public R<Boolean> recordlogin(@RequestBody SysUser sysUser) - { - return R.ok(userService.updateUserProfile(sysUser)); - } - - /** - * 鑾峰彇鐢ㄦ埛淇℃伅 - * - * @return 鐢ㄦ埛淇℃伅 - */ - @GetMapping("getInfo") - public AjaxResult getInfo() - { - LoginUser loginUser = SecurityUtils.getLoginUser(); - SysUser user = loginUser.getSysUser(); - // 瑙掕壊闆嗗悎 - Set<String> roles = permissionService.getRolePermission(user); - // 鏉冮檺闆嗗悎 - Set<String> permissions = permissionService.getMenuPermission(user); - if (!loginUser.getPermissions().equals(permissions)) - { - loginUser.setPermissions(permissions); - tokenService.refreshToken(loginUser); - } - AjaxResult ajax = AjaxResult.success(); - ajax.put("user", user); - ajax.put("roles", roles); - ajax.put("permissions", permissions); - return ajax; - } - - /** - * 鏍规嵁鐢ㄦ埛缂栧彿鑾峰彇璇︾粏淇℃伅 - */ - @RequiresPermissions("system:user:query") - @GetMapping(value = { "/", "/{userId}" }) - public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId) - { - AjaxResult ajax = AjaxResult.success(); - if (StringUtils.isNotNull(userId)) - { - userService.checkUserDataScope(userId); - SysUser sysUser = userService.selectUserById(userId); - ajax.put(AjaxResult.DATA_TAG, sysUser); - ajax.put("postIds", postService.selectPostListByUserId(userId)); - ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList())); - } - List<SysRole> roles = roleService.selectRoleAll(); - ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); - ajax.put("posts", postService.selectPostAll()); - return ajax; - } - - /** - * 鏂板鐢ㄦ埛 - */ - @RequiresPermissions("system:user:add") - @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@Validated @RequestBody SysUser user) - { - deptService.checkDeptDataScope(user.getDeptId()); - roleService.checkRoleDataScope(user.getRoleIds()); - if (!userService.checkUserNameUnique(user)) - { - return error("鏂板鐢ㄦ埛'" + user.getUserName() + "'澶辫触锛岀櫥褰曡处鍙峰凡瀛樺湪"); - } - else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) - { - return error("鏂板鐢ㄦ埛'" + user.getUserName() + "'澶辫触锛屾墜鏈哄彿鐮佸凡瀛樺湪"); - } - else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) - { - return error("鏂板鐢ㄦ埛'" + user.getUserName() + "'澶辫触锛岄偖绠辫处鍙峰凡瀛樺湪"); - } - user.setCreateBy(SecurityUtils.getUsername()); - user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); - return toAjax(userService.insertUser(user)); - } - - /** - * 淇敼鐢ㄦ埛 - */ - @RequiresPermissions("system:user:edit") - @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@Validated @RequestBody SysUser user) - { - userService.checkUserAllowed(user); - userService.checkUserDataScope(user.getUserId()); - deptService.checkDeptDataScope(user.getDeptId()); - roleService.checkRoleDataScope(user.getRoleIds()); - if (!userService.checkUserNameUnique(user)) - { - return error("淇敼鐢ㄦ埛'" + user.getUserName() + "'澶辫触锛岀櫥褰曡处鍙峰凡瀛樺湪"); - } - else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user)) - { - return error("淇敼鐢ㄦ埛'" + user.getUserName() + "'澶辫触锛屾墜鏈哄彿鐮佸凡瀛樺湪"); - } - else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user)) - { - return error("淇敼鐢ㄦ埛'" + user.getUserName() + "'澶辫触锛岄偖绠辫处鍙峰凡瀛樺湪"); - } - user.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(userService.updateUser(user)); - } - - /** - * 鍒犻櫎鐢ㄦ埛 - */ - @RequiresPermissions("system:user:remove") - @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.DELETE) - @DeleteMapping("/{userIds}") - public AjaxResult remove(@PathVariable Long[] userIds) - { - if (ArrayUtils.contains(userIds, SecurityUtils.getUserId())) - { - return error("褰撳墠鐢ㄦ埛涓嶈兘鍒犻櫎"); - } - return toAjax(userService.deleteUserByIds(userIds)); - } - - /** - * 閲嶇疆瀵嗙爜 - */ - @RequiresPermissions("system:user:edit") - @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.UPDATE) - @PutMapping("/resetPwd") - public AjaxResult resetPwd(@RequestBody SysUser user) - { - userService.checkUserAllowed(user); - userService.checkUserDataScope(user.getUserId()); - user.setPassword(SecurityUtils.encryptPassword(user.getPassword())); - user.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(userService.resetPwd(user)); - } - - /** - * 鐘舵�佷慨鏀� - */ - @RequiresPermissions("system:user:edit") - @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.UPDATE) - @PutMapping("/changeStatus") - public AjaxResult changeStatus(@RequestBody SysUser user) - { - userService.checkUserAllowed(user); - userService.checkUserDataScope(user.getUserId()); - user.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(userService.updateUserStatus(user)); - } - - /** - * 鏍规嵁鐢ㄦ埛缂栧彿鑾峰彇鎺堟潈瑙掕壊 - */ - @RequiresPermissions("system:user:query") - @GetMapping("/authRole/{userId}") - public AjaxResult authRole(@PathVariable("userId") Long userId) - { - AjaxResult ajax = AjaxResult.success(); - SysUser user = userService.selectUserById(userId); - List<SysRole> roles = roleService.selectRolesByUserId(userId); - ajax.put("user", user); - ajax.put("roles", SysUser.isAdmin(userId) ? roles : roles.stream().filter(r -> !r.isAdmin()).collect(Collectors.toList())); - return ajax; - } - - /** - * 鐢ㄦ埛鎺堟潈瑙掕壊 - */ - @RequiresPermissions("system:user:edit") - @Log(title = "鐢ㄦ埛绠$悊", businessType = BusinessType.GRANT) - @PutMapping("/authRole") - public AjaxResult insertAuthRole(Long userId, Long[] roleIds) - { - userService.checkUserDataScope(userId); - roleService.checkRoleDataScope(roleIds); - userService.insertUserAuth(userId, roleIds); - return success(); - } - - /** - * 鑾峰彇閮ㄩ棬鏍戝垪琛� - */ - @RequiresPermissions("system:user:list") - @GetMapping("/deptTree") - public AjaxResult deptTree(SysDept dept) - { - return success(deptService.selectDeptTreeList(dept)); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysUserOnlineController.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysUserOnlineController.java deleted file mode 100644 index 9d6117f..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/controller/SysUserOnlineController.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.ruoyi.system.controller; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.aps.common.core.constant.CacheConstants; -import com.aps.common.core.utils.StringUtils; -import com.aps.common.core.web.controller.BaseController; -import com.aps.common.core.web.domain.AjaxResult; -import com.aps.common.core.web.page.TableDataInfo; -import com.aps.common.log.annotation.Log; -import com.aps.common.log.enums.BusinessType; -import com.aps.common.redis.service.RedisService; -import com.aps.common.security.annotation.RequiresPermissions; -import com.aps.system.api.model.LoginUser; -import com.ruoyi.system.domain.SysUserOnline; -import com.ruoyi.system.service.ISysUserOnlineService; - -/** - * 鍦ㄧ嚎鐢ㄦ埛鐩戞帶 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/online") -public class SysUserOnlineController extends BaseController -{ - @Autowired - private ISysUserOnlineService userOnlineService; - - @Autowired - private RedisService redisService; - - @RequiresPermissions("monitor:online:list") - @GetMapping("/list") - public TableDataInfo list(String ipaddr, String userName) - { - Collection<String> keys = redisService.keys(CacheConstants.LOGIN_TOKEN_KEY + "*"); - List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>(); - for (String key : keys) - { - LoginUser user = redisService.getCacheObject(key); - if (StringUtils.isNotEmpty(ipaddr) && StringUtils.isNotEmpty(userName)) - { - userOnlineList.add(userOnlineService.selectOnlineByInfo(ipaddr, userName, user)); - } - else if (StringUtils.isNotEmpty(ipaddr)) - { - userOnlineList.add(userOnlineService.selectOnlineByIpaddr(ipaddr, user)); - } - else if (StringUtils.isNotEmpty(userName)) - { - userOnlineList.add(userOnlineService.selectOnlineByUserName(userName, user)); - } - else - { - userOnlineList.add(userOnlineService.loginUserToUserOnline(user)); - } - } - Collections.reverse(userOnlineList); - userOnlineList.removeAll(Collections.singleton(null)); - return getDataTable(userOnlineList); - } - - /** - * 寮洪��鐢ㄦ埛 - */ - @RequiresPermissions("monitor:online:forceLogout") - @Log(title = "鍦ㄧ嚎鐢ㄦ埛", businessType = BusinessType.FORCE) - @DeleteMapping("/{tokenId}") - public AjaxResult forceLogout(@PathVariable String tokenId) - { - redisService.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId); - return success(); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysConfig.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysConfig.java deleted file mode 100644 index cdeea80..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysConfig.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.ruoyi.system.domain; - -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.Size; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.aps.common.core.annotation.Excel; -import com.aps.common.core.annotation.Excel.ColumnType; -import com.aps.common.core.web.domain.BaseEntity; - -/** - * 鍙傛暟閰嶇疆琛� sys_config - * - * @author ruoyi - */ -public class SysConfig extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 鍙傛暟涓婚敭 */ - @Excel(name = "鍙傛暟涓婚敭", cellType = ColumnType.NUMERIC) - private Long configId; - - /** 鍙傛暟鍚嶇О */ - @Excel(name = "鍙傛暟鍚嶇О") - private String configName; - - /** 鍙傛暟閿悕 */ - @Excel(name = "鍙傛暟閿悕") - private String configKey; - - /** 鍙傛暟閿�� */ - @Excel(name = "鍙傛暟閿��") - private String configValue; - - /** 绯荤粺鍐呯疆锛圷鏄� N鍚︼級 */ - @Excel(name = "绯荤粺鍐呯疆", readConverterExp = "Y=鏄�,N=鍚�") - private String configType; - - public Long getConfigId() - { - return configId; - } - - public void setConfigId(Long configId) - { - this.configId = configId; - } - - @NotBlank(message = "鍙傛暟鍚嶇О涓嶈兘涓虹┖") - @Size(min = 0, max = 100, message = "鍙傛暟鍚嶇О涓嶈兘瓒呰繃100涓瓧绗�") - public String getConfigName() - { - return configName; - } - - public void setConfigName(String configName) - { - this.configName = configName; - } - - @NotBlank(message = "鍙傛暟閿悕闀垮害涓嶈兘涓虹┖") - @Size(min = 0, max = 100, message = "鍙傛暟閿悕闀垮害涓嶈兘瓒呰繃100涓瓧绗�") - public String getConfigKey() - { - return configKey; - } - - public void setConfigKey(String configKey) - { - this.configKey = configKey; - } - - @NotBlank(message = "鍙傛暟閿�间笉鑳戒负绌�") - @Size(min = 0, max = 500, message = "鍙傛暟閿�奸暱搴︿笉鑳借秴杩�500涓瓧绗�") - public String getConfigValue() - { - return configValue; - } - - public void setConfigValue(String configValue) - { - this.configValue = configValue; - } - - public String getConfigType() - { - return configType; - } - - public void setConfigType(String configType) - { - this.configType = configType; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("configId", getConfigId()) - .append("configName", getConfigName()) - .append("configKey", getConfigKey()) - .append("configValue", getConfigValue()) - .append("configType", getConfigType()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysMenu.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysMenu.java deleted file mode 100644 index 445f1df..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysMenu.java +++ /dev/null @@ -1,274 +0,0 @@ -package com.ruoyi.system.domain; - -import java.util.ArrayList; -import java.util.List; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.aps.common.core.web.domain.BaseEntity; - -/** - * 鑿滃崟鏉冮檺琛� sys_menu - * - * @author ruoyi - */ -public class SysMenu extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 鑿滃崟ID */ - private Long menuId; - - /** 鑿滃崟鍚嶇О */ - private String menuName; - - /** 鐖惰彍鍗曞悕绉� */ - private String parentName; - - /** 鐖惰彍鍗旾D */ - private Long parentId; - - /** 鏄剧ず椤哄簭 */ - private Integer orderNum; - - /** 璺敱鍦板潃 */ - private String path; - - /** 缁勪欢璺緞 */ - private String component; - - /** 璺敱鍙傛暟 */ - private String query; - - /** 璺敱鍚嶇О锛岄粯璁ゅ拰璺敱鍦板潃鐩稿悓鐨勯┘宄版牸寮忥紙娉ㄦ剰锛氬洜涓簐ue3鐗堟湰鐨剅outer浼氬垹闄ゅ悕绉扮浉鍚岃矾鐢憋紝涓洪伩鍏嶅悕瀛楃殑鍐茬獊锛岀壒娈婃儏鍐靛彲浠ヨ嚜瀹氫箟锛� */ - private String routeName; - - /** 鏄惁涓哄閾撅紙0鏄� 1鍚︼級 */ - private String isFrame; - - /** 鏄惁缂撳瓨锛�0缂撳瓨 1涓嶇紦瀛橈級 */ - private String isCache; - - /** 绫诲瀷锛圡鐩綍 C鑿滃崟 F鎸夐挳锛� */ - private String menuType; - - /** 鏄剧ず鐘舵�侊紙0鏄剧ず 1闅愯棌锛� */ - private String visible; - - /** 鑿滃崟鐘舵�侊紙0姝e父 1鍋滅敤锛� */ - private String status; - - /** 鏉冮檺瀛楃涓� */ - private String perms; - - /** 鑿滃崟鍥炬爣 */ - private String icon; - - /** 瀛愯彍鍗� */ - private List<SysMenu> children = new ArrayList<SysMenu>(); - - public Long getMenuId() - { - return menuId; - } - - public void setMenuId(Long menuId) - { - this.menuId = menuId; - } - - @NotBlank(message = "鑿滃崟鍚嶇О涓嶈兘涓虹┖") - @Size(min = 0, max = 50, message = "鑿滃崟鍚嶇О闀垮害涓嶈兘瓒呰繃50涓瓧绗�") - public String getMenuName() - { - return menuName; - } - - public void setMenuName(String menuName) - { - this.menuName = menuName; - } - - public String getParentName() - { - return parentName; - } - - public void setParentName(String parentName) - { - this.parentName = parentName; - } - - public Long getParentId() - { - return parentId; - } - - public void setParentId(Long parentId) - { - this.parentId = parentId; - } - - @NotNull(message = "鏄剧ず椤哄簭涓嶈兘涓虹┖") - public Integer getOrderNum() - { - return orderNum; - } - - public void setOrderNum(Integer orderNum) - { - this.orderNum = orderNum; - } - - @Size(min = 0, max = 200, message = "璺敱鍦板潃涓嶈兘瓒呰繃200涓瓧绗�") - public String getPath() - { - return path; - } - - public void setPath(String path) - { - this.path = path; - } - - @Size(min = 0, max = 200, message = "缁勪欢璺緞涓嶈兘瓒呰繃255涓瓧绗�") - public String getComponent() - { - return component; - } - - public void setComponent(String component) - { - this.component = component; - } - - public String getQuery() - { - return query; - } - - public void setQuery(String query) - { - this.query = query; - } - - public String getRouteName() - { - return routeName; - } - - public void setRouteName(String routeName) - { - this.routeName = routeName; - } - - public String getIsFrame() - { - return isFrame; - } - - public void setIsFrame(String isFrame) - { - this.isFrame = isFrame; - } - - public String getIsCache() - { - return isCache; - } - - public void setIsCache(String isCache) - { - this.isCache = isCache; - } - - @NotBlank(message = "鑿滃崟绫诲瀷涓嶈兘涓虹┖") - public String getMenuType() - { - return menuType; - } - - public void setMenuType(String menuType) - { - this.menuType = menuType; - } - - public String getVisible() - { - return visible; - } - - public void setVisible(String visible) - { - this.visible = visible; - } - - public String getStatus() - { - return status; - } - - public void setStatus(String status) - { - this.status = status; - } - - @Size(min = 0, max = 100, message = "鏉冮檺鏍囪瘑闀垮害涓嶈兘瓒呰繃100涓瓧绗�") - public String getPerms() - { - return perms; - } - - public void setPerms(String perms) - { - this.perms = perms; - } - - public String getIcon() - { - return icon; - } - - public void setIcon(String icon) - { - this.icon = icon; - } - - public List<SysMenu> getChildren() - { - return children; - } - - public void setChildren(List<SysMenu> children) - { - this.children = children; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("menuId", getMenuId()) - .append("menuName", getMenuName()) - .append("parentId", getParentId()) - .append("orderNum", getOrderNum()) - .append("path", getPath()) - .append("component", getComponent()) - .append("query", getQuery()) - .append("routeName", getRouteName()) - .append("isFrame", getIsFrame()) - .append("IsCache", getIsCache()) - .append("menuType", getMenuType()) - .append("visible", getVisible()) - .append("status ", getStatus()) - .append("perms", getPerms()) - .append("icon", getIcon()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysNotice.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysNotice.java deleted file mode 100644 index c66f5ef..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysNotice.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.ruoyi.system.domain; - -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.Size; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.aps.common.core.web.domain.BaseEntity; -import com.aps.common.core.xss.Xss; - -/** - * 閫氱煡鍏憡琛� sys_notice - * - * @author ruoyi - */ -public class SysNotice extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 鍏憡ID */ - private Long noticeId; - - /** 鍏憡鏍囬 */ - private String noticeTitle; - - /** 鍏憡绫诲瀷锛�1閫氱煡 2鍏憡锛� */ - private String noticeType; - - /** 鍏憡鍐呭 */ - private String noticeContent; - - /** 鍏憡鐘舵�侊紙0姝e父 1鍏抽棴锛� */ - private String status; - - public Long getNoticeId() - { - return noticeId; - } - - public void setNoticeId(Long noticeId) - { - this.noticeId = noticeId; - } - - public void setNoticeTitle(String noticeTitle) - { - this.noticeTitle = noticeTitle; - } - - @Xss(message = "鍏憡鏍囬涓嶈兘鍖呭惈鑴氭湰瀛楃") - @NotBlank(message = "鍏憡鏍囬涓嶈兘涓虹┖") - @Size(min = 0, max = 50, message = "鍏憡鏍囬涓嶈兘瓒呰繃50涓瓧绗�") - public String getNoticeTitle() - { - return noticeTitle; - } - - public void setNoticeType(String noticeType) - { - this.noticeType = noticeType; - } - - public String getNoticeType() - { - return noticeType; - } - - public void setNoticeContent(String noticeContent) - { - this.noticeContent = noticeContent; - } - - public String getNoticeContent() - { - return noticeContent; - } - - public void setStatus(String status) - { - this.status = status; - } - - public String getStatus() - { - return status; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("noticeId", getNoticeId()) - .append("noticeTitle", getNoticeTitle()) - .append("noticeType", getNoticeType()) - .append("noticeContent", getNoticeContent()) - .append("status", getStatus()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysPost.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysPost.java deleted file mode 100644 index 23f6a30..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysPost.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.ruoyi.system.domain; - -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import com.aps.common.core.annotation.Excel; -import com.aps.common.core.annotation.Excel.ColumnType; -import com.aps.common.core.web.domain.BaseEntity; - -/** - * 宀椾綅琛� sys_post - * - * @author ruoyi - */ -public class SysPost extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 宀椾綅搴忓彿 */ - @Excel(name = "宀椾綅搴忓彿", cellType = ColumnType.NUMERIC) - private Long postId; - - /** 宀椾綅缂栫爜 */ - @Excel(name = "宀椾綅缂栫爜") - private String postCode; - - /** 宀椾綅鍚嶇О */ - @Excel(name = "宀椾綅鍚嶇О") - private String postName; - - /** 宀椾綅鎺掑簭 */ - @Excel(name = "宀椾綅鎺掑簭") - private Integer postSort; - - /** 鐘舵�侊紙0姝e父 1鍋滅敤锛� */ - @Excel(name = "鐘舵��", readConverterExp = "0=姝e父,1=鍋滅敤") - private String status; - - /** 鐢ㄦ埛鏄惁瀛樺湪姝ゅ矖浣嶆爣璇� 榛樿涓嶅瓨鍦� */ - private boolean flag = false; - - public Long getPostId() - { - return postId; - } - - public void setPostId(Long postId) - { - this.postId = postId; - } - - @NotBlank(message = "宀椾綅缂栫爜涓嶈兘涓虹┖") - @Size(min = 0, max = 64, message = "宀椾綅缂栫爜闀垮害涓嶈兘瓒呰繃64涓瓧绗�") - public String getPostCode() - { - return postCode; - } - - public void setPostCode(String postCode) - { - this.postCode = postCode; - } - - @NotBlank(message = "宀椾綅鍚嶇О涓嶈兘涓虹┖") - @Size(min = 0, max = 50, message = "宀椾綅鍚嶇О闀垮害涓嶈兘瓒呰繃50涓瓧绗�") - public String getPostName() - { - return postName; - } - - public void setPostName(String postName) - { - this.postName = postName; - } - - @NotNull(message = "鏄剧ず椤哄簭涓嶈兘涓虹┖") - public Integer getPostSort() - { - return postSort; - } - - public void setPostSort(Integer postSort) - { - this.postSort = postSort; - } - - public String getStatus() - { - return status; - } - - public void setStatus(String status) - { - this.status = status; - } - - public boolean isFlag() - { - return flag; - } - - public void setFlag(boolean flag) - { - this.flag = flag; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("postId", getPostId()) - .append("postCode", getPostCode()) - .append("postName", getPostName()) - .append("postSort", getPostSort()) - .append("status", getStatus()) - .append("createBy", getCreateBy()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("updateTime", getUpdateTime()) - .append("remark", getRemark()) - .toString(); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java deleted file mode 100644 index 47b21bf..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysRoleDept.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.ruoyi.system.domain; - -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -/** - * 瑙掕壊鍜岄儴闂ㄥ叧鑱� sys_role_dept - * - * @author ruoyi - */ -public class SysRoleDept -{ - /** 瑙掕壊ID */ - private Long roleId; - - /** 閮ㄩ棬ID */ - private Long deptId; - - public Long getRoleId() - { - return roleId; - } - - public void setRoleId(Long roleId) - { - this.roleId = roleId; - } - - public Long getDeptId() - { - return deptId; - } - - public void setDeptId(Long deptId) - { - this.deptId = deptId; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("roleId", getRoleId()) - .append("deptId", getDeptId()) - .toString(); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java deleted file mode 100644 index de10a74..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysRoleMenu.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.ruoyi.system.domain; - -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -/** - * 瑙掕壊鍜岃彍鍗曞叧鑱� sys_role_menu - * - * @author ruoyi - */ -public class SysRoleMenu -{ - /** 瑙掕壊ID */ - private Long roleId; - - /** 鑿滃崟ID */ - private Long menuId; - - public Long getRoleId() - { - return roleId; - } - - public void setRoleId(Long roleId) - { - this.roleId = roleId; - } - - public Long getMenuId() - { - return menuId; - } - - public void setMenuId(Long menuId) - { - this.menuId = menuId; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("roleId", getRoleId()) - .append("menuId", getMenuId()) - .toString(); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java deleted file mode 100644 index 69bac9a..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysUserOnline.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.ruoyi.system.domain; - -/** - * 褰撳墠鍦ㄧ嚎浼氳瘽 - * - * @author ruoyi - */ -public class SysUserOnline -{ - /** 浼氳瘽缂栧彿 */ - private String tokenId; - - /** 鐢ㄦ埛鍚嶇О */ - private String userName; - - /** 鐧诲綍IP鍦板潃 */ - private String ipaddr; - - /** 鐧诲綍鍦板潃 */ - private String loginLocation; - - /** 娴忚鍣ㄧ被鍨� */ - private String browser; - - /** 鎿嶄綔绯荤粺 */ - private String os; - - /** 鐧诲綍鏃堕棿 */ - private Long loginTime; - - public String getTokenId() - { - return tokenId; - } - - public void setTokenId(String tokenId) - { - this.tokenId = tokenId; - } - - public String getUserName() - { - return userName; - } - - public void setUserName(String userName) - { - this.userName = userName; - } - - public String getIpaddr() - { - return ipaddr; - } - - public void setIpaddr(String ipaddr) - { - this.ipaddr = ipaddr; - } - - public String getLoginLocation() - { - return loginLocation; - } - - public void setLoginLocation(String loginLocation) - { - this.loginLocation = loginLocation; - } - - public String getBrowser() - { - return browser; - } - - public void setBrowser(String browser) - { - this.browser = browser; - } - - public String getOs() - { - return os; - } - - public void setOs(String os) - { - this.os = os; - } - - public Long getLoginTime() - { - return loginTime; - } - - public void setLoginTime(Long loginTime) - { - this.loginTime = loginTime; - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java deleted file mode 100644 index 6e8c416..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysUserPost.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.ruoyi.system.domain; - -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -/** - * 鐢ㄦ埛鍜屽矖浣嶅叧鑱� sys_user_post - * - * @author ruoyi - */ -public class SysUserPost -{ - /** 鐢ㄦ埛ID */ - private Long userId; - - /** 宀椾綅ID */ - private Long postId; - - public Long getUserId() - { - return userId; - } - - public void setUserId(Long userId) - { - this.userId = userId; - } - - public Long getPostId() - { - return postId; - } - - public void setPostId(Long postId) - { - this.postId = postId; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("userId", getUserId()) - .append("postId", getPostId()) - .toString(); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java deleted file mode 100644 index 4d15810..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/SysUserRole.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.ruoyi.system.domain; - -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -/** - * 鐢ㄦ埛鍜岃鑹插叧鑱� sys_user_role - * - * @author ruoyi - */ -public class SysUserRole -{ - /** 鐢ㄦ埛ID */ - private Long userId; - - /** 瑙掕壊ID */ - private Long roleId; - - public Long getUserId() - { - return userId; - } - - public void setUserId(Long userId) - { - this.userId = userId; - } - - public Long getRoleId() - { - return roleId; - } - - public void setRoleId(Long roleId) - { - this.roleId = roleId; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("userId", getUserId()) - .append("roleId", getRoleId()) - .toString(); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java deleted file mode 100644 index 8dc52de..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/vo/MetaVo.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.ruoyi.system.domain.vo; - -import com.aps.common.core.utils.StringUtils; - -/** - * 璺敱鏄剧ず淇℃伅 - * - * @author ruoyi - */ -public class MetaVo -{ - /** - * 璁剧疆璇ヨ矾鐢卞湪渚ц竟鏍忓拰闈㈠寘灞戜腑灞曠ず鐨勫悕瀛� - */ - private String title; - - /** - * 璁剧疆璇ヨ矾鐢辩殑鍥炬爣锛屽搴旇矾寰剆rc/assets/icons/svg - */ - private String icon; - - /** - * 璁剧疆涓簍rue锛屽垯涓嶄細琚� <keep-alive>缂撳瓨 - */ - private boolean noCache; - - /** - * 鍐呴摼鍦板潃锛坔ttp(s)://寮�澶达級 - */ - private String link; - - public MetaVo() - { - } - - public MetaVo(String title, String icon) - { - this.title = title; - this.icon = icon; - } - - public MetaVo(String title, String icon, boolean noCache) - { - this.title = title; - this.icon = icon; - this.noCache = noCache; - } - - public MetaVo(String title, String icon, String link) - { - this.title = title; - this.icon = icon; - this.link = link; - } - - public MetaVo(String title, String icon, boolean noCache, String link) - { - this.title = title; - this.icon = icon; - this.noCache = noCache; - if (StringUtils.ishttp(link)) - { - this.link = link; - } - } - - public boolean isNoCache() - { - return noCache; - } - - public void setNoCache(boolean noCache) - { - this.noCache = noCache; - } - - public String getTitle() - { - return title; - } - - public void setTitle(String title) - { - this.title = title; - } - - public String getIcon() - { - return icon; - } - - public void setIcon(String icon) - { - this.icon = icon; - } - - public String getLink() - { - return link; - } - - public void setLink(String link) - { - this.link = link; - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java deleted file mode 100644 index afff8c9..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/vo/RouterVo.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.ruoyi.system.domain.vo; - -import com.fasterxml.jackson.annotation.JsonInclude; -import java.util.List; - -/** - * 璺敱閰嶇疆淇℃伅 - * - * @author ruoyi - */ -@JsonInclude(JsonInclude.Include.NON_EMPTY) -public class RouterVo -{ - /** - * 璺敱鍚嶅瓧 - */ - private String name; - - /** - * 璺敱鍦板潃 - */ - private String path; - - /** - * 鏄惁闅愯棌璺敱锛屽綋璁剧疆 true 鐨勬椂鍊欒璺敱涓嶄細鍐嶄晶杈规爮鍑虹幇 - */ - private boolean hidden; - - /** - * 閲嶅畾鍚戝湴鍧�锛屽綋璁剧疆 noRedirect 鐨勬椂鍊欒璺敱鍦ㄩ潰鍖呭睉瀵艰埅涓笉鍙鐐瑰嚮 - */ - private String redirect; - - /** - * 缁勪欢鍦板潃 - */ - private String component; - - /** - * 璺敱鍙傛暟锛氬 {"id": 1, "name": "ry"} - */ - private String query; - - /** - * 褰撲綘涓�涓矾鐢变笅闈㈢殑 children 澹版槑鐨勮矾鐢卞ぇ浜�1涓椂锛岃嚜鍔ㄤ細鍙樻垚宓屽鐨勬ā寮�--濡傜粍浠堕〉闈� - */ - private Boolean alwaysShow; - - /** - * 鍏朵粬鍏冪礌 - */ - private MetaVo meta; - - /** - * 瀛愯矾鐢� - */ - private List<RouterVo> children; - - public String getName() - { - return name; - } - - public void setName(String name) - { - this.name = name; - } - - public String getPath() - { - return path; - } - - public void setPath(String path) - { - this.path = path; - } - - public boolean getHidden() - { - return hidden; - } - - public void setHidden(boolean hidden) - { - this.hidden = hidden; - } - - public String getRedirect() - { - return redirect; - } - - public void setRedirect(String redirect) - { - this.redirect = redirect; - } - - public String getComponent() - { - return component; - } - - public void setComponent(String component) - { - this.component = component; - } - - public String getQuery() - { - return query; - } - - public void setQuery(String query) - { - this.query = query; - } - - public Boolean getAlwaysShow() - { - return alwaysShow; - } - - public void setAlwaysShow(Boolean alwaysShow) - { - this.alwaysShow = alwaysShow; - } - - public MetaVo getMeta() - { - return meta; - } - - public void setMeta(MetaVo meta) - { - this.meta = meta; - } - - public List<RouterVo> getChildren() - { - return children; - } - - public void setChildren(List<RouterVo> children) - { - this.children = children; - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/vo/TreeSelect.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/vo/TreeSelect.java deleted file mode 100644 index 721de72..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/domain/vo/TreeSelect.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.ruoyi.system.domain.vo; - -import java.io.Serializable; -import java.util.List; -import java.util.stream.Collectors; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.aps.common.core.constant.UserConstants; -import com.aps.common.core.utils.StringUtils; -import com.aps.system.api.domain.SysDept; -import com.ruoyi.system.domain.SysMenu; - -/** - * Treeselect鏍戠粨鏋勫疄浣撶被 - * - * @author ruoyi - */ -public class TreeSelect implements Serializable -{ - private static final long serialVersionUID = 1L; - - /** 鑺傜偣ID */ - private Long id; - - /** 鑺傜偣鍚嶇О */ - private String label; - - /** 鑺傜偣绂佺敤 */ - private boolean disabled = false; - - /** 瀛愯妭鐐� */ - @JsonInclude(JsonInclude.Include.NON_EMPTY) - private List<TreeSelect> children; - - public TreeSelect() - { - - } - - public TreeSelect(SysDept dept) - { - this.id = dept.getDeptId(); - this.label = dept.getDeptName(); - this.disabled = StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()); - this.children = dept.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); - } - - public TreeSelect(SysMenu menu) - { - this.id = menu.getMenuId(); - this.label = menu.getMenuName(); - this.children = menu.getChildren().stream().map(TreeSelect::new).collect(Collectors.toList()); - } - - public Long getId() - { - return id; - } - - public void setId(Long id) - { - this.id = id; - } - - public String getLabel() - { - return label; - } - - public void setLabel(String label) - { - this.label = label; - } - - public boolean isDisabled() - { - return disabled; - } - - public void setDisabled(boolean disabled) - { - this.disabled = disabled; - } - - public List<TreeSelect> getChildren() - { - return children; - } - - public void setChildren(List<TreeSelect> children) - { - this.children = children; - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java deleted file mode 100644 index 69f1ac5..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.ruoyi.system.domain.SysConfig; - -/** - * 鍙傛暟閰嶇疆 鏁版嵁灞� - * - * @author ruoyi - */ -public interface SysConfigMapper -{ - /** - * 鏌ヨ鍙傛暟閰嶇疆淇℃伅 - * - * @param config 鍙傛暟閰嶇疆淇℃伅 - * @return 鍙傛暟閰嶇疆淇℃伅 - */ - public SysConfig selectConfig(SysConfig config); - - /** - * 閫氳繃ID鏌ヨ閰嶇疆 - * - * @param configId 鍙傛暟ID - * @return 鍙傛暟閰嶇疆淇℃伅 - */ - public SysConfig selectConfigById(Long configId); - - /** - * 鏌ヨ鍙傛暟閰嶇疆鍒楄〃 - * - * @param config 鍙傛暟閰嶇疆淇℃伅 - * @return 鍙傛暟閰嶇疆闆嗗悎 - */ - public List<SysConfig> selectConfigList(SysConfig config); - - /** - * 鏍规嵁閿悕鏌ヨ鍙傛暟閰嶇疆淇℃伅 - * - * @param configKey 鍙傛暟閿悕 - * @return 鍙傛暟閰嶇疆淇℃伅 - */ - public SysConfig checkConfigKeyUnique(String configKey); - - /** - * 鏂板鍙傛暟閰嶇疆 - * - * @param config 鍙傛暟閰嶇疆淇℃伅 - * @return 缁撴灉 - */ - public int insertConfig(SysConfig config); - - /** - * 淇敼鍙傛暟閰嶇疆 - * - * @param config 鍙傛暟閰嶇疆淇℃伅 - * @return 缁撴灉 - */ - public int updateConfig(SysConfig config); - - /** - * 鍒犻櫎鍙傛暟閰嶇疆 - * - * @param configId 鍙傛暟ID - * @return 缁撴灉 - */ - public int deleteConfigById(Long configId); - - /** - * 鎵归噺鍒犻櫎鍙傛暟淇℃伅 - * - * @param configIds 闇�瑕佸垹闄ょ殑鍙傛暟ID - * @return 缁撴灉 - */ - public int deleteConfigByIds(Long[] configIds); -} \ No newline at end of file diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java deleted file mode 100644 index 11bf440..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import org.apache.ibatis.annotations.Param; -import com.aps.system.api.domain.SysDept; - -/** - * 閮ㄩ棬绠$悊 鏁版嵁灞� - * - * @author ruoyi - */ -public interface SysDeptMapper -{ - /** - * 鏌ヨ閮ㄩ棬绠$悊鏁版嵁 - * - * @param dept 閮ㄩ棬淇℃伅 - * @return 閮ㄩ棬淇℃伅闆嗗悎 - */ - public List<SysDept> selectDeptList(SysDept dept); - - /** - * 鏍规嵁瑙掕壊ID鏌ヨ閮ㄩ棬鏍戜俊鎭� - * - * @param roleId 瑙掕壊ID - * @param deptCheckStrictly 閮ㄩ棬鏍戦�夋嫨椤规槸鍚﹀叧鑱旀樉绀� - * @return 閫変腑閮ㄩ棬鍒楄〃 - */ - public List<Long> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly); - - /** - * 鏍规嵁閮ㄩ棬ID鏌ヨ淇℃伅 - * - * @param deptId 閮ㄩ棬ID - * @return 閮ㄩ棬淇℃伅 - */ - public SysDept selectDeptById(Long deptId); - - /** - * 鏍规嵁ID鏌ヨ鎵�鏈夊瓙閮ㄩ棬 - * - * @param deptId 閮ㄩ棬ID - * @return 閮ㄩ棬鍒楄〃 - */ - public List<SysDept> selectChildrenDeptById(Long deptId); - - /** - * 鏍规嵁ID鏌ヨ鎵�鏈夊瓙閮ㄩ棬锛堟甯哥姸鎬侊級 - * - * @param deptId 閮ㄩ棬ID - * @return 瀛愰儴闂ㄦ暟 - */ - public int selectNormalChildrenDeptById(Long deptId); - - /** - * 鏄惁瀛樺湪瀛愯妭鐐� - * - * @param deptId 閮ㄩ棬ID - * @return 缁撴灉 - */ - public int hasChildByDeptId(Long deptId); - - /** - * 鏌ヨ閮ㄩ棬鏄惁瀛樺湪鐢ㄦ埛 - * - * @param deptId 閮ㄩ棬ID - * @return 缁撴灉 - */ - public int checkDeptExistUser(Long deptId); - - /** - * 鏍¢獙閮ㄩ棬鍚嶇О鏄惁鍞竴 - * - * @param deptName 閮ㄩ棬鍚嶇О - * @param parentId 鐖堕儴闂↖D - * @return 缁撴灉 - */ - public SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId); - - /** - * 鏂板閮ㄩ棬淇℃伅 - * - * @param dept 閮ㄩ棬淇℃伅 - * @return 缁撴灉 - */ - public int insertDept(SysDept dept); - - /** - * 淇敼閮ㄩ棬淇℃伅 - * - * @param dept 閮ㄩ棬淇℃伅 - * @return 缁撴灉 - */ - public int updateDept(SysDept dept); - - /** - * 淇敼鎵�鍦ㄩ儴闂ㄦ甯哥姸鎬� - * - * @param deptIds 閮ㄩ棬ID缁� - */ - public void updateDeptStatusNormal(Long[] deptIds); - - /** - * 淇敼瀛愬厓绱犲叧绯� - * - * @param depts 瀛愬厓绱� - * @return 缁撴灉 - */ - public int updateDeptChildren(@Param("depts") List<SysDept> depts); - - /** - * 鍒犻櫎閮ㄩ棬绠$悊淇℃伅 - * - * @param deptId 閮ㄩ棬ID - * @return 缁撴灉 - */ - public int deleteDeptById(Long deptId); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java deleted file mode 100644 index 9155f8d..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java +++ /dev/null @@ -1,95 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import org.apache.ibatis.annotations.Param; -import com.aps.system.api.domain.SysDictData; - -/** - * 瀛楀吀琛� 鏁版嵁灞� - * - * @author ruoyi - */ -public interface SysDictDataMapper -{ - /** - * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ瀛楀吀鏁版嵁 - * - * @param dictData 瀛楀吀鏁版嵁淇℃伅 - * @return 瀛楀吀鏁版嵁闆嗗悎淇℃伅 - */ - public List<SysDictData> selectDictDataList(SysDictData dictData); - - /** - * 鏍规嵁瀛楀吀绫诲瀷鏌ヨ瀛楀吀鏁版嵁 - * - * @param dictType 瀛楀吀绫诲瀷 - * @return 瀛楀吀鏁版嵁闆嗗悎淇℃伅 - */ - public List<SysDictData> selectDictDataByType(String dictType); - - /** - * 鏍规嵁瀛楀吀绫诲瀷鍜屽瓧鍏搁敭鍊兼煡璇㈠瓧鍏告暟鎹俊鎭� - * - * @param dictType 瀛楀吀绫诲瀷 - * @param dictValue 瀛楀吀閿�� - * @return 瀛楀吀鏍囩 - */ - public String selectDictLabel(@Param("dictType") String dictType, @Param("dictValue") String dictValue); - - /** - * 鏍规嵁瀛楀吀鏁版嵁ID鏌ヨ淇℃伅 - * - * @param dictCode 瀛楀吀鏁版嵁ID - * @return 瀛楀吀鏁版嵁 - */ - public SysDictData selectDictDataById(Long dictCode); - - /** - * 鏌ヨ瀛楀吀鏁版嵁 - * - * @param dictType 瀛楀吀绫诲瀷 - * @return 瀛楀吀鏁版嵁 - */ - public int countDictDataByType(String dictType); - - /** - * 閫氳繃瀛楀吀ID鍒犻櫎瀛楀吀鏁版嵁淇℃伅 - * - * @param dictCode 瀛楀吀鏁版嵁ID - * @return 缁撴灉 - */ - public int deleteDictDataById(Long dictCode); - - /** - * 鎵归噺鍒犻櫎瀛楀吀鏁版嵁淇℃伅 - * - * @param dictCodes 闇�瑕佸垹闄ょ殑瀛楀吀鏁版嵁ID - * @return 缁撴灉 - */ - public int deleteDictDataByIds(Long[] dictCodes); - - /** - * 鏂板瀛楀吀鏁版嵁淇℃伅 - * - * @param dictData 瀛楀吀鏁版嵁淇℃伅 - * @return 缁撴灉 - */ - public int insertDictData(SysDictData dictData); - - /** - * 淇敼瀛楀吀鏁版嵁淇℃伅 - * - * @param dictData 瀛楀吀鏁版嵁淇℃伅 - * @return 缁撴灉 - */ - public int updateDictData(SysDictData dictData); - - /** - * 鍚屾淇敼瀛楀吀绫诲瀷 - * - * @param oldDictType 鏃у瓧鍏哥被鍨� - * @param newDictType 鏂版棫瀛楀吀绫诲瀷 - * @return 缁撴灉 - */ - public int updateDictDataType(@Param("oldDictType") String oldDictType, @Param("newDictType") String newDictType); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java deleted file mode 100644 index a696666..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.aps.system.api.domain.SysDictType; - -/** - * 瀛楀吀琛� 鏁版嵁灞� - * - * @author ruoyi - */ -public interface SysDictTypeMapper -{ - /** - * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ瀛楀吀绫诲瀷 - * - * @param dictType 瀛楀吀绫诲瀷淇℃伅 - * @return 瀛楀吀绫诲瀷闆嗗悎淇℃伅 - */ - public List<SysDictType> selectDictTypeList(SysDictType dictType); - - /** - * 鏍规嵁鎵�鏈夊瓧鍏哥被鍨� - * - * @return 瀛楀吀绫诲瀷闆嗗悎淇℃伅 - */ - public List<SysDictType> selectDictTypeAll(); - - /** - * 鏍规嵁瀛楀吀绫诲瀷ID鏌ヨ淇℃伅 - * - * @param dictId 瀛楀吀绫诲瀷ID - * @return 瀛楀吀绫诲瀷 - */ - public SysDictType selectDictTypeById(Long dictId); - - /** - * 鏍规嵁瀛楀吀绫诲瀷鏌ヨ淇℃伅 - * - * @param dictType 瀛楀吀绫诲瀷 - * @return 瀛楀吀绫诲瀷 - */ - public SysDictType selectDictTypeByType(String dictType); - - /** - * 閫氳繃瀛楀吀ID鍒犻櫎瀛楀吀淇℃伅 - * - * @param dictId 瀛楀吀ID - * @return 缁撴灉 - */ - public int deleteDictTypeById(Long dictId); - - /** - * 鎵归噺鍒犻櫎瀛楀吀绫诲瀷淇℃伅 - * - * @param dictIds 闇�瑕佸垹闄ょ殑瀛楀吀ID - * @return 缁撴灉 - */ - public int deleteDictTypeByIds(Long[] dictIds); - - /** - * 鏂板瀛楀吀绫诲瀷淇℃伅 - * - * @param dictType 瀛楀吀绫诲瀷淇℃伅 - * @return 缁撴灉 - */ - public int insertDictType(SysDictType dictType); - - /** - * 淇敼瀛楀吀绫诲瀷淇℃伅 - * - * @param dictType 瀛楀吀绫诲瀷淇℃伅 - * @return 缁撴灉 - */ - public int updateDictType(SysDictType dictType); - - /** - * 鏍¢獙瀛楀吀绫诲瀷绉版槸鍚﹀敮涓� - * - * @param dictType 瀛楀吀绫诲瀷 - * @return 缁撴灉 - */ - public SysDictType checkDictTypeUnique(String dictType); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java deleted file mode 100644 index 176cfe6..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.aps.system.api.domain.SysLogininfor; - -/** - * 绯荤粺璁块棶鏃ュ織鎯呭喌淇℃伅 鏁版嵁灞� - * - * @author ruoyi - */ -public interface SysLogininforMapper -{ - /** - * 鏂板绯荤粺鐧诲綍鏃ュ織 - * - * @param logininfor 璁块棶鏃ュ織瀵硅薄 - */ - public int insertLogininfor(SysLogininfor logininfor); - - /** - * 鏌ヨ绯荤粺鐧诲綍鏃ュ織闆嗗悎 - * - * @param logininfor 璁块棶鏃ュ織瀵硅薄 - * @return 鐧诲綍璁板綍闆嗗悎 - */ - public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor); - - /** - * 鎵归噺鍒犻櫎绯荤粺鐧诲綍鏃ュ織 - * - * @param infoIds 闇�瑕佸垹闄ょ殑鐧诲綍鏃ュ織ID - * @return 缁撴灉 - */ - public int deleteLogininforByIds(Long[] infoIds); - - /** - * 娓呯┖绯荤粺鐧诲綍鏃ュ織 - * - * @return 缁撴灉 - */ - public int cleanLogininfor(); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java deleted file mode 100644 index 3302010..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import org.apache.ibatis.annotations.Param; -import com.ruoyi.system.domain.SysMenu; - -/** - * 鑿滃崟琛� 鏁版嵁灞� - * - * @author ruoyi - */ -public interface SysMenuMapper -{ - /** - * 鏌ヨ绯荤粺鑿滃崟鍒楄〃 - * - * @param menu 鑿滃崟淇℃伅 - * @return 鑿滃崟鍒楄〃 - */ - public List<SysMenu> selectMenuList(SysMenu menu); - - /** - * 鏍规嵁鐢ㄦ埛鎵�鏈夋潈闄� - * - * @return 鏉冮檺鍒楄〃 - */ - public List<String> selectMenuPerms(); - - /** - * 鏍规嵁鐢ㄦ埛鏌ヨ绯荤粺鑿滃崟鍒楄〃 - * - * @param menu 鑿滃崟淇℃伅 - * @return 鑿滃崟鍒楄〃 - */ - public List<SysMenu> selectMenuListByUserId(SysMenu menu); - - /** - * 鏍规嵁瑙掕壊ID鏌ヨ鏉冮檺 - * - * @param roleId 瑙掕壊ID - * @return 鏉冮檺鍒楄〃 - */ - public List<String> selectMenuPermsByRoleId(Long roleId); - - /** - * 鏍规嵁鐢ㄦ埛ID鏌ヨ鏉冮檺 - * - * @param userId 鐢ㄦ埛ID - * @return 鏉冮檺鍒楄〃 - */ - public List<String> selectMenuPermsByUserId(Long userId); - - /** - * 鏍规嵁鐢ㄦ埛ID鏌ヨ鑿滃崟 - * - * @return 鑿滃崟鍒楄〃 - */ - public List<SysMenu> selectMenuTreeAll(); - - /** - * 鏍规嵁鐢ㄦ埛ID鏌ヨ鑿滃崟 - * - * @param userId 鐢ㄦ埛ID - * @return 鑿滃崟鍒楄〃 - */ - public List<SysMenu> selectMenuTreeByUserId(Long userId); - - /** - * 鏍规嵁瑙掕壊ID鏌ヨ鑿滃崟鏍戜俊鎭� - * - * @param roleId 瑙掕壊ID - * @param menuCheckStrictly 鑿滃崟鏍戦�夋嫨椤规槸鍚﹀叧鑱旀樉绀� - * @return 閫変腑鑿滃崟鍒楄〃 - */ - public List<Long> selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly); - - /** - * 鏍规嵁鑿滃崟ID鏌ヨ淇℃伅 - * - * @param menuId 鑿滃崟ID - * @return 鑿滃崟淇℃伅 - */ - public SysMenu selectMenuById(Long menuId); - - /** - * 鏄惁瀛樺湪鑿滃崟瀛愯妭鐐� - * - * @param menuId 鑿滃崟ID - * @return 缁撴灉 - */ - public int hasChildByMenuId(Long menuId); - - /** - * 鏂板鑿滃崟淇℃伅 - * - * @param menu 鑿滃崟淇℃伅 - * @return 缁撴灉 - */ - public int insertMenu(SysMenu menu); - - /** - * 淇敼鑿滃崟淇℃伅 - * - * @param menu 鑿滃崟淇℃伅 - * @return 缁撴灉 - */ - public int updateMenu(SysMenu menu); - - /** - * 鍒犻櫎鑿滃崟绠$悊淇℃伅 - * - * @param menuId 鑿滃崟ID - * @return 缁撴灉 - */ - public int deleteMenuById(Long menuId); - - /** - * 鏍¢獙鑿滃崟鍚嶇О鏄惁鍞竴 - * - * @param menuName 鑿滃崟鍚嶇О - * @param parentId 鐖惰彍鍗旾D - * @return 缁撴灉 - */ - public SysMenu checkMenuNameUnique(@Param("menuName") String menuName, @Param("parentId") Long parentId); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java deleted file mode 100644 index 226fdab..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.ruoyi.system.domain.SysNotice; - -/** - * 閫氱煡鍏憡琛� 鏁版嵁灞� - * - * @author ruoyi - */ -public interface SysNoticeMapper -{ - /** - * 鏌ヨ鍏憡淇℃伅 - * - * @param noticeId 鍏憡ID - * @return 鍏憡淇℃伅 - */ - public SysNotice selectNoticeById(Long noticeId); - - /** - * 鏌ヨ鍏憡鍒楄〃 - * - * @param notice 鍏憡淇℃伅 - * @return 鍏憡闆嗗悎 - */ - public List<SysNotice> selectNoticeList(SysNotice notice); - - /** - * 鏂板鍏憡 - * - * @param notice 鍏憡淇℃伅 - * @return 缁撴灉 - */ - public int insertNotice(SysNotice notice); - - /** - * 淇敼鍏憡 - * - * @param notice 鍏憡淇℃伅 - * @return 缁撴灉 - */ - public int updateNotice(SysNotice notice); - - /** - * 鎵归噺鍒犻櫎鍏憡 - * - * @param noticeId 鍏憡ID - * @return 缁撴灉 - */ - public int deleteNoticeById(Long noticeId); - - /** - * 鎵归噺鍒犻櫎鍏憡淇℃伅 - * - * @param noticeIds 闇�瑕佸垹闄ょ殑鍏憡ID - * @return 缁撴灉 - */ - public int deleteNoticeByIds(Long[] noticeIds); -} \ No newline at end of file diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java deleted file mode 100644 index 3f80738..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.aps.system.api.domain.SysOperLog; - -/** - * 鎿嶄綔鏃ュ織 鏁版嵁灞� - * - * @author ruoyi - */ -public interface SysOperLogMapper -{ - /** - * 鏂板鎿嶄綔鏃ュ織 - * - * @param operLog 鎿嶄綔鏃ュ織瀵硅薄 - */ - public int insertOperlog(SysOperLog operLog); - - /** - * 鏌ヨ绯荤粺鎿嶄綔鏃ュ織闆嗗悎 - * - * @param operLog 鎿嶄綔鏃ュ織瀵硅薄 - * @return 鎿嶄綔鏃ュ織闆嗗悎 - */ - public List<SysOperLog> selectOperLogList(SysOperLog operLog); - - /** - * 鎵归噺鍒犻櫎绯荤粺鎿嶄綔鏃ュ織 - * - * @param operIds 闇�瑕佸垹闄ょ殑鎿嶄綔鏃ュ織ID - * @return 缁撴灉 - */ - public int deleteOperLogByIds(Long[] operIds); - - /** - * 鏌ヨ鎿嶄綔鏃ュ織璇︾粏 - * - * @param operId 鎿嶄綔ID - * @return 鎿嶄綔鏃ュ織瀵硅薄 - */ - public SysOperLog selectOperLogById(Long operId); - - /** - * 娓呯┖鎿嶄綔鏃ュ織 - */ - public void cleanOperLog(); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java deleted file mode 100644 index 19be227..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.ruoyi.system.domain.SysPost; - -/** - * 宀椾綅淇℃伅 鏁版嵁灞� - * - * @author ruoyi - */ -public interface SysPostMapper -{ - /** - * 鏌ヨ宀椾綅鏁版嵁闆嗗悎 - * - * @param post 宀椾綅淇℃伅 - * @return 宀椾綅鏁版嵁闆嗗悎 - */ - public List<SysPost> selectPostList(SysPost post); - - /** - * 鏌ヨ鎵�鏈夊矖浣� - * - * @return 宀椾綅鍒楄〃 - */ - public List<SysPost> selectPostAll(); - - /** - * 閫氳繃宀椾綅ID鏌ヨ宀椾綅淇℃伅 - * - * @param postId 宀椾綅ID - * @return 瑙掕壊瀵硅薄淇℃伅 - */ - public SysPost selectPostById(Long postId); - - /** - * 鏍规嵁鐢ㄦ埛ID鑾峰彇宀椾綅閫夋嫨妗嗗垪琛� - * - * @param userId 鐢ㄦ埛ID - * @return 閫変腑宀椾綅ID鍒楄〃 - */ - public List<Long> selectPostListByUserId(Long userId); - - /** - * 鏌ヨ鐢ㄦ埛鎵�灞炲矖浣嶇粍 - * - * @param userName 鐢ㄦ埛鍚� - * @return 缁撴灉 - */ - public List<SysPost> selectPostsByUserName(String userName); - - /** - * 鍒犻櫎宀椾綅淇℃伅 - * - * @param postId 宀椾綅ID - * @return 缁撴灉 - */ - public int deletePostById(Long postId); - - /** - * 鎵归噺鍒犻櫎宀椾綅淇℃伅 - * - * @param postIds 闇�瑕佸垹闄ょ殑宀椾綅ID - * @return 缁撴灉 - */ - public int deletePostByIds(Long[] postIds); - - /** - * 淇敼宀椾綅淇℃伅 - * - * @param post 宀椾綅淇℃伅 - * @return 缁撴灉 - */ - public int updatePost(SysPost post); - - /** - * 鏂板宀椾綅淇℃伅 - * - * @param post 宀椾綅淇℃伅 - * @return 缁撴灉 - */ - public int insertPost(SysPost post); - - /** - * 鏍¢獙宀椾綅鍚嶇О - * - * @param postName 宀椾綅鍚嶇О - * @return 缁撴灉 - */ - public SysPost checkPostNameUnique(String postName); - - /** - * 鏍¢獙宀椾綅缂栫爜 - * - * @param postCode 宀椾綅缂栫爜 - * @return 缁撴灉 - */ - public SysPost checkPostCodeUnique(String postCode); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java deleted file mode 100644 index f9d3a2f..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.ruoyi.system.domain.SysRoleDept; - -/** - * 瑙掕壊涓庨儴闂ㄥ叧鑱旇〃 鏁版嵁灞� - * - * @author ruoyi - */ -public interface SysRoleDeptMapper -{ - /** - * 閫氳繃瑙掕壊ID鍒犻櫎瑙掕壊鍜岄儴闂ㄥ叧鑱� - * - * @param roleId 瑙掕壊ID - * @return 缁撴灉 - */ - public int deleteRoleDeptByRoleId(Long roleId); - - /** - * 鎵归噺鍒犻櫎瑙掕壊閮ㄩ棬鍏宠仈淇℃伅 - * - * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁ID - * @return 缁撴灉 - */ - public int deleteRoleDept(Long[] ids); - - /** - * 鏌ヨ閮ㄩ棬浣跨敤鏁伴噺 - * - * @param deptId 閮ㄩ棬ID - * @return 缁撴灉 - */ - public int selectCountRoleDeptByDeptId(Long deptId); - - /** - * 鎵归噺鏂板瑙掕壊閮ㄩ棬淇℃伅 - * - * @param roleDeptList 瑙掕壊閮ㄩ棬鍒楄〃 - * @return 缁撴灉 - */ - public int batchRoleDept(List<SysRoleDept> roleDeptList); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java deleted file mode 100644 index fec601e..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.aps.system.api.domain.SysRole; - -/** - * 瑙掕壊琛� 鏁版嵁灞� - * - * @author ruoyi - */ -public interface SysRoleMapper -{ - /** - * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ瑙掕壊鏁版嵁 - * - * @param role 瑙掕壊淇℃伅 - * @return 瑙掕壊鏁版嵁闆嗗悎淇℃伅 - */ - public List<SysRole> selectRoleList(SysRole role); - - /** - * 鏍规嵁鐢ㄦ埛ID鏌ヨ瑙掕壊 - * - * @param userId 鐢ㄦ埛ID - * @return 瑙掕壊鍒楄〃 - */ - public List<SysRole> selectRolePermissionByUserId(Long userId); - - /** - * 鏌ヨ鎵�鏈夎鑹� - * - * @return 瑙掕壊鍒楄〃 - */ - public List<SysRole> selectRoleAll(); - - /** - * 鏍规嵁鐢ㄦ埛ID鑾峰彇瑙掕壊閫夋嫨妗嗗垪琛� - * - * @param userId 鐢ㄦ埛ID - * @return 閫変腑瑙掕壊ID鍒楄〃 - */ - public List<Long> selectRoleListByUserId(Long userId); - - /** - * 閫氳繃瑙掕壊ID鏌ヨ瑙掕壊 - * - * @param roleId 瑙掕壊ID - * @return 瑙掕壊瀵硅薄淇℃伅 - */ - public SysRole selectRoleById(Long roleId); - - /** - * 鏍规嵁鐢ㄦ埛ID鏌ヨ瑙掕壊 - * - * @param userName 鐢ㄦ埛鍚� - * @return 瑙掕壊鍒楄〃 - */ - public List<SysRole> selectRolesByUserName(String userName); - - /** - * 鏍¢獙瑙掕壊鍚嶇О鏄惁鍞竴 - * - * @param roleName 瑙掕壊鍚嶇О - * @return 瑙掕壊淇℃伅 - */ - public SysRole checkRoleNameUnique(String roleName); - - /** - * 鏍¢獙瑙掕壊鏉冮檺鏄惁鍞竴 - * - * @param roleKey 瑙掕壊鏉冮檺 - * @return 瑙掕壊淇℃伅 - */ - public SysRole checkRoleKeyUnique(String roleKey); - - /** - * 淇敼瑙掕壊淇℃伅 - * - * @param role 瑙掕壊淇℃伅 - * @return 缁撴灉 - */ - public int updateRole(SysRole role); - - /** - * 鏂板瑙掕壊淇℃伅 - * - * @param role 瑙掕壊淇℃伅 - * @return 缁撴灉 - */ - public int insertRole(SysRole role); - - /** - * 閫氳繃瑙掕壊ID鍒犻櫎瑙掕壊 - * - * @param roleId 瑙掕壊ID - * @return 缁撴灉 - */ - public int deleteRoleById(Long roleId); - - /** - * 鎵归噺鍒犻櫎瑙掕壊淇℃伅 - * - * @param roleIds 闇�瑕佸垹闄ょ殑瑙掕壊ID - * @return 缁撴灉 - */ - public int deleteRoleByIds(Long[] roleIds); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java deleted file mode 100644 index 6602bee..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysRoleMenuMapper.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.ruoyi.system.domain.SysRoleMenu; - -/** - * 瑙掕壊涓庤彍鍗曞叧鑱旇〃 鏁版嵁灞� - * - * @author ruoyi - */ -public interface SysRoleMenuMapper -{ - /** - * 鏌ヨ鑿滃崟浣跨敤鏁伴噺 - * - * @param menuId 鑿滃崟ID - * @return 缁撴灉 - */ - public int checkMenuExistRole(Long menuId); - - /** - * 閫氳繃瑙掕壊ID鍒犻櫎瑙掕壊鍜岃彍鍗曞叧鑱� - * - * @param roleId 瑙掕壊ID - * @return 缁撴灉 - */ - public int deleteRoleMenuByRoleId(Long roleId); - - /** - * 鎵归噺鍒犻櫎瑙掕壊鑿滃崟鍏宠仈淇℃伅 - * - * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁ID - * @return 缁撴灉 - */ - public int deleteRoleMenu(Long[] ids); - - /** - * 鎵归噺鏂板瑙掕壊鑿滃崟淇℃伅 - * - * @param roleMenuList 瑙掕壊鑿滃崟鍒楄〃 - * @return 缁撴灉 - */ - public int batchRoleMenu(List<SysRoleMenu> roleMenuList); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java deleted file mode 100644 index c605f0c..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import org.apache.ibatis.annotations.Param; -import com.aps.system.api.domain.SysUser; - -/** - * 鐢ㄦ埛琛� 鏁版嵁灞� - * - * @author ruoyi - */ -public interface SysUserMapper -{ - /** - * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ鐢ㄦ埛鍒楄〃 - * - * @param sysUser 鐢ㄦ埛淇℃伅 - * @return 鐢ㄦ埛淇℃伅闆嗗悎淇℃伅 - */ - public List<SysUser> selectUserList(SysUser sysUser); - - /** - * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ宸查厤鐢ㄦ埛瑙掕壊鍒楄〃 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 鐢ㄦ埛淇℃伅闆嗗悎淇℃伅 - */ - public List<SysUser> selectAllocatedList(SysUser user); - - /** - * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ鏈垎閰嶇敤鎴疯鑹插垪琛� - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 鐢ㄦ埛淇℃伅闆嗗悎淇℃伅 - */ - public List<SysUser> selectUnallocatedList(SysUser user); - - /** - * 閫氳繃鐢ㄦ埛鍚嶆煡璇㈢敤鎴� - * - * @param userName 鐢ㄦ埛鍚� - * @return 鐢ㄦ埛瀵硅薄淇℃伅 - */ - public SysUser selectUserByUserName(String userName); - - /** - * 閫氳繃鐢ㄦ埛ID鏌ヨ鐢ㄦ埛 - * - * @param userId 鐢ㄦ埛ID - * @return 鐢ㄦ埛瀵硅薄淇℃伅 - */ - public SysUser selectUserById(Long userId); - - /** - * 鏂板鐢ㄦ埛淇℃伅 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 缁撴灉 - */ - public int insertUser(SysUser user); - - /** - * 淇敼鐢ㄦ埛淇℃伅 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 缁撴灉 - */ - public int updateUser(SysUser user); - - /** - * 淇敼鐢ㄦ埛澶村儚 - * - * @param userName 鐢ㄦ埛鍚� - * @param avatar 澶村儚鍦板潃 - * @return 缁撴灉 - */ - public int updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar); - - /** - * 閲嶇疆鐢ㄦ埛瀵嗙爜 - * - * @param userName 鐢ㄦ埛鍚� - * @param password 瀵嗙爜 - * @return 缁撴灉 - */ - public int resetUserPwd(@Param("userName") String userName, @Param("password") String password); - - /** - * 閫氳繃鐢ㄦ埛ID鍒犻櫎鐢ㄦ埛 - * - * @param userId 鐢ㄦ埛ID - * @return 缁撴灉 - */ - public int deleteUserById(Long userId); - - /** - * 鎵归噺鍒犻櫎鐢ㄦ埛淇℃伅 - * - * @param userIds 闇�瑕佸垹闄ょ殑鐢ㄦ埛ID - * @return 缁撴灉 - */ - public int deleteUserByIds(Long[] userIds); - - /** - * 鏍¢獙鐢ㄦ埛鍚嶇О鏄惁鍞竴 - * - * @param userName 鐢ㄦ埛鍚嶇О - * @return 缁撴灉 - */ - public SysUser checkUserNameUnique(String userName); - - /** - * 鏍¢獙鎵嬫満鍙风爜鏄惁鍞竴 - * - * @param phonenumber 鎵嬫満鍙风爜 - * @return 缁撴灉 - */ - public SysUser checkPhoneUnique(String phonenumber); - - /** - * 鏍¢獙email鏄惁鍞竴 - * - * @param email 鐢ㄦ埛閭 - * @return 缁撴灉 - */ - public SysUser checkEmailUnique(String email); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java deleted file mode 100644 index 2a6a720..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import com.ruoyi.system.domain.SysUserPost; - -/** - * 鐢ㄦ埛涓庡矖浣嶅叧鑱旇〃 鏁版嵁灞� - * - * @author ruoyi - */ -public interface SysUserPostMapper -{ - /** - * 閫氳繃鐢ㄦ埛ID鍒犻櫎鐢ㄦ埛鍜屽矖浣嶅叧鑱� - * - * @param userId 鐢ㄦ埛ID - * @return 缁撴灉 - */ - public int deleteUserPostByUserId(Long userId); - - /** - * 閫氳繃宀椾綅ID鏌ヨ宀椾綅浣跨敤鏁伴噺 - * - * @param postId 宀椾綅ID - * @return 缁撴灉 - */ - public int countUserPostById(Long postId); - - /** - * 鎵归噺鍒犻櫎鐢ㄦ埛鍜屽矖浣嶅叧鑱� - * - * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁ID - * @return 缁撴灉 - */ - public int deleteUserPost(Long[] ids); - - /** - * 鎵归噺鏂板鐢ㄦ埛宀椾綅淇℃伅 - * - * @param userPostList 鐢ㄦ埛宀椾綅鍒楄〃 - * @return 缁撴灉 - */ - public int batchUserPost(List<SysUserPost> userPostList); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java deleted file mode 100644 index 3143ec8..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/mapper/SysUserRoleMapper.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import org.apache.ibatis.annotations.Param; -import com.ruoyi.system.domain.SysUserRole; - -/** - * 鐢ㄦ埛涓庤鑹插叧鑱旇〃 鏁版嵁灞� - * - * @author ruoyi - */ -public interface SysUserRoleMapper -{ - /** - * 閫氳繃鐢ㄦ埛ID鍒犻櫎鐢ㄦ埛鍜岃鑹插叧鑱� - * - * @param userId 鐢ㄦ埛ID - * @return 缁撴灉 - */ - public int deleteUserRoleByUserId(Long userId); - - /** - * 鎵归噺鍒犻櫎鐢ㄦ埛鍜岃鑹插叧鑱� - * - * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁ID - * @return 缁撴灉 - */ - public int deleteUserRole(Long[] ids); - - /** - * 閫氳繃瑙掕壊ID鏌ヨ瑙掕壊浣跨敤鏁伴噺 - * - * @param roleId 瑙掕壊ID - * @return 缁撴灉 - */ - public int countUserRoleByRoleId(Long roleId); - - /** - * 鎵归噺鏂板鐢ㄦ埛瑙掕壊淇℃伅 - * - * @param userRoleList 鐢ㄦ埛瑙掕壊鍒楄〃 - * @return 缁撴灉 - */ - public int batchUserRole(List<SysUserRole> userRoleList); - - /** - * 鍒犻櫎鐢ㄦ埛鍜岃鑹插叧鑱斾俊鎭� - * - * @param userRole 鐢ㄦ埛鍜岃鑹插叧鑱斾俊鎭� - * @return 缁撴灉 - */ - public int deleteUserRoleInfo(SysUserRole userRole); - - /** - * 鎵归噺鍙栨秷鎺堟潈鐢ㄦ埛瑙掕壊 - * - * @param roleId 瑙掕壊ID - * @param userIds 闇�瑕佸垹闄ょ殑鐢ㄦ埛鏁版嵁ID - * @return 缁撴灉 - */ - public int deleteUserRoleInfos(@Param("roleId") Long roleId, @Param("userIds") Long[] userIds); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java deleted file mode 100644 index 52a3b00..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysConfigService.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.ruoyi.system.service; - -import java.util.List; -import com.ruoyi.system.domain.SysConfig; - -/** - * 鍙傛暟閰嶇疆 鏈嶅姟灞� - * - * @author ruoyi - */ -public interface ISysConfigService -{ - /** - * 鏌ヨ鍙傛暟閰嶇疆淇℃伅 - * - * @param configId 鍙傛暟閰嶇疆ID - * @return 鍙傛暟閰嶇疆淇℃伅 - */ - public SysConfig selectConfigById(Long configId); - - /** - * 鏍规嵁閿悕鏌ヨ鍙傛暟閰嶇疆淇℃伅 - * - * @param configKey 鍙傛暟閿悕 - * @return 鍙傛暟閿�� - */ - public String selectConfigByKey(String configKey); - - /** - * 鏌ヨ鍙傛暟閰嶇疆鍒楄〃 - * - * @param config 鍙傛暟閰嶇疆淇℃伅 - * @return 鍙傛暟閰嶇疆闆嗗悎 - */ - public List<SysConfig> selectConfigList(SysConfig config); - - /** - * 鏂板鍙傛暟閰嶇疆 - * - * @param config 鍙傛暟閰嶇疆淇℃伅 - * @return 缁撴灉 - */ - public int insertConfig(SysConfig config); - - /** - * 淇敼鍙傛暟閰嶇疆 - * - * @param config 鍙傛暟閰嶇疆淇℃伅 - * @return 缁撴灉 - */ - public int updateConfig(SysConfig config); - - /** - * 鎵归噺鍒犻櫎鍙傛暟淇℃伅 - * - * @param configIds 闇�瑕佸垹闄ょ殑鍙傛暟ID - */ - public void deleteConfigByIds(Long[] configIds); - - /** - * 鍔犺浇鍙傛暟缂撳瓨鏁版嵁 - */ - public void loadingConfigCache(); - - /** - * 娓呯┖鍙傛暟缂撳瓨鏁版嵁 - */ - public void clearConfigCache(); - - /** - * 閲嶇疆鍙傛暟缂撳瓨鏁版嵁 - */ - public void resetConfigCache(); - - /** - * 鏍¢獙鍙傛暟閿悕鏄惁鍞竴 - * - * @param config 鍙傛暟淇℃伅 - * @return 缁撴灉 - */ - public boolean checkConfigKeyUnique(SysConfig config); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java deleted file mode 100644 index dbde860..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysDeptService.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.ruoyi.system.service; - -import java.util.List; -import com.aps.system.api.domain.SysDept; -import com.ruoyi.system.domain.vo.TreeSelect; - -/** - * 閮ㄩ棬绠$悊 鏈嶅姟灞� - * - * @author ruoyi - */ -public interface ISysDeptService -{ - /** - * 鏌ヨ閮ㄩ棬绠$悊鏁版嵁 - * - * @param dept 閮ㄩ棬淇℃伅 - * @return 閮ㄩ棬淇℃伅闆嗗悎 - */ - public List<SysDept> selectDeptList(SysDept dept); - - /** - * 鏌ヨ閮ㄩ棬鏍戠粨鏋勪俊鎭� - * - * @param dept 閮ㄩ棬淇℃伅 - * @return 閮ㄩ棬鏍戜俊鎭泦鍚� - */ - public List<TreeSelect> selectDeptTreeList(SysDept dept); - - /** - * 鏋勫缓鍓嶇鎵�闇�瑕佹爲缁撴瀯 - * - * @param depts 閮ㄩ棬鍒楄〃 - * @return 鏍戠粨鏋勫垪琛� - */ - public List<SysDept> buildDeptTree(List<SysDept> depts); - - /** - * 鏋勫缓鍓嶇鎵�闇�瑕佷笅鎷夋爲缁撴瀯 - * - * @param depts 閮ㄩ棬鍒楄〃 - * @return 涓嬫媺鏍戠粨鏋勫垪琛� - */ - public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts); - - /** - * 鏍规嵁瑙掕壊ID鏌ヨ閮ㄩ棬鏍戜俊鎭� - * - * @param roleId 瑙掕壊ID - * @return 閫変腑閮ㄩ棬鍒楄〃 - */ - public List<Long> selectDeptListByRoleId(Long roleId); - - /** - * 鏍规嵁閮ㄩ棬ID鏌ヨ淇℃伅 - * - * @param deptId 閮ㄩ棬ID - * @return 閮ㄩ棬淇℃伅 - */ - public SysDept selectDeptById(Long deptId); - - /** - * 鏍规嵁ID鏌ヨ鎵�鏈夊瓙閮ㄩ棬锛堟甯哥姸鎬侊級 - * - * @param deptId 閮ㄩ棬ID - * @return 瀛愰儴闂ㄦ暟 - */ - public int selectNormalChildrenDeptById(Long deptId); - - /** - * 鏄惁瀛樺湪閮ㄩ棬瀛愯妭鐐� - * - * @param deptId 閮ㄩ棬ID - * @return 缁撴灉 - */ - public boolean hasChildByDeptId(Long deptId); - - /** - * 鏌ヨ閮ㄩ棬鏄惁瀛樺湪鐢ㄦ埛 - * - * @param deptId 閮ㄩ棬ID - * @return 缁撴灉 true 瀛樺湪 false 涓嶅瓨鍦� - */ - public boolean checkDeptExistUser(Long deptId); - - /** - * 鏍¢獙閮ㄩ棬鍚嶇О鏄惁鍞竴 - * - * @param dept 閮ㄩ棬淇℃伅 - * @return 缁撴灉 - */ - public boolean checkDeptNameUnique(SysDept dept); - - /** - * 鏍¢獙閮ㄩ棬鏄惁鏈夋暟鎹潈闄� - * - * @param deptId 閮ㄩ棬id - */ - public void checkDeptDataScope(Long deptId); - - /** - * 鏂板淇濆瓨閮ㄩ棬淇℃伅 - * - * @param dept 閮ㄩ棬淇℃伅 - * @return 缁撴灉 - */ - public int insertDept(SysDept dept); - - /** - * 淇敼淇濆瓨閮ㄩ棬淇℃伅 - * - * @param dept 閮ㄩ棬淇℃伅 - * @return 缁撴灉 - */ - public int updateDept(SysDept dept); - - /** - * 鍒犻櫎閮ㄩ棬绠$悊淇℃伅 - * - * @param deptId 閮ㄩ棬ID - * @return 缁撴灉 - */ - public int deleteDeptById(Long deptId); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java deleted file mode 100644 index 92ce81c..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.ruoyi.system.service; - -import java.util.List; -import com.aps.system.api.domain.SysDictData; - -/** - * 瀛楀吀 涓氬姟灞� - * - * @author ruoyi - */ -public interface ISysDictDataService -{ - /** - * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ瀛楀吀鏁版嵁 - * - * @param dictData 瀛楀吀鏁版嵁淇℃伅 - * @return 瀛楀吀鏁版嵁闆嗗悎淇℃伅 - */ - public List<SysDictData> selectDictDataList(SysDictData dictData); - - /** - * 鏍规嵁瀛楀吀绫诲瀷鍜屽瓧鍏搁敭鍊兼煡璇㈠瓧鍏告暟鎹俊鎭� - * - * @param dictType 瀛楀吀绫诲瀷 - * @param dictValue 瀛楀吀閿�� - * @return 瀛楀吀鏍囩 - */ - public String selectDictLabel(String dictType, String dictValue); - - /** - * 鏍规嵁瀛楀吀鏁版嵁ID鏌ヨ淇℃伅 - * - * @param dictCode 瀛楀吀鏁版嵁ID - * @return 瀛楀吀鏁版嵁 - */ - public SysDictData selectDictDataById(Long dictCode); - - /** - * 鎵归噺鍒犻櫎瀛楀吀鏁版嵁淇℃伅 - * - * @param dictCodes 闇�瑕佸垹闄ょ殑瀛楀吀鏁版嵁ID - */ - public void deleteDictDataByIds(Long[] dictCodes); - - /** - * 鏂板淇濆瓨瀛楀吀鏁版嵁淇℃伅 - * - * @param dictData 瀛楀吀鏁版嵁淇℃伅 - * @return 缁撴灉 - */ - public int insertDictData(SysDictData dictData); - - /** - * 淇敼淇濆瓨瀛楀吀鏁版嵁淇℃伅 - * - * @param dictData 瀛楀吀鏁版嵁淇℃伅 - * @return 缁撴灉 - */ - public int updateDictData(SysDictData dictData); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java deleted file mode 100644 index d0da36e..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.ruoyi.system.service; - -import java.util.List; -import com.aps.system.api.domain.SysDictData; -import com.aps.system.api.domain.SysDictType; - -/** - * 瀛楀吀 涓氬姟灞� - * - * @author ruoyi - */ -public interface ISysDictTypeService -{ - /** - * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ瀛楀吀绫诲瀷 - * - * @param dictType 瀛楀吀绫诲瀷淇℃伅 - * @return 瀛楀吀绫诲瀷闆嗗悎淇℃伅 - */ - public List<SysDictType> selectDictTypeList(SysDictType dictType); - - /** - * 鏍规嵁鎵�鏈夊瓧鍏哥被鍨� - * - * @return 瀛楀吀绫诲瀷闆嗗悎淇℃伅 - */ - public List<SysDictType> selectDictTypeAll(); - - /** - * 鏍规嵁瀛楀吀绫诲瀷鏌ヨ瀛楀吀鏁版嵁 - * - * @param dictType 瀛楀吀绫诲瀷 - * @return 瀛楀吀鏁版嵁闆嗗悎淇℃伅 - */ - public List<SysDictData> selectDictDataByType(String dictType); - - /** - * 鏍规嵁瀛楀吀绫诲瀷ID鏌ヨ淇℃伅 - * - * @param dictId 瀛楀吀绫诲瀷ID - * @return 瀛楀吀绫诲瀷 - */ - public SysDictType selectDictTypeById(Long dictId); - - /** - * 鏍规嵁瀛楀吀绫诲瀷鏌ヨ淇℃伅 - * - * @param dictType 瀛楀吀绫诲瀷 - * @return 瀛楀吀绫诲瀷 - */ - public SysDictType selectDictTypeByType(String dictType); - - /** - * 鎵归噺鍒犻櫎瀛楀吀淇℃伅 - * - * @param dictIds 闇�瑕佸垹闄ょ殑瀛楀吀ID - */ - public void deleteDictTypeByIds(Long[] dictIds); - - /** - * 鍔犺浇瀛楀吀缂撳瓨鏁版嵁 - */ - public void loadingDictCache(); - - /** - * 娓呯┖瀛楀吀缂撳瓨鏁版嵁 - */ - public void clearDictCache(); - - /** - * 閲嶇疆瀛楀吀缂撳瓨鏁版嵁 - */ - public void resetDictCache(); - - /** - * 鏂板淇濆瓨瀛楀吀绫诲瀷淇℃伅 - * - * @param dictType 瀛楀吀绫诲瀷淇℃伅 - * @return 缁撴灉 - */ - public int insertDictType(SysDictType dictType); - - /** - * 淇敼淇濆瓨瀛楀吀绫诲瀷淇℃伅 - * - * @param dictType 瀛楀吀绫诲瀷淇℃伅 - * @return 缁撴灉 - */ - public int updateDictType(SysDictType dictType); - - /** - * 鏍¢獙瀛楀吀绫诲瀷绉版槸鍚﹀敮涓� - * - * @param dictType 瀛楀吀绫诲瀷 - * @return 缁撴灉 - */ - public boolean checkDictTypeUnique(SysDictType dictType); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java deleted file mode 100644 index 6059665..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysLogininforService.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.ruoyi.system.service; - -import java.util.List; -import com.aps.system.api.domain.SysLogininfor; - -/** - * 绯荤粺璁块棶鏃ュ織鎯呭喌淇℃伅 鏈嶅姟灞� - * - * @author ruoyi - */ -public interface ISysLogininforService -{ - /** - * 鏂板绯荤粺鐧诲綍鏃ュ織 - * - * @param logininfor 璁块棶鏃ュ織瀵硅薄 - */ - public int insertLogininfor(SysLogininfor logininfor); - - /** - * 鏌ヨ绯荤粺鐧诲綍鏃ュ織闆嗗悎 - * - * @param logininfor 璁块棶鏃ュ織瀵硅薄 - * @return 鐧诲綍璁板綍闆嗗悎 - */ - public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor); - - /** - * 鎵归噺鍒犻櫎绯荤粺鐧诲綍鏃ュ織 - * - * @param infoIds 闇�瑕佸垹闄ょ殑鐧诲綍鏃ュ織ID - * @return 缁撴灉 - */ - public int deleteLogininforByIds(Long[] infoIds); - - /** - * 娓呯┖绯荤粺鐧诲綍鏃ュ織 - */ - public void cleanLogininfor(); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java deleted file mode 100644 index 4de9419..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java +++ /dev/null @@ -1,144 +0,0 @@ -package com.ruoyi.system.service; - -import java.util.List; -import java.util.Set; -import com.ruoyi.system.domain.SysMenu; -import com.ruoyi.system.domain.vo.RouterVo; -import com.ruoyi.system.domain.vo.TreeSelect; - -/** - * 鑿滃崟 涓氬姟灞� - * - * @author ruoyi - */ -public interface ISysMenuService -{ - /** - * 鏍规嵁鐢ㄦ埛鏌ヨ绯荤粺鑿滃崟鍒楄〃 - * - * @param userId 鐢ㄦ埛ID - * @return 鑿滃崟鍒楄〃 - */ - public List<SysMenu> selectMenuList(Long userId); - - /** - * 鏍规嵁鐢ㄦ埛鏌ヨ绯荤粺鑿滃崟鍒楄〃 - * - * @param menu 鑿滃崟淇℃伅 - * @param userId 鐢ㄦ埛ID - * @return 鑿滃崟鍒楄〃 - */ - public List<SysMenu> selectMenuList(SysMenu menu, Long userId); - - /** - * 鏍规嵁鐢ㄦ埛ID鏌ヨ鏉冮檺 - * - * @param userId 鐢ㄦ埛ID - * @return 鏉冮檺鍒楄〃 - */ - public Set<String> selectMenuPermsByUserId(Long userId); - - /** - * 鏍规嵁瑙掕壊ID鏌ヨ鏉冮檺 - * - * @param roleId 瑙掕壊ID - * @return 鏉冮檺鍒楄〃 - */ - public Set<String> selectMenuPermsByRoleId(Long roleId); - - /** - * 鏍规嵁鐢ㄦ埛ID鏌ヨ鑿滃崟鏍戜俊鎭� - * - * @param userId 鐢ㄦ埛ID - * @return 鑿滃崟鍒楄〃 - */ - public List<SysMenu> selectMenuTreeByUserId(Long userId); - - /** - * 鏍规嵁瑙掕壊ID鏌ヨ鑿滃崟鏍戜俊鎭� - * - * @param roleId 瑙掕壊ID - * @return 閫変腑鑿滃崟鍒楄〃 - */ - public List<Long> selectMenuListByRoleId(Long roleId); - - /** - * 鏋勫缓鍓嶇璺敱鎵�闇�瑕佺殑鑿滃崟 - * - * @param menus 鑿滃崟鍒楄〃 - * @return 璺敱鍒楄〃 - */ - public List<RouterVo> buildMenus(List<SysMenu> menus); - - /** - * 鏋勫缓鍓嶇鎵�闇�瑕佹爲缁撴瀯 - * - * @param menus 鑿滃崟鍒楄〃 - * @return 鏍戠粨鏋勫垪琛� - */ - public List<SysMenu> buildMenuTree(List<SysMenu> menus); - - /** - * 鏋勫缓鍓嶇鎵�闇�瑕佷笅鎷夋爲缁撴瀯 - * - * @param menus 鑿滃崟鍒楄〃 - * @return 涓嬫媺鏍戠粨鏋勫垪琛� - */ - public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus); - - /** - * 鏍规嵁鑿滃崟ID鏌ヨ淇℃伅 - * - * @param menuId 鑿滃崟ID - * @return 鑿滃崟淇℃伅 - */ - public SysMenu selectMenuById(Long menuId); - - /** - * 鏄惁瀛樺湪鑿滃崟瀛愯妭鐐� - * - * @param menuId 鑿滃崟ID - * @return 缁撴灉 true 瀛樺湪 false 涓嶅瓨鍦� - */ - public boolean hasChildByMenuId(Long menuId); - - /** - * 鏌ヨ鑿滃崟鏄惁瀛樺湪瑙掕壊 - * - * @param menuId 鑿滃崟ID - * @return 缁撴灉 true 瀛樺湪 false 涓嶅瓨鍦� - */ - public boolean checkMenuExistRole(Long menuId); - - /** - * 鏂板淇濆瓨鑿滃崟淇℃伅 - * - * @param menu 鑿滃崟淇℃伅 - * @return 缁撴灉 - */ - public int insertMenu(SysMenu menu); - - /** - * 淇敼淇濆瓨鑿滃崟淇℃伅 - * - * @param menu 鑿滃崟淇℃伅 - * @return 缁撴灉 - */ - public int updateMenu(SysMenu menu); - - /** - * 鍒犻櫎鑿滃崟绠$悊淇℃伅 - * - * @param menuId 鑿滃崟ID - * @return 缁撴灉 - */ - public int deleteMenuById(Long menuId); - - /** - * 鏍¢獙鑿滃崟鍚嶇О鏄惁鍞竴 - * - * @param menu 鑿滃崟淇℃伅 - * @return 缁撴灉 - */ - public boolean checkMenuNameUnique(SysMenu menu); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java deleted file mode 100644 index 47ce1b7..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysNoticeService.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.ruoyi.system.service; - -import java.util.List; -import com.ruoyi.system.domain.SysNotice; - -/** - * 鍏憡 鏈嶅姟灞� - * - * @author ruoyi - */ -public interface ISysNoticeService -{ - /** - * 鏌ヨ鍏憡淇℃伅 - * - * @param noticeId 鍏憡ID - * @return 鍏憡淇℃伅 - */ - public SysNotice selectNoticeById(Long noticeId); - - /** - * 鏌ヨ鍏憡鍒楄〃 - * - * @param notice 鍏憡淇℃伅 - * @return 鍏憡闆嗗悎 - */ - public List<SysNotice> selectNoticeList(SysNotice notice); - - /** - * 鏂板鍏憡 - * - * @param notice 鍏憡淇℃伅 - * @return 缁撴灉 - */ - public int insertNotice(SysNotice notice); - - /** - * 淇敼鍏憡 - * - * @param notice 鍏憡淇℃伅 - * @return 缁撴灉 - */ - public int updateNotice(SysNotice notice); - - /** - * 鍒犻櫎鍏憡淇℃伅 - * - * @param noticeId 鍏憡ID - * @return 缁撴灉 - */ - public int deleteNoticeById(Long noticeId); - - /** - * 鎵归噺鍒犻櫎鍏憡淇℃伅 - * - * @param noticeIds 闇�瑕佸垹闄ょ殑鍏憡ID - * @return 缁撴灉 - */ - public int deleteNoticeByIds(Long[] noticeIds); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java deleted file mode 100644 index f91b34b..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysOperLogService.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.ruoyi.system.service; - -import java.util.List; -import com.aps.system.api.domain.SysOperLog; - -/** - * 鎿嶄綔鏃ュ織 鏈嶅姟灞� - * - * @author ruoyi - */ -public interface ISysOperLogService -{ - /** - * 鏂板鎿嶄綔鏃ュ織 - * - * @param operLog 鎿嶄綔鏃ュ織瀵硅薄 - * @return 缁撴灉 - */ - public int insertOperlog(SysOperLog operLog); - - /** - * 鏌ヨ绯荤粺鎿嶄綔鏃ュ織闆嗗悎 - * - * @param operLog 鎿嶄綔鏃ュ織瀵硅薄 - * @return 鎿嶄綔鏃ュ織闆嗗悎 - */ - public List<SysOperLog> selectOperLogList(SysOperLog operLog); - - /** - * 鎵归噺鍒犻櫎绯荤粺鎿嶄綔鏃ュ織 - * - * @param operIds 闇�瑕佸垹闄ょ殑鎿嶄綔鏃ュ織ID - * @return 缁撴灉 - */ - public int deleteOperLogByIds(Long[] operIds); - - /** - * 鏌ヨ鎿嶄綔鏃ュ織璇︾粏 - * - * @param operId 鎿嶄綔ID - * @return 鎿嶄綔鏃ュ織瀵硅薄 - */ - public SysOperLog selectOperLogById(Long operId); - - /** - * 娓呯┖鎿嶄綔鏃ュ織 - */ - public void cleanOperLog(); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysPermissionService.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysPermissionService.java deleted file mode 100644 index afb18a2..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysPermissionService.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.ruoyi.system.service; - -import java.util.Set; - -import com.aps.system.api.domain.SysUser; - -/** - * 鏉冮檺淇℃伅 鏈嶅姟灞� - * - * @author ruoyi - */ -public interface ISysPermissionService -{ - /** - * 鑾峰彇瑙掕壊鏁版嵁鏉冮檺 - * - * @param userId 鐢ㄦ埛Id - * @return 瑙掕壊鏉冮檺淇℃伅 - */ - public Set<String> getRolePermission(SysUser user); - - /** - * 鑾峰彇鑿滃崟鏁版嵁鏉冮檺 - * - * @param userId 鐢ㄦ埛Id - * @return 鑿滃崟鏉冮檺淇℃伅 - */ - public Set<String> getMenuPermission(SysUser user); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysPostService.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysPostService.java deleted file mode 100644 index 84779bf..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysPostService.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.ruoyi.system.service; - -import java.util.List; -import com.ruoyi.system.domain.SysPost; - -/** - * 宀椾綅淇℃伅 鏈嶅姟灞� - * - * @author ruoyi - */ -public interface ISysPostService -{ - /** - * 鏌ヨ宀椾綅淇℃伅闆嗗悎 - * - * @param post 宀椾綅淇℃伅 - * @return 宀椾綅鍒楄〃 - */ - public List<SysPost> selectPostList(SysPost post); - - /** - * 鏌ヨ鎵�鏈夊矖浣� - * - * @return 宀椾綅鍒楄〃 - */ - public List<SysPost> selectPostAll(); - - /** - * 閫氳繃宀椾綅ID鏌ヨ宀椾綅淇℃伅 - * - * @param postId 宀椾綅ID - * @return 瑙掕壊瀵硅薄淇℃伅 - */ - public SysPost selectPostById(Long postId); - - /** - * 鏍规嵁鐢ㄦ埛ID鑾峰彇宀椾綅閫夋嫨妗嗗垪琛� - * - * @param userId 鐢ㄦ埛ID - * @return 閫変腑宀椾綅ID鍒楄〃 - */ - public List<Long> selectPostListByUserId(Long userId); - - /** - * 鏍¢獙宀椾綅鍚嶇О - * - * @param post 宀椾綅淇℃伅 - * @return 缁撴灉 - */ - public boolean checkPostNameUnique(SysPost post); - - /** - * 鏍¢獙宀椾綅缂栫爜 - * - * @param post 宀椾綅淇℃伅 - * @return 缁撴灉 - */ - public boolean checkPostCodeUnique(SysPost post); - - /** - * 閫氳繃宀椾綅ID鏌ヨ宀椾綅浣跨敤鏁伴噺 - * - * @param postId 宀椾綅ID - * @return 缁撴灉 - */ - public int countUserPostById(Long postId); - - /** - * 鍒犻櫎宀椾綅淇℃伅 - * - * @param postId 宀椾綅ID - * @return 缁撴灉 - */ - public int deletePostById(Long postId); - - /** - * 鎵归噺鍒犻櫎宀椾綅淇℃伅 - * - * @param postIds 闇�瑕佸垹闄ょ殑宀椾綅ID - * @return 缁撴灉 - */ - public int deletePostByIds(Long[] postIds); - - /** - * 鏂板淇濆瓨宀椾綅淇℃伅 - * - * @param post 宀椾綅淇℃伅 - * @return 缁撴灉 - */ - public int insertPost(SysPost post); - - /** - * 淇敼淇濆瓨宀椾綅淇℃伅 - * - * @param post 宀椾綅淇℃伅 - * @return 缁撴灉 - */ - public int updatePost(SysPost post); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java deleted file mode 100644 index ef4f0a3..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java +++ /dev/null @@ -1,173 +0,0 @@ -package com.ruoyi.system.service; - -import java.util.List; -import java.util.Set; -import com.aps.system.api.domain.SysRole; -import com.ruoyi.system.domain.SysUserRole; - -/** - * 瑙掕壊涓氬姟灞� - * - * @author ruoyi - */ -public interface ISysRoleService -{ - /** - * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ瑙掕壊鏁版嵁 - * - * @param role 瑙掕壊淇℃伅 - * @return 瑙掕壊鏁版嵁闆嗗悎淇℃伅 - */ - public List<SysRole> selectRoleList(SysRole role); - - /** - * 鏍规嵁鐢ㄦ埛ID鏌ヨ瑙掕壊鍒楄〃 - * - * @param userId 鐢ㄦ埛ID - * @return 瑙掕壊鍒楄〃 - */ - public List<SysRole> selectRolesByUserId(Long userId); - - /** - * 鏍规嵁鐢ㄦ埛ID鏌ヨ瑙掕壊鏉冮檺 - * - * @param userId 鐢ㄦ埛ID - * @return 鏉冮檺鍒楄〃 - */ - public Set<String> selectRolePermissionByUserId(Long userId); - - /** - * 鏌ヨ鎵�鏈夎鑹� - * - * @return 瑙掕壊鍒楄〃 - */ - public List<SysRole> selectRoleAll(); - - /** - * 鏍规嵁鐢ㄦ埛ID鑾峰彇瑙掕壊閫夋嫨妗嗗垪琛� - * - * @param userId 鐢ㄦ埛ID - * @return 閫変腑瑙掕壊ID鍒楄〃 - */ - public List<Long> selectRoleListByUserId(Long userId); - - /** - * 閫氳繃瑙掕壊ID鏌ヨ瑙掕壊 - * - * @param roleId 瑙掕壊ID - * @return 瑙掕壊瀵硅薄淇℃伅 - */ - public SysRole selectRoleById(Long roleId); - - /** - * 鏍¢獙瑙掕壊鍚嶇О鏄惁鍞竴 - * - * @param role 瑙掕壊淇℃伅 - * @return 缁撴灉 - */ - public boolean checkRoleNameUnique(SysRole role); - - /** - * 鏍¢獙瑙掕壊鏉冮檺鏄惁鍞竴 - * - * @param role 瑙掕壊淇℃伅 - * @return 缁撴灉 - */ - public boolean checkRoleKeyUnique(SysRole role); - - /** - * 鏍¢獙瑙掕壊鏄惁鍏佽鎿嶄綔 - * - * @param role 瑙掕壊淇℃伅 - */ - public void checkRoleAllowed(SysRole role); - - /** - * 鏍¢獙瑙掕壊鏄惁鏈夋暟鎹潈闄� - * - * @param roleIds 瑙掕壊id - */ - public void checkRoleDataScope(Long... roleIds); - - /** - * 閫氳繃瑙掕壊ID鏌ヨ瑙掕壊浣跨敤鏁伴噺 - * - * @param roleId 瑙掕壊ID - * @return 缁撴灉 - */ - public int countUserRoleByRoleId(Long roleId); - - /** - * 鏂板淇濆瓨瑙掕壊淇℃伅 - * - * @param role 瑙掕壊淇℃伅 - * @return 缁撴灉 - */ - public int insertRole(SysRole role); - - /** - * 淇敼淇濆瓨瑙掕壊淇℃伅 - * - * @param role 瑙掕壊淇℃伅 - * @return 缁撴灉 - */ - public int updateRole(SysRole role); - - /** - * 淇敼瑙掕壊鐘舵�� - * - * @param role 瑙掕壊淇℃伅 - * @return 缁撴灉 - */ - public int updateRoleStatus(SysRole role); - - /** - * 淇敼鏁版嵁鏉冮檺淇℃伅 - * - * @param role 瑙掕壊淇℃伅 - * @return 缁撴灉 - */ - public int authDataScope(SysRole role); - - /** - * 閫氳繃瑙掕壊ID鍒犻櫎瑙掕壊 - * - * @param roleId 瑙掕壊ID - * @return 缁撴灉 - */ - public int deleteRoleById(Long roleId); - - /** - * 鎵归噺鍒犻櫎瑙掕壊淇℃伅 - * - * @param roleIds 闇�瑕佸垹闄ょ殑瑙掕壊ID - * @return 缁撴灉 - */ - public int deleteRoleByIds(Long[] roleIds); - - /** - * 鍙栨秷鎺堟潈鐢ㄦ埛瑙掕壊 - * - * @param userRole 鐢ㄦ埛鍜岃鑹插叧鑱斾俊鎭� - * @return 缁撴灉 - */ - public int deleteAuthUser(SysUserRole userRole); - - /** - * 鎵归噺鍙栨秷鎺堟潈鐢ㄦ埛瑙掕壊 - * - * @param roleId 瑙掕壊ID - * @param userIds 闇�瑕佸彇娑堟巿鏉冪殑鐢ㄦ埛鏁版嵁ID - * @return 缁撴灉 - */ - public int deleteAuthUsers(Long roleId, Long[] userIds); - - /** - * 鎵归噺閫夋嫨鎺堟潈鐢ㄦ埛瑙掕壊 - * - * @param roleId 瑙掕壊ID - * @param userIds 闇�瑕佸垹闄ょ殑鐢ㄦ埛鏁版嵁ID - * @return 缁撴灉 - */ - public int insertAuthUsers(Long roleId, Long[] userIds); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java deleted file mode 100644 index f32e4c8..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysUserOnlineService.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.ruoyi.system.service; - -import com.aps.system.api.model.LoginUser; -import com.ruoyi.system.domain.SysUserOnline; - -/** - * 鍦ㄧ嚎鐢ㄦ埛 鏈嶅姟灞� - * - * @author ruoyi - */ -public interface ISysUserOnlineService -{ - /** - * 閫氳繃鐧诲綍鍦板潃鏌ヨ淇℃伅 - * - * @param ipaddr 鐧诲綍鍦板潃 - * @param user 鐢ㄦ埛淇℃伅 - * @return 鍦ㄧ嚎鐢ㄦ埛淇℃伅 - */ - public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user); - - /** - * 閫氳繃鐢ㄦ埛鍚嶇О鏌ヨ淇℃伅 - * - * @param userName 鐢ㄦ埛鍚嶇О - * @param user 鐢ㄦ埛淇℃伅 - * @return 鍦ㄧ嚎鐢ㄦ埛淇℃伅 - */ - public SysUserOnline selectOnlineByUserName(String userName, LoginUser user); - - /** - * 閫氳繃鐧诲綍鍦板潃/鐢ㄦ埛鍚嶇О鏌ヨ淇℃伅 - * - * @param ipaddr 鐧诲綍鍦板潃 - * @param userName 鐢ㄦ埛鍚嶇О - * @param user 鐢ㄦ埛淇℃伅 - * @return 鍦ㄧ嚎鐢ㄦ埛淇℃伅 - */ - public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user); - - /** - * 璁剧疆鍦ㄧ嚎鐢ㄦ埛淇℃伅 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 鍦ㄧ嚎鐢ㄦ埛 - */ - public SysUserOnline loginUserToUserOnline(LoginUser user); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysUserService.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysUserService.java deleted file mode 100644 index 8f3d49e..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/ISysUserService.java +++ /dev/null @@ -1,206 +0,0 @@ -package com.ruoyi.system.service; - -import java.util.List; -import com.aps.system.api.domain.SysUser; - -/** - * 鐢ㄦ埛 涓氬姟灞� - * - * @author ruoyi - */ -public interface ISysUserService -{ - /** - * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ鐢ㄦ埛鍒楄〃 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 鐢ㄦ埛淇℃伅闆嗗悎淇℃伅 - */ - public List<SysUser> selectUserList(SysUser user); - - /** - * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ宸插垎閰嶇敤鎴疯鑹插垪琛� - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 鐢ㄦ埛淇℃伅闆嗗悎淇℃伅 - */ - public List<SysUser> selectAllocatedList(SysUser user); - - /** - * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ鏈垎閰嶇敤鎴疯鑹插垪琛� - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 鐢ㄦ埛淇℃伅闆嗗悎淇℃伅 - */ - public List<SysUser> selectUnallocatedList(SysUser user); - - /** - * 閫氳繃鐢ㄦ埛鍚嶆煡璇㈢敤鎴� - * - * @param userName 鐢ㄦ埛鍚� - * @return 鐢ㄦ埛瀵硅薄淇℃伅 - */ - public SysUser selectUserByUserName(String userName); - - /** - * 閫氳繃鐢ㄦ埛ID鏌ヨ鐢ㄦ埛 - * - * @param userId 鐢ㄦ埛ID - * @return 鐢ㄦ埛瀵硅薄淇℃伅 - */ - public SysUser selectUserById(Long userId); - - /** - * 鏍规嵁鐢ㄦ埛ID鏌ヨ鐢ㄦ埛鎵�灞炶鑹茬粍 - * - * @param userName 鐢ㄦ埛鍚� - * @return 缁撴灉 - */ - public String selectUserRoleGroup(String userName); - - /** - * 鏍规嵁鐢ㄦ埛ID鏌ヨ鐢ㄦ埛鎵�灞炲矖浣嶇粍 - * - * @param userName 鐢ㄦ埛鍚� - * @return 缁撴灉 - */ - public String selectUserPostGroup(String userName); - - /** - * 鏍¢獙鐢ㄦ埛鍚嶇О鏄惁鍞竴 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 缁撴灉 - */ - public boolean checkUserNameUnique(SysUser user); - - /** - * 鏍¢獙鎵嬫満鍙风爜鏄惁鍞竴 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 缁撴灉 - */ - public boolean checkPhoneUnique(SysUser user); - - /** - * 鏍¢獙email鏄惁鍞竴 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 缁撴灉 - */ - public boolean checkEmailUnique(SysUser user); - - /** - * 鏍¢獙鐢ㄦ埛鏄惁鍏佽鎿嶄綔 - * - * @param user 鐢ㄦ埛淇℃伅 - */ - public void checkUserAllowed(SysUser user); - - /** - * 鏍¢獙鐢ㄦ埛鏄惁鏈夋暟鎹潈闄� - * - * @param userId 鐢ㄦ埛id - */ - public void checkUserDataScope(Long userId); - - /** - * 鏂板鐢ㄦ埛淇℃伅 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 缁撴灉 - */ - public int insertUser(SysUser user); - - /** - * 娉ㄥ唽鐢ㄦ埛淇℃伅 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 缁撴灉 - */ - public boolean registerUser(SysUser user); - - /** - * 淇敼鐢ㄦ埛淇℃伅 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 缁撴灉 - */ - public int updateUser(SysUser user); - - /** - * 鐢ㄦ埛鎺堟潈瑙掕壊 - * - * @param userId 鐢ㄦ埛ID - * @param roleIds 瑙掕壊缁� - */ - public void insertUserAuth(Long userId, Long[] roleIds); - - /** - * 淇敼鐢ㄦ埛鐘舵�� - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 缁撴灉 - */ - public int updateUserStatus(SysUser user); - - /** - * 淇敼鐢ㄦ埛鍩烘湰淇℃伅 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 缁撴灉 - */ - public boolean updateUserProfile(SysUser user); - - /** - * 淇敼鐢ㄦ埛澶村儚 - * - * @param userName 鐢ㄦ埛鍚� - * @param avatar 澶村儚鍦板潃 - * @return 缁撴灉 - */ - public boolean updateUserAvatar(String userName, String avatar); - - /** - * 閲嶇疆鐢ㄦ埛瀵嗙爜 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 缁撴灉 - */ - public int resetPwd(SysUser user); - - /** - * 閲嶇疆鐢ㄦ埛瀵嗙爜 - * - * @param userName 鐢ㄦ埛鍚� - * @param password 瀵嗙爜 - * @return 缁撴灉 - */ - public int resetUserPwd(String userName, String password); - - /** - * 閫氳繃鐢ㄦ埛ID鍒犻櫎鐢ㄦ埛 - * - * @param userId 鐢ㄦ埛ID - * @return 缁撴灉 - */ - public int deleteUserById(Long userId); - - /** - * 鎵归噺鍒犻櫎鐢ㄦ埛淇℃伅 - * - * @param userIds 闇�瑕佸垹闄ょ殑鐢ㄦ埛ID - * @return 缁撴灉 - */ - public int deleteUserByIds(Long[] userIds); - - /** - * 瀵煎叆鐢ㄦ埛鏁版嵁 - * - * @param userList 鐢ㄦ埛鏁版嵁鍒楄〃 - * @param isUpdateSupport 鏄惁鏇存柊鏀寔锛屽鏋滃凡瀛樺湪锛屽垯杩涜鏇存柊鏁版嵁 - * @param operName 鎿嶄綔鐢ㄦ埛 - * @return 缁撴灉 - */ - public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName); -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java deleted file mode 100644 index 48a88e3..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java +++ /dev/null @@ -1,213 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.Collection; -import java.util.List; -import jakarta.annotation.PostConstruct; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.aps.common.core.constant.CacheConstants; -import com.aps.common.core.constant.UserConstants; -import com.aps.common.core.exception.ServiceException; -import com.aps.common.core.text.Convert; -import com.aps.common.core.utils.StringUtils; -import com.aps.common.redis.service.RedisService; -import com.ruoyi.system.domain.SysConfig; -import com.ruoyi.system.mapper.SysConfigMapper; -import com.ruoyi.system.service.ISysConfigService; - -/** - * 鍙傛暟閰嶇疆 鏈嶅姟灞傚疄鐜� - * - * @author ruoyi - */ -@Service -public class SysConfigServiceImpl implements ISysConfigService -{ - @Autowired - private SysConfigMapper configMapper; - - @Autowired - private RedisService redisService; - - /** - * 椤圭洰鍚姩鏃讹紝鍒濆鍖栧弬鏁板埌缂撳瓨 - */ - @PostConstruct - public void init() - { - loadingConfigCache(); - } - - /** - * 鏌ヨ鍙傛暟閰嶇疆淇℃伅 - * - * @param configId 鍙傛暟閰嶇疆ID - * @return 鍙傛暟閰嶇疆淇℃伅 - */ - @Override - public SysConfig selectConfigById(Long configId) - { - SysConfig config = new SysConfig(); - config.setConfigId(configId); - return configMapper.selectConfig(config); - } - - /** - * 鏍规嵁閿悕鏌ヨ鍙傛暟閰嶇疆淇℃伅 - * - * @param configKey 鍙傛暟key - * @return 鍙傛暟閿�� - */ - @Override - public String selectConfigByKey(String configKey) - { - String configValue = Convert.toStr(redisService.getCacheObject(getCacheKey(configKey))); - if (StringUtils.isNotEmpty(configValue)) - { - return configValue; - } - SysConfig config = new SysConfig(); - config.setConfigKey(configKey); - SysConfig retConfig = configMapper.selectConfig(config); - if (StringUtils.isNotNull(retConfig)) - { - redisService.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue()); - return retConfig.getConfigValue(); - } - return StringUtils.EMPTY; - } - - /** - * 鏌ヨ鍙傛暟閰嶇疆鍒楄〃 - * - * @param config 鍙傛暟閰嶇疆淇℃伅 - * @return 鍙傛暟閰嶇疆闆嗗悎 - */ - @Override - public List<SysConfig> selectConfigList(SysConfig config) - { - return configMapper.selectConfigList(config); - } - - /** - * 鏂板鍙傛暟閰嶇疆 - * - * @param config 鍙傛暟閰嶇疆淇℃伅 - * @return 缁撴灉 - */ - @Override - public int insertConfig(SysConfig config) - { - int row = configMapper.insertConfig(config); - if (row > 0) - { - redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); - } - return row; - } - - /** - * 淇敼鍙傛暟閰嶇疆 - * - * @param config 鍙傛暟閰嶇疆淇℃伅 - * @return 缁撴灉 - */ - @Override - public int updateConfig(SysConfig config) - { - SysConfig temp = configMapper.selectConfigById(config.getConfigId()); - if (!StringUtils.equals(temp.getConfigKey(), config.getConfigKey())) - { - redisService.deleteObject(getCacheKey(temp.getConfigKey())); - } - - int row = configMapper.updateConfig(config); - if (row > 0) - { - redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); - } - return row; - } - - /** - * 鎵归噺鍒犻櫎鍙傛暟淇℃伅 - * - * @param configIds 闇�瑕佸垹闄ょ殑鍙傛暟ID - */ - @Override - public void deleteConfigByIds(Long[] configIds) - { - for (Long configId : configIds) - { - SysConfig config = selectConfigById(configId); - if (StringUtils.equals(UserConstants.YES, config.getConfigType())) - { - throw new ServiceException(String.format("鍐呯疆鍙傛暟銆�%1$s銆戜笉鑳藉垹闄� ", config.getConfigKey())); - } - configMapper.deleteConfigById(configId); - redisService.deleteObject(getCacheKey(config.getConfigKey())); - } - } - - /** - * 鍔犺浇鍙傛暟缂撳瓨鏁版嵁 - */ - @Override - public void loadingConfigCache() - { - List<SysConfig> configsList = configMapper.selectConfigList(new SysConfig()); - for (SysConfig config : configsList) - { - redisService.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); - } - } - - /** - * 娓呯┖鍙傛暟缂撳瓨鏁版嵁 - */ - @Override - public void clearConfigCache() - { - Collection<String> keys = redisService.keys(CacheConstants.SYS_CONFIG_KEY + "*"); - redisService.deleteObject(keys); - } - - /** - * 閲嶇疆鍙傛暟缂撳瓨鏁版嵁 - */ - @Override - public void resetConfigCache() - { - clearConfigCache(); - loadingConfigCache(); - } - - /** - * 鏍¢獙鍙傛暟閿悕鏄惁鍞竴 - * - * @param config 鍙傛暟閰嶇疆淇℃伅 - * @return 缁撴灉 - */ - @Override - public boolean checkConfigKeyUnique(SysConfig config) - { - Long configId = StringUtils.isNull(config.getConfigId()) ? -1L : config.getConfigId(); - SysConfig info = configMapper.checkConfigKeyUnique(config.getConfigKey()); - if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 璁剧疆cache key - * - * @param configKey 鍙傛暟閿� - * @return 缂撳瓨閿甼ey - */ - private String getCacheKey(String configKey) - { - return CacheConstants.SYS_CONFIG_KEY + configKey; - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java deleted file mode 100644 index 7456233..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java +++ /dev/null @@ -1,338 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import java.util.stream.Collectors; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.aps.common.core.constant.UserConstants; -import com.aps.common.core.exception.ServiceException; -import com.aps.common.core.text.Convert; -import com.aps.common.core.utils.SpringUtils; -import com.aps.common.core.utils.StringUtils; -import com.aps.common.datascope.annotation.DataScope; -import com.aps.common.security.utils.SecurityUtils; -import com.aps.system.api.domain.SysDept; -import com.aps.system.api.domain.SysRole; -import com.aps.system.api.domain.SysUser; -import com.ruoyi.system.domain.vo.TreeSelect; -import com.ruoyi.system.mapper.SysDeptMapper; -import com.ruoyi.system.mapper.SysRoleMapper; -import com.ruoyi.system.service.ISysDeptService; - -/** - * 閮ㄩ棬绠$悊 鏈嶅姟瀹炵幇 - * - * @author ruoyi - */ -@Service -public class SysDeptServiceImpl implements ISysDeptService -{ - @Autowired - private SysDeptMapper deptMapper; - - @Autowired - private SysRoleMapper roleMapper; - - /** - * 鏌ヨ閮ㄩ棬绠$悊鏁版嵁 - * - * @param dept 閮ㄩ棬淇℃伅 - * @return 閮ㄩ棬淇℃伅闆嗗悎 - */ - @Override - @DataScope(deptAlias = "d") - public List<SysDept> selectDeptList(SysDept dept) - { - return deptMapper.selectDeptList(dept); - } - - /** - * 鏌ヨ閮ㄩ棬鏍戠粨鏋勪俊鎭� - * - * @param dept 閮ㄩ棬淇℃伅 - * @return 閮ㄩ棬鏍戜俊鎭泦鍚� - */ - @Override - public List<TreeSelect> selectDeptTreeList(SysDept dept) - { - List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept); - return buildDeptTreeSelect(depts); - } - - /** - * 鏋勫缓鍓嶇鎵�闇�瑕佹爲缁撴瀯 - * - * @param depts 閮ㄩ棬鍒楄〃 - * @return 鏍戠粨鏋勫垪琛� - */ - @Override - public List<SysDept> buildDeptTree(List<SysDept> depts) - { - List<SysDept> returnList = new ArrayList<SysDept>(); - List<Long> tempList = depts.stream().map(SysDept::getDeptId).collect(Collectors.toList()); - for (SysDept dept : depts) - { - // 濡傛灉鏄《绾ц妭鐐�, 閬嶅巻璇ョ埗鑺傜偣鐨勬墍鏈夊瓙鑺傜偣 - if (!tempList.contains(dept.getParentId())) - { - recursionFn(depts, dept); - returnList.add(dept); - } - } - if (returnList.isEmpty()) - { - returnList = depts; - } - return returnList; - } - - /** - * 鏋勫缓鍓嶇鎵�闇�瑕佷笅鎷夋爲缁撴瀯 - * - * @param depts 閮ㄩ棬鍒楄〃 - * @return 涓嬫媺鏍戠粨鏋勫垪琛� - */ - @Override - public List<TreeSelect> buildDeptTreeSelect(List<SysDept> depts) - { - List<SysDept> deptTrees = buildDeptTree(depts); - return deptTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); - } - - /** - * 鏍规嵁瑙掕壊ID鏌ヨ閮ㄩ棬鏍戜俊鎭� - * - * @param roleId 瑙掕壊ID - * @return 閫変腑閮ㄩ棬鍒楄〃 - */ - @Override - public List<Long> selectDeptListByRoleId(Long roleId) - { - SysRole role = roleMapper.selectRoleById(roleId); - return deptMapper.selectDeptListByRoleId(roleId, role.isDeptCheckStrictly()); - } - - /** - * 鏍规嵁閮ㄩ棬ID鏌ヨ淇℃伅 - * - * @param deptId 閮ㄩ棬ID - * @return 閮ㄩ棬淇℃伅 - */ - @Override - public SysDept selectDeptById(Long deptId) - { - return deptMapper.selectDeptById(deptId); - } - - /** - * 鏍规嵁ID鏌ヨ鎵�鏈夊瓙閮ㄩ棬锛堟甯哥姸鎬侊級 - * - * @param deptId 閮ㄩ棬ID - * @return 瀛愰儴闂ㄦ暟 - */ - @Override - public int selectNormalChildrenDeptById(Long deptId) - { - return deptMapper.selectNormalChildrenDeptById(deptId); - } - - /** - * 鏄惁瀛樺湪瀛愯妭鐐� - * - * @param deptId 閮ㄩ棬ID - * @return 缁撴灉 - */ - @Override - public boolean hasChildByDeptId(Long deptId) - { - int result = deptMapper.hasChildByDeptId(deptId); - return result > 0; - } - - /** - * 鏌ヨ閮ㄩ棬鏄惁瀛樺湪鐢ㄦ埛 - * - * @param deptId 閮ㄩ棬ID - * @return 缁撴灉 true 瀛樺湪 false 涓嶅瓨鍦� - */ - @Override - public boolean checkDeptExistUser(Long deptId) - { - int result = deptMapper.checkDeptExistUser(deptId); - return result > 0; - } - - /** - * 鏍¢獙閮ㄩ棬鍚嶇О鏄惁鍞竴 - * - * @param dept 閮ㄩ棬淇℃伅 - * @return 缁撴灉 - */ - @Override - public boolean checkDeptNameUnique(SysDept dept) - { - Long deptId = StringUtils.isNull(dept.getDeptId()) ? -1L : dept.getDeptId(); - SysDept info = deptMapper.checkDeptNameUnique(dept.getDeptName(), dept.getParentId()); - if (StringUtils.isNotNull(info) && info.getDeptId().longValue() != deptId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 鏍¢獙閮ㄩ棬鏄惁鏈夋暟鎹潈闄� - * - * @param deptId 閮ㄩ棬id - */ - @Override - public void checkDeptDataScope(Long deptId) - { - if (!SysUser.isAdmin(SecurityUtils.getUserId()) && StringUtils.isNotNull(deptId)) - { - SysDept dept = new SysDept(); - dept.setDeptId(deptId); - List<SysDept> depts = SpringUtils.getAopProxy(this).selectDeptList(dept); - if (StringUtils.isEmpty(depts)) - { - throw new ServiceException("娌℃湁鏉冮檺璁块棶閮ㄩ棬鏁版嵁锛�"); - } - } - } - - /** - * 鏂板淇濆瓨閮ㄩ棬淇℃伅 - * - * @param dept 閮ㄩ棬淇℃伅 - * @return 缁撴灉 - */ - @Override - public int insertDept(SysDept dept) - { - SysDept info = deptMapper.selectDeptById(dept.getParentId()); - // 濡傛灉鐖惰妭鐐逛笉涓烘甯哥姸鎬�,鍒欎笉鍏佽鏂板瀛愯妭鐐� - if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) - { - throw new ServiceException("閮ㄩ棬鍋滅敤锛屼笉鍏佽鏂板"); - } - dept.setAncestors(info.getAncestors() + "," + dept.getParentId()); - return deptMapper.insertDept(dept); - } - - /** - * 淇敼淇濆瓨閮ㄩ棬淇℃伅 - * - * @param dept 閮ㄩ棬淇℃伅 - * @return 缁撴灉 - */ - @Override - public int updateDept(SysDept dept) - { - SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId()); - SysDept oldDept = deptMapper.selectDeptById(dept.getDeptId()); - if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) - { - String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId(); - String oldAncestors = oldDept.getAncestors(); - dept.setAncestors(newAncestors); - updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors); - } - int result = deptMapper.updateDept(dept); - if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors()) - && !StringUtils.equals("0", dept.getAncestors())) - { - // 濡傛灉璇ラ儴闂ㄦ槸鍚敤鐘舵�侊紝鍒欏惎鐢ㄨ閮ㄩ棬鐨勬墍鏈変笂绾ч儴闂� - updateParentDeptStatusNormal(dept); - } - return result; - } - - /** - * 淇敼璇ラ儴闂ㄧ殑鐖剁骇閮ㄩ棬鐘舵�� - * - * @param dept 褰撳墠閮ㄩ棬 - */ - private void updateParentDeptStatusNormal(SysDept dept) - { - String ancestors = dept.getAncestors(); - Long[] deptIds = Convert.toLongArray(ancestors); - deptMapper.updateDeptStatusNormal(deptIds); - } - - /** - * 淇敼瀛愬厓绱犲叧绯� - * - * @param deptId 琚慨鏀圭殑閮ㄩ棬ID - * @param newAncestors 鏂扮殑鐖禝D闆嗗悎 - * @param oldAncestors 鏃х殑鐖禝D闆嗗悎 - */ - public void updateDeptChildren(Long deptId, String newAncestors, String oldAncestors) - { - List<SysDept> children = deptMapper.selectChildrenDeptById(deptId); - for (SysDept child : children) - { - child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors)); - } - if (children.size() > 0) - { - deptMapper.updateDeptChildren(children); - } - } - - /** - * 鍒犻櫎閮ㄩ棬绠$悊淇℃伅 - * - * @param deptId 閮ㄩ棬ID - * @return 缁撴灉 - */ - @Override - public int deleteDeptById(Long deptId) - { - return deptMapper.deleteDeptById(deptId); - } - - /** - * 閫掑綊鍒楄〃 - */ - private void recursionFn(List<SysDept> list, SysDept t) - { - // 寰楀埌瀛愯妭鐐瑰垪琛� - List<SysDept> childList = getChildList(list, t); - t.setChildren(childList); - for (SysDept tChild : childList) - { - if (hasChild(list, tChild)) - { - recursionFn(list, tChild); - } - } - } - - /** - * 寰楀埌瀛愯妭鐐瑰垪琛� - */ - private List<SysDept> getChildList(List<SysDept> list, SysDept t) - { - List<SysDept> tlist = new ArrayList<SysDept>(); - Iterator<SysDept> it = list.iterator(); - while (it.hasNext()) - { - SysDept n = (SysDept) it.next(); - if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getDeptId().longValue()) - { - tlist.add(n); - } - } - return tlist; - } - - /** - * 鍒ゆ柇鏄惁鏈夊瓙鑺傜偣 - */ - private boolean hasChild(List<SysDept> list, SysDept t) - { - return getChildList(list, t).size() > 0 ? true : false; - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java deleted file mode 100644 index 69e8fa9..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.aps.common.security.utils.DictUtils; -import com.aps.system.api.domain.SysDictData; -import com.ruoyi.system.mapper.SysDictDataMapper; -import com.ruoyi.system.service.ISysDictDataService; - -/** - * 瀛楀吀 涓氬姟灞傚鐞� - * - * @author ruoyi - */ -@Service -public class SysDictDataServiceImpl implements ISysDictDataService -{ - @Autowired - private SysDictDataMapper dictDataMapper; - - /** - * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ瀛楀吀鏁版嵁 - * - * @param dictData 瀛楀吀鏁版嵁淇℃伅 - * @return 瀛楀吀鏁版嵁闆嗗悎淇℃伅 - */ - @Override - public List<SysDictData> selectDictDataList(SysDictData dictData) - { - return dictDataMapper.selectDictDataList(dictData); - } - - /** - * 鏍规嵁瀛楀吀绫诲瀷鍜屽瓧鍏搁敭鍊兼煡璇㈠瓧鍏告暟鎹俊鎭� - * - * @param dictType 瀛楀吀绫诲瀷 - * @param dictValue 瀛楀吀閿�� - * @return 瀛楀吀鏍囩 - */ - @Override - public String selectDictLabel(String dictType, String dictValue) - { - return dictDataMapper.selectDictLabel(dictType, dictValue); - } - - /** - * 鏍规嵁瀛楀吀鏁版嵁ID鏌ヨ淇℃伅 - * - * @param dictCode 瀛楀吀鏁版嵁ID - * @return 瀛楀吀鏁版嵁 - */ - @Override - public SysDictData selectDictDataById(Long dictCode) - { - return dictDataMapper.selectDictDataById(dictCode); - } - - /** - * 鎵归噺鍒犻櫎瀛楀吀鏁版嵁淇℃伅 - * - * @param dictCodes 闇�瑕佸垹闄ょ殑瀛楀吀鏁版嵁ID - */ - @Override - public void deleteDictDataByIds(Long[] dictCodes) - { - for (Long dictCode : dictCodes) - { - SysDictData data = selectDictDataById(dictCode); - dictDataMapper.deleteDictDataById(dictCode); - List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); - DictUtils.setDictCache(data.getDictType(), dictDatas); - } - } - - /** - * 鏂板淇濆瓨瀛楀吀鏁版嵁淇℃伅 - * - * @param data 瀛楀吀鏁版嵁淇℃伅 - * @return 缁撴灉 - */ - @Override - public int insertDictData(SysDictData data) - { - int row = dictDataMapper.insertDictData(data); - if (row > 0) - { - List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); - DictUtils.setDictCache(data.getDictType(), dictDatas); - } - return row; - } - - /** - * 淇敼淇濆瓨瀛楀吀鏁版嵁淇℃伅 - * - * @param data 瀛楀吀鏁版嵁淇℃伅 - * @return 缁撴灉 - */ - @Override - public int updateDictData(SysDictData data) - { - int row = dictDataMapper.updateDictData(data); - if (row > 0) - { - List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(data.getDictType()); - DictUtils.setDictCache(data.getDictType(), dictDatas); - } - return row; - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java deleted file mode 100644 index 18189f9..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java +++ /dev/null @@ -1,223 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import jakarta.annotation.PostConstruct; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import com.aps.common.core.constant.UserConstants; -import com.aps.common.core.exception.ServiceException; -import com.aps.common.core.utils.StringUtils; -import com.aps.common.security.utils.DictUtils; -import com.aps.system.api.domain.SysDictData; -import com.aps.system.api.domain.SysDictType; -import com.ruoyi.system.mapper.SysDictDataMapper; -import com.ruoyi.system.mapper.SysDictTypeMapper; -import com.ruoyi.system.service.ISysDictTypeService; - -/** - * 瀛楀吀 涓氬姟灞傚鐞� - * - * @author ruoyi - */ -@Service -public class SysDictTypeServiceImpl implements ISysDictTypeService -{ - @Autowired - private SysDictTypeMapper dictTypeMapper; - - @Autowired - private SysDictDataMapper dictDataMapper; - - /** - * 椤圭洰鍚姩鏃讹紝鍒濆鍖栧瓧鍏稿埌缂撳瓨 - */ - @PostConstruct - public void init() - { - loadingDictCache(); - } - - /** - * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ瀛楀吀绫诲瀷 - * - * @param dictType 瀛楀吀绫诲瀷淇℃伅 - * @return 瀛楀吀绫诲瀷闆嗗悎淇℃伅 - */ - @Override - public List<SysDictType> selectDictTypeList(SysDictType dictType) - { - return dictTypeMapper.selectDictTypeList(dictType); - } - - /** - * 鏍规嵁鎵�鏈夊瓧鍏哥被鍨� - * - * @return 瀛楀吀绫诲瀷闆嗗悎淇℃伅 - */ - @Override - public List<SysDictType> selectDictTypeAll() - { - return dictTypeMapper.selectDictTypeAll(); - } - - /** - * 鏍规嵁瀛楀吀绫诲瀷鏌ヨ瀛楀吀鏁版嵁 - * - * @param dictType 瀛楀吀绫诲瀷 - * @return 瀛楀吀鏁版嵁闆嗗悎淇℃伅 - */ - @Override - public List<SysDictData> selectDictDataByType(String dictType) - { - List<SysDictData> dictDatas = DictUtils.getDictCache(dictType); - if (StringUtils.isNotEmpty(dictDatas)) - { - return dictDatas; - } - dictDatas = dictDataMapper.selectDictDataByType(dictType); - if (StringUtils.isNotEmpty(dictDatas)) - { - DictUtils.setDictCache(dictType, dictDatas); - return dictDatas; - } - return null; - } - - /** - * 鏍规嵁瀛楀吀绫诲瀷ID鏌ヨ淇℃伅 - * - * @param dictId 瀛楀吀绫诲瀷ID - * @return 瀛楀吀绫诲瀷 - */ - @Override - public SysDictType selectDictTypeById(Long dictId) - { - return dictTypeMapper.selectDictTypeById(dictId); - } - - /** - * 鏍规嵁瀛楀吀绫诲瀷鏌ヨ淇℃伅 - * - * @param dictType 瀛楀吀绫诲瀷 - * @return 瀛楀吀绫诲瀷 - */ - @Override - public SysDictType selectDictTypeByType(String dictType) - { - return dictTypeMapper.selectDictTypeByType(dictType); - } - - /** - * 鎵归噺鍒犻櫎瀛楀吀绫诲瀷淇℃伅 - * - * @param dictIds 闇�瑕佸垹闄ょ殑瀛楀吀ID - */ - @Override - public void deleteDictTypeByIds(Long[] dictIds) - { - for (Long dictId : dictIds) - { - SysDictType dictType = selectDictTypeById(dictId); - if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) - { - throw new ServiceException(String.format("%1$s宸插垎閰�,涓嶈兘鍒犻櫎", dictType.getDictName())); - } - dictTypeMapper.deleteDictTypeById(dictId); - DictUtils.removeDictCache(dictType.getDictType()); - } - } - - /** - * 鍔犺浇瀛楀吀缂撳瓨鏁版嵁 - */ - @Override - public void loadingDictCache() - { - SysDictData dictData = new SysDictData(); - dictData.setStatus("0"); - Map<String, List<SysDictData>> dictDataMap = dictDataMapper.selectDictDataList(dictData).stream().collect(Collectors.groupingBy(SysDictData::getDictType)); - for (Map.Entry<String, List<SysDictData>> entry : dictDataMap.entrySet()) - { - DictUtils.setDictCache(entry.getKey(), entry.getValue().stream().sorted(Comparator.comparing(SysDictData::getDictSort)).collect(Collectors.toList())); - } - } - - /** - * 娓呯┖瀛楀吀缂撳瓨鏁版嵁 - */ - @Override - public void clearDictCache() - { - DictUtils.clearDictCache(); - } - - /** - * 閲嶇疆瀛楀吀缂撳瓨鏁版嵁 - */ - @Override - public void resetDictCache() - { - clearDictCache(); - loadingDictCache(); - } - - /** - * 鏂板淇濆瓨瀛楀吀绫诲瀷淇℃伅 - * - * @param dict 瀛楀吀绫诲瀷淇℃伅 - * @return 缁撴灉 - */ - @Override - public int insertDictType(SysDictType dict) - { - int row = dictTypeMapper.insertDictType(dict); - if (row > 0) - { - DictUtils.setDictCache(dict.getDictType(), null); - } - return row; - } - - /** - * 淇敼淇濆瓨瀛楀吀绫诲瀷淇℃伅 - * - * @param dict 瀛楀吀绫诲瀷淇℃伅 - * @return 缁撴灉 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public int updateDictType(SysDictType dict) - { - SysDictType oldDict = dictTypeMapper.selectDictTypeById(dict.getDictId()); - dictDataMapper.updateDictDataType(oldDict.getDictType(), dict.getDictType()); - int row = dictTypeMapper.updateDictType(dict); - if (row > 0) - { - List<SysDictData> dictDatas = dictDataMapper.selectDictDataByType(dict.getDictType()); - DictUtils.setDictCache(dict.getDictType(), dictDatas); - } - return row; - } - - /** - * 鏍¢獙瀛楀吀绫诲瀷绉版槸鍚﹀敮涓� - * - * @param dict 瀛楀吀绫诲瀷 - * @return 缁撴灉 - */ - @Override - public boolean checkDictTypeUnique(SysDictType dict) - { - Long dictId = StringUtils.isNull(dict.getDictId()) ? -1L : dict.getDictId(); - SysDictType dictType = dictTypeMapper.checkDictTypeUnique(dict.getDictType()); - if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java deleted file mode 100644 index ce9d80e..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.aps.system.api.domain.SysLogininfor; -import com.ruoyi.system.mapper.SysLogininforMapper; -import com.ruoyi.system.service.ISysLogininforService; - -/** - * 绯荤粺璁块棶鏃ュ織鎯呭喌淇℃伅 鏈嶅姟灞傚鐞� - * - * @author ruoyi - */ -@Service -public class SysLogininforServiceImpl implements ISysLogininforService -{ - - @Autowired - private SysLogininforMapper logininforMapper; - - /** - * 鏂板绯荤粺鐧诲綍鏃ュ織 - * - * @param logininfor 璁块棶鏃ュ織瀵硅薄 - */ - @Override - public int insertLogininfor(SysLogininfor logininfor) - { - return logininforMapper.insertLogininfor(logininfor); - } - - /** - * 鏌ヨ绯荤粺鐧诲綍鏃ュ織闆嗗悎 - * - * @param logininfor 璁块棶鏃ュ織瀵硅薄 - * @return 鐧诲綍璁板綍闆嗗悎 - */ - @Override - public List<SysLogininfor> selectLogininforList(SysLogininfor logininfor) - { - return logininforMapper.selectLogininforList(logininfor); - } - - /** - * 鎵归噺鍒犻櫎绯荤粺鐧诲綍鏃ュ織 - * - * @param infoIds 闇�瑕佸垹闄ょ殑鐧诲綍鏃ュ織ID - * @return 缁撴灉 - */ - @Override - public int deleteLogininforByIds(Long[] infoIds) - { - return logininforMapper.deleteLogininforByIds(infoIds); - } - - /** - * 娓呯┖绯荤粺鐧诲綍鏃ュ織 - */ - @Override - public void cleanLogininfor() - { - logininforMapper.cleanLogininfor(); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java deleted file mode 100644 index d53ee03..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java +++ /dev/null @@ -1,543 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.aps.common.core.constant.Constants; -import com.aps.common.core.constant.UserConstants; -import com.aps.common.core.utils.StringUtils; -import com.aps.common.security.utils.SecurityUtils; -import com.aps.system.api.domain.SysRole; -import com.aps.system.api.domain.SysUser; -import com.ruoyi.system.domain.SysMenu; -import com.ruoyi.system.domain.vo.MetaVo; -import com.ruoyi.system.domain.vo.RouterVo; -import com.ruoyi.system.domain.vo.TreeSelect; -import com.ruoyi.system.mapper.SysMenuMapper; -import com.ruoyi.system.mapper.SysRoleMapper; -import com.ruoyi.system.mapper.SysRoleMenuMapper; -import com.ruoyi.system.service.ISysMenuService; - -/** - * 鑿滃崟 涓氬姟灞傚鐞� - * - * @author ruoyi - */ -@Service -public class SysMenuServiceImpl implements ISysMenuService -{ - public static final String PREMISSION_STRING = "perms[\"{0}\"]"; - - @Autowired - private SysMenuMapper menuMapper; - - @Autowired - private SysRoleMapper roleMapper; - - @Autowired - private SysRoleMenuMapper roleMenuMapper; - - /** - * 鏍规嵁鐢ㄦ埛鏌ヨ绯荤粺鑿滃崟鍒楄〃 - * - * @param userId 鐢ㄦ埛ID - * @return 鑿滃崟鍒楄〃 - */ - @Override - public List<SysMenu> selectMenuList(Long userId) - { - return selectMenuList(new SysMenu(), userId); - } - - /** - * 鏌ヨ绯荤粺鑿滃崟鍒楄〃 - * - * @param menu 鑿滃崟淇℃伅 - * @return 鑿滃崟鍒楄〃 - */ - @Override - public List<SysMenu> selectMenuList(SysMenu menu, Long userId) - { - List<SysMenu> menuList = null; - // 绠$悊鍛樻樉绀烘墍鏈夎彍鍗曚俊鎭� - if (SysUser.isAdmin(userId)) - { - menuList = menuMapper.selectMenuList(menu); - } - else - { - menu.getParams().put("userId", userId); - menuList = menuMapper.selectMenuListByUserId(menu); - } - return menuList; - } - - /** - * 鏍规嵁鐢ㄦ埛ID鏌ヨ鏉冮檺 - * - * @param userId 鐢ㄦ埛ID - * @return 鏉冮檺鍒楄〃 - */ - @Override - public Set<String> selectMenuPermsByUserId(Long userId) - { - List<String> perms = menuMapper.selectMenuPermsByUserId(userId); - Set<String> permsSet = new HashSet<>(); - for (String perm : perms) - { - if (StringUtils.isNotEmpty(perm)) - { - permsSet.addAll(Arrays.asList(perm.trim().split(","))); - } - } - return permsSet; - } - - /** - * 鏍规嵁瑙掕壊ID鏌ヨ鏉冮檺 - * - * @param roleId 瑙掕壊ID - * @return 鏉冮檺鍒楄〃 - */ - @Override - public Set<String> selectMenuPermsByRoleId(Long roleId) - { - List<String> perms = menuMapper.selectMenuPermsByRoleId(roleId); - Set<String> permsSet = new HashSet<>(); - for (String perm : perms) - { - if (StringUtils.isNotEmpty(perm)) - { - permsSet.addAll(Arrays.asList(perm.trim().split(","))); - } - } - return permsSet; - } - - /** - * 鏍规嵁鐢ㄦ埛ID鏌ヨ鑿滃崟 - * - * @param userId 鐢ㄦ埛鍚嶇О - * @return 鑿滃崟鍒楄〃 - */ - @Override - public List<SysMenu> selectMenuTreeByUserId(Long userId) - { - List<SysMenu> menus = null; - if (SecurityUtils.isAdmin(userId)) - { - menus = menuMapper.selectMenuTreeAll(); - } - else - { - menus = menuMapper.selectMenuTreeByUserId(userId); - } - return getChildPerms(menus, 0); - } - - /** - * 鏍规嵁瑙掕壊ID鏌ヨ鑿滃崟鏍戜俊鎭� - * - * @param roleId 瑙掕壊ID - * @return 閫変腑鑿滃崟鍒楄〃 - */ - @Override - public List<Long> selectMenuListByRoleId(Long roleId) - { - SysRole role = roleMapper.selectRoleById(roleId); - return menuMapper.selectMenuListByRoleId(roleId, role.isMenuCheckStrictly()); - } - - /** - * 鏋勫缓鍓嶇璺敱鎵�闇�瑕佺殑鑿滃崟 - * - * @param menus 鑿滃崟鍒楄〃 - * @return 璺敱鍒楄〃 - */ - @Override - public List<RouterVo> buildMenus(List<SysMenu> menus) - { - List<RouterVo> routers = new LinkedList<RouterVo>(); - for (SysMenu menu : menus) - { - RouterVo router = new RouterVo(); - router.setHidden("1".equals(menu.getVisible())); - router.setName(getRouteName(menu)); - router.setPath(getRouterPath(menu)); - router.setComponent(getComponent(menu)); - router.setQuery(menu.getQuery()); - router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); - List<SysMenu> cMenus = menu.getChildren(); - if (StringUtils.isNotEmpty(cMenus) && UserConstants.TYPE_DIR.equals(menu.getMenuType())) - { - router.setAlwaysShow(true); - router.setRedirect("noRedirect"); - router.setChildren(buildMenus(cMenus)); - } - else if (isMenuFrame(menu)) - { - router.setMeta(null); - List<RouterVo> childrenList = new ArrayList<RouterVo>(); - RouterVo children = new RouterVo(); - children.setPath(menu.getPath()); - children.setComponent(menu.getComponent()); - children.setName(getRouteName(menu.getRouteName(), menu.getPath())); - children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), StringUtils.equals("1", menu.getIsCache()), menu.getPath())); - children.setQuery(menu.getQuery()); - childrenList.add(children); - router.setChildren(childrenList); - } - else if (menu.getParentId().intValue() == 0 && isInnerLink(menu)) - { - router.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon())); - router.setPath("/"); - List<RouterVo> childrenList = new ArrayList<RouterVo>(); - RouterVo children = new RouterVo(); - String routerPath = innerLinkReplaceEach(menu.getPath()); - children.setPath(routerPath); - children.setComponent(UserConstants.INNER_LINK); - children.setName(getRouteName(menu.getRouteName(), routerPath)); - children.setMeta(new MetaVo(menu.getMenuName(), menu.getIcon(), menu.getPath())); - childrenList.add(children); - router.setChildren(childrenList); - } - routers.add(router); - } - return routers; - } - - /** - * 鏋勫缓鍓嶇鎵�闇�瑕佹爲缁撴瀯 - * - * @param menus 鑿滃崟鍒楄〃 - * @return 鏍戠粨鏋勫垪琛� - */ - @Override - public List<SysMenu> buildMenuTree(List<SysMenu> menus) - { - List<SysMenu> returnList = new ArrayList<SysMenu>(); - List<Long> tempList = menus.stream().map(SysMenu::getMenuId).collect(Collectors.toList()); - for (Iterator<SysMenu> iterator = menus.iterator(); iterator.hasNext();) - { - SysMenu menu = (SysMenu) iterator.next(); - // 濡傛灉鏄《绾ц妭鐐�, 閬嶅巻璇ョ埗鑺傜偣鐨勬墍鏈夊瓙鑺傜偣 - if (!tempList.contains(menu.getParentId())) - { - recursionFn(menus, menu); - returnList.add(menu); - } - } - if (returnList.isEmpty()) - { - returnList = menus; - } - return returnList; - } - - /** - * 鏋勫缓鍓嶇鎵�闇�瑕佷笅鎷夋爲缁撴瀯 - * - * @param menus 鑿滃崟鍒楄〃 - * @return 涓嬫媺鏍戠粨鏋勫垪琛� - */ - @Override - public List<TreeSelect> buildMenuTreeSelect(List<SysMenu> menus) - { - List<SysMenu> menuTrees = buildMenuTree(menus); - return menuTrees.stream().map(TreeSelect::new).collect(Collectors.toList()); - } - - /** - * 鏍规嵁鑿滃崟ID鏌ヨ淇℃伅 - * - * @param menuId 鑿滃崟ID - * @return 鑿滃崟淇℃伅 - */ - @Override - public SysMenu selectMenuById(Long menuId) - { - return menuMapper.selectMenuById(menuId); - } - - /** - * 鏄惁瀛樺湪鑿滃崟瀛愯妭鐐� - * - * @param menuId 鑿滃崟ID - * @return 缁撴灉 - */ - @Override - public boolean hasChildByMenuId(Long menuId) - { - int result = menuMapper.hasChildByMenuId(menuId); - return result > 0; - } - - /** - * 鏌ヨ鑿滃崟浣跨敤鏁伴噺 - * - * @param menuId 鑿滃崟ID - * @return 缁撴灉 - */ - @Override - public boolean checkMenuExistRole(Long menuId) - { - int result = roleMenuMapper.checkMenuExistRole(menuId); - return result > 0; - } - - /** - * 鏂板淇濆瓨鑿滃崟淇℃伅 - * - * @param menu 鑿滃崟淇℃伅 - * @return 缁撴灉 - */ - @Override - public int insertMenu(SysMenu menu) - { - return menuMapper.insertMenu(menu); - } - - /** - * 淇敼淇濆瓨鑿滃崟淇℃伅 - * - * @param menu 鑿滃崟淇℃伅 - * @return 缁撴灉 - */ - @Override - public int updateMenu(SysMenu menu) - { - return menuMapper.updateMenu(menu); - } - - /** - * 鍒犻櫎鑿滃崟绠$悊淇℃伅 - * - * @param menuId 鑿滃崟ID - * @return 缁撴灉 - */ - @Override - public int deleteMenuById(Long menuId) - { - return menuMapper.deleteMenuById(menuId); - } - - /** - * 鏍¢獙鑿滃崟鍚嶇О鏄惁鍞竴 - * - * @param menu 鑿滃崟淇℃伅 - * @return 缁撴灉 - */ - @Override - public boolean checkMenuNameUnique(SysMenu menu) - { - Long menuId = StringUtils.isNull(menu.getMenuId()) ? -1L : menu.getMenuId(); - SysMenu info = menuMapper.checkMenuNameUnique(menu.getMenuName(), menu.getParentId()); - if (StringUtils.isNotNull(info) && info.getMenuId().longValue() != menuId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 鑾峰彇璺敱鍚嶇О - * - * @param menu 鑿滃崟淇℃伅 - * @return 璺敱鍚嶇О - */ - public String getRouteName(SysMenu menu) - { - // 闈炲閾惧苟涓旀槸涓�绾х洰褰曪紙绫诲瀷涓虹洰褰曪級 - if (isMenuFrame(menu)) - { - return StringUtils.EMPTY; - } - return getRouteName(menu.getRouteName(), menu.getPath()); - } - - /** - * 鑾峰彇璺敱鍚嶇О锛屽娌℃湁閰嶇疆璺敱鍚嶇О鍒欏彇璺敱鍦板潃 - * - * @param name 璺敱鍚嶇О - * @param path 璺敱鍦板潃 - * @return 璺敱鍚嶇О锛堥┘宄版牸寮忥級 - */ - public String getRouteName(String name, String path) - { - String routerName = StringUtils.isNotEmpty(name) ? name : path; - return StringUtils.capitalize(routerName); - } - - /** - * 鑾峰彇璺敱鍦板潃 - * - * @param menu 鑿滃崟淇℃伅 - * @return 璺敱鍦板潃 - */ - public String getRouterPath(SysMenu menu) - { - String routerPath = menu.getPath(); - // 鍐呴摼鎵撳紑澶栫綉鏂瑰紡 - if (menu.getParentId().intValue() != 0 && isInnerLink(menu)) - { - routerPath = innerLinkReplaceEach(routerPath); - } - // 闈炲閾惧苟涓旀槸涓�绾х洰褰曪紙绫诲瀷涓虹洰褰曪級 - if (0 == menu.getParentId().intValue() && UserConstants.TYPE_DIR.equals(menu.getMenuType()) - && UserConstants.NO_FRAME.equals(menu.getIsFrame())) - { - routerPath = "/" + menu.getPath(); - } - // 闈炲閾惧苟涓旀槸涓�绾х洰褰曪紙绫诲瀷涓鸿彍鍗曪級 - else if (isMenuFrame(menu)) - { - routerPath = "/"; - } - return routerPath; - } - - /** - * 鑾峰彇缁勪欢淇℃伅 - * - * @param menu 鑿滃崟淇℃伅 - * @return 缁勪欢淇℃伅 - */ - public String getComponent(SysMenu menu) - { - String component = UserConstants.LAYOUT; - if (StringUtils.isNotEmpty(menu.getComponent()) && !isMenuFrame(menu)) - { - component = menu.getComponent(); - } - else if (StringUtils.isEmpty(menu.getComponent()) && menu.getParentId().intValue() != 0 && isInnerLink(menu)) - { - component = UserConstants.INNER_LINK; - } - else if (StringUtils.isEmpty(menu.getComponent()) && isParentView(menu)) - { - component = UserConstants.PARENT_VIEW; - } - return component; - } - - /** - * 鏄惁涓鸿彍鍗曞唴閮ㄨ烦杞� - * - * @param menu 鑿滃崟淇℃伅 - * @return 缁撴灉 - */ - public boolean isMenuFrame(SysMenu menu) - { - return menu.getParentId().intValue() == 0 && UserConstants.TYPE_MENU.equals(menu.getMenuType()) - && menu.getIsFrame().equals(UserConstants.NO_FRAME); - } - - /** - * 鏄惁涓哄唴閾剧粍浠� - * - * @param menu 鑿滃崟淇℃伅 - * @return 缁撴灉 - */ - public boolean isInnerLink(SysMenu menu) - { - return menu.getIsFrame().equals(UserConstants.NO_FRAME) && StringUtils.ishttp(menu.getPath()); - } - - /** - * 鏄惁涓簆arent_view缁勪欢 - * - * @param menu 鑿滃崟淇℃伅 - * @return 缁撴灉 - */ - public boolean isParentView(SysMenu menu) - { - return menu.getParentId().intValue() != 0 && UserConstants.TYPE_DIR.equals(menu.getMenuType()); - } - - /** - * 鏍规嵁鐖惰妭鐐圭殑ID鑾峰彇鎵�鏈夊瓙鑺傜偣 - * - * @param list 鍒嗙被琛� - * @param parentId 浼犲叆鐨勭埗鑺傜偣ID - * @return String - */ - public List<SysMenu> getChildPerms(List<SysMenu> list, int parentId) - { - List<SysMenu> returnList = new ArrayList<SysMenu>(); - for (Iterator<SysMenu> iterator = list.iterator(); iterator.hasNext();) - { - SysMenu t = (SysMenu) iterator.next(); - // 涓�銆佹牴鎹紶鍏ョ殑鏌愪釜鐖惰妭鐐笽D,閬嶅巻璇ョ埗鑺傜偣鐨勬墍鏈夊瓙鑺傜偣 - if (t.getParentId() == parentId) - { - recursionFn(list, t); - returnList.add(t); - } - } - return returnList; - } - - /** - * 閫掑綊鍒楄〃 - * - * @param list 鍒嗙被琛� - * @param t 瀛愯妭鐐� - */ - private void recursionFn(List<SysMenu> list, SysMenu t) - { - // 寰楀埌瀛愯妭鐐瑰垪琛� - List<SysMenu> childList = getChildList(list, t); - t.setChildren(childList); - for (SysMenu tChild : childList) - { - if (hasChild(list, tChild)) - { - recursionFn(list, tChild); - } - } - } - - /** - * 寰楀埌瀛愯妭鐐瑰垪琛� - */ - private List<SysMenu> getChildList(List<SysMenu> list, SysMenu t) - { - List<SysMenu> tlist = new ArrayList<SysMenu>(); - Iterator<SysMenu> it = list.iterator(); - while (it.hasNext()) - { - SysMenu n = (SysMenu) it.next(); - if (n.getParentId().longValue() == t.getMenuId().longValue()) - { - tlist.add(n); - } - } - return tlist; - } - - /** - * 鍒ゆ柇鏄惁鏈夊瓙鑺傜偣 - */ - private boolean hasChild(List<SysMenu> list, SysMenu t) - { - return getChildList(list, t).size() > 0; - } - - /** - * 鍐呴摼鍩熷悕鐗规畩瀛楃鏇挎崲 - * - * @return 鏇挎崲鍚庣殑鍐呴摼鍩熷悕 - */ - public String innerLinkReplaceEach(String path) - { - return StringUtils.replaceEach(path, new String[] { Constants.HTTP, Constants.HTTPS, Constants.WWW, ".", ":" }, - new String[] { "", "", "", "/", "/" }); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java deleted file mode 100644 index 765438b..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.ruoyi.system.domain.SysNotice; -import com.ruoyi.system.mapper.SysNoticeMapper; -import com.ruoyi.system.service.ISysNoticeService; - -/** - * 鍏憡 鏈嶅姟灞傚疄鐜� - * - * @author ruoyi - */ -@Service -public class SysNoticeServiceImpl implements ISysNoticeService -{ - @Autowired - private SysNoticeMapper noticeMapper; - - /** - * 鏌ヨ鍏憡淇℃伅 - * - * @param noticeId 鍏憡ID - * @return 鍏憡淇℃伅 - */ - @Override - public SysNotice selectNoticeById(Long noticeId) - { - return noticeMapper.selectNoticeById(noticeId); - } - - /** - * 鏌ヨ鍏憡鍒楄〃 - * - * @param notice 鍏憡淇℃伅 - * @return 鍏憡闆嗗悎 - */ - @Override - public List<SysNotice> selectNoticeList(SysNotice notice) - { - return noticeMapper.selectNoticeList(notice); - } - - /** - * 鏂板鍏憡 - * - * @param notice 鍏憡淇℃伅 - * @return 缁撴灉 - */ - @Override - public int insertNotice(SysNotice notice) - { - return noticeMapper.insertNotice(notice); - } - - /** - * 淇敼鍏憡 - * - * @param notice 鍏憡淇℃伅 - * @return 缁撴灉 - */ - @Override - public int updateNotice(SysNotice notice) - { - return noticeMapper.updateNotice(notice); - } - - /** - * 鍒犻櫎鍏憡瀵硅薄 - * - * @param noticeId 鍏憡ID - * @return 缁撴灉 - */ - @Override - public int deleteNoticeById(Long noticeId) - { - return noticeMapper.deleteNoticeById(noticeId); - } - - /** - * 鎵归噺鍒犻櫎鍏憡淇℃伅 - * - * @param noticeIds 闇�瑕佸垹闄ょ殑鍏憡ID - * @return 缁撴灉 - */ - @Override - public int deleteNoticeByIds(Long[] noticeIds) - { - return noticeMapper.deleteNoticeByIds(noticeIds); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java deleted file mode 100644 index d64e2c4..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.aps.system.api.domain.SysOperLog; -import com.ruoyi.system.mapper.SysOperLogMapper; -import com.ruoyi.system.service.ISysOperLogService; - -/** - * 鎿嶄綔鏃ュ織 鏈嶅姟灞傚鐞� - * - * @author ruoyi - */ -@Service -public class SysOperLogServiceImpl implements ISysOperLogService -{ - @Autowired - private SysOperLogMapper operLogMapper; - - /** - * 鏂板鎿嶄綔鏃ュ織 - * - * @param operLog 鎿嶄綔鏃ュ織瀵硅薄 - * @return 缁撴灉 - */ - @Override - public int insertOperlog(SysOperLog operLog) - { - return operLogMapper.insertOperlog(operLog); - } - - /** - * 鏌ヨ绯荤粺鎿嶄綔鏃ュ織闆嗗悎 - * - * @param operLog 鎿嶄綔鏃ュ織瀵硅薄 - * @return 鎿嶄綔鏃ュ織闆嗗悎 - */ - @Override - public List<SysOperLog> selectOperLogList(SysOperLog operLog) - { - return operLogMapper.selectOperLogList(operLog); - } - - /** - * 鎵归噺鍒犻櫎绯荤粺鎿嶄綔鏃ュ織 - * - * @param operIds 闇�瑕佸垹闄ょ殑鎿嶄綔鏃ュ織ID - * @return 缁撴灉 - */ - @Override - public int deleteOperLogByIds(Long[] operIds) - { - return operLogMapper.deleteOperLogByIds(operIds); - } - - /** - * 鏌ヨ鎿嶄綔鏃ュ織璇︾粏 - * - * @param operId 鎿嶄綔ID - * @return 鎿嶄綔鏃ュ織瀵硅薄 - */ - @Override - public SysOperLog selectOperLogById(Long operId) - { - return operLogMapper.selectOperLogById(operId); - } - - /** - * 娓呯┖鎿嶄綔鏃ュ織 - */ - @Override - public void cleanOperLog() - { - operLogMapper.cleanOperLog(); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysPermissionServiceImpl.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysPermissionServiceImpl.java deleted file mode 100644 index af34808..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysPermissionServiceImpl.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; -import com.aps.common.core.constant.UserConstants; -import com.aps.common.core.utils.StringUtils; -import com.aps.system.api.domain.SysRole; -import com.aps.system.api.domain.SysUser; -import com.ruoyi.system.service.ISysMenuService; -import com.ruoyi.system.service.ISysPermissionService; -import com.ruoyi.system.service.ISysRoleService; - -/** - * 鐢ㄦ埛鏉冮檺澶勭悊 - * - * @author ruoyi - */ -@Service -public class SysPermissionServiceImpl implements ISysPermissionService -{ - @Autowired - private ISysRoleService roleService; - - @Autowired - private ISysMenuService menuService; - - /** - * 鑾峰彇瑙掕壊鏁版嵁鏉冮檺 - * - * @param userId 鐢ㄦ埛Id - * @return 瑙掕壊鏉冮檺淇℃伅 - */ - @Override - public Set<String> getRolePermission(SysUser user) - { - Set<String> roles = new HashSet<String>(); - // 绠$悊鍛樻嫢鏈夋墍鏈夋潈闄� - if (user.isAdmin()) - { - roles.add("admin"); - } - else - { - roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId())); - } - return roles; - } - - /** - * 鑾峰彇鑿滃崟鏁版嵁鏉冮檺 - * - * @param userId 鐢ㄦ埛Id - * @return 鑿滃崟鏉冮檺淇℃伅 - */ - @Override - public Set<String> getMenuPermission(SysUser user) - { - Set<String> perms = new HashSet<String>(); - // 绠$悊鍛樻嫢鏈夋墍鏈夋潈闄� - if (user.isAdmin()) - { - perms.add("*:*:*"); - } - else - { - List<SysRole> roles = user.getRoles(); - if (!CollectionUtils.isEmpty(roles)) - { - // 澶氳鑹茶缃畃ermissions灞炴�э紝浠ヤ究鏁版嵁鏉冮檺鍖归厤鏉冮檺 - for (SysRole role : roles) - { - if (StringUtils.equals(role.getStatus(), UserConstants.ROLE_NORMAL) && !role.isAdmin()) - { - Set<String> rolePerms = menuService.selectMenuPermsByRoleId(role.getRoleId()); - role.setPermissions(rolePerms); - perms.addAll(rolePerms); - } - } - } - else - { - perms.addAll(menuService.selectMenuPermsByUserId(user.getUserId())); - } - } - return perms; - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java deleted file mode 100644 index 2610d7b..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java +++ /dev/null @@ -1,178 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import com.aps.common.core.constant.UserConstants; -import com.aps.common.core.exception.ServiceException; -import com.aps.common.core.utils.StringUtils; -import com.ruoyi.system.domain.SysPost; -import com.ruoyi.system.mapper.SysPostMapper; -import com.ruoyi.system.mapper.SysUserPostMapper; -import com.ruoyi.system.service.ISysPostService; - -/** - * 宀椾綅淇℃伅 鏈嶅姟灞傚鐞� - * - * @author ruoyi - */ -@Service -public class SysPostServiceImpl implements ISysPostService -{ - @Autowired - private SysPostMapper postMapper; - - @Autowired - private SysUserPostMapper userPostMapper; - - /** - * 鏌ヨ宀椾綅淇℃伅闆嗗悎 - * - * @param post 宀椾綅淇℃伅 - * @return 宀椾綅淇℃伅闆嗗悎 - */ - @Override - public List<SysPost> selectPostList(SysPost post) - { - return postMapper.selectPostList(post); - } - - /** - * 鏌ヨ鎵�鏈夊矖浣� - * - * @return 宀椾綅鍒楄〃 - */ - @Override - public List<SysPost> selectPostAll() - { - return postMapper.selectPostAll(); - } - - /** - * 閫氳繃宀椾綅ID鏌ヨ宀椾綅淇℃伅 - * - * @param postId 宀椾綅ID - * @return 瑙掕壊瀵硅薄淇℃伅 - */ - @Override - public SysPost selectPostById(Long postId) - { - return postMapper.selectPostById(postId); - } - - /** - * 鏍规嵁鐢ㄦ埛ID鑾峰彇宀椾綅閫夋嫨妗嗗垪琛� - * - * @param userId 鐢ㄦ埛ID - * @return 閫変腑宀椾綅ID鍒楄〃 - */ - @Override - public List<Long> selectPostListByUserId(Long userId) - { - return postMapper.selectPostListByUserId(userId); - } - - /** - * 鏍¢獙宀椾綅鍚嶇О鏄惁鍞竴 - * - * @param post 宀椾綅淇℃伅 - * @return 缁撴灉 - */ - @Override - public boolean checkPostNameUnique(SysPost post) - { - Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); - SysPost info = postMapper.checkPostNameUnique(post.getPostName()); - if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 鏍¢獙宀椾綅缂栫爜鏄惁鍞竴 - * - * @param post 宀椾綅淇℃伅 - * @return 缁撴灉 - */ - @Override - public boolean checkPostCodeUnique(SysPost post) - { - Long postId = StringUtils.isNull(post.getPostId()) ? -1L : post.getPostId(); - SysPost info = postMapper.checkPostCodeUnique(post.getPostCode()); - if (StringUtils.isNotNull(info) && info.getPostId().longValue() != postId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 閫氳繃宀椾綅ID鏌ヨ宀椾綅浣跨敤鏁伴噺 - * - * @param postId 宀椾綅ID - * @return 缁撴灉 - */ - @Override - public int countUserPostById(Long postId) - { - return userPostMapper.countUserPostById(postId); - } - - /** - * 鍒犻櫎宀椾綅淇℃伅 - * - * @param postId 宀椾綅ID - * @return 缁撴灉 - */ - @Override - public int deletePostById(Long postId) - { - return postMapper.deletePostById(postId); - } - - /** - * 鎵归噺鍒犻櫎宀椾綅淇℃伅 - * - * @param postIds 闇�瑕佸垹闄ょ殑宀椾綅ID - * @return 缁撴灉 - */ - @Override - public int deletePostByIds(Long[] postIds) - { - for (Long postId : postIds) - { - SysPost post = selectPostById(postId); - if (countUserPostById(postId) > 0) - { - throw new ServiceException(String.format("%1$s宸插垎閰�,涓嶈兘鍒犻櫎", post.getPostName())); - } - } - return postMapper.deletePostByIds(postIds); - } - - /** - * 鏂板淇濆瓨宀椾綅淇℃伅 - * - * @param post 宀椾綅淇℃伅 - * @return 缁撴灉 - */ - @Override - public int insertPost(SysPost post) - { - return postMapper.insertPost(post); - } - - /** - * 淇敼淇濆瓨宀椾綅淇℃伅 - * - * @param post 宀椾綅淇℃伅 - * @return 缁撴灉 - */ - @Override - public int updatePost(SysPost post) - { - return postMapper.updatePost(post); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java deleted file mode 100644 index 7da6103..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java +++ /dev/null @@ -1,427 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import com.aps.common.core.constant.UserConstants; -import com.aps.common.core.exception.ServiceException; -import com.aps.common.core.utils.SpringUtils; -import com.aps.common.core.utils.StringUtils; -import com.aps.common.datascope.annotation.DataScope; -import com.aps.common.security.utils.SecurityUtils; -import com.aps.system.api.domain.SysRole; -import com.aps.system.api.domain.SysUser; -import com.ruoyi.system.domain.SysRoleDept; -import com.ruoyi.system.domain.SysRoleMenu; -import com.ruoyi.system.domain.SysUserRole; -import com.ruoyi.system.mapper.SysRoleDeptMapper; -import com.ruoyi.system.mapper.SysRoleMapper; -import com.ruoyi.system.mapper.SysRoleMenuMapper; -import com.ruoyi.system.mapper.SysUserRoleMapper; -import com.ruoyi.system.service.ISysRoleService; - -/** - * 瑙掕壊 涓氬姟灞傚鐞� - * - * @author ruoyi - */ -@Service -public class SysRoleServiceImpl implements ISysRoleService -{ - @Autowired - private SysRoleMapper roleMapper; - - @Autowired - private SysRoleMenuMapper roleMenuMapper; - - @Autowired - private SysUserRoleMapper userRoleMapper; - - @Autowired - private SysRoleDeptMapper roleDeptMapper; - - /** - * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ瑙掕壊鏁版嵁 - * - * @param role 瑙掕壊淇℃伅 - * @return 瑙掕壊鏁版嵁闆嗗悎淇℃伅 - */ - @Override - @DataScope(deptAlias = "d") - public List<SysRole> selectRoleList(SysRole role) - { - return roleMapper.selectRoleList(role); - } - - /** - * 鏍规嵁鐢ㄦ埛ID鏌ヨ瑙掕壊 - * - * @param userId 鐢ㄦ埛ID - * @return 瑙掕壊鍒楄〃 - */ - @Override - public List<SysRole> selectRolesByUserId(Long userId) - { - List<SysRole> userRoles = roleMapper.selectRolePermissionByUserId(userId); - List<SysRole> roles = selectRoleAll(); - for (SysRole role : roles) - { - for (SysRole userRole : userRoles) - { - if (role.getRoleId().longValue() == userRole.getRoleId().longValue()) - { - role.setFlag(true); - break; - } - } - } - return roles; - } - - /** - * 鏍规嵁鐢ㄦ埛ID鏌ヨ鏉冮檺 - * - * @param userId 鐢ㄦ埛ID - * @return 鏉冮檺鍒楄〃 - */ - @Override - public Set<String> selectRolePermissionByUserId(Long userId) - { - List<SysRole> perms = roleMapper.selectRolePermissionByUserId(userId); - Set<String> permsSet = new HashSet<>(); - for (SysRole perm : perms) - { - if (StringUtils.isNotNull(perm)) - { - permsSet.addAll(Arrays.asList(perm.getRoleKey().trim().split(","))); - } - } - return permsSet; - } - - /** - * 鏌ヨ鎵�鏈夎鑹� - * - * @return 瑙掕壊鍒楄〃 - */ - @Override - public List<SysRole> selectRoleAll() - { - return SpringUtils.getAopProxy(this).selectRoleList(new SysRole()); - } - - /** - * 鏍规嵁鐢ㄦ埛ID鑾峰彇瑙掕壊閫夋嫨妗嗗垪琛� - * - * @param userId 鐢ㄦ埛ID - * @return 閫変腑瑙掕壊ID鍒楄〃 - */ - @Override - public List<Long> selectRoleListByUserId(Long userId) - { - return roleMapper.selectRoleListByUserId(userId); - } - - /** - * 閫氳繃瑙掕壊ID鏌ヨ瑙掕壊 - * - * @param roleId 瑙掕壊ID - * @return 瑙掕壊瀵硅薄淇℃伅 - */ - @Override - public SysRole selectRoleById(Long roleId) - { - return roleMapper.selectRoleById(roleId); - } - - /** - * 鏍¢獙瑙掕壊鍚嶇О鏄惁鍞竴 - * - * @param role 瑙掕壊淇℃伅 - * @return 缁撴灉 - */ - @Override - public boolean checkRoleNameUnique(SysRole role) - { - Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); - SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName()); - if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 鏍¢獙瑙掕壊鏉冮檺鏄惁鍞竴 - * - * @param role 瑙掕壊淇℃伅 - * @return 缁撴灉 - */ - @Override - public boolean checkRoleKeyUnique(SysRole role) - { - Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); - SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey()); - if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 鏍¢獙瑙掕壊鏄惁鍏佽鎿嶄綔 - * - * @param role 瑙掕壊淇℃伅 - */ - @Override - public void checkRoleAllowed(SysRole role) - { - if (StringUtils.isNotNull(role.getRoleId()) && role.isAdmin()) - { - throw new ServiceException("涓嶅厑璁告搷浣滆秴绾х鐞嗗憳瑙掕壊"); - } - } - - /** - * 鏍¢獙瑙掕壊鏄惁鏈夋暟鎹潈闄� - * - * @param roleIds 瑙掕壊id - */ - @Override - public void checkRoleDataScope(Long... roleIds) - { - if (!SysUser.isAdmin(SecurityUtils.getUserId())) - { - for (Long roleId : roleIds) - { - SysRole role = new SysRole(); - role.setRoleId(roleId); - List<SysRole> roles = SpringUtils.getAopProxy(this).selectRoleList(role); - if (StringUtils.isEmpty(roles)) - { - throw new ServiceException("娌℃湁鏉冮檺璁块棶瑙掕壊鏁版嵁锛�"); - } - } - } - } - - /** - * 閫氳繃瑙掕壊ID鏌ヨ瑙掕壊浣跨敤鏁伴噺 - * - * @param roleId 瑙掕壊ID - * @return 缁撴灉 - */ - @Override - public int countUserRoleByRoleId(Long roleId) - { - return userRoleMapper.countUserRoleByRoleId(roleId); - } - - /** - * 鏂板淇濆瓨瑙掕壊淇℃伅 - * - * @param role 瑙掕壊淇℃伅 - * @return 缁撴灉 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public int insertRole(SysRole role) - { - // 鏂板瑙掕壊淇℃伅 - roleMapper.insertRole(role); - return insertRoleMenu(role); - } - - /** - * 淇敼淇濆瓨瑙掕壊淇℃伅 - * - * @param role 瑙掕壊淇℃伅 - * @return 缁撴灉 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public int updateRole(SysRole role) - { - // 淇敼瑙掕壊淇℃伅 - roleMapper.updateRole(role); - // 鍒犻櫎瑙掕壊涓庤彍鍗曞叧鑱� - roleMenuMapper.deleteRoleMenuByRoleId(role.getRoleId()); - return insertRoleMenu(role); - } - - /** - * 淇敼瑙掕壊鐘舵�� - * - * @param role 瑙掕壊淇℃伅 - * @return 缁撴灉 - */ - @Override - public int updateRoleStatus(SysRole role) - { - return roleMapper.updateRole(role); - } - - /** - * 淇敼鏁版嵁鏉冮檺淇℃伅 - * - * @param role 瑙掕壊淇℃伅 - * @return 缁撴灉 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public int authDataScope(SysRole role) - { - // 淇敼瑙掕壊淇℃伅 - roleMapper.updateRole(role); - // 鍒犻櫎瑙掕壊涓庨儴闂ㄥ叧鑱� - roleDeptMapper.deleteRoleDeptByRoleId(role.getRoleId()); - // 鏂板瑙掕壊鍜岄儴闂ㄤ俊鎭紙鏁版嵁鏉冮檺锛� - return insertRoleDept(role); - } - - /** - * 鏂板瑙掕壊鑿滃崟淇℃伅 - * - * @param role 瑙掕壊瀵硅薄 - */ - public int insertRoleMenu(SysRole role) - { - int rows = 1; - // 鏂板鐢ㄦ埛涓庤鑹茬鐞� - List<SysRoleMenu> list = new ArrayList<SysRoleMenu>(); - for (Long menuId : role.getMenuIds()) - { - SysRoleMenu rm = new SysRoleMenu(); - rm.setRoleId(role.getRoleId()); - rm.setMenuId(menuId); - list.add(rm); - } - if (list.size() > 0) - { - rows = roleMenuMapper.batchRoleMenu(list); - } - return rows; - } - - /** - * 鏂板瑙掕壊閮ㄩ棬淇℃伅(鏁版嵁鏉冮檺) - * - * @param role 瑙掕壊瀵硅薄 - */ - public int insertRoleDept(SysRole role) - { - int rows = 1; - // 鏂板瑙掕壊涓庨儴闂紙鏁版嵁鏉冮檺锛夌鐞� - List<SysRoleDept> list = new ArrayList<SysRoleDept>(); - for (Long deptId : role.getDeptIds()) - { - SysRoleDept rd = new SysRoleDept(); - rd.setRoleId(role.getRoleId()); - rd.setDeptId(deptId); - list.add(rd); - } - if (list.size() > 0) - { - rows = roleDeptMapper.batchRoleDept(list); - } - return rows; - } - - /** - * 閫氳繃瑙掕壊ID鍒犻櫎瑙掕壊 - * - * @param roleId 瑙掕壊ID - * @return 缁撴灉 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public int deleteRoleById(Long roleId) - { - // 鍒犻櫎瑙掕壊涓庤彍鍗曞叧鑱� - roleMenuMapper.deleteRoleMenuByRoleId(roleId); - // 鍒犻櫎瑙掕壊涓庨儴闂ㄥ叧鑱� - roleDeptMapper.deleteRoleDeptByRoleId(roleId); - return roleMapper.deleteRoleById(roleId); - } - - /** - * 鎵归噺鍒犻櫎瑙掕壊淇℃伅 - * - * @param roleIds 闇�瑕佸垹闄ょ殑瑙掕壊ID - * @return 缁撴灉 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public int deleteRoleByIds(Long[] roleIds) - { - for (Long roleId : roleIds) - { - checkRoleAllowed(new SysRole(roleId)); - checkRoleDataScope(roleId); - SysRole role = selectRoleById(roleId); - if (countUserRoleByRoleId(roleId) > 0) - { - throw new ServiceException(String.format("%1$s宸插垎閰�,涓嶈兘鍒犻櫎", role.getRoleName())); - } - } - // 鍒犻櫎瑙掕壊涓庤彍鍗曞叧鑱� - roleMenuMapper.deleteRoleMenu(roleIds); - // 鍒犻櫎瑙掕壊涓庨儴闂ㄥ叧鑱� - roleDeptMapper.deleteRoleDept(roleIds); - return roleMapper.deleteRoleByIds(roleIds); - } - - /** - * 鍙栨秷鎺堟潈鐢ㄦ埛瑙掕壊 - * - * @param userRole 鐢ㄦ埛鍜岃鑹插叧鑱斾俊鎭� - * @return 缁撴灉 - */ - @Override - public int deleteAuthUser(SysUserRole userRole) - { - return userRoleMapper.deleteUserRoleInfo(userRole); - } - - /** - * 鎵归噺鍙栨秷鎺堟潈鐢ㄦ埛瑙掕壊 - * - * @param roleId 瑙掕壊ID - * @param userIds 闇�瑕佸彇娑堟巿鏉冪殑鐢ㄦ埛鏁版嵁ID - * @return 缁撴灉 - */ - @Override - public int deleteAuthUsers(Long roleId, Long[] userIds) - { - return userRoleMapper.deleteUserRoleInfos(roleId, userIds); - } - - /** - * 鎵归噺閫夋嫨鎺堟潈鐢ㄦ埛瑙掕壊 - * - * @param roleId 瑙掕壊ID - * @param userIds 闇�瑕佹巿鏉冪殑鐢ㄦ埛鏁版嵁ID - * @return 缁撴灉 - */ - @Override - public int insertAuthUsers(Long roleId, Long[] userIds) - { - // 鏂板鐢ㄦ埛涓庤鑹茬鐞� - List<SysUserRole> list = new ArrayList<SysUserRole>(); - for (Long userId : userIds) - { - SysUserRole ur = new SysUserRole(); - ur.setUserId(userId); - ur.setRoleId(roleId); - list.add(ur); - } - return userRoleMapper.batchUserRole(list); - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java deleted file mode 100644 index 7f44f54..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.ruoyi.system.service.impl; - -import org.springframework.stereotype.Service; -import com.aps.common.core.utils.StringUtils; -import com.aps.system.api.model.LoginUser; -import com.ruoyi.system.domain.SysUserOnline; -import com.ruoyi.system.service.ISysUserOnlineService; - -/** - * 鍦ㄧ嚎鐢ㄦ埛 鏈嶅姟灞傚鐞� - * - * @author ruoyi - */ -@Service -public class SysUserOnlineServiceImpl implements ISysUserOnlineService -{ - /** - * 閫氳繃鐧诲綍鍦板潃鏌ヨ淇℃伅 - * - * @param ipaddr 鐧诲綍鍦板潃 - * @param user 鐢ㄦ埛淇℃伅 - * @return 鍦ㄧ嚎鐢ㄦ埛淇℃伅 - */ - @Override - public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user) - { - if (StringUtils.equals(ipaddr, user.getIpaddr())) - { - return loginUserToUserOnline(user); - } - return null; - } - - /** - * 閫氳繃鐢ㄦ埛鍚嶇О鏌ヨ淇℃伅 - * - * @param userName 鐢ㄦ埛鍚嶇О - * @param user 鐢ㄦ埛淇℃伅 - * @return 鍦ㄧ嚎鐢ㄦ埛淇℃伅 - */ - @Override - public SysUserOnline selectOnlineByUserName(String userName, LoginUser user) - { - if (StringUtils.equals(userName, user.getUsername())) - { - return loginUserToUserOnline(user); - } - return null; - } - - /** - * 閫氳繃鐧诲綍鍦板潃/鐢ㄦ埛鍚嶇О鏌ヨ淇℃伅 - * - * @param ipaddr 鐧诲綍鍦板潃 - * @param userName 鐢ㄦ埛鍚嶇О - * @param user 鐢ㄦ埛淇℃伅 - * @return 鍦ㄧ嚎鐢ㄦ埛淇℃伅 - */ - @Override - public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user) - { - if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) - { - return loginUserToUserOnline(user); - } - return null; - } - - /** - * 璁剧疆鍦ㄧ嚎鐢ㄦ埛淇℃伅 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 鍦ㄧ嚎鐢ㄦ埛 - */ - @Override - public SysUserOnline loginUserToUserOnline(LoginUser user) - { - if (StringUtils.isNull(user)) - { - return null; - } - SysUserOnline sysUserOnline = new SysUserOnline(); - sysUserOnline.setTokenId(user.getToken()); - sysUserOnline.setUserName(user.getUsername()); - sysUserOnline.setIpaddr(user.getIpaddr()); - sysUserOnline.setLoginTime(user.getLoginTime()); - return sysUserOnline; - } -} diff --git a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java deleted file mode 100644 index a615548..0000000 --- a/aps-modules/aps-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ /dev/null @@ -1,551 +0,0 @@ -package com.ruoyi.system.service.impl; - -import java.util.ArrayList; -import java.util.List; -import java.util.stream.Collectors; -import jakarta.validation.Validator; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; -import com.aps.common.core.constant.UserConstants; -import com.aps.common.core.exception.ServiceException; -import com.aps.common.core.utils.SpringUtils; -import com.aps.common.core.utils.StringUtils; -import com.aps.common.core.utils.bean.BeanValidators; -import com.aps.common.datascope.annotation.DataScope; -import com.aps.common.security.utils.SecurityUtils; -import com.aps.system.api.domain.SysRole; -import com.aps.system.api.domain.SysUser; -import com.ruoyi.system.domain.SysPost; -import com.ruoyi.system.domain.SysUserPost; -import com.ruoyi.system.domain.SysUserRole; -import com.ruoyi.system.mapper.SysPostMapper; -import com.ruoyi.system.mapper.SysRoleMapper; -import com.ruoyi.system.mapper.SysUserMapper; -import com.ruoyi.system.mapper.SysUserPostMapper; -import com.ruoyi.system.mapper.SysUserRoleMapper; -import com.ruoyi.system.service.ISysConfigService; -import com.ruoyi.system.service.ISysDeptService; -import com.ruoyi.system.service.ISysUserService; - -/** - * 鐢ㄦ埛 涓氬姟灞傚鐞� - * - * @author ruoyi - */ -@Service -public class SysUserServiceImpl implements ISysUserService -{ - private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class); - - @Autowired - private SysUserMapper userMapper; - - @Autowired - private SysRoleMapper roleMapper; - - @Autowired - private SysPostMapper postMapper; - - @Autowired - private SysUserRoleMapper userRoleMapper; - - @Autowired - private SysUserPostMapper userPostMapper; - - @Autowired - private ISysConfigService configService; - - @Autowired - private ISysDeptService deptService; - - @Autowired - protected Validator validator; - - /** - * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ鐢ㄦ埛鍒楄〃 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 鐢ㄦ埛淇℃伅闆嗗悎淇℃伅 - */ - @Override - @DataScope(deptAlias = "d", userAlias = "u") - public List<SysUser> selectUserList(SysUser user) - { - return userMapper.selectUserList(user); - } - - /** - * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ宸插垎閰嶇敤鎴疯鑹插垪琛� - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 鐢ㄦ埛淇℃伅闆嗗悎淇℃伅 - */ - @Override - @DataScope(deptAlias = "d", userAlias = "u") - public List<SysUser> selectAllocatedList(SysUser user) - { - return userMapper.selectAllocatedList(user); - } - - /** - * 鏍规嵁鏉′欢鍒嗛〉鏌ヨ鏈垎閰嶇敤鎴疯鑹插垪琛� - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 鐢ㄦ埛淇℃伅闆嗗悎淇℃伅 - */ - @Override - @DataScope(deptAlias = "d", userAlias = "u") - public List<SysUser> selectUnallocatedList(SysUser user) - { - return userMapper.selectUnallocatedList(user); - } - - /** - * 閫氳繃鐢ㄦ埛鍚嶆煡璇㈢敤鎴� - * - * @param userName 鐢ㄦ埛鍚� - * @return 鐢ㄦ埛瀵硅薄淇℃伅 - */ - @Override - public SysUser selectUserByUserName(String userName) - { - return userMapper.selectUserByUserName(userName); - } - - /** - * 閫氳繃鐢ㄦ埛ID鏌ヨ鐢ㄦ埛 - * - * @param userId 鐢ㄦ埛ID - * @return 鐢ㄦ埛瀵硅薄淇℃伅 - */ - @Override - public SysUser selectUserById(Long userId) - { - return userMapper.selectUserById(userId); - } - - /** - * 鏌ヨ鐢ㄦ埛鎵�灞炶鑹茬粍 - * - * @param userName 鐢ㄦ埛鍚� - * @return 缁撴灉 - */ - @Override - public String selectUserRoleGroup(String userName) - { - List<SysRole> list = roleMapper.selectRolesByUserName(userName); - if (CollectionUtils.isEmpty(list)) - { - return StringUtils.EMPTY; - } - return list.stream().map(SysRole::getRoleName).collect(Collectors.joining(",")); - } - - /** - * 鏌ヨ鐢ㄦ埛鎵�灞炲矖浣嶇粍 - * - * @param userName 鐢ㄦ埛鍚� - * @return 缁撴灉 - */ - @Override - public String selectUserPostGroup(String userName) - { - List<SysPost> list = postMapper.selectPostsByUserName(userName); - if (CollectionUtils.isEmpty(list)) - { - return StringUtils.EMPTY; - } - return list.stream().map(SysPost::getPostName).collect(Collectors.joining(",")); - } - - /** - * 鏍¢獙鐢ㄦ埛鍚嶇О鏄惁鍞竴 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 缁撴灉 - */ - @Override - public boolean checkUserNameUnique(SysUser user) - { - Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); - SysUser info = userMapper.checkUserNameUnique(user.getUserName()); - if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 鏍¢獙鎵嬫満鍙风爜鏄惁鍞竴 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return - */ - @Override - public boolean checkPhoneUnique(SysUser user) - { - Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); - SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber()); - if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 鏍¢獙email鏄惁鍞竴 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return - */ - @Override - public boolean checkEmailUnique(SysUser user) - { - Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); - SysUser info = userMapper.checkEmailUnique(user.getEmail()); - if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) - { - return UserConstants.NOT_UNIQUE; - } - return UserConstants.UNIQUE; - } - - /** - * 鏍¢獙鐢ㄦ埛鏄惁鍏佽鎿嶄綔 - * - * @param user 鐢ㄦ埛淇℃伅 - */ - @Override - public void checkUserAllowed(SysUser user) - { - if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin()) - { - throw new ServiceException("涓嶅厑璁告搷浣滆秴绾х鐞嗗憳鐢ㄦ埛"); - } - } - - /** - * 鏍¢獙鐢ㄦ埛鏄惁鏈夋暟鎹潈闄� - * - * @param userId 鐢ㄦ埛id - */ - @Override - public void checkUserDataScope(Long userId) - { - if (!SysUser.isAdmin(SecurityUtils.getUserId())) - { - SysUser user = new SysUser(); - user.setUserId(userId); - List<SysUser> users = SpringUtils.getAopProxy(this).selectUserList(user); - if (StringUtils.isEmpty(users)) - { - throw new ServiceException("娌℃湁鏉冮檺璁块棶鐢ㄦ埛鏁版嵁锛�"); - } - } - } - - /** - * 鏂板淇濆瓨鐢ㄦ埛淇℃伅 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 缁撴灉 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public int insertUser(SysUser user) - { - // 鏂板鐢ㄦ埛淇℃伅 - int rows = userMapper.insertUser(user); - // 鏂板鐢ㄦ埛宀椾綅鍏宠仈 - insertUserPost(user); - // 鏂板鐢ㄦ埛涓庤鑹茬鐞� - insertUserRole(user); - return rows; - } - - /** - * 娉ㄥ唽鐢ㄦ埛淇℃伅 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 缁撴灉 - */ - @Override - public boolean registerUser(SysUser user) - { - return userMapper.insertUser(user) > 0; - } - - /** - * 淇敼淇濆瓨鐢ㄦ埛淇℃伅 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 缁撴灉 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public int updateUser(SysUser user) - { - Long userId = user.getUserId(); - // 鍒犻櫎鐢ㄦ埛涓庤鑹插叧鑱� - userRoleMapper.deleteUserRoleByUserId(userId); - // 鏂板鐢ㄦ埛涓庤鑹茬鐞� - insertUserRole(user); - // 鍒犻櫎鐢ㄦ埛涓庡矖浣嶅叧鑱� - userPostMapper.deleteUserPostByUserId(userId); - // 鏂板鐢ㄦ埛涓庡矖浣嶇鐞� - insertUserPost(user); - return userMapper.updateUser(user); - } - - /** - * 鐢ㄦ埛鎺堟潈瑙掕壊 - * - * @param userId 鐢ㄦ埛ID - * @param roleIds 瑙掕壊缁� - */ - @Override - @Transactional(rollbackFor = Exception.class) - public void insertUserAuth(Long userId, Long[] roleIds) - { - userRoleMapper.deleteUserRoleByUserId(userId); - insertUserRole(userId, roleIds); - } - - /** - * 淇敼鐢ㄦ埛鐘舵�� - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 缁撴灉 - */ - @Override - public int updateUserStatus(SysUser user) - { - return userMapper.updateUser(user); - } - - /** - * 淇敼鐢ㄦ埛鍩烘湰淇℃伅 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 缁撴灉 - */ - @Override - public boolean updateUserProfile(SysUser user) - { - return userMapper.updateUser(user) > 0; - } - - /** - * 淇敼鐢ㄦ埛澶村儚 - * - * @param userName 鐢ㄦ埛鍚� - * @param avatar 澶村儚鍦板潃 - * @return 缁撴灉 - */ - @Override - public boolean updateUserAvatar(String userName, String avatar) - { - return userMapper.updateUserAvatar(userName, avatar) > 0; - } - - /** - * 閲嶇疆鐢ㄦ埛瀵嗙爜 - * - * @param user 鐢ㄦ埛淇℃伅 - * @return 缁撴灉 - */ - @Override - public int resetPwd(SysUser user) - { - return userMapper.updateUser(user); - } - - /** - * 閲嶇疆鐢ㄦ埛瀵嗙爜 - * - * @param userName 鐢ㄦ埛鍚� - * @param password 瀵嗙爜 - * @return 缁撴灉 - */ - @Override - public int resetUserPwd(String userName, String password) - { - return userMapper.resetUserPwd(userName, password); - } - - /** - * 鏂板鐢ㄦ埛瑙掕壊淇℃伅 - * - * @param user 鐢ㄦ埛瀵硅薄 - */ - public void insertUserRole(SysUser user) - { - this.insertUserRole(user.getUserId(), user.getRoleIds()); - } - - /** - * 鏂板鐢ㄦ埛宀椾綅淇℃伅 - * - * @param user 鐢ㄦ埛瀵硅薄 - */ - public void insertUserPost(SysUser user) - { - Long[] posts = user.getPostIds(); - if (StringUtils.isNotEmpty(posts)) - { - // 鏂板鐢ㄦ埛涓庡矖浣嶇鐞� - List<SysUserPost> list = new ArrayList<SysUserPost>(); - for (Long postId : posts) - { - SysUserPost up = new SysUserPost(); - up.setUserId(user.getUserId()); - up.setPostId(postId); - list.add(up); - } - userPostMapper.batchUserPost(list); - } - } - - /** - * 鏂板鐢ㄦ埛瑙掕壊淇℃伅 - * - * @param userId 鐢ㄦ埛ID - * @param roleIds 瑙掕壊缁� - */ - public void insertUserRole(Long userId, Long[] roleIds) - { - if (StringUtils.isNotEmpty(roleIds)) - { - // 鏂板鐢ㄦ埛涓庤鑹茬鐞� - List<SysUserRole> list = new ArrayList<SysUserRole>(); - for (Long roleId : roleIds) - { - SysUserRole ur = new SysUserRole(); - ur.setUserId(userId); - ur.setRoleId(roleId); - list.add(ur); - } - userRoleMapper.batchUserRole(list); - } - } - - /** - * 閫氳繃鐢ㄦ埛ID鍒犻櫎鐢ㄦ埛 - * - * @param userId 鐢ㄦ埛ID - * @return 缁撴灉 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public int deleteUserById(Long userId) - { - // 鍒犻櫎鐢ㄦ埛涓庤鑹插叧鑱� - userRoleMapper.deleteUserRoleByUserId(userId); - // 鍒犻櫎鐢ㄦ埛涓庡矖浣嶈〃 - userPostMapper.deleteUserPostByUserId(userId); - return userMapper.deleteUserById(userId); - } - - /** - * 鎵归噺鍒犻櫎鐢ㄦ埛淇℃伅 - * - * @param userIds 闇�瑕佸垹闄ょ殑鐢ㄦ埛ID - * @return 缁撴灉 - */ - @Override - @Transactional(rollbackFor = Exception.class) - public int deleteUserByIds(Long[] userIds) - { - for (Long userId : userIds) - { - checkUserAllowed(new SysUser(userId)); - checkUserDataScope(userId); - } - // 鍒犻櫎鐢ㄦ埛涓庤鑹插叧鑱� - userRoleMapper.deleteUserRole(userIds); - // 鍒犻櫎鐢ㄦ埛涓庡矖浣嶅叧鑱� - userPostMapper.deleteUserPost(userIds); - return userMapper.deleteUserByIds(userIds); - } - - /** - * 瀵煎叆鐢ㄦ埛鏁版嵁 - * - * @param userList 鐢ㄦ埛鏁版嵁鍒楄〃 - * @param isUpdateSupport 鏄惁鏇存柊鏀寔锛屽鏋滃凡瀛樺湪锛屽垯杩涜鏇存柊鏁版嵁 - * @param operName 鎿嶄綔鐢ㄦ埛 - * @return 缁撴灉 - */ - @Override - public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName) - { - if (StringUtils.isNull(userList) || userList.size() == 0) - { - throw new ServiceException("瀵煎叆鐢ㄦ埛鏁版嵁涓嶈兘涓虹┖锛�"); - } - int successNum = 0; - int failureNum = 0; - StringBuilder successMsg = new StringBuilder(); - StringBuilder failureMsg = new StringBuilder(); - for (SysUser user : userList) - { - try - { - // 楠岃瘉鏄惁瀛樺湪杩欎釜鐢ㄦ埛 - SysUser u = userMapper.selectUserByUserName(user.getUserName()); - if (StringUtils.isNull(u)) - { - BeanValidators.validateWithException(validator, user); - deptService.checkDeptDataScope(user.getDeptId()); - String password = configService.selectConfigByKey("sys.user.initPassword"); - user.setPassword(SecurityUtils.encryptPassword(password)); - user.setCreateBy(operName); - userMapper.insertUser(user); - successNum++; - successMsg.append("<br/>" + successNum + "銆佽处鍙� " + user.getUserName() + " 瀵煎叆鎴愬姛"); - } - else if (isUpdateSupport) - { - BeanValidators.validateWithException(validator, user); - checkUserAllowed(u); - checkUserDataScope(u.getUserId()); - deptService.checkDeptDataScope(user.getDeptId()); - user.setUserId(u.getUserId()); - user.setUpdateBy(operName); - userMapper.updateUser(user); - successNum++; - successMsg.append("<br/>" + successNum + "銆佽处鍙� " + user.getUserName() + " 鏇存柊鎴愬姛"); - } - else - { - failureNum++; - failureMsg.append("<br/>" + failureNum + "銆佽处鍙� " + user.getUserName() + " 宸插瓨鍦�"); - } - } - catch (Exception e) - { - failureNum++; - String msg = "<br/>" + failureNum + "銆佽处鍙� " + user.getUserName() + " 瀵煎叆澶辫触锛�"; - failureMsg.append(msg + e.getMessage()); - log.error(msg, e); - } - } - if (failureNum > 0) - { - failureMsg.insert(0, "寰堟姳姝夛紝瀵煎叆澶辫触锛佸叡 " + failureNum + " 鏉℃暟鎹牸寮忎笉姝g‘锛岄敊璇涓嬶細"); - throw new ServiceException(failureMsg.toString()); - } - else - { - successMsg.insert(0, "鎭枩鎮紝鏁版嵁宸插叏閮ㄥ鍏ユ垚鍔燂紒鍏� " + successNum + " 鏉★紝鏁版嵁濡備笅锛�"); - } - return successMsg.toString(); - } - -} diff --git a/aps-visual/aps-monitor/src/main/java/com/ruoyi/modules/monitor/RuoYiMonitorApplication.java b/aps-visual/aps-monitor/src/main/java/com/ruoyi/modules/monitor/RuoYiMonitorApplication.java deleted file mode 100644 index 4ea0533..0000000 --- a/aps-visual/aps-monitor/src/main/java/com/ruoyi/modules/monitor/RuoYiMonitorApplication.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.ruoyi.modules.monitor; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import de.codecentric.boot.admin.server.config.EnableAdminServer; - -/** - * 鐩戞帶涓績 - * - * @author ruoyi - */ -@EnableAdminServer -@SpringBootApplication -public class RuoYiMonitorApplication -{ - public static void main(String[] args) - { - SpringApplication.run(RuoYiMonitorApplication.class, args); - System.out.println("(鈾モ棤鈥库棤)锞夛緸 鐩戞帶涓績鍚姩鎴愬姛 醿�(麓凇`醿�)锞� \n" + - " .-------. ____ __ \n" + - " | _ _ \\ \\ \\ / / \n" + - " | ( ' ) | \\ _. / ' \n" + - " |(_ o _) / _( )_ .' \n" + - " | (_,_).' __ ___(_ o _)' \n" + - " | |\\ \\ | || |(_,_)' \n" + - " | | \\ `' /| `-' / \n" + - " | | \\ / \\ / \n" + - " ''-' `'-' `-..-' "); - } -} diff --git a/aps-visual/aps-monitor/src/main/java/com/ruoyi/modules/monitor/config/WebSecurityConfigurer.java b/aps-visual/aps-monitor/src/main/java/com/ruoyi/modules/monitor/config/WebSecurityConfigurer.java deleted file mode 100644 index 2bd528b..0000000 --- a/aps-visual/aps-monitor/src/main/java/com/ruoyi/modules/monitor/config/WebSecurityConfigurer.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.ruoyi.modules.monitor.config; - -import de.codecentric.boot.admin.server.config.AdminServerProperties; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.security.config.Customizer; -import org.springframework.security.config.annotation.web.builders.HttpSecurity; -import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; -import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer; -import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer; -import org.springframework.security.web.SecurityFilterChain; -import org.springframework.security.web.authentication.SavedRequestAwareAuthenticationSuccessHandler; - -/** - * 鐩戞帶鏉冮檺閰嶇疆 - * - * @author ruoyi - */ -@EnableWebSecurity -@Configuration -public class WebSecurityConfigurer -{ - private final String adminContextPath; - - public WebSecurityConfigurer(AdminServerProperties adminServerProperties) - { - this.adminContextPath = adminServerProperties.getContextPath(); - } - - @Bean - public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception - { - SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler(); - successHandler.setTargetUrlParameter("redirectTo"); - successHandler.setDefaultTargetUrl(adminContextPath + "/"); - - return httpSecurity.headers((header) -> header.frameOptions(HeadersConfigurer.FrameOptionsConfig::disable)) - .authorizeHttpRequests( - (authorize) -> authorize - .requestMatchers(adminContextPath + "/assets/**", - adminContextPath + "/login", - adminContextPath + "/actuator/**", - adminContextPath + "/instances/**") - .permitAll() - .anyRequest() - .authenticated()) - .formLogin((formLogin) -> formLogin.loginPage(adminContextPath + "/login").successHandler(successHandler)) - .logout((logout) -> logout.logoutUrl(adminContextPath + "/logout")) - .httpBasic(Customizer.withDefaults()) - .csrf(AbstractHttpConfigurer::disable) - .build(); - } -} -- Gitblit v1.9.3