com.ruoyi.common.enums.BusinessType Java Examples

The following examples show how to use com.ruoyi.common.enums.BusinessType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SysUserController.java    From supplierShop with MIT License 6 votes vote down vote up
@RequiresPermissions("system:user:resetPwd")
@Log(title = "重置密码", businessType = BusinessType.UPDATE)
@PostMapping("/resetPwd")
@ResponseBody
public AjaxResult resetPwdSave(SysUser user)
{
    user.setSalt(ShiroUtils.randomSalt());
    user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
    if (userService.resetUserPwd(user) > 0)
    {
        if (ShiroUtils.getUserId() == user.getUserId())
        {
            ShiroUtils.setSysUser(userService.selectUserById(user.getUserId()));
        }
        return success();
    }
    return error();
}
 
Example #2
Source File: SysDeptController.java    From ruoyiplus with MIT License 6 votes vote down vote up
/**
 * 删除
 */
@Log(title = "部门管理", businessType = BusinessType.DELETE)
@RequiresPermissions("system:dept:remove")
@PostMapping("/remove/{deptId}")
@ResponseBody
public AjaxResult remove(@PathVariable("deptId") Long deptId)
{
    if (deptService.selectDeptCount(deptId) > 0)
    {
        return error(1, "存在下级部门,不允许删除");
    }
    if (deptService.checkDeptExistUser(deptId))
    {
        return error(1, "部门存在用户,不允许删除");
    }
    return toAjax(deptService.deleteDeptById(deptId));
}
 
Example #3
Source File: SysPostController.java    From supplierShop with MIT License 6 votes vote down vote up
/**
 * 新增保存岗位
 */
@RequiresPermissions("system:post:add")
@Log(title = "岗位管理", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(@Validated SysPost post)
{
    if (UserConstants.POST_NAME_NOT_UNIQUE.equals(postService.checkPostNameUnique(post)))
    {
        return error("新增岗位'" + post.getPostName() + "'失败,岗位名称已存在");
    }
    else if (UserConstants.POST_CODE_NOT_UNIQUE.equals(postService.checkPostCodeUnique(post)))
    {
        return error("新增岗位'" + post.getPostName() + "'失败,岗位编码已存在");
    }
    post.setCreateBy(ShiroUtils.getLoginName());
    return toAjax(postService.insertPost(post));
}
 
Example #4
Source File: SysJobController.java    From ruoyiplus with MIT License 6 votes vote down vote up
@Log(title = "定时任务", businessType = BusinessType.DELETE)
@RequiresPermissions("monitor:job:remove")
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
    try
    {
        jobService.deleteJobByIds(ids);
        return success();
    }
    catch (Exception e)
    {
        e.printStackTrace();
        return error(e.getMessage());
    }
}
 
Example #5
Source File: SysMenuController.java    From supplierShop with MIT License 6 votes vote down vote up
/**
 * 删除菜单
 */
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
@RequiresPermissions("system:menu:remove")
@GetMapping("/remove/{menuId}")
@ResponseBody
public AjaxResult remove(@PathVariable("menuId") Long menuId)
{
    if (menuService.selectCountMenuByParentId(menuId) > 0)
    {
        return AjaxResult.warn("存在子菜单,不允许删除");
    }
    if (menuService.selectCountRoleMenuByMenuId(menuId) > 0)
    {
        return AjaxResult.warn("菜单已分配,不允许删除");
    }
    ShiroUtils.clearCachedAuthorizationInfo();
    return toAjax(menuService.deleteMenuById(menuId));
}
 
Example #6
Source File: SysMenuController.java    From ruoyiplus with MIT License 6 votes vote down vote up
/**
 * 删除菜单
 */
@Log(title = "菜单管理", businessType = BusinessType.DELETE)
@RequiresPermissions("system:menu:remove")
@PostMapping("/remove/{menuId}")
@ResponseBody
public AjaxResult remove(@PathVariable("menuId") Long menuId)
{
    if (menuService.selectCountMenuByParentId(menuId) > 0)
    {
        return error(1, "存在子菜单,不允许删除");
    }
    if (menuService.selectCountRoleMenuByMenuId(menuId) > 0)
    {
        return error(1, "菜单已分配,不允许删除");
    }
    ShiroUtils.clearCachedAuthorizationInfo();
    return toAjax(menuService.deleteMenuById(menuId));
}
 
