@pisell/pisellos 0.0.569 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/index.js +10 -6
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -3
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.js +7 -5
- package/dist/model/strategy/adapter/walletPass/example.js +26 -3
- package/dist/model/strategy/adapter/walletPass/index.js +5 -5
- package/dist/model/strategy/adapter/walletPass/type.d.ts +0 -3
- package/dist/model/strategy/adapter/walletPass/utils.d.ts +0 -26
- package/dist/model/strategy/adapter/walletPass/utils.js +17 -92
- package/dist/model/strategy/strategy-example.js +19 -5
- package/dist/modules/BaseModule.d.ts +1 -1
- package/dist/modules/BaseModule.js +8 -10
- package/dist/modules/Cart/index.js +3 -0
- package/dist/modules/Cart/utils/cartProduct.js +1 -0
- package/dist/modules/Cart/utils/cartResource.js +0 -2
- package/dist/modules/Cart/utils/changePrice.js +9 -16
- package/dist/modules/Date/index.js +5 -1
- package/dist/modules/Discount/index.d.ts +0 -1
- package/dist/modules/Discount/index.js +7 -22
- package/dist/modules/Discount/types.d.ts +0 -1
- package/dist/modules/OpenData/index.js +2 -0
- package/dist/modules/Order/index.js +70 -40
- package/dist/modules/Payment/index.js +162 -97
- package/dist/modules/Payment/types.d.ts +4 -8
- package/dist/modules/Payment/walletpass.d.ts +0 -2
- package/dist/modules/Payment/walletpass.js +5 -4
- package/dist/modules/ProductList/index.d.ts +1 -1
- package/dist/modules/ProductList/index.js +3 -12
- package/dist/modules/ProductList/types.d.ts +0 -1
- package/dist/modules/Rules/index.js +126 -427
- package/dist/modules/SalesSummary/utils.js +1 -2
- package/dist/modules/Schedule/getDateIsInSchedule.js +0 -5
- package/dist/modules/Schedule/index.js +1 -0
- package/dist/modules/Schedule/utils.js +1 -0
- package/dist/modules/Step/index.js +1 -0
- package/dist/modules/Summary/utils.js +22 -43
- package/dist/plugins/request.js +4 -1
- package/dist/plugins/window.js +6 -2
- package/dist/server/index.js +129 -97
- package/dist/server/modules/menu/index.js +41 -32
- package/dist/server/modules/order/index.js +4 -2
- package/dist/server/modules/products/index.js +42 -24
- package/dist/server/modules/quotation/index.js +38 -29
- package/dist/server/modules/resource/index.js +4 -3
- package/dist/server/modules/schedule/index.js +35 -27
- package/dist/server/utils/product.js +1 -0
- package/dist/solution/BaseSales/index.js +41 -38
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingByStep/index.js +60 -11
- package/dist/solution/BookingByStep/utils/capacity.js +11 -1
- package/dist/solution/BookingByStep/utils/resources.js +3 -1
- package/dist/solution/BookingByStep/utils/timeslots.js +43 -2
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.js +2 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +7 -6
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +31 -25
- package/dist/solution/BookingTicket/utils/scan/index.js +10 -6
- package/dist/solution/BuyTickets/index.js +12 -9
- package/dist/solution/Checkout/index.js +252 -177
- package/dist/solution/Checkout/utils/index.js +16 -4
- package/dist/solution/RegisterAndLogin/index.js +76 -30
- package/dist/solution/ScanOrder/index.js +60 -50
- package/dist/solution/ShopDiscount/index.js +14 -15
- package/dist/solution/ShopDiscount/types.d.ts +4 -5
- package/dist/solution/ShopDiscount/utils.d.ts +0 -9
- package/dist/solution/ShopDiscount/utils.js +0 -9
- package/dist/solution/VenueBooking/index.d.ts +3 -31
- package/dist/solution/VenueBooking/index.js +496 -651
- package/dist/solution/VenueBooking/types.d.ts +1 -3
- package/dist/solution/VenueBooking/types.js +0 -1
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +2 -2
- package/dist/solution/VenueBooking/utils/dateSummary.js +25 -12
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +0 -2
- package/dist/solution/VenueBooking/utils/timeSlot.js +4 -9
- package/dist/types/index.d.ts +1 -1
- package/dist/utils/task.js +18 -15
- package/dist/utils/watch.js +1 -0
- package/lib/apis/picoding.js +0 -2
- package/lib/core/index.js +132 -130
- package/lib/effects/index.js +57 -46
- package/lib/index.d.ts +0 -1
- package/lib/index.js +50 -92
- package/lib/model/index.js +21 -14
- package/lib/model/strategy/adapter/dataVariant/adapter.js +50 -38
- package/lib/model/strategy/adapter/dataVariant/evaluator.js +236 -162
- package/lib/model/strategy/adapter/dataVariant/examples.js +237 -229
- package/lib/model/strategy/adapter/dataVariant/index.js +34 -39
- package/lib/model/strategy/adapter/dataVariant/type.js +28 -57
- package/lib/model/strategy/adapter/index.js +64 -100
- package/lib/model/strategy/adapter/itemRule/adapter.js +144 -156
- package/lib/model/strategy/adapter/itemRule/evaluator.js +48 -36
- package/lib/model/strategy/adapter/itemRule/examples.js +225 -295
- package/lib/model/strategy/adapter/itemRule/index.js +57 -83
- package/lib/model/strategy/adapter/itemRule/type.js +36 -97
- package/lib/model/strategy/adapter/promotion/adapter.js +63 -84
- package/lib/model/strategy/adapter/promotion/evaluator.js +231 -381
- package/lib/model/strategy/adapter/promotion/examples.js +159 -139
- package/lib/model/strategy/adapter/promotion/index.js +49 -1
- package/lib/model/strategy/adapter/promotion/type.js +35 -199
- package/lib/model/strategy/adapter/type.js +16 -4
- package/lib/model/strategy/adapter/walletPass/evaluator.js +152 -180
- package/lib/model/strategy/adapter/walletPass/example.js +190 -217
- package/lib/model/strategy/adapter/walletPass/index.js +51 -75
- package/lib/model/strategy/adapter/walletPass/locales.js +58 -36
- package/lib/model/strategy/adapter/walletPass/type.d.ts +0 -3
- package/lib/model/strategy/adapter/walletPass/type.js +16 -4
- package/lib/model/strategy/adapter/walletPass/utils.d.ts +0 -26
- package/lib/model/strategy/adapter/walletPass/utils.js +383 -678
- package/lib/model/strategy/engine.js +168 -270
- package/lib/model/strategy/index.js +34 -49
- package/lib/model/strategy/strategy-example.js +239 -243
- package/lib/model/strategy/type.js +40 -100
- package/lib/modules/Account/index.js +53 -39
- package/lib/modules/Account/types.js +33 -20
- package/lib/modules/AccountList/index.js +154 -116
- package/lib/modules/AccountList/types.js +31 -30
- package/lib/modules/AccountList/utils.js +30 -18
- package/lib/modules/BaseModule.d.ts +1 -1
- package/lib/modules/BaseModule.js +46 -25
- package/lib/modules/BookingContext/index.js +136 -158
- package/lib/modules/BookingContext/types.js +32 -46
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +143 -131
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +82 -75
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +150 -170
- package/lib/modules/BookingContext/utils/flexible.js +55 -38
- package/lib/modules/BookingContext/utils/formatResourceList.js +34 -19
- package/lib/modules/BookingContext/utils/index.js +41 -124
- package/lib/modules/BookingContext/utils/noResource.js +70 -58
- package/lib/modules/BookingContext/utils/orderLineDisplay.js +41 -14
- package/lib/modules/BookingContext/utils/productExtend.js +155 -202
- package/lib/modules/BookingContext/utils/resourceErrors.js +53 -53
- package/lib/modules/BookingContext/utils/resourceSelection.js +41 -19
- package/lib/modules/BookingContext/utils/resources.js +167 -209
- package/lib/modules/BookingContext/utils/serviceTimes.js +116 -115
- package/lib/modules/BookingContext/utils/timeSlices.js +80 -70
- package/lib/modules/Cart/index.js +124 -170
- package/lib/modules/Cart/types.js +51 -46
- package/lib/modules/Cart/utils/cartAccount.js +39 -40
- package/lib/modules/Cart/utils/cartDate.js +61 -56
- package/lib/modules/Cart/utils/cartDiscount.js +33 -28
- package/lib/modules/Cart/utils/cartNote.js +32 -27
- package/lib/modules/Cart/utils/cartProduct.js +251 -321
- package/lib/modules/Cart/utils/cartRelationForms.js +35 -29
- package/lib/modules/Cart/utils/cartResource.js +78 -72
- package/lib/modules/Cart/utils/changePrice.js +50 -28
- package/lib/modules/Cart/utils/index.js +48 -106
- package/lib/modules/Customer/constants.js +34 -13
- package/lib/modules/Customer/index.js +169 -232
- package/lib/modules/Customer/types.js +35 -38
- package/lib/modules/Date/index.js +115 -116
- package/lib/modules/Date/types.js +28 -16
- package/lib/modules/Date/utils.js +123 -174
- package/lib/modules/Discount/index.d.ts +0 -1
- package/lib/modules/Discount/index.js +128 -130
- package/lib/modules/Discount/types.d.ts +0 -1
- package/lib/modules/Discount/types.js +31 -9
- package/lib/modules/Guests/index.js +56 -30
- package/lib/modules/Guests/types.js +33 -23
- package/lib/modules/Holder/index.js +189 -209
- package/lib/modules/Holder/types.js +16 -4
- package/lib/modules/Holder/utils.js +49 -20
- package/lib/modules/OpenData/index.js +76 -69
- package/lib/modules/OpenData/types.js +16 -4
- package/lib/modules/OpenData/utils.js +78 -44
- package/lib/modules/Order/index.js +1909 -1572
- package/lib/modules/Order/types.js +35 -78
- package/lib/modules/Order/utils/bundleDiscountHydration.js +74 -41
- package/lib/modules/Order/utils/manualProductDiscount.js +123 -124
- package/lib/modules/Order/utils/orderCollectionIdentity.js +210 -148
- package/lib/modules/Order/utils.js +634 -799
- package/lib/modules/Payment/cash.js +33 -20
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +76 -145
- package/lib/modules/Payment/eftpos.js +30 -16
- package/lib/modules/Payment/index.js +378 -518
- package/lib/modules/Payment/mx51.js +0 -1
- package/lib/modules/Payment/types.d.ts +4 -8
- package/lib/modules/Payment/types.js +107 -216
- package/lib/modules/Payment/utils.js +48 -51
- package/lib/modules/Payment/walletpass.d.ts +0 -2
- package/lib/modules/Payment/walletpass.js +211 -226
- package/lib/modules/Product/index.js +46 -51
- package/lib/modules/Product/types.js +16 -4
- package/lib/modules/Product/utils.js +33 -32
- package/lib/modules/ProductList/index.d.ts +1 -1
- package/lib/modules/ProductList/index.js +117 -117
- package/lib/modules/ProductList/types.d.ts +0 -1
- package/lib/modules/ProductList/types.js +31 -9
- package/lib/modules/Quotation/index.js +100 -66
- package/lib/modules/Quotation/types.js +16 -4
- package/lib/modules/Resource/index.js +59 -27
- package/lib/modules/Resource/types.js +32 -22
- package/lib/modules/Resource/utils.js +38 -30
- package/lib/modules/ResourcePlanner/index.js +61 -60
- package/lib/modules/ResourcePlanner/planner.js +384 -346
- package/lib/modules/ResourcePlanner/types.js +16 -4
- package/lib/modules/Rules/index.js +903 -1475
- package/lib/modules/Rules/types.js +40 -17
- package/lib/modules/SalesSummary/index.js +90 -85
- package/lib/modules/SalesSummary/types.js +16 -4
- package/lib/modules/SalesSummary/utils.js +427 -351
- package/lib/modules/ScanOrderLogger/index.js +79 -59
- package/lib/modules/ScanOrderLogger/providers/feishu.js +78 -54
- package/lib/modules/ScanOrderLogger/providers/grafana.js +36 -13
- package/lib/modules/ScanOrderLogger/types.js +16 -4
- package/lib/modules/Schedule/getDateIsInSchedule.js +163 -339
- package/lib/modules/Schedule/index.js +114 -100
- package/lib/modules/Schedule/type.js +16 -4
- package/lib/modules/Schedule/types.js +16 -4
- package/lib/modules/Schedule/utils.js +291 -433
- package/lib/modules/Step/index.js +52 -40
- package/lib/modules/Step/tyeps.js +16 -4
- package/lib/modules/Summary/index.js +71 -66
- package/lib/modules/Summary/types.js +16 -4
- package/lib/modules/Summary/utils.js +418 -791
- package/lib/modules/SurchargeList/index.js +60 -46
- package/lib/modules/SurchargeList/types.js +16 -4
- package/lib/modules/index.js +63 -245
- package/lib/plugins/app.js +16 -4
- package/lib/plugins/index.js +25 -36
- package/lib/plugins/request.js +126 -137
- package/lib/plugins/shopStore.js +16 -4
- package/lib/plugins/user.js +16 -4
- package/lib/plugins/window.js +179 -171
- package/lib/server/index.js +2337 -2675
- package/lib/server/modules/floor-plan/index.js +123 -102
- package/lib/server/modules/floor-plan/types.js +30 -15
- package/lib/server/modules/index.js +68 -106
- package/lib/server/modules/menu/index.js +122 -146
- package/lib/server/modules/menu/types.js +31 -18
- package/lib/server/modules/order/index.js +642 -567
- package/lib/server/modules/order/types.js +32 -117
- package/lib/server/modules/order/utils/filterBookings.js +194 -219
- package/lib/server/modules/order/utils/filterOrders.js +92 -118
- package/lib/server/modules/payment/index.js +83 -59
- package/lib/server/modules/payment/types.js +16 -4
- package/lib/server/modules/products/index.js +459 -575
- package/lib/server/modules/products/types.js +34 -44
- package/lib/server/modules/quotation/index.js +172 -137
- package/lib/server/modules/quotation/types.js +31 -21
- package/lib/server/modules/resource/index.js +184 -213
- package/lib/server/modules/resource/types.js +33 -42
- package/lib/server/modules/schedule/index.js +123 -135
- package/lib/server/modules/schedule/types.js +21 -14
- package/lib/server/modules/schedule/utils.js +163 -334
- package/lib/server/types.js +16 -4
- package/lib/server/utils/index.js +23 -25
- package/lib/server/utils/product.js +139 -196
- package/lib/server/utils/schedule.js +41 -34
- package/lib/server/utils/small-ticket.js +456 -478
- package/lib/server/utils/time.js +49 -40
- package/lib/solution/BaseSales/index.js +1016 -850
- package/lib/solution/BaseSales/types.js +37 -41
- package/lib/solution/BaseSales/utils/cartPromotion.js +460 -611
- package/lib/solution/BaseSales/utils/parseSalesResponse.js +105 -85
- package/lib/solution/BaseSales/utils/quotationPrice.js +114 -56
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +143 -102
- package/lib/solution/BaseSales/utils.js +140 -155
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingByStep/index.js +1340 -1530
- package/lib/solution/BookingByStep/types.js +99 -40
- package/lib/solution/BookingByStep/utils/capacity.js +160 -192
- package/lib/solution/BookingByStep/utils/products.js +52 -42
- package/lib/solution/BookingByStep/utils/resources.js +330 -527
- package/lib/solution/BookingByStep/utils/stock.js +44 -65
- package/lib/solution/BookingByStep/utils/timeslots.js +131 -129
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.js +459 -543
- package/lib/solution/BookingTicket/types.js +77 -99
- package/lib/solution/BookingTicket/utils/addProductDecision.js +184 -219
- package/lib/solution/BookingTicket/utils/addTimeAvailability.js +89 -58
- package/lib/solution/BookingTicket/utils/bookingStatus.js +78 -107
- package/lib/solution/BookingTicket/utils/cartView.js +94 -110
- package/lib/solution/BookingTicket/utils/exampleData.js +0 -185
- package/lib/solution/BookingTicket/utils/orderCustomer.js +41 -18
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +86 -219
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +93 -144
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +91 -79
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +41 -54
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +81 -84
- package/lib/solution/BookingTicket/utils/scan/index.js +104 -98
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +43 -90
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +64 -52
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +58 -56
- package/lib/solution/BuyTickets/index.js +70 -67
- package/lib/solution/BuyTickets/types.js +38 -22
- package/lib/solution/Checkout/index.js +1158 -1451
- package/lib/solution/Checkout/types.js +61 -91
- package/lib/solution/Checkout/utils/index.js +156 -228
- package/lib/solution/PlaceOrder/index.js +0 -55
- package/lib/solution/RegisterAndLogin/config.js +460 -493
- package/lib/solution/RegisterAndLogin/index.js +630 -633
- package/lib/solution/RegisterAndLogin/types.js +76 -189
- package/lib/solution/RegisterAndLogin/utils.js +125 -183
- package/lib/solution/Sales/index.js +320 -317
- package/lib/solution/Sales/types.js +33 -27
- package/lib/solution/ScanOrder/index.js +862 -831
- package/lib/solution/ScanOrder/types.js +34 -33
- package/lib/solution/ScanOrder/utils.js +371 -406
- package/lib/solution/ShopDiscount/index.js +233 -235
- package/lib/solution/ShopDiscount/types.d.ts +4 -5
- package/lib/solution/ShopDiscount/types.js +37 -15
- package/lib/solution/ShopDiscount/utils.d.ts +0 -9
- package/lib/solution/ShopDiscount/utils.js +172 -309
- package/lib/solution/UnifiedBookingSales/index.js +405 -379
- package/lib/solution/UnifiedBookingSales/types.js +31 -12
- package/lib/solution/VenueBooking/index.d.ts +3 -31
- package/lib/solution/VenueBooking/index.js +916 -967
- package/lib/solution/VenueBooking/types.d.ts +1 -3
- package/lib/solution/VenueBooking/types.js +39 -20
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +2 -2
- package/lib/solution/VenueBooking/utils/dateSummary.js +62 -25
- package/lib/solution/VenueBooking/utils/resource.js +54 -31
- package/lib/solution/VenueBooking/utils/slotMerge.js +107 -94
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +0 -2
- package/lib/solution/VenueBooking/utils/timeSlot.js +133 -138
- package/lib/solution/VenueBooking/utils.js +67 -130
- package/lib/solution/index.js +41 -124
- package/lib/store/createStore.js +29 -32
- package/lib/types/index.d.ts +1 -1
- package/lib/types/index.js +16 -4
- package/lib/utils/task.js +36 -36
- package/lib/utils/watch.js +47 -81
- package/package.json +2 -4
- package/dist/solution/VenueBooking/utils/smartPricing.d.ts +0 -70
- package/dist/solution/VenueBooking/utils/smartPricing.js +0 -233
- package/lib/solution/VenueBooking/utils/smartPricing.d.ts +0 -70
- package/lib/solution/VenueBooking/utils/smartPricing.js +0 -192
|
@@ -101,6 +101,13 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
101
101
|
var isTargetDayToday = targetDay.isSame(currentTime, 'day');
|
|
102
102
|
var fastestTime = null;
|
|
103
103
|
var fastestResources = [];
|
|
104
|
+
console.log('[TimeslotUtils] 查找最快可用资源:', {
|
|
105
|
+
currentTime: currentTime.format('YYYY-MM-DD HH:mm:ss'),
|
|
106
|
+
resourceCount: resources.length,
|
|
107
|
+
currentCapacity: currentCapacity,
|
|
108
|
+
countMap: countMap
|
|
109
|
+
});
|
|
110
|
+
|
|
104
111
|
// 遍历所有资源,找到最快可用的时间点
|
|
105
112
|
var _iterator2 = _createForOfIteratorHelper(resources),
|
|
106
113
|
_step2;
|
|
@@ -115,21 +122,28 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
115
122
|
return dayjs(time.end_at).isAfter(currentTime);
|
|
116
123
|
});
|
|
117
124
|
if (targetDayTimes.length === 0) {
|
|
125
|
+
console.log("[TimeslotUtils] \u8D44\u6E90 ".concat(_resource.id, "(").concat(_resource.main_field, ") \u4ECA\u65E5\u65E0\u53EF\u7528\u65F6\u95F4\u6BB5"));
|
|
118
126
|
continue;
|
|
119
127
|
}
|
|
120
128
|
var _iterator4 = _createForOfIteratorHelper(targetDayTimes),
|
|
121
129
|
_step4;
|
|
122
130
|
try {
|
|
123
131
|
var _loop = function _loop() {
|
|
124
|
-
var _time$event_list;
|
|
132
|
+
var _time$event_list, _time$event_list2;
|
|
125
133
|
var time = _step4.value;
|
|
126
134
|
var workStartTime = dayjs(time.start_at);
|
|
127
135
|
var workEndTime = dayjs(time.end_at);
|
|
128
136
|
|
|
129
137
|
// 确定检查的起始时间(当前时间 vs 工作开始时间)
|
|
130
138
|
var nextAvailableTime = isTargetDayToday && currentTime.isAfter(workStartTime) ? currentTime : workStartTime;
|
|
139
|
+
console.log("[TimeslotUtils] \u68C0\u67E5\u8D44\u6E90 ".concat(_resource.id, "(").concat(_resource.main_field, "):"), {
|
|
140
|
+
workTime: "".concat(workStartTime.format('HH:mm'), "-").concat(workEndTime.format('HH:mm')),
|
|
141
|
+
checkStartTime: nextAvailableTime.format('HH:mm:ss'),
|
|
142
|
+
eventCount: ((_time$event_list = time.event_list) === null || _time$event_list === void 0 ? void 0 : _time$event_list.length) || 0
|
|
143
|
+
});
|
|
144
|
+
|
|
131
145
|
// 获取所有影响的预约事件(当前时间之后的)
|
|
132
|
-
var relevantEvents = ((_time$
|
|
146
|
+
var relevantEvents = ((_time$event_list2 = time.event_list) === null || _time$event_list2 === void 0 ? void 0 : _time$event_list2.filter(function (event) {
|
|
133
147
|
var eventEnd = dayjs(event.end_at);
|
|
134
148
|
return eventEnd.isAfter(nextAvailableTime);
|
|
135
149
|
})) || [];
|
|
@@ -148,12 +162,20 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
148
162
|
var _event = _step5.value;
|
|
149
163
|
var _eventStart = dayjs(_event.start_at);
|
|
150
164
|
var _eventEnd = dayjs(_event.end_at);
|
|
165
|
+
console.log("[TimeslotUtils] \u68C0\u67E5\u4E8B\u4EF6\u51B2\u7A81:", {
|
|
166
|
+
resourceId: _resource.id,
|
|
167
|
+
eventTime: "".concat(_eventStart.format('HH:mm'), "-").concat(_eventEnd.format('HH:mm')),
|
|
168
|
+
checkTime: finalAvailableTime.format('HH:mm:ss'),
|
|
169
|
+
pax: _event.pax || 1
|
|
170
|
+
});
|
|
171
|
+
|
|
151
172
|
// 检查资源类型和容量
|
|
152
173
|
if (_resource.resourceType === 'single' || (_resource.capacity || 1) === 1) {
|
|
153
174
|
// 单人预约资源:检查时间冲突
|
|
154
175
|
if (finalAvailableTime.isBefore(_eventEnd) && _eventStart.isBefore(finalAvailableTime.add(resolvedDuration, 'minute'))) {
|
|
155
176
|
// 有冲突,使用事件结束时间
|
|
156
177
|
finalAvailableTime = _eventEnd;
|
|
178
|
+
console.log("[TimeslotUtils] \u53D1\u73B0\u65F6\u95F4\u51B2\u7A81\uFF0C\u8C03\u6574\u5230: ".concat(finalAvailableTime.format('HH:mm:ss')));
|
|
157
179
|
}
|
|
158
180
|
} else {
|
|
159
181
|
// 多人预约资源:检查容量
|
|
@@ -167,6 +189,7 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
167
189
|
if (totalRequiredCapacity > totalCapacity) {
|
|
168
190
|
// 容量不足,使用事件结束时间
|
|
169
191
|
finalAvailableTime = _eventEnd;
|
|
192
|
+
console.log("[TimeslotUtils] \u5BB9\u91CF\u4E0D\u8DB3\uFF0C\u8C03\u6574\u5230: ".concat(finalAvailableTime.format('HH:mm:ss')));
|
|
170
193
|
}
|
|
171
194
|
}
|
|
172
195
|
}
|
|
@@ -179,14 +202,19 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
179
202
|
_iterator5.f();
|
|
180
203
|
}
|
|
181
204
|
if (finalAvailableTime.add(resolvedDuration, 'minute').isAfter(workEndTime)) {
|
|
205
|
+
console.log("[TimeslotUtils] \u8D44\u6E90 ".concat(_resource.id, " \u53EF\u7528\u65F6\u95F4\u8D85\u51FA\u5DE5\u4F5C\u65F6\u95F4\uFF0C\u8DF3\u8FC7"));
|
|
182
206
|
return 0; // continue
|
|
183
207
|
}
|
|
208
|
+
console.log("[TimeslotUtils] \u8D44\u6E90 ".concat(_resource.id, "(").concat(_resource.main_field, ") \u6700\u5FEB\u53EF\u7528\u65F6\u95F4: ").concat(finalAvailableTime.format('HH:mm:ss')));
|
|
209
|
+
|
|
184
210
|
// 更新最快可用时间和资源
|
|
185
211
|
if (!fastestTime || finalAvailableTime.isBefore(fastestTime)) {
|
|
186
212
|
fastestTime = finalAvailableTime;
|
|
187
213
|
fastestResources = [_resource];
|
|
214
|
+
console.log("[TimeslotUtils] \u66F4\u65B0\u6700\u5FEB\u65F6\u95F4: ".concat(fastestTime.format('HH:mm:ss'), ", \u8D44\u6E90: ").concat(_resource.main_field));
|
|
188
215
|
} else if (finalAvailableTime.isSame(fastestTime)) {
|
|
189
216
|
fastestResources.push(_resource);
|
|
217
|
+
console.log("[TimeslotUtils] \u6DFB\u52A0\u76F8\u540C\u65F6\u95F4\u8D44\u6E90: ".concat(_resource.main_field));
|
|
190
218
|
}
|
|
191
219
|
return 1; // break
|
|
192
220
|
// 每个资源只需要计算一次
|
|
@@ -211,16 +239,21 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
211
239
|
_iterator2.f();
|
|
212
240
|
}
|
|
213
241
|
if (!fastestTime || fastestResources.length === 0) {
|
|
242
|
+
console.log('[TimeslotUtils] 未找到可用资源');
|
|
214
243
|
return null;
|
|
215
244
|
}
|
|
245
|
+
console.log("[TimeslotUtils] \u627E\u5230 ".concat(fastestResources.length, " \u4E2A\u6700\u5FEB\u53EF\u7528\u8D44\u6E90\uFF0C\u65F6\u95F4: ").concat(fastestTime.format('HH:mm:ss')));
|
|
246
|
+
|
|
216
247
|
// 如果只有一个最快可用的资源,直接返回
|
|
217
248
|
if (fastestResources.length === 1) {
|
|
249
|
+
console.log("[TimeslotUtils] \u8FD4\u56DE\u552F\u4E00\u6700\u5FEB\u8D44\u6E90: ".concat(fastestResources[0].main_field));
|
|
218
250
|
return fastestResources[0];
|
|
219
251
|
}
|
|
220
252
|
|
|
221
253
|
// 如果有多个最快可用的资源,选择空闲时间最长的资源
|
|
222
254
|
var selectedResource = fastestResources[0];
|
|
223
255
|
var maxIdleTime = 0;
|
|
256
|
+
console.log("[TimeslotUtils] \u6BD4\u8F83 ".concat(fastestResources.length, " \u4E2A\u8D44\u6E90\u7684\u7A7A\u95F2\u65F6\u95F4:"));
|
|
224
257
|
for (var _i2 = 0, _fastestResources = fastestResources; _i2 < _fastestResources.length; _i2++) {
|
|
225
258
|
var _workingTime$event_li;
|
|
226
259
|
var resource = _fastestResources[_i2];
|
|
@@ -258,11 +291,19 @@ export function findFastestAvailableResource(_ref2) {
|
|
|
258
291
|
} finally {
|
|
259
292
|
_iterator3.f();
|
|
260
293
|
}
|
|
294
|
+
console.log("[TimeslotUtils] \u8D44\u6E90 ".concat(resource.id, "(").concat(resource.main_field, "):"), {
|
|
295
|
+
工作结束时间: workEndTime.format('HH:mm'),
|
|
296
|
+
总工作时长: workEndTime.diff(fastestTime, 'minute') + '分钟',
|
|
297
|
+
预约占用时长: workEndTime.diff(fastestTime, 'minute') - totalIdleTime + '分钟',
|
|
298
|
+
实际空闲时长: totalIdleTime + '分钟'
|
|
299
|
+
});
|
|
261
300
|
if (totalIdleTime > maxIdleTime) {
|
|
262
301
|
maxIdleTime = totalIdleTime;
|
|
263
302
|
selectedResource = resource;
|
|
303
|
+
console.log("[TimeslotUtils] \u66F4\u65B0\u6700\u4F73\u9009\u62E9: ".concat(resource.main_field, " (\u7A7A\u95F2").concat(totalIdleTime, "\u5206\u949F)"));
|
|
264
304
|
}
|
|
265
305
|
}
|
|
306
|
+
console.log("[TimeslotUtils] \u6700\u7EC8\u9009\u62E9\u8D44\u6E90: ".concat(selectedResource.main_field, " (\u6700\u957F\u7A7A\u95F2").concat(maxIdleTime, "\u5206\u949F)"));
|
|
266
307
|
return selectedResource;
|
|
267
308
|
}
|
|
268
309
|
|
|
@@ -322,7 +322,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
322
322
|
* 获取当前的客户搜索条件
|
|
323
323
|
* @returns 当前搜索条件
|
|
324
324
|
*/
|
|
325
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
325
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
326
326
|
/**
|
|
327
327
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
328
328
|
* @returns 客户状态
|
|
@@ -235,6 +235,8 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
|
|
|
235
235
|
_context.next = 9;
|
|
236
236
|
return this.configureIdGeneratorFromOpenData();
|
|
237
237
|
case 9:
|
|
238
|
+
console.log('[BookingTicket] 初始化完成');
|
|
239
|
+
case 10:
|
|
238
240
|
case "end":
|
|
239
241
|
return _context.stop();
|
|
240
242
|
}
|
|
@@ -173,25 +173,26 @@ export var searchOrder = /*#__PURE__*/function () {
|
|
|
173
173
|
});
|
|
174
174
|
case 3:
|
|
175
175
|
res = _context4.sent;
|
|
176
|
+
console.log('searchOrder>>>>>>>', res);
|
|
176
177
|
if (!((res === null || res === void 0 ? void 0 : res.code) == 200 && !!(res !== null && res !== void 0 && res.data))) {
|
|
177
|
-
_context4.next =
|
|
178
|
+
_context4.next = 7;
|
|
178
179
|
break;
|
|
179
180
|
}
|
|
180
181
|
return _context4.abrupt("return", {
|
|
181
182
|
searchType: 'order',
|
|
182
183
|
response: res
|
|
183
184
|
});
|
|
184
|
-
case
|
|
185
|
+
case 7:
|
|
185
186
|
throw new Error('没有找到对应的识别码');
|
|
186
|
-
case
|
|
187
|
-
_context4.prev =
|
|
187
|
+
case 10:
|
|
188
|
+
_context4.prev = 10;
|
|
188
189
|
_context4.t0 = _context4["catch"](0);
|
|
189
190
|
throw _context4.t0;
|
|
190
|
-
case
|
|
191
|
+
case 13:
|
|
191
192
|
case "end":
|
|
192
193
|
return _context4.stop();
|
|
193
194
|
}
|
|
194
|
-
}, _callee4, null, [[0,
|
|
195
|
+
}, _callee4, null, [[0, 10]]);
|
|
195
196
|
}));
|
|
196
197
|
return function searchOrder(_x7, _x8) {
|
|
197
198
|
return _ref4.apply(this, arguments);
|
|
@@ -76,15 +76,16 @@ var handleScanFn = function handleScanFn(getRequestList, localSearch) {
|
|
|
76
76
|
case 0:
|
|
77
77
|
_ref3 = scanResult || {}, value = _ref3.value; // 本地解析识别码
|
|
78
78
|
if (!localSearch) {
|
|
79
|
-
_context2.next =
|
|
79
|
+
_context2.next = 15;
|
|
80
80
|
break;
|
|
81
81
|
}
|
|
82
82
|
_context2.prev = 2;
|
|
83
83
|
localResult = localSearch === null || localSearch === void 0 ? void 0 : localSearch(value);
|
|
84
84
|
if (!((localResult === null || localResult === void 0 ? void 0 : localResult.length) > 0)) {
|
|
85
|
-
_context2.next =
|
|
85
|
+
_context2.next = 9;
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
88
|
+
console.log('本地搜索到数据>>>>>>>', localResult);
|
|
88
89
|
return _context2.abrupt("return", {
|
|
89
90
|
searchType: 'local_product',
|
|
90
91
|
response: {
|
|
@@ -93,53 +94,58 @@ var handleScanFn = function handleScanFn(getRequestList, localSearch) {
|
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
});
|
|
96
|
-
case
|
|
97
|
-
|
|
98
|
-
break;
|
|
97
|
+
case 9:
|
|
98
|
+
console.log('本地搜索无数据>>>>>>>');
|
|
99
99
|
case 10:
|
|
100
|
-
_context2.
|
|
100
|
+
_context2.next = 15;
|
|
101
|
+
break;
|
|
102
|
+
case 12:
|
|
103
|
+
_context2.prev = 12;
|
|
101
104
|
_context2.t0 = _context2["catch"](2);
|
|
102
105
|
console.error('本地搜索到数据失败>>>>>>>', _context2.t0);
|
|
103
|
-
case
|
|
104
|
-
_context2.prev =
|
|
106
|
+
case 15:
|
|
107
|
+
_context2.prev = 15;
|
|
105
108
|
if (!scanCache.has(value)) {
|
|
106
|
-
_context2.next =
|
|
109
|
+
_context2.next = 22;
|
|
107
110
|
break;
|
|
108
111
|
}
|
|
109
112
|
result = scanCache.get(value);
|
|
113
|
+
console.log('缓存中搜索到数据>>>>>>>', result);
|
|
110
114
|
return _context2.abrupt("return", result);
|
|
111
|
-
case
|
|
112
|
-
|
|
115
|
+
case 22:
|
|
116
|
+
console.log('缓存中无数据>>>>>>>');
|
|
117
|
+
case 23:
|
|
118
|
+
_context2.next = 28;
|
|
113
119
|
break;
|
|
114
|
-
case
|
|
115
|
-
_context2.prev =
|
|
116
|
-
_context2.t1 = _context2["catch"](
|
|
120
|
+
case 25:
|
|
121
|
+
_context2.prev = 25;
|
|
122
|
+
_context2.t1 = _context2["catch"](15);
|
|
117
123
|
console.error('缓存中搜索数据失败>>>>>>>', _context2.t1);
|
|
118
|
-
case
|
|
124
|
+
case 28:
|
|
119
125
|
requestList = (getRequestList === null || getRequestList === void 0 ? void 0 : getRequestList(value)) || [];
|
|
120
126
|
if (!(requestList.length === 0)) {
|
|
121
|
-
_context2.next =
|
|
127
|
+
_context2.next = 31;
|
|
122
128
|
break;
|
|
123
129
|
}
|
|
124
130
|
throw new Error('requestList is empty');
|
|
125
|
-
case
|
|
126
|
-
_context2.prev =
|
|
127
|
-
_context2.next =
|
|
131
|
+
case 31:
|
|
132
|
+
_context2.prev = 31;
|
|
133
|
+
_context2.next = 34;
|
|
128
134
|
return promiseAny(requestList);
|
|
129
|
-
case
|
|
135
|
+
case 34:
|
|
130
136
|
_result = _context2.sent;
|
|
131
137
|
// 将结果缓存
|
|
132
138
|
scanCache.set(value, _result);
|
|
133
139
|
return _context2.abrupt("return", _result);
|
|
134
|
-
case
|
|
135
|
-
_context2.prev =
|
|
136
|
-
_context2.t2 = _context2["catch"](
|
|
140
|
+
case 39:
|
|
141
|
+
_context2.prev = 39;
|
|
142
|
+
_context2.t2 = _context2["catch"](31);
|
|
137
143
|
throw _context2.t2;
|
|
138
|
-
case
|
|
144
|
+
case 42:
|
|
139
145
|
case "end":
|
|
140
146
|
return _context2.stop();
|
|
141
147
|
}
|
|
142
|
-
}, _callee2, null, [[2,
|
|
148
|
+
}, _callee2, null, [[2, 12], [15, 25], [31, 39]]);
|
|
143
149
|
}));
|
|
144
150
|
return function (_x2) {
|
|
145
151
|
return _ref2.apply(this, arguments);
|
|
@@ -46,6 +46,7 @@ var Scan = /*#__PURE__*/function () {
|
|
|
46
46
|
(_this$solution = this.solution) === null || _this$solution === void 0 || (_this$solution = _this$solution.window) === null || _this$solution === void 0 || (_this$solution = _this$solution.interaction) === null || _this$solution === void 0 || (_this$solution = _this$solution.utils) === null || _this$solution === void 0 || (_this$solution$mountF = _this$solution.mountFunction) === null || _this$solution$mountF === void 0 || _this$solution$mountF.call(_this$solution, 'global', 'peripheralsResult', function (strVal) {
|
|
47
47
|
try {
|
|
48
48
|
var _result = JSON.parse(strVal);
|
|
49
|
+
console.log('nativeScannerResult>>>>>>>', _result);
|
|
49
50
|
Scan.scanInstances.forEach(function (instance) {
|
|
50
51
|
instance.handleScan(_result);
|
|
51
52
|
});
|
|
@@ -183,6 +184,7 @@ var Scan = /*#__PURE__*/function () {
|
|
|
183
184
|
}, {
|
|
184
185
|
key: "clearTaskQueue",
|
|
185
186
|
value: function clearTaskQueue(eventKey) {
|
|
187
|
+
console.log('clearTaskQueue>>>>>>>', eventKey);
|
|
186
188
|
if (eventKey) {
|
|
187
189
|
var _this$listenerConfig$3;
|
|
188
190
|
(_this$listenerConfig$3 = this.listenerConfig.get(eventKey)) === null || _this$listenerConfig$3 === void 0 || _this$listenerConfig$3.task.clearTaskQueue();
|
|
@@ -241,7 +243,7 @@ var Scan = /*#__PURE__*/function () {
|
|
|
241
243
|
taskItemUuid = other === null || other === void 0 ? void 0 : other.uuid;
|
|
242
244
|
_ref2 = this.getListenerConfig(eventKey) || {}, scanCallback = _ref2.scanCallback, task = _ref2.task;
|
|
243
245
|
if (!scanCallback) {
|
|
244
|
-
_context.next =
|
|
246
|
+
_context.next = 18;
|
|
245
247
|
break;
|
|
246
248
|
}
|
|
247
249
|
_context.prev = 6;
|
|
@@ -252,6 +254,7 @@ var Scan = /*#__PURE__*/function () {
|
|
|
252
254
|
});
|
|
253
255
|
case 9:
|
|
254
256
|
_result2 = _context.sent;
|
|
257
|
+
console.log("".concat(eventKey, "_result>>>>>>>"), _result2);
|
|
255
258
|
// 如果任务存在,则发布结果
|
|
256
259
|
if (taskItemUuid && task !== null && task !== void 0 && task.isTaskExist(taskItemUuid)) {
|
|
257
260
|
watch.publishByEventKey(this.watchKey, eventKey, {
|
|
@@ -265,11 +268,12 @@ var Scan = /*#__PURE__*/function () {
|
|
|
265
268
|
} else {
|
|
266
269
|
console.warn("".concat(eventKey, "_result_task_not_exist>>>>>>>"), task);
|
|
267
270
|
}
|
|
268
|
-
_context.next =
|
|
271
|
+
_context.next = 18;
|
|
269
272
|
break;
|
|
270
|
-
case
|
|
271
|
-
_context.prev =
|
|
273
|
+
case 14:
|
|
274
|
+
_context.prev = 14;
|
|
272
275
|
_context.t0 = _context["catch"](6);
|
|
276
|
+
console.log("".concat(eventKey, "_result_error>>>>>>>"), _context.t0);
|
|
273
277
|
// 如果任务存在,则发布结果
|
|
274
278
|
if (taskItemUuid && task !== null && task !== void 0 && task.isTaskExist(taskItemUuid)) {
|
|
275
279
|
watch.publishByEventKey(this.watchKey, eventKey, {
|
|
@@ -282,11 +286,11 @@ var Scan = /*#__PURE__*/function () {
|
|
|
282
286
|
} else {
|
|
283
287
|
console.warn("".concat(eventKey, "_result_error_task_not_exist>>>>>>>"), task);
|
|
284
288
|
}
|
|
285
|
-
case
|
|
289
|
+
case 18:
|
|
286
290
|
case "end":
|
|
287
291
|
return _context.stop();
|
|
288
292
|
}
|
|
289
|
-
}, _callee, this, [[6,
|
|
293
|
+
}, _callee, this, [[6, 14]]);
|
|
290
294
|
}));
|
|
291
295
|
function scanTaskAction() {
|
|
292
296
|
return _scanTaskAction.apply(this, arguments);
|
|
@@ -53,25 +53,26 @@ export var BuyTicketsImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
53
53
|
this.core = core;
|
|
54
54
|
this.store = options.store || {};
|
|
55
55
|
this.otherParams = options.otherParams || {};
|
|
56
|
+
console.log('[BuyTickets] 初始化完成');
|
|
56
57
|
// 获取依赖的插件
|
|
57
58
|
this.request = core.getPlugin('request');
|
|
58
59
|
this.window = core.getPlugin('window');
|
|
59
60
|
if (this.request) {
|
|
60
|
-
_context.next =
|
|
61
|
+
_context.next = 8;
|
|
61
62
|
break;
|
|
62
63
|
}
|
|
63
64
|
throw new Error('购物车模块需要 request 插件支持');
|
|
64
|
-
case
|
|
65
|
+
case 8:
|
|
65
66
|
if (!this.otherParams.prodctIds) {
|
|
66
|
-
_context.next =
|
|
67
|
+
_context.next = 11;
|
|
67
68
|
break;
|
|
68
69
|
}
|
|
69
|
-
_context.next =
|
|
70
|
+
_context.next = 11;
|
|
70
71
|
return this.loadProductsByIds(this.otherParams.prodctIds);
|
|
71
|
-
case
|
|
72
|
-
_context.next =
|
|
72
|
+
case 11:
|
|
73
|
+
_context.next = 13;
|
|
73
74
|
return this.core.effects.emit("".concat(this.name, ":onInited"), {});
|
|
74
|
-
case
|
|
75
|
+
case 13:
|
|
75
76
|
case "end":
|
|
76
77
|
return _context.stop();
|
|
77
78
|
}
|
|
@@ -149,6 +150,8 @@ export var BuyTicketsImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
149
150
|
_context4.next = 2;
|
|
150
151
|
return this.core.effects.emit("".concat(this.name, ":onDestroy"), {});
|
|
151
152
|
case 2:
|
|
153
|
+
console.log('[BuyTickets] 已销毁');
|
|
154
|
+
case 3:
|
|
152
155
|
case "end":
|
|
153
156
|
return _context4.stop();
|
|
154
157
|
}
|
|
@@ -273,9 +276,9 @@ export var BuyTicketsImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
273
276
|
// 如果外部没有阻拦,则默认调用后端的保存至购物车接口,然后通知页面 push 到购物车页面
|
|
274
277
|
// 游乐场逻辑:这里会被 hook 先拦截一次,业务层展示 add other product
|
|
275
278
|
// 然后第二次继续被拦截,业务层把这里的数据推给 native 的购物车
|
|
276
|
-
|
|
279
|
+
console.log('listSubmit 应该走逻辑层的 API 发请求了');
|
|
277
280
|
// fetch('')
|
|
278
|
-
case
|
|
281
|
+
case 7:
|
|
279
282
|
case "end":
|
|
280
283
|
return _context7.stop();
|
|
281
284
|
}
|