优化
This commit is contained in:
@@ -278,7 +278,7 @@ export async function uploadPhotos(context, token) {
|
||||
return photos
|
||||
}
|
||||
|
||||
async function awaitProducerConsumption(context, producers) {
|
||||
export async function awaitProducerConsumption(context, producers) {
|
||||
const expected = [...new Set(producers.map((item) => id(item?.containerNo)).filter(nonBlank))]
|
||||
if (!expected.length) return true
|
||||
const consumed = new Set()
|
||||
@@ -308,7 +308,7 @@ async function awaitProducerConsumption(context, producers) {
|
||||
return expected.every((containerNo) => consumed.has(containerNo))
|
||||
}
|
||||
|
||||
async function convertReceivingContainers(context, producers) {
|
||||
export async function convertReceivingContainers(context, producers) {
|
||||
for (const producer of producers) {
|
||||
const containerNo = id(producer?.containerNo)
|
||||
const summaryResponse = await context.request('GET', `/api/platform/v1/last-leg/orders/container-summaries?page=1&size=20&containerNo=${encodeURIComponent(containerNo)}`, undefined, context.token, {})
|
||||
@@ -646,7 +646,7 @@ async function receiveDropship(context, token, producer, inbounds) {
|
||||
return accepted === expectedPending
|
||||
}
|
||||
|
||||
async function runReceiving(context, token, secondaryToken, merchantToken, preferredProducer = null, runAuthorizationProbes = true) {
|
||||
export async function runReceiving(context, token, secondaryToken, merchantToken, preferredProducer = null, runAuthorizationProbes = true) {
|
||||
if (runAuthorizationProbes && context.token) {
|
||||
const denied = await context.request('GET', '/api/pda/v1/last-leg/receiving-containers/candidates', undefined, context.token, {})
|
||||
context.addStep(MODULE, '平台管理员访问令牌不能冒充仓库PDA操作员', denied, forbidden(denied) && traced(denied), trace(denied), OPTIONS)
|
||||
@@ -970,7 +970,7 @@ export async function run(context) {
|
||||
}
|
||||
}
|
||||
|
||||
async function resolveSharedWarehouse(context) {
|
||||
export async function resolveSharedWarehouse(context) {
|
||||
const path = '/api/platform/v1/warehouse-admin?tenantId=0&page=1&size=200&capabilityCode=RECEIVING&warehouseType=OVERSEAS&status=ACTIVE'
|
||||
const response = await context.request('GET', path)
|
||||
const rows = records(response?.body?.data)
|
||||
|
||||
Reference in New Issue
Block a user