@pisell/pisellos 2.3.74 → 2.3.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/index.js +6 -10
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/model/strategy/adapter/walletPass/example.js +3 -26
- package/dist/model/strategy/strategy-example.js +5 -19
- package/dist/modules/Cart/index.js +0 -3
- package/dist/modules/Cart/utils/cartProduct.js +0 -1
- package/dist/modules/Date/index.js +1 -5
- package/dist/modules/Discount/index.js +2 -4
- package/dist/modules/OpenData/index.js +0 -2
- package/dist/modules/Order/index.js +36 -64
- package/dist/modules/Payment/index.js +97 -162
- package/dist/modules/Rules/index.js +1 -4
- package/dist/modules/Schedule/index.js +0 -1
- package/dist/modules/Schedule/utils.js +0 -1
- package/dist/modules/Step/index.js +0 -1
- package/dist/plugins/request.js +1 -4
- package/dist/plugins/window.js +2 -6
- package/dist/server/index.js +97 -129
- package/dist/server/modules/menu/index.js +32 -41
- package/dist/server/modules/order/index.js +2 -4
- package/dist/server/modules/products/index.js +24 -42
- package/dist/server/modules/quotation/index.js +29 -38
- package/dist/server/modules/resource/index.js +3 -4
- package/dist/server/modules/schedule/index.js +27 -35
- package/dist/server/utils/product.js +0 -1
- package/dist/solution/BaseSales/index.js +38 -41
- package/dist/solution/BookingByStep/index.js +7 -59
- package/dist/solution/BookingByStep/utils/capacity.js +1 -11
- package/dist/solution/BookingByStep/utils/resources.js +1 -3
- package/dist/solution/BookingByStep/utils/timeslots.js +2 -43
- package/dist/solution/BookingTicket/index.js +0 -2
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +6 -7
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +25 -31
- package/dist/solution/BookingTicket/utils/scan/index.js +6 -10
- package/dist/solution/BuyTickets/index.js +9 -12
- package/dist/solution/Checkout/index.js +177 -252
- package/dist/solution/Checkout/utils/index.js +4 -16
- package/dist/solution/RegisterAndLogin/index.js +30 -76
- package/dist/solution/ScanOrder/index.js +50 -60
- package/dist/solution/ShopDiscount/index.js +2 -7
- package/dist/solution/VenueBooking/index.js +45 -55
- package/dist/utils/task.js +15 -18
- package/dist/utils/watch.js +0 -1
- package/lib/apis/picoding.js +2 -0
- package/lib/core/index.js +134 -134
- package/lib/effects/index.js +46 -57
- package/lib/index.js +82 -49
- package/lib/model/index.js +14 -21
- package/lib/model/strategy/adapter/dataVariant/adapter.js +38 -50
- package/lib/model/strategy/adapter/dataVariant/evaluator.js +162 -236
- package/lib/model/strategy/adapter/dataVariant/examples.js +229 -237
- package/lib/model/strategy/adapter/dataVariant/index.js +39 -34
- package/lib/model/strategy/adapter/dataVariant/type.js +57 -28
- package/lib/model/strategy/adapter/index.js +100 -64
- package/lib/model/strategy/adapter/itemRule/adapter.js +156 -144
- package/lib/model/strategy/adapter/itemRule/evaluator.js +36 -48
- package/lib/model/strategy/adapter/itemRule/examples.js +295 -225
- package/lib/model/strategy/adapter/itemRule/index.js +83 -57
- package/lib/model/strategy/adapter/itemRule/type.js +97 -36
- package/lib/model/strategy/adapter/promotion/adapter.js +91 -69
- package/lib/model/strategy/adapter/promotion/evaluator.js +444 -310
- package/lib/model/strategy/adapter/promotion/examples.js +222 -234
- package/lib/model/strategy/adapter/promotion/index.js +1 -0
- package/lib/model/strategy/adapter/promotion/type.js +243 -36
- package/lib/model/strategy/adapter/type.js +4 -16
- package/lib/model/strategy/adapter/walletPass/evaluator.js +180 -150
- package/lib/model/strategy/adapter/walletPass/example.js +217 -190
- package/lib/model/strategy/adapter/walletPass/index.js +75 -51
- package/lib/model/strategy/adapter/walletPass/locales.js +36 -58
- package/lib/model/strategy/adapter/walletPass/type.js +4 -16
- package/lib/model/strategy/adapter/walletPass/utils.js +588 -378
- package/lib/model/strategy/engine.js +270 -168
- package/lib/model/strategy/index.js +49 -34
- package/lib/model/strategy/strategy-example.js +243 -239
- package/lib/model/strategy/type.js +100 -40
- package/lib/modules/Account/index.js +39 -53
- package/lib/modules/Account/types.js +20 -33
- package/lib/modules/AccountList/index.js +116 -154
- package/lib/modules/AccountList/types.js +30 -31
- package/lib/modules/AccountList/utils.js +18 -30
- package/lib/modules/BaseModule.js +23 -42
- package/lib/modules/BookingContext/index.js +158 -136
- package/lib/modules/BookingContext/types.js +46 -32
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +138 -146
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +78 -83
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +170 -150
- package/lib/modules/BookingContext/utils/flexible.js +38 -55
- package/lib/modules/BookingContext/utils/formatResourceList.js +19 -34
- package/lib/modules/BookingContext/utils/index.js +124 -41
- package/lib/modules/BookingContext/utils/noResource.js +58 -70
- package/lib/modules/BookingContext/utils/orderLineDisplay.js +14 -41
- package/lib/modules/BookingContext/utils/productExtend.js +202 -155
- package/lib/modules/BookingContext/utils/resourceErrors.js +53 -53
- package/lib/modules/BookingContext/utils/resourceSelection.js +19 -41
- package/lib/modules/BookingContext/utils/resources.js +209 -167
- package/lib/modules/BookingContext/utils/serviceTimes.js +115 -116
- package/lib/modules/BookingContext/utils/timeSlices.js +76 -86
- package/lib/modules/Cart/index.js +170 -124
- package/lib/modules/Cart/types.js +46 -51
- package/lib/modules/Cart/utils/cartAccount.js +40 -39
- package/lib/modules/Cart/utils/cartDate.js +56 -61
- package/lib/modules/Cart/utils/cartDiscount.js +28 -33
- package/lib/modules/Cart/utils/cartNote.js +27 -32
- package/lib/modules/Cart/utils/cartProduct.js +321 -251
- package/lib/modules/Cart/utils/cartRelationForms.js +29 -35
- package/lib/modules/Cart/utils/cartResource.js +70 -78
- package/lib/modules/Cart/utils/changePrice.js +22 -50
- package/lib/modules/Cart/utils/index.js +106 -48
- package/lib/modules/Customer/constants.js +13 -34
- package/lib/modules/Customer/index.js +235 -172
- package/lib/modules/Customer/types.js +38 -35
- package/lib/modules/Date/index.js +116 -115
- package/lib/modules/Date/types.js +16 -28
- package/lib/modules/Date/utils.js +174 -123
- package/lib/modules/Discount/index.js +122 -127
- package/lib/modules/Discount/types.js +9 -31
- package/lib/modules/Guests/index.js +30 -56
- package/lib/modules/Guests/types.js +23 -33
- package/lib/modules/Holder/index.js +209 -189
- package/lib/modules/Holder/types.js +4 -16
- package/lib/modules/Holder/utils.js +20 -49
- package/lib/modules/OpenData/index.js +70 -76
- package/lib/modules/OpenData/types.js +4 -16
- package/lib/modules/OpenData/utils.js +44 -78
- package/lib/modules/Order/index.js +1713 -2118
- package/lib/modules/Order/payment-utils.js +77 -120
- package/lib/modules/Order/types.js +88 -35
- package/lib/modules/Order/utils/bundleDiscountHydration.js +41 -74
- package/lib/modules/Order/utils/discountProductLineIdentity.js +142 -100
- package/lib/modules/Order/utils/manualProductDiscount.js +124 -123
- package/lib/modules/Order/utils/orderCollectionIdentity.js +184 -244
- package/lib/modules/Order/utils.js +814 -647
- package/lib/modules/Payment/cash.js +20 -33
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +145 -76
- package/lib/modules/Payment/eftpos.js +16 -30
- package/lib/modules/Payment/index.js +532 -399
- package/lib/modules/Payment/mx51.js +1 -0
- package/lib/modules/Payment/types.js +230 -108
- package/lib/modules/Payment/utils.js +52 -51
- package/lib/modules/Payment/walletpass.js +485 -660
- package/lib/modules/Product/index.js +51 -46
- package/lib/modules/Product/types.js +4 -16
- package/lib/modules/Product/utils.js +32 -33
- package/lib/modules/ProductList/index.js +113 -123
- package/lib/modules/ProductList/types.js +9 -31
- package/lib/modules/Quotation/index.js +81 -118
- package/lib/modules/Quotation/types.js +4 -16
- package/lib/modules/Resource/index.js +27 -59
- package/lib/modules/Resource/types.js +22 -32
- package/lib/modules/Resource/utils.js +30 -38
- package/lib/modules/ResourcePlanner/index.js +25 -23
- package/lib/modules/ResourcePlanner/localClock.js +54 -119
- package/lib/modules/ResourcePlanner/planner.js +589 -770
- package/lib/modules/ResourcePlanner/types.js +10 -29
- package/lib/modules/Rules/index.js +1218 -959
- package/lib/modules/Rules/types.js +17 -40
- package/lib/modules/SalesSummary/index.js +85 -90
- package/lib/modules/SalesSummary/types.js +4 -16
- package/lib/modules/SalesSummary/utils.js +355 -430
- package/lib/modules/ScanOrderLogger/index.js +59 -79
- package/lib/modules/ScanOrderLogger/providers/feishu.js +54 -78
- package/lib/modules/ScanOrderLogger/providers/grafana.js +13 -36
- package/lib/modules/ScanOrderLogger/types.js +4 -16
- package/lib/modules/Schedule/getDateIsInSchedule.js +334 -163
- package/lib/modules/Schedule/index.js +100 -114
- package/lib/modules/Schedule/type.js +4 -16
- package/lib/modules/Schedule/types.js +4 -16
- package/lib/modules/Schedule/utils.js +433 -291
- package/lib/modules/Step/index.js +40 -52
- package/lib/modules/Step/tyeps.js +4 -16
- package/lib/modules/Summary/index.js +66 -71
- package/lib/modules/Summary/types.js +4 -16
- package/lib/modules/Summary/utils.js +773 -418
- package/lib/modules/SurchargeList/index.js +46 -60
- package/lib/modules/SurchargeList/types.js +4 -16
- package/lib/modules/index.js +245 -63
- package/lib/plugins/app.js +4 -16
- package/lib/plugins/index.js +36 -25
- package/lib/plugins/request.js +137 -126
- package/lib/plugins/shopStore.js +4 -16
- package/lib/plugins/user.js +4 -16
- package/lib/plugins/window.js +171 -179
- package/lib/server/index.js +3050 -2665
- package/lib/server/modules/floor-plan/index.js +118 -134
- package/lib/server/modules/floor-plan/types.js +15 -30
- package/lib/server/modules/index.js +106 -68
- package/lib/server/modules/menu/index.js +142 -122
- package/lib/server/modules/menu/types.js +18 -31
- package/lib/server/modules/order/index.js +784 -1002
- package/lib/server/modules/order/types.js +122 -33
- package/lib/server/modules/order/utils/filterBookings.js +219 -194
- package/lib/server/modules/order/utils/filterOrders.js +118 -92
- package/lib/server/modules/payment/index.js +59 -83
- package/lib/server/modules/payment/types.js +4 -16
- package/lib/server/modules/products/index.js +583 -471
- package/lib/server/modules/products/types.js +44 -34
- package/lib/server/modules/quotation/index.js +137 -172
- package/lib/server/modules/quotation/types.js +21 -31
- package/lib/server/modules/resource/index.js +220 -186
- package/lib/server/modules/resource/types.js +42 -33
- package/lib/server/modules/schedule/index.js +135 -123
- package/lib/server/modules/schedule/types.js +14 -21
- package/lib/server/modules/schedule/utils.js +334 -163
- package/lib/server/types.js +4 -16
- package/lib/server/utils/index.js +25 -23
- package/lib/server/utils/product.js +196 -139
- package/lib/server/utils/schedule.js +34 -41
- package/lib/server/utils/small-ticket.js +479 -456
- package/lib/server/utils/time.js +40 -49
- package/lib/solution/BaseSales/index.js +1186 -1410
- package/lib/solution/BaseSales/types.js +42 -38
- package/lib/solution/BaseSales/utils/cartPromotion.js +642 -498
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +85 -105
- package/lib/solution/BaseSales/utils/quotationPrice.js +56 -114
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +108 -145
- package/lib/solution/BaseSales/utils.js +158 -143
- package/lib/solution/BookingByStep/index.js +1527 -1340
- package/lib/solution/BookingByStep/types.js +40 -99
- package/lib/solution/BookingByStep/utils/capacity.js +192 -160
- package/lib/solution/BookingByStep/utils/products.js +42 -52
- package/lib/solution/BookingByStep/utils/resources.js +527 -330
- package/lib/solution/BookingByStep/utils/stock.js +65 -44
- package/lib/solution/BookingByStep/utils/timeslots.js +129 -131
- package/lib/solution/BookingTicket/index.js +607 -522
- package/lib/solution/BookingTicket/types.js +99 -77
- package/lib/solution/BookingTicket/utils/addProductDecision.js +226 -189
- package/lib/solution/BookingTicket/utils/addTimeAvailability.js +58 -89
- package/lib/solution/BookingTicket/utils/bookingStatus.js +107 -78
- package/lib/solution/BookingTicket/utils/cartView.js +114 -99
- package/lib/solution/BookingTicket/utils/exampleData.js +185 -0
- package/lib/solution/BookingTicket/utils/orderCustomer.js +18 -41
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +219 -86
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +168 -116
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +79 -91
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +54 -41
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +84 -81
- package/lib/solution/BookingTicket/utils/scan/index.js +98 -104
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +90 -43
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +52 -64
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +56 -58
- package/lib/solution/BookingTicket/utils/weighingProductSku.js +34 -48
- package/lib/solution/BuyTickets/index.js +67 -70
- package/lib/solution/BuyTickets/types.js +22 -38
- package/lib/solution/Checkout/index.js +1451 -1158
- package/lib/solution/Checkout/types.js +91 -61
- package/lib/solution/Checkout/utils/index.js +228 -156
- package/lib/solution/PlaceOrder/index.js +55 -0
- package/lib/solution/RegisterAndLogin/config.js +493 -460
- package/lib/solution/RegisterAndLogin/index.js +633 -630
- package/lib/solution/RegisterAndLogin/types.js +189 -76
- package/lib/solution/RegisterAndLogin/utils.js +183 -125
- package/lib/solution/Sales/index.js +328 -324
- package/lib/solution/Sales/types.js +27 -33
- package/lib/solution/ScanOrder/index.js +832 -864
- package/lib/solution/ScanOrder/types.js +33 -34
- package/lib/solution/ScanOrder/utils.js +409 -374
- package/lib/solution/ShopDiscount/index.js +226 -232
- package/lib/solution/ShopDiscount/types.js +15 -37
- package/lib/solution/ShopDiscount/utils.js +300 -172
- package/lib/solution/UnifiedBookingSales/index.js +1035 -1201
- package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +99 -159
- package/lib/solution/UnifiedBookingSales/types.js +10 -32
- package/lib/solution/VenueBooking/index.js +811 -879
- package/lib/solution/VenueBooking/types.js +19 -39
- package/lib/solution/VenueBooking/utils/dateSummary.js +27 -56
- package/lib/solution/VenueBooking/utils/resource.js +31 -54
- package/lib/solution/VenueBooking/utils/slotMerge.js +94 -107
- package/lib/solution/VenueBooking/utils/timeSlot.js +132 -132
- package/lib/solution/VenueBooking/utils.js +130 -67
- package/lib/solution/index.js +124 -41
- package/lib/store/createStore.js +32 -29
- package/lib/types/index.js +4 -16
- package/lib/utils/payment-number.js +26 -46
- package/lib/utils/task.js +36 -36
- package/lib/utils/watch.js +81 -47
- package/package.json +2 -1
package/dist/server/index.js
CHANGED
|
@@ -291,7 +291,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
291
291
|
while (1) switch (_context3.prev = _context3.next) {
|
|
292
292
|
case 0:
|
|
293
293
|
url = _ref5.url, method = _ref5.method, data = _ref5.data, config = _ref5.config;
|
|
294
|
-
console.log('[Server] handleProductQuery:', url, method, data, config);
|
|
295
294
|
menu_list_ids = data.menu_list_ids, customer_id = data.customer_id, ids = data.ids, extension_type = data.extension_type, strategy_context = data.strategy_context;
|
|
296
295
|
_this$resolveProductQ = _this.resolveProductQueryScheduleContext({
|
|
297
296
|
schedule_date: data.schedule_date,
|
|
@@ -327,7 +326,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
327
326
|
totalSubscribers: _this.productQuerySubscribers.size
|
|
328
327
|
});
|
|
329
328
|
}
|
|
330
|
-
_context3.next =
|
|
329
|
+
_context3.next = 8;
|
|
331
330
|
return _this.computeProductQueryResult({
|
|
332
331
|
menu_list_ids: menu_list_ids,
|
|
333
332
|
ids: ids,
|
|
@@ -337,7 +336,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
337
336
|
extension_type: extension_type,
|
|
338
337
|
strategy_context: strategy_context
|
|
339
338
|
});
|
|
340
|
-
case
|
|
339
|
+
case 8:
|
|
341
340
|
result = _context3.sent;
|
|
342
341
|
if (subscriberId && typeof callback === 'function') {
|
|
343
342
|
_this.syncProductQueryScheduleTimers({
|
|
@@ -347,7 +346,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
347
346
|
});
|
|
348
347
|
}
|
|
349
348
|
return _context3.abrupt("return", result);
|
|
350
|
-
case
|
|
349
|
+
case 11:
|
|
351
350
|
case "end":
|
|
352
351
|
return _context3.stop();
|
|
353
352
|
}
|
|
@@ -371,9 +370,8 @@ var Server = /*#__PURE__*/function () {
|
|
|
371
370
|
pathname = _this.parseRequestPath(url || '', path);
|
|
372
371
|
idMatch = pathname.match(/^\/shop\/product\/query\/(\d+)$/);
|
|
373
372
|
productId = idMatch ? Number(idMatch[1]) : NaN;
|
|
374
|
-
console.log('[Server] handleProductQueryById:', pathname, method, data);
|
|
375
373
|
if (Number.isFinite(productId)) {
|
|
376
|
-
_context4.next =
|
|
374
|
+
_context4.next = 7;
|
|
377
375
|
break;
|
|
378
376
|
}
|
|
379
377
|
_this.logWarning('handleProductQueryById: 无效的商品 id', {
|
|
@@ -387,11 +385,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
387
385
|
item: null
|
|
388
386
|
}
|
|
389
387
|
});
|
|
390
|
-
case
|
|
388
|
+
case 7:
|
|
391
389
|
scheduleDateFromData = data && _typeof(data) === 'object' && typeof data.schedule_date === 'string' ? data.schedule_date.trim() : '';
|
|
392
390
|
schedule_date = scheduleDateFromData || (_this.extractQueryParam(url || '', 'schedule_date') || '').trim() || dayjs().format('YYYY-MM-DD');
|
|
393
391
|
if (schedule_date) {
|
|
394
|
-
_context4.next =
|
|
392
|
+
_context4.next = 12;
|
|
395
393
|
break;
|
|
396
394
|
}
|
|
397
395
|
_this.logWarning('handleProductQueryById: 缺少 schedule_date', {
|
|
@@ -403,7 +401,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
403
401
|
status: false,
|
|
404
402
|
data: null
|
|
405
403
|
});
|
|
406
|
-
case
|
|
404
|
+
case 12:
|
|
407
405
|
scheduleDtFromData = data && _typeof(data) === 'object' && typeof data.schedule_datetime === 'string' ? data.schedule_datetime.trim() : '';
|
|
408
406
|
scheduleDtFromUrl = (_this.extractQueryParam(url || '', 'schedule_datetime') || '').trim();
|
|
409
407
|
scheduleDatetime = scheduleDtFromData || scheduleDtFromUrl || "".concat(schedule_date, "T00:00:00");
|
|
@@ -417,7 +415,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
417
415
|
schedule_datetime: scheduleDatetime,
|
|
418
416
|
product_id: productId
|
|
419
417
|
}));
|
|
420
|
-
case
|
|
418
|
+
case 17:
|
|
421
419
|
case "end":
|
|
422
420
|
return _context4.stop();
|
|
423
421
|
}
|
|
@@ -465,7 +463,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
465
463
|
while (1) switch (_context6.prev = _context6.next) {
|
|
466
464
|
case 0:
|
|
467
465
|
url = _ref13.url, method = _ref13.method, data = _ref13.data, config = _ref13.config;
|
|
468
|
-
console.log('[Server] handleOrderList:', url, method, data, config);
|
|
469
466
|
queryPayload = data && _typeof(data) === 'object' ? _objectSpread({}, data) : {};
|
|
470
467
|
_ref15 = config || {}, callback = _ref15.callback, subscriberId = _ref15.subscriberId;
|
|
471
468
|
useLocal = _this.shouldUseLocalOrderQuery(queryPayload);
|
|
@@ -474,7 +471,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
474
471
|
useLocal: useLocal
|
|
475
472
|
});
|
|
476
473
|
if (!useLocal) {
|
|
477
|
-
_context6.next =
|
|
474
|
+
_context6.next = 8;
|
|
478
475
|
break;
|
|
479
476
|
}
|
|
480
477
|
if (subscriberId && typeof callback === 'function') {
|
|
@@ -488,7 +485,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
488
485
|
});
|
|
489
486
|
}
|
|
490
487
|
return _context6.abrupt("return", _this.computeOrderQueryResult(queryPayload));
|
|
491
|
-
case
|
|
488
|
+
case 8:
|
|
492
489
|
if (subscriberId) {
|
|
493
490
|
_this.orderQuerySubscribers.delete(subscriberId);
|
|
494
491
|
_this.logInfo('handleOrderList: 已清理订阅者(走远端)', {
|
|
@@ -497,7 +494,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
497
494
|
});
|
|
498
495
|
}
|
|
499
496
|
return _context6.abrupt("return", _this.fetchOrderListFromAPI(queryPayload));
|
|
500
|
-
case
|
|
497
|
+
case 10:
|
|
501
498
|
case "end":
|
|
502
499
|
return _context6.stop();
|
|
503
500
|
}
|
|
@@ -640,7 +637,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
640
637
|
while (1) switch (_context11.prev = _context11.next) {
|
|
641
638
|
case 0:
|
|
642
639
|
url = _ref26.url, method = _ref26.method, data = _ref26.data, config = _ref26.config;
|
|
643
|
-
console.log('[Server] handleBookingList:', url, method, data, config);
|
|
644
640
|
queryPayload = data && _typeof(data) === 'object' ? _objectSpread({}, data) : {};
|
|
645
641
|
_ref28 = config || {}, callback = _ref28.callback, subscriberId = _ref28.subscriberId;
|
|
646
642
|
useLocal = _this.shouldUseLocalBookingQuery(queryPayload);
|
|
@@ -649,7 +645,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
649
645
|
useLocal: useLocal
|
|
650
646
|
});
|
|
651
647
|
if (!useLocal) {
|
|
652
|
-
_context11.next =
|
|
648
|
+
_context11.next = 11;
|
|
653
649
|
break;
|
|
654
650
|
}
|
|
655
651
|
if (subscriberId) {
|
|
@@ -666,7 +662,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
666
662
|
});
|
|
667
663
|
}
|
|
668
664
|
return _context11.abrupt("return", _this.computeBookingQueryResult(queryPayload));
|
|
669
|
-
case
|
|
665
|
+
case 11:
|
|
670
666
|
if (subscriberId) {
|
|
671
667
|
_this.bookingQuerySubscribers.delete(subscriberId);
|
|
672
668
|
}
|
|
@@ -692,7 +688,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
692
688
|
});
|
|
693
689
|
}
|
|
694
690
|
return _context11.abrupt("return", _this.fetchBookingListFromAPI(queryPayload));
|
|
695
|
-
case
|
|
691
|
+
case 15:
|
|
696
692
|
case "end":
|
|
697
693
|
return _context11.stop();
|
|
698
694
|
}
|
|
@@ -714,7 +710,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
714
710
|
while (1) switch (_context12.prev = _context12.next) {
|
|
715
711
|
case 0:
|
|
716
712
|
url = _ref29.url, method = _ref29.method, data = _ref29.data, config = _ref29.config;
|
|
717
|
-
console.log('[Server] handleResourceList:', url, method, data, config);
|
|
718
713
|
list = (_this$resource = _this.resource) === null || _this$resource === void 0 ? void 0 : _this$resource.getResources({
|
|
719
714
|
skip: (data === null || data === void 0 ? void 0 : data.skip) || 1,
|
|
720
715
|
num: (data === null || data === void 0 ? void 0 : data.num) || 10
|
|
@@ -731,7 +726,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
731
726
|
message: '',
|
|
732
727
|
status: true
|
|
733
728
|
});
|
|
734
|
-
case
|
|
729
|
+
case 4:
|
|
735
730
|
case "end":
|
|
736
731
|
return _context12.stop();
|
|
737
732
|
}
|
|
@@ -1692,7 +1687,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
1692
1687
|
while (1) switch (_context24.prev = _context24.next) {
|
|
1693
1688
|
case 0:
|
|
1694
1689
|
url = _ref58.url, method = _ref58.method, data = _ref58.data, config = _ref58.config;
|
|
1695
|
-
console.log('[Server] handleGetScheduleTimePoints:', url, method, data, config);
|
|
1696
1690
|
menu_list_ids = data.menu_list_ids;
|
|
1697
1691
|
_this.logInfo('handleGetScheduleTimePoints 开始处理', {
|
|
1698
1692
|
menuListIdsCount: (_menu_list_ids$length = menu_list_ids === null || menu_list_ids === void 0 ? void 0 : menu_list_ids.length) !== null && _menu_list_ids$length !== void 0 ? _menu_list_ids$length : 0,
|
|
@@ -1701,7 +1695,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
1701
1695
|
|
|
1702
1696
|
// 检查必要的模块是否已注册
|
|
1703
1697
|
if (_this.menu) {
|
|
1704
|
-
_context24.next =
|
|
1698
|
+
_context24.next = 7;
|
|
1705
1699
|
break;
|
|
1706
1700
|
}
|
|
1707
1701
|
console.error('[Server] Menu 模块未注册');
|
|
@@ -1712,9 +1706,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
1712
1706
|
data: [],
|
|
1713
1707
|
status: false
|
|
1714
1708
|
});
|
|
1715
|
-
case
|
|
1709
|
+
case 7:
|
|
1716
1710
|
if (_this.schedule) {
|
|
1717
|
-
_context24.next =
|
|
1711
|
+
_context24.next = 11;
|
|
1718
1712
|
break;
|
|
1719
1713
|
}
|
|
1720
1714
|
console.error('[Server] Schedule 模块未注册');
|
|
@@ -1725,9 +1719,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
1725
1719
|
data: [],
|
|
1726
1720
|
status: false
|
|
1727
1721
|
});
|
|
1728
|
-
case
|
|
1722
|
+
case 11:
|
|
1729
1723
|
if (!(!menu_list_ids || !Array.isArray(menu_list_ids) || menu_list_ids.length === 0)) {
|
|
1730
|
-
_context24.next =
|
|
1724
|
+
_context24.next = 15;
|
|
1731
1725
|
break;
|
|
1732
1726
|
}
|
|
1733
1727
|
console.error('[Server] menu_list_ids 参数无效');
|
|
@@ -1741,22 +1735,20 @@ var Server = /*#__PURE__*/function () {
|
|
|
1741
1735
|
data: [],
|
|
1742
1736
|
status: false
|
|
1743
1737
|
});
|
|
1744
|
-
case
|
|
1745
|
-
_context24.prev =
|
|
1738
|
+
case 15:
|
|
1739
|
+
_context24.prev = 15;
|
|
1746
1740
|
_this$getMenuSchedule = _this.getMenuScheduleTimePoints(menu_list_ids), menuList = _this$getMenuSchedule.menuList, scheduleIds = _this$getMenuSchedule.scheduleIds, scheduleList = _this$getMenuSchedule.scheduleList, timePoints = _this$getMenuSchedule.timePoints;
|
|
1747
|
-
console.log("[Server] \u627E\u5230 ".concat(menuList.length, " \u4E2A\u9910\u724C"));
|
|
1748
1741
|
_this.logInfo('handleGetScheduleTimePoints: 获取到餐牌列表', {
|
|
1749
1742
|
requestedCount: menu_list_ids.length,
|
|
1750
1743
|
foundCount: menuList.length,
|
|
1751
1744
|
menu_list_ids: menu_list_ids,
|
|
1752
1745
|
menuList: menuList
|
|
1753
1746
|
});
|
|
1754
|
-
console.log("[Server] \u63D0\u53D6\u5230 ".concat(scheduleIds.length, " \u4E2A\u65E5\u7A0BID:"), scheduleIds);
|
|
1755
1747
|
_this.logInfo('handleGetScheduleTimePoints: 提取到日程 IDs', {
|
|
1756
1748
|
scheduleCount: scheduleIds.length
|
|
1757
1749
|
});
|
|
1758
1750
|
if (!(scheduleIds.length === 0)) {
|
|
1759
|
-
_context24.next =
|
|
1751
|
+
_context24.next = 22;
|
|
1760
1752
|
break;
|
|
1761
1753
|
}
|
|
1762
1754
|
_this.logInfo('handleGetScheduleTimePoints: 没有找到相关日程', {
|
|
@@ -1768,13 +1760,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
1768
1760
|
data: [],
|
|
1769
1761
|
status: true
|
|
1770
1762
|
});
|
|
1771
|
-
case
|
|
1772
|
-
console.log("[Server] \u627E\u5230 ".concat(scheduleList.length, " \u4E2A\u65E5\u7A0B"));
|
|
1763
|
+
case 22:
|
|
1773
1764
|
_this.logInfo('handleGetScheduleTimePoints: 获取到日程详情', {
|
|
1774
1765
|
requestedCount: scheduleIds.length,
|
|
1775
1766
|
foundCount: scheduleList.length
|
|
1776
1767
|
});
|
|
1777
|
-
console.log("[Server] \u63D0\u53D6\u5230 ".concat(timePoints.length, " \u4E2A\u65F6\u95F4\u70B9:"), timePoints);
|
|
1778
1768
|
_this.logInfo('handleGetScheduleTimePoints 处理完成', {
|
|
1779
1769
|
menuListIdsCount: menu_list_ids.length,
|
|
1780
1770
|
menuCount: menuList.length,
|
|
@@ -1787,9 +1777,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
1787
1777
|
data: timePoints,
|
|
1788
1778
|
status: true
|
|
1789
1779
|
});
|
|
1790
|
-
case
|
|
1791
|
-
_context24.prev =
|
|
1792
|
-
_context24.t0 = _context24["catch"](
|
|
1780
|
+
case 27:
|
|
1781
|
+
_context24.prev = 27;
|
|
1782
|
+
_context24.t0 = _context24["catch"](15);
|
|
1793
1783
|
errorMessage = _context24.t0 instanceof Error ? _context24.t0.message : '未知错误';
|
|
1794
1784
|
console.error('[Server] 获取日程时间点失败:', _context24.t0);
|
|
1795
1785
|
_this.logError('handleGetScheduleTimePoints: 获取日程时间点失败', {
|
|
@@ -1802,11 +1792,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
1802
1792
|
data: [],
|
|
1803
1793
|
status: false
|
|
1804
1794
|
});
|
|
1805
|
-
case
|
|
1795
|
+
case 33:
|
|
1806
1796
|
case "end":
|
|
1807
1797
|
return _context24.stop();
|
|
1808
1798
|
}
|
|
1809
|
-
}, _callee24, null, [[
|
|
1799
|
+
}, _callee24, null, [[15, 27]]);
|
|
1810
1800
|
}));
|
|
1811
1801
|
return function (_x24) {
|
|
1812
1802
|
return _ref59.apply(this, arguments);
|
|
@@ -1816,7 +1806,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
1816
1806
|
var appPlugin = core.getPlugin('app');
|
|
1817
1807
|
this.app = (appPlugin === null || appPlugin === void 0 ? void 0 : appPlugin.getApp()) || null;
|
|
1818
1808
|
this.logger = ((_this$app4 = this.app) === null || _this$app4 === void 0 ? void 0 : _this$app4.logger) || null;
|
|
1819
|
-
console.log('[Server] Server 初始化', this.core);
|
|
1820
1809
|
this.logInfo('Server 初始化', {
|
|
1821
1810
|
hasApp: !!this.app,
|
|
1822
1811
|
hasLogger: !!this.logger
|
|
@@ -1877,7 +1866,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
1877
1866
|
});
|
|
1878
1867
|
}
|
|
1879
1868
|
_this2.router[method][path] = handler;
|
|
1880
|
-
console.log("[Server] \uD83D\uDCDD \u6CE8\u518C\u8DEF\u7531: ".concat(method.toUpperCase(), " ").concat(path));
|
|
1881
1869
|
_this2.logInfo("\u6CE8\u518C\u8DEF\u7531", {
|
|
1882
1870
|
method: method.toUpperCase(),
|
|
1883
1871
|
path: path
|
|
@@ -1944,7 +1932,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
1944
1932
|
_context25.next = 3;
|
|
1945
1933
|
return this.core.registerModule(module, options);
|
|
1946
1934
|
case 3:
|
|
1947
|
-
console.log("[Server] \u2705 ".concat(moduleName, " \u6A21\u5757\u5DF2\u6CE8\u518C"));
|
|
1948
1935
|
this.logInfo("\u6A21\u5757\u6CE8\u518C\u6210\u529F: ".concat(moduleName), {
|
|
1949
1936
|
moduleName: moduleName
|
|
1950
1937
|
});
|
|
@@ -1960,7 +1947,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
1960
1947
|
});
|
|
1961
1948
|
}
|
|
1962
1949
|
}
|
|
1963
|
-
case
|
|
1950
|
+
case 5:
|
|
1964
1951
|
case "end":
|
|
1965
1952
|
return _context25.stop();
|
|
1966
1953
|
}
|
|
@@ -2050,8 +2037,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
2050
2037
|
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2051
2038
|
while (1) switch (_context27.prev = _context27.next) {
|
|
2052
2039
|
case 0:
|
|
2053
|
-
console.log('[Server] 开始注册模块...');
|
|
2054
|
-
|
|
2055
2040
|
// 如果没有指定模块,则注册所有模块
|
|
2056
2041
|
configs = moduleConfigs || Object.keys(this.moduleRegistry);
|
|
2057
2042
|
this.logInfo('开始批量注册模块', {
|
|
@@ -2060,26 +2045,26 @@ var Server = /*#__PURE__*/function () {
|
|
|
2060
2045
|
});
|
|
2061
2046
|
registeredModules = [];
|
|
2062
2047
|
_iterator2 = _createForOfIteratorHelper(configs);
|
|
2063
|
-
_context27.prev =
|
|
2048
|
+
_context27.prev = 4;
|
|
2064
2049
|
_iterator2.s();
|
|
2065
|
-
case
|
|
2050
|
+
case 6:
|
|
2066
2051
|
if ((_step2 = _iterator2.n()).done) {
|
|
2067
|
-
_context27.next =
|
|
2052
|
+
_context27.next = 24;
|
|
2068
2053
|
break;
|
|
2069
2054
|
}
|
|
2070
2055
|
config = _step2.value;
|
|
2071
2056
|
configName = typeof config === 'string' ? config : config.name;
|
|
2072
|
-
_context27.prev =
|
|
2073
|
-
_context27.next =
|
|
2057
|
+
_context27.prev = 9;
|
|
2058
|
+
_context27.next = 12;
|
|
2074
2059
|
return this.registerModuleByName(config);
|
|
2075
|
-
case
|
|
2060
|
+
case 12:
|
|
2076
2061
|
result = _context27.sent;
|
|
2077
2062
|
registeredModules.push(result);
|
|
2078
|
-
_context27.next =
|
|
2063
|
+
_context27.next = 22;
|
|
2079
2064
|
break;
|
|
2080
|
-
case
|
|
2081
|
-
_context27.prev =
|
|
2082
|
-
_context27.t0 = _context27["catch"](
|
|
2065
|
+
case 16:
|
|
2066
|
+
_context27.prev = 16;
|
|
2067
|
+
_context27.t0 = _context27["catch"](9);
|
|
2083
2068
|
errorMessage = _context27.t0 instanceof Error ? _context27.t0.message : String(_context27.t0);
|
|
2084
2069
|
this.logError("\u6A21\u5757\u6CE8\u518C\u5931\u8D25: ".concat(configName), {
|
|
2085
2070
|
moduleName: configName,
|
|
@@ -2087,22 +2072,21 @@ var Server = /*#__PURE__*/function () {
|
|
|
2087
2072
|
});
|
|
2088
2073
|
console.error("[Server] \u6A21\u5757\u6CE8\u518C\u5931\u8D25:", _context27.t0);
|
|
2089
2074
|
throw _context27.t0;
|
|
2090
|
-
case
|
|
2091
|
-
_context27.next =
|
|
2075
|
+
case 22:
|
|
2076
|
+
_context27.next = 6;
|
|
2092
2077
|
break;
|
|
2093
|
-
case
|
|
2094
|
-
_context27.next =
|
|
2078
|
+
case 24:
|
|
2079
|
+
_context27.next = 29;
|
|
2095
2080
|
break;
|
|
2096
|
-
case
|
|
2097
|
-
_context27.prev =
|
|
2098
|
-
_context27.t1 = _context27["catch"](
|
|
2081
|
+
case 26:
|
|
2082
|
+
_context27.prev = 26;
|
|
2083
|
+
_context27.t1 = _context27["catch"](4);
|
|
2099
2084
|
_iterator2.e(_context27.t1);
|
|
2100
|
-
case
|
|
2101
|
-
_context27.prev =
|
|
2085
|
+
case 29:
|
|
2086
|
+
_context27.prev = 29;
|
|
2102
2087
|
_iterator2.f();
|
|
2103
|
-
return _context27.finish(
|
|
2104
|
-
case
|
|
2105
|
-
console.log('[Server] ✅ 所有模块注册完成');
|
|
2088
|
+
return _context27.finish(29);
|
|
2089
|
+
case 32:
|
|
2106
2090
|
this.logInfo('所有模块注册完成', {
|
|
2107
2091
|
registeredCount: registeredModules.length,
|
|
2108
2092
|
moduleNames: registeredModules.map(function (m) {
|
|
@@ -2111,11 +2095,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
2111
2095
|
})
|
|
2112
2096
|
});
|
|
2113
2097
|
return _context27.abrupt("return", registeredModules);
|
|
2114
|
-
case
|
|
2098
|
+
case 34:
|
|
2115
2099
|
case "end":
|
|
2116
2100
|
return _context27.stop();
|
|
2117
2101
|
}
|
|
2118
|
-
}, _callee27, this, [[
|
|
2102
|
+
}, _callee27, this, [[4, 26, 29, 32], [9, 16]]);
|
|
2119
2103
|
}));
|
|
2120
2104
|
function registerModules(_x29) {
|
|
2121
2105
|
return _registerModules.apply(this, arguments);
|
|
@@ -2135,7 +2119,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
2135
2119
|
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
2136
2120
|
while (1) switch (_context28.prev = _context28.next) {
|
|
2137
2121
|
case 0:
|
|
2138
|
-
console.log('[Server] 开始预加载模块数据...');
|
|
2139
2122
|
modulesToPreload = registeredModules.filter(function (m) {
|
|
2140
2123
|
return m.shouldPreload;
|
|
2141
2124
|
});
|
|
@@ -2146,41 +2129,39 @@ var Server = /*#__PURE__*/function () {
|
|
|
2146
2129
|
});
|
|
2147
2130
|
preloadResults = [];
|
|
2148
2131
|
_iterator3 = _createForOfIteratorHelper(registeredModules);
|
|
2149
|
-
_context28.prev =
|
|
2132
|
+
_context28.prev = 4;
|
|
2150
2133
|
_iterator3.s();
|
|
2151
|
-
case
|
|
2134
|
+
case 6:
|
|
2152
2135
|
if ((_step3 = _iterator3.n()).done) {
|
|
2153
|
-
_context28.next =
|
|
2136
|
+
_context28.next = 36;
|
|
2154
2137
|
break;
|
|
2155
2138
|
}
|
|
2156
2139
|
_step3$value = _step3.value, module = _step3$value.module, config = _step3$value.config, shouldPreload = _step3$value.shouldPreload;
|
|
2157
2140
|
if (shouldPreload) {
|
|
2158
|
-
_context28.next =
|
|
2141
|
+
_context28.next = 11;
|
|
2159
2142
|
break;
|
|
2160
2143
|
}
|
|
2161
|
-
console.log("[Server] \u23ED\uFE0F \u8DF3\u8FC7 ".concat(config.name, " \u6A21\u5757\u9884\u52A0\u8F7D"));
|
|
2162
2144
|
this.logInfo("\u8DF3\u8FC7\u6A21\u5757\u9884\u52A0\u8F7D: ".concat(config.name), {
|
|
2163
2145
|
moduleName: config.name,
|
|
2164
2146
|
reason: 'shouldPreload=false'
|
|
2165
2147
|
});
|
|
2166
|
-
return _context28.abrupt("continue",
|
|
2167
|
-
case
|
|
2148
|
+
return _context28.abrupt("continue", 34);
|
|
2149
|
+
case 11:
|
|
2168
2150
|
if (!(typeof module.preload === 'function')) {
|
|
2169
|
-
_context28.next =
|
|
2151
|
+
_context28.next = 33;
|
|
2170
2152
|
break;
|
|
2171
2153
|
}
|
|
2172
2154
|
startTime = Date.now();
|
|
2173
|
-
_context28.prev =
|
|
2155
|
+
_context28.prev = 13;
|
|
2174
2156
|
this.logInfo("\u5F00\u59CB\u9884\u52A0\u8F7D\u6A21\u5757: ".concat(config.name), {
|
|
2175
2157
|
moduleName: config.name
|
|
2176
2158
|
});
|
|
2177
2159
|
options === null || options === void 0 || (_options$onModuleLoad = options.onModuleLoad) === null || _options$onModuleLoad === void 0 || _options$onModuleLoad.call(options, config.name);
|
|
2178
|
-
_context28.next =
|
|
2160
|
+
_context28.next = 18;
|
|
2179
2161
|
return module.preload();
|
|
2180
|
-
case
|
|
2162
|
+
case 18:
|
|
2181
2163
|
options === null || options === void 0 || (_options$onModuleLoad2 = options.onModuleLoadComplete) === null || _options$onModuleLoad2 === void 0 || _options$onModuleLoad2.call(options, config.name);
|
|
2182
2164
|
duration = Date.now() - startTime;
|
|
2183
|
-
console.log("[Server] \u2705 ".concat(config.name, " \u6A21\u5757\u6570\u636E\u5DF2\u9884\u52A0\u8F7D"));
|
|
2184
2165
|
this.logInfo("\u6A21\u5757\u9884\u52A0\u8F7D\u6210\u529F: ".concat(config.name), {
|
|
2185
2166
|
moduleName: config.name,
|
|
2186
2167
|
duration: "".concat(duration, "ms")
|
|
@@ -2189,11 +2170,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
2189
2170
|
name: config.name,
|
|
2190
2171
|
success: true
|
|
2191
2172
|
});
|
|
2192
|
-
_context28.next =
|
|
2173
|
+
_context28.next = 31;
|
|
2193
2174
|
break;
|
|
2194
|
-
case
|
|
2195
|
-
_context28.prev =
|
|
2196
|
-
_context28.t0 = _context28["catch"](
|
|
2175
|
+
case 24:
|
|
2176
|
+
_context28.prev = 24;
|
|
2177
|
+
_context28.t0 = _context28["catch"](13);
|
|
2197
2178
|
_duration = Date.now() - startTime;
|
|
2198
2179
|
errorMessage = _context28.t0 instanceof Error ? _context28.t0.message : String(_context28.t0);
|
|
2199
2180
|
console.error("[Server] \u274C ".concat(config.name, " \u6A21\u5757\u9884\u52A0\u8F7D\u5931\u8D25:"), _context28.t0);
|
|
@@ -2207,45 +2188,43 @@ var Server = /*#__PURE__*/function () {
|
|
|
2207
2188
|
success: false,
|
|
2208
2189
|
error: errorMessage
|
|
2209
2190
|
});
|
|
2210
|
-
case
|
|
2211
|
-
_context28.next =
|
|
2191
|
+
case 31:
|
|
2192
|
+
_context28.next = 34;
|
|
2212
2193
|
break;
|
|
2213
|
-
case
|
|
2214
|
-
console.log("[Server] \u26A0\uFE0F ".concat(config.name, " \u6A21\u5757\u672A\u5B9E\u73B0 preload() \u65B9\u6CD5"));
|
|
2194
|
+
case 33:
|
|
2215
2195
|
this.logWarning("\u6A21\u5757\u672A\u5B9E\u73B0 preload \u65B9\u6CD5: ".concat(config.name), {
|
|
2216
2196
|
moduleName: config.name
|
|
2217
2197
|
});
|
|
2218
|
-
case
|
|
2219
|
-
_context28.next =
|
|
2198
|
+
case 34:
|
|
2199
|
+
_context28.next = 6;
|
|
2220
2200
|
break;
|
|
2221
|
-
case
|
|
2222
|
-
_context28.next =
|
|
2201
|
+
case 36:
|
|
2202
|
+
_context28.next = 41;
|
|
2223
2203
|
break;
|
|
2224
|
-
case
|
|
2225
|
-
_context28.prev =
|
|
2226
|
-
_context28.t1 = _context28["catch"](
|
|
2204
|
+
case 38:
|
|
2205
|
+
_context28.prev = 38;
|
|
2206
|
+
_context28.t1 = _context28["catch"](4);
|
|
2227
2207
|
_iterator3.e(_context28.t1);
|
|
2228
|
-
case
|
|
2229
|
-
_context28.prev =
|
|
2208
|
+
case 41:
|
|
2209
|
+
_context28.prev = 41;
|
|
2230
2210
|
_iterator3.f();
|
|
2231
|
-
return _context28.finish(
|
|
2232
|
-
case
|
|
2211
|
+
return _context28.finish(41);
|
|
2212
|
+
case 44:
|
|
2233
2213
|
successCount = preloadResults.filter(function (r) {
|
|
2234
2214
|
return r.success;
|
|
2235
2215
|
}).length;
|
|
2236
2216
|
failCount = preloadResults.filter(function (r) {
|
|
2237
2217
|
return !r.success;
|
|
2238
2218
|
}).length;
|
|
2239
|
-
console.log('[Server] ✅ 所有模块数据预加载完成');
|
|
2240
2219
|
this.logInfo('所有模块预加载完成', {
|
|
2241
2220
|
successCount: successCount,
|
|
2242
2221
|
failCount: failCount
|
|
2243
2222
|
});
|
|
2244
|
-
case
|
|
2223
|
+
case 47:
|
|
2245
2224
|
case "end":
|
|
2246
2225
|
return _context28.stop();
|
|
2247
2226
|
}
|
|
2248
|
-
}, _callee28, this, [[
|
|
2227
|
+
}, _callee28, this, [[4, 38, 41, 44], [13, 24]]);
|
|
2249
2228
|
}));
|
|
2250
2229
|
function preloadModulesData(_x30, _x31) {
|
|
2251
2230
|
return _preloadModulesData.apply(this, arguments);
|
|
@@ -3074,7 +3053,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
3074
3053
|
return _regeneratorRuntime().wrap(function _callee37$(_context37) {
|
|
3075
3054
|
while (1) switch (_context37.prev = _context37.next) {
|
|
3076
3055
|
case 0:
|
|
3077
|
-
console.log('[Server] 开始清空所有模块的IndexedDB缓存...');
|
|
3078
3056
|
this.logInfo('开始清空所有模块的 IndexedDB 缓存');
|
|
3079
3057
|
clearTasks = [];
|
|
3080
3058
|
moduleNames = []; // 收集所有模块的清空任务
|
|
@@ -3107,29 +3085,28 @@ var Server = /*#__PURE__*/function () {
|
|
|
3107
3085
|
moduleNames.push('FloorPlan');
|
|
3108
3086
|
}
|
|
3109
3087
|
if (!(clearTasks.length === 0)) {
|
|
3110
|
-
_context37.next =
|
|
3088
|
+
_context37.next = 14;
|
|
3111
3089
|
break;
|
|
3112
3090
|
}
|
|
3113
3091
|
console.warn('[Server] 没有找到已注册的模块,无需清空');
|
|
3114
3092
|
this.logWarning('没有找到已注册的模块,无需清空 IndexedDB');
|
|
3115
3093
|
return _context37.abrupt("return");
|
|
3116
|
-
case
|
|
3094
|
+
case 14:
|
|
3117
3095
|
this.logInfo('准备清空模块缓存', {
|
|
3118
3096
|
moduleNames: moduleNames
|
|
3119
3097
|
});
|
|
3120
|
-
_context37.prev =
|
|
3121
|
-
_context37.next =
|
|
3098
|
+
_context37.prev = 15;
|
|
3099
|
+
_context37.next = 18;
|
|
3122
3100
|
return Promise.all(clearTasks);
|
|
3123
|
-
case
|
|
3124
|
-
console.log("[Server] \u2705 \u5DF2\u6210\u529F\u6E05\u7A7A\u6240\u6709\u6A21\u5757\u7684IndexedDB\u7F13\u5B58: ".concat(moduleNames.join(', ')));
|
|
3101
|
+
case 18:
|
|
3125
3102
|
this.logInfo('成功清空所有模块的 IndexedDB 缓存', {
|
|
3126
3103
|
moduleNames: moduleNames
|
|
3127
3104
|
});
|
|
3128
|
-
_context37.next =
|
|
3105
|
+
_context37.next = 27;
|
|
3129
3106
|
break;
|
|
3130
|
-
case
|
|
3131
|
-
_context37.prev =
|
|
3132
|
-
_context37.t0 = _context37["catch"](
|
|
3107
|
+
case 21:
|
|
3108
|
+
_context37.prev = 21;
|
|
3109
|
+
_context37.t0 = _context37["catch"](15);
|
|
3133
3110
|
errorMessage = _context37.t0 instanceof Error ? _context37.t0.message : String(_context37.t0);
|
|
3134
3111
|
console.error('[Server] ❌ 清空IndexedDB缓存时发生错误:', _context37.t0);
|
|
3135
3112
|
this.logError('清空 IndexedDB 缓存时发生错误', {
|
|
@@ -3137,11 +3114,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
3137
3114
|
error: errorMessage
|
|
3138
3115
|
});
|
|
3139
3116
|
throw _context37.t0;
|
|
3140
|
-
case
|
|
3117
|
+
case 27:
|
|
3141
3118
|
case "end":
|
|
3142
3119
|
return _context37.stop();
|
|
3143
3120
|
}
|
|
3144
|
-
}, _callee37, this, [[
|
|
3121
|
+
}, _callee37, this, [[15, 21]]);
|
|
3145
3122
|
}));
|
|
3146
3123
|
function clearAllIndexDB() {
|
|
3147
3124
|
return _clearAllIndexDB.apply(this, arguments);
|
|
@@ -3308,7 +3285,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
3308
3285
|
}, {
|
|
3309
3286
|
key: "registerServerRoutes",
|
|
3310
3287
|
value: function registerServerRoutes() {
|
|
3311
|
-
console.log('[Server] 注册 Server 层业务路由...');
|
|
3312
3288
|
this.registerRoutes([{
|
|
3313
3289
|
method: 'post',
|
|
3314
3290
|
path: '/shop/product/query',
|
|
@@ -7634,9 +7610,8 @@ var Server = /*#__PURE__*/function () {
|
|
|
7634
7610
|
this.logInfo('computeOrderQueryResult: 开始过滤', {
|
|
7635
7611
|
data: data
|
|
7636
7612
|
});
|
|
7637
|
-
console.log('[Server] computeOrderQueryResult', data);
|
|
7638
7613
|
if (this.order) {
|
|
7639
|
-
_context73.next =
|
|
7614
|
+
_context73.next = 4;
|
|
7640
7615
|
break;
|
|
7641
7616
|
}
|
|
7642
7617
|
this.logError('computeOrderQueryResult: Order 模块未注册');
|
|
@@ -7649,7 +7624,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7649
7624
|
},
|
|
7650
7625
|
status: false
|
|
7651
7626
|
});
|
|
7652
|
-
case
|
|
7627
|
+
case 4:
|
|
7653
7628
|
rawList = this.order.getOrders();
|
|
7654
7629
|
this.logInfo('computeOrderQueryResult: 本地订单数量', {
|
|
7655
7630
|
rawCount: rawList.length
|
|
@@ -7676,7 +7651,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7676
7651
|
message: '',
|
|
7677
7652
|
status: true
|
|
7678
7653
|
});
|
|
7679
|
-
case
|
|
7654
|
+
case 10:
|
|
7680
7655
|
case "end":
|
|
7681
7656
|
return _context73.stop();
|
|
7682
7657
|
}
|
|
@@ -8520,7 +8495,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
8520
8495
|
key: "getProductScopeByMenuConfig",
|
|
8521
8496
|
value: function getProductScopeByMenuConfig(activeMenuList) {
|
|
8522
8497
|
if (!activeMenuList || activeMenuList.length === 0) {
|
|
8523
|
-
console.log('[Server] 没有生效的餐牌,返回空数组');
|
|
8524
8498
|
this.logInfo('getProductScopeByMenuConfig: 没有生效的餐牌,返回空数组', {
|
|
8525
8499
|
activeMenuCount: 0
|
|
8526
8500
|
});
|
|
@@ -8551,7 +8525,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
8551
8525
|
|
|
8552
8526
|
// 如果有任何一个餐牌是 product_all,则返回所有商品
|
|
8553
8527
|
if (config.type === 'product_all') {
|
|
8554
|
-
console.log('[Server] 餐牌允许所有商品:', menu.name);
|
|
8555
8528
|
this.logInfo('getProductScopeByMenuConfig: 餐牌允许所有商品', {
|
|
8556
8529
|
menuId: menu.form_record_id,
|
|
8557
8530
|
menuName: menu.name,
|
|
@@ -8569,7 +8542,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
8569
8542
|
productIds.forEach(function (id) {
|
|
8570
8543
|
return id && allowedProductIds.add(id);
|
|
8571
8544
|
});
|
|
8572
|
-
console.log('[Server] 餐牌允许指定商品 (product_ids):', menu.name, productIds);
|
|
8573
8545
|
this.logInfo('getProductScopeByMenuConfig: 餐牌允许指定商品', {
|
|
8574
8546
|
menuId: menu.form_record_id,
|
|
8575
8547
|
menuName: menu.name,
|
|
@@ -8586,7 +8558,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
8586
8558
|
collectionIds.forEach(function (id) {
|
|
8587
8559
|
return id && allowedCollectionIds.add(id);
|
|
8588
8560
|
});
|
|
8589
|
-
console.log('[Server] 餐牌允许商品集合 (product_collection):', menu.name, collectionIds);
|
|
8590
8561
|
this.logInfo('getProductScopeByMenuConfig: 餐牌允许商品集合', {
|
|
8591
8562
|
menuId: menu.form_record_id,
|
|
8592
8563
|
menuName: menu.name,
|
|
@@ -8611,7 +8582,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
8611
8582
|
|
|
8612
8583
|
// 如果没有收集到任何商品 ID 和集合 ID,返回空数组
|
|
8613
8584
|
if (allowedProductIds.size === 0 && allowedCollectionIds.size === 0) {
|
|
8614
|
-
console.log('[Server] 没有允许的商品和集合');
|
|
8615
8585
|
this.logWarning('getProductScopeByMenuConfig: 没有允许的商品和集合', {
|
|
8616
8586
|
activeMenuCount: activeMenuList.length
|
|
8617
8587
|
});
|
|
@@ -8622,8 +8592,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
8622
8592
|
}
|
|
8623
8593
|
var allowedProductIdsArray = Array.from(allowedProductIds);
|
|
8624
8594
|
var allowedCollectionIdsArray = Array.from(allowedCollectionIds);
|
|
8625
|
-
console.log('[Server] 允许的商品 IDs:', allowedProductIdsArray);
|
|
8626
|
-
console.log('[Server] 允许的集合 IDs:', allowedCollectionIdsArray);
|
|
8627
8595
|
this.logInfo('getProductScopeByMenuConfig: 收集到的允许规则', {
|
|
8628
8596
|
allowedProductCount: allowedProductIds.size,
|
|
8629
8597
|
allowedCollectionCount: allowedCollectionIds.size
|