浏览代码

去除打印

yumeng 1 月之前
父节点
当前提交
4f044ce16b

+ 3 - 1
job-bytedance/src/main/java/cn/com/ctop/job/bytedance/data/service/impl/BytedanceReportNewServiceImpl.java

@@ -24,7 +24,7 @@ public class BytedanceReportNewServiceImpl implements IBytedanceReportNewService
     @Autowired
     @Autowired
     private AccountReportNewMapper accountReportNewMapper;
     private AccountReportNewMapper accountReportNewMapper;
 
 
-    private static final JSONArray metrics = new JSONArray();
+    private static JSONArray metrics = new JSONArray();
 
 
     @Override
     @Override
     public void getBytedanceAccountHour(Long advertiserId, String accessToken, String startDate, String endDate, Integer page) {
     public void getBytedanceAccountHour(Long advertiserId, String accessToken, String startDate, String endDate, Integer page) {
@@ -218,6 +218,7 @@ public class BytedanceReportNewServiceImpl implements IBytedanceReportNewService
         if (!Check.isNull(metrics)) {
         if (!Check.isNull(metrics)) {
             return metrics;
             return metrics;
         }
         }
+        synchronized();
         String url = "https://api.oceanengine.com/open_api/v3.0/report/custom/config/get/";
         String url = "https://api.oceanengine.com/open_api/v3.0/report/custom/config/get/";
         Map<String, Object> paramsMap = new HashMap<>();
         Map<String, Object> paramsMap = new HashMap<>();
         paramsMap.put("advertiser_id", advertiserId);
         paramsMap.put("advertiser_id", advertiserId);
@@ -238,6 +239,7 @@ public class BytedanceReportNewServiceImpl implements IBytedanceReportNewService
                     if (!Check.isNull(list)) {
                     if (!Check.isNull(list)) {
                         JSONArray metricsArray = list.getJSONArray("metrics");
                         JSONArray metricsArray = list.getJSONArray("metrics");
                         if (!Check.isNull(metricsArray)) {
                         if (!Check.isNull(metricsArray)) {
+                            metrics = new JSONArray();
                             for (int i = 0; i < metricsArray.size(); i++) {
                             for (int i = 0; i < metricsArray.size(); i++) {
                                 JSONObject fieldJson = metricsArray.getJSONObject(i);
                                 JSONObject fieldJson = metricsArray.getJSONObject(i);
                                 String field = fieldJson.getString("field");
                                 String field = fieldJson.getString("field");