feat(analog): 新增ICC模拟量数据同步 - 重建electricity_data表(迁移20261024_icc_analog_data.sql:删除equip_id与electricity占位列、icc_device_code更名imei、新增analog_type/analog_name/analog_unit/analog_value、collect_time以同步时间填充、按月分区2026_10~2027_03、唯一键(line_code,analog_type,collect_time));同步服务IccAnalogSyncService复用OAuth2鉴权,按已同步线路line_code分批(≤50)拉取最新模拟量(POST /analog/subsystem/page,pageSize=500短页停止)幂等upsert并写icc_sync_log(sync_type=electricity_data);新增POST /api/electricity-data/sync手动同步(RBAC device:list);注册icc_analog_sync每5分钟定时任务与sys_job种子;同步db_init/db_seed与设计文档;无前端改动

This commit is contained in:
wk authored and trae-solo-agent committed 2026-10-24 14:52:22 +08:00
1 parent 160ad85051
commit c92fc7f298
15 files changed
+701 -27

No files matched your search

@@ -0,0 +1,14 @@
import { Controller, Post, Inject } from "@midwayjs/core";
import { Context } from "@midwayjs/koa";
import { IccAnalogSyncService } from "../service/icc_analog_sync.service";
@Controller("/api/electricity-data")
export class ElectricityDataController {
@Inject() ctx!: Context;
@Inject() iccAnalogSyncService!: IccAnalogSyncService;
@Post("/sync") async sync() {
const result = await this.iccAnalogSyncService.syncFromIcc(this.ctx);
return { code: 200, message: "模拟量数据同步完成", data: result };
}
}