From b82faa2dceec256a6843e28a7541077a6f23bfb7 Mon Sep 17 00:00:00 2001 From: yahaozhang Date: Wed, 17 Sep 2025 16:36:36 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=A8=E8=AE=BE=E5=A4=87=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=92=8C=E9=93=BE=E6=8E=A5=E7=8A=B6=E6=80=81=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E4=B8=AD=E6=B7=BB=E5=8A=A0=E5=AE=8C=E6=88=90=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=EF=BC=8C=E5=A2=9E=E5=BC=BA=E7=8A=B6=E6=80=81=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/service/device/DeviceStatusCheckService.java | 1 + .../server/service/link/DeviceAllocationService.java | 2 ++ .../server/service/link/LinkStatusService.java | 7 +++++++ 3 files changed, 10 insertions(+) diff --git a/src/main/java/com/gameplatform/server/service/device/DeviceStatusCheckService.java b/src/main/java/com/gameplatform/server/service/device/DeviceStatusCheckService.java index 2d2cfcf..c8e2e71 100644 --- a/src/main/java/com/gameplatform/server/service/device/DeviceStatusCheckService.java +++ b/src/main/java/com/gameplatform/server/service/device/DeviceStatusCheckService.java @@ -165,6 +165,7 @@ public class DeviceStatusCheckService { for (LinkTask task : loggedInTasks) { try { task.setStatus("COMPLETED"); + task.setReason("设备空闲兜底完成"); task.setCompletedPoints(points); task.setUpdatedAt(LocalDateTime.now()); diff --git a/src/main/java/com/gameplatform/server/service/link/DeviceAllocationService.java b/src/main/java/com/gameplatform/server/service/link/DeviceAllocationService.java index 7a74a26..b4b99e4 100644 --- a/src/main/java/com/gameplatform/server/service/link/DeviceAllocationService.java +++ b/src/main/java/com/gameplatform/server/service/link/DeviceAllocationService.java @@ -108,6 +108,7 @@ public class DeviceAllocationService { if (shouldExpire) { String prev = task.getStatus(); task.setStatus("EXPIRED"); + task.setReason("USING超时10分钟自动过期"); task.setUpdatedAt(now); int updated = linkTaskMapper.update(task); if (updated > 0) { @@ -143,6 +144,7 @@ public class DeviceAllocationService { if (shouldComplete) { String prev = task.getStatus(); task.setStatus("COMPLETED"); + task.setReason("LOGGED_IN超过30分钟自动完成"); task.setUpdatedAt(now); int updated = linkTaskMapper.update(task); if (updated > 0) { diff --git a/src/main/java/com/gameplatform/server/service/link/LinkStatusService.java b/src/main/java/com/gameplatform/server/service/link/LinkStatusService.java index 1f97363..47ea430 100644 --- a/src/main/java/com/gameplatform/server/service/link/LinkStatusService.java +++ b/src/main/java/com/gameplatform/server/service/link/LinkStatusService.java @@ -225,6 +225,7 @@ public class LinkStatusService { // 5. 更新链接状态为 REFUNDED linkTask.setStatus("REFUNDED"); + linkTask.setReason("状态:已退款"); linkTask.setRefundAt(LocalDateTime.now()); linkTask.setUpdatedAt(LocalDateTime.now()); @@ -532,6 +533,7 @@ private UserLinkStatusResponse doGetUserLinkStatus(Long linkId, String codeNo) { log.warn("链接任务已过期: expireAt={}", linkTask.getExpireAt()); LocalDateTime now = LocalDateTime.now(); linkTask.setStatus("EXPIRED"); + linkTask.setReason("状态:已过期"); linkTask.setExpireAt(now); // 设置过期时间戳 linkTask.setUpdatedAt(now); // Note: The following line was incomplete/incorrect in the original. @@ -564,6 +566,7 @@ private UserLinkStatusResponse doGetUserLinkStatus(Long linkId, String codeNo) { LocalDateTime now = LocalDateTime.now(); linkTask.setStatus("EXPIRED"); + linkTask.setReason("状态:已过期(10分钟未登录)"); linkTask.setExpireAt(now); // 设置过期时间戳 linkTask.setUpdatedAt(now); // Note: The following line was incomplete/incorrect in the original. @@ -698,6 +701,7 @@ private UserLinkStatusResponse doGetUserLinkStatus(Long linkId, String codeNo) { if(!linkTask.getStatus().equals("USING")){ LocalDateTime now = LocalDateTime.now(); linkTask.setStatus("USING"); + linkTask.setReason("首次选区"); linkTask.setUpdatedAt(now); linkTaskMapper.updateById(linkTask); } @@ -733,6 +737,7 @@ private UserLinkStatusResponse doGetUserLinkStatus(Long linkId, String codeNo) { if(!linkTask.getStatus().equals("USING")){ LocalDateTime now = LocalDateTime.now(); linkTask.setStatus("USING"); + linkTask.setReason("重复选区"); linkTask.setUpdatedAt(now); linkTaskMapper.updateById(linkTask); } @@ -752,6 +757,7 @@ private UserLinkStatusResponse doGetUserLinkStatus(Long linkId, String codeNo) { // 将链接状态设置为过期 linkTask.setStatus("EXPIRED"); + linkTask.setReason("首次选区已过期"); linkTask.setExpireAt(now); // 设置过期时间戳 linkTask.setUpdatedAt(now); linkTaskMapper.updateById(linkTask); @@ -1042,6 +1048,7 @@ private UserLinkStatusResponse doGetUserLinkStatus(Long linkId, String codeNo) { linkTask.setLoginAt(now); } linkTask.setStatus("LOGGED_IN"); + linkTask.setReason("状态:已登录"); linkTask.setUpdatedAt(now); linkTaskMapper.updateById(linkTask);