@pisell/pisellos 0.0.276 → 0.0.278
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.
|
@@ -2578,16 +2578,22 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2578
2578
|
var mTimes = curr.times.filter(function (n) {
|
|
2579
2579
|
return !dayjs(n.start_at).isAfter(dayjs(item.start), 'minute') && !dayjs(n.end_at).isBefore(dayjs(item.end), 'minute') || dayjs(n.start_at).isBefore(dayjs(item.end), 'minute') && dayjs(n.end_at).isAfter(dayjs(item.start), 'minute');
|
|
2580
2580
|
});
|
|
2581
|
+
// 这里为什么要设置个 map,因为有可能日程有重叠,所以要把重叠的 event_list 去除
|
|
2582
|
+
var mSet = new Map();
|
|
2581
2583
|
mTimes.forEach(function (n) {
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2584
|
+
// acc += n.event_list?.reduce((acc: any, curr: any) => acc + curr.pax, 0);
|
|
2585
|
+
// mSet.set(n)
|
|
2586
|
+
n.event_list.forEach(function (m) {
|
|
2587
|
+
mSet.set(m.id, m.pax || 1);
|
|
2588
|
+
});
|
|
2586
2589
|
});
|
|
2590
|
+
acc += Array.from(mSet.values()).reduce(function (acc, curr) {
|
|
2591
|
+
return acc + curr;
|
|
2592
|
+
}, 0);
|
|
2587
2593
|
return acc;
|
|
2588
2594
|
}, 0);
|
|
2589
2595
|
// 如果已使用容量超过了当前类型资源的容量,则不可用
|
|
2590
|
-
if (
|
|
2596
|
+
if (otherCartNeedCapacity + usedCapacity >= currentTypeResourcesCapacity) {
|
|
2591
2597
|
bookingLeft = 0;
|
|
2592
2598
|
count = 0;
|
|
2593
2599
|
}
|
|
@@ -1810,13 +1810,16 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
|
|
|
1810
1810
|
const mTimes = curr.times.filter((n2) => {
|
|
1811
1811
|
return !(0, import_dayjs.default)(n2.start_at).isAfter((0, import_dayjs.default)(item.start), "minute") && !(0, import_dayjs.default)(n2.end_at).isBefore((0, import_dayjs.default)(item.end), "minute") || (0, import_dayjs.default)(n2.start_at).isBefore((0, import_dayjs.default)(item.end), "minute") && (0, import_dayjs.default)(n2.end_at).isAfter((0, import_dayjs.default)(item.start), "minute");
|
|
1812
1812
|
});
|
|
1813
|
+
const mSet = /* @__PURE__ */ new Map();
|
|
1813
1814
|
mTimes.forEach((n2) => {
|
|
1814
|
-
|
|
1815
|
-
|
|
1815
|
+
n2.event_list.forEach((m) => {
|
|
1816
|
+
mSet.set(m.id, m.pax || 1);
|
|
1817
|
+
});
|
|
1816
1818
|
});
|
|
1819
|
+
acc += Array.from(mSet.values()).reduce((acc2, curr2) => acc2 + curr2, 0);
|
|
1817
1820
|
return acc;
|
|
1818
1821
|
}, 0);
|
|
1819
|
-
if (
|
|
1822
|
+
if (otherCartNeedCapacity + usedCapacity >= currentTypeResourcesCapacity) {
|
|
1820
1823
|
bookingLeft = 0;
|
|
1821
1824
|
count = 0;
|
|
1822
1825
|
}
|