@pisell/pisellos 2.3.59 → 2.3.61

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 (46) hide show
  1. package/dist/core/index.d.ts +0 -7
  2. package/dist/core/index.js +66 -109
  3. package/dist/model/strategy/adapter/walletPass/evaluator.js +0 -1
  4. package/dist/model/strategy/adapter/walletPass/type.d.ts +5 -0
  5. package/dist/model/strategy/adapter/walletPass/utils.js +57 -24
  6. package/dist/modules/Payment/types.d.ts +2 -0
  7. package/dist/modules/Payment/utils.js +4 -1
  8. package/dist/modules/Payment/walletpass.d.ts +11 -0
  9. package/dist/modules/Payment/walletpass.js +204 -49
  10. package/dist/modules/ProductList/index.js +2 -1
  11. package/dist/modules/Quotation/index.d.ts +0 -6
  12. package/dist/modules/Quotation/index.js +19 -75
  13. package/dist/plugins/request.d.ts +0 -1
  14. package/dist/server/index.js +62 -74
  15. package/dist/server/modules/floor-plan/index.d.ts +0 -4
  16. package/dist/server/modules/floor-plan/index.js +98 -240
  17. package/dist/server/modules/order/index.d.ts +5 -6
  18. package/dist/server/modules/order/index.js +78 -176
  19. package/dist/server/modules/products/index.d.ts +0 -2
  20. package/dist/server/modules/products/index.js +3 -17
  21. package/dist/server/modules/resource/index.js +13 -21
  22. package/dist/solution/BaseSales/index.d.ts +5 -0
  23. package/dist/solution/BaseSales/index.js +311 -281
  24. package/lib/core/index.d.ts +0 -7
  25. package/lib/core/index.js +3 -20
  26. package/lib/model/strategy/adapter/walletPass/evaluator.js +0 -1
  27. package/lib/model/strategy/adapter/walletPass/type.d.ts +5 -0
  28. package/lib/model/strategy/adapter/walletPass/utils.js +62 -10
  29. package/lib/modules/Payment/types.d.ts +2 -0
  30. package/lib/modules/Payment/utils.js +5 -1
  31. package/lib/modules/Payment/walletpass.d.ts +11 -0
  32. package/lib/modules/Payment/walletpass.js +183 -15
  33. package/lib/modules/ProductList/index.js +2 -1
  34. package/lib/modules/Quotation/index.d.ts +0 -6
  35. package/lib/modules/Quotation/index.js +5 -49
  36. package/lib/plugins/request.d.ts +0 -1
  37. package/lib/server/modules/floor-plan/index.d.ts +0 -4
  38. package/lib/server/modules/floor-plan/index.js +6 -54
  39. package/lib/server/modules/order/index.d.ts +5 -6
  40. package/lib/server/modules/order/index.js +23 -105
  41. package/lib/server/modules/products/index.d.ts +0 -2
  42. package/lib/server/modules/products/index.js +4 -15
  43. package/lib/server/modules/resource/index.js +2 -7
  44. package/lib/solution/BaseSales/index.d.ts +5 -0
  45. package/lib/solution/BaseSales/index.js +11 -0
  46. package/package.json +1 -1
@@ -1,10 +1,6 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
5
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
7
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
8
4
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
9
5
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
6
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
@@ -40,15 +36,12 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
40
36
  list: []
41
37
  });
42
38
  _defineProperty(_assertThisInitialized(_this), "scheduleResolver", void 0);
43
- _defineProperty(_assertThisInitialized(_this), "app", void 0);
44
- _defineProperty(_assertThisInitialized(_this), "quotationListUpdatedListener", void 0);
45
39
  return _this;
46
40
  }
