|
@@ -367,7 +367,7 @@ public class KuaishouBatchCampaignPreviewServiceImpl extends ServiceImpl<Kuaisho
|
|
|
groupPreview.setBid(bid);
|
|
|
}
|
|
|
}
|
|
|
- groupPreview.setPlayableId(getPlayableId(appList.getJSONArray("playableIds"), j+1));
|
|
|
+ groupPreview.setPlayableId(getPlayableId(appList.getJSONArray("playableIds"), j + 1));
|
|
|
groupPreview.setPlayButton(appList.getString("playButton"));
|
|
|
groupPreviewMapper.insert(groupPreview);
|
|
|
JSONObject material = materialList.getJSONObject(j);
|
|
@@ -517,7 +517,7 @@ public class KuaishouBatchCampaignPreviewServiceImpl extends ServiceImpl<Kuaisho
|
|
|
groupPreview.setBid(bid);
|
|
|
}
|
|
|
}
|
|
|
- groupPreview.setPlayableId(getPlayableId(appList.getJSONArray("playableIds"), j+1));
|
|
|
+ groupPreview.setPlayableId(getPlayableId(appList.getJSONArray("playableIds"), j + 1));
|
|
|
groupPreview.setPlayButton(appList.getString("playButton"));
|
|
|
groupPreviewMapper.insert(groupPreview);
|
|
|
if (groupPreview.getUnitType() == 4) {
|
|
@@ -595,12 +595,15 @@ public class KuaishouBatchCampaignPreviewServiceImpl extends ServiceImpl<Kuaisho
|
|
|
|
|
|
|
|
|
private Long getPlayableId(JSONArray ids, Integer num) {
|
|
|
+ if (Check.isNull(ids)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
int size = ids.size();
|
|
|
if (size > 0) {
|
|
|
if (size >= num) {
|
|
|
- return ids.getLong(num-1);
|
|
|
+ return ids.getLong(num - 1);
|
|
|
} else {
|
|
|
- return ids.getLong(num % size ==0?(size-1):((num % size)-1));
|
|
|
+ return ids.getLong(num % size == 0 ? (size - 1) : ((num % size) - 1));
|
|
|
}
|
|
|
}
|
|
|
return null;
|