Merge branch 'version_performance_2.0' of http://gitlab.ldxinyong.com/enterpriseManagement/lz_management into version_performance_2.0

This commit is contained in:
杜建超 2020-10-20 17:03:42 +08:00
commit 47bc97664e
26 changed files with 321 additions and 114 deletions

View File

@ -4,12 +4,10 @@ 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.*;
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 +23,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,14 +31,25 @@ public class DepartmentsController {
/** /**
* 列表 * 列表
*/ */
@RequestMapping("/list") @PostMapping("/list")
// @RequiresPermissions("staff:structure:list") // @RequiresPermissions("staff:structure:list")
public List<DepartmentsDto> list() { public List<DepartmentsDto> list() {
List<DepartmentsDto> departmentList = departmentsService.getDepartmentTree(); List<DepartmentsDto> departmentList = departmentsService.getDepartmentTree(0);
return departmentList; 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);
}
/** /**
* 信息 * 信息

View File

@ -104,7 +104,7 @@ public class ReportResultController extends AbstractController{
public R departmentTreeByStaffId(){ public R departmentTreeByStaffId(){
Long userId = getUserId(); Long userId = getUserId();
if(chartService.hrOrBoss(userId)){ if(chartService.hrOrBoss(userId)){
List<DepartmentsDto> data = departmentsService.getDepartmentTree(); List<DepartmentsDto> data = departmentsService.getDepartmentTree(0);
return R.ok().put("data",data); return R.ok().put("data",data);
} }
if(chartService.leader(getUserId())){ if(chartService.leader(getUserId())){

View File

@ -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);
}
/** /**
* 信息 * 信息

View File

@ -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<ReportProgressListDto> getPositionByStaffIds(@Param("req") ReportListReq req, @Param("staffIds") List<String> staffIds, @Param("page") IPage page);
List<StaffSimpleDto> selectStaffSimpleInfoByIds(@Param("ids") List<Long> ids); List<StaffSimpleDto> selectStaffSimpleInfoByIds(@Param("ids") List<Long> ids);
List<StaffDto> getDepatAllStaffInfos(@Param("departmentId") String departmentId);
} }

View File

@ -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,42 @@ 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;
/** /**
* 飞书部门id * 飞书部门id
*/ */
@ApiModelProperty(value = "部门id钉钉飞书部门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;
@ApiModelProperty(value = "部门人员集合", name = "staffDtos")
private List<StaffDto> staffDtos;
} }

View File

@ -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;
}

View File

@ -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;
/** /**
* 员工姓名 * 员工姓名
*/ */
@ApiModelProperty(name = "value", value = "姓名")
private String name; private String name;
/** /**
* 职位 * 职位
*/ */
@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;
} }

View 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;
}

View File

@ -27,7 +27,7 @@ public interface DepartmentsService extends IService<DepartmentsEntity> {
List<DepartmentsDto> getDepartmentTree(); List<DepartmentsDto> getDepartmentTree(int type);
List<DepartmentsDto> selectByParentDepartmentId(String deparentId); List<DepartmentsDto> selectByParentDepartmentId(String deparentId);

View File

@ -84,5 +84,7 @@ public interface StaffService extends IService<StaffEntity> {
List<StaffEntity> selectAll(); List<StaffEntity> selectAll();
List<StaffSimpleDto> selectStaffSimpleInfoByIds(List<Long> ids); List<StaffSimpleDto> selectStaffSimpleInfoByIds(List<Long> ids);
List<StaffDto> getDepatAllStaffInfos(String departmentId);
} }

View File

