@pisell/pisellos 2.3.74 → 2.3.76

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 (283) hide show
  1. package/dist/core/index.js +6 -10
  2. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  3. package/dist/model/strategy/adapter/walletPass/example.js +3 -26
  4. package/dist/model/strategy/strategy-example.js +5 -19
  5. package/dist/modules/Cart/index.js +0 -3
  6. package/dist/modules/Cart/utils/cartProduct.js +0 -1
  7. package/dist/modules/Date/index.js +1 -5
  8. package/dist/modules/Discount/index.js +2 -4
  9. package/dist/modules/OpenData/index.js +0 -2
  10. package/dist/modules/Order/index.d.ts +1 -1
  11. package/dist/modules/Order/index.js +75 -91
  12. package/dist/modules/Order/types.d.ts +3 -1
  13. package/dist/modules/Payment/index.js +97 -162
  14. package/dist/modules/Rules/index.js +1 -4
  15. package/dist/modules/Schedule/index.js +0 -1
  16. package/dist/modules/Schedule/utils.js +0 -1
  17. package/dist/modules/Step/index.js +0 -1
  18. package/dist/plugins/request.js +1 -4
  19. package/dist/plugins/window.js +2 -6
  20. package/dist/server/index.js +97 -129
  21. package/dist/server/modules/menu/index.js +32 -41
  22. package/dist/server/modules/order/index.js +2 -4
  23. package/dist/server/modules/products/index.js +24 -42
  24. package/dist/server/modules/quotation/index.js +29 -38
  25. package/dist/server/modules/resource/index.js +3 -4
  26. package/dist/server/modules/schedule/index.js +27 -35
  27. package/dist/server/utils/product.js +0 -1
  28. package/dist/solution/BaseSales/index.js +100 -72
  29. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +5 -0
  30. package/dist/solution/BaseSales/utils/cartPromotion.js +15 -6
  31. package/dist/solution/BookingByStep/index.js +7 -59
  32. package/dist/solution/BookingByStep/utils/capacity.js +1 -11
  33. package/dist/solution/BookingByStep/utils/resources.js +1 -3
  34. package/dist/solution/BookingByStep/utils/timeslots.js +2 -43
  35. package/dist/solution/BookingTicket/index.js +0 -2
  36. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +6 -7
  37. package/dist/solution/BookingTicket/utils/scan/handleScan.js +25 -31
  38. package/dist/solution/BookingTicket/utils/scan/index.js +6 -10
  39. package/dist/solution/BuyTickets/index.js +9 -12
  40. package/dist/solution/Checkout/index.js +177 -252
  41. package/dist/solution/Checkout/utils/index.js +4 -16
  42. package/dist/solution/RegisterAndLogin/index.js +30 -76
  43. package/dist/solution/ScanOrder/index.js +50 -60
  44. package/dist/solution/ShopDiscount/index.js +2 -7
  45. package/dist/solution/VenueBooking/index.js +45 -55
  46. package/dist/utils/task.js +15 -18
  47. package/dist/utils/watch.js +0 -1
  48. package/lib/apis/picoding.js +2 -0
  49. package/lib/core/index.js +134 -134
  50. package/lib/effects/index.js +46 -57
  51. package/lib/index.js +82 -49
  52. package/lib/model/index.js +14 -21
  53. package/lib/model/strategy/adapter/dataVariant/adapter.js +38 -50
  54. package/lib/model/strategy/adapter/dataVariant/evaluator.js +162 -236
  55. package/lib/model/strategy/adapter/dataVariant/examples.js +229 -237
  56. package/lib/model/strategy/adapter/dataVariant/index.js +39 -34
  57. package/lib/model/strategy/adapter/dataVariant/type.js +57 -28
  58. package/lib/model/strategy/adapter/index.js +100 -64
  59. package/lib/model/strategy/adapter/itemRule/adapter.js +156 -144
  60. package/lib/model/strategy/adapter/itemRule/evaluator.js +36 -48
  61. package/lib/model/strategy/adapter/itemRule/examples.js +295 -225
  62. package/lib/model/strategy/adapter/itemRule/index.js +83 -57
  63. package/lib/model/strategy/adapter/itemRule/type.js +97 -36
  64. package/lib/model/strategy/adapter/promotion/adapter.js +91 -69
  65. package/lib/model/strategy/adapter/promotion/evaluator.js +444 -310
  66. package/lib/model/strategy/adapter/promotion/examples.js +222 -234
  67. package/lib/model/strategy/adapter/promotion/index.js +1 -0
  68. package/lib/model/strategy/adapter/promotion/type.js +243 -36
  69. package/lib/model/strategy/adapter/type.js +4 -16
  70. package/lib/model/strategy/adapter/walletPass/evaluator.js +180 -150
  71. package/lib/model/strategy/adapter/walletPass/example.js +217 -190
  72. package/lib/model/strategy/adapter/walletPass/index.js +75 -51
  73. package/lib/model/strategy/adapter/walletPass/locales.js +36 -58
  74. package/lib/model/strategy/adapter/walletPass/type.js +4 -16
  75. package/lib/model/strategy/adapter/walletPass/utils.js +588 -378
  76. package/lib/model/strategy/engine.js +270 -168
  77. package/lib/model/strategy/index.js +49 -34
  78. package/lib/model/strategy/strategy-example.js +243 -239
  79. package/lib/model/strategy/type.js +100 -40
  80. package/lib/modules/Account/index.js +39 -53
  81. package/lib/modules/Account/types.js +20 -33
  82. package/lib/modules/AccountList/index.js +116 -154
  83. package/lib/modules/AccountList/types.js +30 -31
  84. package/lib/modules/AccountList/utils.js +18 -30
  85. package/lib/modules/BaseModule.js +23 -42
  86. package/lib/modules/BookingContext/index.js +158 -136
  87. package/lib/modules/BookingContext/types.js +46 -32
  88. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +138 -146
  89. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +78 -83
  90. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +170 -150
  91. package/lib/modules/BookingContext/utils/flexible.js +38 -55
  92. package/lib/modules/BookingContext/utils/formatResourceList.js +19 -34
  93. package/lib/modules/BookingContext/utils/index.js +124 -41
  94. package/lib/modules/BookingContext/utils/noResource.js +58 -70
  95. package/lib/modules/BookingContext/utils/orderLineDisplay.js +14 -41
  96. package/lib/modules/BookingContext/utils/productExtend.js +202 -155
  97. package/lib/modules/BookingContext/utils/resourceErrors.js +53 -53
  98. package/lib/modules/BookingContext/utils/resourceSelection.js +19 -41
  99. package/lib/modules/BookingContext/utils/resources.js +209 -167
  100. package/lib/modules/BookingContext/utils/serviceTimes.js +115 -116
  101. package/lib/modules/BookingContext/utils/timeSlices.js +76 -86
  102. package/lib/modules/Cart/index.js +170 -124
  103. package/lib/modules/Cart/types.js +46 -51
  104. package/lib/modules/Cart/utils/cartAccount.js +40 -39
  105. package/lib/modules/Cart/utils/cartDate.js +56 -61
  106. package/lib/modules/Cart/utils/cartDiscount.js +28 -33
  107. package/lib/modules/Cart/utils/cartNote.js +27 -32
  108. package/lib/modules/Cart/utils/cartProduct.js +321 -251
  109. package/lib/modules/Cart/utils/cartRelationForms.js +29 -35
  110. package/lib/modules/Cart/utils/cartResource.js +70 -78
  111. package/lib/modules/Cart/utils/changePrice.js +22 -50
  112. package/lib/modules/Cart/utils/index.js +106 -48
  113. package/lib/modules/Customer/constants.js +13 -34
  114. package/lib/modules/Customer/index.js +235 -172
  115. package/lib/modules/Customer/types.js +38 -35
  116. package/lib/modules/Date/index.js +116 -115
  117. package/lib/modules/Date/types.js +16 -28
  118. package/lib/modules/Date/utils.js +174 -123
  119. package/lib/modules/Discount/index.js +122 -127
  120. package/lib/modules/Discount/types.js +9 -31
  121. package/lib/modules/Guests/index.js +30 -56
  122. package/lib/modules/Guests/types.js +23 -33
  123. package/lib/modules/Holder/index.js +209 -189
  124. package/lib/modules/Holder/types.js +4 -16
  125. package/lib/modules/Holder/utils.js +20 -49
  126. package/lib/modules/OpenData/index.js +70 -76
  127. package/lib/modules/OpenData/types.js +4 -16
  128. package/lib/modules/OpenData/utils.js +44 -78
  129. package/lib/modules/Order/index.d.ts +1 -1
  130. package/lib/modules/Order/index.js +1733 -2121
  131. package/lib/modules/Order/payment-utils.js +77 -120
  132. package/lib/modules/Order/types.d.ts +3 -1
  133. package/lib/modules/Order/types.js +88 -35
  134. package/lib/modules/Order/utils/bundleDiscountHydration.js +41 -74
  135. package/lib/modules/Order/utils/discountProductLineIdentity.js +142 -100
  136. package/lib/modules/Order/utils/manualProductDiscount.js +124 -123
  137. package/lib/modules/Order/utils/orderCollectionIdentity.js +184 -244
  138. package/lib/modules/Order/utils.js +814 -647
  139. package/lib/modules/Payment/cash.js +20 -33
  140. package/lib/modules/Payment/cashRecommendationAlgorithm.js +145 -76
  141. package/lib/modules/Payment/eftpos.js +16 -30
  142. package/lib/modules/Payment/index.js +532 -399
  143. package/lib/modules/Payment/mx51.js +1 -0
  144. package/lib/modules/Payment/types.js +230 -108
  145. package/lib/modules/Payment/utils.js +52 -51
  146. package/lib/modules/Payment/walletpass.js +485 -660
  147. package/lib/modules/Product/index.js +51 -46
  148. package/lib/modules/Product/types.js +4 -16
  149. package/lib/modules/Product/utils.js +32 -33
  150. package/lib/modules/ProductList/index.js +113 -123
  151. package/lib/modules/ProductList/types.js +9 -31
  152. package/lib/modules/Quotation/index.js +81 -118
  153. package/lib/modules/Quotation/types.js +4 -16
  154. package/lib/modules/Resource/index.js +27 -59
  155. package/lib/modules/Resource/types.js +22 -32
  156. package/lib/modules/Resource/utils.js +30 -38
  157. package/lib/modules/ResourcePlanner/index.js +25 -23
  158. package/lib/modules/ResourcePlanner/localClock.js +54 -119
  159. package/lib/modules/ResourcePlanner/planner.js +589 -770
  160. package/lib/modules/ResourcePlanner/types.js +10 -29
  161. package/lib/modules/Rules/index.js +1218 -959
  162. package/lib/modules/Rules/types.js +17 -40
  163. package/lib/modules/SalesSummary/index.js +85 -90
  164. package/lib/modules/SalesSummary/types.js +4 -16
  165. package/lib/modules/SalesSummary/utils.js +355 -430
  166. package/lib/modules/ScanOrderLogger/index.js +59 -79
  167. package/lib/modules/ScanOrderLogger/providers/feishu.js +54 -78
  168. package/lib/modules/ScanOrderLogger/providers/grafana.js +13 -36
  169. package/lib/modules/ScanOrderLogger/types.js +4 -16
  170. package/lib/modules/Schedule/getDateIsInSchedule.js +334 -163
  171. package/lib/modules/Schedule/index.js +100 -114
  172. package/lib/modules/Schedule/type.js +4 -16
  173. package/lib/modules/Schedule/types.js +4 -16
  174. package/lib/modules/Schedule/utils.js +433 -291
  175. package/lib/modules/Step/index.js +40 -52
  176. package/lib/modules/Step/tyeps.js +4 -16
  177. package/lib/modules/Summary/index.js +66 -71
  178. package/lib/modules/Summary/types.js +4 -16
  179. package/lib/modules/Summary/utils.js +773 -418
  180. package/lib/modules/SurchargeList/index.js +46 -60
  181. package/lib/modules/SurchargeList/types.js +4 -16
  182. package/lib/modules/index.js +245 -63
  183. package/lib/plugins/app.js +4 -16
  184. package/lib/plugins/index.js +36 -25
  185. package/lib/plugins/request.js +137 -126
  186. package/lib/plugins/shopStore.js +4 -16
  187. package/lib/plugins/user.js +4 -16
  188. package/lib/plugins/window.js +171 -179
  189. package/lib/server/index.js +3050 -2665
  190. package/lib/server/modules/floor-plan/index.js +118 -134
  191. package/lib/server/modules/floor-plan/types.js +15 -30
  192. package/lib/server/modules/index.js +106 -68
  193. package/lib/server/modules/menu/index.js +142 -122
  194. package/lib/server/modules/menu/types.js +18 -31
  195. package/lib/server/modules/order/index.js +784 -1002
  196. package/lib/server/modules/order/types.js +122 -33
  197. package/lib/server/modules/order/utils/filterBookings.js +219 -194
  198. package/lib/server/modules/order/utils/filterOrders.js +118 -92
  199. package/lib/server/modules/payment/index.js +59 -83
  200. package/lib/server/modules/payment/types.js +4 -16
  201. package/lib/server/modules/products/index.js +583 -471
  202. package/lib/server/modules/products/types.js +44 -34
  203. package/lib/server/modules/quotation/index.js +137 -172
  204. package/lib/server/modules/quotation/types.js +21 -31
  205. package/lib/server/modules/resource/index.js +220 -186
  206. package/lib/server/modules/resource/types.js +42 -33
  207. package/lib/server/modules/schedule/index.js +135 -123
  208. package/lib/server/modules/schedule/types.js +14 -21
  209. package/lib/server/modules/schedule/utils.js +334 -163
  210. package/lib/server/types.js +4 -16
  211. package/lib/server/utils/index.js +25 -23
  212. package/lib/server/utils/product.js +196 -139
  213. package/lib/server/utils/schedule.js +34 -41
  214. package/lib/server/utils/small-ticket.js +479 -456
  215. package/lib/server/utils/time.js +40 -49
  216. package/lib/solution/BaseSales/index.js +1220 -1412
  217. package/lib/solution/BaseSales/types.js +42 -38
  218. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +5 -0
  219. package/lib/solution/BaseSales/utils/cartPromotion.js +652 -498
  220. package/lib/solution/BaseSales/utils/parseSalesResponse.js +85 -105
  221. package/lib/solution/BaseSales/utils/quotationPrice.js +56 -114
  222. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +108 -145
  223. package/lib/solution/BaseSales/utils.js +158 -143
  224. package/lib/solution/BookingByStep/index.js +1527 -1340
  225. package/lib/solution/BookingByStep/types.js +40 -99
  226. package/lib/solution/BookingByStep/utils/capacity.js +192 -160
  227. package/lib/solution/BookingByStep/utils/products.js +42 -52
  228. package/lib/solution/BookingByStep/utils/resources.js +527 -330
  229. package/lib/solution/BookingByStep/utils/stock.js +65 -44
  230. package/lib/solution/BookingByStep/utils/timeslots.js +129 -131
  231. package/lib/solution/BookingTicket/index.js +607 -522
  232. package/lib/solution/BookingTicket/types.js +99 -77
  233. package/lib/solution/BookingTicket/utils/addProductDecision.js +226 -189
  234. package/lib/solution/BookingTicket/utils/addTimeAvailability.js +58 -89
  235. package/lib/solution/BookingTicket/utils/bookingStatus.js +107 -78
  236. package/lib/solution/BookingTicket/utils/cartView.js +114 -99
  237. package/lib/solution/BookingTicket/utils/exampleData.js +185 -0
  238. package/lib/solution/BookingTicket/utils/orderCustomer.js +18 -41
  239. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +219 -86
  240. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +168 -116
  241. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +79 -91
  242. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +54 -41
  243. package/lib/solution/BookingTicket/utils/scan/handleScan.js +84 -81
  244. package/lib/solution/BookingTicket/utils/scan/index.js +98 -104
  245. package/lib/solution/BookingTicket/utils/scan/scanCache.js +90 -43
  246. package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +52 -64
  247. package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +56 -58
  248. package/lib/solution/BookingTicket/utils/weighingProductSku.js +34 -48
  249. package/lib/solution/BuyTickets/index.js +67 -70
  250. package/lib/solution/BuyTickets/types.js +22 -38
  251. package/lib/solution/Checkout/index.js +1451 -1158
  252. package/lib/solution/Checkout/types.js +91 -61
  253. package/lib/solution/Checkout/utils/index.js +228 -156
  254. package/lib/solution/PlaceOrder/index.js +55 -0
  255. package/lib/solution/RegisterAndLogin/config.js +493 -460
  256. package/lib/solution/RegisterAndLogin/index.js +633 -630
  257. package/lib/solution/RegisterAndLogin/types.js +189 -76
  258. package/lib/solution/RegisterAndLogin/utils.js +183 -125
  259. package/lib/solution/Sales/index.js +328 -324
  260. package/lib/solution/Sales/types.js +27 -33
  261. package/lib/solution/ScanOrder/index.js +832 -864
  262. package/lib/solution/ScanOrder/types.js +33 -34
  263. package/lib/solution/ScanOrder/utils.js +409 -374
  264. package/lib/solution/ShopDiscount/index.js +226 -232
  265. package/lib/solution/ShopDiscount/types.js +15 -37
  266. package/lib/solution/ShopDiscount/utils.js +300 -172
  267. package/lib/solution/UnifiedBookingSales/index.js +1035 -1201
  268. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +99 -159
  269. package/lib/solution/UnifiedBookingSales/types.js +10 -32
  270. package/lib/solution/VenueBooking/index.js +811 -879
  271. package/lib/solution/VenueBooking/types.js +19 -39
  272. package/lib/solution/VenueBooking/utils/dateSummary.js +27 -56
  273. package/lib/solution/VenueBooking/utils/resource.js +31 -54
  274. package/lib/solution/VenueBooking/utils/slotMerge.js +94 -107
  275. package/lib/solution/VenueBooking/utils/timeSlot.js +132 -132
  276. package/lib/solution/VenueBooking/utils.js +130 -67
  277. package/lib/solution/index.js +124 -41
  278. package/lib/store/createStore.js +32 -29
  279. package/lib/types/index.js +4 -16
  280. package/lib/utils/payment-number.js +26 -46
  281. package/lib/utils/task.js +36 -36
  282. package/lib/utils/watch.js +81 -47
  283. package/package.json +2 -1
