yuhongqi 2 тижнів тому
батько
коміт
2fe3b2b447

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

@@ -75,7 +75,7 @@ public class LiveCompletionPointsRecordServiceImpl implements ILiveCompletionPoi
             String configJson = live.getConfigJson();
             LiveWatchConfig config = null;
             Long requiredWatchDuration = null;
-            
+
             if (configJson != null && !configJson.isEmpty()) {
                 try {
                     config = JSON.parseObject(configJson, LiveWatchConfig.class);
@@ -113,7 +113,7 @@ public class LiveCompletionPointsRecordServiceImpl implements ILiveCompletionPoi
             BigDecimal watchRate = BigDecimal.valueOf(actualWatchDuration)
                     .multiply(BigDecimal.valueOf(100))
                     .divide(BigDecimal.valueOf(videoDuration), 2, RoundingMode.HALF_UP);
-            
+
             // 限制完课比例最大值为100.00%(防止数据库字段溢出)
             if (watchRate.compareTo(BigDecimal.valueOf(100)) > 0) {
                 watchRate = BigDecimal.valueOf(100);
@@ -280,7 +280,7 @@ public class LiveCompletionPointsRecordServiceImpl implements ILiveCompletionPoi
             // 2. 从直播间配置获取看课时长配置
             String configJson = live.getConfigJson();
             LiveWatchConfig config = null;
-            
+
             if (configJson != null && !configJson.isEmpty()) {
                 try {
                     config = JSON.parseObject(configJson, LiveWatchConfig.class);
@@ -344,7 +344,7 @@ public class LiveCompletionPointsRecordServiceImpl implements ILiveCompletionPoi
             }
             LiveCompletionPointsRecord record = new LiveCompletionPointsRecord();
 
-            if (config.getScoreAmount() == null) {
+            if (!config.getEnabled()) {
                 return record;
             }
 
@@ -373,7 +373,7 @@ public class LiveCompletionPointsRecordServiceImpl implements ILiveCompletionPoi
             throw e;
         }
     }
-    
+
     /**
      * 计算积分
      * 根据连续天数计算应得积分(简单规则:连续天数越多积分越多)