Explorar o código

[26111301] 新增理论功率模块:菜单与字典脚本、16 个查询/导出接口、7 个前端页面

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
taosj hai 3 días
pai
achega
0255233a09
Modificáronse 37 ficheiros con 4737 adicións e 5 borrados
  1. 373 0
      QWEN.md
  2. 16 2
      forecast-backend-server/src/main/java/com/ufo/project/config/domain/ConfigStation.java
  3. 11 0
      forecast-backend-server/src/main/java/com/ufo/project/config/mapper/ConfigStationMapper.java
  4. 14 0
      forecast-backend-server/src/main/java/com/ufo/project/model/mapper/DataElectricityLocalMapper.java
  5. 180 0
      forecast-backend-server/src/main/java/com/ufo/project/theoretical/calc/TheoreticalPowerCalc.java
  6. 257 0
      forecast-backend-server/src/main/java/com/ufo/project/theoretical/controller/TheoreticalPowerController.java
  7. 52 0
      forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/CurtailedEnergyQuery.java
  8. 70 0
      forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/CurtailedEnergyRow.java
  9. 65 0
      forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/DailyReportQuery.java
  10. 84 0
      forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/IntraPlantCheckRow.java
  11. 104 0
      forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/LatestPowerRow.java
  12. 26 0
      forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/LatestQuery.java
  13. 112 0
      forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/LogicCheckRow.java
  14. 65 0
      forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/MonthlyReportQuery.java
  15. 84 0
      forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/OffSiteCheckRow.java
  16. 52 0
      forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/PowerCheckQuery.java
  17. 112 0
      forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/ReportRow.java
  18. 98 0
      forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/TheoreticalEnergyRow.java
  19. 52 0
      forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/TheoreticalPowerQuery.java
  20. 98 0
      forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/TheoreticalPowerRow.java
  21. 99 0
      forecast-backend-server/src/main/java/com/ufo/project/theoretical/service/ITheoreticalPowerService.java
  22. 1040 0
      forecast-backend-server/src/main/java/com/ufo/project/theoretical/service/impl/TheoreticalPowerServiceImpl.java
  23. 14 0
      forecast-backend-server/src/main/java/com/ufo/project/weather/mapper/DataWeatherLocalMapper.java
  24. 11 2
      forecast-backend-server/src/main/resources/mybatis/config/ConfigStationMapper.xml
  25. 15 0
      forecast-backend-server/src/main/resources/mybatis/model/DataElectricityLocalMapper.xml
  26. 16 0
      forecast-backend-server/src/main/resources/mybatis/weather/DataWeatherLocalMapper.xml
  27. 165 0
      forecast-backend-vue/src/api/theoretical/power.js
  28. 207 0
      forecast-backend-vue/src/views/ufo/theoretical/PvCurtailmentEnergy.vue
  29. 227 0
      forecast-backend-vue/src/views/ufo/theoretical/PvCurtailmentEnergyDaily.vue
  30. 178 0
      forecast-backend-vue/src/views/ufo/theoretical/PvCurtailmentEnergyMonthly.vue
  31. 157 0
      forecast-backend-vue/src/views/ufo/theoretical/PvIntraPlantPowerCheck.vue
  32. 153 0
      forecast-backend-vue/src/views/ufo/theoretical/PvOffSitePowerCheck.vue
  33. 167 0
      forecast-backend-vue/src/views/ufo/theoretical/PvStationLogicCheck.vue
  34. 247 0
      forecast-backend-vue/src/views/ufo/theoretical/PvTheoreticalPower.vue
  35. 73 0
      release_note/20261112/ddl.sql
  36. 29 1
      release_note/20261112/dml.sql
  37. 14 0
      release_note/20261112/release_note.md

+ 373 - 0
QWEN.md

@@ -0,0 +1,373 @@
+# 功率预测系统 (Electricity Service)
+
+Spring Boot + Vue3 前后端分离项目,面向电力(光伏/风电)发电功率预测、气象监控、设备管理的现代化企业级系统。
+
+## 仓库结构
+
+```
+qx/forecast/
+├── forecast-backend-server/    # 后端 — Spring Boot 2.7.18
+├── forecast-backend-vue/       # 前端 — Vue 3 + Ant Design Vue
+├── forecast-common/            # 公共模块 (前后端共用)
+├── forecast-dao/               # 数据访问层
+├── gateway/                    # 微服务网关 (forecast-device-gateway)
+├── pom.xml                     # 多模块根 POM
+├── doc/                        # 项目文档
+├── 资料/                        # 参考资料
+└── release_note/               # 版本发布说明
+```
+
+## 1. forecast-backend-server — 后端服务
+
+### 1.1 技术栈
+
+| 层级 | 技术 |
+|------|------|
+| **框架** | Spring Boot 2.7.18, Java 1.8 |
+| **数据库** | PostgreSQL (druid 连接池) |
+| **ORM** | MyBatis + PageHelper 分页插件 |
+| **安全** | Spring Security + JWT Token |
+| **缓存** | Redis (spring-boot-starter-data-redis) |
+| **任务调度** | Quartz |
+| **JSON** | Fastjson2 2.0.47 |
+| **文件/Excel** | EasyExcel 4.0.3, Apache POI 5.2.5 |
+| **代码生成** | Velocity 模板 |
+| **验证码** | EasyCaptcha |
+| **支付** | IJPay (微信/支付宝/银联/京东/PayPal) |
+| **AI** | OpenAI Java SDK 4.8.0 |
+
+### 1.2 项目配置
+
+- **端口**: `8081`
+- **上下文**: `/`
+- **Profile**: `test` (dev/test/prod 三套配置 `application-{env}.yml`)
+- **Maven Profile**: `development` (默认, 使用 dev profile), `production` (使用 prod profile)
+- **文件上传路径**: `./upload` (可通过环境变量 `UPLOAD_PATH` 覆盖)
+- **Token 有效期**: 30 分钟, header=`Authorization`, secret 通过 `JWT_SECRET` 环境变量覆盖
+- **XSS 防护**: 全局开启, 排除 `/system/notice`
+
+### 1.3 包结构
+
+```
+com.ufo/
+├── ElectricityServiceApplication.java    # 启动类
+│
+├── base/
+│   ├── common/                           # 通用组件
+│   │   ├── core/                         # 核心基础类 (文本工具等)
+│   │   ├── constant/                     # 常量定义
+│   │   ├── enums/                        # 枚举类
+│   │   ├── filter/                       # 过滤器 (XSS 等)
+│   │   ├── utils/                        # 工具类
+│   │   └── xss/                          # XSS 防护
+│   │
+│   └── framework/                        # 框架层
+│       ├── aspectj/                      # AOP 切面
+│       ├── config/                       # 配置类
+│       │   ├── ApplicationConfig         # 应用配置
+│       │   ├── DruidConfig               # 数据库连接池
+│       │   ├── FilterConfig              # 过滤器链
+│       │   ├── MyBatisConfig             # MyBatis 配置
+│       │   ├── RedisConfig               # Redis 序列化
+│       │   ├── ResourcesConfig           # Web 资源
+│       │   ├── SecurityConfig            # Spring Security/JWT
+│       │   ├── ScheduleConfig            # Quartz 定时任务
+│       │   ├── ThreadPoolConfig          # 线程池
+│       │   └── ...
+│       ├── datasource/                   # 多数据源支持
+│       ├── interceptor/                  # 拦截器
+│       ├── manager/                      # 异步任务管理
+│       ├── redis/                        # Redis 工具
+│       ├── security/                     # 安全认证
+│       ├── task/                         # 定时任务
+│       └── web/                          # Web 层基类
+│
+├── module/                               # 基础业务模块 (类 RuoYi)
+│   ├── common/                           # 通用控制器
+│   ├── system/                           # 系统管理 (用户/角色/菜单/字典/岗位/部门等)
+│   ├── monitor/                          # 系统监控 (在线用户/操作日志/登录日志/服务/缓存/定时任务)
+│   └── tool/                             # 系统工具 (代码生成 GenController)
+│
+└── project/                              # 业务模块
+    ├── alarm/                            # 告警管理 (告警记录/规则/规则模板/故障处理/巡检记录/监控发送)
+    ├── api/                              # API 开放平台 (OAuth2/访问控制/版本发布/API 记录)
+    ├── assessment/                       # 考核管理 (指标/规则/任务)
+    ├── config/                           # 配置管理 (站点/设备/测点/通道/协议/省份城市/供应商/限电等)
+    │   ├── ConfigStationController       # 站点配置
+    │   ├── ConfigDeviceController        # 设备配置
+    │   ├── ConfigPointController         # 测点配置
+    │   ├── ConfigStationPowerLimitCtrl   # 站点功率限额
+    │   └── ...
+    ├── data/                             # 数据报表 (光伏/风电数据对比、短期预测报表等)
+    ├── datasource/                       # 数据采集源 (抓数据配置/文件分析/用户关联)
+    ├── forecast/                         # ⭐ 功率预测 (核心业务)
+    │   ├── shortterm/
+    │   │   ├── power/                    # 短期功率预测 (原始/修正/发布/回填/报表)
+    │   │   └── weather/                  # 短期气象预测 (原始/修正/发布/回填/报表)
+    │   ├── supershorted/                 # 超短期预测 (原始/修正/发布/回填/报表)
+    │   └── power/                        # 超短期功率预测
+    ├── model/                            # 模型管理 (算法/版本/训练任务/预测任务/评估/精度排名/触发策略)
+    ├── rbac/                             # RBAC 权限 (用户/角色/菜单/模块/角色菜单/用户角色)
+    ├── realtime/                         # 实时数据 (超短期/站点设备功率/设备天气/气象站)
+    ├── report/                           # 报表管理 (站点/模板/任务/指标统计/多模型)
+    ├── weather/                          # 气象数据 (台风/天气预警/天气区域/警报)
+    └── ...
+```
+
+### 1.4 启动方式
+
+```bash
+cd forecast-backend-server
+# 默认使用 test profile
+mvn spring-boot:run
+
+# 或指定 profile
+mvn spring-boot:run -Dspring.profiles.active=dev
+mvn spring-boot:run -Dspring.profiles.active=prod
+
+# 打包
+mvn clean package -Pproduction
+```
+
+### 1.5 数据库
+
+- **数据库**: PostgreSQL
+- **MyBatis Mapper XML 位置**: `src/main/resources/mybatis/` (按业务模块分目录: `power/`, `rbac/`, `config/`, `alarm/`, `datasource/`, `monitor/` 等)
+- **SQL 脚本**: `src/main/resources/sql/`
+  - `electricity_init_new.sql` — 初始化表结构
+  - `electricity_init_new_dm.sql` — 达梦数据库版本
+  - `electricity_mock_new.sql` — 模拟数据
+  - `20260819_short_term_power_forecasting.sql` — 短期预测表
+  - `20260819_ultra_short_term_power_forecasting.sql` — 超短期预测表
+
+### 1.6 代码生成器
+
+基于 Velocity 模板,可一键生成前后端 CRUD 代码。
+- 配置入口: `base/framework/config/GenConfig`
+- 控制器: `module/tool/gen/controller/GenController`
+- Mapper XML 位于 `mybatis/tool/` 目录
+
+### 1.7 核心业务领域
+
+这是一个**电力功率预测系统**,主要功能包括:
+
+1. **功率预测** (核心): 短期/超短期功率预测和气象预测,每个预测周期有原始(RO)→修正(CO)→发布(IS)→回填(BA)→报表(RP) 五个状态
+2. **站点设备管理**: 光伏/风电站点、设备、测点、通道、协议的 CRUD 配置
+3. **实时数据采集**: 设备功率、天气、气象站等实时数据
+4. **气象数据**: 台风预警、天气警报、天气区域
+5. **告警管理**: 告警规则、告警记录、故障处理、巡检记录
+6. **模型管理**: 预测模型算法、版本、训练/预测任务、精度评估
+7. **报表统计**: 气象指标、考核指标、报表模板和任务
+8. **系统管理**: 基于 RBAC 的权限体系 (用户/角色/菜单)
+9. **API 开放平台**: OAuth2 客户端、API 版本发布、访问控制
+
+## 2. forecast-backend-vue — 前端
+
+基于 BearJia 模板定制,面向电力功率预测业务的前端应用。
+
+### 2.1 技术栈
+
+| 层级 | 技术 |
+|------|------|
+| **框架** | Vue 3.4.21 (Composition API) |
+| **UI 组件库** | Ant Design Vue 4.1.2 |
+| **构建工具** | Vite 5.1.4 |
+| **状态管理** | Pinia 2.1.7 |
+| **路由** | Vue Router 4.3.0 |
+| **HTTP 客户端** | Axios 1.6.7 |
+| **图表** | ECharts 5.6.0 |
+| **表单** | FormCreate (ant-design-vue) 3.2.31 |
+| **富文本** | WangEditor 5.1.23 |
+| **代码高亮** | vue3-highlightjs |
+| **工具库** | VueUse 10.9.0, dayjs 1.11.10, JS Cookie, SortableJS |
+| **开发辅助** | Unplugin Auto Import, Unplugin Vue Components |
+
+### 2.2 环境配置
+
+| 环境 | 文件 | 端口 | 基础路径 | 代理路径 |
+|------|------|------|----------|----------|
+| 开发 | `.env.dev` | 8090 | `/` | `/dev-api` → `localhost:8080` |
+| 测试 | `.env.test` | 8088 | `/` | `/test-api` → Nginx 代理 |
+| 生产 | `.env.prod` | 80 | `/` | `/prod-api` → Nginx 代理 |
+
+### 2.3 目录结构
+
+```
+forecast-backend-vue/
+├── config/vite/                    # Vite 配置模块化
+├── src/
+│   ├── api/                        # API 接口 (按业务域分包)
+│   │   ├── alarm/                  # 告警接口
+│   │   ├── assessment/             # 考核接口
+│   │   ├── config/                 # 配置接口 (站点/设备/测点等)
+│   │   ├── data/                   # 数据报表接口
+│   │   ├── datasource/             # 数据采集接口
+│   │   ├── forecast/               # 预测接口 (短期/超短期)
+│   │   ├── model/                  # 模型接口
+│   │   ├── monitor/                # 监控接口
+│   │   ├── power/                  # 功率接口
+│   │   ├── rbac/                   # 权限接口
+│   │   ├── realtime/               # 实时数据接口
+│   │   ├── report/                 # 报表接口
+│   │   ├── system/                 # 系统管理接口
+│   │   └── weather/                # 气象接口
+│   │
+│   ├── assets/                     # 静态资源
+│   ├── components/                 # 公共组件
+│   │   ├── BearJiaProTable/        # 统一表格组件 (含搜索/分页/导出)
+│   │   ├── SearchForm/             # 搜索表单组件
+│   │   ├── TableActionBar/         # 表格操作栏
+│   │   ├── PageContainer/          # 页面容器
+│   │   ├── DictTag/                # 字典标签
+│   │   ├── FileUpload/             # 文件上传
+│   │   ├── ImageUpload/            # 图片上传
+│   │   ├── ImagePreview/           # 图片预览
+│   │   ├── IconSelector/           # 图标选择器
+│   │   ├── Ellipsis/               # 文本省略
+│   │   ├── editor/                 # 富文本编辑器 (WangEditor)
+│   │   ├── layout/                 # 布局组件 (侧边栏/顶栏/历史导航/设置抽屉)
+│   │   └── common/                 # 通用组件 (消息中心/全局加载/搜索/全屏)
+│   │
+│   ├── composables/                # Composition API 组合函数
+│   │   ├── useDict.js              # 字典管理
+│   │   ├── useTable.js             # 表格逻辑
+│   │   └── useFullscreen.js        # 全屏处理
+│   │
+│   ├── config/                     # 运行时配置
+│   │   └── system.config.js
+│   │
+│   ├── directive/                  # 自定义指令
+│   │   └── permission/             # 权限指令 v-hasPermi
+│   │
+│   ├── layout/                     # 布局文件
+│   │   ├── BaseLayout.vue          # 主布局 (含侧边栏/顶栏/标签页)
+│   │   ├── FrontendLayout.vue      # 前端展示页布局
+│   │   ├── ParentView/             # 父级容器
+│   │   └── InnerLink/              # 内嵌链接
+│   │
+│   ├── plugins/                    # Vue 插件
+│   │   ├── auth.js                 # 权限校验
+│   │   ├── cache.js                # 缓存工具
+│   │   ├── errorHandler.js         # 全局错误处理
+│   │   ├── modal.js                # 弹窗封装
+│   │   ├── table.js                # 表格插件
+│   │   ├── tab.js                  # 标签页插件
+│   │   └── dayjs.js                # 日期配置
+│   │
+│   ├── router/                     # 路由配置
+│   │   ├── vueRouter.js            # Vue Router 实例 (含守卫)
+│   │   ├── routes.js               # 路由定义 (公共+动态)
+│   │   ├── electricity.js          # 电力业务路由
+│   │   └── frontend.js             # 前端展示路由
+│   │
+│   ├── stores/                     # Pinia 状态管理
+│   │   ├── app.js                  # 应用状态
+│   │   ├── user.js                 # 用户信息/Token
+│   │   ├── permission.js           # 动态路由 (菜单权限过滤)
+│   │   ├── tagsView.js             # 标签页状态
+│   │   └── tableConfig.js          # 表格配置
+│   │
+│   ├── style/                      # 全局样式 (Less)
+│   │   └── global.less
+│   │
+│   ├── utils/                      # 工具函数
+│   │   ├── request.js              # Axios 封装 (拦截器/Token/错误处理)
+│   │   ├── theme.js                # 主题服务 (亮色/暗色/系统跟随)
+│   │   └── configInit.js           # 配置初始化
+│   │
+│   └── views/                      # 页面组件
+│       ├── ufo/                    # ⭐ 业务页面 (统一 /ufo/ 前缀)
+│       │   ├── workbench/          # 主看板/工作台
+│       │   ├── electricity/        # 电力核心业务
+│       │   │   ├── forecast/       # 功率预测页面 (短期/超短期)
+│       │   │   ├── analysis/       # 数据分析页面
+│       │   │   ├── dashboard/      # 数据看板
+│       │   │   ├── realtime/       # 实时数据页面
+│       │   │   ├── report/         # 报表页面
+│       │   │   ├── device/         # 设备管理页面
+│       │   │   ├── weather/        # 气象页面
+│       │   │   └── fault/          # 故障处理页面
+│       │   ├── config/             # 配置管理页面
+│       │   │   └── station/        # 站点配置 (含设备/测点/模块子页面)
+│       │   ├── system/             # 系统管理页面 (用户/角色/菜单/字典/岗位/部门/通知)
+│       │   ├── monitor/            # 系统监控 (在线用户/操作日志/登录日志/服务/缓存/定时任务/Druid)
+│       │   ├── datareport/         # 数据报表页面
+│       │   └── tool/               # 系统工具 (代码生成)
+│       ├── frontend/               # 前端展示页
+│       ├── error/                  # 错误页 (404 等)
+│       └── LoginPage[23].vue       # 多主题登录页
+```
+
+### 2.4 核心功能模块
+
+1. **主看板/工作台**: 系统总览,关键指标展示
+2. **功率预测**: 短期/超短期功率预测和气象预测的前端操作界面
+3. **数据分析**: 预测数据分析与可视化
+4. **设备管理**: 光伏/风电站点、设备、测点、通道配置
+5. **实时数据**: 设备功率、天气、气象站实时数据展示
+6. **报表管理**: 预测报表、统计报表查看与导出
+7. **告警管理**: 告警记录查看、故障处理、巡检记录
+8. **气象中心**: 台风预警、天气警报管理
+9. **系统管理**: 用户/角色/菜单/字典/岗位/部门管理
+10. **系统监控**: 在线用户/操作日志/登录日志/服务/缓存/定时任务
+11. **数据字典**: 下拉选项配置与管理
+
+### 2.5 前端特色
+
+- **动态路由**: 基于菜单权限动态加载路由 (后端 `/getRouters` 接口)
+- **多布局模式**: 侧边栏/顶栏/混合布局,通过 `SettingDrawer` 配置抽屉切换
+- **主题系统**: 亮色/暗色主题,支持跟随系统 (基于 Less 变量)
+- **BearJiaProTable**: 统一表格组件,集成搜索、分页、列设置、导出功能
+- **历史导航**: 智能标签页管理,支持右键菜单
+- **FormCreate**: 动态表单渲染
+- **组件自动导入**: Unplugin Auto Import + Unplugin Vue Components,无需手动 import
+
+### 2.6 启动方式
+
+```bash
+cd forecast-backend-vue
+
+# 安装依赖
+yarn install   # 或 npm install
+
+# 启动开发服务器 (dev 环境, 端口 8090)
+yarn dev
+
+# 测试环境构建
+yarn build:test
+
+# 生产环境构建
+yarn build:prod
+
+# 预览构建结果
+yarn preview
+
+# 代码检查与格式化
+yarn lint
+yarn lint:fix
+yarn format
+```
+
+## 3. 开发约定
+
+- 项目参考 BearJia/RuoYi-Vue 架构,基础模块遵循 `module` + `framework` 分层
+- 业务模块放在 `project` 下,按领域分包: `config`/`forecast`/`alarm`/`model`/`data`/`report`/`weather`/`api`/`assessment`/`datasource`/`realtime`/`rbac`
+- Controller → Service → Mapper 三层架构
+- Domain 对象统一放在 `com.ufo.project.{module}.domain`
+- Mapper XML 统一放在 `src/main/resources/mybatis/{module}/`
+- 接口命名: Service 使用 `I{Domain}Service`,实现类 `{Domain}ServiceImpl`
+- 前端路由统一使用 `/ufo/` 前缀,页面组件放在 `src/views/ufo/` 下
+- 前端 API 接口按业务域分包,放在 `src/api/` 下,与后端模块对应
+
+### 3.1 理论功率模块
+
+- 包位置: `com.ufo.project.theoretical`(controller/service/domain,Mapper XML 在 `src/main/resources/mybatis/theoretical/`)
+- 16 个查询/导出接口统一基路径 `/theoretical/power`,全部 POST
+- 测光法系数 a1/a2 读字典 `algorithm_config`/测光法配置,校核阈值读字典 `theoretical_power_config`;字典缓存为纯 Redis、无 DB 回源,改字典后必须重启后端服务才生效
+- `config_station.inverter_quantity` 为测光法逆变器台数 n(P = n×(a1×G+a2×T))
+
+### 3.2 SQL 脚本规范(release_note)
+
+- 新版本脚本放 `release_note/{yyyyMMdd}/`(目录不存在则新建),按文件拆分: 表结构/ALTER/COMMENT 与菜单 → `ddl.sql`,字典与初始化数据 → `dml.sql`,维护 `release_note.md`(功能说明 / [更新说明] / [备注] 三段)
+- 全部脚本可重复执行: 建表先 drop 再 create(含 sequence);insert 加 `WHERE NOT EXISTS` 或先删后插;alter 加 `IF NOT EXISTS`
+- 菜单脚本格式: 一级菜单 M 类型 `parent_id=0` 字面量,`path` 单英文单词,component/query/route_name/perms 留空;二级菜单 C 类型 `parent_id` 按父菜单名称反查(须加 `and t.parent_id = 0` 限定),path/component/route_name/perms 必填;`menu_id` 统一用 `nextval(pg_get_serial_sequence('sys_menu','menu_id'))`;生成时调用方只需提供菜单名称 / order_num / 所属一级菜单名称 / 页面 path

+ 16 - 2
forecast-backend-server/src/main/java/com/ufo/project/config/domain/ConfigStation.java

@@ -66,6 +66,10 @@ public class ConfigStation extends BaseEntity
     @Excel(name = "风机/光伏板数量")
     private Long fansPvPanelquantity;
 
+    /** 逆变器数量 */
+    @Excel(name = "逆变器数量")
+    private Integer inverterQuantity;
+
     /** 海拔 */
     @Excel(name = "海拔")
     private String elevation;
