feat: gate overseas receiving and harden phase4 workflows
This commit is contained in:
+7
-1
@@ -1,6 +1,7 @@
|
||||
package com.baiyue.common.event;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.Map;
|
||||
|
||||
/** Actual carrier milestone recorded by Firstleg for overseas receiving readiness. */
|
||||
public record FirstLegContainerShippingNodeRecordedV1(
|
||||
@@ -20,6 +21,11 @@ public record FirstLegContainerShippingNodeRecordedV1(
|
||||
String providerNodeCode,
|
||||
String sourceReference,
|
||||
String rawPayloadHash) {
|
||||
private static final Map<String, Integer> STANDARD_NODES = Map.of(
|
||||
"DEPARTED_WAREHOUSE", 10, "AT_ORIGIN_PORT", 20, "LOADED_ON_VESSEL", 30,
|
||||
"DEPARTED_ORIGIN_PORT", 40, "IN_TRANSIT", 50, "ARRIVED_DESTINATION_PORT", 60,
|
||||
"DISCHARGED_FROM_VESSEL", 70, "PICKUP_READY", 80, "PICKED_UP", 90,
|
||||
"EMPTY_RETURNED", 100);
|
||||
|
||||
public FirstLegContainerShippingNodeRecordedV1 {
|
||||
if (queryId == null || queryId.isBlank() || customerId == null || customerId.isBlank()
|
||||
@@ -28,7 +34,7 @@ public record FirstLegContainerShippingNodeRecordedV1(
|
||||
|| containerNo == null || containerNo.isBlank()) {
|
||||
throw new IllegalArgumentException("船节点交接业务标识不能为空");
|
||||
}
|
||||
if (standardNode == null || standardNode.isBlank() || nodeSequence < 10
|
||||
if (standardNode == null || !Integer.valueOf(nodeSequence).equals(STANDARD_NODES.get(standardNode))
|
||||
|| observedAt == null || actualAt == null) {
|
||||
throw new IllegalArgumentException("船节点交接只接受带实际时间的标准节点事实");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user