@@ -207,9 +207,8 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
207
207
  // // 预连接数据库
208
208
  // this.dbManager.connect()
209
209
 
210
- console.log('[PaymentModule] 初始化完成');
211
210
  this.logInfo('PaymentModule initialized successfully');
212
- case 16:
211
+ case 15:
213
212
  case "end":
214
213
  return _context.stop();
215
214
  }
@@ -341,7 +340,6 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
341
340
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
342
341
  while (1) switch (_context2.prev = _context2.next) {
343
342
  case 0:
344
- console.log('网络状态:', status.connected);
345
343
  _this3.logInfo('Network status changed', {
346
344
  connected: status.connected,
347
345
  previousStatus: status.previousStatus
@@ -350,7 +348,7 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
350
348
  _this3.logInfo('Network reconnected');
351
349
  // 网络恢复时的处理逻辑可以在这里添加
352
350
  }
353
- case 3:
351
+ case 2:
354
352
  case "end":
355
353
  return _context2.stop();
356
354
  }
@@ -627,7 +625,7 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
627
625
  case 3:
628
626
  order = _context7.sent;
629
627
  if (!order) {
630
- _context7.next = 10;
628
+ _context7.next = 9;
631
629
  break;
632
630
  }
633
631
  _context7.next = 7;
@@ -636,20 +634,18 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
636
634
  _context7.next = 9;
637
635
  return this.core.effects.emit("".concat(this.name, ":onOrderDeleted"), order);
638
636
  case 9:
639
- console.log('[PaymentModule] 支付订单删除成功:', orderUuid);
640
- case 10:
641
- _context7.next = 16;
637
+ _context7.next = 15;
642
638
  break;
643
- case 12:
644
- _context7.prev = 12;
639
+ case 11:
640
+ _context7.prev = 11;
645
641
  _context7.t0 = _context7["catch"](0);
646
642
  console.error('[PaymentModule] 删除支付订单失败', _context7.t0);
647
643
  throw _context7.t0;
648
- case 16:
644
+ case 15:
649
645
  case "end":
650
646
  return _context7.stop();
651
647
  }
