浏览代码

fix:保存广告记录使用时间戳而不是时间字符串

zack 1 月之前
父节点
当前提交
862ee0d959

+ 4 - 0
yt-common/src/main/java/com/ytpm/app/param/DyzAdRecordParam.java

@@ -33,6 +33,10 @@ public class DyzAdRecordParam {
     private String beginTime;
     @ApiModelProperty("完成时间")
     private String finishTime;
+    @ApiModelProperty("开始时间时间戳")
+    private Long begintimestamp;
+    @ApiModelProperty("完成时间时间戳")
+    private Long finishtimestamp;
     @ApiModelProperty("当天观看广告次数")
     private int adCount;
     @ApiModelProperty("Taku预估eCPM 对应adsource_price")

+ 8 - 0
yt-ios-lemon/lemon-ios-service/src/main/java/com/ytpm/lemonios/service/impl/AdServiceImpl.java

@@ -67,6 +67,10 @@ public class AdServiceImpl implements AdService {
                 param.setBeginTime(param.getFinishTime());
             }
             BeanUtils.copyProperties(param, adRecord);
+            if (param.getBegintimestamp() != null && param.getFinishtimestamp() != null) {
+                adRecord.setBeginTime(DateUtil.format(new Date(param.getBegintimestamp()), "yyyy-MM-dd HH:mm:ss"));
+                adRecord.setFinishTime(DateUtil.format(new Date(param.getFinishtimestamp()), "yyyy-MM-dd HH:mm:ss"));
+            }
             adRecord.setIosId(param.getIosId());
             adRecord.setAppId("251be4dff0fd408fbc1fe2c47bf515eb");
             adRecord.setRecordId(IdUtil.fastSimpleUUID());
@@ -300,6 +304,10 @@ public class AdServiceImpl implements AdService {
             param.setBeginTime(param.getFinishTime());
         }
         BeanUtils.copyProperties(param, adRecord);
+        if (param.getBegintimestamp() != null && param.getFinishtimestamp() != null) {
+            adRecord.setBeginTime(DateUtil.format(new Date(param.getBegintimestamp()), "yyyy-MM-dd HH:mm:ss"));
+            adRecord.setFinishTime(DateUtil.format(new Date(param.getFinishtimestamp()), "yyyy-MM-dd HH:mm:ss"));
+        }
         adRecord.setIosId(param.getIosId());
         adRecord.setRecordId(IdUtil.fastSimpleUUID());
         adRecord.setUserId(user.getUserId());