This commit is contained in:
2025-08-17 21:52:18 +08:00
parent 488eb5f64c
commit 3b561b0fc7
37 changed files with 6 additions and 1106 deletions

View File

@@ -1,7 +0,0 @@
package cn.van.business.erp.request;
public class AuthorizeListQueryRequest extends ERPRequestBase {
public AuthorizeListQueryRequest(ERPAccount erpAccount) {
super("https://open.goofish.pro/api/open/user/authorize/list", erpAccount);
}
}

View File

@@ -1,31 +0,0 @@
package cn.van.business.erp.request;
/**
* @author Leo
* @version 1.0
* @create 2025/4/10 15:20
* @descriptionERP账户枚举类
*/
public enum ERPAccount {
// 胡歌1016208368633221
ACCOUNT_HUGE("1016208368633221", "waLiRMgFcixLbcLjUSSwo370Hp1nBcBu"),
// 刘强东anotherApiKey
ACCOUNT_LQD("anotherApiKey", "anotherApiSecret");
private final String apiKey;
private final String apiKeySecret;
ERPAccount(String apiKey, String apiKeySecret) {
this.apiKey = apiKey;
this.apiKeySecret = apiKeySecret;
}
public String getApiKey() {
return apiKey;
}
public String getApiKeySecret() {
return apiKeySecret;
}
}

View File

@@ -1,59 +0,0 @@
package cn.van.business.erp.request;
import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson2.JSONObject;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public abstract class ERPRequestBase {
protected String url;
protected String sign;
protected ERPAccount erpAccount;
protected JSONObject requestBody;
public ERPRequestBase(String url, ERPAccount erpAccount) {
this.url = url;
this.erpAccount = erpAccount;
}
public void setRequestBody(JSONObject requestBody) {
this.requestBody = requestBody;
}
public String genMd5(String str) {
StringBuilder result = new StringBuilder();
try {
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] digest = md.digest(str.getBytes(StandardCharsets.UTF_8));
for (byte b : digest) {
result.append(String.format("%02x", b & 0xff));
}
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
return result.toString();
}
public void genSign() {
long timestamp = System.currentTimeMillis() / 1000;
String jsonStr = requestBody.toJSONString();
String data = erpAccount.getApiKey() + "," + genMd5(jsonStr) + "," + timestamp + "," + erpAccount.getApiKeySecret();
this.sign = genMd5(data);
}
public String getRequestUrl() {
return url+"?appid="+erpAccount.getApiKey()+"&timestamp="+System.currentTimeMillis()/1000+"&sign="+sign;
}
public String getRequestBody() {
return requestBody.toJSONString();
}
public String getResponseBody() {
genSign();
HttpRequest post = HttpRequest.post(getRequestUrl());
post.body(getRequestBody());
return post.execute().body();
}
}

View File

@@ -1,107 +0,0 @@
package cn.van.business.erp.request;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class HttpTest {
private static String apiKey = "1016208368633221"; // 开放平台提供的应用KEY
private static String apiKeySecret = "o9wl81dncmvby3ijpq7eur456zhgtaxs"; // 开放平台提供的应用密钥
private static String domain = "https://open.goofish.pro"; // 域名
public static void main(String[] args) {
// 获取当前时间戳
long timestamp = System.currentTimeMillis() / 1000L;
System.out.println("timestamp: " + timestamp);
// 请求体JSON字符串
String productId = "941757976162";
String jsonBody = "{\"product_id\":" + productId + "}";
// 生成签名
String sign = genSign(timestamp, jsonBody);
System.out.println("sign: " + sign);
// 拼接请求地址
String apiUrl = domain + "/api/open/product/detail?appid=" + apiKey + "&timestamp=" + timestamp + "&sign="
+ sign;
try {
// 创建URL对象
URL url = new URL(apiUrl);
// 打开连接
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
// 设置请求方法为POST
connection.setRequestMethod("POST");
// 设置请求头部
connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("Accept", "application/json");
// 启用输出流
connection.setDoOutput(true);
// 获取输出流并写入请求体
OutputStream outputStream = connection.getOutputStream();
outputStream.write(jsonBody.getBytes(StandardCharsets.UTF_8));
outputStream.close();
// 获取响应状态码
int responseCode = connection.getResponseCode();
System.out.println("API Response Code: " + responseCode);
// 读取响应内容
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line;
StringBuilder response = new StringBuilder();
while ((line = bufferedReader.readLine()) != null) {
response.append(line);
}
bufferedReader.close();
// 关闭连接
connection.disconnect();
System.out.println("API Response: " + response.toString());
} catch (IOException e) {
// 在此处处理异常
e.printStackTrace();
}
}
// md5加密
private static String genMd5(String str) {
StringBuilder result = new StringBuilder();
try {
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] digest = md.digest(str.getBytes(StandardCharsets.UTF_8));
for (byte b : digest) {
result.append(String.format("%02x", b & 0xff));
}
} catch (NoSuchAlgorithmException e) {
throw new RuntimeException(e);
}
return result.toString();
}
// 生成签名
private static String genSign(long timestamp, String jsonStr) {
// 拼接字符串
String data = apiKey + "," + genMd5(jsonStr) + "," + timestamp + "," + apiKeySecret;
// 商务对接模式 拼接字符串
// String data = apiKey + "," + genMd5(jsonStr) + "," + timestamp + "," + seller_id + "," + apiKeySecret;
// 生成签名
return genMd5(data);
}
}