@@ -239,11 +243,20 @@ public class ConfigStation extends BaseEntity
         this.fansPvPanelquantity = fansPvPanelquantity;
     }
 
-    public Long getFansPvPanelquantity() 
+    public Long getFansPvPanelquantity()
     {
         return fansPvPanelquantity;
     }
-    public void setElevation(String elevation) 
+    public void setInverterQuantity(Integer inverterQuantity)
+    {
+        this.inverterQuantity = inverterQuantity;
+    }
+
+    public Integer getInverterQuantity()
+    {
+        return inverterQuantity;
+    }
+    public void setElevation(String elevation)
     {
         this.elevation = elevation;
     }
@@ -395,6 +408,7 @@ public class ConfigStation extends BaseEntity
             .append("installedCapacity", getInstalledCapacity())
             .append("gridConnectedCapacity", getGridConnectedCapacity())
             .append("fansPvPanelquantity", getFansPvPanelquantity())
+            .append("inverterQuantity", getInverterQuantity())
             .append("elevation", getElevation())
             .append("operationTime", getOperationTime())
             .append("boosterstationVoltageLevel", getBoosterstationVoltageLevel())

+ 11 - 0
forecast-backend-server/src/main/java/com/ufo/project/config/mapper/ConfigStationMapper.java

@@ -1,6 +1,9 @@
 package com.ufo.project.config.mapper;
 
 import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+
 import com.ufo.project.config.domain.ConfigStation;
 
 /**
@@ -27,6 +30,14 @@ public interface ConfigStationMapper
      */
     public List<ConfigStation> selectConfigStationByIds(Long[] ids);
 
+    /**
+     * 按场站统一编码查询场站信息(未删除,取第一条)
+     *
+     * @param stationCode 场站统一编码
+     * @return 场站信息
+     */
+    public ConfigStation selectConfigStationByCode(@Param("stationCode") String stationCode);
+
     /**
      * 查询场站信息列表
      *

+ 14 - 0
forecast-backend-server/src/main/java/com/ufo/project/model/mapper/DataElectricityLocalMapper.java

@@ -52,6 +52,20 @@ public interface DataElectricityLocalMapper
     public List<DataElectricityLocal> selectActualPowerRange(@Param("configStationId") Long configStationId,
             @Param("startTime") String startTime, @Param("endTime") String endTime);
 
+    /**
+     * 按时间区间分页查询功率采样数据(keyset 游标分页,游标为 (tm, config_station_id))
+     *
+     * @param configStationId 场站id
+     * @param startTime 起始时间(ISO 8601带时区字符串,包含)
+     * @param endTime 结束时间(ISO 8601带时区字符串,不包含;service 层将含截止日转换为截止日次日 00:00 传入)
+     * @param lastTm 上一页最后一条记录的 tm(ISO 8601 字符串),首页传 null
+     * @param lastStationId 上一页最后一条记录的 config_station_id,首页传 null
+     * @return 功率采样数据集合(按 tm, config_station_id 升序,每页最多 2000 条)
+     */
+    public List<DataElectricityLocal> selectElectricityPaged(@Param("configStationId") Long configStationId,
+            @Param("startTime") String startTime, @Param("endTime") String endTime,
+            @Param("lastTm") String lastTm, @Param("lastStationId") Long lastStationId);
+
     /**
      * 新增功率采样数据
      * 

+ 180 - 0
forecast-backend-server/src/main/java/com/ufo/project/theoretical/calc/TheoreticalPowerCalc.java

@@ -0,0 +1,180 @@
+package com.ufo.project.theoretical.calc;
+
+import java.math.BigDecimal;
+import java.math.RoundingMode;
+import java.util.List;
+
+/**
+ * 理论功率计算助手(纯 JDK,无 Spring/MyBatis 依赖)
+ *
+ * 口径来源:aicoding/26111301.md 与 docs/superpowers/specs/2026-11-16-theoretical-power-design.md
+ *
+ * @author ufo
+ */
+public class TheoreticalPowerCalc
+{
+    private TheoreticalPowerCalc()
+    {
+    }
+
+    /**
+     * 采样对齐(设计 §3.3):points 按时间升序 (epochSec, value);
+     * 先取 tm==targetSec 精确点;否则取 [targetSec, targetSec+deltaMin*60) 内 epoch 最大点;无 → 0
+     *
+     * @param points    升序原始点 (epochSec, value)
+     * @param targetSec 目标时刻(epoch 秒)
+     * @param deltaMin  采样窗口(分钟,5/15)
+     * @return 采样值;无点 → 0
+     */
+    public static double samplePoint(List<double[]> points, long targetSec, int deltaMin)
+    {
+        if (points == null || points.isEmpty())
+        {
+            return 0;
+        }
+        long windowEnd = targetSec + deltaMin * 60L;
+        double best = 0;
+        boolean found = false;
+        for (double[] p : points)
+        {
+            long t = (long) p[0];
+            if (t == targetSec)
+            {
+                return p[1];
+            }
+            if (t >= targetSec && t < windowEnd)
+            {
+                // points 升序,窗口内后者 epoch 更大,持续覆盖即取最大值
+                best = p[1];
+                found = true;
+            }
+            else if (t >= windowEnd)
+            {
+                break;
+            }
+        }
+        return found ? best : 0;
+    }
+
+    /**
+     * 可用功率 = 理论功率 × availability / 100(availability null 按 100)
+     *
+     * @param theoretical  理论功率
+     * @param availability 可用率(百分比)
+     * @return 可用功率
+     */
+    public static double availablePower(Double theoretical, Double availability)
+    {
+        if (theoretical == null)
+        {
+            return 0;
+        }
+        if (availability == null)
+        {
+            return theoretical;
+        }
+        return theoretical * availability / 100;
+    }
+
+    /**
+     * 测光法理论功率 P = n × (a1×G + a2×T)
+     *
+     * @param n                  逆变器数量(null → 0)
+     * @param a1                 辐照系数
+     * @param a2                 温度系数
+     * @param irradiance         总辐照度(null 或 <=0 → 用斜射辐照度)
+     * @param inclinedIrradiance 斜射辐照度
+     * @param temperature        温度(null → 0)
+     * @return 理论功率
+     */
+    public static double photometricPower(Integer n, double a1, double a2, Double irradiance, Double inclinedIrradiance, Double temperature)
+    {
+        if (n == null)
+        {
+            return 0;
+        }
+        double g;
+        if (irradiance != null && irradiance > 0)
+        {
+            g = irradiance;
+        }
+        else if (inclinedIrradiance != null)
+        {
+            g = inclinedIrradiance;
+        }
+        else
+        {
+            g = 0;
+        }
+        double t = temperature == null ? 0 : temperature;
+        return n * (a1 * g + a2 * t);
+    }
+
+    /**
+     * 电量单点法(设计 §3.4):升序原始点 [(t1,p1)...(tn,pn)],单位 kW;
+     * E_i=(p_i+p_{i+1})/2×Δt_i 小时 (i<n);E_n=p_n×(dayEndSec−t_n) 小时;Σ kW·h ÷ 10000 = 万千瓦时
+     *
+     * @param rawPoints  升序原始点 (epochSec, kW)
+     * @param dayEndSec  次日 00:00(epoch 秒)
+     * @return 当日总电量(万千瓦时)
+     */
+    public static double energyWanKwh(List<double[]> rawPoints, long dayEndSec)
+    {
+        if (rawPoints == null || rawPoints.isEmpty())
+        {
+            return 0;
+        }
+        double kwh = 0;
+        int n = rawPoints.size();
+        for (int i = 0; i < n - 1; i++)
+        {
+            double[] cur = rawPoints.get(i);
+            double[] next = rawPoints.get(i + 1);
+            double dtHours = (next[0] - cur[0]) / 3600.0;
+            kwh += (cur[1] + next[1]) / 2 * dtHours;
+        }
+        double[] last = rawPoints.get(n - 1);
+        if (dayEndSec > last[0])
+        {
+            double dtHours = (dayEndSec - last[0]) / 3600.0;
+            kwh += last[1] * dtHours;
+        }
+        return kwh / 10000;
+    }
+
+    /**
+     * 百分比 = num / den × 100;num null → 0;den null 或 0 → 0
+     *
+     * @param num 分子
+     * @param den 分母
+     * @return 百分比值
+     */
+    public static double ratio100(Double num, Double den)
+    {
+        if (num == null)
+        {
+            return 0;
+        }
+        if (den == null || den == 0)
+        {
+            return 0;
+        }
+        return num / den * 100;
+    }
+
+    /**
+     * 四舍五入(HALF_UP)到指定位数
+     *
+     * @param v     原值
+     * @param scale 保留位数
+     * @return 保留后数值
+     */
+    public static double round(double v, int scale)
+    {
+        if (Double.isNaN(v) || Double.isInfinite(v))
+        {
+            return 0;
+        }
+        return BigDecimal.valueOf(v).setScale(scale, RoundingMode.HALF_UP).doubleValue();
+    }
+}

+ 257 - 0
forecast-backend-server/src/main/java/com/ufo/project/theoretical/controller/TheoreticalPowerController.java

@@ -0,0 +1,257 @@
+package com.ufo.project.theoretical.controller;
+
+import java.io.IOException;
+import java.net.URLEncoder;
+import java.util.List;
+
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.alibaba.excel.EasyExcel;
+import com.ufo.base.framework.aspectj.lang.annotation.Log;
+import com.ufo.base.framework.aspectj.lang.enums.BusinessType;
+import com.ufo.base.framework.web.controller.BaseController;
+import com.ufo.base.framework.web.domain.AjaxResult;
+import com.ufo.project.theoretical.domain.CurtailedEnergyQuery;
+import com.ufo.project.theoretical.domain.CurtailedEnergyRow;
+import com.ufo.project.theoretical.domain.DailyReportQuery;
+import com.ufo.project.theoretical.domain.IntraPlantCheckRow;
+import com.ufo.project.theoretical.domain.LatestPowerRow;
+import com.ufo.project.theoretical.domain.LatestQuery;
+import com.ufo.project.theoretical.domain.LogicCheckRow;
+import com.ufo.project.theoretical.domain.MonthlyReportQuery;
+import com.ufo.project.theoretical.domain.OffSiteCheckRow;
+import com.ufo.project.theoretical.domain.PowerCheckQuery;
+import com.ufo.project.theoretical.domain.ReportRow;
+import com.ufo.project.theoretical.domain.TheoreticalEnergyRow;
+import com.ufo.project.theoretical.domain.TheoreticalPowerQuery;
+import com.ufo.project.theoretical.domain.TheoreticalPowerRow;
+import com.ufo.project.theoretical.service.ITheoreticalPowerService;
+
+/**
+ * 光伏理论功率Controller
+ * <p>16 个接口 = 8 查询 + 8 导出,基础路径 /theoretical/power,全部 POST</p>
+ *
+ * @author ufo
+ */
+@RestController
+@RequestMapping("/theoretical/power")
+public class TheoreticalPowerController extends BaseController
+{
+    @Autowired
+    private ITheoreticalPowerService theoreticalPowerService;
+
+    /**
+     * 3.2.1 光伏理论功率列表
+     */
+    @PreAuthorize("@ss.hasPermi('theoretical:power:list')")
+    @PostMapping("/list")
+    public AjaxResult powerList(@RequestBody TheoreticalPowerQuery query)
+    {
+        return success(theoreticalPowerService.selectPowerList(query));
+    }
+
+    /**
+     * 3.3.3 实时数据(全场最新一条)
+     */
+    @PreAuthorize("@ss.hasPermi('theoretical:power:list')")
+    @PostMapping("/latest")
+    public AjaxResult latest(@RequestBody LatestQuery query)
+    {
+        LatestPowerRow row = theoreticalPowerService.selectLatest(query);
+        return success(row);
+    }
+
+    /**
+     * 3.3.1 光伏受阻电量列表
+     */
+    @PreAuthorize("@ss.hasPermi('theoretical:curtailedEnergy:list')")
+    @PostMapping("/curtailedEnergy/list")
+    public AjaxResult curtailedEnergyList(@RequestBody CurtailedEnergyQuery query)
+    {
+        return success(theoreticalPowerService.selectCurtailedEnergyList(query));
+    }
+
+    /**
+     * 3.4.1 光伏场站逻辑校核列表
+     */
+    @PreAuthorize("@ss.hasPermi('theoretical:logicCheck:list')")
+    @PostMapping("/logicCheck/list")
+    public AjaxResult logicCheckList(@RequestBody PowerCheckQuery query)
+    {
+        return success(theoreticalPowerService.selectLogicCheckList(query));
+    }
+
+    /**
+     * 3.5.1 光伏场外受阻电力校核列表
+     */
+    @PreAuthorize("@ss.hasPermi('theoretical:offSiteCheck:list')")
+    @PostMapping("/offSiteCheck/list")
+    public AjaxResult offSiteCheckList(@RequestBody PowerCheckQuery query)
+    {
+        return success(theoreticalPowerService.selectOffSiteCheckList(query));
+    }
+
+    /**
+     * 3.6.1 光伏场内受阻电力校核列表(末行合计)
+     */
+    @PreAuthorize("@ss.hasPermi('theoretical:intraPlantCheck:list')")
+    @PostMapping("/intraPlantCheck/list")
+    public AjaxResult intraPlantCheckList(@RequestBody PowerCheckQuery query)
+    {
+        return success(theoreticalPowerService.selectIntraPlantCheckList(query));
+    }
+
+    /**
+     * 3.7.1 光伏受阻电量日报(每日一条 + 末行合计)
+     */
+    @PreAuthorize("@ss.hasPermi('theoretical:dailyReport:list')")
+    @PostMapping("/dailyReport/list")
+    public AjaxResult dailyReportList(@RequestBody DailyReportQuery query)
+    {
+        return success(theoreticalPowerService.selectDailyReportList(query));
+    }
+
+    /**
+     * 3.8.1 光伏受阻电量月报(每月一条 + 末行总合计)
+     */
+    @PreAuthorize("@ss.hasPermi('theoretical:monthlyReport:list')")
+    @PostMapping("/monthlyReport/list")
+    public AjaxResult monthlyReportList(@RequestBody MonthlyReportQuery query)
+    {
+        return success(theoreticalPowerService.selectMonthlyReportList(query));
+    }
+
+    /**
+     * 3.2.2 导出光伏理论功率
+     */
+    @PreAuthorize("@ss.hasPermi('theoretical:power:list')")
+    @Log(title = "光伏理论功率", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void exportPower(HttpServletResponse response, @RequestBody TheoreticalPowerQuery query)
+            throws IOException
+    {
+        writeExcel(response, "光伏理论功率_" + yyyyMMdd(query.getDay()), "光伏理论功率",
+                theoreticalPowerService.selectPowerList(query), TheoreticalPowerRow.class);
+    }
+
+    /**
+     * 3.2.3 导出光伏理论发电量
+     */
+    @PreAuthorize("@ss.hasPermi('theoretical:power:list')")
+    @Log(title = "光伏理论发电量", businessType = BusinessType.EXPORT)
+    @PostMapping("/energy/export")
+    public void exportEnergy(HttpServletResponse response, @RequestBody TheoreticalPowerQuery query)
+            throws IOException
+    {
+        writeExcel(response, "光伏理论发电量_" + yyyyMMdd(query.getDay()), "光伏理论发电量",
+                theoreticalPowerService.selectEnergyList(query), TheoreticalEnergyRow.class);
+    }
+
+    /**
+     * 3.3.2 导出光伏受阻电量
+     */
+    @PreAuthorize("@ss.hasPermi('theoretical:curtailedEnergy:list')")
+    @Log(title = "光伏受阻电量", businessType = BusinessType.EXPORT)
+    @PostMapping("/curtailedEnergy/export")
+    public void exportCurtailedEnergy(HttpServletResponse response, @RequestBody CurtailedEnergyQuery query)
+            throws IOException
+    {
+        writeExcel(response, "光伏受阻电量_" + yyyyMMdd(query.getDay()), "光伏受阻电量",
+                theoreticalPowerService.selectCurtailedEnergyList(query), CurtailedEnergyRow.class);
+    }
+
+    /**
+     * 3.4.2 导出光伏场站逻辑校核
+     */
+    @PreAuthorize("@ss.hasPermi('theoretical:logicCheck:list')")
+    @Log(title = "光伏场站逻辑校核", businessType = BusinessType.EXPORT)
+    @PostMapping("/logicCheck/export")
+    public void exportLogicCheck(HttpServletResponse response, @RequestBody PowerCheckQuery query)
+            throws IOException
+    {
+        writeExcel(response, "光伏场站逻辑校核_" + yyyyMMdd(query.getDay()), "光伏场站逻辑校核",
+                theoreticalPowerService.selectLogicCheckList(query), LogicCheckRow.class);
+    }
+
+    /**
+     * 3.5.2 导出光伏场外受阻电力校核
+     */
+    @PreAuthorize("@ss.hasPermi('theoretical:offSiteCheck:list')")
+    @Log(title = "光伏场外受阻电力校核", businessType = BusinessType.EXPORT)
+    @PostMapping("/offSiteCheck/export")
+    public void exportOffSiteCheck(HttpServletResponse response, @RequestBody PowerCheckQuery query)
+            throws IOException
+    {
+        writeExcel(response, "光伏场外受阻电力校核_" + yyyyMMdd(query.getDay()), "光伏场外受阻电力校核",
+                theoreticalPowerService.selectOffSiteCheckList(query), OffSiteCheckRow.class);
+    }
+
+    /**
+     * 3.6.2 导出光伏场内受阻电力校核
+     */
+    @PreAuthorize("@ss.hasPermi('theoretical:intraPlantCheck:list')")
+    @Log(title = "光伏场内受阻电力校核", businessType = BusinessType.EXPORT)
+    @PostMapping("/intraPlantCheck/export")
+    public void exportIntraPlantCheck(HttpServletResponse response, @RequestBody PowerCheckQuery query)
+            throws IOException
+    {
+        writeExcel(response, "光伏场内受阻电力校核_" + yyyyMMdd(query.getDay()), "光伏场内受阻电力校核",
+                theoreticalPowerService.selectIntraPlantCheckList(query), IntraPlantCheckRow.class);
+    }
+
+    /**
+     * 3.7.2 导出光伏受阻电量日报
+     */
+    @PreAuthorize("@ss.hasPermi('theoretical:dailyReport:list')")
+    @Log(title = "光伏受阻电量日报", businessType = BusinessType.EXPORT)
+    @PostMapping("/dailyReport/export")
+    public void exportDailyReport(HttpServletResponse response, @RequestBody DailyReportQuery query)
+            throws IOException
+    {
+        String fileName = "光伏受阻电量日报_" + query.getStartDay() + "_" + query.getEndDay();
+        writeExcel(response, fileName, "光伏受阻电量日报",
+                theoreticalPowerService.selectDailyReportList(query), ReportRow.class);
+    }
+
+    /**
+     * 3.8.2 导出光伏受阻电量月报
+     */
+    @PreAuthorize("@ss.hasPermi('theoretical:monthlyReport:list')")
+    @Log(title = "光伏受阻电量月报", businessType = BusinessType.EXPORT)
+    @PostMapping("/monthlyReport/export")
+    public void exportMonthlyReport(HttpServletResponse response, @RequestBody MonthlyReportQuery query)
+            throws IOException
+    {
+        String fileName = "光伏受阻电量月报_" + query.getStartMonth() + "_" + query.getEndMonth();
+        writeExcel(response, fileName, "光伏受阻电量月报",
+                theoreticalPowerService.selectMonthlyReportList(query), ReportRow.class);
+    }
+
+    /**
+     * 统一导出写法(参照 UltraShortTermPowerForecastingController.export)
+     */
+    private <T> void writeExcel(HttpServletResponse response, String rawFileName, String sheetName,
+            List<T> data, Class<T> headClass) throws IOException
+    {
+        response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
+        response.setCharacterEncoding("utf-8");
+        String fileName = URLEncoder.encode(rawFileName + ".xlsx", "UTF-8").replaceAll("\\+", "%20");
+        response.setHeader("Content-Disposition", "attachment;filename*=utf-8''" + fileName);
+        EasyExcel.write(response.getOutputStream(), headClass).sheet(sheetName).doWrite(data);
+    }
+
+    /**
+     * yyyy-MM-dd → yyyyMMdd(导出文件名用)
+     */
+    private String yyyyMMdd(String day)
+    {
+        return day == null ? "" : day.replace("-", "");
+    }
+}

+ 52 - 0
forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/CurtailedEnergyQuery.java

@@ -0,0 +1,52 @@
+package com.ufo.project.theoretical.domain;
+
+import java.io.Serializable;
+
+/**
+ * 光伏受阻电量查询参数(3.3.1/3.3.2)
+ *
+ * @author ufo
+ */
+public class CurtailedEnergyQuery implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 场站编码 */
+    private String stationCode;
+
+    /** 理论功率算法 sampleMachine=样板法 photometricMethod=测光法 */
+    private String dataType;
+
+    /** 日期 yyyy-MM-dd */
+    private String day;
+
+    public String getStationCode()
+    {
+        return stationCode;
+    }
+
+    public void setStationCode(String stationCode)
+    {
+        this.stationCode = stationCode;
+    }
+
+    public String getDataType()
+    {
+        return dataType;
+    }
+
+    public void setDataType(String dataType)
+    {
+        this.dataType = dataType;
+    }
+
+    public String getDay()
+    {
+        return day;
+    }
+
+    public void setDay(String day)
+    {
+        this.day = day;
+    }
+}

+ 70 - 0
forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/CurtailedEnergyRow.java

@@ -0,0 +1,70 @@
+package com.ufo.project.theoretical.domain;
+
+import java.io.Serializable;
+import com.alibaba.excel.annotation.ExcelProperty;
+
+/**
+ * 光伏受阻电量行(3.3.1/3.3.2,原始采集点,万千瓦时,3 位小数)
+ *
+ * @author ufo
+ */
+public class CurtailedEnergyRow implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 时间(yyyy-MM-dd HH:mm:ss 原始点) */
+    @ExcelProperty("时间")
+    private String time;
+
+    /** 场内受阻电量(万千瓦时) */
+    @ExcelProperty("场内受阻电量(万千瓦时)")
+    private Double intraPlantCurtailedEnergy = 0D;
+
+    /** 场外受阻电量(万千瓦时) */
+    @ExcelProperty("场外受阻电量(万千瓦时)")
+    private Double offSiteCurtailedEnergy = 0D;
+
+    /** 总受阻电量(万千瓦时) */
+    @ExcelProperty("总受阻电量(万千瓦时)")
+    private Double totalCurtailedEnergy = 0D;
+
+    public String getTime()
+    {
+        return time;
+    }
+
+    public void setTime(String time)
+    {
+        this.time = time;
+    }
+
+    public Double getIntraPlantCurtailedEnergy()
+    {
+        return intraPlantCurtailedEnergy;
+    }
+
+    public void setIntraPlantCurtailedEnergy(Double intraPlantCurtailedEnergy)
+    {
+        this.intraPlantCurtailedEnergy = intraPlantCurtailedEnergy;
+    }
+
+    public Double getOffSiteCurtailedEnergy()
+    {
+        return offSiteCurtailedEnergy;
+    }
+
+    public void setOffSiteCurtailedEnergy(Double offSiteCurtailedEnergy)
+    {
+        this.offSiteCurtailedEnergy = offSiteCurtailedEnergy;
+    }
+
+    public Double getTotalCurtailedEnergy()
+    {
+        return totalCurtailedEnergy;
+    }
+
+    public void setTotalCurtailedEnergy(Double totalCurtailedEnergy)
+    {
+        this.totalCurtailedEnergy = totalCurtailedEnergy;
+    }
+}

+ 65 - 0
forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/DailyReportQuery.java

