# 畜牧产品产量登记 — 技术方案 > 模板:`baqing-admin/src/main/resources/templates/livestock_product_output_import_template.xlsx` ## 1. 架构 Controller `/dataModel/livestockProductOutput` → Service → Mapper;Excel:`LivestockProductOutputExcelParser` / `LivestockProductOutputExcelExporter`;校验:`LivestockProductOutputValidation`。 ## 2. 表 `biz_livestock_product_output` 唯一键 `uk_year_month_village (stat_year, stat_month, village_dept_id)`;字段含乡镇/村冗余名、`meat_output`、`milk_output`(万吨)。DDL:`sql/biz_livestock_product_output.sql`。 ## 3. Excel 列(0-based) | 列 | 字段 | | --- | --- | | 0 | 序号 | | 1 | 乡镇 | | 2 | 村 | | 3 | 肉产量(万吨) | | 4 | 奶产量(万吨) | 数据起始:`headerRow + 1`。导入遇「合计」停止;导出写合计行并合并 0~2 列,对肉/奶求和。 ## 4. 导入 / 导出 - 导入:任一行失败不写库 → 按唯一键 upsert。 - 导出:可选 `townDeptId`;复制模板数据行样式到新建行;含合计行。 ## 5. 前端 - 页面:`ruoyi-ui/src/views/dataModel/livestockProductOutput/index.vue` - API:`ruoyi-ui/src/api/dataModel/livestockProductOutput.js` - i18n:`livestockProductOutput` ## 6. 修订记录 | 版本 | 说明 | | --- | --- | | 1.0 | 首版对齐交接模板与合作社/出栏交互 |