View File

@@ -1,7 +0,0 @@
package cn.van.business.erp.request;
public class ProductListQueryRequest extends ERPRequestBase {
public ProductListQueryRequest(ERPAccount erpAccount) {
super("https://open.goofish.pro/api/open/product/list", erpAccount);
}
}

View File

@@ -1,24 +0,0 @@
package cn.van.business.model.erp;
/**
* 食品生产地信息
*/
@lombok.Data
public class Address {
/**
* 生产地城市ID
*/
private long city;
/**
* 详细地址
*/
private String detail;
/**
* 生产地地区ID
*/
private long district;
/**
* 生产地省份ID
*/
private long province;
}

View File

@@ -1,25 +0,0 @@
package cn.van.business.model.erp;
/**
* @author Leo
* @version 1.0
* @create 2025/4/10 15:15
* @description
*/
/**
* 闲鱼特卖信息,闲鱼特卖类型为临期非食品行业时必传
*
* 闲鱼特卖信息
*/
@lombok.Data
public class AdventData {
/**
* 有效期信息
*/
private AdventDataExpire expire;
/**
* 生产信息
*/
private AdventDataProduction production;
}

View File

@@ -1,16 +0,0 @@
package cn.van.business.model.erp;
/**
* 有效期信息
*/
@lombok.Data
public class AdventDataExpire {
/**
* 保质期
*/
private long num;
/**
* 单位
*/
private PurpleUnit unit;
}

View File

@@ -1,12 +0,0 @@
package cn.van.business.model.erp;
/**
* 生产信息
*/
@lombok.Data
public class AdventDataProduction {
/**
* 生产日期
*/
private String date;
}

View File

@@ -1,22 +0,0 @@
package cn.van.business.model.erp;
import java.io.IOException; /**
* 验货费规则
*/
public enum AssumeRule {
BUYER, SELLER;
public String toValue() {
switch (this) {
case BUYER: return "buyer";
case SELLER: return "seller";
}
return null;
}
public static AssumeRule forValue(String value) throws IOException {
if (value.equals("buyer")) return BUYER;
if (value.equals("seller")) return SELLER;
throw new IOException("Cannot deserialize AssumeRule");
}
}

View File

@@ -1,34 +0,0 @@
package cn.van.business.model.erp;
import java.util.List; /**
* 美妆信息
*/
@lombok.Data
public class BeautyMakeup {
/**
* 品牌
*/
private String brand;
/**
* 验货图片
*/
private List<String> images;
/**
* 成色
*/
private String level;
/**
* 检测机构ID枚举值
* 181 : 维鉴
* 182 : 中检科深
*/
private long orgid;
/**
* 检测机构名称
*/
private String orgName;
/**
* 规格
*/
private String spec;
}

View File

@@ -1,24 +0,0 @@
package cn.van.business.model.erp;
/**
* 图书信息
*/
@lombok.Data
public class BookData {
/**
* 图书作者
*/
private String author;
/**
* 图书ISBN码
*/
private String isbn;
/**
* 图书出版社
*/
private String publisher;
/**
* 图书标题
*/
private String title;
}

View File