@@ -0,0 +1,65 @@
+package com.ufo.project.theoretical.domain;
+
+import java.io.Serializable;
+
+/**
+ * 光伏受阻电量日报查询参数(3.7.1/3.7.2)
+ *
+ * @author ufo
+ */
+public class DailyReportQuery implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 场站编码 */
+    private String stationCode;
+
+    /** 理论功率算法 sampleMachine=样板法 photometricMethod=测光法 */
+    private String dataType;
+
+    /** 开始日期 yyyy-MM-dd */
+    private String startDay;
+
+    /** 结束日期 yyyy-MM-dd */
+    private String endDay;
+
+    public String getStationCode()
+    {
+        return stationCode;
+    }
+
+    public void setStationCode(String stationCode)
+    {
+        this.stationCode = stationCode;
+    }
+
+    public String getDataType()
+    {
+        return dataType;
+    }
+
+    public void setDataType(String dataType)
+    {
+        this.dataType = dataType;
+    }
+
+    public String getStartDay()
+    {
+        return startDay;
+    }
+
+    public void setStartDay(String startDay)
+    {
+        this.startDay = startDay;
+    }
+
+    public String getEndDay()
+    {
+        return endDay;
+    }
+
+    public void setEndDay(String endDay)
+    {
+        this.endDay = endDay;
+    }
+}

+ 84 - 0
forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/IntraPlantCheckRow.java

@@ -0,0 +1,84 @@
+package com.ufo.project.theoretical.domain;
+
+import java.io.Serializable;
+import com.alibaba.excel.annotation.ExcelProperty;
+
+/**
+ * 光伏场内受阻电力校核行(3.6.1/3.6.2,5 分钟网格,MW 3 位小数,末行合计)
+ *
+ * @author ufo
+ */
+public class IntraPlantCheckRow implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 时间(HH:mm,合计行 time="合计") */
+    @ExcelProperty("时间")
+    private String time;
+
+    /** 理论功率(MW) */
+    @ExcelProperty("理论功率(MW)")
+    private Double theoreticalPower = 0D;
+
+    /** 可用功率(MW) */
+    @ExcelProperty("可用功率(MW)")
+    private Double availablePower = 0D;
+
+    /** 偏差(%) = 理论 ÷ 可用 × 100 */
+    @ExcelProperty("偏差(%)")
+    private Double deviation = 0D;
+
+    /** 校核结果(合格/不合格) */
+    @ExcelProperty("校核结果")
+    private String qualifiedDesc;
+
+    public String getTime()
+    {
+        return time;
+    }
+
+    public void setTime(String time)
+    {
+        this.time = time;
+    }
+
+    public Double getTheoreticalPower()
+    {
+        return theoreticalPower;
+    }
+
+    public void setTheoreticalPower(Double theoreticalPower)
+    {
+        this.theoreticalPower = theoreticalPower;
+    }
+
+    public Double getAvailablePower()
+    {
+        return availablePower;
+    }
+
+    public void setAvailablePower(Double availablePower)
+    {
+        this.availablePower = availablePower;
+    }
+
+    public Double getDeviation()
+    {
+        return deviation;
+    }
+
+    public void setDeviation(Double deviation)
+    {
+        this.deviation = deviation;
+    }
+
+    public String getQualifiedDesc()
+    {
+        return qualifiedDesc;
+    }
+
+    public void setQualifiedDesc(String qualifiedDesc)
+    {
+        this.qualifiedDesc = qualifiedDesc;
+    }
+}

+ 104 - 0
forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/LatestPowerRow.java

@@ -0,0 +1,104 @@
+package com.ufo.project.theoretical.domain;
+
+import java.io.Serializable;
+
+/**
+ * 实时数据行(3.3.3,全场最新一条 + 开机容量,kW,3 位小数)
+ *
+ * @author ufo
+ */
+public class LatestPowerRow implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 时间(yyyy-MM-dd HH:mm:ss 最新数据时刻) */
+    private String time;
+
+    /** 实发功率(kW) */
+    private Double power = 0D;
+
+    /** 样板法理论功率(kW) */
+    private Double sampleMachineTheoreticalPower = 0D;
+
+    /** 测光法理论功率(kW) */
+    private Double photometricMethodTheoreticalPower = 0D;
+
+    /** 样板法可用功率(kW) */
+    private Double sampleMachineAvailablePower = 0D;
+
+    /** 测光法可用功率(kW) */
+    private Double photometricMethodAvailablePower = 0D;
+
+    /** 开机容量(kW) */
+    private Double installedCapacity = 0D;
+
+    public String getTime()
+    {
+        return time;
+    }
+
+    public void setTime(String time)
+    {
+        this.time = time;
+    }
+
+    public Double getPower()
+    {
+        return power;
+    }
+
+    public void setPower(Double power)
+    {
+        this.power = power;
+    }
+
+    public Double getSampleMachineTheoreticalPower()
+    {
+        return sampleMachineTheoreticalPower;
+    }
+
+    public void setSampleMachineTheoreticalPower(Double sampleMachineTheoreticalPower)
+    {
+        this.sampleMachineTheoreticalPower = sampleMachineTheoreticalPower;
+    }
+
+    public Double getPhotometricMethodTheoreticalPower()
+    {
+        return photometricMethodTheoreticalPower;
+    }
+
+    public void setPhotometricMethodTheoreticalPower(Double photometricMethodTheoreticalPower)
+    {
+        this.photometricMethodTheoreticalPower = photometricMethodTheoreticalPower;
+    }
+
+    public Double getSampleMachineAvailablePower()
+    {
+        return sampleMachineAvailablePower;
+    }
+
+    public void setSampleMachineAvailablePower(Double sampleMachineAvailablePower)
+    {
+        this.sampleMachineAvailablePower = sampleMachineAvailablePower;
+    }
+
+    public Double getPhotometricMethodAvailablePower()
+    {
+        return photometricMethodAvailablePower;
+    }
+
+    public void setPhotometricMethodAvailablePower(Double photometricMethodAvailablePower)
+    {
+        this.photometricMethodAvailablePower = photometricMethodAvailablePower;
+    }
+
+    public Double getInstalledCapacity()
+    {
+        return installedCapacity;
+    }
+
+    public void setInstalledCapacity(Double installedCapacity)
+    {
+        this.installedCapacity = installedCapacity;
+    }
+}

+ 26 - 0
forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/LatestQuery.java

@@ -0,0 +1,26 @@
+package com.ufo.project.theoretical.domain;
+
+import java.io.Serializable;
+
+/**
+ * 实时数据查询参数(3.3.3,全场最新一条,无 day)
+ *
+ * @author ufo
+ */
+public class LatestQuery implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 场站编码 */
+    private String stationCode;
+
+    public String getStationCode()
+    {
+        return stationCode;
+    }
+
+    public void setStationCode(String stationCode)
+    {
+        this.stationCode = stationCode;
+    }
+}

+ 112 - 0
forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/LogicCheckRow.java

@@ -0,0 +1,112 @@
+package com.ufo.project.theoretical.domain;
+
+import java.io.Serializable;
+import com.alibaba.excel.annotation.ExcelProperty;
+
+/**
+ * 光伏场站逻辑校核行(3.4.1/3.4.2,5 分钟网格,百分比 2 位小数)
+ *
+ * @author ufo
+ */
+public class LogicCheckRow implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 时间(HH:mm) */
+    @ExcelProperty("时间")
+    private String time;
+
+    /** 装机比理论(%) */
+    @ExcelProperty("装机比理论(%)")
+    private Double installed2TheoreticalPercent = 0D;
+
+    /** 装机比理论判定(合格/不合格) */
+    @ExcelProperty("装机比理论判定")
+    private String installed2TheoreticalDesc;
+
+    /** 理论比可用(%) */
+    @ExcelProperty("理论比可用(%)")
+    private Double theoretical2AvailablePercent = 0D;
+
+    /** 理论比可用判定(合格/不合格) */
+    @ExcelProperty("理论比可用判定")
+    private String theoretical2AvailableDesc;
+
+    /** 可用比实际(%) */
+    @ExcelProperty("可用比实际(%)")
+    private Double available2ActualPercent = 0D;
+
+    /** 可用比实际判定(合格/不合格) */
+    @ExcelProperty("可用比实际判定")
+    private String available2ActualDesc;
+
+    public String getTime()
+    {
+        return time;
+    }
+
+    public void setTime(String time)
+    {
+        this.time = time;
+    }
+
+    public Double getInstalled2TheoreticalPercent()
+    {
+        return installed2TheoreticalPercent;
+    }
+
+    public void setInstalled2TheoreticalPercent(Double installed2TheoreticalPercent)
+    {
+        this.installed2TheoreticalPercent = installed2TheoreticalPercent;
+    }
+
+    public String getInstalled2TheoreticalDesc()
+    {
+        return installed2TheoreticalDesc;
+    }
+
+    public void setInstalled2TheoreticalDesc(String installed2TheoreticalDesc)
+    {
+        this.installed2TheoreticalDesc = installed2TheoreticalDesc;
+    }
+
+    public Double getTheoretical2AvailablePercent()
+    {
+        return theoretical2AvailablePercent;
+    }
+
+    public void setTheoretical2AvailablePercent(Double theoretical2AvailablePercent)
+    {
+        this.theoretical2AvailablePercent = theoretical2AvailablePercent;
+    }
+
+    public String getTheoretical2AvailableDesc()
+    {
+        return theoretical2AvailableDesc;
+    }
+
+    public void setTheoretical2AvailableDesc(String theoretical2AvailableDesc)
+    {
+        this.theoretical2AvailableDesc = theoretical2AvailableDesc;
+    }
+
+    public Double getAvailable2ActualPercent()
+    {
+        return available2ActualPercent;
+    }
+
+    public void setAvailable2ActualPercent(Double available2ActualPercent)
+    {
+        this.available2ActualPercent = available2ActualPercent;
+    }
+
+    public String getAvailable2ActualDesc()
+    {
+        return available2ActualDesc;
+    }
+
+    public void setAvailable2ActualDesc(String available2ActualDesc)
+    {
+        this.available2ActualDesc = available2ActualDesc;
+    }
+}

+ 65 - 0
forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/MonthlyReportQuery.java

@@ -0,0 +1,65 @@
+package com.ufo.project.theoretical.domain;
+
+import java.io.Serializable;
+
+/**
+ * 光伏受阻电量月报查询参数(3.8.1/3.8.2)
+ *
+ * @author ufo
+ */
+public class MonthlyReportQuery implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 场站编码 */
+    private String stationCode;
+
+    /** 理论功率算法 sampleMachine=样板法 photometricMethod=测光法 */
+    private String dataType;
+
+    /** 开始月份 yyyy-MM */
+    private String startMonth;
+
+    /** 结束月份 yyyy-MM */
+    private String endMonth;
+
+    public String getStationCode()
+    {
+        return stationCode;
+    }
+
+    public void setStationCode(String stationCode)
+    {
+        this.stationCode = stationCode;
+    }
+
+    public String getDataType()
+    {
+        return dataType;
+    }
+
+    public void setDataType(String dataType)
+    {
+        this.dataType = dataType;
+    }
+
+    public String getStartMonth()
+    {
+        return startMonth;
+    }
+
+    public void setStartMonth(String startMonth)
+    {
+        this.startMonth = startMonth;
+    }
+
+    public String getEndMonth()
+    {
+        return endMonth;
+    }
+
+    public void setEndMonth(String endMonth)
+    {
+        this.endMonth = endMonth;
+    }
+}

+ 84 - 0
forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/OffSiteCheckRow.java

@@ -0,0 +1,84 @@
+package com.ufo.project.theoretical.domain;
+
+import java.io.Serializable;
+import com.alibaba.excel.annotation.ExcelProperty;
+
+/**
+ * 光伏场外受阻电力校核行(3.5.1/3.5.2,5 分钟网格,MW 3 位小数)
+ *
+ * @author ufo
+ */
+public class OffSiteCheckRow implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 时间(HH:mm) */
+    @ExcelProperty("时间")
+    private String time;
+
+    /** 可用功率(MW) */
+    @ExcelProperty("可用功率(MW)")
+    private Double availablePower = 0D;
+
+    /** 实发功率(MW) */
+    @ExcelProperty("实发功率(MW)")
+    private Double power = 0D;
+
+    /** 偏差(%) = 可用 ÷ 实发 × 100 */
+    @ExcelProperty("偏差(%)")
+    private Double deviation = 0D;
+
+    /** 校核结果(合格/不合格) */
+    @ExcelProperty("校核结果")
+    private String qualifiedDesc;
+
+    public String getTime()
+    {
+        return time;
+    }
+
+    public void setTime(String time)
+    {
+        this.time = time;
+    }
+
+    public Double getAvailablePower()
+    {
+        return availablePower;
+    }
+
+    public void setAvailablePower(Double availablePower)
+    {
+        this.availablePower = availablePower;
+    }
+
+    public Double getPower()
+    {
+        return power;
+    }
+
+    public void setPower(Double power)
+    {
+        this.power = power;
+    }
+
+    public Double getDeviation()
+    {
+        return deviation;
+    }
+
+    public void setDeviation(Double deviation)
+    {
+        this.deviation = deviation;
+    }
+
+    public String getQualifiedDesc()
+    {
+        return qualifiedDesc;
+    }
+
+    public void setQualifiedDesc(String qualifiedDesc)
+    {
+        this.qualifiedDesc = qualifiedDesc;
+    }
+}

+ 52 - 0
forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/PowerCheckQuery.java

@@ -0,0 +1,52 @@
+package com.ufo.project.theoretical.domain;
+
+import java.io.Serializable;
+
+/**
+ * 电力校核查询参数(3.4/3.5/3.6 逻辑校核、场外校核、场内校核)
+ *
+ * @author ufo
+ */
+public class PowerCheckQuery implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 场站编码 */
+    private String stationCode;
+
+    /** 理论功率算法 sampleMachine=样板法 photometricMethod=测光法 */
+    private String dataType;
+
+    /** 日期 yyyy-MM-dd */
+    private String day;
+
+    public String getStationCode()
+    {
+        return stationCode;
+    }
+
+    public void setStationCode(String stationCode)
+    {
+        this.stationCode = stationCode;
+    }
+
+    public String getDataType()
+    {
+        return dataType;
+    }
+
+    public void setDataType(String dataType)
+    {
+        this.dataType = dataType;
+    }
+
+    public String getDay()
+    {
+        return day;
+    }
+
+    public void setDay(String day)
+    {
+        this.day = day;
+    }
+}

+ 112 - 0
forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/ReportRow.java

@@ -0,0 +1,112 @@
+package com.ufo.project.theoretical.domain;
+
+import java.io.Serializable;
+import com.alibaba.excel.annotation.ExcelProperty;
+
+/**
+ * 光伏受阻电量日报/月报行(3.7/3.8,万千瓦时 3 位小数,末行合计)
+ *
+ * @author ufo
+ */
+public class ReportRow implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 时间(日报 yyyy-MM-dd / 月报 yyyy-MM,合计行 time="合计") */
+    @ExcelProperty("时间")
+    private String time;
+
+    /** 理论发电量(万千瓦时) */
+    @ExcelProperty("理论发电量(万千瓦时)")
+    private Double theoreticalEnergy = 0D;
+
+    /** 可用发电量(万千瓦时) */
+    @ExcelProperty("可用发电量(万千瓦时)")
+    private Double availableEnergy = 0D;
+
+    /** 实际发电量(万千瓦时) */
+    @ExcelProperty("实际发电量(万千瓦时)")
+    private Double energy = 0D;
+
+    /** 场内受阻电量(万千瓦时) */
+    @ExcelProperty("场内受阻电量(万千瓦时)")
+    private Double intraPlantCurtailedEnergy = 0D;
+
+    /** 场外受阻电量(万千瓦时) */
+    @ExcelProperty("场外受阻电量(万千瓦时)")
+    private Double offSiteCurtailedEnergy = 0D;
+
+    /** 总受阻电量(万千瓦时) */
+    @ExcelProperty("总受阻电量(万千瓦时)")
+    private Double totalCurtailedEnergy = 0D;
+
+    public String getTime()
+    {
+        return time;
+    }
+
+    public void setTime(String time)
+    {
+        this.time = time;
+    }
+
+    public Double getTheoreticalEnergy()
+    {
+        return theoreticalEnergy;
+    }
+
+    public void setTheoreticalEnergy(Double theoreticalEnergy)
+    {
+        this.theoreticalEnergy = theoreticalEnergy;
+    }
+
+    public Double getAvailableEnergy()
+    {
+        return availableEnergy;
+    }
+
+    public void setAvailableEnergy(Double availableEnergy)
+    {
+        this.availableEnergy = availableEnergy;
+    }
+
+    public Double getEnergy()
+    {
+        return energy;
+    }
+
+    public void setEnergy(Double energy)
+    {
+        this.energy = energy;
+    }
+
+    public Double getIntraPlantCurtailedEnergy()
+    {
+        return intraPlantCurtailedEnergy;
+    }
+
+    public void setIntraPlantCurtailedEnergy(Double intraPlantCurtailedEnergy)
+    {
+        this.intraPlantCurtailedEnergy = intraPlantCurtailedEnergy;
+    }
+
+    public Double getOffSiteCurtailedEnergy()
+    {
+        return offSiteCurtailedEnergy;
+    }
+
+    public void setOffSiteCurtailedEnergy(Double offSiteCurtailedEnergy)
+    {
+        this.offSiteCurtailedEnergy = offSiteCurtailedEnergy;
+    }
+
+    public Double getTotalCurtailedEnergy()
+    {
+        return totalCurtailedEnergy;
+    }
+
+    public void setTotalCurtailedEnergy(Double totalCurtailedEnergy)
+    {
+        this.totalCurtailedEnergy = totalCurtailedEnergy;
+    }
+}

+ 98 - 0
forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/TheoreticalEnergyRow.java

@@ -0,0 +1,98 @@
+package com.ufo.project.theoretical.domain;
+
+import java.io.Serializable;
+import com.alibaba.excel.annotation.ExcelProperty;
+
+/**
+ * 光伏理论发电量行(3.2.3,原始采集点,万千瓦时,3 位小数)
+ *
+ * @author ufo
+ */
+public class TheoreticalEnergyRow implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 时间(yyyy-MM-dd HH:mm:ss 原始点) */
+    @ExcelProperty("时间")
+    private String time;
+
+    /** 实发电量(万千瓦时) */
+    @ExcelProperty("实发电量(万千瓦时)")
+    private Double energy = 0D;
+
+    /** 样板法理论发电量(万千瓦时) */
+    @ExcelProperty("样板法理论发电量(万千瓦时)")
+    private Double sampleMachineTheoreticalEnergy = 0D;
+
+    /** 测光法理论发电量(万千瓦时) */
+    @ExcelProperty("测光法理论发电量(万千瓦时)")
+    private Double photometricMethodTheoreticalEnergy = 0D;
+
+    /** 样板法可用发电量(万千瓦时) */
+    @ExcelProperty("样板法可用发电量(万千瓦时)")
+    private Double sampleMachineAvailableEnergy = 0D;
+
+    /** 测光法可用发电量(万千瓦时) */
+    @ExcelProperty("测光法可用发电量(万千瓦时)")
+    private Double photometricMethodAvailableEnergy = 0D;
+
+    public String getTime()
+    {
+        return time;
+    }
+
+    public void setTime(String time)
+    {
+        this.time = time;
+    }
+
+    public Double getEnergy()
+    {
+        return energy;
+    }
+
+    public void setEnergy(Double energy)
+    {
+        this.energy = energy;
+    }
+
+    public Double getSampleMachineTheoreticalEnergy()
+    {
+        return sampleMachineTheoreticalEnergy;
+    }
+
+    public void setSampleMachineTheoreticalEnergy(Double sampleMachineTheoreticalEnergy)
+    {
+        this.sampleMachineTheoreticalEnergy = sampleMachineTheoreticalEnergy;
+    }
+
+    public Double getPhotometricMethodTheoreticalEnergy()
+    {
+        return photometricMethodTheoreticalEnergy;
+    }
+
+    public void setPhotometricMethodTheoreticalEnergy(Double photometricMethodTheoreticalEnergy)
+    {
+        this.photometricMethodTheoreticalEnergy = photometricMethodTheoreticalEnergy;
+    }
+
+    public Double getSampleMachineAvailableEnergy()
+    {
+        return sampleMachineAvailableEnergy;
+    }
+
+    public void setSampleMachineAvailableEnergy(Double sampleMachineAvailableEnergy)
+    {
+        this.sampleMachineAvailableEnergy = sampleMachineAvailableEnergy;
+    }
+
+    public Double getPhotometricMethodAvailableEnergy()
+    {
+        return photometricMethodAvailableEnergy;
+    }
+
+    public void setPhotometricMethodAvailableEnergy(Double photometricMethodAvailableEnergy)
+    {
+        this.photometricMethodAvailableEnergy = photometricMethodAvailableEnergy;
+    }
+}

+ 52 - 0
forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/TheoreticalPowerQuery.java

@@ -0,0 +1,52 @@
+package com.ufo.project.theoretical.domain;
+
+import java.io.Serializable;
+
+/**
+ * 光伏理论功率查询参数(3.2.1/3.2.2/3.2.3)
+ *
+ * @author ufo
+ */
+public class TheoreticalPowerQuery implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 场站编码 */
+    private String stationCode;
+
+    /** 采样频率(分钟,5/15) */
+    private Integer samplingFrequency;
+
+    /** 日期 yyyy-MM-dd */
+    private String day;
+
+    public String getStationCode()
+    {
+        return stationCode;
+    }
+
+    public void setStationCode(String stationCode)
+    {
+        this.stationCode = stationCode;
+    }
+
+    public Integer getSamplingFrequency()
+    {
+        return samplingFrequency;
+    }
+
+    public void setSamplingFrequency(Integer samplingFrequency)
+    {
+        this.samplingFrequency = samplingFrequency;
+    }
+
+    public String getDay()
+    {
+        return day;
+    }
+
+    public void setDay(String day)
+    {
+        this.day = day;
+    }
+}

+ 98 - 0
forecast-backend-server/src/main/java/com/ufo/project/theoretical/domain/TheoreticalPowerRow.java

@@ -0,0 +1,98 @@
+package com.ufo.project.theoretical.domain;
+
+import java.io.Serializable;
+import com.alibaba.excel.annotation.ExcelProperty;
+
+/**
+ * 光伏理论功率行(3.2.1/3.2.2,kW,3 位小数)
+ *
+ * @author ufo
+ */
+public class TheoreticalPowerRow implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+
+    /** 时间(yyyy-MM-dd HH:mm:ss 网格时刻) */
+    @ExcelProperty("时间")
+    private String time;
+
+    /** 实发功率(kW) */
+    @ExcelProperty("实发功率")
+    private Double power = 0D;
+
+    /** 样板法理论功率(kW) */
+    @ExcelProperty("样板法理论功率")
+    private Double sampleMachineTheoreticalPower = 0D;
+
+    /** 测光法理论功率(kW) */
+    @ExcelProperty("测光法理论功率")
+    private Double photometricMethodTheoreticalPower = 0D;
+
+    /** 样板法可用功率(kW) */
+    @ExcelProperty("样板法可用功率")
+    private Double sampleMachineAvailablePower = 0D;
+
+    /** 测光法可用功率(kW) */
+    @ExcelProperty("测光法可用功率")
+    private Double photometricMethodAvailablePower = 0D;
+
+    public String getTime()
+    {
+        return time;
+    }
+
+    public void setTime(String time)
+    {
+        this.time = time;
+    }
+
+    public Double getPower()
+    {
+        return power;
+    }
+
+    public void setPower(Double power)
+    {
+        this.power = power;
+    }
+
+    public Double getSampleMachineTheoreticalPower()
+    {
+        return sampleMachineTheoreticalPower;
+    }
+
+    public void setSampleMachineTheoreticalPower(Double sampleMachineTheoreticalPower)
+    {
+        this.sampleMachineTheoreticalPower = sampleMachineTheoreticalPower;
+    }
+
+    public Double getPhotometricMethodTheoreticalPower()
+    {
+        return photometricMethodTheoreticalPower;
+    }
+
+    public void setPhotometricMethodTheoreticalPower(Double photometricMethodTheoreticalPower)
+    {
+        this.photometricMethodTheoreticalPower = photometricMethodTheoreticalPower;
+    }
+
+    public Double getSampleMachineAvailablePower()
+    {
+        return sampleMachineAvailablePower;
+    }
+
+    public void setSampleMachineAvailablePower(Double sampleMachineAvailablePower)
+    {
+        this.sampleMachineAvailablePower = sampleMachineAvailablePower;
+    }
+
+    public Double getPhotometricMethodAvailablePower()
+    {
+        return photometricMethodAvailablePower;
+    }
+
+    public void setPhotometricMethodAvailablePower(Double photometricMethodAvailablePower)
+    {
+        this.photometricMethodAvailablePower = photometricMethodAvailablePower;
+    }
+}

