|
@@ -16,6 +16,9 @@ import com.doudian.open.api.buyin_colonelActivityDetail.param.BuyinColonelActivi
|
|
|
import com.doudian.open.api.buyin_colonelMultiSettlementOrders.BuyinColonelMultiSettlementOrdersRequest;
|
|
|
import com.doudian.open.api.buyin_colonelMultiSettlementOrders.BuyinColonelMultiSettlementOrdersResponse;
|
|
|
import com.doudian.open.api.buyin_colonelMultiSettlementOrders.param.BuyinColonelMultiSettlementOrdersParam;
|
|
|
+import com.doudian.open.api.buyin_colonel_trusteeshipList.BuyinColonelTrusteeshipListRequest;
|
|
|
+import com.doudian.open.api.buyin_colonel_trusteeshipList.BuyinColonelTrusteeshipListResponse;
|
|
|
+import com.doudian.open.api.buyin_colonel_trusteeshipList.param.BuyinColonelTrusteeshipListParam;
|
|
|
import com.doudian.open.api.buyin_decryptContactInfo.BuyinDecryptContactInfoRequest;
|
|
|
import com.doudian.open.api.buyin_decryptContactInfo.BuyinDecryptContactInfoResponse;
|
|
|
import com.doudian.open.api.buyin_decryptContactInfo.data.BuyinDecryptContactInfoData;
|
|
@@ -61,7 +64,7 @@ public class BytedanceServiceImpl implements IBytedanceService {
|
|
|
/**
|
|
|
* 新增团长活动 信息
|
|
|
*
|
|
|
- * @param 信息
|
|
|
+ * @param 信息
|
|
|
*/
|
|
|
@Override
|
|
|
public void addBytedanceColonelActivityList(Long page) {
|
|
@@ -203,11 +206,12 @@ public class BytedanceServiceImpl implements IBytedanceService {
|
|
|
String category_name = data.getString("category_name");// 行业类目名称
|
|
|
String product_stock = data.getString("product_stock");// 商品库存
|
|
|
String shop_score = data.getString("shop_score");// 店铺分
|
|
|
+ Double service_ratio = data.getDouble("service_ratio");// 店铺分
|
|
|
|
|
|
itemJson.put("itemId", product_id);
|
|
|
itemJson.put("itemTitle", title);
|
|
|
itemJson.put("itemPrice", price);
|
|
|
- itemJson.put("itemDesc", "-");
|
|
|
+ itemJson.put("itemDesc", title);
|
|
|
itemJson.put("zkFinalPrice", price);
|
|
|
itemJson.put("itemImgUrl", cover);
|
|
|
itemJson.put("shopStar", "-");
|
|
@@ -227,13 +231,23 @@ public class BytedanceServiceImpl implements IBytedanceService {
|
|
|
itemJson.put("itemDescUrls", null); // 详情图
|
|
|
itemJson.put("activityId", activityId);
|
|
|
itemJson.put("shopTitle", shop_name);
|
|
|
- itemJson.put("commissionRate", cos_ratio);
|
|
|
+ if(!Check.isNull(cos_ratio)){
|
|
|
+ itemJson.put("commissionRate", cos_ratio * 10);
|
|
|
+ }else {
|
|
|
+ itemJson.put("commissionRate", 0);
|
|
|
+ }
|
|
|
+
|
|
|
itemJson.put("mallServiceScore", shop_score);
|
|
|
itemJson.put("mallQualityScore", ""); // 店铺质量分
|
|
|
itemJson.put("skuList", ""); // sku信息
|
|
|
itemJson.put("postArea", ""); // 发货地址
|
|
|
itemJson.put("detailUrl", detail_url);
|
|
|
- itemJson.put("regimentalPromotionRate", null);
|
|
|
+ if(!Check.isNull(service_ratio)){
|
|
|
+ itemJson.put("regimentalPromotionRate", service_ratio * 10);
|
|
|
+ }else {
|
|
|
+ itemJson.put("regimentalPromotionRate",0);
|
|
|
+ }
|
|
|
+
|
|
|
returnJson.put("itemJson", itemJson);
|
|
|
|
|
|
}
|
|
@@ -250,6 +264,85 @@ public class BytedanceServiceImpl implements IBytedanceService {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ public JSONObject trusteeship(Long activityId, Long itemId) {
|
|
|
+ JSONObject returnJson = new JSONObject();
|
|
|
+ AccessToken accessToken = tokenService.getAccessToken(1L);
|
|
|
+ BuyinColonelTrusteeshipListRequest request = new BuyinColonelTrusteeshipListRequest();
|
|
|
+ BuyinColonelTrusteeshipListParam param = request.getParam();
|
|
|
+ param.setProductId(itemId);
|
|
|
+ param.setStatus(1);
|
|
|
+ param.setPage(1L);
|
|
|
+ param.setPageSize(20L);
|
|
|
+ param.setRetrieveMode(1);
|
|
|
+
|
|
|
+ BuyinColonelTrusteeshipListResponse response = request.execute(accessToken);
|
|
|
+ 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");
|
|
|
+ if (!Check.isNull(dataJson)) {
|
|
|
+ JSONObject record = dataJson.getJSONArray("records").getJSONObject(0);
|
|
|
+ if (!Check.isNull(record)) {
|
|
|
+ String update_time = record.getString("update_time"); // 更新时间
|
|
|
+ Long product_id = record.getLong("product_id"); // 商品id
|
|
|
+ String product_name = record.getString("product_name"); // 商品id
|
|
|
+ Long product_price = record.getLong("product_price"); // 商品售价
|
|
|
+ String product_img = record.getString("product_img"); // 商品图片
|
|
|
+ Long shop_id = record.getLong("shop_id"); // 商家ID
|
|
|
+ String shop_name = record.getString("shop_name"); // 商家名称
|
|
|
+ String shop_score = record.getString("shop_score"); // 店铺体验分
|
|
|
+ Long trusteeship_commission_rate = record.getLong("trusteeship_commission_rate"); // 托管佣金率
|
|
|
+ Long trusteeship_service_rate = record.getLong("trusteeship_service_rate"); // 托管服务费率
|
|
|
+ Long product_stock = record.getLong("product_stock"); // 商品库存
|
|
|
+ Integer status = record.getInteger("status"); // 托管状态。0:待审核;1:生效中;2:已结束
|
|
|
+ JSONObject itemJson = new JSONObject();
|
|
|
+
|
|
|
+ itemJson.put("itemId", product_id);
|
|
|
+ itemJson.put("itemTitle", product_name);
|
|
|
+ itemJson.put("itemPrice", product_price);
|
|
|
+ itemJson.put("itemDesc", product_name);
|
|
|
+ itemJson.put("zkFinalPrice", product_price);
|
|
|
+ itemJson.put("itemImgUrl", product_img);
|
|
|
+ itemJson.put("shopStar", "-");
|
|
|
+ itemJson.put("mallLogisticsScore", shop_score);
|
|
|
+ itemJson.put("activityItemStatus", 2);
|
|
|
+ itemJson.put("categoryId", 0);
|
|
|
+ itemJson.put("categoryName", "托管商品");
|
|
|
+ itemJson.put("itemGalleryUrls", null); // 轮播图
|
|
|
+ itemJson.put("itemDescUrls", null); // 详情图
|
|
|
+ itemJson.put("activityId", activityId);
|
|
|
+ itemJson.put("shopTitle", shop_name);
|
|
|
+ if (!Check.isNull(trusteeship_commission_rate)) {
|
|
|
+ itemJson.put("commissionRate", trusteeship_commission_rate / 10);
|
|
|
+ } else {
|
|
|
+ itemJson.put("commissionRate", 0);
|
|
|
+ }
|
|
|
+ if (!Check.isNull(trusteeship_service_rate)) {
|
|
|
+ itemJson.put("regimentalPromotionRate", trusteeship_service_rate / 10);
|
|
|
+ } else {
|
|
|
+ itemJson.put("regimentalPromotionRate", 0);
|
|
|
+ }
|
|
|
+ itemJson.put("mallServiceScore", shop_score);
|
|
|
+ itemJson.put("mallQualityScore", shop_score); // 店铺质量分
|
|
|
+ itemJson.put("skuList", ""); // sku信息
|
|
|
+ itemJson.put("postArea", ""); // 发货地址
|
|
|
+ itemJson.put("detailUrl", "https://haohuo.jinritemai.com/ecommerce/trade/detail/index.html?id=" + product_id);
|
|
|
+ // itemJson.put("regimentalPromotionRate", null);
|
|
|
+ returnJson.put("itemJson", itemJson);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ returnJson.put("code", -1);
|
|
|
+ returnJson.put("message", msg);
|
|
|
+ }
|
|
|
+ return returnJson;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
public void addBytedanceInstituteOrderColonel(String startTime, String endTime, String cursor) {
|
|
|
AccessToken accessToken = tokenService.getAccessToken(1L);
|
|
|
cursor = Check.isNull(cursor) ? "0" : cursor;
|