| | |
| | | /** |
| | | * 生成验证码 |
| | | */ |
| | | @ApiOperation(value = "获取图片验证码", notes = "获取验证码") |
| | | /* @ApiOperation(value = "获取图片验证码", notes = "获取验证码") |
| | | @GetMapping("/captchaImage") |
| | | public AjaxResult getCode(HttpServletResponse response) throws IOException { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | |
| | | ajax.put("uuid", uuid); |
| | | ajax.put("img", "data:image/jpg;base64,"+Base64.encode(os.toByteArray())); |
| | | return ajax; |
| | | } |
| | | }*/ |
| | | } |
| | |
| | | /** |
| | | * 通用上传请求(多个) |
| | | */ |
| | | @ApiOperation(value = "文件上传(多个)", notes = "文件上传(多个)") |
| | | /*@ApiOperation(value = "文件上传(多个)", notes = "文件上传(多个)") |
| | | @PostMapping("/uploads") |
| | | public AjaxResult uploadFiles(List<MultipartFile> files) throws Exception { |
| | | try { |
| | |
| | | } catch (Exception e) { |
| | | return AjaxResult.error(e.getMessage()); |
| | | } |
| | | } |
| | | }*/ |
| | | |
| | | // /** |
| | | // * 本地资源通用下载 |
| | |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping(value = "/app/addressBook") |
| | | @Api(value = "用户地址簿", tags = "用户地址簿操作控制器") |
| | | @Slf4j |
| | | public class AddressBookController { |
| | | @Autowired |
| | |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/app/agreement") |
| | | @Api(value = "协议", tags = "协议操作控制器") |
| | | @Slf4j |
| | | public class AgreementController { |
| | | |
| | |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/app/user") |
| | | @Api(value = "app用户",tags = "app用户操作控制器") |
| | | @Slf4j |
| | | public class AppUserController { |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private TokenBlacklistService blacklistService; |
| | | @GetMapping("/test") |
| | | /* @GetMapping("/test") |
| | | @ApiOperation(value = "登出" ,tags = "app用户端") |
| | | public R<Void> test(@RequestHeader("Authorization") String token) { |
| | | throw new ServiceException("测试"); |
| | | |
| | | } |
| | | }*/ |
| | | /** |
| | | * 登出 |
| | | */ |
| | |
| | | * 手机号验证码登录 |
| | | */ |
| | | @PostMapping("/mobileLogin") |
| | | @ApiOperation(value = "手机号登录",tags = "app用户端") |
| | | @ApiOperation(value = "手机号登录",tags = "app用户端",notes = "手机号:19923261698 如果不存在,即帮忙注册,需要传jscode") |
| | | public R<LoginVO> mobileLogin(@RequestBody @Valid MobileLoginDTO mobileLogin) { |
| | | return appUserService.mobileLogin(mobileLogin); |
| | | |
| | |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping(value = "/app/banner") |
| | | @Api(value = "banner", tags = "banner操作控制器") |
| | | @Slf4j |
| | | public class BannerController { |
| | | |
| | |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/app/community") |
| | | @Api(value = "小区信息", tags = "小区信息操作控制器") |
| | | @Slf4j |
| | | public class CommunityController { |
| | | @Autowired |
| | |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping(value = "/communityCourier") |
| | | @Api(value = "小区 - 跑腿员关联", tags = "小区 - 跑腿员关联操作控制器") |
| | | @Slf4j |
| | | public class CommunityCourierController { |
| | | @Autowired |
| | |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/app/courier") |
| | | @Api(value = "跑腿员信息", tags = "跑腿员信息操作控制器") |
| | | @Slf4j |
| | | public class CourierController { |
| | | @Autowired |
| | |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping(value = "/app/evaluation") |
| | | @Api(value = "评价表", tags = "评价表操作控制器") |
| | | @Slf4j |
| | | public class EvaluationController { |
| | | @Autowired |
| | |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping(value = "/app/feedback") |
| | | @Api(value = "用户反馈", tags = "用户反馈操作控制器") |
| | | @Slf4j |
| | | public class FeedbackController { |
| | | @Autowired |
| | |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/app/order") |
| | | @Api(value = "订单表", tags = "订单表操作控制器") |
| | | |
| | | @Slf4j |
| | | public class OrderController { |
| | | @Autowired |
| | |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping(value = "/app/phone") |
| | | @Api(value = "客服电话", tags = "客服电话操作控制器") |
| | | |
| | | @Slf4j |
| | | public class PhoneController { |
| | | @Autowired |
| | |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping(value = "/app/region") |
| | | @Api(value = "省市区三级联动", tags = "省市区三级联动操作控制器") |
| | | |
| | | @Slf4j |
| | | public class RegionController { |
| | | @Autowired |
| | |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping(value = "/app/report") |
| | | @Api(value = "上报表", tags = "上报表操作控制器") |
| | | |
| | | @Slf4j |
| | | public class ReportController { |
| | | |
| | |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping(value = "/app/systemConfig") |
| | | @Api(value = "系统配置", tags = "系统配置操作控制器") |
| | | |
| | | @Slf4j |
| | | public class SystemConfigController { |
| | | |
| | |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping(value = "/userCancellationLog") |
| | | @Api(value = "注销记录", tags = "注销记录操作控制器") |
| | | |
| | | @Slf4j |
| | | public class UserCancellationLogController { |
| | | @Autowired |
| | |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/app/vipOrder") |
| | | @Api(value = "vip订单信息", tags = "vip订单信息操作控制器") |
| | | |
| | | @Slf4j |
| | | public class VipOrderController { |
| | | @Autowired |
| | |
| | | @Validated |
| | | @RestController |
| | | @RequestMapping(value = "/app/vipSetting") |
| | | @Api(value = "会员权益", tags = "会员权益操作控制器") |
| | | |
| | | @Slf4j |
| | | public class VipSettingController { |
| | | @Autowired |
| | |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @ApiOperation(value = "用户管理-部门选择框", tags = "系统后台-权限管理") |
| | | @ApiOperation(value = "账号管理-部门选择框", tags = "系统后台-权限管理") |
| | | @GetMapping("/list") |
| | | public AjaxResult list() { |
| | | List<SysDeptPageVO> list = deptService.getDeptList(); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 部门详情 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | @ApiOperation(value = "部门管理-查看部门(回显)", tags = "系统后台-权限管理") |
| | | @GetMapping("/{deptId}") |
| | | public AjaxResult detail(@PathVariable("deptId") Long deptId) { |
| | | SysDept sysDept = deptService.selectDeptById(deptId); |
| | | return success(sysDept); |
| | | } |
| | | /** |
| | | * 修改部门 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:dept:list')") |
| | | @Log(title = "部门管理", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "部门管理-新增部门", tags = "系统后台-权限管理") |
| | | @ApiOperation(value = "部门管理-修改部门", tags = "系统后台-权限管理") |
| | | @PutMapping("/edit") |
| | | public AjaxResult edit(@RequestParam("id")Long id, |
| | | @RequestParam("name")String name) { |
| | |
| | | * @param loginBody 登录信息 |
| | | * @return 结果 |
| | | */ |
| | | @ApiOperation(value = "登录", notes = "登录") |
| | | @ApiOperation(value = "登录", notes = "username:hlg password:e10adc3949ba59abbe56e057f20f883e(123456) 密码前端需MD5加密传输") |
| | | @PostMapping("/login") |
| | | public AjaxResult login(@RequestBody LoginBody loginBody) { |
| | | AjaxResult ajax = AjaxResult.success(); |
| | |
| | | * |
| | | * @return 路由信息 |
| | | */ |
| | | @ApiOperation(value = "获取路由信息", notes = "获取路由信息") |
| | | /* @ApiOperation(value = "获取路由信息", notes = "获取路由信息") |
| | | @GetMapping("getRouters") |
| | | public AjaxResult getRouters() { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId); |
| | | return AjaxResult.success(menuService.buildMenus(menus)); |
| | | } |
| | | }*/ |
| | | |
| | | /** |
| | | * 退出登录 |
| | |
| | | /** |
| | | * 菜单信息 |
| | | * */ |
| | | @Api(value = "菜单控制器",tags = "菜单控制器") |
| | | |
| | | @RestController |
| | | @RequestMapping("/system/menu") |
| | | public class SysMenuController extends BaseController { |
| | |
| | | * 获取菜单列表树 |
| | | */ |
| | | @GetMapping("/tree") |
| | | @ApiOperation(value = "角色管理-菜单列表树", tags = {"系统后台-权限管理","首页"}) |
| | | @ApiOperation(value = "角色管理-菜单列表树", tags = {"系统后台-权限管理","系统后台-首页"}) |
| | | public R<List<MenuTreeVO>> tree() { |
| | | LoginUser loginUser = (LoginUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); |
| | | return R.ok(menuService.tree(loginUser.getUserId())); |
| | |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | @Api(value = "角色管理控制器",tags = "角色管理控制器") |
| | | @RestController |
| | | @RequestMapping("/system/role") |
| | | public class SysRoleController extends BaseController { |
| | |
| | | return toAjax(roleService.insertRole(role)); |
| | | |
| | | }*/ |
| | | @ApiOperation(value = "新增角色", notes = "系统后台-权限管理") |
| | | @ApiOperation(value = "新增角色", tags = "系统后台-权限管理") |
| | | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @Log(title = "角色管理", businessType = BusinessType.INSERT) |
| | | @PostMapping("/add") |
| | |
| | | /** |
| | | * 修改保存角色 |
| | | */ |
| | | @ApiOperation(value = "修改角色", notes = "系统后台-权限管理") |
| | | @ApiOperation(value = "修改角色", tags = "系统后台-权限管理") |
| | | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @Log(title = "角色管理", businessType = BusinessType.INSERT) |
| | | @PutMapping("/edit") |
| | |
| | | /** |
| | | * 删除角色 |
| | | */ |
| | | @ApiOperation(value = "删除角色", notes = "系统后台-权限管理") |
| | | @ApiOperation(value = "删除角色", tags = "系统后台-权限管理") |
| | | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @Log(title = "角色管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{roleId}") |
| | |
| | | /** |
| | | * 查看详情 |
| | | */ |
| | | @ApiOperation(value = "查看详情", notes = "系统后台-权限管理") |
| | | @ApiOperation(value = "查看详情", tags = "系统后台-权限管理") |
| | | @PreAuthorize("@ss.hasPermi('system:role:list')") |
| | | @Log(title = "角色管理", businessType = BusinessType.DELETE) |
| | | @GetMapping("/{roleId}") |
| | |
| | | /** |
| | | * 获取角色选择框列表 |
| | | */ |
| | | /* |
| | | @ApiOperation(value = "获取角色选择框列表", notes = "获取角色选择框列表") |
| | | @PreAuthorize("@ss.hasPermi('system:role:query')") |
| | | @GetMapping("/optionselect") |
| | | public AjaxResult optionselect() { |
| | | return success(roleService.selectRoleAll()); |
| | | @ApiOperation(value = "账号管理-获取角色下拉框", tags = "系统后台-权限管理") |
| | | @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @GetMapping("/getOptionSelect") |
| | | public R<List<SysRoleVO>> getOptionSelect() { |
| | | return R.ok(roleService.getOptionSelect()); |
| | | } |
| | | */ |
| | | |
| | | /** |
| | | * 查询已分配用户角色列表 |
| | |
| | | */ |
| | | @ApiOperation(value = "账号管理-修改用户", tags = "系统后台-权限管理") |
| | | @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @Log(title = "账号管理", businessType = BusinessType.UPDATE) |
| | | @PostMapping("/edit") |
| | | public R<Void> edit(@Valid @RequestBody EditSysUserDTO dto) { |
| | | userService.edit(dto); |
| | |
| | | */ |
| | | @ApiOperation(value = "账号管理-删除用户", tags = "系统后台-权限管理") |
| | | @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @Log(title = "用户管理", businessType = BusinessType.DELETE) |
| | | @Log(title = "账号管理", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{userId}") |
| | | public R remove(@PathVariable("userId") Long userId) { |
| | | if (Objects.equals(userId, getUserId())) { |
| | |
| | | */ |
| | | @ApiOperation(value = "账号管理-重置密码", tags = "系统后台-权限管理") |
| | | @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @Log(title = "账号管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/resetPassword/{userId}") |
| | | public R<Void> resetPassword(@PathVariable("userId") Long userId) { |
| | | userService.resetPassword(userId); |
| | |
| | | */ |
| | | @ApiOperation(value = "账号管理-状态修改", tags = "系统后台-权限管理") |
| | | @PreAuthorize("@ss.hasPermi('system:user:list')") |
| | | @Log(title = "用户管理", businessType = BusinessType.UPDATE) |
| | | @Log(title = "账号管理", businessType = BusinessType.UPDATE) |
| | | @PutMapping("/changeStatus/{userId}") |
| | | public R<Void> changeStatus(@PathVariable("userId") Long userId) { |
| | | if (Objects.equals(userId, getUserId())) { |
| | | return R.fail("当前用户不能删除"); |
| | | return R.fail("当前用户不能操作"); |
| | | } |
| | | userService.changeStatus(userId); |
| | | return R.ok(); |
| | |
| | | # 开发环境配置 |
| | | server: |
| | | # 服务器的HTTP端口,默认为8080 |
| | | port: 8081 |
| | | port: 8084 |
| | | servlet: |
| | | # 应用的访问路径 |
| | | context-path: / |
| | |
| | | * @param deptId 部门ID |
| | | * @return 结果 |
| | | */ |
| | | public int deleteDeptById(Long deptId); |
| | | public int deleteDeptById(@Param("deptId")Long deptId); |
| | | |
| | | IPage<SysDeptPageVO> page(@Param("page")IPage<SysDeptPageVO> page, @Param("name")String name); |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.common.core.domain.entity.SysRole; |
| | | import com.ruoyi.system.object.vo.SysRolePageVO; |
| | | import com.ruoyi.system.object.vo.SysRoleVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public int deleteRoleByIds(Long[] roleIds); |
| | | |
| | | IPage<SysRolePageVO> page(IPage<SysRolePageVO> page, String name); |
| | | IPage<SysRolePageVO> page(@Param("page") IPage<SysRolePageVO> page,@Param("name") String name); |
| | | |
| | | List<SysRoleVO> getOptionSelect(); |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("添加角色DTO") |
| | | public class AddSysRoleDTO { |
| | | @ApiModelProperty("角色名称") |
| | | @NotEmpty(message = "角色名称不能为空") |
| | | private String roleName; |
| | | @ApiModelProperty("菜单权限集合") |
| | | @NotEmpty(message = "菜单权限集合不能为空") |
| | | private List<Long> menuIds; |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotEmpty; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel("添加用户DTO") |
| | | public class AddSysUserDTO{ |
| | | @ApiModelProperty(value = "姓名") |
| | | @NotEmpty(message = "姓名不能为空") |
| | | private String nickName; |
| | | @ApiModelProperty(value = "联系电话") |
| | | @NotEmpty(message = "联系电话不能为空") |
| | | private String phonenumber; |
| | | @ApiModelProperty(value = "所在部门id") |
| | | @NotNull(message = "所在部门不能为空") |
| | | private Long deptId; |
| | | @ApiModelProperty(value = "所属角色id") |
| | | @NotNull(message = "所属角色不能为空") |
| | | private Long roleId; |
| | | |
| | | |
| | | } |
| | |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Getter |
| | | @Setter |
| | | @ApiModel("编辑用户DTO") |
| | | public class EditSysUserDTO extends AddSysUserDTO { |
| | | @ApiModelProperty(value = "用户id") |
| | | @NotNull(message = "用户id不能为空") |
| | | private Long userId; |
| | | } |
| | |
| | | private Long deptId; |
| | | |
| | | @ApiModelProperty("部门名称") |
| | | private String name; |
| | | private String deptName; |
| | | } |
| | |
| | | void edit( EditSysRoleDTO dto); |
| | | |
| | | SysRoleVO getById(Long roleId); |
| | | |
| | | List<SysRoleVO> getOptionSelect(); |
| | | } |
| | |
| | | package com.ruoyi.system.service.impl; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.*; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.ruoyi.common.core.domain.model.LoginUser; |
| | |
| | | sysRoleVO.setMenuIdList(menuIds); |
| | | return sysRoleVO; |
| | | } |
| | | |
| | | @Override |
| | | public List<SysRoleVO> getOptionSelect() { |
| | | return roleMapper.getOptionSelect(); |
| | | |
| | | } |
| | | } |
| | |
| | | select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, |
| | | (select dept_name from sys_dept where dept_id = d.parent_id) parent_name |
| | | from sys_dept d |
| | | where d.dept_id = #{deptId} |
| | | where d.dept_id = #{deptId} and del_flag = '0' |
| | | </select> |
| | | |
| | | <select id="checkDeptExistUser" parameterType="Long" resultType="int"> |
| | |
| | | </select> |
| | | <select id="page" resultType="com.ruoyi.system.object.vo.SysDeptPageVO"> |
| | | select |
| | | dept_id,name |
| | | dept_id,dept_name |
| | | from sys_dept |
| | | where |
| | | del_flag='0' |
| | | <if test="name!=null and name!='' "> |
| | | and `dept_name` like concat('%',#{name},'%') |
| | | </if> |
| | | </select> |
| | | <select id="getDeptList" resultType="com.ruoyi.system.object.vo.SysDeptPageVO"> |
| | | select |
| | | dept_id,name |
| | | dept_id,dept_name |
| | | from sys_dept |
| | | where |
| | | del_flag='0' |
| | | |
| | | </select> |
| | | <select id="selectDeptByName" resultType="com.ruoyi.common.core.domain.entity.SysDept"> |
| | | select dept_id from sys_dept where del_flag='0' and deptName like #{name} |
| | | select dept_id from sys_dept where del_flag='0' and dept_name like #{name} |
| | | </select> |
| | | |
| | | <insert id="insertDept" parameterType="SysDept"> |
| | |
| | | </if> |
| | | order by role_sort asc |
| | | </select> |
| | | <select id="getOptionSelect" resultType="com.ruoyi.system.object.vo.SysRoleVO"> |
| | | select role_id,role_name from sys_role where del_flag=0 |
| | | </select> |
| | | |
| | | |
| | | <insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId"> |