feat: 新增可配置通知中心,支持扫描式/埋点式通知规则与手动群发

新增通知规则实体、扫描任务、API与管理界面,重构站内通知支持用户/电工双类型,移除硬编码的证照到期提醒,新增工单派单、电工审核结果等通知触发场景,调整菜单与数据库结构适配新通知体系。
This commit is contained in:
andyesfly committed 2026-10-06 11:53:02 +08:00
1 parent 91aa3c06f0
commit 6cf6a3d5b9
36 files changed
+3309 -246

No files matched your search

+7 -7
View File
@@ -64,7 +64,7 @@ export class DispatchPriceService {
return {
code: 200,
message: "获取派单成本价目列表成功",
message: "获取勘察费用列表成功",
data: { list: rows.map((r) => r.toJSON()), total: count, page: Number(page), pageSize: Number(pageSize) }
};
}
@@ -72,7 +72,7 @@ export class DispatchPriceService {
async detail(id: number): Promise<any> {
const record = await this.dispatchPriceModel.findByPk(id);
if (!record) return { code: 404, message: "价目不存在", data: null };
return { code: 200, message: "获取派单成本价目详情成功", data: record.toJSON() };
return { code: 200, message: "获取勘察费用详情成功", data: record.toJSON() };
}
async create(data: any, ctx: Context): Promise<any> {
@@ -89,14 +89,14 @@ export class DispatchPriceService {
try {
payload.priceCode = await this.generatePriceCode();
const created = await this.dispatchPriceModel.create(payload);
return { code: 200, message: "创建派单成本价目成功", data: created.toJSON() };
return { code: 200, message: "创建勘察费用成功", data: created.toJSON() };
} catch (err: any) {
// 唯一冲突:重新生成编码后重试 1 次
if (err instanceof UniqueConstraintError) {
try {
payload.priceCode = await this.generatePriceCode();
const created = await this.dispatchPriceModel.create(payload);
return { code: 200, message: "创建派单成本价目成功", data: created.toJSON() };
return { code: 200, message: "创建勘察费用成功", data: created.toJSON() };
} catch (_e) {
return { code: 400, message: "价格编码已存在", data: null };
}
@@ -112,7 +112,7 @@ export class DispatchPriceService {
const payload = this.pickWritable(data);
await record.update(payload);
return { code: 200, message: "更新派单成本价目成功", data: record.toJSON() };
return { code: 200, message: "更新勘察费用成功", data: record.toJSON() };
}
async delete(id: number, ctx: Context): Promise<any> {
@@ -120,7 +120,7 @@ export class DispatchPriceService {
if (!record) return { code: 404, message: "价目不存在", data: null };
await record.destroy();
return { code: 200, message: "删除派单成本价目成功", data: null };
return { code: 200, message: "删除勘察费用成功", data: null };
}
async updateStatus(id: number, status: number, ctx: Context): Promise<any> {
@@ -130,6 +130,6 @@ export class DispatchPriceService {
if (!record) return { code: 404, message: "价目不存在", data: null };
await record.update({ status });
return { code: 200, message: "更新派单成本价目状态成功", data: null };
return { code: 200, message: "更新勘察费用状态成功", data: null };
}
}