From f8081b876f3f372bc7bc7eb67518a51b4580d34e Mon Sep 17 00:00:00 2001 From: liufumingren Date: Mon, 28 Sep 2026 01:32:03 +0800 Subject: [PATCH] =?UTF-8?q?feat(order.wave):=20=E6=96=B0=E5=A2=9E=20order.?= =?UTF-8?q?wave.fetchableOrderCount=20=E5=9B=A2=E8=B4=AD=E5=8F=AF=E6=8A=93?= =?UTF-8?q?=E5=8F=96=E8=AE=A2=E5=8D=95=E6=95=B0=E7=BB=9F=E8=AE=A1=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 与 order.wave.groupOrderFetchList 同口径:同一候选条件(step in [1,2,3]、status!=cancel、 outbound_status!=padding、intercept_status='none'、lock_status='none'、wave_id=0,叠加 store_id/shop_name/stock_query 过滤)+ items_hash 粗分组 + 团购阈值过滤; 仅取 id/items_hash/items/sys_logistics_code 四列做内存计数,不分页、不查订单明细 - 返回 data:group_count / order_count / same_order_quantity / raw_order_count / warehouse_id / distinguish_express;仓库上下文缺失返回 flag=failure/code=400 - 口径提示:order_count 为命中分组的订单数合计(与 groupOrderFetchList 的 pagination.total=分组数语义不同); include_sku 为 groupOrderFetchList 页内过滤参数,本方法不参与统计 - 权限与日志:已加入 wave.js systemInit 的 _noNeedRight / _noNeedLog / _noNeedAuth 名单 (与 groupOrderFetchList 一致),仅需登录;不产生 wms_permission 记录,无需权限同步与迁移 - 文档:methods/system.json 新增 order.wave.fetchableOrderCount(根版本 0.3.194 -> 0.3.195、 updatedAt 2026-09-28),methods/changes/system.json 新增变更记录;AI_METHOD_ROUTING.md 由脚本重新生成 service method 清单 - 测试:test/app/service/systemMethods/order/wave.fetchableOrderCount.test.js(8 用例); 该路径命中仓库 .gitignore 的 test/* 规则,按既有约定未纳入版本管理 --- AI_METHOD_ROUTING.md | 139 +++++++++++------------ app/service/systemMethods/order/wave.js | 141 +++++++++++++++++++++++- methods/changes/system.json | 18 +++ methods/system.json | 107 +++++++++++++++++- 4 files changed, 332 insertions(+), 73 deletions(-) diff --git a/AI_METHOD_ROUTING.md b/AI_METHOD_ROUTING.md index 4cf02d0..540fbe5 100644 --- a/AI_METHOD_ROUTING.md +++ b/AI_METHOD_ROUTING.md @@ -315,13 +315,12 @@ rg "class .*Service|module.exports" app/service/qimenMethods 维护说明: - 扫描范围:app/service/**/*.js - 本节内容由脚本生成,新增/修改 service 后请同步刷新。 -- 刷新命令:node .\script\tmp-gen-service-method-inventory.cjs +- 刷新命令:node .\temp\tmp-gen-service-method-inventory.cjs -> node .\temp\tmp-update-ai-method-routing.cjs - 临时清单输出:temp/tmp-service-method-inventory.md +- 扫描器注意:括号计数前会先遮蔽字符串/模板/注释/正则内容(maskLiteralsAndComments);若移除该遮蔽,字符串里的未配对花括号(如 startsWith('{'))会让其后方法被整体漏扫。 -自动生成时间: 2026-09-24T13:58:51.474Z -(2026-09-25 手动补录:systemMethods/index.js 新增 uploadClientErrorLog、新增 systems/client_error_log.js;生成脚本 tmp-gen-service-method-inventory.cjs 不在仓库,待补齐脚本后重扫) -(2026-09-27 手动下线:删除 systems/system_log.js(findCleanupBoundaryId / deleteSystemLogsBatch / cleanupExpiredSystemLogs)—— wms_system_log 表已随迁移 20260927090000-offline-wms-system-log.js 整表下线,文件数 220 -> 219) +自动生成时间: 2026-09-27T17:16:56.519Z 扫描范围: app/service/**/*.js 文件数: 219 @@ -349,7 +348,7 @@ rg "class .*Service|module.exports" app/service/qimenMethods - app/service/inbox/message.js (10) - list, _normalizeIds, _normalizeStrings, detail, thread, stats, retry, _repush, retryFailed, retryFailedByWarehouse - app/service/inbox/processor.js (17) - - _loadGroupInfo, isStaleMessage, process, handleApiMessage, tryBindGroup, writeOutboundReply, isWarehouseGroup, isBlocked, loadBlockedUserIds, invalidateBlockCache, getApiAppCallbackConfig, getApiAppCallbackUrl, pushSystemNotification, extractWarehouseId, extractStoreId, getWarehouseIdFromContext, getStoreIdFromContext + - _loadGroupInfo, isStaleMessage, process, handleApiMessage, tryBindGroup, writeOutboundReply, isWarehouseGroup, loadBlockedUserIds, isBlocked, invalidateBlockCache, getApiAppCallbackConfig, getApiAppCallbackUrl, pushSystemNotification, extractWarehouseId, extractStoreId, getWarehouseIdFromContext, getStoreIdFromContext - app/service/inbox/receiver.js (1) - receive - app/service/inbox/rules.js (3) @@ -360,16 +359,16 @@ rg "class .*Service|module.exports" app/service/qimenMethods - load, invalidate, build - app/service/inbox/v2/functionSync.js (1) - sync -- app/service/inbox/v2/rules.js (9) - - handle, _matchKeywords, _groupAllowed, _extractNumbers, join, _buildParams, _noNumberHint, _buildOutcome, _renderReply +- app/service/inbox/v2/rules.js (8) + - handle, _matchKeywords, _groupAllowed, _extractNumbers, _buildParams, _noNumberHint, _buildOutcome, _renderReply - app/service/main.js (18) - success, fail, normalizeDate, setInfo, getInfo, isPlainObject, normalizeWhereCondition, normalizeWhereParams, extractWhereValues, prepareWhereContext, findQimenAppWithContract, queryFromDatabase, checkAuth, checkApiPermission, extractApiPermissionState, collectApiPermissionValue, setUserContext, systemInit -- app/service/openapi/callback.js (6) - - md5, signCallback, sendWithRetry, sendByAppKey, _formatResponsePayload, logCallback +- app/service/openapi/callback.js (5) + - signCallback, sendWithRetry, sendByAppKey, _formatResponsePayload, logCallback - app/service/openapi/callbackRegistry.js (0) - -- app/service/openapiEntry.js (9) - - resolveOpenapiMethod, getOpenapiMethodService, resolveOpenapiContract, getInfo, dispatchOpenapiMethod, validateOpenapiParams, parseJsonBody, normalizeSignFields, processRequest +- app/service/openapiEntry.js (8) + - resolveOpenapiMethod, getOpenapiMethodService, resolveOpenapiContract, dispatchOpenapiMethod, validateOpenapiParams, parseJsonBody, normalizeSignFields, processRequest - app/service/openapiMethods/callback.js (2) - resolveAppInfo, test - app/service/openapiMethods/deliveryorder.js (2) @@ -426,10 +425,10 @@ rg "class .*Service|module.exports" app/service/qimenMethods - storeStats, storeSideStoreStats, queryWarehouseStats, mergeStoreStats, emptyStoreStats, warehouseStats, hot_order_rank, storeSideHotOrderRank, queryWarehouseHotOrderRank, queryHotOrderRankWindowRows, buildHotOrderRankMap, buildHotOrderRankKeyFilter, mergeHotOrderRank, loadHotOrderRankStockInfo, resolveHotOrderRankProduct, maskHotOrderRankName, formatHotOrderRank, emptyHotOrderRank, express_ratio, storeSideExpressRatio, queryWarehouseExpressRatio, mergeChartData, formatChartData, emptyChartData, platform_distribution, storeSidePlatformDistribution, queryWarehousePlatformDistribution, order_trend - app/service/systemMethods/frontConfig.js (9) - getFrontConfigService, getByDomain, getInfo, getCert, saveInfo, saveCert, setDomain, getDomain, checkDomain -- app/service/systemMethods/inbox.js (14) - - group, message, v2, after_sales, bindCode, groupList, groupQuickList, groupMembers, groupDisable, groupUpdate, groupReset, groupMessages, retry, reply -- app/service/systemMethods/index.js (60) - - fastWhereTree, loadStores, loadWarehouses, loadExpressInterfaces, getCOSUploadConfig, getImages, uploadSuccessNotify, recognizeLicensePlate, ReferenceFile, getMessageDetail, test, getI18nMessage, putI18nCollect, extractModule, tryAutoTranslateNewKeys, searchSpace, searchSpaces, listInterfaceTypes, getLocationTypeList, getQimenAppList, getExpressList, getExpressProductTypeList, getPlatformList, getPrintPlatformList, ensureShopPrintPlatformExists, buildShopPrintPlatformInclude, getShopList, requestPddWaybillSearch, requestPddStdTemplates, requestTbWaybillSearch, requestTbCainiaoStdTemplates, requestPolyStdTemplates, getShopExpressList, getCainiaoStfTemplates, normalizeTemplatePlatformCode, normalizeTemplateExpressCode, getExpressPlatformFieldName, getTemplateAllowedExpressCodeSet, filterPrintPlatformTemplateResponseData, getPrintPlatformTemplateCacheKey, requestPrintPlatformTemplateList, resolvePddTemplateWpCodeCandidates, requestPddTemplateSourceList, getPrintPlatformTemplateList, isPlatformOauthReservationDuplicateError, getPlatformOauthReservationCodePrefix, hasPlatformOauthReservationCodePrefix, normalizePlatformOauthReservationCode, generatePlatformOauthReservationCode, createPlatformOauthReservation, getPlatformOauthLink, listenPlatformOauthBind, loginToIm, polyapiAuthorizeUrl, toOrder, getWorkbenchBindCode, LoginWorkbenchByCode, queryUserByToken, parseWechatBadgeCode, uploadClientErrorLog +- app/service/systemMethods/inbox.js (13) + - group, message, v2, bindCode, groupList, groupQuickList, groupMembers, groupDisable, groupUpdate, groupReset, groupMessages, retry, reply +- app/service/systemMethods/index.js (61) + - fastWhereTree, loadStores, loadWarehouses, loadExpressInterfaces, getCOSUploadConfig, getImages, uploadSuccessNotify, recognizeLicensePlate, ReferenceFile, getMessageDetail, test, getI18nMessage, putI18nCollect, extractModule, tryAutoTranslateNewKeys, searchSpace, searchSpaces, listInterfaceTypes, getLocationTypeList, getQimenAppList, getExpressList, getExpressProductTypeList, getPlatformList, getPrintPlatformList, ensureShopPrintPlatformExists, buildShopPrintPlatformInclude, getShopList, requestPddWaybillSearch, requestPddStdTemplates, requestTbWaybillSearch, requestTbCainiaoStdTemplates, requestPolyStdTemplates, getShopExpressList, getCainiaoStfTemplates, normalizeTemplatePlatformCode, normalizeTemplateExpressCode, getExpressPlatformFieldName, getTemplateAllowedExpressCodeSet, filterPrintPlatformTemplateResponseData, getPrintPlatformTemplateCacheKey, requestPrintPlatformTemplateList, resolvePddTemplateWpCodeCandidates, requestPddTemplateSourceList, getPrintPlatformTemplateList, isPlatformOauthReservationDuplicateError, getPlatformOauthReservationCodePrefix, hasPlatformOauthReservationCodePrefix, normalizePlatformOauthReservationCode, generatePlatformOauthReservationCode, createPlatformOauthReservation, getPlatformOauthLink, listenPlatformOauthBind, loginToIm, polyapiAuthorizeUrl, toOrder, getWorkbenchBindCode, LoginWorkbenchByCode, queryUserByToken, parseWechatBadgeCode, queryUserByWechatBadge, uploadClientErrorLog - app/service/systemMethods/order/archiveOrder.js (2) - list, detail - app/service/systemMethods/order/base.js (56) @@ -448,26 +447,26 @@ rg "class .*Service|module.exports" app/service/qimenMethods - list, manualOutboundOrder - app/service/systemMethods/order/packing.js (11) - list, get, setEndTime, forceRecord, export, exportTaskProgress, generateExportTaskId, normalizeExportTaskId, getExportTaskCacheKey, setExportTaskProgress, getExportTaskProgress -- app/service/systemMethods/order/pendingOrder.js (90) - - list, detail, reverseReviewOrder, assertOrdersWithoutWaybill, syncWavesAfterReverseReview, allocateStorage, allocateStorageProgress, normalizeAllocateStorageTaskProgress, normalizeAllocateStorageTaskCount, normalizeAllocateStorageTaskCounts, normalizeAllocateStorageRequestId, getAllocateStorageTaskCacheKey, setAllocateStorageTaskProgress, getAllocateStorageTaskProgress, getAllocateExpressTaskCacheKey, normalizeAllocateExpressTaskId, setAllocateExpressTaskProgress, getAllocateExpressTaskProgress, getSyncOrderIdsTaskCacheKey, normalizeSyncOrderIdsRequestId, setSyncOrderIdsTaskProgress, getSyncOrderIdsTaskProgress, cancelAllocateStorage, syncOrderIds, syncOrderIdsProgress, allocateExpressCode, allocateExpressCodeTaskProgress, markPendingOutboundOrder, cancelOrder, normalizePendingOutboundOrderIds, normalizePendingCancelOrderIds, isCancelablePendingOrder, updateOrderPlatform, updateOrderExpress, updateAddress, updateRemark, cloneOrder, parseAddress, parseAddressLocal, createOrder, downloadCreateTemplate, normalizeIdsInput, batchIntercept, batchInterceptTaskProgress, generateBatchInterceptTaskId, normalizeBatchInterceptTaskId, normalizeBatchInterceptOrderIds, getBatchInterceptTaskCacheKey, setBatchInterceptTaskProgress, getBatchInterceptTaskProgress, runBatchInterceptTask, batchLock, batchLockTaskProgress, generateBatchLockTaskId, normalizeBatchLockTaskId, normalizeBatchLockOrderIds, getBatchLockTaskCacheKey, setBatchLockTaskProgress, getBatchLockTaskProgress, runBatchLockTask, batchUnlock, batchUnlockTaskProgress, generateBatchUnlockTaskId, normalizeBatchUnlockTaskId, normalizeBatchUnlockOrderIds, getBatchUnlockTaskCacheKey, setBatchUnlockTaskProgress, getBatchUnlockTaskProgress, runBatchUnlockTask, batchUnintercept, batchUninterceptTaskProgress, generateBatchUninterceptTaskId, normalizeBatchUninterceptTaskId, normalizeBatchUninterceptOrderIds, getBatchUninterceptTaskCacheKey, setBatchUninterceptTaskProgress, getBatchUninterceptTaskProgress, runBatchUninterceptTask, manualWaybill, releaseCreationLockForCancel, UNIQUE, allocateSubOrderNumber, writeAllocateSubOrderErrorFlag, writeAllocateSubOrderLog, allocateSubOrderNumberProgress, getAllocateSubOrderTaskCacheKey, setAllocateSubOrderTaskProgress, getAllocateSubOrderTaskProgress, buildSubOrderDetails, batchMarkPrinted +- app/service/systemMethods/order/pendingOrder.js (89) + - list, detail, reverseReviewOrder, assertOrdersWithoutWaybill, syncWavesAfterReverseReview, allocateStorage, allocateStorageProgress, normalizeAllocateStorageTaskProgress, normalizeAllocateStorageTaskCount, normalizeAllocateStorageTaskCounts, normalizeAllocateStorageRequestId, getAllocateStorageTaskCacheKey, setAllocateStorageTaskProgress, getAllocateStorageTaskProgress, getAllocateExpressTaskCacheKey, normalizeAllocateExpressTaskId, setAllocateExpressTaskProgress, getAllocateExpressTaskProgress, getSyncOrderIdsTaskCacheKey, normalizeSyncOrderIdsRequestId, setSyncOrderIdsTaskProgress, getSyncOrderIdsTaskProgress, cancelAllocateStorage, syncOrderIds, syncOrderIdsProgress, allocateExpressCode, allocateExpressCodeTaskProgress, markPendingOutboundOrder, cancelOrder, normalizePendingOutboundOrderIds, normalizePendingCancelOrderIds, isCancelablePendingOrder, updateOrderPlatform, updateOrderExpress, updateAddress, updateRemark, cloneOrder, parseAddress, parseAddressLocal, createOrder, downloadCreateTemplate, normalizeIdsInput, batchIntercept, batchInterceptTaskProgress, generateBatchInterceptTaskId, normalizeBatchInterceptTaskId, normalizeBatchInterceptOrderIds, getBatchInterceptTaskCacheKey, setBatchInterceptTaskProgress, getBatchInterceptTaskProgress, runBatchInterceptTask, batchLock, batchLockTaskProgress, generateBatchLockTaskId, normalizeBatchLockTaskId, normalizeBatchLockOrderIds, getBatchLockTaskCacheKey, setBatchLockTaskProgress, getBatchLockTaskProgress, runBatchLockTask, batchUnlock, batchUnlockTaskProgress, generateBatchUnlockTaskId, normalizeBatchUnlockTaskId, normalizeBatchUnlockOrderIds, getBatchUnlockTaskCacheKey, setBatchUnlockTaskProgress, getBatchUnlockTaskProgress, runBatchUnlockTask, batchUnintercept, batchUninterceptTaskProgress, generateBatchUninterceptTaskId, normalizeBatchUninterceptTaskId, normalizeBatchUninterceptOrderIds, getBatchUninterceptTaskCacheKey, setBatchUninterceptTaskProgress, getBatchUninterceptTaskProgress, runBatchUninterceptTask, manualWaybill, releaseCreationLockForCancel, allocateSubOrderNumber, writeAllocateSubOrderErrorFlag, writeAllocateSubOrderLog, allocateSubOrderNumberProgress, getAllocateSubOrderTaskCacheKey, setAllocateSubOrderTaskProgress, getAllocateSubOrderTaskProgress, buildSubOrderDetails, batchMarkPrinted - app/service/systemMethods/order/print.js (4) - getWavePlatformPrintData, getOrderPrintData, getPrintDataByWaybillCodes, unlockWavePlatformPrintDataByGroup -- app/service/systemMethods/order/recheckOrder.js (60) - - scanOrder, NOW, markWaveRecheckStart, scanTask, buildSingleWaveScanView, buildSingleWaveView, buildGroupWaveList, getPickModeByWaveId, getTaskIdByWaveId, getWaveOrdersBasic, batchQueryPackageMaterialRecommendation, enrichOrdersWithStock, getPickerInfoByWaveId, getPickerInfoByTaskId, getWaveStrategyInfo, scanWaybill, confirmRecheck, confirmRecheckByWaveId, _writeRecheckActionLog, updateTaskOrderReviewAndTryUnbindCart, _resolveTaskIdByWaveFallback, _checkTaskOrdersAllReviewed, updateTaskOrdersReviewBatch, unbindCartForTask, resolveOrderId, resolveScanKeyword, pickOrderMatchByKeyword, pickOrderIdByWaybill, pickOrderIdByCartCode, pickWaveMatchContextByWaveNo, pickCartMatchContextByCartCode, getTableColumnSet, resolvePickModeName, buildWaveMatchView, buildCartMatchView, flattenCartMatchOrders, enrichTaskOrderRows, groupTaskOrdersByWaveId, groupTaskOrdersByPickStatus, groupTaskOrdersByBoxNo, groupTaskOrders, buildRecheckReviewNo, assertOrderCanRecheck, recheckOrderList, queryRecheckOrderSingleList, queryRecheckOrderGroupList, resolveModelTableName, confirmIntercept, interceptScan, batchQuickRecheck, normalizeWaveIds, batchQuickRecheckByWave, _completePickForOrder, _markRecheckForOrder, _tryCompleteWaveIfAllOrdersRechecked, _tryCompleteWaveInTransaction, removeUnprintedInterceptedOrdersFromWave, _updateTaskOrderReviewInTransaction, _unbindCartForTaskInTransaction, _writeRecheckActionLogInTransaction +- app/service/systemMethods/order/recheckOrder.js (59) + - scanOrder, markWaveRecheckStart, scanTask, buildSingleWaveScanView, buildSingleWaveView, buildGroupWaveList, getPickModeByWaveId, getTaskIdByWaveId, getWaveOrdersBasic, batchQueryPackageMaterialRecommendation, enrichOrdersWithStock, getPickerInfoByWaveId, getPickerInfoByTaskId, getWaveStrategyInfo, scanWaybill, confirmRecheck, confirmRecheckByWaveId, _writeRecheckActionLog, updateTaskOrderReviewAndTryUnbindCart, _resolveTaskIdByWaveFallback, _checkTaskOrdersAllReviewed, updateTaskOrdersReviewBatch, unbindCartForTask, resolveOrderId, resolveScanKeyword, pickOrderMatchByKeyword, pickOrderIdByWaybill, pickOrderIdByCartCode, pickWaveMatchContextByWaveNo, pickCartMatchContextByCartCode, getTableColumnSet, resolvePickModeName, buildWaveMatchView, buildCartMatchView, flattenCartMatchOrders, enrichTaskOrderRows, groupTaskOrdersByWaveId, groupTaskOrdersByPickStatus, groupTaskOrdersByBoxNo, groupTaskOrders, buildRecheckReviewNo, assertOrderCanRecheck, recheckOrderList, queryRecheckOrderSingleList, queryRecheckOrderGroupList, resolveModelTableName, confirmIntercept, interceptScan, batchQuickRecheck, normalizeWaveIds, batchQuickRecheckByWave, _completePickForOrder, _markRecheckForOrder, _tryCompleteWaveIfAllOrdersRechecked, _tryCompleteWaveInTransaction, removeUnprintedInterceptedOrdersFromWave, _updateTaskOrderReviewInTransaction, _unbindCartForTaskInTransaction, _writeRecheckActionLogInTransaction - app/service/systemMethods/order/reviewOrder.js (2) - list, reviewOrder - app/service/systemMethods/order/storageAllocation.js (0) - -- app/service/systemMethods/order/wave.js (245) - - buildBatchAllocateExpressTraceId, buildOrderOperationLogRows, batchCreateOrderOperationLogs, buildMachineStructureToken, parseMachineStructureToken, getOrderItemPart, getDefaultWaveQuantity, getMinGroupOrderFetchQuantity, getGroupWavePrefix, getSingleFetchByIdsWavePrefix, getWarehouseSubjectConfig, getWarehouseSubjectConfigValue, normalizeFetchStructureRequests, generateWaveId, getCurrentDatePart, VALUES, getNextWaveNoSequence, buildWaveNo, id, getWaveCreator, extractInsertId, extractLastInsertId, isDuplicateEntryError, resolveWaveScopeByWaveMeta, createWaveBatchReady, buildFetchWhere, fetchSingleStructure, normalizeBoolean, normalizePositiveInteger, normalizeRequiredPositiveInteger, normalizeIdsInput, normalizePagination, normalizeWaveStatusList, normalizeBatchListStorageAssignmentStatusFilter, normalizeBatchListExpressAssignmentStatusFilter, normalizeBatchListPrintAssignmentStatusFilter, normalizeBatchListConfirmPrintAssignmentStatusFilter, normalizeBatchListClaimAssignmentStatusFilter, normalizeBatchListReviewAssignmentStatusFilter, normalizeBatchListSyncAssignmentStatusFilter, getBatchListAssignmentFilterSchema, normalizeBatchListAssignmentStatusFilterByType, normalizeBatchListAssignmentStatusFilter, getModelTableSqlName, buildBatchListStorageAssignmentFilterClause, buildBatchListExpressAssignmentFilterClause, buildBatchListPrintAssignmentFilterClause, buildBatchListConfirmPrintAssignmentFilterClause, buildBatchListClaimAssignmentFilterClause, buildBatchListReviewAssignmentFilterClause, buildBatchListSyncAssignmentFilterClause, buildBatchListAssignmentStatusFilterClauseByType, buildBatchListAssignmentStatusFilterClause, isEmptyBatchListWhereValue, resolveBatchListFieldCondition, buildBatchListFieldConditionSql, normalizeBatchListDistinguishExpressValue, normalizeBatchListStoreIdCondition, buildBatchListWhereClause, normalizeWavePickTaskListPagination, normalizeWavePickTaskListRequest, buildWavePickTaskListWhereClause, resolveAssignmentStatus, normalizeSkuText, normalizeShopName, parseItemSnapshot, normalizeOrderItemRow, mergeOrderItemDetails, buildItemSummary, buildOrderItemSnapshot, buildItemSnapshotKey, orderMatchesIncludeSku, buildCoarseGroupKey, buildStatusSummary, buildGroupKey, groupOrderFetchList, singleOrderFetchList, waveStrategyList, getWaveStrategyNextFetchOrderCountMap, getWaveStrategyDebugFetchOrderListMap, previewWaveStrategyNextFetchOrderCount, getWaveStrategyMatchedOrderCountFilteredMap, getWaveStrategyMatchedOrderCountTotal, waveStrategyCreate, waveStrategyUpdate, bumpWaveStrategyVersionAndInvalidateCache, getWaveStrategyModel, normalizeWaveStrategyId, normalizeWaveStrategyUpsertPayload, normalizeWaveStrategyWavePrefix, resolveWaveStrategyFetchWavePrefix, patchWaveStrategyIntegerField, validateWaveStrategyAllowedOwners, validateWaveStrategyAllowedExpresses, getWaveStrategyAvailableOwnerSet, getWaveStrategyAvailableExpressSet, applyWaveStrategyMaxSameStructureConstraint, normalizeWaveStrategyFallbackOrderListWhere, resolveWaveStrategyFallbackTrackingNo, resolveWaveStrategyFallbackStoreName, resolveWaveStrategyFallbackSysLogisticsName, buildWaveStrategyFallbackOrderListItem, waveStrategyFallbackOrderList, resolveWaveBatchOwnerStoreNameMap, batchList, getConfirmPrintUnclaimedVersionKey, bumpConfirmPrintUnclaimedWaveVersion, getConfirmPrintUnclaimedWaveVersion, queryConfirmPrintUnclaimedWaveCount, confirmPrintScan, confirmPrintUnclaimedWaveCount, wavePickTaskList, batchCancel, batchCancelTaskProgress, batchAllocateExpress, batchAllocateExpressTaskProgress, batchAllocateStorage, batchAllocateStorageTaskProgress, submitWaveStrategyQuickScanForWarehouse, waveStrategyQuickScan, waveStrategyQuickScanTaskProgress, buildWaveStrategyQuickScanOrderWhere, getWaveStrategyQuickScanStrategyRows, getWaveStrategyQuickScanMatchModel, syncWaveStrategyQuickScanMatchedStrategies, cleanupWaveStrategyQuickScanMatchedStrategies, cleanupWaveStrategyQuickScanMatchedStrategiesByOrderIds, enqueueWaveStrategyQuickScanPostOrderChange, executeWaveStrategyQuickScan, runWaveStrategyQuickScanTask, batchUpdateWaveStrategyQuickScanOrders, generateWaveStrategyQuickScanTaskId, normalizeWaveStrategyQuickScanTaskId, getWaveStrategyQuickScanTaskCacheKey, setWaveStrategyQuickScanTaskProgress, getWaveStrategyQuickScanTaskProgress, getWaveStrategyQuickScanWarehouseLockCacheKey, setWaveStrategyQuickScanWarehouseLock, getWaveStrategyQuickScanWarehouseLock, clearWaveStrategyQuickScanWarehouseLock, normalizeWaveStrategyQuickScanVersion, normalizeWaveStrategyQuickScanList, normalizeWaveStrategyQuickScanNumberOrNull, normalizeWaveStrategyQuickScanBoolean, normalizeWaveStrategyQuickScanStringList, getWaveStrategyQuickScanStructureKey, getWaveStrategyQuickScanExpressKey, filterCandidateOrdersByRequireSameExpress, isWaveStrategyQuickScanOrderMatched, getWaveStrategyQuickScanMatchedStrategyIds, isWaveStrategyQuickScanOrderMatchedSingleStrategy, isWaveStrategyQuickScanValueInRange, resolveGroupCandidateOrderIdsForSingleFetch, singleFetchByIds, batchRemoveOrders, resortWaveIndex, batchRemoveExceptionOrders, batchRemoveExceptionOrdersTaskProgress, generateBatchCancelTaskId, normalizeBatchCancelTaskId, generateBatchRemoveExceptionOrdersTaskId, normalizeBatchRemoveExceptionOrdersTaskId, normalizeBatchRemoveExceptionOrdersWaveIds, getBatchRemoveExceptionOrdersTaskCacheKey, setBatchRemoveExceptionOrdersTaskProgress, getBatchRemoveExceptionOrdersTaskProgress, isExceptionRemovableOrder, runBatchRemoveExceptionOrdersTask, normalizeBatchCancelWaveIds, getBatchCancelTaskCacheKey, setBatchCancelTaskProgress, getBatchCancelTaskProgress, runBatchCancelTask, generateBatchAllocateExpressTaskId, normalizeBatchAllocateExpressTaskId, normalizeBatchAllocateExpressWaveIds, getBatchAllocateExpressTaskCacheKey, setBatchAllocateExpressTaskProgress, getBatchAllocateExpressTaskProgress, generateBatchAllocateStorageTaskId, normalizeBatchAllocateStorageTaskId, normalizeBatchAllocateStorageWaveIds, normalizeBatchAllocateStorageTaskCount, buildBatchAllocateStorageRunningProgressPayload, normalizeBatchAllocateStorageOrderIds, getBatchAllocateStorageTaskCacheKey, getBatchAllocateStorageWarehouseLockKey, tryAcquireBatchAllocateStorageWarehouseLock, releaseBatchAllocateStorageWarehouseLock, setBatchAllocateStorageTaskProgress, getBatchAllocateStorageTaskProgress, isMissingBusinessKeyColumnError, runBatchAllocateExpressTask, runBatchAllocateStorageTask, batchAutoGrouping, batchFinishAutoGrouping, generateFetchTaskId, normalizeFetchTaskId, getFetchTaskCacheKey, setFetchTaskProgress, getFetchTaskProgress, fetchTaskProgress, runFetchTask, submitFetchTask, groupFetch, singleFetch, resolveWaveStrategyFetchPickMode, buildWaveStrategyFetchBoxAssignments, prepareWaveStrategyFetchPlan, in, ensureNoActiveWavePickTaskForOperator, normalizeWaveStrategyFetchCreatedBefore, buildWaveStrategyFetchTodayStart, getWaveStrategyFetchCandidateOrders, groupWaveStrategyFetchCandidateOrdersByStructure, buildWaveStrategyFetchOrderSkuMap, selectWaveStrategyFetchOrdersBySkuLimit, createWaveBatchByOrderIdsInTransaction, mergeWaveStrategyFirstPoolSameStructureOrders, autoPopulateWaveStrategyFetchSelections, executeWaveStrategyDirectFetch, createWavePickTaskFromPlan, buildTaskCreatePayload, buildTaskWaveRows, buildTaskOrderRows, buildTaskSkuRows, buildTaskBoxRows, bindPickCartForTask, initTaskCheckpointAndLogs, ensurePickCartAvailable, generateWavePickTaskNo, createWavePickTaskWithRetry, isTaskNoDuplicateError, bulkInsertRows, parseWaveStrategyExistingTaskInfo, waveStrategyFetchPda, cancelWavePickTasksInternal, wavePickTaskCancel, wavePickTaskCancelSelf, waveStrategyFetchAdmin, deleteOrderWaveIndexByOrderIds, deleteOrderWaveIndexByWaveIds, rebuildOrderWaveIndex, replaceOrderWaveIndexByWaveIds, fetch +- app/service/systemMethods/order/wave.js (243) + - buildBatchAllocateExpressTraceId, buildOrderOperationLogRows, batchCreateOrderOperationLogs, buildMachineStructureToken, parseMachineStructureToken, getOrderItemPart, getDefaultWaveQuantity, getMinGroupOrderFetchQuantity, getGroupWavePrefix, getSingleFetchByIdsWavePrefix, getWarehouseSubjectConfig, getWarehouseSubjectConfigValue, normalizeFetchStructureRequests, generateWaveId, getCurrentDatePart, getNextWaveNoSequence, buildWaveNo, getWaveCreator, extractInsertId, extractLastInsertId, isDuplicateEntryError, resolveWaveScopeByWaveMeta, createWaveBatchReady, buildFetchWhere, fetchSingleStructure, normalizeBoolean, normalizePositiveInteger, normalizeRequiredPositiveInteger, normalizeIdsInput, normalizePagination, normalizeWaveStatusList, normalizeBatchListStorageAssignmentStatusFilter, normalizeBatchListExpressAssignmentStatusFilter, normalizeBatchListPrintAssignmentStatusFilter, normalizeBatchListConfirmPrintAssignmentStatusFilter, normalizeBatchListClaimAssignmentStatusFilter, normalizeBatchListReviewAssignmentStatusFilter, normalizeBatchListSyncAssignmentStatusFilter, getBatchListAssignmentFilterSchema, normalizeBatchListAssignmentStatusFilterByType, normalizeBatchListAssignmentStatusFilter, getModelTableSqlName, buildBatchListStorageAssignmentFilterClause, buildBatchListExpressAssignmentFilterClause, buildBatchListPrintAssignmentFilterClause, buildBatchListConfirmPrintAssignmentFilterClause, buildBatchListClaimAssignmentFilterClause, buildBatchListReviewAssignmentFilterClause, buildBatchListSyncAssignmentFilterClause, buildBatchListAssignmentStatusFilterClauseByType, buildBatchListAssignmentStatusFilterClause, isEmptyBatchListWhereValue, resolveBatchListFieldCondition, buildBatchListFieldConditionSql, normalizeBatchListDistinguishExpressValue, normalizeBatchListStoreIdCondition, buildBatchListWhereClause, normalizeWavePickTaskListPagination, normalizeWavePickTaskListRequest, buildWavePickTaskListWhereClause, resolveAssignmentStatus, normalizeSkuText, normalizeShopName, parseItemSnapshot, normalizeOrderItemRow, mergeOrderItemDetails, buildItemSummary, buildOrderItemSnapshot, buildItemSnapshotKey, orderMatchesIncludeSku, buildCoarseGroupKey, buildStatusSummary, buildGroupKey, groupOrderFetchList, singleOrderFetchList, fetchableOrderCount, waveStrategyList, getWaveStrategyNextFetchOrderCountMap, getWaveStrategyDebugFetchOrderListMap, previewWaveStrategyNextFetchOrderCount, getWaveStrategyMatchedOrderCountFilteredMap, getWaveStrategyMatchedOrderCountTotal, waveStrategyCreate, waveStrategyUpdate, bumpWaveStrategyVersionAndInvalidateCache, getWaveStrategyModel, normalizeWaveStrategyId, normalizeWaveStrategyUpsertPayload, normalizeWaveStrategyWavePrefix, resolveWaveStrategyFetchWavePrefix, patchWaveStrategyIntegerField, validateWaveStrategyAllowedOwners, validateWaveStrategyAllowedExpresses, getWaveStrategyAvailableOwnerSet, getWaveStrategyAvailableExpressSet, applyWaveStrategyMaxSameStructureConstraint, normalizeWaveStrategyFallbackOrderListWhere, resolveWaveStrategyFallbackTrackingNo, resolveWaveStrategyFallbackStoreName, resolveWaveStrategyFallbackSysLogisticsName, buildWaveStrategyFallbackOrderListItem, waveStrategyFallbackOrderList, resolveWaveBatchOwnerStoreNameMap, batchList, getConfirmPrintUnclaimedVersionKey, bumpConfirmPrintUnclaimedWaveVersion, getConfirmPrintUnclaimedWaveVersion, queryConfirmPrintUnclaimedWaveCount, confirmPrintScan, confirmPrintUnclaimedWaveCount, wavePickTaskList, batchCancel, batchCancelTaskProgress, batchAllocateExpress, batchAllocateExpressTaskProgress, batchAllocateStorage, batchAllocateStorageTaskProgress, submitWaveStrategyQuickScanForWarehouse, waveStrategyQuickScan, waveStrategyQuickScanTaskProgress, buildWaveStrategyQuickScanOrderWhere, getWaveStrategyQuickScanStrategyRows, getWaveStrategyQuickScanMatchModel, syncWaveStrategyQuickScanMatchedStrategies, cleanupWaveStrategyQuickScanMatchedStrategies, cleanupWaveStrategyQuickScanMatchedStrategiesByOrderIds, enqueueWaveStrategyQuickScanPostOrderChange, executeWaveStrategyQuickScan, runWaveStrategyQuickScanTask, batchUpdateWaveStrategyQuickScanOrders, generateWaveStrategyQuickScanTaskId, normalizeWaveStrategyQuickScanTaskId, getWaveStrategyQuickScanTaskCacheKey, setWaveStrategyQuickScanTaskProgress, getWaveStrategyQuickScanTaskProgress, getWaveStrategyQuickScanWarehouseLockCacheKey, setWaveStrategyQuickScanWarehouseLock, getWaveStrategyQuickScanWarehouseLock, clearWaveStrategyQuickScanWarehouseLock, normalizeWaveStrategyQuickScanVersion, normalizeWaveStrategyQuickScanList, normalizeWaveStrategyQuickScanNumberOrNull, normalizeWaveStrategyQuickScanBoolean, normalizeWaveStrategyQuickScanStringList, getWaveStrategyQuickScanStructureKey, getWaveStrategyQuickScanExpressKey, filterCandidateOrdersByRequireSameExpress, isWaveStrategyQuickScanOrderMatched, getWaveStrategyQuickScanMatchedStrategyIds, isWaveStrategyQuickScanOrderMatchedSingleStrategy, isWaveStrategyQuickScanValueInRange, resolveGroupCandidateOrderIdsForSingleFetch, singleFetchByIds, batchRemoveOrders, resortWaveIndex, batchRemoveExceptionOrders, batchRemoveExceptionOrdersTaskProgress, generateBatchCancelTaskId, normalizeBatchCancelTaskId, generateBatchRemoveExceptionOrdersTaskId, normalizeBatchRemoveExceptionOrdersTaskId, normalizeBatchRemoveExceptionOrdersWaveIds, getBatchRemoveExceptionOrdersTaskCacheKey, setBatchRemoveExceptionOrdersTaskProgress, getBatchRemoveExceptionOrdersTaskProgress, isExceptionRemovableOrder, runBatchRemoveExceptionOrdersTask, normalizeBatchCancelWaveIds, getBatchCancelTaskCacheKey, setBatchCancelTaskProgress, getBatchCancelTaskProgress, runBatchCancelTask, generateBatchAllocateExpressTaskId, normalizeBatchAllocateExpressTaskId, normalizeBatchAllocateExpressWaveIds, getBatchAllocateExpressTaskCacheKey, setBatchAllocateExpressTaskProgress, getBatchAllocateExpressTaskProgress, generateBatchAllocateStorageTaskId, normalizeBatchAllocateStorageTaskId, normalizeBatchAllocateStorageWaveIds, normalizeBatchAllocateStorageTaskCount, buildBatchAllocateStorageRunningProgressPayload, normalizeBatchAllocateStorageOrderIds, getBatchAllocateStorageTaskCacheKey, getBatchAllocateStorageWarehouseLockKey, tryAcquireBatchAllocateStorageWarehouseLock, releaseBatchAllocateStorageWarehouseLock, setBatchAllocateStorageTaskProgress, getBatchAllocateStorageTaskProgress, isMissingBusinessKeyColumnError, runBatchAllocateExpressTask, runBatchAllocateStorageTask, batchAutoGrouping, batchFinishAutoGrouping, generateFetchTaskId, normalizeFetchTaskId, getFetchTaskCacheKey, setFetchTaskProgress, getFetchTaskProgress, fetchTaskProgress, runFetchTask, submitFetchTask, groupFetch, singleFetch, resolveWaveStrategyFetchPickMode, buildWaveStrategyFetchBoxAssignments, prepareWaveStrategyFetchPlan, ensureNoActiveWavePickTaskForOperator, normalizeWaveStrategyFetchCreatedBefore, buildWaveStrategyFetchTodayStart, getWaveStrategyFetchCandidateOrders, groupWaveStrategyFetchCandidateOrdersByStructure, buildWaveStrategyFetchOrderSkuMap, selectWaveStrategyFetchOrdersBySkuLimit, createWaveBatchByOrderIdsInTransaction, mergeWaveStrategyFirstPoolSameStructureOrders, autoPopulateWaveStrategyFetchSelections, executeWaveStrategyDirectFetch, createWavePickTaskFromPlan, buildTaskCreatePayload, buildTaskWaveRows, buildTaskOrderRows, buildTaskSkuRows, buildTaskBoxRows, bindPickCartForTask, initTaskCheckpointAndLogs, ensurePickCartAvailable, generateWavePickTaskNo, createWavePickTaskWithRetry, isTaskNoDuplicateError, bulkInsertRows, parseWaveStrategyExistingTaskInfo, waveStrategyFetchPda, cancelWavePickTasksInternal, wavePickTaskCancel, wavePickTaskCancelSelf, waveStrategyFetchAdmin, deleteOrderWaveIndexByOrderIds, deleteOrderWaveIndexByWaveIds, rebuildOrderWaveIndex, replaceOrderWaveIndexByWaveIds, fetch - app/service/systemMethods/outbound.js (1) - autoOutbound - app/service/systemMethods/pick.js (14) - normalizeBoolean, getOrderModelByWarehouse, generatePickTaskNo, createWavePickTask, resolveLocationSortedOrderIds, query, wavePickTaskDetail, wavePickTaskCurrent, wavePickTaskSubmit, wavePickComplete, wavePickTaskComplete, getWavePickModeByWaveId, getWaveClaimGateStats, waveClaimScan - app/service/systemMethods/pickCart.js (9) - scan, bindTaskCart, create, update, delete, batchDelete, detail, list, codeDuplicateCheck -- app/service/systemMethods/print.js (28) - - buildPrintSendInputSummary, summarizeExpressPayload, extractExpressTaskCodeFromPayload, buildPrintTaskCodeForRecord, buildPendingPrintRecordPayload, buildSentPrintRecordUpdatePayload, buildSendFailedPrintRecordUpdatePayload, normalizeOrderIds, collectOrderIdsFromPlatformGroup, collectOrderIdsFromCustomizeData, normalizeExpressPlatformCode, extractOrderIdsFromPrintRecordData, updateOrderPrintStatusByCallback, getPrintTaskCodeRetryConfig, getPrintTaskCodeWritebackRetryConfig, generateAtomicPrintTaskCode, isDuplicateKeyError, calculateBackoffDelayMs, sleep, reserveUniquePrintTaskCode, bindTaskCodeToPrintRecord, bindTaskCodeToPrintRecordWithRetry, send, now, if, update, error, fail +- app/service/systemMethods/print.js (57) + - buildPrintSendInputSummary, summarizeExpressPayload, extractExpressTaskCodeFromPayload, buildPrintTaskCodeForRecord, buildPendingPrintRecordPayload, buildSentPrintRecordUpdatePayload, buildSendFailedPrintRecordUpdatePayload, normalizeOrderIds, collectOrderIdsFromPlatformGroup, collectOrderIdsFromCustomizeData, normalizeExpressPlatformCode, extractOrderIdsFromPrintRecordData, updateOrderPrintStatusByCallback, getPrintTaskCodeRetryConfig, getPrintTaskCodeWritebackRetryConfig, generateAtomicPrintTaskCode, isDuplicateKeyError, calculateBackoffDelayMs, sleep, reserveUniquePrintTaskCode, bindTaskCodeToPrintRecord, bindTaskCodeToPrintRecordWithRetry, send, validateExpressSendInput, loadExpressPrintStation, buildExpressPrintRecordFields, collectExpressPlatformCodes, extractUniqueWaveIds, collectOrderIdsFromWaveGroups, extractOrderIdsFromNotifyLockPayload, buildNotifyLockInputSummary, getPrintOrderOperationOperator, writePrintOrderOperationLogsByOrderIds, notifyLock, notify_lock, resolveBatchOrderIdsByWaveFallback, markWavePrintStatus, confirmWavePrint, lockOrderDeliveryAfterPrintSentSuccess, loadExpressPlatformComponents, validateExpressComponentsOnline, resolveExpressPrinterName, sendExpressWaveGroups, parsePrintCallbackTime, handlePrintCallback, getPrintResult, getPrintRecordItem, getList, getItem, add, hasName, updateItem, del, getComputer, getComputerPrinter, savePrinters, tryUnbindCartAfterPrintComplete - app/service/systemMethods/printComputer.js (5) - list, update, setRecording, cancelRecording, delete - app/service/systemMethods/printer/station.js (1) @@ -578,32 +577,32 @@ rg "class .*Service|module.exports" app/service/qimenMethods - _pick, _toText, _parseClientTime, _normalizeItem, upload - app/service/systems/comboGoods.js (15) - fetchStockInfoMap, buildSimpleNotation, buildNameNotation, validateItems, getTargetStoreIdFromMap, checkCustomCodeUniqueForCreate, checkCustomCodeUniqueForUpdate, list, buildListWhere, create, update, delete, search, searchByIdOrCode, enrichComboList -- app/service/systems/delivery_order.js (56) - - getStoreSubjectConfigCacheKey, normalizeStoreSubjectConfig, getStoreSubjectConfig, findCodeOption, getOptionName, appendOrderOperationLog, getOrderLogOperator, getOrderLogWarehouseId, flushOrderOperationLogs, findPlatformOptionByCode, getPlatformSnapshotCode, getPlatformSnapshotName, resolvePlatformSnapshot, resolveExpressCodeFromSetting, resolveExpressSettingSnapshot, resolveEnableExternalExpressCode, resolveExpressSnapshot, normalizeNeedOmsWaybill, addOrder, buildOrderStats, isRetryableLockError, isPrimaryKeyDuplicate, formatOrderCreateError, resolveOrderStep, generateItemsHash, calculateCRC32, normalizeOrderFromKey, resolveOperatorName, prepareOrderData, addOrderLines, buildOrderItemSnapshot, safeParseFloat, withPatchedCtxUser, buildAsyncProcessContext, buildExpressAllocateRequest, enqueueAutoWaybillAllocation, buildStorageAllocateRequest, getStoreWarehousePolicyConfig, normalizePolicyFlag, resolveCutoffOrderConfig, isPastCutoffTime, Date, isAllocationWindowClosed, buildAutoGroupingStructure, findAutoGroupingWaveId, appendOrderToWave, countCandidateGroupOrders, createGroupingWave, markWaveAutoGrouping, finishAutoGroupingIfNeeded, runAutoGrouping, runAsyncProcessStep, findAutoExpressExcludedRemark, appendAutoExpressSkipLog, appendNeedOmsWaybillWaitLog, asyncProcessOrderCreated +- app/service/systems/delivery_order.js (55) + - getStoreSubjectConfigCacheKey, normalizeStoreSubjectConfig, getStoreSubjectConfig, findCodeOption, getOptionName, appendOrderOperationLog, getOrderLogOperator, getOrderLogWarehouseId, flushOrderOperationLogs, findPlatformOptionByCode, getPlatformSnapshotCode, getPlatformSnapshotName, resolvePlatformSnapshot, resolveExpressCodeFromSetting, resolveExpressSettingSnapshot, resolveEnableExternalExpressCode, resolveExpressSnapshot, normalizeNeedOmsWaybill, addOrder, buildOrderStats, isRetryableLockError, isPrimaryKeyDuplicate, formatOrderCreateError, resolveOrderStep, generateItemsHash, calculateCRC32, normalizeOrderFromKey, resolveOperatorName, prepareOrderData, addOrderLines, buildOrderItemSnapshot, safeParseFloat, withPatchedCtxUser, buildAsyncProcessContext, buildExpressAllocateRequest, enqueueAutoWaybillAllocation, buildStorageAllocateRequest, getStoreWarehousePolicyConfig, normalizePolicyFlag, resolveCutoffOrderConfig, isPastCutoffTime, isAllocationWindowClosed, buildAutoGroupingStructure, findAutoGroupingWaveId, appendOrderToWave, countCandidateGroupOrders, createGroupingWave, markWaveAutoGrouping, finishAutoGroupingIfNeeded, runAutoGrouping, runAsyncProcessStep, findAutoExpressExcludedRemark, appendAutoExpressSkipLog, appendNeedOmsWaybillWaitLog, asyncProcessOrderCreated - app/service/systems/entry_order.js (16) - addOrder, getLineCount, received, success, fail, findByOrderCode, findByStatus, getStatsByWarehouse, updateSyncStatus, updateOrderStatus, calculateReceivedQuantities, batchUpdateReceived, getOrderProgress, tryCreateEntryOrder, addItems, reviewEntry - app/service/systems/excel.js (26) - getContentType, sanitizeSheetName, normalizeHeaders, normalizeColumns, prepareSheetData, hasEmbeddedImages, buildWorksheet, buildWorkbook, buildExcelJsWorkbook, inferImageExtension, resolveImageSource, mergeCellStyle, applyStyledRows, applyTextColumnsToSheetJs, applyTextColumnsToExcelJs, addEmbeddedImages, generateBuffer, writeFile, writeAtomicBufferFile, sanitizeFilename, buildUploadKey, generateAndUpload, sendFile, parseBuffer, parseFile, workbookToJSON -- app/service/systems/express_platform.js (17) - - getOrderLogOperator, buildOrderExpressVerPatch, buildExpressPlatformTraceId, OrderExpress, cleanupFailedWaybillOrders, warnExpressCodeMismatch, buildFailedOrderCleanupList, polyapi, cainiao, parsePlatformPrintData, stringifyPlatformPrintData, buildWaybillOrderMetaMap, buildWaybillSettlementRelationMap, lockAndDeductWaybillSettlement, persistWaybillSuccessUpdates, normalizePddExtData, pdd +- app/service/systems/express_platform.js (16) + - getOrderLogOperator, buildOrderExpressVerPatch, buildExpressPlatformTraceId, cleanupFailedWaybillOrders, warnExpressCodeMismatch, buildFailedOrderCleanupList, polyapi, cainiao, parsePlatformPrintData, stringifyPlatformPrintData, buildWaybillOrderMetaMap, buildWaybillSettlementRelationMap, lockAndDeductWaybillSettlement, persistWaybillSuccessUpdates, normalizePddExtData, pdd - app/service/systems/express_policy.js (10) - getWarehousePolicyCacheKey, getWarehousePolicyCacheTTL, clearWarehousePolicyCache, fetchWarehousePoliciesFromDB, getWarehousePolicies, _matchAnyToken, _matchAnyIntersect, _matchValueInArray, _isStoreOnlyPolicy, matchPolicy -- app/service/systems/express.js (72) - - getExpressListCacheKey, getCurrentWarehouseId, buildWaybillTraceId, getOrderLogOperator, getOrderLogWarehouseId, createAllocateExpressFailureLogs, normalizeWaybillBusinessKeys, normalizeWaybillCreatePlatformCode, normalizeWaybillPolicyConfig, buildWaybillBalanceExceptionText, normalizeWaybillCreateOrders, buildWaybillCreateRelationGroups, collectWaybillRelationProcessingState, buildWaybillRelationLockMap, lockWaybillRelationBalance, markWaybillOrdersAsException, writeWaybillOrderExceptions, writeDispatchOrderFlags, markWaybillAsyncOrdersAsError, buildMergedExpressLabel, normalizeExpressSettingRow, loadExpressSettingListFromDatabase, buildExpressSettingCustomCodeList, buildMergedExpressList, getExpressProductTypeListCacheKey, normalizeExpressProductTypeRow, normalizeExpressCodeKey, isSfExpressCode, extractExpressProductTypesFromTypeDesc, collectPddSfTimedDeliveryProductTypes, clearExpressProductTypeCache, upsertExpressProductTypeList, syncPddSfTimedDeliveryExpressProductTypes, normalizeExpressRow, loadExpressList, loadExpressListFromCache, loadExpressListFromDatabase, getSystemExpressList, loadExpressProductTypeListFromDatabase, getExpressList, getExpressProductTypeList, normalizeWaybillPrintPlatformCode, loadWaybillPrintPlatformCodeMap, loadWaybillAsyncRequestPlatformCodeMap, Map, resolveWaybillAsyncRequestPlatformCode, resolveWaybillGroupPrintPlatformCode, groupWaybillOrdersByPlatformAndLogistics, splitWaybillOrdersIntoBatches, pickWaybillExpressInterface, resolveWaybillAsyncPlatformCode, groupWaybillAsyncOrdersByPlatform, buildWaybillOrderDeliveryMap, normalizeWaybillAsyncText, normalizeWaybillAsyncNumber, formatWaybillAsyncDate, normalizeWaybillAsyncItems, buildWaybillAsyncRouteInfo, buildWaybillAsyncOrderInfo, buildWaybillAsyncReceiverInfo, buildWaybillAsyncSettlementInfo, buildWaybillAsyncItemsSummary, buildWaybillAsyncOrderListItem, buildWaybillAsyncBizcontentSkeleton, shouldDispatchWaybillAsyncPerOrder, dispatchWaybillAsyncPlatform, resolveWaybillAsyncDispatchPlatformCode, hardDeleteWaybillAsyncOrderExpressRows, getWaybillAsyncOrderDeliveryModel, createWaybillCodePipeline, asyncTask, createWaybillCode +- app/service/systems/express.js (71) + - getExpressListCacheKey, getCurrentWarehouseId, buildWaybillTraceId, getOrderLogOperator, getOrderLogWarehouseId, createAllocateExpressFailureLogs, normalizeWaybillBusinessKeys, normalizeWaybillCreatePlatformCode, normalizeWaybillPolicyConfig, buildWaybillBalanceExceptionText, normalizeWaybillCreateOrders, buildWaybillCreateRelationGroups, collectWaybillRelationProcessingState, buildWaybillRelationLockMap, lockWaybillRelationBalance, markWaybillOrdersAsException, writeWaybillOrderExceptions, writeDispatchOrderFlags, markWaybillAsyncOrdersAsError, buildMergedExpressLabel, normalizeExpressSettingRow, loadExpressSettingListFromDatabase, buildExpressSettingCustomCodeList, buildMergedExpressList, getExpressProductTypeListCacheKey, normalizeExpressProductTypeRow, normalizeExpressCodeKey, isSfExpressCode, extractExpressProductTypesFromTypeDesc, collectPddSfTimedDeliveryProductTypes, clearExpressProductTypeCache, upsertExpressProductTypeList, syncPddSfTimedDeliveryExpressProductTypes, normalizeExpressRow, loadExpressList, loadExpressListFromCache, loadExpressListFromDatabase, getSystemExpressList, loadExpressProductTypeListFromDatabase, getExpressList, getExpressProductTypeList, normalizeWaybillPrintPlatformCode, loadWaybillPrintPlatformCodeMap, loadWaybillAsyncRequestPlatformCodeMap, resolveWaybillAsyncRequestPlatformCode, resolveWaybillGroupPrintPlatformCode, groupWaybillOrdersByPlatformAndLogistics, splitWaybillOrdersIntoBatches, pickWaybillExpressInterface, resolveWaybillAsyncPlatformCode, groupWaybillAsyncOrdersByPlatform, buildWaybillOrderDeliveryMap, normalizeWaybillAsyncText, normalizeWaybillAsyncNumber, formatWaybillAsyncDate, normalizeWaybillAsyncItems, buildWaybillAsyncRouteInfo, buildWaybillAsyncOrderInfo, buildWaybillAsyncReceiverInfo, buildWaybillAsyncSettlementInfo, buildWaybillAsyncItemsSummary, buildWaybillAsyncOrderListItem, buildWaybillAsyncBizcontentSkeleton, shouldDispatchWaybillAsyncPerOrder, dispatchWaybillAsyncPlatform, resolveWaybillAsyncDispatchPlatformCode, hardDeleteWaybillAsyncOrderExpressRows, getWaybillAsyncOrderDeliveryModel, createWaybillCodePipeline, asyncTask, createWaybillCode - app/service/systems/fast_where.js (13) - buildTree, getTreeByType, buildSubTree, getWithChildrenByType, getAllChildren, getByType, getGroups, getChildrenByPid, getTreeChildrenByPid, create, update, findById, delete - app/service/systems/file.js (2) - getImages, ReferenceFile -- app/service/systems/frontConfig.js (50) - - createError, getCurrentWarehouseId, deleteCacheByKey, normalizeText, normalizeTheme, assertDomainUnique, getRecordField, sanitizeErrorText, getDomainVerifyConfig, resolveDohUrls, getCnameTarget, buildDomainVerifyCode, parseTxtAnswerData, extractTxtValuesFromAnswers, queryDohEndpoint, resolveTxtByDoh, resolveTxtBySystem, timeoutMs, resolveTxtValues, verifyDomainRecord, isUnknownColumnError, findVerifiedDomainRecord, verifyPendingDomains, buildInfoOutput, buildCertOutput, getInfo, getCert, getDomain, setDomain, promotePendingDomain, checkPendingDomainRecord, checkDomain, buildDomainOutput, buildResolvedValues, describeDomainStatus, getDomainCacheKey, buildPublicOutput, clearDomainCache, clearDomainCaches, buildPendingClearPatch, getByDomain, normalizePem, parseCertPem, assertCertValid, collectCertNames, certCoversDomain, validateKeyPem, assertWarehouseSubject, saveInfo, saveCert -- app/service/systems/inbound_direct_log.js (15) - - getItems, _addSingleItem, _bindReceivingDetail, addItem, removeItem, commit, notifyEntryOrderCompleted, _queryCompletedEntryItems, _buildCompletedItemLines, buildEntryOrderConfirmRequest, _sendOpenApiCallback, operationLog, qimenEntrySync, _syncReceivingStorageStatus, _applyReceivingStockOccupancy +- app/service/systems/frontConfig.js (49) + - createError, getCurrentWarehouseId, deleteCacheByKey, normalizeText, normalizeTheme, assertDomainUnique, getRecordField, sanitizeErrorText, getDomainVerifyConfig, resolveDohUrls, getCnameTarget, buildDomainVerifyCode, parseTxtAnswerData, extractTxtValuesFromAnswers, queryDohEndpoint, resolveTxtByDoh, resolveTxtBySystem, resolveTxtValues, verifyDomainRecord, isUnknownColumnError, findVerifiedDomainRecord, verifyPendingDomains, buildInfoOutput, buildCertOutput, getInfo, getCert, getDomain, setDomain, promotePendingDomain, checkPendingDomainRecord, checkDomain, buildDomainOutput, buildResolvedValues, describeDomainStatus, getDomainCacheKey, buildPublicOutput, clearDomainCache, clearDomainCaches, buildPendingClearPatch, getByDomain, normalizePem, parseCertPem, assertCertValid, collectCertNames, certCoversDomain, validateKeyPem, assertWarehouseSubject, saveInfo, saveCert +- app/service/systems/inbound_direct_log.js (14) + - getItems, _addSingleItem, _bindReceivingDetail, addItem, removeItem, commit, notifyEntryOrderCompleted, _queryCompletedEntryItems, _buildCompletedItemLines, buildEntryOrderConfirmRequest, _sendOpenApiCallback, qimenEntrySync, _syncReceivingStorageStatus, _applyReceivingStockOccupancy - app/service/systems/inbox/group.js (11) - list, quickList, members, disable, update, reset, validateExpressInterfaces, validateSystemExpressCode, findGroupsByExpress, findStoreAfterSalesGroups, findStoreGroups - app/service/systems/inbox/v2.js (41) - wid, _invalidate, _op, _assertWritableSubType, _findSubType, _page, type, _typeList, _typeCreate, _typeUpdate, _typeDelete, subType, _subTypeList, _subTypeCreate, _subTypeUpdate, _subTypeDelete, keyword, _keywordList, _keywordDupDescribe, _keywordCreate, _keywordUpdate, _keywordDelete, numberRule, _numberRuleList, function, _functionList, _functionUpdate, reply, _replySave, _replyRestore, _replyMerged, _replyCreate, _replyUpdate, _replyDelete, relation, _relFunctionList, _relFunctionSet, _relRuleList, _relRuleSet, _relGroupList, _relGroupSet -- app/service/systems/intercept_auto_confirm.js (10) - - withPatchedCtxUser, listCurrentWarehouseIds, NOW, buildCandidateWhereSql, Date, matchesAutoConfirmCriteria, resolveCurrentTableName, scanCandidateOrderIds, confirmInterceptForOrderIds, runAutoConfirm +- app/service/systems/intercept_auto_confirm.js (9) + - withPatchedCtxUser, listCurrentWarehouseIds, buildCandidateWhereSql, matchesAutoConfirmCriteria, Date, resolveCurrentTableName, scanCandidateOrderIds, confirmInterceptForOrderIds, runAutoConfirm - app/service/systems/license_plate.js (7) - getTencentCloudConfig, getTencentCloudRegion, normalizeBase64Image, buildTencentCloudRequest, sendTencentCloudRequest, recognizeLicensePlate, formatLicensePlateResult - app/service/systems/location_space.js (16) @@ -622,16 +621,16 @@ rg "class .*Service|module.exports" app/service/qimenMethods - buildOperationLogData, buildBusinessLogWhere, formatOperationLogRows, createOperationLog, createOperationLogs, queryLogsByBusinessType, queryStockLogs, queryOrderLogs, queryAllOrderLogs, queryAllLogsByBusinessType, queryReceivingLogs, queryEntryOrderLogs, queryStockoutLogs, getMessageDetail - app/service/systems/order_async.js (9) - finalizeSuccessfulQimenSync, syncQmOrders, syncManualOrders, flushDeferredOrderSyncNotices, syncApiOrders, syncStockoutOrders, buildStockoutConfirmRequest, notifyStockoutExternal, resolveOpenApiAppByStore -- app/service/systems/order_auto_outbound.js (12) - - getEnabledAutoOutboundWarehouses, normalizeSubjectConfigForAutoOutbound, buildAutoOutboundWhere, findAutoOutboundOrders, Date, buildSameDayOutboundCutoffUtc, resolveSameDayTime, resolveSameDayReleaseTime, buildSameDayReleaseUtc, findOrderIdsWithWeigh, processWarehouseAutoOutbound, executeAutoOutbound -- app/service/systems/order_delivery_archive.js (17) - - getArchiveDefaults, buildArchiveOptions, NOW, buildArchiveThresholds, normalizeWarehouseIds, listDispatchWarehouseIds, getArchiveModels, buildCandidateWhere, buildQueryOptions, buildHistoryOrderRow, buildHistoryItemRow, getArchiveErrorInfo, rollbackQuietly, archiveDispatchBatch, archiveDispatchOrdersForWarehouse, resolveFailureCursor, archiveDispatchOrdersToHistory +- app/service/systems/order_auto_outbound.js (11) + - getEnabledAutoOutboundWarehouses, normalizeSubjectConfigForAutoOutbound, buildAutoOutboundWhere, findAutoOutboundOrders, buildSameDayOutboundCutoffUtc, resolveSameDayTime, resolveSameDayReleaseTime, buildSameDayReleaseUtc, findOrderIdsWithWeigh, processWarehouseAutoOutbound, executeAutoOutbound +- app/service/systems/order_delivery_archive.js (16) + - getArchiveDefaults, buildArchiveOptions, buildArchiveThresholds, normalizeWarehouseIds, listDispatchWarehouseIds, getArchiveModels, buildCandidateWhere, buildQueryOptions, buildHistoryOrderRow, buildHistoryItemRow, getArchiveErrorInfo, rollbackQuietly, archiveDispatchBatch, archiveDispatchOrdersForWarehouse, resolveFailureCursor, archiveDispatchOrdersToHistory - app/service/systems/order_delivery_migration.js (15) - syncOutboundOrdersToDelivery, retryTimeoutOutboundOrdersToDelivery, syncOutboundOrdersByStatus, normalizeWarehouseIds, listCurrentWarehouseIds, normalizeOutboundStatuses, buildMigrationQueryOptions, getOutboundMigrationErrorInfo, markOutboundOrdersTimeout, buildDispatchKey, buildDispatchRow, buildDispatchItemRow, getMigrationModels, buildTargetOrderIdMap, syncOutboundOrdersForWarehouse - app/service/systems/order_export.js (14) - getExportPageSize, normalizeExportModuleName, getSortModuleNameByTableType, resolveExportTarget, getOrderExportColumns, normalizeExportColumns, buildOrderExportFilename, buildUploadKey, toPlainRow, normalizeExportCellValue, mapOrderExportRow, uploadOrderExportFile, buildOrderExportPage, exportOrders -- app/service/systems/order_express.js (30) - - createBusinessError, normalizeOrderId, normalizeWaybillCode, normalizePackageMaterialCode, normalizePackageMaterialId, normalizeBindOrderId, getCurrentWarehouseId, findActivePackageMaterialById, findActivePackageMaterialByCode, findValidOrderExpressByOrderAndWaybill, findOrderInterceptStatus, assertOrderNotIntercepted, normalizeWeighingWeight, findValidOrderExpressRows, updateWeighingWeight, updateWeighingWeightByWaybill, _updateWaveAllOrdersWeight, _buildWaveWeighingSummary, _getStoreName, _getWaveSysLogisticsName, _updateSingleOrderWeight, _updateWaveOrderWeight, _writeWeighActionLog, _tryWaveCompatibility, _upsertPackageMaterialItemRelation, bindExpressPackageMaterial, bindExpressPackageMaterialByWaybill, _bindSingleExpressPackageMaterial, _bindWavePackageMaterialByBusinessKey, _writePackageMaterialActionLog +- app/service/systems/order_express.js (34) + - createBusinessError, normalizeOrderId, normalizeWaybillCode, normalizePackageMaterialCode, normalizePackageMaterialId, normalizeBindOrderId, getCurrentWarehouseId, findActivePackageMaterialById, findActivePackageMaterialByCode, findValidOrderExpressByOrderAndWaybill, findOrderInterceptStatus, assertOrderNotIntercepted, findOrderWaveAndPackStatus, isSingleWeighRequirePack, assertSingleOrderPackedForWeigh, buildWeighPackBlockedMessage, normalizeWeighingWeight, findValidOrderExpressRows, updateWeighingWeight, updateWeighingWeightByWaybill, _updateWaveAllOrdersWeight, _buildWaveWeighingSummary, _getStoreName, _getWaveSysLogisticsName, _updateSingleOrderWeight, _updateWaveOrderWeight, _writeWeighActionLog, _tryWaveCompatibility, _upsertPackageMaterialItemRelation, bindExpressPackageMaterial, bindExpressPackageMaterialByWaybill, _bindSingleExpressPackageMaterial, _bindWavePackageMaterialByBusinessKey, _writePackageMaterialActionLog - app/service/systems/order_outbound.js (1) - markOutboundOrder - app/service/systems/order_packing.js (10) @@ -646,8 +645,8 @@ rg "class .*Service|module.exports" app/service/qimenMethods - allocatePicking, allocateStorage, syncOrderIds, cancelAllocateStorage, releaseInterceptLocksByOrderIds - app/service/systems/pack_task_auto_finish.js (1) - executeAutoFinishPackTasks -- app/service/systems/pick_compensation.js (9) - - executeCompensation, compensateWarehouse, getPendingOrderIds, findPendingPickingForDispatchOrders, findPendingPickingForCancelledOrders, SUM, releaseCancelledInTransaction, compensateInTransaction, createBusinessError +- app/service/systems/pick_compensation.js (8) + - executeCompensation, compensateWarehouse, getPendingOrderIds, findPendingPickingForDispatchOrders, findPendingPickingForCancelledOrders, releaseCancelledInTransaction, compensateInTransaction, createBusinessError - app/service/systems/pick.js (37) - getOrderModel, createBusinessError, getTableColumnSet, loadOrderItemMap, parseItemSnapshot, buildPickingSummary, getPickModeViewMeta, loadOrderWaveMap, buildPickingView, resolveWaveInfo, isOrderReviewed, buildWaveOrderWhere, queryPickingInfo, queryByOrder, wavePickTaskCurrent, wavePickTaskDetail, resolveOperatorContext, normalizePickCartStatus, buildPickCartDetail, getPickCartById, getPickCartByCode, pickCartCodeDuplicateCheck, assertPickCartCodeUnique, getOwnedTask, getTaskPickProgress, wavePickTaskSubmit, wavePickTaskComplete, _afterSkipInterceptedPostActions, _writePickCompleteActionLog, pickCartScan, wavePickTaskBindCart, pickCartCreate, pickCartUpdate, pickCartDelete, pickCartBatchDelete, pickCartDetail, pickCartList - app/service/systems/pickCart.js (9) @@ -664,24 +663,24 @@ rg "class .*Service|module.exports" app/service/qimenMethods - notifyRefreshInfo, list, update, setRecording, cancelRecording, delete - app/service/systems/qimen_query.js (3) - qimenClient, send, sendRequest -- app/service/systems/receiving_entry_match.js (29) - - matchAfterEntryCompleted, _bindEntryOrderReceiving, bindEntryOrderReceiving, _bindReceivingsWithStorageSync, _bindOneReceivingAndSyncStorage, max, _syncReceivingStorageByEntryItems, _parseLedgerMap, _serializeLedgerMap, min, _buildLegacyBaselineLedger, _bindingAllocationByStock, _recalcReceivingStorageStatus, _reconcileEntryReceivedQuantity, recordLedgerAllocation, setLedgerAllocation, rollbackEntryOrderBindings, _rollbackOneBindingStorage, _getRecentReceivingOrders, _findReceivingByRemark, _compareDetails, _queryEntryOrderLines, buildEntryOrderConfirmRequest, _sendCallback, _sendQimenCallback, _sendOpenApiCallback, _markReceivingPartialStorage, _commitBinding, unbindEntryOrderReceiving +- app/service/systems/receiving_entry_match.js (27) + - matchAfterEntryCompleted, _bindEntryOrderReceiving, bindEntryOrderReceiving, _bindReceivingsWithStorageSync, _bindOneReceivingAndSyncStorage, _syncReceivingStorageByEntryItems, _parseLedgerMap, _serializeLedgerMap, _buildLegacyBaselineLedger, _bindingAllocationByStock, _recalcReceivingStorageStatus, _reconcileEntryReceivedQuantity, recordLedgerAllocation, setLedgerAllocation, rollbackEntryOrderBindings, _rollbackOneBindingStorage, _getRecentReceivingOrders, _findReceivingByRemark, _compareDetails, _queryEntryOrderLines, buildEntryOrderConfirmRequest, _sendCallback, _sendQimenCallback, _sendOpenApiCallback, _markReceivingPartialStorage, _commitBinding, unbindEntryOrderReceiving - app/service/systems/receiving_pending_notice.js (16) - getMemoryDailyLocks, getWarehouseNoticeConfigs, findPendingReceivings, groupByStore, buildRowLine, formatDateOnly, buildTemplateVariables, buildContent, resolveNoticeSendMethod, sendPendingNotice, sendCustomerServiceFallback, notifyWarehouse, getRedisClient, acquireDailyLock, releaseDailyLock, execute -- app/service/systems/report.js (17) - - getDefinition, parseFieldsField, definitionToView, resolveTypeEntry, resolveQuerier, listRegisteredTypes, validateTypeFields, resolveOrderedFields, Date, buildFilename, buildWorkbookSheets, generate, generateBuffer, saveDefinition, findDefinitionById, listDefinitions, deleteDefinition +- app/service/systems/report.js (16) + - getDefinition, parseFieldsField, definitionToView, resolveTypeEntry, resolveQuerier, listRegisteredTypes, validateTypeFields, resolveOrderedFields, buildFilename, buildWorkbookSheets, generate, generateBuffer, saveDefinition, findDefinitionById, listDefinitions, deleteDefinition - app/service/systems/report/queries/index.js (0) - - app/service/systems/report/queries/interceptOrder.js (0) - - app/service/systems/report/queries/sevenDayStockFlow.js (0) - -- app/service/systems/reportDelivery.js (29) - - normalizeScheduleTimes, parseJsonArray, readJsonArray, readJsonObject, normalizeNotifyTemplate, normalizePlanName, normalizeNotifyGroupIds, normalizeNotifyMemberIds, validateNotifyGroupExists, savePlan, copyPlan, planToView, listPlans, listLogs, hitTimePoints, bizDateOfTrigger, bizDateOfTimePoint, resolveStoreWarehouse, markDelivered, markFailed, markExporting, buildMessageContent, resolveNotifyGroups, Date, deliverByChannel, sendNotifyIfConfigured, processOne, parseScheduleTimes, dispatch +- app/service/systems/reportDelivery.js (28) + - normalizeScheduleTimes, parseJsonArray, readJsonArray, readJsonObject, normalizeNotifyTemplate, normalizePlanName, normalizeNotifyGroupIds, normalizeNotifyMemberIds, validateNotifyGroupExists, savePlan, copyPlan, planToView, listPlans, listLogs, hitTimePoints, bizDateOfTrigger, bizDateOfTimePoint, resolveStoreWarehouse, markDelivered, markFailed, markExporting, buildMessageContent, resolveNotifyGroups, deliverByChannel, sendNotifyIfConfigured, processOne, parseScheduleTimes, dispatch - app/service/systems/return_received.js (19) - createBusinessError, create, _isUrgentReturnQuery, notifyPending, _handleInterceptAfterSale, _updateOrderInterceptStatus, list, exportList, _generateExportExcel, detail, delete, _findByIdChecked, _enrichReturn, _resolveStoreRemark, _resolveStoreRemarkMap, _buildListWhere, _resolveConditionValue, _extractConditionValue, _buildListOrder -- app/service/systems/return_unpack.js (50) - - _getRecordingComputerId, _buildVideoUrl, createBusinessError, create, transferByWaybills, addDetail, updateDetail, removeDetail, cancel, _resolveSubmitEndTime, submit, _notifyUnpacked, forceRecord, list, detailList, videoList, exportUnpack, _resolveStoreNameMap, _resolveExpressNameMap, _extractDetailColor, detail, _buildWaybillMatch, _findWaybillFlexible, queryByWaybill, _resolveWarehouseName, _resolveStoreIdByWaybill, _resolveReturnOrderInfo, delete, _insertMainWithRetry, _transferOneWaybill, _backfillDetailsFromOrder, _countDetails, _resolveReturnReceivedId, _buildTransferDetailRows, _findByIdChecked, _assertUnpacking, _findDetailChecked, _recalcMain, _enrichRow, _flattenVideos, _enrichDetailsWithStock, _resolveStoreRemark, VALUES, _generateUnpackNo, _buildListWhere, _buildDetailListWhere, _buildVideoListWhere, _buildVideoListOrder, _resolveConditionValue, _buildListOrder +- app/service/systems/return_unpack.js (49) + - _getRecordingComputerId, _buildVideoUrl, createBusinessError, create, transferByWaybills, addDetail, updateDetail, removeDetail, cancel, _resolveSubmitEndTime, submit, _notifyUnpacked, forceRecord, list, detailList, videoList, exportUnpack, _resolveStoreNameMap, _resolveExpressNameMap, _extractDetailColor, detail, _buildWaybillMatch, _findWaybillFlexible, queryByWaybill, _resolveWarehouseName, _resolveStoreIdByWaybill, _resolveReturnOrderInfo, delete, _insertMainWithRetry, _transferOneWaybill, _backfillDetailsFromOrder, _countDetails, _resolveReturnReceivedId, _buildTransferDetailRows, _findByIdChecked, _assertUnpacking, _findDetailChecked, _recalcMain, _enrichRow, _flattenVideos, _enrichDetailsWithStock, _resolveStoreRemark, _generateUnpackNo, _buildListWhere, _buildDetailListWhere, _buildVideoListWhere, _buildVideoListOrder, _resolveConditionValue, _buildListOrder - app/service/systems/return_waybill.js (12) - createBusinessError, create, update, list, detail, delete, _findByIdChecked, _assertStoreContract, _formatRow, _buildListWhere, _resolveConditionValue, _buildListOrder - app/service/systems/setting/account.js (31) @@ -712,26 +711,26 @@ rg "class .*Service|module.exports" app/service/qimenMethods - Constants, toXml, signTopRequest, verifyTopRequest, verifyAndExtractParams, generateSignedParams, encryptHMAC, encryptHMACSHA256, encryptMD5, byte2hex - app/service/systems/space.js (3) - _searchByKeyword, searchSpace, searchSpaces -- app/service/systems/stock_store.js (46) - - create, initQimenStockData, convertToQimenFormat, getItemInfoWithCache, getItemStorages, _calculateCacheTTL, clearItemStorageCache, _runWithTransaction, getStoreWarehousePolicyByStoreAndWarehouse, getStoreWarehousePolicyConfigByStockId, updateLockedQuantity, lockItemStorages, ID, inbound, normalizeOutboundMeta, getPickingRowsForOutbound, getPickingBatchMap, buildOutboundTransactionPayloads, outbound, checkAndCreateWarehouseStock, getWarehouseStock, exportWarehouseStock, exportExternalWarehouseStock, buildSequelizeCondition, processConditionValue, normalizeDate, formatDate, isEmptyValue, getProhibitedType, getBarcodes, handleBatchChange, saveWarehouseStockBarcode, getStoreStocks, bindItem, unbindItem, getInfo, saveWarehouseStock, createWarehouseStock, validateSaveParams, stockLog, checkItemCodeUnique, handleBatchDelete, deleteUnit, deleteProhibited, search, getStockDetail +- app/service/systems/stock_store.js (45) + - create, initQimenStockData, convertToQimenFormat, getItemInfoWithCache, getItemStorages, _calculateCacheTTL, clearItemStorageCache, _runWithTransaction, getStoreWarehousePolicyByStoreAndWarehouse, getStoreWarehousePolicyConfigByStockId, updateLockedQuantity, lockItemStorages, inbound, normalizeOutboundMeta, getPickingRowsForOutbound, getPickingBatchMap, buildOutboundTransactionPayloads, outbound, checkAndCreateWarehouseStock, getWarehouseStock, exportWarehouseStock, exportExternalWarehouseStock, buildSequelizeCondition, processConditionValue, normalizeDate, formatDate, isEmptyValue, getProhibitedType, getBarcodes, handleBatchChange, saveWarehouseStockBarcode, getStoreStocks, bindItem, unbindItem, getInfo, saveWarehouseStock, createWarehouseStock, validateSaveParams, stockLog, checkItemCodeUnique, handleBatchDelete, deleteUnit, deleteProhibited, search, getStockDetail - app/service/systems/stock_transaction.js (10) - normalizeInboundOrderId, isOrderOutboundTransaction, resolveOutboundOrderReference, create, list, _buildStorageTransactionWhere, _resolveKeywordToStockIds, queryList, exportList, exportStorageList - app/service/systems/stock_warehouse.js (3) - _buildStockDetailCacheKey, getStockDetails, invalidateStockDetailCache - app/service/systems/stockout_order.js (5) - resolveStockoutExpress, create, query, cancel, _writeStockoutOperationLog -- app/service/systems/storage/entry.js (27) - - normalizeExpenseRecordValue, normalizeExpenseRecordCondition, normalizeFilterValues, buildEntryStockTransactionExistsCondition, buildHasReceivingCondition, preprocessEntryListWhere, list, get, IN, enrichItemsWithAvailableReceivingDetails, normalizeCancelEntryOrderIds, getOwnedEntryOrderById, cancel, _guardCancelEntryOrder, _doCancelEntryOrder, _rollbackReceivingStorageStatus, addItem, commit, removeItem, getReceivingDetailsForBind, containerList, _applyReceivingInboundUsage, quickInbound, receivingCompare, _buildMergedComparison, exportEntryOrders, exportStoreEntryOrders +- app/service/systems/storage/entry.js (26) + - normalizeExpenseRecordValue, normalizeExpenseRecordCondition, normalizeFilterValues, buildEntryStockTransactionExistsCondition, buildHasReceivingCondition, preprocessEntryListWhere, list, get, enrichItemsWithAvailableReceivingDetails, normalizeCancelEntryOrderIds, getOwnedEntryOrderById, cancel, _guardCancelEntryOrder, _doCancelEntryOrder, _rollbackReceivingStorageStatus, addItem, commit, removeItem, getReceivingDetailsForBind, containerList, _applyReceivingInboundUsage, quickInbound, receivingCompare, _buildMergedComparison, exportEntryOrders, exportStoreEntryOrders - app/service/systems/storage/expiry.js (1) - list -- app/service/systems/storage/index.js (15) - - findByStockAndBatch, findBySpace, findAvailableByWarehouse, findExpiringSoon, updateQuantity, lockQuantity, unlockQuantity, allocateQuantity, interceptLockQuantity, interceptReceiveQuantity, interceptUnlockQuantity, min, offsetGapOnInbound, getStockSummary, getSpaceUsage +- app/service/systems/storage/index.js (14) + - findByStockAndBatch, findBySpace, findAvailableByWarehouse, findExpiringSoon, updateQuantity, lockQuantity, unlockQuantity, allocateQuantity, interceptLockQuantity, interceptReceiveQuantity, interceptUnlockQuantity, offsetGapOnInbound, getStockSummary, getSpaceUsage - app/service/systems/storage/inventory.js (16) - createTransferStockTransactions, transferLocation, transferByProduct, updateExpiry, resolveStockQueryToStockIds, getInventoryList, getStorageListByStockId, getStorageListBySpaceId, _aggregateStorageRowsByStock, _aggregateStorageRowsBySpace, _loadInventoryWarningRanges, _formatBatchStorageRows, quickPutaway, directPutaway, exportInventoryList, _generateEntryOrderCode - app/service/systems/storage/management.js (1) - replenishmentDemand -- app/service/systems/storage/receiving.js (44) - - getReceivingList, _resolveStockQueryReceivingIds, _resolveReceivingStoreNameMap, getStoreReceivingList, getReceivingDetail, batchCancelReceiving, rejectReceiving, reviewReceiving, buildReviewReportSheets, sendStoreBoundNotice, resolveReceivingCreatorName, sendReviewNotice, resolveReviewDetailItemCodeMap, isEmptyValue, buildSequelizeCondition, processConditionValue, buildReceivingNumberPrefix, generateNextReceivingNumber, isReceivingNumberDuplicateError, create, save, bindStore, get, addDetail, bindDetailProduct, updateDetail, getStockStoreInfo, updateReceivingStats, deleteDetail, detailChange, invalid, formatReportDate, formatDeliveryMethod, getCompletionContactFields, Map, buildCompletionReportSheets, uploadCompletionExcelReport, sendCompletionNotice, sendStoreUnmatchedNotice, completeReceiving, _syncProductDataFromReceiving, scanDetail, exportReceivingList, exportStoreReceivingList +- app/service/systems/storage/receiving.js (43) + - getReceivingList, _resolveStockQueryReceivingIds, _resolveReceivingStoreNameMap, getStoreReceivingList, getReceivingDetail, batchCancelReceiving, rejectReceiving, reviewReceiving, buildReviewReportSheets, sendStoreBoundNotice, resolveReceivingCreatorName, sendReviewNotice, resolveReviewDetailItemCodeMap, isEmptyValue, buildSequelizeCondition, processConditionValue, buildReceivingNumberPrefix, generateNextReceivingNumber, isReceivingNumberDuplicateError, create, save, bindStore, get, addDetail, bindDetailProduct, updateDetail, getStockStoreInfo, updateReceivingStats, deleteDetail, detailChange, invalid, formatReportDate, formatDeliveryMethod, getCompletionContactFields, buildCompletionReportSheets, uploadCompletionExcelReport, sendCompletionNotice, sendStoreUnmatchedNotice, completeReceiving, _syncProductDataFromReceiving, scanDetail, exportReceivingList, exportStoreReceivingList - app/service/systems/storage/report.js (5) - loadReportReferenceMaps, buildExportFilename, export, _resolveKeywordToStockIds, search - app/service/systems/storage/stock_warehouse.js (3) @@ -742,20 +741,20 @@ rg "class .*Service|module.exports" app/service/qimenMethods - createError, getCurrentStoreId, getCurrentAccountId, toPositiveNumber, normalizePage, normalizeStatusFlag, normalizeAuthStatus, normalizeNonNegativeInteger, normalizeInteger, normalizeText, normalizeIntegerRange, normalizeEmail, getPolicyConfigFieldList, getPolicyConfigFieldMetaList, normalizePolicyConfig, getPolicyConfigCacheKey, hasPolicyConfigColumn, loadPolicyConfigByContractId, savePolicyConfigByContractId, getPolicyConfigDefaults, mergePolicyConfigWithDefaults, getEffectivePolicyConfigByContractId, ensureWarehouseSubject, getNoticeService, sendPrintQuantityAdjustNotice, resolveRelationId, normalizeDate, normalizeSignAction, normalizeTempCode, getTempCodeCacheKey, createTempCode, pickRemaskField, resolveRemaskValue, buildCurrentRemaskPatch, requireCurrentRemaskPatch, saveTempSignPayload, getTempSignPayload, clearTempSignPayload, buildTempSignView, getCurrentSubject, getCounterparty, buildListWhereByStoreId, buildListWhere, getRelationIncludes, getQimenContractCacheKey, clearQimenContractCache, getApiInterfaceType, getQimenInterfaceType, resolveQimenCustomerIdByAppKey, getQimenErpNameMapByAppKeys, serializeQimenConfig, getQimenConfigMap, getSingleQimenConfig, resolvePairIds, serializeRelation, findScopedRelation, buildListForStoreWhere, listForStore, exportListForStore, listForWarehouse, list, sign, trimContract, confirmSign, rename, adjustPrintQuantity, queryPrintQuantityLogs, exportPrintQuantityLogs, getPolicyConfigFields, getPolicyConfig, savePolicyConfig, listApiConfig, saveApiConfig, deleteQimenConfig, unbind, getContractConfigCacheKey, invalidateContractConfigCache, getContractConfig, openAccount, createUser - app/service/systems/store.js (22) - normalizeSubjectConfigInput, validateStoreData, checkCompanyNameExists, findByAccountId, findAllEnabled, findAllWarehouses, getStoreName, getStoreRemaskName, createStore, createWarehouse, joinStore, joinWarehouse, ensureEmployeeRoleBinding, assignAdminRoleToCreator, generateJoinToken, sendNotification, sendNotificationToAdmins, getStoreRoles, auditApply, loadStores, loadWarehouses, bindCode -- app/service/systems/upload.js (19) - - getTencentCloudConfig, getCosConfig, initCOS, getUploadParams, hash_hmac, generatePolicyAndSignature, resolveUploadMaxSizeBytes, validateFileInfo, generateFileName, parseSizeToBytes, formatFileSize, getFrontendConfig, uploadFile, uploadBuffer, validateFile, uploadSuccessNotify, getMimeType, createFileReference, handleUploadCallback -- app/service/systems/video_record_request.js (15) - - _getRecordingComputer, _isComputerOnline, _resetVideoRecords, _withinReuseWindow, _markFailed, requestPackVideo, requestUnpackVideo, requestFor, syncByVideos, settleStatuses, notifyResults, queryPackVideo, _buildResultMessage, _notifyManualHandling, _replyResult -- app/service/systems/warehouseNotify.js (7) - - truncateLogBody, getCallbackConfig, MD5, buildSignature, writeLog, push, pushSystemMessage +- app/service/systems/upload.js (18) + - getTencentCloudConfig, getCosConfig, initCOS, getUploadParams, generatePolicyAndSignature, resolveUploadMaxSizeBytes, validateFileInfo, generateFileName, parseSizeToBytes, formatFileSize, getFrontendConfig, uploadFile, uploadBuffer, validateFile, uploadSuccessNotify, getMimeType, createFileReference, handleUploadCallback +- app/service/systems/video_record_request.js (14) + - _getRecordingComputer, _isComputerOnline, _resetVideoRecords, _withinReuseWindow, _markFailed, requestPackVideo, requestUnpackVideo, requestFor, syncByVideos, settleStatuses, notifyResults, _buildResultMessage, _notifyManualHandling, _replyResult +- app/service/systems/warehouseNotify.js (6) + - truncateLogBody, getCallbackConfig, buildSignature, writeLog, push, pushSystemMessage - app/service/systems/wave_batch_closure.js (4) - closeFinishedWaves, normalizeConfirmIntervalMs, readEmptyConfirmState, writeEmptyConfirmState - app/service/systems/waybill.js (5) - toOrder, list, detail, export, buildWaybillExportFile -- app/service/systems/wechat.js (35) - - getAuthUrl, getAccountInfoSync, resolveWechatApp, loginByCode, getMyLoginCode, bindUser, buildBindResult, bindByEmployee, getUserAgreementText, getUserAgreement, setUserAgreement, findWarehouseWechatApp, findLatestAgreementVersion, getAgreementVersion, cleanupUnusedAgreementVersions, pushLoginCode, queryauth, wxaauth, resolveBodyMedia, resolveMediaValue, downloadFromUrl, resolveMediaFilename, registerMiniprogram, updateInfo, buildHeadimgKey, uploadHeadimg, getTemplateList, hasFuncScope, buildAuthorizerPatch, getAuthorizerInfo, commit, submitAudit, buildTrialQrCodeKey, getTrialQRCode, userList +- app/service/systems/wechat.js (34) + - getAuthUrl, resolveWechatApp, loginByCode, getMyLoginCode, bindUser, buildBindResult, bindByEmployee, getUserAgreementText, getUserAgreement, setUserAgreement, findWarehouseWechatApp, findLatestAgreementVersion, getAgreementVersion, cleanupUnusedAgreementVersions, pushLoginCode, queryauth, wxaauth, resolveBodyMedia, resolveMediaValue, downloadFromUrl, resolveMediaFilename, registerMiniprogram, updateInfo, buildHeadimgKey, uploadHeadimg, getTemplateList, hasFuncScope, buildAuthorizerPatch, getAuthorizerInfo, commit, submitAudit, buildTrialQrCodeKey, getTrialQRCode, userList - app/service/systems/workbench.js (75) - - list, detail, create, update, delete, bindCamera, business, _loadPackCtx, _countWaveOrders, _countWaveOrdersCached, SUM, _sumWaveItemsTotal, _sumWaveItemsTotalCached, _getWaveOrderIds, Set, _buildPackChangeSummary, _writePackOperationLog, _updateOrderPackStatus, _packOrder, resolvePackTaskEndTime, _finishPack, _resetPackOsd, _sendWeight, _writeWeighOpLog, _aggregateWaveItems, _fetchWaveItemsSummary, _fetchOrderItemsDetail, _countCurrentPackMembers, _getBigGroupPackCoefficient, _queryOrder, generatePackCtxKey, getWorkbenchPackCtxCacheKey, getWorkbenchBindClientCacheKey, getWorkbenchBindCodeCacheKey, getWorkbenchTokenCacheKey, generateRandomChars, generateWorkbenchToken, generateWorkbenchLoginCode, normalizeWorkbenchBindCode, generateUniqueWorkbenchLoginCode, createUniqueWorkbenchClientCode, createUniqueWorkbenchBindCode, buildWorkbenchBindState, getWorkbenchBindRemainingSeconds, setWorkbenchBindState, createWorkbenchBindSession, refreshWorkbenchBindCode, formatWorkbenchBindData, waitForWorkbenchBindComplete, getWorkbenchBindCode, formatWorkbenchTokenInfo, listWorkbenchMembers, listCurrentPackTasks, buildCurrentPackingInfo, invalidateWorkbenchTokenCacheByWorkbenchId, buildWorkbenchTokenInfo, bindWorkbench, getWorkbenchInfoByToken, _round2, _formatPackCountTime, buildWorkbenchPackCountTimeRange, getWorkbenchCountByToken, loginWorkbenchByCode, resetLoginCode, clearExpiredWorkbenchTokens, resolveWorkbenchContext, resolveWorkbenchByToken, packOrderByToken, finishPackByToken, sendWeightByToken, queryOrderByToken, normalizeWorkbenchMemberIds, _finishAllPackTasksByMemberLogout, removeWorkbenchMember, bindWorkbenchMember + - list, detail, create, update, delete, bindCamera, business, _loadPackCtx, _countWaveOrders, _countWaveOrdersCached, _sumWaveItemsTotal, _sumWaveItemsTotalCached, _getWaveOrderIds, Set, _buildPackChangeSummary, _writePackOperationLog, _updateOrderPackStatus, _packOrder, resolvePackTaskEndTime, _finishPack, _resetPackOsd, _sendWeight, _assertSingleWeighPackedForWeigh, _writeWeighOpLog, _aggregateWaveItems, _fetchWaveItemsSummary, _fetchOrderItemsDetail, _countCurrentPackMembers, _getBigGroupPackCoefficient, _queryOrder, generatePackCtxKey, getWorkbenchPackCtxCacheKey, getWorkbenchBindClientCacheKey, getWorkbenchBindCodeCacheKey, getWorkbenchTokenCacheKey, generateRandomChars, generateWorkbenchToken, generateWorkbenchLoginCode, normalizeWorkbenchBindCode, generateUniqueWorkbenchLoginCode, createUniqueWorkbenchClientCode, createUniqueWorkbenchBindCode, buildWorkbenchBindState, getWorkbenchBindRemainingSeconds, setWorkbenchBindState, createWorkbenchBindSession, refreshWorkbenchBindCode, formatWorkbenchBindData, waitForWorkbenchBindComplete, getWorkbenchBindCode, formatWorkbenchTokenInfo, listWorkbenchMembers, listCurrentPackTasks, buildCurrentPackingInfo, invalidateWorkbenchTokenCacheByWorkbenchId, buildWorkbenchTokenInfo, bindWorkbench, getWorkbenchInfoByToken, _round2, _formatPackCountTime, buildWorkbenchPackCountTimeRange, getWorkbenchCountByToken, loginWorkbenchByCode, resetLoginCode, clearExpiredWorkbenchTokens, resolveWorkbenchContext, resolveWorkbenchByToken, packOrderByToken, finishPackByToken, sendWeightByToken, queryOrderByToken, normalizeWorkbenchMemberIds, _finishAllPackTasksByMemberLogout, removeWorkbenchMember, bindWorkbenchMember - app/service/warehouse.js (7) - resolveWarehouseMethod, getWarehouseMethodService, dispatchWarehouseMethod, validateWarehouseParams, parseJsonBody, normalizeSignFields, processRequest - app/service/warehouseMethods/inbox.js (2) @@ -822,6 +821,10 @@ rg "class .*Service|module.exports" app/service/qimenMethods + + + + diff --git a/app/service/systemMethods/order/wave.js b/app/service/systemMethods/order/wave.js index 71d4fc0..d7a8ec0 100644 --- a/app/service/systemMethods/order/wave.js +++ b/app/service/systemMethods/order/wave.js @@ -134,9 +134,9 @@ class WaveService extends OrderBaseService { constructor(ctx) { super(ctx); const _noNeedLogin = ''; - const _noNeedRight = 'wavePickTaskCancelSelf,groupOrderFetchList,singleOrderFetchList,waveStrategyList,waveStrategyFallbackOrderList,waveStrategyFetchPda,waveStrategyFetchAdmin,groupFetch,singleFetch,fetch,fetchTaskProgress,batchList,wavePickTaskList,batchCancel,batchCancelTaskProgress,batchRemoveExceptionOrders,batchRemoveExceptionOrdersTaskProgress,batchAllocateExpress,batchAllocateExpressTaskProgress,batchAllocateStorage,batchAllocateStorageTaskProgress,batchAutoGrouping,batchFinishAutoGrouping,batchRemoveOrders,singleFetchByIds,waveStrategyQuickScan,waveStrategyQuickScanTaskProgress,confirmPrintUnclaimedWaveCount'; - const _noNeedLog = 'groupOrderFetchList,singleOrderFetchList,waveStrategyList,waveStrategyFallbackOrderList,waveStrategyFetchAdmin,groupFetch,singleFetch,fetch,fetchTaskProgress,batchList,wavePickTaskList,batchCancel,batchCancelTaskProgress,batchRemoveExceptionOrders,batchRemoveExceptionOrdersTaskProgress,batchAllocateExpress,batchAllocateExpressTaskProgress,batchAllocateStorage,batchAllocateStorageTaskProgress,batchAutoGrouping,batchFinishAutoGrouping,batchRemoveOrders,singleFetchByIds,waveStrategyQuickScan,waveStrategyQuickScanTaskProgress,confirmPrintScan,confirmPrintUnclaimedWaveCount'; - const _noNeedAuth = 'groupOrderFetchList,singleOrderFetchList,waveStrategyList,waveStrategyFallbackOrderList,waveStrategyFetchPda,waveStrategyFetchAdmin,groupFetch,singleFetch,fetch,fetchTaskProgress,batchList,wavePickTaskList,batchCancel,batchCancelTaskProgress,batchRemoveExceptionOrders,batchRemoveExceptionOrdersTaskProgress,batchAllocateExpress,batchAllocateExpressTaskProgress,batchAllocateStorage,batchAllocateStorageTaskProgress,batchAutoGrouping,batchFinishAutoGrouping,batchRemoveOrders,singleFetchByIds,waveStrategyQuickScan,waveStrategyQuickScanTaskProgress,confirmPrintUnclaimedWaveCount'; + const _noNeedRight = 'wavePickTaskCancelSelf,groupOrderFetchList,singleOrderFetchList,fetchableOrderCount,waveStrategyList,waveStrategyFallbackOrderList,waveStrategyFetchPda,waveStrategyFetchAdmin,groupFetch,singleFetch,fetch,fetchTaskProgress,batchList,wavePickTaskList,batchCancel,batchCancelTaskProgress,batchRemoveExceptionOrders,batchRemoveExceptionOrdersTaskProgress,batchAllocateExpress,batchAllocateExpressTaskProgress,batchAllocateStorage,batchAllocateStorageTaskProgress,batchAutoGrouping,batchFinishAutoGrouping,batchRemoveOrders,singleFetchByIds,waveStrategyQuickScan,waveStrategyQuickScanTaskProgress,confirmPrintUnclaimedWaveCount'; + const _noNeedLog = 'groupOrderFetchList,singleOrderFetchList,fetchableOrderCount,waveStrategyList,waveStrategyFallbackOrderList,waveStrategyFetchAdmin,groupFetch,singleFetch,fetch,fetchTaskProgress,batchList,wavePickTaskList,batchCancel,batchCancelTaskProgress,batchRemoveExceptionOrders,batchRemoveExceptionOrdersTaskProgress,batchAllocateExpress,batchAllocateExpressTaskProgress,batchAllocateStorage,batchAllocateStorageTaskProgress,batchAutoGrouping,batchFinishAutoGrouping,batchRemoveOrders,singleFetchByIds,waveStrategyQuickScan,waveStrategyQuickScanTaskProgress,confirmPrintScan,confirmPrintUnclaimedWaveCount'; + const _noNeedAuth = 'groupOrderFetchList,singleOrderFetchList,fetchableOrderCount,waveStrategyList,waveStrategyFallbackOrderList,waveStrategyFetchPda,waveStrategyFetchAdmin,groupFetch,singleFetch,fetch,fetchTaskProgress,batchList,wavePickTaskList,batchCancel,batchCancelTaskProgress,batchRemoveExceptionOrders,batchRemoveExceptionOrdersTaskProgress,batchAllocateExpress,batchAllocateExpressTaskProgress,batchAllocateStorage,batchAllocateStorageTaskProgress,batchAutoGrouping,batchFinishAutoGrouping,batchRemoveOrders,singleFetchByIds,waveStrategyQuickScan,waveStrategyQuickScanTaskProgress,confirmPrintUnclaimedWaveCount'; this.systemInit(_noNeedLogin, _noNeedRight, _noNeedLog, _noNeedAuth); } @@ -3379,6 +3379,141 @@ class WaveService extends OrderBaseService { }); } + /** + * 团购可抓取订单数统计。 + * + * 口径与 groupOrderFetchList 完全一致(同一候选 where、同一 items_hash 粗分组、 + * 同一团购阈值 same_order_quantity 过滤),但**不分页、不查订单明细**, + * 仅返回达到团购阈值分组的数量与组内订单数合计,供前端展示「可抓取订单数」等轻量统计。 + * + * 差异说明:groupOrderFetchList 的 pagination.total 是**分组数**(每组订单数在 group_count 内), + * 本方法 order_count 是**订单数合计**,两者口径不同;include_sku 为页内过滤,本方法不参与统计。 + * + * @param {Object} [data={}] 请求参数。 + * @param {boolean} [data.distinguish_express=false] 是否区分快递(影响分组粒度)。 + * @param {number|string} [data.store_id] 货主ID(作为筛选条件)。 + * @param {number|string} [data.same_order_quantity] 最小同组订单数量阈值(>=);未传时取仓库配置 min_group_order_fetch_quantity(默认 13)。 + * @param {string} [data.shop_name] 店铺名称(模糊匹配)。 + * @param {string} [data.stock_query] 商品模糊筛选(stock_warehouse / stock_barcodes → order_items)。 + * @return {Promise} 统一返回结构,data 含 group_count / order_count / same_order_quantity / raw_order_count / warehouse_id / distinguish_express。 + */ + async fetchableOrderCount(data = {}) { + const t0 = Date.now(); + const requestData = this.isPlainObject(data) ? data : {}; + const warehouseId = Number(this.getWarehouseId() || 0); + if (!Number.isInteger(warehouseId) || warehouseId <= 0) { + return this.fail('未识别到当前仓库上下文', {}, 400); + } + + const model = await this.getOrderModel('pendingOrder', warehouseId); + const t1 = Date.now(); + + const distinguishExpress = this.normalizeBoolean(requestData.distinguish_express, false); + const storeId = this.normalizePositiveInteger(requestData.store_id, 'store_id', 0); + const sameOrderQuantityInput = requestData.same_order_quantity; + const hasSameOrderQuantityInput = !(sameOrderQuantityInput === undefined || sameOrderQuantityInput === null || sameOrderQuantityInput === ''); + const explicitSameOrderQuantity = hasSameOrderQuantityInput + ? this.normalizePositiveInteger(sameOrderQuantityInput, 'same_order_quantity', 0) + : 0; + const minGroupOrderFetchQuantity = await this.getMinGroupOrderFetchQuantity(warehouseId); + const sameOrderQuantity = explicitSameOrderQuantity > 0 + ? explicitSameOrderQuantity + : minGroupOrderFetchQuantity; + const shopName = this.normalizeShopName(requestData.shop_name); + const stockQuery = String(requestData.stock_query || '').trim(); + + const where = { + step: { [Op.in]: [ 1, 2, 3 ] }, + status: { [Op.ne]: 'cancel' }, + outbound_status: { [Op.ne]: 'padding' }, + intercept_status: 'none', + lock_status: 'none', + wave_id: 0, + }; + + if (storeId > 0) { + where.store_id = storeId; + } + + if (shopName) { + where.shop_nick = { [Op.like]: `%${shopName}%` }; + } + + if (stockQuery) { + const stockOrderIds = await this.findOrderIdsByStockQuery(stockQuery, 'order', warehouseId); + if (stockOrderIds.length <= 0) { + return this.success('ok', { + group_count: 0, + order_count: 0, + same_order_quantity: sameOrderQuantity, + raw_order_count: 0, + warehouse_id: warehouseId, + distinguish_express: distinguishExpress, + }); + } + + where.id = { [Op.in]: stockOrderIds }; + } + + // 仅取分组基准字段,不取明细(与 groupOrderFetchList Phase 1 同表同 where) + const rawOrders = await model.findAll({ + where, + attributes: [ 'id', 'items_hash', 'items', 'sys_logistics_code' ], + raw: true, + }); + const t2 = Date.now(); + + // 纯内存粗分组:items_hash(缺省回落 items)相同即为同组,distinguish_express 时再叠加快递编码 + const coarseGroupSizeMap = new Map(); + for (const order of rawOrders) { + const coarseKey = this.buildCoarseGroupKey(order, distinguishExpress); + if (!coarseKey) { + continue; + } + + coarseGroupSizeMap.set(coarseKey, Number(coarseGroupSizeMap.get(coarseKey) || 0) + 1); + } + + // 团购阈值过滤:仅统计同组订单数 >= sameOrderQuantity 的分组 + let groupCount = 0; + let orderCount = 0; + for (const groupSize of coarseGroupSizeMap.values()) { + if (groupSize < sameOrderQuantity) { + continue; + } + + groupCount += 1; + orderCount += groupSize; + } + const t3 = Date.now(); + + this.ctx.logger.info('[wave.fetchableOrderCount] 链路耗时', { + warehouseId, + params: { distinguishExpress, storeId, sameOrderQuantity, shopName: shopName || null, stockQuery: stockQuery || null }, + counts: { + rawOrders: rawOrders.length, + coarseGroups: coarseGroupSizeMap.size, + fetchableGroups: groupCount, + fetchableOrders: orderCount, + }, + timing_ms: { + getModel: t1 - t0, + queryOrders: t2 - t1, + counting: t3 - t2, + total: t3 - t0, + }, + }); + + return this.success('ok', { + group_count: groupCount, + order_count: orderCount, + same_order_quantity: sameOrderQuantity, + raw_order_count: rawOrders.length, + warehouse_id: warehouseId, + distinguish_express: distinguishExpress, + }); + } + /** * 查询当前仓库波次策略列表。 * diff --git a/methods/changes/system.json b/methods/changes/system.json index f224873..9e8ef7d 100644 --- a/methods/changes/system.json +++ b/methods/changes/system.json @@ -1,4 +1,22 @@ [ + { + "version": "2026.09.28-order-wave-fetchable-order-count", + "date": "2026-09-28", + "type": "added", + "summary": "新增 order.wave.fetchableOrderCount:统计当前仓库团购可抓取订单数(与 order.wave.groupOrderFetchList 同口径:同一候选条件 + items_hash 粗分组 + 团购阈值过滤),但不分页、不查订单明细,仅返回命中分组数与组内订单数合计。", + "methods": [ + "order.wave.fetchableOrderCount" + ], + "notes": [ + "代码依据:app/service/systemMethods/order/wave.js 新增 async fetchableOrderCount(data)。候选 where 与 groupOrderFetchList 完全一致(step in [1,2,3]、status != cancel、outbound_status != padding、intercept_status='none'、lock_status='none'、wave_id=0,叠加 store_id / shop_name / stock_query 过滤);分组键复用 buildCoarseGroupKey(items_hash 缺省回落 items,distinguish_express=true 时再叠加 sys_logistics_code);阈值同源 getMinGroupOrderFetchQuantity(仓库配置,默认 13);仅取 id/items_hash/items/sys_logistics_code 四列,纯内存计数,不查订单明细。", + "口径差异(重要):groupOrderFetchList 的 pagination.total 是分组数(每组订单数在 item.group_count 内),本方法 order_count 是命中分组的订单数合计、group_count 是命中分组数;include_sku 为 groupOrderFetchList 的页内过滤参数,本方法不参与统计,因此带 include_sku 时两者不保证一致。", + "权限与日志:方法已加入 wave.js systemInit 的 _noNeedRight / _noNeedLog / _noNeedAuth 名单(与 groupOrderFetchList 一致),仅需登录;isNeedAuth=false,不产生 wms_permission 权限记录,无需执行 permission:sync:system-api,也不需要新增迁移。", + "返回结构:成功返回 flag=success/code=1,data 含 group_count / order_count / same_order_quantity / raw_order_count / warehouse_id / distinguish_express;仓库上下文缺失时返回 flag=failure/code=400「未识别到当前仓库上下文」。", + "测试:test/app/service/systemMethods/order/wave.fetchableOrderCount.test.js(8 用例:阈值命中统计、阈值变化、区分快递粒度、store_id+shop_name 进入候选 where、stock_query 空命中短路、仓库上下文缺失 400、默认阈值回落、与 groupOrderFetchList 命中分组订单数合计一致性)。", + "文档变更范围:methods/system.json 在 module=order.wave(订单波次模块)分组 list 末尾新增 1 条 method;根版本 0.3.194 → 0.3.195、updatedAt 2026-09-27 → 2026-09-28;methods/changes/system.json 新增本条(插入数组首位);其余 method 未改动。", + "维护源口径(遗留事项):methods/system.json 的维护源为库表(wms_api_method_doc + wms_method_doc_meta);本次按 docs/api-doc-update-workflow.md 走 npm run doc:api:update 直接写 JSON,未连接数据库、未写库,后续由维护者决定是否同步入库。" + ] + }, { "version": "2026.09.27-weigh-pack-message-simplify", "date": "2026-09-27", diff --git a/methods/system.json b/methods/system.json index b1183e2..1dce6b0 100644 --- a/methods/system.json +++ b/methods/system.json @@ -1,8 +1,8 @@ { "module": "system", "description": "系统接口标准入口,method 对应系统内置方法,全部使用 POST 请求,参数统一放在 body 内", - "version": "0.3.194", - "updatedAt": "2026-09-27", + "version": "0.3.195", + "updatedAt": "2026-09-28", "headers": [ { "name": "platform", @@ -11672,6 +11672,109 @@ "message": "内部错误" } ] + }, + { + "method": "order.wave.fetchableOrderCount", + "description": "统计当前仓库团购可抓取订单数。口径与 order.wave.groupOrderFetchList 完全一致(同一候选条件 + items_hash 粗分组 + 团购阈值过滤),但不分页、不查订单明细,仅返回达到团购阈值分组的数量与组内订单数合计。注意与 groupOrderFetchList 的口径差异:其 pagination.total 是分组数,本方法 order_count 是命中分组的订单数合计。", + "isNeedAuth": false, + "isNeedLogin": true, + "headers": [ + { + "name": "Authorization", + "type": "string", + "required": true, + "description": "Bearer token" + } + ], + "params": [ + { + "name": "distinguish_express", + "type": "boolean", + "required": false, + "source": "body", + "description": "是否区分快递(影响分组粒度):开启后按「结构(items_hash) + 快递编码」分组,关闭(默认)仅按结构分组。" + }, + { + "name": "store_id", + "type": "number", + "required": false, + "source": "body", + "description": "货主ID(仅作为筛选条件,需为非负整数)。" + }, + { + "name": "same_order_quantity", + "type": "number", + "required": false, + "source": "body", + "description": "最小同组订单数量阈值(>=)。显式传入有效非负整数且大于 0 时按传入值使用;未传入或为 0 时使用仓库配置 min_group_order_fetch_quantity(默认 13)。" + }, + { + "name": "shop_name", + "type": "string", + "required": false, + "source": "body", + "description": "店铺名称(shop_nick 模糊匹配)。" + }, + { + "name": "stock_query", + "type": "string", + "required": false, + "source": "body", + "description": "商品模糊筛选:经 stock_warehouse / stock_barcodes → order_items 限定候选订单范围;未匹配到任何商品时直接返回 group_count=0 / order_count=0。" + } + ], + "response": [ + { + "name": "group_count", + "type": "number", + "required": true, + "description": "达到团购阈值的分组数(同组订单数 >= same_order_quantity)。" + }, + { + "name": "order_count", + "type": "number", + "required": true, + "description": "可抓取订单数合计(命中分组内订单数之和;不含未达阈值分组的订单,也不含 items_hash/items 均为空无法分组的订单)。" + }, + { + "name": "same_order_quantity", + "type": "number", + "required": true, + "description": "本次统计实际使用的团购阈值(入参值或仓库配置值)。" + }, + { + "name": "raw_order_count", + "type": "number", + "required": true, + "description": "参与分组统计的候选订单总数(过滤团购阈值之前,便于核对口径)。" + }, + { + "name": "warehouse_id", + "type": "number", + "required": true, + "description": "当前仓库ID(取自登录上下文 ctx.user.store_id)。" + }, + { + "name": "distinguish_express", + "type": "boolean", + "required": true, + "description": "是否区分快递(回显本次分组粒度)。" + } + ], + "errors": [ + { + "code": "400", + "message": "未识别到当前仓库上下文" + }, + { + "code": "400", + "message": "参数格式错误(如 store_id / same_order_quantity 非非负整数)" + }, + { + "code": "500", + "message": "查询失败" + } + ] } ] },