| | |
| | | { |
| | | String rspStr = resolveBodyFromRequest(request); |
| | | JSONObject obj = JSON.parseObject(rspStr); |
| | | validateCodeService.checkCaptcha(obj.getString(CODE), obj.getString(UUID)); |
| | | /* validateCodeService.checkCaptcha(obj.getString(CODE), obj.getString(UUID));*/ |
| | | } |
| | | catch (Exception e) |
| | | { |
| | |
| | | package com.ruoyi.system.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
| | | import java.util.List; |
| | | |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.domain.dto.deptQuery; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import io.seata.common.util.StringUtils; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.ArrayUtils; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.domain.AjaxResult; |
| | | import com.ruoyi.common.log.annotation.Log; |
| | |
| | | return success(depts); |
| | | } |
| | | |
| | | @RequiresPermissions("system:dept:list") |
| | | @GetMapping("/pagelist") |
| | | @ApiOperation("分页获取部门列表") |
| | | public AjaxResult pagelist(deptQuery dept) |
| | | { |
| | | PageInfo<SysDept> pageInfo = new PageInfo<>(dept.getPageCurr(), dept.getPageSize()); |
| | | |
| | | PageInfo<SysDept> page = deptService.page(pageInfo, |
| | | new LambdaQueryWrapper<SysDept>() |
| | | .like(StringUtils.isNotBlank(dept.getDeptName()), SysDept::getDeptName, |
| | | dept.getDeptName()).eq(SysDept::getDelFlag, "0")); |
| | | return AjaxResult.success(page); |
| | | } |
| | | |
| | | /** |
| | | * 查询部门列表(排除节点) |
| | | */ |
| | |
| | | |
| | | // @ApiOperation("获取所有角色信息根据公司id") |
| | | @GetMapping("/list") |
| | | public AjaxResult list(Integer companyId) |
| | | @ApiOperation("获取不分页角色列表") |
| | | public AjaxResult list() |
| | | { |
| | | SysRole role = new SysRole(); |
| | | List<SysRole> list = roleService.selectRoleList(role); |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation("获取角色列表") |
| | | @ApiOperation("获取分页角色列表") |
| | | @PostMapping("/listPage") |
| | | public AjaxResult listPage(@Validated @RequestBody RoleQuery query) |
| | | { |
New file |
| | |
| | | package com.ruoyi.system.domain.dto; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | @Data |
| | | @ApiModel("部门查询") |
| | | public class deptQuery extends BasePage { |
| | | private static final long serialVersionUID = 6935257450787285105L; |
| | | |
| | | @ApiModelProperty("部门名称") |
| | | private String deptName; |
| | | } |
| | |
| | | package com.ruoyi.system.mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import com.ruoyi.system.api.domain.SysDept; |
| | | |
| | |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface SysDeptMapper |
| | | public interface SysDeptMapper extends BaseMapper<SysDept> |
| | | { |
| | | /** |
| | | * 查询部门管理数据 |
| | |
| | | package com.ruoyi.system.service; |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.system.api.domain.SysDept; |
| | | import com.ruoyi.system.api.domain.SysRole; |
| | | import com.ruoyi.system.domain.vo.TreeSelect; |
| | | |
| | | /** |
| | |
| | | * |
| | | * @author ruoyi |
| | | */ |
| | | public interface ISysDeptService |
| | | public interface ISysDeptService extends IService<SysDept> |
| | | { |
| | | /** |
| | | * 查询部门管理数据 |
| | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.system.domain.vo.TreeSelect; |
| | | import com.ruoyi.system.mapper.SysDeptMapper; |
| | | import com.ruoyi.system.mapper.SysRoleMapper; |
| | | import com.ruoyi.system.service.ISysDeptService; |
| | | import com.ruoyi.system.service.ISysRoleService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.ruoyi.common.core.constant.UserConstants; |
| | |
| | | * @author ruoyi |
| | | */ |
| | | @Service |
| | | public class SysDeptServiceImpl implements ISysDeptService |
| | | public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements ISysDeptService |
| | | { |
| | | @Autowired |
| | | private SysDeptMapper deptMapper; |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | </resultMap> |
| | | |
| | | <sql id="selectDeptVo"> |
| | | 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 |
| | | select d.dept_id, d.dept_name, d.del_flag, d.create_by, d.create_time |
| | | from sys_dept d |
| | | </sql> |
| | | |
| | |
| | | <if test="deptId != null and deptId != 0"> |
| | | AND dept_id = #{deptId} |
| | | </if> |
| | | <if test="parentId != null and parentId != 0"> |
| | | AND parent_id = #{parentId} |
| | | </if> |
| | | <if test="deptName != null and deptName != ''"> |
| | | AND dept_name like concat('%', #{deptName}, '%') |
| | | </if> |
| | | <if test="status != null and status != ''"> |
| | | AND status = #{status} |
| | | </if> |
| | | <!-- 数据范围过滤 --> |
| | | ${params.dataScope} |
| | | order by d.parent_id, d.order_num |
| | | </select> |
| | | |
| | | <select id="selectDeptListByRoleId" resultType="Long"> |
| | |
| | | <insert id="insertDept" parameterType="com.ruoyi.system.api.domain.SysDept"> |
| | | insert into sys_dept( |
| | | <if test="deptId != null and deptId != 0">dept_id,</if> |
| | | <if test="parentId != null and parentId != 0">parent_id,</if> |
| | | <if test="deptName != null and deptName != ''">dept_name,</if> |
| | | <if test="ancestors != null and ancestors != ''">ancestors,</if> |
| | | <if test="orderNum != null">order_num,</if> |
| | | <if test="leader != null and leader != ''">leader,</if> |
| | | <if test="phone != null and phone != ''">phone,</if> |
| | | <if test="email != null and email != ''">email,</if> |
| | | <if test="status != null">status,</if> |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | create_time |
| | | )values( |
| | | <if test="deptId != null and deptId != 0">#{deptId},</if> |
| | | <if test="parentId != null and parentId != 0">#{parentId},</if> |
| | | <if test="deptName != null and deptName != ''">#{deptName},</if> |
| | | <if test="ancestors != null and ancestors != ''">#{ancestors},</if> |
| | | <if test="orderNum != null">#{orderNum},</if> |
| | | <if test="leader != null and leader != ''">#{leader},</if> |
| | | <if test="phone != null and phone != ''">#{phone},</if> |
| | | <if test="email != null and email != ''">#{email},</if> |
| | | <if test="status != null">#{status},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | sysdate() |
| | | ) |
| | |
| | | <update id="updateDept" parameterType="com.ruoyi.system.api.domain.SysDept"> |
| | | update sys_dept |
| | | <set> |
| | | <if test="parentId != null and parentId != 0">parent_id = #{parentId},</if> |
| | | <if test="deptName != null and deptName != ''">dept_name = #{deptName},</if> |
| | | <if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if> |
| | | <if test="orderNum != null">order_num = #{orderNum},</if> |
| | | <if test="leader != null">leader = #{leader},</if> |
| | | <if test="phone != null">phone = #{phone},</if> |
| | | <if test="email != null">email = #{email},</if> |
| | | <if test="status != null and status != ''">status = #{status},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | update_time = sysdate() |
| | | </set> |
| | |
| | | select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1 |
| | | </select> |
| | | <select id="getList" resultType="com.ruoyi.system.api.domain.SysUser"> |
| | | select su.user_id userId,su.nick_name nickName,su.phonenumber,su.status,sr.role_name |
| | | roleName,sr.role_id roleId,case su.user_type when '01' then 2 |
| | | else 1 end as isAuctioneer |
| | | from |
| | | sys_user su left join sys_user_role sur on su.user_id = sur.user_id left join sys_role sr on |
| | | sr.role_id |
| | | = sur.role_id where 1=1 |
| | | SELECT |
| | | su.user_id userId, |
| | | su.nick_name nickName, |
| | | su.phonenumber, |
| | | su. STATUS, |
| | | sr.role_name roleName, |
| | | dp.dept_name deptName, |
| | | su.dept_id deptId, |
| | | sr.role_id roleId, |
| | | CASE su.user_type |
| | | WHEN '01' THEN |
| | | 2 |
| | | ELSE |
| | | 1 |
| | | END AS isAuctioneer |
| | | FROM |
| | | sys_user su |
| | | LEFT JOIN sys_user_role sur ON su.user_id = sur.user_id |
| | | LEFT JOIN sys_role sr ON sr.role_id = sur.role_id |
| | | LEFT JOIN sys_dept dp ON dp.dept_id = su.dept_id |
| | | where 1=1 |
| | | <if test="nickName !=null and nickName !=''"> |
| | | and su.nick_name like concat("%", #{nickName},"%") |
| | | </if> |
| | | <if test="phonenumber !=null and phonenumber !=''"> |
| | | and su.phonenumber like concat("%", #{phonenumber},"%") |
| | | </if> |
| | | <if test="deptId !=null and deptId !=''"> |
| | | and su.dept_id = #{deptId} |
| | | </if> |
| | | <if test="status !=null and status !=''"> |
| | | and su.status = #{status} |
| | | </if> |
| | | and su.del_flag = '0' and su.user_type in('00','01') |
| | | and su.del_flag = '0' and su.user_type in('00') |
| | | order by su.create_time desc |
| | | </select> |
| | | <select id="getAllList" resultType="com.ruoyi.system.api.domain.SysUser"> |