feat: 新增电工APP端与定时任务管理功能

- 新增电工APP独立鉴权中间件与登录注册接口
- 新增定时任务管理模块,支持任务配置、执行日志与手动触发
- 新增运维费定价与电工派单成本价目管理
- 新增电工资质证照管理与到期提醒定时任务
- 完善数据库实体与DTO校验,优化权限控制
This commit is contained in:
andyesfly committed 2026-10-02 16:08:00 +08:00
1 parent 1803ad679c
commit f4454ad014
57 files changed
+9388 -200

No files matched your search

+105
View File
@@ -0,0 +1,105 @@
import { Column, Model, Table, DataType, CreatedAt, UpdatedAt } from "sequelize-typescript";
@Table({
tableName: "sys_job",
comment: "定时任务定义与调度配置表",
timestamps: true,
createdAt: "created_at",
updatedAt: "updated_at"
})
export default class SysJob extends Model {
@Column({
type: DataType.BIGINT,
autoIncrement: true,
primaryKey: true
})
id!: number;
@Column({
type: DataType.STRING(64),
field: "job_key",
comment: "任务键(唯一标识)"
})
jobKey!: string;
@Column({
type: DataType.STRING(64),
field: "job_name",
comment: "任务名称"
})
jobName!: string;
@Column({
type: DataType.STRING(64),
field: "cron_expression",
comment: "cron 表达式"
})
cronExpression!: string;
@Column({
type: DataType.JSONB,
field: "params",
comment: "任务参数(JSONB)"
})
params!: Record<string, any>;
@Column({
type: DataType.SMALLINT,
field: "retry_times",
comment: "重试次数"
})
retryTimes!: number;
@Column({
type: DataType.INTEGER,
field: "retry_interval",
comment: "重试间隔(秒)"
})
retryInterval!: number;
@Column({
type: DataType.SMALLINT,
comment: "状态: 1-启用 0-停用"
})
status!: number;
@Column({
type: DataType.STRING(255),
comment: "备注"
})
remark!: string | null;
@Column({
type: DataType.DATE,
field: "last_run_at",
comment: "上次执行时间"
})
lastRunAt!: Date | null;
@Column({
type: DataType.SMALLINT,
field: "last_run_status",
comment: "上次执行状态: 1-成功 2-失败 3-跳过"
})
lastRunStatus!: number | null;
@Column({
type: DataType.INTEGER,
field: "last_run_cost_ms",
comment: "上次执行耗时(毫秒)"
})
lastRunCostMs!: number | null;
@Column({
type: DataType.TEXT,
field: "last_error",
comment: "上次失败原因"
})
lastError!: string | null;
@CreatedAt
created_at!: Date;
@UpdatedAt
updated_at!: Date;
}