完善
This commit is contained in:
commit
b504efd308
@ -54,6 +54,7 @@ public class ShiroConfig {
|
||||
filterMap.put("/file/**", "anon");
|
||||
filterMap.put("/user/lzstaffrole/role/**", "anon");
|
||||
filterMap.put("/user/lzresultrecord/**", "anon");
|
||||
filterMap.put("/user/lzstaffrole/listByGroupId/**", "anon");
|
||||
filterMap.put("/test/**", "anon");
|
||||
filterMap.put("/druid/**", "anon");
|
||||
filterMap.put("/app/**", "anon");
|
||||
|
||||
@ -8,6 +8,7 @@ import com.lz.common.utils.R;
|
||||
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.enums.RoleEnums;
|
||||
import com.lz.modules.app.model.RoleModel;
|
||||
import com.lz.modules.app.resp.StaffRoleModel;
|
||||
import com.lz.modules.app.service.DepartmentsService;
|
||||
@ -16,9 +17,11 @@ import com.lz.modules.app.service.StaffService;
|
||||
import com.lz.modules.flow.entity.RecordRole;
|
||||
import com.lz.modules.flow.entity.StaffRole;
|
||||
import com.lz.modules.flow.entity.StaffRoleDepartment;
|
||||
import com.lz.modules.flow.entity.StaffRoleEvaluationGroup;
|
||||
import com.lz.modules.flow.req.StaffRoleRequest;
|
||||
import com.lz.modules.flow.service.RecordRoleService;
|
||||
import com.lz.modules.flow.service.StaffRoleDepartmentService;
|
||||
import com.lz.modules.flow.service.StaffRoleEvaluationGroupService;
|
||||
import com.lz.modules.flow.service.StaffRoleService;
|
||||
import com.lz.modules.sys.entity.SysMenuEntity;
|
||||
import com.lz.modules.sys.entity.SysRoleEntity;
|
||||
@ -63,6 +66,8 @@ public class StaffRoleController {
|
||||
|
||||
@Autowired
|
||||
private DepartmentsStaffRelateService departmentsStaffRelateService;
|
||||
@Autowired
|
||||
private StaffRoleEvaluationGroupService staffRoleEvaluationGroupService;
|
||||
|
||||
/**
|
||||
* 列表
|
||||
@ -80,7 +85,7 @@ public class StaffRoleController {
|
||||
// http://localhost:8080/lz_management/user/lzstaffrole/listByGroupId?groupId=3
|
||||
@ApiImplicitParam(name = "groupId",value = "组id",defaultValue = "1",required = true, dataType = "Long",paramType = "query")
|
||||
public R listByGroupId( Long groupId ) {
|
||||
List<StaffRole> staffRoleList = staffRoleService.selectByGroupId(groupId);
|
||||
List<StaffRole> staffRoleList = staffRoleService.selectAllStaffRoleByDepartmentLevel(Arrays.asList(new String[]{RoleEnums.MASTER_PM.getName(),RoleEnums.CHILD_PM.getName()}));
|
||||
List<StaffRoleModel> staffRoles = new ArrayList<>();
|
||||
for(StaffRole staffRole:staffRoleList){
|
||||
StaffRoleModel staffRoleModel = new StaffRoleModel();
|
||||
@ -93,6 +98,14 @@ public class StaffRoleController {
|
||||
staffRoleModel.setStaffName(staffRoleModel.getStaffName() + " "+departmentsEntity.getDepartmentName());
|
||||
}
|
||||
}
|
||||
StaffRoleEvaluationGroup staffRoleEvaluationGroup = staffRoleEvaluationGroupService.selectEvaluationGroupIdsByRoleIdGroupId(staffRole.getId(),groupId);
|
||||
staffRoleModel.setIsSelect(0);
|
||||
if(staffRoleEvaluationGroup !=null){
|
||||
staffRoleModel.setIsSelect(1);
|
||||
}
|
||||
if(staffRole.getDepartmentLevel().equals(RoleEnums.MASTER_PM.getName())){
|
||||
staffRoleModel.setIsSelect(1);
|
||||
}
|
||||
staffRoles.add(staffRoleModel);
|
||||
}
|
||||
return R.ok().put("data", staffRoles);
|
||||
@ -185,7 +198,6 @@ public class StaffRoleController {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (req.getId() == null || req.getId() <= 0) {
|
||||
staffRoleService.insertStaffRole(staffRole);
|
||||
} else {
|
||||
|
||||
@ -21,10 +21,6 @@ public class StaffRoleModel {
|
||||
@ApiModelProperty(value = "组id", name = "evaluationGroupId")
|
||||
private Long evaluationGroupId;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//是否是必选
|
||||
@ApiModelProperty(value = "是否是必选,0不是必选,1必选", name = "isSelect")
|
||||
private Integer isSelect;
|
||||
|
||||
@ -41,5 +41,9 @@ public interface StaffRoleEvaluationGroupMapper extends BaseMapper<StaffRoleEval
|
||||
|
||||
void deleteStaffRoleEvaluationGroupByRoleId(@Param("roleId") Long roleId);
|
||||
|
||||
|
||||
List<StaffRoleEvaluationGroup> selectStaffRoleEvaluationsGroupByStaffRoles(@Param("list") List<StaffRole> staffRoles);
|
||||
|
||||
StaffRoleEvaluationGroup selectEvaluationGroupIdsByRoleIdGroupId(@Param("roleId") Long roleId, @Param("groupId") Long groupId);
|
||||
|
||||
}
|
||||
@ -62,4 +62,8 @@ public interface StaffRoleMapper extends BaseMapper<StaffRole> {
|
||||
List<StaffRole> selectMastRoles();
|
||||
|
||||
List<StaffRole> selectAllGroupManageRoles();
|
||||
List<StaffRole> selectAllStaffRoleByDepartmentLevel(@Param("departmentLevels") List<String> departmentLevels);
|
||||
|
||||
StaffRole selectStaffRolesByStaffIdDepartmentLevelList(@Param("staffId") Long staffId, @Param("departmentLevels") List<String> departmentLevels);
|
||||
|
||||
}
|
||||
@ -40,5 +40,9 @@ public interface StaffRoleEvaluationGroupService extends IService<StaffRoleEvalu
|
||||
|
||||
void deleteStaffRoleEvaluationGroupByRoleId(Long roleId);
|
||||
|
||||
|
||||
List<StaffRoleEvaluationGroup> selectStaffRoleEvaluationsGroupByStaffRoles(List<StaffRole> staffRoles);
|
||||
|
||||
StaffRoleEvaluationGroup selectEvaluationGroupIdsByRoleIdGroupId(Long roleId, Long groupId);
|
||||
|
||||
}
|
||||
@ -65,9 +65,11 @@ public interface StaffRoleService extends IService<StaffRole> {
|
||||
List<StaffRole> selectAllByStaffId(Long userId);
|
||||
|
||||
Map<String, Integer> getRoleByUserId(Long userId);
|
||||
|
||||
//获取主管理员
|
||||
List<StaffRole> selectMastRoles();
|
||||
//获取管理全部考评组
|
||||
List<StaffRole> selectAllGroupManageRoles();
|
||||
List<StaffRole> selectAllStaffRoleByDepartmentLevel(List<String> asList);
|
||||
|
||||
List<StaffRole> selectByEvaluationGroupId(Long id);
|
||||
}
|
||||
@ -72,7 +72,13 @@ public class StaffRoleEvaluationGroupServiceImpl extends ServiceImpl<StaffRoleEv
|
||||
staffRoleEvaluationGroupMapper.deleteStaffRoleEvaluationGroupByRoleId(roleId);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public StaffRoleEvaluationGroup selectEvaluationGroupIdsByRoleIdGroupId(Long roleId, Long groupId) {
|
||||
|
||||
return staffRoleEvaluationGroupMapper.selectEvaluationGroupIdsByRoleIdGroupId(roleId,groupId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Long> selectEvaluationGroupIdsByRoleId(Long roleId) {
|
||||
return staffRoleEvaluationGroupMapper.selectEvaluationGroupIdsByRoleId(roleId);
|
||||
}
|
||||
|
||||
@ -37,10 +37,8 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@ -410,8 +408,15 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
||||
RoleEnums.MASTER_PM.getName().equals(staffRole.getDepartmentLevel())) {
|
||||
return R.ok("更新成功");
|
||||
}
|
||||
} else if (roleModel.getStaffId() != null) { // 员工不为空
|
||||
StaffRole data = staffRoleMapper.selectStaffRolesByStaffIdDepartmentLevel(roleModel.getStaffId(), roleModel.getDepartmentLevel());
|
||||
} else if (roleModel.getStaffId() != null) { // 员工不为空,表示是新增数据
|
||||
StaffRole data = null;
|
||||
if(RoleEnums.CHILD_PM.getName().equals(roleModel.getDepartmentLevel()) //如果是主管理员,或者是子管理员,主管理员和子管理员不能同时存在
|
||||
|| RoleEnums.MASTER_PM.getName().equals(roleModel.getDepartmentLevel())){
|
||||
data = staffRoleMapper.selectStaffRolesByStaffIdDepartmentLevelList(roleModel.getStaffId(),
|
||||
Arrays.asList(new String[]{RoleEnums.CHILD_PM.getName(),RoleEnums.MASTER_PM.getName()}));
|
||||
} else {
|
||||
data = staffRoleMapper.selectStaffRolesByStaffIdDepartmentLevel(roleModel.getStaffId(), roleModel.getDepartmentLevel());
|
||||
}
|
||||
if (data != null) {
|
||||
return R.error("该管理员己经存在");
|
||||
}
|
||||
@ -426,12 +431,12 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
||||
} else if (RoleEnums.MASTER_PM.getName().equals(staffRole.getDepartmentLevel())) {
|
||||
insertPM(staffRole, RoleMenuEnums.MASTER_PM.getType(), staffEntity);
|
||||
} else if (RoleEnums.CHILD_PM.getName().equals(staffRole.getDepartmentLevel())) { //如果是子管理员
|
||||
for (Long evaluationGroupId : evaluationGroupInfoIds) {
|
||||
StaffRoleEvaluationGroup evaluationGroup = new StaffRoleEvaluationGroup();
|
||||
evaluationGroup.setIsSelect(1);
|
||||
evaluationGroup.setRoleId(staffRole.getId());
|
||||
evaluationGroup.setEvaluationGroupId(evaluationGroupId);
|
||||
staffRoleEvaluationGroupService.insertStaffRoleEvaluationGroup(evaluationGroup);
|
||||
if(new Long(0).equals(roleModel.getEvaluationGroupId())){//全部考评组
|
||||
insertStaffRoleEvaluationGroup(staffRole.getId(),0l);
|
||||
}else{///部分考评组
|
||||
for (Long evaluationGroupId : evaluationGroupInfoIds) {
|
||||
insertStaffRoleEvaluationGroup(staffRole.getId(),evaluationGroupId);
|
||||
}
|
||||
}
|
||||
if (roleModel.getDepartmentId().equals(DepartmentPMEnums.SELF_DEPARTMENT.getType().toString())) {//如果是自己所在部门
|
||||
departmentInfoIds.clear();
|
||||
@ -446,6 +451,7 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
||||
staffRoleDepartment.setDepartmentName(departmentsEntity.getDepartmentName());
|
||||
staffRoleDepartmentService.insertStaffRoleDepartment(staffRoleDepartment);
|
||||
}
|
||||
|
||||
for (Long staffMenuId : selectStaffMenuInfoIdIds) {
|
||||
StaffRoleMenu staffRoleMenu = new StaffRoleMenu();
|
||||
staffRoleMenu.setRoleId(staffRole.getId());
|
||||
@ -503,6 +509,12 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
||||
return map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StaffRole> selectAllStaffRoleByDepartmentLevel(List<String> asList) {
|
||||
|
||||
return staffRoleMapper.selectAllStaffRoleByDepartmentLevel(asList);
|
||||
}
|
||||
|
||||
public void insertPM(StaffRole staffRole, Long parentId, StaffEntity staffEntity) {
|
||||
staffRole.setEvaluationGroupId(EvaluationGroupEnums.ALL.getType());//全部考评组
|
||||
staffRole.setDepartmentId(DepartmentPMEnums.ALL.getType());//所有部门
|
||||
@ -515,13 +527,19 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
||||
staffRoleMenuService.insertStaffRoleMenu(staffRoleMenu);
|
||||
}
|
||||
if (parentId.equals(RoleMenuEnums.MASTER_PM.getType())) { //如果是绩效管理员
|
||||
StaffRoleEvaluationGroup staffRoleEvaluationGroup = new StaffRoleEvaluationGroup();
|
||||
staffRoleEvaluationGroup.setRoleId(staffRole.getId());
|
||||
staffRoleEvaluationGroup.setIsSelect(1);
|
||||
staffRoleEvaluationGroupService.insertStaffRoleEvaluationGroup(staffRoleEvaluationGroup);
|
||||
insertStaffRoleEvaluationGroup(staffRole.getId(),0l);
|
||||
}
|
||||
}
|
||||
|
||||
public void insertStaffRoleEvaluationGroup(Long roleId,Long evaluationGroupId){
|
||||
StaffRoleEvaluationGroup staffRoleEvaluationGroup = new StaffRoleEvaluationGroup();
|
||||
staffRoleEvaluationGroup.setRoleId(roleId);
|
||||
staffRoleEvaluationGroup.setEvaluationGroupId(evaluationGroupId);
|
||||
staffRoleEvaluationGroup.setIsSelect(1);
|
||||
staffRoleEvaluationGroupService.insertStaffRoleEvaluationGroup(staffRoleEvaluationGroup);
|
||||
}
|
||||
|
||||
|
||||
public void getStaffMenuInfo(StaffMenu parent, List<StaffMenu> all) {
|
||||
List<StaffMenu> childs = new ArrayList<>();
|
||||
for (StaffMenu child : all) {
|
||||
@ -542,4 +560,9 @@ public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole
|
||||
public List<StaffRole> selectAllGroupManageRoles(){
|
||||
return staffRoleMapper.selectAllGroupManageRoles();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StaffRole> selectByEvaluationGroupId(Long groupId){
|
||||
return staffRoleMapper.selectByEvaluationGroupId(groupId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ public class ChartController extends AbstractController{
|
||||
|
||||
|
||||
|
||||
@RequestMapping("/own/result")
|
||||
@PostMapping("/own/result")
|
||||
@ApiOperation("获取个人成长曲线")
|
||||
@ApiResponses({@ApiResponse(code = 200,message = "成功",response = OwnResultResp.class)})
|
||||
public R ownResult(Long userId){
|
||||
|
||||
@ -135,6 +135,7 @@ public class EvaluationGroupController extends AbstractController {
|
||||
@ApiResponses({@ApiResponse(code = 200, message = "成功", response = EvaluationGroup.class)})
|
||||
public R save(@RequestBody @ApiParam EvaluationGroup evaluationGroup) {
|
||||
EvaluationGroup evaluationGroup1 = evaluationGroupService.selectEvaluationGroupByName(evaluationGroup.getName());
|
||||
List<StaffRole> staffRoles = null;
|
||||
if(evaluationGroup.getId() != null && evaluationGroup.getId().intValue() > 0){
|
||||
if(evaluationGroup1 == null || evaluationGroup1.getId().equals(evaluationGroup.getId())){
|
||||
if(evaluationGroup.getDepIds() == null){
|
||||
@ -150,6 +151,8 @@ public class EvaluationGroupController extends AbstractController {
|
||||
evaluationGroup.setOutIds("");
|
||||
}
|
||||
evaluationGroupService.updateEvaluationGroupById(evaluationGroup);
|
||||
|
||||
staffRoles = staffRoleService.selectByEvaluationGroupId(evaluationGroup.getId());//查询已经管理改组的管理员
|
||||
}else {
|
||||
return R.error("已经存在相同名称考核组");
|
||||
}
|
||||
@ -168,13 +171,16 @@ public class EvaluationGroupController extends AbstractController {
|
||||
return Long.parseLong(s);
|
||||
}
|
||||
}).collect(Collectors.toMap(Long::longValue, Function.identity(), (e, replace) -> e));
|
||||
List<StaffRole> staffRoles = staffRoleService.selectMastRoles();//获取主绩效管理员
|
||||
|
||||
for (StaffRole staffRole:staffRoles
|
||||
) {//去掉主管理员
|
||||
) {//去掉已经在管理本组的管理员
|
||||
if(mapIds.containsKey(staffRole.getStaffId())){
|
||||
mapIds.remove(staffRole.getStaffId());
|
||||
}else{
|
||||
staffRoleEvaluationGroupService.deleteStaffRoleEvaluationGroupByRoleId(staffRole.getId());
|
||||
}
|
||||
}
|
||||
|
||||
//去掉管理全考评组
|
||||
staffRoles = staffRoleService.selectAllGroupManageRoles();
|
||||
for (StaffRole staffRole:staffRoles
|
||||
@ -183,6 +189,8 @@ public class EvaluationGroupController extends AbstractController {
|
||||
mapIds.remove(staffRole.getStaffId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(mapIds.size() > 0){
|
||||
List<Long> ids = mapIds.values().stream().collect(Collectors.toList());
|
||||
staffRoles = staffRoleService.selectStaffRolesByStaffId(ids);
|
||||
|
||||
@ -21,7 +21,7 @@ public class ChartResultReq extends BasePage{
|
||||
private Long startId;
|
||||
|
||||
@ApiModelProperty(value = "等级",name = "scoreLevel")
|
||||
private Long scoreLevel;
|
||||
private String scoreLevel;
|
||||
|
||||
private Long loginUserId;
|
||||
|
||||
|
||||
@ -21,5 +21,8 @@ public class ChartStatistical {
|
||||
@ApiModelProperty(value = "提示",name = "tip")
|
||||
private String tip;
|
||||
|
||||
@ApiModelProperty(value = "等级",name = "scoreLevel")
|
||||
private String scoreLevel;
|
||||
|
||||
|
||||
}
|
||||
@ -116,9 +116,15 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
||||
res.setCycleTime(name.substring(0,name.lastIndexOf("绩效考核")));
|
||||
}
|
||||
//过滤非自己管理的人员
|
||||
int i = resultRecordMapper.countStartAndGroupNum(flowStart.getId(),mandepartmentIds);
|
||||
ResultRecord resultRecord = resultRecordMapper.selectOneByStartId(flowStart.getId());
|
||||
res.setJoinNum(resultRecord == null? StringUtil.EMPTY : resultRecord.getStaffName() + i + "等人");
|
||||
//没有管理的部门
|
||||
if(mandepartmentIds!=null && mandepartmentIds.size()==0){
|
||||
res.setJoinNum("0人");
|
||||
}else {
|
||||
int i = resultRecordMapper.countStartAndGroupNum(flowStart.getId(),mandepartmentIds);
|
||||
res.setJoinNum(resultRecord == null? StringUtil.EMPTY : resultRecord.getStaffName() + i + "等人");
|
||||
}
|
||||
|
||||
data.add(res);
|
||||
});
|
||||
PageUtils pages = new PageUtils();
|
||||
@ -136,6 +142,12 @@ public class AssessManagerServiceImpl implements AssessManagerService {
|
||||
if(StringUtil.isNotBlank(req.getEvaluationIds())){
|
||||
req.setCopyEvaluationIds(evaluationGroupService.getEvaluationCopyIdsByEvaluationIds(req.getEvaluationIds(),req.getStartId()));
|
||||
}
|
||||
List<String> mandepartmentIds = assessService.roleDepartments(req.getLoginUserId());
|
||||
//没有管理的部门
|
||||
if(mandepartmentIds!=null && mandepartmentIds.size()==0){
|
||||
return new PageUtils();
|
||||
}
|
||||
req.setDepartmentIds(mandepartmentIds);
|
||||
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(),req.getPageSize()).doSelect(
|
||||
page -> resultRecordMapper.selectAssessListByStartId(page,req)
|
||||
);
|
||||
|
||||
@ -9,6 +9,7 @@ import com.lz.common.utils.R;
|
||||
import com.lz.common.utils.StringUtil;
|
||||
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.DepartmentsStaffRelateService;
|
||||
import com.lz.modules.app.service.StaffService;
|
||||
@ -38,6 +39,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author: djc
|
||||
@ -93,6 +96,9 @@ public class ChartResultServiceImpl implements ChartResultService {
|
||||
}
|
||||
//自己管理的部门
|
||||
List<String> mandepartmentIds = assessService.roleDepartments(staffId);
|
||||
if(mandepartmentIds!=null && mandepartmentIds.size()==0){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
List<ChartStatisticalRes> data = Lists.newArrayList();
|
||||
ChartStatisticalRes res;
|
||||
|
||||
@ -120,24 +126,16 @@ public class ChartResultServiceImpl implements ChartResultService {
|
||||
data.add(res);
|
||||
|
||||
//如果不是默认,获得发起考核信息
|
||||
if(flowStart == null){
|
||||
flowStart = flowStartMapper.selectFlowStartById(startId);
|
||||
}
|
||||
String[] split = flowStart.getGroupIds().split(",");
|
||||
Set<String> staffIds = new HashSet<>();
|
||||
for(String s:split){
|
||||
List<String> strings = evaluationGroupService.selectAllStaffIdsByGroupId(Long.valueOf(s));
|
||||
staffIds.addAll(strings);
|
||||
}
|
||||
log.info("chartReport 所有人员:" + JSON.toJSONString(staffIds));
|
||||
//自己管理的和发起的人员交集
|
||||
List<String> manstaffIds = staffService.staffsByAllDeparmentIds(mandepartmentIds);
|
||||
log.info("chartReport 管理人员:" + JSON.toJSONString(manstaffIds));
|
||||
manstaffIds.retainAll(staffIds);
|
||||
log.info("chartReport 交集人员:" + JSON.toJSONString(manstaffIds));
|
||||
|
||||
List<String> all = new ArrayList<>(manstaffIds);
|
||||
List<ChartStatistical> depstaff = this.countDepartmentAndStaffNum(all);
|
||||
List<Object> objects = resultRecordService.listObjs(new QueryWrapper<ResultRecord>()
|
||||
.eq("is_delete", 0)
|
||||
.eq("start_id", startId)
|
||||
.in(mandepartmentIds != null, "department_id", mandepartmentIds).select("staff_id"));
|
||||
if(CollectionUtils.isEmpty(objects)){
|
||||
return data;
|
||||
}
|
||||
List<String> collect = objects.stream().map(o -> String.valueOf(o)).collect(Collectors.toList());
|
||||
List<ChartStatistical> depstaff = this.countDepartmentAndStaffNum(collect);
|
||||
res = new ChartStatisticalRes();
|
||||
res.setType(2);
|
||||
res.setStatisticals(buildDepStaffs(depstaff));
|
||||
@ -187,12 +185,19 @@ public class ChartResultServiceImpl implements ChartResultService {
|
||||
//自己管理的和所有的部门交集
|
||||
log.info("selectChartDetailList 管理部门:" + JSON.toJSONString(allDeparmentIds));
|
||||
List<String> mandepartmentIds = assessService.roleDepartments(req.getLoginUserId());
|
||||
log.info("selectChartDetailList 管理部门:" + JSON.toJSONString(mandepartmentIds));
|
||||
mandepartmentIds.retainAll(allDeparmentIds);
|
||||
if(mandepartmentIds!=null ){
|
||||
if(mandepartmentIds.size()==0){
|
||||
return new PageUtils();
|
||||
}
|
||||
log.info("selectChartDetailList 管理部门:" + JSON.toJSONString(mandepartmentIds));
|
||||
mandepartmentIds.retainAll(allDeparmentIds);
|
||||
if(mandepartmentIds.size()==0){
|
||||
return new PageUtils();
|
||||
}
|
||||
}
|
||||
log.info("selectChartDetailList 交集部门:" + JSON.toJSONString(mandepartmentIds));
|
||||
List<String> ids = staffService.staffsByAllDeparmentIds(mandepartmentIds);
|
||||
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize()).doSelect(
|
||||
page -> resultRecordMapper.selectChartDetailList(page,ids,req.getStartId(),req.getScoreLevel())
|
||||
page -> resultRecordMapper.selectChartDetailList(page,mandepartmentIds,req.getStartId(),req.getScoreLevel())
|
||||
);
|
||||
return pageUtils;
|
||||
}
|
||||
@ -228,6 +233,9 @@ public class ChartResultServiceImpl implements ChartResultService {
|
||||
req.setCopyEvaluationIds(evaluationGroupService.getEvaluationCopyIdsByEvaluationIds(req.getEvaluationIds(),req.getStartId()));
|
||||
//获取自己管理的部门
|
||||
List<String> mandepartmentIds = assessService.roleDepartments(req.getLoginUserId());
|
||||
if(mandepartmentIds!=null && mandepartmentIds.size()==0){
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
req.setDepartmentIds(mandepartmentIds);
|
||||
List<ChartStatistical> process = resultRecordMapper.countAssessNumByFlowProcess(req);
|
||||
List<ChartStatistical> data = buildProcess(process, req.getStartId(),mandepartmentIds,req);
|
||||
|
||||
@ -79,7 +79,7 @@ public interface ResultRecordMapper extends BaseMapper<ResultRecord> {
|
||||
|
||||
List<ChartStatistical> countNumByScoreLevel(@Param("startId") Long startId,@Param("evaluationIds")List<Long> evaluationIds,@Param("departmentIds")List<String> departmentIds);
|
||||
|
||||
List<ResultRecord> selectChartDetailList(@Param("page") IPage page, @Param("staffIds") List<String> staffIds, @Param("startId")Long startId,@Param("scoreLevel")Long scoreLevel);
|
||||
List<ResultRecord> selectChartDetailList(@Param("page") IPage page, @Param("departmentIds") List<String> departmentIds, @Param("startId")Long startId,@Param("scoreLevel")String scoreLevel);
|
||||
|
||||
int batchDeleteByStartId(@Param("startId")Long startId);
|
||||
|
||||
|
||||
@ -379,7 +379,7 @@
|
||||
</select>
|
||||
|
||||
<select id="countNumByScoreLevel" resultType="com.lz.modules.performance.res.ChartStatistical">
|
||||
SELECT count(score_level) num,case score_level WHEN 0 THEN '无等级' ELSE score_level END as 'desc' from lz_result_record where is_delete=0
|
||||
SELECT count(score_level) num,score_level,case score_level WHEN 0 THEN '无等级' ELSE score_level END as 'desc' from lz_result_record where is_delete=0
|
||||
and start_id =#{startId}
|
||||
<if test="evaluationIds !=null and evaluationIds.size()!=0">
|
||||
and evaluation_id in (
|
||||
@ -404,10 +404,10 @@
|
||||
on r.staff_id = s.id
|
||||
where r.is_delete =0 and s.is_delete=0
|
||||
and r.start_id = #{startId}
|
||||
<if test="staffIds!=null and staffIds.size()!=0">
|
||||
and r.staff_id in (
|
||||
<foreach collection="staffIds" item="staff_id" separator=",">
|
||||
#{staff_id}
|
||||
<if test="departmentIds!=null and departmentIds.size()!=0">
|
||||
and r.department_id in (
|
||||
<foreach collection="departmentIds" item="department_id" separator=",">
|
||||
#{department_id}
|
||||
</foreach>
|
||||
)
|
||||
</if>
|
||||
|
||||
@ -105,6 +105,10 @@
|
||||
</foreach>
|
||||
)
|
||||
</select>
|
||||
<select id="selectEvaluationGroupIdsByRoleIdGroupId"
|
||||
resultType="com.lz.modules.flow.entity.StaffRoleEvaluationGroup">
|
||||
select * from lz_staff_role_evaluation_group where is_delete = 0 and role_id = #{roleId} and evaluation_group_id = #{groupId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
@ -91,7 +91,7 @@
|
||||
|
||||
|
||||
<update id="deleteStaffRoleById" parameterType="java.lang.Long">
|
||||
update lz_staff_role set is_delete = 1 where id=#{id} limit 1
|
||||
delete from lz_staff_role where id=#{id} limit 1
|
||||
</update>
|
||||
|
||||
|
||||
@ -165,9 +165,22 @@
|
||||
|
||||
|
||||
<select id="selectAllMenus" resultType="com.lz.modules.flow.entity.StaffMenu">
|
||||
select * from lz_staff_menu where id in (
|
||||
select * from lz_staff_menu where id in (
|
||||
select menu_id from lz_staff_role_menu where role_id in (
|
||||
select id from lz_staff_role where staff_id = #{userId}))
|
||||
select id from lz_staff_role where staff_id = #{userId} and is_delete=0) and is_delete = 0 ) and is_delete = 0
|
||||
</select>
|
||||
<select id="selectAllStaffRoleByDepartmentLevel" resultType="com.lz.modules.flow.entity.StaffRole">
|
||||
select * from lz_staff_role where is_delete = 0 and department_level in
|
||||
<foreach collection="departmentLevels" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectStaffRolesByStaffIdDepartmentLevelList" resultType="com.lz.modules.flow.entity.StaffRole">
|
||||
select * from lz_staff_role where is_delete = 0 and staff_id = #{staffId} and department_level in
|
||||
<foreach collection="departmentLevels" item="item" index="index" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="selectMastRoles" resultType="StaffRole" >
|
||||
@ -175,7 +188,7 @@
|
||||
</select>
|
||||
|
||||
<select id="selectAllGroupManageRoles" resultType="StaffRole" >
|
||||
select role.* from lz_staff_role role join lz_staff_role_evaluation_group egroup on egroup.role_id = role.id where egroup.evaluation_group_id=0 and egroup.is_delete=0 and role.is_delete=0
|
||||
select * from lz_staff_role where evaluation_group_id=0 and is_delete=0 and is_delete=0
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user