652
- }, _callee7, this, [[0, 12]]);
648
+ }, _callee7, this, [[0, 11]]);
653
649
  }));
654
650
  function deletePaymentOrderAsync(_x6) {
655
651
  return _deletePaymentOrderAsync.apply(this, arguments);
@@ -799,10 +795,9 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
799
795
  originalOrderId: originalOrderId,
800
796
  newOrderId: newOrderId
801
797
  });
802
- console.log("[PaymentModule] \u8BA2\u5355ID\u66FF\u6362\u6210\u529F: ".concat(originalOrderId, " \u2192 ").concat(newOrderId));
803
798
  return _context9.abrupt("return", updatedOrder);
804
- case 28:
805
- _context9.prev = 28;
799
+ case 27:
800
+ _context9.prev = 27;
806
801
  _context9.t0 = _context9["catch"](1);
807
802
  console.error('[PaymentModule] 替换订单ID失败', _context9.t0);
808
803
  this.logError('replaceOrderIdByUuidAsync failed', _context9.t0, {
@@ -810,11 +805,11 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
810
805
  newOrderId: newOrderId
811
806
  });
812
807
  throw _context9.t0;
813
- case 33:
808
+ case 32:
814
809
  case "end":
815
810
  return _context9.stop();
816
811
  }
817
- }, _callee9, this, [[1, 28]]);
812
+ }, _callee9, this, [[1, 27]]);
818
813
  }));
