fix(warehouse): align partner import carrier columns
This commit is contained in:
@@ -40,7 +40,7 @@ class PartnerImportServiceTest {
|
||||
void shouldImportValidMultiTypeRow() throws Exception {
|
||||
byte[] file = withRows(service.template(), new String[][] {
|
||||
{"CAR-100", "测试船公司", "CARRIER,SHIPPER", "张三", "13800138000", "test@example.com",
|
||||
"CN", "广东省", "深圳市", "南山区", "测试路 1 号", "518000", "ACTIVE", "测试备注"}
|
||||
"MATSON", "CN", "广东省", "深圳市", "南山区", "测试路 1 号", "518000", "ACTIVE", "测试备注"}
|
||||
});
|
||||
|
||||
PartnerImportResult result = service.importFile(0L, "partners.xlsx", file);
|
||||
@@ -52,6 +52,7 @@ class PartnerImportServiceTest {
|
||||
assertThat(captor.getValue().getTenantId()).isZero();
|
||||
assertThat(captor.getValue().getDataScopeId()).isZero();
|
||||
assertThat(captor.getValue().getTypes()).containsExactly("CARRIER", "SHIPPER");
|
||||
assertThat(captor.getValue().getCarrierCode()).isEqualTo("MATSON");
|
||||
assertThat(captor.getValue().getRemark()).isEqualTo("测试备注");
|
||||
}
|
||||
|
||||
@@ -59,8 +60,8 @@ class PartnerImportServiceTest {
|
||||
@DisplayName("文件内任一错误时整批零写入并返回行号")
|
||||
void shouldRejectWholeBatchWhenAnyRowIsInvalid() throws Exception {
|
||||
byte[] file = withRows(service.template(), new String[][] {
|
||||
{"CAR-100", "测试船公司一", "CARRIER", "张三", "13800138000", "", "CN", "", "深圳市", "", "测试路 1 号", "", "ACTIVE", ""},
|
||||
{"CAR-100", "测试单位二", "UNKNOWN", "李四", "13900139000", "bad-email", "C", "", "", "", "", "", "ENABLED", ""}
|
||||
{"CAR-100", "测试船公司一", "CARRIER", "张三", "13800138000", "", "MATSON", "CN", "", "深圳市", "", "测试路 1 号", "", "ACTIVE", ""},
|
||||
{"CAR-100", "测试单位二", "UNKNOWN", "李四", "13900139000", "bad-email", "", "C", "", "", "", "", "", "ENABLED", ""}
|
||||
});
|
||||
|
||||
PartnerImportResult result = service.importFile(0L, "partners.xlsx", file);
|
||||
|
||||
Reference in New Issue
Block a user