# 合作社发展数据填报 — 技术方案 > 依据:同目录功能需求;模板 `baqing-admin/src/main/resources/templates/cooperative_development_import_template.xlsx`。 ## 1. 架构 Controller `/dataModel/cooperativeDevelopment` → Service → Mapper;Excel:`CooperativeDevelopmentExcelParser` / `CooperativeDevelopmentExcelExporter`;校验:`CooperativeDevelopmentValidation`(村反推乡镇)。 ## 2. 表 `biz_cooperative_development` 唯一键 `uk_year_month_village_coop (stat_year, stat_month, village_dept_id, cooperative_name)`;含乡镇/村冗余名、入社/入股/效益/就业/存出栏/产品认证/培训、经营范围(逗号)、经营模式、运营情况。DDL:`sql/biz_cooperative_development.sql`(`DROP` 全量重建)。 ## 3. 接口 | URI | 说明 | | --- | --- | | CRUD `/list` `/{id}` POST/PUT/DELETE | 常规;列表可筛村、合作社名称 | | `/villageTree` | 县→乡镇→村 | | `/importData` | 按唯一键 upsert(存在更新 / 不存在插入) | | `/export` | 按年月导出;可选 `townDeptId`,不传则导出全部乡镇 | ### Excel 列(0-based,节选) | 列 | 字段 | | --- | --- | | 1~2 | 村、乡镇 | | 3~7 | 合作社名称、法人、成立时间、注册资本、总资产 | | 8~17 | 入社/入股 | | 18~23 | 效益 | | 24~31 | 就业与存出栏 | | 32~36 | 产品与培训 | | 37~46 | 经营范围多选标记 | | 47~52 | 经营模式单选标记 | | 53~55 | 运营情况单选标记 | 数据起始行:`headerRow + 5`(表头跨 1~7 行)。 ## 4. 前端 - 页面:`ruoyi-ui/src/views/dataModel/cooperativeDevelopment/index.vue` - API:`ruoyi-ui/src/api/dataModel/cooperativeDevelopment.js` - i18n:`lang/zh|bo/dataModel.js` → `cooperativeDevelopment` - 表单只选村(Treeselect,`disable-branch-nodes`);经营范围 checkbox → 逗号提交。 ## 5. 导入 / 导出 - 导入:任一行失败不写库 → 成功则按 `(年,月,村,合作社名称)` 查重,存在 `update`、不存在 `insert`。 - 导出:写合作社行 + 标记列;**不含合计行**。 ## 6. 修订记录 | 版本 | 说明 | | --- | --- | | 1.0 | 首版对齐交接模板与出栏模块交互 | | 1.1 | 导入按唯一键 upsert,取消 deleteByYearMonth |