@pisell/pisellos 2.2.175 → 2.2.176

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.
Files changed (172) hide show
  1. package/dist/modules/BookingContext/index.d.ts +37 -0
  2. package/dist/modules/BookingContext/index.js +436 -0
  3. package/dist/modules/BookingContext/types.d.ts +102 -0
  4. package/dist/modules/BookingContext/types.js +51 -0
  5. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  6. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +193 -0
  7. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  8. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +137 -0
  9. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +75 -0
  10. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +215 -0
  11. package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
  12. package/dist/modules/BookingContext/utils/flexible.js +56 -0
  13. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  14. package/dist/modules/BookingContext/utils/formatResourceList.js +38 -0
  15. package/dist/modules/BookingContext/utils/index.d.ts +11 -0
  16. package/dist/modules/BookingContext/utils/index.js +11 -0
  17. package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
  18. package/dist/modules/BookingContext/utils/noResource.js +77 -0
  19. package/dist/modules/BookingContext/utils/productExtend.d.ts +72 -0
  20. package/dist/modules/BookingContext/utils/productExtend.js +339 -0
  21. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  22. package/dist/modules/BookingContext/utils/resourceErrors.js +74 -0
  23. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  24. package/dist/modules/BookingContext/utils/resourceSelection.js +24 -0
  25. package/dist/modules/BookingContext/utils/resources.d.ts +80 -0
  26. package/dist/modules/BookingContext/utils/resources.js +486 -0
  27. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  28. package/dist/modules/BookingContext/utils/serviceTimes.js +151 -0
  29. package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  30. package/dist/modules/BookingContext/utils/timeSlices.js +100 -0
  31. package/dist/modules/Customer/index.d.ts +6 -0
  32. package/dist/modules/Customer/index.js +129 -83
  33. package/dist/modules/Customer/types.d.ts +2 -0
  34. package/dist/modules/Discount/index.d.ts +2 -4
  35. package/dist/modules/Discount/index.js +8 -93
  36. package/dist/modules/Discount/types.d.ts +1 -7
  37. package/dist/modules/Order/index.d.ts +84 -17
  38. package/dist/modules/Order/index.js +1239 -495
  39. package/dist/modules/Order/types.d.ts +198 -18
  40. package/dist/modules/Order/types.js +31 -0
  41. package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  42. package/dist/modules/Order/utils/manualProductDiscount.js +212 -0
  43. package/dist/modules/Order/utils.d.ts +50 -1
  44. package/dist/modules/Order/utils.js +261 -31
  45. package/dist/modules/Quotation/index.d.ts +0 -1
  46. package/dist/modules/Quotation/index.js +23 -21
  47. package/dist/modules/Rules/index.d.ts +4 -0
  48. package/dist/modules/Rules/index.js +26 -10
  49. package/dist/modules/SalesSummary/index.js +4 -2
  50. package/dist/modules/SalesSummary/utils.js +3 -3
  51. package/dist/modules/Schedule/index.js +6 -2
  52. package/dist/modules/index.d.ts +1 -0
  53. package/dist/modules/index.js +2 -1
  54. package/dist/server/index.js +87 -29
  55. package/dist/server/modules/order/utils/filterOrders.js +20 -6
  56. package/dist/server/modules/products/index.d.ts +1 -1
  57. package/dist/server/modules/products/index.js +130 -113
  58. package/dist/server/modules/schedule/index.js +13 -6
  59. package/dist/solution/BaseSales/index.d.ts +89 -7
  60. package/dist/solution/BaseSales/index.js +1484 -365
  61. package/dist/solution/BaseSales/types.d.ts +67 -1
  62. package/dist/solution/BaseSales/types.js +3 -1
  63. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +275 -0
  64. package/dist/solution/BaseSales/utils/cartPromotion.js +1258 -0
  65. package/dist/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
  66. package/dist/solution/BaseSales/utils/quotationPrice.js +237 -0
  67. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +68 -16
  68. package/dist/solution/BaseSales/utils.js +46 -8
  69. package/dist/solution/BookingByStep/index.d.ts +1 -1
  70. package/dist/solution/BookingTicket/index.d.ts +133 -1
  71. package/dist/solution/BookingTicket/index.js +780 -175
  72. package/dist/solution/BookingTicket/types.d.ts +2 -0
  73. package/dist/solution/BookingTicket/types.js +3 -0
  74. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +113 -0
  75. package/dist/solution/BookingTicket/utils/addProductDecision.js +346 -0
  76. package/dist/solution/BookingTicket/utils/cartView.js +4 -2
  77. package/dist/solution/ScanOrder/index.d.ts +9 -3
  78. package/dist/solution/ScanOrder/index.js +231 -128
  79. package/dist/solution/ScanOrder/utils.js +46 -8
  80. package/dist/solution/ShopDiscount/index.d.ts +0 -1
  81. package/dist/solution/ShopDiscount/index.js +18 -23
  82. package/dist/solution/VenueBooking/index.d.ts +5 -9
  83. package/dist/solution/VenueBooking/index.js +103 -55
  84. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
  85. package/dist/solution/VenueBooking/utils/slotMerge.js +10 -0
  86. package/lib/model/strategy/adapter/promotion/index.js +0 -49
  87. package/lib/modules/BookingContext/index.d.ts +37 -0
  88. package/lib/modules/BookingContext/index.js +297 -0
  89. package/lib/modules/BookingContext/types.d.ts +102 -0
  90. package/lib/modules/BookingContext/types.js +34 -0
  91. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
  92. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +207 -0
  93. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
  94. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +141 -0
  95. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +75 -0
  96. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +198 -0
  97. package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
  98. package/lib/modules/BookingContext/utils/flexible.js +80 -0
  99. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  100. package/lib/modules/BookingContext/utils/formatResourceList.js +50 -0
  101. package/lib/modules/BookingContext/utils/index.d.ts +11 -0
  102. package/lib/modules/BookingContext/utils/index.js +43 -0
  103. package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
  104. package/lib/modules/BookingContext/utils/noResource.js +90 -0
  105. package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
  106. package/lib/modules/BookingContext/utils/productExtend.js +283 -0
  107. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  108. package/lib/modules/BookingContext/utils/resourceErrors.js +80 -0
  109. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  110. package/lib/modules/BookingContext/utils/resourceSelection.js +46 -0
  111. package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
  112. package/lib/modules/BookingContext/utils/resources.js +377 -0
  113. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  114. package/lib/modules/BookingContext/utils/serviceTimes.js +162 -0
  115. package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  116. package/lib/modules/BookingContext/utils/timeSlices.js +124 -0
  117. package/lib/modules/Customer/index.d.ts +6 -0
  118. package/lib/modules/Customer/index.js +26 -11
  119. package/lib/modules/Customer/types.d.ts +2 -0
  120. package/lib/modules/Discount/index.d.ts +2 -4
  121. package/lib/modules/Discount/index.js +8 -63
  122. package/lib/modules/Discount/types.d.ts +1 -7
  123. package/lib/modules/Order/index.d.ts +84 -17
  124. package/lib/modules/Order/index.js +588 -145
  125. package/lib/modules/Order/types.d.ts +198 -18
  126. package/lib/modules/Order/types.js +1 -0
  127. package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  128. package/lib/modules/Order/utils/manualProductDiscount.js +207 -0
  129. package/lib/modules/Order/utils.d.ts +50 -1
  130. package/lib/modules/Order/utils.js +229 -21
  131. package/lib/modules/Quotation/index.d.ts +0 -1
  132. package/lib/modules/Quotation/index.js +18 -15
  133. package/lib/modules/Rules/index.d.ts +4 -0
  134. package/lib/modules/Rules/index.js +22 -14
  135. package/lib/modules/SalesSummary/index.js +4 -2
  136. package/lib/modules/SalesSummary/utils.js +3 -3
  137. package/lib/modules/Schedule/index.js +3 -1
  138. package/lib/modules/index.d.ts +1 -0
  139. package/lib/modules/index.js +3 -1
  140. package/lib/server/index.js +41 -4
  141. package/lib/server/modules/order/utils/filterOrders.js +12 -4
  142. package/lib/server/modules/products/index.d.ts +1 -1
  143. package/lib/server/modules/products/index.js +30 -20
  144. package/lib/server/modules/schedule/index.js +2 -1
  145. package/lib/solution/BaseSales/index.d.ts +89 -7
  146. package/lib/solution/BaseSales/index.js +736 -22
  147. package/lib/solution/BaseSales/types.d.ts +67 -1
  148. package/lib/solution/BaseSales/types.js +3 -1
  149. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +275 -0
  150. package/lib/solution/BaseSales/utils/cartPromotion.js +836 -0
  151. package/lib/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
  152. package/lib/solution/BaseSales/utils/quotationPrice.js +277 -0
  153. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +71 -12
  154. package/lib/solution/BaseSales/utils.js +46 -6
  155. package/lib/solution/BookingByStep/index.d.ts +1 -1
  156. package/lib/solution/BookingTicket/index.d.ts +133 -1
  157. package/lib/solution/BookingTicket/index.js +352 -8
  158. package/lib/solution/BookingTicket/types.d.ts +2 -0
  159. package/lib/solution/BookingTicket/types.js +6 -0
  160. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +113 -0
  161. package/lib/solution/BookingTicket/utils/addProductDecision.js +318 -0
  162. package/lib/solution/BookingTicket/utils/cartView.js +4 -2
  163. package/lib/solution/ScanOrder/index.d.ts +9 -3
  164. package/lib/solution/ScanOrder/index.js +147 -66
  165. package/lib/solution/ScanOrder/utils.js +46 -6
  166. package/lib/solution/ShopDiscount/index.d.ts +0 -1
  167. package/lib/solution/ShopDiscount/index.js +2 -4
  168. package/lib/solution/VenueBooking/index.d.ts +5 -9
  169. package/lib/solution/VenueBooking/index.js +50 -14
  170. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
  171. package/lib/solution/VenueBooking/utils/slotMerge.js +10 -0
  172. package/package.json +2 -2
