操作日志修改

This commit is contained in:
chenxing
2026-08-17 20:13:17 +08:00
parent ac95b2463b
commit 60360bfb6b
@@ -77,7 +77,7 @@ public class PushDispatcher {
users = sysUserRepository.findAll(); users = sysUserRepository.findAll();
} }
for (ApplicationInfo app : applicationInfoRepository.findByPushEnabled(1)) { for (ApplicationInfo app : applicationInfoRepository.findByPushEnabled(1)) {
dispatchToOne(app, type, groups, users, "auto"); dispatchToOne(app, type, groups, users, "auto", false);
} }
} catch (Exception e) { } catch (Exception e) {
log.error("[推送] 分发失败(不影响主业务)", e); log.error("[推送] 分发失败(不影响主业务)", e);
@@ -108,7 +108,9 @@ public class PushDispatcher {
users = (targetIds == null || targetIds.isEmpty()) users = (targetIds == null || targetIds.isEmpty())
? sysUserRepository.findAll() : sysUserRepository.findAllById(targetIds); ? sysUserRepository.findAll() : sysUserRepository.findAllById(targetIds);
} }
dispatchToOne(app, type, groups, users, "manual"); // 手动全量同步(SyncGroup/SyncUser)属于管理员主动触发,绕过订阅接口开关,确保一定能投递
boolean force = (type == PushInterfaceType.SYNC_GROUP || type == PushInterfaceType.SYNC_USER);
dispatchToOne(app, type, groups, users, "manual", force);
} }
/** /**
@@ -176,11 +178,13 @@ public class PushDispatcher {
// ===================== 核心 ===================== // ===================== 核心 =====================
private void dispatchToOne(ApplicationInfo app, PushInterfaceType type, private void dispatchToOne(ApplicationInfo app, PushInterfaceType type,
List<SysGroup> groups, List<SysUser> users, String triggerType) { List<SysGroup> groups, List<SysUser> users, String triggerType, boolean force) {
if (app.getPushEnabled() == null || app.getPushEnabled() != 1) { if (app.getPushEnabled() == null || app.getPushEnabled() != 1) {
return; return;
} }
if (!containsEventType(app.getPushEventTypes(), type.getPath())) { // 手动全量同步为管理员主动触发,绕过订阅接口开关(force=true);
// 自动/增量事件仍要求订阅方在 pushEventTypes 中勾选对应接口。
if (!force && !containsEventType(app.getPushEventTypes(), type.getPath())) {
return; return;
} }
boolean isFull = (type == PushInterfaceType.SYNC_GROUP || type == PushInterfaceType.SYNC_USER); boolean isFull = (type == PushInterfaceType.SYNC_GROUP || type == PushInterfaceType.SYNC_USER);