|
@@ -2659,6 +2659,8 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
|
|
|
userIds.add(user.getId());
|
|
userIds.add(user.getId());
|
|
|
});
|
|
});
|
|
|
RoleDO role = roleService.getRoleByCode("项目部日报审批RD");
|
|
RoleDO role = roleService.getRoleByCode("项目部日报审批RD");
|
|
|
|
|
+ // 日报查阅 瑞都 日报抄送
|
|
|
|
|
+ RoleDO detailRole = roleService.getRoleByCode("日报查阅RD");
|
|
|
if (ObjUtil.isNotEmpty(role)) {
|
|
if (ObjUtil.isNotEmpty(role)) {
|
|
|
Set<Long> roleIds = new HashSet<>();
|
|
Set<Long> roleIds = new HashSet<>();
|
|
|
roleIds.add(role.getId());
|
|
roleIds.add(role.getId());
|
|
@@ -2698,6 +2700,47 @@ public class IotRdDailyReportServiceImpl implements IotRdDailyReportService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ // 给日报抄送人发送 4小时日报更新的 钉钉及站内信消息
|
|
|
|
|
+ if (ObjUtil.isNotEmpty(detailRole)) {
|
|
|
|
|
+ // 拥有日报查阅权限的人员列表
|
|
|
|
|
+ Set<Long> detailRoleIds = new HashSet<>();
|
|
|
|
|
+ detailRoleIds.add(role.getId());
|
|
|
|
|
+ List<UserRoleDO> userRoles = userRoleMapper.selectListByRoleIds(detailRoleIds);
|
|
|
|
|
+ if (CollUtil.isNotEmpty(userRoles)) {
|
|
|
|
|
+ // 提取有审批角色的所有用户ID(去重+空值过滤)
|
|
|
|
|
+ Set<Long> roleUserIds = userRoles.stream()
|
|
|
|
|
+ .map(UserRoleDO::getUserId)
|
|
|
|
|
+ .filter(Objects::nonNull) // 过滤空userId
|
|
|
|
|
+ .collect(Collectors.toSet());
|
|
|
|
|
+
|
|
|
|
|
+ // 计算两个集合的交集,得到最终目标用户ID
|
|
|
|
|
+ Set<Long> targetUserIds = userIds.stream()
|
|
|
|
|
+ .filter(roleUserIds::contains)
|
|
|
|
|
+ .collect(Collectors.toSet());
|
|
|
|
|
+
|
|
|
|
|
+ // 异步发送 站内信 钉钉消息
|
|
|
|
|
+ if (CollUtil.isNotEmpty(targetUserIds)) {
|
|
|
|
|
+ Map<Long, AdminUserRespDTO> users = adminUserApi.getUserMap(targetUserIds);
|
|
|
|
|
+ // 给多个用户发送 相同的 提醒消息
|
|
|
|
|
+ if (CollUtil.isNotEmpty(users)) {
|
|
|
|
|
+ CountDownLatch latch = new CountDownLatch(users.size());
|
|
|
|
|
+ users.forEach((userId, user) -> {
|
|
|
|
|
+ pmsThreadPoolTaskExecutor.execute(() -> {
|
|
|
|
|
+ try {
|
|
|
|
|
+ String mobile = user.getMobile();
|
|
|
|
|
+ if (StrUtil.isNotBlank(mobile) && StrUtil.isNotBlank(tobeSendMsgReport.getReportName())) {
|
|
|
|
|
+ pmsMessage.sendMessage(tobeSendMsgReport.getId(), tobeSendMsgReport.getReportName(), PmsConstants.DAILY_REPORT_DETAIL,
|
|
|
|
|
+ userId, mobile);
|
|
|
|
|
+ }
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ latch.countDown();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|