提交代码

This commit is contained in:
zlwu committed 2025-07-27 11:52:17 +08:00
1 parent 6a0eeec01e
commit eda12ddf59
13 files changed
+4629

No files matched your search

@@ -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.XgStudentMsgBatchVo;
import org.dromara.xg.domain.bo.XgStudentMsgBatchBo;
import org.dromara.xg.service.IXgStudentMsgBatchService;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
* 学生信息批次收集
*
* @author zlwu
* @date 2025-07-27
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/studentMsgBatch/studentMsgBatch")
public class XgStudentMsgBatchController extends BaseController {
private final IXgStudentMsgBatchService xgStudentMsgBatchService;
/**
* 查询学生信息批次收集列表
*/
@SaCheckPermission("studentMsgBatch:studentMsgBatch:list")
@GetMapping("/list")
public TableDataInfo<XgStudentMsgBatchVo> list(XgStudentMsgBatchBo bo, PageQuery pageQuery) {
return xgStudentMsgBatchService.queryPageList(bo, pageQuery);
}
/**
* 导出学生信息批次收集列表
*/
@SaCheckPermission("studentMsgBatch:studentMsgBatch:export")
@Log(title = "学生信息批次收集", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(XgStudentMsgBatchBo bo, HttpServletResponse response) {
List<XgStudentMsgBatchVo> list = xgStudentMsgBatchService.queryList(bo);
ExcelUtil.exportExcel(list, "学生信息批次收集", XgStudentMsgBatchVo.class, response);
}
/**
* 获取学生信息批次收集详细信息
*
* @param id 主键
*/
@SaCheckPermission("studentMsgBatch:studentMsgBatch:query")
@GetMapping("/{id}")
public R<XgStudentMsgBatchVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long id) {
return R.ok(xgStudentMsgBatchService.queryById(id));
}
/**
* 新增学生信息批次收集
*/
@SaCheckPermission("studentMsgBatch:studentMsgBatch:add")
@Log(title = "学生信息批次收集", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody XgStudentMsgBatchBo bo) {
return toAjax(xgStudentMsgBatchService.insertByBo(bo));
}
/**
* 修改学生信息批次收集
*/
@SaCheckPermission("studentMsgBatch:studentMsgBatch:edit")
@Log(title = "学生信息批次收集", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody XgStudentMsgBatchBo bo) {
return toAjax(xgStudentMsgBatchService.updateByBo(bo));
}
/**
* 删除学生信息批次收集
*
* @param ids 主键串
*/
@SaCheckPermission("studentMsgBatch:studentMsgBatch:remove")
@Log(title = "学生信息批次收集", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] ids) {
return toAjax(xgStudentMsgBatchService.deleteWithValidByIds(List.of(ids), true));
}
}
@@ -0,0 +1,553 @@
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_student_msg_batch
*
* @author zlwu
* @date 2025-07-27
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("xg_student_msg_batch")
public class XgStudentMsgBatch 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 String studentNo;
/**
* 身份证号
*/
private String idCard;
/**
* 姓名
*/
private String name;
/**
* 英文姓名
*/
private String nameEnglish;
/**
* 曾用名
*/
private String formerName;
/**
* 性别:0-男,1-女
*/
private String gender;
/**
* 出生日期
*/
private Date birthDate;
/**
* 民族
*/
private String nationality;
/**
* 籍贯
*/
private String nativePlace;
/**
* 政治面貌
*/
private String politicalStatus;
/**
* 户籍所在地
*/
private String hukouLocation;
/**
* 家庭地址
*/
private String homeAddress;
/**
* 现住址
*/
private String currentAddress;
/**
* 邮政编码
*/
private String postalCode;
/**
* 照片URL
*/
private String photoUrl;
/**
* 学生照片存储路径
*/
private String photoPath;
/**
* 手机号码
*/
private String phone;
/**
* 是否住校:0-否,1-是
*/
private Long isBoarder;
/**
* 文化程度
*/
private String educationLevel;
/**
* 户口类型:农业、非农业
*/
private String householdRegisterType;
/**
* 宗教信仰
*/
private String religion;
/**
* 生源地区(省市县)
*/
private String sourceRegion;
/**
* 毕业院校
*/
private String graduateSchool;
/**
* 电子邮箱
*/
private String email;
/**
* QQ号码
*/
private String qq;
/**
* 微信号
*/
private String wechat;
/**
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
*/
private String maritalStatus;
/**
* 紧急联系人姓名
*/
private String emergencyContactName;
/**
* 紧急联系人电话
*/
private String emergencyContactPhone;
/**
* 紧急联系人关系
*/
private String emergencyContactRelation;
/**
* 是否贫困生:0-否,1-是
*/
private Long isPoorStudent;
/**
* 是否少数民族:0-否,1-是
*/
private Long isMinority;
/**
* 是否残疾:0-否,1-是
*/
private Long isDisabled;
/**
* 是否孤儿:0-否,1-是
*/
private Long isOrphan;
/**
* 是否留守儿童:0-否,1-是
*/
private Long isLeftBehindChild;
/**
* 是否独生子女:0-否,1-是
*/
private Long isSingleChild;
/**
* 是否低保:0-否,1-是
*/
private Long isLowIncome;
/**
* 是否有助学贷款:0-否,1-是
*/
private Long hasLoan;
/**
* 助学贷款金额
*/
private Long loanAmount;
/**
* 特长爱好
*/
private String specialties;
/**
* 获奖情况
*/
private String awards;
/**
* 违纪记录
*/
private String violations;
/**
* 社会活动
*/
private String socialActivities;
/**
* 父亲姓名
*/
private String fatherName;
/**
* 父亲电话
*/
private String fatherPhone;
/**
* 父亲工作单位
*/
private String fatherWorkUnit;
/**
* 母亲姓名
*/
private String motherName;
/**
* 母亲电话
*/
private String motherPhone;
/**
* 母亲工作单位
*/
private String motherWorkUnit;
/**
* 监护人姓名
*/
private String guardianName;
/**
* 监护人电话
*/
private String guardianPhone;
/**
* 监护人关系
*/
private String guardianRelation;
/**
* 家庭年收入
*/
private Long familyIncome;
/**
* 人均收入
*/
private Long perCapitaIncome;
/**
* 收入来源
*/
private String incomeSource;
/**
* 家庭经济状况:富裕、一般、困难、特困
*/
private String familyEconomicStatus;
/**
* 家庭成员数量
*/
private Long familyMembers;
/**
* 身高(cm)
*/
private Long height;
/**
* 体重(kg)
*/
private Long weight;
/**
* 血型
*/
private String bloodType;
/**
* 健康状况
*/
private String healthStatus;
/**
* 特殊体质或疾病
*/
private String specialCondition;
/**
* 病史
*/
private String medicalHistory;
/**
* 过敏史
*/
private String allergies;
/**
* 残疾类型 1 - 视力残疾 2 - 听力残疾 3 - 智力残疾 9 - 其他残疾
*/
private String disabilityType;
/**
* 残疾等级
*/
private String disabilityLevel;
/**
* 录取类别:统招、自主招生、专项计划等
*/
private String admissionCategory;
/**
* 学籍状态:1-在籍,2-休学,3-复学,4-退学,5-毕业
*/
private String studentStatus;
/**
* 入学年份
*/
private Long enrollmentYear;
/**
* 入学日期
*/
private Date enrollmentDate;
/**
* 银行卡号
*/
private String bankCardNo;
/**
* 开户银行
*/
private String bankName;
/**
* 开户支行
*/
private String bankBranch;
/**
* 持卡人姓名
*/
private String cardHolderName;
/**
* 信息状态:1-正常,2-待审核,3-审核中,4-已驳回,5-已锁定
*/
private String infoStatus;
/**
* 数据来源:manual-手工录入,import-批量导入,sync-系统同步
*/
private String dataSource;
/**
* 最后修改批次ID
*/
private Long lastBatchId;
/**
* 最后审核时间
*/
private Date lastAuditTime;
/**
* 信息是否完整:0-不完整,1-完整
*/
private Long isComplete;
/**
* 完整度百分比
*/
private Long completionRate;
/**
* 学制(年)- 预留,数据从班级表关联
*/
private Long schoolSystem;
/**
* 学历层次 - 预留,数据从班级表关联
*/
private String academicLevel;
/**
* 培养方式:全日制、在职、函授、夜大等 - 预留,数据从班级表关联
*/
private String trainingType;
/**
* 专业id - 预留,数据从班级表关联
*/
private String majorId;
/**
* 专业名称 - 预留,数据从班级表关联
*/
private String majorName;
/**
* 班级id - 预留,数据从班级表关联
*/
private String classId;
/**
* 班级名称 - 预留,数据从班级表关联
*/
private String className;
/**
* 年级 - 预留,数据从班级表关联
*/
private String grade;
/**
* 学院id - 预留,数据从班级表关联
*/
private String collegeId;
/**
* 学院名称 - 预留,数据从班级表关联
*/
private String collegeName;
/**
* 辅导员ID - 预留,数据从班级表关联
*/
private Long counselorId;
/**
* 辅导员姓名 - 预留,数据从班级表关联
*/
private String counselorName;
/**
* 班主任ID - 预留,数据从班级表关联
*/
private Long classTeacherId;
/**
* 班主任姓名 - 预留,数据从班级表关联
*/
private String classTeacherName;
/**
* 宿舍楼栋 - 预留,数据从班级表关联
*/
private String dormitoryBuilding;
/**
* 宿舍房间号 - 预留,数据从班级表关联
*/
private String dormitoryRoom;
/**
* 扩展字段1
*/
private String extField1;
/**
* 扩展字段2
*/
private String extField2;
/**
* 扩展字段3
*/
private String extField3;
/**
* 扩展字段4
*/
private String extField4;
/**
* 扩展字段5
*/
private String extField5;
/**
* 备注信息
*/
private String remark;
/**
* 正在进行中的批次id
*/
private Long batchId;
}
@@ -0,0 +1,556 @@
package org.dromara.xg.domain.bo;
import org.dromara.xg.domain.XgStudentMsgBatch;
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_student_msg_batch
*
* @author zlwu
* @date 2025-07-27
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = XgStudentMsgBatch.class, reverseConvertGenerate = false)
public class XgStudentMsgBatchBo extends BaseEntity {
/**
* 主键ID(雪花ID)
*/
@NotNull(message = "主键ID(雪花ID)不能为空", groups = { EditGroup.class })
private Long id;
/**
* 删除标志(0代表存在 1代表删除)
*/
private Long deleted;
/**
* 学号
*/
@NotBlank(message = "学号不能为空", groups = { AddGroup.class, EditGroup.class })
private String studentNo;
/**
* 身份证号
*/
private String idCard;
/**
* 姓名
*/
@NotBlank(message = "姓名不能为空", groups = { AddGroup.class, EditGroup.class })
private String name;
/**
* 英文姓名
*/
private String nameEnglish;
/**
* 曾用名
*/
private String formerName;
/**
* 性别:0-男,1-女
*/
@NotBlank(message = "性别:0-男,1-女不能为空", groups = { AddGroup.class, EditGroup.class })
private String gender;
/**
* 出生日期
*/
private Date birthDate;
/**
* 民族
*/
private String nationality;
/**
* 籍贯
*/
private String nativePlace;
/**
* 政治面貌
*/
private String politicalStatus;
/**
* 户籍所在地
*/
private String hukouLocation;
/**
* 家庭地址
*/
private String homeAddress;
/**
* 现住址
*/
private String currentAddress;
/**
* 邮政编码
*/
private String postalCode;
/**
* 照片URL
*/
private String photoUrl;
/**
* 学生照片存储路径
*/
private String photoPath;
/**
* 手机号码
*/
private String phone;
/**
* 是否住校:0-否,1-是
*/
private Long isBoarder;
/**
* 文化程度
*/
private String educationLevel;
/**
* 户口类型:农业、非农业
*/
private String householdRegisterType;
/**
* 宗教信仰
*/
private String religion;
/**
* 生源地区(省市县)
*/
private String sourceRegion;
/**
* 毕业院校
*/
private String graduateSchool;
/**
* 电子邮箱
*/
private String email;
/**
* QQ号码
*/
private String qq;
/**
* 微信号
*/
private String wechat;
/**
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
*/
private String maritalStatus;
/**
* 紧急联系人姓名
*/
private String emergencyContactName;
/**
* 紧急联系人电话
*/
private String emergencyContactPhone;
/**
* 紧急联系人关系
*/
private String emergencyContactRelation;
/**
* 是否贫困生:0-否,1-是
*/
private Long isPoorStudent;
/**
* 是否少数民族:0-否,1-是
*/
private Long isMinority;
/**
* 是否残疾:0-否,1-是
*/
private Long isDisabled;
/**
* 是否孤儿:0-否,1-是
*/
private Long isOrphan;
/**
* 是否留守儿童:0-否,1-是
*/
private Long isLeftBehindChild;
/**
* 是否独生子女:0-否,1-是
*/
private Long isSingleChild;
/**
* 是否低保:0-否,1-是
*/
private Long isLowIncome;
/**
* 是否有助学贷款:0-否,1-是
*/
private Long hasLoan;
/**
* 助学贷款金额
*/
private Long loanAmount;
/**
* 特长爱好
*/
private String specialties;
/**
* 获奖情况
*/
private String awards;
/**
* 违纪记录
*/
private String violations;
/**
* 社会活动
*/
private String socialActivities;
/**
* 父亲姓名
*/
private String fatherName;
/**
* 父亲电话
*/
private String fatherPhone;
/**
* 父亲工作单位
*/
private String fatherWorkUnit;
/**
* 母亲姓名
*/
private String motherName;
/**
* 母亲电话
*/
private String motherPhone;
/**
* 母亲工作单位
*/
private String motherWorkUnit;
/**
* 监护人姓名
*/
private String guardianName;
/**
* 监护人电话
*/
private String guardianPhone;
/**
* 监护人关系
*/
private String guardianRelation;
/**
* 家庭年收入
*/
private Long familyIncome;
/**
* 人均收入
*/
private Long perCapitaIncome;
/**
* 收入来源
*/
private String incomeSource;
/**
* 家庭经济状况:富裕、一般、困难、特困
*/
private String familyEconomicStatus;
/**
* 家庭成员数量
*/
private Long familyMembers;
/**
* 身高(cm)
*/
private Long height;
/**
* 体重(kg)
*/
private Long weight;
/**
* 血型
*/
private String bloodType;
/**
* 健康状况
*/
private String healthStatus;
/**
* 特殊体质或疾病
*/
private String specialCondition;
/**
* 病史
*/
private String medicalHistory;
/**
* 过敏史
*/
private String allergies;
/**
* 残疾类型 1 - 视力残疾 2 - 听力残疾 3 - 智力残疾 9 - 其他残疾
*/
private String disabilityType;
/**
* 残疾等级
*/
private String disabilityLevel;
/**
* 录取类别:统招、自主招生、专项计划等
*/
private String admissionCategory;
/**
* 学籍状态:1-在籍,2-休学,3-复学,4-退学,5-毕业
*/
private String studentStatus;
/**
* 入学年份
*/
private Long enrollmentYear;
/**
* 入学日期
*/
private Date enrollmentDate;
/**
* 银行卡号
*/
private String bankCardNo;
/**
* 开户银行
*/
private String bankName;
/**
* 开户支行
*/
private String bankBranch;
/**
* 持卡人姓名
*/
private String cardHolderName;
/**
* 信息状态:1-正常,2-待审核,3-审核中,4-已驳回,5-已锁定
*/
private String infoStatus;
/**
* 数据来源:manual-手工录入,import-批量导入,sync-系统同步
*/
private String dataSource;
/**
* 最后修改批次ID
*/
private Long lastBatchId;
/**
* 最后审核时间
*/
private Date lastAuditTime;
/**
* 信息是否完整:0-不完整,1-完整
*/
private Long isComplete;
/**
* 完整度百分比
*/
private Long completionRate;
/**
* 学制(年)- 预留,数据从班级表关联
*/
private Long schoolSystem;
/**
* 学历层次 - 预留,数据从班级表关联
*/
private String academicLevel;
/**
* 培养方式:全日制、在职、函授、夜大等 - 预留,数据从班级表关联
*/
private String trainingType;
/**
* 专业id - 预留,数据从班级表关联
*/
private String majorId;
/**
* 专业名称 - 预留,数据从班级表关联
*/
private String majorName;
/**
* 班级id - 预留,数据从班级表关联
*/
private String classId;
/**
* 班级名称 - 预留,数据从班级表关联
*/
private String className;
/**
* 年级 - 预留,数据从班级表关联
*/
private String grade;
/**
* 学院id - 预留,数据从班级表关联
*/
private String collegeId;
/**
* 学院名称 - 预留,数据从班级表关联
*/
private String collegeName;
/**
* 辅导员ID - 预留,数据从班级表关联
*/
private Long counselorId;
/**
* 辅导员姓名 - 预留,数据从班级表关联
*/
private String counselorName;
/**
* 班主任ID - 预留,数据从班级表关联
*/
private Long classTeacherId;
/**
* 班主任姓名 - 预留,数据从班级表关联
*/
private String classTeacherName;
/**
* 宿舍楼栋 - 预留,数据从班级表关联
*/
private String dormitoryBuilding;
/**
* 宿舍房间号 - 预留,数据从班级表关联
*/
private String dormitoryRoom;
/**
* 扩展字段1
*/
private String extField1;
/**
* 扩展字段2
*/
private String extField2;
/**
* 扩展字段3
*/
private String extField3;
/**
* 扩展字段4
*/
private String extField4;
/**
* 扩展字段5
*/
private String extField5;
/**
* 备注信息
*/
private String remark;
/**
* 正在进行中的批次id
*/
@NotNull(message = "正在进行中的批次id不能为空", groups = { AddGroup.class, EditGroup.class })
private Long batchId;
}
@@ -0,0 +1,670 @@
package org.dromara.xg.domain.vo;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.xg.domain.XgStudentMsgBatch;
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_student_msg_batch
*
* @author zlwu
* @date 2025-07-27
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = XgStudentMsgBatch.class)
public class XgStudentMsgBatchVo 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;
/**
* 学号
*/
@ExcelProperty(value = "学号")
private String studentNo;
/**
* 身份证号
*/
@ExcelProperty(value = "身份证号")
private String idCard;
/**
* 姓名
*/
@ExcelProperty(value = "姓名")
private String name;
/**
* 英文姓名
*/
@ExcelProperty(value = "英文姓名")
private String nameEnglish;
/**
* 曾用名
*/
@ExcelProperty(value = "曾用名")
private String formerName;
/**
* 性别:0-男,1-女
*/
@ExcelProperty(value = "性别:0-男,1-女")
private String gender;
/**
* 出生日期
*/
@ExcelProperty(value = "出生日期")
private Date birthDate;
/**
* 民族
*/
@ExcelProperty(value = "民族 ")
private String nationality;
/**
* 籍贯
*/
@ExcelProperty(value = "籍贯")
private String nativePlace;
/**
* 政治面貌
*/
@ExcelProperty(value = "政治面貌")
private String politicalStatus;
/**
* 户籍所在地
*/
@ExcelProperty(value = "户籍所在地")
private String hukouLocation;
/**
* 家庭地址
*/
@ExcelProperty(value = "家庭地址")
private String homeAddress;
/**
* 现住址
*/
@ExcelProperty(value = "现住址")
private String currentAddress;
/**
* 邮政编码
*/
@ExcelProperty(value = "邮政编码")
private String postalCode;
/**
* 照片URL
*/
@ExcelProperty(value = "照片URL")
private String photoUrl;
/**
* 学生照片存储路径
*/
@ExcelProperty(value = "学生照片存储路径")
private String photoPath;
/**
* 手机号码
*/
@ExcelProperty(value = "手机号码")
private String phone;
/**
* 是否住校:0-否,1-是
*/
@ExcelProperty(value = "是否住校:0-否,1-是")
private Long isBoarder;
/**
* 文化程度
*/
@ExcelProperty(value = "文化程度")
private String educationLevel;
/**
* 户口类型:农业、非农业
*/
@ExcelProperty(value = "户口类型:农业、非农业")
private String householdRegisterType;
/**
* 宗教信仰
*/
@ExcelProperty(value = "宗教信仰")
private String religion;
/**
* 生源地区(省市县)
*/
@ExcelProperty(value = "生源地区", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "省=市县")
private String sourceRegion;
/**
* 毕业院校
*/
@ExcelProperty(value = "毕业院校")
private String graduateSchool;
/**
* 电子邮箱
*/
@ExcelProperty(value = "电子邮箱")
private String email;
/**
* QQ号码
*/
@ExcelProperty(value = "QQ号码")
private String qq;
/**
* 微信号
*/
@ExcelProperty(value = "微信号")
private String wechat;
/**
* 婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶
*/
@ExcelProperty(value = "婚姻状况:1 未婚、2 已婚、3 离异、4 丧偶 ")
private String maritalStatus;
/**
* 紧急联系人姓名
*/
@ExcelProperty(value = "紧急联系人姓名")
private String emergencyContactName;
/**
* 紧急联系人电话
*/
@ExcelProperty(value = "紧急联系人电话")
private String emergencyContactPhone;
/**
* 紧急联系人关系
*/
@ExcelProperty(value = "紧急联系人关系")
private String emergencyContactRelation;
/**
* 是否贫困生:0-否,1-是
*/
@ExcelProperty(value = "是否贫困生:0-否,1-是")
private Long isPoorStudent;
/**
* 是否少数民族:0-否,1-是
*/
@ExcelProperty(value = "是否少数民族:0-否,1-是")
private Long isMinority;
/**
* 是否残疾:0-否,1-是
*/
@ExcelProperty(value = "是否残疾:0-否,1-是")
private Long isDisabled;
/**
* 是否孤儿:0-否,1-是
*/
@ExcelProperty(value = "是否孤儿:0-否,1-是")
private Long isOrphan;
/**
* 是否留守儿童:0-否,1-是
*/
@ExcelProperty(value = "是否留守儿童:0-否,1-是")
private Long isLeftBehindChild;
/**
* 是否独生子女:0-否,1-是
*/
@ExcelProperty(value = "是否独生子女:0-否,1-是")
private Long isSingleChild;
/**
* 是否低保:0-否,1-是
*/
@ExcelProperty(value = "是否低保:0-否,1-是")
private Long isLowIncome;
/**
* 是否有助学贷款:0-否,1-是
*/
@ExcelProperty(value = "是否有助学贷款:0-否,1-是")
private Long hasLoan;
/**
* 助学贷款金额
*/
@ExcelProperty(value = "助学贷款金额")
private Long loanAmount;
/**
* 特长爱好
*/
@ExcelProperty(value = "特长爱好")
private String specialties;
/**
* 获奖情况
*/
@ExcelProperty(value = "获奖情况")
private String awards;
/**
* 违纪记录
*/
@ExcelProperty(value = "违纪记录")
private String violations;
/**
* 社会活动
*/
@ExcelProperty(value = "社会活动")
private String socialActivities;
/**
* 父亲姓名
*/
@ExcelProperty(value = "父亲姓名")
private String fatherName;
/**
* 父亲电话
*/
@ExcelProperty(value = "父亲电话")
private String fatherPhone;
/**
* 父亲工作单位
*/
@ExcelProperty(value = "父亲工作单位")
private String fatherWorkUnit;
/**
* 母亲姓名
*/
@ExcelProperty(value = "母亲姓名")
private String motherName;
/**
* 母亲电话
*/
@ExcelProperty(value = "母亲电话")
private String motherPhone;
/**
* 母亲工作单位
*/
@ExcelProperty(value = "母亲工作单位")
private String motherWorkUnit;
/**
* 监护人姓名
*/
@ExcelProperty(value = "监护人姓名")
private String guardianName;
/**
* 监护人电话
*/
@ExcelProperty(value = "监护人电话")
private String guardianPhone;
/**
* 监护人关系
*/
@ExcelProperty(value = "监护人关系")
private String guardianRelation;
/**
* 家庭年收入
*/
@ExcelProperty(value = "家庭年收入")
private Long familyIncome;
/**
* 人均收入
*/
@ExcelProperty(value = "人均收入")
private Long perCapitaIncome;
/**
* 收入来源
*/
@ExcelProperty(value = "收入来源")
private String incomeSource;
/**
* 家庭经济状况:富裕、一般、困难、特困
*/
@ExcelProperty(value = "家庭经济状况:富裕、一般、困难、特困")
private String familyEconomicStatus;
/**
* 家庭成员数量
*/
@ExcelProperty(value = "家庭成员数量")
private Long familyMembers;
/**
* 身高(cm)
*/
@ExcelProperty(value = "身高", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "c=m")
private Long height;
/**
* 体重(kg)
*/
@ExcelProperty(value = "体重", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "k=g")
private Long weight;
/**
* 血型
*/
@ExcelProperty(value = "血型")
private String bloodType;
/**
* 健康状况
*/
@ExcelProperty(value = "健康状况")
private String healthStatus;
/**
* 特殊体质或疾病
*/
@ExcelProperty(value = "特殊体质或疾病")
private String specialCondition;
/**
* 病史
*/
@ExcelProperty(value = "病史")
private String medicalHistory;
/**
* 过敏史
*/
@ExcelProperty(value = "过敏史")
private String allergies;
/**
* 残疾类型 1 - 视力残疾 2 - 听力残疾 3 - 智力残疾 9 - 其他残疾
*/
@ExcelProperty(value = "残疾类型 1 - 视力残疾 2 - 听力残疾 3 - 智力残疾 9 - 其他残疾")
private String disabilityType;
/**
* 残疾等级
*/
@ExcelProperty(value = "残疾等级")
private String disabilityLevel;
/**
* 录取类别:统招、自主招生、专项计划等
*/
@ExcelProperty(value = "录取类别:统招、自主招生、专项计划等")
private String admissionCategory;
/**
* 学籍状态:1-在籍,2-休学,3-复学,4-退学,5-毕业
*/
@ExcelProperty(value = "学籍状态:1-在籍,2-休学,3-复学,4-退学,5-毕业")
private String studentStatus;
/**
* 入学年份
*/
@ExcelProperty(value = "入学年份")
private Long enrollmentYear;
/**
* 入学日期
*/
@ExcelProperty(value = "入学日期")
private Date enrollmentDate;
/**
* 银行卡号
*/
@ExcelProperty(value = "银行卡号")
private String bankCardNo;
/**
* 开户银行
*/
@ExcelProperty(value = "开户银行")
private String bankName;
/**
* 开户支行
*/
@ExcelProperty(value = "开户支行")
private String bankBranch;
/**
* 持卡人姓名
*/
@ExcelProperty(value = "持卡人姓名")
private String cardHolderName;
/**
* 信息状态:1-正常,2-待审核,3-审核中,4-已驳回,5-已锁定
*/
@ExcelProperty(value = "信息状态:1-正常,2-待审核,3-审核中,4-已驳回,5-已锁定")
private String infoStatus;
/**
* 数据来源:manual-手工录入,import-批量导入,sync-系统同步
*/
@ExcelProperty(value = "数据来源:manual-手工录入,import-批量导入,sync-系统同步")
private String dataSource;
/**
* 最后修改批次ID
*/
@ExcelProperty(value = "最后修改批次ID")
private Long lastBatchId;
/**
* 最后审核时间
*/
@ExcelProperty(value = "最后审核时间")
private Date lastAuditTime;
/**
* 信息是否完整:0-不完整,1-完整
*/
@ExcelProperty(value = "信息是否完整:0-不完整,1-完整")
private Long isComplete;
/**
* 完整度百分比
*/
@ExcelProperty(value = "完整度百分比")
private Long completionRate;
/**
* 学制(年)- 预留,数据从班级表关联
*/
@ExcelProperty(value = "学制", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "年=")
private Long schoolSystem;
/**
* 学历层次 - 预留,数据从班级表关联
*/
@ExcelProperty(value = "学历层次 - 预留,数据从班级表关联")
private String academicLevel;
/**
* 培养方式:全日制、在职、函授、夜大等 - 预留,数据从班级表关联
*/
@ExcelProperty(value = "培养方式:全日制、在职、函授、夜大等 - 预留,数据从班级表关联")
private String trainingType;
/**
* 专业id - 预留,数据从班级表关联
*/
@ExcelProperty(value = "专业id - 预留,数据从班级表关联")
private String majorId;
/**
* 专业名称 - 预留,数据从班级表关联
*/
@ExcelProperty(value = "专业名称 - 预留,数据从班级表关联")
private String majorName;
/**
* 班级id - 预留,数据从班级表关联
*/
@ExcelProperty(value = "班级id - 预留,数据从班级表关联")
private String classId;
/**
* 班级名称 - 预留,数据从班级表关联
*/
@ExcelProperty(value = "班级名称 - 预留,数据从班级表关联")
private String className;
/**
* 年级 - 预留,数据从班级表关联
*/
@ExcelProperty(value = "年级 - 预留,数据从班级表关联")
private String grade;
/**
* 学院id - 预留,数据从班级表关联
*/
@ExcelProperty(value = "学院id - 预留,数据从班级表关联")
private String collegeId;
/**
* 学院名称 - 预留,数据从班级表关联
*/
@ExcelProperty(value = "学院名称 - 预留,数据从班级表关联")
private String collegeName;
/**
* 辅导员ID - 预留,数据从班级表关联
*/
@ExcelProperty(value = "辅导员ID - 预留,数据从班级表关联")
private Long counselorId;
/**
* 辅导员姓名 - 预留,数据从班级表关联
*/
@ExcelProperty(value = "辅导员姓名 - 预留,数据从班级表关联")
private String counselorName;
/**
* 班主任ID - 预留,数据从班级表关联
*/
@ExcelProperty(value = "班主任ID - 预留,数据从班级表关联")
private Long classTeacherId;
/**
* 班主任姓名 - 预留,数据从班级表关联
*/
@ExcelProperty(value = "班主任姓名 - 预留,数据从班级表关联")
private String classTeacherName;
/**
* 宿舍楼栋 - 预留,数据从班级表关联
*/
@ExcelProperty(value = "宿舍楼栋 - 预留,数据从班级表关联")
private String dormitoryBuilding;
/**
* 宿舍房间号 - 预留,数据从班级表关联
*/
@ExcelProperty(value = "宿舍房间号 - 预留,数据从班级表关联")
private String dormitoryRoom;
/**
* 扩展字段1
*/
@ExcelProperty(value = "扩展字段1")
private String extField1;
/**
* 扩展字段2
*/
@ExcelProperty(value = "扩展字段2")
private String extField2;
/**
* 扩展字段3
*/
@ExcelProperty(value = "扩展字段3")
private String extField3;
/**
* 扩展字段4
*/
@ExcelProperty(value = "扩展字段4")
private String extField4;
/**
* 扩展字段5
*/
@ExcelProperty(value = "扩展字段5")
private String extField5;
/**
* 备注信息
*/
@ExcelProperty(value = "备注信息")
private String remark;
/**
* 正在进行中的批次id
*/
@ExcelProperty(value = "正在进行中的批次id")
private Long batchId;
}
@@ -0,0 +1,15 @@
package org.dromara.xg.mapper;
import org.dromara.xg.domain.XgStudentMsgBatch;
import org.dromara.xg.domain.vo.XgStudentMsgBatchVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
/**
* 学生信息批次收集Mapper接口
*
* @author zlwu
* @date 2025-07-27
*/
public interface XgStudentMsgBatchMapper extends BaseMapperPlus<XgStudentMsgBatch, XgStudentMsgBatchVo> {
}
@@ -0,0 +1,68 @@
package org.dromara.xg.service;
import org.dromara.xg.domain.vo.XgStudentMsgBatchVo;
import org.dromara.xg.domain.bo.XgStudentMsgBatchBo;
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 IXgStudentMsgBatchService {
/**
* 查询学生信息批次收集
*
* @param id 主键
* @return 学生信息批次收集
*/
XgStudentMsgBatchVo queryById(Long id);
/**
* 分页查询学生信息批次收集列表
*
* @param bo 查询条件
* @param pageQuery 分页参数
* @return 学生信息批次收集分页列表
*/
TableDataInfo<XgStudentMsgBatchVo> queryPageList(XgStudentMsgBatchBo bo, PageQuery pageQuery);
/**
* 查询符合条件的学生信息批次收集列表
*
* @param bo 查询条件
* @return 学生信息批次收集列表
*/
List<XgStudentMsgBatchVo> queryList(XgStudentMsgBatchBo bo);
/**
* 新增学生信息批次收集
*
* @param bo 学生信息批次收集
* @return 是否新增成功
*/
Boolean insertByBo(XgStudentMsgBatchBo bo);
/**
* 修改学生信息批次收集
*
* @param bo 学生信息批次收集
* @return 是否修改成功
*/
Boolean updateByBo(XgStudentMsgBatchBo bo);
/**
* 校验并批量删除学生信息批次收集信息
*
* @param ids 待删除的主键集合
* @param isValid 是否进行有效性校验
* @return 是否删除成功
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}
@@ -0,0 +1,234 @@
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.XgStudentMsgBatchBo;
import org.dromara.xg.domain.vo.XgStudentMsgBatchVo;
import org.dromara.xg.domain.XgStudentMsgBatch;
import org.dromara.xg.mapper.XgStudentMsgBatchMapper;
import org.dromara.xg.service.IXgStudentMsgBatchService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* 学生信息批次收集Service业务层处理
*
* @author zlwu
* @date 2025-07-27
*/
@Slf4j
@RequiredArgsConstructor
@Service
public class XgStudentMsgBatchServiceImpl implements IXgStudentMsgBatchService {
private final XgStudentMsgBatchMapper baseMapper;
/**
* 查询学生信息批次收集
*
* @param id 主键
* @return 学生信息批次收集
*/
@Override
public XgStudentMsgBatchVo queryById(Long id){
return baseMapper.selectVoById(id);
}
/**
* 分页查询学生信息批次收集列表
*
* @param bo 查询条件
* @param pageQuery 分页参数
* @return 学生信息批次收集分页列表
*/
@Override
public TableDataInfo<XgStudentMsgBatchVo> queryPageList(XgStudentMsgBatchBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<XgStudentMsgBatch> lqw = buildQueryWrapper(bo);
Page<XgStudentMsgBatchVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* 查询符合条件的学生信息批次收集列表
*
* @param bo 查询条件
* @return 学生信息批次收集列表
*/
@Override
public List<XgStudentMsgBatchVo> queryList(XgStudentMsgBatchBo bo) {
LambdaQueryWrapper<XgStudentMsgBatch> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<XgStudentMsgBatch> buildQueryWrapper(XgStudentMsgBatchBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<XgStudentMsgBatch> lqw = Wrappers.lambdaQuery();
lqw.orderByAsc(XgStudentMsgBatch::getId);
lqw.eq(bo.getDeleted() != null, XgStudentMsgBatch::getDeleted, bo.getDeleted());
lqw.eq(StringUtils.isNotBlank(bo.getStudentNo()), XgStudentMsgBatch::getStudentNo, bo.getStudentNo());
lqw.eq(StringUtils.isNotBlank(bo.getIdCard()), XgStudentMsgBatch::getIdCard, bo.getIdCard());
lqw.like(StringUtils.isNotBlank(bo.getName()), XgStudentMsgBatch::getName, bo.getName());
lqw.eq(StringUtils.isNotBlank(bo.getNameEnglish()), XgStudentMsgBatch::getNameEnglish, bo.getNameEnglish());
lqw.like(StringUtils.isNotBlank(bo.getFormerName()), XgStudentMsgBatch::getFormerName, bo.getFormerName());
lqw.eq(StringUtils.isNotBlank(bo.getGender()), XgStudentMsgBatch::getGender, bo.getGender());
lqw.eq(bo.getBirthDate() != null, XgStudentMsgBatch::getBirthDate, bo.getBirthDate());
lqw.eq(StringUtils.isNotBlank(bo.getNationality()), XgStudentMsgBatch::getNationality, bo.getNationality());
lqw.eq(StringUtils.isNotBlank(bo.getNativePlace()), XgStudentMsgBatch::getNativePlace, bo.getNativePlace());
lqw.eq(StringUtils.isNotBlank(bo.getPoliticalStatus()), XgStudentMsgBatch::getPoliticalStatus, bo.getPoliticalStatus());
lqw.eq(StringUtils.isNotBlank(bo.getHukouLocation()), XgStudentMsgBatch::getHukouLocation, bo.getHukouLocation());
lqw.eq(StringUtils.isNotBlank(bo.getHomeAddress()), XgStudentMsgBatch::getHomeAddress, bo.getHomeAddress());
lqw.eq(StringUtils.isNotBlank(bo.getCurrentAddress()), XgStudentMsgBatch::getCurrentAddress, bo.getCurrentAddress());
lqw.eq(StringUtils.isNotBlank(bo.getPostalCode()), XgStudentMsgBatch::getPostalCode, bo.getPostalCode());
lqw.eq(StringUtils.isNotBlank(bo.getPhotoUrl()), XgStudentMsgBatch::getPhotoUrl, bo.getPhotoUrl());
lqw.eq(StringUtils.isNotBlank(bo.getPhotoPath()), XgStudentMsgBatch::getPhotoPath, bo.getPhotoPath());
lqw.eq(StringUtils.isNotBlank(bo.getPhone()), XgStudentMsgBatch::getPhone, bo.getPhone());
lqw.eq(bo.getIsBoarder() != null, XgStudentMsgBatch::getIsBoarder, bo.getIsBoarder());
lqw.eq(StringUtils.isNotBlank(bo.getEducationLevel()), XgStudentMsgBatch::getEducationLevel, bo.getEducationLevel());
lqw.eq(StringUtils.isNotBlank(bo.getHouseholdRegisterType()), XgStudentMsgBatch::getHouseholdRegisterType, bo.getHouseholdRegisterType());
lqw.eq(StringUtils.isNotBlank(bo.getReligion()), XgStudentMsgBatch::getReligion, bo.getReligion());
lqw.eq(StringUtils.isNotBlank(bo.getSourceRegion()), XgStudentMsgBatch::getSourceRegion, bo.getSourceRegion());
lqw.eq(StringUtils.isNotBlank(bo.getGraduateSchool()), XgStudentMsgBatch::getGraduateSchool, bo.getGraduateSchool());
lqw.eq(StringUtils.isNotBlank(bo.getEmail()), XgStudentMsgBatch::getEmail, bo.getEmail());
lqw.eq(StringUtils.isNotBlank(bo.getQq()), XgStudentMsgBatch::getQq, bo.getQq());
lqw.eq(StringUtils.isNotBlank(bo.getWechat()), XgStudentMsgBatch::getWechat, bo.getWechat());
lqw.eq(StringUtils.isNotBlank(bo.getMaritalStatus()), XgStudentMsgBatch::getMaritalStatus, bo.getMaritalStatus());
lqw.like(StringUtils.isNotBlank(bo.getEmergencyContactName()), XgStudentMsgBatch::getEmergencyContactName, bo.getEmergencyContactName());
lqw.eq(StringUtils.isNotBlank(bo.getEmergencyContactPhone()), XgStudentMsgBatch::getEmergencyContactPhone, bo.getEmergencyContactPhone());
lqw.eq(StringUtils.isNotBlank(bo.getEmergencyContactRelation()), XgStudentMsgBatch::getEmergencyContactRelation, bo.getEmergencyContactRelation());
lqw.eq(bo.getIsPoorStudent() != null, XgStudentMsgBatch::getIsPoorStudent, bo.getIsPoorStudent());
lqw.eq(bo.getIsMinority() != null, XgStudentMsgBatch::getIsMinority, bo.getIsMinority());
lqw.eq(bo.getIsDisabled() != null, XgStudentMsgBatch::getIsDisabled, bo.getIsDisabled());
lqw.eq(bo.getIsOrphan() != null, XgStudentMsgBatch::getIsOrphan, bo.getIsOrphan());
lqw.eq(bo.getIsLeftBehindChild() != null, XgStudentMsgBatch::getIsLeftBehindChild, bo.getIsLeftBehindChild());
lqw.eq(bo.getIsSingleChild() != null, XgStudentMsgBatch::getIsSingleChild, bo.getIsSingleChild());
lqw.eq(bo.getIsLowIncome() != null, XgStudentMsgBatch::getIsLowIncome, bo.getIsLowIncome());
lqw.eq(bo.getHasLoan() != null, XgStudentMsgBatch::getHasLoan, bo.getHasLoan());
lqw.eq(bo.getLoanAmount() != null, XgStudentMsgBatch::getLoanAmount, bo.getLoanAmount());
lqw.eq(StringUtils.isNotBlank(bo.getSpecialties()), XgStudentMsgBatch::getSpecialties, bo.getSpecialties());
lqw.eq(StringUtils.isNotBlank(bo.getAwards()), XgStudentMsgBatch::getAwards, bo.getAwards());
lqw.eq(StringUtils.isNotBlank(bo.getViolations()), XgStudentMsgBatch::getViolations, bo.getViolations());
lqw.eq(StringUtils.isNotBlank(bo.getSocialActivities()), XgStudentMsgBatch::getSocialActivities, bo.getSocialActivities());
lqw.like(StringUtils.isNotBlank(bo.getFatherName()), XgStudentMsgBatch::getFatherName, bo.getFatherName());
lqw.eq(StringUtils.isNotBlank(bo.getFatherPhone()), XgStudentMsgBatch::getFatherPhone, bo.getFatherPhone());
lqw.eq(StringUtils.isNotBlank(bo.getFatherWorkUnit()), XgStudentMsgBatch::getFatherWorkUnit, bo.getFatherWorkUnit());
lqw.like(StringUtils.isNotBlank(bo.getMotherName()), XgStudentMsgBatch::getMotherName, bo.getMotherName());
lqw.eq(StringUtils.isNotBlank(bo.getMotherPhone()), XgStudentMsgBatch::getMotherPhone, bo.getMotherPhone());
lqw.eq(StringUtils.isNotBlank(bo.getMotherWorkUnit()), XgStudentMsgBatch::getMotherWorkUnit, bo.getMotherWorkUnit());
lqw.like(StringUtils.isNotBlank(bo.getGuardianName()), XgStudentMsgBatch::getGuardianName, bo.getGuardianName());
lqw.eq(StringUtils.isNotBlank(bo.getGuardianPhone()), XgStudentMsgBatch::getGuardianPhone, bo.getGuardianPhone());
lqw.eq(StringUtils.isNotBlank(bo.getGuardianRelation()), XgStudentMsgBatch::getGuardianRelation, bo.getGuardianRelation());
lqw.eq(bo.getFamilyIncome() != null, XgStudentMsgBatch::getFamilyIncome, bo.getFamilyIncome());
lqw.eq(bo.getPerCapitaIncome() != null, XgStudentMsgBatch::getPerCapitaIncome, bo.getPerCapitaIncome());
lqw.eq(StringUtils.isNotBlank(bo.getIncomeSource()), XgStudentMsgBatch::getIncomeSource, bo.getIncomeSource());
lqw.eq(StringUtils.isNotBlank(bo.getFamilyEconomicStatus()), XgStudentMsgBatch::getFamilyEconomicStatus, bo.getFamilyEconomicStatus());
lqw.eq(bo.getFamilyMembers() != null, XgStudentMsgBatch::getFamilyMembers, bo.getFamilyMembers());
lqw.eq(bo.getHeight() != null, XgStudentMsgBatch::getHeight, bo.getHeight());
lqw.eq(bo.getWeight() != null, XgStudentMsgBatch::getWeight, bo.getWeight());
lqw.eq(StringUtils.isNotBlank(bo.getBloodType()), XgStudentMsgBatch::getBloodType, bo.getBloodType());
lqw.eq(StringUtils.isNotBlank(bo.getHealthStatus()), XgStudentMsgBatch::getHealthStatus, bo.getHealthStatus());
lqw.eq(StringUtils.isNotBlank(bo.getSpecialCondition()), XgStudentMsgBatch::getSpecialCondition, bo.getSpecialCondition());
lqw.eq(StringUtils.isNotBlank(bo.getMedicalHistory()), XgStudentMsgBatch::getMedicalHistory, bo.getMedicalHistory());
lqw.eq(StringUtils.isNotBlank(bo.getAllergies()), XgStudentMsgBatch::getAllergies, bo.getAllergies());
lqw.eq(StringUtils.isNotBlank(bo.getDisabilityType()), XgStudentMsgBatch::getDisabilityType, bo.getDisabilityType());
lqw.eq(StringUtils.isNotBlank(bo.getDisabilityLevel()), XgStudentMsgBatch::getDisabilityLevel, bo.getDisabilityLevel());
lqw.eq(StringUtils.isNotBlank(bo.getAdmissionCategory()), XgStudentMsgBatch::getAdmissionCategory, bo.getAdmissionCategory());
lqw.eq(StringUtils.isNotBlank(bo.getStudentStatus()), XgStudentMsgBatch::getStudentStatus, bo.getStudentStatus());
lqw.eq(bo.getEnrollmentYear() != null, XgStudentMsgBatch::getEnrollmentYear, bo.getEnrollmentYear());
lqw.eq(bo.getEnrollmentDate() != null, XgStudentMsgBatch::getEnrollmentDate, bo.getEnrollmentDate());
lqw.eq(StringUtils.isNotBlank(bo.getBankCardNo()), XgStudentMsgBatch::getBankCardNo, bo.getBankCardNo());
lqw.like(StringUtils.isNotBlank(bo.getBankName()), XgStudentMsgBatch::getBankName, bo.getBankName());
lqw.eq(StringUtils.isNotBlank(bo.getBankBranch()), XgStudentMsgBatch::getBankBranch, bo.getBankBranch());
lqw.like(StringUtils.isNotBlank(bo.getCardHolderName()), XgStudentMsgBatch::getCardHolderName, bo.getCardHolderName());
lqw.eq(StringUtils.isNotBlank(bo.getInfoStatus()), XgStudentMsgBatch::getInfoStatus, bo.getInfoStatus());
lqw.eq(StringUtils.isNotBlank(bo.getDataSource()), XgStudentMsgBatch::getDataSource, bo.getDataSource());
lqw.eq(bo.getLastBatchId() != null, XgStudentMsgBatch::getLastBatchId, bo.getLastBatchId());
lqw.eq(bo.getLastAuditTime() != null, XgStudentMsgBatch::getLastAuditTime, bo.getLastAuditTime());
lqw.eq(bo.getIsComplete() != null, XgStudentMsgBatch::getIsComplete, bo.getIsComplete());
lqw.eq(bo.getCompletionRate() != null, XgStudentMsgBatch::getCompletionRate, bo.getCompletionRate());
lqw.eq(bo.getSchoolSystem() != null, XgStudentMsgBatch::getSchoolSystem, bo.getSchoolSystem());
lqw.eq(StringUtils.isNotBlank(bo.getAcademicLevel()), XgStudentMsgBatch::getAcademicLevel, bo.getAcademicLevel());
lqw.eq(StringUtils.isNotBlank(bo.getTrainingType()), XgStudentMsgBatch::getTrainingType, bo.getTrainingType());
lqw.eq(StringUtils.isNotBlank(bo.getMajorId()), XgStudentMsgBatch::getMajorId, bo.getMajorId());
lqw.like(StringUtils.isNotBlank(bo.getMajorName()), XgStudentMsgBatch::getMajorName, bo.getMajorName());
lqw.eq(StringUtils.isNotBlank(bo.getClassId()), XgStudentMsgBatch::getClassId, bo.getClassId());
lqw.like(StringUtils.isNotBlank(bo.getClassName()), XgStudentMsgBatch::getClassName, bo.getClassName());
lqw.eq(StringUtils.isNotBlank(bo.getGrade()), XgStudentMsgBatch::getGrade, bo.getGrade());
lqw.eq(StringUtils.isNotBlank(bo.getCollegeId()), XgStudentMsgBatch::getCollegeId, bo.getCollegeId());
lqw.like(StringUtils.isNotBlank(bo.getCollegeName()), XgStudentMsgBatch::getCollegeName, bo.getCollegeName());
lqw.eq(bo.getCounselorId() != null, XgStudentMsgBatch::getCounselorId, bo.getCounselorId());
lqw.like(StringUtils.isNotBlank(bo.getCounselorName()), XgStudentMsgBatch::getCounselorName, bo.getCounselorName());
lqw.eq(bo.getClassTeacherId() != null, XgStudentMsgBatch::getClassTeacherId, bo.getClassTeacherId());
lqw.like(StringUtils.isNotBlank(bo.getClassTeacherName()), XgStudentMsgBatch::getClassTeacherName, bo.getClassTeacherName());
lqw.eq(StringUtils.isNotBlank(bo.getDormitoryBuilding()), XgStudentMsgBatch::getDormitoryBuilding, bo.getDormitoryBuilding());
lqw.eq(StringUtils.isNotBlank(bo.getDormitoryRoom()), XgStudentMsgBatch::getDormitoryRoom, bo.getDormitoryRoom());
lqw.eq(StringUtils.isNotBlank(bo.getExtField1()), XgStudentMsgBatch::getExtField1, bo.getExtField1());
lqw.eq(StringUtils.isNotBlank(bo.getExtField2()), XgStudentMsgBatch::getExtField2, bo.getExtField2());
lqw.eq(StringUtils.isNotBlank(bo.getExtField3()), XgStudentMsgBatch::getExtField3, bo.getExtField3());
lqw.eq(StringUtils.isNotBlank(bo.getExtField4()), XgStudentMsgBatch::getExtField4, bo.getExtField4());
lqw.eq(StringUtils.isNotBlank(bo.getExtField5()), XgStudentMsgBatch::getExtField5, bo.getExtField5());
lqw.eq(bo.getBatchId() != null, XgStudentMsgBatch::getBatchId, bo.getBatchId());
return lqw;
}
/**
* 新增学生信息批次收集
*
* @param bo 学生信息批次收集
* @return 是否新增成功
*/
@Override
public Boolean insertByBo(XgStudentMsgBatchBo bo) {
XgStudentMsgBatch add = MapstructUtils.convert(bo, XgStudentMsgBatch.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setId(add.getId());
}
return flag;
}
/**
* 修改学生信息批次收集
*
* @param bo 学生信息批次收集
* @return 是否修改成功
*/
@Override
public Boolean updateByBo(XgStudentMsgBatchBo bo) {
XgStudentMsgBatch update = MapstructUtils.convert(bo, XgStudentMsgBatch.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
* 保存前的数据校验
*/
private void validEntityBeforeSave(XgStudentMsgBatch entity){
//TODO 做一些数据校验,如唯一约束
}
/**
* 校验并批量删除学生信息批次收集信息
*
* @param ids 待删除的主键集合
* @param isValid 是否进行有效性校验
* @return 是否删除成功
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteByIds(ids) > 0;
}
}
@@ -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.XgStudentMsgBatchMapper">
</mapper>
+63
View File
@@ -0,0 +1,63 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { StuColBatchVO, StuColBatchForm, StuColBatchQuery } from '@/api/stuMsgSupply/types';
/**
* 查询学生信息收集批次列表
* @param query
* @returns {*}
*/
export const listStuColBatch = (query?: StuColBatchQuery): AxiosPromise<StuColBatchVO[]> => {
return request({
url: '/XgStuColBatch/stuColBatch/list',
method: 'get',
params: query
});
};
/**
* 查询学生信息收集批次详细
* @param id
*/
export const getStuColBatch = (id: string | number): AxiosPromise<StuColBatchVO> => {
return request({
url: '/XgStuColBatch/stuColBatch/' + id,
method: 'get'
});
};
/**
* 新增学生信息收集批次
* @param data
*/
export const addStuColBatch = (data: StuColBatchForm) => {
return request({
url: '/XgStuColBatch/stuColBatch',
method: 'post',
data: data
});
};
/**
* 修改学生信息收集批次
* @param data
*/
export const updateStuColBatch = (data: StuColBatchForm) => {
return request({
url: '/XgStuColBatch/stuColBatch',
method: 'put',
data: data
});
};
/**
* 删除学生信息收集批次
* @param id
*/
export const delStuColBatch = (id: string | number | Array<string | number>) => {
return request({
url: '/XgStuColBatch/stuColBatch/' + id,
method: 'delete'
});
};
+101
View File
@@ -0,0 +1,101 @@
export interface StuColBatchVO {
/**
* 批次ID
*/
id: string | number;
/**
* 批次名称
*/
batchName: string;
/**
* 批次描述
*/
description: string;
/**
* 开始时间
*/
startTime: string;
/**
* 结束时间
*/
endTime: string;
/**
* 状态(0正常 1停用)
*/
status: string;
/**
* 收集类型 1 - 新学期收集 2 - 其他
*/
collectionType: string;
}
export interface StuColBatchForm extends BaseEntity {
/**
* 批次ID
*/
id?: string | number;
/**
* 批次名称
*/
batchName?: string;
/**
* 批次描述
*/
description?: string;
/**
* 开始时间
*/
startTime?: string;
/**
* 结束时间
*/
endTime?: string;
/**
* 状态(0正常 1停用)
*/
status?: string;
/**
* 收集类型 1 - 新学期收集 2 - 其他
*/
collectionType?: string;
}
export interface StuColBatchQuery extends PageQuery {
/**
* 批次名称
*/
batchName?: string;
/**
* 状态(0正常 1停用)
*/
status?: string;
/**
* 收集类型 1 - 新学期收集 2 - 其他
*/
collectionType?: string;
/**
* 日期范围参数
*/
params?: any;
}
@@ -0,0 +1,63 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { StudentMsgBatchVO, StudentMsgBatchForm, StudentMsgBatchQuery } from '@/api/studentMsgBatch/studentMsgBatch/types';
/**
* 查询学生信息批次收集列表
* @param query
* @returns {*}
*/
export const listStudentMsgBatch = (query?: StudentMsgBatchQuery): AxiosPromise<StudentMsgBatchVO[]> => {
return request({
url: '/studentMsgBatch/studentMsgBatch/list',
method: 'get',
params: query
});
};
/**
* 查询学生信息批次收集详细
* @param id
*/
export const getStudentMsgBatch = (id: string | number): AxiosPromise<StudentMsgBatchVO> => {
return request({
url: '/studentMsgBatch/studentMsgBatch/' + id,
method: 'get'
});
};
/**
* 新增学生信息批次收集
* @param data
*/
export const addStudentMsgBatch = (data: StudentMsgBatchForm) => {
return request({
url: '/studentMsgBatch/studentMsgBatch',
method: 'post',
data: data
});
};
/**
* 修改学生信息批次收集
* @param data
*/
export const updateStudentMsgBatch = (data: StudentMsgBatchForm) => {
return request({
url: '/studentMsgBatch/studentMsgBatch',
method: 'put',
data: data
});
};
/**
* 删除学生信息批次收集
* @param id
*/
export const delStudentMsgBatch = (id: string | number | Array<string | number>) => {
return request({
url: '/studentMsgBatch/studentMsgBatch/' + id,
method: 'delete'
});
};
File diff suppressed because it is too large. Load diff
+613
View File
@@ -0,0 +1,613 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="批次名称" prop="batchName">
<el-input v-model="queryParams.batchName" placeholder="请输入批次名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['XgStuColBatch:stuColBatch:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['XgStuColBatch:stuColBatch:edit']"
>修改</el-button
>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="danger"
plain
icon="Delete"
:disabled="multiple"
@click="handleDelete()"
v-hasPermi="['XgStuColBatch:stuColBatch:remove']"
>删除</el-button
>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['XgStuColBatch:stuColBatch:export']">导出</el-button>
</el-col> -->
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" border :data="stuColBatchList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="批次ID" align="center" prop="id" v-if="true" />
<el-table-column label="批次名称" align="center" prop="batchName" />
<el-table-column label="批次描述" align="center" prop="description" />
<el-table-column label="开始时间" align="center" prop="startTime" width="200">
<template #default="scope">
<span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="结束时间" align="center" prop="endTime" width="200">
<template #default="scope">
<span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" prop="status">
<template #default="scope">
<el-tag :type="scope.row.status === '0' ? 'success' : 'danger'">
{{ scope.row.status === '0' ? '正常' : '停用' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="收集类型" align="center" prop="collectionType">
<template #default="scope">
<el-tag :type="scope.row.collectionType === '1' ? 'primary' : 'info'">
{{ scope.row.collectionType === '1' ? '新学期收集' : '其他' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="200" class-name="small-padding fixed-right">
<template #default="scope">
<el-tooltip content="查看详细" placement="top">
<el-button
link
type="info"
plain
icon="View"
@click="handleView(scope.row)"
v-hasPermi="['XgStuColBatch:stuColBatch:query']"
></el-button>
</el-tooltip>
<!-- <el-tooltip content="修改" placement="top">
<el-button
link
type="primary"
plain
icon="Edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['XgStuColBatch:stuColBatch:edit']"
></el-button>
</el-tooltip>
<el-tooltip content="收集范围" placement="top">
<el-button
link
type="warning"
plain
icon="Setting"
@click="handleScope(scope.row)"
v-hasPermi="['XgStuColBatch:stuColBatch:scope']"
></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button
link
plain
type="danger"
icon="Delete"
@click="handleDelete(scope.row)"
v-hasPermi="['XgStuColBatch:stuColBatch:remove']"
></el-button>
</el-tooltip> -->
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改学生信息收集批次对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="stuColBatchFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="批次名称" prop="batchName">
<el-input v-model="form.batchName" placeholder="请输入批次名称" />
</el-form-item>
<el-form-item label="批次描述" prop="description">
<el-input v-model="form.description" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="开始时间" prop="startTime">
<el-date-picker
clearable
style="width: 100%"
v-model="form.startTime"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择开始时间"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束时间" prop="endTime">
<el-date-picker
clearable
style="width: 100%"
v-model="form.endTime"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择结束时间"
>
</el-date-picker>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="form.status" placeholder="请选择状态">
<el-option label="正常" value="0" />
<el-option label="停用" value="1" />
</el-select>
</el-form-item>
<el-form-item label="收集类型" prop="collectionType">
<el-select v-model="form.collectionType" placeholder="请选择收集类型">
<el-option label="新学期收集" value="1" />
<el-option label="其他" value="2" />
</el-select>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</template>
</el-dialog>
<!-- 收集范围设置对话框 -->
<el-dialog title="设置收集范围" v-model="scopeDialog.visible" width="500px" append-to-body @close="handleScopeDialogClose">
<div class="scope-content">
<el-tree
ref="scopeTreeRef"
:data="deptTreeData"
show-checkbox
default-expand-all
node-key="id"
:props="{ children: 'children', label: 'label' }"
:check-strictly="false"
/>
</div>
<template #footer>
<div class="dialog-footer">
<el-button :loading="scopeButtonLoading" type="primary" @click="submitScope">确 定</el-button>
<el-button @click="cancelScope">取 消</el-button>
</div>
</template>
</el-dialog>
<!-- 查看详细对话框 -->
<el-dialog title="批次详细信息" v-model="viewDialog.visible" width="800px" append-to-body>
<el-tabs v-model="viewActiveTab" type="border-card">
<el-tab-pane label="基本信息" name="basic">
<el-descriptions :column="2" border>
<el-descriptions-item label="批次ID">{{ viewForm.id }}</el-descriptions-item>
<el-descriptions-item label="批次名称">{{ viewForm.batchName }}</el-descriptions-item>
<el-descriptions-item label="批次描述" :span="2">{{ viewForm.description || '暂无描述' }}</el-descriptions-item>
<el-descriptions-item label="开始时间">{{ parseTime(viewForm.startTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</el-descriptions-item>
<el-descriptions-item label="结束时间">{{ parseTime(viewForm.endTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</el-descriptions-item>
<el-descriptions-item label="状态">
<el-tag :type="viewForm.status === '0' ? 'success' : 'danger'">
{{ viewForm.status === '0' ? '正常' : '停用' }}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="收集类型">
<el-tag :type="viewForm.collectionType === '1' ? 'primary' : 'info'">
{{ viewForm.collectionType === '1' ? '新学期收集' : '其他' }}
</el-tag>
</el-descriptions-item>
<el-descriptions-item label="创建时间">{{ parseTime(viewForm.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</el-descriptions-item>
<el-descriptions-item label="更新时间">{{ parseTime(viewForm.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</el-descriptions-item>
</el-descriptions>
</el-tab-pane>
<!-- <el-tab-pane label="权限范围" name="scope">
<div class="scope-detail-content">
<div v-if="scopeDetailList.length === 0" class="no-data">
<el-empty description="暂无权限范围配置" />
</div>
<div v-else>
<el-alert title="权限范围说明" type="info" :closable="false" show-icon class="mb-3">
<template #default> 该批次配置了 {{ scopeDetailList.length }} 个班级的收集权限,具体如下: </template>
</el-alert>
<el-table :data="scopeDetailList" border stripe>
<el-table-column label="序号" type="index" width="60" align="center" />
<el-table-column label="学院名称" prop="collegeName" align="center" />
<el-table-column label="专业名称" prop="majorName" align="center" />
<el-table-column label="班级名称" prop="className" align="center" />
<el-table-column label="配置时间" align="center" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
</el-table>
</div>
</div>
</el-tab-pane> -->
</el-tabs>
<template #footer>
<div class="dialog-footer">
<el-button @click="cancelView">关 闭</el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="StuColBatch" lang="ts">
import { listStuColBatch, getStuColBatch, delStuColBatch, addStuColBatch, updateStuColBatch } from '@/api/stuMsgSupply';
import { StuColBatchVO, StuColBatchQuery, StuColBatchForm } from '@/api/stuMsgSupply/types';
import { setScope, getScope, getScopeDetail } from '@/api/stuColBatchClass/stuColBatchClass';
import request from '@/utils/request';
import { ElMessage } from 'element-plus';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const stuColBatchList = ref<StuColBatchVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const stuColBatchFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
// 收集范围弹窗相关数据
const scopeDialog = reactive({
visible: false
});
const scopeButtonLoading = ref(false);
const currentBatch = ref<StuColBatchVO | null>(null);
const deptTreeData = ref<any[]>([]);
const checkedDeptIds = ref<number[]>([]);
const scopeTreeRef = ref();
// 查看详细弹窗相关数据
const viewDialog = reactive({
visible: false
});
const viewForm = ref<StuColBatchVO>({} as StuColBatchVO);
const viewActiveTab = ref('basic');
const scopeDetailList = ref<any[]>([]);
const initFormData: StuColBatchForm = {
id: undefined,
batchName: undefined,
description: undefined,
startTime: new Date()
.toLocaleString('zh-CN', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
hour12: false
})
.replace(/\//g, '-'),
endTime: undefined,
status: '0',
collectionType: '1'
};
const data = reactive<PageData<StuColBatchForm, StuColBatchQuery>>({
form: { ...initFormData },
queryParams: {
pageNum: 1,
pageSize: 10,
batchName: undefined,
status: undefined,
collectionType: undefined,
params: {}
},
rules: {
id: [{ required: true, message: '批次ID不能为空', trigger: 'blur' }],
batchName: [{ required: true, message: '批次名称不能为空', trigger: 'blur' }],
startTime: [{ required: true, message: '开始时间不能为空', trigger: 'blur' }],
endTime: [{ required: true, message: '结束时间不能为空', trigger: 'blur' }],
status: [{ required: true, message: '状态不能为空', trigger: 'change' }],
collectionType: [{ required: true, message: '收集类型 1 - 新学期收集 2 - 其他 不能为空', trigger: 'change' }]
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询学生信息收集批次列表 */
const getList = async () => {
loading.value = true;
const res = await listStuColBatch(queryParams.value);
stuColBatchList.value = res.rows;
total.value = res.total;
loading.value = false;
};
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
};
/** 表单重置 */
const reset = () => {
form.value = { ...initFormData };
stuColBatchFormRef.value?.resetFields();
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
};
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
};
/** 多选框选中数据 */
const handleSelectionChange = (selection: StuColBatchVO[]) => {
ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
};
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = '添加学生信息收集批次';
};
/** 修改按钮操作 */
const handleUpdate = async (row?: StuColBatchVO) => {
reset();
const _id = row?.id || ids.value[0];
const res = await getStuColBatch(_id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改学生信息收集批次';
};
/** 提交按钮 */
const submitForm = () => {
stuColBatchFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.id) {
await updateStuColBatch(form.value).finally(() => (buttonLoading.value = false));
} else {
await addStuColBatch(form.value).finally(() => (buttonLoading.value = false));
}
proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false;
await getList();
}
});
};
/** 删除按钮操作 */
const handleDelete = async (row?: StuColBatchVO) => {
const _ids = row?.id || ids.value;
await proxy?.$modal.confirm('是否确认删除学生信息收集批次编号为"' + row?.batchName + '"的数据项?').finally(() => (loading.value = false));
await delStuColBatch(_ids);
proxy?.$modal.msgSuccess('删除成功');
await getList();
};
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download(
'XgStuColBatch/stuColBatch/export',
{
...queryParams.value
},
`stuColBatch_${new Date().getTime()}.xlsx`
);
};
/** 收集范围按钮操作 */
const handleScope = async (row: StuColBatchVO) => {
currentBatch.value = row;
// 先清空勾选状态
checkedDeptIds.value = [];
await loadDeptTree();
await loadCurrentScope(row.id);
scopeDialog.visible = true;
// 使用nextTick确保DOM更新完成后再设置勾选状态
await nextTick();
if (scopeTreeRef.value && checkedDeptIds.value.length > 0) {
scopeTreeRef.value.setCheckedKeys(checkedDeptIds.value);
}
};
/** 加载部门树数据 */
const loadDeptTree = async () => {
try {
loading.value = true;
const response = await request({
url: '/system/user/deptTree',
method: 'get',
params: {
belongDeptId: 101
}
});
if (response && response.code === 200) {
deptTreeData.value = response.data || [];
}
} catch (error) {
console.error('获取部门树数据失败:', error);
ElMessage.error('获取范围选项失败');
} finally {
loading.value = false;
}
};
/** 加载当前批次的收集范围 */
const loadCurrentScope = async (batchId: string | number) => {
try {
checkedDeptIds.value = [];
const response = await getScope(batchId);
if (response && response.code === 200) {
checkedDeptIds.value = response.data || [];
} else {
checkedDeptIds.value = [];
}
} catch (error) {
console.error('加载收集范围失败:', error);
checkedDeptIds.value = [];
}
};
/** 构建树形数据 */
const buildTree = (data: any[]) => {
// 如果数据已经是树形结构,直接转换格式
const convertToTreeNode = (item: any): any => {
return {
id: item.deptId,
label: item.deptName,
children: item.children ? item.children.map(convertToTreeNode) : []
};
};
return data.map(convertToTreeNode);
};
/** 提交收集范围 */
const submitScope = async () => {
if (!currentBatch.value) return;
try {
scopeButtonLoading.value = true;
const checkedNodes = scopeTreeRef.value.getCheckedNodes();
const checkedIds = checkedNodes.map((node: any) => node.id);
// 调用后端API设置收集范围
const response = await setScope(currentBatch.value.id, checkedIds);
if (response && response.code === 200) {
ElMessage.success(response.msg || '收集范围设置成功');
scopeDialog.visible = false;
// 提交成功后清空状态
handleScopeDialogClose();
} else {
ElMessage.error(response?.msg || '设置收集范围失败');
}
} catch (error) {
console.error('设置收集范围失败:', error);
ElMessage.error('设置收集范围失败');
} finally {
scopeButtonLoading.value = false;
}
};
/** 取消收集范围设置 */
const cancelScope = () => {
scopeDialog.visible = false;
currentBatch.value = null;
checkedDeptIds.value = [];
// 清空树形组件的勾选状态
if (scopeTreeRef.value) {
scopeTreeRef.value.setCheckedKeys([]);
}
};
/** 处理收集范围弹窗关闭 */
const handleScopeDialogClose = () => {
// 清空相关状态
currentBatch.value = null;
checkedDeptIds.value = [];
// 清空树形组件的勾选状态
if (scopeTreeRef.value) {
scopeTreeRef.value.setCheckedKeys([]);
}
};
/** 查看详细按钮操作 */
const handleView = async (row: StuColBatchVO) => {
try {
// 获取批次基本信息
const res = await getStuColBatch(row.id);
viewForm.value = res.data;
// 获取权限范围详细信息
await loadScopeDetail(row.id);
viewDialog.visible = true;
viewActiveTab.value = 'basic';
} catch (error) {
console.error('获取批次详情失败:', error);
proxy?.$modal.msgError('获取批次详情失败');
}
};
/** 加载权限范围详细信息 */
const loadScopeDetail = async (batchId: string | number) => {
try {
const response = await getScopeDetail(batchId);
if (response && response.code === 200) {
scopeDetailList.value = response.data || [];
} else {
scopeDetailList.value = [];
}
} catch (error) {
console.error('加载权限范围详情失败:', error);
scopeDetailList.value = [];
}
};
/** 取消查看详细 */
const cancelView = () => {
viewDialog.visible = false;
viewForm.value = {} as StuColBatchVO;
scopeDetailList.value = [];
viewActiveTab.value = 'basic';
};
onMounted(() => {
getList();
});
</script>
<style scoped>
.scope-detail-content {
padding: 10px 0;
}
.no-data {
text-align: center;
padding: 40px 0;
}
.mb-3 {
margin-bottom: 12px;
}
</style>