提交代码
This commit is contained in:
1 parent
cc03e81f49
commit
454c9a26cb
63 files changed
+6437
-1239
No files matched your search
@@ -1,238 +0,0 @@
|
||||
package org.dromara.zsjy.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.zsjy.domain.ZsjyEnrollmentProcess;
|
||||
import org.dromara.zsjy.domain.bo.ZsjyEnrollmentProcessBo;
|
||||
import org.dromara.zsjy.domain.vo.ZsjyEnrollmentProcessVo;
|
||||
import org.dromara.zsjy.mapper.ZsjyEnrollmentProcessMapper;
|
||||
import org.dromara.zsjy.service.IZsjyEnrollmentProcessService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 招生录取流程状态Service实现类
|
||||
* 修复版本 - 添加了基于用户角色的数据过滤逻辑
|
||||
*
|
||||
* @author Cursor AI
|
||||
* @date 2025-07-21
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ZsjyEnrollmentProcessServiceImpl implements IZsjyEnrollmentProcessService {
|
||||
|
||||
private final ZsjyEnrollmentProcessMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询招生录取流程状态
|
||||
*
|
||||
* @param id 招生录取流程状态主键
|
||||
* @return 招生录取流程状态
|
||||
*/
|
||||
@Override
|
||||
public ZsjyEnrollmentProcessVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建查询条件
|
||||
*/
|
||||
private LambdaQueryWrapper<ZsjyEnrollmentProcess> buildQueryWrapper(ZsjyEnrollmentProcessBo bo) {
|
||||
LambdaQueryWrapper<ZsjyEnrollmentProcess> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(bo.getEnrollmentId() != null, ZsjyEnrollmentProcess::getEnrollmentId, bo.getEnrollmentId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getStudentName()), ZsjyEnrollmentProcess::getStudentName, bo.getStudentName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getIdCard()), ZsjyEnrollmentProcess::getIdCard, bo.getIdCard());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCurrentStatus()), ZsjyEnrollmentProcess::getCurrentStatus, bo.getCurrentStatus());
|
||||
lqw.eq(bo.getCurrentHandler() != null, ZsjyEnrollmentProcess::getCurrentHandler, bo.getCurrentHandler());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getInfoAuditStatus()), ZsjyEnrollmentProcess::getInfoAuditStatus, bo.getInfoAuditStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAdmissionStatus()), ZsjyEnrollmentProcess::getAdmissionStatus, bo.getAdmissionStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getFinalAuditStatus()), ZsjyEnrollmentProcess::getFinalAuditStatus, bo.getFinalAuditStatus());
|
||||
lqw.eq(bo.getIsCompleted() != null, ZsjyEnrollmentProcess::getIsCompleted, bo.getIsCompleted());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询招生录取流程状态列表
|
||||
* 修复:添加基于用户角色的数据过滤逻辑
|
||||
*
|
||||
* @param bo 招生录取流程状态查询条件
|
||||
* @param pageQuery 分页查询参数
|
||||
* @return 招生录取流程状态分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ZsjyEnrollmentProcessVo> queryPageList(ZsjyEnrollmentProcessBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ZsjyEnrollmentProcess> lqw = buildQueryWrapper(bo);
|
||||
|
||||
// 获取当前用户ID和角色
|
||||
Long userId = LoginHelper.getUserId();
|
||||
List<String> roles = LoginHelper.getRolePermission();
|
||||
|
||||
// 根据角色过滤数据
|
||||
if (roles.contains("zsjy_info_auditor")) {
|
||||
// 信息审核员只能看到状态为0和1的数据
|
||||
lqw.in(ZsjyEnrollmentProcess::getCurrentStatus, "0", "1");
|
||||
} else if (roles.contains("zsjy_admission_processor")) {
|
||||
// 录取处理员只能看到状态为2的数据
|
||||
lqw.eq(ZsjyEnrollmentProcess::getCurrentStatus, "2");
|
||||
} else if (!roles.contains("admin") && !roles.contains("superadmin")) {
|
||||
// 非管理员且非特定角色,只能看到自己处理的数据
|
||||
lqw.eq(ZsjyEnrollmentProcess::getCurrentHandler, userId);
|
||||
}
|
||||
|
||||
Page<ZsjyEnrollmentProcessVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的招生录取流程状态列表
|
||||
*
|
||||
* @param bo 招生录取流程状态查询条件
|
||||
* @return 招生录取流程状态列表
|
||||
*/
|
||||
@Override
|
||||
public List<ZsjyEnrollmentProcessVo> queryList(ZsjyEnrollmentProcessBo bo) {
|
||||
LambdaQueryWrapper<ZsjyEnrollmentProcess> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询当前用户的待处理流程列表
|
||||
* 修复:添加基于用户角色的数据过滤逻辑
|
||||
*
|
||||
* @param bo 招生录取流程状态查询条件
|
||||
* @param pageQuery 分页查询参数
|
||||
* @return 待处理的招生录取流程状态分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ZsjyEnrollmentProcessVo> queryPendingList(ZsjyEnrollmentProcessBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ZsjyEnrollmentProcess> lqw = buildQueryWrapper(bo);
|
||||
|
||||
// 获取当前用户ID和角色
|
||||
Long userId = LoginHelper.getUserId();
|
||||
List<String> roles = LoginHelper.getRolePermission();
|
||||
|
||||
// 根据角色过滤待处理数据
|
||||
if (roles.contains("zsjy_info_auditor")) {
|
||||
// 信息审核员只能看到状态为0和1的待处理数据
|
||||
lqw.and(wrapper -> wrapper
|
||||
.eq(ZsjyEnrollmentProcess::getCurrentHandler, userId)
|
||||
.or(subWrapper -> subWrapper
|
||||
.isNull(ZsjyEnrollmentProcess::getCurrentHandler)
|
||||
.in(ZsjyEnrollmentProcess::getCurrentStatus, "0", "1")
|
||||
)
|
||||
);
|
||||
} else if (roles.contains("zsjy_admission_processor")) {
|
||||
// 录取处理员只能看到状态为2的待处理数据
|
||||
lqw.and(wrapper -> wrapper
|
||||
.eq(ZsjyEnrollmentProcess::getCurrentHandler, userId)
|
||||
.or(subWrapper -> subWrapper
|
||||
.isNull(ZsjyEnrollmentProcess::getCurrentHandler)
|
||||
.eq(ZsjyEnrollmentProcess::getCurrentStatus, "2")
|
||||
)
|
||||
);
|
||||
} else if (roles.contains("admin") || roles.contains("superadmin")) {
|
||||
// 管理员可以看到所有待处理数据
|
||||
// 不添加额外过滤条件
|
||||
} else {
|
||||
// 其他用户只能看到分配给自己的数据
|
||||
lqw.eq(ZsjyEnrollmentProcess::getCurrentHandler, userId);
|
||||
}
|
||||
|
||||
// 排除已完成和已驳回的流程
|
||||
lqw.notIn(ZsjyEnrollmentProcess::getCurrentStatus, "4", "9");
|
||||
|
||||
Page<ZsjyEnrollmentProcessVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据报名信息ID查询流程状态
|
||||
*
|
||||
* @param enrollmentId 报名信息ID
|
||||
* @return 招生录取流程状态
|
||||
*/
|
||||
@Override
|
||||
public ZsjyEnrollmentProcessVo queryByEnrollmentId(Long enrollmentId) {
|
||||
LambdaQueryWrapper<ZsjyEnrollmentProcess> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(ZsjyEnrollmentProcess::getEnrollmentId, enrollmentId);
|
||||
return baseMapper.selectVoOne(lqw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增招生录取流程状态
|
||||
*
|
||||
* @param bo 招生录取流程状态
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(ZsjyEnrollmentProcessBo bo) {
|
||||
ZsjyEnrollmentProcess add = MapstructUtils.convert(bo, ZsjyEnrollmentProcess.class);
|
||||
// 设置初始状态为待审核
|
||||
if (StringUtils.isEmpty(add.getCurrentStatus())) {
|
||||
add.setCurrentStatus("0");
|
||||
}
|
||||
// 设置信息审核状态为待审核
|
||||
if (StringUtils.isEmpty(add.getInfoAuditStatus())) {
|
||||
add.setInfoAuditStatus("0");
|
||||
}
|
||||
// 设置录取处理状态为待处理
|
||||
if (StringUtils.isEmpty(add.getAdmissionStatus())) {
|
||||
add.setAdmissionStatus("0");
|
||||
}
|
||||
// 设置最终审核状态为待确认
|
||||
if (StringUtils.isEmpty(add.getFinalAuditStatus())) {
|
||||
add.setFinalAuditStatus("0");
|
||||
}
|
||||
// 设置缴费状态为未缴费
|
||||
if (StringUtils.isEmpty(add.getPaymentStatus())) {
|
||||
add.setPaymentStatus("0");
|
||||
}
|
||||
// 设置完成状态为未完成
|
||||
if (add.getIsCompleted() == null) {
|
||||
add.setIsCompleted(0);
|
||||
}
|
||||
// 分配处理人(根据角色分配)
|
||||
if (add.getCurrentHandler() == null) {
|
||||
// 这里应该根据实际业务逻辑分配处理人
|
||||
// 例如:从信息审核员角色中选择一个用户作为处理人
|
||||
}
|
||||
|
||||
return baseMapper.insert(add) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改招生录取流程状态
|
||||
*
|
||||
* @param bo 招生录取流程状态
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(ZsjyEnrollmentProcessBo bo) {
|
||||
ZsjyEnrollmentProcess update = MapstructUtils.convert(bo, ZsjyEnrollmentProcess.class);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除招生录取流程状态信息
|
||||
*
|
||||
* @param ids 需要删除的招生录取流程状态主键集合
|
||||
* @param isValid 是否校验,true-删除前校验,false-不校验
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// 进行校验,例如检查是否有已完成的流程不允许删除等
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package org.dromara.xg.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.xg.domain.vo.XgClassMsgVo;
|
||||
import org.dromara.xg.domain.bo.XgClassMsgBo;
|
||||
import org.dromara.xg.service.IXgClassMsgService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 班级信息-新版
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/classMsg/classMsg")
|
||||
public class XgClassMsgController extends BaseController {
|
||||
|
||||
private final IXgClassMsgService xgClassMsgService;
|
||||
|
||||
/**
|
||||
* 查询班级信息-新版列表
|
||||
*/
|
||||
@SaCheckPermission("classMsg:classMsg:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<XgClassMsgVo> list(XgClassMsgBo bo, PageQuery pageQuery) {
|
||||
return xgClassMsgService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出班级信息-新版列表
|
||||
*/
|
||||
@SaCheckPermission("classMsg:classMsg:export")
|
||||
@Log(title = "班级信息-新版", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(XgClassMsgBo bo, HttpServletResponse response) {
|
||||
List<XgClassMsgVo> list = xgClassMsgService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "班级信息-新版", XgClassMsgVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取班级信息-新版详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("classMsg:classMsg:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<XgClassMsgVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(xgClassMsgService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增班级信息-新版
|
||||
*/
|
||||
@SaCheckPermission("classMsg:classMsg:add")
|
||||
@Log(title = "班级信息-新版", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody XgClassMsgBo bo) {
|
||||
return toAjax(xgClassMsgService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改班级信息-新版
|
||||
*/
|
||||
@SaCheckPermission("classMsg:classMsg:edit")
|
||||
@Log(title = "班级信息-新版", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody XgClassMsgBo bo) {
|
||||
return toAjax(xgClassMsgService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除班级信息-新版
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("classMsg:classMsg:remove")
|
||||
@Log(title = "班级信息-新版", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(xgClassMsgService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
+105
@@ -0,0 +1,105 @@
|
||||
package org.dromara.xg.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.xg.domain.vo.XgClassTeacherCounselorRelVo;
|
||||
import org.dromara.xg.domain.bo.XgClassTeacherCounselorRelBo;
|
||||
import org.dromara.xg.service.IXgClassTeacherCounselorRelService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 班级班主任辅导员关联
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/teacherCounselorRel/classTeacherCounselorRel")
|
||||
public class XgClassTeacherCounselorRelController extends BaseController {
|
||||
|
||||
private final IXgClassTeacherCounselorRelService xgClassTeacherCounselorRelService;
|
||||
|
||||
/**
|
||||
* 查询班级班主任辅导员关联列表
|
||||
*/
|
||||
@SaCheckPermission("teacherCounselorRel:classTeacherCounselorRel:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<XgClassTeacherCounselorRelVo> list(XgClassTeacherCounselorRelBo bo, PageQuery pageQuery) {
|
||||
return xgClassTeacherCounselorRelService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出班级班主任辅导员关联列表
|
||||
*/
|
||||
@SaCheckPermission("teacherCounselorRel:classTeacherCounselorRel:export")
|
||||
@Log(title = "班级班主任辅导员关联", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(XgClassTeacherCounselorRelBo bo, HttpServletResponse response) {
|
||||
List<XgClassTeacherCounselorRelVo> list = xgClassTeacherCounselorRelService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "班级班主任辅导员关联", XgClassTeacherCounselorRelVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取班级班主任辅导员关联详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("teacherCounselorRel:classTeacherCounselorRel:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<XgClassTeacherCounselorRelVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(xgClassTeacherCounselorRelService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增班级班主任辅导员关联
|
||||
*/
|
||||
@SaCheckPermission("teacherCounselorRel:classTeacherCounselorRel:add")
|
||||
@Log(title = "班级班主任辅导员关联", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody XgClassTeacherCounselorRelBo bo) {
|
||||
return toAjax(xgClassTeacherCounselorRelService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改班级班主任辅导员关联
|
||||
*/
|
||||
@SaCheckPermission("teacherCounselorRel:classTeacherCounselorRel:edit")
|
||||
@Log(title = "班级班主任辅导员关联", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody XgClassTeacherCounselorRelBo bo) {
|
||||
return toAjax(xgClassTeacherCounselorRelService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除班级班主任辅导员关联
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("teacherCounselorRel:classTeacherCounselorRel:remove")
|
||||
@Log(title = "班级班主任辅导员关联", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(xgClassTeacherCounselorRelService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package org.dromara.xg.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.xg.domain.vo.XgSysDeptVo;
|
||||
import org.dromara.xg.service.IXgSysDeptService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 学院专业信息管理
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Tag(name = "学院专业信息管理")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/xg/college")
|
||||
public class XgSysDeptController {
|
||||
|
||||
private final IXgSysDeptService deptService;
|
||||
|
||||
/**
|
||||
* 获取学院列表
|
||||
*/
|
||||
@Operation(summary = "获取学院列表")
|
||||
@SaCheckPermission("xg:college:list")
|
||||
@GetMapping("/list")
|
||||
public R<List<XgSysDeptVo>> list() {
|
||||
List<XgSysDeptVo> depts = deptService.selectCollegeList();
|
||||
return R.ok(depts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学院和专业的树结构
|
||||
*/
|
||||
@Operation(summary = "获取学院和专业的树结构")
|
||||
@SaCheckPermission("xg:college:list")
|
||||
@GetMapping("/tree")
|
||||
public R<List<XgSysDeptVo>> tree() {
|
||||
List<XgSysDeptVo> depts = deptService.selectCollegeAndMajorTree();
|
||||
return R.ok(depts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据学院ID获取专业列表
|
||||
*/
|
||||
@Operation(summary = "根据学院ID获取专业列表")
|
||||
@SaCheckPermission("xg:college:list")
|
||||
@GetMapping("/majors/{collegeId}")
|
||||
public R<List<XgSysDeptVo>> majors(@PathVariable Long collegeId) {
|
||||
List<XgSysDeptVo> depts = deptService.selectMajorListByCollegeId(collegeId);
|
||||
return R.ok(depts);
|
||||
}
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package org.dromara.xg.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.xg.domain.XgSysUser;
|
||||
import org.dromara.xg.service.IXgSysUserService;
|
||||
|
||||
/**
|
||||
* 系统用户信息
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-24
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/xg/sysUser")
|
||||
public class XgSysUserController extends BaseController {
|
||||
|
||||
private final IXgSysUserService xgSysUserService;
|
||||
|
||||
/**
|
||||
* 查询有效用户列表
|
||||
*/
|
||||
@SaCheckPermission("xg:sysUser:list")
|
||||
@GetMapping("/activeList")
|
||||
public R<List<XgSysUser>> activeList() {
|
||||
List<XgSysUser> list = xgSysUserService.selectActiveUserList();
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
package org.dromara.xg.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 班级信息-新版对象 xg_class_msg
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("xg_class_msg")
|
||||
public class XgClassMsg extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@TableLogic(value = "0", delval = "1")
|
||||
private Long deleted;
|
||||
|
||||
/**
|
||||
* 学院代码
|
||||
*/
|
||||
private Long collegeId;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
private String collegeName;
|
||||
|
||||
/**
|
||||
* 专业代码
|
||||
*/
|
||||
private Long majorId;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
private String majorName;
|
||||
|
||||
/**
|
||||
* 班级代码
|
||||
*/
|
||||
private String classCode;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 班级类型:1-中级工 2-高级工 3-预备技师 4-技师 5-中高职一体
|
||||
*/
|
||||
private String classType;
|
||||
|
||||
/**
|
||||
* 年级
|
||||
*/
|
||||
private String grade;
|
||||
|
||||
/**
|
||||
* 入学年份
|
||||
*/
|
||||
private Long enrollmentYear;
|
||||
|
||||
/**
|
||||
* 毕业年份
|
||||
*/
|
||||
private Long graduationYear;
|
||||
|
||||
/**
|
||||
* 培养方式:全日制,在职,函授,夜大等
|
||||
*/
|
||||
private String trainingType;
|
||||
|
||||
/**
|
||||
* 学位类型:学士,硕士,博士,专科
|
||||
*/
|
||||
private String degreeType;
|
||||
|
||||
/**
|
||||
* 辅导员ID
|
||||
*/
|
||||
private Long counselorId;
|
||||
|
||||
/**
|
||||
* 辅导员姓名
|
||||
*/
|
||||
private String counselorName;
|
||||
|
||||
/**
|
||||
* 班主任ID
|
||||
*/
|
||||
private Long classTeacherId;
|
||||
|
||||
/**
|
||||
* 班主任姓名
|
||||
*/
|
||||
private String classTeacherName;
|
||||
|
||||
/**
|
||||
* 班级导师ID
|
||||
*/
|
||||
private Long classAdvisorId;
|
||||
|
||||
/**
|
||||
* 班级导师姓名
|
||||
*/
|
||||
private String classAdvisorName;
|
||||
|
||||
/**
|
||||
* 班长ID
|
||||
*/
|
||||
private Long classMonitorId;
|
||||
|
||||
/**
|
||||
* 班长姓名
|
||||
*/
|
||||
private String classMonitorName;
|
||||
|
||||
/**
|
||||
* 副班长ID
|
||||
*/
|
||||
private Long deputyMonitorId;
|
||||
|
||||
/**
|
||||
* 副班长姓名
|
||||
*/
|
||||
private String deputyMonitorName;
|
||||
|
||||
/**
|
||||
* 班级状态:1-正常,2-暂停,3-毕业,4-解散
|
||||
*/
|
||||
private String classStatus;
|
||||
|
||||
/**
|
||||
* 是否已毕业:0-未毕业,1-已毕业
|
||||
*/
|
||||
private Long isGraduation;
|
||||
|
||||
/**
|
||||
* 毕业日期
|
||||
*/
|
||||
private Date graduationDate;
|
||||
|
||||
/**
|
||||
* 计划容量
|
||||
*/
|
||||
private Long plannedCapacity;
|
||||
|
||||
/**
|
||||
* 当前学生人数
|
||||
*/
|
||||
private Long currentStudentCount;
|
||||
|
||||
/**
|
||||
* 最大学生人数
|
||||
*/
|
||||
private Long maxStudentCount;
|
||||
|
||||
/**
|
||||
* 男生人数
|
||||
*/
|
||||
private Long maleCount;
|
||||
|
||||
/**
|
||||
* 女生人数
|
||||
*/
|
||||
private Long femaleCount;
|
||||
|
||||
/**
|
||||
* 在籍人数
|
||||
*/
|
||||
private Long activeCount;
|
||||
|
||||
/**
|
||||
* 转入人数
|
||||
*/
|
||||
private Long transferInCount;
|
||||
|
||||
/**
|
||||
* 转出人数
|
||||
*/
|
||||
private Long transferOutCount;
|
||||
|
||||
/**
|
||||
* 退学人数
|
||||
*/
|
||||
private Long dropoutCount;
|
||||
|
||||
/**
|
||||
* 毕业人数
|
||||
*/
|
||||
private Long graduateCount;
|
||||
|
||||
/**
|
||||
* 班级办公室位置
|
||||
*/
|
||||
private String officeLocation;
|
||||
|
||||
/**
|
||||
* 班级教室位置
|
||||
*/
|
||||
private String classLocation;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String contactPhone;
|
||||
|
||||
/**
|
||||
* QQ群号
|
||||
*/
|
||||
private String qqGroup;
|
||||
|
||||
/**
|
||||
* 微信群
|
||||
*/
|
||||
private String wechatGroup;
|
||||
|
||||
/**
|
||||
* 班级邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 课程安排(JSON格式)
|
||||
*/
|
||||
private String classSchedule;
|
||||
|
||||
/**
|
||||
* 班级文化建设
|
||||
*/
|
||||
private String classCulture;
|
||||
|
||||
/**
|
||||
* 班级规章制度
|
||||
*/
|
||||
private String classRules;
|
||||
|
||||
/**
|
||||
* 班级描述
|
||||
*/
|
||||
private String classDescription;
|
||||
|
||||
/**
|
||||
* 最后统计更新时间
|
||||
*/
|
||||
private Date lastCountUpdate;
|
||||
|
||||
/**
|
||||
* 扩展字段1
|
||||
*/
|
||||
private String extField1;
|
||||
|
||||
/**
|
||||
* 扩展字段2
|
||||
*/
|
||||
private String extField2;
|
||||
|
||||
/**
|
||||
* 扩展字段3
|
||||
*/
|
||||
private String extField3;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package org.dromara.xg.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 班级班主任辅导员关联对象 xg_class_teacher_counselor_rel
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("xg_class_teacher_counselor_rel")
|
||||
public class XgClassTeacherCounselorRel extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@TableLogic(value = "0", delval = "1")
|
||||
private Long deleted;
|
||||
|
||||
/**
|
||||
* 班级ID,关联xg_class_msg.id
|
||||
*/
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 教师ID,关联sys_user.user_id
|
||||
*/
|
||||
private Long teacherId;
|
||||
|
||||
/**
|
||||
* 教师姓名
|
||||
*/
|
||||
private String teacherName;
|
||||
|
||||
/**
|
||||
* 教师类型:class_teacher-班主任,counselor-辅导员,advisor-导师
|
||||
*/
|
||||
private String teacherType;
|
||||
|
||||
/**
|
||||
* 开始日期
|
||||
*/
|
||||
private Date startDate;
|
||||
|
||||
/**
|
||||
* 结束日期
|
||||
*/
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package org.dromara.xg.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 部门表 sys_dept
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@TableName("sys_dept")
|
||||
public class XgSysDept extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 父部门ID
|
||||
*/
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 祖级列表
|
||||
*/
|
||||
private String ancestors;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private Long leader;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 部门状态:0正常,1停用
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 父部门名称
|
||||
*/
|
||||
private String parentName;
|
||||
|
||||
/**
|
||||
* 部门类别编码
|
||||
*/
|
||||
private String deptCategory;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package org.dromara.xg.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 系统用户信息对象
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-24
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("sys_user")
|
||||
public class XgSysUser extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@TableId(value = "user_id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 用户手机号码
|
||||
*/
|
||||
private String phonenumber;
|
||||
|
||||
/**
|
||||
* 帐号状态(0正常 1停用)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
}
|
||||
+271
@@ -0,0 +1,271 @@
|
||||
package org.dromara.xg.domain.bo;
|
||||
|
||||
import org.dromara.xg.domain.XgClassMsg;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 班级信息-新版业务对象 xg_class_msg
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = XgClassMsg.class, reverseConvertGenerate = false)
|
||||
public class XgClassMsgBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
@NotNull(message = "主键ID(雪花ID)不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 学院代码
|
||||
*/
|
||||
private Long collegeId;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
private String collegeName;
|
||||
|
||||
/**
|
||||
* 专业代码
|
||||
*/
|
||||
private Long majorId;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
private String majorName;
|
||||
|
||||
/**
|
||||
* 班级代码
|
||||
*/
|
||||
@NotBlank(message = "班级代码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String classCode;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
@NotBlank(message = "班级名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 班级类型:1-中级工 2-高级工 3-预备技师 4-技师 5-中高职一体
|
||||
*/
|
||||
private String classType;
|
||||
|
||||
/**
|
||||
* 年级
|
||||
*/
|
||||
@NotBlank(message = "年级不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String grade;
|
||||
|
||||
/**
|
||||
* 入学年份
|
||||
*/
|
||||
@NotNull(message = "入学年份不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long enrollmentYear;
|
||||
|
||||
/**
|
||||
* 毕业年份
|
||||
*/
|
||||
private Long graduationYear;
|
||||
|
||||
/**
|
||||
* 培养方式:全日制,在职,函授,夜大等
|
||||
*/
|
||||
private String trainingType;
|
||||
|
||||
/**
|
||||
* 学位类型:学士,硕士,博士,专科
|
||||
*/
|
||||
private String degreeType;
|
||||
|
||||
/**
|
||||
* 辅导员ID
|
||||
*/
|
||||
private Long counselorId;
|
||||
|
||||
/**
|
||||
* 辅导员姓名
|
||||
*/
|
||||
private String counselorName;
|
||||
|
||||
/**
|
||||
* 班主任ID
|
||||
*/
|
||||
private Long classTeacherId;
|
||||
|
||||
/**
|
||||
* 班主任姓名
|
||||
*/
|
||||
private String classTeacherName;
|
||||
|
||||
/**
|
||||
* 班级导师ID
|
||||
*/
|
||||
private Long classAdvisorId;
|
||||
|
||||
/**
|
||||
* 班级导师姓名
|
||||
*/
|
||||
private String classAdvisorName;
|
||||
|
||||
/**
|
||||
* 班长ID
|
||||
*/
|
||||
private Long classMonitorId;
|
||||
|
||||
/**
|
||||
* 班长姓名
|
||||
*/
|
||||
private String classMonitorName;
|
||||
|
||||
/**
|
||||
* 副班长ID
|
||||
*/
|
||||
private Long deputyMonitorId;
|
||||
|
||||
/**
|
||||
* 副班长姓名
|
||||
*/
|
||||
private String deputyMonitorName;
|
||||
|
||||
/**
|
||||
* 班级状态:1-正常,2-暂停,3-毕业,4-解散
|
||||
*/
|
||||
private String classStatus;
|
||||
|
||||
/**
|
||||
* 是否已毕业:0-未毕业,1-已毕业
|
||||
*/
|
||||
private Long isGraduation;
|
||||
|
||||
/**
|
||||
* 毕业日期
|
||||
*/
|
||||
private Date graduationDate;
|
||||
|
||||
/**
|
||||
* 计划容量
|
||||
*/
|
||||
private Long plannedCapacity;
|
||||
|
||||
/**
|
||||
* 当前学生人数
|
||||
*/
|
||||
private Long currentStudentCount;
|
||||
|
||||
/**
|
||||
* 最大学生人数
|
||||
*/
|
||||
private Long maxStudentCount;
|
||||
|
||||
/**
|
||||
* 男生人数
|
||||
*/
|
||||
private Long maleCount;
|
||||
|
||||
/**
|
||||
* 女生人数
|
||||
*/
|
||||
private Long femaleCount;
|
||||
|
||||
/**
|
||||
* 在籍人数
|
||||
*/
|
||||
private Long activeCount;
|
||||
|
||||
/**
|
||||
* 转入人数
|
||||
*/
|
||||
private Long transferInCount;
|
||||
|
||||
/**
|
||||
* 转出人数
|
||||
*/
|
||||
private Long transferOutCount;
|
||||
|
||||
/**
|
||||
* 退学人数
|
||||
*/
|
||||
private Long dropoutCount;
|
||||
|
||||
/**
|
||||
* 毕业人数
|
||||
*/
|
||||
private Long graduateCount;
|
||||
|
||||
/**
|
||||
* 班级办公室位置
|
||||
*/
|
||||
private String officeLocation;
|
||||
|
||||
/**
|
||||
* 班级教室位置
|
||||
*/
|
||||
private String classLocation;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String contactPhone;
|
||||
|
||||
/**
|
||||
* QQ群号
|
||||
*/
|
||||
private String qqGroup;
|
||||
|
||||
/**
|
||||
* 微信群
|
||||
*/
|
||||
private String wechatGroup;
|
||||
|
||||
/**
|
||||
* 班级邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 课程安排(JSON格式)
|
||||
*/
|
||||
private String classSchedule;
|
||||
|
||||
/**
|
||||
* 班级文化建设
|
||||
*/
|
||||
private String classCulture;
|
||||
|
||||
/**
|
||||
* 班级规章制度
|
||||
*/
|
||||
private String classRules;
|
||||
|
||||
/**
|
||||
* 班级描述
|
||||
*/
|
||||
private String classDescription;
|
||||
|
||||
/**
|
||||
* 最后统计更新时间
|
||||
*/
|
||||
private Date lastCountUpdate;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package org.dromara.xg.domain.bo;
|
||||
|
||||
import org.dromara.xg.domain.XgClassTeacherCounselorRel;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 班级班主任辅导员关联业务对象 xg_class_teacher_counselor_rel
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = XgClassTeacherCounselorRel.class, reverseConvertGenerate = false)
|
||||
public class XgClassTeacherCounselorRelBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
@NotNull(message = "主键ID(雪花ID)不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
private Long deleted;
|
||||
|
||||
/**
|
||||
* 班级ID,关联xg_class_msg.id
|
||||
*/
|
||||
@NotNull(message = "班级ID,关联xg_class_msg.id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 教师ID,关联sys_user.user_id
|
||||
*/
|
||||
@NotNull(message = "教师ID,关联sys_user.user_id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long teacherId;
|
||||
|
||||
/**
|
||||
* 教师姓名
|
||||
*/
|
||||
private String teacherName;
|
||||
|
||||
/**
|
||||
* 教师类型:class_teacher-班主任,counselor-辅导员,advisor-导师
|
||||
*/
|
||||
@NotBlank(message = "教师类型:class_teacher-班主任,counselor-辅导员,advisor-导师不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String teacherType;
|
||||
|
||||
/**
|
||||
* 开始日期
|
||||
*/
|
||||
@NotNull(message = "开始日期不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date startDate;
|
||||
|
||||
/**
|
||||
* 结束日期
|
||||
*/
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
package org.dromara.xg.domain.bo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 部门查询对象
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "部门查询对象")
|
||||
public class XgSysDeptBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@Schema(description = "部门id")
|
||||
@NotNull(message = "部门id不能为空", groups = { EditGroup.class })
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 父部门ID
|
||||
*/
|
||||
@Schema(description = "父部门id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@Schema(description = "部门名称")
|
||||
@NotBlank(message = "部门名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@Schema(description = "显示顺序")
|
||||
@NotNull(message = "显示顺序不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
@Schema(description = "负责人")
|
||||
private String leader;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@Schema(description = "联系电话")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 部门状态:0正常,1停用
|
||||
*/
|
||||
@Schema(description = "部门状态:0正常,1停用")
|
||||
private String status;
|
||||
|
||||
}
|
||||
+358
@@ -0,0 +1,358 @@
|
||||
package org.dromara.xg.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.xg.domain.XgClassMsg;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 班级信息-新版视图对象 xg_class_msg
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = XgClassMsg.class)
|
||||
public class XgClassMsgVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "雪=花ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 学院代码
|
||||
*/
|
||||
@ExcelProperty(value = "学院代码")
|
||||
private Long collegeId;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
@ExcelProperty(value = "学院名称")
|
||||
private String collegeName;
|
||||
|
||||
/**
|
||||
* 专业代码
|
||||
*/
|
||||
@ExcelProperty(value = "专业代码")
|
||||
private Long majorId;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
@ExcelProperty(value = "专业名称")
|
||||
private String majorName;
|
||||
|
||||
/**
|
||||
* 班级代码
|
||||
*/
|
||||
@ExcelProperty(value = "班级代码")
|
||||
private String classCode;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
@ExcelProperty(value = "班级名称")
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 班级类型:1-中级工 2-高级工 3-预备技师 4-技师 5-中高职一体
|
||||
*/
|
||||
@ExcelProperty(value = "班级类型")
|
||||
private String classType;
|
||||
|
||||
/**
|
||||
* 年级
|
||||
*/
|
||||
@ExcelProperty(value = "年级")
|
||||
private String grade;
|
||||
|
||||
/**
|
||||
* 入学年份
|
||||
*/
|
||||
@ExcelProperty(value = "入学年份")
|
||||
private Long enrollmentYear;
|
||||
|
||||
/**
|
||||
* 毕业年份
|
||||
*/
|
||||
@ExcelProperty(value = "毕业年份")
|
||||
private Long graduationYear;
|
||||
|
||||
/**
|
||||
* 培养方式
|
||||
*/
|
||||
@ExcelProperty(value = "培养方式")
|
||||
private String trainingType;
|
||||
|
||||
/**
|
||||
* 学位类型
|
||||
*/
|
||||
@ExcelProperty(value = "学位类型")
|
||||
private String degreeType;
|
||||
|
||||
/**
|
||||
* 辅导员ID
|
||||
*/
|
||||
@ExcelProperty(value = "辅导员ID")
|
||||
private Long counselorId;
|
||||
|
||||
/**
|
||||
* 辅导员姓名
|
||||
*/
|
||||
@ExcelProperty(value = "辅导员姓名")
|
||||
private String counselorName;
|
||||
|
||||
/**
|
||||
* 班主任ID
|
||||
*/
|
||||
@ExcelProperty(value = "班主任ID")
|
||||
private Long classTeacherId;
|
||||
|
||||
/**
|
||||
* 班主任姓名
|
||||
*/
|
||||
@ExcelProperty(value = "班主任姓名")
|
||||
private String classTeacherName;
|
||||
|
||||
/**
|
||||
* 班级导师ID
|
||||
*/
|
||||
@ExcelProperty(value = "班级导师ID")
|
||||
private Long classAdvisorId;
|
||||
|
||||
/**
|
||||
* 班级导师姓名
|
||||
*/
|
||||
@ExcelProperty(value = "班级导师姓名")
|
||||
private String classAdvisorName;
|
||||
|
||||
/**
|
||||
* 班长ID
|
||||
*/
|
||||
@ExcelProperty(value = "班长ID")
|
||||
private Long classMonitorId;
|
||||
|
||||
/**
|
||||
* 班长姓名
|
||||
*/
|
||||
@ExcelProperty(value = "班长姓名")
|
||||
private String classMonitorName;
|
||||
|
||||
/**
|
||||
* 副班长ID
|
||||
*/
|
||||
@ExcelProperty(value = "副班长ID")
|
||||
private Long deputyMonitorId;
|
||||
|
||||
/**
|
||||
* 副班长姓名
|
||||
*/
|
||||
@ExcelProperty(value = "副班长姓名")
|
||||
private String deputyMonitorName;
|
||||
|
||||
/**
|
||||
* 班级状态:1-正常,2-暂停,3-毕业,4-解散
|
||||
*/
|
||||
@ExcelProperty(value = "班级状态")
|
||||
private String classStatus;
|
||||
|
||||
/**
|
||||
* 是否已毕业:0-未毕业,1-已毕业
|
||||
*/
|
||||
@ExcelProperty(value = "是否已毕业")
|
||||
private Long isGraduation;
|
||||
|
||||
/**
|
||||
* 毕业日期
|
||||
*/
|
||||
@ExcelProperty(value = "毕业日期")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date graduationDate;
|
||||
|
||||
/**
|
||||
* 计划容量
|
||||
*/
|
||||
@ExcelProperty(value = "计划容量")
|
||||
private Long plannedCapacity;
|
||||
|
||||
/**
|
||||
* 当前学生人数
|
||||
*/
|
||||
@ExcelProperty(value = "当前学生人数")
|
||||
private Long currentStudentCount;
|
||||
|
||||
/**
|
||||
* 最大学生人数
|
||||
*/
|
||||
@ExcelProperty(value = "最大学生人数")
|
||||
private Long maxStudentCount;
|
||||
|
||||
/**
|
||||
* 男生人数
|
||||
*/
|
||||
@ExcelProperty(value = "男生人数")
|
||||
private Long maleCount;
|
||||
|
||||
/**
|
||||
* 女生人数
|
||||
*/
|
||||
@ExcelProperty(value = "女生人数")
|
||||
private Long femaleCount;
|
||||
|
||||
/**
|
||||
* 在籍人数
|
||||
*/
|
||||
@ExcelProperty(value = "在籍人数")
|
||||
private Long activeCount;
|
||||
|
||||
/**
|
||||
* 转入人数
|
||||
*/
|
||||
@ExcelProperty(value = "转入人数")
|
||||
private Long transferInCount;
|
||||
|
||||
/**
|
||||
* 转出人数
|
||||
*/
|
||||
@ExcelProperty(value = "转出人数")
|
||||
private Long transferOutCount;
|
||||
|
||||
/**
|
||||
* 退学人数
|
||||
*/
|
||||
@ExcelProperty(value = "退学人数")
|
||||
private Long dropoutCount;
|
||||
|
||||
/**
|
||||
* 毕业人数
|
||||
*/
|
||||
@ExcelProperty(value = "毕业人数")
|
||||
private Long graduateCount;
|
||||
|
||||
/**
|
||||
* 班级办公室位置
|
||||
*/
|
||||
@ExcelProperty(value = "班级办公室位置")
|
||||
private String officeLocation;
|
||||
|
||||
/**
|
||||
* 班级教室位置
|
||||
*/
|
||||
@ExcelProperty(value = "班级教室位置")
|
||||
private String classLocation;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@ExcelProperty(value = "联系电话")
|
||||
private String contactPhone;
|
||||
|
||||
/**
|
||||
* QQ群号
|
||||
*/
|
||||
@ExcelProperty(value = "QQ群号")
|
||||
private String qqGroup;
|
||||
|
||||
/**
|
||||
* 微信群
|
||||
*/
|
||||
@ExcelProperty(value = "微信群")
|
||||
private String wechatGroup;
|
||||
|
||||
/**
|
||||
* 班级邮箱
|
||||
*/
|
||||
@ExcelProperty(value = "班级邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 课程安排(JSON格式)
|
||||
*/
|
||||
@ExcelProperty(value = "课程安排")
|
||||
private String classSchedule;
|
||||
|
||||
/**
|
||||
* 班级文化建设
|
||||
*/
|
||||
@ExcelProperty(value = "班级文化建设")
|
||||
private String classCulture;
|
||||
|
||||
/**
|
||||
* 班级规章制度
|
||||
*/
|
||||
@ExcelProperty(value = "班级规章制度")
|
||||
private String classRules;
|
||||
|
||||
/**
|
||||
* 班级描述
|
||||
*/
|
||||
@ExcelProperty(value = "班级描述")
|
||||
private String classDescription;
|
||||
|
||||
/**
|
||||
* 最后统计更新时间
|
||||
*/
|
||||
@ExcelProperty(value = "最后统计更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date lastCountUpdate;
|
||||
|
||||
/**
|
||||
* 扩展字段1
|
||||
*/
|
||||
private String extField1;
|
||||
|
||||
/**
|
||||
* 扩展字段2
|
||||
*/
|
||||
private String extField2;
|
||||
|
||||
/**
|
||||
* 扩展字段3
|
||||
*/
|
||||
private String extField3;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
@ExcelProperty(value = "备注信息")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
private Long updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
package org.dromara.xg.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.xg.domain.XgClassTeacherCounselorRel;
|
||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import cn.idev.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 班级班主任辅导员关联视图对象 xg_class_teacher_counselor_rel
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = XgClassTeacherCounselorRel.class)
|
||||
public class XgClassTeacherCounselorRelVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "雪=花ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@ExcelProperty(value = "删除标志", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=代表存在,1=代表删除")
|
||||
private Long deleted;
|
||||
|
||||
/**
|
||||
* 班级ID,关联xg_class_msg.id
|
||||
*/
|
||||
@ExcelProperty(value = "班级ID,关联xg_class_msg.id")
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
@ExcelProperty(value = "班级名称")
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 教师ID,关联sys_user.user_id
|
||||
*/
|
||||
@ExcelProperty(value = "教师ID,关联sys_user.user_id")
|
||||
private Long teacherId;
|
||||
|
||||
/**
|
||||
* 教师姓名
|
||||
*/
|
||||
@ExcelProperty(value = "教师姓名")
|
||||
private String teacherName;
|
||||
|
||||
/**
|
||||
* 教师类型:class_teacher-班主任,counselor-辅导员,advisor-导师
|
||||
*/
|
||||
@ExcelProperty(value = "教师类型:class_teacher-班主任,counselor-辅导员,advisor-导师")
|
||||
private String teacherType;
|
||||
|
||||
/**
|
||||
* 开始日期
|
||||
*/
|
||||
@ExcelProperty(value = "开始日期")
|
||||
private Date startDate;
|
||||
|
||||
/**
|
||||
* 结束日期
|
||||
*/
|
||||
@ExcelProperty(value = "结束日期")
|
||||
private Date endDate;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
@ExcelProperty(value = "备注信息")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
package org.dromara.xg.domain.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门视图对象
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Data
|
||||
@Schema(description = "部门视图对象")
|
||||
public class XgSysDeptVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
@Schema(description = "部门id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 父部门ID
|
||||
*/
|
||||
@Schema(description = "父部门id")
|
||||
private Long parentId;
|
||||
|
||||
/**
|
||||
* 祖级列表
|
||||
*/
|
||||
@Schema(description = "祖级列表")
|
||||
private String ancestors;
|
||||
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
@Schema(description = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
/**
|
||||
* 显示顺序
|
||||
*/
|
||||
@Schema(description = "显示顺序")
|
||||
private Integer orderNum;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
@Schema(description = "负责人")
|
||||
private String leader;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
@Schema(description = "联系电话")
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 部门状态:0正常,1停用
|
||||
*/
|
||||
@Schema(description = "部门状态:0正常,1停用")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 删除标志
|
||||
*/
|
||||
@Schema(description = "删除标志")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@Schema(description = "创建者")
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@Schema(description = "更新者")
|
||||
private Long updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Schema(description = "更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 子部门
|
||||
*/
|
||||
@Schema(description = "子部门")
|
||||
private List<XgSysDeptVo> children = new ArrayList<>();
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package org.dromara.xg.mapper;
|
||||
|
||||
import org.dromara.xg.domain.XgClassMsg;
|
||||
import org.dromara.xg.domain.vo.XgClassMsgVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 班级信息-新版Mapper接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
public interface XgClassMsgMapper extends BaseMapperPlus<XgClassMsg, XgClassMsgVo> {
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package org.dromara.xg.mapper;
|
||||
|
||||
import org.dromara.xg.domain.XgClassTeacherCounselorRel;
|
||||
import org.dromara.xg.domain.vo.XgClassTeacherCounselorRelVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 班级班主任辅导员关联Mapper接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
public interface XgClassTeacherCounselorRelMapper extends BaseMapperPlus<XgClassTeacherCounselorRel, XgClassTeacherCounselorRelVo> {
|
||||
|
||||
}
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
package org.dromara.xg.mapper;
|
||||
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.xg.domain.XgSysDept;
|
||||
import org.dromara.xg.domain.vo.XgSysDeptVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门管理 数据层
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface XgSysDeptMapper extends BaseMapperPlus<XgSysDept, XgSysDeptVo> {
|
||||
|
||||
/**
|
||||
* 查询二级学院列表
|
||||
*
|
||||
* @param sysDept 部门信息
|
||||
* @return 二级学院集合
|
||||
*/
|
||||
List<XgSysDeptVo> selectCollegeList(XgSysDept sysDept);
|
||||
|
||||
/**
|
||||
* 根据学院ID查询专业列表
|
||||
*
|
||||
* @param collegeId 学院ID
|
||||
* @return 专业集合
|
||||
*/
|
||||
List<XgSysDeptVo> selectMajorListByCollegeId(Long collegeId);
|
||||
|
||||
/**
|
||||
* 查询部门树结构信息
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 部门树信息集合
|
||||
*/
|
||||
List<XgSysDeptVo> selectDeptTreeList(XgSysDept dept);
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package org.dromara.xg.mapper;
|
||||
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.xg.domain.XgSysUser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统用户信息Mapper接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-24
|
||||
*/
|
||||
public interface XgSysUserMapper extends BaseMapperPlus<XgSysUser, XgSysUser> {
|
||||
|
||||
/**
|
||||
* 查询有效用户列表
|
||||
*
|
||||
* @return 用户列表
|
||||
*/
|
||||
List<XgSysUser> selectActiveUserList();
|
||||
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package org.dromara.xg.service;
|
||||
|
||||
import org.dromara.xg.domain.vo.XgClassMsgVo;
|
||||
import org.dromara.xg.domain.bo.XgClassMsgBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 班级信息-新版Service接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
public interface IXgClassMsgService {
|
||||
|
||||
/**
|
||||
* 查询班级信息-新版
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 班级信息-新版
|
||||
*/
|
||||
XgClassMsgVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询班级信息-新版列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 班级信息-新版分页列表
|
||||
*/
|
||||
TableDataInfo<XgClassMsgVo> queryPageList(XgClassMsgBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的班级信息-新版列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 班级信息-新版列表
|
||||
*/
|
||||
List<XgClassMsgVo> queryList(XgClassMsgBo bo);
|
||||
|
||||
/**
|
||||
* 新增班级信息-新版
|
||||
*
|
||||
* @param bo 班级信息-新版
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(XgClassMsgBo bo);
|
||||
|
||||
/**
|
||||
* 修改班级信息-新版
|
||||
*
|
||||
* @param bo 班级信息-新版
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(XgClassMsgBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除班级信息-新版信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package org.dromara.xg.service;
|
||||
|
||||
import org.dromara.xg.domain.vo.XgClassTeacherCounselorRelVo;
|
||||
import org.dromara.xg.domain.bo.XgClassTeacherCounselorRelBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 班级班主任辅导员关联Service接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
public interface IXgClassTeacherCounselorRelService {
|
||||
|
||||
/**
|
||||
* 查询班级班主任辅导员关联
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 班级班主任辅导员关联
|
||||
*/
|
||||
XgClassTeacherCounselorRelVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询班级班主任辅导员关联列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 班级班主任辅导员关联分页列表
|
||||
*/
|
||||
TableDataInfo<XgClassTeacherCounselorRelVo> queryPageList(XgClassTeacherCounselorRelBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的班级班主任辅导员关联列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 班级班主任辅导员关联列表
|
||||
*/
|
||||
List<XgClassTeacherCounselorRelVo> queryList(XgClassTeacherCounselorRelBo bo);
|
||||
|
||||
/**
|
||||
* 新增班级班主任辅导员关联
|
||||
*
|
||||
* @param bo 班级班主任辅导员关联
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(XgClassTeacherCounselorRelBo bo);
|
||||
|
||||
/**
|
||||
* 修改班级班主任辅导员关联
|
||||
*
|
||||
* @param bo 班级班主任辅导员关联
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(XgClassTeacherCounselorRelBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除班级班主任辅导员关联信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
package org.dromara.xg.service;
|
||||
|
||||
import org.dromara.xg.domain.XgSysDept;
|
||||
import org.dromara.xg.domain.vo.XgSysDeptVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 部门管理 服务层
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
public interface IXgSysDeptService {
|
||||
|
||||
/**
|
||||
* 查询二级学院列表
|
||||
*
|
||||
* @return 学院列表
|
||||
*/
|
||||
List<XgSysDeptVo> selectCollegeList();
|
||||
|
||||
/**
|
||||
* 查询学院和专业的树结构
|
||||
*
|
||||
* @return 树结构列表
|
||||
*/
|
||||
List<XgSysDeptVo> selectCollegeAndMajorTree();
|
||||
|
||||
/**
|
||||
* 根据学院ID查询专业列表
|
||||
*
|
||||
* @param collegeId 学院ID
|
||||
* @return 专业列表
|
||||
*/
|
||||
List<XgSysDeptVo> selectMajorListByCollegeId(Long collegeId);
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package org.dromara.xg.service;
|
||||
|
||||
import org.dromara.xg.domain.XgSysUser;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统用户信息Service接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-24
|
||||
*/
|
||||
public interface IXgSysUserService {
|
||||
|
||||
/**
|
||||
* 查询所有有效用户列表
|
||||
*
|
||||
* @return 有效用户列表
|
||||
*/
|
||||
List<XgSysUser> selectActiveUserList();
|
||||
|
||||
}
|
||||
+272
@@ -0,0 +1,272 @@
|
||||
package org.dromara.xg.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.system.domain.SysDept;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.dromara.xg.domain.bo.XgClassMsgBo;
|
||||
import org.dromara.xg.domain.vo.XgClassMsgVo;
|
||||
import org.dromara.xg.domain.XgClassMsg;
|
||||
import org.dromara.xg.domain.XgSysDept;
|
||||
import org.dromara.xg.mapper.XgClassMsgMapper;
|
||||
import org.dromara.xg.mapper.XgSysDeptMapper;
|
||||
import org.dromara.xg.service.IXgClassMsgService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 班级信息-新版Service业务层处理
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class XgClassMsgServiceImpl implements IXgClassMsgService {
|
||||
|
||||
private final XgClassMsgMapper baseMapper;
|
||||
private final XgSysDeptMapper deptMapper;
|
||||
|
||||
/**
|
||||
* 查询班级信息-新版
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 班级信息-新版
|
||||
*/
|
||||
@Override
|
||||
public XgClassMsgVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询班级信息-新版列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 班级信息-新版分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<XgClassMsgVo> queryPageList(XgClassMsgBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<XgClassMsg> lqw = buildQueryWrapper(bo);
|
||||
Page<XgClassMsgVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的班级信息-新版列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 班级信息-新版列表
|
||||
*/
|
||||
@Override
|
||||
public List<XgClassMsgVo> queryList(XgClassMsgBo bo) {
|
||||
LambdaQueryWrapper<XgClassMsg> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<XgClassMsg> buildQueryWrapper(XgClassMsgBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<XgClassMsg> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(XgClassMsg::getId);
|
||||
lqw.eq(bo.getCollegeId() != null, XgClassMsg::getCollegeId, bo.getCollegeId());
|
||||
lqw.eq(bo.getMajorId() != null, XgClassMsg::getMajorId, bo.getMajorId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getClassName()), XgClassMsg::getClassName, bo.getClassName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getClassType()), XgClassMsg::getClassType, bo.getClassType());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getGrade()), XgClassMsg::getGrade, bo.getGrade());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getClassStatus()), XgClassMsg::getClassStatus, bo.getClassStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增班级信息-新版
|
||||
*
|
||||
* @param bo 班级信息-新版
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertByBo(XgClassMsgBo bo) {
|
||||
XgClassMsg add = MapstructUtils.convert(bo, XgClassMsg.class);
|
||||
validEntityBeforeSave(add);
|
||||
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
|
||||
// 在班级创建成功后,同时创建对应的部门信息
|
||||
XgSysDept dept = new XgSysDept();
|
||||
dept.setDeptName(bo.getClassName()); // 使用班级名称作为部门名称
|
||||
dept.setParentId(bo.getMajorId()); // 以专业作为父部门
|
||||
|
||||
// 查询父部门信息,构建祖级列表
|
||||
XgSysDept parentDept = deptMapper.selectById(bo.getMajorId());
|
||||
if (parentDept != null) {
|
||||
dept.setAncestors(parentDept.getAncestors() + "," + parentDept.getDeptId());
|
||||
} else {
|
||||
// 如果父部门不存在,则设置为顶级部门
|
||||
dept.setAncestors("0");
|
||||
}
|
||||
|
||||
// 设置部门基本信息
|
||||
dept.setOrderNum(10); // 默认排序号
|
||||
dept.setStatus("0"); // 状态:0正常
|
||||
dept.setDelFlag("0"); // 删除标志:0代表存在
|
||||
dept.setDeptCategory("bj-" + bo.getClassName()); // 部门类别编码:1班级
|
||||
// 设置联系信息
|
||||
dept.setPhone(bo.getContactPhone());
|
||||
dept.setEmail(bo.getEmail());
|
||||
|
||||
// 设置负责人(班主任)
|
||||
if (bo.getClassTeacherId() != null && StringUtils.isNotEmpty(bo.getClassTeacherName())) {
|
||||
dept.setLeader(bo.getClassTeacherId());
|
||||
}
|
||||
|
||||
dept.setDeptId(add.getId());
|
||||
|
||||
// 插入部门记录
|
||||
deptMapper.insert(dept);
|
||||
log.info("成功创建班级对应的部门信息,班级ID:{},部门ID:{}", bo.getId(), dept.getDeptId());
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改班级信息-新版
|
||||
*
|
||||
* @param bo 班级信息-新版
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateByBo(XgClassMsgBo bo) {
|
||||
XgClassMsg update = MapstructUtils.convert(bo, XgClassMsg.class);
|
||||
validEntityBeforeSave(update);
|
||||
|
||||
// 使用LambdaQueryWrapper替代直接调用updateById
|
||||
LambdaQueryWrapper<XgClassMsg> updateWrapper = Wrappers.lambdaQuery();
|
||||
updateWrapper.eq(XgClassMsg::getId, update.getId());
|
||||
boolean result = baseMapper.update(update, updateWrapper) > 0;
|
||||
|
||||
// 更新成功后,同步更新部门表信息
|
||||
if (result) {
|
||||
// 查询部门信息
|
||||
XgSysDept dept = deptMapper.selectById(update.getId());
|
||||
if (dept != null) {
|
||||
// 更新部门基本信息
|
||||
dept.setDeptName(update.getClassName()); // 使用班级名称作为部门名称
|
||||
|
||||
// 如果班级的父部门(专业)发生变化,需要更新祖级列表
|
||||
if (!dept.getParentId().equals(update.getMajorId())) {
|
||||
dept.setParentId(update.getMajorId()); // 设置新的父部门ID
|
||||
|
||||
// 查询父部门信息,构建新的祖级列表
|
||||
XgSysDept parentDept = deptMapper.selectById(update.getMajorId());
|
||||
if (parentDept != null) {
|
||||
dept.setAncestors(parentDept.getAncestors() + "," + parentDept.getDeptId());
|
||||
}
|
||||
}
|
||||
dept.setDeptCategory("bj-" + bo.getClassName()); // 部门类别编码:1班级
|
||||
// 更新联系信息
|
||||
dept.setPhone(update.getContactPhone());
|
||||
dept.setEmail(update.getEmail());
|
||||
|
||||
// 更新负责人(班主任)
|
||||
if (update.getClassTeacherId() != null && StringUtils.isNotEmpty(update.getClassTeacherName())) {
|
||||
dept.setLeader(update.getClassTeacherId());
|
||||
}
|
||||
|
||||
// 更新部门表
|
||||
LambdaQueryWrapper<XgSysDept> deptUpdateWrapper = Wrappers.lambdaQuery();
|
||||
deptUpdateWrapper.eq(XgSysDept::getDeptId, dept.getDeptId());
|
||||
deptMapper.update(dept, deptUpdateWrapper);
|
||||
log.info("成功更新班级对应的部门信息,班级ID:{},部门ID:{}", update.getId(), dept.getDeptId());
|
||||
} else {
|
||||
// 如果部门不存在,则创建新的部门记录
|
||||
dept = new XgSysDept();
|
||||
dept.setDeptId(update.getId());
|
||||
dept.setDeptName(update.getClassName()); // 使用班级名称作为部门名称
|
||||
dept.setParentId(update.getMajorId()); // 以专业作为父部门
|
||||
|
||||
// 查询父部门信息,构建祖级列表
|
||||
XgSysDept parentDept = deptMapper.selectById(update.getMajorId());
|
||||
if (parentDept != null) {
|
||||
dept.setAncestors(parentDept.getAncestors() + "," + parentDept.getDeptId());
|
||||
} else {
|
||||
// 如果父部门不存在,则设置为顶级部门
|
||||
dept.setAncestors("0");
|
||||
}
|
||||
// dept.setDeptCategory("bj-" + bo.getClassName()); // 部门类别编码:1班级
|
||||
// 设置部门基本信息
|
||||
dept.setOrderNum(10); // 默认排序号
|
||||
dept.setStatus("0"); // 状态:0正常
|
||||
dept.setDelFlag("0"); // 删除标志:0代表存在
|
||||
dept.setDeptCategory("bj-" + update.getClassName()); // 部门类别编码:bj-班级
|
||||
|
||||
// 设置联系信息
|
||||
dept.setPhone(update.getContactPhone());
|
||||
dept.setEmail(update.getEmail());
|
||||
|
||||
// 设置负责人(班主任)
|
||||
if (update.getClassTeacherId() != null && StringUtils.isNotEmpty(update.getClassTeacherName())) {
|
||||
dept.setLeader(update.getClassTeacherId());
|
||||
}
|
||||
|
||||
// 插入部门记录
|
||||
deptMapper.insert(dept);
|
||||
log.info("班级对应的部门信息不存在,已创建部门信息,班级ID:{},部门ID:{}", update.getId(), dept.getDeptId());
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(XgClassMsg entity) {
|
||||
// TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除班级信息-新版信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
|
||||
// 删除班级的同时,标记对应的部门为删除状态
|
||||
for (Long id : ids) {
|
||||
XgSysDept dept = deptMapper.selectById(id);
|
||||
if (dept != null) {
|
||||
dept.setDelFlag("1"); // 设置删除标志(1代表删除)
|
||||
// 使用LambdaUpdateWrapper替代直接调用updateById
|
||||
LambdaQueryWrapper<XgSysDept> deleteUpdateWrapper = Wrappers.lambdaQuery();
|
||||
deleteUpdateWrapper.eq(XgSysDept::getDeptId, dept.getDeptId());
|
||||
deptMapper.update(dept, deleteUpdateWrapper);
|
||||
log.info("成功标记班级对应的部门为删除状态,班级ID:{},部门ID:{}", id, dept.getDeptId());
|
||||
}
|
||||
}
|
||||
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
+433
@@ -0,0 +1,433 @@
|
||||
package org.dromara.xg.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.dromara.xg.domain.bo.XgClassTeacherCounselorRelBo;
|
||||
import org.dromara.xg.domain.vo.XgClassTeacherCounselorRelVo;
|
||||
import org.dromara.xg.domain.XgClassTeacherCounselorRel;
|
||||
import org.dromara.xg.domain.XgClassMsg;
|
||||
import org.dromara.xg.mapper.XgClassTeacherCounselorRelMapper;
|
||||
import org.dromara.xg.mapper.XgClassMsgMapper;
|
||||
import org.dromara.xg.service.IXgClassTeacherCounselorRelService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 班级班主任辅导员关联Service业务层处理
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class XgClassTeacherCounselorRelServiceImpl implements IXgClassTeacherCounselorRelService {
|
||||
|
||||
private final XgClassTeacherCounselorRelMapper baseMapper;
|
||||
private final XgClassMsgMapper classMsgMapper;
|
||||
|
||||
// 班主任类型常量
|
||||
private static final String HEAD_TEACHER_TYPE = "class_teacher";
|
||||
// 辅导员类型常量
|
||||
private static final String COUNSELOR_TYPE = "counselor";
|
||||
|
||||
/**
|
||||
* 查询班级班主任辅导员关联
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 班级班主任辅导员关联
|
||||
*/
|
||||
@Override
|
||||
public XgClassTeacherCounselorRelVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询班级班主任辅导员关联列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 班级班主任辅导员关联分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<XgClassTeacherCounselorRelVo> queryPageList(XgClassTeacherCounselorRelBo bo,
|
||||
PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<XgClassTeacherCounselorRel> lqw = buildQueryWrapper(bo);
|
||||
Page<XgClassTeacherCounselorRelVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的班级班主任辅导员关联列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 班级班主任辅导员关联列表
|
||||
*/
|
||||
@Override
|
||||
public List<XgClassTeacherCounselorRelVo> queryList(XgClassTeacherCounselorRelBo bo) {
|
||||
LambdaQueryWrapper<XgClassTeacherCounselorRel> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<XgClassTeacherCounselorRel> buildQueryWrapper(XgClassTeacherCounselorRelBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<XgClassTeacherCounselorRel> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(XgClassTeacherCounselorRel::getId);
|
||||
lqw.eq(bo.getDeleted() != null, XgClassTeacherCounselorRel::getDeleted, bo.getDeleted());
|
||||
lqw.eq(bo.getClassId() != null, XgClassTeacherCounselorRel::getClassId, bo.getClassId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getClassName()), XgClassTeacherCounselorRel::getClassName,
|
||||
bo.getClassName());
|
||||
lqw.eq(bo.getTeacherId() != null, XgClassTeacherCounselorRel::getTeacherId, bo.getTeacherId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getTeacherName()), XgClassTeacherCounselorRel::getTeacherName,
|
||||
bo.getTeacherName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTeacherType()), XgClassTeacherCounselorRel::getTeacherType,
|
||||
bo.getTeacherType());
|
||||
lqw.eq(bo.getStartDate() != null, XgClassTeacherCounselorRel::getStartDate, bo.getStartDate());
|
||||
lqw.eq(bo.getEndDate() != null, XgClassTeacherCounselorRel::getEndDate, bo.getEndDate());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增班级班主任辅导员关联
|
||||
*
|
||||
* @param bo 班级班主任辅导员关联
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertByBo(XgClassTeacherCounselorRelBo bo) {
|
||||
// 当处理班主任更换时的特殊流程
|
||||
if (HEAD_TEACHER_TYPE.equals(bo.getTeacherType())) {
|
||||
log.info("开始处理班主任更换流程: classId=[{}], teacherId=[{}], teacherName=[{}]",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName());
|
||||
// 1. 查询当前班级的班主任记录
|
||||
LambdaQueryWrapper<XgClassTeacherCounselorRel> queryWrapper = Wrappers.lambdaQuery();
|
||||
queryWrapper.eq(XgClassTeacherCounselorRel::getClassId, bo.getClassId())
|
||||
.eq(XgClassTeacherCounselorRel::getTeacherType, HEAD_TEACHER_TYPE)
|
||||
.eq(XgClassTeacherCounselorRel::getDeleted, 0);
|
||||
|
||||
log.info("准备查询班级ID[{}]的现有班主任记录,查询条件: teacherType={}, deleted={}",
|
||||
bo.getClassId(), HEAD_TEACHER_TYPE, 0);
|
||||
List<XgClassTeacherCounselorRel> currentRecords = baseMapper.selectList(queryWrapper);
|
||||
log.info("班级ID[{}]的班主任查询结果: 找到{}条记录", bo.getClassId(), currentRecords.size());
|
||||
|
||||
// 2. 将当前班级的班主任记录标记为删除并设置结束日期
|
||||
if (!currentRecords.isEmpty()) {
|
||||
for (XgClassTeacherCounselorRel record : currentRecords) {
|
||||
record.setDeleted(1L);
|
||||
record.setEndDate(new Date());
|
||||
baseMapper.updateById(record);
|
||||
// 再执行逻辑删除
|
||||
baseMapper.deleteById(record.getId());
|
||||
log.info("已将班级ID[{}]的原班主任记录ID[{}]标记为删除并设置结束日期: {}",
|
||||
record.getClassId(), record.getId(), record.getEndDate());
|
||||
}
|
||||
}
|
||||
|
||||
// 当bo.getTeacherId(),
|
||||
// bo.getTeacherName()为空时,就不要插入新数据了,但是还是需要更新xg_class_msg表中的班主任信息
|
||||
// log.info("bo.getTeacherName()=[{}]", bo.getTeacherName());
|
||||
log.info("班主任名称值检查 - 原始值:[{}], 是否为null:{}, 长度:{}, 去空格后:[{}]",
|
||||
bo.getTeacherName(),
|
||||
bo.getTeacherName() == null,
|
||||
bo.getTeacherName() == null ? -1 : bo.getTeacherName().length(),
|
||||
bo.getTeacherName() == null ? "null" : bo.getTeacherName().trim());
|
||||
|
||||
if (bo.getTeacherName() == null || "none123".equals(bo.getTeacherName())
|
||||
|| (bo.getTeacherName() != null
|
||||
&& ("none123".equals(bo.getTeacherName().trim())
|
||||
|| "none123".equalsIgnoreCase(bo.getTeacherName().trim())
|
||||
|| bo.getTeacherName().trim().isEmpty()
|
||||
|| "null".equals(bo.getTeacherName().trim())))) {
|
||||
log.info("班主任信息为空,不插入新数据");
|
||||
// 4. 更新班级表中的班主任信息
|
||||
LambdaUpdateWrapper<XgClassMsg> classUpdateWrapper = Wrappers.lambdaUpdate(XgClassMsg.class)
|
||||
.eq(XgClassMsg::getId, bo.getClassId())
|
||||
.set(XgClassMsg::getClassTeacherId, null)
|
||||
.set(XgClassMsg::getClassTeacherName, null);
|
||||
|
||||
int updateResult = classMsgMapper.update(null, classUpdateWrapper);
|
||||
log.info("更新班级表中的班主任信息: classId=[{}], teacherId=[{}], teacherName=[{}], 结果=[{}]",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName(), updateResult > 0 ? "成功" : "失败");
|
||||
|
||||
log.info("已完成班级ID[{}]的班主任信息更换: teacherId={}, teacherName={}",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName());
|
||||
|
||||
// 班主任信息为空,不插入新数据,直接返回
|
||||
return true;
|
||||
} else {
|
||||
// 4. 更新班级表中的班主任信息
|
||||
LambdaUpdateWrapper<XgClassMsg> classUpdateWrapper = Wrappers.lambdaUpdate(XgClassMsg.class)
|
||||
.eq(XgClassMsg::getId, bo.getClassId())
|
||||
.set(XgClassMsg::getClassTeacherId, bo.getTeacherId())
|
||||
.set(XgClassMsg::getClassTeacherName, bo.getTeacherName());
|
||||
|
||||
int updateResult = classMsgMapper.update(null, classUpdateWrapper);
|
||||
log.info("更新班级表中的班主任信息: classId=[{}], teacherId=[{}], teacherName=[{}], 结果=[{}]",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName(), updateResult > 0 ? "成功" : "失败");
|
||||
|
||||
log.info("已完成班级ID[{}]的班主任信息更换: teacherId={}, teacherName={}",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName());
|
||||
|
||||
}
|
||||
|
||||
// 3. 插入新的班主任关联记录
|
||||
XgClassTeacherCounselorRel newRel = MapstructUtils.convert(bo, XgClassTeacherCounselorRel.class);
|
||||
newRel.setId(null); // 确保插入新记录
|
||||
newRel.setDeleted(0L);
|
||||
newRel.setStartDate(new Date());
|
||||
validEntityBeforeSave(newRel);
|
||||
int insertResult = baseMapper.insert(newRel);
|
||||
log.info("插入新的班主任关联记录: classId=[{}], teacherId=[{}], 结果=[{}], 新记录ID=[{}]",
|
||||
newRel.getClassId(), newRel.getTeacherId(), insertResult > 0 ? "成功" : "失败", newRel.getId());
|
||||
|
||||
return true;
|
||||
} else if (COUNSELOR_TYPE.equals(bo.getTeacherType())) {
|
||||
log.info("开始处理辅导员更换流程: classId=[{}], teacherId=[{}], teacherName=[{}]",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName());
|
||||
// 1. 查询当前班级的辅导员记录
|
||||
LambdaQueryWrapper<XgClassTeacherCounselorRel> queryWrapper = Wrappers.lambdaQuery();
|
||||
queryWrapper.eq(XgClassTeacherCounselorRel::getClassId, bo.getClassId())
|
||||
.eq(XgClassTeacherCounselorRel::getTeacherType, COUNSELOR_TYPE)
|
||||
.eq(XgClassTeacherCounselorRel::getDeleted, 0);
|
||||
|
||||
log.info("准备查询班级ID[{}]的现有辅导员记录,查询条件: teacherType={}, deleted={}",
|
||||
bo.getClassId(), COUNSELOR_TYPE, 0);
|
||||
List<XgClassTeacherCounselorRel> currentRecords = baseMapper.selectList(queryWrapper);
|
||||
log.info("班级ID[{}]的辅导员查询结果: 找到{}条记录", bo.getClassId(), currentRecords.size());
|
||||
|
||||
// 2. 将当前班级的辅导员记录标记为删除并设置结束日期
|
||||
if (!currentRecords.isEmpty()) {
|
||||
for (XgClassTeacherCounselorRel record : currentRecords) {
|
||||
record.setDeleted(1L);
|
||||
record.setEndDate(new Date());
|
||||
baseMapper.updateById(record);
|
||||
// 再执行逻辑删除
|
||||
baseMapper.deleteById(record.getId());
|
||||
log.info("已将班级ID[{}]的原辅导员记录ID[{}]标记为删除并设置结束日期: {}",
|
||||
record.getClassId(), record.getId(), record.getEndDate());
|
||||
}
|
||||
}
|
||||
|
||||
// 当bo.getTeacherId(),
|
||||
// bo.getTeacherName()为空时,就不要插入新数据了,但是还是需要更新xg_class_msg表中的班主任信息
|
||||
// log.info("bo.getTeacherName()=[{}]", bo.getTeacherName());
|
||||
log.info("辅导员名称值检查 - 原始值:[{}], 是否为null:{}, 长度:{}, 去空格后:[{}]",
|
||||
bo.getTeacherName(),
|
||||
bo.getTeacherName() == null,
|
||||
bo.getTeacherName() == null ? -1 : bo.getTeacherName().length(),
|
||||
bo.getTeacherName() == null ? "null" : bo.getTeacherName().trim());
|
||||
|
||||
if (bo.getTeacherName() == null || "none123".equals(bo.getTeacherName())
|
||||
|| (bo.getTeacherName() != null
|
||||
&& ("none123".equals(bo.getTeacherName().trim())
|
||||
|| "none123".equalsIgnoreCase(bo.getTeacherName().trim())
|
||||
|| bo.getTeacherName().trim().isEmpty()
|
||||
|| "null".equals(bo.getTeacherName().trim())))) {
|
||||
log.info("辅导员信息为空,不插入新数据");
|
||||
// 4. 更新班级表中的班主任信息
|
||||
LambdaUpdateWrapper<XgClassMsg> classUpdateWrapper = Wrappers.lambdaUpdate(XgClassMsg.class)
|
||||
.eq(XgClassMsg::getId, bo.getClassId())
|
||||
.set(XgClassMsg::getCounselorId, null)
|
||||
.set(XgClassMsg::getCounselorName, null);
|
||||
|
||||
int updateResult = classMsgMapper.update(null, classUpdateWrapper);
|
||||
log.info("更新班级表中的辅导员信息: classId=[{}], teacherId=[{}], teacherName=[{}], 结果=[{}]",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName(), updateResult > 0 ? "成功" : "失败");
|
||||
|
||||
log.info("已完成班级ID[{}]的辅导员信息更换: teacherId={}, teacherName={}",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName());
|
||||
|
||||
// 辅导员信息为空,不插入新数据,直接返回
|
||||
return true;
|
||||
} else {
|
||||
LambdaUpdateWrapper<XgClassMsg> classUpdateWrapper = Wrappers.lambdaUpdate(XgClassMsg.class)
|
||||
.eq(XgClassMsg::getId, bo.getClassId())
|
||||
.set(XgClassMsg::getCounselorId, bo.getTeacherId())
|
||||
.set(XgClassMsg::getCounselorName, bo.getTeacherName());
|
||||
|
||||
int updateResult = classMsgMapper.update(null, classUpdateWrapper);
|
||||
log.info("更新班级表中的辅导员信息: classId=[{}], teacherId=[{}], teacherName=[{}], 结果=[{}]",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName(), updateResult > 0 ? "成功" : "失败");
|
||||
|
||||
log.info("已完成班级ID[{}]的辅导员信息更换: teacherId={}, teacherName={}",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName());
|
||||
}
|
||||
|
||||
// 3. 插入新的辅导员关联记录
|
||||
XgClassTeacherCounselorRel newRel = MapstructUtils.convert(bo, XgClassTeacherCounselorRel.class);
|
||||
newRel.setId(null); // 确保插入新记录
|
||||
newRel.setDeleted(0L);
|
||||
newRel.setStartDate(new Date());
|
||||
validEntityBeforeSave(newRel);
|
||||
int insertResult = baseMapper.insert(newRel);
|
||||
log.info("插入新的辅导员关联记录: classId=[{}], teacherId=[{}], 结果=[{}], 新记录ID=[{}]",
|
||||
newRel.getClassId(), newRel.getTeacherId(), insertResult > 0 ? "成功" : "失败", newRel.getId());
|
||||
|
||||
return true;
|
||||
} else {
|
||||
// 非班主任类型的普通更新
|
||||
XgClassTeacherCounselorRel update = MapstructUtils.convert(bo, XgClassTeacherCounselorRel.class);
|
||||
validEntityBeforeSave(update);
|
||||
boolean result = baseMapper.updateById(update) > 0;
|
||||
log.info("更新非班主任类型关联记录: id=[{}], teacherType=[{}], 结果=[{}]",
|
||||
update.getId(), update.getTeacherType(), result ? "成功" : "失败");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改班级班主任辅导员关联
|
||||
*
|
||||
* @param bo 班级班主任辅导员关联
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateByBo(XgClassTeacherCounselorRelBo bo) {
|
||||
// 当处理班主任更换时的特殊流程
|
||||
if (HEAD_TEACHER_TYPE.equals(bo.getTeacherType())) {
|
||||
log.info("开始处理班主任更换流程: classId=[{}], teacherId=[{}], teacherName=[{}]",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName());
|
||||
// 1. 查询当前班级的班主任记录
|
||||
LambdaQueryWrapper<XgClassTeacherCounselorRel> queryWrapper = Wrappers.lambdaQuery();
|
||||
queryWrapper.eq(XgClassTeacherCounselorRel::getClassId, bo.getClassId())
|
||||
.eq(XgClassTeacherCounselorRel::getTeacherType, HEAD_TEACHER_TYPE)
|
||||
.eq(XgClassTeacherCounselorRel::getDeleted, 0);
|
||||
|
||||
log.info("准备查询班级ID[{}]的现有班主任记录,查询条件: teacherType={}, deleted={}",
|
||||
bo.getClassId(), HEAD_TEACHER_TYPE, 0);
|
||||
List<XgClassTeacherCounselorRel> currentRecords = baseMapper.selectList(queryWrapper);
|
||||
log.info("班级ID[{}]的班主任查询结果: 找到{}条记录", bo.getClassId(), currentRecords.size());
|
||||
|
||||
// 2. 将当前班级的班主任记录标记为删除并设置结束日期
|
||||
if (!currentRecords.isEmpty()) {
|
||||
for (XgClassTeacherCounselorRel record : currentRecords) {
|
||||
record.setDeleted(1L);
|
||||
record.setEndDate(new Date());
|
||||
baseMapper.updateById(record);
|
||||
// 再执行逻辑删除
|
||||
baseMapper.deleteById(record.getId());
|
||||
log.info("已将班级ID[{}]的原班主任记录ID[{}]标记为删除并设置结束日期: {}",
|
||||
record.getClassId(), record.getId(), record.getEndDate());
|
||||
}
|
||||
}
|
||||
|
||||
// 当bo.getTeacherId(),
|
||||
// bo.getTeacherName()为空时,就不要插入新数据了,但是还是需要更新xg_class_msg表中的班主任信息
|
||||
// log.info("bo.getTeacherName()=[{}]", bo.getTeacherName());
|
||||
log.info("班主任名称值检查 - 原始值:[{}], 是否为null:{}, 长度:{}, 去空格后:[{}]",
|
||||
bo.getTeacherName(),
|
||||
bo.getTeacherName() == null,
|
||||
bo.getTeacherName() == null ? -1 : bo.getTeacherName().length(),
|
||||
bo.getTeacherName() == null ? "null" : bo.getTeacherName().trim());
|
||||
|
||||
if (bo.getTeacherName() == null || "none123".equals(bo.getTeacherName())
|
||||
|| (bo.getTeacherName() != null
|
||||
&& ("none123".equals(bo.getTeacherName().trim())
|
||||
|| "none123".equalsIgnoreCase(bo.getTeacherName().trim())
|
||||
|| bo.getTeacherName().trim().isEmpty()
|
||||
|| "null".equals(bo.getTeacherName().trim())))) {
|
||||
log.info("班主任信息为空,不插入新数据");
|
||||
// 4. 更新班级表中的班主任信息
|
||||
LambdaUpdateWrapper<XgClassMsg> classUpdateWrapper = Wrappers.lambdaUpdate(XgClassMsg.class)
|
||||
.eq(XgClassMsg::getId, bo.getClassId())
|
||||
.set(XgClassMsg::getClassTeacherId, null)
|
||||
.set(XgClassMsg::getClassTeacherName, null);
|
||||
|
||||
int updateResult = classMsgMapper.update(null, classUpdateWrapper);
|
||||
log.info("更新班级表中的班主任信息: classId=[{}], teacherId=[{}], teacherName=[{}], 结果=[{}]",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName(), updateResult > 0 ? "成功" : "失败");
|
||||
|
||||
log.info("已完成班级ID[{}]的班主任信息更换: teacherId={}, teacherName={}",
|
||||
bo.getClassId(), bo.getTeacherId(), bo.getTeacherName());
|
||||
|
||||
// 班主任信息为空,不插入新数据,直接返回
|
||||
return true;
|
||||
}
|
||||
|
||||
// 3. 插入新的班主任关联记录
|
||||
XgClassTeacherCounselorRel newRel = MapstructUtils.convert(bo, XgClassTeacherCounselorRel.class);
|
||||
newRel.setId(null); // 确保插入新记录
|
||||
newRel.setDeleted(0L);
|
||||
newRel.setStartDate(new Date());
|
||||
validEntityBeforeSave(newRel);
|
||||
int insertResult = baseMapper.insert(newRel);
|
||||
log.info("插入新的班主任关联记录: classId=[{}], teacherId=[{}], 结果=[{}], 新记录ID=[{}]",
|
||||
newRel.getClassId(), newRel.getTeacherId(), insertResult > 0 ? "成功" : "失败", newRel.getId());
|
||||
|
||||
return true;
|
||||
} else {
|
||||
// 非班主任类型的普通更新
|
||||
XgClassTeacherCounselorRel update = MapstructUtils.convert(bo, XgClassTeacherCounselorRel.class);
|
||||
validEntityBeforeSave(update);
|
||||
boolean result = baseMapper.updateById(update) > 0;
|
||||
log.info("更新非班主任类型关联记录: id=[{}], teacherType=[{}], 结果=[{}]",
|
||||
update.getId(), update.getTeacherType(), result ? "成功" : "失败");
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(XgClassTeacherCounselorRel entity) {
|
||||
// TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除班级班主任辅导员关联信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
|
||||
// 查询要删除的记录,获取班主任类型的记录对应的班级ID
|
||||
List<XgClassTeacherCounselorRel> entityList = baseMapper.selectBatchIds(ids);
|
||||
List<XgClassTeacherCounselorRelVo> relList = MapstructUtils.convert(entityList,
|
||||
XgClassTeacherCounselorRelVo.class);
|
||||
|
||||
// 收集需要清空班主任信息的班级ID列表
|
||||
List<Long> classIdsToUpdate = relList.stream()
|
||||
.filter(rel -> HEAD_TEACHER_TYPE.equals(rel.getTeacherType()))
|
||||
.map(XgClassTeacherCounselorRelVo::getClassId)
|
||||
.distinct()
|
||||
.toList();
|
||||
|
||||
// 先执行删除操作
|
||||
boolean deleteResult = baseMapper.deleteByIds(ids) > 0;
|
||||
|
||||
// 如果删除成功且有班主任类型的记录,则清空对应班级的班主任信息
|
||||
if (deleteResult && !classIdsToUpdate.isEmpty()) {
|
||||
LambdaUpdateWrapper<XgClassMsg> updateWrapper = Wrappers.lambdaUpdate(XgClassMsg.class)
|
||||
.in(XgClassMsg::getId, classIdsToUpdate)
|
||||
.set(XgClassMsg::getClassTeacherId, null)
|
||||
.set(XgClassMsg::getClassTeacherName, null);
|
||||
|
||||
classMsgMapper.update(null, updateWrapper);
|
||||
log.info("已清空{}个班级的班主任信息: classIds={}", classIdsToUpdate.size(), classIdsToUpdate);
|
||||
}
|
||||
|
||||
return deleteResult;
|
||||
}
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
package org.dromara.xg.service.impl;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.xg.domain.XgSysDept;
|
||||
import org.dromara.xg.domain.vo.XgSysDeptVo;
|
||||
import org.dromara.xg.mapper.XgSysDeptMapper;
|
||||
import org.dromara.xg.service.IXgSysDeptService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 部门管理 服务实现
|
||||
*
|
||||
* @author Lion Li
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class XgSysDeptServiceImpl implements IXgSysDeptService {
|
||||
|
||||
private final XgSysDeptMapper deptMapper;
|
||||
|
||||
/**
|
||||
* 查询二级学院列表
|
||||
*
|
||||
* @return 学院列表
|
||||
*/
|
||||
@Override
|
||||
public List<XgSysDeptVo> selectCollegeList() {
|
||||
XgSysDept dept = new XgSysDept();
|
||||
return deptMapper.selectCollegeList(dept);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询学院和专业的树结构
|
||||
*
|
||||
* @return 树结构列表
|
||||
*/
|
||||
@Override
|
||||
public List<XgSysDeptVo> selectCollegeAndMajorTree() {
|
||||
XgSysDept dept = new XgSysDept();
|
||||
List<XgSysDeptVo> depts = deptMapper.selectDeptTreeList(dept);
|
||||
return buildDeptTree(depts);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据学院ID查询专业列表
|
||||
*
|
||||
* @param collegeId 学院ID
|
||||
* @return 专业列表
|
||||
*/
|
||||
@Override
|
||||
public List<XgSysDeptVo> selectMajorListByCollegeId(Long collegeId) {
|
||||
return deptMapper.selectMajorListByCollegeId(collegeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建部门树结构
|
||||
*
|
||||
* @param depts 部门列表
|
||||
* @return 树结构列表
|
||||
*/
|
||||
private List<XgSysDeptVo> buildDeptTree(List<XgSysDeptVo> depts) {
|
||||
List<XgSysDeptVo> returnList = new ArrayList<>();
|
||||
List<Long> tempList = depts.stream().map(XgSysDeptVo::getDeptId).collect(Collectors.toList());
|
||||
for (XgSysDeptVo dept : depts) {
|
||||
// 如果是顶级节点或父节点不在当前列表中,则直接添加
|
||||
if (!tempList.contains(dept.getParentId()) || dept.getParentId().equals(101L)) {
|
||||
recursionFn(depts, dept);
|
||||
returnList.add(dept);
|
||||
}
|
||||
}
|
||||
// 如果是空数组则返回一个空数组,否则可能导致前端JS出错
|
||||
if (returnList.isEmpty()) {
|
||||
returnList = new ArrayList<>();
|
||||
}
|
||||
return returnList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 递归构建部门树
|
||||
*
|
||||
* @param list 部门列表
|
||||
* @param t 当前部门
|
||||
*/
|
||||
private void recursionFn(List<XgSysDeptVo> list, XgSysDeptVo t) {
|
||||
// 得到子节点列表
|
||||
List<XgSysDeptVo> childList = getChildList(list, t);
|
||||
t.setChildren(childList);
|
||||
for (XgSysDeptVo tChild : childList) {
|
||||
if (hasChild(list, tChild)) {
|
||||
recursionFn(list, tChild);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到子节点列表
|
||||
*
|
||||
* @param list 部门列表
|
||||
* @param t 当前部门
|
||||
* @return 子部门列表
|
||||
*/
|
||||
private List<XgSysDeptVo> getChildList(List<XgSysDeptVo> list, XgSysDeptVo t) {
|
||||
List<XgSysDeptVo> tList = new ArrayList<>();
|
||||
for (XgSysDeptVo n : list) {
|
||||
if (n.getParentId().longValue() == t.getDeptId().longValue()) {
|
||||
tList.add(n);
|
||||
}
|
||||
}
|
||||
return tList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否有子节点
|
||||
*
|
||||
* @param list 部门列表
|
||||
* @param t 当前部门
|
||||
* @return 是否有子节点
|
||||
*/
|
||||
private boolean hasChild(List<XgSysDeptVo> list, XgSysDeptVo t) {
|
||||
return getChildList(list, t).size() > 0;
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package org.dromara.xg.service.impl;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.xg.domain.XgSysUser;
|
||||
import org.dromara.xg.mapper.XgSysUserMapper;
|
||||
import org.dromara.xg.service.IXgSysUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统用户信息Service业务层处理
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-24
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class XgSysUserServiceImpl implements IXgSysUserService {
|
||||
|
||||
private final XgSysUserMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询所有有效用户列表
|
||||
*
|
||||
* @return 有效用户列表
|
||||
*/
|
||||
@Override
|
||||
public List<XgSysUser> selectActiveUserList() {
|
||||
return baseMapper.selectActiveUserList();
|
||||
}
|
||||
}
|
||||
+99
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.xg.mapper.XgClassMsgMapper">
|
||||
|
||||
<resultMap id="XgClassMsgResult" type="org.dromara.xg.domain.vo.XgClassMsgVo">
|
||||
<id property="id" column="id"/>
|
||||
<result property="collegeId" column="college_id"/>
|
||||
<result property="collegeName" column="college_name"/>
|
||||
<result property="majorId" column="major_id"/>
|
||||
<result property="majorName" column="major_name"/>
|
||||
<result property="classCode" column="class_code"/>
|
||||
<result property="className" column="class_name"/>
|
||||
<result property="classType" column="class_type"/>
|
||||
<result property="grade" column="grade"/>
|
||||
<result property="enrollmentYear" column="enrollment_year"/>
|
||||
<result property="graduationYear" column="graduation_year"/>
|
||||
<result property="trainingType" column="training_type"/>
|
||||
<result property="degreeType" column="degree_type"/>
|
||||
<result property="counselorId" column="counselor_id"/>
|
||||
<result property="counselorName" column="counselor_name"/>
|
||||
<result property="classTeacherId" column="class_teacher_id"/>
|
||||
<result property="classTeacherName" column="class_teacher_name"/>
|
||||
<result property="classAdvisorId" column="class_advisor_id"/>
|
||||
<result property="classAdvisorName" column="class_advisor_name"/>
|
||||
<result property="classMonitorId" column="class_monitor_id"/>
|
||||
<result property="classMonitorName" column="class_monitor_name"/>
|
||||
<result property="deputyMonitorId" column="deputy_monitor_id"/>
|
||||
<result property="deputyMonitorName" column="deputy_monitor_name"/>
|
||||
<result property="classStatus" column="class_status"/>
|
||||
<result property="isGraduation" column="is_graduation"/>
|
||||
<result property="graduationDate" column="graduation_date"/>
|
||||
<result property="plannedCapacity" column="planned_capacity"/>
|
||||
<result property="currentStudentCount" column="current_student_count"/>
|
||||
<result property="maxStudentCount" column="max_student_count"/>
|
||||
<result property="maleCount" column="male_count"/>
|
||||
<result property="femaleCount" column="female_count"/>
|
||||
<result property="activeCount" column="active_count"/>
|
||||
<result property="transferInCount" column="transfer_in_count"/>
|
||||
<result property="transferOutCount" column="transfer_out_count"/>
|
||||
<result property="dropoutCount" column="dropout_count"/>
|
||||
<result property="graduateCount" column="graduate_count"/>
|
||||
<result property="officeLocation" column="office_location"/>
|
||||
<result property="classLocation" column="class_location"/>
|
||||
<result property="contactPhone" column="contact_phone"/>
|
||||
<result property="qqGroup" column="qq_group"/>
|
||||
<result property="wechatGroup" column="wechat_group"/>
|
||||
<result property="email" column="email"/>
|
||||
<result property="classSchedule" column="class_schedule"/>
|
||||
<result property="classCulture" column="class_culture"/>
|
||||
<result property="classRules" column="class_rules"/>
|
||||
<result property="classDescription" column="class_description"/>
|
||||
<result property="lastCountUpdate" column="last_count_update"/>
|
||||
<result property="extField1" column="ext_field1"/>
|
||||
<result property="extField2" column="ext_field2"/>
|
||||
<result property="extField3" column="ext_field3"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectXgClassMsgVo">
|
||||
select c.id, c.college_id, dc.dept_name as college_name, c.major_id, dm.dept_name as major_name,
|
||||
c.class_code, c.class_name, c.class_type, c.grade, c.enrollment_year, c.graduation_year,
|
||||
c.training_type, c.degree_type, c.counselor_id, c.counselor_name, c.class_teacher_id,
|
||||
c.class_teacher_name, c.class_advisor_id, c.class_advisor_name, c.class_monitor_id,
|
||||
c.class_monitor_name, c.deputy_monitor_id, c.deputy_monitor_name, c.class_status,
|
||||
c.is_graduation, c.graduation_date, c.planned_capacity, c.current_student_count,
|
||||
c.max_student_count, c.male_count, c.female_count, c.active_count, c.transfer_in_count,
|
||||
c.transfer_out_count, c.dropout_count, c.graduate_count, c.office_location,
|
||||
c.class_location, c.contact_phone, c.qq_group, c.wechat_group, c.email,
|
||||
c.class_schedule, c.class_culture, c.class_rules, c.class_description,
|
||||
c.last_count_update, c.ext_field1, c.ext_field2, c.ext_field3, c.remark,
|
||||
c.create_by, c.create_time, c.update_by, c.update_time
|
||||
from xg_class_msg c
|
||||
left join sys_dept dc on c.college_id = dc.dept_id
|
||||
left join sys_dept dm on c.major_id = dm.dept_id
|
||||
where c.deleted = 0
|
||||
</sql>
|
||||
|
||||
<select id="selectVoList" resultMap="XgClassMsgResult">
|
||||
<include refid="selectXgClassMsgVo"/>
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectVoById" parameterType="Long" resultMap="XgClassMsgResult">
|
||||
<include refid="selectXgClassMsgVo"/>
|
||||
and c.id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectVoPage" resultMap="XgClassMsgResult">
|
||||
<include refid="selectXgClassMsgVo"/>
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.xg.mapper.XgSysDeptMapper">
|
||||
|
||||
<resultMap id="SysDeptResult" type="org.dromara.xg.domain.XgSysDept">
|
||||
<id property="deptId" column="dept_id"/>
|
||||
<result property="parentId" column="parent_id"/>
|
||||
<result property="ancestors" column="ancestors"/>
|
||||
<result property="deptName" column="dept_name"/>
|
||||
<result property="orderNum" column="order_num"/>
|
||||
<result property="leader" column="leader"/>
|
||||
<result property="phone" column="phone"/>
|
||||
<result property="email" column="email"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 基础查询方法 -->
|
||||
<select id="selectById" parameterType="java.lang.Long" resultMap="SysDeptResult">
|
||||
select dept_id, parent_id, ancestors, dept_name, order_num, leader, phone, email,
|
||||
status, del_flag, create_by, create_time, update_by, update_time
|
||||
from sys_dept
|
||||
where dept_id = #{deptId} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectCollegeList" parameterType="org.dromara.xg.domain.XgSysDept" resultType="org.dromara.xg.domain.vo.XgSysDeptVo">
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email,
|
||||
d.status, d.del_flag, d.create_by, d.create_time, d.update_by, d.update_time
|
||||
from sys_dept d
|
||||
where d.del_flag = '0' and d.status = '0' and d.parent_id = 101
|
||||
<if test="deptName != null and deptName != ''">
|
||||
AND d.dept_name like concat('%', #{deptName}, '%')
|
||||
</if>
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectMajorListByCollegeId" parameterType="java.lang.Long" resultType="org.dromara.xg.domain.vo.XgSysDeptVo">
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email,
|
||||
d.status, d.del_flag, d.create_by, d.create_time, d.update_by, d.update_time
|
||||
from sys_dept d
|
||||
where d.del_flag = '0' and d.status = '0' and d.parent_id = #{collegeId}
|
||||
order by d.order_num
|
||||
</select>
|
||||
|
||||
<select id="selectDeptTreeList" parameterType="org.dromara.xg.domain.XgSysDept" resultType="org.dromara.xg.domain.vo.XgSysDeptVo">
|
||||
select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email,
|
||||
d.status, d.del_flag, d.create_by, d.create_time, d.update_by, d.update_time
|
||||
from sys_dept d
|
||||
where d.del_flag = '0'
|
||||
and (d.parent_id = 101 or exists (select 1 from sys_dept where del_flag = '0' and parent_id = 101 and dept_id = d.parent_id))
|
||||
<if test="deptName != null and deptName != ''">
|
||||
AND d.dept_name like concat('%', #{deptName}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND d.status = #{status}
|
||||
</if>
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
</mapper>
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.xg.mapper.XgClassTeacherCounselorRelMapper">
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.xg.mapper.XgSysUserMapper">
|
||||
|
||||
<resultMap type="org.dromara.xg.domain.XgSysUser" id="XgSysUserResult">
|
||||
<id property="userId" column="user_id"/>
|
||||
<result property="nickName" column="nick_name"/>
|
||||
<result property="phonenumber" column="phonenumber"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<!-- 查询有效用户列表 -->
|
||||
<select id="selectActiveUserList" resultMap="XgSysUserResult">
|
||||
select user_id, nick_name, phonenumber
|
||||
from sys_user
|
||||
where status = '0' and del_flag = '0'
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,48 @@
|
||||
# 前端代码调整记录
|
||||
|
||||
## 日期:2025-07-03 17:32:46
|
||||
## 开发人员:wuzilong
|
||||
|
||||
### 修改内容:修复班级类型显示问题
|
||||
|
||||
#### 问题描述
|
||||
班级类型的值显示了数字 4,但是没有显示成 "技师"。
|
||||
|
||||
#### 问题原因
|
||||
班级类型 `classType` 在后端可能以字符串形式返回,而前端格式化函数 `formatClassType` 使用数字索引进行映射,导致字符串类型的值(如 "4")无法正确匹配到对应文本。
|
||||
|
||||
#### 修改方案
|
||||
修改 `formatClassType` 函数,确保能够处理字符串和数字类型的值。
|
||||
|
||||
#### 修改文件
|
||||
- `web/src/views/classmsg/classMsg/index.vue`
|
||||
|
||||
#### 代码变更
|
||||
```javascript
|
||||
// 修改前
|
||||
const formatClassType = (value: number) => {
|
||||
const map = {
|
||||
1: '中级工',
|
||||
2: '高级工',
|
||||
3: '预备技师',
|
||||
4: '技师',
|
||||
5: '中高职一体'
|
||||
};
|
||||
return map[value] || value;
|
||||
};
|
||||
|
||||
// 修改后
|
||||
const formatClassType = (value: number | string) => {
|
||||
const map = {
|
||||
'1': '中级工',
|
||||
'2': '高级工',
|
||||
'3': '预备技师',
|
||||
'4': '技师',
|
||||
'5': '中高职一体'
|
||||
};
|
||||
return map[value] || value;
|
||||
};
|
||||
```
|
||||
|
||||
#### 测试验证
|
||||
修改后,班级类型值为 4 或 "4" 都能正确显示为 "技师"。
|
||||
@@ -0,0 +1,74 @@
|
||||
# 班级信息API修改记录
|
||||
|
||||
## 时间:2025-07-03 15:45:32
|
||||
|
||||
## 变更内容
|
||||
|
||||
### 1. 修改查询班级信息接口
|
||||
|
||||
#### 变更描述
|
||||
修改`http://localhost/dev-api/classMsg/classMsg/{id}`接口,确保返回xg_class_msg表的所有字段,并通过关联sys_dept表获取学院名称和专业名称。
|
||||
|
||||
#### 修改文件
|
||||
1. `/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/domain/vo/XgClassMsgVo.java`
|
||||
- 增加了所有xg_class_msg表中的字段
|
||||
- 确保所有字段有适当的注释和ExcelProperty注解
|
||||
|
||||
2. `/backend/ruoyi-modules/ruoyi-xg/src/main/resources/mapper/classmsg/XgClassMsgMapper.xml`
|
||||
- 更新了ResultMap以映射所有字段
|
||||
- 扩展了SQL查询以包含所有字段
|
||||
- 保留了与sys_dept表的关联查询,以获取collegeName和majorName
|
||||
|
||||
#### 变更原因
|
||||
确保API返回班级信息表的完整数据,并通过关联查询获取学院和专业名称,提升前端展示效果和数据完整性。
|
||||
|
||||
#### 测试验证
|
||||
- 接口URL: `http://localhost/dev-api/classMsg/classMsg/1947889099849498626`
|
||||
- 返回状态码: 200
|
||||
- 返回数据包含xg_class_msg表的所有字段
|
||||
- collegeName和majorName字段已正确从sys_dept表获取
|
||||
|
||||
### 2. 修改班级创建功能,同步创建部门
|
||||
|
||||
#### 变更描述
|
||||
修改班级创建功能,使得在创建班级的同时,自动在sys_dept表中创建对应的部门记录,建立班级与部门的关联关系。
|
||||
|
||||
#### 修改文件
|
||||
1. `/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/impl/XgClassMsgServiceImpl.java`
|
||||
- 注入XgSysDeptMapper依赖
|
||||
- 修改insertByBo方法,在班级创建成功后创建部门记录
|
||||
- 设置部门的基本信息,包括名称、父部门、祖级列表、状态等
|
||||
- 设置部门的联系信息和负责人
|
||||
|
||||
#### 变更原因
|
||||
根据业务需求,班级需要同时作为系统中的一个部门单位存在,便于后续权限管理和组织结构展示。
|
||||
|
||||
#### 测试验证
|
||||
- 创建班级后检查sys_dept表是否有对应的部门记录
|
||||
- 验证部门名称是否与班级名称一致
|
||||
- 验证部门的父部门ID是否为班级所属专业ID
|
||||
- 验证部门的祖级列表是否正确构建
|
||||
|
||||
## 时间:2025-07-23 16:12:45
|
||||
|
||||
### 3. 修复XgSysDeptMapper缺少selectById方法映射的问题
|
||||
|
||||
#### 变更描述
|
||||
修复在创建班级时报错"Invalid bound statement (not found): org.dromara.xg.mapper.XgSysDeptMapper.selectById"的问题。在XgSysDeptMapper.xml中添加了selectById方法的SQL映射。
|
||||
|
||||
#### 修改文件
|
||||
1. `/backend/ruoyi-modules/ruoyi-xg/src/main/resources/mapper/sysdept/XgSysDeptMapper.xml`
|
||||
- 添加了SysDeptResult结果映射,包含部门表的所有字段
|
||||
- 添加了selectById方法的SQL映射,用于根据ID查询部门信息
|
||||
- 保留了原有的三个自定义方法映射
|
||||
|
||||
#### 变更原因
|
||||
在班级创建过程中,需要查询父部门(专业)信息以构建部门的祖级列表,但XgSysDeptMapper的XML文件中缺少selectById方法的映射,导致MyBatis无法找到对应的SQL语句。
|
||||
|
||||
#### 技术分析
|
||||
XgSysDeptMapper接口继承了BaseMapperPlus,应该继承了MyBatis-Plus的基础方法,但在XML中没有对应的映射。通常MyBatis-Plus会自动提供这些基础方法的实现,但在本项目中可能需要显式定义这些方法的SQL映射。
|
||||
|
||||
#### 测试验证
|
||||
- 重新测试创建班级功能,验证不再报错
|
||||
- 确认班级创建的同时,能够成功创建对应的部门记录
|
||||
- 验证部门的祖级列表是否正确构建
|
||||
@@ -1,64 +1,44 @@
|
||||
# 代码调整记录(2025-07-15 cursor)
|
||||
# 班级管理-班主任和辅导员设置功能优化记录
|
||||
|
||||
## 变更时间
|
||||
2025-07-15 20:00:00
|
||||
|
||||
## 变更人
|
||||
cursor
|
||||
**日期**: 2025-07-15 11:30:25
|
||||
**操作人**: Cursor AI
|
||||
**变更类型**: 功能优化
|
||||
|
||||
## 变更内容
|
||||
- 【满意度调查-问卷管理】新增弹窗时,问卷编号(surveyCode)自动生成唯一值并填入表单,无需手动输入。
|
||||
- 生成规则:编号格式为 `SAT-YYYYMMDD-xxxxxx`,其中 `xxxxxx` 为基于时间和随机数的唯一字符串。
|
||||
- 主要代码位置:`web/src/views/hq/satSurvey/index.vue`,`handleAdd` 方法。
|
||||
- 复用工具:`@/utils/index` 的 `createUniqueString`。
|
||||
|
||||
## 规范说明
|
||||
- 遵循前端开发规范,自动生成唯一编号,提升用户体验,避免重复。
|
||||
- 变更已同步记录至本文件,符合项目文档同步要求。
|
||||
1. **API接口添加**:
|
||||
- 创建 `web/src/api/xg/sysUser.ts` 文件,新增 `getActiveUserList` 接口,用于调用后端 `/xg/sysUser/activeList` 接口获取有效用户列表。
|
||||
|
||||
---
|
||||
2. **班级管理页面功能优化**:
|
||||
- 将"设置班主任"和"设置辅导员"弹窗中的用户数据来源从模拟数据改为通过API获取真实数据
|
||||
- 调整下拉框中用户信息的展示格式为: `nick_name(user_id)(phonenumber)`
|
||||
- 优化用户搜索功能,支持按姓名、用户ID和电话号码搜索
|
||||
- 添加电话号码为空时的兼容处理,显示为"-"
|
||||
- 将模拟提交更新为真实API调用
|
||||
|
||||
## 变更时间
|
||||
2025-07-15 14:30:00
|
||||
## 涉及文件
|
||||
|
||||
## 变更人
|
||||
cursor
|
||||
1. **新增文件**:
|
||||
- `web/src/api/xg/sysUser.ts` - 学工模块用户API接口
|
||||
|
||||
## 变更内容
|
||||
- 【满意度调查-题库管理】新增API查询所有题目分类(包括已逻辑删除的),解决题目列表显示已删除分类的问题。
|
||||
- 后端:`HqSatCategoryController`添加`/listAllIncludeDeleted`接口,`IHqSatCategoryService`添加`queryListWithDeleted`方法
|
||||
- 前端:`api/hq/satCategory/index.ts`添加`listAllSatCategory`方法,`views/hq/satQuestion/index.vue`修改`getAllCategoryList`
|
||||
- 技术实现:通过SQL条件`last("AND 1=1")`忽略MyBatis-Plus自动添加的逻辑删除条件,实现查询所有数据(包括已删除)
|
||||
2. **修改文件**:
|
||||
- `web/src/views/classmsg/classMsg/index.vue` - 班级管理页面
|
||||
|
||||
## 规范说明
|
||||
- 遵循后端开发规范,保留原有接口功能,新增接口处理特殊需求
|
||||
- 逻辑删除规范:系统中所有删除为逻辑删除,但特殊场景需要查询所有数据时,通过专门接口实现
|
||||
- 变更已同步记录至本文件,符合项目文档同步要求
|
||||
## 功能说明
|
||||
|
||||
## 相关文档
|
||||
- **API文档**: `docs/开发文档/API/后勤满意度调查API.md`
|
||||
- **数据库设计**: `docs/设计文档/database/满意度调查模块表设计.sql`
|
||||
本次优化主要是提升用户在设置班主任和辅导员时的体验,改进了以下几点:
|
||||
|
||||
---
|
||||
1. **数据真实性**:从使用模拟数据改为调用后端接口获取真实用户数据
|
||||
2. **信息展示**:在下拉框中展示更完整的用户信息(姓名、ID、电话)
|
||||
3. **搜索功能**:增强搜索功能,支持多字段搜索
|
||||
4. **提交功能**:修改为真实API调用,确保数据能正确保存
|
||||
|
||||
## 变更时间
|
||||
2025-07-15 16:00:00
|
||||
## 后续计划
|
||||
|
||||
## 变更人
|
||||
cursor
|
||||
1. 进一步优化用户搜索体验,考虑添加按部门过滤功能
|
||||
2. 优化页面响应速度,考虑添加数据缓存
|
||||
3. 添加用户选择记忆功能,便于快速重复选择同一用户
|
||||
|
||||
## 变更内容
|
||||
- 【满意度调查-题库管理】修复查询所有题目分类接口SQL语法错误问题
|
||||
- 错误原因:使用MyBatis-Plus的`last("AND 1=1")`方法导致生成的SQL语法错误
|
||||
```sql
|
||||
SELECT ... FROM hq_sat_category WHERE deleted=0 ORDER BY id ASC AND 1=1
|
||||
```
|
||||
- 修复方案:改用更可靠的Java Stream API方式处理数据
|
||||
1. 使用`baseMapper.selectByMap(null)`获取所有记录
|
||||
2. 通过Stream流式处理,手动实现过滤、转换和排序
|
||||
3. 不再依赖SQL语法,避免复杂的SQL拼接问题
|
||||
## 备注
|
||||
|
||||
## 规范说明
|
||||
- 遵循异常处理规范,通过代码调整解决生产环境中出现的问题
|
||||
- 使用函数式编程,提高代码可读性和可维护性
|
||||
- 变更已同步记录至本文件,符合项目文档同步要求
|
||||
此次优化基于后端已有的 `/xg/sysUser/activeList` 接口,确保前后端数据交互的一致性和准确性。
|
||||
@@ -0,0 +1,317 @@
|
||||
# 代码调整记录
|
||||
|
||||
## 2025-07-23 14:30:00 - 修复XgSysDept实体类表名配置
|
||||
|
||||
### 修复问题
|
||||
|
||||
#### 问题描述
|
||||
在班级信息管理模块中,`XgClassMsgServiceImpl.insertByBo()` 方法中插入部门信息时报错,系统尝试向 `hzdyjs_xg.xg_sys_dept` 表插入数据,但实际上正确的表名应该是 `hzdyjs_xg.sys_dept`。
|
||||
|
||||
#### 问题原因
|
||||
`XgSysDept` 实体类没有添加 `@TableName` 注解来明确指定表名,导致MyBatis-Plus默认按照类名生成表名(类名为 `XgSysDept`,生成的表名为 `xg_sys_dept`)。
|
||||
|
||||
#### 解决方案
|
||||
在 `XgSysDept` 实体类上添加 `@TableName("sys_dept")` 注解,指定正确的数据库表名。
|
||||
|
||||
```java
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@TableName("sys_dept")
|
||||
public class XgSysDept extends BaseEntity {
|
||||
// 类定义内容
|
||||
}
|
||||
```
|
||||
|
||||
### 修改文件
|
||||
- `/Users/wuzilong/work/00code/hzdyjs_xg/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/domain/XgSysDept.java`
|
||||
|
||||
### 测试验证
|
||||
- [x] 重新构建项目,确认编译通过
|
||||
- [x] 测试班级创建功能,确认部门信息成功插入到 `sys_dept` 表
|
||||
|
||||
### 经验教训与最佳实践
|
||||
1. 所有实体类应该明确使用 `@TableName` 注解指定表名,即使表名遵循了默认命名规则
|
||||
2. 跨模块使用表时(如 `xg` 模块使用 `system` 模块的表),尤其需要注意正确指定表名
|
||||
3. 命名规范:尽量保持类名与表名的对应关系,避免混淆
|
||||
|
||||
### 后续优化建议
|
||||
- 考虑将系统表的操作封装在原模块中,通过服务调用而非直接数据库操作来管理数据
|
||||
- 完善单元测试,覆盖跨模块表操作的场景
|
||||
|
||||
## 2025-07-23 16:15:20 - 修改班级信息时同步更新部门表数据
|
||||
|
||||
### 修复问题
|
||||
|
||||
#### 问题描述
|
||||
在班级信息管理模块中,使用`XgClassMsgServiceImpl.updateByBo()`方法修改班级信息时,只更新了班级表(`xg_class_msg`)中的数据,没有同步更新系统部门表(`sys_dept`)中对应的部门信息,导致班级信息与部门信息不一致。
|
||||
|
||||
#### 问题原因
|
||||
`updateByBo()`方法原先的实现只关注了`xg_class_msg`表的更新,而忽略了在创建班级时同时创建的部门信息的维护。当班级信息(如班级名称、负责人、联系方式等)发生变化时,应同步更新对应的部门信息。
|
||||
|
||||
#### 解决方案
|
||||
修改`XgClassMsgServiceImpl.updateByBo()`方法,在更新班级信息成功后,同步更新`sys_dept`表中对应的部门信息:
|
||||
|
||||
1. 使用班级ID查询对应的部门信息
|
||||
2. 如果部门存在,则更新部门信息:
|
||||
- 更新部门名称为班级名称
|
||||
- 如果专业(父部门)发生变化,更新部门的父部门ID和祖级列表
|
||||
- 更新部门的联系电话和邮箱
|
||||
- 更新部门负责人为班主任
|
||||
3. 如果部门不存在(异常情况),则创建新的部门记录
|
||||
|
||||
```java
|
||||
@Override
|
||||
public Boolean updateByBo(XgClassMsgBo bo) {
|
||||
XgClassMsg update = MapstructUtils.convert(bo, XgClassMsg.class);
|
||||
validEntityBeforeSave(update);
|
||||
boolean result = baseMapper.updateById(update) > 0;
|
||||
|
||||
// 更新成功后,同步更新部门表信息
|
||||
if (result) {
|
||||
// 查询部门信息
|
||||
XgSysDept dept = deptMapper.selectById(update.getId());
|
||||
if (dept != null) {
|
||||
// 更新部门基本信息
|
||||
dept.setDeptName(update.getClassName()); // 使用班级名称作为部门名称
|
||||
|
||||
// 如果班级的父部门(专业)发生变化,需要更新祖级列表
|
||||
if (!dept.getParentId().equals(update.getMajorId())) {
|
||||
dept.setParentId(update.getMajorId()); // 设置新的父部门ID
|
||||
|
||||
// 查询父部门信息,构建新的祖级列表
|
||||
XgSysDept parentDept = deptMapper.selectById(update.getMajorId());
|
||||
if (parentDept != null) {
|
||||
dept.setAncestors(parentDept.getAncestors() + "," + parentDept.getDeptId());
|
||||
}
|
||||
}
|
||||
|
||||
// 更新联系信息
|
||||
dept.setPhone(update.getContactPhone());
|
||||
dept.setEmail(update.getEmail());
|
||||
|
||||
// 更新负责人(班主任)
|
||||
if (update.getClassTeacherId() != null && StringUtils.isNotEmpty(update.getClassTeacherName())) {
|
||||
dept.setLeader(update.getClassTeacherName());
|
||||
}
|
||||
|
||||
// 更新部门表
|
||||
deptMapper.updateById(dept);
|
||||
log.info("成功更新班级对应的部门信息,班级ID:{},部门ID:{}", update.getId(), dept.getDeptId());
|
||||
} else {
|
||||
// 如果部门不存在,则创建新的部门记录
|
||||
// 处理异常情况的代码...
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
```
|
||||
|
||||
### 修改文件
|
||||
- `/Users/wuzilong/work/00code/hzdyjs_xg/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/impl/XgClassMsgServiceImpl.java`
|
||||
|
||||
### 测试验证
|
||||
- [x] 修改班级名称,验证对应部门名称是否同步更新
|
||||
- [x] 修改班级所属专业,验证部门的父部门ID和祖级列表是否正确更新
|
||||
- [x] 修改班主任信息,验证部门负责人是否同步更新
|
||||
- [x] 修改班级联系方式,验证部门联系电话和邮箱是否同步更新
|
||||
- [x] 测试边界情况:当班级存在但对应部门不存在时,是否正确创建部门信息
|
||||
|
||||
### 经验教训与最佳实践
|
||||
1. 在涉及多表关联的业务逻辑中,修改主表数据时应考虑同步更新关联表数据
|
||||
2. 对于班级-部门这类一一对应的数据,应保持其信息的一致性
|
||||
3. 在更新关联表数据时,需要特别注意树形结构数据(如部门的祖级列表)的正确维护
|
||||
4. 使用日志记录重要操作,便于问题排查
|
||||
|
||||
### 后续优化建议
|
||||
- 考虑将班级-部门的同步逻辑封装到单独的方法中,提高代码复用性
|
||||
- 在业务层面明确规定班级表与部门表的关联关系,避免数据不一致
|
||||
- 对班级-部门同步逻辑添加单元测试,确保逻辑的正确性和稳定性
|
||||
|
||||
## 2025-07-23 16:35:10 - 修复XgSysDept类中leader字段类型
|
||||
|
||||
### 修复问题
|
||||
|
||||
#### 问题描述
|
||||
在修改班级信息同步更新部门表时发现,`XgSysDept`类中的`leader`字段类型为`String`,而实际数据库表`sys_dept`中对应的字段类型为`bigint(20)`。在系统标准实现中,`SysDept`类的`leader`字段类型为`Long`,与数据库类型对应,导致无法正确保存班主任ID信息。
|
||||
|
||||
#### 问题原因
|
||||
`XgSysDept`类的定义与标准`SysDept`类不一致,可能是在创建类时误将`leader`字段定义为`String`类型。实际上,`leader`字段应该存储的是用户的ID(`Long`类型),而不是姓名(`String`类型)。
|
||||
|
||||
#### 解决方案
|
||||
修改`XgSysDept`类中`leader`字段的类型,从`String`改为`Long`,与标准`SysDept`类保持一致。
|
||||
|
||||
```java
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private Long leader;
|
||||
```
|
||||
|
||||
### 修改文件
|
||||
- `/Users/wuzilong/work/00code/hzdyjs_xg/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/domain/XgSysDept.java`
|
||||
|
||||
### 测试验证
|
||||
- [x] 确认XgSysDept类能够正确编译
|
||||
- [x] 验证修改班级信息时,能够正确同步更新部门表中的负责人ID
|
||||
- [x] 检查数据库中班级对应的部门记录,确认leader字段值为班主任的用户ID
|
||||
|
||||
### 经验教训与最佳实践
|
||||
1. 创建实体类时,应确保字段类型与数据库表定义一致
|
||||
2. 使用跨模块的数据库表时,应参考原模块的实体类定义,确保字段定义一致
|
||||
3. 关联字段(如leader对应用户ID)应使用对应的数据类型(Long),而不是展示值的类型(String)
|
||||
|
||||
### 后续优化建议
|
||||
- 考虑使用代码生成工具生成实体类,确保字段类型与数据库一致
|
||||
- 添加字段校验逻辑,确保插入数据库前数据类型正确
|
||||
- 统一各模块中对同一数据库表的实体类定义,避免不一致
|
||||
|
||||
## 2025-07-23 16:45:30 - 修复班级删除时未同步删除部门的问题
|
||||
|
||||
### 修复问题
|
||||
|
||||
#### 问题描述
|
||||
在班级信息管理模块中,使用`XgClassMsgServiceImpl.deleteWithValidByIds()`方法删除班级信息时,只删除了班级表(`xg_class_msg`)中的数据,没有同步标记系统部门表(`sys_dept`)中对应的部门记录为删除状态,导致部门信息残留。
|
||||
|
||||
#### 问题原因
|
||||
`deleteWithValidByIds()`方法原先的实现只关注了`xg_class_msg`表的删除,而忽略了在班级删除时同步处理部门信息。这导致班级被删除后,对应的部门记录仍然存在于系统中。
|
||||
|
||||
#### 解决方案
|
||||
修改`XgClassMsgServiceImpl.deleteWithValidByIds()`方法,在删除班级信息之前,先将对应的部门记录标记为删除状态:
|
||||
|
||||
```java
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
|
||||
// 删除班级的同时,标记对应的部门为删除状态
|
||||
for (Long id : ids) {
|
||||
XgSysDept dept = deptMapper.selectById(id);
|
||||
if (dept != null) {
|
||||
dept.setDelFlag("1"); // 设置删除标志(1代表删除)
|
||||
deptMapper.updateById(dept);
|
||||
log.info("成功标记班级对应的部门为删除状态,班级ID:{},部门ID:{}", id, dept.getDeptId());
|
||||
}
|
||||
}
|
||||
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
```
|
||||
|
||||
### 修改文件
|
||||
- `/Users/wuzilong/work/00code/hzdyjs_xg/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/impl/XgClassMsgServiceImpl.java`
|
||||
|
||||
### 测试验证
|
||||
- [x] 删除班级信息,验证对应的部门记录是否被标记为删除状态
|
||||
- [x] 检查系统部门树中,确认已删除班级对应的部门不再显示
|
||||
- [x] 测试批量删除多个班级,确认所有对应的部门都被正确标记为删除状态
|
||||
|
||||
### 经验教训与最佳实践
|
||||
1. 在涉及多表关联的业务逻辑中,删除主表数据时应考虑同步处理关联表数据
|
||||
2. 使用逻辑删除而非物理删除,保留数据完整性和可恢复性
|
||||
3. 同步操作应添加日志记录,便于问题排查
|
||||
|
||||
### 后续优化建议
|
||||
- 考虑使用事务确保班级删除和部门标记删除的原子性
|
||||
- 完善校验逻辑,检查部门是否有关联的用户、角色等数据,避免删除带来的数据不一致
|
||||
- 添加数据恢复功能,支持恢复误删的班级及其对应的部门信息
|
||||
|
||||
## 2025-07-23 16:55:15 - 为班级信息管理相关方法添加事务注解
|
||||
|
||||
### 优化内容
|
||||
|
||||
#### 优化描述
|
||||
为`XgClassMsgServiceImpl`类的`insertByBo`、`updateByBo`和`deleteWithValidByIds`方法添加`@Transactional`事务注解,确保班级信息和部门信息的同步操作在一个事务中执行,保证数据一致性。
|
||||
|
||||
#### 优化原因
|
||||
班级信息管理涉及班级表(`xg_class_msg`)和部门表(`sys_dept`)的同步操作,需要确保这些操作要么全部成功,要么全部失败,避免出现班级信息与部门信息不一致的情况。
|
||||
|
||||
#### 实现方案
|
||||
在相关方法上添加`@Transactional(rollbackFor = Exception.class)`注解,指定任何异常都会触发事务回滚:
|
||||
|
||||
```java
|
||||
/**
|
||||
* 新增班级信息-新版
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertByBo(XgClassMsgBo bo) {
|
||||
// 方法实现...
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改班级信息-新版
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean updateByBo(XgClassMsgBo bo) {
|
||||
// 方法实现...
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除班级信息-新版信息
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
// 方法实现...
|
||||
}
|
||||
```
|
||||
|
||||
### 修改文件
|
||||
- `/Users/wuzilong/work/00code/hzdyjs_xg/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/impl/XgClassMsgServiceImpl.java`
|
||||
|
||||
### 测试验证
|
||||
- [x] 新增班级时,如果部门信息创建失败,验证班级信息是否也回滚
|
||||
- [x] 修改班级时,如果部门信息更新失败,验证班级信息是否也回滚
|
||||
- [x] 删除班级时,如果部门标记删除失败,验证班级信息是否也回滚
|
||||
|
||||
### 最佳实践
|
||||
1. 在涉及多表操作的业务方法上使用`@Transactional`注解
|
||||
2. 指定`rollbackFor = Exception.class`确保任何异常都触发回滚
|
||||
3. 确保事务覆盖所有需要保持一致性的数据库操作
|
||||
|
||||
### 后续优化建议
|
||||
- 考虑调整事务隔离级别,根据具体业务需求选择合适的隔离级别
|
||||
- 监控事务执行情况,确保事务不会因为执行时间过长而影响系统性能
|
||||
- 针对事务操作添加专门的单元测试,验证事务回滚功能
|
||||
|
||||
# 班级信息模块代码变更记录
|
||||
|
||||
## 修复时间:2025-07-23 16:45:30
|
||||
|
||||
### 修复问题:XgSysDeptMapper updateById方法未找到导致的班级信息删除错误
|
||||
|
||||
#### 错误信息
|
||||
|
||||
```
|
||||
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): org.dromara.xg.mapper.XgSysDeptMapper.updateById
|
||||
```
|
||||
|
||||
#### 问题分析
|
||||
|
||||
在 `XgClassMsgServiceImpl` 类的 `deleteWithValidByIds` 方法中,通过 `deptMapper.updateById(dept)` 调用来更新部门信息的删除标志,但是由于 `XgSysDeptMapper` 接口继承的是 `BaseMapperPlus<XgSysDept, XgSysDeptVo>` 而不是直接的 `BaseMapper<XgSysDept>`,虽然 `BaseMapperPlus` 也继承了 `BaseMapper`,但是可能由于MyBatis的配置问题,找不到 `updateById` 方法的实现。
|
||||
|
||||
#### 解决方案
|
||||
|
||||
使用 `update` 方法配合 `LambdaQueryWrapper` 替代 `updateById` 方法,具体如下:
|
||||
|
||||
1. 将 `deptMapper.updateById(dept)` 替换为:
|
||||
```java
|
||||
LambdaQueryWrapper<XgSysDept> deleteUpdateWrapper = Wrappers.lambdaQuery();
|
||||
deleteUpdateWrapper.eq(XgSysDept::getDeptId, dept.getDeptId());
|
||||
deptMapper.update(dept, deleteUpdateWrapper);
|
||||
```
|
||||
|
||||
2. 同时修复了 `updateByBo` 方法中类似的问题。
|
||||
|
||||
#### 修改文件
|
||||
|
||||
- `/Users/wuzilong/work/00code/hzdyjs_xg/backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/impl/XgClassMsgServiceImpl.java`
|
||||
|
||||
#### 修改人员
|
||||
|
||||
- wuzilong
|
||||
@@ -0,0 +1,30 @@
|
||||
# 代码调整记录 2025-07-24
|
||||
|
||||
## 修复班主任关联表结束日期未更新问题
|
||||
|
||||
### 问题描述
|
||||
在班级班主任辅导员关联管理模块中,班主任变更时应设置原记录的结束日期,但发现使用LambdaUpdateWrapper方式更新时结束日期字段(end_date)未能正确写入数据库。
|
||||
|
||||
### 问题分析
|
||||
问题出现在XgClassTeacherCounselorRelServiceImpl.java的updateByBo方法中,使用LambdaUpdateWrapper更新end_date字段时未能正确映射到数据库。这可能与MyBatis-Plus自动查询时不包含继承字段、VO类字段映射等问题有关。
|
||||
|
||||
### 解决方案
|
||||
将原来使用Lambda表达式批量更新的方式改为先查询出需要更新的记录,然后逐个设置结束日期并调用updateById方法更新,确保字段能正确映射到数据库。
|
||||
|
||||
### 代码修改
|
||||
1. 修改文件:`backend/ruoyi-modules/ruoyi-xg/src/main/java/org/dromara/xg/service/impl/XgClassTeacherCounselorRelServiceImpl.java`
|
||||
2. 修改方法:`updateByBo`
|
||||
3. 具体变更:
|
||||
- 使用LambdaQueryWrapper先查询出符合条件的记录
|
||||
- 对查询出的记录逐一设置deleted=1和endDate为当前日期
|
||||
- 调用updateById方法更新每条记录
|
||||
- 添加日志记录更新结果
|
||||
|
||||
### 测试验证
|
||||
已验证修改后能正确设置结束日期,并在数据库中正确保存。
|
||||
|
||||
### 变更时间
|
||||
2025-07-24 15:30:24
|
||||
|
||||
### 变更人
|
||||
zlwu
|
||||
@@ -0,0 +1,105 @@
|
||||
# 班级班主任辅导员关联表设计及实现记录
|
||||
|
||||
**变更时间**: 2025-07-25 14:35:00
|
||||
|
||||
**变更人**: Cursor AI
|
||||
|
||||
**变更类型**: 数据库表设计
|
||||
|
||||
## 变更摘要
|
||||
|
||||
根据项目需求,设计了班级班主任辅导员关联表(`xg_class_teacher_counselor_rel`),用于记录班级与班主任、辅导员的关联历史,支持历史变更和统计分析。
|
||||
|
||||
## 设计背景
|
||||
|
||||
现有系统中的班级信息表(`xg_class_msg`)只记录了当前的班主任和辅导员信息,无法满足以下业务需求:
|
||||
|
||||
1. 记录班主任和辅导员的完整任职历史
|
||||
2. 追踪班主任和辅导员的变更情况(任命、调动、辞职等)
|
||||
3. 统计分析教师任职情况和工作表现
|
||||
4. 支持临时代理等特殊情况的记录
|
||||
|
||||
## 设计方案
|
||||
|
||||
### 1. 数据表设计
|
||||
|
||||
创建新表`xg_class_teacher_counselor_rel`,包含以下核心字段组:
|
||||
|
||||
- **基础字段**: 符合项目规范的标准字段(id, tenant_id, create_by等)
|
||||
- **关联信息**: 班级ID、班级代码、班级名称
|
||||
- **教师信息**: 教师ID、教师姓名、教师类型(班主任/辅导员/导师)
|
||||
- **任职信息**: 任职状态、开始日期、结束日期、是否当前任职
|
||||
- **变更信息**: 变更原因、变更类型、变更操作人、变更时间
|
||||
- **其他信息**: 工作内容、工作表现、工作总结、备注
|
||||
|
||||
### 2. 索引设计
|
||||
|
||||
针对常见查询场景设计了合理的索引:
|
||||
|
||||
- 单字段索引:tenant_id, deleted, class_id, teacher_id, teacher_type等
|
||||
- 复合索引:(class_id, teacher_type, is_current) - 支持查询某班级当前的特定类型教师
|
||||
|
||||
### 3. 业务规则
|
||||
|
||||
1. **唯一性规则**: 同一班级同一时间同一类型只能有一名当前任职教师
|
||||
2. **时间连续性**: 同一教师对同一班级的连续任职记录需保持时间连续
|
||||
3. **状态管理**: 当新任教师被任命时,原任教师自动结束任期
|
||||
4. **双向关联**: 既可以查询教师负责的班级,也可以查询班级的历任教师
|
||||
|
||||
## 实现细节
|
||||
|
||||
### 1. 数据表创建
|
||||
|
||||
已创建数据表SQL文件:`docs/设计文档/database/学工管理-宿舍管理/xg_class_teacher_counselor_rel 班级班主任辅导员关联表.sql`
|
||||
|
||||
表设计符合项目数据库设计规范:
|
||||
- 使用雪花ID作为主键
|
||||
- 包含完整的租户和审计字段
|
||||
- 使用逻辑删除
|
||||
- 合理的字段命名和注释
|
||||
|
||||
### 2. 数据迁移计划
|
||||
|
||||
1. **初始化数据**: 从`xg_class_msg`表抽取当前班主任和辅导员信息,创建初始记录
|
||||
2. **设置is_current**: 所有初始记录设置为当前任职(is_current=1)
|
||||
3. **起始时间**: 对于缺少明确起始时间的记录,使用班级创建时间作为默认起始时间
|
||||
|
||||
### 3. 变更处理流程
|
||||
|
||||
1. **教师任命**: 创建新记录,设置为当前任职,原任教师自动结束任期
|
||||
2. **教师离职**: 更新end_date和is_current,无需添加新记录
|
||||
3. **教师调动**: 结束原班级任期,创建新班级任职记录
|
||||
4. **临时代理**: 创建临时代理记录,结束后恢复原任教师状态
|
||||
|
||||
### 4. 关键业务方法
|
||||
|
||||
待开发的核心业务方法:
|
||||
|
||||
```java
|
||||
// 获取班级当前教师
|
||||
getCurrentTeacher(Long classId, String teacherType)
|
||||
|
||||
// 获取班级历任教师
|
||||
getHistoryTeachers(Long classId, String teacherType)
|
||||
|
||||
// 获取教师负责的班级
|
||||
getTeacherClasses(Long teacherId, String teacherType, boolean onlyCurrent)
|
||||
|
||||
// 教师任命
|
||||
appointTeacher(Long classId, Long teacherId, String teacherType, String reason)
|
||||
|
||||
// 教师离任
|
||||
dismissTeacher(Long relationId, String reason, Date endDate)
|
||||
```
|
||||
|
||||
## 下一步计划
|
||||
|
||||
1. 创建相关实体类、服务接口和实现类
|
||||
2. 开发相关控制器和API接口
|
||||
3. 实现前端管理界面
|
||||
4. 开发数据统计和分析功能
|
||||
5. 添加相关权限控制
|
||||
|
||||
## 变更影响
|
||||
|
||||
本次变更是对现有班级管理功能的扩展,不影响现有功能,但提供了更丰富的历史记录和管理能力,满足学校对班级管理的高级需求。
|
||||
+27
-71
@@ -1,88 +1,44 @@
|
||||
# API文档总览
|
||||
|
||||
<<<<<<< HEAD
|
||||
本文档作为所有API文档的总入口,提供快速导航功能。
|
||||
|
||||
## 基础规范
|
||||
## 核心模块API
|
||||
|
||||
- [API文档基础规范](./API文档基础规范.md)
|
||||
|
||||
## 认证登录
|
||||
|
||||
- [用户认证登录API](./用户认证登录API.md)
|
||||
|
||||
## 后勤管理
|
||||
## 学工管理模块API
|
||||
|
||||
- [学生信息管理API](./学生信息管理API.md)
|
||||
- [班级信息管理API](./班级信息管理API.md)
|
||||
- [宿舍管理API](./宿舍管理API.md)
|
||||
|
||||
## 后勤管理模块API
|
||||
|
||||
- [物业报修管理API](./物业报修管理API.md)
|
||||
- [后勤满意度调查API](./后勤满意度调查API.md)
|
||||
- [场地预约管理API](./场地预约管理API.md)
|
||||
- [报告厅预约审核API](./报告厅预约审核API.md)
|
||||
- [后勤满意度调查API](./后勤满意度调查API.md)
|
||||
|
||||
## 招生迎新
|
||||
## 工作流模块API
|
||||
|
||||
- [招生统计API](./招生统计API.md)
|
||||
- [请假工作流API](./请假工作流API.md)
|
||||
|
||||
## 学工管理
|
||||
## 班级信息管理API
|
||||
- [班级信息管理API](班级信息管理API.md):包含班级基本信息的增删改查接口
|
||||
- **重要更新(2025-07-03)**: 新增班级时会自动在sys_dept表中创建对应部门记录
|
||||
- 支持按学院、专业、年级等条件查询班级
|
||||
- 提供班级详情查询和统计接口
|
||||
|
||||
- [班干部管理API](./班干部管理API.md)
|
||||
**核心功能**:
|
||||
- 班级信息分页查询(支持多条件搜索)
|
||||
- 班级信息新增、修改、删除
|
||||
- 班级信息导出
|
||||
- 学院专业级联查询(通过关联sys_dept表获取学院名称和专业名称)
|
||||
|
||||
## 开发工具
|
||||
**API基础路径**: `/classMsg/classMsg`
|
||||
|
||||
- [API文档模板](./API文档模板.md)
|
||||
=======
|
||||
本文件作为API文档的统一导航入口,提供项目中所有API文档的快速访问链接。
|
||||
**最新更新**:
|
||||
- 2025-07-23: 修复新增班级时出现的"Invalid bound statement (not found): org.dromara.xg.mapper.XgSysDeptMapper.selectById"错误,在XgSysDeptMapper.xml中添加selectById方法的SQL映射
|
||||
- 2025-07-03: 修复前端班级类型(classType)和班级状态(classStatus)的数据类型处理,确保同时支持字符串和数字类型值的正确显示
|
||||
- 2025-07-03: 优化接口返回班级信息表的所有字段,增强数据完整性;通过关联sys_dept表获取collegeName和majorName字段,减少前端接口调用
|
||||
|
||||
## 认证登录
|
||||
|
||||
- [用户认证登录API](./用户认证登录API.md) - 用户登录、获取用户信息等接口
|
||||
|
||||
## 学工管理模块
|
||||
- [班干部管理API](班干部管理API.md)
|
||||
- [宿舍管理员授权API](宿舍管理员授权API.md)
|
||||
- [宿舍楼树形结构API](宿舍楼树形结构API.md) - 校区-宿舍区-宿舍楼三级树形结构数据 (旧版API,路径: `/sslxx/dormBuilding/buildingTree`)
|
||||
|
||||
## 宿舍管理相关API
|
||||
|
||||
| API文档名称 | 说明 | 路径 |
|
||||
| ---------- | ---- | ---- |
|
||||
| [宿舍房间管理API](./宿舍房间管理API.md) | 提供宿舍楼树形结构API | `/xgss/dormBuildingTree/list` |
|
||||
| [宿舍房间管理API](./宿舍房间管理API.md) | 提供宿舍楼列表查询API | `/sslxx/dormBuilding/list` |
|
||||
|
||||
## 后勤管理
|
||||
|
||||
### 场地管理
|
||||
|
||||
- [场地预约管理API](./场地预约管理API.md) - 场地信息管理、预约申请管理接口
|
||||
- [报告厅预约审核API](./报告厅预约审核API.md) - 报告厅信息管理、预约审核接口
|
||||
|
||||
### 物业管理
|
||||
|
||||
- [物业报修管理API](./物业报修管理API.md) - 报修工单管理、维修处理接口
|
||||
|
||||
### 满意度调查
|
||||
|
||||
- [后勤满意度调查API](./后勤满意度调查API.md) - 问卷设计、答题管理接口
|
||||
|
||||
## 工作流管理
|
||||
|
||||
- [请假流程API](./请假流程API.md) - 请假申请、审批管理接口
|
||||
|
||||
## 系统管理
|
||||
|
||||
- [菜单权限API](./菜单权限API.md) - 菜单配置、权限管理接口
|
||||
- [用户管理API](./用户管理API.md) - 系统用户、角色、部门管理接口
|
||||
|
||||
## API基础规范
|
||||
|
||||
- [API文档基础规范](./API文档基础规范.md) - API接口设计规范、响应格式规范
|
||||
|
||||
## 更新记录
|
||||
|
||||
- 2025-07-23:修复宿舍楼列表接口floors字段为null的问题,更新宿舍房间管理API文档
|
||||
- 2025-07-03:更新宿舍房间管理API,增强多角色权限支持
|
||||
- 2025-07-20:新增宿舍楼树形结构API文档
|
||||
- 2025-07-20:新增宿舍管理员授权API文档
|
||||
- 2025-07-15:新增场地预约管理API文档
|
||||
- 2025-07-10:新增物业报修管理API文档
|
||||
- 2025-07-01:重组API文档结构,创建统一导航入口
|
||||
>>>>>>> 8e84da4ed45dd1d711c4a797a4f26f637012f6a9
|
||||
**详细文档**: [班级信息管理API.md](./班级信息管理API.md)
|
||||
@@ -0,0 +1,313 @@
|
||||
# 班级信息管理API文档
|
||||
|
||||
## 基本信息
|
||||
|
||||
- **模块名称**: 班级信息管理
|
||||
- **接口前缀**: /classMsg
|
||||
- **权限前缀**: classMsg:classMsg:
|
||||
|
||||
## API接口列表
|
||||
|
||||
### 1. 班级信息查询接口
|
||||
|
||||
#### 1.1 获取班级信息列表
|
||||
|
||||
- **接口URL**: `/classMsg/classMsg/list`
|
||||
- **请求方式**: GET
|
||||
- **权限标识**: `classMsg:classMsg:list`
|
||||
- **请求参数**:
|
||||
|
||||
| 参数名 | 类型 | 是否必须 | 描述 |
|
||||
| -------- | ------ | -------- | ---------- |
|
||||
| pageNum | int | 是 | 页码 |
|
||||
| pageSize | int | 是 | 每页条数 |
|
||||
| collegeId| int | 否 | 学院ID |
|
||||
| majorId | int | 否 | 专业ID |
|
||||
| className| string | 否 | 班级名称 |
|
||||
| classType| int | 否 | 班级类型 |
|
||||
| grade | string | 否 | 年级 |
|
||||
| classStatus| int | 否 | 班级状态 |
|
||||
|
||||
- **返回参数**:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功",
|
||||
"rows": [
|
||||
{
|
||||
"id": 1,
|
||||
"collegeId": 1001,
|
||||
"collegeName": "信息学院",
|
||||
"majorId": 2001,
|
||||
"majorName": "计算机科学与技术",
|
||||
"classCode": "CS2025-01",
|
||||
"className": "计科2025-01班",
|
||||
"classType": 1,
|
||||
"grade": "2025",
|
||||
"enrollmentYear": 2025,
|
||||
"graduationYear": 2029,
|
||||
"counselorId": 102,
|
||||
"counselorName": "李老师",
|
||||
"classTeacherId": 103,
|
||||
"classTeacherName": "张老师",
|
||||
"classStatus": 1,
|
||||
"remark": "示例班级"
|
||||
}
|
||||
],
|
||||
"total": 1
|
||||
}
|
||||
```
|
||||
|
||||
#### 1.2 获取班级信息详情
|
||||
|
||||
- **接口URL**: `/classMsg/classMsg/{id}`
|
||||
- **请求方式**: GET
|
||||
- **权限标识**: `classMsg:classMsg:query`
|
||||
- **请求参数**:
|
||||
|
||||
| 参数名 | 类型 | 是否必须 | 描述 |
|
||||
| ------ | ---- | -------- | ------- |
|
||||
| id | int | 是 | 班级ID |
|
||||
|
||||
- **返回参数**:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功",
|
||||
"data": {
|
||||
"id": 1,
|
||||
"collegeId": 1001,
|
||||
"collegeName": "信息学院",
|
||||
"majorId": 2001,
|
||||
"majorName": "计算机科学与技术",
|
||||
"classCode": "CS2025-01",
|
||||
"className": "计科2025-01班",
|
||||
"classType": 1,
|
||||
"grade": "2025",
|
||||
"enrollmentYear": 2025,
|
||||
"graduationYear": 2029,
|
||||
"counselorId": 102,
|
||||
"counselorName": "李老师",
|
||||
"classTeacherId": 103,
|
||||
"classTeacherName": "张老师",
|
||||
"classStatus": 1,
|
||||
"remark": "示例班级"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### 2. 班级信息维护接口
|
||||
|
||||
#### 2.1 新增班级信息
|
||||
|
||||
- **接口URL**: `/classMsg/classMsg`
|
||||
- **请求方式**: POST
|
||||
- **权限标识**: `classMsg:classMsg:add`
|
||||
- **请求参数**:
|
||||
|
||||
```json
|
||||
{
|
||||
"collegeId": 1001,
|
||||
"collegeName": "信息学院",
|
||||
"majorId": 2001,
|
||||
"majorName": "计算机科学与技术",
|
||||
"classCode": "CS2025-01",
|
||||
"className": "计科2025-01班",
|
||||
"classType": 1,
|
||||
"grade": "2025",
|
||||
"enrollmentYear": 2025,
|
||||
"graduationYear": 2029,
|
||||
"classStatus": 1,
|
||||
"remark": "示例班级"
|
||||
}
|
||||
```
|
||||
|
||||
- **返回参数**:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功"
|
||||
}
|
||||
```
|
||||
|
||||
#### 2.2 修改班级信息
|
||||
|
||||
- **接口URL**: `/classMsg/classMsg`
|
||||
- **请求方式**: PUT
|
||||
- **权限标识**: `classMsg:classMsg:edit`
|
||||
- **请求参数**:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 1,
|
||||
"collegeId": 1001,
|
||||
"collegeName": "信息学院",
|
||||
"majorId": 2001,
|
||||
"majorName": "计算机科学与技术",
|
||||
"classCode": "CS2025-01",
|
||||
"className": "计科2025-01班",
|
||||
"classType": 1,
|
||||
"grade": "2025",
|
||||
"enrollmentYear": 2025,
|
||||
"graduationYear": 2029,
|
||||
"classStatus": 1,
|
||||
"remark": "修改后的班级"
|
||||
}
|
||||
```
|
||||
|
||||
- **返回参数**:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功"
|
||||
}
|
||||
```
|
||||
|
||||
#### 2.3 设置班主任
|
||||
|
||||
- **接口URL**: `/classMsg/classMsg`
|
||||
- **请求方式**: PUT
|
||||
- **权限标识**: `classMsg:classMsg:edit`
|
||||
- **请求参数**:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 1,
|
||||
"classTeacherId": 103,
|
||||
"classTeacherName": "张老师"
|
||||
}
|
||||
```
|
||||
|
||||
- **返回参数**:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功"
|
||||
}
|
||||
```
|
||||
|
||||
#### 2.4 设置辅导员
|
||||
|
||||
- **接口URL**: `/classMsg/classMsg`
|
||||
- **请求方式**: PUT
|
||||
- **权限标识**: `classMsg:classMsg:edit`
|
||||
- **请求参数**:
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 1,
|
||||
"counselorId": 102,
|
||||
"counselorName": "李老师"
|
||||
}
|
||||
```
|
||||
|
||||
- **返回参数**:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功"
|
||||
}
|
||||
```
|
||||
|
||||
#### 2.5 删除班级信息
|
||||
|
||||
- **接口URL**: `/classMsg/classMsg/{ids}`
|
||||
- **请求方式**: DELETE
|
||||
- **权限标识**: `classMsg:classMsg:remove`
|
||||
- **请求参数**:
|
||||
|
||||
| 参数名 | 类型 | 是否必须 | 描述 |
|
||||
| ------ | ------ | -------- | ------------------ |
|
||||
| ids | string | 是 | 班级ID,多个用逗号分隔 |
|
||||
|
||||
- **返回参数**:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功"
|
||||
}
|
||||
```
|
||||
|
||||
#### 2.6 导出班级信息
|
||||
|
||||
- **接口URL**: `/classMsg/classMsg/export`
|
||||
- **请求方式**: GET
|
||||
- **权限标识**: `classMsg:classMsg:export`
|
||||
- **请求参数**: 与查询参数相同
|
||||
- **返回参数**: 文件流
|
||||
|
||||
### 3. 班级教师关联接口
|
||||
|
||||
#### 3.1 查询有效用户列表(用于班主任/辅导员选择)
|
||||
|
||||
- **接口URL**: `/xg/sysUser/activeList`
|
||||
- **请求方式**: GET
|
||||
- **权限标识**: `xg:sysUser:list`
|
||||
- **请求参数**: 无
|
||||
- **返回参数**:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功",
|
||||
"data": [
|
||||
{
|
||||
"userId": 100,
|
||||
"userName": "teacher1",
|
||||
"nickName": "张老师",
|
||||
"email": "zhang@example.com",
|
||||
"phonenumber": "13800138000",
|
||||
"sex": "0",
|
||||
"status": "0",
|
||||
"deptId": 101,
|
||||
"deptName": "计算机系"
|
||||
},
|
||||
{
|
||||
"userId": 101,
|
||||
"userName": "teacher2",
|
||||
"nickName": "李老师",
|
||||
"email": "li@example.com",
|
||||
"phonenumber": "13800138001",
|
||||
"sex": "1",
|
||||
"status": "0",
|
||||
"deptId": 102,
|
||||
"deptName": "机械系"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## 数据字典
|
||||
|
||||
### 班级类型(classType)
|
||||
|
||||
| 编码 | 名称 |
|
||||
| ---- | ---------- |
|
||||
| 1 | 中级工 |
|
||||
| 2 | 高级工 |
|
||||
| 3 | 预备技师 |
|
||||
| 4 | 技师 |
|
||||
| 5 | 中高职一体 |
|
||||
|
||||
### 班级状态(classStatus)
|
||||
|
||||
| 编码 | 名称 |
|
||||
| ---- | ---- |
|
||||
| 1 | 正常 |
|
||||
| 2 | 暂停 |
|
||||
| 3 | 毕业 |
|
||||
| 4 | 解散 |
|
||||
|
||||
### 是否已毕业(isGraduation)
|
||||
|
||||
| 编码 | 名称 |
|
||||
| ---- | ------ |
|
||||
| 0 | 未毕业 |
|
||||
| 1 | 已毕业 |
|
||||
@@ -0,0 +1,299 @@
|
||||
# 班级教师关联管理API文档
|
||||
|
||||
## 文档信息
|
||||
- **模块名称**: 班级教师关联管理
|
||||
- **版本**: 1.0.1
|
||||
- **最后更新**: 2025-07-24
|
||||
- **更新人**: zlwu
|
||||
|
||||
## API概览
|
||||
|
||||
本文档主要描述班级与教师(班主任/辅导员)关联的相关API接口,提供班主任和辅导员的设置、更新、查询等功能。
|
||||
|
||||
### 基础数据结构
|
||||
|
||||
#### 班级教师关联对象 (XgClassTeacherCounselorRelBo)
|
||||
|
||||
| 字段名 | 类型 | 必填 | 描述 |
|
||||
| --- | --- | --- | --- |
|
||||
| id | Long | 否(新增)/是(修改) | 主键ID |
|
||||
| classId | Long | 是 | 班级ID |
|
||||
| teacherId | Long | 否 | 班主任ID |
|
||||
| teacherName | String | 否 | 班主任姓名 |
|
||||
| counselorId | Long | 否 | 辅导员ID |
|
||||
| counselorName | String | 否 | 辅导员姓名 |
|
||||
| relationType | Integer | 是 | 关联类型: 1-班主任, 2-辅导员 |
|
||||
| startDate | Date | 否 | 开始日期 |
|
||||
| endDate | Date | 否 | 结束日期 |
|
||||
| remark | String | 否 | 备注信息 |
|
||||
| createTime | Date | 是 | 创建时间 |
|
||||
| createBy | Long | 是 | 创建者 |
|
||||
| updateTime | Date | 是 | 更新时间 |
|
||||
| updateBy | Long | 是 | 更新者 |
|
||||
|
||||
## 接口列表
|
||||
|
||||
### 1. 查询班级教师关联列表
|
||||
|
||||
- **接口URL**: `/teacherCounselorRel/classTeacherCounselorRel/list`
|
||||
- **请求方式**: GET
|
||||
- **权限标识**: `teacherCounselorRel:classTeacherCounselorRel:list`
|
||||
|
||||
#### 请求参数
|
||||
|
||||
| 参数名 | 类型 | 必填 | 位置 | 描述 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| classId | Long | 否 | query | 班级ID |
|
||||
| relationType | Integer | 否 | query | 关联类型: 1-班主任, 2-辅导员 |
|
||||
| pageNum | Integer | 否 | query | 当前页码, 默认为1 |
|
||||
| pageSize | Integer | 否 | query | 每页数量, 默认为10 |
|
||||
|
||||
#### 响应结果
|
||||
|
||||
```json
|
||||
{
|
||||
"total": 100,
|
||||
"rows": [
|
||||
{
|
||||
"id": 1,
|
||||
"classId": 1001,
|
||||
"teacherId": 2001,
|
||||
"teacherName": "张老师",
|
||||
"counselorId": 3001,
|
||||
"counselorName": "李辅导员",
|
||||
"relationType": 1,
|
||||
"remark": "高一年级班主任",
|
||||
"createTime": "2025-07-01 10:00:00",
|
||||
"createBy": 1,
|
||||
"updateTime": "2025-07-20 15:30:00",
|
||||
"updateBy": 1
|
||||
}
|
||||
],
|
||||
"code": 200,
|
||||
"msg": "查询成功"
|
||||
}
|
||||
```
|
||||
|
||||
### 2. 获取班级教师关联详情
|
||||
|
||||
- **接口URL**: `/teacherCounselorRel/classTeacherCounselorRel/{id}`
|
||||
- **请求方式**: GET
|
||||
- **权限标识**: `teacherCounselorRel:classTeacherCounselorRel:query`
|
||||
|
||||
#### 请求参数
|
||||
|
||||
| 参数名 | 类型 | 必填 | 位置 | 描述 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| id | Long | 是 | path | 关联ID |
|
||||
|
||||
#### 响应结果
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"data": {
|
||||
"id": 1,
|
||||
"classId": 1001,
|
||||
"teacherId": 2001,
|
||||
"teacherName": "张老师",
|
||||
"counselorId": 3001,
|
||||
"counselorName": "李辅导员",
|
||||
"relationType": 1,
|
||||
"remark": "高一年级班主任",
|
||||
"createTime": "2025-07-01 10:00:00",
|
||||
"createBy": 1,
|
||||
"updateTime": "2025-07-20 15:30:00",
|
||||
"updateBy": 1
|
||||
},
|
||||
"msg": "操作成功"
|
||||
}
|
||||
```
|
||||
|
||||
### 3. 新增班级教师关联
|
||||
|
||||
- **接口URL**: `/teacherCounselorRel/classTeacherCounselorRel`
|
||||
- **请求方式**: POST
|
||||
- **权限标识**: `teacherCounselorRel:classTeacherCounselorRel:add`
|
||||
|
||||
#### 请求参数
|
||||
|
||||
| 参数名 | 类型 | 必填 | 位置 | 描述 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| classId | Long | 是 | body | 班级ID |
|
||||
| teacherId | Long | 否 | body | 班主任ID |
|
||||
| teacherName | String | 否 | body | 班主任姓名 |
|
||||
| counselorId | Long | 否 | body | 辅导员ID |
|
||||
| counselorName | String | 否 | body | 辅导员姓名 |
|
||||
| relationType | Integer | 是 | body | 关联类型: 1-班主任, 2-辅导员 |
|
||||
| remark | String | 否 | body | 备注信息 |
|
||||
|
||||
#### 请求示例
|
||||
|
||||
```json
|
||||
{
|
||||
"classId": 1001,
|
||||
"teacherId": 2001,
|
||||
"teacherName": "张老师",
|
||||
"relationType": 1,
|
||||
"remark": "高一年级班主任"
|
||||
}
|
||||
```
|
||||
|
||||
#### 响应结果
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功"
|
||||
}
|
||||
```
|
||||
|
||||
### 4. 修改班级教师关联
|
||||
|
||||
- **接口URL**: `/teacherCounselorRel/classTeacherCounselorRel`
|
||||
- **请求方式**: PUT
|
||||
- **权限标识**: `teacherCounselorRel:classTeacherCounselorRel:edit`
|
||||
|
||||
#### 请求参数
|
||||
|
||||
| 参数名 | 类型 | 必填 | 位置 | 描述 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| id | Long | 是 | body | 关联ID |
|
||||
| classId | Long | 否 | body | 班级ID |
|
||||
| teacherId | Long | 否 | body | 班主任ID |
|
||||
| teacherName | String | 否 | body | 班主任姓名 |
|
||||
| counselorId | Long | 否 | body | 辅导员ID |
|
||||
| counselorName | String | 否 | body | 辅导员姓名 |
|
||||
| relationType | Integer | 否 | body | 关联类型: 1-班主任, 2-辅导员 |
|
||||
| remark | String | 否 | body | 备注信息 |
|
||||
|
||||
#### 班主任更换机制
|
||||
|
||||
当通过此接口更换班主任时(relationType=1),系统会执行以下操作:
|
||||
|
||||
1. 将当前班级的所有未删除的班主任记录标记为已删除(deleted=1)
|
||||
2. 设置原班主任记录的结束日期(endDate)为当前日期时间
|
||||
3. 创建新的班主任关联记录,设置开始日期(startDate)为当前日期时间
|
||||
4. 同步更新班级表中的班主任信息
|
||||
|
||||
这样确保了班主任更换记录的完整性,可以通过查看历史记录追踪班级班主任的变更情况。
|
||||
|
||||
#### 请求示例
|
||||
|
||||
```json
|
||||
{
|
||||
"id": 1,
|
||||
"classId": 1001,
|
||||
"teacherId": 2002,
|
||||
"teacherName": "王老师",
|
||||
"relationType": 1,
|
||||
"remark": "高一年级新班主任"
|
||||
}
|
||||
```
|
||||
|
||||
#### 响应结果
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功"
|
||||
}
|
||||
```
|
||||
|
||||
### 5. 删除班级教师关联
|
||||
|
||||
- **接口URL**: `/teacherCounselorRel/classTeacherCounselorRel/{ids}`
|
||||
- **请求方式**: DELETE
|
||||
- **权限标识**: `teacherCounselorRel:classTeacherCounselorRel:remove`
|
||||
|
||||
#### 请求参数
|
||||
|
||||
| 参数名 | 类型 | 必填 | 位置 | 描述 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| ids | Long[] | 是 | path | 关联ID数组,多个以英文逗号分隔 |
|
||||
|
||||
#### 响应结果
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功"
|
||||
}
|
||||
```
|
||||
|
||||
### 6. 导出班级教师关联数据
|
||||
|
||||
- **接口URL**: `/teacherCounselorRel/classTeacherCounselorRel/export`
|
||||
- **请求方式**: POST
|
||||
- **权限标识**: `teacherCounselorRel:classTeacherCounselorRel:export`
|
||||
- **响应类型**: application/vnd.ms-excel
|
||||
|
||||
#### 请求参数
|
||||
|
||||
| 参数名 | 类型 | 必填 | 位置 | 描述 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| classId | Long | 否 | query | 班级ID |
|
||||
| relationType | Integer | 否 | query | 关联类型: 1-班主任, 2-辅导员 |
|
||||
|
||||
## 前端调用示例
|
||||
|
||||
### 设置班主任
|
||||
|
||||
```typescript
|
||||
// 导入API
|
||||
import { addClassTeacherCounselorRel } from '@/api/xg/classTeacherCounselorRel';
|
||||
|
||||
// 构造数据
|
||||
const teacherRelData = {
|
||||
classId: classId,
|
||||
teacherId: teacherId,
|
||||
teacherName: teacherName,
|
||||
relationType: 1 // 1表示班主任类型
|
||||
};
|
||||
|
||||
// 调用API
|
||||
try {
|
||||
await addClassTeacherCounselorRel(teacherRelData);
|
||||
this.$modal.msgSuccess('班主任设置成功');
|
||||
} catch (error) {
|
||||
this.$modal.msgError('设置失败,请重试');
|
||||
}
|
||||
```
|
||||
|
||||
### 设置辅导员
|
||||
|
||||
```typescript
|
||||
// 导入API
|
||||
import { addClassTeacherCounselorRel } from '@/api/xg/classTeacherCounselorRel';
|
||||
|
||||
// 构造数据
|
||||
const counselorRelData = {
|
||||
classId: classId,
|
||||
counselorId: counselorId,
|
||||
counselorName: counselorName,
|
||||
relationType: 2 // 2表示辅导员类型
|
||||
};
|
||||
|
||||
// 调用API
|
||||
try {
|
||||
await addClassTeacherCounselorRel(counselorRelData);
|
||||
this.$modal.msgSuccess('辅导员设置成功');
|
||||
} catch (error) {
|
||||
this.$modal.msgError('设置失败,请重试');
|
||||
}
|
||||
```
|
||||
|
||||
## 错误码说明
|
||||
|
||||
| 错误码 | 描述 | 解决方案 |
|
||||
| --- | --- | --- |
|
||||
| 400 | 请求参数错误 | 检查请求参数是否正确 |
|
||||
| 401 | 未授权 | 检查登录状态和权限 |
|
||||
| 500 | 服务器内部错误 | 联系管理员 |
|
||||
|
||||
## 更新记录
|
||||
|
||||
| 日期 | 更新人 | 版本 | 变更内容 |
|
||||
| --- | --- | --- | --- |
|
||||
| 2025-07-24 | zlwu | 1.0.1 | 添加班主任更换机制说明,补充开始/结束日期字段 |
|
||||
| 2025-07-24 | zlwu | 1.0.0 | 初始版本 |
|
||||
@@ -0,0 +1,152 @@
|
||||
# 前端学院专业级联下拉框使用说明
|
||||
|
||||
## 概述
|
||||
|
||||
本文档描述了如何在前端页面中使用学院专业级联下拉框组件,实现学院和专业的联动选择。当用户选择学院后,专业下拉框会自动更新为该学院下的专业列表。
|
||||
|
||||
## API接口
|
||||
|
||||
组件使用以下API接口:
|
||||
|
||||
1. **获取学院列表**
|
||||
- 请求路径:`GET /xg/college/list`
|
||||
- 返回格式:`R<List<SysDeptVo>>`
|
||||
|
||||
2. **获取学院专业树形结构**
|
||||
- 请求路径:`GET /xg/college/tree`
|
||||
- 返回格式:`R<List<SysDeptVo>>`
|
||||
- 说明:返回包含子部门的树形结构数据
|
||||
|
||||
3. **根据学院ID获取专业列表**
|
||||
- 请求路径:`GET /xg/college/majors/{collegeId}`
|
||||
- 参数:`collegeId` - 学院ID
|
||||
- 返回格式:`R<List<SysDeptVo>>`
|
||||
|
||||
## 使用示例
|
||||
|
||||
### 1. 导入API和类型
|
||||
|
||||
```typescript
|
||||
import { listColleges, collegeTree, listMajorsByCollegeId } from '@/api/classMsg/college';
|
||||
import { SysDeptVo } from '@/api/classMsg/types';
|
||||
```
|
||||
|
||||
### 2. 定义数据变量
|
||||
|
||||
```typescript
|
||||
// 学院选项
|
||||
const collegeOptions = ref<SysDeptVo[]>([]);
|
||||
// 检索时的专业选项
|
||||
const majorOptions = ref<SysDeptVo[]>([]);
|
||||
// 表单中的专业选项
|
||||
const formMajorOptions = ref<SysDeptVo[]>([]);
|
||||
// 学院专业树形数据
|
||||
const collegeTreeData = ref<SysDeptVo[]>([]);
|
||||
```
|
||||
|
||||
### 3. 加载学院数据
|
||||
|
||||
```typescript
|
||||
/** 查询学院列表 */
|
||||
const getCollegeList = async () => {
|
||||
const res = await listColleges();
|
||||
collegeOptions.value = res.data;
|
||||
}
|
||||
|
||||
// 在页面加载时调用
|
||||
onMounted(() => {
|
||||
getCollegeList();
|
||||
});
|
||||
```
|
||||
|
||||
### 4. 添加联动事件处理
|
||||
|
||||
```typescript
|
||||
/** 学院选择框变化事件 */
|
||||
const handleCollegeChange = (value: number) => {
|
||||
queryParams.value.majorId = undefined;
|
||||
if (value) {
|
||||
getMajorList(value);
|
||||
} else {
|
||||
majorOptions.value = [];
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询专业列表 */
|
||||
const getMajorList = async (collegeId: number) => {
|
||||
if (!collegeId) {
|
||||
majorOptions.value = [];
|
||||
return;
|
||||
}
|
||||
const res = await listMajorsByCollegeId(collegeId);
|
||||
majorOptions.value = res.data;
|
||||
}
|
||||
```
|
||||
|
||||
### 5. 在表单中添加下拉框
|
||||
|
||||
```html
|
||||
<!-- 学院下拉框 -->
|
||||
<el-form-item label="学院代码" prop="collegeId">
|
||||
<el-select v-model="queryParams.collegeId" placeholder="请选择学院" clearable @change="handleCollegeChange">
|
||||
<el-option
|
||||
v-for="item in collegeOptions"
|
||||
:key="item.deptId"
|
||||
:label="item.deptName"
|
||||
:value="item.deptId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 专业下拉框 -->
|
||||
<el-form-item label="专业代码" prop="majorId">
|
||||
<el-select v-model="queryParams.majorId" placeholder="请选择专业" clearable>
|
||||
<el-option
|
||||
v-for="item in majorOptions"
|
||||
:key="item.deptId"
|
||||
:label="item.deptName"
|
||||
:value="item.deptId"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
```
|
||||
|
||||
## 自动填充名称
|
||||
|
||||
在表单中,当选择学院或专业代码时,可以自动填充对应的名称字段并设置为只读:
|
||||
|
||||
```typescript
|
||||
/** 表单学院选择框变化事件 */
|
||||
const handleFormCollegeChange = (value: number) => {
|
||||
form.value.majorId = undefined;
|
||||
form.value.majorName = undefined;
|
||||
if (value) {
|
||||
// 设置学院名称
|
||||
const college = collegeOptions.value.find(item => item.deptId === value);
|
||||
if (college) {
|
||||
form.value.collegeName = college.deptName;
|
||||
}
|
||||
getFormMajorList(value);
|
||||
} else {
|
||||
form.value.collegeName = undefined;
|
||||
formMajorOptions.value = [];
|
||||
}
|
||||
}
|
||||
|
||||
/** 表单专业选择框变化事件 */
|
||||
const handleFormMajorChange = (value: number) => {
|
||||
if (value) {
|
||||
// 设置专业名称
|
||||
const major = formMajorOptions.value.find(item => item.deptId === value);
|
||||
if (major) {
|
||||
form.value.majorName = major.deptName;
|
||||
}
|
||||
} else {
|
||||
form.value.majorName = undefined;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## 完整实现示例
|
||||
|
||||
请参考 `web/src/views/classmsg/classMsg/index.vue` 文件中的完整实现,该文件演示了如何在检索表单和编辑表单中使用学院专业级联下拉框。
|
||||
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
Navicat Premium Dump SQL
|
||||
|
||||
Source Server : 47.99.164.66 hn02le.34lkdLKD
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50736 (5.7.36)
|
||||
Source Host : 47.99.164.66:3306
|
||||
Source Schema : hzdyjs_xg
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50736 (5.7.36)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 23/07/2025 17:22:51
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for xg_class_msg
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `xg_class_msg`;
|
||||
CREATE TABLE `xg_class_msg` (
|
||||
`id` bigint(20) NOT NULL COMMENT '主键ID(雪花ID)',
|
||||
`tenant_id` varchar(20) NOT NULL DEFAULT '000000' COMMENT '租户编号',
|
||||
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
||||
`create_by` bigint(20) DEFAULT NULL COMMENT '创建者',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` bigint(20) DEFAULT NULL COMMENT '更新者',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`deleted` tinyint(1) DEFAULT '0' COMMENT '删除标志(0代表存在 1代表删除)',
|
||||
`college_id` bigint(20) DEFAULT NULL COMMENT '学院代码',
|
||||
`college_name` varchar(100) DEFAULT NULL COMMENT '学院名称',
|
||||
`major_id` bigint(20) DEFAULT NULL COMMENT '专业代码',
|
||||
`major_name` varchar(100) DEFAULT NULL COMMENT '专业名称',
|
||||
`class_code` varchar(32) NOT NULL COMMENT '班级代码',
|
||||
`class_name` varchar(100) NOT NULL COMMENT '班级名称',
|
||||
`class_type` varchar(20) DEFAULT '1' COMMENT '班级类型:1-中级工 2-高级工 3-预备技师 4-技师 5-中高职一体',
|
||||
`grade` varchar(10) NOT NULL COMMENT '年级',
|
||||
`enrollment_year` int(4) NOT NULL COMMENT '入学年份',
|
||||
`graduation_year` int(4) DEFAULT NULL COMMENT '毕业年份',
|
||||
`training_type` varchar(20) DEFAULT NULL COMMENT '培养方式:全日制,在职,函授,夜大等',
|
||||
`degree_type` varchar(20) DEFAULT NULL COMMENT '学位类型:学士,硕士,博士,专科',
|
||||
`counselor_id` bigint(20) DEFAULT NULL COMMENT '辅导员ID',
|
||||
`counselor_name` varchar(50) DEFAULT NULL COMMENT '辅导员姓名',
|
||||
`class_teacher_id` bigint(20) DEFAULT NULL COMMENT '班主任ID',
|
||||
`class_teacher_name` varchar(50) DEFAULT NULL COMMENT '班主任姓名',
|
||||
`class_advisor_id` bigint(20) DEFAULT NULL COMMENT '班级导师ID',
|
||||
`class_advisor_name` varchar(50) DEFAULT NULL COMMENT '班级导师姓名',
|
||||
`class_monitor_id` bigint(20) DEFAULT NULL COMMENT '班长ID',
|
||||
`class_monitor_name` varchar(50) DEFAULT NULL COMMENT '班长姓名',
|
||||
`deputy_monitor_id` bigint(20) DEFAULT NULL COMMENT '副班长ID',
|
||||
`deputy_monitor_name` varchar(50) DEFAULT NULL COMMENT '副班长姓名',
|
||||
`class_status` char(1) DEFAULT '1' COMMENT '班级状态:1-正常,2-暂停,3-毕业,4-解散',
|
||||
`is_graduation` tinyint(1) DEFAULT '0' COMMENT '是否已毕业:0-未毕业,1-已毕业',
|
||||
`graduation_date` date DEFAULT NULL COMMENT '毕业日期',
|
||||
`planned_capacity` int(11) DEFAULT '50' COMMENT '计划容量',
|
||||
`current_student_count` int(11) DEFAULT '0' COMMENT '当前学生人数',
|
||||
`max_student_count` int(11) DEFAULT '50' COMMENT '最大学生人数',
|
||||
`male_count` int(11) DEFAULT '0' COMMENT '男生人数',
|
||||
`female_count` int(11) DEFAULT '0' COMMENT '女生人数',
|
||||
`active_count` int(11) DEFAULT '0' COMMENT '在籍人数',
|
||||
`transfer_in_count` int(11) DEFAULT '0' COMMENT '转入人数',
|
||||
`transfer_out_count` int(11) DEFAULT '0' COMMENT '转出人数',
|
||||
`dropout_count` int(11) DEFAULT '0' COMMENT '退学人数',
|
||||
`graduate_count` int(11) DEFAULT '0' COMMENT '毕业人数',
|
||||
`office_location` varchar(200) DEFAULT NULL COMMENT '班级办公室位置',
|
||||
`class_location` varchar(100) DEFAULT NULL COMMENT '班级教室位置',
|
||||
`contact_phone` varchar(20) DEFAULT NULL COMMENT '联系电话',
|
||||
`qq_group` varchar(20) DEFAULT NULL COMMENT 'QQ群号',
|
||||
`wechat_group` varchar(100) DEFAULT NULL COMMENT '微信群',
|
||||
`email` varchar(100) DEFAULT NULL COMMENT '班级邮箱',
|
||||
`class_schedule` text COMMENT '课程安排(JSON格式)',
|
||||
`class_culture` text COMMENT '班级文化建设',
|
||||
`class_rules` text COMMENT '班级规章制度',
|
||||
`class_description` varchar(500) DEFAULT NULL COMMENT '班级描述',
|
||||
`last_count_update` datetime DEFAULT NULL COMMENT '最后统计更新时间',
|
||||
`ext_field1` varchar(200) DEFAULT NULL COMMENT '扩展字段1',
|
||||
`ext_field2` varchar(200) DEFAULT NULL COMMENT '扩展字段2',
|
||||
`ext_field3` varchar(200) DEFAULT NULL COMMENT '扩展字段3',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注信息',
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `uk_class_code_tenant` (`class_code`,`tenant_id`),
|
||||
KEY `idx_tenant_id` (`tenant_id`),
|
||||
KEY `idx_deleted` (`deleted`),
|
||||
KEY `idx_college_id` (`college_id`),
|
||||
KEY `idx_enrollment_year` (`enrollment_year`),
|
||||
KEY `idx_grade` (`grade`),
|
||||
KEY `idx_major_id` (`major_id`),
|
||||
KEY `idx_counselor_id` (`counselor_id`),
|
||||
KEY `idx_class_teacher_id` (`class_teacher_id`),
|
||||
KEY `idx_class_status` (`class_status`),
|
||||
KEY `idx_college_grade` (`college_id`,`grade`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='班级信息表-新版';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
Navicat Premium Dump SQL
|
||||
|
||||
Source Server : 47.99.164.66 hn02le.34lkdLKD
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 50736 (5.7.36)
|
||||
Source Host : 47.99.164.66:3306
|
||||
Source Schema : hzdyjs_xg
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 50736 (5.7.36)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 25/07/2025 14:30:26
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for xg_class_teacher_counselor_rel
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `xg_class_teacher_counselor_rel`;
|
||||
CREATE TABLE `xg_class_teacher_counselor_rel` (
|
||||
`id` bigint(20) NOT NULL COMMENT '主键ID(雪花ID)',
|
||||
`tenant_id` varchar(20) NOT NULL DEFAULT '000000' COMMENT '租户编号',
|
||||
`create_dept` bigint(20) DEFAULT NULL COMMENT '创建部门',
|
||||
`create_by` bigint(20) DEFAULT NULL COMMENT '创建者',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_by` bigint(20) DEFAULT NULL COMMENT '更新者',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`deleted` tinyint(1) DEFAULT '0' COMMENT '删除标志(0代表存在 1代表删除)',
|
||||
-- 关联信息
|
||||
`class_id` bigint(20) NOT NULL COMMENT '班级ID,关联xg_class_msg.id',
|
||||
`class_name` varchar(100) DEFAULT NULL COMMENT '班级名称',
|
||||
-- 教师信息
|
||||
`teacher_id` bigint(20) NOT NULL COMMENT '教师ID,关联sys_user.user_id',
|
||||
`teacher_name` varchar(50) DEFAULT NULL COMMENT '教师姓名',
|
||||
`teacher_type` varchar(20) NOT NULL COMMENT '教师类型:class_teacher-班主任,counselor-辅导员,advisor-导师',
|
||||
-- 任职信息
|
||||
`start_date` datetime NOT NULL COMMENT '开始日期',
|
||||
`end_date` datetime DEFAULT NULL COMMENT '结束日期',
|
||||
`remark` varchar(500) DEFAULT NULL COMMENT '备注信息',
|
||||
-- 主键和索引
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
KEY `idx_tenant_id` (`tenant_id`),
|
||||
KEY `idx_deleted` (`deleted`),
|
||||
KEY `idx_class_id` (`class_id`),
|
||||
KEY `idx_teacher_id` (`teacher_id`),
|
||||
KEY `idx_teacher_type` (`teacher_type`),
|
||||
KEY `idx_start_date` (`start_date`),
|
||||
KEY `idx_end_date` (`end_date`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='班级班主任辅导员关联表';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
@@ -1,163 +0,0 @@
|
||||
<!--
|
||||
修复后的招生流程状态页面片段
|
||||
作者:Cursor AI
|
||||
日期:2025-07-21
|
||||
说明:修复下拉菜单中的操作项,添加v-hasPermi指令
|
||||
-->
|
||||
|
||||
<template>
|
||||
<!-- 这里只包含需要修改的下拉菜单部分,完整代码请参考原文件 -->
|
||||
<el-dropdown @command="(command: string) => handleCommand(command, scope.row)">
|
||||
<el-button link type="primary" icon="More" />
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<!-- 添加v-hasPermi指令,确保只有有权限的用户才能看到相应的操作 -->
|
||||
<el-dropdown-item
|
||||
v-hasPermi="['zsjy:enrollmentProcess:process']"
|
||||
command="payment"
|
||||
:disabled="scope.row.paymentStatus === '1'"
|
||||
>
|
||||
<el-icon><CreditCard /></el-icon>
|
||||
缴费确认
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-hasPermi="['zsjy:enrollmentProcess:complete']"
|
||||
command="complete"
|
||||
:disabled="scope.row.isCompleted === 1"
|
||||
>
|
||||
<el-icon><CircleCheck /></el-icon>
|
||||
完成录取
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
v-hasPermi="['zsjy:enrollmentProcess:reject']"
|
||||
command="reject"
|
||||
:disabled="scope.row.currentStatus === '9'"
|
||||
>
|
||||
<el-icon><CircleClose /></el-icon>
|
||||
驳回流程
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
command="reset"
|
||||
v-hasPermi="['zsjy:enrollmentProcess:reset']"
|
||||
>
|
||||
<el-icon><RefreshRight /></el-icon>
|
||||
重置流程
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
command="delete"
|
||||
v-hasPermi="['zsjy:enrollmentProcess:remove']"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>
|
||||
删除
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
|
||||
// 获取用户存储
|
||||
const userStore = useUserStore()
|
||||
|
||||
// 判断是否为信息审核员
|
||||
const isInfoAuditor = computed(() => {
|
||||
return userStore.roles?.includes('zsjy_info_auditor') || false
|
||||
})
|
||||
|
||||
// 判断是否为录取处理员
|
||||
const isAdmissionProcessor = computed(() => {
|
||||
return userStore.roles?.includes('zsjy_admission_processor') || false
|
||||
})
|
||||
|
||||
// 判断是否为管理员
|
||||
const isAdmin = computed(() => {
|
||||
return userStore.roles?.includes('admin') || userStore.roles?.includes('superadmin') || false
|
||||
})
|
||||
|
||||
// 修改getList方法,根据用户角色过滤数据
|
||||
const getList = async () => {
|
||||
loading.value = true
|
||||
|
||||
// 根据角色设置查询参数
|
||||
if (isInfoAuditor.value) {
|
||||
// 信息审核员只查询状态为0和1的数据
|
||||
queryParams.value.currentStatus = ['0', '1']
|
||||
} else if (isAdmissionProcessor.value) {
|
||||
// 录取处理员只查询状态为2的数据
|
||||
queryParams.value.currentStatus = '2'
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await listEnrollmentProcess(queryParams.value)
|
||||
processList.value = res.rows || []
|
||||
total.value = res.total || 0
|
||||
} catch (error) {
|
||||
console.error('获取流程列表失败:', error)
|
||||
|
||||
// 如果是404错误(接口不存在),使用模拟数据
|
||||
if (error?.response?.status === 404 || error?.message?.includes('404')) {
|
||||
console.warn('后端接口不存在,使用模拟数据')
|
||||
// 创建模拟的流程数据,根据用户角色过滤
|
||||
let mockData = [
|
||||
{
|
||||
id: 1946510098494091300,
|
||||
enrollmentId: 1001,
|
||||
studentName: '张三',
|
||||
idCard: '330101200501010001',
|
||||
currentStatus: '0',
|
||||
infoAuditStatus: '0',
|
||||
admissionStatus: '0',
|
||||
finalAuditStatus: '0',
|
||||
isCompleted: 0,
|
||||
createTime: '2025-07-20 10:28:09'
|
||||
},
|
||||
{
|
||||
id: 1946510098494091301,
|
||||
enrollmentId: 1946510098494091266,
|
||||
studentName: '赵四',
|
||||
idCard: '340403201509091234',
|
||||
currentStatus: '0',
|
||||
infoAuditStatus: '0',
|
||||
admissionStatus: '0',
|
||||
finalAuditStatus: '0',
|
||||
isCompleted: 0,
|
||||
createTime: '2025-07-20 10:28:18'
|
||||
},
|
||||
{
|
||||
id: 1946510098494091302,
|
||||
enrollmentId: 1003,
|
||||
studentName: '王五',
|
||||
idCard: '110101200601010003',
|
||||
currentStatus: '2',
|
||||
infoAuditStatus: '1',
|
||||
admissionStatus: '0',
|
||||
finalAuditStatus: '0',
|
||||
isCompleted: 0,
|
||||
createTime: '2025-07-20 10:28:27'
|
||||
}
|
||||
]
|
||||
|
||||
// 根据用户角色过滤模拟数据
|
||||
if (isInfoAuditor.value) {
|
||||
mockData = mockData.filter(item => ['0', '1'].includes(item.currentStatus))
|
||||
} else if (isAdmissionProcessor.value) {
|
||||
mockData = mockData.filter(item => item.currentStatus === '2')
|
||||
}
|
||||
|
||||
processList.value = mockData
|
||||
total.value = mockData.length
|
||||
proxy?.$modal.msgWarning('后端接口暂未实现,显示模拟数据')
|
||||
} else {
|
||||
// 其他错误,设置空数据并抛出错误
|
||||
processList.value = []
|
||||
total.value = 0
|
||||
throw error
|
||||
}
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -1,190 +0,0 @@
|
||||
/**
|
||||
* 前端权限控制修复脚本
|
||||
* 作者:Cursor AI
|
||||
* 日期:2025-07-21
|
||||
* 说明:修复招生流程状态页面中的权限控制问题
|
||||
*
|
||||
* 问题:zhanglaoshi和lililaoshi两个账号虽然有不同的权限,但前端页面显示相同的操作按钮
|
||||
* 解决方案:修改前端代码,确保下拉菜单中的操作也受到权限控制
|
||||
*/
|
||||
|
||||
/**
|
||||
* 需要修改的文件:/web/src/views/zsjy/enrollmentProcess/index.vue
|
||||
*
|
||||
* 1. 修改下拉菜单中的操作项,添加v-hasPermi指令
|
||||
*
|
||||
* 原代码:
|
||||
* <el-dropdown-item command="payment" :disabled="scope.row.paymentStatus === '1'">
|
||||
* <el-icon><CreditCard /></el-icon>
|
||||
* 缴费确认
|
||||
* </el-dropdown-item>
|
||||
* <el-dropdown-item command="complete" :disabled="scope.row.isCompleted === 1">
|
||||
* <el-icon><CircleCheck /></el-icon>
|
||||
* 完成录取
|
||||
* </el-dropdown-item>
|
||||
* <el-dropdown-item command="reject" :disabled="scope.row.currentStatus === '9'">
|
||||
* <el-icon><CircleClose /></el-icon>
|
||||
* 驳回流程
|
||||
* </el-dropdown-item>
|
||||
*
|
||||
* 修改后的代码:
|
||||
* <el-dropdown-item v-hasPermi="['zsjy:enrollmentProcess:process']" command="payment" :disabled="scope.row.paymentStatus === '1'">
|
||||
* <el-icon><CreditCard /></el-icon>
|
||||
* 缴费确认
|
||||
* </el-dropdown-item>
|
||||
* <el-dropdown-item v-hasPermi="['zsjy:enrollmentProcess:complete']" command="complete" :disabled="scope.row.isCompleted === 1">
|
||||
* <el-icon><CircleCheck /></el-icon>
|
||||
* 完成录取
|
||||
* </el-dropdown-item>
|
||||
* <el-dropdown-item v-hasPermi="['zsjy:enrollmentProcess:reject']" command="reject" :disabled="scope.row.currentStatus === '9'">
|
||||
* <el-icon><CircleClose /></el-icon>
|
||||
* 驳回流程
|
||||
* </el-dropdown-item>
|
||||
*/
|
||||
|
||||
/**
|
||||
* 2. 修改后端API查询逻辑,确保用户只能看到自己有权限处理的数据
|
||||
*
|
||||
* 文件:/backend/ruoyi-modules/ruoyi-zsjy/src/main/java/org/dromara/zsjy/service/impl/ZsjyEnrollmentProcessServiceImpl.java
|
||||
*
|
||||
* 修改 queryPageList 方法,添加用户角色过滤:
|
||||
*
|
||||
* @Override
|
||||
* public TableDataInfo<ZsjyEnrollmentProcessVo> queryPageList(ZsjyEnrollmentProcessBo bo, PageQuery pageQuery) {
|
||||
* LambdaQueryWrapper<ZsjyEnrollmentProcess> lqw = buildQueryWrapper(bo);
|
||||
*
|
||||
* // 获取当前用户ID和角色
|
||||
* Long userId = LoginHelper.getUserId();
|
||||
* List<String> roles = LoginHelper.getRolePermission();
|
||||
*
|
||||
* // 根据角色过滤数据
|
||||
* if (roles.contains("zsjy_info_auditor")) {
|
||||
* // 信息审核员只能看到状态为0和1的数据
|
||||
* lqw.in(ZsjyEnrollmentProcess::getCurrentStatus, "0", "1");
|
||||
* } else if (roles.contains("zsjy_admission_processor")) {
|
||||
* // 录取处理员只能看到状态为2的数据
|
||||
* lqw.eq(ZsjyEnrollmentProcess::getCurrentStatus, "2");
|
||||
* } else if (!roles.contains("admin")) {
|
||||
* // 非管理员且非特定角色,只能看到自己处理的数据
|
||||
* lqw.eq(ZsjyEnrollmentProcess::getCurrentHandler, userId);
|
||||
* }
|
||||
*
|
||||
* Page<ZsjyEnrollmentProcessVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
* return TableDataInfo.build(result);
|
||||
* }
|
||||
*/
|
||||
|
||||
/**
|
||||
* 3. 修改前端页面中的数据过滤逻辑
|
||||
*
|
||||
* 在 getList 方法中添加用户角色判断,根据角色设置不同的查询参数:
|
||||
*
|
||||
* const getList = async () => {
|
||||
* loading.value = true;
|
||||
*
|
||||
* // 获取用户角色
|
||||
* const userStore = useUserStore();
|
||||
* const roles = userStore.roles || [];
|
||||
*
|
||||
* // 根据角色设置查询参数
|
||||
* if (roles.includes('zsjy_info_auditor')) {
|
||||
* // 信息审核员只查询状态为0和1的数据
|
||||
* queryParams.value.currentStatus = ['0', '1'];
|
||||
* } else if (roles.includes('zsjy_admission_processor')) {
|
||||
* // 录取处理员只查询状态为2的数据
|
||||
* queryParams.value.currentStatus = '2';
|
||||
* }
|
||||
*
|
||||
* try {
|
||||
* const res = await listEnrollmentProcess(queryParams.value);
|
||||
* processList.value = res.rows || [];
|
||||
* total.value = res.total || 0;
|
||||
* } catch (error) {
|
||||
* // 错误处理...
|
||||
* } finally {
|
||||
* loading.value = false;
|
||||
* }
|
||||
* };
|
||||
*/
|
||||
|
||||
/**
|
||||
* 4. 添加用户角色判断辅助函数
|
||||
*
|
||||
* 在页面中添加以下辅助函数,用于判断当前用户角色:
|
||||
*
|
||||
* // 导入用户存储
|
||||
* import { useUserStore } from '@/store/modules/user';
|
||||
*
|
||||
* // 获取用户存储
|
||||
* const userStore = useUserStore();
|
||||
*
|
||||
* // 判断是否为信息审核员
|
||||
* const isInfoAuditor = computed(() => {
|
||||
* return userStore.roles?.includes('zsjy_info_auditor') || false;
|
||||
* });
|
||||
*
|
||||
* // 判断是否为录取处理员
|
||||
* const isAdmissionProcessor = computed(() => {
|
||||
* return userStore.roles?.includes('zsjy_admission_processor') || false;
|
||||
* });
|
||||
*
|
||||
* // 判断是否为管理员
|
||||
* const isAdmin = computed(() => {
|
||||
* return userStore.roles?.includes('admin') || userStore.roles?.includes('superadmin') || false;
|
||||
* });
|
||||
*/
|
||||
|
||||
/**
|
||||
* 5. 修复后端数据过滤逻辑
|
||||
*
|
||||
* 文件:/backend/ruoyi-modules/ruoyi-zsjy/src/main/java/org/dromara/zsjy/service/impl/ZsjyEnrollmentProcessServiceImpl.java
|
||||
*
|
||||
* 修改 queryPendingList 方法,根据用户角色过滤数据:
|
||||
*
|
||||
* @Override
|
||||
* public TableDataInfo<ZsjyEnrollmentProcessVo> queryPendingList(ZsjyEnrollmentProcessBo bo, PageQuery pageQuery) {
|
||||
* LambdaQueryWrapper<ZsjyEnrollmentProcess> lqw = buildQueryWrapper(bo);
|
||||
*
|
||||
* // 获取当前用户ID和角色
|
||||
* Long userId = LoginHelper.getUserId();
|
||||
* List<String> roles = LoginHelper.getRolePermission();
|
||||
*
|
||||
* // 根据角色过滤待处理数据
|
||||
* if (roles.contains("zsjy_info_auditor")) {
|
||||
* // 信息审核员只能看到状态为0和1的待处理数据
|
||||
* lqw.and(wrapper -> wrapper
|
||||
* .eq(ZsjyEnrollmentProcess::getCurrentHandler, userId)
|
||||
* .or(subWrapper -> subWrapper
|
||||
* .isNull(ZsjyEnrollmentProcess::getCurrentHandler)
|
||||
* .in(ZsjyEnrollmentProcess::getCurrentStatus, "0", "1")
|
||||
* )
|
||||
* );
|
||||
* } else if (roles.contains("zsjy_admission_processor")) {
|
||||
* // 录取处理员只能看到状态为2的待处理数据
|
||||
* lqw.and(wrapper -> wrapper
|
||||
* .eq(ZsjyEnrollmentProcess::getCurrentHandler, userId)
|
||||
* .or(subWrapper -> subWrapper
|
||||
* .isNull(ZsjyEnrollmentProcess::getCurrentHandler)
|
||||
* .eq(ZsjyEnrollmentProcess::getCurrentStatus, "2")
|
||||
* )
|
||||
* );
|
||||
* } else if (roles.contains("admin") || roles.contains("superadmin")) {
|
||||
* // 管理员可以看到所有待处理数据
|
||||
* // 不添加额外过滤条件
|
||||
* } else {
|
||||
* // 其他用户只能看到分配给自己的数据
|
||||
* lqw.eq(ZsjyEnrollmentProcess::getCurrentHandler, userId);
|
||||
* }
|
||||
*
|
||||
* // 排除已完成和已驳回的流程
|
||||
* lqw.notIn(ZsjyEnrollmentProcess::getCurrentStatus, "4", "9");
|
||||
*
|
||||
* Page<ZsjyEnrollmentProcessVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
* return TableDataInfo.build(result);
|
||||
* }
|
||||
*/
|
||||
|
||||
// 执行修复步骤
|
||||
console.log('前端权限控制修复脚本生成完成!');
|
||||
console.log('请按照以上说明修改相应的前端和后端代码。');
|
||||
console.log('修改完成后,请清除浏览器缓存并重新登录测试。');
|
||||
@@ -1,153 +0,0 @@
|
||||
# 用户权限修复指南
|
||||
|
||||
## 问题描述
|
||||
|
||||
zhanglaoshi和lililaoshi两个账号虽然应该有不同的权限和职责,但实际登录后看到的权限和数据是相同的。根据系统设计:
|
||||
|
||||
- **zhanglaoshi**:负责审核学生信息,应该只能看到状态为0和1的数据
|
||||
- **lililaoshi**:负责确认缴费和填写录取通知书号码,应该只能看到状态为2的数据
|
||||
|
||||
## 修复方案
|
||||
|
||||
我们已经准备了三个修复脚本文件:
|
||||
|
||||
1. `fix-user-role-permissions.sql`:修复数据库中的用户角色关联和权限配置
|
||||
2. `ZsjyEnrollmentProcessServiceImpl-fixed.java`:修复后端服务实现类中的数据过滤逻辑
|
||||
3. `fix-enrollmentProcess-view.vue`:修复前端页面中的权限控制和数据过滤
|
||||
|
||||
## 修复步骤
|
||||
|
||||
### 1. 修复数据库中的用户角色关联
|
||||
|
||||
执行以下SQL脚本修复数据库中的用户角色关联和权限配置:
|
||||
|
||||
```bash
|
||||
mysql -u root -p hzdyjs_xg < fix-user-role-permissions.sql
|
||||
```
|
||||
|
||||
或者直接在MySQL客户端中执行`fix-user-role-permissions.sql`文件中的SQL语句。
|
||||
|
||||
### 2. 修复后端服务实现类
|
||||
|
||||
1. 找到`ZsjyEnrollmentProcessServiceImpl.java`文件:
|
||||
|
||||
```bash
|
||||
find /path/to/project -name "ZsjyEnrollmentProcessServiceImpl.java"
|
||||
```
|
||||
|
||||
2. 备份原文件:
|
||||
|
||||
```bash
|
||||
cp /path/to/ZsjyEnrollmentProcessServiceImpl.java /path/to/ZsjyEnrollmentProcessServiceImpl.java.bak
|
||||
```
|
||||
|
||||
3. 用修复后的文件替换原文件:
|
||||
|
||||
```bash
|
||||
cp ZsjyEnrollmentProcessServiceImpl-fixed.java /path/to/ZsjyEnrollmentProcessServiceImpl.java
|
||||
```
|
||||
|
||||
### 3. 修复前端页面
|
||||
|
||||
1. 找到`enrollmentProcess/index.vue`文件:
|
||||
|
||||
```bash
|
||||
find /path/to/project -name "index.vue" | grep enrollmentProcess
|
||||
```
|
||||
|
||||
2. 备份原文件:
|
||||
|
||||
```bash
|
||||
cp /path/to/enrollmentProcess/index.vue /path/to/enrollmentProcess/index.vue.bak
|
||||
```
|
||||
|
||||
3. 根据`fix-enrollmentProcess-view.vue`文件中的代码片段修改原文件:
|
||||
|
||||
- 修改下拉菜单中的操作项,添加v-hasPermi指令
|
||||
- 添加用户角色判断辅助函数
|
||||
- 修改getList方法,根据用户角色过滤数据
|
||||
|
||||
### 4. 重启服务
|
||||
|
||||
1. 重新编译并启动后端服务:
|
||||
|
||||
```bash
|
||||
cd /path/to/backend
|
||||
mvn clean package
|
||||
./hot-start.sh
|
||||
```
|
||||
|
||||
2. 重新编译并启动前端服务:
|
||||
|
||||
```bash
|
||||
cd /path/to/web
|
||||
npm run build
|
||||
```
|
||||
|
||||
### 5. 清除缓存并重新登录
|
||||
|
||||
1. 清除浏览器缓存
|
||||
2. 重新登录系统
|
||||
3. 分别使用zhanglaoshi和lililaoshi账号测试
|
||||
|
||||
## 验证修复效果
|
||||
|
||||
### zhanglaoshi账号
|
||||
|
||||
1. 登录系统:用户名`zhanglaoshi`,密码`123456`
|
||||
2. 进入流程状态页面
|
||||
3. 验证是否只能看到状态为0和1的数据
|
||||
4. 验证是否只能看到"查看详情"和"信息审核"按钮
|
||||
5. 验证下拉菜单中是否没有"缴费确认"和"录取处理"等操作
|
||||
|
||||
### lililaoshi账号
|
||||
|
||||
1. 登录系统:用户名`lililaoshi`,密码`123456`
|
||||
2. 进入流程状态页面
|
||||
3. 验证是否只能看到状态为2的数据
|
||||
4. 验证是否只能看到"查看详情"和"录取处理"按钮
|
||||
5. 验证下拉菜单中是否有"缴费确认"操作,但没有"信息审核"操作
|
||||
|
||||
## 常见问题
|
||||
|
||||
### 1. 修复后仍然看到相同的数据和权限
|
||||
|
||||
可能原因:
|
||||
- 浏览器缓存未清除
|
||||
- 后端服务未重启
|
||||
- 权限缓存未更新
|
||||
|
||||
解决方法:
|
||||
- 清除浏览器缓存
|
||||
- 重启后端服务
|
||||
- 重新登录系统
|
||||
|
||||
### 2. 部分按钮仍然可见但点击无反应
|
||||
|
||||
可能原因:
|
||||
- 前端权限控制未完全修复
|
||||
- 后端接口权限验证生效
|
||||
|
||||
解决方法:
|
||||
- 检查前端v-hasPermi指令是否正确应用
|
||||
- 确认后端接口权限注解是否正确配置
|
||||
|
||||
### 3. 数据过滤不正确
|
||||
|
||||
可能原因:
|
||||
- 后端查询条件构建错误
|
||||
- 角色权限配置不正确
|
||||
|
||||
解决方法:
|
||||
- 检查后端查询条件构建逻辑
|
||||
- 验证角色权限配置是否正确
|
||||
|
||||
## 联系支持
|
||||
|
||||
如果在修复过程中遇到问题,请联系系统开发团队获取支持。
|
||||
|
||||
---
|
||||
|
||||
**修复日期**: 2025-07-21
|
||||
**修复人员**: Cursor AI
|
||||
**修复版本**: v1.0
|
||||
@@ -1,100 +0,0 @@
|
||||
-- 修复zhanglaoshi和lililaoshi的角色权限配置
|
||||
-- 作者:Cursor AI
|
||||
-- 日期:2025-07-21
|
||||
-- 说明:解决zhanglaoshi和lililaoshi账号权限配置问题
|
||||
|
||||
-- 1. 检查用户角色关联情况
|
||||
SELECT u.user_id, u.user_name, u.nick_name, r.role_id, r.role_name, r.role_key
|
||||
FROM sys_user u
|
||||
JOIN sys_user_role ur ON u.user_id = ur.user_id
|
||||
JOIN sys_role r ON ur.role_id = r.role_id
|
||||
WHERE u.user_name IN ('zhanglaoshi', 'lililaoshi');
|
||||
|
||||
-- 2. 删除现有的用户角色关联,确保没有错误配置
|
||||
DELETE FROM sys_user_role WHERE user_id IN (9001, 9002);
|
||||
|
||||
-- 3. 重新配置正确的用户角色关联
|
||||
-- zhanglaoshi(9001) -> 招生信息审核员(10)
|
||||
-- lililaoshi(9002) -> 招生录取处理员(11)
|
||||
INSERT INTO sys_user_role (user_id, role_id) VALUES
|
||||
(9001, 10), -- 张老师 -> 招生信息审核员
|
||||
(9002, 11); -- 李老师 -> 招生录取处理员
|
||||
|
||||
-- 4. 检查角色权限配置
|
||||
SELECT r.role_name, m.menu_name, m.perms
|
||||
FROM sys_role r
|
||||
JOIN sys_role_menu rm ON r.role_id = rm.role_id
|
||||
JOIN sys_menu m ON rm.menu_id = m.menu_id
|
||||
WHERE r.role_id IN (10, 11)
|
||||
ORDER BY r.role_id, m.menu_id;
|
||||
|
||||
-- 5. 确保招生信息审核员角色(10)有正确的权限
|
||||
-- 检查是否有信息审核权限
|
||||
SELECT COUNT(*) FROM sys_menu WHERE perms = 'zsjy:enrollmentProcess:audit';
|
||||
|
||||
-- 6. 确保招生录取处理员角色(11)有正确的权限
|
||||
-- 检查是否有录取处理权限
|
||||
SELECT COUNT(*) FROM sys_menu WHERE perms = 'zsjy:enrollmentProcess:process';
|
||||
|
||||
-- 7. 修复招生信息审核员角色(10)权限
|
||||
-- 如果需要添加缺失的信息审核权限
|
||||
INSERT IGNORE INTO sys_role_menu (role_id, menu_id)
|
||||
SELECT 10, menu_id FROM sys_menu WHERE perms = 'zsjy:enrollmentProcess:audit';
|
||||
|
||||
-- 移除不应有的录取处理权限
|
||||
DELETE FROM sys_role_menu
|
||||
WHERE role_id = 10
|
||||
AND menu_id IN (SELECT menu_id FROM sys_menu WHERE perms = 'zsjy:enrollmentProcess:process');
|
||||
|
||||
-- 8. 修复招生录取处理员角色(11)权限
|
||||
-- 如果需要添加缺失的录取处理权限
|
||||
INSERT IGNORE INTO sys_role_menu (role_id, menu_id)
|
||||
SELECT 11, menu_id FROM sys_menu WHERE perms = 'zsjy:enrollmentProcess:process';
|
||||
|
||||
-- 移除不应有的信息审核权限
|
||||
DELETE FROM sys_role_menu
|
||||
WHERE role_id = 11
|
||||
AND menu_id IN (SELECT menu_id FROM sys_menu WHERE perms = 'zsjy:enrollmentProcess:audit');
|
||||
|
||||
-- 9. 检查流程状态数据过滤
|
||||
-- 查看当前流程状态数据分配情况
|
||||
SELECT id, student_name, current_status, current_handler, current_handler_name
|
||||
FROM zsjy_enrollment_process
|
||||
WHERE deleted = 0
|
||||
ORDER BY current_status;
|
||||
|
||||
-- 10. 修复流程状态数据分配
|
||||
-- 确保状态0和1的流程分配给zhanglaoshi(9001)
|
||||
UPDATE zsjy_enrollment_process
|
||||
SET current_handler = 9001,
|
||||
current_handler_name = '张老师',
|
||||
update_time = NOW()
|
||||
WHERE current_status IN ('0', '1')
|
||||
AND deleted = 0;
|
||||
|
||||
-- 确保状态2的流程分配给lililaoshi(9002)
|
||||
UPDATE zsjy_enrollment_process
|
||||
SET current_handler = 9002,
|
||||
current_handler_name = '李老师',
|
||||
update_time = NOW()
|
||||
WHERE current_status = '2'
|
||||
AND deleted = 0;
|
||||
|
||||
-- 11. 最终验证
|
||||
-- 再次检查用户角色关联
|
||||
SELECT u.user_id, u.user_name, u.nick_name, r.role_id, r.role_name, r.role_key
|
||||
FROM sys_user u
|
||||
JOIN sys_user_role ur ON u.user_id = ur.user_id
|
||||
JOIN sys_role r ON ur.role_id = r.role_id
|
||||
WHERE u.user_name IN ('zhanglaoshi', 'lililaoshi');
|
||||
|
||||
-- 检查流程状态分配情况
|
||||
SELECT
|
||||
current_status,
|
||||
COUNT(*) as total_count,
|
||||
SUM(CASE WHEN current_handler = 9001 THEN 1 ELSE 0 END) as zhanglaoshi_count,
|
||||
SUM(CASE WHEN current_handler = 9002 THEN 1 ELSE 0 END) as lililaoshi_count
|
||||
FROM zsjy_enrollment_process
|
||||
WHERE deleted = 0
|
||||
GROUP BY current_status
|
||||
ORDER BY current_status;
|
||||
@@ -1,17 +0,0 @@
|
||||
-- 添加缴费状态字典类型和字典数据
|
||||
-- 执行时间:2025-07-22
|
||||
|
||||
-- 1. 添加字典类型
|
||||
INSERT INTO sys_dict_type (dict_id, dict_name, dict_type, create_by, create_time, update_by, update_time, remark)
|
||||
VALUES (1001, '缴费状态', 'zsjy_payment_status', 1, NOW(), NULL, NULL, '招生缴费状态选项');
|
||||
|
||||
-- 2. 添加字典数据
|
||||
INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, create_by, create_time, update_by, update_time, remark)
|
||||
VALUES
|
||||
(2001, 1, '未缴费', '0', 'zsjy_payment_status', '', 'warning', 'Y', 1, NOW(), NULL, NULL, '未缴费状态'),
|
||||
(2002, 2, '已缴费', '1', 'zsjy_payment_status', '', 'success', 'N', 1, NOW(), NULL, NULL, '已缴费状态');
|
||||
|
||||
-- 3. 更新现有数据,确保所有为NULL的缴费状态都设置为'0'(未缴费)
|
||||
UPDATE zsjy_enrollment_process
|
||||
SET payment_status = '0'
|
||||
WHERE payment_status IS NULL OR payment_status = '';
|
||||
@@ -1,14 +0,0 @@
|
||||
-- 调整新生录取流程菜单位置
|
||||
-- 创建时间: 2025-07-20
|
||||
-- 功能说明: 将新生录取流程菜单从招生迎新模块调整到招生就业模块的招生信息管理下面
|
||||
|
||||
-- 1. 查询当前菜单信息
|
||||
SELECT menu_id, menu_name, parent_id FROM sys_menu WHERE menu_id = 1904;
|
||||
|
||||
-- 2. 更新新生录取流程菜单的父菜单ID
|
||||
UPDATE sys_menu
|
||||
SET parent_id = 8100 -- 招生信息管理菜单的ID
|
||||
WHERE menu_id = 1904; -- 新生录取流程菜单的ID
|
||||
|
||||
-- 3. 确认更新结果
|
||||
SELECT menu_id, menu_name, parent_id FROM sys_menu WHERE menu_id = 1904;
|
||||
@@ -1,54 +0,0 @@
|
||||
-- 连接数据库
|
||||
-- 复制新生录取流程管理菜单权限配置脚本
|
||||
-- 新生录取流程菜单权限配置
|
||||
-- 创建时间: 2025-07-20
|
||||
-- 功能说明: 添加新生录取流程管理菜单及权限配置
|
||||
|
||||
-- 1. 在招生迎新模块下添加新生录取流程管理菜单
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
VALUES (1904, '新生录取流程', 1900, 3, 'enrollmentProcess', 'zsjy/enrollmentProcess/index', NULL, 1, 0, 'C', '0', '0', 'zsjy:enrollmentProcess:list', 'education', 1, SYSDATE(), NULL, NULL, '新生录取流程管理菜单');
|
||||
|
||||
-- 2. 添加对应的按钮权限
|
||||
-- 查询权限
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
VALUES (1904001, '新生录取流程查询', 1904, 1, '#', '', NULL, 1, 0, 'F', '0', '0', 'zsjy:enrollmentProcess:query', '#', 1, SYSDATE(), NULL, NULL, '');
|
||||
|
||||
-- 新增权限
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
VALUES (1904002, '新生录取流程新增', 1904, 2, '#', '', NULL, 1, 0, 'F', '0', '0', 'zsjy:enrollmentProcess:add', '#', 1, SYSDATE(), NULL, NULL, '');
|
||||
|
||||
-- 修改权限
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
VALUES (1904003, '新生录取流程修改', 1904, 3, '#', '', NULL, 1, 0, 'F', '0', '0', 'zsjy:enrollmentProcess:edit', '#', 1, SYSDATE(), NULL, NULL, '');
|
||||
|
||||
-- 删除权限
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
VALUES (1904004, '新生录取流程删除', 1904, 4, '#', '', NULL, 1, 0, 'F', '0', '0', 'zsjy:enrollmentProcess:remove', '#', 1, SYSDATE(), NULL, NULL, '');
|
||||
|
||||
-- 导出权限
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
VALUES (1904005, '新生录取流程导出', 1904, 5, '#', '', NULL, 1, 0, 'F', '0', '0', 'zsjy:enrollmentProcess:export', '#', 1, SYSDATE(), NULL, NULL, '');
|
||||
|
||||
-- 审核权限
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
VALUES (1904006, '信息审核', 1904, 6, '#', '', NULL, 1, 0, 'F', '0', '0', 'zsjy:enrollmentProcess:audit', '#', 1, SYSDATE(), NULL, NULL, '');
|
||||
|
||||
-- 录取处理权限
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
VALUES (1904007, '录取处理', 1904, 7, '#', '', NULL, 1, 0, 'F', '0', '0', 'zsjy:enrollmentProcess:process', '#', 1, SYSDATE(), NULL, NULL, '');
|
||||
|
||||
-- 最终审核权限
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
VALUES (1904008, '最终审核', 1904, 8, '#', '', NULL, 1, 0, 'F', '0', '0', 'zsjy:enrollmentProcess:finalAudit', '#', 1, SYSDATE(), NULL, NULL, '');
|
||||
|
||||
-- 流程重置权限
|
||||
INSERT INTO sys_menu (menu_id, menu_name, parent_id, order_num, path, component, query_param, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
VALUES (1904009, '流程重置', 1904, 9, '#', '', NULL, 1, 0, 'F', '0', '0', 'zsjy:enrollmentProcess:reset', '#', 1, SYSDATE(), NULL, NULL, '');
|
||||
|
||||
-- 3. 给管理员角色授权新增的所有菜单权限
|
||||
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||
SELECT 1, menu_id FROM sys_menu WHERE menu_id IN (1904, 1904001, 1904002, 1904003, 1904004, 1904005, 1904006, 1904007, 1904008, 1904009);
|
||||
|
||||
-- 4. 给招生管理员角色授权新增的所有菜单权限(假设招生管理员角色ID为2)
|
||||
INSERT INTO sys_role_menu (role_id, menu_id)
|
||||
SELECT 2, menu_id FROM sys_menu WHERE menu_id IN (1904, 1904001, 1904002, 1904003, 1904004, 1904005, 1904006, 1904007, 1904008, 1904009);
|
||||
@@ -1,25 +0,0 @@
|
||||
-- 修复字典值不匹配问题
|
||||
-- 执行时间:2025-07-22
|
||||
|
||||
-- 1. 更新zsjy_enrollment_process表中的is_completed字段值,从数字(0,1)转换为字符串("N","Y")
|
||||
UPDATE zsjy_enrollment_process
|
||||
SET is_completed = 'N'
|
||||
WHERE is_completed = 0 OR is_completed IS NULL;
|
||||
|
||||
UPDATE zsjy_enrollment_process
|
||||
SET is_completed = 'Y'
|
||||
WHERE is_completed = 1;
|
||||
|
||||
-- 2. 添加新的字典项,用于明确缴费状态值
|
||||
-- 先删除已存在的缴费状态字典数据,以防重复
|
||||
DELETE FROM sys_dict_data WHERE dict_type = 'zsjy_payment_status';
|
||||
|
||||
-- 重新添加带有明确CSS样式的缴费状态字典数据
|
||||
INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, create_by, create_time, remark)
|
||||
VALUES
|
||||
(2001, 1, '未缴费', '0', 'zsjy_payment_status', '', 'warning', 'Y', 1, NOW(), '未缴费状态'),
|
||||
(2002, 2, '已缴费', '1', 'zsjy_payment_status', '', 'success', 'N', 1, NOW(), '已缴费状态');
|
||||
|
||||
-- 3. 强制清除Redis缓存中的字典数据
|
||||
-- 注意:这一步可能需要管理员在Redis命令行中执行
|
||||
-- redis-cli -h [主机] -p [端口] -a [密码] KEYS "sys_dict:*" | xargs redis-cli -h [主机] -p [端口] -a [密码] DEL
|
||||
@@ -1,84 +0,0 @@
|
||||
-- 录取流程数据修复脚本
|
||||
-- 执行时间:2025-07-22
|
||||
-- 目标:确保所有录取流程记录的字段都有默认值,且状态统一为"录取处理中"
|
||||
|
||||
-- 1. 首先获取当前管理员用户ID和姓名,用于填充默认审核人信息
|
||||
SET @admin_id = 1; -- 默认管理员ID
|
||||
SET @admin_name = '系统管理员'; -- 默认管理员姓名
|
||||
|
||||
-- 2. 将所有状态更新为"录取处理中"
|
||||
UPDATE zsjy_enrollment_process
|
||||
SET current_status = '2',
|
||||
info_audit_status = '1',
|
||||
admission_status = '0',
|
||||
final_audit_status = '0'
|
||||
WHERE 1=1;
|
||||
|
||||
-- 3. 填充所有为NULL的基本信息字段
|
||||
UPDATE zsjy_enrollment_process
|
||||
SET
|
||||
-- 当前处理人信息
|
||||
current_handler = COALESCE(current_handler, @admin_id),
|
||||
current_handler_name = COALESCE(current_handler_name, @admin_name),
|
||||
|
||||
-- 信息审核相关字段
|
||||
info_audit_user = COALESCE(info_audit_user, @admin_id),
|
||||
info_audit_user_name = COALESCE(info_audit_user_name, @admin_name),
|
||||
info_audit_time = COALESCE(info_audit_time, NOW()),
|
||||
info_audit_opinion = COALESCE(info_audit_opinion, '系统默认审核通过'),
|
||||
|
||||
-- 录取处理相关字段
|
||||
admission_user = COALESCE(admission_user, NULL),
|
||||
admission_user_name = COALESCE(admission_user_name, NULL),
|
||||
admission_time = COALESCE(admission_time, NULL),
|
||||
admission_opinion = COALESCE(admission_opinion, NULL),
|
||||
|
||||
-- 最终确认相关字段
|
||||
final_audit_user = COALESCE(final_audit_user, NULL),
|
||||
final_audit_user_name = COALESCE(final_audit_user_name, NULL),
|
||||
final_audit_time = COALESCE(final_audit_time, NULL),
|
||||
final_audit_opinion = COALESCE(final_audit_opinion, NULL),
|
||||
|
||||
-- 其他状态字段
|
||||
payment_status = COALESCE(payment_status, '0'),
|
||||
is_completed = COALESCE(is_completed, 0),
|
||||
remark = COALESCE(remark, '系统自动修复的数据')
|
||||
WHERE 1=1;
|
||||
|
||||
-- 4. 确保报名信息审核通过同步到录取流程表
|
||||
-- 4.1 先找出所有已审核通过的报名信息
|
||||
INSERT INTO zsjy_enrollment_process (
|
||||
id, tenant_id, create_by, create_time, update_by, update_time, deleted,
|
||||
enrollment_id, student_name, id_card,
|
||||
current_status, current_handler, current_handler_name,
|
||||
info_audit_status, info_audit_user, info_audit_user_name, info_audit_time, info_audit_opinion,
|
||||
admission_status, final_audit_status, payment_status, is_completed
|
||||
)
|
||||
SELECT
|
||||
-- 生成雪花ID
|
||||
FLOOR(RAND() * 9000000000000000000) + 1000000000000000000 as id,
|
||||
a.tenant_id, @admin_id, NOW(), NULL, NULL, 0,
|
||||
-- 基本信息
|
||||
a.id, a.name, a.id_card,
|
||||
-- 流程状态信息
|
||||
'2' as current_status, @admin_id as current_handler, @admin_name as current_handler_name,
|
||||
'1' as info_audit_status, @admin_id as info_audit_user, @admin_name as info_audit_user_name,
|
||||
NOW() as info_audit_time, '系统自动审核通过' as info_audit_opinion,
|
||||
'0' as admission_status, '0' as final_audit_status, '0' as payment_status, 0 as is_completed
|
||||
FROM zsjy_enrollment_info a
|
||||
LEFT JOIN zsjy_enrollment_process b ON a.id = b.enrollment_id
|
||||
WHERE b.enrollment_id IS NULL
|
||||
AND a.enrollment_status = '2'; -- 只同步已审核通过的报名信息
|
||||
|
||||
-- 5. 确保数据库中的所有报名信息状态与录取流程状态一致
|
||||
UPDATE zsjy_enrollment_info a
|
||||
JOIN zsjy_enrollment_process b ON a.id = b.enrollment_id
|
||||
SET a.enrollment_status = b.current_status
|
||||
WHERE a.enrollment_status != b.current_status;
|
||||
|
||||
-- 6. 输出统计信息
|
||||
SELECT
|
||||
SUM(CASE WHEN current_status = '2' THEN 1 ELSE 0 END) AS '录取处理中数量',
|
||||
SUM(CASE WHEN info_audit_status = '1' THEN 1 ELSE 0 END) AS '信息已审核通过数量',
|
||||
COUNT(*) AS '总数据条数'
|
||||
FROM zsjy_enrollment_process;
|
||||
@@ -1,67 +0,0 @@
|
||||
-- 招生录取流程数据修复脚本
|
||||
-- 创建时间: 2025-07-20
|
||||
-- 功能说明: 修复录取流程表与报名信息表不一致的问题,以及缺失字段数据
|
||||
|
||||
-- 1. 为缺少流程记录的报名信息创建流程记录
|
||||
INSERT INTO zsjy_enrollment_process (
|
||||
id, tenant_id, create_by, create_time, update_by, update_time, deleted,
|
||||
enrollment_id, student_name, id_card, current_status, current_handler, current_handler_name,
|
||||
info_audit_status, admission_status, final_audit_status, payment_status, is_completed
|
||||
)
|
||||
SELECT
|
||||
FLOOR(RAND() * 9000000000000000000) + 1000000000000000000 as id, -- 生成一个随机的雪花ID
|
||||
a.tenant_id, 1, NOW(), NULL, NULL, 0,
|
||||
a.id, a.name, a.id_card, '0', 9001, '张老师',
|
||||
'0', '0', '0', '0', 0
|
||||
FROM zsjy_enrollment_info a
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM zsjy_enrollment_process b
|
||||
WHERE a.id = b.enrollment_id
|
||||
);
|
||||
|
||||
-- 2. 更新所有流程记录中空的处理人字段
|
||||
UPDATE zsjy_enrollment_process
|
||||
SET
|
||||
info_audit_user = CASE
|
||||
WHEN info_audit_status = '1' THEN current_handler
|
||||
ELSE NULL
|
||||
END,
|
||||
info_audit_user_name = CASE
|
||||
WHEN info_audit_status = '1' THEN current_handler_name
|
||||
ELSE NULL
|
||||
END,
|
||||
admission_user = CASE
|
||||
WHEN admission_status = '1' THEN current_handler
|
||||
ELSE NULL
|
||||
END,
|
||||
admission_user_name = CASE
|
||||
WHEN admission_status = '1' THEN current_handler_name
|
||||
ELSE NULL
|
||||
END,
|
||||
final_audit_user = CASE
|
||||
WHEN final_audit_status = '1' THEN current_handler
|
||||
ELSE NULL
|
||||
END,
|
||||
final_audit_user_name = CASE
|
||||
WHEN final_audit_status = '1' THEN current_handler_name
|
||||
ELSE NULL
|
||||
END
|
||||
WHERE
|
||||
info_audit_user IS NULL OR
|
||||
admission_user IS NULL OR
|
||||
final_audit_user IS NULL;
|
||||
|
||||
-- 3. 确保报名信息表和流程表的状态一致
|
||||
-- 将报名信息表中的状态更新为流程表中的状态
|
||||
UPDATE zsjy_enrollment_info a
|
||||
JOIN zsjy_enrollment_process b ON a.id = b.enrollment_id
|
||||
SET a.enrollment_status = b.current_status
|
||||
WHERE a.enrollment_status != b.current_status;
|
||||
|
||||
-- 4. 查看修复结果
|
||||
SELECT
|
||||
(SELECT COUNT(*) FROM zsjy_enrollment_info) AS total_enrollment_info,
|
||||
(SELECT COUNT(*) FROM zsjy_enrollment_process) AS total_enrollment_process,
|
||||
(SELECT COUNT(*) FROM zsjy_enrollment_info a
|
||||
WHERE NOT EXISTS (SELECT 1 FROM zsjy_enrollment_process b WHERE a.id = b.enrollment_id))
|
||||
AS missing_process;
|
||||
@@ -1,13 +0,0 @@
|
||||
-- 更新录取通知书字段默认值
|
||||
-- 执行时间:2025-07-22
|
||||
|
||||
-- 为所有NULL的录取通知书字段设置默认值
|
||||
UPDATE zsjy_enrollment_process
|
||||
SET notice_number = CONCAT('XG', DATE_FORMAT(NOW(), '%Y'), '-', LPAD(id % 10000, 4, '0'))
|
||||
WHERE notice_number IS NULL OR notice_number = '';
|
||||
|
||||
-- 更新特定记录的录取通知书和缴费状态,用于测试
|
||||
UPDATE zsjy_enrollment_process
|
||||
SET payment_status = '1',
|
||||
notice_number = CONCAT('XG', DATE_FORMAT(NOW(), '%Y'), '-TEST-', LPAD(id % 10000, 4, '0'))
|
||||
WHERE id IN (1946510098494091300, 1946510098494091301);
|
||||
@@ -0,0 +1,46 @@
|
||||
import request from '@/utils/request';
|
||||
import { ClassMsgForm, ClassMsgQuery, ClassMsgVO } from '../types';
|
||||
import { AxiosPromise } from 'axios';
|
||||
|
||||
// 查询班级信息-新版列表
|
||||
export function listClassMsg(query: ClassMsgQuery) {
|
||||
return request({
|
||||
url: '/classMsg/classMsg/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
// 查询班级信息-新版详细
|
||||
export function getClassMsg(id: string | number) {
|
||||
return request({
|
||||
url: `/classMsg/classMsg/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 新增班级信息-新版
|
||||
export function addClassMsg(data: ClassMsgForm) {
|
||||
return request({
|
||||
url: '/classMsg/classMsg',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 修改班级信息-新版
|
||||
export function updateClassMsg(data: ClassMsgForm) {
|
||||
return request({
|
||||
url: '/classMsg/classMsg',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 删除班级信息-新版
|
||||
export function delClassMsg(id: string | number) {
|
||||
return request({
|
||||
url: `/classMsg/classMsg/${id}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,336 @@
|
||||
export interface ClassMsgVO {
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 学院代码
|
||||
*/
|
||||
collegeId: string | number;
|
||||
|
||||
/**
|
||||
* 专业代码
|
||||
*/
|
||||
majorId: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className: string;
|
||||
|
||||
/**
|
||||
* 班级类型:1-中级工 2-高级工 3-预备技师 4-技师 5-中高职一体
|
||||
*/
|
||||
classType: string;
|
||||
|
||||
/**
|
||||
* 年级
|
||||
*/
|
||||
grade: string;
|
||||
|
||||
/**
|
||||
* 入学年份
|
||||
*/
|
||||
enrollmentYear: number;
|
||||
|
||||
/**
|
||||
* 毕业年份
|
||||
*/
|
||||
graduationYear: number;
|
||||
|
||||
/**
|
||||
* 班级状态:1-正常,2-暂停,3-毕业,4-解散
|
||||
*/
|
||||
classStatus: string;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
remark: string;
|
||||
|
||||
}
|
||||
|
||||
export interface ClassMsgForm extends BaseEntity {
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 学院代码
|
||||
*/
|
||||
collegeId?: string | number;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
collegeName?: string;
|
||||
|
||||
/**
|
||||
* 专业代码
|
||||
*/
|
||||
majorId?: string | number;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
majorName?: string;
|
||||
|
||||
/**
|
||||
* 班级代码
|
||||
*/
|
||||
classCode?: string;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 班级类型:1-中级工 2-高级工 3-预备技师 4-技师 5-中高职一体
|
||||
*/
|
||||
classType?: string;
|
||||
|
||||
/**
|
||||
* 年级
|
||||
*/
|
||||
grade?: string;
|
||||
|
||||
/**
|
||||
* 入学年份
|
||||
*/
|
||||
enrollmentYear?: number;
|
||||
|
||||
/**
|
||||
* 毕业年份
|
||||
*/
|
||||
graduationYear?: number;
|
||||
|
||||
/**
|
||||
* 培养方式:全日制,在职,函授,夜大等
|
||||
*/
|
||||
trainingType?: string;
|
||||
|
||||
/**
|
||||
* 学位类型:学士,硕士,博士,专科
|
||||
*/
|
||||
degreeType?: string;
|
||||
|
||||
/**
|
||||
* 辅导员ID
|
||||
*/
|
||||
counselorId?: string | number;
|
||||
|
||||
/**
|
||||
* 辅导员姓名
|
||||
*/
|
||||
counselorName?: string;
|
||||
|
||||
/**
|
||||
* 班主任ID
|
||||
*/
|
||||
classTeacherId?: string | number;
|
||||
|
||||
/**
|
||||
* 班主任姓名
|
||||
*/
|
||||
classTeacherName?: string;
|
||||
|
||||
/**
|
||||
* 班级导师ID
|
||||
*/
|
||||
classAdvisorId?: string | number;
|
||||
|
||||
/**
|
||||
* 班级导师姓名
|
||||
*/
|
||||
classAdvisorName?: string;
|
||||
|
||||
/**
|
||||
* 班长ID
|
||||
*/
|
||||
classMonitorId?: string | number;
|
||||
|
||||
/**
|
||||
* 班长姓名
|
||||
*/
|
||||
classMonitorName?: string;
|
||||
|
||||
/**
|
||||
* 副班长ID
|
||||
*/
|
||||
deputyMonitorId?: string | number;
|
||||
|
||||
/**
|
||||
* 副班长姓名
|
||||
*/
|
||||
deputyMonitorName?: string;
|
||||
|
||||
/**
|
||||
* 班级状态:1-正常,2-暂停,3-毕业,4-解散
|
||||
*/
|
||||
classStatus?: string;
|
||||
|
||||
/**
|
||||
* 是否已毕业:0-未毕业,1-已毕业
|
||||
*/
|
||||
isGraduation?: number;
|
||||
|
||||
/**
|
||||
* 毕业日期
|
||||
*/
|
||||
graduationDate?: string;
|
||||
|
||||
/**
|
||||
* 计划容量
|
||||
*/
|
||||
plannedCapacity?: number;
|
||||
|
||||
/**
|
||||
* 当前学生人数
|
||||
*/
|
||||
currentStudentCount?: number;
|
||||
|
||||
/**
|
||||
* 最大学生人数
|
||||
*/
|
||||
maxStudentCount?: number;
|
||||
|
||||
/**
|
||||
* 男生人数
|
||||
*/
|
||||
maleCount?: number;
|
||||
|
||||
/**
|
||||
* 女生人数
|
||||
*/
|
||||
femaleCount?: number;
|
||||
|
||||
/**
|
||||
* 在籍人数
|
||||
*/
|
||||
activeCount?: number;
|
||||
|
||||
/**
|
||||
* 转入人数
|
||||
*/
|
||||
transferInCount?: number;
|
||||
|
||||
/**
|
||||
* 转出人数
|
||||
*/
|
||||
transferOutCount?: number;
|
||||
|
||||
/**
|
||||
* 退学人数
|
||||
*/
|
||||
dropoutCount?: number;
|
||||
|
||||
/**
|
||||
* 毕业人数
|
||||
*/
|
||||
graduateCount?: number;
|
||||
|
||||
/**
|
||||
* 班级办公室位置
|
||||
*/
|
||||
officeLocation?: string;
|
||||
|
||||
/**
|
||||
* 班级教室位置
|
||||
*/
|
||||
classLocation?: string;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
contactPhone?: string;
|
||||
|
||||
/**
|
||||
* QQ群号
|
||||
*/
|
||||
qqGroup?: string;
|
||||
|
||||
/**
|
||||
* 微信群
|
||||
*/
|
||||
wechatGroup?: string;
|
||||
|
||||
/**
|
||||
* 班级邮箱
|
||||
*/
|
||||
email?: string;
|
||||
|
||||
/**
|
||||
* 课程安排(JSON格式)
|
||||
*/
|
||||
classSchedule?: string;
|
||||
|
||||
/**
|
||||
* 班级文化建设
|
||||
*/
|
||||
classCulture?: string;
|
||||
|
||||
/**
|
||||
* 班级规章制度
|
||||
*/
|
||||
classRules?: string;
|
||||
|
||||
/**
|
||||
* 班级描述
|
||||
*/
|
||||
classDescription?: string;
|
||||
|
||||
/**
|
||||
* 最后统计更新时间
|
||||
*/
|
||||
lastCountUpdate?: string;
|
||||
|
||||
/**
|
||||
* 备注信息
|
||||
*/
|
||||
remark?: string;
|
||||
|
||||
}
|
||||
|
||||
export interface ClassMsgQuery extends PageQuery {
|
||||
|
||||
/**
|
||||
* 学院代码
|
||||
*/
|
||||
collegeId?: string | number;
|
||||
|
||||
/**
|
||||
* 专业代码
|
||||
*/
|
||||
majorId?: string | number;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
className?: string;
|
||||
|
||||
/**
|
||||
* 班级类型:1-中级工 2-高级工 3-预备技师 4-技师 5-中高职一体
|
||||
*/
|
||||
classType?: string;
|
||||
|
||||
/**
|
||||
* 年级
|
||||
*/
|
||||
grade?: string;
|
||||
|
||||
/**
|
||||
* 班级状态:1-正常,2-暂停,3-毕业,4-解散
|
||||
*/
|
||||
classStatus?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import request from '@/utils/request';
|
||||
import { SysDeptVo } from './types';
|
||||
|
||||
// 获取学院列表
|
||||
export function listColleges() {
|
||||
return request({
|
||||
url: '/xg/college/list',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 获取学院和专业树形结构
|
||||
export function collegeTree() {
|
||||
return request({
|
||||
url: '/xg/college/tree',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 根据学院ID获取专业列表
|
||||
export function listMajorsByCollegeId(collegeId: string | number) {
|
||||
return request({
|
||||
url: `/xg/college/majors/${collegeId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
/** 部门视图对象 */
|
||||
export interface SysDeptVo {
|
||||
/** 部门id */
|
||||
deptId: number;
|
||||
/** 父部门id */
|
||||
parentId: number;
|
||||
/** 祖级列表 */
|
||||
ancestors: string;
|
||||
/** 部门名称 */
|
||||
deptName: string;
|
||||
/** 显示顺序 */
|
||||
orderNum: number;
|
||||
/** 负责人 */
|
||||
leader: string;
|
||||
/** 联系电话 */
|
||||
phone: string;
|
||||
/** 邮箱 */
|
||||
email: string;
|
||||
/** 部门状态:0正常,1停用 */
|
||||
status: string;
|
||||
/** 删除标志 */
|
||||
delFlag: string;
|
||||
/** 创建者 */
|
||||
createBy: number;
|
||||
/** 创建时间 */
|
||||
createTime: string;
|
||||
/** 更新者 */
|
||||
updateBy: number;
|
||||
/** 更新时间 */
|
||||
updateTime: string;
|
||||
/** 子部门 */
|
||||
children: SysDeptVo[];
|
||||
}
|
||||
|
||||
/** 班级查询参数 */
|
||||
export interface ClassMsgQuery {
|
||||
/** 学院代码 */
|
||||
collegeId?: number | string;
|
||||
/** 专业代码 */
|
||||
majorId?: number | string;
|
||||
/** 班级名称 */
|
||||
className?: string;
|
||||
/** 班级类型 */
|
||||
classType?: string | number;
|
||||
/** 年级 */
|
||||
grade?: string;
|
||||
/** 班级状态 */
|
||||
classStatus?: string | number;
|
||||
/** 分页大小 */
|
||||
pageSize: number;
|
||||
/** 当前页码 */
|
||||
pageNum: number;
|
||||
/** 其他参数 */
|
||||
params: Record<string, any>;
|
||||
}
|
||||
|
||||
/** 班级详细信息 */
|
||||
export interface ClassMsgVO {
|
||||
/** 主键ID */
|
||||
id: string | number;
|
||||
/** 学院代码 */
|
||||
collegeId?: string | number;
|
||||
/** 学院名称 */
|
||||
collegeName?: string;
|
||||
/** 专业代码 */
|
||||
majorId?: string | number;
|
||||
/** 专业名称 */
|
||||
majorName?: string;
|
||||
/** 班级代码 */
|
||||
classCode?: string;
|
||||
/** 班级名称 */
|
||||
className?: string;
|
||||
/** 班级类型 */
|
||||
classType?: string | number;
|
||||
/** 年级 */
|
||||
grade?: string;
|
||||
/** 入学年份 */
|
||||
enrollmentYear?: string;
|
||||
/** 毕业年份 */
|
||||
graduationYear?: string;
|
||||
/** 培养类型 */
|
||||
trainingType?: string;
|
||||
/** 学位类型 */
|
||||
degreeType?: string;
|
||||
/** 辅导员ID */
|
||||
counselorId?: string | number;
|
||||
/** 辅导员姓名 */
|
||||
counselorName?: string;
|
||||
/** 班主任ID */
|
||||
classTeacherId?: string | number;
|
||||
/** 班主任姓名 */
|
||||
classTeacherName?: string;
|
||||
/** 班级导师ID */
|
||||
classAdvisorId?: string | number;
|
||||
/** 班级导师姓名 */
|
||||
classAdvisorName?: string;
|
||||
/** 班长ID */
|
||||
classMonitorId?: string | number;
|
||||
/** 班长姓名 */
|
||||
classMonitorName?: string;
|
||||
/** 副班长ID */
|
||||
deputyMonitorId?: string | number;
|
||||
/** 副班长姓名 */
|
||||
deputyMonitorName?: string;
|
||||
/** 班级状态 */
|
||||
classStatus?: string | number;
|
||||
/** 是否已毕业 */
|
||||
isGraduation?: string | number;
|
||||
/** 毕业日期 */
|
||||
graduationDate?: string;
|
||||
/** 计划容量 */
|
||||
plannedCapacity?: number;
|
||||
/** 当前学生人数 */
|
||||
currentStudentCount?: number;
|
||||
/** 最大学生人数 */
|
||||
maxStudentCount?: number;
|
||||
/** 男生人数 */
|
||||
maleCount?: number;
|
||||
/** 女生人数 */
|
||||
femaleCount?: number;
|
||||
/** 在籍人数 */
|
||||
activeCount?: number;
|
||||
/** 转入人数 */
|
||||
transferInCount?: number;
|
||||
/** 转出人数 */
|
||||
transferOutCount?: number;
|
||||
/** 退学人数 */
|
||||
dropoutCount?: number;
|
||||
/** 毕业人数 */
|
||||
graduateCount?: number;
|
||||
/** 办公室位置 */
|
||||
officeLocation?: string;
|
||||
/** 教室位置 */
|
||||
classLocation?: string;
|
||||
/** 联系电话 */
|
||||
contactPhone?: string;
|
||||
/** QQ群号 */
|
||||
qqGroup?: string;
|
||||
/** 微信群 */
|
||||
wechatGroup?: string;
|
||||
/** 班级邮箱 */
|
||||
email?: string;
|
||||
/** 课程安排 */
|
||||
classSchedule?: string;
|
||||
/** 班级文化建设 */
|
||||
classCulture?: string;
|
||||
/** 班级规章制度 */
|
||||
classRules?: string;
|
||||
/** 班级描述 */
|
||||
classDescription?: string;
|
||||
/** 统计更新时间 */
|
||||
lastCountUpdate?: string;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/** 班级表单数据 */
|
||||
export interface ClassMsgForm extends ClassMsgVO {
|
||||
// 表单额外字段
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
/**
|
||||
* 班级班主任辅导员关联对象
|
||||
*/
|
||||
interface ClassTeacherCounselorRelBo {
|
||||
id?: number | string;
|
||||
classId?: number | string;
|
||||
teacherId?: number | string;
|
||||
teacherName?: string;
|
||||
counselorId?: number | string;
|
||||
counselorName?: string;
|
||||
relationType?: number; // 1:班主任 2:辅导员
|
||||
remark?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加班级班主任辅导员关联
|
||||
* @param data 班级班主任辅导员关联信息
|
||||
* @returns 返回添加结果
|
||||
*/
|
||||
export function addClassTeacherCounselorRel(data: ClassTeacherCounselorRelBo) {
|
||||
return request({
|
||||
url: '/teacherCounselorRel/classTeacherCounselorRel',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改班级班主任辅导员关联
|
||||
* @param data 班级班主任辅导员关联信息
|
||||
* @returns 返回修改结果
|
||||
*/
|
||||
export function updateClassTeacherCounselorRel(data: ClassTeacherCounselorRelBo) {
|
||||
return request({
|
||||
url: '/teacherCounselorRel/classTeacherCounselorRel',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询班级班主任辅导员关联列表
|
||||
* @param query 查询参数
|
||||
* @returns 返回班级班主任辅导员关联列表
|
||||
*/
|
||||
export function listClassTeacherCounselorRel(query: any) {
|
||||
return request({
|
||||
url: '/teacherCounselorRel/classTeacherCounselorRel/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取班级班主任辅导员关联详情
|
||||
* @param id 关联ID
|
||||
* @returns 返回班级班主任辅导员关联详情
|
||||
*/
|
||||
export function getClassTeacherCounselorRel(id: number | string) {
|
||||
return request({
|
||||
url: `/teacherCounselorRel/classTeacherCounselorRel/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除班级班主任辅导员关联
|
||||
* @param ids 关联ID数组
|
||||
* @returns 返回删除结果
|
||||
*/
|
||||
export function delClassTeacherCounselorRel(ids: number | string | (number | string)[]) {
|
||||
return request({
|
||||
url: `/teacherCounselorRel/classTeacherCounselorRel/${ids instanceof Array ? ids.join(',') : ids}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出班级班主任辅导员关联
|
||||
* @param query 查询参数
|
||||
* @returns 返回导出结果
|
||||
*/
|
||||
export function exportClassTeacherCounselorRel(query: any) {
|
||||
return request({
|
||||
url: '/teacherCounselorRel/classTeacherCounselorRel/export',
|
||||
method: 'post',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
});
|
||||
}
|
||||
@@ -14,5 +14,8 @@ import request from '@/utils/request';
|
||||
// export * from './scholarship' // 奖助管理
|
||||
// export * from './activity' // 活动管理
|
||||
|
||||
// 导出学工用户模块API
|
||||
export * from './sysUser'
|
||||
|
||||
// 临时导出一个空对象,防止编译错误
|
||||
export default {};
|
||||
@@ -0,0 +1,29 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
|
||||
/**
|
||||
* 用户信息对象
|
||||
*/
|
||||
export interface XgSysUser {
|
||||
userId: number | string;
|
||||
userName: string;
|
||||
nickName: string;
|
||||
email: string;
|
||||
phonenumber: string;
|
||||
sex: string;
|
||||
status: string;
|
||||
createTime: string;
|
||||
updateTime: string;
|
||||
deptId: number;
|
||||
deptName: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询有效用户列表
|
||||
*/
|
||||
export function getActiveUserList(): AxiosPromise<XgSysUser[]> {
|
||||
return request({
|
||||
url: '/xg/sysUser/activeList',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -46,7 +46,7 @@
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
:default-expand-all="isExpandAll"
|
||||
>
|
||||
<el-table-column prop="deptName" label="部门名称" width="260"></el-table-column>
|
||||
<el-table-column prop="deptName" label="部门名称" width="400"></el-table-column>
|
||||
<el-table-column prop="deptCategory" align="center" label="类别编码" width="200"></el-table-column>
|
||||
<el-table-column prop="orderNum" align="center" label="排序" width="200"></el-table-column>
|
||||
<el-table-column prop="status" align="center" label="状态" width="100">
|
||||
|
||||
Reference in new issue
Block a user