发起绩效时增加搜索绩效管理员

This commit is contained in:
wulin 2020-10-30 11:30:20 +08:00
parent ee7c9ebc4f
commit c88eb0a9b3
5 changed files with 20 additions and 4 deletions

View File

@ -96,4 +96,6 @@ public interface StaffDao extends BaseMapper<StaffEntity> {
StaffSimpleInfo selectStaffSimpleInfo(@Param("staffId") Long staffId);
List<StaffEntity> selectNamesByIds(@Param("list") List<Long> sIds);
List<StaffEntity> selectStaffsByGroupId(@Param("copyId") Long copyId);
}

View File

@ -101,5 +101,7 @@ public interface StaffService extends IService<StaffEntity> {
StaffSimpleInfo selectStaffSimpleInfo(Long staffId);
List<StaffEntity> selectNamesByIds(List<Long> sIds);
//获取绩效考核管理员
List<StaffEntity> selectStaffsByGroupId(Long copyId);
}

View File

@ -524,5 +524,10 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
return staffDao.selectNamesByIds(sIds);
}
@Override
public List<StaffEntity> selectStaffsByGroupId(Long copyId){
return staffDao.selectStaffsByGroupId(copyId);
}
}

View File

@ -181,7 +181,6 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
}
Map<String, List<StaffEntity>> staffManages = new HashedMap();//部门(id+几级)和部门几级管理对应关系减少数据库查找
//下面开始初始化流程
List<Long> ids = Arrays.stream(flowStart.getGroupIds().split(",")).map(new Function<String, Long>() {
@ -250,8 +249,9 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
Map<Long, String> chartNameMaps =
flowCharts.stream().collect(Collectors.toMap(FlowChart::getId, FlowChart::getName));//流程节点与流程名称对应map下面多次循环减少数据库查找
List<StaffEntity> staffManagers = null;
if(!StringUtil.isEmpty(evaluationGroup.getManagerIds())){
//获取绩效考核管理员
List<StaffEntity> staffManagers = staffService.selectStaffsByGroupId(evaluationGroup.getCopyId());
/*if(!StringUtil.isEmpty(evaluationGroup.getManagerIds())){
List<Long> mIds = Arrays.stream(evaluationGroup.getManagerIds().split(","))
.map(new Function<String, Long>() {
@Override
@ -262,7 +262,7 @@ public class FlowStartServiceImpl extends ServiceImpl<FlowStartMapper, FlowStart
//查找在职的管理人员
staffManagers = staffService.selectOnJobByIds(mIds);
}
}*/
if(staffManagers == null || staffManagers.size() == 0){
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();//事务回滚
return 4;

View File

@ -538,4 +538,11 @@
</foreach>
)
</select>
<select id="selectStaffsByGroupId" resultType="com.lz.modules.app.entity.StaffEntity">
select staff.* from (select * from lz_staff where id in (
select staff_id from lz_staff_role where is_delete = 0 and (evaluation_group_id = #{sIds} or evaluation_group_id = 0)
) and is_delete=0) as staff join lz_staff_occupation as occupation on staff.id = occupation.staff_id where occupation.staff_status=0
</select>
</mapper>