适配PDA稳定柜次身份契约
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
function text(value) {
|
||||
return value == null ? '' : String(value)
|
||||
}
|
||||
|
||||
export function stableTaskIdentity(identity = {}) {
|
||||
return {
|
||||
operatorId: text(identity.operatorId ?? identity.accountId ?? identity.userId),
|
||||
taskId: text(identity.taskId ?? identity.inboundId),
|
||||
loadingPlanId: text(identity.loadingPlanId),
|
||||
containerBookingId: text(identity.containerBookingId)
|
||||
}
|
||||
}
|
||||
|
||||
export function stableTaskIdentityKey(identity = {}) {
|
||||
const value = stableTaskIdentity(identity)
|
||||
if (!value.operatorId || !value.taskId || !value.loadingPlanId) return ''
|
||||
return [value.operatorId, value.taskId, value.loadingPlanId].map(encodeURIComponent).join(':')
|
||||
}
|
||||
|
||||
export function stableTaskOperationIdentity(identity = {}) {
|
||||
const value = stableTaskIdentity(identity)
|
||||
return `${value.operatorId}-${value.taskId}-${value.loadingPlanId}-${value.containerBookingId}`
|
||||
}
|
||||
Reference in New Issue
Block a user