You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.4 KiB
43 lines
1.4 KiB
|
2 weeks ago
|
package common.ecommerce.yqn.adapter;
|
||
|
|
|
||
|
|
import common.ecommerce.warehouse.enums.WarehouseProvider;
|
||
|
|
import common.ecommerce.warehouse.model.WarehouseInfo;
|
||
|
|
import common.ecommerce.yqn.dto.YqnDtos;
|
||
|
|
|
||
|
|
import java.util.ArrayList;
|
||
|
|
import java.util.List;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 运去哪仓库档案映射(API 134)。
|
||
|
|
*/
|
||
|
|
public final class YqnWarehouseMapper {
|
||
|
|
|
||
|
|
private YqnWarehouseMapper() {
|
||
|
|
}
|
||
|
|
|
||
|
|
/** 响应 → 统一仓库档案。 */
|
||
|
|
public static List<WarehouseInfo> toWarehouses(List<YqnDtos.WarehouseRow> rows) {
|
||
|
|
if (rows == null || rows.isEmpty()) {
|
||
|
|
return new ArrayList<WarehouseInfo>();
|
||
|
|
}
|
||
|
|
List<WarehouseInfo> out = new ArrayList<WarehouseInfo>(rows.size());
|
||
|
|
for (YqnDtos.WarehouseRow row : rows) {
|
||
|
|
out.add(WarehouseInfo.builder()
|
||
|
|
.sourceProvider(WarehouseProvider.YQN)
|
||
|
|
.warehouseCode(row.warehouseCode)
|
||
|
|
.name(row.name)
|
||
|
|
.country(row.country)
|
||
|
|
.state(row.state)
|
||
|
|
.city(row.city)
|
||
|
|
.address1(row.address1)
|
||
|
|
.address2(row.address2)
|
||
|
|
.postalCode(row.postal)
|
||
|
|
.contactName(row.linkman)
|
||
|
|
.mobilePhone(row.mobilePhone)
|
||
|
|
.email(row.email)
|
||
|
|
.build());
|
||
|
|
}
|
||
|
|
return out;
|
||
|
|
}
|
||
|
|
}
|