@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.
- package/dist/modules/BookingContext/index.d.ts +37 -0
- package/dist/modules/BookingContext/index.js +436 -0
- package/dist/modules/BookingContext/types.d.ts +102 -0
- package/dist/modules/BookingContext/types.js +51 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +193 -0
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +137 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +75 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +215 -0
- package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/dist/modules/BookingContext/utils/flexible.js +56 -0
- package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/dist/modules/BookingContext/utils/formatResourceList.js +38 -0
- package/dist/modules/BookingContext/utils/index.d.ts +11 -0
- package/dist/modules/BookingContext/utils/index.js +11 -0
- package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/dist/modules/BookingContext/utils/noResource.js +77 -0
- package/dist/modules/BookingContext/utils/productExtend.d.ts +72 -0
- package/dist/modules/BookingContext/utils/productExtend.js +339 -0
- package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
- package/dist/modules/BookingContext/utils/resourceErrors.js +74 -0
- package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
- package/dist/modules/BookingContext/utils/resourceSelection.js +24 -0
- package/dist/modules/BookingContext/utils/resources.d.ts +80 -0
- package/dist/modules/BookingContext/utils/resources.js +486 -0
- package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/dist/modules/BookingContext/utils/serviceTimes.js +151 -0
- package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/dist/modules/BookingContext/utils/timeSlices.js +100 -0
- package/dist/modules/Customer/index.d.ts +6 -0
- package/dist/modules/Customer/index.js +129 -83
- package/dist/modules/Customer/types.d.ts +2 -0
- package/dist/modules/Discount/index.d.ts +2 -4
- package/dist/modules/Discount/index.js +8 -93
- package/dist/modules/Discount/types.d.ts +1 -7
- package/dist/modules/Order/index.d.ts +84 -17
- package/dist/modules/Order/index.js +1239 -495
- package/dist/modules/Order/types.d.ts +198 -18
- package/dist/modules/Order/types.js +31 -0
- package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
- package/dist/modules/Order/utils/manualProductDiscount.js +212 -0
- package/dist/modules/Order/utils.d.ts +50 -1
- package/dist/modules/Order/utils.js +261 -31
- package/dist/modules/Quotation/index.d.ts +0 -1
- package/dist/modules/Quotation/index.js +23 -21
- package/dist/modules/Rules/index.d.ts +4 -0
- package/dist/modules/Rules/index.js +26 -10
- package/dist/modules/SalesSummary/index.js +4 -2
- package/dist/modules/SalesSummary/utils.js +3 -3
- package/dist/modules/Schedule/index.js +6 -2
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +2 -1
- package/dist/server/index.js +87 -29
- package/dist/server/modules/order/utils/filterOrders.js +20 -6
- package/dist/server/modules/products/index.d.ts +1 -1
- package/dist/server/modules/products/index.js +130 -113
- package/dist/server/modules/schedule/index.js +13 -6
- package/dist/solution/BaseSales/index.d.ts +89 -7
- package/dist/solution/BaseSales/index.js +1484 -365
- package/dist/solution/BaseSales/types.d.ts +67 -1
- package/dist/solution/BaseSales/types.js +3 -1
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +275 -0
- package/dist/solution/BaseSales/utils/cartPromotion.js +1258 -0
- package/dist/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
- package/dist/solution/BaseSales/utils/quotationPrice.js +237 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +68 -16
- package/dist/solution/BaseSales/utils.js +46 -8
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +133 -1
- package/dist/solution/BookingTicket/index.js +780 -175
- package/dist/solution/BookingTicket/types.d.ts +2 -0
- package/dist/solution/BookingTicket/types.js +3 -0
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +113 -0
- package/dist/solution/BookingTicket/utils/addProductDecision.js +346 -0
- package/dist/solution/BookingTicket/utils/cartView.js +4 -2
- package/dist/solution/ScanOrder/index.d.ts +9 -3
- package/dist/solution/ScanOrder/index.js +231 -128
- package/dist/solution/ScanOrder/utils.js +46 -8
- package/dist/solution/ShopDiscount/index.d.ts +0 -1
- package/dist/solution/ShopDiscount/index.js +18 -23
- package/dist/solution/VenueBooking/index.d.ts +5 -9
- package/dist/solution/VenueBooking/index.js +103 -55
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +10 -0
- package/lib/model/strategy/adapter/promotion/index.js +0 -49
- package/lib/modules/BookingContext/index.d.ts +37 -0
- package/lib/modules/BookingContext/index.js +297 -0
- package/lib/modules/BookingContext/types.d.ts +102 -0
- package/lib/modules/BookingContext/types.js +34 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +207 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +141 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +75 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +198 -0
- package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/lib/modules/BookingContext/utils/flexible.js +80 -0
- package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/lib/modules/BookingContext/utils/formatResourceList.js +50 -0
- package/lib/modules/BookingContext/utils/index.d.ts +11 -0
- package/lib/modules/BookingContext/utils/index.js +43 -0
- package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/lib/modules/BookingContext/utils/noResource.js +90 -0
- package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
- package/lib/modules/BookingContext/utils/productExtend.js +283 -0
- package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
- package/lib/modules/BookingContext/utils/resourceErrors.js +80 -0
- package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
- package/lib/modules/BookingContext/utils/resourceSelection.js +46 -0
- package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
- package/lib/modules/BookingContext/utils/resources.js +377 -0
- package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/lib/modules/BookingContext/utils/serviceTimes.js +162 -0
- package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/lib/modules/BookingContext/utils/timeSlices.js +124 -0
- package/lib/modules/Customer/index.d.ts +6 -0
- package/lib/modules/Customer/index.js +26 -11
- package/lib/modules/Customer/types.d.ts +2 -0
- package/lib/modules/Discount/index.d.ts +2 -4
- package/lib/modules/Discount/index.js +8 -63
- package/lib/modules/Discount/types.d.ts +1 -7
- package/lib/modules/Order/index.d.ts +84 -17
- package/lib/modules/Order/index.js +588 -145
- package/lib/modules/Order/types.d.ts +198 -18
- package/lib/modules/Order/types.js +1 -0
- package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
- package/lib/modules/Order/utils/manualProductDiscount.js +207 -0
- package/lib/modules/Order/utils.d.ts +50 -1
- package/lib/modules/Order/utils.js +229 -21
- package/lib/modules/Quotation/index.d.ts +0 -1
- package/lib/modules/Quotation/index.js +18 -15
- package/lib/modules/Rules/index.d.ts +4 -0
- package/lib/modules/Rules/index.js +22 -14
- package/lib/modules/SalesSummary/index.js +4 -2
- package/lib/modules/SalesSummary/utils.js +3 -3
- package/lib/modules/Schedule/index.js +3 -1
- package/lib/modules/index.d.ts +1 -0
- package/lib/modules/index.js +3 -1
- package/lib/server/index.js +41 -4
- package/lib/server/modules/order/utils/filterOrders.js +12 -4
- package/lib/server/modules/products/index.d.ts +1 -1
- package/lib/server/modules/products/index.js +30 -20
- package/lib/server/modules/schedule/index.js +2 -1
- package/lib/solution/BaseSales/index.d.ts +89 -7
- package/lib/solution/BaseSales/index.js +736 -22
- package/lib/solution/BaseSales/types.d.ts +67 -1
- package/lib/solution/BaseSales/types.js +3 -1
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +275 -0
- package/lib/solution/BaseSales/utils/cartPromotion.js +836 -0
- package/lib/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
- package/lib/solution/BaseSales/utils/quotationPrice.js +277 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +71 -12
- package/lib/solution/BaseSales/utils.js +46 -6
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +133 -1
- package/lib/solution/BookingTicket/index.js +352 -8
- package/lib/solution/BookingTicket/types.d.ts +2 -0
- package/lib/solution/BookingTicket/types.js +6 -0
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +113 -0
- package/lib/solution/BookingTicket/utils/addProductDecision.js +318 -0
- package/lib/solution/BookingTicket/utils/cartView.js +4 -2
- package/lib/solution/ScanOrder/index.d.ts +9 -3
- package/lib/solution/ScanOrder/index.js +147 -66
- package/lib/solution/ScanOrder/utils.js +46 -6
- package/lib/solution/ShopDiscount/index.d.ts +0 -1
- package/lib/solution/ShopDiscount/index.js +2 -4
- package/lib/solution/VenueBooking/index.d.ts +5 -9
- package/lib/solution/VenueBooking/index.js +50 -14
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +10 -0
- 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
|
|
462
|
-
var totalAmount = isPriceIncludeTax === 1 ?
|
|
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(
|
|
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
|
-
|
|
209
|
-
return
|
|
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",
|
package/dist/modules/index.d.ts
CHANGED
package/dist/modules/index.js
CHANGED
package/dist/server/index.js
CHANGED
|
@@ -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
|
|
1622
|
+
case 12:
|
|
1616
1623
|
this.logInfo('Products 报价单价格桥接初始化完成');
|
|
1617
|
-
_context18.next =
|
|
1624
|
+
_context18.next = 19;
|
|
1618
1625
|
break;
|
|
1619
|
-
case
|
|
1620
|
-
_context18.prev =
|
|
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
|
|
1633
|
+
case 19:
|
|
1627
1634
|
case "end":
|
|
1628
1635
|
return _context18.stop();
|
|
1629
1636
|
}
|
|
1630
|
-
}, _callee18, this, [[6,
|
|
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,
|
|
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 =
|
|
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
|
|
3333
|
-
if (!(
|
|
3345
|
+
case 7:
|
|
3346
|
+
if (!(queryIds.length > 0)) {
|
|
3334
3347
|
_context29.next = 18;
|
|
3335
3348
|
break;
|
|
3336
3349
|
}
|
|
3337
|
-
|
|
3350
|
+
uniqueIds = Array.from(new Set(queryIds));
|
|
3338
3351
|
_tPrice = performance.now();
|
|
3339
|
-
_context29.next =
|
|
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
|
|
3403
|
+
case 23:
|
|
3346
3404
|
allProductsWithPrice = _context29.sent;
|
|
3347
|
-
perfMark('computeQuery.getProductsWithPrice(single)', performance.now() -
|
|
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
|
|
3430
|
+
case 30:
|
|
3373
3431
|
if (this.menu) {
|
|
3374
|
-
_context29.next =
|
|
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
|
|
3443
|
+
case 33:
|
|
3386
3444
|
if (this.schedule) {
|
|
3387
|
-
_context29.next =
|
|
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
|
|
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 =
|
|
3480
|
+
_context29.next = 49;
|
|
3423
3481
|
break;
|
|
3424
3482
|
}
|
|
3425
|
-
_context29.next =
|
|
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
|
|
3492
|
+
case 46:
|
|
3435
3493
|
_context29.t0 = _context29.sent;
|
|
3436
|
-
_context29.next =
|
|
3494
|
+
_context29.next = 50;
|
|
3437
3495
|
break;
|
|
3438
|
-
case
|
|
3496
|
+
case 49:
|
|
3439
3497
|
_context29.t0 = [];
|
|
3440
|
-
case
|
|
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
|
|
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
|
-
|
|
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.
|
|
151
|
+
actual: order.payments,
|
|
138
152
|
expected: safeFilters.payment_methods
|
|
139
153
|
}
|
|
140
154
|
});
|
|
141
155
|
return false;
|
|
142
156
|
}
|
|
143
|
-
var hasMatch =
|
|
144
|
-
return safeFilters.payment_methods.includes(
|
|
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:
|
|
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
|
|
24
|
+
private quotationBridgeLoadedKey?;
|
|
25
25
|
private quotationBridgeRefreshPromise?;
|
|
26
26
|
private quotationBridgeRefreshKey?;
|
|
27
27
|
private productDataSource;
|