@ -13,14 +13,17 @@ import com.lz.modules.app.dao.StaffDao;
import com.lz.modules.app.dto.DepartmentInfos; import com.lz.modules.app.dto.DepartmentInfos;
import com.lz.modules.app.dto.DepartmentsDto; import com.lz.modules.app.dto.DepartmentsDto;
import com.lz.modules.app.dto.StaffDepartmentDto; 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.DepartmentsEntity;
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity; import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import com.lz.modules.app.entity.StaffEntity; import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.app.service.DepartmentsService; import com.lz.modules.app.service.DepartmentsService;
import com.lz.modules.app.service.StaffService;
import com.lz.modules.job.model.responseBo.DepartmentInfosBo; import com.lz.modules.job.model.responseBo.DepartmentInfosBo;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -37,6 +40,9 @@ public class DepartmentsServiceImpl extends ServiceImpl<DepartmentsDao, Departme
@Resource @Resource
DepartmentsStaffRelateDao departmentsStaffRelateDao; DepartmentsStaffRelateDao departmentsStaffRelateDao;
@Autowired
StaffService staffService;
@Override @Override
public PageUtils queryPage(Map<String, Object> params) { public PageUtils queryPage(Map<String, Object> params) {
IPage<DepartmentsEntity> page = this.page( IPage<DepartmentsEntity> page = this.page(
@ -62,9 +68,17 @@ public class DepartmentsServiceImpl extends ServiceImpl<DepartmentsDao, Departme
} }
@Override @Override
public List<DepartmentsDto> getDepartmentTree() { public List<DepartmentsDto> getDepartmentTree(int type) {
List<DepartmentsDto> departmentsParentsList = departmentsDao.getDepartmentsByparentId("1"); 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; return departmentsParentsList;
} }
@ -98,12 +112,17 @@ public class DepartmentsServiceImpl extends ServiceImpl<DepartmentsDao, Departme
return staffDepartmentDto; return staffDepartmentDto;
} }
private List<DepartmentsDto> getDepartmentTreeList(List<DepartmentsDto> departmentList) { private List<DepartmentsDto> getDepartmentTreeList(List<DepartmentsDto> departmentList, int type) {
List<DepartmentsDto> DepartmentsList = Lists.newArrayList(); List<DepartmentsDto> DepartmentsList = Lists.newArrayList();
for (DepartmentsDto departmentsDto : departmentList) { for (DepartmentsDto departmentsDto : departmentList) {
List<DepartmentsDto> departmentsChirdList = departmentsDao.getDepartmentsByparentId(departmentsDto.getDepartmentId()); List<DepartmentsDto> departmentsChirdList = departmentsDao.getDepartmentsByparentId(departmentsDto.getDepartmentId());
if (departmentsChirdList.size() > 0) { 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); DepartmentsList.add(departmentsDto);
} }
@ -232,7 +251,7 @@ public class DepartmentsServiceImpl extends ServiceImpl<DepartmentsDao, Departme
public List<DepartmentsDto> getDepartmentTreeByStaffId(String staffId,boolean containSelf) { public List<DepartmentsDto> getDepartmentTreeByStaffId(String staffId,boolean containSelf) {
DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateDao.selectByStaffId(Long.valueOf(staffId)); DepartmentsStaffRelateEntity departmentsStaffRelateEntity = departmentsStaffRelateDao.selectByStaffId(Long.valueOf(staffId));
List<DepartmentsDto> departmentsParentsList = departmentsDao.getDepartmentsByparentId(departmentsStaffRelateEntity.getDepartmentId()); List<DepartmentsDto> departmentsParentsList = departmentsDao.getDepartmentsByparentId(departmentsStaffRelateEntity.getDepartmentId());
getDepartmentTreeList(departmentsParentsList); getDepartmentTreeList(departmentsParentsList, 0);
if(containSelf){ if(containSelf){
List<DepartmentsDto> result = new ArrayList<>(); List<DepartmentsDto> result = new ArrayList<>();
DepartmentsDto departmentsDto = new DepartmentsDto(); DepartmentsDto departmentsDto = new DepartmentsDto();

View File

@ -458,6 +458,11 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
return staffDao.selectStaffSimpleInfoByIds(ids); return staffDao.selectStaffSimpleInfoByIds(ids);
} }
@Override
public List<StaffDto> getDepatAllStaffInfos(String departmentId){
return staffDao.getDepatAllStaffInfos(departmentId);
}
} }

View File

@ -8,6 +8,7 @@ package com.lz.modules.flow.dao;
* @since 2020-08-18 * @since 2020-08-18
*/ */
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lz.modules.app.dto.DepartmentsSimpleDto;
import com.lz.modules.flow.entity.StaffRoleDepartment; import com.lz.modules.flow.entity.StaffRoleDepartment;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -42,4 +43,6 @@ public interface StaffRoleDepartmentMapper extends BaseMapper<StaffRoleDepartmen
void deleteStaffRoleDepartment(@Param("id") Long id); void deleteStaffRoleDepartment(@Param("id") Long id);
List<StaffRoleDepartment> selectStaffRoleDepartmentByStaffRoleIdDepartments(@Param("staffRoleId") Long staffRoleId, @Param("departments") List<String> departments); List<StaffRoleDepartment> selectStaffRoleDepartmentByStaffRoleIdDepartments(@Param("staffRoleId") Long staffRoleId, @Param("departments") List<String> departments);
List<DepartmentsSimpleDto> selectDepartmentSimpleInfos(@Param("ids") List<String> ids);
} }

View File

