feat: v2.0 — maintenance module, AI analysis, station power fix
- Add full 检修维护中心 (6.4): 3-type work orders (消缺/巡检/抄表), asset management, warehouse, work plans, billing settlement - Add AI智能分析 tab with LLM-powered diagnostics (StepFun + ZhipuAI) - Add AI模型配置 settings page (provider, temperature, prompts) - Fix station power accuracy: use API station total (station_power) instead of inverter-level computation — eliminates timing gaps - Add 7 new DB models, 4 new API routers, 5 new frontend pages - Migrations: 009 (maintenance expansion) + 010 (AI analysis) - Version bump: 1.6.1 → 2.0.0 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -86,3 +86,21 @@ class OpsInsight(Base):
|
||||
generated_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
valid_until = Column(DateTime(timezone=True))
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
|
||||
|
||||
class AIAnalysisResult(Base):
|
||||
"""AI智能分析结果"""
|
||||
__tablename__ = "ai_analysis_results"
|
||||
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
scope = Column(String(20), default="station") # device, station, all
|
||||
device_id = Column(Integer, ForeignKey("devices.id"), nullable=True)
|
||||
analysis_type = Column(String(20), default="diagnostic") # diagnostic, insight, custom
|
||||
prompt_used = Column(Text)
|
||||
result_text = Column(Text)
|
||||
model_used = Column(String(100))
|
||||
provider_used = Column(String(20)) # stepfun, zhipu
|
||||
tokens_used = Column(Integer)
|
||||
duration_ms = Column(Integer)
|
||||
created_by = Column(Integer, ForeignKey("users.id"))
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
|
||||
Reference in New Issue
Block a user