This commit is contained in:
zlwu committed 2026-08-17 20:32:18 +08:00
1 parent 9345cf4ad8
commit c3bd2c00ae
51 files changed
+14486 -15765

No files matched your search

+4
View File
@@ -68,6 +68,7 @@ def _slot_dict(slot: DutySlot, assignments: Sequence[DutyAssignment]) -> Dict[st
"shiftLabel": SHIFT_LABELS.get(slot.shift_type, slot.shift_type),
"capacity": slot.capacity,
"taken": len(active),
"remark": (slot.remark or "").strip() or None,
"assignments": [_assignment_dict(a) for a in active],
}
@@ -290,6 +291,7 @@ def save_day(
for slot_in in body.slots:
order += 1
slot = existing_by_type.get(slot_in.shiftType)
slot_remark = (slot_in.remark or "").strip() or None
# 已有 slot 上历史 assign 用户可再保存(D4);新建 slot 必须具备值班人员角色(D7)
grandfathered_user_ids: set = set()
if slot is None:
@@ -298,6 +300,7 @@ def save_day(
duty_day_id=day.id,
shift_type=slot_in.shiftType,
capacity=slot_in.capacity,
remark=slot_remark,
tenant_no=tenant_no,
order_num=order,
create_by=user_id,
@@ -335,6 +338,7 @@ def save_day(
f"超过名额 {slot_in.capacity},请先删人再缩容"
)
slot.capacity = slot_in.capacity
slot.remark = slot_remark
slot.order_num = order
slot.update_by = user_id
slot.update_time = now