@@ -458,8 +458,8 @@ export function calculateSalesSummary(params) {
458
458
  }, new Decimal(0));
459
459
  }
460
460
  var shopDiscountAmount = Decimal.max(new Decimal(Number(shopDiscount) || 0), 0);
461
- var expectAmount = Decimal.max(0, productAmount.plus(surchargeAmount).minus(shopDiscountAmount));
462
- var totalAmount = isPriceIncludeTax === 1 ? expectAmount : expectAmount.plus(productTaxFee);
461
+ var preTaxExpectAmount = Decimal.max(0, productAmount.plus(surchargeAmount).minus(shopDiscountAmount));
462
+ var totalAmount = isPriceIncludeTax === 1 ? preTaxExpectAmount : preTaxExpectAmount.plus(productTaxFee);
463
463
  var deposit = calculateProductsDeposit(products);
464
464
  return {
465
465
  product_quantity: productQuantity,
@@ -475,7 +475,7 @@ export function calculateSalesSummary(params) {
475
475
  discount_amount: toFixed2(Decimal.max(productOriginalAmount.minus(productAmount), 0).plus(shopDiscountAmount)),
476
476
  deposit_amount: deposit ? deposit.total : '0.00',
477
477
  deposit: deposit,
478
- expect_amount: toFixed2(expectAmount),
478
+ expect_amount: toFixed2(totalAmount),
479
479
  total_amount: toFixed2(totalAmount),
480
480
  total_refund_amount: '0.00',
481
481
  customer_paid_amount: '0.00',
@@ -205,9 +205,13 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
205
205
  }, {
206
206
  key: "getScheduleListByIds",
207
207
  value: function getScheduleListByIds(ids) {
208
- return this.store.scheduleList.filter(function (n) {
209
- return ids.includes(n.id);
208
+ var idSet = new Set(ids.map(function (id) {
209
+ return String(id);
210
+ }));
211
+ var list = this.store.scheduleList.filter(function (n) {
212
+ return idSet.has(String(n.id));
210
213
  });
214
+ return list;
211
215
  }
212
216
  }, {
213
217
  key: "setAvailabilityScheduleDateList",
@@ -16,3 +16,4 @@ export * from './Schedule';
16
16
  export * from './Quotation';
17
17
  export * from './ScanOrderLogger';
18
18
  export * from './OpenData';
19
+ export * from './BookingContext';
@@ -15,4 +15,5 @@ export * from "./SalesSummary";
15
15
  export * from "./Schedule";
16
16
  export * from "./Quotation";
17
17
  export * from "./ScanOrderLogger";
18
- export * from "./OpenData";
18
+ export * from "./OpenData";
19
+ export * from "./BookingContext";
@@ -168,16 +168,17 @@ var Server = /*#__PURE__*/function () {
168
168
  */
169
169
  _defineProperty(this, "handleProductQuery", /*#__PURE__*/function () {
170
170
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
171
- var url, method, data, config, menu_list_ids, schedule_datetime, schedule_date, customer_id, _ref3, callback, subscriberId;
171
+ var url, method, data, config, menu_list_ids, schedule_datetime, schedule_date, customer_id, ids, _ref3, callback, subscriberId;
172
172
  return _regeneratorRuntime().wrap(function _callee$(_context) {
173
173
  while (1) switch (_context.prev = _context.next) {
174
174
  case 0:
175
175
  url = _ref.url, method = _ref.method, data = _ref.data, config = _ref.config;
176
176
  console.log('[Server] handleProductQuery:', url, method, data, config);
177
- menu_list_ids = data.menu_list_ids, schedule_datetime = data.schedule_datetime, schedule_date = data.schedule_date, customer_id = data.customer_id;
177
+ menu_list_ids = data.menu_list_ids, schedule_datetime = data.schedule_datetime, schedule_date = data.schedule_date, customer_id = data.customer_id, ids = data.ids;
178
178
  _ref3 = config || {}, callback = _ref3.callback, subscriberId = _ref3.subscriberId;
179
179
  _this.logInfo('handleProductQuery: 开始处理商品查询请求', {
180
180
  menu_list_ids: menu_list_ids,
181
+ ids: ids,
181
182
  schedule_datetime: schedule_datetime,
182
183
  schedule_date: schedule_date,
183
184
  customer_id: customer_id
@@ -189,6 +190,7 @@ var Server = /*#__PURE__*/function () {
189
190
  callback: callback,
190
191
  context: {
191
192
  menu_list_ids: menu_list_ids,
193
+ ids: ids,
192
194
  schedule_date: schedule_date,
193
195
  schedule_datetime: schedule_datetime,
194
196
  customer_id: customer_id
@@ -201,6 +203,7 @@ var Server = /*#__PURE__*/function () {
201
203
  }
202
204
  return _context.abrupt("return", _this.computeProductQueryResult({
203
205
  menu_list_ids: menu_list_ids,
206
+ ids: ids,
204
207
  schedule_date: schedule_date,
205
208
  schedule_datetime: schedule_datetime,
206
209
  customer_id: customer_id
@@ -1608,26 +1611,30 @@ var Server = /*#__PURE__*/function () {
1608
1611
  case 6:
1609
1612
  _context18.prev = 6;
1610
1613
  _context18.next = 9;
1614
+ return this.schedule.loadAllSchedule();
1615
+ case 9:
1616
+ this.products.clearPriceCache();
1617
+ _context18.next = 12;
1611
1618
  return this.products.setupQuotationPriceBridge({
1612
1619
  scheduleModule: this.schedule,
1613
1620
  channel: (_this$core$context = this.core.context) === null || _this$core$context === void 0 ? void 0 : _this$core$context.channel
1614
1621
  });
1615
- case 9:
1622
+ case 12:
1616
1623
  this.logInfo('Products 报价单价格桥接初始化完成');
1617
- _context18.next = 16;
1624
+ _context18.next = 19;
1618
1625
  break;
1619
- case 12:
1620
- _context18.prev = 12;
1626
+ case 15:
1627
+ _context18.prev = 15;
1621
1628
  _context18.t0 = _context18["catch"](6);
1622
1629
  errorMessage = _context18.t0 instanceof Error ? _context18.t0.message : String(_context18.t0);
1623
1630
  this.logError('Products 报价单价格桥接初始化失败', {
1624
1631
  error: errorMessage
1625
1632
  });
1626
- case 16:
1633
+ case 19:
1627
1634
  case "end":
1628
1635
  return _context18.stop();
1629
1636
  }
1630
- }, _callee18, this, [[6, 12]]);
1637
+ }, _callee18, this, [[6, 15]]);
1631
1638
  }));
1632
1639
  function setupProductsQuotationPriceBridge() {
1633
1640
  return _setupProductsQuotationPriceBridge.apply(this, arguments);
@@ -3303,14 +3310,20 @@ var Server = /*#__PURE__*/function () {
3303
3310
  var _computeProductQueryResult = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(context, options) {
3304
3311
  var _menu_list_ids$length3,
3305
3312
  _this6 = this;
3306
- var tTotal, menu_list_ids, schedule_date, schedule_datetime, customer_id, product_id, _published$find, pid, _tPrice, allProductsWithPrice, published, item, activeMenuList, tMenu, menuList, tFilter, productScope, scopedProductIds, tPrice, filteredProducts, tStatus, beforeStatusCount, tSort;
3313
+ var tTotal, menu_list_ids, ids, schedule_date, schedule_datetime, customer_id, product_id, queryIds, uniqueIds, _tPrice, productsWithPrice, _filteredProducts, _published$find, pid, _tPrice2, allProductsWithPrice, published, item, activeMenuList, tMenu, menuList, tFilter, productScope, scopedProductIds, tPrice, filteredProducts, tStatus, beforeStatusCount, tSort;
3307
3314
  return _regeneratorRuntime().wrap(function _callee29$(_context29) {
3308
3315
  while (1) switch (_context29.prev = _context29.next) {
3309
3316
  case 0:
3310
3317
  tTotal = performance.now();
3311
- menu_list_ids = context.menu_list_ids, schedule_date = context.schedule_date, schedule_datetime = context.schedule_datetime, customer_id = context.customer_id, product_id = context.product_id;
3318
+ menu_list_ids = context.menu_list_ids, ids = context.ids, schedule_date = context.schedule_date, schedule_datetime = context.schedule_datetime, customer_id = context.customer_id, product_id = context.product_id;
3319
+ queryIds = Array.isArray(ids) ? ids.map(function (id) {
3320
+ return Number(id);
3321
+ }).filter(function (id) {
3322
+ return Number.isFinite(id);
3323
+ }) : [];
3312
3324
  this.logInfo('computeProductQueryResult 开始', {
3313
3325
  menuListIdsCount: (_menu_list_ids$length3 = menu_list_ids === null || menu_list_ids === void 0 ? void 0 : menu_list_ids.length) !== null && _menu_list_ids$length3 !== void 0 ? _menu_list_ids$length3 : 0,
3326
+ ids: queryIds,
3314
3327
  schedule_datetime: schedule_datetime,
3315
3328
  schedule_date: schedule_date,
3316
3329
  customer_id: customer_id,
@@ -3318,7 +3331,7 @@ var Server = /*#__PURE__*/function () {
3318
3331
  changedIds: options === null || options === void 0 ? void 0 : options.changedIds
3319
3332
  });
3320
3333
  if (this.products) {
3321
- _context29.next = 6;
3334
+ _context29.next = 7;
3322
3335
  break;
3323
3336
  }
3324
3337
  this.logError('computeProductQueryResult: Products 模块未注册');
@@ -3329,22 +3342,67 @@ var Server = /*#__PURE__*/function () {
3329
3342
  count: 0
3330
3343
  }
3331
3344
  });
3332
- case 6:
3333
- if (!(product_id != null && Number.isFinite(Number(product_id)))) {
3345
+ case 7:
3346
+ if (!(queryIds.length > 0)) {
3334
3347
  _context29.next = 18;
3335
3348
  break;
3336
3349
  }
3337
- pid = Number(product_id);
3350
+ uniqueIds = Array.from(new Set(queryIds));
3338
3351
  _tPrice = performance.now();
3339
- _context29.next = 11;
3352
+ _context29.next = 12;
3353
+ return this.products.getProductsWithPrice(schedule_date, {
3354
+ scheduleModule: this.getSchedule(),
3355
+ schedule_datetime: schedule_datetime,
3356
+ customer_id: customer_id
3357
+ }, {
3358
+ changedIds: options === null || options === void 0 ? void 0 : options.changedIds,
3359
+ productIds: uniqueIds
3360
+ });
3361
+ case 12:
3362
+ productsWithPrice = _context29.sent;
3363
+ perfMark('computeQuery.getProductsWithPrice(ids)', performance.now() - _tPrice, {
3364
+ count: productsWithPrice.length,
3365
+ ids: uniqueIds
3366
+ });
3367
+ _filteredProducts = productsWithPrice.filter(function (p) {
3368
+ return uniqueIds.includes(Number(p === null || p === void 0 ? void 0 : p.id));
3369
+ }).filter(function (p) {
3370
+ return ((p === null || p === void 0 ? void 0 : p.status) || 'published') === 'published';
3371
+ });
3372
+ perfMark('computeProductQueryResult', performance.now() - tTotal, {
3373
+ mode: 'ids',
3374
+ ids: uniqueIds,
3375
+ count: _filteredProducts.length
3376
+ });
3377
+ this.logInfo('computeProductQueryResult 完成(ids)', {
3378
+ ids: uniqueIds,
3379
+ count: _filteredProducts.length
3380
+ });
3381
+ return _context29.abrupt("return", {
3382
+ code: 200,
3383
+ data: {
3384
+ list: _filteredProducts,
3385
+ count: _filteredProducts.length
3386
+ },
3387
+ message: '',
3388
+ status: true
3389
+ });
3390
+ case 18:
3391
+ if (!(product_id != null && Number.isFinite(Number(product_id)))) {
3392
+ _context29.next = 30;
3393
+ break;
3394
+ }
3395
+ pid = Number(product_id);
3396
+ _tPrice2 = performance.now();
3397
+ _context29.next = 23;
3340
3398
  return this.products.getProductsWithPrice(schedule_date, {
3341
3399
  scheduleModule: this.getSchedule()
3342
3400
  }, {
3343
3401
  changedIds: options === null || options === void 0 ? void 0 : options.changedIds
3344
3402
  });
3345
- case 11:
3403
+ case 23:
3346
3404
  allProductsWithPrice = _context29.sent;
3347
- perfMark('computeQuery.getProductsWithPrice(single)', performance.now() - _tPrice, {
3405
+ perfMark('computeQuery.getProductsWithPrice(single)', performance.now() - _tPrice2, {
3348
3406
  count: allProductsWithPrice.length,
3349
3407
  productId: pid
3350
3408
  });
@@ -3369,9 +3427,9 @@ var Server = /*#__PURE__*/function () {
3369
3427
  message: item ? '' : '商品不存在或未发布',
3370
3428
  status: true
3371
3429
  });
3372
- case 18:
3430
+ case 30:
3373
3431
  if (this.menu) {
3374
- _context29.next = 21;
3432
+ _context29.next = 33;
3375
3433
  break;
3376
3434
  }
3377
3435
  this.logError('computeProductQueryResult: Menu 模块未注册');
@@ -3382,9 +3440,9 @@ var Server = /*#__PURE__*/function () {
3382
3440
  count: 0
3383
3441
  }
3384
3442
  });
3385
- case 21:
3443
+ case 33:
3386
3444
  if (this.schedule) {
3387
- _context29.next = 24;
3445
+ _context29.next = 36;
3388
3446
  break;
3389
3447
  }
3390
3448
  this.logError('computeProductQueryResult: Schedule 模块未注册');
@@ -3395,7 +3453,7 @@ var Server = /*#__PURE__*/function () {
3395
3453
  count: 0
3396
3454
  }
3397
3455
  });
3398
- case 24:
3456
+ case 36:
3399
3457
  activeMenuList = [];
3400
3458
  if (menu_list_ids && Array.isArray(menu_list_ids) && menu_list_ids.length > 0) {
3401
3459
  tMenu = performance.now();
@@ -3419,10 +3477,10 @@ var Server = /*#__PURE__*/function () {
3419
3477
  });
3420
3478
  tPrice = performance.now();
3421
3479
  if (!(scopedProductIds.length > 0)) {
3422
- _context29.next = 37;
3480
+ _context29.next = 49;
3423
3481
  break;
3424
3482
  }
3425
- _context29.next = 34;
3483
+ _context29.next = 46;
3426
3484
  return this.products.getProductsWithPrice(schedule_date, {
3427
3485
  scheduleModule: this.getSchedule(),
3428
3486
  schedule_datetime: schedule_datetime,
@@ -3431,13 +3489,13 @@ var Server = /*#__PURE__*/function () {
3431
3489
  changedIds: options === null || options === void 0 ? void 0 : options.changedIds,
3432
3490
  productIds: productScope.isAllProducts ? undefined : scopedProductIds
3433
3491
  });
3434
- case 34:
3492
+ case 46:
3435
3493
  _context29.t0 = _context29.sent;
3436
- _context29.next = 38;
3494
+ _context29.next = 50;
3437
3495
  break;
3438
- case 37:
3496
+ case 49:
3439
3497
  _context29.t0 = [];
3440
- case 38:
3498
+ case 50:
3441
3499
  filteredProducts = _context29.t0;
3442
3500
  perfMark('computeQuery.getProductsWithPrice', performance.now() - tPrice, {
3443
3501
  count: filteredProducts.length,
@@ -3480,7 +3538,7 @@ var Server = /*#__PURE__*/function () {
3480
3538
  message: '',
3481
3539
  status: true
3482
3540
  });
3483
- case 50:
3541
+ case 62:
3484
3542
  case "end":
3485
3543
  return _context29.stop();
3486
3544
  }
@@ -1,4 +1,17 @@
1
1
  import dayjs from 'dayjs';
2
+ /** 从订单 payments 提取支付方式 code,与 UI 筛选选项及 filterBookings 一致 */
3
+ function getOrderPaymentCodes(order) {
4
+ var payments = order.payments;
5
+ if (!Array.isArray(payments) || payments.length === 0) {
6
+ return [];
7
+ }
8
+ return payments.map(function (item) {
9
+ return item === null || item === void 0 ? void 0 : item.code;
10
+ }).filter(function (code) {
11
+ return typeof code === 'string' && code.length > 0;
12
+ });
13
+ }
14
+
2
15
  /**
3
16
  * 订单过滤函数
4
17
  * @param orders 原始订单列表
@@ -126,22 +139,23 @@ export function filterOrders(orders, filters) {
126
139
  }
127
140
  }
128
141
 
129
- // payment_methods - 支付方式
142
+ // payment_methods - 支付方式(按 payments[].code 匹配,不再使用 order.payment_methods)
130
143
  if (safeFilters.payment_methods && safeFilters.payment_methods.length > 0) {
131
- if (!order.payment_methods || !Array.isArray(order.payment_methods) || order.payment_methods.length === 0) {
144
+ var orderPaymentCodes = getOrderPaymentCodes(order);
145
+ if (orderPaymentCodes.length === 0) {
132
146
  rejected.push({
133
147
  order_id: order.order_id,
134
148
  order_number: order.order_number,
135
149
  reason: {
136
150
  field: 'payment_methods',
137
- actual: order.payment_methods,
151
+ actual: order.payments,
138
152
  expected: safeFilters.payment_methods
139
153
  }
140
154
  });
141
155
  return false;
142
156
  }
143
- var hasMatch = order.payment_methods.some(function (pm) {
144
- return safeFilters.payment_methods.includes(pm);
157
+ var hasMatch = orderPaymentCodes.some(function (code) {
158
+ return safeFilters.payment_methods.includes(code);
145
159
  });
146
160
  if (!hasMatch) {
147
161
  rejected.push({
@@ -149,7 +163,7 @@ export function filterOrders(orders, filters) {
149
163
  order_number: order.order_number,
150
164
  reason: {
151
165
  field: 'payment_methods',
152
- actual: order.payment_methods,
166
+ actual: orderPaymentCodes,
153
167
  expected: safeFilters.payment_methods
154
168
  }
155
169
  });
@@ -21,7 +21,7 @@ export declare class ProductsModule extends BaseModule implements Module {
21
21
  private isPriceFormatterRegistered;
22
22
  private quotationPriceBridge?;
23
23
  private quotationBridgeChannel?;
24
- private quotationBridgeCustomerId?;
24
+ private quotationBridgeLoadedKey?;
25
25
  private quotationBridgeRefreshPromise?;
26
26
  private quotationBridgeRefreshKey?;
27
27
  private productDataSource;