@pisell/pisellos 0.0.567 → 0.0.568
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/walletPass/evaluator.js +0 -2
- package/dist/model/strategy/adapter/walletPass/example.js +3 -26
- package/dist/model/strategy/adapter/walletPass/utils.js +0 -3
- 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 +1 -4
- package/dist/modules/OpenData/index.js +0 -2
- package/dist/modules/Order/index.d.ts +1 -1
- package/dist/modules/Order/index.js +14 -41
- package/dist/modules/Payment/index.js +142 -270
- package/dist/modules/Payment/walletpass.js +4 -5
- package/dist/modules/Rules/index.js +0 -7
- package/dist/modules/Schedule/utils.js +0 -1
- package/dist/modules/Step/index.js +0 -1
- package/dist/plugins/request.js +1 -4
- package/dist/plugins/window.js +2 -6
- package/dist/server/index.js +88 -121
- package/dist/server/modules/menu/index.js +32 -41
- package/dist/server/modules/products/index.js +29 -49
- 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 +32 -40
- package/dist/server/utils/product.js +0 -1
- 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.d.ts +1 -1
- package/dist/solution/BookingTicket/index.js +5 -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 -246
- 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.d.ts +5 -0
- package/dist/solution/VenueBooking/index.js +364 -327
- 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 +130 -131
- package/lib/effects/index.js +46 -57
- package/lib/index.js +92 -53
- 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 +84 -63
- package/lib/model/strategy/adapter/promotion/evaluator.js +381 -231
- package/lib/model/strategy/adapter/promotion/examples.js +139 -159
- package/lib/model/strategy/adapter/promotion/index.js +1 -49
- package/lib/model/strategy/adapter/promotion/type.js +199 -35
- package/lib/model/strategy/adapter/type.js +4 -16
- package/lib/model/strategy/adapter/walletPass/evaluator.js +180 -152
- 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 +652 -402
- 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 +22 -45
- 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 +306 -241
- package/lib/modules/Cart/utils/cartRelationForms.js +29 -35
- package/lib/modules/Cart/utils/cartResource.js +72 -78
- package/lib/modules/Cart/utils/changePrice.js +26 -62
- package/lib/modules/Cart/utils/index.js +106 -48
- package/lib/modules/Customer/constants.js +13 -34
- package/lib/modules/Customer/index.js +216 -153
- 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 +117 -113
- 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 +63 -74
- package/lib/modules/OpenData/types.js +4 -16
- package/lib/modules/OpenData/utils.js +44 -78
- package/lib/modules/Order/index.d.ts +1 -1
- package/lib/modules/Order/index.js +332 -320
- package/lib/modules/Order/types.js +24 -33
- package/lib/modules/Order/utils.js +350 -284
- 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 +566 -432
- package/lib/modules/Payment/mx51.js +1 -0
- package/lib/modules/Payment/types.js +216 -107
- package/lib/modules/Payment/utils.js +50 -47
- package/lib/modules/Payment/walletpass.js +221 -203
- 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 +111 -110
- package/lib/modules/ProductList/types.js +9 -31
- package/lib/modules/Quotation/index.js +60 -82
- 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/Rules/index.js +1172 -872
- package/lib/modules/Rules/types.js +17 -40
- package/lib/modules/SalesSummary/index.js +59 -68
- package/lib/modules/SalesSummary/types.js +4 -16
- package/lib/modules/SalesSummary/utils.js +176 -193
- 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 -167
- package/lib/modules/Schedule/index.js +97 -107
- 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 -70
- package/lib/modules/Summary/types.js +4 -16
- package/lib/modules/Summary/utils.js +782 -429
- package/lib/modules/index.js +212 -57
- 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 +882 -623
- package/lib/server/modules/index.js +85 -59
- 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 +195 -231
- package/lib/server/modules/order/types.js +107 -32
- package/lib/server/modules/order/utils/filterBookings.js +174 -140
- package/lib/server/modules/order/utils/filterOrders.js +89 -60
- package/lib/server/modules/products/index.js +430 -335
- package/lib/server/modules/products/types.js +41 -34
- package/lib/server/modules/quotation/index.js +76 -77
- package/lib/server/modules/quotation/types.js +21 -31
- package/lib/server/modules/resource/index.js +216 -187
- package/lib/server/modules/resource/types.js +42 -33
- package/lib/server/modules/schedule/index.js +134 -119
- 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/time.js +40 -49
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingByStep/index.js +1530 -1343
- 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.d.ts +1 -1
- package/lib/solution/BookingTicket/index.js +147 -122
- package/lib/solution/BookingTicket/types.js +38 -64
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +64 -80
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +82 -80
- package/lib/solution/BookingTicket/utils/scan/index.js +90 -94
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +90 -43
- 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 +227 -158
- 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 +218 -200
- package/lib/solution/Sales/types.js +27 -33
- package/lib/solution/ScanOrder/index.js +803 -840
- package/lib/solution/ScanOrder/types.js +34 -34
- package/lib/solution/ScanOrder/utils.js +372 -331
- package/lib/solution/ShopDiscount/index.js +230 -236
- package/lib/solution/ShopDiscount/types.js +15 -37
- package/lib/solution/ShopDiscount/utils.js +309 -172
- package/lib/solution/VenueBooking/index.d.ts +5 -0
- package/lib/solution/VenueBooking/index.js +886 -929
- package/lib/solution/VenueBooking/types.js +20 -40
- package/lib/solution/VenueBooking/utils/dateSummary.js +22 -54
- package/lib/solution/VenueBooking/utils/resource.js +31 -54
- package/lib/solution/VenueBooking/utils/slotMerge.js +88 -106
- package/lib/solution/VenueBooking/utils/smartPricing.js +112 -100
- package/lib/solution/VenueBooking/utils/timeSlot.js +133 -132
- package/lib/solution/VenueBooking/utils.js +130 -67
- package/lib/solution/index.js +102 -37
- package/lib/store/createStore.js +32 -29
- package/lib/types/index.js +4 -16
- 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
|
@@ -144,7 +144,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
144
144
|
while (1) switch (_context.prev = _context.next) {
|
|
145
145
|
case 0:
|
|
146
146
|
url = _ref.url, method = _ref.method, data = _ref.data, config = _ref.config;
|
|
147
|
-
console.log('[Server] handleProductQuery:', url, method, data, config);
|
|
148
147
|
menu_list_ids = data.menu_list_ids, schedule_datetime = data.schedule_datetime, schedule_date = data.schedule_date;
|
|
149
148
|
_ref3 = config || {}, callback = _ref3.callback, subscriberId = _ref3.subscriberId;
|
|
150
149
|
_this.logInfo('handleProductQuery: 开始处理商品查询请求', {
|
|
@@ -173,7 +172,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
173
172
|
schedule_date: schedule_date,
|
|
174
173
|
schedule_datetime: schedule_datetime
|
|
175
174
|
}));
|
|
176
|
-
case
|
|
175
|
+
case 6:
|
|
177
176
|
case "end":
|
|
178
177
|
return _context.stop();
|
|
179
178
|
}
|
|
@@ -221,7 +220,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
221
220
|
while (1) switch (_context3.prev = _context3.next) {
|
|
222
221
|
case 0:
|
|
223
222
|
url = _ref7.url, method = _ref7.method, data = _ref7.data, config = _ref7.config;
|
|
224
|
-
console.log('[Server] handleOrderList:', url, method, data, config);
|
|
225
223
|
queryPayload = data && _typeof(data) === 'object' ? _objectSpread({}, data) : {};
|
|
226
224
|
_ref9 = config || {}, callback = _ref9.callback, subscriberId = _ref9.subscriberId;
|
|
227
225
|
_this.logInfo('handleOrderList: 开始处理订单列表请求', {
|
|
@@ -238,7 +236,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
238
236
|
});
|
|
239
237
|
}
|
|
240
238
|
return _context3.abrupt("return", _this.computeOrderQueryResult(queryPayload));
|
|
241
|
-
case
|
|
239
|
+
case 6:
|
|
242
240
|
case "end":
|
|
243
241
|
return _context3.stop();
|
|
244
242
|
}
|
|
@@ -292,7 +290,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
292
290
|
while (1) switch (_context5.prev = _context5.next) {
|
|
293
291
|
case 0:
|
|
294
292
|
url = _ref13.url, method = _ref13.method, data = _ref13.data, config = _ref13.config;
|
|
295
|
-
console.log('[Server] handleBookingList:', url, method, data, config);
|
|
296
293
|
queryPayload = data && _typeof(data) === 'object' ? _objectSpread({}, data) : {};
|
|
297
294
|
_ref15 = config || {}, callback = _ref15.callback, subscriberId = _ref15.subscriberId;
|
|
298
295
|
isToday = _this.isBookingQueryForToday(queryPayload);
|
|
@@ -301,7 +298,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
301
298
|
isToday: isToday
|
|
302
299
|
});
|
|
303
300
|
if (!isToday) {
|
|
304
|
-
_context5.next =
|
|
301
|
+
_context5.next = 10;
|
|
305
302
|
break;
|
|
306
303
|
}
|
|
307
304
|
if (subscriberId && typeof callback === 'function') {
|
|
@@ -315,7 +312,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
315
312
|
});
|
|
316
313
|
}
|
|
317
314
|
return _context5.abrupt("return", _this.computeBookingQueryResult(queryPayload));
|
|
318
|
-
case
|
|
315
|
+
case 10:
|
|
319
316
|
if (subscriberId) {
|
|
320
317
|
_this.bookingQuerySubscribers.delete(subscriberId);
|
|
321
318
|
_this.logInfo('handleBookingList: 已清理订阅者(非今天)', {
|
|
@@ -324,7 +321,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
324
321
|
});
|
|
325
322
|
}
|
|
326
323
|
return _context5.abrupt("return", _this.fetchBookingListFromAPI(queryPayload));
|
|
327
|
-
case
|
|
324
|
+
case 12:
|
|
328
325
|
case "end":
|
|
329
326
|
return _context5.stop();
|
|
330
327
|
}
|
|
@@ -346,7 +343,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
346
343
|
while (1) switch (_context6.prev = _context6.next) {
|
|
347
344
|
case 0:
|
|
348
345
|
url = _ref16.url, method = _ref16.method, data = _ref16.data, config = _ref16.config;
|
|
349
|
-
console.log('[Server] handleResourceList:', url, method, data, config);
|
|
350
346
|
list = (_this$resource = _this.resource) === null || _this$resource === void 0 ? void 0 : _this$resource.getResources({
|
|
351
347
|
skip: (data === null || data === void 0 ? void 0 : data.skip) || 1,
|
|
352
348
|
num: (data === null || data === void 0 ? void 0 : data.num) || 10
|
|
@@ -360,7 +356,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
360
356
|
message: '',
|
|
361
357
|
status: true
|
|
362
358
|
});
|
|
363
|
-
case
|
|
359
|
+
case 3:
|
|
364
360
|
case "end":
|
|
365
361
|
return _context6.stop();
|
|
366
362
|
}
|
|
@@ -415,7 +411,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
415
411
|
while (1) switch (_context8.prev = _context8.next) {
|
|
416
412
|
case 0:
|
|
417
413
|
url = _ref21.url, method = _ref21.method, data = _ref21.data, config = _ref21.config;
|
|
418
|
-
console.log('[Server] handleGetScheduleTimePoints:', url, method, data, config);
|
|
419
414
|
menu_list_ids = data.menu_list_ids;
|
|
420
415
|
_this.logInfo('handleGetScheduleTimePoints 开始处理', {
|
|
421
416
|
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,
|
|
@@ -424,7 +419,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
424
419
|
|
|
425
420
|
// 检查必要的模块是否已注册
|
|
426
421
|
if (_this.menu) {
|
|
427
|
-
_context8.next =
|
|
422
|
+
_context8.next = 7;
|
|
428
423
|
break;
|
|
429
424
|
}
|
|
430
425
|
console.error('[Server] Menu 模块未注册');
|
|
@@ -435,9 +430,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
435
430
|
data: [],
|
|
436
431
|
status: false
|
|
437
432
|
});
|
|
438
|
-
case
|
|
433
|
+
case 7:
|
|
439
434
|
if (_this.schedule) {
|
|
440
|
-
_context8.next =
|
|
435
|
+
_context8.next = 11;
|
|
441
436
|
break;
|
|
442
437
|
}
|
|
443
438
|
console.error('[Server] Schedule 模块未注册');
|
|
@@ -448,9 +443,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
448
443
|
data: [],
|
|
449
444
|
status: false
|
|
450
445
|
});
|
|
451
|
-
case
|
|
446
|
+
case 11:
|
|
452
447
|
if (!(!menu_list_ids || !Array.isArray(menu_list_ids) || menu_list_ids.length === 0)) {
|
|
453
|
-
_context8.next =
|
|
448
|
+
_context8.next = 15;
|
|
454
449
|
break;
|
|
455
450
|
}
|
|
456
451
|
console.error('[Server] menu_list_ids 参数无效');
|
|
@@ -464,11 +459,10 @@ var Server = /*#__PURE__*/function () {
|
|
|
464
459
|
data: [],
|
|
465
460
|
status: false
|
|
466
461
|
});
|
|
467
|
-
case
|
|
468
|
-
_context8.prev =
|
|
462
|
+
case 15:
|
|
463
|
+
_context8.prev = 15;
|
|
469
464
|
// 1. 获取餐牌列表
|
|
470
465
|
menuList = _this.menu.getMenuByIds(menu_list_ids);
|
|
471
|
-
console.log("[Server] \u627E\u5230 ".concat(menuList.length, " \u4E2A\u9910\u724C"));
|
|
472
466
|
_this.logInfo('handleGetScheduleTimePoints: 获取到餐牌列表', {
|
|
473
467
|
requestedCount: menu_list_ids.length,
|
|
474
468
|
foundCount: menuList.length,
|
|
@@ -478,12 +472,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
478
472
|
|
|
479
473
|
// 2. 提取所有的 schedule IDs
|
|
480
474
|
scheduleIds = extractScheduleIdsFromMenus(menuList);
|
|
481
|
-
console.log("[Server] \u63D0\u53D6\u5230 ".concat(scheduleIds.length, " \u4E2A\u65E5\u7A0BID:"), scheduleIds);
|
|
482
475
|
_this.logInfo('handleGetScheduleTimePoints: 提取到日程 IDs', {
|
|
483
476
|
scheduleCount: scheduleIds.length
|
|
484
477
|
});
|
|
485
478
|
if (!(scheduleIds.length === 0)) {
|
|
486
|
-
_context8.next =
|
|
479
|
+
_context8.next = 23;
|
|
487
480
|
break;
|
|
488
481
|
}
|
|
489
482
|
_this.logInfo('handleGetScheduleTimePoints: 没有找到相关日程', {
|
|
@@ -495,10 +488,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
495
488
|
data: [],
|
|
496
489
|
status: true
|
|
497
490
|
});
|
|
498
|
-
case
|
|
491
|
+
case 23:
|
|
499
492
|
// 3. 获取日程详情
|
|
500
493
|
scheduleList = _this.schedule.getScheduleByIds(scheduleIds);
|
|
501
|
-
console.log("[Server] \u627E\u5230 ".concat(scheduleList.length, " \u4E2A\u65E5\u7A0B"));
|
|
502
494
|
_this.logInfo('handleGetScheduleTimePoints: 获取到日程详情', {
|
|
503
495
|
requestedCount: scheduleIds.length,
|
|
504
496
|
foundCount: scheduleList.length
|
|
@@ -506,7 +498,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
506
498
|
|
|
507
499
|
// 4. 提取时间点
|
|
508
500
|
timePoints = extractTimePointsFromSchedules(scheduleList);
|
|
509
|
-
console.log("[Server] \u63D0\u53D6\u5230 ".concat(timePoints.length, " \u4E2A\u65F6\u95F4\u70B9:"), timePoints);
|
|
510
501
|
_this.logInfo('handleGetScheduleTimePoints 处理完成', {
|
|
511
502
|
menuListIdsCount: menu_list_ids.length,
|
|
512
503
|
menuCount: menuList.length,
|
|
@@ -519,9 +510,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
519
510
|
data: timePoints,
|
|
520
511
|
status: true
|
|
521
512
|
});
|
|
522
|
-
case
|
|
523
|
-
_context8.prev =
|
|
524
|
-
_context8.t0 = _context8["catch"](
|
|
513
|
+
case 30:
|
|
514
|
+
_context8.prev = 30;
|
|
515
|
+
_context8.t0 = _context8["catch"](15);
|
|
525
516
|
errorMessage = _context8.t0 instanceof Error ? _context8.t0.message : '未知错误';
|
|
526
517
|
console.error('[Server] 获取日程时间点失败:', _context8.t0);
|
|
527
518
|
_this.logError('handleGetScheduleTimePoints: 获取日程时间点失败', {
|
|
@@ -534,11 +525,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
534
525
|
data: [],
|
|
535
526
|
status: false
|
|
536
527
|
});
|
|
537
|
-
case
|
|
528
|
+
case 36:
|
|
538
529
|
case "end":
|
|
539
530
|
return _context8.stop();
|
|
540
531
|
}
|
|
541
|
-
}, _callee8, null, [[
|
|
532
|
+
}, _callee8, null, [[15, 30]]);
|
|
542
533
|
}));
|
|
543
534
|
return function (_x8) {
|
|
544
535
|
return _ref22.apply(this, arguments);
|
|
@@ -548,7 +539,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
548
539
|
var appPlugin = core.getPlugin('app');
|
|
549
540
|
this.app = (appPlugin === null || appPlugin === void 0 ? void 0 : appPlugin.getApp()) || null;
|
|
550
541
|
this.logger = ((_this$app = this.app) === null || _this$app === void 0 ? void 0 : _this$app.logger) || null;
|
|
551
|
-
console.log('[Server] Server 初始化', this.core);
|
|
552
542
|
this.logInfo('Server 初始化', {
|
|
553
543
|
hasApp: !!this.app,
|
|
554
544
|
hasLogger: !!this.logger
|
|
@@ -585,7 +575,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
585
575
|
});
|
|
586
576
|
}
|
|
587
577
|
_this2.router[method][path] = handler;
|
|
588
|
-
console.log("[Server] \uD83D\uDCDD \u6CE8\u518C\u8DEF\u7531: ".concat(method.toUpperCase(), " ").concat(path));
|
|
589
578
|
_this2.logInfo("\u6CE8\u518C\u8DEF\u7531", {
|
|
590
579
|
method: method.toUpperCase(),
|
|
591
580
|
path: path
|
|
@@ -616,7 +605,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
616
605
|
_context9.next = 3;
|
|
617
606
|
return this.core.registerModule(module, options);
|
|
618
607
|
case 3:
|
|
619
|
-
console.log("[Server] \u2705 ".concat(moduleName, " \u6A21\u5757\u5DF2\u6CE8\u518C"));
|
|
620
608
|
this.logInfo("\u6A21\u5757\u6CE8\u518C\u6210\u529F: ".concat(moduleName), {
|
|
621
609
|
moduleName: moduleName
|
|
622
610
|
});
|
|
@@ -632,7 +620,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
632
620
|
});
|
|
633
621
|
}
|
|
634
622
|
}
|
|
635
|
-
case
|
|
623
|
+
case 5:
|
|
636
624
|
case "end":
|
|
637
625
|
return _context9.stop();
|
|
638
626
|
}
|
|
@@ -722,8 +710,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
722
710
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
723
711
|
while (1) switch (_context11.prev = _context11.next) {
|
|
724
712
|
case 0:
|
|
725
|
-
console.log('[Server] 开始注册模块...');
|
|
726
|
-
|
|
727
713
|
// 如果没有指定模块,则注册所有模块
|
|
728
714
|
configs = moduleConfigs || Object.keys(this.moduleRegistry);
|
|
729
715
|
this.logInfo('开始批量注册模块', {
|
|
@@ -732,26 +718,26 @@ var Server = /*#__PURE__*/function () {
|
|
|
732
718
|
});
|
|
733
719
|
registeredModules = [];
|
|
734
720
|
_iterator = _createForOfIteratorHelper(configs);
|
|
735
|
-
_context11.prev =
|
|
721
|
+
_context11.prev = 4;
|
|
736
722
|
_iterator.s();
|
|
737
|
-
case
|
|
723
|
+
case 6:
|
|
738
724
|
if ((_step = _iterator.n()).done) {
|
|
739
|
-
_context11.next =
|
|
725
|
+
_context11.next = 24;
|
|
740
726
|
break;
|
|
741
727
|
}
|
|
742
728
|
config = _step.value;
|
|
743
729
|
configName = typeof config === 'string' ? config : config.name;
|
|
744
|
-
_context11.prev =
|
|
745
|
-
_context11.next =
|
|
730
|
+
_context11.prev = 9;
|
|
731
|
+
_context11.next = 12;
|
|
746
732
|
return this.registerModuleByName(config);
|
|
747
|
-
case
|
|
733
|
+
case 12:
|
|
748
734
|
result = _context11.sent;
|
|
749
735
|
registeredModules.push(result);
|
|
750
|
-
_context11.next =
|
|
736
|
+
_context11.next = 22;
|
|
751
737
|
break;
|
|
752
|
-
case
|
|
753
|
-
_context11.prev =
|
|
754
|
-
_context11.t0 = _context11["catch"](
|
|
738
|
+
case 16:
|
|
739
|
+
_context11.prev = 16;
|
|
740
|
+
_context11.t0 = _context11["catch"](9);
|
|
755
741
|
errorMessage = _context11.t0 instanceof Error ? _context11.t0.message : String(_context11.t0);
|
|
756
742
|
this.logError("\u6A21\u5757\u6CE8\u518C\u5931\u8D25: ".concat(configName), {
|
|
757
743
|
moduleName: configName,
|
|
@@ -759,22 +745,21 @@ var Server = /*#__PURE__*/function () {
|
|
|
759
745
|
});
|
|
760
746
|
console.error("[Server] \u6A21\u5757\u6CE8\u518C\u5931\u8D25:", _context11.t0);
|
|
761
747
|
throw _context11.t0;
|
|
762
|
-
case
|
|
763
|
-
_context11.next =
|
|
748
|
+
case 22:
|
|
749
|
+
_context11.next = 6;
|
|
764
750
|
break;
|
|
765
|
-
case
|
|
766
|
-
_context11.next =
|
|
751
|
+
case 24:
|
|
752
|
+
_context11.next = 29;
|
|
767
753
|
break;
|
|
768
|
-
case
|
|
769
|
-
_context11.prev =
|
|
770
|
-
_context11.t1 = _context11["catch"](
|
|
754
|
+
case 26:
|
|
755
|
+
_context11.prev = 26;
|
|
756
|
+
_context11.t1 = _context11["catch"](4);
|
|
771
757
|
_iterator.e(_context11.t1);
|
|
772
|
-
case
|
|
773
|
-
_context11.prev =
|
|
758
|
+
case 29:
|
|
759
|
+
_context11.prev = 29;
|
|
774
760
|
_iterator.f();
|
|
775
|
-
return _context11.finish(
|
|
776
|
-
case
|
|
777
|
-
console.log('[Server] ✅ 所有模块注册完成');
|
|
761
|
+
return _context11.finish(29);
|
|
762
|
+
case 32:
|
|
778
763
|
this.logInfo('所有模块注册完成', {
|
|
779
764
|
registeredCount: registeredModules.length,
|
|
780
765
|
moduleNames: registeredModules.map(function (m) {
|
|
@@ -783,11 +768,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
783
768
|
})
|
|
784
769
|
});
|
|
785
770
|
return _context11.abrupt("return", registeredModules);
|
|
786
|
-
case
|
|
771
|
+
case 34:
|
|
787
772
|
case "end":
|
|
788
773
|
return _context11.stop();
|
|
789
774
|
}
|
|
790
|
-
}, _callee11, this, [[
|
|
775
|
+
}, _callee11, this, [[4, 26, 29, 32], [9, 16]]);
|
|
791
776
|
}));
|
|
792
777
|
function registerModules(_x13) {
|
|
793
778
|
return _registerModules.apply(this, arguments);
|
|
@@ -807,7 +792,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
807
792
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
808
793
|
while (1) switch (_context12.prev = _context12.next) {
|
|
809
794
|
case 0:
|
|
810
|
-
console.log('[Server] 开始预加载模块数据...');
|
|
811
795
|
modulesToPreload = registeredModules.filter(function (m) {
|
|
812
796
|
return m.shouldPreload;
|
|
813
797
|
});
|
|
@@ -818,41 +802,39 @@ var Server = /*#__PURE__*/function () {
|
|
|
818
802
|
});
|
|
819
803
|
preloadResults = [];
|
|
820
804
|
_iterator2 = _createForOfIteratorHelper(registeredModules);
|
|
821
|
-
_context12.prev =
|
|
805
|
+
_context12.prev = 4;
|
|
822
806
|
_iterator2.s();
|
|
823
|
-
case
|
|
807
|
+
case 6:
|
|
824
808
|
if ((_step2 = _iterator2.n()).done) {
|
|
825
|
-
_context12.next =
|
|
809
|
+
_context12.next = 36;
|
|
826
810
|
break;
|
|
827
811
|
}
|
|
828
812
|
_step2$value = _step2.value, module = _step2$value.module, config = _step2$value.config, shouldPreload = _step2$value.shouldPreload;
|
|
829
813
|
if (shouldPreload) {
|
|
830
|
-
_context12.next =
|
|
814
|
+
_context12.next = 11;
|
|
831
815
|
break;
|
|
832
816
|
}
|
|
833
|
-
console.log("[Server] \u23ED\uFE0F \u8DF3\u8FC7 ".concat(config.name, " \u6A21\u5757\u9884\u52A0\u8F7D"));
|
|
834
817
|
this.logInfo("\u8DF3\u8FC7\u6A21\u5757\u9884\u52A0\u8F7D: ".concat(config.name), {
|
|
835
818
|
moduleName: config.name,
|
|
836
819
|
reason: 'shouldPreload=false'
|
|
837
820
|
});
|
|
838
|
-
return _context12.abrupt("continue",
|
|
839
|
-
case
|
|
821
|
+
return _context12.abrupt("continue", 34);
|
|
822
|
+
case 11:
|
|
840
823
|
if (!(typeof module.preload === 'function')) {
|
|
841
|
-
_context12.next =
|
|
824
|
+
_context12.next = 33;
|
|
842
825
|
break;
|
|
843
826
|
}
|
|
844
827
|
startTime = Date.now();
|
|
845
|
-
_context12.prev =
|
|
828
|
+
_context12.prev = 13;
|
|
846
829
|
this.logInfo("\u5F00\u59CB\u9884\u52A0\u8F7D\u6A21\u5757: ".concat(config.name), {
|
|
847
830
|
moduleName: config.name
|
|
848
831
|
});
|
|
849
832
|
options === null || options === void 0 || (_options$onModuleLoad = options.onModuleLoad) === null || _options$onModuleLoad === void 0 || _options$onModuleLoad.call(options, config.name);
|
|
850
|
-
_context12.next =
|
|
833
|
+
_context12.next = 18;
|
|
851
834
|
return module.preload();
|
|
852
|
-
case
|
|
835
|
+
case 18:
|
|
853
836
|
options === null || options === void 0 || (_options$onModuleLoad2 = options.onModuleLoadComplete) === null || _options$onModuleLoad2 === void 0 || _options$onModuleLoad2.call(options, config.name);
|
|
854
837
|
duration = Date.now() - startTime;
|
|
855
|
-
console.log("[Server] \u2705 ".concat(config.name, " \u6A21\u5757\u6570\u636E\u5DF2\u9884\u52A0\u8F7D"));
|
|
856
838
|
this.logInfo("\u6A21\u5757\u9884\u52A0\u8F7D\u6210\u529F: ".concat(config.name), {
|
|
857
839
|
moduleName: config.name,
|
|
858
840
|
duration: "".concat(duration, "ms")
|
|
@@ -861,11 +843,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
861
843
|
name: config.name,
|
|
862
844
|
success: true
|
|
863
845
|
});
|
|
864
|
-
_context12.next =
|
|
846
|
+
_context12.next = 31;
|
|
865
847
|
break;
|
|
866
|
-
case
|
|
867
|
-
_context12.prev =
|
|
868
|
-
_context12.t0 = _context12["catch"](
|
|
848
|
+
case 24:
|
|
849
|
+
_context12.prev = 24;
|
|
850
|
+
_context12.t0 = _context12["catch"](13);
|
|
869
851
|
_duration = Date.now() - startTime;
|
|
870
852
|
errorMessage = _context12.t0 instanceof Error ? _context12.t0.message : String(_context12.t0);
|
|
871
853
|
console.error("[Server] \u274C ".concat(config.name, " \u6A21\u5757\u9884\u52A0\u8F7D\u5931\u8D25:"), _context12.t0);
|
|
@@ -879,45 +861,43 @@ var Server = /*#__PURE__*/function () {
|
|
|
879
861
|
success: false,
|
|
880
862
|
error: errorMessage
|
|
881
863
|
});
|
|
882
|
-
case
|
|
883
|
-
_context12.next =
|
|
864
|
+
case 31:
|
|
865
|
+
_context12.next = 34;
|
|
884
866
|
break;
|
|
885
|
-
case
|
|
886
|
-
console.log("[Server] \u26A0\uFE0F ".concat(config.name, " \u6A21\u5757\u672A\u5B9E\u73B0 preload() \u65B9\u6CD5"));
|
|
867
|
+
case 33:
|
|
887
868
|
this.logWarning("\u6A21\u5757\u672A\u5B9E\u73B0 preload \u65B9\u6CD5: ".concat(config.name), {
|
|
888
869
|
moduleName: config.name
|
|
889
870
|
});
|
|
890
|
-
case
|
|
891
|
-
_context12.next =
|
|
871
|
+
case 34:
|
|
872
|
+
_context12.next = 6;
|
|
892
873
|
break;
|
|
893
|
-
case
|
|
894
|
-
_context12.next =
|
|
874
|
+
case 36:
|
|
875
|
+
_context12.next = 41;
|
|
895
876
|
break;
|
|
896
|
-
case
|
|
897
|
-
_context12.prev =
|
|
898
|
-
_context12.t1 = _context12["catch"](
|
|
877
|
+
case 38:
|
|
878
|
+
_context12.prev = 38;
|
|
879
|
+
_context12.t1 = _context12["catch"](4);
|
|
899
880
|
_iterator2.e(_context12.t1);
|
|
900
|
-
case
|
|
901
|
-
_context12.prev =
|
|
881
|
+
case 41:
|
|
882
|
+
_context12.prev = 41;
|
|
902
883
|
_iterator2.f();
|
|
903
|
-
return _context12.finish(
|
|
904
|
-
case
|
|
884
|
+
return _context12.finish(41);
|
|
885
|
+
case 44:
|
|
905
886
|
successCount = preloadResults.filter(function (r) {
|
|
906
887
|
return r.success;
|
|
907
888
|
}).length;
|
|
908
889
|
failCount = preloadResults.filter(function (r) {
|
|
909
890
|
return !r.success;
|
|
910
891
|
}).length;
|
|
911
|
-
console.log('[Server] ✅ 所有模块数据预加载完成');
|
|
912
892
|
this.logInfo('所有模块预加载完成', {
|
|
913
893
|
successCount: successCount,
|
|
914
894
|
failCount: failCount
|
|
915
895
|
});
|
|
916
|
-
case
|
|
896
|
+
case 47:
|
|
917
897
|
case "end":
|
|
918
898
|
return _context12.stop();
|
|
919
899
|
}
|
|
920
|
-
}, _callee12, this, [[
|
|
900
|
+
}, _callee12, this, [[4, 38, 41, 44], [13, 24]]);
|
|
921
901
|
}));
|
|
922
902
|
function preloadModulesData(_x14, _x15) {
|
|
923
903
|
return _preloadModulesData.apply(this, arguments);
|
|
@@ -1124,7 +1104,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
1124
1104
|
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
1125
1105
|
while (1) switch (_context15.prev = _context15.next) {
|
|
1126
1106
|
case 0:
|
|
1127
|
-
console.log('[Server] 开始清空所有模块的IndexedDB缓存...');
|
|
1128
1107
|
this.logInfo('开始清空所有模块的 IndexedDB 缓存');
|
|
1129
1108
|
clearTasks = [];
|
|
1130
1109
|
moduleNames = []; // 收集所有模块的清空任务
|
|
@@ -1153,29 +1132,28 @@ var Server = /*#__PURE__*/function () {
|
|
|
1153
1132
|
moduleNames.push('Order');
|
|
1154
1133
|
}
|
|
1155
1134
|
if (!(clearTasks.length === 0)) {
|
|
1156
|
-
_context15.next =
|
|
1135
|
+
_context15.next = 13;
|
|
1157
1136
|
break;
|
|
1158
1137
|
}
|
|
1159
1138
|
console.warn('[Server] 没有找到已注册的模块,无需清空');
|
|
1160
1139
|
this.logWarning('没有找到已注册的模块,无需清空 IndexedDB');
|
|
1161
1140
|
return _context15.abrupt("return");
|
|
1162
|
-
case
|
|
1141
|
+
case 13:
|
|
1163
1142
|
this.logInfo('准备清空模块缓存', {
|
|
1164
1143
|
moduleNames: moduleNames
|
|
1165
1144
|
});
|
|
1166
|
-
_context15.prev =
|
|
1167
|
-
_context15.next =
|
|
1145
|
+
_context15.prev = 14;
|
|
1146
|
+
_context15.next = 17;
|
|
1168
1147
|
return Promise.all(clearTasks);
|
|
1169
|
-
case
|
|
1170
|
-
console.log("[Server] \u2705 \u5DF2\u6210\u529F\u6E05\u7A7A\u6240\u6709\u6A21\u5757\u7684IndexedDB\u7F13\u5B58: ".concat(moduleNames.join(', ')));
|
|
1148
|
+
case 17:
|
|
1171
1149
|
this.logInfo('成功清空所有模块的 IndexedDB 缓存', {
|
|
1172
1150
|
moduleNames: moduleNames
|
|
1173
1151
|
});
|
|
1174
|
-
_context15.next =
|
|
1152
|
+
_context15.next = 26;
|
|
1175
1153
|
break;
|
|
1176
|
-
case
|
|
1177
|
-
_context15.prev =
|
|
1178
|
-
_context15.t0 = _context15["catch"](
|
|
1154
|
+
case 20:
|
|
1155
|
+
_context15.prev = 20;
|
|
1156
|
+
_context15.t0 = _context15["catch"](14);
|
|
1179
1157
|
errorMessage = _context15.t0 instanceof Error ? _context15.t0.message : String(_context15.t0);
|
|
1180
1158
|
console.error('[Server] ❌ 清空IndexedDB缓存时发生错误:', _context15.t0);
|
|
1181
1159
|
this.logError('清空 IndexedDB 缓存时发生错误', {
|
|
@@ -1183,11 +1161,11 @@ var Server = /*#__PURE__*/function () {
|
|
|
1183
1161
|
error: errorMessage
|
|
1184
1162
|
});
|
|
1185
1163
|
throw _context15.t0;
|
|
1186
|
-
case
|
|
1164
|
+
case 26:
|
|
1187
1165
|
case "end":
|
|
1188
1166
|
return _context15.stop();
|
|
1189
1167
|
}
|
|
1190
|
-
}, _callee15, this, [[
|
|
1168
|
+
}, _callee15, this, [[14, 20]]);
|
|
1191
1169
|
}));
|
|
1192
1170
|
function clearAllIndexDB() {
|
|
1193
1171
|
return _clearAllIndexDB.apply(this, arguments);
|
|
@@ -1225,7 +1203,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
1225
1203
|
key: "hasRoute",
|
|
1226
1204
|
value: function hasRoute(method, path) {
|
|
1227
1205
|
var _this$router$method2;
|
|
1228
|
-
console.log(method, path, 'method, path');
|
|
1229
1206
|
return !!((_this$router$method2 = this.router[method]) !== null && _this$router$method2 !== void 0 && _this$router$method2[path]);
|
|
1230
1207
|
}
|
|
1231
1208
|
|
|
@@ -1328,7 +1305,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
1328
1305
|
}, {
|
|
1329
1306
|
key: "registerServerRoutes",
|
|
1330
1307
|
value: function registerServerRoutes() {
|
|
1331
|
-
console.log('[Server] 注册 Server 层业务路由...');
|
|
1332
1308
|
this.registerRoutes([{
|
|
1333
1309
|
method: 'post',
|
|
1334
1310
|
path: '/shop/product/query',
|
|
@@ -1486,9 +1462,8 @@ var Server = /*#__PURE__*/function () {
|
|
|
1486
1462
|
this.logInfo('computeOrderQueryResult: 开始过滤', {
|
|
1487
1463
|
data: data
|
|
1488
1464
|
});
|
|
1489
|
-
console.log('[Server] computeOrderQueryResult', data);
|
|
1490
1465
|
if (this.order) {
|
|
1491
|
-
_context18.next =
|
|
1466
|
+
_context18.next = 4;
|
|
1492
1467
|
break;
|
|
1493
1468
|
}
|
|
1494
1469
|
this.logError('computeOrderQueryResult: Order 模块未注册');
|
|
@@ -1501,7 +1476,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
1501
1476
|
},
|
|
1502
1477
|
status: false
|
|
1503
1478
|
});
|
|
1504
|
-
case
|
|
1479
|
+
case 4:
|
|
1505
1480
|
rawList = this.order.getOrders();
|
|
1506
1481
|
this.logInfo('computeOrderQueryResult: 本地订单数量', {
|
|
1507
1482
|
rawCount: rawList.length
|
|
@@ -1521,7 +1496,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
1521
1496
|
message: '',
|
|
1522
1497
|
status: true
|
|
1523
1498
|
});
|
|
1524
|
-
case
|
|
1499
|
+
case 9:
|
|
1525
1500
|
case "end":
|
|
1526
1501
|
return _context18.stop();
|
|
1527
1502
|
}
|
|
@@ -1971,7 +1946,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
1971
1946
|
value: function filterProductsByMenuConfig(products, activeMenuList) {
|
|
1972
1947
|
// 如果没有生效的餐牌,返回空数组
|
|
1973
1948
|
if (!activeMenuList || activeMenuList.length === 0) {
|
|
1974
|
-
console.log('[Server] 没有生效的餐牌,返回空数组');
|
|
1975
1949
|
this.logInfo('filterProductsByMenuConfig: 没有生效的餐牌,返回空数组', {
|
|
1976
1950
|
productCount: products.length,
|
|
1977
1951
|
activeMenuCount: 0
|
|
@@ -2000,7 +1974,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
2000
1974
|
|
|
2001
1975
|
// 如果有任何一个餐牌是 product_all,则返回所有商品
|
|
2002
1976
|
if (config.type === 'product_all') {
|
|
2003
|
-
console.log('[Server] 餐牌允许所有商品:', menu.name);
|
|
2004
1977
|
this.logInfo('filterProductsByMenuConfig: 餐牌允许所有商品', {
|
|
2005
1978
|
menuId: menu.form_record_id,
|
|
2006
1979
|
menuName: menu.name,
|
|
@@ -2018,7 +1991,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
2018
1991
|
productIds.forEach(function (id) {
|
|
2019
1992
|
return id && allowedProductIds.add(id);
|
|
2020
1993
|
});
|
|
2021
|
-
console.log('[Server] 餐牌允许指定商品 (product_ids):', menu.name, productIds);
|
|
2022
1994
|
this.logInfo('filterProductsByMenuConfig: 餐牌允许指定商品', {
|
|
2023
1995
|
menuId: menu.form_record_id,
|
|
2024
1996
|
menuName: menu.name,
|
|
@@ -2035,7 +2007,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
2035
2007
|
collectionIds.forEach(function (id) {
|
|
2036
2008
|
return id && allowedCollectionIds.add(id);
|
|
2037
2009
|
});
|
|
2038
|
-
console.log('[Server] 餐牌允许商品集合 (product_collection):', menu.name, collectionIds);
|
|
2039
2010
|
this.logInfo('filterProductsByMenuConfig: 餐牌允许商品集合', {
|
|
2040
2011
|
menuId: menu.form_record_id,
|
|
2041
2012
|
menuName: menu.name,
|
|
@@ -2060,7 +2031,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
2060
2031
|
|
|
2061
2032
|
// 如果没有收集到任何商品 ID 和集合 ID,返回空数组
|
|
2062
2033
|
if (allowedProductIds.size === 0 && allowedCollectionIds.size === 0) {
|
|
2063
|
-
console.log('[Server] 没有允许的商品和集合');
|
|
2064
2034
|
this.logWarning('filterProductsByMenuConfig: 没有允许的商品和集合', {
|
|
2065
2035
|
productCount: products.length,
|
|
2066
2036
|
activeMenuCount: activeMenuList.length
|
|
@@ -2069,8 +2039,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
2069
2039
|
}
|
|
2070
2040
|
var allowedProductIdsArray = Array.from(allowedProductIds);
|
|
2071
2041
|
var allowedCollectionIdsArray = Array.from(allowedCollectionIds);
|
|
2072
|
-
console.log('[Server] 允许的商品 IDs:', allowedProductIdsArray);
|
|
2073
|
-
console.log('[Server] 允许的集合 IDs:', allowedCollectionIdsArray);
|
|
2074
2042
|
this.logInfo('filterProductsByMenuConfig: 收集到的允许规则', {
|
|
2075
2043
|
allowedProductCount: allowedProductIds.size,
|
|
2076
2044
|
allowedCollectionCount: allowedCollectionIds.size
|
|
@@ -2094,7 +2062,6 @@ var Server = /*#__PURE__*/function () {
|
|
|
2094
2062
|
}
|
|
2095
2063
|
return false;
|
|
2096
2064
|
});
|
|
2097
|
-
console.log('[Server] 过滤结果: 原始 %d 个,过滤后 %d 个', products.length, filteredProducts.length);
|
|
2098
2065
|
this.logInfo('filterProductsByMenuConfig: 过滤完成', {
|
|
2099
2066
|
originalCount: products.length,
|
|
2100
2067
|
filteredCount: filteredProducts.length,
|