修复超级管理员无法管理组的问题

This commit is contained in:
wulin 2020-11-17 11:29:37 +08:00
parent 61d57a9292
commit e3de3fa4cd
3 changed files with 40 additions and 45 deletions

View File

@ -138,7 +138,7 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
.collect(Collectors.toList()); .collect(Collectors.toList());
}else{ }else{
//考评组管理 //考评组管理
List<StaffRole> staffRoles = staffRoleService.selectAllByStaffId(sysUserEntity.getUserId()); List<StaffRole> staffRoles = staffRoleService.selectAllByStaffId(sysUserEntity.getUserId());//一个人只会有一个
if(staffRoles.size() == 0){ if(staffRoles.size() == 0){
log.info("非绩效管理员登录查询"); log.info("非绩效管理员登录查询");
return null; return null;
@ -149,6 +149,7 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
log.info("查询的管理组为空"); log.info("查询的管理组为空");
return null; return null;
} }
if(staffRoleEvaluationGroups.get(0).getEvaluationGroupId().longValue() != 0L){//管理指定考评组的
gIds = new ArrayList<>(); gIds = new ArrayList<>();
for (StaffRoleEvaluationGroup staffRoleEvaluationGroup:staffRoleEvaluationGroups for (StaffRoleEvaluationGroup staffRoleEvaluationGroup:staffRoleEvaluationGroups
) { ) {
@ -161,6 +162,8 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
} }
} }
}
List<Long> finalGIds = gIds; List<Long> finalGIds = gIds;
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize()) PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize())
.doSelect(page -> evaluationGroupMapper.seleteEvaluationGroupByReq(page, req, finalGIds)); .doSelect(page -> evaluationGroupMapper.seleteEvaluationGroupByReq(page, req, finalGIds));

View File

@ -248,7 +248,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
Map<Long, List<FlowChartRole>> mustRole = new HashMap<>(); Map<Long, List<FlowChartRole>> mustRole = new HashMap<>();
Map<Long, List<FlowChartRole>> selfMustRole = new HashMap<>(); Map<Long, List<FlowChartRole>> selfMustRole = new HashMap<>();
List<StaffSimpleInfo> noticeStaff = new ArrayList<>();
for (int n = 0; n < evaluationGroups.size(); n++ for (int n = 0; n < evaluationGroups.size(); n++
) { ) {
EvaluationGroup evaluationGroup = evaluationGroups.get(n); EvaluationGroup evaluationGroup = evaluationGroups.get(n);
@ -293,9 +293,12 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
return R.error(evaluationGroup.getName() + "——没有设置绩效管理人员"); return R.error(evaluationGroup.getName() + "——没有设置绩效管理人员");
case 5: case 5:
return R.error(evaluationGroup.getName() + "——初始化考核流程失败"); return R.error(evaluationGroup.getName() + "——初始化考核流程失败");
case 0:
noticeStaff.addAll(staffIds);
break;
} }
dingtalkBusiness.sendWorkMSGWithAsyn(staffIds, WorkMsgTypeEnum.START_WORK.getType());
} }
dingtalkBusiness.sendWorkMSGWithAsyn(noticeStaff, WorkMsgTypeEnum.START_WORK.getType());
return R.ok("发起成功").put("data", flowStart); return R.ok("发起成功").put("data", flowStart);
} }
//isInsert表示是否中途加人 //isInsert表示是否中途加人
@ -474,10 +477,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
if(resultDetails.size() > 0){ if(resultDetails.size() > 0){
// //
resultDetailService.insertResultDetails(resultDetails); resultDetailService.insertResultDetails(resultDetails);
} }
} }
evaluationStartStaffService.insertEvaluationStartStaffs(evaluationStartStaffs); evaluationStartStaffService.insertEvaluationStartStaffs(evaluationStartStaffs);
return 0; return 0;
@ -507,7 +507,6 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
mustRole.put(flow.getChartId(), flowChartRoles); mustRole.put(flow.getChartId(), flowChartRoles);
} }
if(flowChartDetailRecord.getOptType().intValue() == ChartOptType.APPOINT.getCode()){//指定人员的 if(flowChartDetailRecord.getOptType().intValue() == ChartOptType.APPOINT.getCode()){//指定人员的
String roles = null; String roles = null;
@ -522,8 +521,6 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
} }
String[] optIds = flowChartDetailRecord.getOptIds().split(","); String[] optIds = flowChartDetailRecord.getOptIds().split(",");
for (String id:optIds for (String id:optIds
) { ) {
@ -613,7 +610,6 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
evaluationStartStaff.setType(CheckStaffType.STAFF.getCode()); evaluationStartStaff.setType(CheckStaffType.STAFF.getCode());
evaluationStartStaffs.add(evaluationStartStaff); evaluationStartStaffs.add(evaluationStartStaff);
//初始化lz_result_records数据 //初始化lz_result_records数据
ResultRecord resultRecord = new ResultRecord(); ResultRecord resultRecord = new ResultRecord();
resultRecord.setDepartmentId(staffInfo.getDepartmentId()); resultRecord.setDepartmentId(staffInfo.getDepartmentId());
@ -715,8 +711,6 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
if(modelDto.getTagetLibs() != null && modelDto.getTagetLibs().size() > 0){//模板里面有添加指标 if(modelDto.getTagetLibs() != null && modelDto.getTagetLibs().size() > 0){//模板里面有添加指标
for (ResultTagetLibDto libDto: for (ResultTagetLibDto libDto:
modelDto.getTagetLibs()) { modelDto.getTagetLibs()) {
ResultDetail resultDetail = new ResultDetail(); ResultDetail resultDetail = new ResultDetail();
resultDetail.setRecordId(resultRecord.getId()); resultDetail.setRecordId(resultRecord.getId());
resultDetail.setTarget(libDto.getName()); resultDetail.setTarget(libDto.getName());
@ -735,12 +729,8 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
if(resultDetails.size() > 0){ if(resultDetails.size() > 0){
// //
resultDetailService.insertResultDetails(resultDetails); resultDetailService.insertResultDetails(resultDetails);
} }
evaluationStartStaffService.insertEvaluationStartStaffs(evaluationStartStaffs); evaluationStartStaffService.insertEvaluationStartStaffs(evaluationStartStaffs);
//下面通知所有参与考核人员
//如果有下面通知所有管理人员
}else{ }else{
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚 TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
log.info("初始化考核流程失败"); log.info("初始化考核流程失败");

View File

@ -237,7 +237,7 @@ public class DingtalkBusiness {
public String sendWorkMSGWithAsyn(StaffSimpleInfo fromStaff, List<StaffSimpleInfo> toStaffids, int type) { public String sendWorkMSGWithAsyn(StaffSimpleInfo fromStaff, List<StaffSimpleInfo> toStaffids, int type) {
if(toStaffids.size() > 0){
if (toStaffids.get(0).getEmployeeId() == null || toStaffids.get(0).getEmployeeId().length() == 0) { if (toStaffids.get(0).getEmployeeId() == null || toStaffids.get(0).getEmployeeId().length() == 0) {
//查询第三方id //查询第三方id
List<Long> ids = toStaffids.stream().map(new Function<StaffSimpleInfo, Long>() { List<Long> ids = toStaffids.stream().map(new Function<StaffSimpleInfo, Long>() {
@ -261,6 +261,8 @@ public class DingtalkBusiness {
thread.start(); thread.start();
return "OK"; return "OK";
} }
return "error";
}
public String sendWorkMSGWithAsyn(List<StaffSimpleInfo> toStaffids, int type) { public String sendWorkMSGWithAsyn(List<StaffSimpleInfo> toStaffids, int type) {