819
814
  function replaceOrderIdByUuidAsync(_x9, _x10) {
820
815
  return _replaceOrderIdByUuidAsync.apply(this, arguments);
@@ -1105,42 +1100,36 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
1105
1100
  paymentItem.origin_amount = paymentItem.amount; // 保存原始金额
1106
1101
  paymentItem.amount = '0.00'; // 将金额设为0,不参与订单金额计算
1107
1102
 
1108
- console.log("[PaymentModule] \u652F\u4ED8\u9879\u6807\u8BB0\u4E3A\u5220\u9664:", {
1109
- uuid: paymentItem.uuid,
1110
- originalAmount: paymentItem.origin_amount,
1111
- status: paymentItem.status
1112
- });
1113
-
1114
1103
  // 重新计算待付金额
1115
1104
  this.recalculateOrderAmount(order);
1116
1105
 
1117
1106
  // 更新到 IndexDB
1118
- _context13.next = 20;
1107
+ _context13.next = 19;
1119
1108
  return this.dbManager.update('order', order);
1120
- case 20:
1121
- _context13.next = 22;
1109
+ case 19:
1110
+ _context13.next = 21;
1122
1111
  return this.core.effects.emit("".concat(this.name, ":onPaymentDeleted"), {
1123
1112
  order: order,
1124
1113
  paymentItem: paymentItem
1125
1114
  });
1126
- case 22:
1127
- _context13.next = 24;
1115
+ case 21:
1116
+ _context13.next = 23;
1128
1117
  return this.core.effects.emit("".concat(this.name, ":onOrderChanged"), {
1129
1118
  action: 'payment_delete',
1130
1119
  order: order,
1131
1120
  paymentItem: paymentItem
1132
1121
  });
1133
- case 24:
1122
+ case 23:
1134
1123
  this.logInfo('deletePaymentAsync completed successfully (marked as voided)', {
1135
1124
  orderUuid: orderUuid,
1136
1125
  paymentUuid: paymentUuid,
1137
1126
  originalAmount: paymentItem.origin_amount,
1138
1127
  newExpectAmount: order.expect_amount
1139
1128
  });
1140
- _context13.next = 32;
1129
+ _context13.next = 31;
1141
1130
  break;
1142
- case 27:
1143
- _context13.prev = 27;
1131
+ case 26:
1132
+ _context13.prev = 26;
1144
1133
  _context13.t0 = _context13["catch"](1);
1145
1134
  console.error('[PaymentModule] 删除支付项失败', _context13.t0);
1146
1135
  this.logError('deletePaymentAsync failed', _context13.t0, {
@@ -1148,11 +1137,11 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
1148
1137
  paymentUuid: paymentUuid
1149
1138
  });
1150
1139
  throw _context13.t0;
1151
- case 32:
1140
+ case 31:
1152
1141
  case "end":
1153
1142
  return _context13.stop();
1154
1143
  }