@@ -1,24 +0,0 @@
package cn.van.business.model.erp;
import java.util.List; /**
* 品牌捡漏信息
*/
@lombok.Data
public class BrandData {
/**
* 有效期信息
*/
private BrandDataExpire expire;
/**
* 资质证明
*/
private List<Image> images;
/**
* 生产信息
*/
private BrandDataProduction production;
/**
* 供应商名称
*/
private String supplier;
}

View File

@@ -1,16 +0,0 @@
package cn.van.business.model.erp;
/**
* 有效期信息
*/
@lombok.Data
public class BrandDataExpire {
/**
* 保质期
*/
private long num;
/**
* 单位
*/
private FluffyUnit unit;
}

View File

@@ -1,12 +0,0 @@
package cn.van.business.model.erp;
/**
* 生产信息
*/
@lombok.Data
public class BrandDataProduction {
/**
* 生产日期
*/
private String date;
}

View File

@@ -1,26 +0,0 @@
package cn.van.business.model.erp;
/**
* 商品属性,通过`查询商品属性`接口获取属性参数
*
* 商品属性
*/
@lombok.Data
public class Channelpv {
/**
* 属性ID
*/
private String propertyid;
/**
* 属性名称
*/
private String propertyName;
/**
* 属性值ID
*/
private String valueid;
/**
* 属性值名称
*/
private String valueName;
}

View File

@@ -1,44 +0,0 @@
package cn.van.business.model.erp;
import java.util.List; /**
* 文玩信息
*/
@lombok.Data
public class Curio {
/**
* 验货图片
*/
private List<String> images;
/**
* 材料
*/
private String material;
/**
* 检测机构ID枚举值
* 191 : NGC评级
* 192 : PMG评级
* 193 : 公博评级
* 194 : PCGS评级
* 195 : 众诚评级
* 196 : 保粹评级
* 197 : 华夏评级
* 198 : 爱藏评级
* 199 : 华龙盛世
* 1910 : 国鉴鉴定
* 1911 : 信泰评级
* 1912 : 闻德评级
*/
private long orgid;
/**
* 检测机构名称
*/
private String orgName;
/**
* 验货编码
*/
private String qcNo;
/**
* 尺寸
*/
private String size;
}

View File

@@ -1,102 +0,0 @@
package cn.van.business.model.erp;
/**
* @author Leo
* @version 1.0
* @create 2025/4/10 15:13
* @description
*/
// ERPShop.java
import java.util.List;
@lombok.Data
public class ERPShop {
/**
* 闲鱼特卖信息,闲鱼特卖类型为临期非食品行业时必传
*/
private AdventData adventData;
/**
* 图书信息
*/
private BookData bookData;
/**
* 品牌捡漏信息
*/
private BrandData brandData;
/**
* 商品类目ID通过`查询商品类目`接口获取类目参数
*/
private String channelCatid;
/**
* 商品属性,通过`查询商品属性`接口获取属性参数
*/
private List<Channelpv> channelpv;
/**
* 详情图片
*/
private List<Image> detailImages;
/**
* 运费(分)
*/
private long expressFee;
/**
* 闲鱼特卖类型
*/
private Long flashSaleType;
/**
* 食品信息
*/
private FoodData foodData;
/**
* 验货宝信息,商品类型为验货宝时必传
*/
private Empty inspectData;
/**
* 商品类型
*/
private long itemBizType;
/**
* 商品原价(分),注意:当商品类型是特卖类型,即`item_biz_type`=24时`original_price`为必填
*/
private Long originalPrice;
/**
* 商家编码注意一个中文按2个字符算
*/
private String outerid;
/**
* 商品售价注意多规格商品时必须是SKU其中一个金额
*/
private long price;
/**
* 发布店铺
*/
private List<PublishShop> publishShop;
/**
* 验货报告信息,注意:已验货类型的商品按需必填
*/
private ReportData reportData;
/**
* 规格图片
*/
private List<SkuImage> skuImages;
/**
* 商品多规格信息
*/
private List<SkuItems> skuItems;
/**
* 商品行业
*/
private long spBizType;
/**
* 商品库存
*/
private long stock;
/**
* 商品成色
*/
private Long stuffStatus;
}

View File

@@ -1,18 +0,0 @@
package cn.van.business.model.erp;
/**
* 验货宝信息,商品类型为验货宝时必传
*
* 验货宝信息
*/
@lombok.Data
public class Empty {
/**
* 验货费规则
*/
private AssumeRule assumeRule;
/**
* 交易规则
*/
private TradeRule tradeRule;
}

View File