@ -1,7 +1,12 @@
package com.lz.modules.flow.model; 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.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.List;
/** /**
* <p> * <p>
* </p>*考评组表 * </p>*考评组表
@ -19,20 +24,18 @@ public class EvaluationGroupDto {
@ApiModelProperty(value = "", name = "name") @ApiModelProperty(value = "", name = "name")
private String name; private String name;
//绩效管理员IDsystem_user,id逗号隔开 //绩效管理员IDsystem_user,id逗号隔开
@ApiModelProperty(value = "绩效管理员IDsystem_user,id逗号隔开", name = "managerIds") @ApiModelProperty(value = "绩效管理员集合,如果人员离职不会返回", name = "managerIds")
private Long managerIds; private List<StaffSimpleDto> managers;
//参与部门id逗号隔开 //参与部门id逗号隔开
@ApiModelProperty(value = "参与部门id逗号隔开", name = "depIds") @ApiModelProperty(value = "参与部门集合,如果部门不存在不会返回", name = "deps")
private Long depIds; private List<DepartmentsSimpleDto> deps;
//参与考核员工staff_id逗号隔开 //参与考核员工staff_id逗号隔开
@ApiModelProperty(value = "参与考核员工staff_id逗号隔开", name = "staffIds") @ApiModelProperty(value = "参与考核员集合,如果人员离职不会返回", name = "staffs")
private Long staffIds; private List<StaffSimpleDto> staffs;
//0部门1人员 //0部门1人员
@ApiModelProperty(value = "0部门1人员", name = "inType")
private Integer inType;
//排除人员ids逗号隔开 //排除人员ids逗号隔开
@ApiModelProperty(value = "排除人员ids逗号隔开", name = "outIds") @ApiModelProperty(value = "排除人员集合,如果人员离职不会返回", name = "outs")
private Long outIds; private List<StaffSimpleDto> outs;
/** /**
* *
* @return * @return
@ -63,91 +66,18 @@ public class EvaluationGroupDto {
this.name = name; this.name = name;
} }
/**
* 绩效管理员IDsystem_user,id逗号隔开
* @return
*/
public Long getManagerIds() {
return managerIds;
}
/**
* 绩效管理员IDsystem_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 @Override
public String toString() { public String toString() {
return "EvaluationGroup{" + return "EvaluationGroup{" +
",id=" + id + ",id=" + id +
",name=" + name + ",name=" + name +
",managerIds=" + managerIds +
",depIds=" + depIds +
",staffIds=" + staffIds +
",inType=" + inType +
",outIds=" + outIds +
"}"; "}";
} }
} }

View File

@ -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.baomidou.mybatisplus.extension.service.IService;
import com.lz.modules.flow.entity.ResultCalculate; import com.lz.modules.flow.entity.ResultCalculate;

View File

@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lz.modules.flow.dao.ResultCalculateMapper; import com.lz.modules.flow.dao.ResultCalculateMapper;
import com.lz.modules.flow.entity.ResultCalculate; import com.lz.modules.flow.entity.ResultCalculate;
import com.lz.modules.flow.model.ResultCalculateDto; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;

View File

@ -1,6 +1,7 @@
package com.lz.modules.flow.service; package com.lz.modules.flow.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.modules.app.dto.DepartmentsSimpleDto;
import com.lz.modules.flow.entity.StaffRoleDepartment; import com.lz.modules.flow.entity.StaffRoleDepartment;
import java.util.List; import java.util.List;
@ -39,4 +40,6 @@ public interface StaffRoleDepartmentService extends IService<StaffRoleDepartment
StaffRoleDepartment selectStaffRoleDepartmentByDepartmentIdRoleIds(Long menuId, List<Long> ids); StaffRoleDepartment selectStaffRoleDepartmentByDepartmentIdRoleIds(Long menuId, List<Long> ids);
void deleteStaffRoleDepartment(Long id); void deleteStaffRoleDepartment(Long id);
List<DepartmentsSimpleDto> selectDepartmentSimpleInfos(List<String> ids);
} }

View File

@ -1,6 +1,7 @@
package com.lz.modules.flow.service.impl; package com.lz.modules.flow.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.dao.StaffRoleDepartmentMapper;
import com.lz.modules.flow.entity.StaffRoleDepartment; import com.lz.modules.flow.entity.StaffRoleDepartment;
import com.lz.modules.flow.service.StaffRoleDepartmentService; import com.lz.modules.flow.service.StaffRoleDepartmentService;
@ -80,5 +81,10 @@ public class StaffRoleDepartmentServiceImpl extends ServiceImpl<StaffRoleDepartm
staffRoleDepartmentMapper.deleteStaffRoleDepartment(id); staffRoleDepartmentMapper.deleteStaffRoleDepartment(id);
} }
@Override
public List<DepartmentsSimpleDto> selectDepartmentSimpleInfos(List<String> ids){
return staffRoleDepartmentMapper.selectDepartmentSimpleInfos(ids);
}
} }

View File

@ -5,20 +5,29 @@ import com.alibaba.fastjson.JSONObject;
import com.lz.common.utils.PageUtils; import com.lz.common.utils.PageUtils;
import com.lz.common.utils.R; import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil; 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.EvaluationGroup;
import com.lz.modules.flow.entity.FlowManager; import com.lz.modules.flow.entity.FlowManager;
import com.lz.modules.flow.entity.ResultModel; 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.req.EvaluationGroupReq;
import com.lz.modules.flow.service.EvaluationGroupService; import com.lz.modules.flow.service.EvaluationGroupService;
import com.lz.modules.flow.service.FlowManagerService; import com.lz.modules.flow.service.FlowManagerService;
import com.lz.modules.flow.service.ResultModelService; import com.lz.modules.flow.service.ResultModelService;
import com.lz.modules.flow.service.StaffRoleDepartmentService;
import io.swagger.annotations.*; import io.swagger.annotations.*;
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 java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
@RestController @RestController
@RequestMapping("/evaluationGroup") @RequestMapping("/evaluationGroup")
@ -34,21 +43,87 @@ public class EvaluationGroupController {
@Autowired @Autowired
private ResultModelService resultModelService; 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("获取考核组列表") @ApiOperation("获取考核组列表")
@ApiResponses({@ApiResponse(code=200,message = "成功", response=EvaluationGroup.class)}) @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); PageUtils pageUtils = evaluationGroupService.selectEvaluationGroupByReq(req);
return R.ok().put("data",pageUtils); return R.ok().put("data",pageUtils);
} }
@RequestMapping("/update") @PostMapping("/update")
public R update(@RequestBody EvaluationGroup evaluationGroup) { @ApiOperation("编辑考核组")
public R update(@RequestBody @ApiParam EvaluationGroup evaluationGroup) {
evaluationGroupService.updateEvaluationGroupById(evaluationGroup); evaluationGroupService.updateEvaluationGroupById(evaluationGroup);
return R.ok(); return R.ok();
} }

View File

@ -90,6 +90,20 @@ public class FlowChartController {
return R.ok().put("data", flowChartDetailRecord); 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") @GetMapping("/getDetailProc")
@ApiOperation("获取已保存的考核节点详情") @ApiOperation("获取已保存的考核节点详情")
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = FlowChartDetailRecordDto.class)}) @ApiResponses({@ApiResponse(code = 200, message = "成功", response = FlowChartDetailRecordDto.class)})

View File

@ -7,6 +7,7 @@ import com.lz.common.utils.R;
import com.lz.common.utils.StringUtil; import com.lz.common.utils.StringUtil;
import com.lz.modules.flow.entity.FlowStart; import com.lz.modules.flow.entity.FlowStart;
import com.lz.modules.flow.service.FlowStartService; import com.lz.modules.flow.service.FlowStartService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -17,6 +18,7 @@ import java.util.Map;
@RestController @RestController
@RequestMapping("/flowStart") @RequestMapping("/flowStart")
@Api(tags = "发起考核")
public class FlowStartController { public class FlowStartController {

View File

@ -1,14 +1,10 @@
package com.lz.modules.performance.controller; 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.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.entity.ResultCalculate;
import com.lz.modules.flow.model.ResultCalculateDto; 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.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse; 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.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
@RestController @RestController
@RequestMapping("/resultCalculate") @RequestMapping("/resultCalculate")

View File

@ -49,8 +49,9 @@ public class ResultModelController {
} }
@RequestMapping("/update") @PostMapping("/update")
public R update(@RequestBody ResultModel resultModel) { @ApiOperation("编辑考核模板")
public R update(@RequestBody @ApiParam ResultModel resultModel) {
resultModelService.updateResultModelById(resultModel); resultModelService.updateResultModelById(resultModel);
return R.ok(); return R.ok();
} }

View File

@ -111,5 +111,14 @@
</foreach> </foreach>
</select> </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> </mapper>

View File

@ -25,7 +25,7 @@
</select> </select>
<select id="getDepartmentsByparentId" resultType="com.lz.modules.app.dto.DepartmentsDto"> <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> </select>
<update id="updateDepartment"> <update id="updateDepartment">

View File

@ -469,4 +469,14 @@
</foreach> </foreach>
) and occupation.staff_status=0 ) and occupation.staff_status=0
</select> </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> </mapper>