Example #7
Source File: SysProfileController.java    From ruoyiplus with MIT License 6 votes vote down vote up
/**
 * 修改用户
 */
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
@PostMapping("/update")
@ResponseBody
public AjaxResult update(SysUser user)
{
    SysUser currentUser = getSysUser();
    currentUser.setUserName(user.getUserName());
    currentUser.setEmail(user.getEmail());
    currentUser.setPhonenumber(user.getPhonenumber());
    currentUser.setSex(user.getSex());
    if (userService.updateUserInfo(currentUser) > 0)
    {
        setSysUser(userService.selectUserById(currentUser.getUserId()));
        return success();
    }
    return error();
}
 
Example #8
Source File: SysUserController.java    From RuoYi with Apache License 2.0 6 votes vote down vote up
@ApiOperation("新增用户")
@ApiImplicitParam(name = "user", value = "新增用户信息", dataType = "SysUser")
@RequiresPermissions("system:user:add")
@Log(title = "用户管理", businessType = BusinessType.INSERT)
@PostMapping("/add")
@Transactional(rollbackFor = Exception.class)
@ResponseBody
public AjaxResult addSave(SysUser user) {
    if (ObjectUtil.isNotNull(user.getUserId()) && SysUser.isAdmin(user.getUserId())) {
        return error("不允许修改超级管理员用户");
    }
    if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(user.getLoginName()))){
        return error("保存用户'" + user.getLoginName() + "'失败,账号已存在");
    }
    user.setSalt(ShiroUtils.randomSalt());
    user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
    user.setCreateBy(ShiroUtils.getLoginName());
    return toAjax(userService.insertUser(user));
}
 
Example #9
Source File: SysUserController.java    From supplierShop with MIT License 6 votes vote down vote up
/**
 * 修改保存用户
 */
@RequiresPermissions("system:user:edit")
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(@Validated SysUser user)
{
    if (StringUtils.isNotNull(user.getUserId()) && SysUser.isAdmin(user.getUserId()))
    {
        return error("不允许修改超级管理员用户");
    }
    else if (UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
    {
        return error("修改用户'" + user.getLoginName() + "'失败,手机号码已存在");
    }
    else if (UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
    {
        return error("修改用户'" + user.getLoginName() + "'失败,邮箱账号已存在");
    }
    user.setUpdateBy(ShiroUtils.getLoginName());
    return toAjax(userService.updateUser(user));
}
 
Example #10
Source File: SysUserController.java    From supplierShop with MIT License 6 votes vote down vote up
/**
 * 新增保存用户
 */
@RequiresPermissions("system:user:add")
@Log(title = "用户管理", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(@Validated SysUser user)
{
    if (UserConstants.USER_NAME_NOT_UNIQUE.equals(userService.checkLoginNameUnique(user.getLoginName())))
    {
        return error("新增用户'" + user.getLoginName() + "'失败,登录账号已存在");
    }
    else if (UserConstants.USER_PHONE_NOT_UNIQUE.equals(userService.checkPhoneUnique(user)))
    {
        return error("新增用户'" + user.getLoginName() + "'失败,手机号码已存在");
    }
    else if (UserConstants.USER_EMAIL_NOT_UNIQUE.equals(userService.checkEmailUnique(user)))
    {
        return error("新增用户'" + user.getLoginName() + "'失败,邮箱账号已存在");
    }
    user.setSalt(ShiroUtils.randomSalt());
    user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
    user.setCreateBy(ShiroUtils.getLoginName());
    return toAjax(userService.insertUser(user));
}
 
Example #11
Source File: SysDictTypeController.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 新增保存字典类型
 */
@Log(title = "字典类型", businessType = BusinessType.INSERT)
@RequiresPermissions("system:dict:add")
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(@Validated SysDictType dict)
{
    if (UserConstants.DICT_TYPE_NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict)))
    {
        return error("新增字典'" + dict.getDictName() + "'失败,字典类型已存在");
    }
    dict.setCreateBy(ShiroUtils.getLoginName());
    return toAjax(dictTypeService.insertDictType(dict));
}
 
Example #12
Source File: SysUserController.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 用户状态修改
 */
@Log(title = "用户管理", businessType = BusinessType.UPDATE)
@RequiresPermissions("system:user:edit")
@PostMapping("/changeStatus")
@ResponseBody
public AjaxResult changeStatus(SysUser user)
{
    return toAjax(userService.changeStatus(user));
}
 
Example #13
Source File: SysNoticeController.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 删除公告
 */
@RequiresPermissions("system:notice:remove")
@Log(title = "通知公告", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
    return toAjax(noticeService.deleteNoticeByIds(ids));
}
 
Example #14
Source File: SysJobLogController.java    From supplierShop with MIT License 5 votes vote down vote up
@Log(title = "调度日志", businessType = BusinessType.DELETE)
@RequiresPermissions("monitor:job:remove")
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
    return toAjax(jobLogService.deleteJobLogByIds(ids));
}
 