+ 99 - 0
forecast-backend-server/src/main/java/com/ufo/project/theoretical/service/ITheoreticalPowerService.java

@@ -0,0 +1,99 @@
+package com.ufo.project.theoretical.service;
+
+import java.util.List;
+
+import com.ufo.project.theoretical.domain.CurtailedEnergyQuery;
+import com.ufo.project.theoretical.domain.CurtailedEnergyRow;
+import com.ufo.project.theoretical.domain.DailyReportQuery;
+import com.ufo.project.theoretical.domain.IntraPlantCheckRow;
+import com.ufo.project.theoretical.domain.LatestPowerRow;
+import com.ufo.project.theoretical.domain.LatestQuery;
+import com.ufo.project.theoretical.domain.LogicCheckRow;
+import com.ufo.project.theoretical.domain.MonthlyReportQuery;
+import com.ufo.project.theoretical.domain.OffSiteCheckRow;
+import com.ufo.project.theoretical.domain.PowerCheckQuery;
+import com.ufo.project.theoretical.domain.ReportRow;
+import com.ufo.project.theoretical.domain.TheoreticalEnergyRow;
+import com.ufo.project.theoretical.domain.TheoreticalPowerQuery;
+import com.ufo.project.theoretical.domain.TheoreticalPowerRow;
+
+/**
+ * 光伏理论功率Service接口
+ * <p>口径来源:aicoding/26111301.md 与 docs/superpowers/specs/2026-11-16-theoretical-power-design.md</p>
+ *
+ * @author ufo
+ */
+public interface ITheoreticalPowerService
+{
+    /**
+     * 3.2.1/3.2.2 光伏理论功率列表(时间网格,双方法同构,前端本地分页)
+     *
+     * @param query 查询参数(stationCode/samplingFrequency/day)
+     * @return 理论功率行集合
+     */
+    public List<TheoreticalPowerRow> selectPowerList(TheoreticalPowerQuery query);
+
+    /**
+     * 3.2.3 光伏理论发电量列表(原始采集点逐行,双方法同构)
+     *
+     * @param query 查询参数(stationCode/day)
+     * @return 理论发电量行集合
+     */
+    public List<TheoreticalEnergyRow> selectEnergyList(TheoreticalPowerQuery query);
+
+    /**
+     * 3.3.3 实时数据(该场站全库 tm 最大一条,双方法 + 开机容量)
+     *
+     * @param query 查询参数(stationCode)
+     * @return 实时功率行
+     */
+    public LatestPowerRow selectLatest(LatestQuery query);
+
+    /**
+     * 3.1 光伏受阻电量列表(时间网格,按 dataType 取样板法/测光法)
+     *
+     * @param query 查询参数(stationCode/dataType/day)
+     * @return 受阻电量行集合
+     */
+    public List<CurtailedEnergyRow> selectCurtailedEnergyList(CurtailedEnergyQuery query);
+
+    /**
+     * 3.4 光伏场站逻辑校核列表(5 分钟网格)
+     *
+     * @param query 查询参数(stationCode/dataType/day)
+     * @return 逻辑校核行集合
+     */
+    public List<LogicCheckRow> selectLogicCheckList(PowerCheckQuery query);
+
+    /**
+     * 3.5 光伏场外受阻电力校核列表(5 分钟网格)
+     *
+     * @param query 查询参数(stationCode/dataType/day)
+     * @return 场外受阻电力校核行集合
+     */
+    public List<OffSiteCheckRow> selectOffSiteCheckList(PowerCheckQuery query);
+
+    /**
+     * 3.6 光伏场内受阻电力校核列表(5 分钟网格,末行合计)
+     *
+     * @param query 查询参数(stationCode/dataType/day)
+     * @return 场内受阻电力校核行集合
+     */
+    public List<IntraPlantCheckRow> selectIntraPlantCheckList(PowerCheckQuery query);
+
+    /**
+     * 3.7 光伏受阻电量日报列表(每日一条 + 末行合计)
+     *
+     * @param query 查询参数(stationCode/dataType/startDay/endDay,区间 ≤90 天)
+     * @return 日报行集合
+     */
+    public List<ReportRow> selectDailyReportList(DailyReportQuery query);
+
+    /**
+     * 3.8 光伏受阻电量月报列表(每月一条 + 末行总合计)
+     *
+     * @param query 查询参数(stationCode/dataType/startMonth/endMonth,区间 ≤12 月)
+     * @return 月报行集合
+     */
+    public List<ReportRow> selectMonthlyReportList(MonthlyReportQuery query);
+}

+ 1040 - 0
forecast-backend-server/src/main/java/com/ufo/project/theoretical/service/impl/TheoreticalPowerServiceImpl.java

