修复超级管理员无法管理组的问题
This commit is contained in:
parent
61d57a9292
commit
e3de3fa4cd
@ -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,17 +149,20 @@ public class EvaluationGroupServiceImpl extends ServiceImpl<EvaluationGroupMappe
|
|||||||
log.info("查询的管理组为空");
|
log.info("查询的管理组为空");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
gIds = new ArrayList<>();
|
if(staffRoleEvaluationGroups.get(0).getEvaluationGroupId().longValue() != 0L){//管理指定考评组的
|
||||||
for (StaffRoleEvaluationGroup staffRoleEvaluationGroup:staffRoleEvaluationGroups
|
gIds = new ArrayList<>();
|
||||||
) {
|
for (StaffRoleEvaluationGroup staffRoleEvaluationGroup:staffRoleEvaluationGroups
|
||||||
if(staffRoleEvaluationGroup.getEvaluationGroupId().longValue() == 0l){//管理所有组
|
) {
|
||||||
gIds = null;
|
if(staffRoleEvaluationGroup.getEvaluationGroupId().longValue() == 0l){//管理所有组
|
||||||
log.info("管理所有组");
|
gIds = null;
|
||||||
break;
|
log.info("管理所有组");
|
||||||
}
|
break;
|
||||||
gIds.add(staffRoleEvaluationGroup.getEvaluationGroupId());//管理特定组
|
}
|
||||||
|
gIds.add(staffRoleEvaluationGroup.getEvaluationGroupId());//管理特定组
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
List<Long> finalGIds = gIds;
|
List<Long> finalGIds = gIds;
|
||||||
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize())
|
PageUtils pageUtils = PageUtils.startPage(req.getCurrPage(), req.getPageSize())
|
||||||
|
|||||||
@ -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("初始化考核流程失败");
|
||||||
|
|||||||
@ -237,29 +237,31 @@ 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>() {
|
||||||
@Override
|
@Override
|
||||||
public Long apply(StaffSimpleInfo staffSimpleInfo) {
|
public Long apply(StaffSimpleInfo staffSimpleInfo) {
|
||||||
return staffSimpleInfo.getId();
|
return staffSimpleInfo.getId();
|
||||||
|
}
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
List<StaffSimpleInfo> staffSimpleInfos = staffService.selectStaffSimpleInfos(ids);
|
||||||
|
Map<Long, StaffSimpleInfo> map = toStaffids.stream().collect(Collectors.toMap(StaffSimpleInfo::getId, e -> e));
|
||||||
|
for (StaffSimpleInfo staff : staffSimpleInfos
|
||||||
|
) {
|
||||||
|
StaffSimpleInfo staff1 = map.get(staff.getId());
|
||||||
|
staff1.setEmployeeId(staff1.getEmployeeId());
|
||||||
}
|
}
|
||||||
}).collect(Collectors.toList());
|
|
||||||
List<StaffSimpleInfo> staffSimpleInfos = staffService.selectStaffSimpleInfos(ids);
|
|
||||||
Map<Long, StaffSimpleInfo> map = toStaffids.stream().collect(Collectors.toMap(StaffSimpleInfo::getId, e -> e));
|
|
||||||
for (StaffSimpleInfo staff : staffSimpleInfos
|
|
||||||
) {
|
|
||||||
StaffSimpleInfo staff1 = map.get(staff.getId());
|
|
||||||
staff1.setEmployeeId(staff1.getEmployeeId());
|
|
||||||
}
|
}
|
||||||
}
|
WorkMsgTypeEnum workMsgTypeEnum = WorkMsgTypeEnum.findRoleTypeByCode(type);
|
||||||
WorkMsgTypeEnum workMsgTypeEnum = WorkMsgTypeEnum.findRoleTypeByCode(type);
|
|
||||||
|
|
||||||
ThreadSendMessage threadSendMessage = new ThreadSendMessage(fromStaff, toStaffids, workMsgTypeEnum, appid);
|
ThreadSendMessage threadSendMessage = new ThreadSendMessage(fromStaff, toStaffids, workMsgTypeEnum, appid);
|
||||||
Thread thread = new Thread(threadSendMessage);
|
Thread thread = new Thread(threadSendMessage);
|
||||||
thread.start();
|
thread.start();
|
||||||
return "OK";
|
return "OK";
|
||||||
|
}
|
||||||
|
return "error";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user