Просмотр исходного кода

chore: 删除后端教育体系模块(实体+服务+Controller+菜单+页面+表)

完全没用到的代码:
- 4 Java 文件: entity/EducationSystem, mapper/EducationSystemMapper, service/EducationSystemService, controller/admin/EducationSystemController
- Vue 页面: admin/EducationSystems.vue
- admin.js: 5 个 education-systems API 封装

顺手清理相关遗留:
- DatabaseInitializer:
  * 删除 modifyColumnToText('education_systems', 'description') 迁移 (表没了)
  * 删除 runMigration92() (整个迁移不入群, 改为 university+education_system 列在 Guide 未被消费)
- entity/Guide.java: 删除 university + eduSystem 字段
  * 顺带删除 schema.sql 中 guides 表的 university + education_system 列定义
- schema.sql: 删除 CREATE TABLE/INSERT FOR education_systems
- Layout.vue: 删除教育体系菜单项 + submenu 项
- router/index.js: 删除 education-systems 路由

验证: mvn compile 通过, 全项目无 EducationSystem 残留引用
Xiaogang Liao 3 месяцев назад
Родитель
Сommit
e89e61c785

+ 0 - 10
cfc-backend/src/main/java/com/etotem/cfc/config/DatabaseInitializer.java

@@ -3136,8 +3136,6 @@ log.info("已添加template_id列到tasks表");
         modifyColumnToText("supply_settlements", "remark", "备注");
         // content_sections.description
         modifyColumnToText("content_sections", "description", "描述说明");
-        // education_systems.description
-        modifyColumnToText("education_systems", "description", "描述");
         // dimension_config.description
         modifyColumnToText("dimension_config", "description", "描述");
         // energy_rules.description
@@ -5265,7 +5263,6 @@ try {
         runMigration86();
         runMigration88();
         runMigration89();
-        runMigration92();
     }
 
     private void runMigration81() {
@@ -5689,11 +5686,4 @@ try {
         ensureColumn("supply_system", "models", "TEXT COMMENT 'AI模型列表JSON,如[\"agnes-image-2.0-flash\",\"agnes-2.5-flash\"]'");
         log.info("已添加models列到supply_system表");
     }
-
-    private void runMigration92() {
-        // 迁移 92: guides表添加university和education_system列(Guide实体扩展)
-        ensureColumn("guides", "university", "VARCHAR(200) DEFAULT NULL COMMENT '毕业院校'");
-        ensureColumn("guides", "education_system", "VARCHAR(32) DEFAULT NULL COMMENT '教育体系(参考education_systems表)'");
-        log.info("已添加university和education_system列到guides表");
-    }
 }

+ 0 - 52
cfc-backend/src/main/java/com/etotem/cfc/controller/admin/EducationSystemController.java

@@ -1,52 +0,0 @@
-package com.etotem.cfc.controller.admin;
-
-import com.etotem.cfc.common.Result;
-import com.etotem.cfc.entity.EducationSystem;
-import com.etotem.cfc.service.EducationSystemService;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-import java.util.Date;
-import java.util.List;
-
-@RestController
-@RequestMapping("/api/admin/education-systems")
-public class EducationSystemController {
-
-    @Resource
-    private EducationSystemService educationSystemService;
-
-    @PostMapping("/list")
-    public Result<List<EducationSystem>> list() {
-        List<EducationSystem> list = educationSystemService.getActiveSystems();
-        return Result.success(list);
-    }
-
-    @PostMapping("/all")
-    public Result<List<EducationSystem>> listAll() {
-        List<EducationSystem> list = educationSystemService.list();
-        return Result.success(list);
-    }
-
-    @PostMapping("/create")
-    public Result<EducationSystem> create(@RequestBody EducationSystem system) {
-        system.setStatus("ACTIVE");
-        system.setCreatedAt(new Date());
-        system.setUpdatedAt(new Date());
-        EducationSystem created = educationSystemService.createSystem(system);
-        return Result.success(created);
-    }
-
-    @PostMapping("/update")
-    public Result<EducationSystem> update(@RequestBody EducationSystem system) {
-        system.setUpdatedAt(new Date());
-        boolean success = educationSystemService.updateSystem(system);
-        return success ? Result.success(system) : Result.error("更新失败");
-    }
-
-    @PostMapping("/delete")
-    public Result<Void> delete(@RequestParam Long id) {
-        boolean success = educationSystemService.deleteSystem(id);
-        return success ? Result.success(null) : Result.error("删除失败");
-    }
-}

+ 0 - 46
cfc-backend/src/main/java/com/etotem/cfc/entity/EducationSystem.java

