Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0
This commit is contained in:
commit
47bc97664e
@ -4,12 +4,10 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.lz.modules.app.dto.DepartmentsDto;
|
||||
import io.swagger.annotations.*;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||
import com.lz.modules.app.service.DepartmentsService;
|
||||
@ -25,6 +23,7 @@ import com.lz.common.utils.R;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("staff/structure")
|
||||
@Api(tags = "部门相关")
|
||||
public class DepartmentsController {
|
||||
@Autowired
|
||||
private DepartmentsService departmentsService;
|
||||
@ -32,14 +31,25 @@ public class DepartmentsController {
|
||||
/**
|
||||
* 列表
|
||||
*/
|
||||
@RequestMapping("/list")
|
||||
@PostMapping("/list")
|
||||
// @RequiresPermissions("staff:structure:list")
|
||||
public List<DepartmentsDto> list() {
|
||||
List<DepartmentsDto> departmentList = departmentsService.getDepartmentTree();
|
||||
List<DepartmentsDto> departmentList = departmentsService.getDepartmentTree(0);
|
||||
|
||||
return departmentList;
|
||||
}
|
||||
|
||||
@GetMapping("/deplist")
|
||||
// @RequiresPermissions("staff:structure:list")
|
||||
@ApiOperation("获取全部有效部门树列表")
|
||||
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = DepartmentsDto.class)})
|
||||
public R deplist(@RequestParam @ApiParam(value = "请求类型0 请求部门不包含人员列表,1同时返回人员列表") int type) {
|
||||
List<DepartmentsDto> departmentList = departmentsService.getDepartmentTree(type);
|
||||
|
||||
return R.ok().put("data", departmentList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
|
||||
@ -104,7 +104,7 @@ public class ReportResultController extends AbstractController{
|
||||
public R departmentTreeByStaffId(){
|
||||
Long userId = getUserId();
|
||||
if(chartService.hrOrBoss(userId)){
|
||||
List<DepartmentsDto> data = departmentsService.getDepartmentTree();
|
||||
List<DepartmentsDto> data = departmentsService.getDepartmentTree(0);
|
||||
return R.ok().put("data",data);
|
||||
}
|
||||
if(chartService.leader(getUserId())){
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.lz.modules.app.controller;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.StaffEntity;
|
||||
import com.lz.modules.app.enums.ExcelStaffHeardEnum;
|
||||
import com.lz.modules.app.req.StaffReq;
|
||||
import com.lz.modules.app.service.*;
|
||||
import io.swagger.annotations.*;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
@ -30,6 +34,7 @@ import java.util.*;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("staff/info")
|
||||
@Api(tags = "人员相关")
|
||||
public class StaffController {
|
||||
|
||||
@Autowired
|
||||
@ -96,6 +101,34 @@ public class StaffController {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 信息
|
||||
|
||||
@ -82,4 +82,6 @@ public interface StaffDao extends BaseMapper<StaffEntity> {
|
||||
List<ReportProgressListDto> getPositionByStaffIds(@Param("req") ReportListReq req, @Param("staffIds") List<String> staffIds, @Param("page") IPage page);
|
||||
|
||||
List<StaffSimpleDto> selectStaffSimpleInfoByIds(@Param("ids") List<Long> ids);
|
||||
|
||||
List<StaffDto> getDepatAllStaffInfos(@Param("departmentId") String departmentId);
|
||||
}
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
package com.lz.modules.app.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@ -15,32 +17,42 @@ import java.util.List;
|
||||
* @date 2020-04-30 16:59:50
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("部门信息Dto")
|
||||
public class DepartmentsDto implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
/**
|
||||
* 飞书部门id
|
||||
*/
|
||||
@ApiModelProperty(value = "部门id,钉钉,飞书部门id", name = "departmentId")
|
||||
private String departmentId;
|
||||
/**
|
||||
* 飞书上级部门id
|
||||
*/
|
||||
@ApiModelProperty(value = "钉钉,飞书上级部门id", name = "departmentParentId")
|
||||
private String departmentParentId;
|
||||
/**
|
||||
* 飞书显示部门人数
|
||||
*/
|
||||
@ApiModelProperty(value = "部门人员数量", name = "memberCount")
|
||||
private Integer memberCount;
|
||||
/**
|
||||
* 组织架构名称/部门名称
|
||||
*/
|
||||
@ApiModelProperty(value = "部门名称", name = "departmentName")
|
||||
private String departmentName;
|
||||
/**
|
||||
* ztree属性
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "部门id", name = "id")
|
||||
private Boolean open;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "部门id", name = "id")
|
||||
private List<?> list;
|
||||
@ApiModelProperty(value = "部门人员集合", name = "staffDtos")
|
||||
private List<StaffDto> staffDtos;
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
package com.lz.modules.app.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门表
|
||||
*
|
||||
* @author fumeiai
|
||||
* @email fumeiai@linzikg.com
|
||||
* @date 2020-04-30 16:59:50
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("部门简单信息Dto")
|
||||
public class DepartmentsSimpleDto implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty(value = "部门id", name = "id")
|
||||
private Integer id;
|
||||
/**
|
||||
* 飞书显示部门人数
|
||||
*/
|
||||
@ApiModelProperty(value = "部门人数", name = "memberCount")
|
||||
private Integer memberCount;
|
||||
/**
|
||||
* 组织架构名称/部门名称
|
||||
*/
|
||||
@ApiModelProperty(value = "部门名称", name = "departmentName")
|
||||
private String departmentName;
|
||||
|
||||
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
package com.lz.modules.app.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@ -12,33 +14,40 @@ import java.io.Serializable;
|
||||
* @date 2020-04-29 20:59:20
|
||||
*/
|
||||
@Data
|
||||
@ApiModel("员工Dto")
|
||||
public class StaffDto implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 员工Id
|
||||
*/
|
||||
@ApiModelProperty(name = "staffId", value = "员工id")
|
||||
private Long staffId;
|
||||
|
||||
/**
|
||||
* 员工工号
|
||||
*/
|
||||
@ApiModelProperty(name = "staffNo", value = "工号")
|
||||
private String staffNo;
|
||||
/**
|
||||
* 员工姓名
|
||||
*/
|
||||
@ApiModelProperty(name = "value", value = "姓名")
|
||||
private String name;
|
||||
/**
|
||||
* 职位
|
||||
*/
|
||||
@ApiModelProperty(name = "position", value = "职位")
|
||||
private String position;
|
||||
/**
|
||||
* 人员状态【1:离职;0:在职】
|
||||
*/
|
||||
@ApiModelProperty(name = "staffStatus", value = "在职状态")
|
||||
private String staffStatus;
|
||||
/**
|
||||
* 是否是部门负责人
|
||||
*/
|
||||
@ApiModelProperty(name = "departmentLeader", value = "是否部门领导")
|
||||
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;
|
||||
|
||||
}
|
||||
@ -27,7 +27,7 @@ public interface DepartmentsService extends IService<DepartmentsEntity> {
|
||||
|
||||
|
||||
|
||||
List<DepartmentsDto> getDepartmentTree();
|
||||
List<DepartmentsDto> getDepartmentTree(int type);
|
||||
|
||||
List<DepartmentsDto> selectByParentDepartmentId(String deparentId);
|
||||
|
||||
|
||||
@ -84,5 +84,7 @@ public interface StaffService extends IService<StaffEntity> {
|
||||
List<StaffEntity> selectAll();
|
||||
|
||||
List<StaffSimpleDto> selectStaffSimpleInfoByIds(List<Long> ids);
|
||||
|
||||
List<StaffDto> getDepatAllStaffInfos(String departmentId);
|
||||
}
|
||||
|
||||
|
||||
@ -13,14 +13,17 @@ import com.lz.modules.app.dao.StaffDao;
|
||||
import com.lz.modules.app.dto.DepartmentInfos;
|
||||
import com.lz.modules.app.dto.DepartmentsDto;
|
||||
import com.lz.modules.app.dto.StaffDepartmentDto;
|
||||
import com.lz.modules.app.dto.StaffDto;
|
||||
import com.lz.modules.app.entity.DepartmentsEntity;
|
||||
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
|
||||
import com.lz.modules.app.entity.StaffEntity;
|
||||
import com.lz.modules.app.service.DepartmentsService;
|
||||
import com.lz.modules.app.service.StaffService;
|
||||
import com.lz.modules.job.model.responseBo.DepartmentInfosBo;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@ -37,6 +40,9 @@ public class DepartmentsServiceImpl extends ServiceImpl<DepartmentsDao, Departme
|
||||
@Resource
|
||||
DepartmentsStaffRelateDao departmentsStaffRelateDao;
|
||||
|
||||
@Autowired
|
||||
StaffService staffService;
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
IPage<DepartmentsEntity> page = this.page(
|
||||
@ -62,9 +68,17 @@ public class DepartmentsServiceImpl extends ServiceImpl<DepartmentsDao, Departme
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DepartmentsDto> getDepartmentTree() {
|
||||
public List<DepartmentsDto> getDepartmentTree(int type) {
|
||||
List<DepartmentsDto> departmentsParentsList = departmentsDao.getDepartmentsByparentId("1");
|
||||
getDepartmentTreeList(departmentsParentsList);
|
||||
if(type == 1){
|
||||
for (DepartmentsDto dto: departmentsParentsList
|
||||
) {
|
||||
List<StaffDto> staffDtos = staffService.getDepatAllStaffInfos(dto.getDepartmentId());
|
||||
dto.setStaffDtos(staffDtos);
|
||||
}
|
||||
}
|
||||
|
||||
getDepartmentTreeList(departmentsParentsList, type);
|
||||
return departmentsParentsList;
|
||||
}
|
||||
|
||||
@ -98,12 +112,17 @@ public class DepartmentsServiceImpl extends ServiceImpl<DepartmentsDao, Departme
|
||||
return staffDepartmentDto;
|
||||
}
|
||||
|
||||
private List<DepartmentsDto> getDepartmentTreeList(List<DepartmentsDto> departmentList) {
|
||||
private List<DepartmentsDto> getDepartmentTreeList(List<DepartmentsDto> departmentList, int type) {
|
||||
List<DepartmentsDto> DepartmentsList = Lists.newArrayList();
|
||||
for (DepartmentsDto departmentsDto : departmentList) {
|
||||
List<DepartmentsDto> departmentsChirdList = departmentsDao.getDepartmentsByparentId(departmentsDto.getDepartmentId());
|
||||
if (departmentsChirdList.size() > 0) {
|
||||
departmentsDto.setList(getDepartmentTreeList(departmentsChirdList));
|
||||
departmentsDto.setList(getDepartmentTreeList(departmentsChirdList, type));
|
||||
}
|
||||
if(type == 1){
|
||||
List<StaffDto> staffDtos = staffService.getDepatAllStaffInfos(departmentsDto.getDepartmentId());
|
||||
departmentsDto.setStaffDtos(staffDtos);
|
||||
|
||||
}
|
||||
DepartmentsList.add(departmentsDto);
|
||||
}
|
||||
@ -232,7 +251,7 @@ public class DepartmentsServiceImpl extends ServiceImpl<DepartmentsDao, Departme
|
||||
public List<DepartmentsDto> getDepartmentTreeByStaffId(String staffId,boolean containSelf) {
|
||||
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateDao.selectByStaffId(Long.valueOf(staffId));
|
||||
List<DepartmentsDto> departmentsParentsList = departmentsDao.getDepartmentsByparentId(departmentsStaffRelateEntity.getDepartmentId());
|
||||
getDepartmentTreeList(departmentsParentsList);
|
||||
getDepartmentTreeList(departmentsParentsList, 0);
|
||||
if(containSelf){
|
||||
List<DepartmentsDto> result = new ArrayList<>();
|
||||
DepartmentsDto departmentsDto = new DepartmentsDto();
|
||||
|
||||
@ -458,6 +458,11 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
|
||||
return staffDao.selectStaffSimpleInfoByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StaffDto> getDepatAllStaffInfos(String departmentId){
|
||||
return staffDao.getDepatAllStaffInfos(departmentId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ package com.lz.modules.flow.dao;
|
||||
* @since 2020-08-18
|
||||
*/
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.lz.modules.app.dto.DepartmentsSimpleDto;
|
||||
import com.lz.modules.flow.entity.StaffRoleDepartment;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -42,4 +43,6 @@ public interface StaffRoleDepartmentMapper extends BaseMapper<StaffRoleDepartmen
|
||||
void deleteStaffRoleDepartment(@Param("id") Long id);
|
||||
|
||||
List<StaffRoleDepartment> selectStaffRoleDepartmentByStaffRoleIdDepartments(@Param("staffRoleId") Long staffRoleId, @Param("departments") List<String> departments);
|
||||
|
||||
List<DepartmentsSimpleDto> selectDepartmentSimpleInfos(@Param("ids") List<String> ids);
|
||||
}
|
||||
@ -1,7 +1,12 @@
|
||||
package com.lz.modules.flow.model;
|
||||
import com.lz.modules.app.dto.DepartmentsSimpleDto;
|
||||
import com.lz.modules.app.dto.StaffSimpleDto;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* </p>*考评组表
|
||||
@ -19,20 +24,18 @@ public class EvaluationGroupDto {
|
||||
@ApiModelProperty(value = "", name = "name")
|
||||
private String name;
|
||||
//绩效管理员ID,system_user,id,逗号隔开
|
||||
@ApiModelProperty(value = "绩效管理员ID,system_user,id,逗号隔开", name = "managerIds")
|
||||
private Long managerIds;
|
||||
@ApiModelProperty(value = "绩效管理员集合,如果人员离职不会返回", name = "managerIds")
|
||||
private List<StaffSimpleDto> managers;
|
||||
//参与部门id,逗号隔开
|
||||
@ApiModelProperty(value = "参与部门id,逗号隔开", name = "depIds")
|
||||
private Long depIds;
|
||||
@ApiModelProperty(value = "参与部门集合,如果部门不存在不会返回", name = "deps")
|
||||
private List<DepartmentsSimpleDto> deps;
|
||||
//参与考核员工staff_id,逗号隔开
|
||||
@ApiModelProperty(value = "参与考核员工staff_id,逗号隔开", name = "staffIds")
|
||||
private Long staffIds;
|
||||
@ApiModelProperty(value = "参与考核员集合,如果人员离职不会返回", name = "staffs")
|
||||
private List<StaffSimpleDto> staffs;
|
||||
//0部门,1人员
|
||||
@ApiModelProperty(value = "0部门,1人员", name = "inType")
|
||||
private Integer inType;
|
||||
//排除人员ids,逗号隔开
|
||||
@ApiModelProperty(value = "排除人员ids,逗号隔开", name = "outIds")
|
||||
private Long outIds;
|
||||
@ApiModelProperty(value = "排除人员集合,如果人员离职不会返回", name = "outs")
|
||||
private List<StaffSimpleDto> outs;
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
@ -63,91 +66,18 @@ public class EvaluationGroupDto {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 绩效管理员ID,system_user,id,逗号隔开
|
||||
* @return
|
||||
*/
|
||||
public Long getManagerIds() {
|
||||
return managerIds;
|
||||
}
|
||||
/**
|
||||
* 绩效管理员ID,system_user,id,逗号隔开
|
||||
* @param managerIds
|
||||
*/
|
||||
public void setManagerIds(Long managerIds) {
|
||||
this.managerIds = managerIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 参与部门id,逗号隔开
|
||||
* @return
|
||||
*/
|
||||
public Long getDepIds() {
|
||||
return depIds;
|
||||
}
|
||||
/**
|
||||
* 参与部门id,逗号隔开
|
||||
* @param depIds
|
||||
*/
|
||||
public void setDepIds(Long depIds) {
|
||||
this.depIds = depIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 参与考核员工staff_id,逗号隔开
|
||||
* @return
|
||||
*/
|
||||
public Long getStaffIds() {
|
||||
return staffIds;
|
||||
}
|
||||
/**
|
||||
* 参与考核员工staff_id,逗号隔开
|
||||
* @param staffIds
|
||||
*/
|
||||
public void setStaffIds(Long staffIds) {
|
||||
this.staffIds = staffIds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 0部门,1人员
|
||||
* @return
|
||||
*/
|
||||
public Integer getInType() {
|
||||
return inType;
|
||||
}
|
||||
/**
|
||||
* 0部门,1人员
|
||||
* @param inType
|
||||
*/
|
||||
public void setInType(Integer inType) {
|
||||
this.inType = inType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 排除人员ids,逗号隔开
|
||||
* @return
|
||||
*/
|
||||
public Long getOutIds() {
|
||||
return outIds;
|
||||
}
|
||||
/**
|
||||
* 排除人员ids,逗号隔开
|
||||
* @param outIds
|
||||
*/
|
||||
public void setOutIds(Long outIds) {
|
||||
this.outIds = outIds;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "EvaluationGroup{" +
|
||||
",id=" + id +
|
||||
",name=" + name +
|
||||
",managerIds=" + managerIds +
|
||||
",depIds=" + depIds +
|
||||
",staffIds=" + staffIds +
|
||||
",inType=" + inType +
|
||||
",outIds=" + outIds +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.lz.modules.flow.service.impl;
|
||||
package com.lz.modules.flow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.lz.modules.flow.entity.ResultCalculate;
|
||||
@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.lz.modules.flow.dao.ResultCalculateMapper;
|
||||
import com.lz.modules.flow.entity.ResultCalculate;
|
||||
import com.lz.modules.flow.model.ResultCalculateDto;
|
||||
import com.lz.modules.flow.service.impl.ResultCalculateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.lz.modules.flow.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.lz.modules.app.dto.DepartmentsSimpleDto;
|
||||
import com.lz.modules.flow.entity.StaffRoleDepartment;
|
||||
|
||||
import java.util.List;
|
||||
@ -39,4 +40,6 @@ public interface StaffRoleDepartmentService extends IService<StaffRoleDepartment
|
||||
StaffRoleDepartment selectStaffRoleDepartmentByDepartmentIdRoleIds(Long menuId, List<Long> ids);
|
||||
|
||||
void deleteStaffRoleDepartment(Long id);
|
||||
|
||||
List<DepartmentsSimpleDto> selectDepartmentSimpleInfos(List<String> ids);
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package com.lz.modules.flow.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.lz.modules.app.dto.DepartmentsSimpleDto;
|
||||
import com.lz.modules.flow.dao.StaffRoleDepartmentMapper;
|
||||
import com.lz.modules.flow.entity.StaffRoleDepartment;
|
||||
import com.lz.modules.flow.service.StaffRoleDepartmentService;
|
||||
@ -80,5 +81,10 @@ public class StaffRoleDepartmentServiceImpl extends ServiceImpl<StaffRoleDepartm
|
||||
staffRoleDepartmentMapper.deleteStaffRoleDepartment(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DepartmentsSimpleDto> selectDepartmentSimpleInfos(List<String> ids){
|
||||
return staffRoleDepartmentMapper.selectDepartmentSimpleInfos(ids);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -5,20 +5,29 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.common.utils.R;
|
||||
import com.lz.common.utils.StringUtil;
|
||||
import com.lz.modules.app.dto.DepartmentsSimpleDto;
|
||||
import com.lz.modules.app.dto.StaffSimpleDto;
|
||||
import com.lz.modules.app.service.StaffService;
|
||||
import com.lz.modules.flow.entity.EvaluationGroup;
|
||||
import com.lz.modules.flow.entity.FlowManager;
|
||||
import com.lz.modules.flow.entity.ResultModel;
|
||||
import com.lz.modules.flow.model.EvaluationGroupDto;
|
||||
import com.lz.modules.flow.req.EvaluationGroupReq;
|
||||
import com.lz.modules.flow.service.EvaluationGroupService;
|
||||
import com.lz.modules.flow.service.FlowManagerService;
|
||||
import com.lz.modules.flow.service.ResultModelService;
|
||||
import com.lz.modules.flow.service.StaffRoleDepartmentService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/evaluationGroup")
|
||||
@ -34,21 +43,87 @@ public class EvaluationGroupController {
|
||||
@Autowired
|
||||
private ResultModelService resultModelService;
|
||||
|
||||
@Autowired
|
||||
private StaffService staffService;
|
||||
|
||||
@Autowired
|
||||
private StaffRoleDepartmentService staffRoleDepartmentService;
|
||||
|
||||
|
||||
|
||||
|
||||
@PostMapping("/getById")
|
||||
@GetMapping("/getById")
|
||||
@ApiOperation("获取考核组详情")
|
||||
@ApiResponses({@ApiResponse(code=200,message = "成功", response= EvaluationGroupDto.class)})
|
||||
public R getById(@RequestParam @ApiParam("考核组id") Long id) {
|
||||
EvaluationGroup evaluationGroup = evaluationGroupService.selectEvaluationGroupById(id);
|
||||
EvaluationGroupDto evaluationGroupDto = new EvaluationGroupDto();
|
||||
if(evaluationGroup.getDepIds() != null && evaluationGroup.getDepIds().length() > 0){
|
||||
|
||||
List<String> ids = Arrays.stream(evaluationGroup.getDepIds().split(",")).map(new Function<String, String>() {
|
||||
@Override
|
||||
public String apply(String s) {
|
||||
return s;
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
List<DepartmentsSimpleDto> departmentsSimpleDtos = staffRoleDepartmentService.selectDepartmentSimpleInfos(ids);
|
||||
evaluationGroupDto.setDeps(departmentsSimpleDtos);
|
||||
}
|
||||
if(evaluationGroup.getStaffIds() != null && evaluationGroup.getStaffIds().length() > 0){
|
||||
List<Long> ids = Arrays.stream(evaluationGroup.getStaffIds().split(",")).map(new Function<String, Long>() {
|
||||
@Override
|
||||
public Long apply(String s) {
|
||||
return Long.parseLong(s);
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
//指定人员,搜索人员信息
|
||||
List<StaffSimpleDto> staffSimpleDtos = staffService.selectStaffSimpleInfoByIds(ids);
|
||||
evaluationGroupDto.setStaffs(staffSimpleDtos);
|
||||
}
|
||||
|
||||
if(evaluationGroup.getManagerIds() != null && evaluationGroup.getManagerIds().length() > 0){
|
||||
List<Long> ids = Arrays.stream(evaluationGroup.getManagerIds().split(",")).map(new Function<String, Long>() {
|
||||
@Override
|
||||
public Long apply(String s) {
|
||||
return Long.parseLong(s);
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
//指定人员,搜索人员信息
|
||||
List<StaffSimpleDto> staffSimpleDtos = staffService.selectStaffSimpleInfoByIds(ids);
|
||||
evaluationGroupDto.setManagers(staffSimpleDtos);
|
||||
}
|
||||
if(evaluationGroup.getOutIds() != null && evaluationGroup.getOutIds().length() > 0){
|
||||
List<Long> ids = Arrays.stream(evaluationGroup.getOutIds().split(",")).map(new Function<String, Long>() {
|
||||
@Override
|
||||
public Long apply(String s) {
|
||||
return Long.parseLong(s);
|
||||
}
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
//指定人员,搜索人员信息
|
||||
List<StaffSimpleDto> staffSimpleDtos = staffService.selectStaffSimpleInfoByIds(ids);
|
||||
evaluationGroupDto.setOuts(staffSimpleDtos);
|
||||
}
|
||||
|
||||
BeanUtils.copyProperties(evaluationGroup, evaluationGroupDto);
|
||||
return R.ok().put("data",evaluationGroupDto);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getGroups")
|
||||
@ApiOperation("获取考核组列表")
|
||||
@ApiResponses({@ApiResponse(code=200,message = "成功", response=EvaluationGroup.class)})
|
||||
public R getById(@RequestBody @ApiParam EvaluationGroupReq req) {
|
||||
public R getGroups(@RequestBody @ApiParam EvaluationGroupReq req) {
|
||||
PageUtils pageUtils = evaluationGroupService.selectEvaluationGroupByReq(req);
|
||||
return R.ok().put("data",pageUtils);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody EvaluationGroup evaluationGroup) {
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("编辑考核组")
|
||||
public R update(@RequestBody @ApiParam EvaluationGroup evaluationGroup) {
|
||||
evaluationGroupService.updateEvaluationGroupById(evaluationGroup);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -90,6 +90,20 @@ public class FlowChartController {
|
||||
return R.ok().put("data", flowChartDetailRecord);
|
||||
}
|
||||
|
||||
@PostMapping("/updateDetailProc")
|
||||
@ApiOperation("编辑流程节点小流程")
|
||||
public R updateDetailProc(@RequestBody @ApiParam FlowChartDetailRecord flowChartDetailRecord) {
|
||||
flowChartDetailRecordService.updateFlowChartDetailRecordById(flowChartDetailRecord);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PostMapping("/deleteDetailProc")
|
||||
@ApiOperation("删除流程节点小流程")
|
||||
public R deleteDetailProc(@RequestParam @ApiParam(value = "节点流程id", name = "id") Long id) {
|
||||
flowChartDetailRecordService.deleteFlowChartDetailRecordById(id);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@GetMapping("/getDetailProc")
|
||||
@ApiOperation("获取已保存的考核节点详情")
|
||||
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = FlowChartDetailRecordDto.class)})
|
||||
|
||||
@ -7,6 +7,7 @@ import com.lz.common.utils.R;
|
||||
import com.lz.common.utils.StringUtil;
|
||||
import com.lz.modules.flow.entity.FlowStart;
|
||||
import com.lz.modules.flow.service.FlowStartService;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@ -17,6 +18,7 @@ import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/flowStart")
|
||||
@Api(tags = "发起考核")
|
||||
public class FlowStartController {
|
||||
|
||||
|
||||
|
||||
@ -1,14 +1,10 @@
|
||||
package com.lz.modules.performance.controller;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.lz.common.utils.PageUtils;
|
||||
import com.lz.common.utils.R;
|
||||
import com.lz.common.utils.StringUtil;
|
||||
import com.lz.modules.flow.entity.FlowChart;
|
||||
import com.lz.modules.flow.entity.ResultCalculate;
|
||||
import com.lz.modules.flow.model.ResultCalculateDto;
|
||||
import com.lz.modules.flow.service.impl.ResultCalculateService;
|
||||
import com.lz.modules.flow.service.ResultCalculateService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiResponse;
|
||||
@ -19,9 +15,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/resultCalculate")
|
||||
|
||||
@ -49,8 +49,9 @@ public class ResultModelController {
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/update")
|
||||
public R update(@RequestBody ResultModel resultModel) {
|
||||
@PostMapping("/update")
|
||||
@ApiOperation("编辑考核模板")
|
||||
public R update(@RequestBody @ApiParam ResultModel resultModel) {
|
||||
resultModelService.updateResultModelById(resultModel);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@ -111,5 +111,14 @@
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectDepartmentSimpleInfos"
|
||||
resultType="com.lz.modules.app.dto.DepartmentsSimpleDto">
|
||||
select id, member_count, department_name from lz_departments where is_delete = 0
|
||||
and department_id in
|
||||
<foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
</select>
|
||||
|
||||
<select id="getDepartmentsByparentId" resultType="com.lz.modules.app.dto.DepartmentsDto">
|
||||
select department_id,department_parent_id,member_count,department_name from lz_departments where department_parent_id=#{parentId}
|
||||
select id, department_id,department_parent_id,member_count,department_name from lz_departments where department_parent_id=#{parentId}
|
||||
</select>
|
||||
|
||||
<update id="updateDepartment">
|
||||
|
||||
@ -469,4 +469,14 @@
|
||||
</foreach>
|
||||
) and occupation.staff_status=0
|
||||
</select>
|
||||
|
||||
<select id="getDepatAllStaffInfos" resultType="com.lz.modules.app.dto.StaffDto">
|
||||
select jj.staff_id, jj.name, jj.department_leader, occ.position as position,
|
||||
case occ.staff_status when 0 then '在职' else '离职' end staff_status
|
||||
from (select staff.id as staff_id, staff.name as name, relate.is_leader as department_leader
|
||||
from lz_departments_staff_relate relate join lz_staff staff on staff.id = relate.staff_id
|
||||
where relate.department_id = #{departmentId} and relate.is_delete=0 and staff.is_delete=0) jj
|
||||
join lz_staff_occupation occ on jj.staff_id=occ.staff_id where occ.staff_status=0 and occ.is_delete=0
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user