Browse Source
POST /webApi/order/listByLogisticProductHasPerm → List<LogisticsProduct> 复用已有的 LogisticsProductCapable.products(),能力位 LOGISTICS_PRODUCT。 关键点:productId = -998 是「使用分物流规则」的哨兵值,不是真实产品, 映射时跳过——否则宿主的渠道清单里会多一个查不到的 id。 applicableBusiness 固定 1(店铺订单):统一模型不区分业务类型。 文档说 warehouseId 必填,实测不传会返回全账号的产品(162 条 vs 仓 2 的 36 条), 所以只在 providerWarehouseId 是数字时才下发。 统一模型只有编码 / 名称 / 是否跨国三个字段;易达云不回跨国标记,恒 false。 承运商类型、派单方式、面单获取方式、增值服务选项都只在 DTO 里。 真机(2026-11-16,仓 2):店铺订单 36 条、平台仓订单 23 条、退货单 35 条; 不传业务类型 37 条(含 -998);不传仓 162 条。-998 每次都出现,确认是哨兵值。 Co-Authored-By: Claude <noreply@anthropic.com>master
5 changed files with 433 additions and 2 deletions
@ -0,0 +1,90 @@ |
|||||||
|
package common.ecommerce.edayun.adapter; |
||||||
|
|
||||||
|
import common.ecommerce.edayun.dto.EdayunLogisticsProductDtos; |
||||||
|
import common.ecommerce.warehouse.enums.WarehouseProvider; |
||||||
|
import common.ecommerce.warehouse.model.LogisticsProduct; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.Collections; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* 易达云物流产品映射 |
||||||
|
* ({@code POST /webApi/order/listByLogisticProductHasPerm})。 |
||||||
|
* |
||||||
|
* <p>统一模型 {@link LogisticsProduct} 只有「编码 / 名称 / 是否跨国」三个可填字段; |
||||||
|
* 承运商类型、派单方式、增值服务选项这些只在 DTO 里。</p> |
||||||
|
* |
||||||
|
* <p>{@code productId = -998} 是「使用分物流规则」的哨兵值,不是真实产品—— |
||||||
|
* <b>映射时跳过</b>,否则宿主的渠道清单里会多一个查不到的产品。</p> |
||||||
|
*/ |
||||||
|
public final class EdayunLogisticsProductMapper { |
||||||
|
|
||||||
|
/** 「智能分物流」哨兵值。 */ |
||||||
|
static final String ID_AUTO_ROUTE = "-998"; |
||||||
|
|
||||||
|
private EdayunLogisticsProductMapper() { |
||||||
|
} |
||||||
|
|
||||||
|
/** 查询请求。 */ |
||||||
|
public static EdayunLogisticsProductDtos.ListProductRequest toRequest( |
||||||
|
String providerWarehouseId, Integer applicableBusiness) { |
||||||
|
EdayunLogisticsProductDtos.ListProductRequest req = |
||||||
|
new EdayunLogisticsProductDtos.ListProductRequest(); |
||||||
|
req.warehouseId = warehouseIdOf(providerWarehouseId); |
||||||
|
req.applicableBusiness = applicableBusiness; |
||||||
|
return req; |
||||||
|
} |
||||||
|
|
||||||
|
/** 响应 → 统一产品清单;跳过 {@code -998} 与无效行。 */ |
||||||
|
public static List<LogisticsProduct> toProducts( |
||||||
|
List<EdayunLogisticsProductDtos.Product> rows, String warehouseCode) { |
||||||
|
if (rows == null || rows.isEmpty()) { |
||||||
|
return Collections.emptyList(); |
||||||
|
} |
||||||
|
List<LogisticsProduct> out = new ArrayList<LogisticsProduct>(rows.size()); |
||||||
|
for (EdayunLogisticsProductDtos.Product row : rows) { |
||||||
|
LogisticsProduct product = toProduct(row, warehouseCode); |
||||||
|
if (product != null) { |
||||||
|
out.add(product); |
||||||
|
} |
||||||
|
} |
||||||
|
return out; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 一个产品 → 统一模型。 |
||||||
|
* |
||||||
|
* <p>编码用 {@code productId}(字符串化的数字),名称用 {@code productName}。 |
||||||
|
* {@code crossCountry} 易达云不回,恒 false。</p> |
||||||
|
*/ |
||||||
|
static LogisticsProduct toProduct(EdayunLogisticsProductDtos.Product row, String warehouseCode) { |
||||||
|
if (row == null || row.productId == null || row.productId.trim().isEmpty()) { |
||||||
|
return null; |
||||||
|
} |
||||||
|
String id = row.productId.trim(); |
||||||
|
if (ID_AUTO_ROUTE.equals(id)) { |
||||||
|
// 「使用分物流规则」不是可选的物流产品
|
||||||
|
return null; |
||||||
|
} |
||||||
|
return LogisticsProduct.builder() |
||||||
|
.sourceProvider(WarehouseProvider.EDAYUN) |
||||||
|
.warehouseCode(warehouseCode) |
||||||
|
.logisticsProductCode(id) |
||||||
|
.logisticsProductName(row.productName) |
||||||
|
.crossCountry(false) |
||||||
|
.build(); |
||||||
|
} |
||||||
|
|
||||||
|
/** 仓方仓 id 是数字;非数字/为空返回 null(不传,仓方返回全部仓)。 */ |
||||||
|
static Long warehouseIdOf(String providerWarehouseId) { |
||||||
|
if (providerWarehouseId == null || providerWarehouseId.trim().isEmpty()) { |
||||||
|
return null; |
||||||
|
} |
||||||
|
try { |
||||||
|
return Long.valueOf(providerWarehouseId.trim()); |
||||||
|
} catch (NumberFormatException e) { |
||||||
|
return null; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,79 @@ |
|||||||
|
package common.ecommerce.edayun.dto; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* 易达云报文结构:根据仓库查询物流产品列表 |
||||||
|
* ({@code POST /webApi/order/listByLogisticProductHasPerm})。 |
||||||
|
* |
||||||
|
* <p>一个文件对应一个接口。用于「出库单 / 退货单能选哪些物流产品」。 |
||||||
|
* 最后一条可能是 {@code productId = -998}(智能分物流),此时其余字段全是 null。</p> |
||||||
|
*/ |
||||||
|
public final class EdayunLogisticsProductDtos { |
||||||
|
|
||||||
|
private EdayunLogisticsProductDtos() { |
||||||
|
} |
||||||
|
|
||||||
|
/** 查询请求。 */ |
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL) |
||||||
|
public static final class ListProductRequest { |
||||||
|
/** 适用业务:1 店铺订单 / 2 平台仓订单 / 3 退货单。 */ |
||||||
|
public Integer applicableBusiness; |
||||||
|
/** 仓库 id。文档标必填,实测不传返回全部仓的产品。 */ |
||||||
|
public Long warehouseId; |
||||||
|
} |
||||||
|
|
||||||
|
/** 查询响应。 */ |
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL) |
||||||
|
public static final class ListProductResponse { |
||||||
|
public Integer code; |
||||||
|
public String msg; |
||||||
|
public List<Product> data; |
||||||
|
public String traceId; |
||||||
|
} |
||||||
|
|
||||||
|
/** 一个物流产品。 */ |
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL) |
||||||
|
public static final class Product { |
||||||
|
|
||||||
|
/** 物流产品 id(字符串化的数字)。 */ |
||||||
|
public String productId; |
||||||
|
public String productName; |
||||||
|
/** 承运商类型,码表未给。 */ |
||||||
|
public Integer carrierType; |
||||||
|
/** 派送类型,码表未给。 */ |
||||||
|
public Integer deliveryType; |
||||||
|
|
||||||
|
/** 服务属性列表,码表未给。 */ |
||||||
|
public List<Integer> serviceAttribute; |
||||||
|
/** 是否校验跟踪号。 */ |
||||||
|
public Boolean tackingNoCheckFlag; |
||||||
|
/** 适用业务:1 店铺订单 / 2 平台仓订单 / 3 退货单。 */ |
||||||
|
public List<Integer> applicableBusiness; |
||||||
|
|
||||||
|
/** 面单获取方式,码表未给(实测 0 / 1 / 2)。 */ |
||||||
|
public Integer labelGetMethod; |
||||||
|
|
||||||
|
/** 增值服务选项(名称 + 可取值说明)。 */ |
||||||
|
public List<ValueAddedOption> valueAddedOptions; |
||||||
|
|
||||||
|
/** 固定价格标记。 */ |
||||||
|
public Integer fixedPrice; |
||||||
|
/** 退货是否回传提货时间标记。 */ |
||||||
|
public Integer returnPickupTimeFlage; |
||||||
|
/** 是否对公众开放。 */ |
||||||
|
public Boolean supportPublic; |
||||||
|
/** 客户编码列表;null 表示不限。 */ |
||||||
|
public List<String> customerCodes; |
||||||
|
} |
||||||
|
|
||||||
|
/** 增值服务选项。 */ |
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL) |
||||||
|
public static final class ValueAddedOption { |
||||||
|
public String name; |
||||||
|
/** 取值说明,如 {@code is_signature};文档示例还写过逗号拼接的多值。 */ |
||||||
|
public String value; |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,110 @@ |
|||||||
|
package common.ecommerce.edayun.adapter; |
||||||
|
|
||||||
|
import common.ecommerce.edayun.dto.EdayunLogisticsProductDtos; |
||||||
|
import common.ecommerce.http.JacksonJsonCodec; |
||||||
|
import common.ecommerce.shared.spi.ChannelSecret; |
||||||
|
import common.ecommerce.shared.testkit.RecordingTransport; |
||||||
|
import common.ecommerce.shared.testkit.Responses; |
||||||
|
import common.ecommerce.warehouse.enums.WarehouseProvider; |
||||||
|
import common.ecommerce.warehouse.model.LogisticsProduct; |
||||||
|
import common.ecommerce.warehouse.sdk.WarehouseConnection; |
||||||
|
import common.ecommerce.warehouse.sdk.WarehouseContext; |
||||||
|
import org.junit.jupiter.api.Test; |
||||||
|
|
||||||
|
import java.time.Clock; |
||||||
|
import java.time.Instant; |
||||||
|
import java.time.ZoneOffset; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertEquals; |
||||||
|
import static org.junit.jupiter.api.Assertions.assertNull; |
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue; |
||||||
|
|
||||||
|
/** |
||||||
|
* 物流产品清单({@code /webApi/order/listByLogisticProductHasPerm})。 |
||||||
|
* |
||||||
|
* <p>重点:{@code -998}(使用分物流规则)不是真实产品,要跳过。</p> |
||||||
|
*/ |
||||||
|
class EdayunLogisticsProductTest { |
||||||
|
|
||||||
|
private static final Clock CLOCK = Clock.fixed(Instant.parse("2026-11-16T00:00:00Z"), ZoneOffset.UTC); |
||||||
|
|
||||||
|
private static WarehouseContext ctx() { |
||||||
|
return WarehouseContext.of("EDY-WH", WarehouseProvider.EDAYUN, "2", |
||||||
|
WarehouseConnection.of("https://test.example/openapi", |
||||||
|
ChannelSecret.builder().appKey("k").appSecret("s") |
||||||
|
.clientId("c").clientSecret("cs").build()), |
||||||
|
"req-lp", CLOCK); |
||||||
|
} |
||||||
|
|
||||||
|
private static EdayunLogisticsProductDtos.Product product(String id, String name) { |
||||||
|
EdayunLogisticsProductDtos.Product p = new EdayunLogisticsProductDtos.Product(); |
||||||
|
p.productId = id; |
||||||
|
p.productName = name; |
||||||
|
return p; |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
void mapsProduct() { |
||||||
|
LogisticsProduct lp = EdayunLogisticsProductMapper.toProduct( |
||||||
|
product("133", "美国USPS-Priority Mail"), "USLA"); |
||||||
|
|
||||||
|
assertEquals("133", lp.logisticsProductCode()); |
||||||
|
assertEquals("美国USPS-Priority Mail", lp.logisticsProductName()); |
||||||
|
assertEquals("USLA", lp.warehouseCode()); |
||||||
|
assertEquals(WarehouseProvider.EDAYUN, lp.sourceProvider()); |
||||||
|
// 易达云不回跨国标记,恒 false
|
||||||
|
assertTrue(!lp.crossCountry()); |
||||||
|
} |
||||||
|
|
||||||
|
/** -998 是「使用分物流规则」的哨兵值,不是可选产品。 */ |
||||||
|
@Test |
||||||
|
void autoRouteSentinelIsSkipped() { |
||||||
|
List<LogisticsProduct> list = EdayunLogisticsProductMapper.toProducts( |
||||||
|
java.util.Arrays.asList(product("133", "USPS"), product("-998", "使用分物流规则")), |
||||||
|
"USLA"); |
||||||
|
|
||||||
|
assertEquals(1, list.size()); |
||||||
|
assertEquals("133", list.get(0).logisticsProductCode()); |
||||||
|
} |
||||||
|
|
||||||
|
/** 没有 productId 的行跳过。 */ |
||||||
|
@Test |
||||||
|
void rowsWithoutProductIdAreSkipped() { |
||||||
|
assertNull(EdayunLogisticsProductMapper.toProduct(product(" ", "x"), "W")); |
||||||
|
assertNull(EdayunLogisticsProductMapper.toProduct(null, "W")); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
void emptyRowsYieldEmptyList() { |
||||||
|
assertTrue(EdayunLogisticsProductMapper.toProducts(null, "W").isEmpty()); |
||||||
|
assertTrue(EdayunLogisticsProductMapper.toProducts( |
||||||
|
java.util.Collections.<EdayunLogisticsProductDtos.Product>emptyList(), "W").isEmpty()); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
void warehouseIdOnlyWhenNumeric() { |
||||||
|
assertEquals(Long.valueOf(2L), EdayunLogisticsProductMapper.toRequest("2", 1).warehouseId); |
||||||
|
assertNull(EdayunLogisticsProductMapper.toRequest("USLA", 1).warehouseId); |
||||||
|
assertNull(EdayunLogisticsProductMapper.toRequest(null, 1).warehouseId); |
||||||
|
} |
||||||
|
|
||||||
|
@Test |
||||||
|
void adapterQueriesProducts() { |
||||||
|
RecordingTransport transport = RecordingTransport.create() |
||||||
|
.route(common.ecommerce.edayun.EdayunConstants.PATH_TOKEN, req -> Responses.ok( |
||||||
|
"{\"access_token\":\"T1\",\"token_type\":\"bearer\"}")) |
||||||
|
.route(common.ecommerce.edayun.EdayunConstants.PATH_LOGISTICS_PRODUCTS, |
||||||
|
req -> Responses.ok("{\"code\":200,\"msg\":\"操作成功\",\"data\":[" |
||||||
|
+ "{\"productId\":\"133\",\"productName\":\"USPS\"}," |
||||||
|
+ "{\"productId\":\"-998\",\"productName\":\"使用分物流规则\"}]}")); |
||||||
|
|
||||||
|
List<LogisticsProduct> list = new EdayunAdapter(transport, new JacksonJsonCodec()) |
||||||
|
.products(ctx(), null); |
||||||
|
|
||||||
|
assertEquals(1, list.size()); |
||||||
|
String body = transport.lastDataRequest().body(); |
||||||
|
assertTrue(body.contains("\"warehouseId\":2"), body); |
||||||
|
assertTrue(body.contains("\"applicableBusiness\":1"), body); |
||||||
|
} |
||||||
|
} |
||||||
@ -0,0 +1,121 @@ |
|||||||
|
package common.ecommerce.edayun.probe; |
||||||
|
|
||||||
|
import common.ecommerce.edayun.EdayunConstants; |
||||||
|
import common.ecommerce.edayun.adapter.EdayunAdapter; |
||||||
|
import common.ecommerce.edayun.adapter.EdayunBolMapper; |
||||||
|
import common.ecommerce.edayun.adapter.EdayunLogisticsProductMapper; |
||||||
|
import common.ecommerce.edayun.dto.EdayunBolDtos; |
||||||
|
import common.ecommerce.edayun.dto.EdayunLogisticsProductDtos; |
||||||
|
import common.ecommerce.http.JacksonJsonCodec; |
||||||
|
import common.ecommerce.http.OkHttpTransport; |
||||||
|
import common.ecommerce.shared.error.ChannelException; |
||||||
|
import common.ecommerce.shared.spi.ChannelSecret; |
||||||
|
import common.ecommerce.warehouse.enums.WarehouseProvider; |
||||||
|
import common.ecommerce.warehouse.model.BolDocument; |
||||||
|
import common.ecommerce.warehouse.model.LogisticsProduct; |
||||||
|
import common.ecommerce.warehouse.sdk.WarehouseConnection; |
||||||
|
import common.ecommerce.warehouse.sdk.WarehouseContext; |
||||||
|
import org.junit.jupiter.api.Assumptions; |
||||||
|
import org.junit.jupiter.api.Test; |
||||||
|
import org.junit.jupiter.api.condition.EnabledIfSystemProperty; |
||||||
|
|
||||||
|
import java.time.Clock; |
||||||
|
import java.util.List; |
||||||
|
import java.util.UUID; |
||||||
|
|
||||||
|
/** |
||||||
|
* BOL + 物流产品联调探针:<b>只读</b>,不会在仓侧产生任何数据。 |
||||||
|
* |
||||||
|
* <pre> |
||||||
|
* # 只看报文(不联网) |
||||||
|
* mvn -pl warehouse-sdk-edayun -DfailIfNoTests=false \ |
||||||
|
* -Dedayun.probe.bol=true -Dtest=EdayunBolProbeTest test |
||||||
|
* |
||||||
|
* # 真查(只读) |
||||||
|
* ... -Dedayun.probe.bol=true -Dedayun.probe.call=true \ |
||||||
|
* -Dedayun.probe.clientId=... -Dedayun.probe.clientSecret=... \ |
||||||
|
* -Dedayun.probe.appKey=... -Dedayun.probe.appSecret=... \ |
||||||
|
* [-Dedayun.probe.warehouseId=2] [-Dedayun.probe.orderNo=FBA473182144] |
||||||
|
* </pre> |
||||||
|
*/ |
||||||
|
@EnabledIfSystemProperty(named = "edayun.probe.bol", matches = "true") |
||||||
|
class EdayunBolProbeTest { |
||||||
|
|
||||||
|
private static final String BASE_URL = opt("edayun.probe.baseUrl", EdayunConstants.PR_BASE_URL); |
||||||
|
private static final String CLIENT_ID = System.getProperty("edayun.probe.clientId", ""); |
||||||
|
private static final String CLIENT_SECRET = System.getProperty("edayun.probe.clientSecret", ""); |
||||||
|
private static final String APP_KEY = System.getProperty("edayun.probe.appKey", ""); |
||||||
|
private static final String APP_SECRET = System.getProperty("edayun.probe.appSecret", ""); |
||||||
|
private static final String WAREHOUSE_ID = System.getProperty("edayun.probe.warehouseId", ""); |
||||||
|
private static final String ORDER_NO = opt("edayun.probe.orderNo", "FBA473182144"); |
||||||
|
private static final boolean CALL = Boolean.getBoolean("edayun.probe.call"); |
||||||
|
|
||||||
|
@Test |
||||||
|
void probeBolAndProducts() { |
||||||
|
EdayunBolDtos.GetBolRequest bolBody = EdayunBolMapper.toRequest(ORDER_NO); |
||||||
|
EdayunLogisticsProductDtos.ListProductRequest lpBody = |
||||||
|
EdayunLogisticsProductMapper.toRequest(emptyToNull(WAREHOUSE_ID), 1); |
||||||
|
|
||||||
|
System.out.println("\n================ edayun / POST " |
||||||
|
+ EdayunConstants.PATH_BOL_LIST + " ================"); |
||||||
|
System.out.println("[request] " + new JacksonJsonCodec().toJson(bolBody)); |
||||||
|
System.out.println("\n================ edayun / POST " |
||||||
|
+ EdayunConstants.PATH_LOGISTICS_PRODUCTS + " ================"); |
||||||
|
System.out.println("[request] " + new JacksonJsonCodec().toJson(lpBody)); |
||||||
|
|
||||||
|
Assumptions.assumeTrue(CALL, "dry-run:未加 -Dedayun.probe.call=true,不实际调用"); |
||||||
|
Assumptions.assumeTrue(!CLIENT_ID.trim().isEmpty() && !CLIENT_SECRET.trim().isEmpty() |
||||||
|
&& !APP_KEY.trim().isEmpty() && !APP_SECRET.trim().isEmpty(), |
||||||
|
"真查需要 -Dedayun.probe.clientId / clientSecret / appKey / appSecret"); |
||||||
|
|
||||||
|
try { |
||||||
|
WarehouseContext ctx = WarehouseContext.of("EDY-PROBE", WarehouseProvider.EDAYUN, |
||||||
|
emptyToNull(WAREHOUSE_ID), |
||||||
|
WarehouseConnection.of(BASE_URL, |
||||||
|
ChannelSecret.builder() |
||||||
|
.appKey(APP_KEY).appSecret(APP_SECRET) |
||||||
|
.clientId(CLIENT_ID).clientSecret(CLIENT_SECRET) |
||||||
|
.build()), |
||||||
|
"probe-" + UUID.randomUUID(), Clock.systemUTC()); |
||||||
|
EdayunAdapter adapter = new EdayunAdapter( |
||||||
|
new OkHttpTransport("common-ecommerce/1.0.0 (edayun-probe)", 10_000, 60_000), |
||||||
|
new JacksonJsonCodec()); |
||||||
|
|
||||||
|
List<BolDocument> bols = adapter.orderBols(ctx, ORDER_NO); |
||||||
|
System.out.println("[OK] bols=" + bols.size()); |
||||||
|
for (BolDocument b : bols) { |
||||||
|
System.out.println(" " + b.bolCode() + " status=" + b.rawStatus() |
||||||
|
+ "/" + b.statusName() + " pickup=" + b.scheduledPickupDate() |
||||||
|
+ " qty=" + b.scheduledPickupQuantity() |
||||||
|
+ " tracking=" + b.trackingNo()); |
||||||
|
System.out.println(" file=" + b.fileUrl()); |
||||||
|
} |
||||||
|
|
||||||
|
List<LogisticsProduct> products = adapter.products(ctx, null); |
||||||
|
System.out.println("[OK] logisticsProducts=" + products.size()); |
||||||
|
for (int i = 0; i < Math.min(5, products.size()); i++) { |
||||||
|
LogisticsProduct p = products.get(i); |
||||||
|
System.out.println(" " + p.logisticsProductCode() + " " + p.logisticsProductName()); |
||||||
|
} |
||||||
|
} catch (RuntimeException e) { |
||||||
|
String msg = e.getMessage() == null ? e.getClass().getSimpleName() : e.getMessage(); |
||||||
|
System.out.println("[ERROR] " + e.getClass().getSimpleName() + ": " |
||||||
|
+ (msg.length() <= 800 ? msg : msg.substring(0, 800) + "…")); |
||||||
|
if (e instanceof ChannelException) { |
||||||
|
ChannelException ce = (ChannelException) e; |
||||||
|
System.out.println(" platformCode=" + ce.platformCode() |
||||||
|
+ " retryable=" + ce.retryable()); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
private static String opt(String name, String fallback) { |
||||||
|
String value = System.getProperty(name, ""); |
||||||
|
String trimmed = value == null ? "" : value.trim(); |
||||||
|
return trimmed.isEmpty() ? fallback : trimmed; |
||||||
|
} |
||||||
|
|
||||||
|
private static String emptyToNull(String v) { |
||||||
|
return v == null || v.trim().isEmpty() ? null : v.trim(); |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue