优化
This commit is contained in:
+3
-3
@@ -29,8 +29,8 @@ class WarehouseSchemaContractTest {
|
||||
"postal_code", "status", "remark");
|
||||
assertThat(sql).contains("CREATE TABLE IF NOT EXISTS wh_partner_type")
|
||||
.contains("idx_wh_partner_type_scope")
|
||||
.contains("chk_wh_partner_type CHECK (partner_type IN ('CUSTOMER','CARRIER','SHIPPER','CONSIGNEE'))")
|
||||
.contains("chk_wh_partner_type_value CHECK (partner_type IN ('CUSTOMER','CARRIER','SHIPPER','CONSIGNEE'))")
|
||||
.contains("chk_wh_partner_type CHECK (partner_type IN ('CARRIER','SHIPPER','CONSIGNEE'))")
|
||||
.contains("chk_wh_partner_type_value CHECK (partner_type IN ('CARRIER','SHIPPER','CONSIGNEE'))")
|
||||
.doesNotContain("CUSTOMS_BROKER", "SUPPLIER或BOTH");
|
||||
assertBaseColumns(sql);
|
||||
}
|
||||
@@ -145,7 +145,7 @@ class WarehouseSchemaContractTest {
|
||||
void unifiedSqlUsesOnlyNonSupplierPartnerTypes() throws IOException {
|
||||
String unified = Files.readString(Path.of("..", "deploy", "sql", "头程数据库统一增量-MySQL8.sql"));
|
||||
assertThat(tableDefinition(unified, "wh_partner"))
|
||||
.contains("chk_wh_partner_type CHECK (partner_type IN ('CUSTOMER','CARRIER','SHIPPER','CONSIGNEE'))")
|
||||
.contains("chk_wh_partner_type CHECK (partner_type IN ('CARRIER','SHIPPER','CONSIGNEE'))")
|
||||
.doesNotContain("CUSTOMS_BROKER", "SUPPLIER或BOTH");
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class PartnerImportServiceTest {
|
||||
@DisplayName("标准模板支持多类型并写入服务端数据范围")
|
||||
void shouldImportValidMultiTypeRow() throws Exception {
|
||||
byte[] file = withRows(service.template(), new String[][] {
|
||||
{"CUS-100", "测试单位", "CUSTOMER,SHIPPER", "张三", "13800138000", "test@example.com",
|
||||
{"CAR-100", "测试船公司", "CARRIER,SHIPPER", "张三", "13800138000", "test@example.com",
|
||||
"CN", "广东省", "深圳市", "南山区", "测试路 1 号", "518000", "ACTIVE", "测试备注"}
|
||||
});
|
||||
|
||||
@@ -51,7 +51,7 @@ class PartnerImportServiceTest {
|
||||
verify(repository).insert(captor.capture());
|
||||
assertThat(captor.getValue().getTenantId()).isZero();
|
||||
assertThat(captor.getValue().getDataScopeId()).isZero();
|
||||
assertThat(captor.getValue().getTypes()).containsExactly("CUSTOMER", "SHIPPER");
|
||||
assertThat(captor.getValue().getTypes()).containsExactly("CARRIER", "SHIPPER");
|
||||
assertThat(captor.getValue().getRemark()).isEqualTo("测试备注");
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class PartnerImportServiceTest {
|
||||
@DisplayName("文件内任一错误时整批零写入并返回行号")
|
||||
void shouldRejectWholeBatchWhenAnyRowIsInvalid() throws Exception {
|
||||
byte[] file = withRows(service.template(), new String[][] {
|
||||
{"CUS-100", "测试单位一", "CUSTOMER", "张三", "13800138000", "", "CN", "", "深圳市", "", "测试路 1 号", "", "ACTIVE", ""},
|
||||
{"CAR-100", "测试船公司一", "CARRIER", "张三", "13800138000", "", "CN", "", "深圳市", "", "测试路 1 号", "", "ACTIVE", ""},
|
||||
{"CUS-100", "测试单位二", "UNKNOWN", "李四", "13900139000", "bad-email", "C", "", "", "", "", "", "ENABLED", ""}
|
||||
});
|
||||
|
||||
|
||||
+3
-3
@@ -78,7 +78,7 @@ class PlatformMasterDataManagementServiceTest {
|
||||
assertThat(entity.getValue().getDataScopeId()).isZero();
|
||||
assertThat(entity.getValue().getPartnerCode()).isEqualTo("CUS-001");
|
||||
assertThat(entity.getValue().getPartnerName()).isEqualTo("示例客户");
|
||||
assertThat(entity.getValue().getTypes()).containsExactly("CUSTOMER", "SHIPPER");
|
||||
assertThat(entity.getValue().getTypes()).containsExactly("CARRIER", "SHIPPER");
|
||||
assertThat(entity.getValue().getRemark()).isEqualTo("测试备注");
|
||||
}
|
||||
|
||||
@@ -210,9 +210,9 @@ class PlatformMasterDataManagementServiceTest {
|
||||
}
|
||||
|
||||
private static PartnerSaveRequest partnerRequest() {
|
||||
return new PartnerSaveRequest("CUS-001", "示例客户", "CUSTOMER", "张三", "13800138000",
|
||||
return new PartnerSaveRequest("CUS-001", "示例客户", "CARRIER", "张三", "13800138000",
|
||||
"test@example.com", "CN", "广东省", "深圳市", "南山区", "示例地址", "518000", "ACTIVE",
|
||||
java.util.List.of("CUSTOMER", "SHIPPER"), "测试备注");
|
||||
java.util.List.of("CARRIER", "SHIPPER"), "测试备注");
|
||||
}
|
||||
|
||||
private static ExpressCompanySaveRequest expressRequest() {
|
||||
|
||||
Reference in New Issue
Block a user