员工和部门接口说明修改
This commit is contained in:
parent
64df8406fa
commit
a63101d2c9
@ -4,12 +4,13 @@ import java.util.Arrays;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.lz.modules.app.dto.DepartmentsDto;
|
import com.lz.modules.app.dto.DepartmentsDto;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.annotations.ApiResponse;
|
||||||
|
import io.swagger.annotations.ApiResponses;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import com.lz.modules.app.entity.DepartmentsEntity;
|
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||||
import com.lz.modules.app.service.DepartmentsService;
|
import com.lz.modules.app.service.DepartmentsService;
|
||||||
@ -25,6 +26,7 @@ import com.lz.common.utils.R;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("staff/structure")
|
@RequestMapping("staff/structure")
|
||||||
|
@Api(tags = "部门相关")
|
||||||
public class DepartmentsController {
|
public class DepartmentsController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private DepartmentsService departmentsService;
|
private DepartmentsService departmentsService;
|
||||||
@ -32,8 +34,10 @@ public class DepartmentsController {
|
|||||||
/**
|
/**
|
||||||
* 列表
|
* 列表
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/list")
|
@PostMapping("/list")
|
||||||
// @RequiresPermissions("staff:structure:list")
|
// @RequiresPermissions("staff:structure:list")
|
||||||
|
@ApiOperation("获取全部有效部门树列表")
|
||||||
|
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = DepartmentsDto.class)})
|
||||||
public List<DepartmentsDto> list() {
|
public List<DepartmentsDto> list() {
|
||||||
List<DepartmentsDto> departmentList = departmentsService.getDepartmentTree();
|
List<DepartmentsDto> departmentList = departmentsService.getDepartmentTree();
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.lz.modules.app.controller;
|
package com.lz.modules.app.controller;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
@ -9,8 +10,11 @@ import com.lz.modules.app.dto.*;
|
|||||||
import com.lz.modules.app.entity.DepartmentsEntity;
|
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||||
import com.lz.modules.app.entity.StaffEntity;
|
import com.lz.modules.app.entity.StaffEntity;
|
||||||
import com.lz.modules.app.enums.ExcelStaffHeardEnum;
|
import com.lz.modules.app.enums.ExcelStaffHeardEnum;
|
||||||
|
import com.lz.modules.app.req.StaffReq;
|
||||||
import com.lz.modules.app.service.*;
|
import com.lz.modules.app.service.*;
|
||||||
|
import io.swagger.annotations.*;
|
||||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
@ -30,6 +34,7 @@ import java.util.*;
|
|||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("staff/info")
|
@RequestMapping("staff/info")
|
||||||
|
@Api(tags = "人员相关")
|
||||||
public class StaffController {
|
public class StaffController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -96,6 +101,34 @@ public class StaffController {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表
|
||||||
|
*/
|
||||||
|
@PostMapping("/stafflist")
|
||||||
|
// @RequiresPermissions("staff:info:list")
|
||||||
|
@ApiOperation("获取人员列表")
|
||||||
|
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = StaffDto.class)})
|
||||||
|
public R stafflist(@RequestBody @ApiParam StaffReq staffReq) {
|
||||||
|
//当前页
|
||||||
|
Map<String, Object> map = new HashMap<>();
|
||||||
|
if(staffReq.getCurrPage() > 0){
|
||||||
|
map.put("page", staffReq.getCurrPage());
|
||||||
|
}
|
||||||
|
|
||||||
|
if(staffReq.getPageSize() > 0){
|
||||||
|
map.put("limit", staffReq.getPageSize());
|
||||||
|
}
|
||||||
|
|
||||||
|
if(staffReq.getDepartmentId() != null){
|
||||||
|
map.put("departmentId", staffReq.getDepartmentId());
|
||||||
|
}
|
||||||
|
|
||||||
|
if(staffReq.getName() != null && staffReq.getName().length() > 0){
|
||||||
|
map.put("name", staffReq.getName());
|
||||||
|
}
|
||||||
|
return list(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 信息
|
* 信息
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
package com.lz.modules.app.dto;
|
package com.lz.modules.app.dto;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -15,32 +17,41 @@ import java.util.List;
|
|||||||
* @date 2020-04-30 16:59:50
|
* @date 2020-04-30 16:59:50
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@ApiModel("部门信息Dto")
|
||||||
public class DepartmentsDto implements Serializable{
|
public class DepartmentsDto implements Serializable{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "部门id", name = "id")
|
||||||
|
private Integer id;
|
||||||
/**
|
/**
|
||||||
* 飞书部门id
|
* 飞书部门id
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "钉钉,飞书部门id", name = "departmentId")
|
||||||
private String departmentId;
|
private String departmentId;
|
||||||
/**
|
/**
|
||||||
* 飞书上级部门id
|
* 飞书上级部门id
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "钉钉,飞书上级部门id", name = "departmentParentId")
|
||||||
private String departmentParentId;
|
private String departmentParentId;
|
||||||
/**
|
/**
|
||||||
* 飞书显示部门人数
|
* 飞书显示部门人数
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "部门人员数量", name = "memberCount")
|
||||||
private Integer memberCount;
|
private Integer memberCount;
|
||||||
/**
|
/**
|
||||||
* 组织架构名称/部门名称
|
* 组织架构名称/部门名称
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(value = "部门名称", name = "departmentName")
|
||||||
private String departmentName;
|
private String departmentName;
|
||||||
/**
|
/**
|
||||||
* ztree属性
|
* ztree属性
|
||||||
*/
|
*/
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "部门id", name = "id")
|
||||||
private Boolean open;
|
private Boolean open;
|
||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
@ApiModelProperty(value = "部门id", name = "id")
|
||||||
private List<?> list;
|
private List<?> list;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package com.lz.modules.app.dto;
|
package com.lz.modules.app.dto;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -12,33 +14,40 @@ import java.io.Serializable;
|
|||||||
* @date 2020-04-29 20:59:20
|
* @date 2020-04-29 20:59:20
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@ApiModel("员工Dto")
|
||||||
public class StaffDto implements Serializable {
|
public class StaffDto implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 员工Id
|
* 员工Id
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(name = "staffId", value = "员工id")
|
||||||
private Long staffId;
|
private Long staffId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 员工工号
|
* 员工工号
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(name = "staffNo", value = "工号")
|
||||||
private String staffNo;
|
private String staffNo;
|
||||||
/**
|
/**
|
||||||
* 员工姓名
|
* 员工姓名
|
||||||
*/
|
*/
|
||||||
private String name;
|
@ApiModelProperty(name = "value", value = "姓名")
|
||||||
|
private String value;
|
||||||
/**
|
/**
|
||||||
* 职位
|
* 职位
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(name = "position", value = "职位")
|
||||||
private String position;
|
private String position;
|
||||||
/**
|
/**
|
||||||
* 人员状态【1:离职;0:在职】
|
* 人员状态【1:离职;0:在职】
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(name = "staffStatus", value = "在职状态")
|
||||||
private String staffStatus;
|
private String staffStatus;
|
||||||
/**
|
/**
|
||||||
* 是否是部门负责人
|
* 是否是部门负责人
|
||||||
*/
|
*/
|
||||||
|
@ApiModelProperty(name = "departmentLeader", value = "是否部门领导")
|
||||||
private Integer departmentLeader;
|
private Integer departmentLeader;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
32
src/main/java/com/lz/modules/app/req/StaffReq.java
Normal file
32
src/main/java/com/lz/modules/app/req/StaffReq.java
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
package com.lz.modules.app.req;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 员工基本信息表
|
||||||
|
*
|
||||||
|
* @author fumeiai
|
||||||
|
* @email fumeiai@linzikg.com
|
||||||
|
* @date 2020-04-29 20:59:20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ApiModel("人员查询req")
|
||||||
|
public class StaffReq implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ApiModelProperty(name = "currPage", value = "当前页码")
|
||||||
|
private int currPage = 1;
|
||||||
|
@ApiModelProperty(name = "pageSize", value = "每页返回条数")
|
||||||
|
private int pageSize = 10;
|
||||||
|
//
|
||||||
|
@ApiModelProperty(name = "name", value = "员工姓名")
|
||||||
|
private String name;
|
||||||
|
@ApiModelProperty(name = "departmentId", value = "部门id")
|
||||||
|
private Integer departmentId;
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user