1155
- }, _callee13, this, [[1, 27]]);
1144
+ }, _callee13, this, [[1, 26]]);
1156
1145
  }));
1157
1146
  function deletePaymentAsync(_x15, _x16) {
1158
1147
  return _deletePaymentAsync.apply(this, arguments);
@@ -1216,80 +1205,61 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
1216
1205
  existingVoucherItems = order.payment.filter(function (payment) {
1217
1206
  return payment.voucher_id && payment.status !== 'voided' && !payment.isSynced;
1218
1207
  });
1219
- console.log('[PaymentModule] 发现现有代金券支付项:', {
1220
- orderUuid: orderUuid,
1221
- existingVoucherCount: existingVoucherItems.length,
1222
- existingItems: existingVoucherItems.map(function (item) {
1223
- return {
1224
- uuid: item.uuid,
1225
- code: item.code,
1226
- amount: item.amount,
1227
- voucher_id: item.voucher_id,
1228
- isSynced: item.isSynced
1229
- };
1230
- })
1231
- });
1232
-
1233
1208
  // 2. 删除所有现有的代金券支付项(仅删除未同步的)
1234
1209
  _iterator2 = _createForOfIteratorHelper(existingVoucherItems);
1235
- _context14.prev = 12;
1210
+ _context14.prev = 11;
1236
1211
  _iterator2.s();
1237
- case 14:
1212
+ case 13:
1238
1213
  if ((_step2 = _iterator2.n()).done) {
1239
- _context14.next = 21;
1214
+ _context14.next = 19;
1240
1215
  break;
1241
1216
  }
1242
1217
  voucherItem = _step2.value;
1243
- console.log("[PaymentModule] \u5220\u9664\u73B0\u6709\u4EE3\u91D1\u5238\u652F\u4ED8\u9879: ".concat(voucherItem.uuid));
1244
- _context14.next = 19;
1218
+ _context14.next = 17;
1245
1219
  return _this6.deletePaymentAsync(orderUuid, voucherItem.uuid);
1220
+ case 17:
1221
+ _context14.next = 13;
1222
+ break;
1246
1223
  case 19:
1247
- _context14.next = 14;
1224
+ _context14.next = 24;
1248
1225
  break;
1249
1226
  case 21:
1250
- _context14.next = 26;
1251
- break;
1252
- case 23:
1253
- _context14.prev = 23;
1254
- _context14.t0 = _context14["catch"](12);
1227
+ _context14.prev = 21;
1228
+ _context14.t0 = _context14["catch"](11);
1255
1229
  _iterator2.e(_context14.t0);
1256
- case 26:
1257
- _context14.prev = 26;
1230
+ case 24:
1231
+ _context14.prev = 24;
1258
1232
  _iterator2.f();
1259
- return _context14.finish(26);
1260
- case 29:
1261
- _context14.next = 31;
1233
+ return _context14.finish(24);
1234
+ case 27:
1235
+ _context14.next = 29;
1262
1236
  return _this6.getPaymentOrderByUuidAsync(orderUuid);
1263
- case 31:
1237
+ case 29:
1264
1238
  orderAfterDelete = _context14.sent;
1265
1239
  if (orderAfterDelete) {
1266
- _context14.next = 34;
1240
+ _context14.next = 32;
1267
1241
  break;
1268
1242
  }
1269
1243
  throw new Error("\u8BA2\u5355\u4E0D\u5B58\u5728: ".concat(orderUuid));
1270
- case 34:
1244
+ case 32:
1271
1245
  existingActiveVoucherKeys = new Set(orderAfterDelete.payment.filter(function (p) {
1272
1246
  return p.voucher_id && p.status !== 'voided' && !p.isSynced;
1273
1247
  }).map(function (p) {
1274
1248
  return "".concat(p.voucher_id, "|").concat(p.order_payment_type || 'normal');
1275
1249
  }));
1276
- console.log('[PaymentModule] 添加新的代金券支付项:', {
1277
- orderUuid: orderUuid,
1278
- newItemCount: normalizedVoucherItems.length
1279
- });
1280
1250
  _iterator3 = _createForOfIteratorHelper(normalizedVoucherItems);
1281
- _context14.prev = 37;
1251
+ _context14.prev = 34;
1282
1252
  _iterator3.s();
1283
- case 39:
1253
+ case 36:
1284
1254
  if ((_step3 = _iterator3.n()).done) {
1285
- _context14.next = 52;
1255
+ _context14.next = 48;
1286
1256
  break;
1287
1257
  }
1288
1258
  _voucherItem = _step3.value;
1289
1259
  orderPaymentType = _voucherItem.order_payment_type || 'normal';
1290
1260
  key = "".concat(_voucherItem.voucher_id, "|").concat(orderPaymentType);
1291
1261
  if (!existingActiveVoucherKeys.has(key)) {
1292
- _context14.next = 46;
1262
+ _context14.next = 43;
1293
1263
  break;
1294
1264
  }
1295
1265
  console.warn('[PaymentModule] Skip adding voucher payment item because it already exists (active)', {
@@ -1297,54 +1267,48 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
1297
1267
  voucher_id: _voucherItem.voucher_id,
1298
1268
  order_payment_type: orderPaymentType
1299
1269
  });
1300
- return _context14.abrupt("continue", 50);
1301
- case 46:
1302
- console.log("[PaymentModule] \u6DFB\u52A0\u4EE3\u91D1\u5238\u652F\u4ED8\u9879:", _objectSpread(_objectSpread({}, _voucherItem), {}, {
1303
- code: _voucherItem.code,
1304
- amount: _voucherItem.amount,
1305
- voucher_id: _voucherItem.voucher_id,
1306
- order_payment_type: orderPaymentType
1307
- }));
1308
- _context14.next = 49;
1270
+ return _context14.abrupt("continue", 46);
1271
+ case 43:
1272
+ _context14.next = 45;
1309
1273
  return _this6.addPaymentItemAsync(orderUuid, _voucherItem);
1310
- case 49:
1274
+ case 45:
1311
1275
  existingActiveVoucherKeys.add(key);
1312
- case 50:
1313
- _context14.next = 39;
1276
+ case 46:
1277
+ _context14.next = 36;
1314
1278
  break;
1315
- case 52:
1316
- _context14.next = 57;
1279
+ case 48:
1280
+ _context14.next = 53;
1317
1281
  break;
1318
- case 54:
1319
- _context14.prev = 54;
1320
- _context14.t1 = _context14["catch"](37);
1282
+ case 50:
1283
+ _context14.prev = 50;
1284
+ _context14.t1 = _context14["catch"](34);
1321
1285
  _iterator3.e(_context14.t1);
1322
- case 57:
1323
- _context14.prev = 57;
1286
+ case 53:
1287
+ _context14.prev = 53;
1324
1288
  _iterator3.f();
1325
- return _context14.finish(57);
1326
- case 60:
1327
- _context14.next = 62;
1289
+ return _context14.finish(53);
1290
+ case 56:
1291
+ _context14.next = 58;
1328
1292
  return _this6.getPaymentOrderByUuidAsync(orderUuid);
1329
- case 62:
1293
+ case 58:
1330
1294
  updatedOrder = _context14.sent;
1331
- _context14.next = 65;
1295
+ _context14.next = 61;
1332
1296
  return _this6.core.effects.emit("".concat(_this6.name, ":onPaymentAdded"), {
1333
1297
  orderUuid: orderUuid,
1334
1298
  order: updatedOrder,
1335
1299
  payment: null // 批量操作不提供单个支付项
1336
1300
  });
1337
- case 65:
1301
+ case 61:
1338
1302
  _this6.logInfo('updateVoucherPaymentItemsAsync completed successfully', {
1339
1303
  orderUuid: orderUuid,
1340
1304
  removedVoucherCount: existingVoucherItems.length,
1341
1305
  addedVoucherCount: normalizedVoucherItems.length,
1342
1306
  finalExpectAmount: updatedOrder === null || updatedOrder === void 0 ? void 0 : updatedOrder.expect_amount
1343
1307
  });
1344
- _context14.next = 73;
1308
+ _context14.next = 69;
1345
1309
  break;
1346
- case 68:
1347
- _context14.prev = 68;
1310
+ case 64:
1311
+ _context14.prev = 64;
1348
1312
  _context14.t2 = _context14["catch"](3);
1349
1313
  console.error('[PaymentModule] 批量更新代金券支付项失败:', _context14.t2);
1350
1314
  _this6.logError('updateVoucherPaymentItemsAsync failed', _context14.t2, {
@@ -1352,11 +1316,11 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
1352
1316
  voucherPaymentItems: voucherPaymentItems
1353
1317
  });
1354
1318
  throw _context14.t2;
1355
- case 73:
1319
+ case 69:
1356
1320
  case "end":
1357
1321
  return _context14.stop();
1358
1322
  }
