|
@@ -188,11 +188,11 @@ public class JiaoYangFenXiaoServiceImpl implements IJiaoYangFenXiaoService {
|
|
|
clipCooperation.setAuthItemGmv30d(jsonObject.getString("authItemGmv30d"));
|
|
|
clipCooperation.setStatDate(statDate);
|
|
|
JSONObject getData = this.getClipData(jsonObject.getLong("clipId"), cookie);
|
|
|
- if (!Check.isNull(getData)) {
|
|
|
+ /* if (!Check.isNull(getData)) {
|
|
|
clipCooperation.setVideoCount(getData.getString("videoCount"));
|
|
|
clipCooperation.setVideoShow(getData.getString("videoShow"));
|
|
|
Thread.sleep(60 * 1000);
|
|
|
- }
|
|
|
+ }*/
|
|
|
adds.add(clipCooperation);
|
|
|
|
|
|
|
|
@@ -257,6 +257,73 @@ public class JiaoYangFenXiaoServiceImpl implements IJiaoYangFenXiaoService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public void getClipCooperationV2(String cookie, int offset, Long statDate, Integer status) throws Exception {
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("status", status);
|
|
|
+ params.put("limit", 10);
|
|
|
+ params.put("offset", offset);
|
|
|
+ Map<String, String> headers = new HashMap<>();
|
|
|
+ headers.put("Cookie", cookie);
|
|
|
+ String postUrl = "https://cps.kwaixiaodian.com/gateway/distribute/platform/recreate/leader/clip/cooperation/list";
|
|
|
+ String resultStr = HttpUtils.httpPostRequest(postUrl, params, headers);
|
|
|
+ JSONObject result = JSONObject.parseObject(resultStr);
|
|
|
+ if (Check.isNull(result)) {
|
|
|
+ log.error("骄阳分销数据返回为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Integer code = result.getInteger("result");
|
|
|
+ if (code != 1) {
|
|
|
+ log.info("骄阳分销尔创列表数据返回异常:", resultStr);
|
|
|
+ sendMessageService.sendMessage("113dee46c7df464da78c07a985e92cd1", "骄阳分销cookie失效,请及时更新。媒体返回信息:" + resultStr);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ JSONObject dataJson = result.getJSONObject("data");
|
|
|
+ if (Check.isNull(dataJson)) {
|
|
|
+ log.error("骄阳分销数据返回为data数据为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ JSONArray list = dataJson.getJSONArray("leaderCoopClip");
|
|
|
+ if (Check.isNull(list)) {
|
|
|
+ log.error("骄阳分销数据返回为list数据为空");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ log.info("骄阳分销当前数据条数:{}", list.size());
|
|
|
+ List<JyClipCooperation> adds = new ArrayList<>();
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
+ JSONObject jsonObject = list.getJSONObject(i);
|
|
|
+ JyClipCooperation clipCooperation = new JyClipCooperation();
|
|
|
+ clipCooperation.setClipId(jsonObject.getLong("clipId"));
|
|
|
+ clipCooperation.setClipName(jsonObject.getString("clipName"));
|
|
|
+ clipCooperation.setHeadImg(jsonObject.getString("headImg"));
|
|
|
+ clipCooperation.setCommissionRate(jsonObject.getLong("commissionRate"));
|
|
|
+ clipCooperation.setFansNum(jsonObject.getString("fansNum"));
|
|
|
+ clipCooperation.setGmv30d(jsonObject.getString("gmv30d"));
|
|
|
+ clipCooperation.setStartTime(jsonObject.getString("startTime"));
|
|
|
+ clipCooperation.setEndTime(jsonObject.getString("endTime"));
|
|
|
+ clipCooperation.setStatus(jsonObject.getInteger("status"));
|
|
|
+ clipCooperation.setTerminationReason(jsonObject.getString("terminationReason"));
|
|
|
+ clipCooperation.setCommissionRateView(jsonObject.getString("commissionRateView"));
|
|
|
+ clipCooperation.setShopScore(jsonObject.getString("shopScore"));
|
|
|
+ clipCooperation.setClipGmv30d(jsonObject.getString("clipGmv30d"));
|
|
|
+ clipCooperation.setAuthItemGmv30d(jsonObject.getString("authItemGmv30d"));
|
|
|
+ clipCooperation.setStatDate(statDate);
|
|
|
+ JSONObject getData = this.getClipData(jsonObject.getLong("clipId"), cookie);
|
|
|
+ if (!Check.isNull(getData)) {
|
|
|
+ clipCooperation.setVideoCount(getData.getString("videoCount"));
|
|
|
+ clipCooperation.setVideoShow(getData.getString("videoShow"));
|
|
|
+ Thread.sleep(30 * 1000);
|
|
|
+ }
|
|
|
+ adds.add(clipCooperation);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ jiaoYangFenXiaoMapper.replaceClipCooperation(adds);
|
|
|
+ if (list.size() >= 10) {
|
|
|
+ getClipCooperation(cookie, offset + 10, statDate, status);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private JSONObject getClipData(Long clipId, String cookie) {
|
|
|
JSONObject returnJson = new JSONObject();
|
|
|
Map<String, Object> params = new HashMap<>();
|