|
@@ -5,6 +5,7 @@ import cn.com.ctop.common.module.utils.Check;
|
|
import cn.com.ctop.common.module.utils.HttpUtils;
|
|
import cn.com.ctop.common.module.utils.HttpUtils;
|
|
import cn.com.ctop.common.module.utils.LoadFileUtil;
|
|
import cn.com.ctop.common.module.utils.LoadFileUtil;
|
|
import cn.com.ctop.kuaishou.modules.batch.entity.JyClipCooperation;
|
|
import cn.com.ctop.kuaishou.modules.batch.entity.JyClipCooperation;
|
|
|
|
+import cn.com.ctop.kuaishou.modules.batch.entity.JyClipTopList;
|
|
import cn.com.ctop.kuaishou.modules.batch.entity.JyOrderList;
|
|
import cn.com.ctop.kuaishou.modules.batch.entity.JyOrderList;
|
|
|
|
|
|
import cn.com.ctop.kuaishou.modules.batch.mapper.JiaoYangFenXiaoMapper;
|
|
import cn.com.ctop.kuaishou.modules.batch.mapper.JiaoYangFenXiaoMapper;
|
|
@@ -179,7 +180,7 @@ public class JiaoYangFenXiaoServiceImpl implements IJiaoYangFenXiaoService {
|
|
clipCooperation.setAuthItemGmv30d(jsonObject.getString("authItemGmv30d"));
|
|
clipCooperation.setAuthItemGmv30d(jsonObject.getString("authItemGmv30d"));
|
|
clipCooperation.setStatDate(statDate);
|
|
clipCooperation.setStatDate(statDate);
|
|
JSONObject getData = this.getClipData(jsonObject.getLong("clipId"), cookie);
|
|
JSONObject getData = this.getClipData(jsonObject.getLong("clipId"), cookie);
|
|
- if(!Check.isNull(getData)){
|
|
|
|
|
|
+ if (!Check.isNull(getData)) {
|
|
clipCooperation.setVideoCount(getData.getString("videoCount"));
|
|
clipCooperation.setVideoCount(getData.getString("videoCount"));
|
|
clipCooperation.setVideoShow(getData.getString("videoShow"));
|
|
clipCooperation.setVideoShow(getData.getString("videoShow"));
|
|
}
|
|
}
|
|
@@ -194,6 +195,60 @@ public class JiaoYangFenXiaoServiceImpl implements IJiaoYangFenXiaoService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public String getCookieById(Long id) {
|
|
|
|
+ return jiaoYangFenXiaoMapper.getCookieById(id);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<JSONObject> getAccountList() {
|
|
|
|
+ return jiaoYangFenXiaoMapper.getAccountList();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void getItemTop(String cookie, Long statDate, Long id, String name, Integer offset) {
|
|
|
|
+ JSONObject returnJson = new JSONObject();
|
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
|
+ params.put("activityUserId", id);
|
|
|
|
+ params.put("bizCode", 2);
|
|
|
|
+ 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/seller/activity/topItem/list";
|
|
|
|
+ String resultStr = null;
|
|
|
|
+ try {
|
|
|
|
+ resultStr = HttpUtils.KuaiShouttpGetRequest(postUrl, params, headers);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ JSONObject result = JSONObject.parseObject(resultStr);
|
|
|
|
+ Integer code = result.getInteger("result");
|
|
|
|
+ JSONArray topActivityItemInfo = new JSONArray();
|
|
|
|
+ if (code == 1) {
|
|
|
|
+ JSONObject data = result.getJSONObject("data");
|
|
|
|
+ if (!Check.isNull(data)) {
|
|
|
|
+ topActivityItemInfo = data.getJSONArray("topActivityItemInfo");
|
|
|
|
+ for (int i = 0; i < topActivityItemInfo.size(); i++) {
|
|
|
|
+ JSONObject jsonObject = topActivityItemInfo.getJSONObject(i);
|
|
|
|
+ jsonObject.put("statDate", statDate);
|
|
|
|
+ jsonObject.put("clipId", id);
|
|
|
|
+ jsonObject.put("clipName", name);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<JyClipTopList> adds = topActivityItemInfo.toJavaList(JyClipTopList.class);
|
|
|
|
+ if (!Check.isNull(adds)) {
|
|
|
|
+ jiaoYangFenXiaoMapper.replaceTopItem(adds);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (topActivityItemInfo.size() > 0) {
|
|
|
|
+ getItemTop(cookie, statDate, id, name, offset + 10);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
private JSONObject getClipData(Long clipId, String cookie) {
|
|
private JSONObject getClipData(Long clipId, String cookie) {
|
|
JSONObject returnJson = new JSONObject();
|
|
JSONObject returnJson = new JSONObject();
|
|
Map<String, Object> params = new HashMap<>();
|
|
Map<String, Object> params = new HashMap<>();
|