提交代码
This commit is contained in:
1 parent
e450a8ffe7
commit
2e51d1154d
37 files changed
+7428
-137
No files matched your search
+105
@@ -0,0 +1,105 @@
|
||||
package org.dromara.workflow.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.workflow.domain.vo.XgStudentLeaveVo;
|
||||
import org.dromara.workflow.domain.bo.XgStudentLeaveBo;
|
||||
import org.dromara.workflow.service.IXgStudentLeaveService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/studentLeave/studentLeave")
|
||||
public class XgStudentLeaveController extends BaseController {
|
||||
|
||||
private final IXgStudentLeaveService xgStudentLeaveService;
|
||||
|
||||
/**
|
||||
* 查询学生请假 - 记录学生的请假申请、审批和销假信息列表
|
||||
*/
|
||||
@SaCheckPermission("studentLeave:studentLeave:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<XgStudentLeaveVo> list(XgStudentLeaveBo bo, PageQuery pageQuery) {
|
||||
return xgStudentLeaveService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出学生请假 - 记录学生的请假申请、审批和销假信息列表
|
||||
*/
|
||||
@SaCheckPermission("studentLeave:studentLeave:export")
|
||||
@Log(title = "学生请假 - 记录学生的请假申请、审批和销假信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(XgStudentLeaveBo bo, HttpServletResponse response) {
|
||||
List<XgStudentLeaveVo> list = xgStudentLeaveService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "学生请假 - 记录学生的请假申请、审批和销假信息", XgStudentLeaveVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学生请假 - 记录学生的请假申请、审批和销假信息详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("studentLeave:studentLeave:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<XgStudentLeaveVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(xgStudentLeaveService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*/
|
||||
@SaCheckPermission("studentLeave:studentLeave:add")
|
||||
@Log(title = "学生请假 - 记录学生的请假申请、审批和销假信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody XgStudentLeaveBo bo) {
|
||||
return toAjax(xgStudentLeaveService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*/
|
||||
@SaCheckPermission("studentLeave:studentLeave:edit")
|
||||
@Log(title = "学生请假 - 记录学生的请假申请、审批和销假信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody XgStudentLeaveBo bo) {
|
||||
return toAjax(xgStudentLeaveService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("studentLeave:studentLeave:remove")
|
||||
@Log(title = "学生请假 - 记录学生的请假申请、审批和销假信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(xgStudentLeaveService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
+193
@@ -0,0 +1,193 @@
|
||||
package org.dromara.workflow.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_leave
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("xg_student_leave")
|
||||
public class XgStudentLeave extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@TableLogic(value = "0", delval = "1")
|
||||
private Long deleted;
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
private Long studentId;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
private String studentName;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
private String studentNo;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
private Long majorId;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
private String majorName;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
private Long collegeId;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
private String collegeName;
|
||||
|
||||
/**
|
||||
* 请假类型编码
|
||||
*/
|
||||
private String leaveTypeCode;
|
||||
|
||||
/**
|
||||
* 请假类型名称
|
||||
*/
|
||||
private String leaveTypeName;
|
||||
|
||||
/**
|
||||
* 开始时间(年月日时分秒)
|
||||
*/
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间(年月日时分秒)
|
||||
*/
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 请假时长(天)
|
||||
*/
|
||||
private Double leaveDuration;
|
||||
|
||||
/**
|
||||
* 是否离校:0-否,1-是
|
||||
*/
|
||||
private String isLeaveSchool;
|
||||
|
||||
/**
|
||||
* 是否需要销假:0-否,1-是
|
||||
*/
|
||||
private String needCancel;
|
||||
|
||||
/**
|
||||
* 紧急联系人
|
||||
*/
|
||||
private String emergencyContact;
|
||||
|
||||
/**
|
||||
* 紧急联系电话
|
||||
*/
|
||||
private String emergencyPhone;
|
||||
|
||||
/**
|
||||
* 请假原因
|
||||
*/
|
||||
private String leaveReason;
|
||||
|
||||
/**
|
||||
* 请假时地理位置
|
||||
*/
|
||||
private String leaveLocation;
|
||||
|
||||
/**
|
||||
* 附件OSS文件ID(逗号分隔)
|
||||
*/
|
||||
private String attachmentOssIds;
|
||||
|
||||
/**
|
||||
* 审批状态:0-待审批,1-已通过,2-已拒绝,3-已取消
|
||||
*/
|
||||
private String approvalStatus;
|
||||
|
||||
/**
|
||||
* 审批意见
|
||||
*/
|
||||
private String approvalOpinion;
|
||||
|
||||
/**
|
||||
* 审批时间
|
||||
*/
|
||||
private Date approvalTime;
|
||||
|
||||
/**
|
||||
* 审批人ID
|
||||
*/
|
||||
private Long approvalBy;
|
||||
|
||||
/**
|
||||
* 审批人姓名
|
||||
*/
|
||||
private String approvalByName;
|
||||
|
||||
/**
|
||||
* 销假状态:0-未销假,1-已销假,2-逾期未销假
|
||||
*/
|
||||
private String cancelStatus;
|
||||
|
||||
/**
|
||||
* 销假时间
|
||||
*/
|
||||
private Date cancelTime;
|
||||
|
||||
/**
|
||||
* 销假地理位置
|
||||
*/
|
||||
private String cancelLocation;
|
||||
|
||||
/**
|
||||
* 销假照片OSS文件ID(逗号分隔)
|
||||
*/
|
||||
private String cancelPhotoOssIds;
|
||||
|
||||
/**
|
||||
* 销假备注
|
||||
*/
|
||||
private String cancelRemark;
|
||||
|
||||
}
|
||||
+204
@@ -0,0 +1,204 @@
|
||||
package org.dromara.workflow.domain.bo;
|
||||
|
||||
import org.dromara.workflow.domain.XgStudentLeave;
|
||||
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_leave
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = XgStudentLeave.class, reverseConvertGenerate = false)
|
||||
public class XgStudentLeaveBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
@NotNull(message = "主键ID(雪花ID)不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
private Long deleted;
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
@NotNull(message = "学生ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long studentId;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
@NotBlank(message = "学生姓名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String studentName;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
@NotBlank(message = "学号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String studentNo;
|
||||
|
||||
/**
|
||||
* 班级ID
|
||||
*/
|
||||
private Long classId;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 专业ID
|
||||
*/
|
||||
private Long majorId;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
private String majorName;
|
||||
|
||||
/**
|
||||
* 学院ID
|
||||
*/
|
||||
private Long collegeId;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
private String collegeName;
|
||||
|
||||
/**
|
||||
* 请假类型编码
|
||||
*/
|
||||
@NotBlank(message = "请假类型编码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String leaveTypeCode;
|
||||
|
||||
/**
|
||||
* 请假类型名称
|
||||
*/
|
||||
@NotBlank(message = "请假类型名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String leaveTypeName;
|
||||
|
||||
/**
|
||||
* 开始时间(年月日时分秒)
|
||||
*/
|
||||
@NotNull(message = "开始时间(年月日时分秒)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间(年月日时分秒)
|
||||
*/
|
||||
@NotNull(message = "结束时间(年月日时分秒)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 请假时长(天)
|
||||
*/
|
||||
@NotNull(message = "请假时长(天)不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Double leaveDuration;
|
||||
|
||||
/**
|
||||
* 是否离校:0-否,1-是
|
||||
*/
|
||||
@NotBlank(message = "是否离校:0-否,1-是不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String isLeaveSchool;
|
||||
|
||||
/**
|
||||
* 是否需要销假:0-否,1-是
|
||||
*/
|
||||
@NotBlank(message = "是否需要销假:0-否,1-是不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String needCancel;
|
||||
|
||||
/**
|
||||
* 紧急联系人
|
||||
*/
|
||||
private String emergencyContact;
|
||||
|
||||
/**
|
||||
* 紧急联系电话
|
||||
*/
|
||||
private String emergencyPhone;
|
||||
|
||||
/**
|
||||
* 请假原因
|
||||
*/
|
||||
@NotBlank(message = "请假原因不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String leaveReason;
|
||||
|
||||
/**
|
||||
* 请假时地理位置
|
||||
*/
|
||||
private String leaveLocation;
|
||||
|
||||
/**
|
||||
* 附件OSS文件ID(逗号分隔)
|
||||
*/
|
||||
private String attachmentOssIds;
|
||||
|
||||
/**
|
||||
* 审批状态
|
||||
*/
|
||||
@NotBlank(message = "审批状态不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String approvalStatus;
|
||||
|
||||
/**
|
||||
* 审批意见
|
||||
*/
|
||||
private String approvalOpinion;
|
||||
|
||||
/**
|
||||
* 审批时间
|
||||
*/
|
||||
private Date approvalTime;
|
||||
|
||||
/**
|
||||
* 审批人ID
|
||||
*/
|
||||
private Long approvalBy;
|
||||
|
||||
/**
|
||||
* 审批人姓名
|
||||
*/
|
||||
private String approvalByName;
|
||||
|
||||
/**
|
||||
* 销假状态:0-未销假,1-已销假,2-逾期未销假 3-无需销假
|
||||
*/
|
||||
@NotBlank(message = "销假状态:0-未销假,1-已销假,2-逾期未销假 3-无需销假 不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String cancelStatus;
|
||||
|
||||
/**
|
||||
* 销假时间
|
||||
*/
|
||||
private Date cancelTime;
|
||||
|
||||
/**
|
||||
* 销假地理位置
|
||||
*/
|
||||
private String cancelLocation;
|
||||
|
||||
/**
|
||||
* 销假照片OSS文件ID(逗号分隔)
|
||||
*/
|
||||
private String cancelPhotoOssIds;
|
||||
|
||||
/**
|
||||
* 销假备注
|
||||
*/
|
||||
private String cancelRemark;
|
||||
|
||||
}
|
||||
+236
@@ -0,0 +1,236 @@
|
||||
package org.dromara.workflow.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.dromara.workflow.domain.XgStudentLeave;
|
||||
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_leave
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = XgStudentLeave.class)
|
||||
public class XgStudentLeaveVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "雪=花ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 1代表删除)
|
||||
*/
|
||||
@ExcelProperty(value = "删除标志", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "0=代表存在,1=代表删除")
|
||||
private Long deleted;
|
||||
|
||||
/**
|
||||
* 学生ID
|
||||
*/
|
||||
@ExcelProperty(value = "学生ID")
|
||||
private Long studentId;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
@ExcelProperty(value = "学生姓名")
|
||||
private String studentName;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
@ExcelProperty(value = "学号")
|
||||
private String studentNo;
|
||||
|
||||
/**
|
||||
* 班级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 leaveTypeCode;
|
||||
|
||||
/**
|
||||
* 请假类型名称
|
||||
*/
|
||||
@ExcelProperty(value = "请假类型名称")
|
||||
private String leaveTypeName;
|
||||
|
||||
/**
|
||||
* 开始时间(年月日时分秒)
|
||||
*/
|
||||
@ExcelProperty(value = "开始时间", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "年=月日时分秒")
|
||||
private Date startTime;
|
||||
|
||||
/**
|
||||
* 结束时间(年月日时分秒)
|
||||
*/
|
||||
@ExcelProperty(value = "结束时间", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "年=月日时分秒")
|
||||
private Date endTime;
|
||||
|
||||
/**
|
||||
* 请假时长(天)
|
||||
*/
|
||||
@ExcelProperty(value = "请假时长", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "天=")
|
||||
private Double leaveDuration;
|
||||
|
||||
/**
|
||||
* 是否离校:0-否,1-是
|
||||
*/
|
||||
@ExcelProperty(value = "是否离校:0-否,1-是")
|
||||
private String isLeaveSchool;
|
||||
|
||||
/**
|
||||
* 是否需要销假:0-否,1-是
|
||||
*/
|
||||
@ExcelProperty(value = "是否需要销假:0-否,1-是")
|
||||
private String needCancel;
|
||||
|
||||
/**
|
||||
* 紧急联系人
|
||||
*/
|
||||
@ExcelProperty(value = "紧急联系人")
|
||||
private String emergencyContact;
|
||||
|
||||
/**
|
||||
* 紧急联系电话
|
||||
*/
|
||||
@ExcelProperty(value = "紧急联系电话")
|
||||
private String emergencyPhone;
|
||||
|
||||
/**
|
||||
* 请假原因
|
||||
*/
|
||||
@ExcelProperty(value = "请假原因")
|
||||
private String leaveReason;
|
||||
|
||||
/**
|
||||
* 请假时地理位置
|
||||
*/
|
||||
@ExcelProperty(value = "请假时地理位置")
|
||||
private String leaveLocation;
|
||||
|
||||
/**
|
||||
* 附件OSS文件ID(逗号分隔)
|
||||
*/
|
||||
@ExcelProperty(value = "附件OSS文件ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "逗=号分隔")
|
||||
private String attachmentOssIds;
|
||||
|
||||
/**
|
||||
* 审批状态
|
||||
*/
|
||||
@ExcelProperty(value = "审批状态")
|
||||
private String approvalStatus;
|
||||
|
||||
/**
|
||||
* 审批意见
|
||||
*/
|
||||
@ExcelProperty(value = "审批意见")
|
||||
private String approvalOpinion;
|
||||
|
||||
/**
|
||||
* 审批时间
|
||||
*/
|
||||
@ExcelProperty(value = "审批时间")
|
||||
private Date approvalTime;
|
||||
|
||||
/**
|
||||
* 审批人ID
|
||||
*/
|
||||
@ExcelProperty(value = "审批人ID")
|
||||
private Long approvalBy;
|
||||
|
||||
/**
|
||||
* 审批人姓名
|
||||
*/
|
||||
@ExcelProperty(value = "审批人姓名")
|
||||
private String approvalByName;
|
||||
|
||||
/**
|
||||
* 销假状态:0-未销假,1-已销假,2-逾期未销假 3 - 无需销假
|
||||
*/
|
||||
@ExcelProperty(value = "销假状态:0-未销假,1-已销假,2-逾期未销假 3 - 无需销假")
|
||||
private String cancelStatus;
|
||||
|
||||
/**
|
||||
* 销假时间
|
||||
*/
|
||||
@ExcelProperty(value = "销假时间")
|
||||
private Date cancelTime;
|
||||
|
||||
/**
|
||||
* 销假地理位置
|
||||
*/
|
||||
@ExcelProperty(value = "销假地理位置")
|
||||
private String cancelLocation;
|
||||
|
||||
/**
|
||||
* 销假照片OSS文件ID(逗号分隔)
|
||||
*/
|
||||
@ExcelProperty(value = "销假照片OSS文件ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "逗=号分隔")
|
||||
private String cancelPhotoOssIds;
|
||||
|
||||
/**
|
||||
* 销假备注
|
||||
*/
|
||||
@ExcelProperty(value = "销假备注")
|
||||
private String cancelRemark;
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package org.dromara.workflow.mapper;
|
||||
|
||||
import org.dromara.workflow.domain.XgStudentLeave;
|
||||
import org.dromara.workflow.domain.vo.XgStudentLeaveVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 学生请假 - 记录学生的请假申请、审批和销假信息Mapper接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
public interface XgStudentLeaveMapper extends BaseMapperPlus<XgStudentLeave, XgStudentLeaveVo> {
|
||||
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package org.dromara.workflow.service;
|
||||
|
||||
import org.dromara.workflow.domain.vo.XgStudentLeaveVo;
|
||||
import org.dromara.workflow.domain.bo.XgStudentLeaveBo;
|
||||
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-08-03
|
||||
*/
|
||||
public interface IXgStudentLeaveService {
|
||||
|
||||
/**
|
||||
* 查询学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*/
|
||||
XgStudentLeaveVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询学生请假 - 记录学生的请假申请、审批和销假信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 学生请假 - 记录学生的请假申请、审批和销假信息分页列表
|
||||
*/
|
||||
TableDataInfo<XgStudentLeaveVo> queryPageList(XgStudentLeaveBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的学生请假 - 记录学生的请假申请、审批和销假信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 学生请假 - 记录学生的请假申请、审批和销假信息列表
|
||||
*/
|
||||
List<XgStudentLeaveVo> queryList(XgStudentLeaveBo bo);
|
||||
|
||||
/**
|
||||
* 新增学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*
|
||||
* @param bo 学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(XgStudentLeaveBo bo);
|
||||
|
||||
/**
|
||||
* 修改学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*
|
||||
* @param bo 学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(XgStudentLeaveBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除学生请假 - 记录学生的请假申请、审批和销假信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
+163
@@ -0,0 +1,163 @@
|
||||
package org.dromara.workflow.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.workflow.domain.bo.XgStudentLeaveBo;
|
||||
import org.dromara.workflow.domain.vo.XgStudentLeaveVo;
|
||||
import org.dromara.workflow.domain.XgStudentLeave;
|
||||
import org.dromara.workflow.mapper.XgStudentLeaveMapper;
|
||||
import org.dromara.workflow.service.IXgStudentLeaveService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 学生请假 - 记录学生的请假申请、审批和销假信息Service业务层处理
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class XgStudentLeaveServiceImpl implements IXgStudentLeaveService {
|
||||
|
||||
private final XgStudentLeaveMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*/
|
||||
@Override
|
||||
public XgStudentLeaveVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询学生请假 - 记录学生的请假申请、审批和销假信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 学生请假 - 记录学生的请假申请、审批和销假信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<XgStudentLeaveVo> queryPageList(XgStudentLeaveBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<XgStudentLeave> lqw = buildQueryWrapper(bo);
|
||||
Page<XgStudentLeaveVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的学生请假 - 记录学生的请假申请、审批和销假信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 学生请假 - 记录学生的请假申请、审批和销假信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<XgStudentLeaveVo> queryList(XgStudentLeaveBo bo) {
|
||||
LambdaQueryWrapper<XgStudentLeave> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<XgStudentLeave> buildQueryWrapper(XgStudentLeaveBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<XgStudentLeave> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(XgStudentLeave::getId);
|
||||
lqw.eq(bo.getDeleted() != null, XgStudentLeave::getDeleted, bo.getDeleted());
|
||||
lqw.eq(bo.getStudentId() != null, XgStudentLeave::getStudentId, bo.getStudentId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getStudentName()), XgStudentLeave::getStudentName, bo.getStudentName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStudentNo()), XgStudentLeave::getStudentNo, bo.getStudentNo());
|
||||
lqw.eq(bo.getClassId() != null, XgStudentLeave::getClassId, bo.getClassId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getClassName()), XgStudentLeave::getClassName, bo.getClassName());
|
||||
lqw.eq(bo.getMajorId() != null, XgStudentLeave::getMajorId, bo.getMajorId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getMajorName()), XgStudentLeave::getMajorName, bo.getMajorName());
|
||||
lqw.eq(bo.getCollegeId() != null, XgStudentLeave::getCollegeId, bo.getCollegeId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCollegeName()), XgStudentLeave::getCollegeName, bo.getCollegeName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLeaveTypeCode()), XgStudentLeave::getLeaveTypeCode, bo.getLeaveTypeCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getLeaveTypeName()), XgStudentLeave::getLeaveTypeName, bo.getLeaveTypeName());
|
||||
lqw.eq(bo.getStartTime() != null, XgStudentLeave::getStartTime, bo.getStartTime());
|
||||
lqw.eq(bo.getEndTime() != null, XgStudentLeave::getEndTime, bo.getEndTime());
|
||||
lqw.eq(bo.getLeaveDuration() != null, XgStudentLeave::getLeaveDuration, bo.getLeaveDuration());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIsLeaveSchool()), XgStudentLeave::getIsLeaveSchool, bo.getIsLeaveSchool());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getNeedCancel()), XgStudentLeave::getNeedCancel, bo.getNeedCancel());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEmergencyContact()), XgStudentLeave::getEmergencyContact, bo.getEmergencyContact());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEmergencyPhone()), XgStudentLeave::getEmergencyPhone, bo.getEmergencyPhone());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLeaveReason()), XgStudentLeave::getLeaveReason, bo.getLeaveReason());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLeaveLocation()), XgStudentLeave::getLeaveLocation, bo.getLeaveLocation());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAttachmentOssIds()), XgStudentLeave::getAttachmentOssIds, bo.getAttachmentOssIds());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getApprovalStatus()), XgStudentLeave::getApprovalStatus, bo.getApprovalStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getApprovalOpinion()), XgStudentLeave::getApprovalOpinion, bo.getApprovalOpinion());
|
||||
lqw.eq(bo.getApprovalTime() != null, XgStudentLeave::getApprovalTime, bo.getApprovalTime());
|
||||
lqw.eq(bo.getApprovalBy() != null, XgStudentLeave::getApprovalBy, bo.getApprovalBy());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getApprovalByName()), XgStudentLeave::getApprovalByName, bo.getApprovalByName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCancelStatus()), XgStudentLeave::getCancelStatus, bo.getCancelStatus());
|
||||
lqw.eq(bo.getCancelTime() != null, XgStudentLeave::getCancelTime, bo.getCancelTime());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCancelLocation()), XgStudentLeave::getCancelLocation, bo.getCancelLocation());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCancelPhotoOssIds()), XgStudentLeave::getCancelPhotoOssIds, bo.getCancelPhotoOssIds());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCancelRemark()), XgStudentLeave::getCancelRemark, bo.getCancelRemark());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*
|
||||
* @param bo 学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(XgStudentLeaveBo bo) {
|
||||
XgStudentLeave add = MapstructUtils.convert(bo, XgStudentLeave.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
*
|
||||
* @param bo 学生请假 - 记录学生的请假申请、审批和销假信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(XgStudentLeaveBo bo) {
|
||||
XgStudentLeave update = MapstructUtils.convert(bo, XgStudentLeave.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(XgStudentLeave 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.workflow.mapper.XgStudentLeaveMapper">
|
||||
|
||||
</mapper>
|
||||
+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.XgLeaveTypeConfigVo;
|
||||
import org.dromara.xg.domain.bo.XgLeaveTypeConfigBo;
|
||||
import org.dromara.xg.service.IXgLeaveTypeConfigService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 学生请假类型配置
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/xgLeaveTypeConfig/xgLeaveTypeConfig")
|
||||
public class XgLeaveTypeConfigController extends BaseController {
|
||||
|
||||
private final IXgLeaveTypeConfigService xgLeaveTypeConfigService;
|
||||
|
||||
/**
|
||||
* 查询学生请假类型配置列表
|
||||
*/
|
||||
@SaCheckPermission("xgLeaveTypeConfig:xgLeaveTypeConfig:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<XgLeaveTypeConfigVo> list(XgLeaveTypeConfigBo bo, PageQuery pageQuery) {
|
||||
return xgLeaveTypeConfigService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出学生请假类型配置列表
|
||||
*/
|
||||
@SaCheckPermission("xgLeaveTypeConfig:xgLeaveTypeConfig:export")
|
||||
@Log(title = "学生请假类型配置", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(XgLeaveTypeConfigBo bo, HttpServletResponse response) {
|
||||
List<XgLeaveTypeConfigVo> list = xgLeaveTypeConfigService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "学生请假类型配置", XgLeaveTypeConfigVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学生请假类型配置详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("xgLeaveTypeConfig:xgLeaveTypeConfig:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<XgLeaveTypeConfigVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(xgLeaveTypeConfigService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增学生请假类型配置
|
||||
*/
|
||||
@SaCheckPermission("xgLeaveTypeConfig:xgLeaveTypeConfig:add")
|
||||
@Log(title = "学生请假类型配置", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody XgLeaveTypeConfigBo bo) {
|
||||
return toAjax(xgLeaveTypeConfigService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改学生请假类型配置
|
||||
*/
|
||||
@SaCheckPermission("xgLeaveTypeConfig:xgLeaveTypeConfig:edit")
|
||||
@Log(title = "学生请假类型配置", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody XgLeaveTypeConfigBo bo) {
|
||||
return toAjax(xgLeaveTypeConfigService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除学生请假类型配置
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("xgLeaveTypeConfig:xgLeaveTypeConfig:remove")
|
||||
@Log(title = "学生请假类型配置", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(xgLeaveTypeConfigService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
+22
@@ -39,6 +39,7 @@ import org.dromara.common.excel.convert.ExcelDictPreloadConvert;
|
||||
import org.dromara.common.excel.service.SqlCacheConfigService;
|
||||
import org.dromara.common.core.utils.SpringUtils;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.satoken.utils.LoginHelper;
|
||||
import org.dromara.xg.domain.vo.XgStudentMsgVo;
|
||||
import org.dromara.xg.domain.bo.XgStudentMsgBo;
|
||||
import org.dromara.xg.domain.bo.XgStudentMsgAdvancedSearchBo;
|
||||
@@ -615,6 +616,27 @@ public class XgStudentMsgController extends BaseController {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前登录用户的学生信息
|
||||
*/
|
||||
@SaCheckPermission("studentMsg:studentMsg:query")
|
||||
@GetMapping("/currentUserInfo")
|
||||
public R<XgStudentMsgVo> getCurrentUserInfo() {
|
||||
// 获取当前登录用户ID
|
||||
Long userId = LoginHelper.getUserId();
|
||||
if (userId == null) {
|
||||
return R.fail("用户未登录");
|
||||
}
|
||||
|
||||
// 根据用户ID查询学生信息
|
||||
XgStudentMsgVo studentInfo = xgStudentMsgService.queryByUserId(userId);
|
||||
if (studentInfo == null) {
|
||||
return R.fail("未找到当前用户的学生信息");
|
||||
}
|
||||
|
||||
return R.ok(studentInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取学生信息详细信息
|
||||
*
|
||||
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
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_leave_type_config
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("xg_leave_type_config")
|
||||
public class XgLeaveTypeConfig 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 leaveTypeName;
|
||||
|
||||
/**
|
||||
* 请假类型编码
|
||||
*/
|
||||
private String leaveTypeCode;
|
||||
|
||||
/**
|
||||
* 请假类型描述
|
||||
*/
|
||||
private String leaveTypeDesc;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 请假是否需要上传地理位置:0-否,1-是
|
||||
*/
|
||||
private String needLocationOnApply;
|
||||
|
||||
/**
|
||||
* 销假是否必须上传照片:0-否,1-是
|
||||
*/
|
||||
private String needPhotoOnCancel;
|
||||
|
||||
/**
|
||||
* 销假是否需要上传地理位置:0-否,1-是
|
||||
*/
|
||||
private String needLocationOnCancel;
|
||||
|
||||
/**
|
||||
* 非离校请假是否需要销假:0-否,1-是
|
||||
*/
|
||||
private String needCancelForNonLeave;
|
||||
|
||||
/**
|
||||
* 是否可以提前请假:0-否,1-是
|
||||
*/
|
||||
private String canApplyInAdvance;
|
||||
|
||||
/**
|
||||
* 是否开启:0-关闭,1-开启
|
||||
*/
|
||||
private String isEnabled;
|
||||
|
||||
/**
|
||||
* 请假最大申请时长(天)
|
||||
*/
|
||||
private Double maxApplyDuration;
|
||||
|
||||
/**
|
||||
* 销假逾期多少时长给予提醒(天)
|
||||
*/
|
||||
private Double cancelOverdueReminder;
|
||||
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
package org.dromara.xg.domain.bo;
|
||||
|
||||
import org.dromara.xg.domain.XgLeaveTypeConfig;
|
||||
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_leave_type_config
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = XgLeaveTypeConfig.class, reverseConvertGenerate = false)
|
||||
public class XgLeaveTypeConfigBo 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 leaveTypeName;
|
||||
|
||||
/**
|
||||
* 请假类型编码
|
||||
*/
|
||||
@NotBlank(message = "请假类型编码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String leaveTypeCode;
|
||||
|
||||
/**
|
||||
* 请假类型描述
|
||||
*/
|
||||
private String leaveTypeDesc;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 请假是否需要上传地理位置:0-否,1-是
|
||||
*/
|
||||
@NotBlank(message = "请假是否需要上传地理位置:0-否,1-是不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String needLocationOnApply;
|
||||
|
||||
/**
|
||||
* 销假是否必须上传照片:0-否,1-是
|
||||
*/
|
||||
@NotBlank(message = "销假是否必须上传照片:0-否,1-是不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String needPhotoOnCancel;
|
||||
|
||||
/**
|
||||
* 销假是否需要上传地理位置:0-否,1-是
|
||||
*/
|
||||
@NotBlank(message = "销假是否需要上传地理位置:0-否,1-是不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String needLocationOnCancel;
|
||||
|
||||
/**
|
||||
* 非离校请假是否需要销假:0-否,1-是
|
||||
*/
|
||||
@NotBlank(message = "非离校请假是否需要销假:0-否,1-是不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String needCancelForNonLeave;
|
||||
|
||||
/**
|
||||
* 是否可以提前请假:0-否,1-是
|
||||
*/
|
||||
@NotBlank(message = "是否可以提前请假:0-否,1-是不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String canApplyInAdvance;
|
||||
|
||||
/**
|
||||
* 是否开启:0-关闭,1-开启
|
||||
*/
|
||||
@NotBlank(message = "是否开启:0-关闭,1-开启不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String isEnabled;
|
||||
|
||||
/**
|
||||
* 请假最大申请时长(天)
|
||||
*/
|
||||
private Double maxApplyDuration;
|
||||
|
||||
/**
|
||||
* 销假逾期多少时长给予提醒(天)
|
||||
*/
|
||||
private Double cancelOverdueReminder;
|
||||
|
||||
|
||||
}
|
||||
+119
@@ -0,0 +1,119 @@
|
||||
package org.dromara.xg.domain.vo;
|
||||
|
||||
import org.dromara.xg.domain.XgLeaveTypeConfig;
|
||||
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_leave_type_config
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = XgLeaveTypeConfig.class)
|
||||
public class XgLeaveTypeConfigVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键ID(雪花ID)
|
||||
*/
|
||||
@ExcelProperty(value = "主键ID", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "雪=花ID")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 请假类型名称
|
||||
*/
|
||||
@ExcelProperty(value = "请假类型名称")
|
||||
private String leaveTypeName;
|
||||
|
||||
/**
|
||||
* 请假类型编码
|
||||
*/
|
||||
@ExcelProperty(value = "请假类型编码")
|
||||
private String leaveTypeCode;
|
||||
|
||||
/**
|
||||
* 请假类型描述
|
||||
*/
|
||||
@ExcelProperty(value = "请假类型描述")
|
||||
private String leaveTypeDesc;
|
||||
|
||||
/**
|
||||
* 排序号
|
||||
*/
|
||||
@ExcelProperty(value = "排序号")
|
||||
private Long sortOrder;
|
||||
|
||||
/**
|
||||
* 请假是否需要上传地理位置:0-否,1-是
|
||||
*/
|
||||
@ExcelProperty(value = "请假是否需要上传地理位置:0-否,1-是", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_yesno")
|
||||
private String needLocationOnApply;
|
||||
|
||||
/**
|
||||
* 销假是否必须上传照片:0-否,1-是
|
||||
*/
|
||||
@ExcelProperty(value = "销假是否必须上传照片:0-否,1-是", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_yesno")
|
||||
private String needPhotoOnCancel;
|
||||
|
||||
/**
|
||||
* 销假是否需要上传地理位置:0-否,1-是
|
||||
*/
|
||||
@ExcelProperty(value = "销假是否需要上传地理位置:0-否,1-是", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_yesno")
|
||||
private String needLocationOnCancel;
|
||||
|
||||
/**
|
||||
* 非离校请假是否需要销假:0-否,1-是
|
||||
*/
|
||||
@ExcelProperty(value = "非离校请假是否需要销假:0-否,1-是", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_yesno")
|
||||
private String needCancelForNonLeave;
|
||||
|
||||
/**
|
||||
* 是否可以提前请假:0-否,1-是
|
||||
*/
|
||||
@ExcelProperty(value = "是否可以提前请假:0-否,1-是", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_yesno")
|
||||
private String canApplyInAdvance;
|
||||
|
||||
/**
|
||||
* 是否开启:0-关闭,1-开启
|
||||
*/
|
||||
@ExcelProperty(value = "是否开启:0-关闭,1-开启", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(dictType = "sys_yesno")
|
||||
private String isEnabled;
|
||||
|
||||
/**
|
||||
* 请假最大申请时长(天)
|
||||
*/
|
||||
@ExcelProperty(value = "请假最大申请时长", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "天=")
|
||||
private Double maxApplyDuration;
|
||||
|
||||
/**
|
||||
* 销假逾期多少时长给予提醒(天)
|
||||
*/
|
||||
@ExcelProperty(value = "销假逾期多少时长给予提醒", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "天=")
|
||||
private Double cancelOverdueReminder;
|
||||
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package org.dromara.xg.mapper;
|
||||
|
||||
import org.dromara.xg.domain.XgLeaveTypeConfig;
|
||||
import org.dromara.xg.domain.vo.XgLeaveTypeConfigVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 学生请假类型配置Mapper接口
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
public interface XgLeaveTypeConfigMapper extends BaseMapperPlus<XgLeaveTypeConfig, XgLeaveTypeConfigVo> {
|
||||
|
||||
}
|
||||
+68
@@ -0,0 +1,68 @@
|
||||
package org.dromara.xg.service;
|
||||
|
||||
import org.dromara.xg.domain.vo.XgLeaveTypeConfigVo;
|
||||
import org.dromara.xg.domain.bo.XgLeaveTypeConfigBo;
|
||||
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-08-03
|
||||
*/
|
||||
public interface IXgLeaveTypeConfigService {
|
||||
|
||||
/**
|
||||
* 查询学生请假类型配置
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 学生请假类型配置
|
||||
*/
|
||||
XgLeaveTypeConfigVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询学生请假类型配置列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 学生请假类型配置分页列表
|
||||
*/
|
||||
TableDataInfo<XgLeaveTypeConfigVo> queryPageList(XgLeaveTypeConfigBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的学生请假类型配置列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 学生请假类型配置列表
|
||||
*/
|
||||
List<XgLeaveTypeConfigVo> queryList(XgLeaveTypeConfigBo bo);
|
||||
|
||||
/**
|
||||
* 新增学生请假类型配置
|
||||
*
|
||||
* @param bo 学生请假类型配置
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(XgLeaveTypeConfigBo bo);
|
||||
|
||||
/**
|
||||
* 修改学生请假类型配置
|
||||
*
|
||||
* @param bo 学生请假类型配置
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(XgLeaveTypeConfigBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除学生请假类型配置信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
+8
@@ -98,6 +98,14 @@ public interface IXgStudentMsgService {
|
||||
*/
|
||||
XgStudentMsgVo queryPersonalInfo(Long userId);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询学生信息
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 学生信息
|
||||
*/
|
||||
XgStudentMsgVo queryByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 根据班级ID和姓名查询学生信息列表
|
||||
*
|
||||
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
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.XgLeaveTypeConfigBo;
|
||||
import org.dromara.xg.domain.vo.XgLeaveTypeConfigVo;
|
||||
import org.dromara.xg.domain.XgLeaveTypeConfig;
|
||||
import org.dromara.xg.mapper.XgLeaveTypeConfigMapper;
|
||||
import org.dromara.xg.service.IXgLeaveTypeConfigService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 学生请假类型配置Service业务层处理
|
||||
*
|
||||
* @author zlwu
|
||||
* @date 2025-08-03
|
||||
*/
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class XgLeaveTypeConfigServiceImpl implements IXgLeaveTypeConfigService {
|
||||
|
||||
private final XgLeaveTypeConfigMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询学生请假类型配置
|
||||
*
|
||||
* @param id 主键
|
||||
* @return 学生请假类型配置
|
||||
*/
|
||||
@Override
|
||||
public XgLeaveTypeConfigVo queryById(Long id) {
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询学生请假类型配置列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 学生请假类型配置分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<XgLeaveTypeConfigVo> queryPageList(XgLeaveTypeConfigBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<XgLeaveTypeConfig> lqw = buildQueryWrapper(bo);
|
||||
Page<XgLeaveTypeConfigVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的学生请假类型配置列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 学生请假类型配置列表
|
||||
*/
|
||||
@Override
|
||||
public List<XgLeaveTypeConfigVo> queryList(XgLeaveTypeConfigBo bo) {
|
||||
LambdaQueryWrapper<XgLeaveTypeConfig> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<XgLeaveTypeConfig> buildQueryWrapper(XgLeaveTypeConfigBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<XgLeaveTypeConfig> lqw = Wrappers.lambdaQuery();
|
||||
lqw.orderByAsc(XgLeaveTypeConfig::getSortOrder);
|
||||
lqw.orderByAsc(XgLeaveTypeConfig::getId);
|
||||
lqw.eq(bo.getDeleted() != null, XgLeaveTypeConfig::getDeleted, bo.getDeleted());
|
||||
lqw.eq(bo.getIsEnabled() != null, XgLeaveTypeConfig::getIsEnabled, bo.getIsEnabled());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getLeaveTypeName()), XgLeaveTypeConfig::getLeaveTypeName,
|
||||
bo.getLeaveTypeName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getLeaveTypeCode()), XgLeaveTypeConfig::getLeaveTypeCode,
|
||||
bo.getLeaveTypeCode());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增学生请假类型配置
|
||||
*
|
||||
* @param bo 学生请假类型配置
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(XgLeaveTypeConfigBo bo) {
|
||||
XgLeaveTypeConfig add = MapstructUtils.convert(bo, XgLeaveTypeConfig.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改学生请假类型配置
|
||||
*
|
||||
* @param bo 学生请假类型配置
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(XgLeaveTypeConfigBo bo) {
|
||||
XgLeaveTypeConfig update = MapstructUtils.convert(bo, XgLeaveTypeConfig.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(XgLeaveTypeConfig entity) {
|
||||
// TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除学生请假类型配置信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
// TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
+14
@@ -663,6 +663,20 @@ public class XgStudentMsgServiceImpl implements IXgStudentMsgService {
|
||||
.eq(XgStudentMsg::getId, userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户ID查询学生信息
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 学生信息
|
||||
*/
|
||||
@Override
|
||||
public XgStudentMsgVo queryByUserId(Long userId) {
|
||||
// deleted 为0 且 用户ID为userId
|
||||
return baseMapper.selectVoOne(new LambdaQueryWrapper<XgStudentMsg>()
|
||||
.eq(XgStudentMsg::getDeleted, 0)
|
||||
.eq(XgStudentMsg::getId, userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据班级ID和姓名查询学生信息列表
|
||||
*
|
||||
|
||||
+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.XgLeaveTypeConfigMapper">
|
||||
|
||||
</mapper>
|
||||
Reference in new issue
Block a user