diff --git a/src/main/java/com/lz/modules/flow/service/impl/FlowStartServiceImpl.java b/src/main/java/com/lz/modules/flow/service/impl/FlowStartServiceImpl.java index bb59aaed..58364636 100644 --- a/src/main/java/com/lz/modules/flow/service/impl/FlowStartServiceImpl.java +++ b/src/main/java/com/lz/modules/flow/service/impl/FlowStartServiceImpl.java @@ -24,10 +24,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.interceptor.TransactionAspectSupport; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.function.Function; import java.util.stream.Collectors; @@ -80,6 +77,9 @@ public class FlowStartServiceImpl extends ServiceImpl> staffManages = new HashedMap();//部门(id+几级)和部门几级管理对应关系,减少数据库查找 + Map> mustRole = new HashMap<>(); + Map> selfMustRole = new HashMap<>(); for (GroupStaffs groupStaffs:startGroupStaffIds.getGroups() ) { List staffSimpleInfos = staffService.selectStaffSimpleInfos(groupStaffs.getStaffIds()); if(staffSimpleInfos.size() == 0){ R.error(groupStaffs.getEvaluationGroup().getName() + "——无有效考核人员"); } - switch (start(groupStaffs.getEvaluationGroup(), flowStart, staffManages, staffSimpleInfos)){ + switch (start(groupStaffs.getEvaluationGroup(), flowStart, staffManages, staffSimpleInfos, mustRole, selfMustRole)){ case 1: return R.error(groupStaffs.getEvaluationGroup().getName() + "——没有设置考核模板"); @@ -191,6 +193,9 @@ public class FlowStartServiceImpl extends ServiceImpl evaluationGroups = evaluationGroupService.selectEvaluationGroupByIds(ids); + Map> mustRole = new HashMap<>(); + Map> selfMustRole = new HashMap<>(); + for (int n = 0; n < evaluationGroups.size(); n++ ) { EvaluationGroup evaluationGroup = evaluationGroups.get(n); @@ -202,7 +207,7 @@ public class FlowStartServiceImpl extends ServiceImpl> staffManages, List staffIds){ + Map> staffManages, List staffIds, + Map> mustRole, Map> selfMustRole){ List resultModelDtos = resultModelService.selectResultDtoByGroupId(evaluationGroup.getId()); @@ -317,8 +323,24 @@ public class FlowStartServiceImpl extends ServiceImpl flowChartRoles = null; + //获取必备权限 + if(mustRole.containsKey(flow.getChartId())){ + flowChartRoles = mustRole.get(flow.getChartId()); + }else{ + flowChartRoles = + flowChartRoleService.selectFlowChartRolesByChartIdAndType(flow.getChartId(), 1); + mustRole.put(flow.getChartId(), flowChartRoles); + } + + + if(flowChartDetailRecord.getOptType().intValue() == ChartOptType.APPOINT.getCode()){//指定人员的 + + String[] optIds = flowChartDetailRecord.getOptIds().split(","); + + for (String id:optIds ) { @@ -334,6 +356,20 @@ public class FlowStartServiceImpl extends ServiceImpl 0){//设置必备权限 + String roles = flowChartRoles.stream().map(new Function() { + @Override + public String apply(FlowChartRole flowChartRole) { + return flowChartRole.getRoleId().toString(); + } + }).collect(Collectors.joining(",")); + if(flowApprovalRole.getRoleId() == null || flowApprovalRole.getRoleId().length() == 0){ + flowApprovalRole.setRoleId(roles); + }else{ + flowApprovalRole.setRoleId(flowApprovalRole.getRoleId() + "," + roles); + } + } } //stepIndex++; if(flowApprovalRole != null){ @@ -341,6 +377,17 @@ public class FlowStartServiceImpl extends ServiceImpl flowChartRoles1 = + flowChartRoleService.selectFlowChartRolesByChartIdAndType(flow.getChartId(), 2); + selfMustRole.put(flow.getChartId(), flowChartRoles1); + flowChartRoles.addAll(flowChartRoles1); + } + } flowApprovalRole = new FlowApprovalRole(); flowApprovalRole.setFlowId(flow.getId()); flowApprovalRole.setStepType(flowChartDetailRecord.getStepType()); @@ -349,9 +396,25 @@ public class FlowStartServiceImpl extends ServiceImpl 0){//设置必备权限 + String roles = flowChartRoles.stream().map(new Function() { + @Override + public String apply(FlowChartRole flowChartRole) { + return flowChartRole.getRoleId().toString(); + } + }).collect(Collectors.joining(",")); + if(flowApprovalRole.getRoleId() == null || flowApprovalRole.getRoleId().length() == 0){ + flowApprovalRole.setRoleId(roles); + }else{ + flowApprovalRole.setRoleId(flowApprovalRole.getRoleId() + "," + roles); + } + } + stepIndex++; } + + } //插入记录/flowChart/saveDetailProcs if(flowApprovalRoles.size() > 0){ diff --git a/src/main/java/com/lz/modules/performance/controller/ChartController.java b/src/main/java/com/lz/modules/performance/controller/ChartController.java index 55b9492a..78cfc9c7 100644 --- a/src/main/java/com/lz/modules/performance/controller/ChartController.java +++ b/src/main/java/com/lz/modules/performance/controller/ChartController.java @@ -42,7 +42,8 @@ public class ChartController extends AbstractController{ public R chartResult(@RequestParam(required = false) @ApiParam(name = "startId",value = "考核周期标识id") Long startId){ List chartStatisticalRes = null; try { - chartStatisticalRes = chartResultService.chartReport(startId); + Long userId = getUserId(); + chartStatisticalRes = chartResultService.chartReport(startId,userId); } catch (Exception e) { log.error("获取绩效报表统计异常" ,e); return R.error(); diff --git a/src/main/java/com/lz/modules/performance/controller/FlowChartController.java b/src/main/java/com/lz/modules/performance/controller/FlowChartController.java index e0a016a7..394fa38c 100644 --- a/src/main/java/com/lz/modules/performance/controller/FlowChartController.java +++ b/src/main/java/com/lz/modules/performance/controller/FlowChartController.java @@ -145,49 +145,15 @@ public class FlowChartController { if(flowChartDetailRecordListReq.getRecordSimpleDtos() != null && flowChartDetailRecordListReq.getRecordSimpleDtos().size() > 0){ List inserts = new ArrayList<>(); List updaes = new ArrayList<>(); - Map> mustRole = new HashMap<>(); - Map> selfMustRole = new HashMap<>(); + int index = 0; for (FlowChartDetailRecordSimpleReq req:flowChartDetailRecordListReq.getRecordSimpleDtos() ) { FlowChartDetailRecord flowChartDetailRecord = new FlowChartDetailRecord(); BeanUtils.copyProperties(req, flowChartDetailRecord); flowChartDetailRecord.setChartId(flowChartDetailRecordListReq.getId()); - List flowChartRoles = null; - if(mustRole.containsKey(flowChartDetailRecordListReq.getId())){ - flowChartRoles = mustRole.get(flowChartDetailRecordListReq.getId()); - }else{ - flowChartRoles = - flowChartRoleService.selectFlowChartRolesByChartIdAndType(flowChartDetailRecordListReq.getId(), 1); - mustRole.put(flowChartDetailRecordListReq.getId(), flowChartRoles); - } - if(flowChartDetailRecord.getOptType().intValue() == -1){//考核人是自己的 - //获取被考核人的必备权限 - if(selfMustRole.containsKey(flowChartDetailRecordListReq.getId())){ - flowChartRoles.addAll(selfMustRole.get(flowChartDetailRecordListReq.getId())); - }else{ - List flowChartRoles1 = - flowChartRoleService.selectFlowChartRolesByChartIdAndType(flowChartDetailRecordListReq.getId(), 2); - selfMustRole.put(flowChartDetailRecordListReq.getId(), flowChartRoles1); - flowChartRoles.addAll(flowChartRoles1); - } - } - - if(flowChartRoles != null && flowChartRoles.size() > 0){//设置必备权限 - String roles = flowChartRoles.stream().map(new Function() { - @Override - public String apply(FlowChartRole flowChartRole) { - return flowChartRole.getRoleId().toString(); - } - }).collect(Collectors.joining(",")); - if(flowChartDetailRecord.getRoleIds() == null || flowChartDetailRecord.getRoleIds().length() == 0){ - flowChartDetailRecord.setRoleIds(roles); - }else{ - flowChartDetailRecord.setRoleIds(flowChartDetailRecord.getRoleIds() + "," + roles); - } - } flowChartDetailRecord.setEvaluationGroupId(flowChartDetailRecordListReq.getEvaluationGroupId()); flowChartDetailRecord.setStepIndex(index); diff --git a/src/main/java/com/lz/modules/performance/req/AssessDetailReq.java b/src/main/java/com/lz/modules/performance/req/AssessDetailReq.java index aa7dd4fe..1d478e8e 100644 --- a/src/main/java/com/lz/modules/performance/req/AssessDetailReq.java +++ b/src/main/java/com/lz/modules/performance/req/AssessDetailReq.java @@ -31,4 +31,6 @@ public class AssessDetailReq extends BasePage{ //状态 确认 执行 结果录入。。。 @ApiModelProperty(value = "状态 确认 执行 结果录入。。。",name = "flowProcess") private Integer flowProcess; + + private List departmentIds; } diff --git a/src/main/java/com/lz/modules/performance/req/AssessListReq.java b/src/main/java/com/lz/modules/performance/req/AssessListReq.java index 4d778d94..4626259f 100644 --- a/src/main/java/com/lz/modules/performance/req/AssessListReq.java +++ b/src/main/java/com/lz/modules/performance/req/AssessListReq.java @@ -4,6 +4,7 @@ import com.lz.modules.equipment.entity.model.BasePage; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import org.springframework.beans.factory.annotation.Autowired; /** * @Author: djc @@ -19,4 +20,7 @@ public class AssessListReq extends BasePage { //组名称 @ApiModelProperty(value = "考核名称",name = "name") private String name; + + private Long staffId; + } diff --git a/src/main/java/com/lz/modules/performance/req/ChartResultReq.java b/src/main/java/com/lz/modules/performance/req/ChartResultReq.java index 89921e5e..b848ea53 100644 --- a/src/main/java/com/lz/modules/performance/req/ChartResultReq.java +++ b/src/main/java/com/lz/modules/performance/req/ChartResultReq.java @@ -22,4 +22,7 @@ public class ChartResultReq extends BasePage{ @ApiModelProperty(value = "等级",name = "scoreLevel") private Long scoreLevel; + + private Long staffId; + } diff --git a/src/main/java/com/lz/modules/performance/res/AssessManagerDetailRes.java b/src/main/java/com/lz/modules/performance/res/AssessManagerDetailRes.java index 7c9a840c..4921ce50 100644 --- a/src/main/java/com/lz/modules/performance/res/AssessManagerDetailRes.java +++ b/src/main/java/com/lz/modules/performance/res/AssessManagerDetailRes.java @@ -15,6 +15,9 @@ import java.util.List; @Data @ApiModel("考核详情列表实体") public class AssessManagerDetailRes { + //头像 + @ApiModelProperty(value = "头像", name = "avatar") + private String avatar; @ApiModelProperty(value = "姓名",name = "staffName") private String staffName; diff --git a/src/main/java/com/lz/modules/performance/service/AssessService.java b/src/main/java/com/lz/modules/performance/service/AssessService.java index cfb46616..cc482098 100644 --- a/src/main/java/com/lz/modules/performance/service/AssessService.java +++ b/src/main/java/com/lz/modules/performance/service/AssessService.java @@ -17,9 +17,9 @@ public interface AssessService { /** * - * @param staffRole + * @param staffId * @return null 为全部部门 size = 0 为没有部门 */ - List roleDepartment(StaffRole staffRole); + List roleDepartments(Long staffId); } diff --git a/src/main/java/com/lz/modules/performance/service/ChartResultService.java b/src/main/java/com/lz/modules/performance/service/ChartResultService.java index 40e85374..6d67af17 100644 --- a/src/main/java/com/lz/modules/performance/service/ChartResultService.java +++ b/src/main/java/com/lz/modules/performance/service/ChartResultService.java @@ -18,7 +18,7 @@ import java.util.List; */ public interface ChartResultService { - List chartReport(Long startId); + List chartReport(Long startId,Long staffId); List countDepartmentAndStaffNum(ListstaffIds); diff --git a/src/main/java/com/lz/modules/performance/service/impl/AssessManagerServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/AssessManagerServiceImpl.java index 01e8acca..def09c4c 100644 --- a/src/main/java/com/lz/modules/performance/service/impl/AssessManagerServiceImpl.java +++ b/src/main/java/com/lz/modules/performance/service/impl/AssessManagerServiceImpl.java @@ -1,5 +1,6 @@ package com.lz.modules.performance.service.impl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.google.common.collect.Maps; import com.lz.common.exception.RRException; @@ -8,6 +9,7 @@ import com.lz.common.utils.R; import com.lz.common.utils.StringUtil; import com.lz.modules.app.dto.ApprovalDto; import com.lz.modules.app.dto.StaffSimpleDto; +import com.lz.modules.app.entity.StaffEntity; import com.lz.modules.app.service.StaffService; import com.lz.modules.flow.dao.EvaluationStartStaffMapper; import com.lz.modules.flow.dao.FlowStartMapper; @@ -27,6 +29,7 @@ import com.lz.modules.performance.req.AssessToScoreReq; import com.lz.modules.performance.res.AssessManagerDetailRes; import com.lz.modules.performance.res.AssessManagerListRes; import com.lz.modules.performance.service.AssessManagerService; +import com.lz.modules.performance.service.AssessService; import com.lz.modules.sys.dao.app.ResultRecordMapper; import com.lz.modules.sys.entity.app.ResultRecord; import com.lz.modules.sys.service.app.ResultRecordService; @@ -71,6 +74,8 @@ public class AssessManagerServiceImpl implements AssessManagerService { private EvaluationStartStaffMapper evaluationStartStaffMapper; @Autowired private FlowStartService flowStartService; + @Autowired + private AssessService assessService; @Override public PageUtils assessList(AssessListReq req) { @@ -80,8 +85,10 @@ public class AssessManagerServiceImpl implements AssessManagerService { ); List list = pageUtils.getList(); if(CollectionUtils.isEmpty(list)){ + log.info("未找到考核发起数据"); return pageUtils; } + List mandepartmentIds = assessService.roleDepartments(req.getStaffId()); list.forEach(flowStart -> { AssessManagerListRes res = new AssessManagerListRes(); String name = flowStart.getName(); @@ -90,7 +97,8 @@ public class AssessManagerServiceImpl implements AssessManagerService { if(name.contains("绩效考核")){ res.setCycleTime(name.substring(0,name.lastIndexOf("绩效考核"))); } - int i = resultRecordMapper.countStartAndGroupNum(flowStart.getId()); + //过滤非自己管理的人员 + int i = resultRecordMapper.countStartAndGroupNum(flowStart.getId(),mandepartmentIds); ResultRecord resultRecord = resultRecordMapper.selectOneByStartId(flowStart.getId()); res.setJoinNum(resultRecord == null? StringUtil.EMPTY : resultRecord.getStaffName() + i + "等人"); data.add(res); @@ -109,6 +117,12 @@ public class AssessManagerServiceImpl implements AssessManagerService { PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(),req.getPageSize()).doSelect( page -> resultRecordMapper.selectAssessListByStartId(page,req) ); + List list = pageUtils.getList(); + list.forEach(assessManagerDetailRes -> { + StaffEntity staffEntity = staffService.selectStaffById(assessManagerDetailRes.getStaffId()); + assessManagerDetailRes.setAvatar(Optional.ofNullable(staffEntity.getAvatar()).orElse(StringUtil.EMPTY)); + }); + return pageUtils; } @@ -227,8 +241,10 @@ public class AssessManagerServiceImpl implements AssessManagerService { List recordIds = resultRecordMapper.selectToScoreList(req.getStartId(), evaluation); if(CollectionUtils.isEmpty(recordIds)){ + log.info("该考评组无数据 evaluationId:" + evaluation); continue; } + log.info("本次评分更新操作 num: " + recordIds.size()); recordIds.forEach(aLong -> { //更新流程绩效 ApprovalDto approvalDto = new ApprovalDto(); @@ -236,7 +252,8 @@ public class AssessManagerServiceImpl implements AssessManagerService { approvalDto.setResultRecordId(aLong); approvalDto.setMenuName("开始评分"); try { - resultRecordService.newApproval(approvalDto); + R r = resultRecordService.newApproval(approvalDto); + log.info("绩效id aLong :" + aLong + " ,res" + JSON.toJSONString(r)); } catch (Exception e) { log.error("执行中状态跳过失败 recorId:" + aLong,e); } @@ -248,7 +265,7 @@ public class AssessManagerServiceImpl implements AssessManagerService { } - public static void main(String[] args) { + /* public static void main(String[] args) { ExecutorService executorService = Executors.newFixedThreadPool(10); CompletableFuture> future = CompletableFuture.supplyAsync(()-> Arrays.asList(1L,2L),executorService); try { @@ -259,6 +276,6 @@ public class AssessManagerServiceImpl implements AssessManagerService { } catch (ExecutionException e) { e.printStackTrace(); } - } + }*/ } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/performance/service/impl/AssessServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/AssessServiceImpl.java index d0e756b6..85e7b4a5 100644 --- a/src/main/java/com/lz/modules/performance/service/impl/AssessServiceImpl.java +++ b/src/main/java/com/lz/modules/performance/service/impl/AssessServiceImpl.java @@ -8,10 +8,7 @@ import com.lz.modules.app.entity.StaffEntity; import com.lz.modules.app.service.StaffService; import com.lz.modules.flow.entity.StaffRole; import com.lz.modules.flow.entity.StaffRoleDepartment; -import com.lz.modules.flow.service.FlowChangeService; -import com.lz.modules.flow.service.FlowRecordService; -import com.lz.modules.flow.service.StaffRoleDepartmentService; -import com.lz.modules.flow.service.StaffRoleEvaluationGroupService; +import com.lz.modules.flow.service.*; import com.lz.modules.performance.dto.TaskListDto; import com.lz.modules.performance.req.AssessTaskReq; import com.lz.modules.performance.res.ChartStatisticalRes; @@ -49,6 +46,8 @@ public class AssessServiceImpl implements AssessService { private StaffRoleDepartmentService staffRoleDepartmentService; @Autowired private StaffRoleEvaluationGroupService staffRoleEvaluationGroupService; + @Autowired + private StaffRoleService staffRoleService; @Override public PageUtils userTaskList(AssessTaskReq req,Long userId) { @@ -68,7 +67,7 @@ public class AssessServiceImpl implements AssessService { name = "您"; } //根据状态拼接文案 - res.setTitle(name + "的" + taskListDto.getMonthTime() + ""); + res.setTitle(name + "的" + taskListDto.getMonthTime() + "绩效考核 "); res.setTime(DateUtils.format(taskListDto.getGmtModified(),DateUtils.DATE_TIME_PATTERN)); //跳转绩效详情页 res.setRecordId(taskListDto.getRecordId()); @@ -84,7 +83,8 @@ public class AssessServiceImpl implements AssessService { @Override - public List roleDepartment(StaffRole staffRole) { + public List roleDepartments(Long staffId) { + StaffRole staffRole = staffRoleService.selectByStaffId(staffId); if(staffRole == null){ log.info("staffRole 为空"); return Collections.EMPTY_LIST; @@ -103,7 +103,8 @@ public class AssessServiceImpl implements AssessService { allDepart.addAll(strings); }); - List collect = allDepart.stream().distinct().map(s -> Long.valueOf(s)).collect(Collectors.toList()); + List collect = allDepart.stream().distinct().collect(Collectors.toList()); + log.info("获取到权限对应的部门 " + JSON.toJSONString(collect)); return collect; } log.info("未获取到用户权限对应的部门 roleID: " + staffRole.getId()); diff --git a/src/main/java/com/lz/modules/performance/service/impl/ChartResultServiceImpl.java b/src/main/java/com/lz/modules/performance/service/impl/ChartResultServiceImpl.java index 20a59c38..4490f275 100644 --- a/src/main/java/com/lz/modules/performance/service/impl/ChartResultServiceImpl.java +++ b/src/main/java/com/lz/modules/performance/service/impl/ChartResultServiceImpl.java @@ -1,5 +1,6 @@ package com.lz.modules.performance.service.impl; +import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.google.common.collect.Maps; import com.lz.common.utils.PageUtils; @@ -24,6 +25,7 @@ import com.lz.modules.performance.req.ChartStartsReq; import com.lz.modules.performance.res.ChartStartsRes; import com.lz.modules.performance.res.ChartStatistical; import com.lz.modules.performance.res.ChartStatisticalRes; +import com.lz.modules.performance.service.AssessService; import com.lz.modules.performance.service.ChartResultService; import com.lz.modules.sys.dao.app.ResultRecordMapper; import com.lz.modules.sys.entity.app.ResultRecord; @@ -62,15 +64,18 @@ public class ChartResultServiceImpl implements ChartResultService { private DepartmentsService departmentsService; @Autowired private FlowChartService flowChartService; + @Autowired + private AssessService assessService; @Override - public List chartReport(Long startId) { + public List chartReport(Long startId,Long staffId) { String defaultTime = StringUtil.EMPTY; Integer defaultCycleType = null; + FlowStart flowStart = null; if(startId==null){ //取最近一条记录 - FlowStart flowStart = flowStartMapper.selectRecentlyLimt(); + flowStart = flowStartMapper.selectRecentlyLimt(); if(flowStart!=null){ log.info("首次进入,默认返回最新记录 flowStartId:" + flowStart.getId()); startId = flowStart.getId(); @@ -80,10 +85,12 @@ public class ChartResultServiceImpl implements ChartResultService { return new ArrayList<>(); } } + //自己管理的部门 + List mandepartmentIds = assessService.roleDepartments(staffId); List data = new ArrayList<>(); ChartStatisticalRes res; - List process = resultRecordService.countNumByFlowProcess(startId,null,null); + List process = resultRecordService.countNumByFlowProcess(startId,null,mandepartmentIds); res = new ChartStatisticalRes(); res.setType(0); @@ -95,7 +102,7 @@ public class ChartResultServiceImpl implements ChartResultService { } data.add(res); - List scoreLevel = resultRecordService.countNumByScoreLevel(startId,null,null); + List scoreLevel = resultRecordService.countNumByScoreLevel(startId,null,mandepartmentIds); res = new ChartStatisticalRes(); res.setType(1); res.setStatisticals(scoreLevel); @@ -106,14 +113,24 @@ public class ChartResultServiceImpl implements ChartResultService { } data.add(res); - FlowStart flowStart = flowStartMapper.selectFlowStartById(startId); + //如果不是默认,获得发起考核信息 + if(flowStart == null){ + flowStart = flowStartMapper.selectFlowStartById(startId); + } String[] split = flowStart.getGroupIds().split(","); Set staffIds = new HashSet<>(); for(String s:split){ List strings = evaluationGroupService.selectAllStaffIdsByGroupId(Long.valueOf(s)); staffIds.addAll(strings); } - List all = new ArrayList<>(staffIds); + log.info("chartReport 所有人员:" + JSON.toJSONString(staffIds)); + //自己管理的和发起的人员交集 + List manstaffIds = staffService.staffsByAllDeparmentIds(mandepartmentIds); + log.info("chartReport 管理人员:" + JSON.toJSONString(manstaffIds)); + manstaffIds.retainAll(staffIds); + log.info("chartReport 交集人员:" + JSON.toJSONString(manstaffIds)); + + List all = new ArrayList<>(manstaffIds); List depstaff = this.countDepartmentAndStaffNum(all); res = new ChartStatisticalRes(); res.setType(2); @@ -161,7 +178,13 @@ public class ChartResultServiceImpl implements ChartResultService { @Override public PageUtils selectChartDetailList(ChartResultReq req) { List allDeparmentIds = staffService.selectAllDeparmentIdsByDepartmentParentId(req.getDepartmentId()); - List ids = staffService.staffsByAllDeparmentIds(allDeparmentIds); + //自己管理的和所有的部门交集 + log.info("selectChartDetailList 管理部门:" + JSON.toJSONString(allDeparmentIds)); + List mandepartmentIds = assessService.roleDepartments(req.getStaffId()); + log.info("selectChartDetailList 管理部门:" + JSON.toJSONString(mandepartmentIds)); + mandepartmentIds.retainAll(allDeparmentIds); + log.info("selectChartDetailList 交集部门:" + JSON.toJSONString(mandepartmentIds)); + List ids = staffService.staffsByAllDeparmentIds(mandepartmentIds); PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize()).doSelect( page -> resultRecordMapper.selectChartDetailList(page,ids,req.getStartId(),req.getScoreLevel()) ); diff --git a/src/main/java/com/lz/modules/sys/dao/app/ResultRecordMapper.java b/src/main/java/com/lz/modules/sys/dao/app/ResultRecordMapper.java index bf9f9a14..6d67c384 100644 --- a/src/main/java/com/lz/modules/sys/dao/app/ResultRecordMapper.java +++ b/src/main/java/com/lz/modules/sys/dao/app/ResultRecordMapper.java @@ -73,15 +73,15 @@ public interface ResultRecordMapper extends BaseMapper { List selectResultRecordAllByStaffId(@Param("staffId") Long staffId); - List countNumByFlowProcess(@Param("startId") Long startId,@Param("evaluationIds")List evaluationIds,@Param("departmentIds")List departmentIds); + List countNumByFlowProcess(@Param("startId") Long startId,@Param("evaluationIds")List evaluationIds,@Param("departmentIds")List departmentIds); - List countNumByScoreLevel(@Param("startId") Long startId,@Param("evaluationIds")List evaluationIds,@Param("departmentIds")List departmentIds); + List countNumByScoreLevel(@Param("startId") Long startId,@Param("evaluationIds")List evaluationIds,@Param("departmentIds")List departmentIds); List selectChartDetailList(@Param("page") IPage page, @Param("staffIds") List staffIds, @Param("startId")Long startId,@Param("scoreLevel")Long scoreLevel); int batchDeleteByStartId(@Param("startId")Long startId); - int countStartAndGroupNum(@Param("startId")Long startId); + int countStartAndGroupNum(@Param("startId")Long startId,@Param("departmentIds")List departmentIds); ResultRecord selectOneByStartId(@Param("startId")Long startId); diff --git a/src/main/java/com/lz/modules/sys/service/app/ResultRecordService.java b/src/main/java/com/lz/modules/sys/service/app/ResultRecordService.java index 0479e567..24001402 100644 --- a/src/main/java/com/lz/modules/sys/service/app/ResultRecordService.java +++ b/src/main/java/com/lz/modules/sys/service/app/ResultRecordService.java @@ -103,9 +103,9 @@ public interface ResultRecordService extends IService { List selectResultRecordAllByStaffId(Long staffId); - List countNumByFlowProcess(Long startId,List evaluationIds,List departmentIds); + List countNumByFlowProcess(Long startId,List evaluationIds,List departmentIds); - List countNumByScoreLevel(Long startId,List evaluationIds,List departmentIds); + List countNumByScoreLevel(Long startId,List evaluationIds,List departmentIds); void batchDeleteByStaffIds(List staffIds); diff --git a/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java b/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java index a31efd34..5c9fd4dc 100644 --- a/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java +++ b/src/main/java/com/lz/modules/sys/service/app/impl/ResultRecordServiceImpl.java @@ -750,12 +750,12 @@ public class ResultRecordServiceImpl extends ServiceImpl countNumByFlowProcess(Long startId,List evaluationIds,List departmentIds) { + public List countNumByFlowProcess(Long startId,List evaluationIds,List departmentIds) { return resultRecordMapper.countNumByFlowProcess(startId,evaluationIds,departmentIds); } @Override - public List countNumByScoreLevel(Long startId,List evaluationIds,List departmentIds) { + public List countNumByScoreLevel(Long startId,List evaluationIds,List departmentIds) { return resultRecordMapper.countNumByScoreLevel(startId,evaluationIds,departmentIds); } diff --git a/src/main/resources/mapper/app/ResultRecordMapper.xml b/src/main/resources/mapper/app/ResultRecordMapper.xml index 886340b8..353c9c7a 100644 --- a/src/main/resources/mapper/app/ResultRecordMapper.xml +++ b/src/main/resources/mapper/app/ResultRecordMapper.xml @@ -420,6 +420,13 @@