Browse Source

优化排班导出代码

zhongwei
tyty 1 year ago
parent
commit
c5ba0661d5
  1. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java

9
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java

@ -1409,6 +1409,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
// 获取部门所有没有分组的组员
LambdaQueryWrapper<ImsDutyMainPersonEntity> personWrapper = new LambdaQueryWrapper();
personWrapper.eq(ImsDutyMainPersonEntity::getCreateDept, deptId);
personWrapper.like(ImsDutyMainPersonEntity::getDutyDate, yearAndMonth);
List<ImsDutyMainPersonEntity> deptPersonList = imsDutyMainPersonMapper.selectList(personWrapper);
// 获取本月天数
@ -1438,13 +1439,15 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
List<ImsDutyGroupPEntity> list = imsDutyGroupPService.list(groupPWrapper);
managerName = deptUserMap.get(deptDutyGroupMap.get(imsDutyMainEntity.getDutyGroupId()).getManagerId());
personIds = list.stream().map(ImsDutyGroupPEntity::getPersonId).collect(Collectors.toList());
personIds = list.stream()
// 过滤出组长
.filter(s->!s.getPersonId().equals(deptDutyGroupMap.get(imsDutyMainEntity.getDutyGroupId()).getManagerId()))
.map(ImsDutyGroupPEntity::getPersonId).collect(Collectors.toList());
} else {
// 不存在分组id从排班人员中获取组长和组员
List<ImsDutyMainPersonEntity> personList = deptPersonList.stream().filter(var -> var.getDutyMainId().equals(imsDutyMainEntity.getId())).collect(Collectors.toList());
managerName = deptUserMap.get(personList.get(0).getDutyChargePerson());
personIds = personList.stream().map(ImsDutyMainPersonEntity::getDutyPerson).collect(Collectors.toList());
personIds = personList.stream().filter(s->!s.getDutyPerson().equals(personList.get(0).getDutyChargePerson())).map(ImsDutyMainPersonEntity::getDutyPerson).collect(Collectors.toList());
}
String personNames = "";

Loading…
Cancel
Save