|
@@ -817,7 +817,7 @@ public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person>
|
|
|
List<Person> people = personMapper.queryPersonList(pageQueryPersonDTO);
|
|
|
int total = personMapper.queryCount(pageQueryPersonDTO);
|
|
|
|
|
|
- return packagePageResult(people, total);
|
|
|
+ return packagePageResult(people, total, pageQueryPersonDTO.getDepId());
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -829,7 +829,20 @@ public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person>
|
|
|
* @author lixing
|
|
|
* @version V1.0 2021/4/14 5:51 下午
|
|
|
*/
|
|
|
- private IPage<ResponsePersonListItemVO> packagePageResult(List<Person> people, int total) {
|
|
|
+ private IPage<ResponsePersonListItemVO> packagePageResult(List<Person> people, int total){
|
|
|
+ return packagePageResult(people, total, null);
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 组装分页查询结果
|
|
|
+ *
|
|
|
+ * @param people 人员列表(单页)
|
|
|
+ * @param total 人员总数量
|
|
|
+ * @param depId 部门id,如果不根据部门id查询这里传null
|
|
|
+ * @return 分页结果
|
|
|
+ * @author lixing
|
|
|
+ * @version V1.0 2021/4/14 5:51 下午
|
|
|
+ */
|
|
|
+ private IPage<ResponsePersonListItemVO> packagePageResult(List<Person> people, int total, String depId) {
|
|
|
List<String> accountIds = people.stream().map(Person::getAccountId).collect(Collectors.toList());
|
|
|
Map<String, AccountRoleVO> accountRoleVoMap = saasAccountRoleService.
|
|
|
queryAccountRoleVoMapByAccountIdList(accountIds);
|
|
@@ -868,6 +881,17 @@ public class PersonServiceImpl extends ServiceImpl<PersonMapper, Person>
|
|
|
// 设置所属部门
|
|
|
List<WorkResume> workResumes = workResumeService.queryWorkResumeListByPersonIdList(
|
|
|
Lists.newArrayList(responsePersonListItem.getId()));
|
|
|
+ if (StringUtils.isNotBlank(depId)) {
|
|
|
+ List<WorkResume> currentWorkResumes = workResumes.stream().filter(workResume -> depId.equals(workResume.getDepId())
|
|
|
+ && responsePersonListItem.getId().equals(workResume.getPersonId())).
|
|
|
+ collect(Collectors.toList());
|
|
|
+ if (!CollectionUtils.isEmpty(currentWorkResumes)) {
|
|
|
+ WorkResume currentWorkResume = currentWorkResumes.get(0);
|
|
|
+ responsePersonListItem.setIsLeader(currentWorkResume.getIsLeader());
|
|
|
+ responsePersonListItem.setEnableState(currentWorkResume.getEnableState());
|
|
|
+ responsePersonListItem.setHiredState(currentWorkResume.getHiredState());
|
|
|
+ }
|
|
|
+ }
|
|
|
responsePersonListItem.setDeps(getDepSimpleObjVoList(workResumes));
|
|
|
}
|
|
|
|