Sfoglia il codice sorgente

优化领取记录表

xw 3 giorni fa
parent
commit
fc66a64871

+ 6 - 6
fs-service/src/main/java/com/fs/live/service/impl/LiveCompletionPointsRecordServiceImpl.java

@@ -143,16 +143,16 @@ public class LiveCompletionPointsRecordServiceImpl implements ILiveCompletionPoi
 
                 long daysBetween = ChronoUnit.DAYS.between(lastDate, today);
 
-                if (daysBetween == 1) {
+                if (daysBetween == 0) {
+                    continuousDays = latestRecord.getContinuousDays();
+                    log.debug("今天已有其他直播间完课记录,继承连续天数, liveId={}, userId={}, continuousDays={}", 
+                            liveId, userId, continuousDays);
+                } else if (daysBetween == 1) {
                     // 昨天完课了,连续天数+1
                     continuousDays = latestRecord.getContinuousDays() + 1;
-                } else if (daysBetween > 1) {
+                } else {
                     // 中断了,重新开始
                     continuousDays = 1;
-                } else {
-                    // daysBetween == 0 说明今天已经有记录了(理论上不会进入这里,因为前面已经检查过)
-                    log.warn("异常情况: 今天已有完课记录, liveId={}, userId={}", liveId, userId);
-                    return;
                 }
             }