diff --git a/src/main/java/cn/van/business/erp/request/ERPAccount.java b/src/main/java/cn/van/business/erp/request/ERPAccount.java new file mode 100644 index 0000000..0782688 --- /dev/null +++ b/src/main/java/cn/van/business/erp/request/ERPAccount.java @@ -0,0 +1,31 @@ +//package cn.van.business.erp.request; +// +///** +// * @author Leo +// * @version 1.0 +// * @create 2025/4/10 15:20 +// * @description:ERP账户枚举类 +// */ +//public enum ERPAccount { +// // 胡歌 +// ACCOUNT_HUGE("1016208368633221", "waLiRMgFcixLbcLjUSSwo370Hp1nBcBu"), +// // 刘强东 +// 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; +// } +//} +// diff --git a/src/main/java/cn/van/business/erp/request/ERPProductQueryRequest.java b/src/main/java/cn/van/business/erp/request/ERPProductQueryRequest.java new file mode 100644 index 0000000..00b0992 --- /dev/null +++ b/src/main/java/cn/van/business/erp/request/ERPProductQueryRequest.java @@ -0,0 +1,20 @@ +//package cn.van.business.erp.request; +// +//import com.fasterxml.jackson.core.JsonProcessingException; +//import com.fasterxml.jackson.databind.ObjectMapper; +// +//public class ProductQueryRequest extends ERPRequestBase { +// public ProductQueryRequest(String url, ERPAccount erpAccount, ApifoxModel requestBody) { +// super(url, erpAccount, requestBody); +// } +// +// @Override +// public String getRequestBodyAsString() { +// try { +// ObjectMapper objectMapper = new ObjectMapper(); +// return objectMapper.writeValueAsString(requestBody); +// } catch (JsonProcessingException e) { +// throw new RuntimeException("Failed to convert request body to JSON", e); +// } +// } +//} diff --git a/src/main/java/cn/van/business/erp/request/ERPRequestBase.java b/src/main/java/cn/van/business/erp/request/ERPRequestBase.java new file mode 100644 index 0000000..e5890e3 --- /dev/null +++ b/src/main/java/cn/van/business/erp/request/ERPRequestBase.java @@ -0,0 +1,49 @@ +//package cn.van.business.erp.request; +// +//import com.fasterxml.jackson.core.JsonProcessingException; +//import com.fasterxml.jackson.databind.ObjectMapper; +// +//import java.nio.charset.StandardCharsets; +//import java.security.MessageDigest; +//import java.security.NoSuchAlgorithmException; +// +//public abstract class ERPRequestBase { +// protected final String url; +// protected final ERPAccount erpAccount; +// protected final Object requestBody; +// +// public ERPRequestBase(String url, ERPAccount erpAccount, Object requestBody) { +// this.url = url; +// this.erpAccount = erpAccount; +// this.requestBody = requestBody; +// } +// +// public String getUrl() { +// return url; +// } +// +// public ERPAccount getErpAccount() { +// return erpAccount; +// } +// +// public abstract String getRequestBodyAsString(); +// +// protected 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(); +// } +// +// protected String genSign(long timestamp, String jsonStr) { +// String data = erpAccount.getApiKey() + "," + genMd5(jsonStr) + "," + timestamp + "," + erpAccount.getApiKeySecret(); +// return genMd5(data); +// } +//} diff --git a/src/main/java/cn/van/business/erp/request/test.java b/src/main/java/cn/van/business/erp/request/test.java new file mode 100644 index 0000000..781dffd --- /dev/null +++ b/src/main/java/cn/van/business/erp/request/test.java @@ -0,0 +1,111 @@ +//package cn.van.business.erp.request; +// +///** +// * @author Leo +// * @version 1.0 +// * @create 2025/4/9 21:30 +// * @description: +// */ +//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 long apiKey = 203413189371893L; // 开放平台提供的应用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; +// +// // 请求体JSON字符串 +// String productId = "220656347074629"; +// String jsonBody = "{\"product_id\":" + productId + "}"; +// +// // 生成签名 +// String sign = genSign(timestamp, jsonBody); +// +// // 拼接请求地址 +// String apiUrl = domain + "/api/open/product/detail?appid=" + apiKey + "×tamp=" + 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); +// } +//} diff --git a/src/main/java/cn/van/business/model/erp/Address.java b/src/main/java/cn/van/business/model/erp/Address.java new file mode 100644 index 0000000..ea3431e --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/Address.java @@ -0,0 +1,24 @@ +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; +} diff --git a/src/main/java/cn/van/business/model/erp/AdventData.java b/src/main/java/cn/van/business/model/erp/AdventData.java new file mode 100644 index 0000000..3a326ac --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/AdventData.java @@ -0,0 +1,25 @@ +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; +} diff --git a/src/main/java/cn/van/business/model/erp/AdventDataExpire.java b/src/main/java/cn/van/business/model/erp/AdventDataExpire.java new file mode 100644 index 0000000..eb161c9 --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/AdventDataExpire.java @@ -0,0 +1,16 @@ +package cn.van.business.model.erp; + +/** + * 有效期信息 + */ +@lombok.Data +public class AdventDataExpire { + /** + * 保质期 + */ + private long num; + /** + * 单位 + */ + private PurpleUnit unit; +} diff --git a/src/main/java/cn/van/business/model/erp/AdventDataProduction.java b/src/main/java/cn/van/business/model/erp/AdventDataProduction.java new file mode 100644 index 0000000..13a96da --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/AdventDataProduction.java @@ -0,0 +1,12 @@ +package cn.van.business.model.erp; + +/** + * 生产信息 + */ +@lombok.Data +public class AdventDataProduction { + /** + * 生产日期 + */ + private String date; +} diff --git a/src/main/java/cn/van/business/model/erp/AssumeRule.java b/src/main/java/cn/van/business/model/erp/AssumeRule.java new file mode 100644 index 0000000..ec8ce02 --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/AssumeRule.java @@ -0,0 +1,22 @@ +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"); + } +} diff --git a/src/main/java/cn/van/business/model/erp/BeautyMakeup.java b/src/main/java/cn/van/business/model/erp/BeautyMakeup.java new file mode 100644 index 0000000..fa9d7d3 --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/BeautyMakeup.java @@ -0,0 +1,34 @@ +package cn.van.business.model.erp; + +import java.util.List; /** + * 美妆信息 + */ +@lombok.Data +public class BeautyMakeup { + /** + * 品牌 + */ + private String brand; + /** + * 验货图片 + */ + private List images; + /** + * 成色 + */ + private String level; + /** + * 检测机构ID,枚举值: + * 181 : 维鉴 + * 182 : 中检科深 + */ + private long orgid; + /** + * 检测机构名称 + */ + private String orgName; + /** + * 规格 + */ + private String spec; +} diff --git a/src/main/java/cn/van/business/model/erp/BookData.java b/src/main/java/cn/van/business/model/erp/BookData.java new file mode 100644 index 0000000..f0c76e0 --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/BookData.java @@ -0,0 +1,24 @@ +package cn.van.business.model.erp; + +/** + * 图书信息 + */ +@lombok.Data +public class BookData { + /** + * 图书作者 + */ + private String author; + /** + * 图书ISBN码 + */ + private String isbn; + /** + * 图书出版社 + */ + private String publisher; + /** + * 图书标题 + */ + private String title; +} diff --git a/src/main/java/cn/van/business/model/erp/BrandData.java b/src/main/java/cn/van/business/model/erp/BrandData.java new file mode 100644 index 0000000..4ce3a40 --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/BrandData.java @@ -0,0 +1,24 @@ +package cn.van.business.model.erp; + +import java.util.List; /** + * 品牌捡漏信息 + */ +@lombok.Data +public class BrandData { + /** + * 有效期信息 + */ + private BrandDataExpire expire; + /** + * 资质证明 + */ + private List images; + /** + * 生产信息 + */ + private BrandDataProduction production; + /** + * 供应商名称 + */ + private String supplier; +} diff --git a/src/main/java/cn/van/business/model/erp/BrandDataExpire.java b/src/main/java/cn/van/business/model/erp/BrandDataExpire.java new file mode 100644 index 0000000..02b0184 --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/BrandDataExpire.java @@ -0,0 +1,16 @@ +package cn.van.business.model.erp; + +/** + * 有效期信息 + */ +@lombok.Data +public class BrandDataExpire { + /** + * 保质期 + */ + private long num; + /** + * 单位 + */ + private FluffyUnit unit; +} diff --git a/src/main/java/cn/van/business/model/erp/BrandDataProduction.java b/src/main/java/cn/van/business/model/erp/BrandDataProduction.java new file mode 100644 index 0000000..90c8751 --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/BrandDataProduction.java @@ -0,0 +1,12 @@ +package cn.van.business.model.erp; + +/** + * 生产信息 + */ +@lombok.Data +public class BrandDataProduction { + /** + * 生产日期 + */ + private String date; +} diff --git a/src/main/java/cn/van/business/model/erp/Channelpv.java b/src/main/java/cn/van/business/model/erp/Channelpv.java new file mode 100644 index 0000000..67e5395 --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/Channelpv.java @@ -0,0 +1,26 @@ +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; +} diff --git a/src/main/java/cn/van/business/model/erp/Curio.java b/src/main/java/cn/van/business/model/erp/Curio.java new file mode 100644 index 0000000..8a076a4 --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/Curio.java @@ -0,0 +1,44 @@ +package cn.van.business.model.erp; + +import java.util.List; /** + * 文玩信息 + */ +@lombok.Data +public class Curio { + /** + * 验货图片 + */ + private List 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; +} diff --git a/src/main/java/cn/van/business/model/erp/ERPShop.java b/src/main/java/cn/van/business/model/erp/ERPShop.java new file mode 100644 index 0000000..c6ff709 --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/ERPShop.java @@ -0,0 +1,102 @@ +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; + /** + * 详情图片 + */ + private List 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; + /** + * 验货报告信息,注意:已验货类型的商品按需必填 + */ + private ReportData reportData; + /** + * 规格图片 + */ + private List skuImages; + /** + * 商品多规格信息 + */ + private List skuItems; + /** + * 商品行业 + */ + private long spBizType; + /** + * 商品库存 + */ + private long stock; + /** + * 商品成色 + */ + private Long stuffStatus; +} + + diff --git a/src/main/java/cn/van/business/model/erp/Empty.java b/src/main/java/cn/van/business/model/erp/Empty.java new file mode 100644 index 0000000..2edf34f --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/Empty.java @@ -0,0 +1,18 @@ +package cn.van.business.model.erp; + +/** + * 验货宝信息,商品类型为验货宝时必传 + * + * 验货宝信息 + */ +@lombok.Data +public class Empty { + /** + * 验货费规则 + */ + private AssumeRule assumeRule; + /** + * 交易规则 + */ + private TradeRule tradeRule; +} diff --git a/src/main/java/cn/van/business/model/erp/FluffyUnit.java b/src/main/java/cn/van/business/model/erp/FluffyUnit.java new file mode 100644 index 0000000..e35b1da --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/FluffyUnit.java @@ -0,0 +1,20 @@ +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"); + } +} diff --git a/src/main/java/cn/van/business/model/erp/FoodData.java b/src/main/java/cn/van/business/model/erp/FoodData.java new file mode 100644 index 0000000..d12f7fe --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/FoodData.java @@ -0,0 +1,28 @@ +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; +} diff --git a/src/main/java/cn/van/business/model/erp/FoodDataExpire.java b/src/main/java/cn/van/business/model/erp/FoodDataExpire.java new file mode 100644 index 0000000..f5d46df --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/FoodDataExpire.java @@ -0,0 +1,16 @@ +package cn.van.business.model.erp; + +/** + * 食品有效期信息 + */ +@lombok.Data +public class FoodDataExpire { + /** + * 保质期 + */ + private long num; + /** + * 单位 + */ + private PurpleUnit unit; +} diff --git a/src/main/java/cn/van/business/model/erp/FoodDataProduction.java b/src/main/java/cn/van/business/model/erp/FoodDataProduction.java new file mode 100644 index 0000000..c34c3ef --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/FoodDataProduction.java @@ -0,0 +1,16 @@ +package cn.van.business.model.erp; + +/** + * 食品生产信息 + */ +@lombok.Data +public class FoodDataProduction { + /** + * 食品生产地信息 + */ + private Address address; + /** + * 食品生产日期 + */ + private String date; +} diff --git a/src/main/java/cn/van/business/model/erp/Game.java b/src/main/java/cn/van/business/model/erp/Game.java new file mode 100644 index 0000000..10fbcb9 --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/Game.java @@ -0,0 +1,28 @@ +package cn.van.business.model.erp; + +import java.util.List; /** + * 游戏信息 + */ +@lombok.Data +public class Game { + /** + * 验货图片 + */ + private List images; + /** + * 游戏平台 + */ + private String platform; + /** + * 验货描述 + */ + private String qcDesc; + /** + * 验货编码 + */ + private String qcNo; + /** + * 报告标题 + */ + private String title; +} diff --git a/src/main/java/cn/van/business/model/erp/Image.java b/src/main/java/cn/van/business/model/erp/Image.java new file mode 100644 index 0000000..40ce7a2 --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/Image.java @@ -0,0 +1,22 @@ +package cn.van.business.model.erp; + +/** + * 资质证明 + * + * 新图片信息 + */ +@lombok.Data +public class Image { + /** + * 图片高度 + */ + private long height; + /** + * 图片地址 + */ + private String src; + /** + * 图片宽度 + */ + private long width; +} diff --git a/src/main/java/cn/van/business/model/erp/Jewelry.java b/src/main/java/cn/van/business/model/erp/Jewelry.java new file mode 100644 index 0000000..6ec8301 --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/Jewelry.java @@ -0,0 +1,36 @@ +package cn.van.business.model.erp; + +import java.util.List; /** + * 珠宝信息 + */ +@lombok.Data +public class Jewelry { + /** + * 颜色 + */ + private String color; + /** + * 验货图片 + */ + private List images; + /** + * 检测机构名称 + */ + private String orgName; + /** + * 验货描述 + */ + private String qcDesc; + /** + * 验货编码 + */ + private String qcNo; + /** + * 形状 + */ + private String shape; + /** + * 重量 + */ + private String weight; +} diff --git a/src/main/java/cn/van/business/model/erp/PublishShop.java b/src/main/java/cn/van/business/model/erp/PublishShop.java new file mode 100644 index 0000000..98d8555 --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/PublishShop.java @@ -0,0 +1,45 @@ +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 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; +} diff --git a/src/main/java/cn/van/business/model/erp/PurpleUnit.java b/src/main/java/cn/van/business/model/erp/PurpleUnit.java new file mode 100644 index 0000000..941b4ba --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/PurpleUnit.java @@ -0,0 +1,24 @@ +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"); + } +} diff --git a/src/main/java/cn/van/business/model/erp/ReportData.java b/src/main/java/cn/van/business/model/erp/ReportData.java new file mode 100644 index 0000000..f838521 --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/ReportData.java @@ -0,0 +1,35 @@ +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; +} diff --git a/src/main/java/cn/van/business/model/erp/ReportItem.java b/src/main/java/cn/van/business/model/erp/ReportItem.java new file mode 100644 index 0000000..3c3e66c --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/ReportItem.java @@ -0,0 +1,33 @@ +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; +} diff --git a/src/main/java/cn/van/business/model/erp/SkuImage.java b/src/main/java/cn/van/business/model/erp/SkuImage.java new file mode 100644 index 0000000..3e5946f --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/SkuImage.java @@ -0,0 +1,24 @@ +package cn.van.business.model.erp; + +/** + * 规格图片 + */ +@lombok.Data +public class SkuImage { + /** + * 图片高度 + */ + private long height; + /** + * 规格属性 + */ + private String skuText; + /** + * 图片地址 + */ + private String src; + /** + * 图片宽度 + */ + private long width; +} diff --git a/src/main/java/cn/van/business/model/erp/SkuItems.java b/src/main/java/cn/van/business/model/erp/SkuItems.java new file mode 100644 index 0000000..d698cfd --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/SkuItems.java @@ -0,0 +1,24 @@ +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; +} diff --git a/src/main/java/cn/van/business/model/erp/The3C.java b/src/main/java/cn/van/business/model/erp/The3C.java new file mode 100644 index 0000000..4dcb3b7 --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/The3C.java @@ -0,0 +1,52 @@ +package cn.van.business.model.erp; + +import java.util.List; /** + * 严选3c信息 + */ +@lombok.Data +public class The3C { + /** + * 质检选项ID,内部存储,不对外展示 + */ + private List 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 reportItems; + /** + * 质检时间,体现在商品验货报告页 + */ + private String reportTime; + /** + * 质检人,体现在商品验货报告页 + */ + private String reportUser; + /** + * 子类ID + */ + private long subclassid; +} diff --git a/src/main/java/cn/van/business/model/erp/TradeRule.java b/src/main/java/cn/van/business/model/erp/TradeRule.java new file mode 100644 index 0000000..ef4a39e --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/TradeRule.java @@ -0,0 +1,22 @@ +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"); + } +} diff --git a/src/main/java/cn/van/business/model/erp/UsedCar.java b/src/main/java/cn/van/business/model/erp/UsedCar.java new file mode 100644 index 0000000..096d038 --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/UsedCar.java @@ -0,0 +1,34 @@ +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; +} diff --git a/src/main/java/cn/van/business/model/erp/Valuable.java b/src/main/java/cn/van/business/model/erp/Valuable.java new file mode 100644 index 0000000..050bd95 --- /dev/null +++ b/src/main/java/cn/van/business/model/erp/Valuable.java @@ -0,0 +1,32 @@ +package cn.van.business.model.erp; + +import java.util.List; /** + * 奢品信息 + */ +@lombok.Data +public class Valuable { + /** + * 验货图片 + */ + private List images; + /** + * 检测机构ID,枚举值: + * 161 : 中检 + * 162 : 国检 + * 163 : 华测 + * 164 : 中溯 + */ + private long orgid; + /** + * 检测机构名称 + */ + private String orgName; + /** + * 验货描述 + */ + private String qcDesc; + /** + * 验货编码 + */ + private String qcNo; +} diff --git a/src/main/java/cn/van/business/util/JDUtil.java b/src/main/java/cn/van/business/util/JDUtil.java index c7e222a..572a33e 100644 --- a/src/main/java/cn/van/business/util/JDUtil.java +++ b/src/main/java/cn/van/business/util/JDUtil.java @@ -99,7 +99,7 @@ public class JDUtil { *

