@pisell/pisellos 2.2.257 → 2.2.259

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 (59) hide show
  1. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +17 -13
  2. package/dist/modules/Order/index.d.ts +32 -1
  3. package/dist/modules/Order/index.js +615 -288
  4. package/dist/modules/Order/types.d.ts +20 -2
  5. package/dist/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
  6. package/dist/modules/Order/utils/bundleDiscountHydration.js +144 -0
  7. package/dist/modules/Order/utils.d.ts +4 -0
  8. package/dist/modules/Order/utils.js +114 -28
  9. package/dist/modules/Rules/index.d.ts +3 -3
  10. package/dist/modules/Rules/index.js +8 -3
  11. package/dist/modules/Rules/types.d.ts +2 -1
  12. package/dist/modules/SalesSummary/index.d.ts +7 -3
  13. package/dist/modules/SalesSummary/index.js +67 -39
  14. package/dist/modules/SalesSummary/types.d.ts +1 -0
  15. package/dist/modules/SalesSummary/utils.js +2 -1
  16. package/dist/modules/SurchargeList/index.d.ts +6 -4
  17. package/dist/modules/SurchargeList/index.js +62 -39
  18. package/dist/modules/SurchargeList/types.d.ts +6 -2
  19. package/dist/server/index.d.ts +3 -0
  20. package/dist/server/index.js +1136 -855
  21. package/dist/server/modules/order/index.d.ts +22 -3
  22. package/dist/server/modules/order/index.js +398 -316
  23. package/dist/solution/BaseSales/index.d.ts +22 -2
  24. package/dist/solution/BaseSales/index.js +995 -701
  25. package/dist/solution/BaseSales/types.d.ts +1 -0
  26. package/dist/solution/BaseSales/types.js +2 -1
  27. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +2 -1
  28. package/dist/solution/BookingTicket/index.d.ts +8 -0
  29. package/dist/solution/BookingTicket/index.js +153 -6
  30. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +11 -1
  31. package/lib/modules/Order/index.d.ts +32 -1
  32. package/lib/modules/Order/index.js +402 -64
  33. package/lib/modules/Order/types.d.ts +20 -2
  34. package/lib/modules/Order/utils/bundleDiscountHydration.d.ts +5 -0
  35. package/lib/modules/Order/utils/bundleDiscountHydration.js +139 -0
  36. package/lib/modules/Order/utils.d.ts +4 -0
  37. package/lib/modules/Order/utils.js +84 -2
  38. package/lib/modules/Rules/index.d.ts +3 -3
  39. package/lib/modules/Rules/index.js +4 -3
  40. package/lib/modules/Rules/types.d.ts +2 -1
  41. package/lib/modules/SalesSummary/index.d.ts +7 -3
  42. package/lib/modules/SalesSummary/index.js +28 -11
  43. package/lib/modules/SalesSummary/types.d.ts +1 -0
  44. package/lib/modules/SalesSummary/utils.js +2 -0
  45. package/lib/modules/SurchargeList/index.d.ts +6 -4
  46. package/lib/modules/SurchargeList/index.js +41 -21
  47. package/lib/modules/SurchargeList/types.d.ts +6 -2
  48. package/lib/server/index.d.ts +3 -0
  49. package/lib/server/index.js +215 -9
  50. package/lib/server/modules/order/index.d.ts +22 -3
  51. package/lib/server/modules/order/index.js +103 -53
  52. package/lib/solution/BaseSales/index.d.ts +22 -2
  53. package/lib/solution/BaseSales/index.js +246 -60
  54. package/lib/solution/BaseSales/types.d.ts +1 -0
  55. package/lib/solution/BaseSales/types.js +2 -1
  56. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +2 -1
  57. package/lib/solution/BookingTicket/index.d.ts +8 -0
  58. package/lib/solution/BookingTicket/index.js +101 -0
  59. package/package.json +1 -1