@@ -1,46 +0,0 @@
-package com.etotem.cfc.entity;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import lombok.Data;
-
-import java.io.Serializable;
-import java.util.Date;
-
-@Data
-@TableName("education_systems")
-public class EducationSystem implements Serializable {
-
-    @TableId(type = IdType.AUTO)
-    private Long id;
-
-    /**
-     * 编码(key)
-     */
-    private String name;
-
-    /**
-     * 显示名称
-     */
-    private String label;
-
-    /**
-     * 描述说明
-     */
-    private String description;
-
-    /**
-     * 排序
-     */
-    private Integer sortOrder;
-
-    /**
-     * 状态: ACTIVE/DISABLED
-     */
-    private String status;
-
-    private Date createdAt;
-
-    private Date updatedAt;
-}

+ 0 - 14
cfc-backend/src/main/java/com/etotem/cfc/entity/Guide.java

@@ -46,20 +46,6 @@ public class Guide implements Serializable {
      * 从业年限
      */
     private Integer experienceYears;
-
-    /**
-     * 毕业院校
-     */
-    private String university;
-
-    /**
-     * 教育体系(参考education_systems表)
-     */
-    private String eduSystem;
-
-    /**
-     * 评分
-     */
     private Integer rating;
 
     /**

+ 0 - 9
cfc-backend/src/main/java/com/etotem/cfc/mapper/EducationSystemMapper.java

@@ -1,9 +0,0 @@
-package com.etotem.cfc.mapper;
-
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.etotem.cfc.entity.EducationSystem;
-import org.apache.ibatis.annotations.Mapper;
-
-@Mapper
-public interface EducationSystemMapper extends BaseMapper<EducationSystem> {
-}

+ 0 - 33
cfc-backend/src/main/java/com/etotem/cfc/service/EducationSystemService.java

@@ -1,33 +0,0 @@
-package com.etotem.cfc.service;
-
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.etotem.cfc.entity.EducationSystem;
-import com.etotem.cfc.mapper.EducationSystemMapper;
-import org.springframework.stereotype.Service;
-
-import java.util.List;
-
-@Service
-public class EducationSystemService extends ServiceImpl<EducationSystemMapper, EducationSystem> {
-
-    public List<EducationSystem> getActiveSystems() {
-        LambdaQueryWrapper<EducationSystem> wrapper = new LambdaQueryWrapper<>();
-        wrapper.eq(EducationSystem::getStatus, "ACTIVE")
-               .orderByAsc(EducationSystem::getSortOrder);
-        return this.list(wrapper);
-    }
-
-    public EducationSystem createSystem(EducationSystem system) {
-        this.save(system);
-        return system;
-    }
-
-    public boolean updateSystem(EducationSystem system) {
-        return this.updateById(system);
-    }
-
-    public boolean deleteSystem(Long id) {
-        return this.removeById(id);
-    }
-}

+ 0 - 21
cfc-backend/src/main/resources/schema.sql

@@ -287,8 +287,6 @@ CREATE TABLE IF NOT EXISTS guides (
     title VARCHAR(50) COMMENT '职称/称号',
     specialty VARCHAR(200) COMMENT '专长领域',
     bio TEXT COMMENT '简介',
-    university VARCHAR(200) COMMENT '毕业院校',
-    education_system VARCHAR(32) COMMENT '教育体系(参考education_systems表)',
     experience_years TINYINT DEFAULT 0 COMMENT '从业年限',
     rating INT DEFAULT 500 COMMENT '评分(百分位,500=5.00)',
     total_appointments INT DEFAULT 0 COMMENT '总服务次数',
@@ -1556,25 +1554,6 @@ CREATE TABLE IF NOT EXISTS health_report_drafts (
     INDEX idx_status_expire (status, expire_at)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='健康报告上传草稿表(两阶段入库中间态)';
 
--- 教育体系配置表
-CREATE TABLE IF NOT EXISTS education_systems (
-    id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '主键ID',
-    name VARCHAR(32) NOT NULL UNIQUE COMMENT '编码(key)',
-    label VARCHAR(50) NOT NULL COMMENT '显示名称',
-    description TEXT COMMENT '描述说明',
-    sort_order INT DEFAULT 0 COMMENT '排序',
-    status VARCHAR(20) DEFAULT 'ACTIVE' COMMENT '状态: ACTIVE/DISABLED',
-    created_at DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
-    updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='教育体系配置表';
-
-INSERT INTO education_systems (name, label, description, sort_order) VALUES
-('high_school', '中专/高中', '中等教育学历', 1),
-('associate', '大专', '高等专科学历', 2),
-('bachelor', '本科', '大学本科学历', 3),
-('master', '硕士', '硕士研究生学历', 4),
-('doctor', '博士', '博士研究生学历', 5);
-
 -- ===== v1.2 先天属性体系 =====
 
 -- 家庭成员先天属性表

+ 0 - 40
cfc-web/src/api/admin.js

@@ -710,46 +710,6 @@ export function updateProductProfitRate(productId, profitRate) {
   })
 }
 
-// ========== 教育体系管理 API ==========
-
-export function getEducationSystems() {
-  return request({
-    url: '/api/admin/education-systems/list',
-    method: 'post'
-  })
-}
-
-export function getAllEducationSystems() {
-  return request({
-    url: '/api/admin/education-systems/all',
-    method: 'post'
-  })
-}
-
-export function createEducationSystem(data) {
-  return request({
-    url: '/api/admin/education-systems/create',
-    method: 'post',
-    data
-  })
-}
-
-export function updateEducationSystem(data) {
-  return request({
-    url: '/api/admin/education-systems/update',
-    method: 'post',
-    data
-  })
-}
-
-export function deleteEducationSystem(id) {
-  return request({
-    url: '/api/admin/education-systems/delete',
-    method: 'post',
-    data: { id }
-  })
-}
-
 // ========== 星座配置管理 API ==========
 
 export function listZodiacConfigs() {

+ 0 - 6
cfc-web/src/router/index.js

@@ -326,12 +326,6 @@ const routes = [
         component: () => import('@/views/admin/WithdrawAudit.vue'),
         meta: { title: '提现审核', perm: 'audit:withdraw' }
       },
-      {
-        path: 'education-systems',
-        name: 'EducationSystems',
-        component: () => import('@/views/admin/EducationSystems.vue'),
-        meta: { title: '教育体系管理', perm: 'system:education' }
-      },
       {
         path: 'supply-system',
         name: 'SupplySystemList',

+ 0 - 5
cfc-web/src/views/Layout.vue

@@ -267,11 +267,6 @@ export default {
                 { path: '/dimension-config', label: '维度配置', icon: 'el-icon-data-line', perm: 'system:config' },
                 { path: '/relationship-types', label: '关系类型', icon: 'el-icon-share', perm: 'system:config' },
               ]},
-            // --- 教育体系 ---
-            { title: '教育体系', icon: 'el-icon-s-management', perm: 'system:education',
-              children: [
-                { path: '/education-systems', label: '教育体系', icon: 'el-icon-s-management', perm: 'system:education' },
-              ]},
             // --- 供应商体系 ---
             { title: '供应商体系', icon: 'el-icon-s-management', perm: 'system:supply',
               children: [

+ 0 - 179
cfc-web/src/views/admin/EducationSystems.vue

@@ -1,179 +0,0 @@
-<template>
-  <div class="education-systems admin-page">
-    <el-card>
-      <div slot="header" class="admin-page-header">
-        <span class="admin-page-title">教育体系管理</span>
-        <div class="flex items-center gap-sm">
-          <el-input v-model="keyword" placeholder="搜索体系..." prefix-icon="el-icon-search" clearable @keyup.enter.native="handleSearch" @clear="handleSearch" />
-          <el-button type="primary" size="small" @click="handleCreate">+ 添加体系</el-button>
-        </div>
-      </div>
-      <div class="table-scroll-wrap"><el-table :data="filteredData" stripe>
-        <el-table-column prop="id" label="ID" width="80"></el-table-column>
-        <el-table-column prop="name" label="编码" width="120"></el-table-column>
-        <el-table-column prop="label" label="显示名称"></el-table-column>
-        <el-table-column prop="description" label="描述"></el-table-column>
-        <el-table-column prop="sortOrder" label="排序" width="80"></el-table-column>
-        <el-table-column prop="status" label="状态" width="100">
-          <template slot-scope="scope">
-            <el-tag :type="scope.row.status === 'ACTIVE' ? 'success' : 'danger'">
-              {{ scope.row.status === 'ACTIVE' ? '启用' : '停用' }}
-            </el-tag>
-          </template>
-        </el-table-column>
-        <el-table-column label="操作" width="200" fixed="right">
-          <template slot-scope="{ row }">
-            <el-button size="mini" type="primary" @click="handleEdit(row)">编辑</el-button>
-            <el-dropdown trigger="hover" @command="(cmd) => handleActionCmd(row, cmd)">
-              <el-button size="mini">
-                更多<i class="el-icon-arrow-down el-icon--right"></i>
-              </el-button>
-              <el-dropdown-menu slot="dropdown">
-                <el-dropdown-item :command="row.status === 'ACTIVE' ? 'disable' : 'enable'" icon="el-icon-switch-button">{{ row.status === 'ACTIVE' ? '停用' : '启用' }}</el-dropdown-item>
-              </el-dropdown-menu>
-            </el-dropdown>
-          </template>
-        </el-table-column>
-    </el-table></div>
-  </el-card>
-
-    <el-dialog :visible.sync="dialogVisible" :title="isEdit ? '编辑教育体系' : '添加教育体系'" width="500px">
-      <el-form :model="form" label-width="80px">
-        <el-form-item label="编码">
-          <el-input v-model="form.name" placeholder="如: bachelor"></el-input>
-        </el-form-item>
-        <el-form-item label="显示名称">
-          <el-input v-model="form.label" placeholder="如: 本科"></el-input>
-        </el-form-item>
-        <el-form-item label="描述">
-          <el-input v-model="form.description" type="textarea"></el-input>
-        </el-form-item>
-        <el-form-item label="排序">
-          <el-input-number v-model="form.sortOrder" :min="0"></el-input-number>
-        </el-form-item>
-      </el-form>
-      <div slot="footer">
-        <el-button @click="dialogVisible = false">取消</el-button>
-        <el-button type="primary" @click="handleSubmit">保存</el-button>
-      </div>
-    </el-dialog>
-
-    <el-dialog title="操作成功" :visible.sync="successDialogVisible" width="400px" :close-on-click-modal="false">
-      <div style="text-align:center;padding:10px 0">
-        <i class="el-icon-success" style="color:#67C23A;font-size:32px"></i>
-        <p style="margin:12px 0 0;font-size:16px;color:#303133">保存成功</p>
-      </div>
-      <div slot="footer">
-        <el-button type="primary" @click="handleContinue">继续添加</el-button>
-        <el-button @click="handleClose">关闭</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { getAllEducationSystems, createEducationSystem, updateEducationSystem } from '@/api/admin'
-
-export default {
-  name: 'EducationSystems',
-  data() {
-    return {
-      systems: [],
-      keyword: '',
-      dialogVisible: false,
-      successDialogVisible: false,
-      isEdit: false,
-      form: {
-        id: null,
-        name: '',
-        label: '',
-        description: '',
-        sortOrder: 0,
-        status: 'ACTIVE'
-      }
-    }
-  },
-  computed: {
-    filteredData() {
-      if (!this.keyword) return this.systems
-      const kw = this.keyword.toLowerCase()
-      return this.systems.filter(item => item.name?.toLowerCase().includes(kw) || item.label?.toLowerCase().includes(kw))
-    }
-  },
-  created() {
-    this.loadData()
-  },
-  methods: {
-    async loadData() {
-      try {
-        const res = await getAllEducationSystems()
-        if (res.data) {
-          this.systems = res.data
-        }
-      } catch (e) {
-        console.error(e)
-      }
-    },
-    handleCreate() {
-      this.isEdit = false
-      this.form = { id: null, name: '', label: '', description: '', sortOrder: 0, status: 'ACTIVE' }
-      this.dialogVisible = true
-    },
-    handleEdit(row) {
-      this.isEdit = true
-      this.form = { ...row }
-      this.dialogVisible = true
-    },
-    async toggleStatus(row) {
-      row.status = row.status === 'ACTIVE' ? 'DISABLED' : 'ACTIVE'
-      try {
-        await updateEducationSystem(row)
-        this.$message.success('状态已更新')
-      } catch (e) {
-        row.status = row.status === 'ACTIVE' ? 'DISABLED' : 'ACTIVE'
-        this.$message.error('更新失败')
-      }
-    },
-    async handleSubmit() {
-      try {
-        if (this.isEdit) {
-          await updateEducationSystem(this.form)
-        } else {
-          await createEducationSystem(this.form)
-        }
-        this.$message.success('保存成功')
-        this.successDialogVisible = true
-      } catch (e) {
-        this.$message.error('保存失败')
-      }
-    },
-    handleSearch() {},
-    handleActionCmd(row, cmd) {
-      switch (cmd) {
-        case 'disable':
-          row.status = 'DISABLED'
-          this.toggleStatus(row)
-          break
-        case 'enable':
-          row.status = 'ACTIVE'
-          this.toggleStatus(row)
-          break
-      }
-    },
-    handleContinue() {
-      this.successDialogVisible = false
-      this.isEdit = false
-      this.form = { id: null, name: '', label: '', description: '', sortOrder: 0, status: 'ACTIVE' }
-      this.dialogVisible = true
-    },
-    handleClose() {
-      this.successDialogVisible = false
-      this.dialogVisible = false
-      this.loadData()
-    }
-  }
-}
-</script>
-
-<style scoped>
-</style>