@@ -1,20 +0,0 @@
package cn.van.business.model.erp;
import java.io.IOException; /**
* 单位
*/
public enum FluffyUnit {
EMPTY;
public String toValue() {
switch (this) {
case EMPTY: return "\u5929";
}
return null;
}
public static FluffyUnit forValue(String value) throws IOException {
if (value.equals("\u5929")) return EMPTY;
throw new IOException("Cannot deserialize FluffyUnit");
}
}

View File

@@ -1,28 +0,0 @@
package cn.van.business.model.erp;
/**
* 食品信息
*/
@lombok.Data
public class FoodData {
/**
* 食品品牌
*/
private String brand;
/**
* 食品有效期信息
*/
private FoodDataExpire expire;
/**
* 食品包装
*/
private String pack;
/**
* 食品生产信息
*/
private FoodDataProduction production;
/**
* 食品规格
*/
private String spec;
}

View File

@@ -1,16 +0,0 @@
package cn.van.business.model.erp;
/**
* 食品有效期信息
*/
@lombok.Data
public class FoodDataExpire {
/**
* 保质期
*/
private long num;
/**
* 单位
*/
private PurpleUnit unit;
}

View File

@@ -1,16 +0,0 @@
package cn.van.business.model.erp;
/**
* 食品生产信息
*/
@lombok.Data
public class FoodDataProduction {
/**
* 食品生产地信息
*/
private Address address;
/**
* 食品生产日期
*/
private String date;
}

View File

@@ -1,28 +0,0 @@
package cn.van.business.model.erp;
import java.util.List; /**
* 游戏信息
*/
@lombok.Data
public class Game {
/**
* 验货图片
*/
private List<String> images;
/**
* 游戏平台
*/
private String platform;
/**
* 验货描述
*/
private String qcDesc;
/**
* 验货编码
*/
private String qcNo;
/**
* 报告标题
*/
private String title;
}

View File

@@ -1,22 +0,0 @@
package cn.van.business.model.erp;
/**
* 资质证明
*
* 新图片信息
*/
@lombok.Data
public class Image {
/**
* 图片高度
*/
private long height;
/**
* 图片地址
*/
private String src;
/**
* 图片宽度
*/
private long width;
}

View File

@@ -1,36 +0,0 @@
package cn.van.business.model.erp;
import java.util.List; /**
* 珠宝信息
*/
@lombok.Data
public class Jewelry {
/**
* 颜色
*/
private String color;
/**
* 验货图片
*/
private List<String> images;
/**
* 检测机构名称
*/
private String orgName;
/**
* 验货描述
*/
private String qcDesc;
/**
* 验货编码
*/
private String qcNo;
/**
* 形状
*/
private String shape;
/**
* 重量
*/
private String weight;
}

View File

@@ -1,45 +0,0 @@
package cn.van.business.model.erp;
import java.util.List;
@lombok.Data
public class PublishShop {
/**
* 商品发货城市
*/
private long city;
/**
* 商品描述注意一个中文按2个字符算不支持HTML代码可使用\n换行
*/
private String content;
/**
* 商品发货地区
*/
private long district;
/**
* 商品图片URL注意第1张作为商品主图前9张发布到闲鱼App
*/
private List<String> images;
/**
* 商品发货省份
*/
private long province;
/**
* 商品服务
*/
private String serviceSupport;
/**
* 商品标题注意一个中文按2个字符算
*/
private String title;
/**
* 闲鱼会员名
*/
private String userName;
/**
* 商品白底图URL注意
* 1如果传入会在闲鱼商品详情显示并且无法删除只能修改
* 2当商品类型是特卖类型即`item_biz_type`=24时`white_images`为必填
*/
private String whiteImages;
}

View File

@@ -1,24 +0,0 @@
package cn.van.business.model.erp;
import java.io.IOException; /**
* 单位
*/
public enum PurpleUnit {
EMPTY, PURPLE, UNIT;
public String toValue() {
switch (this) {
case EMPTY: return "\u5929";
case PURPLE: return "\u5e74";
case UNIT: return "\u6708";
}
return null;
}
public static PurpleUnit forValue(String value) throws IOException {
if (value.equals("\u5929")) return EMPTY;
if (value.equals("\u5e74")) return PURPLE;
if (value.equals("\u6708")) return UNIT;
throw new IOException("Cannot deserialize PurpleUnit");
}
}

View File