47
41
  _createClass(QuotationModule, [{
48
42
  key: "initialize",
49
43
  value: function () {
50
44
  var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(core, options) {
51
- var _core$getPlugin, _core$getPlugin$getAp;
52
45
  return _regeneratorRuntime().wrap(function _callee$(_context) {
53
46
  while (1) switch (_context.prev = _context.next) {
54
47
  case 0:
@@ -60,11 +53,10 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
60
53
  }
61
54
  throw new Error('QuotationModule 需要 request 插件支持');
62
55
  case 4:
63
- this.app = (_core$getPlugin = core.getPlugin('app')) === null || _core$getPlugin === void 0 || (_core$getPlugin$getAp = _core$getPlugin.getApp) === null || _core$getPlugin$getAp === void 0 ? void 0 : _core$getPlugin$getAp.call(_core$getPlugin);
64
56
  this.store = {
65
57
  list: []
66
58
  };
67
- case 6:
59
+ case 5:
68
60
  case "end":
69
61
  return _context.stop();
70
62
  }
@@ -79,8 +71,8 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
79
71
  key: "loadQuotations",
80
72
  value: function () {
81
73
  var _loadQuotations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
82
- var _this2 = this;
83
- var query, initialResultApplied, applyRemoteUpdate, res;
74
+ var _data;
75
+ var query, res, list;
84
76
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
85
77
  while (1) switch (_context2.prev = _context2.next) {
86
78
  case 0:
@@ -89,27 +81,19 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
89
81
  if ((params === null || params === void 0 ? void 0 : params.channel) === 'online_store') {
90
82
  query.channel = 'online-store';
91
83
  }
92
- initialResultApplied = false;
93
- applyRemoteUpdate = function applyRemoteUpdate(response) {
94
- _this2.applyQuotationResponse(response);
95
- if (initialResultApplied) {
96
- _this2.notifyQuotationListUpdated();
97
- }
98
- };
99
- _context2.next = 7;
84
+ _context2.next = 5;
100
85
  return this.request.get('/quotation/available', query, {
101
- cache: {
102
- type: 'indexDB',
103
- updateCache: true,
104
- cacheKeyData: this.getQuotationCacheKeyData(query)
105
- },
106
- cacheUpdateChange: applyRemoteUpdate
86
+ useCache: false,
87
+ osServer: true
107
88
  });
108
- case 7:
89
+ case 5:
109
90
  res = _context2.sent;
110
- this.applyQuotationResponse(res);
111
- initialResultApplied = true;
112
- case 10:
91
+ list = (res === null || res === void 0 || (_data = res.data) === null || _data === void 0 ? void 0 : _data.list) || (res === null || res === void 0 ? void 0 : res.list) || [];
92
+ list.sort(function (a, b) {
93
+ return b.sort - a.sort;
94
+ });
95
+ this.store.list = list;
96
+ case 9:
113
97
  case "end":
114
98
  return _context2.stop();
115
99
  }
@@ -125,15 +109,10 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
125
109
  value: function getQuotationList() {
126
110
  return this.store.list;
127
111
  }
128
- }, {
129
- key: "setQuotationListUpdatedListener",
130
- value: function setQuotationListUpdatedListener(listener) {
131
- this.quotationListUpdatedListener = listener;
132
- }
133
112
  }, {
134
113
  key: "getQuotationCustomerScopeInfo",
135
114
  value: function getQuotationCustomerScopeInfo() {
136
- var _this3 = this;
115
+ var _this2 = this;
137
116
  var customerById = new Map();
138
117
  var quotationScopes = this.store.list.filter(function (quotation) {
139
118
  return Array.isArray(quotation.customer) && quotation.customer.length > 0;
@@ -143,7 +122,7 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
143
122
  var localSeen = new Set();
144
123
  var quotationCustomers = quotation.customer || [];
145
124
  quotationCustomers.forEach(function (customer) {
146
- var customerId = _this3.normalizeCustomerId(customer === null || customer === void 0 ? void 0 : customer.id);
125
+ var customerId = _this2.normalizeCustomerId(customer === null || customer === void 0 ? void 0 : customer.id);
147
126
  if (!customerId || localSeen.has(customerId)) return;
148
127
  localSeen.add(customerId);
149
128
  customerIds.push(customerId);
@@ -268,41 +247,6 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
268
247
  value: function setScheduleResolver(resolver) {
269
248
  this.scheduleResolver = resolver;
270
249
  }
271
- }, {
272
- key: "applyQuotationResponse",
273
- value: function applyQuotationResponse(response) {
274
- var _data;
275
- var source = (response === null || response === void 0 || (_data = response.data) === null || _data === void 0 ? void 0 : _data.list) || (response === null || response === void 0 ? void 0 : response.list) || [];
276
- this.store.list = _toConsumableArray(source).sort(function (a, b) {
277
- return Number(b.sort || 0) - Number(a.sort || 0);
278
- });
279
- }
280
- }, {
281
- key: "notifyQuotationListUpdated",
282
- value: function notifyQuotationListUpdated() {
283
- try {
284
- var _this$quotationListUp;
285
- (_this$quotationListUp = this.quotationListUpdatedListener) === null || _this$quotationListUp === void 0 || _this$quotationListUp.call(this);
286
- } catch (error) {
287
- console.warn('[QuotationModule] 报价单后台更新回调失败', error);
288
- }
289
- }
290
- }, {
291
- key: "getQuotationCacheKeyData",
292
- value: function getQuotationCacheKeyData(query) {
293
- var shopId = '';
294
- try {
295
- var _this$app, _this$app$getStorage;
296
- var storedCore = (_this$app = this.app) === null || _this$app === void 0 || (_this$app = _this$app.storage) === null || _this$app === void 0 || (_this$app$getStorage = _this$app.getStorage) === null || _this$app$getStorage === void 0 ? void 0 : _this$app$getStorage.call(_this$app, 'core');
297
- var coreInfo = typeof storedCore === 'string' ? JSON.parse(storedCore || '{}') : storedCore || {};
298
- shopId = String((coreInfo === null || coreInfo === void 0 ? void 0 : coreInfo.id) || '');
299
- } catch (_unused) {
300
- // 缓存隔离信息读取失败时仍按请求参数缓存。
301
- }
302
- return _objectSpread(_objectSpread({}, query), {}, {
303
- shop_id: shopId
304
- });
305
- }
306
250
  }, {
307
251
  key: "isQuotationVisibleForCustomer",
308
252
  value: function isQuotationVisibleForCustomer(quotation, customerId) {
@@ -329,17 +273,17 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
329
273
  key: "isQuotationActiveAt",
330
274
  value: function isQuotationActiveAt(quotation, datetime) {
331
275
  var _quotation$schedule,
332
- _this4 = this;
276
+ _this3 = this;
333
277
  if (!((_quotation$schedule = quotation.schedule) !== null && _quotation$schedule !== void 0 && _quotation$schedule.length)) return false;
334
278
  var scheduleItems = [];
335
279
  quotation.schedule.forEach(function (s) {
336
- var _this4$scheduleResolv;
337
- var full = (_this4$scheduleResolv = _this4.scheduleResolver) === null || _this4$scheduleResolv === void 0 ? void 0 : _this4$scheduleResolv.call(_this4, s.id);
280
+ var _this3$scheduleResolv;
281
+ var full = (_this3$scheduleResolv = _this3.scheduleResolver) === null || _this3$scheduleResolv === void 0 ? void 0 : _this3$scheduleResolv.call(_this3, s.id);
338
282
  if (full) {
339
283
  scheduleItems.push(full);
340
284
  return;
341
285
  }
342
- if (_this4.scheduleResolver) {
286
+ if (_this3.scheduleResolver) {
343
287
  return;
344
288
  }
345
289
  var fallbackSchedule = _objectSpread(_objectSpread({}, s), {}, {
@@ -68,7 +68,6 @@ export interface RequestOptions {
68
68
  useCache?: boolean;
69
69
  customToast?: () => void;
70
70
  cache?: CacheProps;
71
- cacheUpdateChange?: (data: any) => void;
72
71
  osServer?: boolean;
73
72
  prefix?: boolean;
74
73
  callback?: (res: any) => void;
@@ -2717,7 +2717,6 @@ var Server = /*#__PURE__*/function () {
2717
2717
  key: "setupProductsQuotationPriceBridge",
2718
2718
  value: (function () {
2719
2719
  var _setupProductsQuotationPriceBridge = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33() {
2720
- var _this5 = this;
2721
2720
  var _this$core$context, errorMessage;
2722
2721
  return _regeneratorRuntime().wrap(function _callee33$(_context33) {
2723
2722
  while (1) switch (_context33.prev = _context33.next) {
@@ -2737,42 +2736,31 @@ var Server = /*#__PURE__*/function () {
2737
2736
  return _context33.abrupt("return");
2738
2737
  case 6:
2739
2738
  _context33.prev = 6;
2739
+ _context33.next = 9;
2740
+ return this.schedule.loadAllSchedule();
2741
+ case 9:
2740
2742
  this.products.clearPriceCache();
2741
- _context33.next = 10;
2743
+ _context33.next = 12;
2742
2744
  return this.products.setupQuotationPriceBridge({
2743
2745
  scheduleModule: this.schedule,
2744
- channel: (_this$core$context = this.core.context) === null || _this$core$context === void 0 ? void 0 : _this$core$context.channel,
2745
- onQuotationUpdated: function onQuotationUpdated() {
2746
- void _this5.recomputeAndNotifyProductQuery();
2747
- }
2748
- });
2749
- case 10:
2750
- // Schedule 已在模块 preload 阶段加载完成。价格桥接先使用本地数据,
2751
- // 远端刷新转为后台校准,避免二次启动重复阻塞请求。
2752
- void this.schedule.loadAllSchedule().then(function () {
2753
- var _this5$products;
2754
- (_this5$products = _this5.products) === null || _this5$products === void 0 || _this5$products.clearPriceCache();
2755
- void _this5.recomputeAndNotifyProductQuery();
2756
- }).catch(function (error) {
2757
- _this5.logWarning('Products 报价单价格桥接后台刷新 Schedule 失败,继续使用本地数据', {
2758
- error: error instanceof Error ? error.message : String(error)
2759
- });
2746
+ channel: (_this$core$context = this.core.context) === null || _this$core$context === void 0 ? void 0 : _this$core$context.channel
2760
2747
  });
2748
+ case 12:
2761
2749
  this.logInfo('Products 报价单价格桥接初始化完成');
2762
- _context33.next = 18;
2750
+ _context33.next = 19;
2763
2751
  break;
2764
- case 14:
2765
- _context33.prev = 14;
2752
+ case 15:
2753
+ _context33.prev = 15;
2766
2754
  _context33.t0 = _context33["catch"](6);
2767
2755
  errorMessage = _context33.t0 instanceof Error ? _context33.t0.message : String(_context33.t0);
2768
2756
  this.logError('Products 报价单价格桥接初始化失败', {
2769
2757
  error: errorMessage
2770
2758
  });
2771
- case 18:
2759
+ case 19:
2772
2760
  case "end":
2773
2761
  return _context33.stop();
2774
2762
  }
2775
- }, _callee33, this, [[6, 14]]);
2763
+ }, _callee33, this, [[6, 15]]);
2776
2764
  }));
2777
2765
  function setupProductsQuotationPriceBridge() {
2778
2766
  return _setupProductsQuotationPriceBridge.apply(this, arguments);
@@ -3247,10 +3235,10 @@ var Server = /*#__PURE__*/function () {
3247
3235
  }, {
3248
3236
  key: "getAllRoutes",
3249
3237
  value: function getAllRoutes() {
3250
- var _this6 = this;
3238
+ var _this5 = this;
3251
3239
  var routes = [];
3252
3240
  ['get', 'post', 'put', 'remove'].forEach(function (method) {
3253
- Object.keys(_this6.router[method]).forEach(function (path) {
3241
+ Object.keys(_this5.router[method]).forEach(function (path) {
3254
3242
  routes.push({
3255
3243
  method: method,
3256
3244
  path: path
@@ -3380,7 +3368,7 @@ var Server = /*#__PURE__*/function () {
3380
3368
  key: "getPaymentRouteModule",
3381
3369
  value: function () {
3382
3370
  var _getPaymentRouteModule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40() {
3383
- var _this7 = this;
3371
+ var _this6 = this;
3384
3372
  return _regeneratorRuntime().wrap(function _callee40$(_context40) {
3385
3373
  while (1) switch (_context40.prev = _context40.next) {
3386
3374
  case 0:
@@ -3409,13 +3397,13 @@ var Server = /*#__PURE__*/function () {
3409
3397
  case 0:
3410
3398
  module = new PaymentServerModule('server_payment_route', '1.0.0');
3411
3399
  _context39.next = 3;
3412
- return module.initialize(_this7.core, {
3400
+ return module.initialize(_this6.core, {
3413
3401
  store: {
3414
3402
  payMethods: []
3415
3403
  }
3416
3404
  });
3417
3405
  case 3:
3418
- _this7.paymentRouteModule = module;
3406
+ _this6.paymentRouteModule = module;
3419
3407
  return _context39.abrupt("return", module);
3420
3408
  case 5:
3421
3409
  case "end":
@@ -3423,7 +3411,7 @@ var Server = /*#__PURE__*/function () {
3423
3411
  }
3424
3412
  }, _callee39);
3425
3413
  }))().finally(function () {
3426
- _this7.paymentRouteModuleInFlight = undefined;
3414
+ _this6.paymentRouteModuleInFlight = undefined;
3427
3415
  });
3428
3416
  return _context40.abrupt("return", this.paymentRouteModuleInFlight);
3429
3417
  case 8:
@@ -3599,7 +3587,7 @@ var Server = /*#__PURE__*/function () {
3599
3587
  }, {
3600
3588
  key: "scheduleSubscriberTimePointReloads",
3601
3589
  value: function scheduleSubscriberTimePointReloads(subscriberId, timePoints) {
3602
- var _this8 = this;
3590
+ var _this7 = this;
3603
3591
  var subscriber = this.productQuerySubscribers.get(subscriberId);
3604
3592
  if (!subscriber || !timePoints.length) return;
3605
3593
  var scheduleDate = subscriber.context.schedule_date || dayjs().format('YYYY-MM-DD');
@@ -3620,7 +3608,7 @@ var Server = /*#__PURE__*/function () {
3620
3608
  setInterval(function () {
3621
3609
  var currentTime = dayjs().format('hh:mm');
3622
3610
  if (timePoints.includes(currentTime)) {
3623
- _this8.onScheduleTimePointTimerFire(subscriberId);
3611
+ _this7.onScheduleTimePointTimerFire(subscriberId);
3624
3612
  }
3625
3613
  }, 60000);
3626
3614
  if (timerIds.length > 0) {
@@ -3789,7 +3777,7 @@ var Server = /*#__PURE__*/function () {
3789
3777
  key: "refreshMenuScheduleCacheAfterEmptyResult",
3790
3778
  value: (function () {
3791
3779
  var _refreshMenuScheduleCacheAfterEmptyResult = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44() {
3792
- var _this9 = this;
3780
+ var _this8 = this;
3793
3781
  var now;
3794
3782
  return _regeneratorRuntime().wrap(function _callee44$(_context44) {
3795
3783
  while (1) switch (_context44.prev = _context44.next) {
@@ -3812,11 +3800,11 @@ var Server = /*#__PURE__*/function () {
3812
3800
  this.menuScheduleRefreshInFlight = Promise.all([this.menu.loadMenuList(), this.schedule.loadAllSchedule()]).then(function () {
3813
3801
  return undefined;
3814
3802
  }).catch(function (error) {
3815
- _this9.logWarning('刷新菜单/日程缓存失败,继续使用现有缓存', {
3803
+ _this8.logWarning('刷新菜单/日程缓存失败,继续使用现有缓存', {
3816
3804
  error: error instanceof Error ? error.message : String(error)
3817
3805
  });
3818
3806
  }).finally(function () {
3819
- _this9.menuScheduleRefreshInFlight = null;
3807
+ _this8.menuScheduleRefreshInFlight = null;
3820
3808
  });
3821
3809
  }
3822
3810
  _context44.next = 8;
@@ -4002,10 +3990,10 @@ var Server = /*#__PURE__*/function () {
4002
3990
  }, {
4003
3991
  key: "stripSalesSearchPageParams",
4004
3992
  value: function stripSalesSearchPageParams(value) {
4005
- var _this10 = this;
3993
+ var _this9 = this;
4006
3994
  if (Array.isArray(value)) {
4007
3995
  return value.map(function (item) {
4008
- return _this10.stripSalesSearchPageParams(item);
3996
+ return _this9.stripSalesSearchPageParams(item);
4009
3997
  });
4010
3998
  }
4011
3999
  if (!value || _typeof(value) !== 'object') return value;
@@ -4043,12 +4031,12 @@ var Server = /*#__PURE__*/function () {
4043
4031
  key: "extractSalesSearchOrderIds",
4044
4032
  value: function extractSalesSearchOrderIds(kind, result) {
4045
4033
  var _this$findSalesSearch,
4046
- _this11 = this;
4034
+ _this10 = this;
4047
4035
  var data = this.extractSalesSearchResponseData(result);
4048
4036
  var list = kind === 'aggregate' ? (_this$findSalesSearch = this.findSalesSearchAggregateGroup(data)) === null || _this$findSalesSearch === void 0 ? void 0 : _this$findSalesSearch.list : data === null || data === void 0 ? void 0 : data.list;
4049
4037
  if (!Array.isArray(list)) return [];
4050
4038
  return list.map(function (item) {
4051
- return _this11.getSalesSearchOrderId(item);
4039
+ return _this10.getSalesSearchOrderId(item);
4052
4040
  }).filter(function (id) {
4053
4041
  return !!id;
4054
4042
  });
@@ -4215,11 +4203,11 @@ var Server = /*#__PURE__*/function () {
4215
4203
  }, {
4216
4204
  key: "stableSerialize",
4217
4205
  value: function stableSerialize(value) {
4218
- var _this12 = this;
4206
+ var _this11 = this;
4219
4207
  if (value === null || value === undefined) return 'null';
4220
4208
  if (Array.isArray(value)) {
4221
4209
  return "[".concat(value.map(function (item) {
4222
- return _this12.stableSerialize(item);
4210
+ return _this11.stableSerialize(item);
4223
4211
  }).join(','), "]");
4224
4212
  }
4225
4213
  if (_typeof(value) === 'object') {
@@ -4228,7 +4216,7 @@ var Server = /*#__PURE__*/function () {
4228
4216
  return obj[k] !== undefined;
4229
4217
  }).sort();
4230
4218
  return "{".concat(keys.map(function (k) {
4231
- return "".concat(JSON.stringify(k), ":").concat(_this12.stableSerialize(obj[k]));
4219
+ return "".concat(JSON.stringify(k), ":").concat(_this11.stableSerialize(obj[k]));
4232
4220
  }).join(','), "}");
4233
4221
  }
4234
4222
  return JSON.stringify(value);
@@ -4768,7 +4756,7 @@ var Server = /*#__PURE__*/function () {
4768
4756
  key: "runLocalPaymentUpdateInQueue",
4769
4757
  value: function () {
4770
4758
  var _runLocalPaymentUpdateInQueue = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(key, task, context) {
4771
- var _this13 = this;
4759
+ var _this12 = this;
4772
4760
  var queuedAt, hasPreviousTask, previous, current, tail, _data, result, released;
4773
4761
  return _regeneratorRuntime().wrap(function _callee50$(_context50) {
4774
4762
  while (1) switch (_context50.prev = _context50.next) {
@@ -4787,7 +4775,7 @@ var Server = /*#__PURE__*/function () {
4787
4775
  return _regeneratorRuntime().wrap(function _callee49$(_context49) {
4788
4776
  while (1) switch (_context49.prev = _context49.next) {
4789
4777
  case 0:
4790
- _this13.logInfo('handleUpdateLocalPayment: 串行队列开始执行', _objectSpread(_objectSpread({}, context), {}, {
4778
+ _this12.logInfo('handleUpdateLocalPayment: 串行队列开始执行', _objectSpread(_objectSpread({}, context), {}, {
4791
4779
  queue_key: key,
4792
4780
  queue_wait_ms: Date.now() - queuedAt
4793
4781
  }));
@@ -6182,7 +6170,7 @@ var Server = /*#__PURE__*/function () {
6182
6170
  key: "handlePendingSyncCheckoutOrder",
6183
6171
  value: function () {
6184
6172
  var _handlePendingSyncCheckoutOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(params) {
6185
- var _this14 = this;
6173
+ var _this13 = this;
6186
6174
  var backendPath, data, title, reason, pendingOrder, _pendingOrder$payment, _pendingOrder$summary, _pendingOrder$summary2, _pendingOrder$summary3, changeGivenAmount, errorMessage;
6187
6175
  return _regeneratorRuntime().wrap(function _callee63$(_context63) {
6188
6176
  while (1) switch (_context63.prev = _context63.next) {
@@ -6235,7 +6223,7 @@ var Server = /*#__PURE__*/function () {
6235
6223
  });
6236
6224
  changeGivenAmount = pendingOrder === null || pendingOrder === void 0 || (_pendingOrder$payment = pendingOrder.payments) === null || _pendingOrder$payment === void 0 ? void 0 : _pendingOrder$payment.reduce(function (sum, payment) {
6237
6225
  var _payment$metadata;
6238
- return sum + _this14.toAmountNumber(payment === null || payment === void 0 || (_payment$metadata = payment.metadata) === null || _payment$metadata === void 0 ? void 0 : _payment$metadata.change_given_amount);
6226
+ return sum + _this13.toAmountNumber(payment === null || payment === void 0 || (_payment$metadata = payment.metadata) === null || _payment$metadata === void 0 ? void 0 : _payment$metadata.change_given_amount);
6239
6227
  }, 0);
6240
6228
  return _context63.abrupt("return", {
6241
6229
  code: 200,
@@ -6375,13 +6363,13 @@ var Server = /*#__PURE__*/function () {
6375
6363
  }, {
6376
6364
  key: "sumPaidOrderPayments",
6377
6365
  value: function sumPaidOrderPayments(payments) {
6378
- var _this15 = this;
6366
+ var _this14 = this;
6379
6367
  if (!Array.isArray(payments)) return 0;
6380
6368
  return payments.reduce(function (sum, payment) {
6381
6369
  var _payment$amount;
6382
6370
  var status = String((payment === null || payment === void 0 ? void 0 : payment.status) || '').toLowerCase();
6383
6371
  if (status !== 'paid') return sum;
6384
- return sum + _this15.toAmountNumber((_payment$amount = payment === null || payment === void 0 ? void 0 : payment.amount) !== null && _payment$amount !== void 0 ? _payment$amount : payment === null || payment === void 0 ? void 0 : payment.origin_amount);
6372
+ return sum + _this14.toAmountNumber((_payment$amount = payment === null || payment === void 0 ? void 0 : payment.amount) !== null && _payment$amount !== void 0 ? _payment$amount : payment === null || payment === void 0 ? void 0 : payment.origin_amount);
6385
6373
  }, 0);
6386
6374
  }
6387
6375
  }, {
@@ -6397,7 +6385,7 @@ var Server = /*#__PURE__*/function () {
6397
6385
  value: function () {
6398
6386
  var _buildSmallTicketProductMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee66(order) {
6399
6387
  var _this$products3,
6400
- _this16 = this;
6388
+ _this15 = this;
6401
6389
  var products, productIdSet, productIds, entries;
6402
6390
  return _regeneratorRuntime().wrap(function _callee66$(_context66) {
6403
6391
  while (1) switch (_context66.prev = _context66.next) {
@@ -6430,20 +6418,20 @@ var Server = /*#__PURE__*/function () {
6430
6418
  _context66.next = 8;
6431
6419
  return Promise.all(productIds.map( /*#__PURE__*/function () {
6432
6420
  var _ref68 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(id) {
6433
- var _this16$products, _this16$products$getP, product;
6421
+ var _this15$products, _this15$products$getP, product;
6434
6422
  return _regeneratorRuntime().wrap(function _callee65$(_context65) {
6435
6423
  while (1) switch (_context65.prev = _context65.next) {
6436
6424
  case 0:
6437
6425
  _context65.prev = 0;
6438
6426
  _context65.next = 3;
6439
- return (_this16$products = _this16.products) === null || _this16$products === void 0 || (_this16$products$getP = _this16$products.getProductById) === null || _this16$products$getP === void 0 ? void 0 : _this16$products$getP.call(_this16$products, Number(id));
6427
+ return (_this15$products = _this15.products) === null || _this15$products === void 0 || (_this15$products$getP = _this15$products.getProductById) === null || _this15$products$getP === void 0 ? void 0 : _this15$products$getP.call(_this15$products, Number(id));
6440
6428
  case 3:
6441
6429
  product = _context65.sent;
6442
6430
  return _context65.abrupt("return", product ? [String(id), product] : null);
6443
6431
  case 7:
6444
6432
  _context65.prev = 7;
6445
6433
  _context65.t0 = _context65["catch"](0);
6446
- _this16.logWarning('buildSmallTicketProductMap: 查询本地商品失败', {
6434
+ _this15.logWarning('buildSmallTicketProductMap: 查询本地商品失败', {
6447
6435
  product_id: id,
6448
6436
  error: _context65.t0 instanceof Error ? _context65.t0.message : String(_context65.t0)
6449
6437
  });
@@ -6594,7 +6582,7 @@ var Server = /*#__PURE__*/function () {
6594
6582
  key: "withSalesDetailProductSnapshots",
6595
6583
  value: function () {
6596
6584
  var _withSalesDetailProductSnapshots = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee68(order) {
6597
- var _this17 = this;
6585
+ var _this16 = this;
6598
6586
  var products, snapshotMap, hasChanged, enrichedProducts, enrichedOrder;
6599
6587
  return _regeneratorRuntime().wrap(function _callee68$(_context68) {
6600
6588
  while (1) switch (_context68.prev = _context68.next) {
@@ -6618,8 +6606,8 @@ var Server = /*#__PURE__*/function () {
6618
6606
  case 8:
6619
6607
  hasChanged = false;
6620
6608
  enrichedProducts = products.map(function (product) {
6621
- var productWithBundleSnapshots = _this17.withBundleCatalogSnapshots(product, snapshotMap);
6622
- var nextProduct = _this17.withProductCatalogSnapshots(productWithBundleSnapshots, snapshotMap);
6609
+ var productWithBundleSnapshots = _this16.withBundleCatalogSnapshots(product, snapshotMap);
6610
+ var nextProduct = _this16.withProductCatalogSnapshots(productWithBundleSnapshots, snapshotMap);
6623
6611
  if (nextProduct !== product) hasChanged = true;
6624
6612
  return nextProduct;
6625
6613
  });
@@ -6647,13 +6635,13 @@ var Server = /*#__PURE__*/function () {
6647
6635
  }, {
6648
6636
  key: "withPendingSyncProductTitles",
6649
6637
  value: function withPendingSyncProductTitles(order, productMap) {
6650
- var _this18 = this;
6638
+ var _this17 = this;
6651
6639
  var products = Array.isArray(order.products) ? order.products : null;
6652
6640
  if (!(products !== null && products !== void 0 && products.length)) return order;
6653
6641
  return _objectSpread(_objectSpread({}, order), {}, {
6654
6642
  products: products.map(function (product) {
6655
6643
  return _objectSpread(_objectSpread({}, product), {}, {
6656
- product_title: _this18.buildProductTitleSnapshot(product, productMap)
6644
+ product_title: _this17.buildProductTitleSnapshot(product, productMap)
6657
6645
  });
6658
6646
  })
6659
6647
  });
@@ -6664,7 +6652,7 @@ var Server = /*#__PURE__*/function () {
6664
6652
  var _product$product_id4,
6665
6653
  _product$product,
6666
6654
  _fallbackProduct$prod,
6667
- _this19 = this;
6655
+ _this18 = this;
6668
6656
  var productId = (_product$product_id4 = product.product_id) !== null && _product$product_id4 !== void 0 ? _product$product_id4 : product.id;
6669
6657
  var fallbackProduct = productId !== undefined && productId !== null ? productMap[productId] || productMap[String(productId)] : null;
6670
6658
  var ownTitle = product.product_title || product.title || product.name || ((_product$product = product.product) === null || _product$product === void 0 ? void 0 : _product$product.title);
@@ -6672,7 +6660,7 @@ var Server = /*#__PURE__*/function () {
6672
6660
  var currentLocale = this.getProductTitleSnapshotCurrentLocale();
6673
6661
  var autoTitle = this.resolveFirstProductTitleValue(ownTitle) || this.resolveFirstProductTitleValue(fallbackTitle);
6674
6662
  return PRODUCT_TITLE_SNAPSHOT_KEYS.reduce(function (snapshot, key) {
6675
- snapshot[key] = _this19.resolveProductTitleValue(ownTitle, key, currentLocale) || _this19.resolveProductTitleValue(fallbackTitle, key, currentLocale) || (key === 'auto' || key === 'original' ? autoTitle : null);
6663
+ snapshot[key] = _this18.resolveProductTitleValue(ownTitle, key, currentLocale) || _this18.resolveProductTitleValue(fallbackTitle, key, currentLocale) || (key === 'auto' || key === 'original' ? autoTitle : null);
6676
6664
  return snapshot;
6677
6665
  }, {});
6678
6666
  }
@@ -6771,14 +6759,14 @@ var Server = /*#__PURE__*/function () {
6771
6759
  key: "enrichPaymentNamesByCode",
6772
6760
  value: function () {
6773
6761
  var _enrichPaymentNamesByCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee69(order) {
6774
- var _this20 = this;
6762
+ var _this19 = this;
6775
6763
  var payments, hasMissingName, paymentModule, payMethods, nameByCode, _iterator12, _step12, method, codeKey, name, hasResolvedName, enrichedPayments;
6776
6764
  return _regeneratorRuntime().wrap(function _callee69$(_context69) {
6777
6765
  while (1) switch (_context69.prev = _context69.next) {
6778
6766
  case 0:
6779
6767
  payments = Array.isArray(order === null || order === void 0 ? void 0 : order.payments) ? order.payments : [];
6780
6768
  hasMissingName = payments.some(function (payment) {
6781
- return _this20.isBlankPaymentName(payment === null || payment === void 0 ? void 0 : payment.name) && _this20.shouldLookupPaymentMethodNameByCode(payment === null || payment === void 0 ? void 0 : payment.code);
6769
+ return _this19.isBlankPaymentName(payment === null || payment === void 0 ? void 0 : payment.name) && _this19.shouldLookupPaymentMethodNameByCode(payment === null || payment === void 0 ? void 0 : payment.code);
6782
6770
  });
6783
6771
  if (hasMissingName) {
6784
6772
  _context69.next = 4;
@@ -6811,9 +6799,9 @@ var Server = /*#__PURE__*/function () {
6811
6799
  }
6812
6800
  hasResolvedName = false;
6813
6801
  enrichedPayments = payments.map(function (payment) {
6814
- if (!_this20.isBlankPaymentName(payment === null || payment === void 0 ? void 0 : payment.name)) return payment;
6815
- if (!_this20.shouldLookupPaymentMethodNameByCode(payment === null || payment === void 0 ? void 0 : payment.code)) return payment;
6816
- var name = nameByCode.get(_this20.getPaymentCodeKey(payment === null || payment === void 0 ? void 0 : payment.code));
6802
+ if (!_this19.isBlankPaymentName(payment === null || payment === void 0 ? void 0 : payment.name)) return payment;
6803
+ if (!_this19.shouldLookupPaymentMethodNameByCode(payment === null || payment === void 0 ? void 0 : payment.code)) return payment;
6804
+ var name = nameByCode.get(_this19.getPaymentCodeKey(payment === null || payment === void 0 ? void 0 : payment.code));
6817
6805
  if (!name) return payment;
6818
6806
  hasResolvedName = true;
6819
6807
  return _objectSpread(_objectSpread({}, payment), {}, {
@@ -7395,10 +7383,10 @@ var Server = /*#__PURE__*/function () {
7395
7383
  value: function extractBackendErrorResponse(error) {
7396
7384
  var _error$response3,
7397
7385
  _error$response4,
7398
- _this21 = this;
7386
+ _this20 = this;
7399
7387
  var candidates = [error === null || error === void 0 || (_error$response3 = error.response) === null || _error$response3 === void 0 ? void 0 : _error$response3.data, error === null || error === void 0 ? void 0 : error.data, error === null || error === void 0 || (_error$response4 = error.response) === null || _error$response4 === void 0 ? void 0 : _error$response4.body, error === null || error === void 0 ? void 0 : error.body];
7400
7388
  return candidates.find(function (candidate) {
7401
- return _this21.isExplicitBackendErrorResponse(candidate);
7389
+ return _this20.isExplicitBackendErrorResponse(candidate);
7402
7390
  }) || null;
7403
7391
  }
7404
7392
  }, {
@@ -7759,7 +7747,7 @@ var Server = /*#__PURE__*/function () {
7759
7747
  value: (function () {
7760
7748
  var _computeProductQueryResult = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee75(context, options) {
7761
7749
  var _menu_list_ids$length3,
7762
- _this22 = this;
7750
+ _this21 = this;
7763
7751
  var tTotal, menu_list_ids, ids, schedule_date, schedule_datetime, customer_id, extension_type, product_id, strategy_context, queryIds, formatterContext, uniqueIds, _tPrice, productsWithPrice, _filteredProducts, extensionFilteredProducts, _published$find, pid, _tPrice2, allProductsWithPrice, published, item, _tPrice3, _filteredProducts2, _tStatus, _beforeStatusCount, _tExtensionType, _beforeExtensionTypeCount, _tSort, activeMenuList, tMenu, getActiveMenus, tFilter, productScope, scopedProductIds, tPrice, filteredProducts, tStatus, beforeStatusCount, tExtensionType, beforeExtensionTypeCount, tSort;
7764
7752
  return _regeneratorRuntime().wrap(function _callee75$(_context75) {
7765
7753
  while (1) switch (_context75.prev = _context75.next) {
@@ -7958,9 +7946,9 @@ var Server = /*#__PURE__*/function () {
7958
7946
  }
7959
7947
  tMenu = performance.now();
7960
7948
  getActiveMenus = function getActiveMenus() {
7961
- return _this22.menu.getMenuByIds(menu_list_ids).filter(function (menu) {
7962
- var _this22$schedule;
7963
- return ((_this22$schedule = _this22.schedule) === null || _this22$schedule === void 0 ? void 0 : _this22$schedule.getDateIsInSchedule(schedule_datetime, menu.schedule)) || false;
7949
+ return _this21.menu.getMenuByIds(menu_list_ids).filter(function (menu) {
7950
+ var _this21$schedule;
7951
+ return ((_this21$schedule = _this21.schedule) === null || _this21$schedule === void 0 ? void 0 : _this21$schedule.getDateIsInSchedule(schedule_datetime, menu.schedule)) || false;
7964
7952
  });
7965
7953
  };
7966
7954
  activeMenuList = getActiveMenus();
@@ -8269,7 +8257,7 @@ var Server = /*#__PURE__*/function () {
8269
8257
  }, {
8270
8258
  key: "notifySalesSearchSubscribers",
8271
8259
  value: function notifySalesSearchSubscribers(payload) {
8272
- var _this23 = this;
8260
+ var _this22 = this;
8273
8261
  if (this.salesSearchSubscribers.size === 0) return;
8274
8262
  var changedOrders = this.extractChangedOrdersFromPayload(payload);
8275
8263
  if (changedOrders.length === 0) {
@@ -8287,21 +8275,21 @@ var Server = /*#__PURE__*/function () {
8287
8275
  subscriber = _step20$value[1];
8288
8276
  try {
8289
8277
  var changedVisibleOrders = changedOrders.filter(function (order) {
8290
- var orderId = _this23.getSalesSearchOrderId(order);
8278
+ var orderId = _this22.getSalesSearchOrderId(order);
8291
8279
  return !!orderId && subscriber.visibleOrderIds.has(orderId);
8292
8280
  });
8293
8281
  if (changedVisibleOrders.length === 0) {
8294
8282
  return 1; // continue
8295
8283
  }
8296
- subscriber.callback(_this23.buildSalesSearchDeltaResponse(subscriber, changedVisibleOrders));
8297
- _this23.logInfo('notifySalesSearchSubscribers: 已推送 delta', {
8284
+ subscriber.callback(_this22.buildSalesSearchDeltaResponse(subscriber, changedVisibleOrders));
8285
+ _this22.logInfo('notifySalesSearchSubscribers: 已推送 delta', {
8298
8286
  subscriberId: subscriberId,
8299
8287
  kind: subscriber.kind,
8300
8288
  count: changedVisibleOrders.length
8301
8289
  });
8302
8290
  } catch (error) {
8303
8291
  var errorMessage = error instanceof Error ? error.message : String(error);
8304
- _this23.logError('notifySalesSearchSubscribers: 推送失败', {
8292
+ _this22.logError('notifySalesSearchSubscribers: 推送失败', {
8305
8293
  subscriberId: subscriberId,
8306
8294
  error: errorMessage
8307
8295
  });
@@ -10,7 +10,6 @@ export declare class FloorPlanModule extends BaseModule implements Module {
10
10
  private store;
11
11
  private request;
12
12
  private logger;
13
- private dbManager;
14
13
  private floorPlanDataSource;
15
14
  private pendingSyncMessages;
16
15
  private syncTimer?;
@@ -29,9 +28,6 @@ export declare class FloorPlanModule extends BaseModule implements Module {
29
28
  private mergeItems;
30
29
  private removeByIds;
31
30
  private loadListFromServer;
32
- private loadListFromSQLite;
33
- private saveListToSQLite;
34
- private refreshListFromServer;
35
31
  fetchByIdFromServer(id: number | string): Promise<FloorPlanItem | null>;
36
32
  fetchByCodeFromServer(code: string): Promise<FloorPlanItem | null>;
37
33
  preload(): Promise<void>;