@@ -25,15 +25,17 @@ __export(SurchargeList_exports, {
25
25
  module.exports = __toCommonJS(SurchargeList_exports);
26
26
  var import_BaseModule = require("../BaseModule");
27
27
  __reExport(SurchargeList_exports, require("./types"), module.exports);
28
+ var DEFAULT_SURCHARGE_CHANNEL = "online-store";
28
29
  var SurchargeListModule = class extends import_BaseModule.BaseModule {
29
30
  constructor(name, version) {
30
31
  super(name, version);
31
32
  this.defaultName = "surchargeList";
32
33
  this.defaultVersion = "1.0.0";
33
- this.loadingPromise = null;
34
+ this.loadingPromises = /* @__PURE__ */ new Map();
35
+ this.requestVersion = 0;
34
36
  }
35
37
  async initialize(core, options) {
36
- var _a, _b, _c;
38
+ var _a, _b, _c, _d, _e;
37
39
  this.core = core;
38
40
  this.store = options.store;
39
41
  this.request = this.core.getPlugin("request");
@@ -41,44 +43,62 @@ var SurchargeListModule = class extends import_BaseModule.BaseModule {
41
43
  (_a = options.initialState) == null ? void 0 : _a.surchargeList
42
44
  );
43
45
  this.store.surchargeList = hasInitialSurchargeList ? (_b = options.initialState) == null ? void 0 : _b.surchargeList : [];
44
- this.store.isLoaded = Boolean((_c = options.initialState) == null ? void 0 : _c.isLoaded) || hasInitialSurchargeList;
46
+ this.store.channel = ((_c = options.initialState) == null ? void 0 : _c.channel) || ((_d = options.otherParams) == null ? void 0 : _d.channel) || DEFAULT_SURCHARGE_CHANNEL;
47
+ this.store.isLoaded = Boolean((_e = options.initialState) == null ? void 0 : _e.isLoaded) || hasInitialSurchargeList;
45
48
  if (!this.request) {
46
49
  throw new Error("SurchargeListModule 需要 request 插件支持");
47
50
  }
48
51
  }
49
- async getSurchargeList() {
50
- if (this.store.isLoaded)
52
+ resolveChannel(query) {
53
+ return (query == null ? void 0 : query.channel) || DEFAULT_SURCHARGE_CHANNEL;
54
+ }
55
+ async getSurchargeList(query) {
56
+ const channel = this.resolveChannel(query);
57
+ if (this.store.isLoaded && this.store.channel === channel) {
51
58
  return this.store.surchargeList;
52
- if (this.loadingPromise)
53
- return this.loadingPromise;
54
- this.loadingPromise = this.loadSurchargeList();
55
- return this.loadingPromise;
59
+ }
60
+ const loadingPromise = this.loadingPromises.get(channel);
61
+ if (loadingPromise)
62
+ return loadingPromise;
63
+ const nextPromise = this.loadSurchargeList(channel);
64
+ this.loadingPromises.set(channel, nextPromise);
65
+ return nextPromise;
56
66
  }
57
- async refreshSurchargeList() {
58
- this.loadingPromise = this.loadSurchargeList();
59
- return this.loadingPromise;
67
+ async refreshSurchargeList(query) {
68
+ const channel = this.resolveChannel(query);
69
+ const nextPromise = this.loadSurchargeList(channel);
70
+ this.loadingPromises.set(channel, nextPromise);
71
+ return nextPromise;
60
72
  }
61
- async loadSurchargeList() {
73
+ async loadSurchargeList(channel) {
74
+ const currentRequestVersion = ++this.requestVersion;
62
75
  try {
63
76
  const surchargeList = await this.request.get(
64
77
  "/order/custom-surcharge/available/v2",
65
78
  {
66
- channel: "online-store",
79
+ channel,
67
80
  is_assemble_product_data: 1,
68
81
  is_assemble_schedule_data: 1,
69
82
  with: ["relationSchedule"]
70
83
  }
71
84
  );
72
- this.store.surchargeList = (surchargeList == null ? void 0 : surchargeList.data) || [];
73
- this.store.isLoaded = true;
74
- return this.store.surchargeList;
85
+ const nextSurchargeList = (surchargeList == null ? void 0 : surchargeList.data) || [];
86
+ if (currentRequestVersion === this.requestVersion) {
87
+ this.store.surchargeList = nextSurchargeList;
88
+ this.store.channel = channel;
89
+ this.store.isLoaded = true;
90
+ }
91
+ return nextSurchargeList;
75
92
  } catch (error) {
76
93
  console.warn("[SurchargeListModule] 加载附加费配置失败", error);
77
- this.store.surchargeList = [];
78
- this.store.isLoaded = true;
79
- return this.store.surchargeList;
94
+ if (currentRequestVersion === this.requestVersion) {
95
+ this.store.surchargeList = [];
96
+ this.store.channel = channel;
97
+ this.store.isLoaded = true;
98
+ }
99
+ return [];
80
100
  } finally {
81
- this.loadingPromise = null;
101
+ this.loadingPromises.delete(channel);
82
102
  }
83
103
  }
84
104
  };
@@ -4,8 +4,12 @@ export interface SurchargeListItem {
4
4
  export interface SurchargeListState {
5
5
  surchargeList: SurchargeListItem[];
6
6
  isLoaded: boolean;
7
+ channel?: string;
8
+ }
9
+ export interface SurchargeListQuery {
10
+ channel?: string;
7
11
  }
8
12
  export interface SurchargeListModuleAPI {
9
- getSurchargeList(): Promise<SurchargeListItem[]>;
10
- refreshSurchargeList(): Promise<SurchargeListItem[]>;
13
+ getSurchargeList(query?: SurchargeListQuery): Promise<SurchargeListItem[]>;
14
+ refreshSurchargeList(query?: SurchargeListQuery): Promise<SurchargeListItem[]>;
11
15
  }
@@ -431,6 +431,9 @@ declare class Server {
431
431
  private shouldLookupLocalPrintOrder;
432
432
  private getLocalPrintOrderLookup;
433
433
  private handleLocalPrintOrder;
434
+ private handleMachinecodeBatchMeta;
435
+ private resolveMachinecodeBatchMetadataLookup;
436
+ private syncMachinecodeRedeemStatusToLocalOrder;
434
437
  private handleOrderCheckoutSubmit;
435
438
  private handleSyncCheckoutSubmit;
436
439
  private handlePendingSyncCheckoutOrder;
@@ -639,7 +639,8 @@ var Server = class {
639
639
  checkoutData,
640
640
  order: printableOrder,
641
641
  response: null,
642
- requireFullyPaid: false
642
+ requireFullyPaid: false,
643
+ isManualPrint: true
643
644
  });
644
645
  return {
645
646
  code: 200,
@@ -661,6 +662,97 @@ var Server = class {
661
662
  };
662
663
  }
663
664
  };
665
+ this.handleMachinecodeBatchMeta = async ({ data }) => {
666
+ var _a, _b;
667
+ const title = "handleMachinecodeBatchMeta";
668
+ const backendPath = "/shop/machinecode/batch";
669
+ const ids = Array.isArray(data == null ? void 0 : data.ids) ? data.ids : [];
670
+ const status = data == null ? void 0 : data.status;
671
+ this.logInfo(`${title}: 开始处理`, {
672
+ backendPath,
673
+ batchSize: ids.length,
674
+ status,
675
+ order_lookup: this.resolveMachinecodeBatchMetadataLookup(data) ?? null
676
+ });
677
+ if (ids.length === 0) {
678
+ return {
679
+ code: 200,
680
+ status: true,
681
+ message: "",
682
+ data: []
683
+ };
684
+ }
685
+ if (status !== "used" && status !== "unused") {
686
+ return {
687
+ code: 400,
688
+ status: false,
689
+ message: "无效的核销状态",
690
+ data: null
691
+ };
692
+ }
693
+ try {
694
+ await this.syncMachinecodeRedeemStatusToLocalOrder(data, ids, status);
695
+ } catch (error) {
696
+ const message = this.getUnknownErrorMessage(error);
697
+ this.logError(`${title}: 本地订单核销状态更新失败`, {
698
+ error: message,
699
+ error_detail: this.normalizeUnknownError(error)
700
+ });
701
+ return {
702
+ code: 500,
703
+ status: false,
704
+ message,
705
+ data: null
706
+ };
707
+ }
708
+ if (!((_b = (_a = this.app) == null ? void 0 : _a.request) == null ? void 0 : _b.post)) {
709
+ this.logError(`${title}: app.request 不可用`, { backendPath });
710
+ return {
711
+ code: 500,
712
+ status: false,
713
+ message: "app.request 不可用",
714
+ data: null
715
+ };
716
+ }
717
+ try {
718
+ const response = await this.app.request.post(backendPath, {
719
+ ids,
720
+ status
721
+ }, {
722
+ isShopApi: true,
723
+ customToast: () => {
724
+ }
725
+ });
726
+ return {
727
+ code: (response == null ? void 0 : response.code) ?? 200,
728
+ status: (response == null ? void 0 : response.status) ?? true,
729
+ message: (response == null ? void 0 : response.message) ?? "",
730
+ data: (response == null ? void 0 : response.data) ?? response
731
+ };
732
+ } catch (error) {
733
+ const backendError = this.extractBackendErrorResponse(error);
734
+ if (backendError) {
735
+ return {
736
+ code: backendError.code ?? 500,
737
+ status: backendError.status ?? false,
738
+ message: backendError.message ?? "后端拒绝 batch-metadata",
739
+ data: backendError.data ?? null
740
+ };
741
+ }
742
+ const message = this.getUnknownErrorMessage(error);
743
+ this.logError(`${title}: 请求失败`, {
744
+ backendPath,
745
+ error: message,
746
+ error_detail: this.normalizeUnknownError(error)
747
+ });
748
+ return {
749
+ code: 500,
750
+ status: false,
751
+ message,
752
+ data: null
753
+ };
754
+ }
755
+ };
664
756
  this.handleOrderSalesDetail = async ({ url, data, path }) => {
665
757
  var _a;
666
758
  const requestPath = this.parseRequestPath(url, path);
@@ -737,7 +829,7 @@ var Server = class {
737
829
  };
738
830
  } catch (error) {
739
831
  const errorMessage = error instanceof Error ? error.message : String(error);
740
- this.logError("handleOrderSalesDetail: 请求失败", {
832
+ this.logInfo("handleOrderSalesDetail: 请求失败", {
741
833
  lookup,
742
834
  backendPath,
743
835
  error: errorMessage
@@ -1743,6 +1835,16 @@ var Server = class {
1743
1835
  method: "post",
1744
1836
  path: "/shop/local/print-order",
1745
1837
  handler: this.handleLocalPrintOrder.bind(this)
1838
+ },
1839
+ {
1840
+ method: "post",
1841
+ path: "/shop/machinecode/batch",
1842
+ handler: this.handleMachinecodeBatchMeta.bind(this)
1843
+ },
1844
+ {
1845
+ method: "post",
1846
+ path: "/machinecode/batch",
1847
+ handler: this.handleMachinecodeBatchMeta.bind(this)
1746
1848
  }
1747
1849
  ]);
1748
1850
  this.registerPrefixRoutes([
@@ -2656,10 +2758,12 @@ var Server = class {
2656
2758
  action: "print_all",
2657
2759
  device_id: params.deviceId ?? deviceId,
2658
2760
  payload: {
2659
- type: params.receiptOnly ? "0" : "99",
2761
+ type: params.isManualPrint ? "0" : "99",
2660
2762
  data: params.receiptOnly ? {
2661
2763
  order_id: printIdentity,
2662
- small_ticket_data: (_b = (_a = params.syncedOrder) == null ? void 0 : _a.payment_info) == null ? void 0 : _b.small_ticket_data
2764
+ small_ticket_data: (_b = (_a = params.syncedOrder) == null ? void 0 : _a.payment_info) == null ? void 0 : _b.small_ticket_data,
2765
+ skip_wristband: true,
2766
+ skip_voucher: true
2663
2767
  } : {
2664
2768
  order_id: printIdentity,
2665
2769
  machine_code_print_info: (_d = (_c = params.syncedOrder) == null ? void 0 : _c.payment_info) == null ? void 0 : _d.machine_code_print_info,
@@ -2670,7 +2774,7 @@ var Server = class {
2670
2774
  idempotency_key: this.buildPrintOtherReceiptIdempotencyKey(params.syncedOrder, {
2671
2775
  receiptOnly: params.receiptOnly
2672
2776
  }),
2673
- name: "打印转发",
2777
+ name: "PRINT_V1",
2674
2778
  source: "server",
2675
2779
  source_type: "order",
2676
2780
  source_id: printIdentity
@@ -2710,7 +2814,8 @@ var Server = class {
2710
2814
  checkoutData: params.checkoutData,
2711
2815
  syncedOrder: printableOrder,
2712
2816
  response: params.response,
2713
- receiptOnly: true
2817
+ receiptOnly: true,
2818
+ isManualPrint: params.isManualPrint
2714
2819
  });
2715
2820
  return { printed: true, order: printableOrder };
2716
2821
  }
@@ -2728,6 +2833,110 @@ var Server = class {
2728
2833
  }
2729
2834
  return void 0;
2730
2835
  }
2836
+ resolveMachinecodeBatchMetadataLookup(data) {
2837
+ const candidates = [
2838
+ data == null ? void 0 : data.order_lookup,
2839
+ data == null ? void 0 : data.orderLookup,
2840
+ data == null ? void 0 : data.external_sale_number,
2841
+ data == null ? void 0 : data.externalSaleNumber,
2842
+ data == null ? void 0 : data.order_id,
2843
+ data == null ? void 0 : data.orderId,
2844
+ data == null ? void 0 : data.order_number,
2845
+ data == null ? void 0 : data.orderNumber,
2846
+ data == null ? void 0 : data.shop_order_number,
2847
+ data == null ? void 0 : data.shopOrderNumber,
2848
+ data == null ? void 0 : data.shop_full_order_number,
2849
+ data == null ? void 0 : data.shopFullOrderNumber
2850
+ ];
2851
+ return candidates.find((candidate) => candidate !== void 0 && candidate !== null && candidate !== "");
2852
+ }
2853
+ async syncMachinecodeRedeemStatusToLocalOrder(data, ids, status) {
2854
+ var _a;
2855
+ const title = "handleMachinecodeBatchMetadata";
2856
+ const lookup = this.resolveMachinecodeBatchMetadataLookup(data);
2857
+ if (lookup === void 0) {
2858
+ this.logWarning(`${title}: order lookup 缺失,跳过本地订单核销状态更新`, {
2859
+ batchSize: ids.length,
2860
+ status
2861
+ });
2862
+ return;
2863
+ }
2864
+ if (!((_a = this.order) == null ? void 0 : _a.getLocalOrderByLookup)) {
2865
+ this.logWarning(`${title}: Order 模块未注册,跳过本地订单核销状态更新`, {
2866
+ lookup,
2867
+ status
2868
+ });
2869
+ return;
2870
+ }
2871
+ const localOrder = await this.order.getLocalOrderByLookup(lookup);
2872
+ if (!localOrder) {
2873
+ this.logWarning(`${title}: 本地订单不存在,跳过核销状态更新`, {
2874
+ lookup,
2875
+ status
2876
+ });
2877
+ return;
2878
+ }
2879
+ const voucherIdSet = new Set(
2880
+ ids.filter((id) => id !== void 0 && id !== null && id !== "").map((id) => String(id))
2881
+ );
2882
+ if (voucherIdSet.size === 0) {
2883
+ this.logWarning(`${title}: voucher ids 缺失,跳过本地订单核销状态更新`, {
2884
+ lookup,
2885
+ status
2886
+ });
2887
+ return;
2888
+ }
2889
+ const vouchers = Array.isArray(localOrder.vouchers) ? localOrder.vouchers : [];
2890
+ let hasUpdatedVoucher = false;
2891
+ const nextVouchers = vouchers.map((voucher) => {
2892
+ const voucherId = voucher == null ? void 0 : voucher.voucher_id;
2893
+ if (voucherId === void 0 || voucherId === null)
2894
+ return voucher;
2895
+ if (!voucherIdSet.has(String(voucherId)))
2896
+ return voucher;
2897
+ hasUpdatedVoucher = true;
2898
+ return {
2899
+ ...voucher,
2900
+ status
2901
+ };
2902
+ });
2903
+ if (!hasUpdatedVoucher) {
2904
+ this.logWarning(`${title}: 本地订单未命中任何 voucher,跳过核销状态更新`, {
2905
+ lookup,
2906
+ voucher_ids: Array.from(voucherIdSet),
2907
+ status
2908
+ });
2909
+ return;
2910
+ }
2911
+ if (typeof this.order.overwriteExistingOrder === "function") {
2912
+ await this.order.overwriteExistingOrder({
2913
+ ...localOrder,
2914
+ vouchers: nextVouchers
2915
+ });
2916
+ this.logInfo(`${title}: 本地订单 vouchers 核销状态已更新`, {
2917
+ lookup,
2918
+ updatedCount: voucherIdSet.size,
2919
+ status
2920
+ });
2921
+ return;
2922
+ }
2923
+ if ((data == null ? void 0 : data.external_sale_number) && typeof this.order.markOrderSyncedByExternalSaleNumber === "function") {
2924
+ await this.order.markOrderSyncedByExternalSaleNumber({
2925
+ externalSaleNumber: data.external_sale_number,
2926
+ patch: { vouchers: nextVouchers }
2927
+ });
2928
+ this.logInfo(`${title}: 本地订单 vouchers 核销状态已更新`, {
2929
+ lookup,
2930
+ updatedCount: voucherIdSet.size,
2931
+ status
2932
+ });
2933
+ return;
2934
+ }
2935
+ this.logWarning(`${title}: Order 模块不支持本地订单覆盖,跳过核销状态更新`, {
2936
+ lookup,
2937
+ status
2938
+ });
2939
+ }
2731
2940
  async handleOrderCheckoutSubmit(params) {
2732
2941
  const { backendPath, data, title } = params;
2733
2942
  this.logInfo(`${title}: 开始处理`, {
@@ -2925,11 +3134,8 @@ var Server = class {
2925
3134
  );
2926
3135
  }
2927
3136
  shouldBuildSmallTicketData(order) {
2928
- var _a;
2929
3137
  if (!order || typeof order !== "object")
2930
3138
  return false;
2931
- if ((0, import_small_ticket.hasSmallTicketData)((_a = order.payment_info) == null ? void 0 : _a.small_ticket_data))
2932
- return false;
2933
3139
  return Number(order.small_ticket_data_flag ?? order.smallTicketDataFlag ?? 0) === 1;
2934
3140
  }
2935
3141
  shouldPrintSyncedOrder(params) {
@@ -15,7 +15,6 @@ export declare class OrderModule extends BaseModule implements Module {
15
15
  private syncTimer?;
16
16
  private isProcessingSyncBatch;
17
17
  private isIdlePhase;
18
- private resourceIdIndex;
19
18
  private logger;
20
19
  private storage;
21
20
  private orderSQLiteSaveQueue; /** 按 storageKey 记录最近一次 SQLite 写入来源与时间,用于去重 */
@@ -89,7 +88,6 @@ export declare class OrderModule extends BaseModule implements Module {
89
88
  * @returns 刷新后的订单列表
90
89
  */
91
90
  silentRefresh(): Promise<OrderData[]>;
92
- getOrdersByResourceId(resourceId: string | number): OrderData[];
93
91
  private normalizeOrderForMemoryList;
94
92
  /**
95
93
  * 仅覆盖本地已存在的订单;不存在则直接跳过,不落库、不 emit。
@@ -126,7 +124,6 @@ export declare class OrderModule extends BaseModule implements Module {
126
124
  private isBlankIdentityValue;
127
125
  private getOrderIdentityEntries;
128
126
  private getOrderIdentityKeys;
129
- private extractResourceIds;
130
127
  private getOrderDateKey;
131
128
  /**
132
129
  * 初始化 OrderDataSource 实例
@@ -175,6 +172,28 @@ export declare class OrderModule extends BaseModule implements Module {
175
172
  * 将增量订单合并到 store
176
173
  */
177
174
  private mergeOrdersToStore;
175
+ /**
176
+ * 在身份索引中查找与目标订单共享任一身份键的已存在订单下标。
177
+ * 返回所有命中键里最小的下标,等价于原 findOrderIndexByIdentity 的「取首个匹配」语义。
178
+ *
179
+ * @example
180
+ * const idx = this.lookupOrderIndexByIdentityKeys(identityKeyToIndex, freshIdentityKeys)
181
+ */
182
+ private lookupOrderIndexByIdentityKeys;
183
+ private isRemoteEchoMergeSource;
184
+ /**
185
+ * 将订单的全部身份键登记到索引并指向其在列表中的下标。
186
+ * 合并后订单新增的身份字段(如挂单同步后拿到 order_id)也会被登记。
187
+ *
188
+ * @example
189
+ * this.registerOrderIdentityKeys(identityKeyToIndex, mergedOrder, matchIndex)
190
+ */
191
+ private registerOrderIdentityKeys;
192
+ /**
193
+ * 合并热路径去重兜底:默认直接返回原列表(增量索引已保证无重复)。
194
+ * 仅当 ORDER_MERGE_SELF_CHECK 开启时,额外做一次全表压缩并在发现残留重复时告警。
195
+ */
196
+ private runOrderStoreSelfCheck;
178
197
  private normalizeOrderSyncMessage;
179
198
  private normalizeOrderSyncPayload;
180
199
  private uniqueOrderIds;