@pisell/pisellos 2.2.282 → 2.2.284
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 -9
- 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.d.ts +2 -2
- package/dist/modules/Order/index.js +75 -91
- package/dist/modules/Order/types.d.ts +3 -1
- 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/modules/Summary/utils.d.ts +1 -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 +100 -72
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +5 -0
- package/dist/solution/BaseSales/utils/cartPromotion.js +15 -6
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- 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 +8 -4
- 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 +131 -131
- 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 -51
- 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.d.ts +2 -2
- package/lib/modules/Order/index.js +1733 -2121
- package/lib/modules/Order/payment-utils.js +77 -120
- package/lib/modules/Order/types.d.ts +3 -1
- package/lib/modules/Order/types.js +87 -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 +66 -100
- 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 +60 -61
- package/lib/modules/ResourcePlanner/planner.js +346 -384
- package/lib/modules/ResourcePlanner/types.js +4 -16
- 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.d.ts +1 -1
- 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 +3027 -2655
- package/lib/server/modules/floor-plan/index.js +102 -123
- 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 +146 -122
- package/lib/server/modules/menu/types.js +18 -31
- package/lib/server/modules/order/index.js +758 -956
- 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 +575 -459
- 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 +213 -184
- 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 +1209 -1412
- package/lib/solution/BaseSales/types.js +42 -38
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +5 -0
- package/lib/solution/BaseSales/utils/cartPromotion.js +652 -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.d.ts +1 -1
- 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 +598 -514
- package/lib/solution/BookingTicket/types.js +99 -77
- package/lib/solution/BookingTicket/utils/addProductDecision.js +225 -187
- 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 +437 -487
- package/lib/solution/UnifiedBookingSales/types.js +12 -31
- 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
|
@@ -289,7 +289,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
289
289
|
while (1) switch (_context3.prev = _context3.next) {
|
|
290
290
|
case 0:
|
|
291
291
|
url = _ref5.url, method = _ref5.method, data = _ref5.data, config = _ref5.config;
|
|
292
|
-
console.log('[Server] handleProductQuery:', url, method, data, config);
|
|
293
292
|
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;
|
|
294
293
|
_this$resolveProductQ = _this.resolveProductQueryScheduleContext({
|
|
295
294
|
schedule_date: data.schedule_date,
|
|
@@ -325,7 +324,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
325
324
|
totalSubscribers: _this.productQuerySubscribers.size
|
|
326
325
|
});
|
|
327
326
|
}
|
|
328
|
-
_context3.next =
|
|
327
|
+
_context3.next = 8;
|
|
329
328
|
return _this.computeProductQueryResult({
|
|
330
329
|
menu_list_ids: menu_list_ids,
|
|
331
330
|
ids: ids,
|
|
@@ -335,7 +334,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
335
334
|
extension_type: extension_type,
|
|
336
335
|
strategy_context: strategy_context
|
|
337
336
|
});
|
|
338
|
-
case
|
|
337
|
+
case 8:
|
|
339
338
|
result = _context3.sent;
|
|
340
339
|
if (subscriberId && typeof callback === 'function') {
|
|
341
340
|
_this.syncProductQueryScheduleTimers({
|
|
@@ -345,7 +344,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
345
344
|
});
|
|
346
345
|
}
|
|
347
346
|
return _context3.abrupt("return", result);
|
|
348
|
-
case
|
|
347
|
+
case 11:
|
|
349
348
|
case "end":
|
|
350
349
|
return _context3.stop();
|
|
351
350
|
}
|
|
@@ -369,9 +368,8 @@ var Server = /*#__PURE__*/function () {
|
|
|
369
368
|
pathname = _this.parseRequestPath(url || '', path);
|
|
370
369
|
idMatch = pathname.match(/^\/shop\/product\/query\/(\d+)$/);
|
|
371
370
|
productId = idMatch ? Number(idMatch[1]) : NaN;
|
|
372
|
-
console.log('[Server] handleProductQueryById:', pathname, method, data);
|
|
373
371
|
if (Number.isFinite(productId)) {
|
|
374
|
-
_context4.next =
|
|
372
|
+
_context4.next = 7;
|
|
375
373
|
break;
|
|
376
374
|
}
|
|
377
375
|
_this.logWarning('handleProductQueryById: 无效的商品 id', {
|
|
@@ -385,11 +383,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
385
383
|
item: null
|
|
386
384
|
}
|
|
387
385
|
});
|
|
388
|
-
case
|
|
386
|
+
case 7:
|
|
389
387
|
scheduleDateFromData = data && _typeof(data) === 'object' && typeof data.schedule_date === 'string' ? data.schedule_date.trim() : '';
|
|
390
388
|
schedule_date = scheduleDateFromData || (_this.extractQueryParam(url || '', 'schedule_date') || '').trim() || dayjs().format('YYYY-MM-DD');
|
|
391
389
|
if (schedule_date) {
|
|
392
|
-
_context4.next =
|
|
390
|
+
_context4.next = 12;
|
|
393
391
|
break;
|
|
394
392
|
}
|
|
395
393
|
_this.logWarning('handleProductQueryById: 缺少 schedule_date', {
|
|
@@ -401,7 +399,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
401
399
|
status: false,
|
|
402
400
|
data: null
|
|
403
401
|
});
|
|
404
|
-
case
|
|
402
|
+
case 12:
|
|
405
403
|
scheduleDtFromData = data && _typeof(data) === 'object' && typeof data.schedule_datetime === 'string' ? data.schedule_datetime.trim() : '';
|
|
406
404
|
scheduleDtFromUrl = (_this.extractQueryParam(url || '', 'schedule_datetime') || '').trim();
|
|
407
405
|
scheduleDatetime = scheduleDtFromData || scheduleDtFromUrl || "".concat(schedule_date, "T00:00:00");
|
|
@@ -415,7 +413,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
415
413
|
schedule_datetime: scheduleDatetime,
|
|
416
414
|
product_id: productId
|
|
417
415
|
}));
|
|
418
|
-
case
|
|
416
|
+
case 17:
|
|
419
417
|
case "end":
|
|
420
418
|
return _context4.stop();
|
|
421
419
|
}
|
|
@@ -463,7 +461,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
463
461
|
while (1) switch (_context6.prev = _context6.next) {
|
|
464
462
|
case 0:
|
|
465
463
|
url = _ref13.url, method = _ref13.method, data = _ref13.data, config = _ref13.config;
|
|
466
|
-
console.log('[Server] handleOrderList:', url, method, data, config);
|
|
467
464
|
queryPayload = data && _typeof(data) === 'object' ? _objectSpread({}, data) : {};
|
|
468
465
|
_ref15 = config || {}, callback = _ref15.callback, subscriberId = _ref15.subscriberId;
|
|
469
466
|
useLocal = _this.shouldUseLocalOrderQuery(queryPayload);
|
|
@@ -472,7 +469,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
472
469
|
useLocal: useLocal
|
|
473
470
|
});
|
|
474
471
|
if (!useLocal) {
|
|
475
|
-
_context6.next =
|
|
472
|
+
_context6.next = 8;
|
|
476
473
|
break;
|
|
477
474
|
}
|
|
478
475
|
if (subscriberId && typeof callback === 'function') {
|
|
@@ -486,7 +483,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
486
483
|
});
|
|
487
484
|
}
|
|
488
485
|
return _context6.abrupt("return", _this.computeOrderQueryResult(queryPayload));
|
|
489
|
-
case
|
|
486
|
+
case 8:
|
|
490
487
|
if (subscriberId) {
|
|
491
488
|
_this.orderQuerySubscribers.delete(subscriberId);
|
|
492
489
|
_this.logInfo('handleOrderList: 已清理订阅者(走远端)', {
|
|
@@ -495,7 +492,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
495
492
|
});
|
|
496
493
|
}
|
|
497
494
|
return _context6.abrupt("return", _this.fetchOrderListFromAPI(queryPayload));
|
|
498
|
-
case
|
|
495
|
+
case 10:
|
|
499
496
|
case "end":
|
|
500
497
|
return _context6.stop();
|
|
501
498
|
}
|
|
@@ -638,7 +635,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
638
635
|
while (1) switch (_context11.prev = _context11.next) {
|
|
639
636
|
case 0:
|
|
640
637
|
url = _ref26.url, method = _ref26.method, data = _ref26.data, config = _ref26.config;
|
|
641
|
-
console.log('[Server] handleBookingList:', url, method, data, config);
|
|
642
638
|
queryPayload = data && _typeof(data) === 'object' ? _objectSpread({}, data) : {};
|
|
643
639
|
_ref28 = config || {}, callback = _ref28.callback, subscriberId = _ref28.subscriberId;
|
|
644
640
|
useLocal = _this.shouldUseLocalBookingQuery(queryPayload);
|
|
@@ -647,7 +643,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
647
643
|
useLocal: useLocal
|
|
648
644
|
});
|
|
649
645
|
if (!useLocal) {
|
|
650
|
-
_context11.next =
|
|
646
|
+
_context11.next = 11;
|
|
651
647
|
break;
|
|
652
648
|
}
|
|
653
649
|
if (subscriberId) {
|
|
@@ -664,7 +660,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
664
660
|
});
|
|
665
661
|
}
|
|
666
662
|
return _context11.abrupt("return", _this.computeBookingQueryResult(queryPayload));
|
|
667
|
-
case
|
|
663
|
+
case 11:
|
|
668
664
|
if (subscriberId) {
|
|
669
665
|
_this.bookingQuerySubscribers.delete(subscriberId);
|
|
670
666
|
}
|
|
@@ -690,7 +686,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
690
686
|
});
|
|
691
687
|
}
|
|
692
688
|
return _context11.abrupt("return", _this.fetchBookingListFromAPI(queryPayload));
|
|
693
|
-
case
|
|
689
|
+
case 15:
|
|
694
690
|
case "end":
|
|
695
691
|
return _context11.stop();
|
|
696
692
|
}
|
|
@@ -712,7 +708,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
712
708
|
while (1) switch (_context12.prev = _context12.next) {
|
|
713
709
|
case 0:
|
|
714
710
|
url = _ref29.url, method = _ref29.method, data = _ref29.data, config = _ref29.config;
|
|
715
|
-
console.log('[Server] handleResourceList:', url, method, data, config);
|
|
716
711
|
list = (_this$resource = _this.resource) === null || _this$resource === void 0 ? void 0 : _this$resource.getResources({
|
|
717
712
|
skip: (data === null || data === void 0 ? void 0 : data.skip) || 1,
|
|
718
713
|
num: (data === null || data === void 0 ? void 0 : data.num) || 10
|
|
@@ -729,7 +724,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
729
724
|
message: '',
|
|
730
725
|
status: true
|
|
731
726
|
});
|
|
732
|
-
case
|
|
727
|
+
case 4:
|
|
733
728
|
case "end":
|
|
734
729
|
return _context12.stop();
|
|
735
730
|
}
|
|
@@ -1690,7 +1685,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
1690
1685
|
while (1) switch (_context24.prev = _context24.next) {
|
|
1691
1686
|
case 0:
|
|
1692
1687
|
url = _ref58.url, method = _ref58.method, data = _ref58.data, config = _ref58.config;
|
|
1693
|
-
console.log('[Server] handleGetScheduleTimePoints:', url, method, data, config);
|
|
1694
1688
|
menu_list_ids = data.menu_list_ids;
|
|
1695
1689
|
_this.logInfo('handleGetScheduleTimePoints 开始处理', {
|
|
1696
1690
|
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,
|
|
@@ -1699,7 +1693,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
1699
1693
|
|
|
1700
1694
|
// 检查必要的模块是否已注册
|
|
1701
1695
|
if (_this.menu) {
|
|
1702
|
-
_context24.next =
|
|
1696
|
+
_context24.next = 7;
|
|
1703
1697
|
break;
|
|
1704
1698
|
}
|
|
1705
1699
|
console.error('[Server] Menu 模块未注册');
|
|
@@ -1710,9 +1704,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
1710
1704
|
data: [],
|
|
1711
1705
|
status: false
|
|
1712
1706
|
});
|
|
1713
|
-
case
|
|
1707
|
+
case 7:
|
|
1714
1708
|
if (_this.schedule) {
|
|
1715
|
-
_context24.next =
|
|
1709
|
+
_context24.next = 11;
|
|
1716
1710
|
break;
|
|
1717
1711
|
}
|
|
1718
1712
|
console.error('[Server] Schedule 模块未注册');
|
|
@@ -1723,9 +1717,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
1723
1717
|
data: [],
|
|
1724
1718
|
status: false
|
|
1725
1719
|
});
|
|
1726
|
-
case
|
|
1720
|
+
case 11:
|
|
1727
1721
|
if (!(!menu_list_ids || !Array.isArray(menu_list_ids) || menu_list_ids.length === 0)) {
|
|
1728
|
-
_context24.next =
|
|
1722
|
+
_context24.next = 15;
|
|
1729
1723
|
break;
|
|
1730
1724
|
}
|
|
1731
1725
|
console.error('[Server] menu_list_ids 参数无效');
|
|
@@ -1739,22 +1733,20 @@ var Server = /*#__PURE__*/function () {
|
|
|
1739
1733
|
data: [],
|
|
1740
1734
|
status: false
|
|
1741
1735
|
});
|
|
1742
|
-
case
|
|
1743
|
-
_context24.prev =
|
|
1736
|
+
case 15:
|
|
1737
|
+
_context24.prev = 15;
|
|
1744
1738
|
_this$getMenuSchedule = _this.getMenuScheduleTimePoints(menu_list_ids), menuList = _this$getMenuSchedule.menuList, scheduleIds = _this$getMenuSchedule.scheduleIds, scheduleList = _this$getMenuSchedule.scheduleList, timePoints = _this$getMenuSchedule.timePoints;
|
|
1745
|
-
console.log("[Server] \u627E\u5230 ".concat(menuList.length, " \u4E2A\u9910\u724C"));
|
|
1746
1739
|
_this.logInfo('handleGetScheduleTimePoints: 获取到餐牌列表', {
|
|
1747
1740
|
requestedCount: menu_list_ids.length,
|
|
1748
1741
|
foundCount: menuList.length,
|
|
1749
1742
|
menu_list_ids: menu_list_ids,
|
|
1750
1743
|
menuList: menuList
|
|
1751
1744
|
});
|
|
1752
|
-
console.log("[Server] \u63D0\u53D6\u5230 ".concat(scheduleIds.length, " \u4E2A\u65E5\u7A0BID:"), scheduleIds);
|
|
1753
1745
|
_this.logInfo('handleGetScheduleTimePoints: 提取到日程 IDs', {
|
|
1754
1746
|
scheduleCount: scheduleIds.length
|
|
1755
1747
|
});
|
|
1756
1748
|
if (!(scheduleIds.length === 0)) {
|
|
1757
|
-
_context24.next =
|
|
1749
|
+
_context24.next = 22;
|
|
1758
1750
|
break;
|
|
1759
1751
|
}
|
|
1760
1752
|
_this.logInfo('handleGetScheduleTimePoints: 没有找到相关日程', {
|
|
@@ -1766,13 +1758,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
1766
1758
|
data: [],
|
|
1767
1759
|
status: true
|
|
1768
1760
|
});
|
|
1769
|
-
case
|
|
1770
|
-
console.log("[Server] \u627E\u5230 ".concat(scheduleList.length, " \u4E2A\u65E5\u7A0B"));
|
|
1761
|
+
case 22:
|
|
1771
1762
|
_this.logInfo('handleGetScheduleTimePoints: 获取到日程详情', {
|
|
1772
1763
|
requestedCount: scheduleIds.length,
|
|
1773
1764
|
foundCount: scheduleList.length
|
|
1774
1765
|
});
|
|
1775
|
-
console.log("[Server] \u63D0\u53D6\u5230 ".concat(timePoints.length, " \u4E2A\u65F6\u95F4\u70B9:"), timePoints);
|
|
1776
1766
|
_this.logInfo('handleGetScheduleTimePoints 处理完成', {
|
|
1777
1767
|
menuListIdsCount: menu_list_ids.length,
|
|
1778
1768
|
menuCount: menuList.length,
|
|
@@ -1785,9 +1775,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
1785
1775
|
data: timePoints,
|
|
1786
1776
|
status: true
|
|
1787
1777
|
});
|
|
1788
|
-
case
|
|
1789
|
-
_context24.prev =
|
|
1790
|
-
_context24.t0 = _context24["catch"](
|
|
1778
|
+
case 27:
|
|
1779
|
+
_context24.prev = 27;
|
|
1780
|
+
_context24.t0 = _context24["catch"](15);
|
|
1791
1781
|
errorMessage = _context24.t0 instanceof Error ? _context24.t0.message : '未知错误';
|
|
1792
1782
|
console.error('[Server] 获取日程时间点失败:', _context24.t0);
|
|
1793
1783
|
_this.logError('handleGetScheduleTimePoints: 获取日程时间点失败', {
|
|
@@ -1800,11 +1790,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
1800
1790
|
data: [],
|
|
1801
1791
|
status: false
|
|
1802
1792
|
});
|
|
1803
|
-
case
|
|
1793
|
+
case 33:
|
|
1804
1794
|
case "end":
|
|
1805
1795
|
return _context24.stop();
|
|
1806
1796
|
}
|
|
1807
|
-
}, _callee24, null, [[
|
|
1797
|
+
}, _callee24, null, [[15, 27]]);
|
|
1808
1798
|
}));
|
|
1809
1799
|
return function (_x24) {
|
|
1810
1800
|
return _ref59.apply(this, arguments);
|
|
@@ -1814,7 +1804,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
1814
1804
|
var appPlugin = core.getPlugin('app');
|
|
1815
1805
|
this.app = (appPlugin === null || appPlugin === void 0 ? void 0 : appPlugin.getApp()) || null;
|
|
1816
1806
|
this.logger = ((_this$app4 = this.app) === null || _this$app4 === void 0 ? void 0 : _this$app4.logger) || null;
|
|
1817
|
-
console.log('[Server] Server 初始化', this.core);
|
|
1818
1807
|
this.logInfo('Server 初始化', {
|
|
1819
1808
|
hasApp: !!this.app,
|
|
1820
1809
|
hasLogger: !!this.logger
|
|
@@ -1875,7 +1864,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
1875
1864
|
});
|
|
1876
1865
|
}
|
|
1877
1866
|
_this2.router[method][path] = handler;
|
|
1878
|
-
console.log("[Server] \uD83D\uDCDD \u6CE8\u518C\u8DEF\u7531: ".concat(method.toUpperCase(), " ").concat(path));
|
|
1879
1867
|
_this2.logInfo("\u6CE8\u518C\u8DEF\u7531", {
|
|
1880
1868
|
method: method.toUpperCase(),
|
|
1881
1869
|
path: path
|
|
@@ -1942,7 +1930,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
1942
1930
|
_context25.next = 3;
|
|
1943
1931
|
return this.core.registerModule(module, options);
|
|
1944
1932
|
case 3:
|
|
1945
|
-
console.log("[Server] \u2705 ".concat(moduleName, " \u6A21\u5757\u5DF2\u6CE8\u518C"));
|
|
1946
1933
|
this.logInfo("\u6A21\u5757\u6CE8\u518C\u6210\u529F: ".concat(moduleName), {
|
|
1947
1934
|
moduleName: moduleName
|
|
1948
1935
|
});
|
|
@@ -1958,7 +1945,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
1958
1945
|
});
|
|
1959
1946
|
}
|
|
1960
1947
|
}
|
|
1961
|
-
case
|
|
1948
|
+
case 5:
|
|
1962
1949
|
case "end":
|
|
1963
1950
|
return _context25.stop();
|
|
1964
1951
|
}
|
|
@@ -2048,8 +2035,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
2048
2035
|
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2049
2036
|
while (1) switch (_context27.prev = _context27.next) {
|
|
2050
2037
|
case 0:
|
|
2051
|
-
console.log('[Server] 开始注册模块...');
|
|
2052
|
-
|
|
2053
2038
|
// 如果没有指定模块,则注册所有模块
|
|
2054
2039
|
configs = moduleConfigs || Object.keys(this.moduleRegistry);
|
|
2055
2040
|
this.logInfo('开始批量注册模块', {
|
|
@@ -2058,26 +2043,26 @@ var Server = /*#__PURE__*/function () {
|
|
|
2058
2043
|
});
|
|
2059
2044
|
registeredModules = [];
|
|
2060
2045
|
_iterator2 = _createForOfIteratorHelper(configs);
|
|
2061
|
-
_context27.prev =
|
|
2046
|
+
_context27.prev = 4;
|
|
2062
2047
|
_iterator2.s();
|
|
2063
|
-
case
|
|
2048
|
+
case 6:
|
|
2064
2049
|
if ((_step2 = _iterator2.n()).done) {
|
|
2065
|
-
_context27.next =
|
|
2050
|
+
_context27.next = 24;
|
|
2066
2051
|
break;
|
|
2067
2052
|
}
|
|
2068
2053
|
config = _step2.value;
|
|
2069
2054
|
configName = typeof config === 'string' ? config : config.name;
|
|
2070
|
-
_context27.prev =
|
|
2071
|
-
_context27.next =
|
|
2055
|
+
_context27.prev = 9;
|
|
2056
|
+
_context27.next = 12;
|
|
2072
2057
|
return this.registerModuleByName(config);
|
|
2073
|
-
case
|
|
2058
|
+
case 12:
|
|
2074
2059
|
result = _context27.sent;
|
|
2075
2060
|
registeredModules.push(result);
|
|
2076
|
-
_context27.next =
|
|
2061
|
+
_context27.next = 22;
|
|
2077
2062
|
break;
|
|
2078
|
-
case
|
|
2079
|
-
_context27.prev =
|
|
2080
|
-
_context27.t0 = _context27["catch"](
|
|
2063
|
+
case 16:
|
|
2064
|
+
_context27.prev = 16;
|
|
2065
|
+
_context27.t0 = _context27["catch"](9);
|
|
2081
2066
|
errorMessage = _context27.t0 instanceof Error ? _context27.t0.message : String(_context27.t0);
|
|
2082
2067
|
this.logError("\u6A21\u5757\u6CE8\u518C\u5931\u8D25: ".concat(configName), {
|
|
2083
2068
|
moduleName: configName,
|
|
@@ -2085,22 +2070,21 @@ var Server = /*#__PURE__*/function () {
|
|
|
2085
2070
|
});
|
|
2086
2071
|
console.error("[Server] \u6A21\u5757\u6CE8\u518C\u5931\u8D25:", _context27.t0);
|
|
2087
2072
|
throw _context27.t0;
|
|
2088
|
-
case
|
|
2089
|
-
_context27.next =
|
|
2073
|
+
case 22:
|
|
2074
|
+
_context27.next = 6;
|
|
2090
2075
|
break;
|
|
2091
|
-
case
|
|
2092
|
-
_context27.next =
|
|
2076
|
+
case 24:
|
|
2077
|
+
_context27.next = 29;
|
|
2093
2078
|
break;
|
|
2094
|
-
case
|
|
2095
|
-
_context27.prev =
|
|
2096
|
-
_context27.t1 = _context27["catch"](
|
|
2079
|
+
case 26:
|
|
2080
|
+
_context27.prev = 26;
|
|
2081
|
+
_context27.t1 = _context27["catch"](4);
|
|
2097
2082
|
_iterator2.e(_context27.t1);
|
|
2098
|
-
case
|
|
2099
|
-
_context27.prev =
|
|
2083
|
+
case 29:
|
|
2084
|
+
_context27.prev = 29;
|
|
2100
2085
|
_iterator2.f();
|
|
2101
|
-
return _context27.finish(
|
|
2102
|
-
case
|
|
2103
|
-
console.log('[Server] ✅ 所有模块注册完成');
|
|
2086
|
+
return _context27.finish(29);
|
|
2087
|
+
case 32:
|
|
2104
2088
|
this.logInfo('所有模块注册完成', {
|
|
2105
2089
|
registeredCount: registeredModules.length,
|
|
2106
2090
|
moduleNames: registeredModules.map(function (m) {
|
|
@@ -2109,11 +2093,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
2109
2093
|
})
|
|
2110
2094
|
});
|
|
2111
2095
|
return _context27.abrupt("return", registeredModules);
|
|
2112
|
-
case
|
|
2096
|
+
case 34:
|
|
2113
2097
|
case "end":
|
|
2114
2098
|
return _context27.stop();
|
|
2115
2099
|
}
|
|
2116
|
-
}, _callee27, this, [[
|
|
2100
|
+
}, _callee27, this, [[4, 26, 29, 32], [9, 16]]);
|
|
2117
2101
|
}));
|
|
2118
2102
|
function registerModules(_x29) {
|
|
2119
2103
|
return _registerModules.apply(this, arguments);
|
|
@@ -2133,7 +2117,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
2133
2117
|
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
2134
2118
|
while (1) switch (_context28.prev = _context28.next) {
|
|
2135
2119
|
case 0:
|
|
2136
|
-
console.log('[Server] 开始预加载模块数据...');
|
|
2137
2120
|
modulesToPreload = registeredModules.filter(function (m) {
|
|
2138
2121
|
return m.shouldPreload;
|
|
2139
2122
|
});
|
|
@@ -2144,41 +2127,39 @@ var Server = /*#__PURE__*/function () {
|
|
|
2144
2127
|
});
|
|
2145
2128
|
preloadResults = [];
|
|
2146
2129
|
_iterator3 = _createForOfIteratorHelper(registeredModules);
|
|
2147
|
-
_context28.prev =
|
|
2130
|
+
_context28.prev = 4;
|
|
2148
2131
|
_iterator3.s();
|
|
2149
|
-
case
|
|
2132
|
+
case 6:
|
|
2150
2133
|
if ((_step3 = _iterator3.n()).done) {
|
|
2151
|
-
_context28.next =
|
|
2134
|
+
_context28.next = 36;
|
|
2152
2135
|
break;
|
|
2153
2136
|
}
|
|
2154
2137
|
_step3$value = _step3.value, module = _step3$value.module, config = _step3$value.config, shouldPreload = _step3$value.shouldPreload;
|
|
2155
2138
|
if (shouldPreload) {
|
|
2156
|
-
_context28.next =
|
|
2139
|
+
_context28.next = 11;
|
|
2157
2140
|
break;
|
|
2158
2141
|
}
|
|
2159
|
-
console.log("[Server] \u23ED\uFE0F \u8DF3\u8FC7 ".concat(config.name, " \u6A21\u5757\u9884\u52A0\u8F7D"));
|
|
2160
2142
|
this.logInfo("\u8DF3\u8FC7\u6A21\u5757\u9884\u52A0\u8F7D: ".concat(config.name), {
|
|
2161
2143
|
moduleName: config.name,
|
|
2162
2144
|
reason: 'shouldPreload=false'
|
|
2163
2145
|
});
|
|
2164
|
-
return _context28.abrupt("continue",
|
|
2165
|
-
case
|
|
2146
|
+
return _context28.abrupt("continue", 34);
|
|
2147
|
+
case 11:
|
|
2166
2148
|
if (!(typeof module.preload === 'function')) {
|
|
2167
|
-
_context28.next =
|
|
2149
|
+
_context28.next = 33;
|
|
2168
2150
|
break;
|
|
2169
2151
|
}
|
|
2170
2152
|
startTime = Date.now();
|
|
2171
|
-
_context28.prev =
|
|
2153
|
+
_context28.prev = 13;
|
|
2172
2154
|
this.logInfo("\u5F00\u59CB\u9884\u52A0\u8F7D\u6A21\u5757: ".concat(config.name), {
|
|
2173
2155
|
moduleName: config.name
|
|
2174
2156
|
});
|
|
2175
2157
|
options === null || options === void 0 || (_options$onModuleLoad = options.onModuleLoad) === null || _options$onModuleLoad === void 0 || _options$onModuleLoad.call(options, config.name);
|
|
2176
|
-
_context28.next =
|
|
2158
|
+
_context28.next = 18;
|
|
2177
2159
|
return module.preload();
|
|
2178
|
-
case
|
|
2160
|
+
case 18:
|
|
2179
2161
|
options === null || options === void 0 || (_options$onModuleLoad2 = options.onModuleLoadComplete) === null || _options$onModuleLoad2 === void 0 || _options$onModuleLoad2.call(options, config.name);
|
|
2180
2162
|
duration = Date.now() - startTime;
|
|
2181
|
-
console.log("[Server] \u2705 ".concat(config.name, " \u6A21\u5757\u6570\u636E\u5DF2\u9884\u52A0\u8F7D"));
|
|
2182
2163
|
this.logInfo("\u6A21\u5757\u9884\u52A0\u8F7D\u6210\u529F: ".concat(config.name), {
|
|
2183
2164
|
moduleName: config.name,
|
|
2184
2165
|
duration: "".concat(duration, "ms")
|
|
@@ -2187,11 +2168,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
2187
2168
|
name: config.name,
|
|
2188
2169
|
success: true
|
|
2189
2170
|
});
|
|
2190
|
-
_context28.next =
|
|
2171
|
+
_context28.next = 31;
|
|
2191
2172
|
break;
|
|
2192
|
-
case
|
|
2193
|
-
_context28.prev =
|
|
2194
|
-
_context28.t0 = _context28["catch"](
|
|
2173
|
+
case 24:
|
|
2174
|
+
_context28.prev = 24;
|
|
2175
|
+
_context28.t0 = _context28["catch"](13);
|
|
2195
2176
|
_duration = Date.now() - startTime;
|
|
2196
2177
|
errorMessage = _context28.t0 instanceof Error ? _context28.t0.message : String(_context28.t0);
|
|
2197
2178
|
console.error("[Server] \u274C ".concat(config.name, " \u6A21\u5757\u9884\u52A0\u8F7D\u5931\u8D25:"), _context28.t0);
|
|
@@ -2205,45 +2186,43 @@ var Server = /*#__PURE__*/function () {
|
|
|
2205
2186
|
success: false,
|
|
2206
2187
|
error: errorMessage
|
|
2207
2188
|
});
|
|
2208
|
-
case
|
|
2209
|
-
_context28.next =
|
|
2189
|
+
case 31:
|
|
2190
|
+
_context28.next = 34;
|
|
2210
2191
|
break;
|
|
2211
|
-
case
|
|
2212
|
-
console.log("[Server] \u26A0\uFE0F ".concat(config.name, " \u6A21\u5757\u672A\u5B9E\u73B0 preload() \u65B9\u6CD5"));
|
|
2192
|
+
case 33:
|
|
2213
2193
|
this.logWarning("\u6A21\u5757\u672A\u5B9E\u73B0 preload \u65B9\u6CD5: ".concat(config.name), {
|
|
2214
2194
|
moduleName: config.name
|
|
2215
2195
|
});
|
|
2216
|
-
case
|
|
2217
|
-
_context28.next =
|
|
2196
|
+
case 34:
|
|
2197
|
+
_context28.next = 6;
|
|
2218
2198
|
break;
|
|
2219
|
-
case
|
|
2220
|
-
_context28.next =
|
|
2199
|
+
case 36:
|
|
2200
|
+
_context28.next = 41;
|
|
2221
2201
|
break;
|
|
2222
|
-
case
|
|
2223
|
-
_context28.prev =
|
|
2224
|
-
_context28.t1 = _context28["catch"](
|
|
2202
|
+
case 38:
|
|
2203
|
+
_context28.prev = 38;
|
|
2204
|
+
_context28.t1 = _context28["catch"](4);
|
|
2225
2205
|
_iterator3.e(_context28.t1);
|
|
2226
|
-
case
|
|
2227
|
-
_context28.prev =
|
|
2206
|
+
case 41:
|
|
2207
|
+
_context28.prev = 41;
|
|
2228
2208
|
_iterator3.f();
|
|
2229
|
-
return _context28.finish(
|
|
2230
|
-
case
|
|
2209
|
+
return _context28.finish(41);
|
|
2210
|
+
case 44:
|
|
2231
2211
|
successCount = preloadResults.filter(function (r) {
|
|
2232
2212
|
return r.success;
|
|
2233
2213
|
}).length;
|
|
2234
2214
|
failCount = preloadResults.filter(function (r) {
|
|
2235
2215
|
return !r.success;
|
|
2236
2216
|
}).length;
|
|
2237
|
-
console.log('[Server] ✅ 所有模块数据预加载完成');
|
|
2238
2217
|
this.logInfo('所有模块预加载完成', {
|
|
2239
2218
|
successCount: successCount,
|
|
2240
2219
|
failCount: failCount
|
|
2241
2220
|
});
|
|
2242
|
-
case
|
|
2221
|
+
case 47:
|
|
2243
2222
|
case "end":
|
|
2244
2223
|
return _context28.stop();
|
|
2245
2224
|
}
|
|
2246
|
-
}, _callee28, this, [[
|
|
2225
|
+
}, _callee28, this, [[4, 38, 41, 44], [13, 24]]);
|
|
2247
2226
|
}));
|
|
2248
2227
|
function preloadModulesData(_x30, _x31) {
|
|
2249
2228
|
return _preloadModulesData.apply(this, arguments);
|
|
@@ -3022,7 +3001,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
3022
3001
|
return _regeneratorRuntime().wrap(function _callee37$(_context37) {
|
|
3023
3002
|
while (1) switch (_context37.prev = _context37.next) {
|
|
3024
3003
|
case 0:
|
|
3025
|
-
console.log('[Server] 开始清空所有模块的IndexedDB缓存...');
|
|
3026
3004
|
this.logInfo('开始清空所有模块的 IndexedDB 缓存');
|
|
3027
3005
|
clearTasks = [];
|
|
3028
3006
|
moduleNames = []; // 收集所有模块的清空任务
|
|
@@ -3055,29 +3033,28 @@ var Server = /*#__PURE__*/function () {
|
|
|
3055
3033
|
moduleNames.push('FloorPlan');
|
|
3056
3034
|
}
|
|
3057
3035
|
if (!(clearTasks.length === 0)) {
|
|
3058
|
-
_context37.next =
|
|
3036
|
+
_context37.next = 14;
|
|
3059
3037
|
break;
|
|
3060
3038
|
}
|
|
3061
3039
|
console.warn('[Server] 没有找到已注册的模块,无需清空');
|
|
3062
3040
|
this.logWarning('没有找到已注册的模块,无需清空 IndexedDB');
|
|
3063
3041
|
return _context37.abrupt("return");
|
|
3064
|
-
case
|
|
3042
|
+
case 14:
|
|
3065
3043
|
this.logInfo('准备清空模块缓存', {
|
|
3066
3044
|
moduleNames: moduleNames
|
|
3067
3045
|
});
|
|
3068
|
-
_context37.prev =
|
|
3069
|
-
_context37.next =
|
|
3046
|
+
_context37.prev = 15;
|
|
3047
|
+
_context37.next = 18;
|
|
3070
3048
|
return Promise.all(clearTasks);
|
|
3071
|
-
case
|
|
3072
|
-
console.log("[Server] \u2705 \u5DF2\u6210\u529F\u6E05\u7A7A\u6240\u6709\u6A21\u5757\u7684IndexedDB\u7F13\u5B58: ".concat(moduleNames.join(', ')));
|
|
3049
|
+
case 18:
|
|
3073
3050
|
this.logInfo('成功清空所有模块的 IndexedDB 缓存', {
|
|
3074
3051
|
moduleNames: moduleNames
|
|
3075
3052
|
});
|
|
3076
|
-
_context37.next =
|
|
3053
|
+
_context37.next = 27;
|
|
3077
3054
|
break;
|
|
3078
|
-
case
|
|
3079
|
-
_context37.prev =
|
|
3080
|
-
_context37.t0 = _context37["catch"](
|
|
3055
|
+
case 21:
|
|
3056
|
+
_context37.prev = 21;
|
|
3057
|
+
_context37.t0 = _context37["catch"](15);
|
|
3081
3058
|
errorMessage = _context37.t0 instanceof Error ? _context37.t0.message : String(_context37.t0);
|
|
3082
3059
|
console.error('[Server] ❌ 清空IndexedDB缓存时发生错误:', _context37.t0);
|
|
3083
3060
|
this.logError('清空 IndexedDB 缓存时发生错误', {
|
|
@@ -3085,11 +3062,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
3085
3062
|
error: errorMessage
|
|
3086
3063
|
});
|
|
3087
3064
|
throw _context37.t0;
|
|
3088
|
-
case
|
|
3065
|
+
case 27:
|
|
3089
3066
|
case "end":
|
|
3090
3067
|
return _context37.stop();
|
|
3091
3068
|
}
|
|
3092
|
-
}, _callee37, this, [[
|
|
3069
|
+
}, _callee37, this, [[15, 21]]);
|
|
3093
3070
|
}));
|
|
3094
3071
|
function clearAllIndexDB() {
|
|
3095
3072
|
return _clearAllIndexDB.apply(this, arguments);
|
|
@@ -3256,7 +3233,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
3256
3233
|
}, {
|
|
3257
3234
|
key: "registerServerRoutes",
|
|
3258
3235
|
value: function registerServerRoutes() {
|
|
3259
|
-
console.log('[Server] 注册 Server 层业务路由...');
|
|
3260
3236
|
this.registerRoutes([{
|
|
3261
3237
|
method: 'post',
|
|
3262
3238
|
path: '/shop/product/query',
|
|
@@ -7581,9 +7557,8 @@ var Server = /*#__PURE__*/function () {
|
|
|
7581
7557
|
this.logInfo('computeOrderQueryResult: 开始过滤', {
|
|
7582
7558
|
data: data
|
|
7583
7559
|
});
|
|
7584
|
-
console.log('[Server] computeOrderQueryResult', data);
|
|
7585
7560
|
if (this.order) {
|
|
7586
|
-
_context73.next =
|
|
7561
|
+
_context73.next = 4;
|
|
7587
7562
|
break;
|
|
7588
7563
|
}
|
|
7589
7564
|
this.logError('computeOrderQueryResult: Order 模块未注册');
|
|
@@ -7596,7 +7571,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7596
7571
|
},
|
|
7597
7572
|
status: false
|
|
7598
7573
|
});
|
|
7599
|
-
case
|
|
7574
|
+
case 4:
|
|
7600
7575
|
rawList = this.order.getOrders();
|
|
7601
7576
|
this.logInfo('computeOrderQueryResult: 本地订单数量', {
|
|
7602
7577
|
rawCount: rawList.length
|
|
@@ -7623,7 +7598,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7623
7598
|
message: '',
|
|
7624
7599
|
status: true
|
|
7625
7600
|
});
|
|
7626
|
-
case
|
|
7601
|
+
case 10:
|
|
7627
7602
|
case "end":
|
|
7628
7603
|
return _context73.stop();
|
|
7629
7604
|
}
|
|
@@ -8453,7 +8428,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
8453
8428
|
key: "getProductScopeByMenuConfig",
|
|
8454
8429
|
value: function getProductScopeByMenuConfig(activeMenuList) {
|
|
8455
8430
|
if (!activeMenuList || activeMenuList.length === 0) {
|
|
8456
|
-
console.log('[Server] 没有生效的餐牌,返回空数组');
|
|
8457
8431
|
this.logInfo('getProductScopeByMenuConfig: 没有生效的餐牌,返回空数组', {
|
|
8458
8432
|
activeMenuCount: 0
|
|
8459
8433
|
});
|
|
@@ -8484,7 +8458,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
8484
8458
|
|
|
8485
8459
|
// 如果有任何一个餐牌是 product_all,则返回所有商品
|
|
8486
8460
|
if (config.type === 'product_all') {
|
|
8487
|
-
console.log('[Server] 餐牌允许所有商品:', menu.name);
|
|
8488
8461
|
this.logInfo('getProductScopeByMenuConfig: 餐牌允许所有商品', {
|
|
8489
8462
|
menuId: menu.form_record_id,
|
|
8490
8463
|
menuName: menu.name,
|
|
@@ -8502,7 +8475,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
8502
8475
|
productIds.forEach(function (id) {
|
|
8503
8476
|
return id && allowedProductIds.add(id);
|
|
8504
8477
|
});
|
|
8505
|
-
console.log('[Server] 餐牌允许指定商品 (product_ids):', menu.name, productIds);
|
|
8506
8478
|
this.logInfo('getProductScopeByMenuConfig: 餐牌允许指定商品', {
|
|
8507
8479
|
menuId: menu.form_record_id,
|
|
8508
8480
|
menuName: menu.name,
|
|
@@ -8519,7 +8491,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
8519
8491
|
collectionIds.forEach(function (id) {
|
|
8520
8492
|
return id && allowedCollectionIds.add(id);
|
|
8521
8493
|
});
|
|
8522
|
-
console.log('[Server] 餐牌允许商品集合 (product_collection):', menu.name, collectionIds);
|
|
8523
8494
|
this.logInfo('getProductScopeByMenuConfig: 餐牌允许商品集合', {
|
|
8524
8495
|
menuId: menu.form_record_id,
|
|
8525
8496
|
menuName: menu.name,
|
|
@@ -8544,7 +8515,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
8544
8515
|
|
|
8545
8516
|
// 如果没有收集到任何商品 ID 和集合 ID,返回空数组
|
|
8546
8517
|
if (allowedProductIds.size === 0 && allowedCollectionIds.size === 0) {
|
|
8547
|
-
console.log('[Server] 没有允许的商品和集合');
|
|
8548
8518
|
this.logWarning('getProductScopeByMenuConfig: 没有允许的商品和集合', {
|
|
8549
8519
|
activeMenuCount: activeMenuList.length
|
|
8550
8520
|
});
|
|
@@ -8555,8 +8525,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
8555
8525
|
}
|
|
8556
8526
|
var allowedProductIdsArray = Array.from(allowedProductIds);
|
|
8557
8527
|
var allowedCollectionIdsArray = Array.from(allowedCollectionIds);
|
|
8558
|
-
console.log('[Server] 允许的商品 IDs:', allowedProductIdsArray);
|
|
8559
|
-
console.log('[Server] 允许的集合 IDs:', allowedCollectionIdsArray);
|
|
8560
8528
|
this.logInfo('getProductScopeByMenuConfig: 收集到的允许规则', {
|
|
8561
8529
|
allowedProductCount: allowedProductIds.size,
|
|
8562
8530
|
allowedCollectionCount: allowedCollectionIds.size
|