@@ -0,0 +1,1040 @@
+package com.ufo.project.theoretical.service.impl;
+
+import java.time.Instant;
+import java.time.LocalDate;
+import java.time.YearMonth;
+import java.time.ZoneOffset;
+import java.time.format.DateTimeFormatter;
+import java.time.temporal.ChronoUnit;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.alibaba.fastjson2.JSON;
+import com.alibaba.fastjson2.JSONObject;
+import com.ufo.base.common.exception.ServiceException;
+import com.ufo.base.common.utils.DateUtils;
+import com.ufo.base.common.utils.DictUtils;
+import com.ufo.base.common.utils.StringUtils;
+import com.ufo.project.config.domain.ConfigStation;
+import com.ufo.project.config.mapper.ConfigStationMapper;
+import com.ufo.project.model.domain.DataElectricityLocal;
+import com.ufo.project.model.mapper.DataElectricityLocalMapper;
+import com.ufo.project.model.service.IDataElectricityLocalService;
+import com.ufo.project.theoretical.calc.TheoreticalPowerCalc;
+import com.ufo.project.theoretical.domain.CurtailedEnergyQuery;
+import com.ufo.project.theoretical.domain.CurtailedEnergyRow;
+import com.ufo.project.theoretical.domain.DailyReportQuery;
+import com.ufo.project.theoretical.domain.IntraPlantCheckRow;
+import com.ufo.project.theoretical.domain.LatestPowerRow;
+import com.ufo.project.theoretical.domain.LatestQuery;
+import com.ufo.project.theoretical.domain.LogicCheckRow;
+import com.ufo.project.theoretical.domain.MonthlyReportQuery;
+import com.ufo.project.theoretical.domain.OffSiteCheckRow;
+import com.ufo.project.theoretical.domain.PowerCheckQuery;
+import com.ufo.project.theoretical.domain.ReportRow;
+import com.ufo.project.theoretical.domain.TheoreticalEnergyRow;
+import com.ufo.project.theoretical.domain.TheoreticalPowerQuery;
+import com.ufo.project.theoretical.domain.TheoreticalPowerRow;
+import com.ufo.project.theoretical.service.ITheoreticalPowerService;
+import com.ufo.project.weather.domain.DataWeatherLocal;
+import com.ufo.project.weather.mapper.DataWeatherLocalMapper;
+import com.ufo.project.weather.service.IDataWeatherLocalService;
+
+/**
+ * 光伏理论功率Service实现
+ * <p>口径来源:aicoding/26111301.md 与 docs/superpowers/specs/2026-11-16-theoretical-power-design.md</p>
+ *
+ * @author ufo
+ */
+@Service
+public class TheoreticalPowerServiceImpl implements ITheoreticalPowerService
+{
+    /** 时区(timestamptz +08:00) */
+    private static final ZoneOffset ZONE = ZoneOffset.ofHours(8);
+
+    /** 网格时间(HH:mm) */
+    private static final DateTimeFormatter HHMM = DateTimeFormatter.ofPattern("HH:mm");
+
+    /** 时间(yyyy-MM-dd HH:mm:ss) */
+    private static final DateTimeFormatter DATETIME = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+    /** 测光法字典 */
+    private static final String DICT_ALGORITHM_CONFIG = "algorithm_config";
+    private static final String DICT_LABEL_PHOTOMETRIC = "测光法配置";
+
+    /** 校核阈值字典 */
+    private static final String DICT_POWER_CONFIG = "theoretical_power_config";
+    private static final String DICT_LABEL_POWER_CONFIG = "理论功率配置项";
+
+    /** dataType 取值 */
+    private static final String DATA_TYPE_SAMPLE = "sampleMachine";
+    private static final String DATA_TYPE_PHOTOMETRIC = "photometricMethod";
+
+    @Autowired
+    private ConfigStationMapper configStationMapper;
+
+    @Autowired
+    private IDataElectricityLocalService dataElectricityLocalService;
+
+    @Autowired
+    private IDataWeatherLocalService dataWeatherLocalService;
+
+    @Autowired
+    private DataElectricityLocalMapper dataElectricityLocalMapper;
+
+    @Autowired
+    private DataWeatherLocalMapper dataWeatherLocalMapper;
+
+    /**
+     * 3.2.1/3.2.2 光伏理论功率列表(时间网格,双方法同构)
+     */
+    @Override
+    public List<TheoreticalPowerRow> selectPowerList(TheoreticalPowerQuery query)
+    {
+        ConfigStation station = loadStation(query.getStationCode());
+        String day = requireDay(query.getDay());
+        int freq = requireFrequency(query.getSamplingFrequency());
+        List<DataElectricityLocal> power = loadSingleDayPower(station, day);
+        List<DataWeatherLocal> weather = loadSingleDayWeather(station, day);
+        double a1 = getPhotometricA1();
+        double a2 = getPhotometricA2();
+        Integer n = station.getInverterQuantity();
+
+        List<double[]> actual = rawPoints(power, DataElectricityLocal::getActualPower);
+        List<double[]> availability = rawPoints(power, DataElectricityLocal::getAvailability);
+        List<double[]> irr = rawPoints(weather, DataWeatherLocal::getIrradiance);
+        List<double[]> inclined = rawPoints(weather, DataWeatherLocal::getInclinedIrradiance);
+        List<double[]> temp = rawPoints(weather, DataWeatherLocal::getTemperature);
+
+        List<TheoreticalPowerRow> rows = new ArrayList<>();
+        for (long sec = dayStartEpoch(day); sec < dayStartEpoch(day) + 86400L; sec += freq * 60L)
+        {
+            double avail = TheoreticalPowerCalc.samplePoint(availability, sec, freq);
+            if (avail == 0)
+            {
+                avail = 100;
+            }
+            double photometric = TheoreticalPowerCalc.photometricPower(n, a1, a2,
+                    (double) TheoreticalPowerCalc.samplePoint(irr, sec, freq),
+                    (double) TheoreticalPowerCalc.samplePoint(inclined, sec, freq),
+                    (double) TheoreticalPowerCalc.samplePoint(temp, sec, freq));
+            TheoreticalPowerRow row = new TheoreticalPowerRow();
+            row.setTime(Instant.ofEpochSecond(sec).atOffset(ZONE).format(HHMM));
+            row.setPower(round3(TheoreticalPowerCalc.samplePoint(actual, sec, freq)));
+            row.setSampleMachineTheoreticalPower(0D);
+            row.setSampleMachineAvailablePower(0D);
+            row.setPhotometricMethodTheoreticalPower(round3(photometric));
+            row.setPhotometricMethodAvailablePower(round3(TheoreticalPowerCalc.availablePower(photometric, (double) avail)));
+            rows.add(row);
+        }
+        return rows;
+    }
+
+    /**
+     * 3.2.3 光伏理论发电量列表(原始采集点逐行,双方法同构)
+     */
+    @Override
+    public List<TheoreticalEnergyRow> selectEnergyList(TheoreticalPowerQuery query)
+    {
+        ConfigStation station = loadStation(query.getStationCode());
+        String day = requireDay(query.getDay());
+        List<DataElectricityLocal> power = loadSingleDayPower(station, day);
+        if (power.isEmpty())
+        {
+            return Collections.emptyList();
+        }
+        List<DataWeatherLocal> weather = loadSingleDayWeather(station, day);
+        double a1 = getPhotometricA1();
+        double a2 = getPhotometricA2();
+        Integer n = station.getInverterQuantity();
+
+        long dayEnd = dayStartEpoch(day) + 86400L;
+        List<double[]> actual = rawPoints(power, DataElectricityLocal::getActualPower);
+        List<double[]> availability = rawPoints(power, DataElectricityLocal::getAvailability);
+        List<double[]> irr = rawPoints(weather, DataWeatherLocal::getIrradiance);
+        List<double[]> inclined = rawPoints(weather, DataWeatherLocal::getInclinedIrradiance);
+        List<double[]> temp = rawPoints(weather, DataWeatherLocal::getTemperature);
+
+        int size = power.size();
+        double[] photometricSeries = new double[size];
+        double[] photometricAvailableSeries = new double[size];
+        for (int i = 0; i < size; i++)
+        {
+            long sec = epochSec(power.get(i).getTm());
+            double avail = sampleAt(availability, sec, 5);
+            if (avail == 0)
+            {
+                avail = 100;
+            }
+            double p = TheoreticalPowerCalc.photometricPower(n, a1, a2,
+                    (double) sampleAt(irr, sec, 5),
+                    (double) sampleAt(inclined, sec, 5),
+                    (double) sampleAt(temp, sec, 5));
+            photometricSeries[i] = p;
+            photometricAvailableSeries[i] = TheoreticalPowerCalc.availablePower(p, (double) avail);
+        }
+
+        // 样板法理论功率本版本恒 0,累计电量恒 0;累计值逐点前缀求和
+        double[] actualEnergy = cumulative(actual, dayEnd);
+        double[] photometricEnergy = cumulative(photometricSeries, dayEnd, power);
+        double[] photometricAvailableEnergy = cumulative(photometricAvailableSeries, dayEnd, power);
+
+        List<TheoreticalEnergyRow> rows = new ArrayList<>();
+        for (int i = 0; i < size; i++)
+        {
+            TheoreticalEnergyRow row = new TheoreticalEnergyRow();
+            row.setTime(DATETIME.format(Instant.ofEpochSecond(epochSec(power.get(i).getTm())).atOffset(ZONE)));
+            row.setEnergy(round3(actualEnergy[i]));
+            row.setSampleMachineTheoreticalEnergy(0D);
+            row.setSampleMachineAvailableEnergy(0D);
+            row.setPhotometricMethodTheoreticalEnergy(round3(photometricEnergy[i]));
+            row.setPhotometricMethodAvailableEnergy(round3(photometricAvailableEnergy[i]));
+            rows.add(row);
+        }
+        return rows;
+    }
+
+    /**
+     * 3.3.3 实时数据(该场站全库 tm 最大一条,双方法 + 开机容量)
+     */
+    @Override
+    public LatestPowerRow selectLatest(LatestQuery query)
+    {
+        ConfigStation station = loadStation(query.getStationCode());
+        List<DataElectricityLocal> power = dataElectricityLocalService.selectActualPowerRange(
+                station.getId(), "2000-01-01", "2099-12-31");
+        if (power.isEmpty())
+        {
+            throw new ServiceException("该场站暂无数据");
+        }
+        DataElectricityLocal last = power.get(power.size() - 1);
+        long sec = epochSec(last.getTm());
+        String day = DateUtils.parseDateToStr("yyyy-MM-dd", last.getTm());
+        List<DataWeatherLocal> weather = loadSingleDayWeather(station, day);
+
+        double a1 = getPhotometricA1();
+        double a2 = getPhotometricA2();
+        Integer n = station.getInverterQuantity();
+        double actualPower = last.getActualPower() == null ? 0 : last.getActualPower();
+        double availability = last.getAvailability() == null || last.getAvailability() == 0 ? 100
+                : last.getAvailability();
+        double photometric = TheoreticalPowerCalc.photometricPower(n, a1, a2,
+                (double) sampleAt(rawPoints(weather, DataWeatherLocal::getIrradiance), sec, 5),
+                (double) sampleAt(rawPoints(weather, DataWeatherLocal::getInclinedIrradiance), sec, 5),
+                (double) sampleAt(rawPoints(weather, DataWeatherLocal::getTemperature), sec, 5));
+
+        LatestPowerRow row = new LatestPowerRow();
+        row.setTime(DATETIME.format(Instant.ofEpochSecond(sec).atOffset(ZONE)));
+        row.setPower(round3(actualPower));
+        row.setSampleMachineTheoreticalPower(0D);
+        row.setSampleMachineAvailablePower(0D);
+        row.setPhotometricMethodTheoreticalPower(round3(photometric));
+        row.setPhotometricMethodAvailablePower(round3(TheoreticalPowerCalc.availablePower(photometric, availability)));
+        row.setInstalledCapacity(station.getInstalledCapacity() == null ? 0D : station.getInstalledCapacity().doubleValue());
+        return row;
+    }
+
+    /**
+     * 3.3.1/3.3.2 光伏受阻电量列表(原始采集点逐行,逐点累计;场内=理论−可用,场外=可用−实际,总=场内+场外)
+     */
+    @Override
+    public List<CurtailedEnergyRow> selectCurtailedEnergyList(CurtailedEnergyQuery query)
+    {
+        ConfigStation station = loadStation(query.getStationCode());
+        String dataType = requireDataType(query.getDataType());
+        String day = requireDay(query.getDay());
+        List<DataElectricityLocal> power = loadSingleDayPower(station, day);
+        if (power.isEmpty())
+        {
+            return Collections.emptyList();
+        }
+        List<DataWeatherLocal> weather = loadSingleDayWeather(station, day);
+        double a1 = getPhotometricA1();
+        double a2 = getPhotometricA2();
+        Integer n = station.getInverterQuantity();
+
+        long dayEnd = dayStartEpoch(day) + 86400L;
+        List<double[]> actual = rawPoints(power, DataElectricityLocal::getActualPower);
+        List<double[]> availability = rawPoints(power, DataElectricityLocal::getAvailability);
+        List<double[]> irr = rawPoints(weather, DataWeatherLocal::getIrradiance);
+        List<double[]> inclined = rawPoints(weather, DataWeatherLocal::getInclinedIrradiance);
+        List<double[]> temp = rawPoints(weather, DataWeatherLocal::getTemperature);
+
+        int size = power.size();
+        double[] intraSeries = new double[size];
+        double[] offSiteSeries = new double[size];
+        for (int i = 0; i < size; i++)
+        {
+            long sec = epochSec(power.get(i).getTm());
+            double avail = sampleAt(availability, sec, 5);
+            if (avail == 0)
+            {
+                avail = 100;
+            }
+            double theoretical = methodTheoretical(dataType, TheoreticalPowerCalc.photometricPower(n, a1, a2,
+                    (double) sampleAt(irr, sec, 5),
+                    (double) sampleAt(inclined, sec, 5),
+                    (double) sampleAt(temp, sec, 5)));
+            double available = TheoreticalPowerCalc.availablePower(theoretical, avail);
+            double actualPower = actual.get(i)[1];
+            intraSeries[i] = theoretical - available;
+            offSiteSeries[i] = available - actualPower;
+        }
+
+        double[] intraEnergy = cumulative(intraSeries, dayEnd, power);
+        double[] offSiteEnergy = cumulative(offSiteSeries, dayEnd, power);
+        List<CurtailedEnergyRow> rows = new ArrayList<>();
+        for (int i = 0; i < size; i++)
+        {
+            CurtailedEnergyRow row = new CurtailedEnergyRow();
+            row.setTime(DATETIME.format(Instant.ofEpochSecond(epochSec(power.get(i).getTm())).atOffset(ZONE)));
+            row.setIntraPlantCurtailedEnergy(round3(intraEnergy[i]));
+            row.setOffSiteCurtailedEnergy(round3(offSiteEnergy[i]));
+            row.setTotalCurtailedEnergy(round3(intraEnergy[i] + offSiteEnergy[i]));
+            rows.add(row);
+        }
+        return rows;
+    }
+
+    /**
+     * 3.4.1/3.4.2 光伏场站逻辑校核列表(5 分钟网格 288 点,三比值 2 位小数,按字典阈值判定)
+     */
+    @Override
+    public List<LogicCheckRow> selectLogicCheckList(PowerCheckQuery query)
+    {
+        ConfigStation station = loadStation(query.getStationCode());
+        String dataType = requireDataType(query.getDataType());
+        String day = requireDay(query.getDay());
+        List<DataElectricityLocal> power = loadSingleDayPower(station, day);
+        List<DataWeatherLocal> weather = loadSingleDayWeather(station, day);
+        double a1 = getPhotometricA1();
+        double a2 = getPhotometricA2();
+        Integer n = station.getInverterQuantity();
+        JSONObject config = loadPowerConfig();
+        double installed = station.getInstalledCapacity() == null ? 0D : station.getInstalledCapacity().doubleValue();
+
+        List<double[]> actual = rawPoints(power, DataElectricityLocal::getActualPower);
+        List<double[]> availability = rawPoints(power, DataElectricityLocal::getAvailability);
+        List<double[]> irr = rawPoints(weather, DataWeatherLocal::getIrradiance);
+        List<double[]> inclined = rawPoints(weather, DataWeatherLocal::getInclinedIrradiance);
+        List<double[]> temp = rawPoints(weather, DataWeatherLocal::getTemperature);
+
+        List<LogicCheckRow> rows = new ArrayList<>();
+        for (long sec = dayStartEpoch(day); sec < dayStartEpoch(day) + 86400L; sec += 300L)
+        {
+            double avail = sampleAt(availability, sec, 5);
+            if (avail == 0)
+            {
+                avail = 100;
+            }
+            double theoretical = methodTheoretical(dataType, TheoreticalPowerCalc.photometricPower(n, a1, a2,
+                    (double) sampleAt(irr, sec, 5),
+                    (double) sampleAt(inclined, sec, 5),
+                    (double) sampleAt(temp, sec, 5)));
+            double available = TheoreticalPowerCalc.availablePower(theoretical, avail);
+            double actualPower = sampleAt(actual, sec, 5);
+            double installed2Theoretical = round2(TheoreticalPowerCalc.ratio100(installed, theoretical));
+            double theoretical2Available = round2(TheoreticalPowerCalc.ratio100(theoretical, available));
+            double available2Actual = round2(TheoreticalPowerCalc.ratio100(available, actualPower));
+
+            LogicCheckRow row = new LogicCheckRow();
+            row.setTime(Instant.ofEpochSecond(sec).atOffset(ZONE).format(HHMM));
+            row.setInstalled2TheoreticalPercent(installed2Theoretical);
+            row.setInstalled2TheoreticalDesc(judge(installed2Theoretical, configPercent(config, "installed2TheoreticalPercent")));
+            row.setTheoretical2AvailablePercent(theoretical2Available);
+            row.setTheoretical2AvailableDesc(judge(theoretical2Available, configPercent(config, "theoretical2AvailablePercent")));
+            row.setAvailable2ActualPercent(available2Actual);
+            row.setAvailable2ActualDesc(judge(available2Actual, configPercent(config, "available2ActualPercent")));
+            rows.add(row);
+        }
+        return rows;
+    }
+
+    /**
+     * 3.5.1/3.5.2 光伏场外受阻电力校核列表(5 分钟网格,MW 3 位小数,偏差=可用÷实发×100)
+     */
+    @Override
+    public List<OffSiteCheckRow> selectOffSiteCheckList(PowerCheckQuery query)
+    {
+        ConfigStation station = loadStation(query.getStationCode());
+        String dataType = requireDataType(query.getDataType());
+        String day = requireDay(query.getDay());
+        List<DataElectricityLocal> power = loadSingleDayPower(station, day);
+        List<DataWeatherLocal> weather = loadSingleDayWeather(station, day);
+        double a1 = getPhotometricA1();
+        double a2 = getPhotometricA2();
+        Integer n = station.getInverterQuantity();
+        JSONObject config = loadPowerConfig();
+
+        List<double[]> actual = rawPoints(power, DataElectricityLocal::getActualPower);
+        List<double[]> availability = rawPoints(power, DataElectricityLocal::getAvailability);
+        List<double[]> irr = rawPoints(weather, DataWeatherLocal::getIrradiance);
+        List<double[]> inclined = rawPoints(weather, DataWeatherLocal::getInclinedIrradiance);
+        List<double[]> temp = rawPoints(weather, DataWeatherLocal::getTemperature);
+
+        List<OffSiteCheckRow> rows = new ArrayList<>();
+        for (long sec = dayStartEpoch(day); sec < dayStartEpoch(day) + 86400L; sec += 300L)
+        {
+            double avail = sampleAt(availability, sec, 5);
+            if (avail == 0)
+            {
+                avail = 100;
+            }
+            double theoretical = methodTheoretical(dataType, TheoreticalPowerCalc.photometricPower(n, a1, a2,
+                    (double) sampleAt(irr, sec, 5),
+                    (double) sampleAt(inclined, sec, 5),
+                    (double) sampleAt(temp, sec, 5)));
+            double available = TheoreticalPowerCalc.availablePower(theoretical, avail);
+            double actualPower = sampleAt(actual, sec, 5);
+            double deviation = round2(TheoreticalPowerCalc.ratio100(available, actualPower));
+
+            OffSiteCheckRow row = new OffSiteCheckRow();
+            row.setTime(Instant.ofEpochSecond(sec).atOffset(ZONE).format(HHMM));
+            row.setAvailablePower(round3(available / 1000));
+            row.setPower(round3(actualPower / 1000));
+            row.setDeviation(deviation);
+            row.setQualifiedDesc(judge(deviation, configPercent(config, "available2ActualPercent")));
+            rows.add(row);
+        }
+        return rows;
+    }
+
+    /**
+     * 3.6.1/3.6.2 光伏场内受阻电力校核列表(5 分钟网格,MW 3 位小数,末行合计,偏差=理论÷可用×100)
+     */
+    @Override
+    public List<IntraPlantCheckRow> selectIntraPlantCheckList(PowerCheckQuery query)
+    {
+        ConfigStation station = loadStation(query.getStationCode());
+        String dataType = requireDataType(query.getDataType());
+        String day = requireDay(query.getDay());
+        List<DataElectricityLocal> power = loadSingleDayPower(station, day);
+        List<DataWeatherLocal> weather = loadSingleDayWeather(station, day);
+        double a1 = getPhotometricA1();
+        double a2 = getPhotometricA2();
+        Integer n = station.getInverterQuantity();
+        JSONObject config = loadPowerConfig();
+
+        List<double[]> availability = rawPoints(power, DataElectricityLocal::getAvailability);
+        List<double[]> irr = rawPoints(weather, DataWeatherLocal::getIrradiance);
+        List<double[]> inclined = rawPoints(weather, DataWeatherLocal::getInclinedIrradiance);
+        List<double[]> temp = rawPoints(weather, DataWeatherLocal::getTemperature);
+
+        List<IntraPlantCheckRow> rows = new ArrayList<>();
+        double sumTheoretical = 0;
+        double sumAvailable = 0;
+        for (long sec = dayStartEpoch(day); sec < dayStartEpoch(day) + 86400L; sec += 300L)
+        {
+            double avail = sampleAt(availability, sec, 5);
+            if (avail == 0)
+            {
+                avail = 100;
+            }
+            double theoretical = methodTheoretical(dataType, TheoreticalPowerCalc.photometricPower(n, a1, a2,
+                    (double) sampleAt(irr, sec, 5),
+                    (double) sampleAt(inclined, sec, 5),
+                    (double) sampleAt(temp, sec, 5)));
+            double available = TheoreticalPowerCalc.availablePower(theoretical, avail);
+            sumTheoretical += theoretical;
+            sumAvailable += available;
+            double deviation = round2(TheoreticalPowerCalc.ratio100(theoretical, available));
+
+            IntraPlantCheckRow row = new IntraPlantCheckRow();
+            row.setTime(Instant.ofEpochSecond(sec).atOffset(ZONE).format(HHMM));
+            row.setTheoreticalPower(round3(theoretical / 1000));
+            row.setAvailablePower(round3(available / 1000));
+            row.setDeviation(deviation);
+            row.setQualifiedDesc(judge(deviation, configPercent(config, "theoretical2AvailablePercent")));
+            rows.add(row);
+        }
+
+        // 合计行:偏差按合计值重算
+        double totalDeviation = round2(TheoreticalPowerCalc.ratio100(sumTheoretical, sumAvailable));
+        IntraPlantCheckRow total = new IntraPlantCheckRow();
+        total.setTime("合计");
+        total.setTheoreticalPower(round3(sumTheoretical / 1000));
+        total.setAvailablePower(round3(sumAvailable / 1000));
+        total.setDeviation(totalDeviation);
+        total.setQualifiedDesc(judge(totalDeviation, configPercent(config, "theoretical2AvailablePercent")));
+        rows.add(total);
+        return rows;
+    }
+
+    /**
+     * 3.7.1/3.7.2 光伏受阻电量日报(startDay..endDay 逐日一行 + 末行合计,keyset 分页加载)
+     */
+    @Override
+    public List<ReportRow> selectDailyReportList(DailyReportQuery query)
+    {
+        ConfigStation station = loadStation(query.getStationCode());
+        String dataType = requireDataType(query.getDataType());
+        LocalDate start = parseDay(query.getStartDay());
+        LocalDate end = parseDay(query.getEndDay());
+        if (end.isBefore(start))
+        {
+            throw new ServiceException("endDay 不能早于 startDay");
+        }
+        if (ChronoUnit.DAYS.between(start, end) > 90)
+        {
+            throw new ServiceException("日报时间范围不能超过 90 天");
+        }
+
+        List<LocalDate> days = new ArrayList<>();
+        for (LocalDate d = start; !d.isAfter(end); d = d.plusDays(1))
+        {
+            days.add(d);
+        }
+        double[][] sums = computeDaySeriesSums(station, dataType, days);
+
+        List<ReportRow> rows = new ArrayList<>();
+        double sumTheoretical = 0, sumAvailable = 0, sumEnergy = 0, sumIntra = 0, sumOffSite = 0;
+        for (int i = 0; i < days.size(); i++)
+        {
+            sumTheoretical += sums[0][i];
+            sumAvailable += sums[1][i];
+            sumEnergy += sums[2][i];
+            sumIntra += sums[3][i];
+            sumOffSite += sums[4][i];
+            rows.add(buildReportRow(days.get(i).toString(), sums[0][i], sums[1][i], sums[2][i], sums[3][i], sums[4][i]));
+        }
+        rows.add(buildReportRow("合计", sumTheoretical, sumAvailable, sumEnergy, sumIntra, sumOffSite));
+        return rows;
+    }
+
+    /**
+     * 3.8.1/3.8.2 光伏受阻电量月报(先计算日、再按月求和 + 末行合计,keyset 分页加载)
+     */
+    @Override
+    public List<ReportRow> selectMonthlyReportList(MonthlyReportQuery query)
+    {
+        ConfigStation station = loadStation(query.getStationCode());
+        String dataType = requireDataType(query.getDataType());
+        YearMonth start = parseMonth(query.getStartMonth());
+        YearMonth end = parseMonth(query.getEndMonth());
+        if (end.isBefore(start))
+        {
+            throw new ServiceException("endMonth 不能早于 startMonth");
+        }
+        if (ChronoUnit.MONTHS.between(start, end) > 12)
+        {
+            throw new ServiceException("月报时间范围不能超过 12 个月");
+        }
+
+        List<LocalDate> days = new ArrayList<>();
+        for (LocalDate d = start.atDay(1); !d.isAfter(end.atEndOfMonth()); d = d.plusDays(1))
+        {
+            days.add(d);
+        }
+        double[][] sums = computeDaySeriesSums(station, dataType, days);
+
+        List<ReportRow> rows = new ArrayList<>();
+        double sumTheoretical = 0, sumAvailable = 0, sumEnergy = 0, sumIntra = 0, sumOffSite = 0;
+        int idx = 0;
+        for (YearMonth m = start; !m.isAfter(end); m = m.plusMonths(1))
+        {
+            LocalDate nextMonthFirst = m.plusMonths(1).atDay(1);
+            double mTheoretical = 0, mAvailable = 0, mEnergy = 0, mIntra = 0, mOffSite = 0;
+            while (idx < days.size() && days.get(idx).isBefore(nextMonthFirst))
+            {
+                mTheoretical += sums[0][idx];
+                mAvailable += sums[1][idx];
+                mEnergy += sums[2][idx];
+                mIntra += sums[3][idx];
+                mOffSite += sums[4][idx];
+                idx++;
+            }
+            sumTheoretical += mTheoretical;
+            sumAvailable += mAvailable;
+            sumEnergy += mEnergy;
+            sumIntra += mIntra;
+            sumOffSite += mOffSite;
+            rows.add(buildReportRow(m.toString(), mTheoretical, mAvailable, mEnergy, mIntra, mOffSite));
+        }
+        rows.add(buildReportRow("合计", sumTheoretical, sumAvailable, sumEnergy, sumIntra, sumOffSite));
+        return rows;
+    }
+
+    // ==================== 私有方法 ====================
+
+    /**
+     * 按场站编码加载场站,查不到抛异常
+     */
+    private ConfigStation loadStation(String stationCode)
+    {
+        if (StringUtils.isEmpty(stationCode))
+        {
+            throw new ServiceException("场站编码不能为空");
+        }
+        ConfigStation station = configStationMapper.selectConfigStationByCode(stationCode);
+        if (station == null)
+        {
+            throw new ServiceException("场站不存在:" + stationCode);
+        }
+        return station;
+    }
+
+    /**
+     * 查询指定日期全天(含当天)实发功率
+     */
+    private List<DataElectricityLocal> loadSingleDayPower(ConfigStation station, String day)
+    {
+        return dataElectricityLocalService.selectActualPowerRange(station.getId(), day, day);
+    }
+
+    /**
+     * 查询指定日期全天(含当天)气象采样
+     */
+    private List<DataWeatherLocal> loadSingleDayWeather(ConfigStation station, String day)
+    {
+        return dataWeatherLocalService.selectIrradianceRange(station.getId(), day, day);
+    }
+
+    /**
+     * 校核日期参数
+     */
+    private String requireDay(String day)
+    {
+        if (StringUtils.isEmpty(day))
+        {
+            throw new ServiceException("日期不能为空");
+        }
+        return day;
+    }
+
+    /**
+     * 校核采样频率(5/15 分钟)
+     */
+    private int requireFrequency(Integer freq)
+    {
+        if (freq == null || (freq != 5 && freq != 15))
+        {
+            throw new ServiceException("采样频率仅支持 5 或 15 分钟");
+        }
+        return freq;
+    }
+
+    /**
+     * 读取测光法系数 a1(字典 algorithm_config/测光法配置,缺失按 0)
+     */
+    private double getPhotometricA1()
+    {
+        String json = DictUtils.getDictValue(DICT_ALGORITHM_CONFIG, DICT_LABEL_PHOTOMETRIC);
+        if (StringUtils.isEmpty(json))
+        {
+            return 0;
+        }
+        JSONObject obj = JSON.parseObject(json);
+        return obj.getDoubleValue("a1");
+    }
+
+    /**
+     * 读取测光法系数 a2(字典 algorithm_config/测光法配置,缺失按 0)
+     */
+    private double getPhotometricA2()
+    {
+        String json = DictUtils.getDictValue(DICT_ALGORITHM_CONFIG, DICT_LABEL_PHOTOMETRIC);
+        if (StringUtils.isEmpty(json))
+        {
+            return 0;
+        }
+        JSONObject obj = JSON.parseObject(json);
+        return obj.getDoubleValue("a2");
+    }
+
+    /**
+     * 日期当天 00:00(+08:00)epoch 秒
+     */
+    private long dayStartEpoch(String day)
+    {
+        return LocalDate.parse(day).atStartOfDay(ZONE).toEpochSecond();
+    }
+
+    /**
+     * Date → epoch 秒(+08:00)
+     */
+    private long epochSec(java.util.Date date)
+    {
+        return date.toInstant().atOffset(ZONE).toEpochSecond();
+    }
+
+    /**
+     * 升序原始点索引(epoch 秒,值;null 值按 0)
+     */
+    private List<double[]> rawPoints(List<DataElectricityLocal> list,
+            java.util.function.Function<DataElectricityLocal, Double> getter)
+    {
+        List<double[]> points = new ArrayList<>();
+        if (list != null)
+        {
+            for (DataElectricityLocal item : list)
+            {
+                Double val = getter.apply(item);
+                points.add(new double[] { epochSec(item.getTm()), val == null ? 0 : val });
+            }
+        }
+        return points;
+    }
+
+    /**
+     * 升序原始点索引(气象)
+     */
+    private List<double[]> rawPoints(List<DataWeatherLocal> list,
+            java.util.function.Function<DataWeatherLocal, Double> getter)
+    {
+        List<double[]> points = new ArrayList<>();
+        if (list != null)
+        {
+            for (DataWeatherLocal item : list)
+            {
+                Double val = getter.apply(item);
+                points.add(new double[] { epochSec(item.getTm()), val == null ? 0 : val });
+            }
+        }
+        return points;
+    }
+
+    /**
+     * 原始点时刻采样对齐(设计 §3.3,原始点场景窗口固定 5 分钟)
+     */
+    private double sampleAt(List<double[]> points, long sec, int deltaMin)
+    {
+        return TheoreticalPowerCalc.samplePoint(points, sec, deltaMin);
+    }
+
+    /**
+     * 逐点累计电量(万千瓦时):与原始点时刻对齐的升序序列 (t_i, p_i),
+     * E_i=(p_i+p_{i+1})/2×Δt_i 小时 (i<n);E_n=p_n×(dayEndSec−t_n) 小时;Σ kWh ÷ 10000
+     */
+    private double[] cumulative(List<double[]> points, long dayEnd)
+    {
+        int n = points.size();
+        double[] result = new double[n];
+        double sum = 0;
+        for (int i = 0; i < n; i++)
+        {
+            double delta;
+            if (i < n - 1)
+            {
+                delta = (points.get(i + 1)[0] - points.get(i)[0]) / 3600.0
+                        * (points.get(i)[1] + points.get(i + 1)[1]) / 2;
+            }
+            else
+            {
+                delta = dayEnd > points.get(i)[0]
+                        ? (dayEnd - points.get(i)[0]) / 3600.0 * points.get(i)[1] : 0;
+            }
+            sum += delta / 10000;
+            result[i] = sum;
+        }
+        return result;
+    }
+
+    /**
+     * 逐点累计电量(万千瓦时,功率序列与原始点时刻一一对应)
+     */
+    private double[] cumulative(double[] series, long dayEnd, List<DataElectricityLocal> power)
+    {
+        int n = power.size();
+        double[] result = new double[n];
+        double sum = 0;
+        for (int i = 0; i < n; i++)
+        {
+            double delta;
+            if (i < n - 1)
+            {
+                double dt = epochSec(power.get(i + 1).getTm()) - epochSec(power.get(i).getTm());
+                delta = dt / 3600.0 * (series[i] + series[i + 1]) / 2;
+            }
+            else
+            {
+                double dt = dayEnd - epochSec(power.get(i).getTm());
+                delta = dt > 0 ? dt / 3600.0 * series[i] : 0;
+            }
+            sum += delta / 10000;
+            result[i] = sum;
+        }
+        return result;
+    }
+
+    /**
+     * 校核理论功率算法参数 dataType
+     */
+    private String requireDataType(String dataType)
+    {
+        if (StringUtils.isEmpty(dataType)
+                || (!DATA_TYPE_SAMPLE.equals(dataType) && !DATA_TYPE_PHOTOMETRIC.equals(dataType)))
+        {
+            throw new ServiceException("理论功率算法仅支持 sampleMachine 或 photometricMethod");
+        }
+        return dataType;
+    }
+
+    /**
+     * 读取校核阈值配置(字典 theoretical_power_config/理论功率配置项,缺失返回 null)
+     */
+    private JSONObject loadPowerConfig()
+    {
+        String json = DictUtils.getDictValue(DICT_POWER_CONFIG, DICT_LABEL_POWER_CONFIG);
+        if (StringUtils.isEmpty(json))
+        {
+            return null;
+        }
+        return JSON.parseObject(json);
+    }
+
+    /**
+     * 从配置 JSON 取阈值百分比(缺失返回 null,判定时按合格处理)
+     */
+    private Double configPercent(JSONObject config, String key)
+    {
+        return config == null ? null : config.getDouble(key);
+    }
+
+    /**
+     * 按算法取理论功率:样板法本版本恒 0,测光法取计算值
+     */
+    private double methodTheoretical(String dataType, double photometric)
+    {
+        return DATA_TYPE_SAMPLE.equals(dataType) ? 0 : photometric;
+    }
+
+    /**
+     * 百分比保留 2 位小数
+     */
+    private double round2(double v)
+    {
+        return TheoreticalPowerCalc.round(v, 2);
+    }
+
+    /**
+     * 校核判定:值 0(含分母为 0)显示 0.00 且合格;否则 ≥ 阈值合格(阈值缺失按合格)
+     */
+    private String judge(double value, Double threshold)
+    {
+        if (value == 0)
+        {
+            return "合格";
+        }
+        return threshold == null || value >= threshold ? "合格" : "不合格";
+    }
+
+    /**
+     * 校验并解析日期(yyyy-MM-dd)
+     */
+    private LocalDate parseDay(String day)
+    {
+        if (StringUtils.isEmpty(day))
+        {
+            throw new ServiceException("日期不能为空");
+        }
+        try
+        {
+            return LocalDate.parse(day);
+        }
+        catch (Exception e)
+        {
+            throw new ServiceException("日期格式不正确:" + day);
+        }
+    }
+
+    /**
+     * 校验并解析月份(yyyy-MM)
+     */
+    private YearMonth parseMonth(String month)
+    {
+        if (StringUtils.isEmpty(month))
+        {
+            throw new ServiceException("月份不能为空");
+        }
+        try
+        {
+            return YearMonth.parse(month);
+        }
+        catch (Exception e)
+        {
+            throw new ServiceException("月份格式不正确:" + month);
+        }
+    }
+
+    /**
+     * 分页(keyset 游标)加载功率采样数据,每页 2000 条,区间左闭右开
+     */
+    private List<DataElectricityLocal> loadElectricityPaged(Long stationId, String startIso, String endIsoExcl)
+    {
+        List<DataElectricityLocal> all = new ArrayList<>();
+        String lastTm = null;
+        Long lastStationId = null;
+        while (true)
+        {
+            List<DataElectricityLocal> page = dataElectricityLocalMapper.selectElectricityPaged(
+                    stationId, startIso, endIsoExcl, lastTm, lastStationId);
+            if (page == null || page.isEmpty())
+            {
+                break;
+            }
+            all.addAll(page);
+            if (page.size() < 2000)
+            {
+                break;
+            }
+            lastTm = isoInstant(page.get(page.size() - 1).getTm());
+            lastStationId = stationId;
+        }
+        return all;
+    }
+
+    /**
+     * 分页(keyset 游标)加载气象采样数据,每页 2000 条,区间左闭右开
+     */
+    private List<DataWeatherLocal> loadWeatherPaged(Long stationId, String startIso, String endIsoExcl)
+    {
+        List<DataWeatherLocal> all = new ArrayList<>();
+        String lastTm = null;
+        Long lastStationId = null;
+        while (true)
+        {
+            List<DataWeatherLocal> page = dataWeatherLocalMapper.selectWeatherPaged(
+                    stationId, startIso, endIsoExcl, lastTm, lastStationId);
+            if (page == null || page.isEmpty())
+            {
+                break;
+            }
+            all.addAll(page);
+            if (page.size() < 2000)
+            {
+                break;
+            }
+            lastTm = isoInstant(page.get(page.size() - 1).getTm());
+            lastStationId = stationId;
+        }
+        return all;
+    }
+
+    /**
+     * Date → ISO 8601 带时区字符串(keyset 游标,保留精确 tm)
+     */
+    private String isoInstant(java.util.Date date)
+    {
+        return date.toInstant().atOffset(ZONE).format(DateTimeFormatter.ISO_INSTANT);
+    }
+
+    /**
+     * 逐日 5 序列求和(万千瓦时):[0]理论 [1]可用 [2]实际 [3]场内=理论−可用 [4]场外=可用−实际
+     * 逐点计算各序列值后按 3.3.1 规则按日归集:同日相邻点梯形、当日最末点矩形延至当日 24:00,跨日不回填
+     */
+    private double[][] computeDaySeriesSums(ConfigStation station, String dataType, List<LocalDate> days)
+    {
+        String startIso = days.get(0).toString() + "T00:00:00+08:00";
+        String endIsoExcl = days.get(days.size() - 1).plusDays(1).toString() + "T00:00:00+08:00";
+        List<DataElectricityLocal> power = loadElectricityPaged(station.getId(), startIso, endIsoExcl);
+        List<DataWeatherLocal> weather = loadWeatherPaged(station.getId(), startIso, endIsoExcl);
+        double a1 = getPhotometricA1();
+        double a2 = getPhotometricA2();
+        Integer n = station.getInverterQuantity();
+
+        int dayCount = days.size();
+        long firstDayStart = days.get(0).atStartOfDay(ZONE).toEpochSecond();
+        int size = power.size();
+        int[] dayIndex = new int[size];
+        double[][] series = new double[5][size];
+
+        List<double[]> actual = rawPoints(power, DataElectricityLocal::getActualPower);
+        List<double[]> availability = rawPoints(power, DataElectricityLocal::getAvailability);
+        List<double[]> irr = rawPoints(weather, DataWeatherLocal::getIrradiance);
+        List<double[]> inclined = rawPoints(weather, DataWeatherLocal::getInclinedIrradiance);
+        List<double[]> temp = rawPoints(weather, DataWeatherLocal::getTemperature);
+
+        for (int i = 0; i < size; i++)
+        {
+            long sec = epochSec(power.get(i).getTm());
+            int di = (int) ((sec - firstDayStart) / 86400L);
+            dayIndex[i] = di;
+            double avail = sampleAt(availability, sec, 5);
+            if (avail == 0)
+            {
+                avail = 100;
+            }
+            double theoretical = methodTheoretical(dataType, TheoreticalPowerCalc.photometricPower(n, a1, a2,
+                    (double) sampleAt(irr, sec, 5),
+                    (double) sampleAt(inclined, sec, 5),
+                    (double) sampleAt(temp, sec, 5)));
+            double available = TheoreticalPowerCalc.availablePower(theoretical, avail);
+            double actualPower = actual.get(i)[1];
+            series[0][i] = theoretical;
+            series[1][i] = available;
+            series[2][i] = actualPower;
+            series[3][i] = theoretical - available;
+            series[4][i] = available - actualPower;
+        }
+
+        double[][] sums = new double[5][dayCount];
+        for (int s = 0; s < 5; s++)
+        {
+            sums[s] = seriesDaySum(series[s], dayIndex, power, firstDayStart, dayCount);
+        }
+        return sums;
+    }
+
+    /**
+     * 单序列按日求和(万千瓦时):同日相邻点 (v_i+v_{i+1})/2×Δt 小时;
+     * 当日最末点 v×(当日 24:00 − t) 小时;Σ kWh ÷ 10000
+     */
+    private double[] seriesDaySum(double[] series, int[] dayIndex, List<DataElectricityLocal> power,
+            long firstDayStart, int dayCount)
+    {
+        double[] sum = new double[dayCount];
+        int size = power.size();
+        for (int i = 0; i < size; i++)
+        {
+            long t = epochSec(power.get(i).getTm());
+            int di = dayIndex[i];
+            if (i < size - 1 && dayIndex[i + 1] == di)
+            {
+                long t2 = epochSec(power.get(i + 1).getTm());
+                sum[di] += (t2 - t) / 3600.0 * (series[i] + series[i + 1]) / 2;
+            }
+            else
+            {
+                long dayEnd = firstDayStart + (di + 1) * 86400L;
+                if (t < dayEnd)
+                {
+                    sum[di] += (dayEnd - t) / 3600.0 * series[i];
+                }
+            }
+        }
+        for (int d = 0; d < dayCount; d++)
+        {
+            sum[d] /= 10000;
+        }
+        return sum;
+    }
+
+    /**
+     * 构建日报/月报行(万千瓦时 3 位小数;总受阻=场内+场外 按未取整值计算后取整)
+     */
+    private ReportRow buildReportRow(String time, double theoretical, double available, double energy,
+            double intra, double offSite)
+    {
+        ReportRow row = new ReportRow();
+        row.setTime(time);
+        row.setTheoreticalEnergy(round3(theoretical));
+        row.setAvailableEnergy(round3(available));
+        row.setEnergy(round3(energy));
+        row.setIntraPlantCurtailedEnergy(round3(intra));
+        row.setOffSiteCurtailedEnergy(round3(offSite));
+        row.setTotalCurtailedEnergy(round3(intra + offSite));
+        return row;
+    }
+
+    /**
+     * 功率(kW)保留 3 位小数
+     */
+    private double round3(double v)
+    {
+        return TheoreticalPowerCalc.round(v, 3);
+    }
+}