@@ -1,35 +0,0 @@
package cn.van.business.model.erp;
/**
* 验货报告信息,注意:已验货类型的商品按需必填
*
* 验货报告信息
*/
@lombok.Data
public class ReportData {
/**
* 美妆信息
*/
private BeautyMakeup beautyMakeup;
/**
* 文玩信息
*/
private Curio curio;
/**
* 游戏信息
*/
private Game game;
/**
* 珠宝信息
*/
private Jewelry jewelry;
/**
* 二手车信息
*/
private UsedCar usedCar;
/**
* 奢品信息
*/
private Valuable valuable;
private The3C yx3C;
}

View File

@@ -1,33 +0,0 @@
package cn.van.business.model.erp;
@lombok.Data
public class ReportItem {
/**
* 选项描述
*/
private String answerDesc;
/**
* 选项ID
*/
private long answerid;
/**
* 选项名称
*/
private String answerName;
/**
* 选项类型
*/
private long answerType;
/**
* 分类名称
*/
private String categoryName;
/**
* 分组名称
*/
private String groupName;
/**
* 问题名称
*/
private String questionName;
}

View File

@@ -1,24 +0,0 @@
package cn.van.business.model.erp;
/**
* 规格图片
*/
@lombok.Data
public class SkuImage {
/**
* 图片高度
*/
private long height;
/**
* 规格属性
*/
private String skuText;
/**
* 图片地址
*/
private String src;
/**
* 图片宽度
*/
private long width;
}

View File

@@ -1,24 +0,0 @@
package cn.van.business.model.erp;
/**
* SKU信息
*/
@lombok.Data
public class SkuItems {
/**
* SKU商品编码注意一个中文按2个字符算
*/
private String outerid;
/**
* SKU售价
*/
private long price;
/**
* SKU规格格式 : 规格:属性,多个时使用";"拼接。如:颜色:白色;容量:128G
*/
private String skuText;
/**
* SKU库存
*/
private long stock;
}

View File

@@ -1,52 +0,0 @@
package cn.van.business.model.erp;
import java.util.List; /**
* 严选3c信息
*/
@lombok.Data
public class The3C {
/**
* 质检选项ID内部存储不对外展示
*/
private List<Long> answerids;
/**
* 品牌ID
*/
private long brandid;
/**
* 品牌名称
*/
private String brandName;
/**
* 品类ID
*/
private long classid;
/**
* 机型ID
*/
private long modelid;
/**
* 机型名称
*/
private String modelName;
/**
* IMEI/序列号
*/
private String modelSn;
/**
* 质检报告项,体现在商品验货报告页
*/
private List<ReportItem> reportItems;
/**
* 质检时间,体现在商品验货报告页
*/
private String reportTime;
/**
* 质检人,体现在商品验货报告页
*/
private String reportUser;
/**
* 子类ID
*/
private long subclassid;
}

View File

@@ -1,22 +0,0 @@
package cn.van.business.model.erp;
import java.io.IOException; /**
* 交易规则
*/
public enum TradeRule {
YHB_ONLY, YHB_OPTIONAL;
public String toValue() {
switch (this) {
case YHB_ONLY: return "yhbOnly";
case YHB_OPTIONAL: return "yhbOptional";
}
return null;
}
public static TradeRule forValue(String value) throws IOException {
if (value.equals("yhbOnly")) return YHB_ONLY;
if (value.equals("yhbOptional")) return YHB_OPTIONAL;
throw new IOException("Cannot deserialize TradeRule");
}
}

View File

@@ -1,34 +0,0 @@
package cn.van.business.model.erp;
/**
* 二手车信息
*
* OpenProductReportUsedCar
*/
@lombok.Data
public class UsedCar {
/**
* 营业执照图片
*/
private String businessLicenseFront;
/**
* 使用性质 : 营运/非营运
*/
private String carFunction;
/**
* 车辆识别代码VIN码
*/
private String carVin;
/**
* 行驶证车辆页图片
*/
private String drivingLicenseCarPhoto;
/**
* 行驶证主页图片
*/
private String drivingLicenseInfo;
/**
* 验货报告链接
*/
private String reporturl;
}

View File