1359
- }, _callee14, null, [[3, 68], [12, 23, 26, 29], [37, 54, 57, 60]]);
1323
+ }, _callee14, null, [[3, 64], [11, 21, 24, 27], [34, 50, 53, 56]]);
1360
1324
  }))));
1361
1325
  case 1:
1362
1326
  case "end":
@@ -1577,11 +1541,9 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
1577
1541
  if (totalPaidAmount.gte(orderTotalAmount)) {
1578
1542
  // 支付金额足够,标记为已完成
1579
1543
  order.payment_status = PaymentStatus.Finished;
1580
- console.log("[PaymentModule] \u8BA2\u5355 ".concat(order.uuid, " \u652F\u4ED8\u5B8C\u6210\uFF0C\u91D1\u989D: ").concat(totalPaidAmount.toString(), "/").concat(orderTotalAmount.toString()));
1581
1544
  } else {
1582
1545
  // 支付金额不足,标记为部分支付
1583
1546
  order.payment_status = PaymentStatus.PartiallyPaid;
1584
- console.log("[PaymentModule] \u8BA2\u5355 ".concat(order.uuid, " \u90E8\u5206\u652F\u4ED8\uFF0C\u91D1\u989D: ").concat(totalPaidAmount.toString(), "/").concat(orderTotalAmount.toString()));
1585
1547
  }
1586
1548
 
1587
1549
  // 给后端标记一下是全部支付(paid)还是部分支付
@@ -1592,37 +1554,36 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
1592
1554
  return this.dbManager.update('order', order);
1593
1555
  case 8:
1594
1556
  if (!(paymentData.payments.length === 0)) {
1595
- _context18.next = 12;
1557
+ _context18.next = 11;
1596
1558
  break;
1597
1559
  }
1598
- console.log("[PaymentModule] \u8BA2\u5355 ".concat(order.uuid, " \u652F\u4ED8\u5217\u8868\u4E3A\u7A7A\uFF0C\u8DF3\u8FC7\u652F\u4ED8\u5904\u7406"));
1599
1560
  this.logWarning('Empty payment list', {
1600
1561
  orderUuid: order.uuid,
1601
1562
  orderId: order.order_id
1602
1563
  });