+ 14 - 0
forecast-backend-server/src/main/java/com/ufo/project/weather/mapper/DataWeatherLocalMapper.java

@@ -97,4 +97,18 @@ public interface DataWeatherLocalMapper
      */
     public List<DataWeatherLocal> selectIrradianceRange(@Param("configStationId") Long configStationId,
             @Param("startTime") String startTime, @Param("endTime") String endTime);
+
+    /**
+     * 按时间区间分页查询天气采样数据(keyset 游标分页,游标为 (tm, config_station_id),全列返回)
+     *
+     * @param configStationId 场站ID
+     * @param startTime 起始时间(ISO 8601 字符串,包含)
+     * @param endTime 结束时间(ISO 8601 字符串,不包含;service 层将含截止日转换为截止日次日 00:00 传入)
+     * @param lastTm 上一页最后一条记录的 tm(ISO 8601 字符串),首页传 null
+     * @param lastStationId 上一页最后一条记录的 config_station_id,首页传 null
+     * @return 本地气象采样数据集合(按 tm, config_station_id 升序,每页最多 2000 条)
+     */
+    public List<DataWeatherLocal> selectWeatherPaged(@Param("configStationId") Long configStationId,
+            @Param("startTime") String startTime, @Param("endTime") String endTime,
+            @Param("lastTm") String lastTm, @Param("lastStationId") Long lastStationId);
 }

+ 11 - 2
forecast-backend-server/src/main/resources/mybatis/config/ConfigStationMapper.xml

@@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="installedCapacity"    column="installed_capacity"    />
         <result property="gridConnectedCapacity"    column="grid_connected_capacity"    />
         <result property="fansPvPanelquantity"    column="fans_pv_panelquantity"    />
+        <result property="inverterQuantity"    column="inverter_quantity"    />
         <result property="elevation"    column="elevation"    />
         <result property="operationTime"    column="operation_time"    />
         <result property="boosterstationVoltageLevel"    column="boosterstation_voltage_level"    />
@@ -40,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <sql id="selectConfigStationVo">
-        select id, station_name, station_code, superior_area_id, period_total, longitude, latitude, province_number, city_number, position, installed_capacity, grid_connected_capacity, fans_pv_panelquantity, elevation, operation_time, boosterstation_voltage_level, booster_station_longitude, boosterstation_latitude, responsible_person_name, responsible_person_phone, is_enable, push_status, subject_total, is_full_power, is_del, create_by, create_time, update_by, update_time, station_type, system_power_uuid, area_id from config_station
+        select id, station_name, station_code, superior_area_id, period_total, longitude, latitude, province_number, city_number, position, installed_capacity, grid_connected_capacity, fans_pv_panelquantity, inverter_quantity, elevation, operation_time, boosterstation_voltage_level, booster_station_longitude, boosterstation_latitude, responsible_person_name, responsible_person_phone, is_enable, push_status, subject_total, is_full_power, is_del, create_by, create_time, update_by, update_time, station_type, system_power_uuid, area_id from config_station
     </sql>
 
     <select id="selectConfigStationList" parameterType="ConfigStation" resultMap="ConfigStationResult">
@@ -89,7 +90,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </foreach>
         and station_type = 1
     </select>
-        
+
+    <select id="selectConfigStationByCode" resultMap="ConfigStationResult">
+        <include refid="selectConfigStationVo"/>
+        where station_code = #{stationCode} and is_del = false limit 1
+    </select>
+
     <insert id="insertConfigStation" parameterType="ConfigStation">
         insert into config_station
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -106,6 +112,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="installedCapacity != null">installed_capacity,</if>
             <if test="gridConnectedCapacity != null">grid_connected_capacity,</if>
             <if test="fansPvPanelquantity != null">fans_pv_panelquantity,</if>
+            <if test="inverterQuantity != null">inverter_quantity,</if>
             <if test="elevation != null">elevation,</if>
             <if test="operationTime != null">operation_time,</if>
             <if test="boosterstationVoltageLevel != null">boosterstation_voltage_level,</if>
@@ -140,6 +147,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="installedCapacity != null">#{installedCapacity},</if>
             <if test="gridConnectedCapacity != null">#{gridConnectedCapacity},</if>
             <if test="fansPvPanelquantity != null">#{fansPvPanelquantity},</if>
+            <if test="inverterQuantity != null">#{inverterQuantity},</if>
             <if test="elevation != null">#{elevation},</if>
             <if test="operationTime != null">#{operationTime},</if>
             <if test="boosterstationVoltageLevel != null">#{boosterstationVoltageLevel},</if>
@@ -177,6 +185,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="installedCapacity != null">installed_capacity = #{installedCapacity},</if>
             <if test="gridConnectedCapacity != null">grid_connected_capacity = #{gridConnectedCapacity},</if>
             <if test="fansPvPanelquantity != null">fans_pv_panelquantity = #{fansPvPanelquantity},</if>
+            <if test="inverterQuantity != null">inverter_quantity = #{inverterQuantity},</if>
             <if test="elevation != null">elevation = #{elevation},</if>
             <if test="operationTime != null">operation_time = #{operationTime},</if>
             <if test="boosterstationVoltageLevel != null">boosterstation_voltage_level = #{boosterstationVoltageLevel},</if>

+ 15 - 0
forecast-backend-server/src/main/resources/mybatis/model/DataElectricityLocalMapper.xml

@@ -61,6 +61,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         order by tm asc
     </select>
 
