提交
This commit is contained in:
1 parent
df640dffad
commit
7e122d76dd
8 files changed
+474
-6
No files matched your search
+11
-1
@@ -5,7 +5,6 @@ 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;
|
||||
@@ -18,6 +17,7 @@ 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.XgStudentStatusChangeVo;
|
||||
import org.dromara.xg.domain.bo.XgStudentResumeWithClassChangeBo;
|
||||
import org.dromara.xg.domain.bo.XgStudentStatusChangeBo;
|
||||
import org.dromara.xg.service.IXgStudentStatusChangeService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
@@ -93,6 +93,16 @@ public class XgStudentStatusChangeController extends BaseController {
|
||||
return toAjax(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 复学并换班级(一次提交,事务化写入两条记录)
|
||||
*/
|
||||
@Log(title = "学生复学并换班级", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/resume-with-class-change")
|
||||
public R<Void> resumeWithClassChange(@Validated(AddGroup.class) @RequestBody XgStudentResumeWithClassChangeBo bo) {
|
||||
return toAjax(xgStudentStatusChangeService.insertResumeWithClassChange(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改学生学籍异动
|
||||
*/
|
||||
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
package org.dromara.xg.domain.bo;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 复学并换班级组合业务对象
|
||||
*
|
||||
* @author AI Assistant
|
||||
* @date 2026-03-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class XgStudentResumeWithClassChangeBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
@NotNull(message = "学生ID不能为空", groups = { AddGroup.class })
|
||||
private Long studentId;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
@NotBlank(message = "学号不能为空", groups = { AddGroup.class })
|
||||
private String studentNo;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
private String studentName;
|
||||
|
||||
/**
|
||||
* 原学院ID
|
||||
*/
|
||||
private Long originalCollegeId;
|
||||
|
||||
/**
|
||||
* 原学院名称
|
||||
*/
|
||||
private String originalCollegeName;
|
||||
|
||||
/**
|
||||
* 原专业ID
|
||||
*/
|
||||
private Long originalMajorId;
|
||||
|
||||
/**
|
||||
* 原专业名称
|
||||
*/
|
||||
private String originalMajorName;
|
||||
|
||||
/**
|
||||
* 原班级ID
|
||||
*/
|
||||
private Long originalClassId;
|
||||
|
||||
/**
|
||||
* 原班级名称
|
||||
*/
|
||||
private String originalClassName;
|
||||
|
||||
/**
|
||||
* 新学院ID
|
||||
*/
|
||||
@NotNull(message = "新学院不能为空", groups = { AddGroup.class })
|
||||
private Long newCollegeId;
|
||||
|
||||
/**
|
||||
* 新学院名称
|
||||
*/
|
||||
private String newCollegeName;
|
||||
|
||||
/**
|
||||
* 新专业ID
|
||||
*/
|
||||
@NotNull(message = "新专业不能为空", groups = { AddGroup.class })
|
||||
private Long newMajorId;
|
||||
|
||||
/**
|
||||
* 新专业名称
|
||||
*/
|
||||
private String newMajorName;
|
||||
|
||||
/**
|
||||
* 新班级ID
|
||||
*/
|
||||
@NotNull(message = "新班级不能为空", groups = { AddGroup.class })
|
||||
private Long newClassId;
|
||||
|
||||
/**
|
||||
* 新班级名称
|
||||
*/
|
||||
private String newClassName;
|
||||
|
||||
/**
|
||||
* 生效日期(复学与换班级共用)
|
||||
*/
|
||||
@NotNull(message = "生效时间不能为空", groups = { AddGroup.class })
|
||||
private Date effectiveDate;
|
||||
|
||||
/**
|
||||
* 原因(复学原因,同时作为换班级原因)
|
||||
*/
|
||||
@NotBlank(message = "原因不能为空", groups = { AddGroup.class })
|
||||
private String reason;
|
||||
|
||||
/**
|
||||
* 经办人ID
|
||||
*/
|
||||
private Long operatorId;
|
||||
|
||||
/**
|
||||
* 经办人姓名
|
||||
*/
|
||||
private String operatorName;
|
||||
}
|
||||
+9
@@ -1,6 +1,7 @@
|
||||
package org.dromara.xg.service;
|
||||
|
||||
import org.dromara.xg.domain.vo.XgStudentStatusChangeVo;
|
||||
import org.dromara.xg.domain.bo.XgStudentResumeWithClassChangeBo;
|
||||
import org.dromara.xg.domain.bo.XgStudentStatusChangeBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
@@ -49,6 +50,14 @@ public interface IXgStudentStatusChangeService {
|
||||
*/
|
||||
Boolean insertByBo(XgStudentStatusChangeBo bo);
|
||||
|
||||
/**
|
||||
* 复学并换班级(事务化组合提交)
|
||||
*
|
||||
* @param bo 组合业务参数
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertResumeWithClassChange(XgStudentResumeWithClassChangeBo bo);
|
||||
|
||||
/**
|
||||
* 修改学生学籍异动
|
||||
*
|
||||
|
||||
+57
-2
@@ -9,16 +9,19 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.exception.ServiceException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.dromara.xg.domain.bo.XgStudentClassChangeBo;
|
||||
import org.dromara.xg.domain.bo.XgStudentResumeWithClassChangeBo;
|
||||
import org.dromara.xg.domain.bo.XgStudentStatusChangeBo;
|
||||
import org.dromara.xg.domain.vo.XgStudentStatusChangeVo;
|
||||
import org.dromara.xg.domain.XgStudentStatusChange;
|
||||
import org.dromara.xg.mapper.XgStudentStatusChangeMapper;
|
||||
import org.dromara.xg.service.IXgStudentClassChangeService;
|
||||
import org.dromara.xg.service.IXgStudentStatusChangeService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
@@ -33,6 +36,7 @@ import java.util.Collection;
|
||||
public class XgStudentStatusChangeServiceImpl implements IXgStudentStatusChangeService {
|
||||
|
||||
private final XgStudentStatusChangeMapper baseMapper;
|
||||
private final IXgStudentClassChangeService xgStudentClassChangeService;
|
||||
|
||||
/**
|
||||
* 查询学生学籍异动
|
||||
@@ -73,7 +77,6 @@ public class XgStudentStatusChangeServiceImpl implements IXgStudentStatusChangeS
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<XgStudentStatusChange> buildQueryWrapper(XgStudentStatusChangeBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<XgStudentStatusChange> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getId() != null, XgStudentStatusChange::getId, bo.getId());
|
||||
lqw.eq(bo.getStudentId() != null, XgStudentStatusChange::getStudentId, bo.getStudentId());
|
||||
@@ -106,6 +109,58 @@ public class XgStudentStatusChangeServiceImpl implements IXgStudentStatusChangeS
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 复学并换班级(事务化组合提交)
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean insertResumeWithClassChange(XgStudentResumeWithClassChangeBo bo) {
|
||||
XgStudentStatusChangeBo statusChangeBo = new XgStudentStatusChangeBo();
|
||||
statusChangeBo.setStudentId(bo.getStudentId());
|
||||
statusChangeBo.setStudentNo(bo.getStudentNo());
|
||||
statusChangeBo.setChangeType("FU_XUE");
|
||||
statusChangeBo.setApplyDate(new java.util.Date());
|
||||
statusChangeBo.setEffectiveDate(bo.getEffectiveDate());
|
||||
statusChangeBo.setReason(bo.getReason());
|
||||
statusChangeBo.setOperatorId(bo.getOperatorId());
|
||||
statusChangeBo.setOperatorName(bo.getOperatorName());
|
||||
statusChangeBo.setSource("manual");
|
||||
statusChangeBo.setProcessStatus(0);
|
||||
|
||||
boolean statusInserted = insertByBo(statusChangeBo);
|
||||
if (!statusInserted) {
|
||||
throw new ServiceException("复学记录保存失败");
|
||||
}
|
||||
|
||||
XgStudentClassChangeBo classChangeBo = new XgStudentClassChangeBo();
|
||||
classChangeBo.setStudentId(bo.getStudentId());
|
||||
classChangeBo.setStudentNo(bo.getStudentNo());
|
||||
classChangeBo.setStudentName(bo.getStudentName());
|
||||
classChangeBo.setOriginalCollegeId(bo.getOriginalCollegeId());
|
||||
classChangeBo.setOriginalCollegeName(bo.getOriginalCollegeName());
|
||||
classChangeBo.setOriginalMajorId(bo.getOriginalMajorId());
|
||||
classChangeBo.setOriginalMajorName(bo.getOriginalMajorName());
|
||||
classChangeBo.setOriginalClassId(bo.getOriginalClassId());
|
||||
classChangeBo.setOriginalClassName(bo.getOriginalClassName());
|
||||
classChangeBo.setNewCollegeId(bo.getNewCollegeId());
|
||||
classChangeBo.setNewCollegeName(bo.getNewCollegeName());
|
||||
classChangeBo.setNewMajorId(bo.getNewMajorId());
|
||||
classChangeBo.setNewMajorName(bo.getNewMajorName());
|
||||
classChangeBo.setNewClassId(bo.getNewClassId());
|
||||
classChangeBo.setNewClassName(bo.getNewClassName());
|
||||
classChangeBo.setChangeReason(bo.getReason());
|
||||
classChangeBo.setChangeType("2");
|
||||
classChangeBo.setChangeTime(new java.util.Date());
|
||||
classChangeBo.setEffectiveTime(bo.getEffectiveDate());
|
||||
classChangeBo.setStatus("0");
|
||||
|
||||
boolean classInserted = xgStudentClassChangeService.insertByBo(classChangeBo);
|
||||
if (!classInserted) {
|
||||
throw new ServiceException("换班级记录保存失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改学生学籍异动
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user