1603
1564
  return _context18.abrupt("return");
1604
- case 12:
1605
- _context18.next = 14;
1565
+ case 11:
1566
+ _context18.next = 13;
1606
1567
  return this.core.effects.emit("".concat(this.name, ":onPaymentSubmitted"), order);
1607
- case 14:
1608
- _context18.next = 16;
1568
+ case 13:
1569
+ _context18.next = 15;
1609
1570
  return this.core.effects.emit("".concat(this.name, ":onOrderChanged"), {
1610
1571
  action: 'submit',
1611
1572
  order: order
1612
1573
  });
1613
- case 16:
1614
- _context18.next = 22;
1574
+ case 15:
1575
+ _context18.next = 21;
1615
1576
  break;
1616
- case 18:
1617
- _context18.prev = 18;
1577
+ case 17:
1578
+ _context18.prev = 17;
1618
1579
  _context18.t0 = _context18["catch"](0);
1619
1580
  console.error("[PaymentModule] \u8BA2\u5355 ".concat(order.uuid, " \u652F\u4ED8\u63D0\u4EA4\u5931\u8D25"), _context18.t0);
1620
1581
  throw _context18.t0;
1621
- case 22:
1582
+ case 21:
1622
1583
  case "end":
1623
1584
  return _context18.stop();
1624
1585
  }
1625
- }, _callee18, this, [[0, 18]]);
1586
+ }, _callee18, this, [[0, 17]]);
1626
1587
  }));
1627
1588
  function submitSingleOrderPayment(_x23) {
1628
1589
  return _submitSingleOrderPayment.apply(this, arguments);
@@ -1764,29 +1725,6 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
1764
1725
  // 如果是定金模式,则使用deposit_amount 去减已付款金额
1765
1726
  var remainingAmount = order.is_deposit === 1 ? new Decimal(order.deposit_amount).minus(paidAmount) : totalAmount.minus(paidAmount);
1766
1727
  order.expect_amount = Decimal.max(0, remainingAmount).toFixed(2);
1767
- console.log("[PaymentModule] \u91CD\u65B0\u8BA1\u7B97\u8BA2\u5355\u91D1\u989D:", {
1768
- orderUuid: order.uuid,
1769
- totalAmount: order.total_amount,
1770
- effectivePaidAmount: paidAmount.toFixed(2),
1771
- remainingAmount: order.expect_amount,
1772
- activePayments: order.payment.filter(function (p) {
1773
- return p.status !== 'voided';
1774
- }).length,
1775
- voidedPayments: order.payment.filter(function (p) {
1776
- return p.status === 'voided';
1777
- }).length,
1778
- paymentDetails: order.payment.filter(function (p) {
1779
- return p.status !== 'voided';
1780
- }).map(function (p) {
1781
- return {
1782
- code: p.code,
1783
- amount: p.amount,
1784
- rounding_amount: p.rounding_amount || '0.00',
1785
- effective_amount: new Decimal(p.amount || 0).minus(new Decimal(p.rounding_amount || 0)).toFixed(2)
1786
- };
1787
- }),
1788
- 说明: '有效支付金额包含抹零计算(amount + |rounding_amount|)'
1789
- });
1790
1728
  }
1791
1729
 
