瀏覽代碼

小时数据 补全23小时

zhaoxian 1 年之前
父節點
當前提交
fd52a03e1c

+ 5 - 5
ruixuan-live/src/main/java/com/ruixuan/isc/service/impl/KuaishouItemCollectSamplesServiceImpl.java

@@ -848,9 +848,9 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
             yesterday = supplyChainService.getKsCourtshipGmvHourByDate(userList, DateUtils.getIntegerTime(lastDate));
             roi = supplyChainService.getKsCourtshipGmvHourByDateRoi(userList, DateUtils.getIntegerTime(nowDate));
         }
-        completionTime(today, nowDate);
-        completionTime(yesterday, lastDate);
-        completionTime(roi, nowDate);
+        completionTime(today, nowDate,"charge");
+        completionTime(yesterday, lastDate,"charge");
+        completionTime(roi, nowDate,"roi");
         JSONObject result = new JSONObject();
         result.put("today", today);
         result.put("yesterday", yesterday);
@@ -865,7 +865,7 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
     /**
      * 补全时辰
      */
-    private void completionTime(List<JSONObject> dataList, String nowDate) {
+    private void completionTime(List<JSONObject> dataList, String nowDate,String type) {
      /*   String today = DateUtils.getNowDate("yyyy-MM-dd");   // 当天
         Integer tohour = DateUtils.getNowHour(); // 当前小时*/
 
@@ -887,7 +887,7 @@ public class KuaishouItemCollectSamplesServiceImpl implements IKuaishouItemColle
             if (!newDayList.contains(hour)) {
                 JSONObject obj = new JSONObject();
                 obj.put("time", hour);
-                obj.put("charge", 0.00);
+                obj.put(type, 0.00);
                 dataList.add(obj);
             }
         }