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);