1792
1730
  /**
@@ -2017,62 +1955,59 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
2017
1955
 
2018
1956
  // 计算基础值:x / interval
2019
1957
  baseValue = amount.div(roundingInterval);
2020
- console.log("[PaymentModule] \u820D\u5165\u8BA1\u7B97 - \u539F\u59CB\u91D1\u989D: ".concat(amount.toString(), ", \u95F4\u9694: ").concat(intervalValue, ", \u57FA\u7840\u503C: ").concat(baseValue.toString(), ", \u89C4\u5219: ").concat(rule));
2021
1958
  _context26.t0 = rule;
2022
- _context26.next = _context26.t0 === RoundingRule.Standard ? 13 : _context26.t0 === 'standard' ? 13 : _context26.t0 === RoundingRule.StandardDown ? 15 : _context26.t0 === 'standard_rounding_midpoint_down' ? 15 : _context26.t0 === RoundingRule.AlwaysUp ? 17 : _context26.t0 === 'always_up' ? 17 : _context26.t0 === RoundingRule.AlwaysDown ? 19 : _context26.t0 === 'always_down' ? 19 : 21;
1959
+ _context26.next = _context26.t0 === RoundingRule.Standard ? 12 : _context26.t0 === 'standard' ? 12 : _context26.t0 === RoundingRule.StandardDown ? 14 : _context26.t0 === 'standard_rounding_midpoint_down' ? 14 : _context26.t0 === RoundingRule.AlwaysUp ? 16 : _context26.t0 === 'always_up' ? 16 : _context26.t0 === RoundingRule.AlwaysDown ? 18 : _context26.t0 === 'always_down' ? 18 : 20;
2023
1960
  break;
2024
- case 13:
1961
+ case 12:
2025
1962
  // 标准舍入(中点向上)
2026
1963
  roundedValue = this.standardRound(baseValue, true);
2027
- return _context26.abrupt("break", 22);
2028
- case 15:
1964
+ return _context26.abrupt("break", 21);
1965
+ case 14:
2029
1966
  // 标准舍入(中点向下)
2030
1967
  roundedValue = this.standardRound(baseValue, false);
2031
- return _context26.abrupt("break", 22);
2032
- case 17:
1968
+ return _context26.abrupt("break", 21);
1969
+ case 16:
2033
1970
  // 总是向上舍入
2034
1971
  roundedValue = baseValue.ceil();
2035
- return _context26.abrupt("break", 22);
2036
- case 19:
1972
+ return _context26.abrupt("break", 21);
1973
+ case 18:
2037
1974
  // 总是向下舍入
2038
1975
  roundedValue = baseValue.floor();
2039
- return _context26.abrupt("break", 22);
2040
- case 21:
1976
+ return _context26.abrupt("break", 21);
1977
+ case 20:
2041
1978
  throw new Error("\u4E0D\u652F\u6301\u7684\u820D\u5165\u89C4\u5219: ".concat(rule));
2042
- case 22:
1979
+ case 21:
2043
1980
  // 计算最终金额:roundedValue * interval
2044
1981
  finalAmount = roundedValue.mul(roundingInterval);
2045
1982
  originalAmountStr = amount.toFixed(2); // 如果最终金额是 0 元,则不采用舍入金额,返回原始金额
2046
1983
  if (!finalAmount.eq(0)) {
2047
- _context26.next = 27;
1984
+ _context26.next = 25;
2048
1985
  break;
2049
1986
  }
2050
- console.log("[PaymentModule] \u6700\u7EC8\u91D1\u989D\u4E3A0\uFF0C\u8FD4\u56DE\u539F\u59CB\u91D1\u989D: ".concat(originalAmountStr));
2051
1987
  return _context26.abrupt("return", {
2052
1988
  originalAmount: originalAmountStr,
2053
1989
  roundedAmount: originalAmountStr,
2054
1990
  roundingDifference: '0.00'
2055
1991
  });
2056
- case 27:
1992
+ case 25:
2057
1993
  roundedAmountStr = finalAmount.toFixed(2); // 计算舍入差额
2058
1994
  roundingDifference = finalAmount.sub(amount);
2059
1995
  roundingDifferenceStr = roundingDifference.toFixed(2);
2060
- console.log("[PaymentModule] \u820D\u5165\u7ED3\u679C - \u539F\u59CB\u91D1\u989D: ".concat(originalAmountStr, ", \u820D\u5165\u540E\u91D1\u989D: ").concat(roundedAmountStr, ", \u820D\u5165\u5DEE\u989D: ").concat(roundingDifferenceStr));
2061
1996
  return _context26.abrupt("return", {
2062
1997
  originalAmount: originalAmountStr,
2063
1998
  roundedAmount: roundedAmountStr,
2064
1999
  roundingDifference: roundingDifferenceStr
2065
2000
  });
2066
- case 34:
2067
- _context26.prev = 34;
2001
+ case 31:
2002
+ _context26.prev = 31;
2068
2003
  _context26.t1 = _context26["catch"](0);
2069
2004
  console.error('[PaymentModule] 金额舍入失败:', _context26.t1);
2070
2005
  throw new Error("\u91D1\u989D\u820D\u5165\u5931\u8D25: ".concat(_context26.t1 instanceof Error ? _context26.t1.message : String(_context26.t1)));
2071
- case 38:
2006
+ case 35:
2072
2007
  case "end":
2073
2008
  return _context26.stop();
2074
2009
  }
2075
- }, _callee26, this, [[0, 34]]);
2010
+ }, _callee26, this, [[0, 31]]);
2076
2011
  }));
2077
2012
  function roundAmountAsync(_x27, _x28, _x29) {
2078
2013
  return _roundAmountAsync.apply(this, arguments);
@@ -2457,9 +2457,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2457
2457
  _context3.next = 3;
2458
2458
  return this.core.effects.emit("".concat(this.name, ":onDestroy"), {});
2459
2459
  case 3:
2460
- console.log('[Rules] 已销毁');
2461
2460
  _get(_getPrototypeOf(RulesModule.prototype), "destroy", this).call(this);
2462
- case 5:
2461
+ case 4:
2463
2462
  case "end":
2464
2463
  return _context3.stop();
2465
2464
  }
@@ -2477,8 +2476,6 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2477
2476
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
2478
2477
  while (1) switch (_context4.prev = _context4.next) {
2479
2478
  case 0:
2480
- console.log('[Rules] clear');
2481
- case 1:
2482
2479
  case "end":
2483
2480
  return _context4.stop();
2484
2481
  }
@@ -255,7 +255,6 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
255
255
  var idSet = new Set(ids.map(function (id) {
256
256
  return String(id);
257
257
  }));
258
- console.log('getScheduleListByIds', this.store.scheduleList);
259
258
  if (this.store.map instanceof Map && this.store.map.size > 0) {
260
259
  return ids.map(function (id) {
261
260
  return _this2.store.map.get(Number(id));
@@ -721,7 +721,6 @@ export function getAllSortedDateRanges(schedules) {
721
721
 
722
722
  // 如果没有找到任何 dateRange,返回空数组
723
723
  if (allDateRanges.length === 0) {
724
- console.log('No dateRanges found in schedules:', schedules);
725
724
  return [];
726
725
  }
727
726
 
@@ -166,7 +166,6 @@ export var StepModule = /*#__PURE__*/function (_BaseModule) {
166
166
  return n.key === step.key;
167
167
  });
168
168
  if (index !== -1) {
169
- console.log('[StepModule] 步骤已存在,添加失败');
170
169
  return;
171
170
  }
172
171
  if (key) {
@@ -107,15 +107,12 @@ var RequestPluginImpl = /*#__PURE__*/function () {
107
107
  // 初始化方法
108
108
  function initialize() {
109
109
  this.core = globalThis.pisellOS;
110
- console.log('[RequestPlugin] 初始化完成');
111
110
  }
112
111
 
113
112
  // 销毁方法
114
113
  }, {
115
114
  key: "destroy",
116
- value: function destroy() {
117
- console.log('[RequestPlugin] 已销毁');
118
- }
115
+ value: function destroy() {}
119
116
 
120
117
  /**
121
118
  * 添加请求拦截器
@@ -312,16 +312,12 @@ var WindowPluginImpl = /*#__PURE__*/function () {
312
312
  key: "initialize",
313
313
  value:
314
314
  // 初始化方法
315
- function initialize() {
316
- console.log('[WindowPlugin] 初始化完成');
317
- }
315
+ function initialize() {}
318
316
 
319
317
  // 销毁方法
320
318
  }, {
321
319
  key: "destroy",
322
- value: function destroy() {
323
- console.log('[WindowPlugin] 已销毁');
324
- }
320
+ value: function destroy() {}
325
321
  }]);
326
322
  return WindowPluginImpl;
327
323
  }();