huangpingkang 1 год назад
Родитель
Сommit
6ba5002170

+ 2 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/mapper/xml/DianZhongMapper.xml

@@ -25,7 +25,8 @@
     <select id="getTaskUrl" resultType="com.alibaba.fastjson.JSONObject">
         select task_id,url,type,client_id
         from media_api.dianzhong_data_download_url
-        where stat_date= ${statDate} and downloaded = 0 and url is not null and url != '-1'
+        where downloaded = 0 and url is not null and url != '-1'
+        order by stat_date, type desc , create_time
     </select>
 
     <select id="getDZRetry" resultType="com.alibaba.fastjson.JSONObject">

+ 10 - 7
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/impl/DianZhongServiceImpl.java

@@ -180,7 +180,7 @@ public class DianZhongServiceImpl implements IDianZhongService {
         String promotionId = jsonObject.getString("promotionId");
         adId = StringUtils.isNotBlank(promotionId) ? promotionId : adId;
         Long dyeTime = jsonObject.getLong("dyeTime");
-        String activationTime = DateUtils.formatDate(dyeTime * 1000, "yyyy-MM-dd HH:mm:ss");
+        String activationTime = dyeTime != null ? DateUtils.formatDate(dyeTime * 1000, "yyyy-MM-dd HH:mm:ss") : null;
         String fromMedia = jsonObject.getString("from");
         userJson.put("app_id", appIdByChannelId);
         userJson.put("uid", jsonObject.getString("userId"));
@@ -230,8 +230,8 @@ public class DianZhongServiceImpl implements IDianZhongService {
         String promotionId = jsonObject.getString("promotionId");
         adId = StringUtils.isNotBlank(promotionId) ? promotionId : adId;
         Long dyeTime = jsonObject.getLong("dyeTime");
-        String activationTime = DateUtils.formatDate(dyeTime * 1000, "yyyy-MM-dd HH:mm:ss");
-        String activationDate = DateUtils.formatDate(dyeTime * 1000, "yyyyMMdd");
+        String activationTime = dyeTime != null ? DateUtils.formatDate(dyeTime * 1000, "yyyy-MM-dd HH:mm:ss") : null;
+        String activationDate = dyeTime != null ? DateUtils.formatDate(dyeTime * 1000, "yyyyMMdd") : null;
         Long ctime = jsonObject.getLong("ctime");
         String registerTime = DateUtils.formatDate(ctime * 1000, "yyyy-MM-dd HH:mm:ss");
         String registerDate = DateUtils.formatDate(ctime * 1000, "yyyyMMdd");
@@ -287,6 +287,9 @@ public class DianZhongServiceImpl implements IDianZhongService {
         String promotionId = jsonObject.getString("promotionId");
         adId = StringUtils.isNotBlank(promotionId) ? promotionId : adId;
         Long dyeTime = jsonObject.getLong("dyeTime");
+        if (dyeTime == null) {
+            return;
+        }
         String statDate = DateUtils.formatDate(dyeTime * 1000, "yyyyMMdd");
         String activationTime = DateUtils.formatDate(dyeTime * 1000, "yyyy-MM-dd HH:mm:ss");
         Long ctime = jsonObject.getLong("ctime");
@@ -346,8 +349,8 @@ public class DianZhongServiceImpl implements IDianZhongService {
         String promotionId = jsonObject.getString("promotionId");
         adId = StringUtils.isNotBlank(promotionId) ? promotionId : adId;
         Long dyeTime = jsonObject.getLong("dyeTime");
-        String activationTime = DateUtils.formatDate(dyeTime * 1000, "yyyy-MM-dd HH:mm:ss");
-        String activationDate = DateUtils.formatDate(dyeTime * 1000, "yyyyMMdd");
+        String activationTime = dyeTime != null ? DateUtils.formatDate(dyeTime * 1000, "yyyy-MM-dd HH:mm:ss") : null;
+        String activationDate = dyeTime != null ? DateUtils.formatDate(dyeTime * 1000, "yyyyMMdd") : null;
         String registerTime = DateUtils.formatDate(ctime * 1000, "yyyy-MM-dd HH:mm:ss");
         String registerDate = DateUtils.formatDate(ctime * 1000, "yyyyMMdd");
         String fromMedia = jsonObject.getString("from");
@@ -407,8 +410,8 @@ public class DianZhongServiceImpl implements IDianZhongService {
         String promotionId = jsonObject.getString("promotionId");
         adId = StringUtils.isNotBlank(promotionId) ? promotionId : adId;
         Long dyeTime = jsonObject.getLong("dyeTime");
-        String activationTime = DateUtils.formatDate(dyeTime * 1000, "yyyy-MM-dd HH:mm:ss");
-        String activationDate = DateUtils.formatDate(dyeTime * 1000, "yyyyMMdd");
+        String activationTime = dyeTime != null ? DateUtils.formatDate(dyeTime * 1000, "yyyy-MM-dd HH:mm:ss") : null;
+        String activationDate = dyeTime != null ? DateUtils.formatDate(dyeTime * 1000, "yyyyMMdd") : null;
         Long registerT = jsonObject.getLong("registerDate");
         String registerTime = DateUtils.formatDate(registerT * 1000, "yyyy-MM-dd HH:mm:ss");
         String registerDate = DateUtils.formatDate(registerT * 1000, "yyyyMMdd");