* 订单号: */ - private static final String WENAN_D = "单:\n" + "{单号} \n" + "分销标记(标记用,勿改):\n" + "型号:\n" +"\n" +"链接:\n" +"\n" + "下单付款:\n" + "\n" + "后返金额:\n" + "\n" + "地址:\n" + "\n" + "物流链接:\n" + "\n" + "订单号:\n" + "\n" ; + private static final String WENAN_D = "单:\n" + "{单号} \n" + "分销标记(标记用,勿改):\n" + "型号:\n" +"\n" +"链接:\n" +"\n" + "下单付款:\n" + "\n" + "后返金额:\n" + "\n" + "地址:\n" + "\n" + "物流链接:\n" + "\n" + "订单号:\n" + "\n" + "下单人:\n" + "\n" ; final WXUtil wxUtil; private final StringRedisTemplate redisTemplate; @@ -1405,7 +1405,7 @@ public class JDUtil { itemMap.put("shopId", String.valueOf(productInfo.getData()[0].getShopInfo().getShopId())); itemMap.put("shopName", productInfo.getData()[0].getShopInfo().getShopName()); itemMap.put("skuName", productInfo.getData()[0].getSkuName()); - String replaceAll = itemMap.get("skuName").replaceAll("换新", "").replaceAll("以旧换新", "").replaceAll("国家", "").replaceAll("补贴", "").replaceAll("15%", "").replaceAll("20%", ""); + String replaceAll = itemMap.get("skuName").replaceAll("以旧", "").replaceAll("政府", "").replaceAll("换新", "").replaceAll("领取", "").replaceAll("国家", "").replaceAll("补贴", "").replaceAll("15%", "").replaceAll("20%", ""); itemMap.put("spuid", String.valueOf(productInfo.getData()[0].getSpuid())); itemMap.put("commission", String.valueOf(productInfo.getData()[0].getCommissionInfo().getCommission())); itemMap.put("commissionShare", String.valueOf(productInfo.getData()[0].getCommissionInfo().getCommissionShare()));