@@ -1,32 +0,0 @@
package cn.van.business.model.erp;
import java.util.List; /**
* 奢品信息
*/
@lombok.Data
public class Valuable {
/**
* 验货图片
*/
private List<String> images;
/**
* 检测机构ID枚举值
* 161 : 中检
* 162 : 国检
* 163 : 华测
* 164 : 中溯
*/
private long orgid;
/**
* 检测机构名称
*/
private String orgName;
/**
* 验货描述
*/
private String qcDesc;
/**
* 验货编码
*/
private String qcNo;
}

View File

@@ -130,6 +130,7 @@ public class JDProductService {
itemMap.put("spuid", String.valueOf(productInfo.getData()[0].getSpuid())); itemMap.put("spuid", String.valueOf(productInfo.getData()[0].getSpuid()));
itemMap.put("commission", String.valueOf(productInfo.getData()[0].getCommissionInfo().getCommission())); itemMap.put("commission", String.valueOf(productInfo.getData()[0].getCommissionInfo().getCommission()));
itemMap.put("commissionShare", String.valueOf(productInfo.getData()[0].getCommissionInfo().getCommissionShare())); itemMap.put("commissionShare", String.valueOf(productInfo.getData()[0].getCommissionInfo().getCommissionShare()));
itemMap.put("price", String.valueOf(productInfo.getData()[0].getPriceInfo().getPrice()));
couponInfo.append("店铺: ").append(itemMap.get("shopName")).append("\n").append("标题: ").append(replaceAll).append("\n").append("自营 POP ").append(itemMap.get("owner").equals("g") ? " 自营 " : " POP ").append("\n").append("佣金比例: ").append(itemMap.get("commissionShare")).append("\n").append("佣金: ").append(itemMap.get("commission")).append("\n"); couponInfo.append("店铺: ").append(itemMap.get("shopName")).append("\n").append("标题: ").append(replaceAll).append("\n").append("自营 POP ").append(itemMap.get("owner").equals("g") ? " 自营 " : " POP ").append("\n").append("佣金比例: ").append(itemMap.get("commissionShare")).append("\n").append("佣金: ").append(itemMap.get("commission")).append("\n");
@@ -214,7 +215,7 @@ public class JDProductService {
*/ */
public synchronized JSONArray generatePromotionContentAsJsonArray(String message) { public synchronized JSONArray generatePromotionContentAsJsonArray(String message) {
JSONArray resultArray = new JSONArray(); JSONArray resultArray = new JSONArray();
// 提取方案中的所有 u.jd.com 链接 // 提取方案中的所有 u.jd.com 链接
List<String> urls = extractUJDUrls(message); List<String> urls = extractUJDUrls(message);
if (urls.isEmpty()) { if (urls.isEmpty()) {
@@ -231,7 +232,7 @@ public class JDProductService {
try { try {
// 新建格式好日期 // 新建格式好日期
format = dateFormat.format(new Date()); format = dateFormat.format(new Date());
// 查询商品信息 // 查询商品信息
GoodsQueryResult productInfo = queryProductInfoByUJDUrl(url); GoodsQueryResult productInfo = queryProductInfoByUJDUrl(url);
if (productInfo == null || productInfo.getCode() != 200) { if (productInfo == null || productInfo.getCode() != 200) {
@@ -254,7 +255,7 @@ public class JDProductService {
// 创建商品对象 // 创建商品对象
JSONObject productObj = new JSONObject(); JSONObject productObj = new JSONObject();
productObj.put("url", url); productObj.put("url", url);
// 商品基本信息 // 商品基本信息
productObj.put("materialUrl", productInfo.getData()[0].getMaterialUrl()); productObj.put("materialUrl", productInfo.getData()[0].getMaterialUrl());
productObj.put("oriItemId", productInfo.getData()[0].getOriItemId()); productObj.put("oriItemId", productInfo.getData()[0].getOriItemId());
@@ -279,7 +280,7 @@ public class JDProductService {
// 文案信息 // 文案信息
JSONArray wenanArray = new JSONArray(); JSONArray wenanArray = new JSONArray();
String title = ""; String title = "";
try { try {
if (!message.equals(url)) { if (!message.equals(url)) {
@@ -319,7 +320,7 @@ public class JDProductService {
wenanArray.add(wenan4); wenanArray.add(wenan4);
productObj.put("wenan", wenanArray); productObj.put("wenan", wenanArray);
// 添加通用文案 // 添加通用文案
JSONObject commonWenan = new JSONObject(); JSONObject commonWenan = new JSONObject();
commonWenan.put("type", "通用文案"); commonWenan.put("type", "通用文案");