|
@@ -15,6 +15,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
@@ -53,6 +54,9 @@ public class ContentPlatformDatastatJob {
|
|
|
@XxlJob("syncContentPlatformGzhDatastatJob")
|
|
|
public ReturnT<String> syncContentPlatformGzhDatastatJob(String param) {
|
|
|
String dt = DateUtil.getBeforeDayDateString("yyyyMMdd");
|
|
|
+ if (StringUtils.hasText(param)) {
|
|
|
+ dt = param;
|
|
|
+ }
|
|
|
long count = getGzhDatastatCount(dt);
|
|
|
if (count > 0) {
|
|
|
return ReturnT.SUCCESS;
|
|
@@ -120,10 +124,11 @@ public class ContentPlatformDatastatJob {
|
|
|
size += videoList.size();
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- BigDecimal num = BigDecimal.valueOf(score / size);
|
|
|
- BigDecimal rounded = num.setScale(2, RoundingMode.HALF_UP);
|
|
|
- item.setScore(rounded.doubleValue());
|
|
|
+ if (size > 0) {
|
|
|
+ BigDecimal num = BigDecimal.valueOf(score / size);
|
|
|
+ BigDecimal rounded = num.setScale(2, RoundingMode.HALF_UP);
|
|
|
+ item.setScore(rounded.doubleValue());
|
|
|
+ }
|
|
|
item.setCreateTimestamp(now);
|
|
|
saveList.add(item);
|
|
|
}
|
|
@@ -161,6 +166,9 @@ public class ContentPlatformDatastatJob {
|
|
|
@XxlJob("syncContentPlatformQwDatastatJob")
|
|
|
public ReturnT<String> syncContentPlatformQwDatastatJob(String param) {
|
|
|
String dt = DateUtil.getBeforeDayDateString("yyyyMMdd");
|
|
|
+ if (StringUtils.hasText(param)) {
|
|
|
+ dt = param;
|
|
|
+ }
|
|
|
List<ContentPlatformQwPlan> qwPlanList = getAllQwPlan();
|
|
|
if (CollectionUtils.isEmpty(qwPlanList)) {
|
|
|
return ReturnT.SUCCESS;
|
|
@@ -257,6 +265,9 @@ public class ContentPlatformDatastatJob {
|
|
|
@XxlJob("syncContentPlatformQwDatastatTotalJob")
|
|
|
public ReturnT<String> syncContentPlatformQwDatastatTotalJob(String param) {
|
|
|
String dt = DateUtil.getBeforeDayDateString("yyyyMMdd");
|
|
|
+ if (StringUtils.hasText(param)) {
|
|
|
+ dt = param;
|
|
|
+ }
|
|
|
dataStatMapperExt.deleteQwDatastatTotal(dt);
|
|
|
Map<String, ContentPlatformQwDataStatTotal> saveMap = new HashMap<>();
|
|
|
String outSql = String.format("SELECT * FROM loghubods.qw_out_touliu_behavior_total WHERE dt=%s;", dt);
|