feat: 节假日配置、排班管理独立页面、考勤加班显示优化
- 新增 HolidayConfig 模型,支持法定节假日和调休工作日配置 - 加班费同步逻辑改用 HolidayConfig 判断日期类型 - 员工端考勤显示加班工时、费率和日期类型 - 周末/节假日出勤状态显示为"周末出勤"/"节假日出勤" - 新增 Employee.defaultShiftId 字段,支持长期排班(工作日班次) - 排班管理拆分为独立页面(班次管理+排班),考勤管理保留出勤相关功能 - 排班和每日出勤页面增加身份证号列 - 修复岗位和部门编辑失败问题(POST 改 PUT) - 新增 backfill 脚本:合同薪资回填、默认班次回填 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
@@ -166,6 +166,7 @@ model Organization {
|
||||
departmentRecords EmployeeDepartmentRecord[]
|
||||
notificationSetting NotificationSetting?
|
||||
overtimeConfig OvertimeConfig?
|
||||
holidayConfigs HolidayConfig[]
|
||||
notificationLogs NotificationLog[]
|
||||
employeeAttachments EmployeeAttachment[]
|
||||
disciplinaryRecords DisciplinaryRecord[]
|
||||
@@ -273,6 +274,8 @@ model Employee {
|
||||
education String? // 学历(博士/硕士/本科/大专/高中/其他)
|
||||
femaleWorkerType FemaleWorkerType? // 女性岗位类型(CADRE=干部/WORKER=工人,仅女性需要区分)
|
||||
retirementDaysLeft Int? // 距退休天数(便捷字段,定期计算)
|
||||
defaultShiftId String? // 默认班次ID(长期排班=工作日班次,null=未设置)
|
||||
defaultShift Shift? @relation("EmployeeDefaultShift", fields: [defaultShiftId], references: [id], onDelete: SetNull)
|
||||
createdBy String
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
@@ -637,6 +640,20 @@ model OvertimeConfig {
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
/// 节假日配置(区分法定节假日和调休工作日)
|
||||
model HolidayConfig {
|
||||
id String @id @default(cuid())
|
||||
orgId String
|
||||
org Organization @relation(fields: [orgId], references: [id], onDelete: Cascade)
|
||||
date DateTime // 日期(仅取日期部分)
|
||||
type String // HOLIDAY(法定节假日) | WORKDAY(调休工作日,即周末调休上班)
|
||||
name String? // 节假日名称(如"春节"、"国庆节")
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@unique([orgId, date])
|
||||
@@index([orgId, date])
|
||||
}
|
||||
|
||||
model MedicalPeriodPolicy {
|
||||
id String @id @default(cuid())
|
||||
orgId String
|
||||
@@ -1332,6 +1349,7 @@ model Shift {
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
assignments ShiftAssignment[]
|
||||
defaultEmployees Employee[] @relation("EmployeeDefaultShift")
|
||||
|
||||
@@index([orgId])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user