فهرست منبع

Merge remote-tracking branch 'origin/master'

syh 4 سال پیش
والد
کامیت
06bd9843b7

+ 10 - 5
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouInterfaceServiceImpl.java

@@ -376,7 +376,7 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             campaign.setAccountId(token.getAccountId());
             campaigns.add(campaign);
         }
-        if(!campaigns.isEmpty()){
+        if (!campaigns.isEmpty()) {
             dailyCampaignService.replaceBatch(campaigns);
         }
         getCampaignDailyReportByPage(token, startDate, endDate, page + 1);
@@ -3043,13 +3043,18 @@ public class KuaishouInterfaceServiceImpl implements IKuaishouInterfaceService {
             if (!Check.isNull(resultJson)) {
                 Integer code = resultJson.getInteger("code");
                 if (code == 0) {
-                    JSONArray dataArr = resultJson.getJSONArray("data");
-                    if (!Check.isNull(dataArr)) {
+                    JSONObject dataDetailJson = resultJson.getJSONObject("data");
+                    if (!Check.isNull(dataDetailJson)) {
                         Map<String, Object> deleteMap = new HashMap<>();
+
+                        JSONArray details = dataDetailJson.getJSONArray("details");
+                        if (Check.isNull(details)) {
+                            return;
+                        }
                         deleteMap.put("account_id", accountId);
                         populationService.removeByMap(deleteMap);
-                        for (int i = 0; i < dataArr.size(); i++) {
-                            JSONObject dataJson = dataArr.getJSONObject(i);
+                        for (int i = 0; i < details.size(); i++) {
+                            JSONObject dataJson = details.getJSONObject(i);
                             if (!Check.isNull(dataJson)) {
                                 KuaishouPopulation population = new KuaishouPopulation();
                                 population.setOrientationId(dataJson.getLong("orientation_id"));