Example #15
Source File: SysJobController.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 修改保存调度
 */
@Log(title = "定时任务", businessType = BusinessType.UPDATE)
@RequiresPermissions("monitor:job:edit")
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(@Validated SysJob job) throws SchedulerException, TaskException
{
    return toAjax(jobService.updateJob(job));
}
 
Example #16
Source File: SysDictTypeController.java    From supplierShop with MIT License 5 votes vote down vote up
@Log(title = "字典类型", businessType = BusinessType.EXPORT)
@RequiresPermissions("system:dict:export")
@PostMapping("/export")
@ResponseBody
public AjaxResult export(SysDictType dictType)
{

    List<SysDictType> list = dictTypeService.selectDictTypeList(dictType);
    ExcelUtil<SysDictType> util = new ExcelUtil<SysDictType>(SysDictType.class);
    return util.exportExcel(list, "字典类型");
}
 
Example #17
Source File: SysRoleController.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
/**
 * 修改保存角色
 */
@RequiresPermissions("system:role:edit")
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@Transactional(rollbackFor = Exception.class)
@ResponseBody
public AjaxResult editSave(SysRole role) {
    role.setUpdateBy(ShiroUtils.getLoginName());
    ShiroUtils.clearCachedAuthorizationInfo();
    return toAjax(roleService.updateRole(role));
}
 
Example #18
Source File: SysRoleController.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
@Log(title = "角色管理", businessType = BusinessType.EXPORT)
@RequiresPermissions("system:role:export")
@PostMapping("/export")
@ResponseBody
public AjaxResult export(SysRole role) {
    List<SysRole> list = roleService.selectRoleList(role);
    ExcelUtil<SysRole> util = new ExcelUtil<>(SysRole.class);
    return util.exportExcel(list, "角色信息");
}
 
Example #19
Source File: SysConfigController.java    From ruoyiplus with MIT License 5 votes vote down vote up
@Log(title = "参数管理", businessType = BusinessType.EXPORT)
@RequiresPermissions("system:config:export")
@PostMapping("/export")
@ResponseBody
public AjaxResult export(SysConfig config)
{
    List<SysConfig> list = configService.selectConfigList(config);
    ExcelUtil<SysConfig> util = new ExcelUtil<SysConfig>(SysConfig.class);
    return util.exportExcel(list, "参数数据");
}
 
Example #20
Source File: SysJobLogController.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
@Log(title = "调度日志", businessType = BusinessType.EXPORT)
@RequiresPermissions("monitor:job:export")
@PostMapping("/export")
@ResponseBody
public AjaxResult export(SysJobLog jobLog) {
    List<SysJobLog> list = jobLogService.selectJobLogList(jobLog);
    ExcelUtil<SysJobLog> util = new ExcelUtil<>(SysJobLog.class);
    return util.exportExcel(list, "调度日志");
}
 
