diff --git a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java b/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java deleted file mode 100644 index 9d82a2378..000000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/RuoYiServletInitializer.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.ruoyi; - -import org.springframework.boot.builder.SpringApplicationBuilder; -import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; - -/** - * web容器中进行部署 - * - * @author ruoyi - */ -public class RuoYiServletInitializer extends SpringBootServletInitializer -{ - @Override - protected SpringApplicationBuilder configure(SpringApplicationBuilder application) - { - return application.sources(RuoYiApplication.class); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java deleted file mode 100644 index 5dc5019e7..000000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictDataController.java +++ /dev/null @@ -1,120 +0,0 @@ -package com.ruoyi.web.controller.system; - -import java.util.ArrayList; -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.entity.SysDictData; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.system.service.ISysDictDataService; -import com.ruoyi.system.service.ISysDictTypeService; - -/** - * 数据字典信息 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/system/dict/data") -public class SysDictDataController extends BaseController -{ - @Autowired - private ISysDictDataService dictDataService; - - @Autowired - private ISysDictTypeService dictTypeService; - - @PreAuthorize("@ss.hasPermi('system:dict:list')") - @GetMapping("/list") - public TableDataInfo list(SysDictData dictData) - { - startPage(); - List list = dictDataService.selectDictDataList(dictData); - return getDataTable(list); - } - - @Log(title = "字典数据", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('system:dict:export')") - @GetMapping("/export") - public AjaxResult export(SysDictData dictData) - { - List list = dictDataService.selectDictDataList(dictData); - ExcelUtil util = new ExcelUtil(SysDictData.class); - return util.exportExcel(list, "字典数据"); - } - - /** - * 查询字典数据详细 - */ - @PreAuthorize("@ss.hasPermi('system:dict:query')") - @GetMapping(value = "/{dictCode}") - public AjaxResult getInfo(@PathVariable Long dictCode) - { - return AjaxResult.success(dictDataService.selectDictDataById(dictCode)); - } - - /** - * 根据字典类型查询字典数据信息 - */ - @GetMapping(value = "/type/{dictType}") - public AjaxResult dictType(@PathVariable String dictType) - { - List data = dictTypeService.selectDictDataByType(dictType); - if (StringUtils.isNull(data)) - { - data = new ArrayList(); - } - return AjaxResult.success(data); - } - - /** - * 新增字典类型 - */ - @PreAuthorize("@ss.hasPermi('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)); - } - - /** - * 修改保存字典类型 - */ - @PreAuthorize("@ss.hasPermi('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)); - } - - /** - * 删除字典类型 - */ - @PreAuthorize("@ss.hasPermi('system:dict:remove')") - @Log(title = "字典类型", businessType = BusinessType.DELETE) - @DeleteMapping("/{dictCodes}") - public AjaxResult remove(@PathVariable Long[] dictCodes) - { - return toAjax(dictDataService.deleteDictDataByIds(dictCodes)); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java deleted file mode 100644 index efde2d49f..000000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysDictTypeController.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.ruoyi.web.controller.system; - -import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.security.access.prepost.PreAuthorize; -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.ruoyi.common.annotation.Log; -import com.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.core.domain.entity.SysDictType; -import com.ruoyi.common.core.page.TableDataInfo; -import com.ruoyi.common.enums.BusinessType; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.poi.ExcelUtil; -import com.ruoyi.system.service.ISysDictTypeService; - -/** - * 数据字典信息 - * - * @author ruoyi - */ -@RestController -@RequestMapping("/system/dict/type") -public class SysDictTypeController extends BaseController -{ - @Autowired - private ISysDictTypeService dictTypeService; - - @PreAuthorize("@ss.hasPermi('system:dict:list')") - @GetMapping("/list") - public TableDataInfo list(SysDictType dictType) - { - startPage(); - List list = dictTypeService.selectDictTypeList(dictType); - return getDataTable(list); - } - - @Log(title = "字典类型", businessType = BusinessType.EXPORT) - @PreAuthorize("@ss.hasPermi('system:dict:export')") - @GetMapping("/export") - public AjaxResult export(SysDictType dictType) - { - List list = dictTypeService.selectDictTypeList(dictType); - ExcelUtil util = new ExcelUtil(SysDictType.class); - return util.exportExcel(list, "字典类型"); - } - - /** - * 查询字典类型详细 - */ - @PreAuthorize("@ss.hasPermi('system:dict:query')") - @GetMapping(value = "/{dictId}") - public AjaxResult getInfo(@PathVariable Long dictId) - { - return AjaxResult.success(dictTypeService.selectDictTypeById(dictId)); - } - - /** - * 新增字典类型 - */ - @PreAuthorize("@ss.hasPermi('system:dict:add')") - @Log(title = "字典类型", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@Validated @RequestBody SysDictType dict) - { - if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) - { - return AjaxResult.error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在"); - } - dict.setCreateBy(SecurityUtils.getUsername()); - return toAjax(dictTypeService.insertDictType(dict)); - } - - /** - * 修改字典类型 - */ - @PreAuthorize("@ss.hasPermi('system:dict:edit')") - @Log(title = "字典类型", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@Validated @RequestBody SysDictType dict) - { - if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) - { - return AjaxResult.error("修改字典'" + dict.getDictName() + "'失败,字典类型已存在"); - } - dict.setUpdateBy(SecurityUtils.getUsername()); - return toAjax(dictTypeService.updateDictType(dict)); - } - - /** - * 删除字典类型 - */ - @PreAuthorize("@ss.hasPermi('system:dict:remove')") - @Log(title = "字典类型", businessType = BusinessType.DELETE) - @DeleteMapping("/{dictIds}") - public AjaxResult remove(@PathVariable Long[] dictIds) - { - return toAjax(dictTypeService.deleteDictTypeByIds(dictIds)); - } - - /** - * 清空缓存 - */ - @PreAuthorize("@ss.hasPermi('system:dict:remove')") - @Log(title = "字典类型", businessType = BusinessType.CLEAN) - @DeleteMapping("/clearCache") - public AjaxResult clearCache() - { - dictTypeService.clearCache(); - return AjaxResult.success(); - } - - /** - * 获取字典选择框列表 - */ - @GetMapping("/optionselect") - public AjaxResult optionselect() - { - List dictTypes = dictTypeService.selectDictTypeAll(); - return AjaxResult.success(dictTypes); - } -} diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java deleted file mode 100644 index 2ae0c54ac..000000000 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/tool/TestController.java +++ /dev/null @@ -1,175 +0,0 @@ -package com.ruoyi.web.controller.tool; - -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -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.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import com.ruoyi.common.core.controller.BaseController; -import com.ruoyi.common.core.domain.AjaxResult; -import com.ruoyi.common.utils.StringUtils; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import io.swagger.annotations.ApiOperation; - -/** - * swagger 用户测试方法 - * - * @author ruoyi - */ -@Api("用户信息管理") -@RestController -@RequestMapping("/test/user") -public class TestController extends BaseController -{ - private final static Map users = new LinkedHashMap(); - { - users.put(1, new UserEntity(1, "admin", "admin123", "15888888888")); - users.put(2, new UserEntity(2, "ry", "admin123", "15666666666")); - } - - @ApiOperation("获取用户列表") - @GetMapping("/list") - public AjaxResult userList() - { - List userList = new ArrayList(users.values()); - return AjaxResult.success(userList); - } - - @ApiOperation("获取用户详细") - @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path") - @GetMapping("/{userId}") - public AjaxResult getUser(@PathVariable Integer userId) - { - if (!users.isEmpty() && users.containsKey(userId)) - { - return AjaxResult.success(users.get(userId)); - } - else - { - return AjaxResult.error("用户不存在"); - } - } - - @ApiOperation("新增用户") - @ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity") - @PostMapping("/save") - public AjaxResult save(UserEntity user) - { - if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) - { - return AjaxResult.error("用户ID不能为空"); - } - return AjaxResult.success(users.put(user.getUserId(), user)); - } - - @ApiOperation("更新用户") - @ApiImplicitParam(name = "userEntity", value = "新增用户信息", dataType = "UserEntity") - @PutMapping("/update") - public AjaxResult update(UserEntity user) - { - if (StringUtils.isNull(user) || StringUtils.isNull(user.getUserId())) - { - return AjaxResult.error("用户ID不能为空"); - } - if (users.isEmpty() || !users.containsKey(user.getUserId())) - { - return AjaxResult.error("用户不存在"); - } - users.remove(user.getUserId()); - return AjaxResult.success(users.put(user.getUserId(), user)); - } - - @ApiOperation("删除用户信息") - @ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path") - @DeleteMapping("/{userId}") - public AjaxResult delete(@PathVariable Integer userId) - { - if (!users.isEmpty() && users.containsKey(userId)) - { - users.remove(userId); - return AjaxResult.success(); - } - else - { - return AjaxResult.error("用户不存在"); - } - } -} - -@ApiModel("用户实体") -class UserEntity -{ - @ApiModelProperty("用户ID") - private Integer userId; - - @ApiModelProperty("用户名称") - private String username; - - @ApiModelProperty("用户密码") - private String password; - - @ApiModelProperty("用户手机") - private String mobile; - - public UserEntity() - { - - } - - public UserEntity(Integer userId, String username, String password, String mobile) - { - this.userId = userId; - this.username = username; - this.password = password; - this.mobile = mobile; - } - - public Integer getUserId() - { - return userId; - } - - public void setUserId(Integer userId) - { - this.userId = userId; - } - - public String getUsername() - { - return username; - } - - public void setUsername(String username) - { - this.username = username; - } - - public String getPassword() - { - return password; - } - - public void setPassword(String password) - { - this.password = password; - } - - public String getMobile() - { - return mobile; - } - - public void setMobile(String mobile) - { - this.mobile = mobile; - } -} diff --git a/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml b/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml deleted file mode 100644 index c7c36e375..000000000 --- a/ruoyi-admin/src/main/resources/mybatis/mybatis-config.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java deleted file mode 100644 index 031e15396..000000000 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysPermissionService.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.ruoyi.framework.web.service; - -import java.util.HashSet; -import java.util.Set; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.system.service.ISysMenuService; -import com.ruoyi.system.service.ISysRoleService; - -/** - * 用户权限处理 - * - * @author ruoyi - */ -@Component -public class SysPermissionService { - @Autowired - private ISysRoleService roleService; - - @Autowired - private ISysMenuService menuService; - - /** - * 获取角色数据权限 - * - * @param user 用户信息 - * @return 角色权限信息 - */ - public Set getRolePermission(SysUser user) { - Set roles = new HashSet(); - // 管理员拥有所有权限 - if (user.isAdmin()) { - roles.add("admin"); - } else { - roles.addAll(roleService.selectRolePermissionByUserId(user.getUserId())); - } - return roles; - } - - /** - * 获取菜单数据权限 - * - * @param user 用户信息 - * @return 菜单权限信息 - */ - public Set getMenuPermission(SysUser user) { - Set perms = new HashSet(); - // 管理员拥有所有权限 - if (user.isAdmin()) { - perms.add("*:*:*"); - } else { - perms.addAll(getMenuPermissionmenuService.selectMenuPermsByUserId(user.getUserId())); - } - return perms; - } -} diff --git a/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java b/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java index 4f4aea407..8872de3df 100644 --- a/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java +++ b/ruoyi-generator/src/main/java/com/ruoyi/generator/domain/GenTable.java @@ -10,7 +10,7 @@ import com.ruoyi.common.utils.StringUtils; /** * 业务表 gen_table - * + * * @author ruoyi */ public class GenTable extends BaseEntity @@ -86,206 +86,6 @@ public class GenTable extends BaseEntity /** 上级菜单名称字段 */ private String parentMenuName; - public Long getTableId() - { - return tableId; - } - - public void setTableId(Long tableId) - { - this.tableId = tableId; - } - - public String getTableName() - { - return tableName; - } - - public void setTableName(String tableName) - { - this.tableName = tableName; - } - - public String getTableComment() - { - return tableComment; - } - - public void setTableComment(String tableComment) - { - this.tableComment = tableComment; - } - - public String getClassName() - { - return className; - } - - public void setClassName(String className) - { - this.className = className; - } - - public String getTplCategory() - { - return tplCategory; - } - - public void setTplCategory(String tplCategory) - { - this.tplCategory = tplCategory; - } - - public String getPackageName() - { - return packageName; - } - - public void setPackageName(String packageName) - { - this.packageName = packageName; - } - - public String getModuleName() - { - return moduleName; - } - - public void setModuleName(String moduleName) - { - this.moduleName = moduleName; - } - - public String getBusinessName() - { - return businessName; - } - - public void setBusinessName(String businessName) - { - this.businessName = businessName; - } - - public String getFunctionName() - { - return functionName; - } - - public void setFunctionName(String functionName) - { - this.functionName = functionName; - } - - public String getFunctionAuthor() - { - return functionAuthor; - } - - public void setFunctionAuthor(String functionAuthor) - { - this.functionAuthor = functionAuthor; - } - - public String getGenType() - { - return genType; - } - - public void setGenType(String genType) - { - this.genType = genType; - } - - public String getGenPath() - { - return genPath; - } - - public void setGenPath(String genPath) - { - this.genPath = genPath; - } - - public GenTableColumn getPkColumn() - { - return pkColumn; - } - - public void setPkColumn(GenTableColumn pkColumn) - { - this.pkColumn = pkColumn; - } - - public List getColumns() - { - return columns; - } - - public void setColumns(List columns) - { - this.columns = columns; - } - - public String getOptions() - { - return options; - } - - public void setOptions(String options) - { - this.options = options; - } - - public String getTreeCode() - { - return treeCode; - } - - public void setTreeCode(String treeCode) - { - this.treeCode = treeCode; - } - - public String getTreeParentCode() - { - return treeParentCode; - } - - public void setTreeParentCode(String treeParentCode) - { - this.treeParentCode = treeParentCode; - } - - public String getTreeName() - { - return treeName; - } - - public void setTreeName(String treeName) - { - this.treeName = treeName; - } - - public String getParentMenuId() - { - return parentMenuId; - } - - public void setParentMenuId(String parentMenuId) - { - this.parentMenuId = parentMenuId; - } - - public String getParentMenuName() - { - return parentMenuName; - } - - public void setParentMenuName(String parentMenuName) - { - this.parentMenuName = parentMenuName; - } - public boolean isTree() { return isTree(this.tplCategory); @@ -320,4 +120,4 @@ public class GenTable extends BaseEntity } return StringUtils.equalsAnyIgnoreCase(javaField, GenConstants.BASE_ENTITY); } -} \ No newline at end of file +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java index 0c395f65b..847089b89 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysConfigMapper.java @@ -1,18 +1,18 @@ package com.ruoyi.system.mapper; import java.util.List; + import com.ruoyi.system.domain.SysConfig; /** * 参数配置 数据层 - * + * * @author ruoyi */ -public interface SysConfigMapper -{ +public interface SysConfigMapper { /** * 查询参数配置信息 - * + * * @param config 参数配置信息 * @return 参数配置信息 */ @@ -20,7 +20,7 @@ public interface SysConfigMapper /** * 查询参数配置列表 - * + * * @param config 参数配置信息 * @return 参数配置集合 */ @@ -28,7 +28,7 @@ public interface SysConfigMapper /** * 根据键名查询参数配置信息 - * + * * @param configKey 参数键名 * @return 参数配置信息 */ @@ -36,7 +36,7 @@ public interface SysConfigMapper /** * 新增参数配置 - * + * * @param config 参数配置信息 * @return 结果 */ @@ -44,7 +44,7 @@ public interface SysConfigMapper /** * 修改参数配置 - * + * * @param config 参数配置信息 * @return 结果 */ @@ -52,7 +52,7 @@ public interface SysConfigMapper /** * 删除参数配置 - * + * * @param configId 参数ID * @return 结果 */ @@ -60,7 +60,7 @@ public interface SysConfigMapper /** * 批量删除参数信息 - * + * * @param configIds 需要删除的参数ID * @return 结果 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java deleted file mode 100644 index cead65603..000000000 --- a/ruoyi-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.ruoyi.common.core.domain.entity.SysDept; - -/** - * 部门管理 数据层 - * - * @author ruoyi - */ -public interface SysDeptMapper -{ - /** - * 查询部门管理数据 - * - * @param dept 部门信息 - * @return 部门信息集合 - */ - public List selectDeptList(SysDept dept); - - /** - * 根据角色ID查询部门树信息 - * - * @param roleId 角色ID - * @param deptCheckStrictly 部门树选择项是否关联显示 - * @return 选中部门列表 - */ - public List 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 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 父部门ID - * @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 dept 部门 - */ - public void updateDeptStatus(SysDept dept); - - /** - * 修改子元素关系 - * - * @param depts 子元素 - * @return 结果 - */ - public int updateDeptChildren(@Param("depts") List depts); - - /** - * 删除部门管理信息 - * - * @param deptId 部门ID - * @return 结果 - */ - public int deleteDeptById(Long deptId); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictDataMapper.java deleted file mode 100644 index 92f799e55..000000000 --- a/ruoyi-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.ruoyi.common.core.domain.entity.SysDictData; - -/** - * 字典表 数据层 - * - * @author ruoyi - */ -public interface SysDictDataMapper -{ - /** - * 根据条件分页查询字典数据 - * - * @param dictData 字典数据信息 - * @return 字典数据集合信息 - */ - public List selectDictDataList(SysDictData dictData); - - /** - * 根据字典类型查询字典数据 - * - * @param dictType 字典类型 - * @return 字典数据集合信息 - */ - public List 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/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java deleted file mode 100644 index 81bc78090..000000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDictTypeMapper.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import org.apache.ibatis.annotations.Mapper; -import com.ruoyi.common.core.domain.entity.SysDictType; - -/** - * 字典表 数据层 - * - * @author ruoyi - */ -@Mapper -public interface SysDictTypeMapper -{ - /** - * 根据条件分页查询字典类型 - * - * @param dictType 字典类型信息 - * @return 字典类型集合信息 - */ - public List selectDictTypeList(SysDictType dictType); - - /** - * 根据所有字典类型 - * - * @return 字典类型集合信息 - */ - public List 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/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java index 480dd9ff6..490075e4a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysLogininforMapper.java @@ -1,25 +1,25 @@ package com.ruoyi.system.mapper; import java.util.List; + import com.ruoyi.system.domain.SysLogininfor; /** * 系统访问日志情况信息 数据层 - * + * * @author ruoyi */ -public interface SysLogininforMapper -{ +public interface SysLogininforMapper { /** * 新增系统登录日志 - * + * * @param logininfor 访问日志对象 */ public void insertLogininfor(SysLogininfor logininfor); /** * 查询系统登录日志集合 - * + * * @param logininfor 访问日志对象 * @return 登录记录集合 */ @@ -27,7 +27,7 @@ public interface SysLogininforMapper /** * 批量删除系统登录日志 - * + * * @param infoIds 需要删除的登录日志ID * @return 结果 */ @@ -35,7 +35,7 @@ public interface SysLogininforMapper /** * 清空系统登录日志 - * + * * @return 结果 */ public int cleanLogininfor(); diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java deleted file mode 100644 index 8aa59cfd1..000000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; - -import org.apache.ibatis.annotations.Param; -import com.ruoyi.common.core.domain.entity.SysMenu; - -/** - * 菜单表 数据层 - * - * @author ruoyi - */ -public interface SysMenuMapper { - - /** - * 根据用户查询系统菜单列表 - * - * @param menu 菜单信息 - * @return 菜单列表 - */ - public List selectMenuListByUserId(SysMenu menu); - - /** - * 根据用户ID查询权限 - * - * @param userId 用户ID - * @return 权限列表 - */ - public List selectMenuPermsByUserId(Long userId); - - /** - * 根据用户ID查询菜单 - * - * @return 菜单列表 - */ - public List selectMenuTreeAll(); - - /** - * 根据用户ID查询菜单 - * - * @param userId 用户ID - * @return 菜单列表 - */ - public List selectMenuTreeByUserId(Long userId); - - /** - * 根据角色ID查询菜单树信息 - * - * @param roleId 角色ID - * @param menuCheckStrictly 菜单树选择项是否关联显示 - * @return 选中菜单列表 - */ - public List selectMenuListByRoleId(@Param("roleId") Long roleId, @Param("menuCheckStrictly") boolean menuCheckStrictly); - -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java index cc267ac0c..7eda069b4 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysNoticeMapper.java @@ -1,18 +1,18 @@ package com.ruoyi.system.mapper; import java.util.List; + import com.ruoyi.system.domain.SysNotice; /** * 通知公告表 数据层 - * + * * @author ruoyi */ -public interface SysNoticeMapper -{ +public interface SysNoticeMapper { /** * 查询公告信息 - * + * * @param noticeId 公告ID * @return 公告信息 */ @@ -20,7 +20,7 @@ public interface SysNoticeMapper /** * 查询公告列表 - * + * * @param notice 公告信息 * @return 公告集合 */ @@ -28,7 +28,7 @@ public interface SysNoticeMapper /** * 新增公告 - * + * * @param notice 公告信息 * @return 结果 */ @@ -36,7 +36,7 @@ public interface SysNoticeMapper /** * 修改公告 - * + * * @param notice 公告信息 * @return 结果 */ @@ -44,7 +44,7 @@ public interface SysNoticeMapper /** * 批量删除公告 - * + * * @param noticeId 公告ID * @return 结果 */ @@ -52,7 +52,7 @@ public interface SysNoticeMapper /** * 批量删除公告信息 - * + * * @param noticeIds 需要删除的公告ID * @return 结果 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java index 3bf69bb8e..f7d60d594 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysOperLogMapper.java @@ -1,25 +1,25 @@ package com.ruoyi.system.mapper; import java.util.List; + import com.ruoyi.system.domain.SysOperLog; /** * 操作日志 数据层 - * + * * @author ruoyi */ -public interface SysOperLogMapper -{ +public interface SysOperLogMapper { /** * 新增操作日志 - * + * * @param operLog 操作日志对象 */ public void insertOperlog(SysOperLog operLog); /** * 查询系统操作日志集合 - * + * * @param operLog 操作日志对象 * @return 操作日志集合 */ @@ -27,7 +27,7 @@ public interface SysOperLogMapper /** * 批量删除系统操作日志 - * + * * @param operIds 需要删除的操作日志ID * @return 结果 */ @@ -35,7 +35,7 @@ public interface SysOperLogMapper /** * 查询操作日志详细 - * + * * @param operId 操作ID * @return 操作日志对象 */ diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysPostMapper.java deleted file mode 100644 index a98326f8b..000000000 --- a/ruoyi-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 selectPostList(SysPost post); - - /** - * 查询所有岗位 - * - * @return 岗位列表 - */ - public List selectPostAll(); - - /** - * 通过岗位ID查询岗位信息 - * - * @param postId 岗位ID - * @return 角色对象信息 - */ - public SysPost selectPostById(Long postId); - - /** - * 根据用户ID获取岗位选择框列表 - * - * @param userId 用户ID - * @return 选中岗位ID列表 - */ - public List selectPostListByUserId(Long userId); - - /** - * 查询用户所属岗位组 - * - * @param userName 用户名 - * @return 结果 - */ - public List 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/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleDeptMapper.java deleted file mode 100644 index a4ad4de24..000000000 --- a/ruoyi-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 roleDeptList); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java deleted file mode 100644 index 0bfacdc01..000000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; - -import com.ruoyi.common.core.domain.entity.SysRole; - -/** - * 角色表 数据层 - * - * @author ruoyi - */ -public interface SysRoleMapper { - - /** - * 根据条件分页查询角色数据 - * - * @param role 角色信息 - * @return 角色数据集合信息 - */ - public List selectRoleList(SysRole role); - - /** - * 根据用户ID查询角色 - * - * @param userId 用户ID - * @return 角色列表 - */ - public List selectRolePermissionByUserId(Long userId); - - /** - * 根据用户ID获取角色选择框列表 - * - * @param userId 用户ID - * @return 选中角色ID列表 - */ - public List selectRoleListByUserId(Long userId); - - /** - * 根据用户ID查询角色 - * - * @param userName 用户名 - * @return 角色列表 - */ - public List selectRolesByUserName(String userName); - -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java deleted file mode 100644 index cb621c9f8..000000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.ruoyi.system.mapper; - -import java.util.List; -import org.apache.ibatis.annotations.Param; -import com.ruoyi.common.core.domain.entity.SysUser; - -/** - * 用户表 数据层 - * - * @author ruoyi - */ -public interface SysUserMapper -{ - /** - * 根据条件分页查询用户列表 - * - * @param sysUser 用户信息 - * @return 用户信息集合信息 - */ - public List selectUserList(SysUser sysUser); - -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserPostMapper.java deleted file mode 100644 index 9c33e546d..000000000 --- a/ruoyi-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 userPostList); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java deleted file mode 100644 index 5fe8956be..000000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.ruoyi.system.service; - -import java.util.List; -import com.ruoyi.common.core.domain.entity.SysDictData; - -/** - * 字典 业务层 - * - * @author ruoyi - */ -public interface ISysDictDataService -{ - /** - * 根据条件分页查询字典数据 - * - * @param dictData 字典数据信息 - * @return 字典数据集合信息 - */ - public List 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 - * @return 结果 - */ - public int deleteDictDataByIds(Long[] dictCodes); - - /** - * 新增保存字典数据信息 - * - * @param dictData 字典数据信息 - * @return 结果 - */ - public int insertDictData(SysDictData dictData); - - /** - * 修改保存字典数据信息 - * - * @param dictData 字典数据信息 - * @return 结果 - */ - public int updateDictData(SysDictData dictData); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java deleted file mode 100644 index 3603d896d..000000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysDictTypeService.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.ruoyi.system.service; - -import java.util.List; -import com.ruoyi.common.core.domain.entity.SysDictData; -import com.ruoyi.common.core.domain.entity.SysDictType; - -/** - * 字典 业务层 - * - * @author ruoyi - */ -public interface ISysDictTypeService -{ - /** - * 根据条件分页查询字典类型 - * - * @param dictType 字典类型信息 - * @return 字典类型集合信息 - */ - public List selectDictTypeList(SysDictType dictType); - - /** - * 根据所有字典类型 - * - * @return 字典类型集合信息 - */ - public List selectDictTypeAll(); - - /** - * 根据字典类型查询字典数据 - * - * @param dictType 字典类型 - * @return 字典数据集合信息 - */ - public List selectDictDataByType(String dictType); - - /** - * 根据字典类型ID查询信息 - * - * @param dictId 字典类型ID - * @return 字典类型 - */ - public SysDictType selectDictTypeById(Long dictId); - - /** - * 根据字典类型查询信息 - * - * @param dictType 字典类型 - * @return 字典类型 - */ - public SysDictType selectDictTypeByType(String dictType); - - /** - * 批量删除字典信息 - * - * @param dictIds 需要删除的字典ID - * @return 结果 - */ - public int deleteDictTypeByIds(Long[] dictIds); - - /** - * 清空缓存数据 - */ - public void clearCache(); - - /** - * 新增保存字典类型信息 - * - * @param dictType 字典类型信息 - * @return 结果 - */ - public int insertDictType(SysDictType dictType); - - /** - * 修改保存字典类型信息 - * - * @param dictType 字典类型信息 - * @return 结果 - */ - public int updateDictType(SysDictType dictType); - - /** - * 校验字典类型称是否唯一 - * - * @param dictType 字典类型 - * @return 结果 - */ - public String checkDictTypeUnique(SysDictType dictType); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java deleted file mode 100644 index b377067e4..000000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysMenuService.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.ruoyi.system.service; - -import java.util.List; -import java.util.Set; -import com.ruoyi.common.core.domain.TreeSelect; -import com.ruoyi.common.core.domain.entity.SysMenu; -import com.ruoyi.system.domain.vo.RouterVo; - -/** - * 菜单 业务层 - * - * @author ruoyi - */ -public interface ISysMenuService -{ - /** - * 根据用户查询系统菜单列表 - * - * @param userId 用户ID - * @return 菜单列表 - */ - public List selectMenuList(Long userId); - - /** - * 根据用户查询系统菜单列表 - * - * @param menu 菜单信息 - * @param userId 用户ID - * @return 菜单列表 - */ - public List selectMenuList(SysMenu menu, Long userId); - - /** - * 根据用户ID查询权限 - * - * @param userId 用户ID - * @return 权限列表 - */ - public Set selectMenuPermsByUserId(Long userId); - - /** - * 查询菜单是否存在角色 - * - * @param menuId 菜单ID - * @return 结果 true 存在 false 不存在 - */ - public boolean checkMenuExistRole(Long menuId); - -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java deleted file mode 100644 index 2fb9a540d..000000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysPostService.java +++ /dev/null @@ -1,100 +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 selectPostList(SysPost post); - - /** - * 查询所有岗位 - * - * @return 岗位列表 - */ - public List selectPostAll(); - - /** - * 通过岗位ID查询岗位信息 - * - * @param postId 岗位ID - * @return 角色对象信息 - */ - public SysPost selectPostById(Long postId); - - /** - * 根据用户ID获取岗位选择框列表 - * - * @param userId 用户ID - * @return 选中岗位ID列表 - */ - public List selectPostListByUserId(Long userId); - - /** - * 校验岗位名称 - * - * @param post 岗位信息 - * @return 结果 - */ - public String checkPostNameUnique(SysPost post); - - /** - * 校验岗位编码 - * - * @param post 岗位信息 - * @return 结果 - */ - public String 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 结果 - * @throws Exception 异常 - */ - public int deletePostByIds(Long[] postIds); - - /** - * 新增保存岗位信息 - * - * @param post 岗位信息 - * @return 结果 - */ - public int insertPost(SysPost post); - - /** - * 修改保存岗位信息 - * - * @param post 岗位信息 - * @return 结果 - */ - public int updatePost(SysPost post); -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java deleted file mode 100644 index 96c91591e..000000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysRoleService.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.ruoyi.system.service; - -import java.util.List; -import java.util.Set; - -import com.ruoyi.common.core.domain.entity.SysRole; - -/** - * 角色业务层 - * - * @author ruoyi - */ -public interface ISysRoleService { - - /** - * 根据用户ID查询角色 - * - * @param userId 用户ID - * @return 权限列表 - */ - public Set selectRolePermissionByUserId(Long userId); - - /** - * 修改数据权限信息 - * - * @param role 角色信息 - * @return 结果 - */ - public int authDataScope(SysRole role); - -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java index f1e2f29f6..68b39f86f 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysConfigServiceImpl.java @@ -3,6 +3,7 @@ package com.ruoyi.system.service.impl; import java.util.Collection; import java.util.List; import javax.annotation.PostConstruct; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.common.annotation.DataSource; @@ -19,12 +20,11 @@ import com.ruoyi.system.service.ISysConfigService; /** * 参数配置 服务层实现 - * + * * @author ruoyi */ @Service -public class SysConfigServiceImpl implements ISysConfigService -{ +public class SysConfigServiceImpl implements ISysConfigService { @Autowired private SysConfigMapper configMapper; @@ -35,25 +35,22 @@ public class SysConfigServiceImpl implements ISysConfigService * 项目启动时,初始化参数到缓存 */ @PostConstruct - public void init() - { + public void init() { List configsList = configMapper.selectConfigList(new SysConfig()); - for (SysConfig config : configsList) - { + for (SysConfig config : configsList) { redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); } } /** * 查询参数配置信息 - * + * * @param configId 参数配置ID * @return 参数配置信息 */ @Override @DataSource(DataSourceType.MASTER) - public SysConfig selectConfigById(Long configId) - { + public SysConfig selectConfigById(Long configId) { SysConfig config = new SysConfig(); config.setConfigId(configId); return configMapper.selectConfig(config); @@ -61,23 +58,20 @@ public class SysConfigServiceImpl implements ISysConfigService /** * 根据键名查询参数配置信息 - * + * * @param configKey 参数key * @return 参数键值 */ @Override - public String selectConfigByKey(String configKey) - { + public String selectConfigByKey(String configKey) { String configValue = Convert.toStr(redisCache.getCacheObject(getCacheKey(configKey))); - if (StringUtils.isNotEmpty(configValue)) - { + if (StringUtils.isNotEmpty(configValue)) { return configValue; } SysConfig config = new SysConfig(); config.setConfigKey(configKey); SysConfig retConfig = configMapper.selectConfig(config); - if (StringUtils.isNotNull(retConfig)) - { + if (StringUtils.isNotNull(retConfig)) { redisCache.setCacheObject(getCacheKey(configKey), retConfig.getConfigValue()); return retConfig.getConfigValue(); } @@ -86,28 +80,25 @@ public class SysConfigServiceImpl implements ISysConfigService /** * 查询参数配置列表 - * + * * @param config 参数配置信息 * @return 参数配置集合 */ @Override - public List selectConfigList(SysConfig config) - { + public List selectConfigList(SysConfig config) { return configMapper.selectConfigList(config); } /** * 新增参数配置 - * + * * @param config 参数配置信息 * @return 结果 */ @Override - public int insertConfig(SysConfig config) - { + public int insertConfig(SysConfig config) { int row = configMapper.insertConfig(config); - if (row > 0) - { + if (row > 0) { redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); } return row; @@ -115,16 +106,14 @@ public class SysConfigServiceImpl implements ISysConfigService /** * 修改参数配置 - * + * * @param config 参数配置信息 * @return 结果 */ @Override - public int updateConfig(SysConfig config) - { + public int updateConfig(SysConfig config) { int row = configMapper.updateConfig(config); - if (row > 0) - { + if (row > 0) { redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue()); } return row; @@ -132,24 +121,20 @@ public class SysConfigServiceImpl implements ISysConfigService /** * 批量删除参数信息 - * + * * @param configIds 需要删除的参数ID * @return 结果 */ @Override - public int deleteConfigByIds(Long[] configIds) - { - for (Long configId : configIds) - { + public int deleteConfigByIds(Long[] configIds) { + for (Long configId : configIds) { SysConfig config = selectConfigById(configId); - if (StringUtils.equals(UserConstants.YES, config.getConfigType())) - { + if (StringUtils.equals(UserConstants.YES, config.getConfigType())) { throw new CustomException(String.format("内置参数【%1$s】不能删除 ", config.getConfigKey())); } } int count = configMapper.deleteConfigByIds(configIds); - if (count > 0) - { + if (count > 0) { Collection keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*"); redisCache.deleteObject(keys); } @@ -160,25 +145,22 @@ public class SysConfigServiceImpl implements ISysConfigService * 清空缓存数据 */ @Override - public void clearCache() - { + public void clearCache() { Collection keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*"); redisCache.deleteObject(keys); } /** * 校验参数键名是否唯一 - * + * * @param config 参数配置信息 * @return 结果 */ @Override - public String checkConfigKeyUnique(SysConfig config) - { + public String 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()) - { + if (StringUtils.isNotNull(info) && info.getConfigId().longValue() != configId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; @@ -186,12 +168,11 @@ public class SysConfigServiceImpl implements ISysConfigService /** * 设置cache key - * + * * @param configKey 参数键 * @return 缓存键key */ - private String getCacheKey(String configKey) - { + private String getCacheKey(String configKey) { return Constants.SYS_CONFIG_KEY + configKey; } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java index 39d950531..3034b9025 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java @@ -1,6 +1,7 @@ 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.common.core.domain.entity.SysDictData; @@ -10,64 +11,59 @@ import com.ruoyi.system.service.ISysDictDataService; /** * 字典 业务层处理 - * + * * @author ruoyi */ @Service -public class SysDictDataServiceImpl implements ISysDictDataService -{ +public class SysDictDataServiceImpl implements ISysDictDataService { + @Autowired private SysDictDataMapper dictDataMapper; /** * 根据条件分页查询字典数据 - * + * * @param dictData 字典数据信息 * @return 字典数据集合信息 */ @Override - public List selectDictDataList(SysDictData dictData) - { + public List selectDictDataList(SysDictData dictData) { return dictDataMapper.selectDictDataList(dictData); } /** * 根据字典类型和字典键值查询字典数据信息 - * - * @param dictType 字典类型 + * + * @param dictType 字典类型 * @param dictValue 字典键值 * @return 字典标签 */ @Override - public String selectDictLabel(String dictType, String dictValue) - { + public String selectDictLabel(String dictType, String dictValue) { return dictDataMapper.selectDictLabel(dictType, dictValue); } /** * 根据字典数据ID查询信息 - * + * * @param dictCode 字典数据ID * @return 字典数据 */ @Override - public SysDictData selectDictDataById(Long dictCode) - { + public SysDictData selectDictDataById(Long dictCode) { return dictDataMapper.selectDictDataById(dictCode); } /** * 批量删除字典数据信息 - * + * * @param dictCodes 需要删除的字典数据ID * @return 结果 */ @Override - public int deleteDictDataByIds(Long[] dictCodes) - { + public int deleteDictDataByIds(Long[] dictCodes) { int row = dictDataMapper.deleteDictDataByIds(dictCodes); - if (row > 0) - { + if (row > 0) { DictUtils.clearDictCache(); } return row; @@ -75,16 +71,14 @@ public class SysDictDataServiceImpl implements ISysDictDataService /** * 新增保存字典数据信息 - * + * * @param dictData 字典数据信息 * @return 结果 */ @Override - public int insertDictData(SysDictData dictData) - { + public int insertDictData(SysDictData dictData) { int row = dictDataMapper.insertDictData(dictData); - if (row > 0) - { + if (row > 0) { DictUtils.clearDictCache(); } return row; @@ -92,16 +86,14 @@ public class SysDictDataServiceImpl implements ISysDictDataService /** * 修改保存字典数据信息 - * + * * @param dictData 字典数据信息 * @return 结果 */ @Override - public int updateDictData(SysDictData dictData) - { + public int updateDictData(SysDictData dictData) { int row = dictDataMapper.updateDictData(dictData); - if (row > 0) - { + if (row > 0) { DictUtils.clearDictCache(); } return row; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java index 2db4341b4..5cbd0f0ae 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDictTypeServiceImpl.java @@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl; import java.util.List; import javax.annotation.PostConstruct; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -17,12 +18,11 @@ import com.ruoyi.system.service.ISysDictTypeService; /** * 字典 业务层处理 - * + * * @author ruoyi */ @Service -public class SysDictTypeServiceImpl implements ISysDictTypeService -{ +public class SysDictTypeServiceImpl implements ISysDictTypeService { @Autowired private SysDictTypeMapper dictTypeMapper; @@ -33,11 +33,9 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService * 项目启动时,初始化字典到缓存 */ @PostConstruct - public void init() - { + public void init() { List dictTypeList = dictTypeMapper.selectDictTypeAll(); - for (SysDictType dictType : dictTypeList) - { + for (SysDictType dictType : dictTypeList) { List dictDatas = dictDataMapper.selectDictDataByType(dictType.getDictType()); DictUtils.setDictCache(dictType.getDictType(), dictDatas); } @@ -45,44 +43,39 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService /** * 根据条件分页查询字典类型 - * + * * @param dictType 字典类型信息 * @return 字典类型集合信息 */ @Override - public List selectDictTypeList(SysDictType dictType) - { + public List selectDictTypeList(SysDictType dictType) { return dictTypeMapper.selectDictTypeList(dictType); } /** * 根据所有字典类型 - * + * * @return 字典类型集合信息 */ @Override - public List selectDictTypeAll() - { + public List selectDictTypeAll() { return dictTypeMapper.selectDictTypeAll(); } /** * 根据字典类型查询字典数据 - * + * * @param dictType 字典类型 * @return 字典数据集合信息 */ @Override - public List selectDictDataByType(String dictType) - { + public List selectDictDataByType(String dictType) { List dictDatas = DictUtils.getDictCache(dictType); - if (StringUtils.isNotEmpty(dictDatas)) - { + if (StringUtils.isNotEmpty(dictDatas)) { return dictDatas; } dictDatas = dictDataMapper.selectDictDataByType(dictType); - if (StringUtils.isNotEmpty(dictDatas)) - { + if (StringUtils.isNotEmpty(dictDatas)) { DictUtils.setDictCache(dictType, dictDatas); return dictDatas; } @@ -91,74 +84,58 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService /** * 根据字典类型ID查询信息 - * + * * @param dictId 字典类型ID * @return 字典类型 */ @Override - public SysDictType selectDictTypeById(Long dictId) - { + public SysDictType selectDictTypeById(Long dictId) { return dictTypeMapper.selectDictTypeById(dictId); } /** * 根据字典类型查询信息 - * + * * @param dictType 字典类型 * @return 字典类型 */ @Override - public SysDictType selectDictTypeByType(String dictType) - { + public SysDictType selectDictTypeByType(String dictType) { return dictTypeMapper.selectDictTypeByType(dictType); } /** * 批量删除字典类型信息 - * + * * @param dictIds 需要删除的字典ID * @return 结果 */ @Override - public int deleteDictTypeByIds(Long[] dictIds) - { - for (Long dictId : dictIds) - { + public int deleteDictTypeByIds(Long[] dictIds) { + for (Long dictId : dictIds) { SysDictType dictType = selectDictTypeById(dictId); - if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) - { + if (dictDataMapper.countDictDataByType(dictType.getDictType()) > 0) { throw new CustomException(String.format("%1$s已分配,不能删除", dictType.getDictName())); } } int count = dictTypeMapper.deleteDictTypeByIds(dictIds); - if (count > 0) - { + if (count > 0) { DictUtils.clearDictCache(); } return count; } - /** - * 清空缓存数据 - */ - @Override - public void clearCache() - { - DictUtils.clearDictCache(); - } /** * 新增保存字典类型信息 - * + * * @param dictType 字典类型信息 * @return 结果 */ @Override - public int insertDictType(SysDictType dictType) - { + public int insertDictType(SysDictType dictType) { int row = dictTypeMapper.insertDictType(dictType); - if (row > 0) - { + if (row > 0) { DictUtils.clearDictCache(); } return row; @@ -166,19 +143,17 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService /** * 修改保存字典类型信息 - * + * * @param dictType 字典类型信息 * @return 结果 */ @Override @Transactional - public int updateDictType(SysDictType dictType) - { + public int updateDictType(SysDictType dictType) { SysDictType oldDict = dictTypeMapper.selectDictTypeById(dictType.getDictId()); dictDataMapper.updateDictDataType(oldDict.getDictType(), dictType.getDictType()); int row = dictTypeMapper.updateDictType(dictType); - if (row > 0) - { + if (row > 0) { DictUtils.clearDictCache(); } return row; @@ -186,17 +161,15 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService /** * 校验字典类型称是否唯一 - * + * * @param dict 字典类型 * @return 结果 */ @Override - public String checkDictTypeUnique(SysDictType dict) - { + public String 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()) - { + if (StringUtils.isNotNull(dictType) && dictType.getDictId().longValue() != dictId.longValue()) { return UserConstants.NOT_UNIQUE; } return UserConstants.UNIQUE; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java index f69fd1aff..3bb99530c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysLogininforServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.system.service.impl; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.domain.SysLogininfor; @@ -9,48 +10,44 @@ import com.ruoyi.system.service.ISysLogininforService; /** * 系统访问日志情况信息 服务层处理 - * + * * @author ruoyi */ @Service -public class SysLogininforServiceImpl implements ISysLogininforService -{ +public class SysLogininforServiceImpl implements ISysLogininforService { @Autowired private SysLogininforMapper logininforMapper; /** * 新增系统登录日志 - * + * * @param logininfor 访问日志对象 */ @Override - public void insertLogininfor(SysLogininfor logininfor) - { + public void insertLogininfor(SysLogininfor logininfor) { logininforMapper.insertLogininfor(logininfor); } /** * 查询系统登录日志集合 - * + * * @param logininfor 访问日志对象 * @return 登录记录集合 */ @Override - public List selectLogininforList(SysLogininfor logininfor) - { + public List selectLogininforList(SysLogininfor logininfor) { return logininforMapper.selectLogininforList(logininfor); } /** * 批量删除系统登录日志 - * + * * @param infoIds 需要删除的登录日志ID * @return */ @Override - public int deleteLogininforByIds(Long[] infoIds) - { + public int deleteLogininforByIds(Long[] infoIds) { return logininforMapper.deleteLogininforByIds(infoIds); } @@ -58,8 +55,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService * 清空系统登录日志 */ @Override - public void cleanLogininfor() - { + public void cleanLogininfor() { logininforMapper.cleanLogininfor(); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java deleted file mode 100644 index d0fffefed..000000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java +++ /dev/null @@ -1,101 +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.ruoyi.common.constant.UserConstants; -import com.ruoyi.common.core.domain.TreeSelect; -import com.ruoyi.common.core.domain.entity.SysMenu; -import com.ruoyi.common.core.domain.entity.SysRole; -import com.ruoyi.common.core.domain.entity.SysUser; -import com.ruoyi.common.utils.SecurityUtils; -import com.ruoyi.common.utils.StringUtils; -import com.ruoyi.system.domain.vo.MetaVo; -import com.ruoyi.system.domain.vo.RouterVo; -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 { - - /** - * 根据用户查询系统菜单列表 - * - * @param userId 用户ID - * @return 菜单列表 - */ - @Override - public List selectMenuList(Long userId) { - return selectMenuList(new SysMenu(), userId); - } - - /** - * 查询系统菜单列表 - * - * @param menu 菜单信息 - * @return 菜单列表 - */ - @Override - public List selectMenuList(SysMenu menu, Long userId) { - List 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 selectMenuPermsByUserId(Long userId) { - List perms = menuMapper.selectMenuPermsByUserId(userId); - Set 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 selectMenuTreeByUserId(Long userId) { - List menus = null; - if (SecurityUtils.isAdmin(userId)) { - menus = menuMapper.selectMenuTreeAll(); - } else { - menus = menuMapper.selectMenuTreeByUserId(userId); - } - return getChildPerms(menus, 0); - } - -} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java index 8bebd9c69..0f049f66b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysNoticeServiceImpl.java @@ -1,6 +1,7 @@ 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; @@ -9,84 +10,77 @@ import com.ruoyi.system.service.ISysNoticeService; /** * 公告 服务层实现 - * + * * @author ruoyi */ @Service -public class SysNoticeServiceImpl implements ISysNoticeService -{ +public class SysNoticeServiceImpl implements ISysNoticeService { @Autowired private SysNoticeMapper noticeMapper; /** * 查询公告信息 - * + * * @param noticeId 公告ID * @return 公告信息 */ @Override - public SysNotice selectNoticeById(Long noticeId) - { + public SysNotice selectNoticeById(Long noticeId) { return noticeMapper.selectNoticeById(noticeId); } /** * 查询公告列表 - * + * * @param notice 公告信息 * @return 公告集合 */ @Override - public List selectNoticeList(SysNotice notice) - { + public List selectNoticeList(SysNotice notice) { return noticeMapper.selectNoticeList(notice); } /** * 新增公告 - * + * * @param notice 公告信息 * @return 结果 */ @Override - public int insertNotice(SysNotice notice) - { + public int insertNotice(SysNotice notice) { return noticeMapper.insertNotice(notice); } /** * 修改公告 - * + * * @param notice 公告信息 * @return 结果 */ @Override - public int updateNotice(SysNotice notice) - { + public int updateNotice(SysNotice notice) { return noticeMapper.updateNotice(notice); } /** * 删除公告对象 - * + * * @param noticeId 公告ID * @return 结果 */ @Override - public int deleteNoticeById(Long noticeId) - { + public int deleteNoticeById(Long noticeId) { return noticeMapper.deleteNoticeById(noticeId); } /** * 批量删除公告信息 - * + * * @param noticeIds 需要删除的公告ID * @return 结果 */ @Override - public int deleteNoticeByIds(Long[] noticeIds) - { + public int deleteNoticeByIds(Long[] noticeIds) { return noticeMapper.deleteNoticeByIds(noticeIds); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java index 785ee1ed7..bfedc6af5 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysOperLogServiceImpl.java @@ -1,6 +1,7 @@ package com.ruoyi.system.service.impl; import java.util.List; + import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.system.domain.SysOperLog; @@ -9,59 +10,54 @@ import com.ruoyi.system.service.ISysOperLogService; /** * 操作日志 服务层处理 - * + * * @author ruoyi */ @Service -public class SysOperLogServiceImpl implements ISysOperLogService -{ +public class SysOperLogServiceImpl implements ISysOperLogService { @Autowired private SysOperLogMapper operLogMapper; /** * 新增操作日志 - * + * * @param operLog 操作日志对象 */ @Override - public void insertOperlog(SysOperLog operLog) - { + public void insertOperlog(SysOperLog operLog) { operLogMapper.insertOperlog(operLog); } /** * 查询系统操作日志集合 - * + * * @param operLog 操作日志对象 * @return 操作日志集合 */ @Override - public List selectOperLogList(SysOperLog operLog) - { + public List selectOperLogList(SysOperLog operLog) { return operLogMapper.selectOperLogList(operLog); } /** * 批量删除系统操作日志 - * + * * @param operIds 需要删除的操作日志ID * @return 结果 */ @Override - public int deleteOperLogByIds(Long[] operIds) - { + public int deleteOperLogByIds(Long[] operIds) { return operLogMapper.deleteOperLogByIds(operIds); } /** * 查询操作日志详细 - * + * * @param operId 操作ID * @return 操作日志对象 */ @Override - public SysOperLog selectOperLogById(Long operId) - { + public SysOperLog selectOperLogById(Long operId) { return operLogMapper.selectOperLogById(operId); } @@ -69,8 +65,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService * 清空操作日志 */ @Override - public void cleanOperLog() - { + public void cleanOperLog() { operLogMapper.cleanOperLog(); } } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java deleted file mode 100644 index 127ed3fbd..000000000 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysPostServiceImpl.java +++ /dev/null @@ -1,179 +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.common.constant.UserConstants; -import com.ruoyi.common.exception.CustomException; -import com.ruoyi.common.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 selectPostList(SysPost post) - { - return postMapper.selectPostList(post); - } - - /** - * 查询所有岗位 - * - * @return 岗位列表 - */ - @Override - public List 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 selectPostListByUserId(Long userId) - { - return postMapper.selectPostListByUserId(userId); - } - - /** - * 校验岗位名称是否唯一 - * - * @param post 岗位信息 - * @return 结果 - */ - @Override - public String 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 String 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 结果 - * @throws Exception 异常 - */ - @Override - public int deletePostByIds(Long[] postIds) - { - for (Long postId : postIds) - { - SysPost post = selectPostById(postId); - if (countUserPostById(postId) > 0) - { - throw new CustomException(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/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java index 347837bc5..c07bfd4f9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserOnlineServiceImpl.java @@ -8,24 +8,21 @@ import com.ruoyi.system.service.ISysUserOnlineService; /** * 在线用户 服务层处理 - * + * * @author ruoyi */ @Service -public class SysUserOnlineServiceImpl implements ISysUserOnlineService -{ +public class SysUserOnlineServiceImpl implements ISysUserOnlineService { /** * 通过登录地址查询信息 - * + * * @param ipaddr 登录地址 - * @param user 用户信息 + * @param user 用户信息 * @return 在线用户信息 */ @Override - public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user) - { - if (StringUtils.equals(ipaddr, user.getIpaddr())) - { + public SysUserOnline selectOnlineByIpaddr(String ipaddr, LoginUser user) { + if (StringUtils.equals(ipaddr, user.getIpaddr())) { return loginUserToUserOnline(user); } return null; @@ -33,16 +30,14 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService /** * 通过用户名称查询信息 - * + * * @param userName 用户名称 - * @param user 用户信息 + * @param user 用户信息 * @return 在线用户信息 */ @Override - public SysUserOnline selectOnlineByUserName(String userName, LoginUser user) - { - if (StringUtils.equals(userName, user.getUsername())) - { + public SysUserOnline selectOnlineByUserName(String userName, LoginUser user) { + if (StringUtils.equals(userName, user.getUsername())) { return loginUserToUserOnline(user); } return null; @@ -50,17 +45,15 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService /** * 通过登录地址/用户名称查询信息 - * - * @param ipaddr 登录地址 + * + * @param ipaddr 登录地址 * @param userName 用户名称 - * @param user 用户信息 + * @param user 用户信息 * @return 在线用户信息 */ @Override - public SysUserOnline selectOnlineByInfo(String ipaddr, String userName, LoginUser user) - { - if (StringUtils.equals(ipaddr, user.getIpaddr()) && StringUtils.equals(userName, user.getUsername())) - { + 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; @@ -68,15 +61,13 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService /** * 设置在线用户信息 - * + * * @param user 用户信息 * @return 在线用户 */ @Override - public SysUserOnline loginUserToUserOnline(LoginUser user) - { - if (StringUtils.isNull(user) || StringUtils.isNull(user.getUser())) - { + public SysUserOnline loginUserToUserOnline(LoginUser user) { + if (StringUtils.isNull(user) || StringUtils.isNull(user.getUser())) { return null; } SysUserOnline sysUserOnline = new SysUserOnline(); @@ -87,8 +78,7 @@ public class SysUserOnlineServiceImpl implements ISysUserOnlineService sysUserOnline.setBrowser(user.getBrowser()); sysUserOnline.setOs(user.getOs()); sysUserOnline.setLoginTime(user.getLoginTime()); - if (StringUtils.isNotNull(user.getUser().getDept())) - { + if (StringUtils.isNotNull(user.getUser().getDept())) { sysUserOnline.setDeptName(user.getUser().getDept().getDeptName()); } return sysUserOnline; diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml deleted file mode 100644 index cdc26f4e2..000000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ /dev/null @@ -1,157 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time - from sys_dept d - - - - - - - - - - - - - - - - - - - - insert into sys_dept( - dept_id, - parent_id, - dept_name, - ancestors, - order_num, - leader, - phone, - email, - status, - create_by, - create_time - )values( - #{deptId}, - #{parentId}, - #{deptName}, - #{ancestors}, - #{orderNum}, - #{leader}, - #{phone}, - #{email}, - #{status}, - #{createBy}, - sysdate() - ) - - - - update sys_dept - - parent_id = #{parentId}, - dept_name = #{deptName}, - ancestors = #{ancestors}, - order_num = #{orderNum}, - leader = #{leader}, - phone = #{phone}, - email = #{email}, - status = #{status}, - update_by = #{updateBy}, - update_time = sysdate() - - where dept_id = #{deptId} - - - - update sys_dept set ancestors = - - when #{item.deptId} then #{item.ancestors} - - where dept_id in - - #{item.deptId} - - - - - update sys_dept - - status = #{status}, - update_by = #{updateBy}, - update_time = sysdate() - - where dept_id in (${ancestors}) - - - - update sys_dept set del_flag = '2' where dept_id = #{deptId} - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml deleted file mode 100644 index 75d80a157..000000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysDictDataMapper.xml +++ /dev/null @@ -1,124 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark - from sys_dict_data - - - - - - - - - - - - - - delete from sys_dict_data where dict_code = #{dictCode} - - - - delete from sys_dict_data where dict_code in - - #{dictCode} - - - - - update sys_dict_data - - dict_sort = #{dictSort}, - dict_label = #{dictLabel}, - dict_value = #{dictValue}, - dict_type = #{dictType}, - css_class = #{cssClass}, - list_class = #{listClass}, - is_default = #{isDefault}, - status = #{status}, - remark = #{remark}, - update_by = #{updateBy}, - update_time = sysdate() - - where dict_code = #{dictCode} - - - - update sys_dict_data set dict_type = #{newDictType} where dict_type = #{oldDictType} - - - - insert into sys_dict_data( - dict_sort, - dict_label, - dict_value, - dict_type, - css_class, - list_class, - is_default, - status, - remark, - create_by, - create_time - )values( - #{dictSort}, - #{dictLabel}, - #{dictValue}, - #{dictType}, - #{cssClass}, - #{listClass}, - #{isDefault}, - #{status}, - #{remark}, - #{createBy}, - sysdate() - ) - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml deleted file mode 100644 index 2b44b2eee..000000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysDictTypeMapper.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - - - - - - - - - - - - - - - select dict_id, dict_name, dict_type, status, create_by, create_time, remark - from sys_dict_type - - - - - - - - - - - - - - delete from sys_dict_type where dict_id = #{dictId} - - - - delete from sys_dict_type where dict_id in - - #{dictId} - - - - - update sys_dict_type - - dict_name = #{dictName}, - dict_type = #{dictType}, - status = #{status}, - remark = #{remark}, - update_by = #{updateBy}, - update_time = sysdate() - - where dict_id = #{dictId} - - - - insert into sys_dict_type( - dict_name, - dict_type, - status, - remark, - create_by, - create_time - )values( - #{dictName}, - #{dictType}, - #{status}, - #{remark}, - #{createBy}, - sysdate() - ) - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml deleted file mode 100644 index 8fed327f5..000000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml deleted file mode 100644 index 6ac8e7c36..000000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysPostMapper.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - - - - - - select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark - from sys_post - - - - - - - - - - - - - - - - - - update sys_post - - post_code = #{postCode}, - post_name = #{postName}, - post_sort = #{postSort}, - status = #{status}, - remark = #{remark}, - update_by = #{updateBy}, - update_time = sysdate() - - where post_id = #{postId} - - - - insert into sys_post( - post_id, - post_code, - post_name, - post_sort, - status, - remark, - create_by, - create_time - )values( - #{postId}, - #{postCode}, - #{postName}, - #{postSort}, - #{status}, - #{remark}, - #{createBy}, - sysdate() - ) - - - - delete from sys_post where post_id = #{postId} - - - - delete from sys_post where post_id in - - #{postId} - - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml deleted file mode 100644 index 700671e15..000000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysRoleDeptMapper.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - delete from sys_role_dept where role_id=#{roleId} - - - - - - delete from sys_role_dept where role_id in - - #{roleId} - - - - - insert into sys_role_dept(role_id, dept_id) values - - (#{item.roleId},#{item.deptId}) - - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml deleted file mode 100644 index 0a8bc70a2..000000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.menu_check_strictly, r.dept_check_strictly, - r.status, r.del_flag, r.create_time, r.remark - from sys_role r - left join sys_user_role ur on ur.role_id = r.role_id - left join sys_user u on u.user_id = ur.user_id - left join sys_dept d on u.dept_id = d.dept_id - - - - - - - - - - - - - - - - - - - - insert into sys_role( - role_id, - role_name, - role_key, - role_sort, - data_scope, - menu_check_strictly, - dept_check_strictly, - status, - remark, - create_by, - create_time - )values( - #{roleId}, - #{roleName}, - #{roleKey}, - #{roleSort}, - #{dataScope}, - #{menuCheckStrictly}, - #{deptCheckStrictly}, - #{status}, - #{remark}, - #{createBy}, - sysdate() - ) - - - - update sys_role - - role_name = #{roleName}, - role_key = #{roleKey}, - role_sort = #{roleSort}, - data_scope = #{dataScope}, - menu_check_strictly = #{menuCheckStrictly}, - dept_check_strictly = #{deptCheckStrictly}, - status = #{status}, - remark = #{remark}, - update_by = #{updateBy}, - update_time = sysdate() - - where role_id = #{roleId} - - - - update sys_user set status = #{status} where user_id = #{userId} - - - - delete from sys_role where role_id = #{roleId} - - - - update sys_role set del_flag = '2' where role_id in - - #{roleId} - - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml deleted file mode 100644 index 3fc344879..000000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, - d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status, - r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status - from sys_user u - left join sys_dept d on u.dept_id = d.dept_id - left join sys_user_role ur on u.user_id = ur.user_id - left join sys_role r on r.role_id = ur.role_id - - - - - - - - - - - - - - - - insert into sys_user( - user_id, - dept_id, - user_name, - nick_name, - email, - avatar, - phonenumber, - sex, - password, - status, - create_by, - remark, - create_time - )values( - #{userId}, - #{deptId}, - #{userName}, - #{nickName}, - #{email}, - #{avatar}, - #{phonenumber}, - #{sex}, - #{password}, - #{status}, - #{createBy}, - #{remark}, - sysdate() - ) - - - - update sys_user - - dept_id = #{deptId}, - user_name = #{userName}, - nick_name = #{nickName}, - email = #{email}, - phonenumber = #{phonenumber}, - sex = #{sex}, - avatar = #{avatar}, - password = #{password}, - status = #{status}, - login_ip = #{loginIp}, - login_date = #{loginDate}, - update_by = #{updateBy}, - remark = #{remark}, - update_time = sysdate() - - where user_id = #{userId} - - - - update sys_user set status = #{status} where user_id = #{userId} - - - - update sys_user set avatar = #{avatar} where user_name = #{userName} - - - - update sys_user set password = #{password} where user_name = #{userName} - - - - delete from sys_user where user_id = #{userId} - - - - update sys_user set del_flag = '2' where user_id in - - #{userId} - - - - \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml deleted file mode 100644 index 21c40981b..000000000 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - delete from sys_user_post where user_id=#{userId} - - - - - - delete from sys_user_post where user_id in - - #{userId} - - - - - insert into sys_user_post(user_id, post_id) values - - (#{item.userId},#{item.postId}) - - - - \ No newline at end of file diff --git a/src/main/java/cn/iocoder/dashboard/framework/dict/core/service/DictDataFrameworkService.java b/src/main/java/cn/iocoder/dashboard/framework/dict/core/service/DictDataFrameworkService.java new file mode 100644 index 000000000..ec4eb4a5b --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/framework/dict/core/service/DictDataFrameworkService.java @@ -0,0 +1,35 @@ +package cn.iocoder.dashboard.framework.dict.core.service; + +import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO; + +import java.util.List; + +public interface DictDataFrameworkService { + + /** + * 获得指定的字典数据,从缓存中 + * + * @param type 字典类型 + * @param value 字典数据值 + * @return 字典数据 + */ + SysDictDataDO getDictDataFromCache(String type, String value); + + /** + * 解析获得指定的字典数据,从缓存中 + * + * @param type 字典类型 + * @param label 字典数据标签 + * @return 字典数据 + */ + SysDictDataDO parseDictDataFromCache(String type, String label); + + /** + * 获得指定类型的字典数据,从缓存中 + * + * @param type 字典类型 + * @return 字典数据列表 + */ + List listDictDatasFromCache(String type); + +} diff --git a/src/main/java/cn/iocoder/dashboard/framework/dict/core/util/DictUtils.java b/src/main/java/cn/iocoder/dashboard/framework/dict/core/util/DictUtils.java new file mode 100644 index 000000000..6e8fe2164 --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/framework/dict/core/util/DictUtils.java @@ -0,0 +1,19 @@ +package cn.iocoder.dashboard.framework.dict.core.util; + +import cn.iocoder.dashboard.framework.dict.core.service.DictDataFrameworkService; +import lombok.extern.slf4j.Slf4j; + +/** + * 字典工具类 + */ +@Slf4j +public class DictUtils { + + private static DictDataFrameworkService service; + + public static void init(DictDataFrameworkService service) { + DictUtils.service = service; + log.info("[init][初始化 DictUtils 成功]"); + } + +} diff --git a/src/main/java/cn/iocoder/dashboard/framework/dict/package-info.java b/src/main/java/cn/iocoder/dashboard/framework/dict/package-info.java new file mode 100644 index 000000000..753975d54 --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/framework/dict/package-info.java @@ -0,0 +1,6 @@ +/** + * 字典数据模块 + * + * 通过将字典缓存在内存中,保证性能 + */ +package cn.iocoder.dashboard.framework.dict; diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/SysDictDataController.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/SysDictDataController.java index 6a816589e..bc81bfdf1 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/SysDictDataController.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/SysDictDataController.java @@ -1,7 +1,7 @@ package cn.iocoder.dashboard.modules.system.controller.dict; import cn.iocoder.dashboard.common.pojo.CommonResult; -import cn.iocoder.dashboard.modules.system.controller.dict.vo.SysDataDictSimpleVO; +import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDataDictSimpleVO; import cn.iocoder.dashboard.modules.system.convert.dict.SysDictDataConvert; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO; import cn.iocoder.dashboard.modules.system.service.dict.SysDictDataService; @@ -16,7 +16,7 @@ import java.util.List; import static cn.iocoder.dashboard.common.pojo.CommonResult.success; -@Api(tags = "数据字典 API") +@Api(tags = "字典数据 API") @RestController @RequestMapping("/system/dict-data") public class SysDictDataController { @@ -32,4 +32,74 @@ public class SysDictDataController { return success(SysDictDataConvert.INSTANCE.convertList(list)); } +// @PreAuthorize("@ss.hasPermi('system:dict:list')") +// @GetMapping("/list") +// public TableDataInfo list(SysDictData dictData) { +// startPage(); +// List list = dictDataService.selectDictDataList(dictData); +// return getDataTable(list); +// } +// +// @Log(title = "字典数据", businessType = BusinessType.EXPORT) +// @PreAuthorize("@ss.hasPermi('system:dict:export')") +// @GetMapping("/export") +// public AjaxResult export(SysDictData dictData) { +// List list = dictDataService.selectDictDataList(dictData); +// ExcelUtil util = new ExcelUtil(SysDictData.class); +// return util.exportExcel(list, "字典数据"); +// } +// +// /** +// * 查询字典数据详细 +// */ +// @PreAuthorize("@ss.hasPermi('system:dict:query')") +// @GetMapping(value = "/{dictCode}") +// public AjaxResult getInfo(@PathVariable Long dictCode) { +// return AjaxResult.success(dictDataService.selectDictDataById(dictCode)); +// } +// +// /** +// * 根据字典类型查询字典数据信息 +// */ +// @GetMapping(value = "/type/{dictType}") +// public AjaxResult dictType(@PathVariable String dictType) { +// List data = dictTypeService.selectDictDataByType(dictType); +// if (StringUtils.isNull(data)) { +// data = new ArrayList(); +// } +// return AjaxResult.success(data); +// } +// +// /** +// * 新增字典类型 +// */ +// @PreAuthorize("@ss.hasPermi('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)); +// } +// +// /** +// * 修改保存字典类型 +// */ +// @PreAuthorize("@ss.hasPermi('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)); +// } +// +// /** +// * 删除字典类型 +// */ +// @PreAuthorize("@ss.hasPermi('system:dict:remove')") +// @Log(title = "字典类型", businessType = BusinessType.DELETE) +// @DeleteMapping("/{dictCodes}") +// public AjaxResult remove(@PathVariable Long[] dictCodes) { +// return toAjax(dictDataService.deleteDictDataByIds(dictCodes)); +// } + } diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/SysDictTypeController.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/SysDictTypeController.java new file mode 100644 index 000000000..f4c077c07 --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/SysDictTypeController.java @@ -0,0 +1,91 @@ +package cn.iocoder.dashboard.modules.system.controller.dict; + +import cn.iocoder.dashboard.common.pojo.CommonResult; +import cn.iocoder.dashboard.common.pojo.PageResult; +import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeCreateReqVO; +import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypePageReqVO; +import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeRespVO; +import cn.iocoder.dashboard.modules.system.controller.user.vo.user.SysUserUpdateReqVO; +import cn.iocoder.dashboard.modules.system.convert.dict.SysDictTypeConvert; +import cn.iocoder.dashboard.modules.system.service.dict.SysDictTypeService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +import static cn.iocoder.dashboard.common.pojo.CommonResult.success; + +@Api(tags = "字典类型 API") +@RestController +@RequestMapping("/system/dict-type") +public class SysDictTypeController { + + @Resource + private SysDictTypeService dictTypeService; + + @ApiOperation("/page") + @GetMapping("/list") +// @PreAuthorize("@ss.hasPermi('system:dict:list')") + public CommonResult> pageDictTypes(@Validated SysDictTypePageReqVO reqVO) { + return success(SysDictTypeConvert.INSTANCE.convertPage(dictTypeService.pageDictTypes(reqVO))); + } + + @ApiOperation("/查询字典详细") + @ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024") + @GetMapping(value = "/get") +// @PreAuthorize("@ss.hasPermi('system:dict:query')") + public CommonResult getDictType(@RequestParam("id") Long id) { + return success(SysDictTypeConvert.INSTANCE.convert(dictTypeService.getDictType(id))); + } + + @ApiOperation("新增字典类型") + @PostMapping("/create") +// @PreAuthorize("@ss.hasPermi('system:dict:add')") +// @Log(title = "字典类型", businessType = BusinessType.INSERT) + public CommonResult createDictType(@Validated @RequestBody SysDictTypeCreateReqVO reqVO) { + Long dictTypeId = dictTypeService.createDictType(reqVO); + return success(dictTypeId); + } + + @ApiOperation("修改字典类型") + @PostMapping("update") +// @PreAuthorize("@ss.hasPermi('system:dict:edit')") +// @Log(title = "字典类型", businessType = BusinessType.UPDATE) + public CommonResult updateDictType(@Validated @RequestBody SysUserUpdateReqVO reqVO) { + dictTypeService.updateDictType(reqVO); + return success(true); + } + + @ApiOperation("删除字典类型") + @ApiImplicitParam(name = "id", value = "编号", readOnly = true, example = "1024") + @PostMapping("/delete") +// @PreAuthorize("@ss.hasPermi('system:dict:remove')") + public CommonResult deleteDictType(Long id) { + dictTypeService.deleteDictType(id); + return success(true); + } + + +// /** +// * 获取字典选择框列表 +// */ +// @GetMapping("/optionselect") +// public AjaxResult optionselect() { +// List dictTypes = dictTypeService.selectDictTypeAll(); +// return AjaxResult.success(dictTypes); +// } + + // +// @Log(title = "字典类型", businessType = BusinessType.EXPORT) +// @PreAuthorize("@ss.hasPermi('system:dict:export')") +// @GetMapping("/export") +// public AjaxResult export(SysDictType dictType) { +// List list = dictTypeService.selectDictTypeList(dictType); +// ExcelUtil util = new ExcelUtil(SysDictType.class); +// return util.exportExcel(list, "字典类型"); +// } + +} diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/SysDataDictSimpleVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/data/SysDataDictSimpleVO.java similarity index 88% rename from src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/SysDataDictSimpleVO.java rename to src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/data/SysDataDictSimpleVO.java index 41da3b9c3..7b6e57aa0 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/SysDataDictSimpleVO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/data/SysDataDictSimpleVO.java @@ -1,4 +1,4 @@ -package cn.iocoder.dashboard.modules.system.controller.dict.vo; +package cn.iocoder.dashboard.modules.system.controller.dict.vo.data; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeBaseVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeBaseVO.java new file mode 100644 index 000000000..2f71f99e5 --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeBaseVO.java @@ -0,0 +1,32 @@ +package cn.iocoder.dashboard.modules.system.controller.dict.vo.type; + +import cn.iocoder.dashboard.framework.excel.Excel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Size; + +/** + * 字典类型 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ +@Data +public class SysDictTypeBaseVO { + + @ApiModelProperty(value = "字典名称", required = true, example = "性别") + @NotBlank(message = "字典名称不能为空") + @Size(max = 100, message = "字典类型名称长度不能超过100个字符") + private String name; + + @ApiModelProperty(value = "字典类型", required = true, example = "sys_common_sex") + @NotBlank(message = "字典类型不能为空") + @Size(max = 100, message = "字典类型类型长度不能超过100个字符") + private String type; + + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举类") + @NotBlank(message = "状态不能为空") + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private Integer status; + +} diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeCreateReqVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeCreateReqVO.java new file mode 100644 index 000000000..a3b88f2e4 --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeCreateReqVO.java @@ -0,0 +1,11 @@ +package cn.iocoder.dashboard.modules.system.controller.dict.vo.type; + +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.EqualsAndHashCode; + +@ApiModel("字典类型创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +public class SysDictTypeCreateReqVO extends SysDictTypeBaseVO { +} diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeExcelRespVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeExcelRespVO.java new file mode 100644 index 000000000..e25e994eb --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeExcelRespVO.java @@ -0,0 +1,24 @@ +package cn.iocoder.dashboard.modules.system.controller.dict.vo.type; + +import cn.iocoder.dashboard.framework.excel.Excel; +import lombok.Data; + +/** + * 字典类型 Excel 导出响应 VO + */ +@Data +public class SysDictTypeExcelRespVO { + + @Excel(name = "字典主键", cellType = Excel.ColumnType.NUMERIC) + private Long id; + + @Excel(name = "字典名称") + private String name; + + @Excel(name = "字典类型") + private String type; + + @Excel(name = "状态", readConverterExp = "0=正常,1=停用") + private Integer status; + +} diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypePageReqVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypePageReqVO.java new file mode 100644 index 000000000..ffbf904b0 --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypePageReqVO.java @@ -0,0 +1,17 @@ +package cn.iocoder.dashboard.modules.system.controller.dict.vo.type; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@ApiModel("字典类型分页列表 Request VO") +@Data +public class SysDictTypePageReqVO { + + @ApiModelProperty(value = "字典类型名称", example = "芋道", notes = "模糊匹配") + private String name; + + @ApiModelProperty(value = "展示状态", example = "1", notes = "参见 SysCommonStatusEnum 枚举类") + private Integer status; + +} diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeRespVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeRespVO.java new file mode 100644 index 000000000..280b28e40 --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeRespVO.java @@ -0,0 +1,25 @@ +package cn.iocoder.dashboard.modules.system.controller.dict.vo.type; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +import java.util.Date; + +@ApiModel("字典类型信息 Response VO") +@Data +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class SysDictTypeRespVO extends SysDictTypeBaseVO { + + @ApiModelProperty(value = "字典类型编号", required = true, example = "1024") + private Integer id; + + @ApiModelProperty(value = "创建时间", required = true, example = "时间戳格式") + private Date createTime; + +} diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeSimpleRespVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeSimpleRespVO.java new file mode 100644 index 000000000..13580a4cf --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeSimpleRespVO.java @@ -0,0 +1,21 @@ +package cn.iocoder.dashboard.modules.system.controller.dict.vo.type; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@ApiModel("字典类型精简信息 Response VO") +@Data +@NoArgsConstructor +@AllArgsConstructor +public class SysDictTypeSimpleRespVO { + + @ApiModelProperty(value = "字典类型编号", required = true, example = "1024") + private Integer id; + + @ApiModelProperty(value = "字典类型名称", required = true, example = "芋道") + private String name; + +} diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeUpdateReqVO.java b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeUpdateReqVO.java new file mode 100644 index 000000000..d77995220 --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/system/controller/dict/vo/type/SysDictTypeUpdateReqVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.dashboard.modules.system.controller.dict.vo.type; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import javax.validation.constraints.NotNull; + +@ApiModel("字典类型更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +public class SysDictTypeUpdateReqVO extends SysDictTypeBaseVO { + + @ApiModelProperty(value = "字典类型编号", required = true, example = "1024") + @NotNull(message = "字典类型编号不能为空") + private Long id; + +} diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/convert/dict/SysDictDataConvert.java b/src/main/java/cn/iocoder/dashboard/modules/system/convert/dict/SysDictDataConvert.java index 923bcbc59..b2a12e4e4 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/convert/dict/SysDictDataConvert.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/convert/dict/SysDictDataConvert.java @@ -1,6 +1,6 @@ package cn.iocoder.dashboard.modules.system.convert.dict; -import cn.iocoder.dashboard.modules.system.controller.dict.vo.SysDataDictSimpleVO; +import cn.iocoder.dashboard.modules.system.controller.dict.vo.data.SysDataDictSimpleVO; import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictDataDO; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/convert/dict/SysDictTypeConvert.java b/src/main/java/cn/iocoder/dashboard/modules/system/convert/dict/SysDictTypeConvert.java new file mode 100644 index 000000000..96fe80724 --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/system/convert/dict/SysDictTypeConvert.java @@ -0,0 +1,18 @@ +package cn.iocoder.dashboard.modules.system.convert.dict; + +import cn.iocoder.dashboard.common.pojo.PageResult; +import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeRespVO; +import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictTypeDO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface SysDictTypeConvert { + + SysDictTypeConvert INSTANCE = Mappers.getMapper(SysDictTypeConvert.class); + + PageResult convertPage(PageResult bean); + + SysDictTypeRespVO convert(SysDictTypeDO bean); + +} diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/dal/mysql/dataobject/dict/SysDictTypeDO.java b/src/main/java/cn/iocoder/dashboard/modules/system/dal/mysql/dataobject/dict/SysDictTypeDO.java index b0ef43fb1..f4bf5a249 100644 --- a/src/main/java/cn/iocoder/dashboard/modules/system/dal/mysql/dataobject/dict/SysDictTypeDO.java +++ b/src/main/java/cn/iocoder/dashboard/modules/system/dal/mysql/dataobject/dict/SysDictTypeDO.java @@ -1,7 +1,6 @@ package cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict; import cn.iocoder.dashboard.common.enums.CommonStatusEnum; -import cn.iocoder.dashboard.framework.excel.Excel; import cn.iocoder.dashboard.framework.mybatis.core.dataobject.BaseDO; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; @@ -9,9 +8,6 @@ import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import lombok.EqualsAndHashCode; -import javax.validation.constraints.NotBlank; -import javax.validation.constraints.Size; - /** * 字典类型表 * @@ -26,29 +22,21 @@ public class SysDictTypeDO extends BaseDO { * 字典主键 */ @TableId - @Excel(name = "字典主键", cellType = Excel.ColumnType.NUMERIC) private Long id; /** * 字典名称 */ - @Excel(name = "字典名称") - @NotBlank(message = "字典名称不能为空") - @Size(max = 100, message = "字典类型名称长度不能超过100个字符") private String name; /** * 字典类型 */ @TableField("dict_type") - @Excel(name = "字典类型") - @NotBlank(message = "字典类型不能为空") - @Size(max = 100, message = "字典类型类型长度不能超过100个字符") private String type; /** * 状态 * * 枚举 {@link CommonStatusEnum} */ - @Excel(name = "状态", readConverterExp = "0=正常,1=停用") private Integer status; } diff --git a/src/main/java/cn/iocoder/dashboard/modules/system/service/dict/SysDictTypeService.java b/src/main/java/cn/iocoder/dashboard/modules/system/service/dict/SysDictTypeService.java new file mode 100644 index 000000000..7fd6c944d --- /dev/null +++ b/src/main/java/cn/iocoder/dashboard/modules/system/service/dict/SysDictTypeService.java @@ -0,0 +1,26 @@ +package cn.iocoder.dashboard.modules.system.service.dict; + +import cn.iocoder.dashboard.common.pojo.PageResult; +import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypeCreateReqVO; +import cn.iocoder.dashboard.modules.system.controller.dict.vo.type.SysDictTypePageReqVO; +import cn.iocoder.dashboard.modules.system.controller.user.vo.user.SysUserUpdateReqVO; +import cn.iocoder.dashboard.modules.system.dal.mysql.dataobject.dict.SysDictTypeDO; + +/** + * 字典类型 Service 接口 + * + * @author 芋道源码 + */ +public interface SysDictTypeService { + + PageResult pageDictTypes(SysDictTypePageReqVO reqVO); + + SysDictTypeDO getDictType(Long id); + + Long createDictType(SysDictTypeCreateReqVO reqVO); + + void updateDictType(SysUserUpdateReqVO reqVO); + + void deleteDictType(Long id); + +}