feat: 新增智电改造线路台账功能(ICC拉取同步)
- 数据库:新增迁移脚本20261011_icc_line_ledger.sql(electric_line/line_room/icc_sync_log三表、菜单61、role_menu(1,61)、定时任务icc_line_sync),同步db_seed.sql - 后端:新增ElectricLine/IccSyncLog实体、查询DTO、线路台账服务与ICC拉取同步服务、/api/electric-lines控制器,接入RBAC(device:list)与定时任务 - 前端:新增智电改造线路台账页面及路由,API封装electricLineApi - ICC同步采用本系统主动拉取模式,失败仅记日志不抛错,接口统一code/message/data格式兼容APP
This commit is contained in:
1 parent
f72644c24f
commit
41765cdf44
21 files changed
+1363
-6
No files matched your search
@@ -143,4 +143,63 @@ export const smartDeviceApi = {
|
||||
|
||||
delete: (id: number) =>
|
||||
request.delete(`/smart-devices/${id}`),
|
||||
};
|
||||
|
||||
// ==================== 智电改造线路台账 ====================
|
||||
|
||||
export interface ElectricLine {
|
||||
id: number;
|
||||
lineCode: string;
|
||||
equipId: number;
|
||||
iccDeviceCode?: string;
|
||||
lineName?: string;
|
||||
customerId: number;
|
||||
buildingId?: number;
|
||||
floorNo?: string;
|
||||
location?: string;
|
||||
status: number;
|
||||
syncedAt?: string;
|
||||
createdAt: string;
|
||||
// 联表补全字段
|
||||
customerNo?: string;
|
||||
customerName?: string;
|
||||
equipCode?: string;
|
||||
equipName?: string;
|
||||
buildingName?: string;
|
||||
}
|
||||
|
||||
export interface ElectricLineQuery {
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
keyword?: string;
|
||||
customerId?: number;
|
||||
equipId?: number;
|
||||
buildingId?: number;
|
||||
status?: number;
|
||||
}
|
||||
|
||||
export interface ElectricLineListResult {
|
||||
list: ElectricLine[];
|
||||
total: number;
|
||||
page: number;
|
||||
pageSize: number;
|
||||
}
|
||||
|
||||
export interface IccLineSyncResult {
|
||||
pulled: number;
|
||||
synced: number;
|
||||
inserted: number;
|
||||
updated: number;
|
||||
skipped: number;
|
||||
}
|
||||
|
||||
export const electricLineApi = {
|
||||
getList: (params: ElectricLineQuery) =>
|
||||
request.get<ElectricLineListResult>('/electric-lines', { params }),
|
||||
|
||||
getDetail: (id: number) =>
|
||||
request.get<ElectricLine>(`/electric-lines/${id}`),
|
||||
|
||||
sync: () =>
|
||||
request.post<IccLineSyncResult>('/electric-lines/sync'),
|
||||
};
|
||||
Reference in new issue
Block a user