@pisell/pisellos 2.2.130 → 2.2.131
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 +1 -0
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/server/index.js +10 -9
- package/dist/server/modules/order/types.d.ts +1 -0
- package/dist/server/modules/order/utils/filterOrders.js +6 -0
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/lib/core/index.js +1 -0
- package/lib/model/strategy/adapter/promotion/index.js +0 -49
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/server/index.js +1 -0
- package/lib/server/modules/order/types.d.ts +1 -0
- package/lib/server/modules/order/utils/filterOrders.js +5 -0
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/core/index.js
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// 导出评估器
|
|
2
|
-
export { PromotionEvaluator } from "./evaluator";
|
|
3
|
-
|
|
4
|
-
// 导出适配器
|
|
5
|
-
export { PromotionAdapter } from "./adapter";
|
|
6
|
-
export { default } from "./adapter";
|
|
7
|
-
|
|
8
|
-
// 导出策略配置示例常量
|
|
9
|
-
export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY } from "./examples";
|
|
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
|
|
|
49
49
|
getCategories(): ProductCategory[];
|
|
50
50
|
setOtherParams(key: string, value: any): void;
|
|
51
51
|
getOtherParams(): any;
|
|
52
|
-
getProductType(): "
|
|
52
|
+
getProductType(): "normal" | "duration" | "session";
|
|
53
53
|
}
|
package/dist/server/index.js
CHANGED
|
@@ -2684,6 +2684,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
2684
2684
|
case 0:
|
|
2685
2685
|
tTotal = performance.now();
|
|
2686
2686
|
menu_list_ids = context.menu_list_ids, schedule_date = context.schedule_date, schedule_datetime = context.schedule_datetime;
|
|
2687
|
+
debugger;
|
|
2687
2688
|
this.logInfo('computeProductQueryResult 开始', {
|
|
2688
2689
|
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,
|
|
2689
2690
|
schedule_datetime: schedule_datetime,
|
|
@@ -2691,7 +2692,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
2691
2692
|
changedIds: options === null || options === void 0 ? void 0 : options.changedIds
|
|
2692
2693
|
});
|
|
2693
2694
|
if (this.products) {
|
|
2694
|
-
_context24.next =
|
|
2695
|
+
_context24.next = 7;
|
|
2695
2696
|
break;
|
|
2696
2697
|
}
|
|
2697
2698
|
this.logError('computeProductQueryResult: Products 模块未注册');
|
|
@@ -2702,9 +2703,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
2702
2703
|
count: 0
|
|
2703
2704
|
}
|
|
2704
2705
|
});
|
|
2705
|
-
case
|
|
2706
|
+
case 7:
|
|
2706
2707
|
if (this.menu) {
|
|
2707
|
-
_context24.next =
|
|
2708
|
+
_context24.next = 10;
|
|
2708
2709
|
break;
|
|
2709
2710
|
}
|
|
2710
2711
|
this.logError('computeProductQueryResult: Menu 模块未注册');
|
|
@@ -2715,9 +2716,9 @@ var Server = /*#__PURE__*/function () {
|
|
|
2715
2716
|
count: 0
|
|
2716
2717
|
}
|
|
2717
2718
|
});
|
|
2718
|
-
case
|
|
2719
|
+
case 10:
|
|
2719
2720
|
if (this.schedule) {
|
|
2720
|
-
_context24.next =
|
|
2721
|
+
_context24.next = 13;
|
|
2721
2722
|
break;
|
|
2722
2723
|
}
|
|
2723
2724
|
this.logError('computeProductQueryResult: Schedule 模块未注册');
|
|
@@ -2728,7 +2729,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
2728
2729
|
count: 0
|
|
2729
2730
|
}
|
|
2730
2731
|
});
|
|
2731
|
-
case
|
|
2732
|
+
case 13:
|
|
2732
2733
|
activeMenuList = [];
|
|
2733
2734
|
if (menu_list_ids && Array.isArray(menu_list_ids) && menu_list_ids.length > 0) {
|
|
2734
2735
|
tMenu = performance.now();
|
|
@@ -2743,13 +2744,13 @@ var Server = /*#__PURE__*/function () {
|
|
|
2743
2744
|
});
|
|
2744
2745
|
}
|
|
2745
2746
|
tPrice = performance.now();
|
|
2746
|
-
_context24.next =
|
|
2747
|
+
_context24.next = 18;
|
|
2747
2748
|
return this.products.getProductsWithPrice(schedule_date, {
|
|
2748
2749
|
scheduleModule: this.getSchedule()
|
|
2749
2750
|
}, {
|
|
2750
2751
|
changedIds: options === null || options === void 0 ? void 0 : options.changedIds
|
|
2751
2752
|
});
|
|
2752
|
-
case
|
|
2753
|
+
case 18:
|
|
2753
2754
|
allProductsWithPrice = _context24.sent;
|
|
2754
2755
|
perfMark('computeQuery.getProductsWithPrice', performance.now() - tPrice, {
|
|
2755
2756
|
count: allProductsWithPrice.length
|
|
@@ -2797,7 +2798,7 @@ var Server = /*#__PURE__*/function () {
|
|
|
2797
2798
|
message: '',
|
|
2798
2799
|
status: true
|
|
2799
2800
|
});
|
|
2800
|
-
case
|
|
2801
|
+
case 33:
|
|
2801
2802
|
case "end":
|
|
2802
2803
|
return _context24.stop();
|
|
2803
2804
|
}
|
|
@@ -28,6 +28,12 @@ export function filterOrders(orders, filters) {
|
|
|
28
28
|
|
|
29
29
|
// 1. 过滤
|
|
30
30
|
var filteredList = orders.filter(function (order) {
|
|
31
|
+
if (safeFilters.keyword) {
|
|
32
|
+
if (!JSON.stringify(order).toLowerCase().includes(safeFilters.keyword.toLowerCase())) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
31
37
|
// status - 订单状态
|
|
32
38
|
if (safeFilters.status && safeFilters.status.length > 0) {
|
|
33
39
|
if (!order.status || !safeFilters.status.includes(order.status)) {
|
|
@@ -136,7 +136,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
136
136
|
* 获取当前的客户搜索条件
|
|
137
137
|
* @returns 当前搜索条件
|
|
138
138
|
*/
|
|
139
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
139
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
140
140
|
/**
|
|
141
141
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
142
142
|
* @returns 客户状态
|
package/lib/core/index.js
CHANGED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
-
|
|
29
|
-
// src/model/strategy/adapter/promotion/index.ts
|
|
30
|
-
var promotion_exports = {};
|
|
31
|
-
__export(promotion_exports, {
|
|
32
|
-
BUY_X_GET_Y_FREE_STRATEGY: () => import_examples.BUY_X_GET_Y_FREE_STRATEGY,
|
|
33
|
-
PromotionAdapter: () => import_adapter.PromotionAdapter,
|
|
34
|
-
PromotionEvaluator: () => import_evaluator.PromotionEvaluator,
|
|
35
|
-
X_ITEMS_FOR_Y_PRICE_STRATEGY: () => import_examples.X_ITEMS_FOR_Y_PRICE_STRATEGY,
|
|
36
|
-
default: () => import_adapter2.default
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(promotion_exports);
|
|
39
|
-
var import_evaluator = require("./evaluator");
|
|
40
|
-
var import_adapter = require("./adapter");
|
|
41
|
-
var import_adapter2 = __toESM(require("./adapter"));
|
|
42
|
-
var import_examples = require("./examples");
|
|
43
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
-
0 && (module.exports = {
|
|
45
|
-
BUY_X_GET_Y_FREE_STRATEGY,
|
|
46
|
-
PromotionAdapter,
|
|
47
|
-
PromotionEvaluator,
|
|
48
|
-
X_ITEMS_FOR_Y_PRICE_STRATEGY
|
|
49
|
-
});
|
|
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
|
|
|
49
49
|
getCategories(): ProductCategory[];
|
|
50
50
|
setOtherParams(key: string, value: any): void;
|
|
51
51
|
getOtherParams(): any;
|
|
52
|
-
getProductType(): "
|
|
52
|
+
getProductType(): "normal" | "duration" | "session";
|
|
53
53
|
}
|
package/lib/server/index.js
CHANGED
|
@@ -1713,6 +1713,7 @@ var Server = class {
|
|
|
1713
1713
|
async computeProductQueryResult(context, options) {
|
|
1714
1714
|
const tTotal = performance.now();
|
|
1715
1715
|
const { menu_list_ids, schedule_date, schedule_datetime } = context;
|
|
1716
|
+
debugger;
|
|
1716
1717
|
this.logInfo("computeProductQueryResult 开始", {
|
|
1717
1718
|
menuListIdsCount: (menu_list_ids == null ? void 0 : menu_list_ids.length) ?? 0,
|
|
1718
1719
|
schedule_datetime,
|
|
@@ -35,6 +35,11 @@ function filterOrders(orders, filters) {
|
|
|
35
35
|
const size = safeFilters.num || 20;
|
|
36
36
|
const page = safeFilters.skip || 1;
|
|
37
37
|
let filteredList = orders.filter((order) => {
|
|
38
|
+
if (safeFilters.keyword) {
|
|
39
|
+
if (!JSON.stringify(order).toLowerCase().includes(safeFilters.keyword.toLowerCase())) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
38
43
|
if (safeFilters.status && safeFilters.status.length > 0) {
|
|
39
44
|
if (!order.status || !safeFilters.status.includes(order.status)) {
|
|
40
45
|
return false;
|
|
@@ -136,7 +136,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
|
|
|
136
136
|
* 获取当前的客户搜索条件
|
|
137
137
|
* @returns 当前搜索条件
|
|
138
138
|
*/
|
|
139
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
139
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
140
140
|
/**
|
|
141
141
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
142
142
|
* @returns 客户状态
|