Example #21
Source File: SysUserController.java    From ruoyiplus with MIT License 5 votes vote down vote up
@RequiresPermissions("system:user:resetPwd")
@Log(title = "重置密码", businessType = BusinessType.UPDATE)
@GetMapping("/resetPwd/{userId}")
public String resetPwd(@PathVariable("userId") Long userId, ModelMap mmap)
{
    mmap.put("user", userService.selectUserById(userId));
    return prefix + "/resetPwd";
}
 
Example #22
Source File: SysPostController.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
@RequiresPermissions("system:post:remove")
@Log(title = "岗位管理", businessType = BusinessType.DELETE)
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids) {
    try {
        return toAjax(postService.deletePostByIds(ids));
    } catch (Exception e) {
        return error(e.getMessage());
    }
}
 
Example #23
Source File: SysRoleController.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 批量选择用户授权
 */
@Log(title = "角色管理", businessType = BusinessType.GRANT)
@PostMapping("/authUser/selectAll")
@ResponseBody
public AjaxResult selectAuthUserAll(Long roleId, String userIds)
{
    return toAjax(roleService.insertAuthUsers(roleId, userIds));
}
 
Example #24
Source File: SysRoleController.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 批量取消授权
 */
@Log(title = "角色管理", businessType = BusinessType.GRANT)
@PostMapping("/authUser/cancelAll")
@ResponseBody
public AjaxResult cancelAuthUserAll(Long roleId, String userIds)
{
    return toAjax(roleService.deleteAuthUsers(roleId, userIds));
}
 
Example #25
Source File: SysRoleController.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 取消授权
 */
@Log(title = "角色管理", businessType = BusinessType.GRANT)
@PostMapping("/authUser/cancel")
@ResponseBody
public AjaxResult cancelAuthUser(SysUserRole userRole)
{
    return toAjax(roleService.deleteAuthUser(userRole));
}
 
Example #26
Source File: SysJobLogController.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
@Log(title = "调度日志", businessType = BusinessType.CLEAN)
@RequiresPermissions("monitor:job:remove")
@PostMapping("/clean")
@ResponseBody
public AjaxResult clean() {
    jobLogService.cleanJobLog();
    return success();
}
 
Example #27
Source File: SysJobController.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 新增保存调度
 */
@Log(title = "定时任务", businessType = BusinessType.INSERT)
@RequiresPermissions("monitor:job:add")
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(SysJob job)
{
    job.setCreateBy(ShiroUtils.getLoginName());
    return toAjax(jobService.insertJobCron(job));
}
 
Example #28
Source File: SysRoleController.java    From supplierShop with MIT License 5 votes vote down vote up
/**
 * 保存角色分配数据权限
 */
@RequiresPermissions("system:role:edit")
@Log(title = "角色管理", businessType = BusinessType.UPDATE)
@PostMapping("/authDataScope")
@ResponseBody
public AjaxResult authDataScopeSave(SysRole role)
{
    role.setUpdateBy(ShiroUtils.getLoginName());
    if (roleService.authDataScope(role) > 0)
    {
        ShiroUtils.setSysUser(userService.selectUserById(ShiroUtils.getSysUser().getUserId()));
        return success();
    }
    return error();
}
 
Example #29
Source File: SysJobController.java    From RuoYi with Apache License 2.0 5 votes vote down vote up
@Log(title = "定时任务", businessType = BusinessType.DELETE)
@RequiresPermissions("monitor:job:remove")
@PostMapping("/remove")
@ResponseBody
public AjaxResult remove(String ids)throws SchedulerException {
    jobService.deleteJobByIds(ids);
    return success();
}
 
Example #30
Source File: SysNoticeController.java    From ruoyiplus with MIT License 5 votes vote down vote up
/**
 * 修改保存公告
 */
@RequiresPermissions("system:notice:edit")
@Log(title = "通知公告", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(SysNotice notice)
{
    notice.setUpdateBy(ShiroUtils.getLoginName());
    return toAjax(noticeService.updateNotice(notice));
}