|
@@ -58,7 +58,7 @@ public class BytedanceServiceImpl implements IBytedanceService {
|
|
|
/**
|
|
|
* 新增团长活动 信息
|
|
|
*
|
|
|
- * @param bytedanceColonelActivity 团长活动 信息
|
|
|
+ * @param 团长活动 信息
|
|
|
*/
|
|
|
@Override
|
|
|
public void addBytedanceColonelActivityList(Long page) {
|
|
@@ -152,13 +152,16 @@ public class BytedanceServiceImpl implements IBytedanceService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void addBytedanceColonelActivityProduct(Long activityId, String productInfo) {
|
|
|
+ public JSONObject addBytedanceColonelActivityProduct(Long activityId, Long productInfo) {
|
|
|
+
|
|
|
+
|
|
|
+ JSONObject returnJson = new JSONObject();
|
|
|
AccessToken accessToken = tokenService.getAccessToken(1L);
|
|
|
|
|
|
AllianceColonelActivityProductRequest request = new AllianceColonelActivityProductRequest();
|
|
|
AllianceColonelActivityProductParam param = request.getParam();
|
|
|
param.setActivityId(activityId);
|
|
|
- param.setProductInfo(productInfo);//商品ID/名称(支持根据商品id或者商品名称搜索,商品ID精准匹配,商品名称模糊匹配)
|
|
|
+ param.setProductInfo(String.valueOf(productInfo));//商品ID/名称(支持根据商品id或者商品名称搜索,商品ID精准匹配,商品名称模糊匹配)
|
|
|
param.setPage(1L);//页码,从1开始。分页模式下生效,超过10000条会被限制,推荐使用游标模式 retrieve_mode=1
|
|
|
param.setCount(20L);//每页数量(每页最多20)
|
|
|
// param.setSearchType(4L);//0:报名时间;1:活动价格排序;2:活动佣金比例排序;4:更新时间排序
|
|
@@ -169,11 +172,84 @@ public class BytedanceServiceImpl implements IBytedanceService {
|
|
|
// param.setRetrieveMode(1);//获取模式。0: 分页模式(默认),最多返回10000条数据;1: 游标模式(推荐),返回条数无限制
|
|
|
|
|
|
AllianceColonelActivityProductResponse response = request.execute(accessToken);
|
|
|
+
|
|
|
System.out.println(response);
|
|
|
- if (Check.isNull(response) || !"10000".equals(response.getCode())) {
|
|
|
- log.error("\n【请求接口】: {}\n【请求参数】:{}\n【响应数据】:{}", "/buyin/colonelActivityDetail;(获取团长活动详情)", param, response);
|
|
|
- return;
|
|
|
+
|
|
|
+
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject(response.toString());
|
|
|
+ Integer code = jsonObject.getInteger("code");
|
|
|
+ String msg = jsonObject.getString("msg");
|
|
|
+ if (code == 10000) {
|
|
|
+ returnJson.put("code", 0);
|
|
|
+ returnJson.put("message", "请求成功");
|
|
|
+ returnJson.put("judgeStatus", "1");
|
|
|
+ JSONObject dataJson = jsonObject.getJSONObject("data");
|
|
|
+ JSONObject data = dataJson.getJSONArray("data").getJSONObject(0);
|
|
|
+ if (!Check.isNull(data)) {
|
|
|
+ JSONObject itemJson = new JSONObject();
|
|
|
+ Long product_id = data.getLong("product_id");//商品ID
|
|
|
+ String title = data.getString("title");//商品名称
|
|
|
+ Long price = data.getLong("price");//商品售价
|
|
|
+ Double cos_ratio = data.getDouble("cos_ratio");// 佣金比例
|
|
|
+ Long cos_fee = data.getLong("cos_fee");// 佣金金额,单位分
|
|
|
+ Long first_cid = data.getLong("first_cid");// 商品一级类目
|
|
|
+ Long second_cid = data.getLong("second_cid");// 商品二级类目
|
|
|
+ Long third_cid = data.getLong("third_cid");// 商品商品三级类目
|
|
|
+ Long sales = data.getLong("sales");// 销量
|
|
|
+ String cover = data.getString("cover");// 商品主图
|
|
|
+ String detail_url = data.getString("detail_url");// 商品团长活动链接
|
|
|
+ Long shop_id = data.getLong("shop_id");// 店铺ID
|
|
|
+ String shop_name = data.getString("shop_name");// 店铺名称
|
|
|
+ Integer status = data.getInteger("status");// 审核状态
|
|
|
+ String reason = data.getString("reason");// reason
|
|
|
+ Long category_id = data.getLong("category_id");// 行业类目ID
|
|
|
+ String category_name = data.getString("category_name");// 行业类目名称
|
|
|
+ String product_stock = data.getString("product_stock");// 商品库存
|
|
|
+ String shop_score = data.getString("shop_score");// 店铺分
|
|
|
+
|
|
|
+ itemJson.put("itemId", product_id);
|
|
|
+ itemJson.put("itemTitle", title);
|
|
|
+ itemJson.put("itemPrice", price);
|
|
|
+ itemJson.put("itemDesc", "-");
|
|
|
+ itemJson.put("zkFinalPrice", price);
|
|
|
+ itemJson.put("itemImgUrl", cover);
|
|
|
+ itemJson.put("shopStar", "-");
|
|
|
+ itemJson.put("mallLogisticsScore", shop_name);
|
|
|
+ if (status == 0) {
|
|
|
+ itemJson.put("activityItemStatus", 1);
|
|
|
+ } else if (status == 1) {
|
|
|
+ itemJson.put("activityItemStatus", 2);
|
|
|
+ } else if (status == 2) {
|
|
|
+ itemJson.put("activityItemStatus", 3);
|
|
|
+ } else {
|
|
|
+ itemJson.put("activityItemStatus", 5);
|
|
|
+ }
|
|
|
+ itemJson.put("categoryId", category_id);
|
|
|
+ itemJson.put("categoryName", category_name);
|
|
|
+ itemJson.put("itemGalleryUrls", null); // 轮播图
|
|
|
+ itemJson.put("itemDescUrls", null); // 详情图
|
|
|
+ itemJson.put("activityId", activityId);
|
|
|
+ itemJson.put("shopTitle", shop_name);
|
|
|
+ itemJson.put("commissionRate", cos_ratio);
|
|
|
+ itemJson.put("mallServiceScore", shop_score);
|
|
|
+ itemJson.put("mallQualityScore", ""); // 店铺质量分
|
|
|
+ itemJson.put("skuList", ""); // sku信息
|
|
|
+ itemJson.put("postArea", ""); // 发货地址
|
|
|
+ itemJson.put("detailUrl", detail_url);
|
|
|
+ itemJson.put("regimentalPromotionRate", null);
|
|
|
+ returnJson.put("itemJson", itemJson);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ returnJson.put("code", -1);
|
|
|
+ returnJson.put("message", msg);
|
|
|
+
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ return returnJson;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|