+    <!--
+        keyset 游标分页: 游标为 (tm, config_station_id),首页 lastTm 传 null。
+        时间区间左闭右开: tm >= startTime and tm < endTime(ISO 8601 带时区字符串,与会话时区无关)。
+        每页固定 limit 2000。
+    -->
+    <select id="selectElectricityPaged" resultMap="DataElectricityLocalResult">
+        <include refid="selectDataElectricityLocalVo"/>
+        where config_station_id = #{configStationId}
+          and tm &gt;= #{startTime}
+          and tm &lt; #{endTime}
+        <if test="lastTm != null">and (tm, config_station_id) &gt; (#{lastTm}, #{lastStationId})</if>
+        order by tm, config_station_id
+        limit 2000
+    </select>
+
     <insert id="insertDataElectricityLocal" parameterType="DataElectricityLocal">
         insert into data_electricity_local
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 16 - 0
forecast-backend-server/src/main/resources/mybatis/weather/DataWeatherLocalMapper.xml

@@ -71,6 +71,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         order by tm asc
     </select>
 
+    <!--
+        keyset 游标分页: 游标为 (tm, config_station_id),首页 lastTm 传 null。
+        时间区间左闭右开: tm >= startTime and tm < endTime(ISO 8601 带时区字符串,与会话时区无关)。
+        全列查询(含 inclined_irradiance,供测光法 G 回退使用)。
+        每页固定 limit 2000。
+    -->
+    <select id="selectWeatherPaged" resultMap="DataWeatherLocalResult">
+        <include refid="selectDataWeatherLocalVo"/>
+        where config_station_id = #{configStationId}
+          and tm &gt;= #{startTime}
+          and tm &lt; #{endTime}
+        <if test="lastTm != null">and (tm, config_station_id) &gt; (#{lastTm}, #{lastStationId})</if>
+        order by tm, config_station_id
+        limit 2000
+    </select>
+
     <select id="selectDataWeatherLocalByTm" parameterType="Date" resultMap="DataWeatherLocalResult">
         <include refid="selectDataWeatherLocalVo"/>
         where tm = #{tm}

+ 165 - 0
forecast-backend-vue/src/api/theoretical/power.js

@@ -0,0 +1,165 @@
+import request from '@/utils/request'
+
+// ==================== 查询(8 个) ====================
+
+// 3.2.1 光伏理论功率列表
+export function theoreticalPowerList(data) {
+  return request({
+    url: '/theoretical/power/list',
+    method: 'post',
+    data: data
+  })
+}
+
+// 3.3.3 实时数据(全场最新一条)
+export function theoreticalLatest(data) {
+  return request({
+    url: '/theoretical/power/latest',
+    method: 'post',
+    data: data
+  })
+}
+
+// 3.3.1 光伏受阻电量列表
+export function curtailedEnergyList(data) {
+  return request({
+    url: '/theoretical/power/curtailedEnergy/list',
+    method: 'post',
+    data: data
+  })
+}
+
+// 3.4.1 光伏场站逻辑校核列表
+export function logicCheckList(data) {
+  return request({
+    url: '/theoretical/power/logicCheck/list',
+    method: 'post',
+    data: data
+  })
+}
+
+// 3.5.1 光伏场外受阻电力校核列表
+export function offSiteCheckList(data) {
+  return request({
+    url: '/theoretical/power/offSiteCheck/list',
+    method: 'post',
+    data: data
+  })
+}
+
+// 3.6.1 光伏场内受阻电力校核列表
+export function intraPlantCheckList(data) {
+  return request({
+    url: '/theoretical/power/intraPlantCheck/list',
+    method: 'post',
+    data: data
+  })
+}
+
+// 3.7.1 光伏受阻电量日报
+export function dailyReportList(data) {
+  return request({
+    url: '/theoretical/power/dailyReport/list',
+    method: 'post',
+    data: data
+  })
+}
+
+// 3.8.1 光伏受阻电量月报
+export function monthlyReportList(data) {
+  return request({
+    url: '/theoretical/power/monthlyReport/list',
+    method: 'post',
+    data: data
+  })
+}
+
+// ==================== 导出(8 个) ====================
+
+// 3.2.2 导出光伏理论功率
+export function exportTheoreticalPower(data) {
+  return request({
+    url: '/theoretical/power/export',
+    method: 'post',
+    data: data,
+    responseType: 'blob',
+    timeout: 120000
+  })
+}
+
+// 3.2.3 导出光伏理论发电量
+export function exportTheoreticalEnergy(data) {
+  return request({
+    url: '/theoretical/power/energy/export',
+    method: 'post',
+    data: data,
+    responseType: 'blob',
+    timeout: 120000
+  })
+}
+
+// 3.3.2 导出光伏受阻电量
+export function exportCurtailedEnergy(data) {
+  return request({
+    url: '/theoretical/power/curtailedEnergy/export',
+    method: 'post',
+    data: data,
+    responseType: 'blob',
+    timeout: 120000
+  })
+}
+
+// 3.4.2 导出光伏场站逻辑校核
+export function exportLogicCheck(data) {
+  return request({
+    url: '/theoretical/power/logicCheck/export',
+    method: 'post',
+    data: data,
+    responseType: 'blob',
+    timeout: 120000
+  })
+}
+
+// 3.5.2 导出光伏场外受阻电力校核
+export function exportOffSiteCheck(data) {
+  return request({
+    url: '/theoretical/power/offSiteCheck/export',
+    method: 'post',
+    data: data,
+    responseType: 'blob',
+    timeout: 120000
+  })
+}
+
+// 3.6.2 导出光伏场内受阻电力校核
+export function exportIntraPlantCheck(data) {
+  return request({
+    url: '/theoretical/power/intraPlantCheck/export',
+    method: 'post',
+    data: data,
+    responseType: 'blob',
+    timeout: 120000
+  })
+}
+
+// 3.7.2 导出光伏受阻电量日报
+export function exportDailyReport(data) {
+  return request({
+    url: '/theoretical/power/dailyReport/export',
+    method: 'post',
+    data: data,
+    responseType: 'blob',
+    timeout: 120000
+  })
+}
+
+// 3.8.2 导出光伏受阻电量月报
+export function exportMonthlyReport(data) {
+  return request({
+    url: '/theoretical/power/monthlyReport/export',
+    method: 'post',
+    data: data,
+    responseType: 'blob',
+    timeout: 120000
+  })
+}

+ 207 - 0
forecast-backend-vue/src/views/ufo/theoretical/PvCurtailmentEnergy.vue

@@ -0,0 +1,207 @@
+<template>
+  <div class="pv-curtailment-energy-page">
+    <a-card :bordered="false">
+      <a-row :gutter="[12, 12]" align="middle">
+        <a-col :xs="24" :md="6">
+          <StationSelector v-model:value="query.stationCode" :options="stationOptions" :multiple="false" />
+        </a-col>
+        <a-col :xs="24" :md="6">
+          <a-radio-group v-model:value="query.dataType" button-style="solid">
+            <a-radio value="sampleMachine">样板法</a-radio>
+            <a-radio value="photometricMethod">测光法</a-radio>
+          </a-radio-group>
+        </a-col>
+        <a-col :xs="24" :md="5">
+          <a-date-picker
+            v-model:value="query.day"
+            format="YYYY-MM-DD"
+            value-format="YYYY-MM-DD"
+            placeholder="选择日期"
+            class="full-control"
+          />
+        </a-col>
+        <a-col :xs="24" :md="7">
+          <a-space>
+            <a-button type="primary" :loading="loading" @click="handleQuery">确认</a-button>
+            <a-button :loading="exporting" @click="handleExport">导出</a-button>
+          </a-space>
+        </a-col>
+      </a-row>
+    </a-card>
+
+    <a-card title="受阻电量" :bordered="false" style="margin-top: 16px">
+      <div ref="chartRef" class="bar-chart" />
+    </a-card>
+
+    <a-card title="数据详情" :bordered="false" style="margin-top: 16px">
+      <BusinessDataTable
+        row-key="time"
+        :columns="tableColumns"
+        :data-source="tableRows"
+        :pagination="{ pageSize: 20 }"
+        :scroll-x="'max-content'"
+      />
+    </a-card>
+  </div>
+</template>
+
+<script setup name="PvCurtailmentEnergy">
+import { nextTick, onBeforeUnmount, onMounted, reactive, ref, watch } from 'vue'
+import { message } from 'ant-design-vue'
+import * as echarts from 'echarts'
+import dayjs from 'dayjs'
+import { saveAs } from 'file-saver'
+import { blobValidate } from '@/utils/bearjia'
+import { listStation } from '@/api/config/station'
+import { curtailedEnergyList, exportCurtailedEnergy } from '@/api/theoretical/power'
+import BusinessDataTable from '../electricity/components/BusinessDataTable.vue'
+import StationSelector from '../electricity/components/StationSelector.vue'
+import { normalizeRows } from '../electricity/components/dataAdapter.js'
+
+const loading = ref(false)
+const exporting = ref(false)
+const stationOptions = ref([])
+const tableRows = ref([])
+const chartRef = ref()
+let chartInstance = null
+
+const query = reactive({
+  stationCode: undefined,
+  dataType: 'sampleMachine',
+  day: dayjs().format('YYYY-MM-DD')
+})
+
+const tableColumns = [
+  { title: '时间', dataIndex: 'time', width: 160 },
+  { title: '场内受阻电量(万千瓦时)', dataIndex: 'intraPlantCurtailedEnergy', width: 170 },
+  { title: '场外受阻电量(万千瓦时)', dataIndex: 'offSiteCurtailedEnergy', width: 170 },
+  { title: '总受阻电量(万千瓦时)', dataIndex: 'totalCurtailedEnergy', width: 170 }
+]
+
+const chartOption = () => ({
+  tooltip: { trigger: 'axis' },
+  legend: { top: 0, left: 'center' },
+  // containLabel 让 grid 自动容纳 Y 轴刻度文字,避免长数值被容器左缘裁切
+  grid: { left: 8, right: 24, top: 46, bottom: 52, containLabel: true },
+  xAxis: { type: 'category', data: tableRows.value.map((item) => (item.time || '').slice(11, 16)) },
+  yAxis: { type: 'value', name: '万千瓦时', splitLine: { lineStyle: { color: '#e6eef8' } } },
+  dataZoom: [
+    { type: 'inside', start: 0, end: 100 },
+    { type: 'slider', height: 18, bottom: 12, start: 0, end: 100 }
+  ],
+  series: [
+    {
+      name: '场内受阻电量',
+      type: 'bar',
+      stack: 'curtailed',
+      color: '#1890ff',
+      data: tableRows.value.map((item) => item.intraPlantCurtailedEnergy || 0)
+    },
+    {
+      name: '场外受阻电量',
+      type: 'bar',
+      stack: 'curtailed',
+      color: '#faad14',
+      data: tableRows.value.map((item) => item.offSiteCurtailedEnergy || 0)
+    }
+  ]
+})
+
+const renderChart = async () => {
+  await nextTick()
+  if (!chartRef.value) return
+  if (!chartInstance) {
+    chartInstance = echarts.init(chartRef.value)
+  }
+  chartInstance.setOption(chartOption(), true)
+}
+
+const resizeChart = () => {
+  chartInstance?.resize()
+}
+
+const checkStation = () => {
+  if (!query.stationCode) {
+    message.warning('请先选择电厂')
+    return false
+  }
+  return true
+}
+
+const buildParams = () => ({
+  stationCode: query.stationCode,
+  dataType: query.dataType,
+  day: query.day
+})
+
+const loadStationOptions = async () => {
+  const res = await listStation({ pageNum: 1, pageSize: 500 })
+  const rows = normalizeRows(res)
+  stationOptions.value = rows.map((item, index) => ({
+    label: item.stationName || `站点${index + 1}`,
+    value: item.stationCode
+  }))
+  if (!query.stationCode && stationOptions.value.length) {
+    query.stationCode = stationOptions.value[0].value
+  }
+}
+
+const handleQuery = async () => {
+  if (!checkStation()) return
+  loading.value = true
+  try {
+    const res = await curtailedEnergyList(buildParams())
+    tableRows.value = normalizeRows(res)
+    renderChart()
+  } finally {
+    loading.value = false
+  }
+}
+
+const handleExport = async () => {
+  if (!checkStation()) return
+  exporting.value = true
+  try {
+    const res = await exportCurtailedEnergy(buildParams())
+    const isFile = await blobValidate(res)
+    if (isFile) {
+      saveAs(new Blob([res]), `光伏受阻电量_${dayjs(query.day).format('YYYYMMDD')}.xlsx`)
+      message.success('导出成功')
+    } else {
+      const text = await res.text()
+      let msg = '导出失败'
+      try { msg = JSON.parse(text)?.msg || msg } catch (e) { /* ignore */ }
+      message.error(msg)
+    }
+  } finally {
+    exporting.value = false
+  }
+}
+
+watch(tableRows, renderChart, { deep: true })
+
+onMounted(async () => {
+  await loadStationOptions()
+  await handleQuery()
+  window.addEventListener('resize', resizeChart)
+})
+
+onBeforeUnmount(() => {
+  window.removeEventListener('resize', resizeChart)
+  chartInstance?.dispose()
+  chartInstance = null
+})
+</script>
+
+<style lang="less" scoped>
+.pv-curtailment-energy-page {
+  padding: 16px;
+}
+.full-control {
+  width: 100%;
+}
+.bar-chart {
+  width: 100%;
+  height: 360px;
+}
+</style>

+ 227 - 0
forecast-backend-vue/src/views/ufo/theoretical/PvCurtailmentEnergyDaily.vue

@@ -0,0 +1,227 @@
+<template>
+  <div class="pv-curtailment-energy-daily-page">
+    <a-card :bordered="false">
+      <a-row :gutter="[12, 12]" align="middle">
+        <a-col :xs="24" :md="6">
+          <StationSelector v-model:value="query.stationCode" :options="stationOptions" :multiple="false" />
+        </a-col>
+        <a-col :xs="24" :md="6">
+          <a-radio-group v-model:value="query.dataType" button-style="solid">
+            <a-radio value="sampleMachine">样板法</a-radio>
+            <a-radio value="photometricMethod">测光法</a-radio>
+          </a-radio-group>
+        </a-col>
+        <a-col :xs="24" :md="6">
+          <a-range-picker
+            v-model:value="dateRange"
+            format="YYYY-MM-DD"
+            value-format="YYYY-MM-DD"
+            class="full-control"
+          />
+        </a-col>
+        <a-col :xs="24" :md="6">
+          <a-space>
+            <a-button type="primary" :loading="loading" @click="handleQuery">确认</a-button>
+            <a-button :loading="exporting" @click="handleExport">导出</a-button>
+          </a-space>
+        </a-col>
+      </a-row>
+    </a-card>
+
+    <a-card title="光伏受阻电量" :bordered="false" style="margin-top: 16px">
+      <div ref="chartRef" class="bar-chart" />
+    </a-card>
+
+    <a-card title="数据详情" :bordered="false" style="margin-top: 16px">
+      <BusinessDataTable
+        row-key="time"
+        :custom-row="customRow"
+        :columns="tableColumns"
+        :data-source="tableRows"
+        :pagination="{ pageSize: 20 }"
+        :scroll-x="'max-content'"
+      />
+    </a-card>
+  </div>
+</template>
+
+<script setup name="PvCurtailmentEnergyDaily">
+import { nextTick, onBeforeUnmount, onMounted, reactive, ref } from 'vue'
+import { message } from 'ant-design-vue'
+import * as echarts from 'echarts'
+import dayjs from 'dayjs'
+import { saveAs } from 'file-saver'
+import { blobValidate } from '@/utils/bearjia'
+import { listStation } from '@/api/config/station'
+import { dailyReportList, exportDailyReport } from '@/api/theoretical/power'
+import BusinessDataTable from '../electricity/components/BusinessDataTable.vue'
+import StationSelector from '../electricity/components/StationSelector.vue'
+import { normalizeRows } from '../electricity/components/dataAdapter.js'
+
+const loading = ref(false)
+const exporting = ref(false)
+const stationOptions = ref([])
+const tableRows = ref([])
+const chartRef = ref()
+let chartInstance = null
+
+const query = reactive({
+  stationCode: undefined,
+  dataType: 'sampleMachine'
+})
+
+const dateRange = ref([
+  dayjs().subtract(6, 'day').format('YYYY-MM-DD'),
+  dayjs().format('YYYY-MM-DD')
+])
+
+const tableColumns = [
+  { title: '日期', dataIndex: 'time', width: 110 },
+  { title: '理论发电量(万千瓦时)', dataIndex: 'theoreticalEnergy', width: 160 },
+  { title: '可用发电量(万千瓦时)', dataIndex: 'availableEnergy', width: 160 },
+  { title: '实际发电量(万千瓦时)', dataIndex: 'energy', width: 160 },
+  { title: '场内受阻发电量(万千瓦时)', dataIndex: 'intraPlantCurtailedEnergy', width: 180 },
+  { title: '场外受阻发电量(万千瓦时)', dataIndex: 'offSiteCurtailedEnergy', width: 180 },
+  { title: '总受阻发电量(万千瓦时)', dataIndex: 'totalCurtailedEnergy', width: 180 }
+]
+
+// 合计行为数据源普通末行,加粗展示
+const customRow = (record) => (record.time === '合计' ? { style: { fontWeight: 'bold' } } : {})
+
+const chartOption = () => {
+  const days = tableRows.value.filter((item) => item.time !== '合计')
+  return {
+    tooltip: { trigger: 'axis' },
+    legend: { top: 0, left: 'center' },
+    // containLabel 让 grid 自动容纳 Y 轴刻度文字,避免长数值被容器左缘裁切
+    grid: { left: 8, right: 24, top: 46, bottom: 32, containLabel: true },
+    xAxis: { type: 'category', data: days.map((item) => item.time) },
+    yAxis: { type: 'value', name: '万千瓦时', splitLine: { lineStyle: { color: '#e6eef8' } } },
+    series: [
+      {
+        name: '场内受阻',
+        type: 'bar',
+        color: '#1890ff',
+        data: days.map((item) => item.intraPlantCurtailedEnergy || 0)
+      },
+      {
+        name: '场外受阻',
+        type: 'bar',
+        color: '#faad14',
+        data: days.map((item) => item.offSiteCurtailedEnergy || 0)
+      }
+    ]
+  }
+}
+
+const renderChart = async () => {
+  await nextTick()
+  if (!chartRef.value) return
+  if (!chartInstance) {
+    chartInstance = echarts.init(chartRef.value)
+  }
+  chartInstance.setOption(chartOption(), true)
+}
+
+const resizeChart = () => {
+  chartInstance?.resize()
+}
+
+const checkParams = () => {
+  if (!query.stationCode) {
+    message.warning('请先选择电厂')
+    return false
+  }
+  if (!dateRange.value || dateRange.value.length !== 2) {
+    message.warning('请选择起止日期')
+    return false
+  }
+  const start = dayjs(dateRange.value[0])
+  const end = dayjs(dateRange.value[1])
+  if (end.isBefore(start)) {
+    message.warning('结束日期不能早于开始日期')
+    return false
+  }
+  if (end.diff(start, 'day') > 90) {
+    message.warning('日报时间范围不能超过 90 天')
+    return false
+  }
+  return true
+}
+
+const buildParams = () => ({
+  stationCode: query.stationCode,
+  dataType: query.dataType,
+  startDay: dateRange.value[0],
+  endDay: dateRange.value[1]
+})
+
+const loadStationOptions = async () => {
+  const res = await listStation({ pageNum: 1, pageSize: 500 })
+  const rows = normalizeRows(res)
+  stationOptions.value = rows.map((item, index) => ({
+    label: item.stationName || `站点${index + 1}`,
+    value: item.stationCode
+  }))
+  if (!query.stationCode && stationOptions.value.length) {
+    query.stationCode = stationOptions.value[0].value
+  }
+}
+
+const handleQuery = async () => {
+  if (!checkParams()) return
+  loading.value = true
+  try {
+    const res = await dailyReportList(buildParams())
+    tableRows.value = normalizeRows(res)
+    renderChart()
+  } finally {
+    loading.value = false
+  }
+}
+
+const handleExport = async () => {
+  if (!checkParams()) return
+  exporting.value = true
+  try {
+    const res = await exportDailyReport(buildParams())
+    const isFile = await blobValidate(res)
+    if (isFile) {
+      saveAs(new Blob([res]), `光伏受阻电量日报_${dateRange.value[0]}_${dateRange.value[1]}.xlsx`)
+      message.success('导出成功')
+    } else {
+      const text = await res.text()
+      let msg = '导出失败'
+      try { msg = JSON.parse(text)?.msg || msg } catch (e) { /* ignore */ }
+      message.error(msg)
+    }
+  } finally {
+    exporting.value = false
+  }
+}
+
+onMounted(async () => {
+  await loadStationOptions()
+  await handleQuery()
+  window.addEventListener('resize', resizeChart)
+})
+
+onBeforeUnmount(() => {
+  window.removeEventListener('resize', resizeChart)
+  chartInstance?.dispose()
+  chartInstance = null
+})
+</script>
+
+<style lang="less" scoped>
+.pv-curtailment-energy-daily-page {
+  padding: 16px;
+}
+.full-control {
+  width: 100%;
+}
+.bar-chart {
+  width: 100%;
+  height: 360px;
+}
+</style>

+ 178 - 0
forecast-backend-vue/src/views/ufo/theoretical/PvCurtailmentEnergyMonthly.vue

@@ -0,0 +1,178 @@
+<template>
+  <div class="pv-curtailment-energy-monthly-page">
+    <a-card :bordered="false">
+      <a-row :gutter="[12, 12]" align="middle">
+        <a-col :xs="24" :md="6">
+          <StationSelector v-model:value="query.stationCode" :options="stationOptions" :multiple="false" />
+        </a-col>
+        <a-col :xs="24" :md="6">
+          <a-radio-group v-model:value="query.dataType" button-style="solid">
+            <a-radio value="sampleMachine">样板法</a-radio>
+            <a-radio value="photometricMethod">测光法</a-radio>
+          </a-radio-group>
+        </a-col>
+        <a-col :xs="24" :md="4">
+          <a-date-picker
+            v-model:value="query.startMonth"
+            picker="month"
+            format="YYYY-MM"
+            value-format="YYYY-MM"
+            placeholder="开始月份"
+            class="full-control"
+          />
+        </a-col>
+        <a-col :xs="24" :md="4">
+          <a-date-picker
+            v-model:value="query.endMonth"
+            picker="month"
+            format="YYYY-MM"
+            value-format="YYYY-MM"
+            placeholder="结束月份"
+            class="full-control"
+          />
+        </a-col>
+        <a-col :xs="24" :md="4">
+          <a-space>
+            <a-button type="primary" :loading="loading" @click="handleQuery">确认</a-button>
+            <a-button :loading="exporting" @click="handleExport">导出</a-button>
+          </a-space>
+        </a-col>
+      </a-row>
+    </a-card>
+
+    <a-card title="数据详情" :bordered="false" style="margin-top: 16px">
+      <BusinessDataTable
+        row-key="time"
+        :custom-row="customRow"
+        :columns="tableColumns"
+        :data-source="tableRows"
+        :pagination="{ pageSize: 20 }"
+        :scroll-x="'max-content'"
+      />
+    </a-card>
+  </div>
+</template>
+
+<script setup name="PvCurtailmentEnergyMonthly">
+import { onMounted, reactive, ref } from 'vue'
+import { message } from 'ant-design-vue'
+import dayjs from 'dayjs'
+import { saveAs } from 'file-saver'
+import { blobValidate } from '@/utils/bearjia'
+import { listStation } from '@/api/config/station'
+import { monthlyReportList, exportMonthlyReport } from '@/api/theoretical/power'
+import BusinessDataTable from '../electricity/components/BusinessDataTable.vue'
+import StationSelector from '../electricity/components/StationSelector.vue'
+import { normalizeRows } from '../electricity/components/dataAdapter.js'
+
+const loading = ref(false)
+const exporting = ref(false)
+const stationOptions = ref([])
+const tableRows = ref([])
+
+const query = reactive({
+  stationCode: undefined,
+  dataType: 'sampleMachine',
+  startMonth: dayjs().subtract(6, 'month').format('YYYY-MM'),
+  endMonth: dayjs().format('YYYY-MM')
+})
+
+const tableColumns = [
+  { title: '月份', dataIndex: 'time', width: 100 },
+  { title: '理论发电量(万千瓦时)', dataIndex: 'theoreticalEnergy', width: 160 },
+  { title: '可用发电量(万千瓦时)', dataIndex: 'availableEnergy', width: 160 },
+  { title: '实际发电量(万千瓦时)', dataIndex: 'energy', width: 160 },
+  { title: '场内受阻发电量(万千瓦时)', dataIndex: 'intraPlantCurtailedEnergy', width: 180 },
+  { title: '场外受阻发电量(万千瓦时)', dataIndex: 'offSiteCurtailedEnergy', width: 180 },
+  { title: '总受阻发电量(万千瓦时)', dataIndex: 'totalCurtailedEnergy', width: 180 }
+]
+
+// 合计行为数据源普通末行,加粗展示
+const customRow = (record) => (record.time === '合计' ? { style: { fontWeight: 'bold' } } : {})
+
+const checkParams = () => {
+  if (!query.stationCode) {
+    message.warning('请先选择电厂')
+    return false
+  }
+  if (!query.startMonth || !query.endMonth) {
+    message.warning('请选择起止月份')
+    return false
+  }
+  const start = dayjs(query.startMonth)
+  const end = dayjs(query.endMonth)
+  if (end.isBefore(start)) {
+    message.warning('结束月份不能早于开始月份')
+    return false
+  }
+  if (end.diff(start, 'month') > 12) {
+    message.warning('月报时间范围不能超过 12 个月')
+    return false
+  }
+  return true
+}
+
+const buildParams = () => ({
+  stationCode: query.stationCode,
+  dataType: query.dataType,
+  startMonth: query.startMonth,
+  endMonth: query.endMonth
+})
+
+const loadStationOptions = async () => {
+  const res = await listStation({ pageNum: 1, pageSize: 500 })
+  const rows = normalizeRows(res)
+  stationOptions.value = rows.map((item, index) => ({
+    label: item.stationName || `站点${index + 1}`,
+    value: item.stationCode
+  }))
+  if (!query.stationCode && stationOptions.value.length) {
+    query.stationCode = stationOptions.value[0].value
+  }
+}
+
+const handleQuery = async () => {
+  if (!checkParams()) return
+  loading.value = true
+  try {
+    const res = await monthlyReportList(buildParams())
+    tableRows.value = normalizeRows(res)
+  } finally {
+    loading.value = false
+  }
+}
+
+const handleExport = async () => {
+  if (!checkParams()) return
+  exporting.value = true
+  try {
+    const res = await exportMonthlyReport(buildParams())
+    const isFile = await blobValidate(res)
+    if (isFile) {
+      saveAs(new Blob([res]), `光伏受阻电量月报_${query.startMonth}_${query.endMonth}.xlsx`)
+      message.success('导出成功')
+    } else {
+      const text = await res.text()
+      let msg = '导出失败'
+      try { msg = JSON.parse(text)?.msg || msg } catch (e) { /* ignore */ }
+      message.error(msg)
+    }
+  } finally {
+    exporting.value = false
+  }
+}
+
+onMounted(async () => {
+  await loadStationOptions()
+  await handleQuery()
+})
+</script>
+
+<style lang="less" scoped>
+.pv-curtailment-energy-monthly-page {
+  padding: 16px;
+}
+.full-control {
+  width: 100%;
+}
+</style>

+ 157 - 0
forecast-backend-vue/src/views/ufo/theoretical/PvIntraPlantPowerCheck.vue

@@ -0,0 +1,157 @@
+<template>
+  <div class="pv-intra-plant-power-check-page">
+    <a-card :bordered="false">
+      <a-row :gutter="[12, 12]" align="middle">
+        <a-col :xs="24" :md="6">
+          <StationSelector v-model:value="query.stationCode" :options="stationOptions" :multiple="false" />
+        </a-col>
+        <a-col :xs="24" :md="6">
+          <a-radio-group v-model:value="query.dataType" button-style="solid">
+            <a-radio value="sampleMachine">样板法</a-radio>
+            <a-radio value="photometricMethod">测光法</a-radio>
+          </a-radio-group>
+        </a-col>
+        <a-col :xs="24" :md="5">
+          <a-date-picker
+            v-model:value="query.day"
+            format="YYYY-MM-DD"
+            value-format="YYYY-MM-DD"
+            placeholder="选择日期"
+            class="full-control"
+          />
+        </a-col>
+        <a-col :xs="24" :md="7">
+          <a-space>
+            <a-button type="primary" :loading="loading" @click="handleQuery">确认</a-button>
+            <a-button :loading="exporting" @click="handleExport">导出</a-button>
+          </a-space>
+        </a-col>
+      </a-row>
+    </a-card>
+
+    <a-card title="数据详情" :bordered="false" style="margin-top: 16px">
+      <BusinessDataTable
+        row-key="time"
+        :custom-row="customRow"
+        :columns="tableColumns"
+        :data-source="tableRows"
+        :pagination="{ pageSize: 20 }"
+        :scroll-x="'max-content'"
+      />
+    </a-card>
+  </div>
+</template>
+
+<script setup name="PvIntraPlantPowerCheck">
+import { h, onMounted, reactive, ref } from 'vue'
+import { message } from 'ant-design-vue'
+import dayjs from 'dayjs'
+import { saveAs } from 'file-saver'
+import { blobValidate } from '@/utils/bearjia'
+import { listStation } from '@/api/config/station'
+import { intraPlantCheckList, exportIntraPlantCheck } from '@/api/theoretical/power'
+import BusinessDataTable from '../electricity/components/BusinessDataTable.vue'
+import StationSelector from '../electricity/components/StationSelector.vue'
+import { normalizeRows } from '../electricity/components/dataAdapter.js'
+
+const loading = ref(false)
+const exporting = ref(false)
+const stationOptions = ref([])
+const tableRows = ref([])
+
+const query = reactive({
+  stationCode: undefined,
+  dataType: 'sampleMachine',
+  day: dayjs().format('YYYY-MM-DD')
+})
+
+const renderQualified = (desc) => h('span',
+  { style: desc === '不合格' ? { color: '#f5222d' } : {} }, desc || '')
+
+const tableColumns = [
+  { title: '时间', dataIndex: 'time', width: 100 },
+  { title: '理论功率(MW)', dataIndex: 'theoreticalPower', width: 140 },
+  { title: '可用功率(MW)', dataIndex: 'availablePower', width: 140 },
+  { title: '偏差(%)', dataIndex: 'deviation', width: 120 },
+  {
+    title: '状态',
+    dataIndex: 'qualifiedDesc',
+    width: 100,
+    customRender: ({ record }) => renderQualified(record.qualifiedDesc)
+  }
+]
+
+// 合计行为数据源普通末行,加粗展示
+const customRow = (record) => (record.time === '合计' ? { style: { fontWeight: 'bold' } } : {})
+
+const checkStation = () => {
+  if (!query.stationCode) {
+    message.warning('请先选择电厂')
+    return false
+  }
+  return true
+}
+
+const buildParams = () => ({
+  stationCode: query.stationCode,
+  dataType: query.dataType,
+  day: query.day
+})
+
+const loadStationOptions = async () => {
+  const res = await listStation({ pageNum: 1, pageSize: 500 })
+  const rows = normalizeRows(res)
+  stationOptions.value = rows.map((item, index) => ({
+    label: item.stationName || `站点${index + 1}`,
+    value: item.stationCode
+  }))
+  if (!query.stationCode && stationOptions.value.length) {
+    query.stationCode = stationOptions.value[0].value
+  }
+}
+
+const handleQuery = async () => {
+  if (!checkStation()) return
+  loading.value = true
+  try {
+    const res = await intraPlantCheckList(buildParams())
+    tableRows.value = normalizeRows(res)
+  } finally {
+    loading.value = false
+  }
+}
+
+const handleExport = async () => {
+  if (!checkStation()) return
+  exporting.value = true
+  try {
+    const res = await exportIntraPlantCheck(buildParams())
+    const isFile = await blobValidate(res)
+    if (isFile) {
+      saveAs(new Blob([res]), `光伏场内受阻电力校核_${dayjs(query.day).format('YYYYMMDD')}.xlsx`)
+      message.success('导出成功')
+    } else {
+      const text = await res.text()
+      let msg = '导出失败'
+      try { msg = JSON.parse(text)?.msg || msg } catch (e) { /* ignore */ }
+      message.error(msg)
+    }
+  } finally {
+    exporting.value = false
+  }
+}
+
+onMounted(async () => {
+  await loadStationOptions()
+  await handleQuery()
+})
+</script>
+
+<style lang="less" scoped>
+.pv-intra-plant-power-check-page {
+  padding: 16px;
+}
+.full-control {
+  width: 100%;
+}
+</style>

+ 153 - 0
forecast-backend-vue/src/views/ufo/theoretical/PvOffSitePowerCheck.vue

@@ -0,0 +1,153 @@
+<template>
+  <div class="pv-off-site-power-check-page">
+    <a-card :bordered="false">
+      <a-row :gutter="[12, 12]" align="middle">
+        <a-col :xs="24" :md="6">
+          <StationSelector v-model:value="query.stationCode" :options="stationOptions" :multiple="false" />
+        </a-col>
+        <a-col :xs="24" :md="6">
+          <a-radio-group v-model:value="query.dataType" button-style="solid">
+            <a-radio value="sampleMachine">样板法</a-radio>
+            <a-radio value="photometricMethod">测光法</a-radio>
+          </a-radio-group>
+        </a-col>
+        <a-col :xs="24" :md="5">
+          <a-date-picker
+            v-model:value="query.day"
+            format="YYYY-MM-DD"
+            value-format="YYYY-MM-DD"
+            placeholder="选择日期"
+            class="full-control"
+          />
+        </a-col>
+        <a-col :xs="24" :md="7">
+          <a-space>
+            <a-button type="primary" :loading="loading" @click="handleQuery">确认</a-button>
+            <a-button :loading="exporting" @click="handleExport">导出</a-button>
+          </a-space>
+        </a-col>
+      </a-row>
+    </a-card>
+
+    <a-card title="数据详情" :bordered="false" style="margin-top: 16px">
+      <BusinessDataTable
+        row-key="time"
+        :columns="tableColumns"
+        :data-source="tableRows"
+        :pagination="{ pageSize: 20 }"
+        :scroll-x="'max-content'"
+      />
+    </a-card>
+  </div>
+</template>
+
+<script setup name="PvOffSitePowerCheck">
+import { h, onMounted, reactive, ref } from 'vue'
+import { message } from 'ant-design-vue'
+import dayjs from 'dayjs'
+import { saveAs } from 'file-saver'
+import { blobValidate } from '@/utils/bearjia'
+import { listStation } from '@/api/config/station'
+import { offSiteCheckList, exportOffSiteCheck } from '@/api/theoretical/power'
+import BusinessDataTable from '../electricity/components/BusinessDataTable.vue'
+import StationSelector from '../electricity/components/StationSelector.vue'
+import { normalizeRows } from '../electricity/components/dataAdapter.js'
+
+const loading = ref(false)
+const exporting = ref(false)
+const stationOptions = ref([])
+const tableRows = ref([])
+
+const query = reactive({
+  stationCode: undefined,
+  dataType: 'sampleMachine',
+  day: dayjs().format('YYYY-MM-DD')
+})
+
+const renderQualified = (desc) => h('span',
+  { style: desc === '不合格' ? { color: '#f5222d' } : {} }, desc || '')
+
+const tableColumns = [
+  { title: '时间', dataIndex: 'time', width: 100 },
+  { title: '可用功率(MW)', dataIndex: 'availablePower', width: 140 },
+  { title: '实发功率(MW)', dataIndex: 'power', width: 140 },
+  { title: '偏差(%)', dataIndex: 'deviation', width: 120 },
+  {
+    title: '状态',
+    dataIndex: 'qualifiedDesc',
+    width: 100,
+    customRender: ({ record }) => renderQualified(record.qualifiedDesc)
+  }
+]
+
+const checkStation = () => {
+  if (!query.stationCode) {
+    message.warning('请先选择电厂')
+    return false
+  }
+  return true
+}
+
+const buildParams = () => ({
+  stationCode: query.stationCode,
+  dataType: query.dataType,
+  day: query.day
+})
+
+const loadStationOptions = async () => {
+  const res = await listStation({ pageNum: 1, pageSize: 500 })
+  const rows = normalizeRows(res)
+  stationOptions.value = rows.map((item, index) => ({
+    label: item.stationName || `站点${index + 1}`,
+    value: item.stationCode
+  }))
+  if (!query.stationCode && stationOptions.value.length) {
+    query.stationCode = stationOptions.value[0].value
+  }
+}
+
+const handleQuery = async () => {
+  if (!checkStation()) return
+  loading.value = true
+  try {
+    const res = await offSiteCheckList(buildParams())
+    tableRows.value = normalizeRows(res)
+  } finally {
+    loading.value = false
+  }
+}
+
+const handleExport = async () => {
+  if (!checkStation()) return
+  exporting.value = true
+  try {
+    const res = await exportOffSiteCheck(buildParams())
+    const isFile = await blobValidate(res)
+    if (isFile) {
+      saveAs(new Blob([res]), `光伏场外受阻电力校核_${dayjs(query.day).format('YYYYMMDD')}.xlsx`)
+      message.success('导出成功')
+    } else {
+      const text = await res.text()
+      let msg = '导出失败'
+      try { msg = JSON.parse(text)?.msg || msg } catch (e) { /* ignore */ }
+      message.error(msg)
+    }
+  } finally {
+    exporting.value = false
+  }
+}
+
+onMounted(async () => {
+  await loadStationOptions()
+  await handleQuery()
+})
+</script>
+
+<style lang="less" scoped>
+.pv-off-site-power-check-page {
+  padding: 16px;
+}
+.full-control {
+  width: 100%;
+}
+</style>

+ 167 - 0
forecast-backend-vue/src/views/ufo/theoretical/PvStationLogicCheck.vue

@@ -0,0 +1,167 @@
+<template>
+  <div class="pv-station-logic-check-page">
+    <a-card :bordered="false">
+      <a-row :gutter="[12, 12]" align="middle">
+        <a-col :xs="24" :md="6">
+          <StationSelector v-model:value="query.stationCode" :options="stationOptions" :multiple="false" />
+        </a-col>
+        <a-col :xs="24" :md="6">
+          <a-radio-group v-model:value="query.dataType" button-style="solid">
+            <a-radio value="sampleMachine">样板法</a-radio>
+            <a-radio value="photometricMethod">测光法</a-radio>
+          </a-radio-group>
+        </a-col>
+        <a-col :xs="24" :md="5">
+          <a-date-picker
+            v-model:value="query.day"
+            format="YYYY-MM-DD"
+            value-format="YYYY-MM-DD"
+            placeholder="选择日期"
+            class="full-control"
+          />
+        </a-col>
+        <a-col :xs="24" :md="7">
+          <a-space>
+            <a-button type="primary" :loading="loading" @click="handleQuery">确认</a-button>
+            <a-button :loading="exporting" @click="handleExport">导出</a-button>
+          </a-space>
+        </a-col>
+      </a-row>
+    </a-card>
+
+    <a-card title="数据详情" :bordered="false" style="margin-top: 16px">
+      <BusinessDataTable
+        row-key="time"
+        :columns="tableColumns"
+        :data-source="tableRows"
+        :pagination="{ pageSize: 20 }"
+        :scroll-x="'max-content'"
+      />
+    </a-card>
+  </div>
+</template>
+
+<script setup name="PvStationLogicCheck">
+import { h, onMounted, reactive, ref } from 'vue'
+import { message } from 'ant-design-vue'
+import dayjs from 'dayjs'
+import { saveAs } from 'file-saver'
+import { blobValidate } from '@/utils/bearjia'
+import { listStation } from '@/api/config/station'
+import { logicCheckList, exportLogicCheck } from '@/api/theoretical/power'
+import BusinessDataTable from '../electricity/components/BusinessDataTable.vue'
+import StationSelector from '../electricity/components/StationSelector.vue'
+import { normalizeRows } from '../electricity/components/dataAdapter.js'
+
+const loading = ref(false)
+const exporting = ref(false)
+const stationOptions = ref([])
+const tableRows = ref([])
+
+const query = reactive({
+  stationCode: undefined,
+  dataType: 'sampleMachine',
+  day: dayjs().format('YYYY-MM-DD')
+})
+
+const renderRatioCell = (value, desc) => {
+  const bad = desc === '不合格'
+  return h('span', {}, [
+    h('span', {}, `${Number(value || 0).toFixed(2)} `),
+    h('span', { style: bad ? { color: '#f5222d' } : {} }, desc || '')
+  ])
+}
+
+const tableColumns = [
+  { title: '时间', dataIndex: 'time', width: 100 },
+  {
+    title: '装机比理论',
+    dataIndex: 'installed2TheoreticalPercent',
+    width: 180,
+    customRender: ({ record }) => renderRatioCell(record.installed2TheoreticalPercent, record.installed2TheoreticalDesc)
+  },
+  {
+    title: '理论比可用',
+    dataIndex: 'theoretical2AvailablePercent',
+    width: 180,
+    customRender: ({ record }) => renderRatioCell(record.theoretical2AvailablePercent, record.theoretical2AvailableDesc)
+  },
+  {
+    title: '可用比实际',
+    dataIndex: 'available2ActualPercent',
+    width: 180,
+    customRender: ({ record }) => renderRatioCell(record.available2ActualPercent, record.available2ActualDesc)
+  }
+]
+
+const checkStation = () => {
+  if (!query.stationCode) {
+    message.warning('请先选择电厂')
+    return false
+  }
+  return true
+}
+
+const buildParams = () => ({
+  stationCode: query.stationCode,
+  dataType: query.dataType,
+  day: query.day
+})
+
+const loadStationOptions = async () => {
+  const res = await listStation({ pageNum: 1, pageSize: 500 })
+  const rows = normalizeRows(res)
+  stationOptions.value = rows.map((item, index) => ({
+    label: item.stationName || `站点${index + 1}`,
+    value: item.stationCode
+  }))
+  if (!query.stationCode && stationOptions.value.length) {
+    query.stationCode = stationOptions.value[0].value
+  }
+}
+
+const handleQuery = async () => {
+  if (!checkStation()) return
+  loading.value = true
+  try {
+    const res = await logicCheckList(buildParams())
+    tableRows.value = normalizeRows(res)
+  } finally {
+    loading.value = false
+  }
+}
+
+const handleExport = async () => {
+  if (!checkStation()) return
+  exporting.value = true
+  try {
+    const res = await exportLogicCheck(buildParams())
+    const isFile = await blobValidate(res)
+    if (isFile) {
+      saveAs(new Blob([res]), `光伏场站逻辑校核_${dayjs(query.day).format('YYYYMMDD')}.xlsx`)
+      message.success('导出成功')
+    } else {
+      const text = await res.text()
+      let msg = '导出失败'
+      try { msg = JSON.parse(text)?.msg || msg } catch (e) { /* ignore */ }
+      message.error(msg)
+    }
+  } finally {
+    exporting.value = false
+  }
+}
+
+onMounted(async () => {
+  await loadStationOptions()
+  await handleQuery()
+})
+</script>
+
+<style lang="less" scoped>
+.pv-station-logic-check-page {
+  padding: 16px;
+}
+.full-control {
+  width: 100%;
+}
+</style>

+ 247 - 0
forecast-backend-vue/src/views/ufo/theoretical/PvTheoreticalPower.vue

@@ -0,0 +1,247 @@
+<template>
+  <div class="pv-theoretical-power-page">
+    <a-card :bordered="false">
+      <a-row :gutter="[12, 12]" align="middle">
+        <a-col :xs="24" :md="6">
+          <StationSelector v-model:value="query.stationCode" :options="stationOptions" :multiple="false" />
+        </a-col>
+        <a-col :xs="24" :md="5">
+          <a-radio-group v-model:value="query.samplingFrequency" button-style="solid">
+            <a-radio-button :value="5">5分钟</a-radio-button>
+            <a-radio-button :value="15">15分钟</a-radio-button>
+          </a-radio-group>
+        </a-col>
+        <a-col :xs="24" :md="5">
+          <a-date-picker
+            v-model:value="query.day"
+            format="YYYY-MM-DD"
+            value-format="YYYY-MM-DD"
+            placeholder="选择日期"
+            class="full-control"
+          />
+        </a-col>
+        <a-col :xs="24" :md="8">
+          <a-space>
+            <a-button type="primary" :loading="loading" @click="handleQuery">确认</a-button>
+            <a-button :loading="exporting" @click="handleExport">导出</a-button>
+            <a-button :loading="exportingEnergy" @click="handleExportEnergy">理论发电量导出</a-button>
+          </a-space>
+        </a-col>
+      </a-row>
+    </a-card>
+
+    <a-row :gutter="16" style="margin-top: 16px">
+      <a-col :xs="24" :md="realtimeCollapsed ? 24 : 17">
+        <a-card title="理论功率" :bordered="false">
+          <PowerLineChart :x-axis="chartAxis" :series="chartSeries" y-axis-name="kW" />
+        </a-card>
+      </a-col>
+      <a-col v-show="!realtimeCollapsed" :xs="24" :md="7">
+        <a-card :bordered="false">
+          <template #title>
+            <span>实时数据</span>
+          </template>
+          <template #extra>
+            <a @click="realtimeCollapsed = true">收缩</a>
+          </template>
+          <div class="realtime-row">
+            <span class="realtime-label">最新数据时间:</span>
+            <span class="realtime-value">{{ realtime.time || '-' }}</span>
+          </div>
+          <div class="realtime-row">
+            <span class="realtime-label">开机容量:</span>
+            <span class="realtime-value">{{ fmt(realtime.installedCapacity) }} kW</span>
+          </div>
+          <div class="realtime-row">
+            <span class="realtime-label">实发功率:</span>
+            <span class="realtime-value">{{ fmt(realtime.power) }} kW</span>
+          </div>
+          <div class="realtime-row">
+            <span class="realtime-label">样板法理论功率:</span>
+            <span class="realtime-value">{{ fmt(realtime.sampleMachineTheoreticalPower) }} kW</span>
+          </div>
+          <div class="realtime-row">
+            <span class="realtime-label">测光法理论功率:</span>
+            <span class="realtime-value">{{ fmt(realtime.photometricMethodTheoreticalPower) }} kW</span>
+          </div>
+          <div class="realtime-row">
+            <span class="realtime-label">样板法可用功率:</span>
+            <span class="realtime-value">{{ fmt(realtime.sampleMachineAvailablePower) }} kW</span>
+          </div>
+          <div class="realtime-row">
+            <span class="realtime-label">测光法可用功率:</span>
+            <span class="realtime-value">{{ fmt(realtime.photometricMethodAvailablePower) }} kW</span>
+          </div>
+        </a-card>
+      </a-col>
+      <a-col v-show="realtimeCollapsed" :xs="0" :md="0">
+        <a-button size="small" @click="realtimeCollapsed = false">展开实时数据</a-button>
+      </a-col>
+    </a-row>
+
+    <a-card title="数据详情" :bordered="false" style="margin-top: 16px">
+      <BusinessDataTable
+        row-key="time"
+        :columns="tableColumns"
+        :data-source="tableRows"
+        :pagination="{ pageSize: 20 }"
+        :scroll-x="'max-content'"
+      />
+    </a-card>
+  </div>
+</template>
+
+<script setup name="PvTheoreticalPower">
+import { computed, onMounted, reactive, ref } from 'vue'
+import { message } from 'ant-design-vue'
+import dayjs from 'dayjs'
+import { saveAs } from 'file-saver'
+import { blobValidate } from '@/utils/bearjia'
+import { listStation } from '@/api/config/station'
+import {
+  theoreticalPowerList,
+  theoreticalLatest,
+  exportTheoreticalPower,
+  exportTheoreticalEnergy
+} from '@/api/theoretical/power'
+import BusinessDataTable from '../electricity/components/BusinessDataTable.vue'
+import PowerLineChart from '../electricity/components/PowerLineChart.vue'
+import StationSelector from '../electricity/components/StationSelector.vue'
+import { normalizeRows } from '../electricity/components/dataAdapter.js'
+
+const loading = ref(false)
+const exporting = ref(false)
+const exportingEnergy = ref(false)
+const realtimeCollapsed = ref(false)
+const stationOptions = ref([])
+const tableRows = ref([])
+const realtime = ref({})
+
+const query = reactive({
+  stationCode: undefined,
+  samplingFrequency: 5,
+  day: dayjs().format('YYYY-MM-DD')
+})
+
+const tableColumns = [
+  { title: '时间', dataIndex: 'time', width: 160 },
+  { title: '实发功率(kW)', dataIndex: 'power', width: 120 },
+  { title: '样板法理论功率(kW)', dataIndex: 'sampleMachineTheoreticalPower', width: 150 },
+  { title: '测光法理论功率(kW)', dataIndex: 'photometricMethodTheoreticalPower', width: 150 },
+  { title: '样板法可用功率(kW)', dataIndex: 'sampleMachineAvailablePower', width: 150 },
+  { title: '测光法可用功率(kW)', dataIndex: 'photometricMethodAvailablePower', width: 150 }
+]
+
+const chartAxis = computed(() => tableRows.value.map((item) => (item.time || '').slice(11, 16)))
+const chartSeries = computed(() => ([
+  { name: '实发功率', color: '#1890ff', data: tableRows.value.map((item) => item.power || 0) },
+  { name: '样板法理论功率', color: '#52c41a', data: tableRows.value.map((item) => item.sampleMachineTheoreticalPower || 0) },
+  { name: '样板法可用功率', color: '#95de64', data: tableRows.value.map((item) => item.sampleMachineAvailablePower || 0) },
+  { name: '测光法理论功率', color: '#faad14', data: tableRows.value.map((item) => item.photometricMethodTheoreticalPower || 0) },
+  { name: '测光法可用功率', color: '#f56c6c', data: tableRows.value.map((item) => item.photometricMethodAvailablePower || 0) }
+]))
+
+const fmt = (value) => (value === null || value === undefined ? '-' : Number(value).toFixed(3))
+
+const checkStation = () => {
+  if (!query.stationCode) {
+    message.warning('请先选择电厂')
+    return false
+  }
+  return true
+}
+
+const buildParams = () => ({
+  stationCode: query.stationCode,
+  samplingFrequency: query.samplingFrequency,
+  day: query.day
+})
+
+const loadStationOptions = async () => {
+  const res = await listStation({ pageNum: 1, pageSize: 500 })
+  const rows = normalizeRows(res)
+  stationOptions.value = rows.map((item, index) => ({
+    label: item.stationName || `站点${index + 1}`,
+    value: item.stationCode
+  }))
+  if (!query.stationCode && stationOptions.value.length) {
+    query.stationCode = stationOptions.value[0].value
+  }
+}
+
+const handleQuery = async () => {
+  if (!checkStation()) return
+  loading.value = true
+  try {
+    const res = await theoreticalPowerList(buildParams())
+    tableRows.value = normalizeRows(res)
+    const latestRes = await theoreticalLatest({ stationCode: query.stationCode })
+    realtime.value = latestRes.data || {}
+  } finally {
+    loading.value = false
+  }
+}
+
+const downloadBlob = async (res, name) => {
+  const isFile = await blobValidate(res)
+  if (isFile) {
+    saveAs(new Blob([res]), name)
+    message.success('导出成功')
+  } else {
+    const text = await res.text()
+    let msg = '导出失败'
+    try { msg = JSON.parse(text)?.msg || msg } catch (e) { /* ignore */ }
+    message.error(msg)
+  }
+}
+
+const handleExport = async () => {
+  if (!checkStation()) return
+  exporting.value = true
+  try {
+    const res = await exportTheoreticalPower(buildParams())
+    await downloadBlob(res, `光伏理论功率_${dayjs(query.day).format('YYYYMMDD')}.xlsx`)
+  } finally {
+    exporting.value = false
+  }
+}
+
+const handleExportEnergy = async () => {
+  if (!checkStation()) return
+  exportingEnergy.value = true
+  try {
+    const res = await exportTheoreticalEnergy(buildParams())
+    await downloadBlob(res, `光伏理论发电量_${dayjs(query.day).format('YYYYMMDD')}.xlsx`)
+  } finally {
+    exportingEnergy.value = false
+  }
+}
+
+onMounted(async () => {
+  await loadStationOptions()
+  await handleQuery()
+})
+</script>
+
+<style lang="less" scoped>
+.pv-theoretical-power-page {
+  padding: 16px;
+}
+.full-control {
+  width: 100%;
+}
+.realtime-row {
+  display: flex;
+  align-items: baseline;
+  padding: 6px 0;
+  border-bottom: 1px dashed #eef2f7;
+}
+.realtime-label {
+  flex: 0 0 132px;
+  color: rgba(0, 0, 0, 0.45);
+}
+.realtime-value {
+  flex: 1;
+  font-variant-numeric: tabular-nums;
+}
+</style>

+ 73 - 0
release_note/20261112/ddl.sql

@@ -0,0 +1,73 @@
+-- config_station 增加逆变器数量(幂等)
+ALTER TABLE config_station ADD COLUMN IF NOT EXISTS inverter_quantity integer;
+COMMENT ON COLUMN config_station.inverter_quantity IS '逆变器数量(测光法理论功率用)';
+
+-- 增加 理论功率 一级菜单
+INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+SELECT
+nextval(pg_get_serial_sequence('sys_menu', 'menu_id')),
+'理论功率', 0, 20, 'theoretical', '', '', '', 1, 0, 'M', '0', '0', '', 'ThunderboltOutlined', 'admin', now(), '', NULL, '理论功率一级菜单'
+WHERE NOT EXISTS (SELECT 1 FROM sys_menu t WHERE t.menu_name = '理论功率');
+
+-- 增加 光伏理论功率 二级菜单
+INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+SELECT
+nextval(pg_get_serial_sequence('sys_menu', 'menu_id')),
+'光伏理论功率',
+(select menu_id from sys_menu t where t.menu_name = '理论功率' and t.parent_id = 0),
+10, 'pv-theoretical-power', 'ufo/theoretical/PvTheoreticalPower', '', 'PvTheoreticalPower', 1, 0, 'C', '0', '0', 'theoretical:power:list', 'LineChartOutlined', 'admin', now(), '', NULL, '光伏理论功率页面'
+WHERE NOT EXISTS (SELECT 1 FROM sys_menu t WHERE t.menu_name = '光伏理论功率');
+
+-- 增加 光伏受阻电量 二级菜单
+INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+SELECT
+nextval(pg_get_serial_sequence('sys_menu', 'menu_id')),
+'光伏受阻电量',
+(select menu_id from sys_menu t where t.menu_name = '理论功率' and t.parent_id = 0),
+20, 'pv-curtailment-energy', 'ufo/theoretical/PvCurtailmentEnergy', '', 'PvCurtailmentEnergy', 1, 0, 'C', '0', '0', 'theoretical:curtailedEnergy:list', 'AreaChartOutlined', 'admin', now(), '', NULL, '光伏受阻电量页面'
+WHERE NOT EXISTS (SELECT 1 FROM sys_menu t WHERE t.menu_name = '光伏受阻电量');
+
+-- 增加 光伏场站逻辑校核 二级菜单
+INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+SELECT
+nextval(pg_get_serial_sequence('sys_menu', 'menu_id')),
+'光伏场站逻辑校核',
+(select menu_id from sys_menu t where t.menu_name = '理论功率' and t.parent_id = 0),
+30, 'pv-station-logic-check', 'ufo/theoretical/PvStationLogicCheck', '', 'PvStationLogicCheck', 1, 0, 'C', '0', '0', 'theoretical:logicCheck:list', 'AuditOutlined', 'admin', now(), '', NULL, '光伏场站逻辑校核页面'
+WHERE NOT EXISTS (SELECT 1 FROM sys_menu t WHERE t.menu_name = '光伏场站逻辑校核');
+
+-- 增加 光伏场外受阻电力校核 二级菜单
+INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+SELECT
+nextval(pg_get_serial_sequence('sys_menu', 'menu_id')),
+'光伏场外受阻电力校核',
+(select menu_id from sys_menu t where t.menu_name = '理论功率' and t.parent_id = 0),
+40, 'pv-off-site-power-check', 'ufo/theoretical/PvOffSitePowerCheck', '', 'PvOffSitePowerCheck', 1, 0, 'C', '0', '0', 'theoretical:offSiteCheck:list', 'SafetyOutlined', 'admin', now(), '', NULL, '光伏场外受阻电力校核页面'
+WHERE NOT EXISTS (SELECT 1 FROM sys_menu t WHERE t.menu_name = '光伏场外受阻电力校核');
+
+-- 增加 光伏场内受阻电力校核 二级菜单
+INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+SELECT
+nextval(pg_get_serial_sequence('sys_menu', 'menu_id')),
+'光伏场内受阻电力校核',
+(select menu_id from sys_menu t where t.menu_name = '理论功率' and t.parent_id = 0),
+50, 'pv-intra-plant-power-check', 'ufo/theoretical/PvIntraPlantPowerCheck', '', 'PvIntraPlantPowerCheck', 1, 0, 'C', '0', '0', 'theoretical:intraPlantCheck:list', 'SafetyCertificateOutlined', 'admin', now(), '', NULL, '光伏场内受阻电力校核页面'
+WHERE NOT EXISTS (SELECT 1 FROM sys_menu t WHERE t.menu_name = '光伏场内受阻电力校核');
+
+-- 增加 光伏受阻电量日报 二级菜单
+INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+SELECT
+nextval(pg_get_serial_sequence('sys_menu', 'menu_id')),
+'光伏受阻电量日报',
+(select menu_id from sys_menu t where t.menu_name = '理论功率' and t.parent_id = 0),
+60, 'pv-curtailment-energy-daily', 'ufo/theoretical/PvCurtailmentEnergyDaily', '', 'PvCurtailmentEnergyDaily', 1, 0, 'C', '0', '0', 'theoretical:dailyReport:list', 'FileTextOutlined', 'admin', now(), '', NULL, '光伏受阻电量日报页面'
+WHERE NOT EXISTS (SELECT 1 FROM sys_menu t WHERE t.menu_name = '光伏受阻电量日报');
+
+-- 增加 光伏受阻电量月报 二级菜单
+INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query, route_name, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
+SELECT
+nextval(pg_get_serial_sequence('sys_menu', 'menu_id')),
+'光伏受阻电量月报',
+(select menu_id from sys_menu t where t.menu_name = '理论功率' and t.parent_id = 0),
+70, 'pv-curtailment-energy-monthly', 'ufo/theoretical/PvCurtailmentEnergyMonthly', '', 'PvCurtailmentEnergyMonthly', 1, 0, 'C', '0', '0', 'theoretical:monthlyReport:list', 'CalendarOutlined', 'admin', now(), '', NULL, '光伏受阻电量月报页面'
+WHERE NOT EXISTS (SELECT 1 FROM sys_menu t WHERE t.menu_name = '光伏受阻电量月报');

+ 29 - 1
release_note/20261112/dml.sql

@@ -2,4 +2,32 @@ update "public"."sys_menu" set icon = 'OLDetection' where menu_name = '测点监
 update "public"."sys_menu" set icon = 'OLDetection' where menu_name = '实时监控';
 update "public"."sys_menu" set icon = 'OLDeviceManagement' where menu_name = '设备管理';
 update "public"."sys_menu" set icon = 'OLMeteorologicalResources' where menu_name = '气象资源';
-update "public"."sys_menu" set icon = 'OLPowerForecasting' where menu_name = '功率预测';
+update "public"."sys_menu" set icon = 'OLPowerForecasting' where menu_name = '功率预测';
+
+-- 字典类型: 算法配置(测光法系数)
+INSERT INTO sys_dict_type (dict_id, dict_name, dict_type, status, create_by, create_time, remark)
+SELECT
+nextval(pg_get_serial_sequence('sys_dict_type', 'dict_id')),
+'算法配置', 'algorithm_config', '0', 'admin', now(), '理论功率-算法配置'
+WHERE NOT EXISTS (SELECT 1 FROM sys_dict_type t WHERE t.dict_type = 'algorithm_config');
+-- 算法配置字典数据(先删后插,保证幂等)
+DELETE FROM sys_dict_data WHERE dict_type = 'algorithm_config';
+
+INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark)
+VALUES (nextval(pg_get_serial_sequence('sys_dict_data', 'dict_code')), 1, '测光法配置', '{"a1": 0.0, "a2": 0.0}', 'algorithm_config', '', '', 'N', '0', 'admin', now(), '测光法 P=n*(a1*G+a2*T);a1/a2 初始为 0 占位,需运维替换为真实系数');
+
+-- 字典类型: 理论功率配置项(校核阈值)
+INSERT INTO sys_dict_type (dict_id, dict_name, dict_type, status, create_by, create_time, remark)
+SELECT
+nextval(pg_get_serial_sequence('sys_dict_type', 'dict_id')),
+'理论功率配置项', 'theoretical_power_config', '0', 'admin', now(), '理论功率-校核阈值'
+WHERE NOT EXISTS (SELECT 1 FROM sys_dict_type t WHERE t.dict_type = 'theoretical_power_config');
+-- 理论功率配置项字典数据(先删后插,保证幂等)
+DELETE FROM sys_dict_data WHERE dict_type = 'theoretical_power_config';
+
+INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, remark)
+VALUES (nextval(pg_get_serial_sequence('sys_dict_data', 'dict_code')), 1, '理论功率配置项', '{"installed2TheoreticalPercent": 99.99, "theoretical2AvailablePercent": 99.99, "available2ActualPercent": 95.00}', 'theoretical_power_config', '', '', 'N', '0', 'admin', now(), '校核阈值,比值≥阈值判合格');
+
+-- config_station 逆变器数量初值(按 station_code 定值更新,天然幂等)
+UPDATE config_station SET inverter_quantity = 19 WHERE station_code = 'JMJD01';
+UPDATE config_station SET inverter_quantity = 10 WHERE station_code IN ('YUWEI', 'ZHONGXIN', 'YMPV03', 'GBPV04');

