|
|
@ -1591,7 +1591,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I |
|
|
|
|
|
|
|
|
|
|
|
// 获取一天的排班
|
|
|
|
// 获取一天的排班
|
|
|
|
List<ImsDutyMainEntity> dutyMainDayList = dutyMainList.stream().filter(var -> dateFormat.format(var.getDutyDate()).equals(dateStr)).collect(Collectors.toList()); |
|
|
|
List<ImsDutyMainEntity> dutyMainDayList = dutyMainList.stream().filter(var -> dateFormat.format(var.getDutyDate()).equals(dateStr)).collect(Collectors.toList()); |
|
|
|
|
|
|
|
List<Long> dayUserIds=new ArrayList<>(); |
|
|
|
// 循环获取当前日期每个班次组员id
|
|
|
|
// 循环获取当前日期每个班次组员id
|
|
|
|
for (ImsDutyMainEntity imsDutyMainEntity : dutyMainDayList) { |
|
|
|
for (ImsDutyMainEntity imsDutyMainEntity : dutyMainDayList) { |
|
|
|
ImsDutyMainReportExcel reportExcel = new ImsDutyMainReportExcel(); |
|
|
|
ImsDutyMainReportExcel reportExcel = new ImsDutyMainReportExcel(); |
|
|
@ -1602,23 +1602,25 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I |
|
|
|
} |
|
|
|
} |
|
|
|
reportExcel.setDutyDate(dateStr); |
|
|
|
reportExcel.setDutyDate(dateStr); |
|
|
|
reportExcel.setClassName(imsDutyClass.getClassName() + "(" + imsDutyClass.getStartTime() + " - " + imsDutyClass.getEndTime() + ")"); |
|
|
|
reportExcel.setClassName(imsDutyClass.getClassName() + "(" + imsDutyClass.getStartTime() + " - " + imsDutyClass.getEndTime() + ")"); |
|
|
|
|
|
|
|
|
|
|
|
List<Long> personIds; |
|
|
|
List<Long> personIds; |
|
|
|
|
|
|
|
|
|
|
|
String managerName; |
|
|
|
String managerName; |
|
|
|
if (Func.isNotEmpty(imsDutyMainEntity.getDutyGroupId())) { |
|
|
|
if (Func.isNotEmpty(imsDutyMainEntity.getDutyGroupId())) { |
|
|
|
// 存在分组id需要从分组中获取组长和组员
|
|
|
|
// 存在分组id需要从分组中获取组长和组员
|
|
|
|
LambdaQueryWrapper<ImsDutyGroupPEntity> groupPWrapper = new LambdaQueryWrapper(); |
|
|
|
LambdaQueryWrapper<ImsDutyGroupPEntity> groupPWrapper = new LambdaQueryWrapper(); |
|
|
|
groupPWrapper.eq(ImsDutyGroupPEntity::getGroupId, imsDutyMainEntity.getDutyGroupId()); |
|
|
|
groupPWrapper.eq(ImsDutyGroupPEntity::getGroupId, imsDutyMainEntity.getDutyGroupId()); |
|
|
|
List<ImsDutyGroupPEntity> list = imsDutyGroupPService.list(groupPWrapper); |
|
|
|
List<ImsDutyGroupPEntity> list = imsDutyGroupPService.list(groupPWrapper); |
|
|
|
|
|
|
|
|
|
|
|
managerName = deptUserMap.get(deptDutyGroupMap.get(imsDutyMainEntity.getDutyGroupId()).getManagerId()); |
|
|
|
managerName = deptUserMap.get(deptDutyGroupMap.get(imsDutyMainEntity.getDutyGroupId()).getManagerId()); |
|
|
|
|
|
|
|
dayUserIds.addAll(list.stream().map(ImsDutyGroupPEntity::getPersonId).collect(Collectors.toList())); |
|
|
|
personIds = list.stream() |
|
|
|
personIds = list.stream() |
|
|
|
// 过滤出组长
|
|
|
|
// 过滤出组长
|
|
|
|
.filter(s -> !s.getPersonId().equals(deptDutyGroupMap.get(imsDutyMainEntity.getDutyGroupId()).getManagerId())) |
|
|
|
.filter(s -> !s.getPersonId().equals(deptDutyGroupMap.get(imsDutyMainEntity.getDutyGroupId()).getManagerId())) |
|
|
|
.map(ImsDutyGroupPEntity::getPersonId).collect(Collectors.toList()); |
|
|
|
.map(ImsDutyGroupPEntity::getPersonId).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// 不存在分组id从排班人员中获取组长和组员
|
|
|
|
// 不存在分组id从排班人员中获取组长和组员
|
|
|
|
List<ImsDutyMainPersonEntity> personList = deptPersonList.stream().filter(var -> var.getDutyMainId().equals(imsDutyMainEntity.getId())).collect(Collectors.toList()); |
|
|
|
List<ImsDutyMainPersonEntity> personList = deptPersonList.stream().filter(var -> var.getDutyMainId().equals(imsDutyMainEntity.getId())).collect(Collectors.toList()); |
|
|
|
|
|
|
|
dayUserIds.addAll( personList.stream().map(ImsDutyMainPersonEntity::getDutyPerson).collect(Collectors.toList())); |
|
|
|
managerName = deptUserMap.get(personList.get(0).getDutyChargePerson()); |
|
|
|
managerName = deptUserMap.get(personList.get(0).getDutyChargePerson()); |
|
|
|
personIds = personList.stream().filter(s -> !s.getDutyPerson().equals(personList.get(0).getDutyChargePerson())).map(ImsDutyMainPersonEntity::getDutyPerson).collect(Collectors.toList()); |
|
|
|
personIds = personList.stream().filter(s -> !s.getDutyPerson().equals(personList.get(0).getDutyChargePerson())).map(ImsDutyMainPersonEntity::getDutyPerson).collect(Collectors.toList()); |
|
|
|
} |
|
|
|
} |
|
|
@ -1628,8 +1630,6 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I |
|
|
|
for (int j = 0; j < personIds.size(); j++) { |
|
|
|
for (int j = 0; j < personIds.size(); j++) { |
|
|
|
Long userId = personIds.get(j); |
|
|
|
Long userId = personIds.get(j); |
|
|
|
String userName = deptUserMap.get(userId); |
|
|
|
String userName = deptUserMap.get(userId); |
|
|
|
// 把排班的组员从休息名单中移除
|
|
|
|
|
|
|
|
restUserList.removeIf(user -> user.getId().equals(userId)); |
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(userName)) { |
|
|
|
if (ObjectUtil.isNotEmpty(userName)) { |
|
|
|
if (j == personIds.size() - 1) { |
|
|
|
if (j == personIds.size() - 1) { |
|
|
|
personNames += userName; |
|
|
|
personNames += userName; |
|
|
@ -1648,6 +1648,10 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I |
|
|
|
restReportExcel.setClassName("休息"); |
|
|
|
restReportExcel.setClassName("休息"); |
|
|
|
restReportExcel.setManagerName("无班组长"); |
|
|
|
restReportExcel.setManagerName("无班组长"); |
|
|
|
String personNames = ""; |
|
|
|
String personNames = ""; |
|
|
|
|
|
|
|
// 把排班的组员从休息名单中移除
|
|
|
|
|
|
|
|
for (Long userId : dayUserIds) { |
|
|
|
|
|
|
|
restUserList.removeIf(user -> user.getId().equals(userId)); |
|
|
|
|
|
|
|
} |
|
|
|
// 获取休息组员的名称
|
|
|
|
// 获取休息组员的名称
|
|
|
|
for (int j = 0; j < restUserList.size(); j++) { |
|
|
|
for (int j = 0; j < restUserList.size(); j++) { |
|
|
|
User user = restUserList.get(j); |
|
|
|
User user = restUserList.get(j); |
|
|
|