@pisell/pisellos 0.0.569 → 0.10.2
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 +10 -6
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -3
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.js +7 -5
- package/dist/model/strategy/adapter/walletPass/example.js +26 -3
- package/dist/model/strategy/adapter/walletPass/index.js +5 -5
- package/dist/model/strategy/adapter/walletPass/type.d.ts +0 -3
- package/dist/model/strategy/adapter/walletPass/utils.d.ts +0 -26
- package/dist/model/strategy/adapter/walletPass/utils.js +17 -92
- package/dist/model/strategy/strategy-example.js +19 -5
- package/dist/modules/BaseModule.d.ts +1 -1
- package/dist/modules/BaseModule.js +8 -10
- package/dist/modules/Cart/index.js +3 -0
- package/dist/modules/Cart/utils/cartProduct.js +1 -0
- package/dist/modules/Cart/utils/cartResource.js +0 -2
- package/dist/modules/Cart/utils/changePrice.js +9 -16
- package/dist/modules/Date/index.js +5 -1
- package/dist/modules/Discount/index.d.ts +0 -1
- package/dist/modules/Discount/index.js +7 -22
- package/dist/modules/Discount/types.d.ts +0 -1
- package/dist/modules/OpenData/index.js +2 -0
- package/dist/modules/Order/index.js +70 -40
- package/dist/modules/Payment/index.js +162 -97
- package/dist/modules/Payment/types.d.ts +4 -8
- package/dist/modules/Payment/walletpass.d.ts +0 -2
- package/dist/modules/Payment/walletpass.js +5 -4
- package/dist/modules/ProductList/index.d.ts +1 -1
- package/dist/modules/ProductList/index.js +3 -12
- package/dist/modules/ProductList/types.d.ts +0 -1
- package/dist/modules/Rules/index.js +126 -427
- package/dist/modules/SalesSummary/utils.js +1 -2
- package/dist/modules/Schedule/getDateIsInSchedule.js +0 -5
- package/dist/modules/Schedule/index.js +1 -0
- package/dist/modules/Schedule/utils.js +1 -0
- package/dist/modules/Step/index.js +1 -0
- package/dist/modules/Summary/utils.js +22 -43
- package/dist/plugins/request.js +4 -1
- package/dist/plugins/window.js +6 -2
- package/dist/server/index.js +129 -97
- package/dist/server/modules/menu/index.js +41 -32
- package/dist/server/modules/order/index.js +4 -2
- package/dist/server/modules/products/index.js +42 -24
- package/dist/server/modules/quotation/index.js +38 -29
- package/dist/server/modules/resource/index.js +4 -3
- package/dist/server/modules/schedule/index.js +35 -27
- package/dist/server/utils/product.js +1 -0
- package/dist/solution/BaseSales/index.js +41 -38
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingByStep/index.js +60 -11
- package/dist/solution/BookingByStep/utils/capacity.js +11 -1
- package/dist/solution/BookingByStep/utils/resources.js +3 -1
- package/dist/solution/BookingByStep/utils/timeslots.js +43 -2
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.js +2 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +7 -6
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +31 -25
- package/dist/solution/BookingTicket/utils/scan/index.js +10 -6
- package/dist/solution/BuyTickets/index.js +12 -9
- package/dist/solution/Checkout/index.js +252 -177
- package/dist/solution/Checkout/utils/index.js +16 -4
- package/dist/solution/RegisterAndLogin/index.js +76 -30
- package/dist/solution/ScanOrder/index.js +60 -50
- package/dist/solution/ShopDiscount/index.js +14 -15
- package/dist/solution/ShopDiscount/types.d.ts +4 -5
- package/dist/solution/ShopDiscount/utils.d.ts +0 -9
- package/dist/solution/ShopDiscount/utils.js +0 -9
- package/dist/solution/VenueBooking/index.d.ts +3 -31
- package/dist/solution/VenueBooking/index.js +496 -651
- package/dist/solution/VenueBooking/types.d.ts +1 -3
- package/dist/solution/VenueBooking/types.js +0 -1
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +2 -2
- package/dist/solution/VenueBooking/utils/dateSummary.js +25 -12
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +0 -2
- package/dist/solution/VenueBooking/utils/timeSlot.js +4 -9
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/task.js +18 -15
- package/dist/utils/watch.js +1 -0
- package/lib/apis/picoding.js +0 -2
- package/lib/core/index.js +132 -130
- package/lib/effects/index.js +57 -46
- package/lib/index.d.ts +0 -1
- package/lib/index.js +50 -92
- package/lib/model/index.js +21 -14
- package/lib/model/strategy/adapter/dataVariant/adapter.js +50 -38
- package/lib/model/strategy/adapter/dataVariant/evaluator.js +236 -162
- package/lib/model/strategy/adapter/dataVariant/examples.js +237 -229
- package/lib/model/strategy/adapter/dataVariant/index.js +34 -39
- package/lib/model/strategy/adapter/dataVariant/type.js +28 -57
- package/lib/model/strategy/adapter/index.js +64 -100
- package/lib/model/strategy/adapter/itemRule/adapter.js +144 -156
- package/lib/model/strategy/adapter/itemRule/evaluator.js +48 -36
- package/lib/model/strategy/adapter/itemRule/examples.js +225 -295
- package/lib/model/strategy/adapter/itemRule/index.js +57 -83
- package/lib/model/strategy/adapter/itemRule/type.js +36 -97
- package/lib/model/strategy/adapter/promotion/adapter.js +63 -84
- package/lib/model/strategy/adapter/promotion/evaluator.js +231 -381
- package/lib/model/strategy/adapter/promotion/examples.js +159 -139
- package/lib/model/strategy/adapter/promotion/index.js +49 -1
- package/lib/model/strategy/adapter/promotion/type.js +35 -199
- package/lib/model/strategy/adapter/type.js +16 -4
- package/lib/model/strategy/adapter/walletPass/evaluator.js +152 -180
- package/lib/model/strategy/adapter/walletPass/example.js +190 -217
- package/lib/model/strategy/adapter/walletPass/index.js +51 -75
- package/lib/model/strategy/adapter/walletPass/locales.js +58 -36
- package/lib/model/strategy/adapter/walletPass/type.d.ts +0 -3
- package/lib/model/strategy/adapter/walletPass/type.js +16 -4
- package/lib/model/strategy/adapter/walletPass/utils.d.ts +0 -26
- package/lib/model/strategy/adapter/walletPass/utils.js +383 -678
- package/lib/model/strategy/engine.js +168 -270
- package/lib/model/strategy/index.js +34 -49
- package/lib/model/strategy/strategy-example.js +239 -243
- package/lib/model/strategy/type.js +40 -100
- package/lib/modules/Account/index.js +53 -39
- package/lib/modules/Account/types.js +33 -20
- package/lib/modules/AccountList/index.js +154 -116
- package/lib/modules/AccountList/types.js +31 -30
- package/lib/modules/AccountList/utils.js +30 -18
- package/lib/modules/BaseModule.d.ts +1 -1
- package/lib/modules/BaseModule.js +46 -25
- package/lib/modules/BookingContext/index.js +136 -158
- package/lib/modules/BookingContext/types.js +32 -46
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +143 -131
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +82 -75
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +150 -170
- package/lib/modules/BookingContext/utils/flexible.js +55 -38
- package/lib/modules/BookingContext/utils/formatResourceList.js +34 -19
- package/lib/modules/BookingContext/utils/index.js +41 -124
- package/lib/modules/BookingContext/utils/noResource.js +70 -58
- package/lib/modules/BookingContext/utils/orderLineDisplay.js +41 -14
- package/lib/modules/BookingContext/utils/productExtend.js +155 -202
- package/lib/modules/BookingContext/utils/resourceErrors.js +53 -53
- package/lib/modules/BookingContext/utils/resourceSelection.js +41 -19
- package/lib/modules/BookingContext/utils/resources.js +167 -209
- package/lib/modules/BookingContext/utils/serviceTimes.js +116 -115
- package/lib/modules/BookingContext/utils/timeSlices.js +80 -70
- package/lib/modules/Cart/index.js +124 -170
- package/lib/modules/Cart/types.js +51 -46
- package/lib/modules/Cart/utils/cartAccount.js +39 -40
- package/lib/modules/Cart/utils/cartDate.js +61 -56
- package/lib/modules/Cart/utils/cartDiscount.js +33 -28
- package/lib/modules/Cart/utils/cartNote.js +32 -27
- package/lib/modules/Cart/utils/cartProduct.js +251 -321
- package/lib/modules/Cart/utils/cartRelationForms.js +35 -29
- package/lib/modules/Cart/utils/cartResource.js +78 -72
- package/lib/modules/Cart/utils/changePrice.js +50 -28
- package/lib/modules/Cart/utils/index.js +48 -106
- package/lib/modules/Customer/constants.js +34 -13
- package/lib/modules/Customer/index.js +169 -232
- package/lib/modules/Customer/types.js +35 -38
- package/lib/modules/Date/index.js +115 -116
- package/lib/modules/Date/types.js +28 -16
- package/lib/modules/Date/utils.js +123 -174
- package/lib/modules/Discount/index.d.ts +0 -1
- package/lib/modules/Discount/index.js +128 -130
- package/lib/modules/Discount/types.d.ts +0 -1
- package/lib/modules/Discount/types.js +31 -9
- package/lib/modules/Guests/index.js +56 -30
- package/lib/modules/Guests/types.js +33 -23
- package/lib/modules/Holder/index.js +189 -209
- package/lib/modules/Holder/types.js +16 -4
- package/lib/modules/Holder/utils.js +49 -20
- package/lib/modules/OpenData/index.js +76 -69
- package/lib/modules/OpenData/types.js +16 -4
- package/lib/modules/OpenData/utils.js +78 -44
- package/lib/modules/Order/index.js +1909 -1572
- package/lib/modules/Order/types.js +35 -78
- package/lib/modules/Order/utils/bundleDiscountHydration.js +74 -41
- package/lib/modules/Order/utils/manualProductDiscount.js +123 -124
- package/lib/modules/Order/utils/orderCollectionIdentity.js +210 -148
- package/lib/modules/Order/utils.js +634 -799
- package/lib/modules/Payment/cash.js +33 -20
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +76 -145
- package/lib/modules/Payment/eftpos.js +30 -16
- package/lib/modules/Payment/index.js +378 -518
- package/lib/modules/Payment/mx51.js +0 -1
- package/lib/modules/Payment/types.d.ts +4 -8
- package/lib/modules/Payment/types.js +107 -216
- package/lib/modules/Payment/utils.js +48 -51
- package/lib/modules/Payment/walletpass.d.ts +0 -2
- package/lib/modules/Payment/walletpass.js +211 -226
- package/lib/modules/Product/index.js +46 -51
- package/lib/modules/Product/types.js +16 -4
- package/lib/modules/Product/utils.js +33 -32
- package/lib/modules/ProductList/index.d.ts +1 -1
- package/lib/modules/ProductList/index.js +117 -117
- package/lib/modules/ProductList/types.d.ts +0 -1
- package/lib/modules/ProductList/types.js +31 -9
- package/lib/modules/Quotation/index.js +100 -66
- package/lib/modules/Quotation/types.js +16 -4
- package/lib/modules/Resource/index.js +59 -27
- package/lib/modules/Resource/types.js +32 -22
- package/lib/modules/Resource/utils.js +38 -30
- package/lib/modules/ResourcePlanner/index.js +61 -60
- package/lib/modules/ResourcePlanner/planner.js +384 -346
- package/lib/modules/ResourcePlanner/types.js +16 -4
- package/lib/modules/Rules/index.js +903 -1475
- package/lib/modules/Rules/types.js +40 -17
- package/lib/modules/SalesSummary/index.js +90 -85
- package/lib/modules/SalesSummary/types.js +16 -4
- package/lib/modules/SalesSummary/utils.js +427 -351
- package/lib/modules/ScanOrderLogger/index.js +79 -59
- package/lib/modules/ScanOrderLogger/providers/feishu.js +78 -54
- package/lib/modules/ScanOrderLogger/providers/grafana.js +36 -13
- package/lib/modules/ScanOrderLogger/types.js +16 -4
- package/lib/modules/Schedule/getDateIsInSchedule.js +163 -339
- package/lib/modules/Schedule/index.js +114 -100
- package/lib/modules/Schedule/type.js +16 -4
- package/lib/modules/Schedule/types.js +16 -4
- package/lib/modules/Schedule/utils.js +291 -433
- package/lib/modules/Step/index.js +52 -40
- package/lib/modules/Step/tyeps.js +16 -4
- package/lib/modules/Summary/index.js +71 -66
- package/lib/modules/Summary/types.js +16 -4
- package/lib/modules/Summary/utils.js +418 -791
- package/lib/modules/SurchargeList/index.js +60 -46
- package/lib/modules/SurchargeList/types.js +16 -4
- package/lib/modules/index.js +63 -245
- package/lib/plugins/app.js +16 -4
- package/lib/plugins/index.js +25 -36
- package/lib/plugins/request.js +126 -137
- package/lib/plugins/shopStore.js +16 -4
- package/lib/plugins/user.js +16 -4
- package/lib/plugins/window.js +179 -171
- package/lib/server/index.js +2337 -2675
- package/lib/server/modules/floor-plan/index.js +123 -102
- package/lib/server/modules/floor-plan/types.js +30 -15
- package/lib/server/modules/index.js +68 -106
- package/lib/server/modules/menu/index.js +122 -146
- package/lib/server/modules/menu/types.js +31 -18
- package/lib/server/modules/order/index.js +642 -567
- package/lib/server/modules/order/types.js +32 -117
- package/lib/server/modules/order/utils/filterBookings.js +194 -219
- package/lib/server/modules/order/utils/filterOrders.js +92 -118
- package/lib/server/modules/payment/index.js +83 -59
- package/lib/server/modules/payment/types.js +16 -4
- package/lib/server/modules/products/index.js +459 -575
- package/lib/server/modules/products/types.js +34 -44
- package/lib/server/modules/quotation/index.js +172 -137
- package/lib/server/modules/quotation/types.js +31 -21
- package/lib/server/modules/resource/index.js +184 -213
- package/lib/server/modules/resource/types.js +33 -42
- package/lib/server/modules/schedule/index.js +123 -135
- package/lib/server/modules/schedule/types.js +21 -14
- package/lib/server/modules/schedule/utils.js +163 -334
- package/lib/server/types.js +16 -4
- package/lib/server/utils/index.js +23 -25
- package/lib/server/utils/product.js +139 -196
- package/lib/server/utils/schedule.js +41 -34
- package/lib/server/utils/small-ticket.js +456 -478
- package/lib/server/utils/time.js +49 -40
- package/lib/solution/BaseSales/index.js +1016 -850
- package/lib/solution/BaseSales/types.js +37 -41
- package/lib/solution/BaseSales/utils/cartPromotion.js +460 -611
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +105 -85
- package/lib/solution/BaseSales/utils/quotationPrice.js +114 -56
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +143 -102
- package/lib/solution/BaseSales/utils.js +140 -155
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingByStep/index.js +1340 -1530
- package/lib/solution/BookingByStep/types.js +99 -40
- package/lib/solution/BookingByStep/utils/capacity.js +160 -192
- package/lib/solution/BookingByStep/utils/products.js +52 -42
- package/lib/solution/BookingByStep/utils/resources.js +330 -527
- package/lib/solution/BookingByStep/utils/stock.js +44 -65
- package/lib/solution/BookingByStep/utils/timeslots.js +131 -129
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.js +459 -543
- package/lib/solution/BookingTicket/types.js +77 -99
- package/lib/solution/BookingTicket/utils/addProductDecision.js +184 -219
- package/lib/solution/BookingTicket/utils/addTimeAvailability.js +89 -58
- package/lib/solution/BookingTicket/utils/bookingStatus.js +78 -107
- package/lib/solution/BookingTicket/utils/cartView.js +94 -110
- package/lib/solution/BookingTicket/utils/exampleData.js +0 -185
- package/lib/solution/BookingTicket/utils/orderCustomer.js +41 -18
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +86 -219
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +93 -144
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +91 -79
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +41 -54
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +81 -84
- package/lib/solution/BookingTicket/utils/scan/index.js +104 -98
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +43 -90
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +64 -52
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +58 -56
- package/lib/solution/BuyTickets/index.js +70 -67
- package/lib/solution/BuyTickets/types.js +38 -22
- package/lib/solution/Checkout/index.js +1158 -1451
- package/lib/solution/Checkout/types.js +61 -91
- package/lib/solution/Checkout/utils/index.js +156 -228
- package/lib/solution/PlaceOrder/index.js +0 -55
- package/lib/solution/RegisterAndLogin/config.js +460 -493
- package/lib/solution/RegisterAndLogin/index.js +630 -633
- package/lib/solution/RegisterAndLogin/types.js +76 -189
- package/lib/solution/RegisterAndLogin/utils.js +125 -183
- package/lib/solution/Sales/index.js +320 -317
- package/lib/solution/Sales/types.js +33 -27
- package/lib/solution/ScanOrder/index.js +862 -831
- package/lib/solution/ScanOrder/types.js +34 -33
- package/lib/solution/ScanOrder/utils.js +371 -406
- package/lib/solution/ShopDiscount/index.js +233 -235
- package/lib/solution/ShopDiscount/types.d.ts +4 -5
- package/lib/solution/ShopDiscount/types.js +37 -15
- package/lib/solution/ShopDiscount/utils.d.ts +0 -9
- package/lib/solution/ShopDiscount/utils.js +172 -309
- package/lib/solution/UnifiedBookingSales/index.js +405 -379
- package/lib/solution/UnifiedBookingSales/types.js +31 -12
- package/lib/solution/VenueBooking/index.d.ts +3 -31
- package/lib/solution/VenueBooking/index.js +916 -967
- package/lib/solution/VenueBooking/types.d.ts +1 -3
- package/lib/solution/VenueBooking/types.js +39 -20
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +2 -2
- package/lib/solution/VenueBooking/utils/dateSummary.js +62 -25
- package/lib/solution/VenueBooking/utils/resource.js +54 -31
- package/lib/solution/VenueBooking/utils/slotMerge.js +107 -94
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +0 -2
- package/lib/solution/VenueBooking/utils/timeSlot.js +133 -138
- package/lib/solution/VenueBooking/utils.js +67 -130
- package/lib/solution/index.js +41 -124
- package/lib/store/createStore.js +29 -32
- package/lib/types/index.d.ts +1 -1
- package/lib/types/index.js +16 -4
- package/lib/utils/task.js +36 -36
- package/lib/utils/watch.js +47 -81
- package/package.json +2 -4
- package/dist/solution/VenueBooking/utils/smartPricing.d.ts +0 -70
- package/dist/solution/VenueBooking/utils/smartPricing.js +0 -233
- package/lib/solution/VenueBooking/utils/smartPricing.d.ts +0 -70
- package/lib/solution/VenueBooking/utils/smartPricing.js +0 -192
package/dist/server/index.js
CHANGED
|
@@ -282,6 +282,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
282
282
|
while (1) switch (_context3.prev = _context3.next) {
|
|
283
283
|
case 0:
|
|
284
284
|
url = _ref5.url, method = _ref5.method, data = _ref5.data, config = _ref5.config;
|
|
285
|
+
console.log('[Server] handleProductQuery:', url, method, data, config);
|
|
285
286
|
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;
|
|
286
287
|
_this$resolveProductQ = _this.resolveProductQueryScheduleContext({
|
|
287
288
|
schedule_date: data.schedule_date,
|
|
@@ -317,7 +318,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
317
318
|
totalSubscribers: _this.productQuerySubscribers.size
|
|
318
319
|
});
|
|
319
320
|
}
|
|
320
|
-
_context3.next =
|
|
321
|
+
_context3.next = 9;
|
|
321
322
|
return _this.computeProductQueryResult({
|
|
322
323
|
menu_list_ids: menu_list_ids,
|
|
323
324
|
ids: ids,
|
|
@@ -327,13 +328,13 @@ var Server = /*#__PURE__*/function () {
|
|
|
327
328
|
extension_type: extension_type,
|
|
328
329
|
strategy_context: strategy_context
|
|
329
330
|
});
|
|
330
|
-
case
|
|
331
|
+
case 9:
|
|
331
332
|
result = _context3.sent;
|
|
332
333
|
if (subscriberId && typeof callback === 'function') {
|
|
333
334
|
_this.syncProductQueryScheduleTimers(subscriberId, strategy_context);
|
|
334
335
|
}
|
|
335
336
|
return _context3.abrupt("return", result);
|
|
336
|
-
case
|
|
337
|
+
case 12:
|
|
337
338
|
case "end":
|
|
338
339
|
return _context3.stop();
|
|
339
340
|
}
|
|
@@ -357,8 +358,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
357
358
|
pathname = _this.parseRequestPath(url || '', path);
|
|
358
359
|
idMatch = pathname.match(/^\/shop\/product\/query\/(\d+)$/);
|
|
359
360
|
productId = idMatch ? Number(idMatch[1]) : NaN;
|
|
361
|
+
console.log('[Server] handleProductQueryById:', pathname, method, data);
|
|
360
362
|
if (Number.isFinite(productId)) {
|
|
361
|
-
_context4.next =
|
|
363
|
+
_context4.next = 8;
|
|
362
364
|
break;
|
|
363
365
|
}
|
|
364
366
|
_this.logWarning('handleProductQueryById: 无效的商品 id', {
|
|
@@ -372,11 +374,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
372
374
|
item: null
|
|
373
375
|
}
|
|
374
376
|
});
|
|
375
|
-
case
|
|
377
|
+
case 8:
|
|
376
378
|
scheduleDateFromData = data && _typeof(data) === 'object' && typeof data.schedule_date === 'string' ? data.schedule_date.trim() : '';
|
|
377
379
|
schedule_date = scheduleDateFromData || (_this.extractQueryParam(url || '', 'schedule_date') || '').trim() || dayjs().format('YYYY-MM-DD');
|
|
378
380
|
if (schedule_date) {
|
|
379
|
-
_context4.next =
|
|
381
|
+
_context4.next = 13;
|
|
380
382
|
break;
|
|
381
383
|
}
|
|
382
384
|
_this.logWarning('handleProductQueryById: 缺少 schedule_date', {
|
|
@@ -388,7 +390,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
388
390
|
status: false,
|
|
389
391
|
data: null
|
|
390
392
|
});
|
|
391
|
-
case
|
|
393
|
+
case 13:
|
|
392
394
|
scheduleDtFromData = data && _typeof(data) === 'object' && typeof data.schedule_datetime === 'string' ? data.schedule_datetime.trim() : '';
|
|
393
395
|
scheduleDtFromUrl = (_this.extractQueryParam(url || '', 'schedule_datetime') || '').trim();
|
|
394
396
|
scheduleDatetime = scheduleDtFromData || scheduleDtFromUrl || "".concat(schedule_date, "T00:00:00");
|
|
@@ -402,7 +404,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
402
404
|
schedule_datetime: scheduleDatetime,
|
|
403
405
|
product_id: productId
|
|
404
406
|
}));
|
|
405
|
-
case
|
|
407
|
+
case 18:
|
|
406
408
|
case "end":
|
|
407
409
|
return _context4.stop();
|
|
408
410
|
}
|
|
@@ -450,6 +452,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
450
452
|
while (1) switch (_context6.prev = _context6.next) {
|
|
451
453
|
case 0:
|
|
452
454
|
url = _ref13.url, method = _ref13.method, data = _ref13.data, config = _ref13.config;
|
|
455
|
+
console.log('[Server] handleOrderList:', url, method, data, config);
|
|
453
456
|
queryPayload = data && _typeof(data) === 'object' ? _objectSpread({}, data) : {};
|
|
454
457
|
_ref15 = config || {}, callback = _ref15.callback, subscriberId = _ref15.subscriberId;
|
|
455
458
|
useLocal = _this.shouldUseLocalOrderQuery(queryPayload);
|
|
@@ -458,7 +461,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
458
461
|
useLocal: useLocal
|
|
459
462
|
});
|
|
460
463
|
if (!useLocal) {
|
|
461
|
-
_context6.next =
|
|
464
|
+
_context6.next = 9;
|
|
462
465
|
break;
|
|
463
466
|
}
|
|
464
467
|
if (subscriberId && typeof callback === 'function') {
|
|
@@ -472,7 +475,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
472
475
|
});
|
|
473
476
|
}
|
|
474
477
|
return _context6.abrupt("return", _this.computeOrderQueryResult(queryPayload));
|
|
475
|
-
case
|
|
478
|
+
case 9:
|
|
476
479
|
if (subscriberId) {
|
|
477
480
|
_this.orderQuerySubscribers.delete(subscriberId);
|
|
478
481
|
_this.logInfo('handleOrderList: 已清理订阅者(走远端)', {
|
|
@@ -481,7 +484,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
481
484
|
});
|
|
482
485
|
}
|
|
483
486
|
return _context6.abrupt("return", _this.fetchOrderListFromAPI(queryPayload));
|
|
484
|
-
case
|
|
487
|
+
case 11:
|
|
485
488
|
case "end":
|
|
486
489
|
return _context6.stop();
|
|
487
490
|
}
|
|
@@ -624,6 +627,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
624
627
|
while (1) switch (_context11.prev = _context11.next) {
|
|
625
628
|
case 0:
|
|
626
629
|
url = _ref26.url, method = _ref26.method, data = _ref26.data, config = _ref26.config;
|
|
630
|
+
console.log('[Server] handleBookingList:', url, method, data, config);
|
|
627
631
|
queryPayload = data && _typeof(data) === 'object' ? _objectSpread({}, data) : {};
|
|
628
632
|
_ref28 = config || {}, callback = _ref28.callback, subscriberId = _ref28.subscriberId;
|
|
629
633
|
useLocal = _this.shouldUseLocalBookingQuery(queryPayload);
|
|
@@ -632,7 +636,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
632
636
|
useLocal: useLocal
|
|
633
637
|
});
|
|
634
638
|
if (!useLocal) {
|
|
635
|
-
_context11.next =
|
|
639
|
+
_context11.next = 12;
|
|
636
640
|
break;
|
|
637
641
|
}
|
|
638
642
|
if (subscriberId) {
|
|
@@ -649,7 +653,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
649
653
|
});
|
|
650
654
|
}
|
|
651
655
|
return _context11.abrupt("return", _this.computeBookingQueryResult(queryPayload));
|
|
652
|
-
case
|
|
656
|
+
case 12:
|
|
653
657
|
if (subscriberId) {
|
|
654
658
|
_this.bookingQuerySubscribers.delete(subscriberId);
|
|
655
659
|
}
|
|
@@ -675,7 +679,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
675
679
|
});
|
|
676
680
|
}
|
|
677
681
|
return _context11.abrupt("return", _this.fetchBookingListFromAPI(queryPayload));
|
|
678
|
-
case
|
|
682
|
+
case 16:
|
|
679
683
|
case "end":
|
|
680
684
|
return _context11.stop();
|
|
681
685
|
}
|
|
@@ -697,6 +701,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
697
701
|
while (1) switch (_context12.prev = _context12.next) {
|
|
698
702
|
case 0:
|
|
699
703
|
url = _ref29.url, method = _ref29.method, data = _ref29.data, config = _ref29.config;
|
|
704
|
+
console.log('[Server] handleResourceList:', url, method, data, config);
|
|
700
705
|
list = (_this$resource = _this.resource) === null || _this$resource === void 0 ? void 0 : _this$resource.getResources({
|
|
701
706
|
skip: (data === null || data === void 0 ? void 0 : data.skip) || 1,
|
|
702
707
|
num: (data === null || data === void 0 ? void 0 : data.num) || 10
|
|
@@ -713,7 +718,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
713
718
|
message: '',
|
|
714
719
|
status: true
|
|
715
720
|
});
|
|
716
|
-
case
|
|
721
|
+
case 5:
|
|
717
722
|
case "end":
|
|
718
723
|
return _context12.stop();
|
|
719
724
|
}
|
|
@@ -1491,6 +1496,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
1491
1496
|
while (1) switch (_context21.prev = _context21.next) {
|
|
1492
1497
|
case 0:
|
|
1493
1498
|
url = _ref52.url, method = _ref52.method, data = _ref52.data, config = _ref52.config;
|
|
1499
|
+
console.log('[Server] handleGetScheduleTimePoints:', url, method, data, config);
|
|
1494
1500
|
menu_list_ids = data.menu_list_ids;
|
|
1495
1501
|
_this.logInfo('handleGetScheduleTimePoints 开始处理', {
|
|
1496
1502
|
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,
|
|
@@ -1499,7 +1505,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
1499
1505
|
|
|
1500
1506
|
// 检查必要的模块是否已注册
|
|
1501
1507
|
if (_this.menu) {
|
|
1502
|
-
_context21.next =
|
|
1508
|
+
_context21.next = 8;
|
|
1503
1509
|
break;
|
|
1504
1510
|
}
|
|
1505
1511
|
console.error('[Server] Menu 模块未注册');
|
|
@@ -1510,9 +1516,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
1510
1516
|
data: [],
|
|
1511
1517
|
status: false
|
|
1512
1518
|
});
|
|
1513
|
-
case
|
|
1519
|
+
case 8:
|
|
1514
1520
|
if (_this.schedule) {
|
|
1515
|
-
_context21.next =
|
|
1521
|
+
_context21.next = 12;
|
|
1516
1522
|
break;
|
|
1517
1523
|
}
|
|
1518
1524
|
console.error('[Server] Schedule 模块未注册');
|
|
@@ -1523,9 +1529,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
1523
1529
|
data: [],
|
|
1524
1530
|
status: false
|
|
1525
1531
|
});
|
|
1526
|
-
case
|
|
1532
|
+
case 12:
|
|
1527
1533
|
if (!(!menu_list_ids || !Array.isArray(menu_list_ids) || menu_list_ids.length === 0)) {
|
|
1528
|
-
_context21.next =
|
|
1534
|
+
_context21.next = 16;
|
|
1529
1535
|
break;
|
|
1530
1536
|
}
|
|
1531
1537
|
console.error('[Server] menu_list_ids 参数无效');
|
|
@@ -1539,10 +1545,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
1539
1545
|
data: [],
|
|
1540
1546
|
status: false
|
|
1541
1547
|
});
|
|
1542
|
-
case
|
|
1543
|
-
_context21.prev =
|
|
1548
|
+
case 16:
|
|
1549
|
+
_context21.prev = 16;
|
|
1544
1550
|
// 1. 获取餐牌列表
|
|
1545
1551
|
menuList = _this.menu.getMenuByIds(menu_list_ids);
|
|
1552
|
+
console.log("[Server] \u627E\u5230 ".concat(menuList.length, " \u4E2A\u9910\u724C"));
|
|
1546
1553
|
_this.logInfo('handleGetScheduleTimePoints: 获取到餐牌列表', {
|
|
1547
1554
|
requestedCount: menu_list_ids.length,
|
|
1548
1555
|
foundCount: menuList.length,
|
|
@@ -1552,11 +1559,12 @@ var Server = /*#__PURE__*/function () {
|
|
|
1552
1559
|
|
|
1553
1560
|
// 2. 提取所有的 schedule IDs
|
|
1554
1561
|
scheduleIds = extractScheduleIdsFromMenus(menuList);
|
|
1562
|
+
console.log("[Server] \u63D0\u53D6\u5230 ".concat(scheduleIds.length, " \u4E2A\u65E5\u7A0BID:"), scheduleIds);
|
|
1555
1563
|
_this.logInfo('handleGetScheduleTimePoints: 提取到日程 IDs', {
|
|
1556
1564
|
scheduleCount: scheduleIds.length
|
|
1557
1565
|
});
|
|
1558
1566
|
if (!(scheduleIds.length === 0)) {
|
|
1559
|
-
_context21.next =
|
|
1567
|
+
_context21.next = 26;
|
|
1560
1568
|
break;
|
|
1561
1569
|
}
|
|
1562
1570
|
_this.logInfo('handleGetScheduleTimePoints: 没有找到相关日程', {
|
|
@@ -1568,9 +1576,10 @@ var Server = /*#__PURE__*/function () {
|
|
|
1568
1576
|
data: [],
|
|
1569
1577
|
status: true
|
|
1570
1578
|
});
|
|
1571
|
-
case
|
|
1579
|
+
case 26:
|
|
1572
1580
|
// 3. 获取日程详情
|
|
1573
1581
|
scheduleList = _this.schedule.getScheduleByIds(scheduleIds);
|
|
1582
|
+
console.log("[Server] \u627E\u5230 ".concat(scheduleList.length, " \u4E2A\u65E5\u7A0B"));
|
|
1574
1583
|
_this.logInfo('handleGetScheduleTimePoints: 获取到日程详情', {
|
|
1575
1584
|
requestedCount: scheduleIds.length,
|
|
1576
1585
|
foundCount: scheduleList.length
|
|
@@ -1578,6 +1587,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
1578
1587
|
|
|
1579
1588
|
// 4. 提取时间点
|
|
1580
1589
|
timePoints = extractTimePointsFromSchedules(scheduleList);
|
|
1590
|
+
console.log("[Server] \u63D0\u53D6\u5230 ".concat(timePoints.length, " \u4E2A\u65F6\u95F4\u70B9:"), timePoints);
|
|
1581
1591
|
_this.logInfo('handleGetScheduleTimePoints 处理完成', {
|
|
1582
1592
|
menuListIdsCount: menu_list_ids.length,
|
|
1583
1593
|
menuCount: menuList.length,
|
|
@@ -1590,9 +1600,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
1590
1600
|
data: timePoints,
|
|
1591
1601
|
status: true
|
|
1592
1602
|
});
|
|
1593
|
-
case
|
|
1594
|
-
_context21.prev =
|
|
1595
|
-
_context21.t0 = _context21["catch"](
|
|
1603
|
+
case 35:
|
|
1604
|
+
_context21.prev = 35;
|
|
1605
|
+
_context21.t0 = _context21["catch"](16);
|
|
1596
1606
|
errorMessage = _context21.t0 instanceof Error ? _context21.t0.message : '未知错误';
|
|
1597
1607
|
console.error('[Server] 获取日程时间点失败:', _context21.t0);
|
|
1598
1608
|
_this.logError('handleGetScheduleTimePoints: 获取日程时间点失败', {
|
|
@@ -1605,11 +1615,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
1605
1615
|
data: [],
|
|
1606
1616
|
status: false
|
|
1607
1617
|
});
|
|
1608
|
-
case
|
|
1618
|
+
case 41:
|
|
1609
1619
|
case "end":
|
|
1610
1620
|
return _context21.stop();
|
|
1611
1621
|
}
|
|
1612
|
-
}, _callee21, null, [[
|
|
1622
|
+
}, _callee21, null, [[16, 35]]);
|
|
1613
1623
|
}));
|
|
1614
1624
|
return function (_x21) {
|
|
1615
1625
|
return _ref53.apply(this, arguments);
|
|
@@ -1619,6 +1629,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
1619
1629
|
var appPlugin = core.getPlugin('app');
|
|
1620
1630
|
this.app = (appPlugin === null || appPlugin === void 0 ? void 0 : appPlugin.getApp()) || null;
|
|
1621
1631
|
this.logger = ((_this$app4 = this.app) === null || _this$app4 === void 0 ? void 0 : _this$app4.logger) || null;
|
|
1632
|
+
console.log('[Server] Server 初始化', this.core);
|
|
1622
1633
|
this.logInfo('Server 初始化', {
|
|
1623
1634
|
hasApp: !!this.app,
|
|
1624
1635
|
hasLogger: !!this.logger
|
|
@@ -1679,6 +1690,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
1679
1690
|
});
|
|
1680
1691
|
}
|
|
1681
1692
|
_this2.router[method][path] = handler;
|
|
1693
|
+
console.log("[Server] \uD83D\uDCDD \u6CE8\u518C\u8DEF\u7531: ".concat(method.toUpperCase(), " ").concat(path));
|
|
1682
1694
|
_this2.logInfo("\u6CE8\u518C\u8DEF\u7531", {
|
|
1683
1695
|
method: method.toUpperCase(),
|
|
1684
1696
|
path: path
|
|
@@ -1745,6 +1757,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
1745
1757
|
_context22.next = 3;
|
|
1746
1758
|
return this.core.registerModule(module, options);
|
|
1747
1759
|
case 3:
|
|
1760
|
+
console.log("[Server] \u2705 ".concat(moduleName, " \u6A21\u5757\u5DF2\u6CE8\u518C"));
|
|
1748
1761
|
this.logInfo("\u6A21\u5757\u6CE8\u518C\u6210\u529F: ".concat(moduleName), {
|
|
1749
1762
|
moduleName: moduleName
|
|
1750
1763
|
});
|
|
@@ -1760,7 +1773,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
1760
1773
|
});
|
|
1761
1774
|
}
|
|
1762
1775
|
}
|
|
1763
|
-
case
|
|
1776
|
+
case 6:
|
|
1764
1777
|
case "end":
|
|
1765
1778
|
return _context22.stop();
|
|
1766
1779
|
}
|
|
@@ -1850,6 +1863,8 @@ var Server = /*#__PURE__*/function () {
|
|
|
1850
1863
|
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
1851
1864
|
while (1) switch (_context24.prev = _context24.next) {
|
|
1852
1865
|
case 0:
|
|
1866
|
+
console.log('[Server] 开始注册模块...');
|
|
1867
|
+
|
|
1853
1868
|
// 如果没有指定模块,则注册所有模块
|
|
1854
1869
|
configs = moduleConfigs || Object.keys(this.moduleRegistry);
|
|
1855
1870
|
this.logInfo('开始批量注册模块', {
|
|
@@ -1858,26 +1873,26 @@ var Server = /*#__PURE__*/function () {
|
|
|
1858
1873
|
});
|
|
1859
1874
|
registeredModules = [];
|
|
1860
1875
|
_iterator2 = _createForOfIteratorHelper(configs);
|
|
1861
|
-
_context24.prev =
|
|
1876
|
+
_context24.prev = 5;
|
|
1862
1877
|
_iterator2.s();
|
|
1863
|
-
case
|
|
1878
|
+
case 7:
|
|
1864
1879
|
if ((_step2 = _iterator2.n()).done) {
|
|
1865
|
-
_context24.next =
|
|
1880
|
+
_context24.next = 25;
|
|
1866
1881
|
break;
|
|
1867
1882
|
}
|
|
1868
1883
|
config = _step2.value;
|
|
1869
1884
|
configName = typeof config === 'string' ? config : config.name;
|
|
1870
|
-
_context24.prev =
|
|
1871
|
-
_context24.next =
|
|
1885
|
+
_context24.prev = 10;
|
|
1886
|
+
_context24.next = 13;
|
|
1872
1887
|
return this.registerModuleByName(config);
|
|
1873
|
-
case
|
|
1888
|
+
case 13:
|
|
1874
1889
|
result = _context24.sent;
|
|
1875
1890
|
registeredModules.push(result);
|
|
1876
|
-
_context24.next =
|
|
1891
|
+
_context24.next = 23;
|
|
1877
1892
|
break;
|
|
1878
|
-
case
|
|
1879
|
-
_context24.prev =
|
|
1880
|
-
_context24.t0 = _context24["catch"](
|
|
1893
|
+
case 17:
|
|
1894
|
+
_context24.prev = 17;
|
|
1895
|
+
_context24.t0 = _context24["catch"](10);
|
|
1881
1896
|
errorMessage = _context24.t0 instanceof Error ? _context24.t0.message : String(_context24.t0);
|
|
1882
1897
|
this.logError("\u6A21\u5757\u6CE8\u518C\u5931\u8D25: ".concat(configName), {
|
|
1883
1898
|
moduleName: configName,
|
|
@@ -1885,21 +1900,22 @@ var Server = /*#__PURE__*/function () {
|
|
|
1885
1900
|
});
|
|
1886
1901
|
console.error("[Server] \u6A21\u5757\u6CE8\u518C\u5931\u8D25:", _context24.t0);
|
|
1887
1902
|
throw _context24.t0;
|
|
1888
|
-
case
|
|
1889
|
-
_context24.next =
|
|
1903
|
+
case 23:
|
|
1904
|
+
_context24.next = 7;
|
|
1890
1905
|
break;
|
|
1891
|
-
case
|
|
1892
|
-
_context24.next =
|
|
1906
|
+
case 25:
|
|
1907
|
+
_context24.next = 30;
|
|
1893
1908
|
break;
|
|
1894
|
-
case
|
|
1895
|
-
_context24.prev =
|
|
1896
|
-
_context24.t1 = _context24["catch"](
|
|
1909
|
+
case 27:
|
|
1910
|
+
_context24.prev = 27;
|
|
1911
|
+
_context24.t1 = _context24["catch"](5);
|
|
1897
1912
|
_iterator2.e(_context24.t1);
|
|
1898
|
-
case
|
|
1899
|
-
_context24.prev =
|
|
1913
|
+
case 30:
|
|
1914
|
+
_context24.prev = 30;
|
|
1900
1915
|
_iterator2.f();
|
|
1901
|
-
return _context24.finish(
|
|
1902
|
-
case
|
|
1916
|
+
return _context24.finish(30);
|
|
1917
|
+
case 33:
|
|
1918
|
+
console.log('[Server] ✅ 所有模块注册完成');
|
|
1903
1919
|
this.logInfo('所有模块注册完成', {
|
|
1904
1920
|
registeredCount: registeredModules.length,
|
|
1905
1921
|
moduleNames: registeredModules.map(function (m) {
|
|
@@ -1908,11 +1924,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
1908
1924
|
})
|
|
1909
1925
|
});
|
|
1910
1926
|
return _context24.abrupt("return", registeredModules);
|
|
1911
|
-
case
|
|
1927
|
+
case 36:
|
|
1912
1928
|
case "end":
|
|
1913
1929
|
return _context24.stop();
|
|
1914
1930
|
}
|
|
1915
|
-
}, _callee24, this, [[
|
|
1931
|
+
}, _callee24, this, [[5, 27, 30, 33], [10, 17]]);
|
|
1916
1932
|
}));
|
|
1917
1933
|
function registerModules(_x26) {
|
|
1918
1934
|
return _registerModules.apply(this, arguments);
|
|
@@ -1932,6 +1948,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
1932
1948
|
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
1933
1949
|
while (1) switch (_context25.prev = _context25.next) {
|
|
1934
1950
|
case 0:
|
|
1951
|
+
console.log('[Server] 开始预加载模块数据...');
|
|
1935
1952
|
modulesToPreload = registeredModules.filter(function (m) {
|
|
1936
1953
|
return m.shouldPreload;
|
|
1937
1954
|
});
|
|
@@ -1942,39 +1959,41 @@ var Server = /*#__PURE__*/function () {
|
|
|
1942
1959
|
});
|
|
1943
1960
|
preloadResults = [];
|
|
1944
1961
|
_iterator3 = _createForOfIteratorHelper(registeredModules);
|
|
1945
|
-
_context25.prev =
|
|
1962
|
+
_context25.prev = 5;
|
|
1946
1963
|
_iterator3.s();
|
|
1947
|
-
case
|
|
1964
|
+
case 7:
|
|
1948
1965
|
if ((_step3 = _iterator3.n()).done) {
|
|
1949
|
-
_context25.next =
|
|
1966
|
+
_context25.next = 40;
|
|
1950
1967
|
break;
|
|
1951
1968
|
}
|
|
1952
1969
|
_step3$value = _step3.value, module = _step3$value.module, config = _step3$value.config, shouldPreload = _step3$value.shouldPreload;
|
|
1953
1970
|
if (shouldPreload) {
|
|
1954
|
-
_context25.next =
|
|
1971
|
+
_context25.next = 13;
|
|
1955
1972
|
break;
|
|
1956
1973
|
}
|
|
1974
|
+
console.log("[Server] \u23ED\uFE0F \u8DF3\u8FC7 ".concat(config.name, " \u6A21\u5757\u9884\u52A0\u8F7D"));
|
|
1957
1975
|
this.logInfo("\u8DF3\u8FC7\u6A21\u5757\u9884\u52A0\u8F7D: ".concat(config.name), {
|
|
1958
1976
|
moduleName: config.name,
|
|
1959
1977
|
reason: 'shouldPreload=false'
|
|
1960
1978
|
});
|
|
1961
|
-
return _context25.abrupt("continue",
|
|
1962
|
-
case
|
|
1979
|
+
return _context25.abrupt("continue", 38);
|
|
1980
|
+
case 13:
|
|
1963
1981
|
if (!(typeof module.preload === 'function')) {
|
|
1964
|
-
_context25.next =
|
|
1982
|
+
_context25.next = 36;
|
|
1965
1983
|
break;
|
|
1966
1984
|
}
|
|
1967
1985
|
startTime = Date.now();
|
|
1968
|
-
_context25.prev =
|
|
1986
|
+
_context25.prev = 15;
|
|
1969
1987
|
this.logInfo("\u5F00\u59CB\u9884\u52A0\u8F7D\u6A21\u5757: ".concat(config.name), {
|
|
1970
1988
|
moduleName: config.name
|
|
1971
1989
|
});
|
|
1972
1990
|
options === null || options === void 0 || (_options$onModuleLoad = options.onModuleLoad) === null || _options$onModuleLoad === void 0 || _options$onModuleLoad.call(options, config.name);
|
|
1973
|
-
_context25.next =
|
|
1991
|
+
_context25.next = 20;
|
|
1974
1992
|
return module.preload();
|
|
1975
|
-
case
|
|
1993
|
+
case 20:
|
|
1976
1994
|
options === null || options === void 0 || (_options$onModuleLoad2 = options.onModuleLoadComplete) === null || _options$onModuleLoad2 === void 0 || _options$onModuleLoad2.call(options, config.name);
|
|
1977
1995
|
duration = Date.now() - startTime;
|
|
1996
|
+
console.log("[Server] \u2705 ".concat(config.name, " \u6A21\u5757\u6570\u636E\u5DF2\u9884\u52A0\u8F7D"));
|
|
1978
1997
|
this.logInfo("\u6A21\u5757\u9884\u52A0\u8F7D\u6210\u529F: ".concat(config.name), {
|
|
1979
1998
|
moduleName: config.name,
|
|
1980
1999
|
duration: "".concat(duration, "ms")
|
|
@@ -1983,11 +2002,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
1983
2002
|
name: config.name,
|
|
1984
2003
|
success: true
|
|
1985
2004
|
});
|
|
1986
|
-
_context25.next =
|
|
2005
|
+
_context25.next = 34;
|
|
1987
2006
|
break;
|
|
1988
|
-
case
|
|
1989
|
-
_context25.prev =
|
|
1990
|
-
_context25.t0 = _context25["catch"](
|
|
2007
|
+
case 27:
|
|
2008
|
+
_context25.prev = 27;
|
|
2009
|
+
_context25.t0 = _context25["catch"](15);
|
|
1991
2010
|
_duration = Date.now() - startTime;
|
|
1992
2011
|
errorMessage = _context25.t0 instanceof Error ? _context25.t0.message : String(_context25.t0);
|
|
1993
2012
|
console.error("[Server] \u274C ".concat(config.name, " \u6A21\u5757\u9884\u52A0\u8F7D\u5931\u8D25:"), _context25.t0);
|
|
@@ -2001,43 +2020,45 @@ var Server = /*#__PURE__*/function () {
|
|
|
2001
2020
|
success: false,
|
|
2002
2021
|
error: errorMessage
|
|
2003
2022
|
});
|
|
2004
|
-
case
|
|
2005
|
-
_context25.next =
|
|
2023
|
+
case 34:
|
|
2024
|
+
_context25.next = 38;
|
|
2006
2025
|
break;
|
|
2007
|
-
case
|
|
2026
|
+
case 36:
|
|
2027
|
+
console.log("[Server] \u26A0\uFE0F ".concat(config.name, " \u6A21\u5757\u672A\u5B9E\u73B0 preload() \u65B9\u6CD5"));
|
|
2008
2028
|
this.logWarning("\u6A21\u5757\u672A\u5B9E\u73B0 preload \u65B9\u6CD5: ".concat(config.name), {
|
|
2009
2029
|
moduleName: config.name
|
|
2010
2030
|
});
|
|
2011
|
-
case
|
|
2012
|
-
_context25.next =
|
|
2031
|
+
case 38:
|
|
2032
|
+
_context25.next = 7;
|
|
2013
2033
|
break;
|
|
2014
|
-
case
|
|
2015
|
-
_context25.next =
|
|
2034
|
+
case 40:
|
|
2035
|
+
_context25.next = 45;
|
|
2016
2036
|
break;
|
|
2017
|
-
case
|
|
2018
|
-
_context25.prev =
|
|
2019
|
-
_context25.t1 = _context25["catch"](
|
|
2037
|
+
case 42:
|
|
2038
|
+
_context25.prev = 42;
|
|
2039
|
+
_context25.t1 = _context25["catch"](5);
|
|
2020
2040
|
_iterator3.e(_context25.t1);
|
|
2021
|
-
case
|
|
2022
|
-
_context25.prev =
|
|
2041
|
+
case 45:
|
|
2042
|
+
_context25.prev = 45;
|
|
2023
2043
|
_iterator3.f();
|
|
2024
|
-
return _context25.finish(
|
|
2025
|
-
case
|
|
2044
|
+
return _context25.finish(45);
|
|
2045
|
+
case 48:
|
|
2026
2046
|
successCount = preloadResults.filter(function (r) {
|
|
2027
2047
|
return r.success;
|
|
2028
2048
|
}).length;
|
|
2029
2049
|
failCount = preloadResults.filter(function (r) {
|
|
2030
2050
|
return !r.success;
|
|
2031
2051
|
}).length;
|
|
2052
|
+
console.log('[Server] ✅ 所有模块数据预加载完成');
|
|
2032
2053
|
this.logInfo('所有模块预加载完成', {
|
|
2033
2054
|
successCount: successCount,
|
|
2034
2055
|
failCount: failCount
|
|
2035
2056
|
});
|
|
2036
|
-
case
|
|
2057
|
+
case 52:
|
|
2037
2058
|
case "end":
|
|
2038
2059
|
return _context25.stop();
|
|
2039
2060
|
}
|
|
2040
|
-
}, _callee25, this, [[
|
|
2061
|
+
}, _callee25, this, [[5, 42, 45, 48], [15, 27]]);
|
|
2041
2062
|
}));
|
|
2042
2063
|
function preloadModulesData(_x27, _x28) {
|
|
2043
2064
|
return _preloadModulesData.apply(this, arguments);
|
|
@@ -2671,6 +2692,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
2671
2692
|
return _regeneratorRuntime().wrap(function _callee33$(_context33) {
|
|
2672
2693
|
while (1) switch (_context33.prev = _context33.next) {
|
|
2673
2694
|
case 0:
|
|
2695
|
+
console.log('[Server] 开始清空所有模块的IndexedDB缓存...');
|
|
2674
2696
|
this.logInfo('开始清空所有模块的 IndexedDB 缓存');
|
|
2675
2697
|
clearTasks = [];
|
|
2676
2698
|
moduleNames = []; // 收集所有模块的清空任务
|
|
@@ -2703,28 +2725,29 @@ var Server = /*#__PURE__*/function () {
|
|
|
2703
2725
|
moduleNames.push('FloorPlan');
|
|
2704
2726
|
}
|
|
2705
2727
|
if (!(clearTasks.length === 0)) {
|
|
2706
|
-
_context33.next =
|
|
2728
|
+
_context33.next = 15;
|
|
2707
2729
|
break;
|
|
2708
2730
|
}
|
|
2709
2731
|
console.warn('[Server] 没有找到已注册的模块,无需清空');
|
|
2710
2732
|
this.logWarning('没有找到已注册的模块,无需清空 IndexedDB');
|
|
2711
2733
|
return _context33.abrupt("return");
|
|
2712
|
-
case
|
|
2734
|
+
case 15:
|
|
2713
2735
|
this.logInfo('准备清空模块缓存', {
|
|
2714
2736
|
moduleNames: moduleNames
|
|
2715
2737
|
});
|
|
2716
|
-
_context33.prev =
|
|
2717
|
-
_context33.next =
|
|
2738
|
+
_context33.prev = 16;
|
|
2739
|
+
_context33.next = 19;
|
|
2718
2740
|
return Promise.all(clearTasks);
|
|
2719
|
-
case
|
|
2741
|
+
case 19:
|
|
2742
|
+
console.log("[Server] \u2705 \u5DF2\u6210\u529F\u6E05\u7A7A\u6240\u6709\u6A21\u5757\u7684IndexedDB\u7F13\u5B58: ".concat(moduleNames.join(', ')));
|
|
2720
2743
|
this.logInfo('成功清空所有模块的 IndexedDB 缓存', {
|
|
2721
2744
|
moduleNames: moduleNames
|
|
2722
2745
|
});
|
|
2723
|
-
_context33.next =
|
|
2746
|
+
_context33.next = 29;
|
|
2724
2747
|
break;
|
|
2725
|
-
case
|
|
2726
|
-
_context33.prev =
|
|
2727
|
-
_context33.t0 = _context33["catch"](
|
|
2748
|
+
case 23:
|
|
2749
|
+
_context33.prev = 23;
|
|
2750
|
+
_context33.t0 = _context33["catch"](16);
|
|
2728
2751
|
errorMessage = _context33.t0 instanceof Error ? _context33.t0.message : String(_context33.t0);
|
|
2729
2752
|
console.error('[Server] ❌ 清空IndexedDB缓存时发生错误:', _context33.t0);
|
|
2730
2753
|
this.logError('清空 IndexedDB 缓存时发生错误', {
|
|
@@ -2732,11 +2755,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
2732
2755
|
error: errorMessage
|
|
2733
2756
|
});
|
|
2734
2757
|
throw _context33.t0;
|
|
2735
|
-
case
|
|
2758
|
+
case 29:
|
|
2736
2759
|
case "end":
|
|
2737
2760
|
return _context33.stop();
|
|
2738
2761
|
}
|
|
2739
|
-
}, _callee33, this, [[
|
|
2762
|
+
}, _callee33, this, [[16, 23]]);
|
|
2740
2763
|
}));
|
|
2741
2764
|
function clearAllIndexDB() {
|
|
2742
2765
|
return _clearAllIndexDB.apply(this, arguments);
|
|
@@ -2903,6 +2926,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
2903
2926
|
}, {
|
|
2904
2927
|
key: "registerServerRoutes",
|
|
2905
2928
|
value: function registerServerRoutes() {
|
|
2929
|
+
console.log('[Server] 注册 Server 层业务路由...');
|
|
2906
2930
|
this.registerRoutes([{
|
|
2907
2931
|
method: 'post',
|
|
2908
2932
|
path: '/shop/product/query',
|
|
@@ -6554,8 +6578,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
6554
6578
|
this.logInfo('computeOrderQueryResult: 开始过滤', {
|
|
6555
6579
|
data: data
|
|
6556
6580
|
});
|
|
6581
|
+
console.log('[Server] computeOrderQueryResult', data);
|
|
6557
6582
|
if (this.order) {
|
|
6558
|
-
_context64.next =
|
|
6583
|
+
_context64.next = 5;
|
|
6559
6584
|
break;
|
|
6560
6585
|
}
|
|
6561
6586
|
this.logError('computeOrderQueryResult: Order 模块未注册');
|
|
@@ -6568,7 +6593,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
6568
6593
|
},
|
|
6569
6594
|
status: false
|
|
6570
6595
|
});
|
|
6571
|
-
case
|
|
6596
|
+
case 5:
|
|
6572
6597
|
rawList = this.order.getOrders();
|
|
6573
6598
|
this.logInfo('computeOrderQueryResult: 本地订单数量', {
|
|
6574
6599
|
rawCount: rawList.length
|
|
@@ -6589,7 +6614,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
6589
6614
|
message: '',
|
|
6590
6615
|
status: true
|
|
6591
6616
|
});
|
|
6592
|
-
case
|
|
6617
|
+
case 10:
|
|
6593
6618
|
case "end":
|
|
6594
6619
|
return _context64.stop();
|
|
6595
6620
|
}
|
|
@@ -7419,6 +7444,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7419
7444
|
key: "getProductScopeByMenuConfig",
|
|
7420
7445
|
value: function getProductScopeByMenuConfig(activeMenuList) {
|
|
7421
7446
|
if (!activeMenuList || activeMenuList.length === 0) {
|
|
7447
|
+
console.log('[Server] 没有生效的餐牌,返回空数组');
|
|
7422
7448
|
this.logInfo('getProductScopeByMenuConfig: 没有生效的餐牌,返回空数组', {
|
|
7423
7449
|
activeMenuCount: 0
|
|
7424
7450
|
});
|
|
@@ -7449,6 +7475,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7449
7475
|
|
|
7450
7476
|
// 如果有任何一个餐牌是 product_all,则返回所有商品
|
|
7451
7477
|
if (config.type === 'product_all') {
|
|
7478
|
+
console.log('[Server] 餐牌允许所有商品:', menu.name);
|
|
7452
7479
|
this.logInfo('getProductScopeByMenuConfig: 餐牌允许所有商品', {
|
|
7453
7480
|
menuId: menu.form_record_id,
|
|
7454
7481
|
menuName: menu.name,
|
|
@@ -7466,6 +7493,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7466
7493
|
productIds.forEach(function (id) {
|
|
7467
7494
|
return id && allowedProductIds.add(id);
|
|
7468
7495
|
});
|
|
7496
|
+
console.log('[Server] 餐牌允许指定商品 (product_ids):', menu.name, productIds);
|
|
7469
7497
|
this.logInfo('getProductScopeByMenuConfig: 餐牌允许指定商品', {
|
|
7470
7498
|
menuId: menu.form_record_id,
|
|
7471
7499
|
menuName: menu.name,
|
|
@@ -7482,6 +7510,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7482
7510
|
collectionIds.forEach(function (id) {
|
|
7483
7511
|
return id && allowedCollectionIds.add(id);
|
|
7484
7512
|
});
|
|
7513
|
+
console.log('[Server] 餐牌允许商品集合 (product_collection):', menu.name, collectionIds);
|
|
7485
7514
|
this.logInfo('getProductScopeByMenuConfig: 餐牌允许商品集合', {
|
|
7486
7515
|
menuId: menu.form_record_id,
|
|
7487
7516
|
menuName: menu.name,
|
|
@@ -7506,6 +7535,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
7506
7535
|
|
|
7507
7536
|
// 如果没有收集到任何商品 ID 和集合 ID,返回空数组
|
|
7508
7537
|
if (allowedProductIds.size === 0 && allowedCollectionIds.size === 0) {
|
|
7538
|
+
console.log('[Server] 没有允许的商品和集合');
|
|
7509
7539
|
this.logWarning('getProductScopeByMenuConfig: 没有允许的商品和集合', {
|
|
7510
7540
|
activeMenuCount: activeMenuList.length
|
|
7511
7541
|
});
|
|
@@ -7516,6 +7546,8 @@ var Server = /*#__PURE__*/function () {
|
|
|
7516
7546
|
}
|
|
7517
7547
|
var allowedProductIdsArray = Array.from(allowedProductIds);
|
|
7518
7548
|
var allowedCollectionIdsArray = Array.from(allowedCollectionIds);
|
|
7549
|
+
console.log('[Server] 允许的商品 IDs:', allowedProductIdsArray);
|
|
7550
|
+
console.log('[Server] 允许的集合 IDs:', allowedCollectionIdsArray);
|
|
7519
7551
|
this.logInfo('getProductScopeByMenuConfig: 收集到的允许规则', {
|
|
7520
7552
|
allowedProductCount: allowedProductIds.size,
|
|
7521
7553
|
allowedCollectionCount: allowedCollectionIds.size
|