|
|
@@ -280,9 +280,8 @@ def _call_health(wind_code: str, month: str) -> List[Dict[str, Any]]:
|
|
|
|
|
|
|
|
|
def collect_health(wind: Dict[str, Any], months: List[str]) -> Dict[str, Any]:
|
|
|
- # 健康评估为逐机组模型推理,耗时较长;报告取时间段内最近 1 个月,
|
|
|
- # 其余维度(概览/故障/振动)仍覆盖完整时间段。
|
|
|
- assess_months = months[-1:]
|
|
|
+ # 报告与健康评估页同源:按所选时间段逐月调用健康评估页接口。
|
|
|
+ assess_months = list(months)
|
|
|
monthly = []
|
|
|
latest_turbines: List[Dict[str, Any]] = []
|
|
|
errors = []
|
|
|
@@ -561,5 +560,31 @@ def collect_all(wind_code: str, start_month: str, end_month: str, sections=None)
|
|
|
"generated_at": datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
|
|
|
"data_source": "energy_data_prod(SCADA/故障/振动) + energy_prod(台账/健康)",
|
|
|
},
|
|
|
+ "provenance": {
|
|
|
+ "overview": {
|
|
|
+ "page": "分析概览",
|
|
|
+ "source": f"energy_data_prod.{wind_code}_minute",
|
|
|
+ "period": [start_month, end_month],
|
|
|
+ "filter": "year_month + 分钟级有功/风速聚合",
|
|
|
+ },
|
|
|
+ "health": {
|
|
|
+ "page": "健康评估",
|
|
|
+ "source": HEALTH_API,
|
|
|
+ "period": months,
|
|
|
+ "filter": "windcode + month,逐月调用页面接口",
|
|
|
+ },
|
|
|
+ "fault": {
|
|
|
+ "page": "故障诊断",
|
|
|
+ "source": f"energy_data_prod.{wind_code}_fault",
|
|
|
+ "period": [start_month, end_month],
|
|
|
+ "filter": "time_stamp 月区间",
|
|
|
+ },
|
|
|
+ "vibration": {
|
|
|
+ "page": "振动分析",
|
|
|
+ "source": f"energy_data_prod.{wind_code}_wave",
|
|
|
+ "period": [start_month, end_month],
|
|
|
+ "filter": "time_stamp 月区间 + 波形解析",
|
|
|
+ },
|
|
|
+ },
|
|
|
}
|
|
|
return data
|