diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java index 007b2f1..7293ec0 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java @@ -96,8 +96,8 @@ public class DefectCheckServiceImpl extends BaseServiceImpl dutyMainDayList = dutyMainList.stream().filter(var -> dateFormat.format(var.getDutyDate()).equals(dateStr)).collect(Collectors.toList()); - + List dayUserIds=new ArrayList<>(); // 循环获取当前日期每个班次组员id for (ImsDutyMainEntity imsDutyMainEntity : dutyMainDayList) { ImsDutyMainReportExcel reportExcel = new ImsDutyMainReportExcel(); @@ -1602,23 +1602,25 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl personIds; + String managerName; if (Func.isNotEmpty(imsDutyMainEntity.getDutyGroupId())) { // 存在分组id需要从分组中获取组长和组员 LambdaQueryWrapper groupPWrapper = new LambdaQueryWrapper(); groupPWrapper.eq(ImsDutyGroupPEntity::getGroupId, imsDutyMainEntity.getDutyGroupId()); List list = imsDutyGroupPService.list(groupPWrapper); - managerName = deptUserMap.get(deptDutyGroupMap.get(imsDutyMainEntity.getDutyGroupId()).getManagerId()); + dayUserIds.addAll(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 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()); 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 user.getId().equals(userId)); if (ObjectUtil.isNotEmpty(userName)) { if (j == personIds.size() - 1) { personNames += userName; @@ -1648,6 +1648,10 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl user.getId().equals(userId)); + } // 获取休息组员的名称 for (int j = 0; j < restUserList.size(); j++) { User user = restUserList.get(j);