提交代码修改
This commit is contained in:
1 parent
6a88159417
commit
6a0eeec01e
29 files changed
+3334
No files matched your search
+201
@@ -0,0 +1,201 @@
|
||||
package org.dromara.xg.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
||||
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.springframework.transaction.annotation.Transactional;
|
||||
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.XgStuColBatchClassVo;
|
||||
import org.dromara.xg.domain.bo.XgStuColBatchClassBo;
|
||||
import org.dromara.xg.domain.XgStuColBatchClass;
|
||||
import org.dromara.xg.service.IXgStuColBatchClassService;
|
||||
import org.dromara.xg.mapper.XgStuColBatchClassMapper;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
|
||||
/**
|
||||
* 学生信息收集批次班级权限
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-27
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/stuColBatchClass/stuColBatchClass")
|
||||
public class XgStuColBatchClassController extends BaseController {
|
||||
|
||||
private final IXgStuColBatchClassService xgStuColBatchClassService;
|
||||
private final XgStuColBatchClassMapper xgStuColBatchClassMapper;
|
||||
|
||||
/**
|
||||
* 查询学生信息收集批次班级权限列表
|
||||
*/
|
||||
@SaCheckPermission("stuColBatchClass:stuColBatchClass:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<XgStuColBatchClassVo> list(XgStuColBatchClassBo bo, PageQuery pageQuery) {
|
||||
return xgStuColBatchClassService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出学生信息收集批次班级权限列表
|
||||
*/
|
||||
@SaCheckPermission("stuColBatchClass:stuColBatchClass:export")
|
||||
@Log(title = "学生信息收集批次班级权限", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(XgStuColBatchClassBo bo, HttpServletResponse response) {
|
||||
List<XgStuColBatchClassVo> list = xgStuColBatchClassService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "学生信息收集批次班级权限", XgStuColBatchClassVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学生信息收集批次班级权限详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("stuColBatchClass:stuColBatchClass:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<XgStuColBatchClassVo> getInfo(@NotNull(message = "主键不能为空") @PathVariable Long id) {
|
||||
return R.ok(xgStuColBatchClassService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增学生信息收集批次班级权限
|
||||
*/
|
||||
@SaCheckPermission("stuColBatchClass:stuColBatchClass:add")
|
||||
@Log(title = "学生信息收集批次班级权限", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody XgStuColBatchClassBo bo) {
|
||||
return toAjax(xgStuColBatchClassService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改学生信息收集批次班级权限
|
||||
*/
|
||||
@SaCheckPermission("stuColBatchClass:stuColBatchClass:edit")
|
||||
@Log(title = "学生信息收集批次班级权限", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody XgStuColBatchClassBo bo) {
|
||||
return toAjax(xgStuColBatchClassService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除学生信息收集批次班级权限
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("stuColBatchClass:stuColBatchClass:remove")
|
||||
@Log(title = "学生信息收集批次班级权限", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] ids) {
|
||||
return toAjax(xgStuColBatchClassService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学生信息收集批次班级权限
|
||||
*
|
||||
* @param batchId 批次ID
|
||||
*/
|
||||
@SaCheckPermission("stuColBatchClass:stuColBatchClass:query")
|
||||
@GetMapping("/getScope/{batchId}")
|
||||
public R<List<Long>> getScope(@NotNull(message = "批次ID不能为空") @PathVariable Long batchId) {
|
||||
try {
|
||||
List<Long> classIds = xgStuColBatchClassMapper.selectClassIdsByBatchId(batchId);
|
||||
return R.ok(classIds);
|
||||
} catch (Exception e) {
|
||||
return R.fail("获取收集范围失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取批次配置的权限范围详细信息
|
||||
*
|
||||
* @param batchId 批次ID
|
||||
*/
|
||||
@SaCheckPermission("stuColBatchClass:stuColBatchClass:query")
|
||||
@GetMapping("/getScopeDetail/{batchId}")
|
||||
public R<List<XgStuColBatchClassVo>> getScopeDetail(@NotNull(message = "批次ID不能为空") @PathVariable Long batchId) {
|
||||
try {
|
||||
List<XgStuColBatchClassVo> scopeDetail = xgStuColBatchClassMapper.selectScopeDetailByBatchId(batchId);
|
||||
return R.ok(scopeDetail);
|
||||
} catch (Exception e) {
|
||||
return R.fail("获取权限范围详情失败:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置学生信息收集批次班级权限
|
||||
*
|
||||
* @param batchId 批次ID
|
||||
* @param deptIds 授权的班级ID列表
|
||||
*/
|
||||
@SaCheckPermission("stuColBatchClass:stuColBatchClass:setScope")
|
||||
@Log(title = "设置学生信息收集批次班级权限", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PostMapping("/setScope")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<Void> setScope(@RequestParam("batchId") @NotNull(message = "批次ID不能为空") Long batchId,
|
||||
@RequestParam("deptIds") @NotEmpty(message = "班级ID列表不能为空") List<Long> deptIds) {
|
||||
try {
|
||||
// 第一步:遍历deptIds,查询班级信息
|
||||
List<XgStuColBatchClassVo> classInfoList = xgStuColBatchClassMapper.selectClassInfoByDeptIds(deptIds);
|
||||
|
||||
if (classInfoList.isEmpty()) {
|
||||
return R.fail("未找到有效的班级信息");
|
||||
}
|
||||
|
||||
// 第二步:清理历史权限数据
|
||||
int clearCount = xgStuColBatchClassMapper.clearHistoryPermissions(batchId);
|
||||
|
||||
// 第三步:插入新的权限数据
|
||||
List<XgStuColBatchClass> batchClassList = new ArrayList<>();
|
||||
for (XgStuColBatchClassVo classInfo : classInfoList) {
|
||||
XgStuColBatchClass batchClass = new XgStuColBatchClass();
|
||||
batchClass.setBatchId(batchId);
|
||||
batchClass.setClassId(classInfo.getId());
|
||||
batchClass.setClassName(classInfo.getClassName());
|
||||
batchClass.setMajorId(classInfo.getMajorId());
|
||||
batchClass.setMajorName(classInfo.getMajorName());
|
||||
batchClass.setCollegeId(classInfo.getCollegeId());
|
||||
batchClass.setCollegeName(classInfo.getCollegeName());
|
||||
batchClass.setDeleted(0L);
|
||||
batchClassList.add(batchClass);
|
||||
}
|
||||
|
||||
// 批量插入新权限数据
|
||||
boolean insertResult = true;
|
||||
for (XgStuColBatchClass batchClass : batchClassList) {
|
||||
if (xgStuColBatchClassMapper.insert(batchClass) <= 0) {
|
||||
insertResult = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (insertResult) {
|
||||
return R.ok("权限设置成功,共设置 " + batchClassList.size() + " 个班级权限");
|
||||
} else {
|
||||
return R.fail("权限设置失败");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
return R.fail("权限设置异常:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
+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.XgStuColBatchVo;
|
||||
import org.dromara.xg.domain.bo.XgStuColBatchBo;
|
||||
import org.dromara.xg.service.IXgStuColBatchService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 学生信息收集批次
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-27
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/XgStuColBatch/stuColBatch")
|
||||
public class XgStuColBatchController extends BaseController {
|
||||
|
||||
private final IXgStuColBatchService xgStuColBatchService;
|
||||
|
||||
/**
|
||||
* 查询学生信息收集批次列表
|
||||
*/
|
||||
@SaCheckPermission("XgStuColBatch:stuColBatch:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<XgStuColBatchVo> list(XgStuColBatchBo bo, PageQuery pageQuery) {
|
||||
return xgStuColBatchService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出学生信息收集批次列表
|
||||
*/
|
||||
@SaCheckPermission("XgStuColBatch:stuColBatch:export")
|
||||
@Log(title = "学生信息收集批次", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(XgStuColBatchBo bo, HttpServletResponse response) {
|
||||
List<XgStuColBatchVo> list = xgStuColBatchService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "学生信息收集批次", XgStuColBatchVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学生信息收集批次详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("XgStuColBatch:stuColBatch:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<XgStuColBatchVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(xgStuColBatchService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增学生信息收集批次
|
||||
*/
|
||||
@SaCheckPermission("XgStuColBatch:stuColBatch:add")
|
||||
@Log(title = "学生信息收集批次", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody XgStuColBatchBo bo) {
|
||||
return toAjax(xgStuColBatchService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改学生信息收集批次
|
||||
*/
|
||||
@SaCheckPermission("XgStuColBatch:stuColBatch:edit")
|
||||
@Log(title = "学生信息收集批次", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody XgStuColBatchBo bo) {
|
||||
return toAjax(xgStuColBatchService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除学生信息收集批次
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("XgStuColBatch:stuColBatch:remove")
|
||||
@Log(title = "学生信息收集批次", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(xgStuColBatchService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
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_stu_col_batch
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("xg_stu_col_batch")
|
||||
public class XgStuColBatch extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 批次ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 批次名称
|
||||
*/
|
||||
private String batchName;
|
||||
|
||||
/**
|
||||
* 批次描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 收集类型 1 - 新学期收集 2 - 其他
|
||||
*/
|
||||
private String collectionType;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@TableLogic(value = "0", delval = "1")
|
||||
private Long deleted;
|
||||
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 学生信息收集批次班级权限对象 xg_stu_col_batch_class
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("xg_stu_col_batch_class")
|
||||
public class XgStuColBatchClass extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 批次ID
|
||||
*/
|
||||
private Long batchId;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
private Long majorId;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
private String majorName;
|
||||
|
||||
/**
|
||||
* 院系ID
|
||||
*/
|
||||
private Long collegeId;
|
||||
|
||||
/**
|
||||
* 院系名称
|
||||
*/
|
||||
private String collegeName;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@TableLogic(value = "0", delval = "1")
|
||||
private Long deleted;
|
||||
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package org.dromara.xg.domain.bo;
|
||||
|
||||
import org.dromara.xg.domain.XgStuColBatch;
|
||||
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_stu_col_batch
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = XgStuColBatch.class, reverseConvertGenerate = false)
|
||||
public class XgStuColBatchBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 批次ID
|
||||
*/
|
||||
@NotNull(message = "批次ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 批次名称
|
||||
*/
|
||||
@NotBlank(message = "批次名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String batchName;
|
||||
|
||||
/**
|
||||
* 批次描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@NotNull(message = "开始时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@NotNull(message = "结束时间不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@NotBlank(message = "状态(0正常 1停用)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 收集类型 1 - 新学期收集 2 - 其他
|
||||
*/
|
||||
@NotBlank(message = "收集类型 1 - 新学期收集 2 - 其他不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String collectionType;
|
||||
|
||||
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package org.dromara.xg.domain.bo;
|
||||
|
||||
import org.dromara.xg.domain.XgStuColBatchClass;
|
||||
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.*;
|
||||
|
||||
/**
|
||||
* 学生信息收集批次班级权限业务对象 xg_stu_col_batch_class
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-27
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = XgStuColBatchClass.class, reverseConvertGenerate = false)
|
||||
public class XgStuColBatchClassBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@NotNull(message = "主键ID不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 批次ID
|
||||
*/
|
||||
@NotNull(message = "批次ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long batchId;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
@NotNull(message = "班级ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
@NotBlank(message = "班级名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
private Long majorId;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
private String majorName;
|
||||
|
||||
/**
|
||||
* 院系ID
|
||||
*/
|
||||
private Long collegeId;
|
||||
|
||||
/**
|
||||
* 院系名称
|
||||
*/
|
||||
private String collegeName;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
private Long deleted;
|
||||
|
||||
|
||||
}
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
package org.dromara.xg.domain.vo;
|
||||
|
||||
import org.dromara.xg.domain.XgStuColBatchClass;
|
||||
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;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
/**
|
||||
* 学生信息收集批次班级权限视图对象 xg_stu_col_batch_class
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-27
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = XgStuColBatchClass.class)
|
||||
public class XgStuColBatchClassVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 批次ID
|
||||
*/
|
||||
@ExcelProperty(value = "批次ID")
|
||||
private Long batchId;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
@ExcelProperty(value = "班级ID")
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
@ExcelProperty(value = "班级名称")
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
@ExcelProperty(value = "专业ID")
|
||||
private Long majorId;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
@ExcelProperty(value = "专业名称")
|
||||
private String majorName;
|
||||
|
||||
/**
|
||||
* 院系ID
|
||||
*/
|
||||
@ExcelProperty(value = "院系ID")
|
||||
private Long collegeId;
|
||||
|
||||
/**
|
||||
* 院系名称
|
||||
*/
|
||||
@ExcelProperty(value = "院系名称")
|
||||
private String collegeName;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@ExcelProperty(value = "删除标志", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=代表存在,1=代表删除")
|
||||
private Long deleted;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
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;
|
||||
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
package org.dromara.xg.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.xg.domain.XgStuColBatch;
|
||||
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_stu_col_batch
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-27
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = XgStuColBatch.class)
|
||||
public class XgStuColBatchVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 批次ID
|
||||
*/
|
||||
@ExcelProperty(value = "批次ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 批次名称
|
||||
*/
|
||||
@ExcelProperty(value = "批次名称")
|
||||
private String batchName;
|
||||
|
||||
/**
|
||||
* 批次描述
|
||||
*/
|
||||
@ExcelProperty(value = "批次描述")
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@ExcelProperty(value = "开始时间")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@ExcelProperty(value = "结束时间")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=正常,1=停用")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 收集类型 1 - 新学期收集 2 - 其他
|
||||
*/
|
||||
@ExcelProperty(value = "收集类型 1 - 新学期收集 2 - 其他")
|
||||
private String collectionType;
|
||||
|
||||
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package org.dromara.xg.mapper;
|
||||
|
||||
import org.dromara.xg.domain.XgStuColBatchClass;
|
||||
import org.dromara.xg.domain.vo.XgStuColBatchClassVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 学生信息收集批次班级权限Mapper接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-27
|
||||
*/
|
||||
public interface XgStuColBatchClassMapper extends BaseMapperPlus<XgStuColBatchClass, XgStuColBatchClassVo> {
|
||||
|
||||
/**
|
||||
* 清理指定批次的历史权限数据
|
||||
*
|
||||
* @param batchId 批次ID
|
||||
* @return 影响的行数
|
||||
*/
|
||||
int clearHistoryPermissions(@Param("batchId") Long batchId);
|
||||
|
||||
/**
|
||||
* 根据部门ID列表查询班级信息
|
||||
*
|
||||
* @param deptIds 部门ID列表
|
||||
* @return 班级信息列表
|
||||
*/
|
||||
List<XgStuColBatchClassVo> selectClassInfoByDeptIds(@Param("deptIds") List<Long> deptIds);
|
||||
|
||||
/**
|
||||
* 根据批次ID查询班级ID列表
|
||||
*
|
||||
* @param batchId 批次ID
|
||||
* @return 班级ID列表
|
||||
*/
|
||||
List<Long> selectClassIdsByBatchId(@Param("batchId") Long batchId);
|
||||
|
||||
/**
|
||||
* 根据批次ID查询权限范围详细信息
|
||||
*
|
||||
* @param batchId 批次ID
|
||||
* @return 权限范围详细信息列表
|
||||
*/
|
||||
List<XgStuColBatchClassVo> selectScopeDetailByBatchId(@Param("batchId") Long batchId);
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package org.dromara.xg.mapper;
|
||||
|
||||
import org.dromara.xg.domain.XgStuColBatch;
|
||||
import org.dromara.xg.domain.vo.XgStuColBatchVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 学生信息收集批次Mapper接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-27
|
||||
*/
|
||||
public interface XgStuColBatchMapper extends BaseMapperPlus<XgStuColBatch, XgStuColBatchVo> {
|
||||
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package org.dromara.xg.service;
|
||||
|
||||
import org.dromara.xg.domain.vo.XgStuColBatchClassVo;
|
||||
import org.dromara.xg.domain.bo.XgStuColBatchClassBo;
|
||||
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-27
|
||||
*/
|
||||
public interface IXgStuColBatchClassService {
|
||||
|
||||
/**
|
||||
* 查询学生信息收集批次班级权限
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 学生信息收集批次班级权限
|
||||
*/
|
||||
XgStuColBatchClassVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询学生信息收集批次班级权限列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 学生信息收集批次班级权限分页列表
|
||||
*/
|
||||
TableDataInfo<XgStuColBatchClassVo> queryPageList(XgStuColBatchClassBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的学生信息收集批次班级权限列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 学生信息收集批次班级权限列表
|
||||
*/
|
||||
List<XgStuColBatchClassVo> queryList(XgStuColBatchClassBo bo);
|
||||
|
||||
/**
|
||||
* 新增学生信息收集批次班级权限
|
||||
*
|
||||
* @param bo 学生信息收集批次班级权限
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(XgStuColBatchClassBo bo);
|
||||
|
||||
/**
|
||||
* 修改学生信息收集批次班级权限
|
||||
*
|
||||
* @param bo 学生信息收集批次班级权限
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(XgStuColBatchClassBo 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.XgStuColBatchVo;
|
||||
import org.dromara.xg.domain.bo.XgStuColBatchBo;
|
||||
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-27
|
||||
*/
|
||||
public interface IXgStuColBatchService {
|
||||
|
||||
/**
|
||||
* 查询学生信息收集批次
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 学生信息收集批次
|
||||
*/
|
||||
XgStuColBatchVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询学生信息收集批次列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 学生信息收集批次分页列表
|
||||
*/
|
||||
TableDataInfo<XgStuColBatchVo> queryPageList(XgStuColBatchBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的学生信息收集批次列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 学生信息收集批次列表
|
||||
*/
|
||||
List<XgStuColBatchVo> queryList(XgStuColBatchBo bo);
|
||||
|
||||
/**
|
||||
* 新增学生信息收集批次
|
||||
*
|
||||
* @param bo 学生信息收集批次
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(XgStuColBatchBo bo);
|
||||
|
||||
/**
|
||||
* 修改学生信息收集批次
|
||||
*
|
||||
* @param bo 学生信息收集批次
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(XgStuColBatchBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除学生信息收集批次信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
+139
@@ -0,0 +1,139 @@
|
||||
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 lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.xg.domain.bo.XgStuColBatchClassBo;
|
||||
import org.dromara.xg.domain.vo.XgStuColBatchClassVo;
|
||||
import org.dromara.xg.domain.XgStuColBatchClass;
|
||||
import org.dromara.xg.mapper.XgStuColBatchClassMapper;
|
||||
import org.dromara.xg.service.IXgStuColBatchClassService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 学生信息收集批次班级权限Service业务层处理
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-27
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class XgStuColBatchClassServiceImpl implements IXgStuColBatchClassService {
|
||||
|
||||
private final XgStuColBatchClassMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询学生信息收集批次班级权限
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 学生信息收集批次班级权限
|
||||
*/
|
||||
@Override
|
||||
public XgStuColBatchClassVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询学生信息收集批次班级权限列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 学生信息收集批次班级权限分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<XgStuColBatchClassVo> queryPageList(XgStuColBatchClassBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<XgStuColBatchClass> lqw = buildQueryWrapper(bo);
|
||||
Page<XgStuColBatchClassVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的学生信息收集批次班级权限列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 学生信息收集批次班级权限列表
|
||||
*/
|
||||
@Override
|
||||
public List<XgStuColBatchClassVo> queryList(XgStuColBatchClassBo bo) {
|
||||
LambdaQueryWrapper<XgStuColBatchClass> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<XgStuColBatchClass> buildQueryWrapper(XgStuColBatchClassBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<XgStuColBatchClass> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(XgStuColBatchClass::getId);
|
||||
lqw.eq(bo.getBatchId() != null, XgStuColBatchClass::getBatchId, bo.getBatchId());
|
||||
lqw.eq(bo.getClassId() != null, XgStuColBatchClass::getClassId, bo.getClassId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getClassName()), XgStuColBatchClass::getClassName, bo.getClassName());
|
||||
lqw.eq(bo.getMajorId() != null, XgStuColBatchClass::getMajorId, bo.getMajorId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getMajorName()), XgStuColBatchClass::getMajorName, bo.getMajorName());
|
||||
lqw.eq(bo.getCollegeId() != null, XgStuColBatchClass::getCollegeId, bo.getCollegeId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCollegeName()), XgStuColBatchClass::getCollegeName, bo.getCollegeName());
|
||||
lqw.eq(bo.getDeleted() != null, XgStuColBatchClass::getDeleted, bo.getDeleted());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增学生信息收集批次班级权限
|
||||
*
|
||||
* @param bo 学生信息收集批次班级权限
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(XgStuColBatchClassBo bo) {
|
||||
XgStuColBatchClass add = MapstructUtils.convert(bo, XgStuColBatchClass.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改学生信息收集批次班级权限
|
||||
*
|
||||
* @param bo 学生信息收集批次班级权限
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(XgStuColBatchClassBo bo) {
|
||||
XgStuColBatchClass update = MapstructUtils.convert(bo, XgStuColBatchClass.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(XgStuColBatchClass entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除学生信息收集批次班级权限信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
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 lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.xg.domain.bo.XgStuColBatchBo;
|
||||
import org.dromara.xg.domain.vo.XgStuColBatchVo;
|
||||
import org.dromara.xg.domain.XgStuColBatch;
|
||||
import org.dromara.xg.mapper.XgStuColBatchMapper;
|
||||
import org.dromara.xg.service.IXgStuColBatchService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 学生信息收集批次Service业务层处理
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-07-27
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class XgStuColBatchServiceImpl implements IXgStuColBatchService {
|
||||
|
||||
private final XgStuColBatchMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询学生信息收集批次
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 学生信息收集批次
|
||||
*/
|
||||
@Override
|
||||
public XgStuColBatchVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询学生信息收集批次列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 学生信息收集批次分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<XgStuColBatchVo> queryPageList(XgStuColBatchBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<XgStuColBatch> lqw = buildQueryWrapper(bo);
|
||||
Page<XgStuColBatchVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的学生信息收集批次列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 学生信息收集批次列表
|
||||
*/
|
||||
@Override
|
||||
public List<XgStuColBatchVo> queryList(XgStuColBatchBo bo) {
|
||||
LambdaQueryWrapper<XgStuColBatch> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<XgStuColBatch> buildQueryWrapper(XgStuColBatchBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<XgStuColBatch> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(XgStuColBatch::getId);
|
||||
lqw.like(StringUtils.isNotBlank(bo.getBatchName()), XgStuColBatch::getBatchName, bo.getBatchName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), XgStuColBatch::getStatus, bo.getStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCollectionType()), XgStuColBatch::getCollectionType, bo.getCollectionType());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增学生信息收集批次
|
||||
*
|
||||
* @param bo 学生信息收集批次
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(XgStuColBatchBo bo) {
|
||||
XgStuColBatch add = MapstructUtils.convert(bo, XgStuColBatch.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改学生信息收集批次
|
||||
*
|
||||
* @param bo 学生信息收集批次
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(XgStuColBatchBo bo) {
|
||||
XgStuColBatch update = MapstructUtils.convert(bo, XgStuColBatch.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(XgStuColBatch entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除学生信息收集批次信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
+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.XgStuColBatchMapper">
|
||||
|
||||
</mapper>
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
<?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.XgStuColBatchClassMapper">
|
||||
|
||||
<resultMap id="XgStuColBatchClassVoResult" type="org.dromara.xg.domain.vo.XgStuColBatchClassVo">
|
||||
<id property="id" column="id"/>
|
||||
<result property="batchId" column="batch_id"/>
|
||||
<result property="classId" column="class_id"/>
|
||||
<result property="className" column="class_name"/>
|
||||
<result property="majorId" column="major_id"/>
|
||||
<result property="majorName" column="major_name"/>
|
||||
<result property="collegeId" column="college_id"/>
|
||||
<result property="collegeName" column="college_name"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="deleted" column="deleted"/>
|
||||
<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>
|
||||
|
||||
<!-- 清理指定批次的历史权限数据 -->
|
||||
<update id="clearHistoryPermissions">
|
||||
UPDATE xg_stu_col_batch_class
|
||||
SET deleted = 1
|
||||
WHERE batch_id = #{batchId}
|
||||
</update>
|
||||
|
||||
<!-- 根据部门ID列表查询班级信息 -->
|
||||
<select id="selectClassInfoByDeptIds" resultMap="XgStuColBatchClassVoResult">
|
||||
SELECT
|
||||
c.id,
|
||||
c.college_id,
|
||||
c.college_name,
|
||||
c.major_id,
|
||||
c.major_name,
|
||||
c.class_name,
|
||||
c.create_by,
|
||||
c.create_time,
|
||||
c.update_by,
|
||||
c.update_time
|
||||
FROM xg_class_msg c
|
||||
WHERE c.id IN
|
||||
<foreach collection="deptIds" item="deptId" open="(" separator="," close=")">
|
||||
#{deptId}
|
||||
</foreach>
|
||||
AND c.deleted = 0
|
||||
AND c.class_status = '1'
|
||||
</select>
|
||||
|
||||
<!-- 根据批次ID查询班级ID列表 -->
|
||||
<select id="selectClassIdsByBatchId" resultType="java.lang.Long">
|
||||
SELECT class_id
|
||||
FROM xg_stu_col_batch_class
|
||||
WHERE batch_id = #{batchId}
|
||||
AND deleted = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据批次ID查询权限范围详细信息 -->
|
||||
<select id="selectScopeDetailByBatchId" resultMap="XgStuColBatchClassVoResult">
|
||||
SELECT
|
||||
id,
|
||||
batch_id,
|
||||
class_id,
|
||||
class_name,
|
||||
major_id,
|
||||
major_name,
|
||||
college_id,
|
||||
college_name,
|
||||
remark,
|
||||
deleted,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
FROM xg_stu_col_batch_class
|
||||
WHERE batch_id = #{batchId}
|
||||
AND deleted = 0
|
||||
ORDER BY college_name, major_name, class_name
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in new issue
Block a user