+ 14 - 0
release_note/20261112/release_note.md

@@ -0,0 +1,14 @@
+# 20261112版本更新说明
+1. 增加功能“理论功率”:光伏理论功率 / 光伏受阻电量 / 光伏场站逻辑校核 / 光伏场外受阻电力校核 / 光伏场内受阻电力校核 / 光伏受阻电量日报 / 光伏受阻电量月报,共 7 个页面、16 个查询/导出接口
+2. `config_station` 增加 `inverter_quantity`(逆变器数量)字段并初始化
+
+[更新说明]
+1. 执行 `release_note/20261112/ddl.sql`
+2. 执行 `release_note/20261112/dml.sql`
+3. 更新服务端jar
+4. 更新前端dist
+
+[备注]
+1. 字典缓存为纯 Redis 缓存、无 DB 回源:执行 dml.sql 插入 `algorithm_config`、`theoretical_power_config` 两个字典后,必须重启后端服务(或手动清理 Redis 字典缓存),理论功率接口才能读到测光法系数 a1/a2 与校核阈值
+2. `algorithm_config` 字典中测光法配置初始为 0 占位({"a1": 0.0, "a2": 0.0}),此时测光法理论功率恒为 0,上线前需运维替换为真实系数
+3. 测试环境冒烟顺序:先执行 ddl.sql/dml.sql → 重启后端服务 → 再冒烟 16 接口与 7 页面