提交代码
This commit is contained in:
1 parent
5e0af12650
commit
7c78b3cf29
9 files changed
+791
-11
No files matched your search
+13
@@ -17,6 +17,7 @@ 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.DormHygieneCheckExportVo;
|
||||
import org.dromara.xg.domain.vo.XgDormHygieneCheckVo;
|
||||
import org.dromara.xg.domain.bo.XgDormHygieneCheckBo;
|
||||
import org.dromara.xg.domain.bo.XgDormHygieneCheckCompleteBo;
|
||||
@@ -123,4 +124,16 @@ public class XgDormHygieneCheckController extends BaseController {
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable Long[] ids) {
|
||||
return toAjax(xgDormHygieneCheckService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出宿舍卫生检查列表(包含学生卫生情况)
|
||||
*/
|
||||
@SaCheckPermission("dormHygieneCheck:dormHygieneCheck:export")
|
||||
@Log(title = "宿舍卫生检查", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/advancedExport")
|
||||
public void advancedExport(XgDormHygieneCheckBo bo, HttpServletResponse response) {
|
||||
List<DormHygieneCheckExportVo> list = xgDormHygieneCheckService.queryExportList(bo);
|
||||
ExcelUtil.exportExcel(list, "宿舍卫生检查数据", DormHygieneCheckExportVo.class, response);
|
||||
}
|
||||
|
||||
}
|
||||
+183
@@ -0,0 +1,183 @@
|
||||
package org.dromara.xg.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
||||
import org.dromara.xg.convert.StudentInfoExcelConvert;
|
||||
import org.dromara.xg.domain.XgDormHygieneCheck;
|
||||
import org.dromara.xg.domain.XgDormViolation;
|
||||
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 java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 宿舍卫生检查导出 视图对象 dorm_hygiene_check_export
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2025-01-29
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = XgDormHygieneCheck.class)
|
||||
public class DormHygieneCheckExportVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 检查标题
|
||||
*/
|
||||
@ExcelProperty(value = "检查标题")
|
||||
private String checkTitle;
|
||||
|
||||
/**
|
||||
* 检查日期
|
||||
*/
|
||||
@ExcelProperty(value = "检查日期")
|
||||
private String checkDate;
|
||||
|
||||
/**
|
||||
* 检查员姓名
|
||||
*/
|
||||
@ExcelProperty(value = "检查员")
|
||||
private String checkerName;
|
||||
|
||||
/**
|
||||
* 检查类型
|
||||
*/
|
||||
@ExcelProperty(value = "检查类型")
|
||||
private String checkTypeText;
|
||||
|
||||
/**
|
||||
* 检查级别
|
||||
*/
|
||||
@ExcelProperty(value = "检查级别")
|
||||
private String checkLevelText;
|
||||
|
||||
/**
|
||||
* 校区名称
|
||||
*/
|
||||
@ExcelProperty(value = "校区")
|
||||
private String campusName;
|
||||
|
||||
/**
|
||||
* 宿舍区名称
|
||||
*/
|
||||
@ExcelProperty(value = "宿舍区")
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 宿舍楼名称
|
||||
*/
|
||||
@ExcelProperty(value = "宿舍楼")
|
||||
private String buildingName;
|
||||
|
||||
/**
|
||||
* 房间名称
|
||||
*/
|
||||
@ExcelProperty(value = "房间号")
|
||||
private String roomName;
|
||||
|
||||
/**
|
||||
* 宿舍总分
|
||||
*/
|
||||
@ExcelProperty(value = "宿舍总分")
|
||||
private Double totalScore;
|
||||
|
||||
/**
|
||||
* 卫生等级
|
||||
*/
|
||||
@ExcelProperty(value = "卫生等级")
|
||||
private String hygieneGradeText;
|
||||
|
||||
/**
|
||||
* 学号
|
||||
*/
|
||||
@ExcelProperty(value = "学号")
|
||||
private String studentNo;
|
||||
|
||||
/**
|
||||
* 学生姓名
|
||||
*/
|
||||
@ExcelProperty(value = "学生姓名")
|
||||
private String studentName;
|
||||
|
||||
/**
|
||||
* 班级名称
|
||||
*/
|
||||
@ExcelProperty(value = "班级")
|
||||
private String className;
|
||||
|
||||
/**
|
||||
* 专业名称
|
||||
*/
|
||||
@ExcelProperty(value = "专业")
|
||||
private String majorName;
|
||||
|
||||
/**
|
||||
* 学院名称
|
||||
*/
|
||||
@ExcelProperty(value = "学院")
|
||||
private String collegeName;
|
||||
|
||||
/**
|
||||
* 床位编号
|
||||
*/
|
||||
@ExcelProperty(value = "床位号")
|
||||
private String bedCode;
|
||||
|
||||
/**
|
||||
* 学生个人得分
|
||||
*/
|
||||
@ExcelProperty(value = "个人得分")
|
||||
private Integer studentScore;
|
||||
|
||||
/**
|
||||
* 出勤状态
|
||||
*/
|
||||
@ExcelProperty(value = "出勤状态")
|
||||
private String attendanceStatusText;
|
||||
|
||||
/**
|
||||
* 学生评级
|
||||
*/
|
||||
@ExcelProperty(value = "个人评级")
|
||||
private String studentGradeText;
|
||||
|
||||
/**
|
||||
* 是否为寝室长
|
||||
*/
|
||||
// @ExcelProperty(value = "是否寝室长")
|
||||
// private String isResponsiblePersonText;
|
||||
|
||||
/**
|
||||
* 评分备注
|
||||
*/
|
||||
// @ExcelProperty(value = "评分备注")
|
||||
// private String scoreRemarks;
|
||||
|
||||
/**
|
||||
* 改进意见
|
||||
*/
|
||||
// @ExcelProperty(value = "改进意见")
|
||||
// private String improvementNotes;
|
||||
|
||||
/**
|
||||
* 检查总结
|
||||
*/
|
||||
@ExcelProperty(value = "检查总结")
|
||||
private String checkSummary;
|
||||
|
||||
/**
|
||||
* 整改建议
|
||||
*/
|
||||
@ExcelProperty(value = "整改建议")
|
||||
private String improvementSuggestions;
|
||||
|
||||
}
|
||||
+11
@@ -1,8 +1,11 @@
|
||||
package org.dromara.xg.mapper;
|
||||
|
||||
import org.dromara.xg.domain.XgDormHygieneCheck;
|
||||
import org.dromara.xg.domain.bo.XgDormHygieneCheckBo;
|
||||
import org.dromara.xg.domain.vo.DormHygieneCheckExportVo;
|
||||
import org.dromara.xg.domain.vo.XgDormHygieneCheckVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 宿舍卫生检查Mapper接口
|
||||
@@ -12,4 +15,12 @@ import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
*/
|
||||
public interface XgDormHygieneCheckMapper extends BaseMapperPlus<XgDormHygieneCheck, XgDormHygieneCheckVo> {
|
||||
|
||||
/**
|
||||
* 查询宿舍卫生检查导出列表(包含学生卫生情况)
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 导出数据列表
|
||||
*/
|
||||
List<DormHygieneCheckExportVo> selectExportList(XgDormHygieneCheckBo bo);
|
||||
|
||||
}
|
||||
+10
@@ -1,5 +1,6 @@
|
||||
package org.dromara.xg.service;
|
||||
|
||||
import org.dromara.xg.domain.vo.DormHygieneCheckExportVo;
|
||||
import org.dromara.xg.domain.vo.XgDormHygieneCheckVo;
|
||||
import org.dromara.xg.domain.bo.XgDormHygieneCheckBo;
|
||||
import org.dromara.xg.domain.bo.XgDormHygieneCheckCompleteBo;
|
||||
@@ -82,4 +83,13 @@ public interface IXgDormHygieneCheckService {
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateWithStudentScores(XgDormHygieneCheckCompleteBo bo);
|
||||
|
||||
/**
|
||||
* 查询宿舍卫生检查导出列表(包含学生卫生情况)
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 导出数据列表
|
||||
*/
|
||||
List<DormHygieneCheckExportVo> queryExportList(XgDormHygieneCheckBo bo);
|
||||
|
||||
}
|
||||
+121
@@ -14,6 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.dromara.xg.domain.bo.XgDormHygieneCheckBo;
|
||||
import org.dromara.xg.domain.bo.XgDormHygieneCheckCompleteBo;
|
||||
import org.dromara.xg.domain.bo.XgDormHygieneStudentScoreBo;
|
||||
import org.dromara.xg.domain.vo.DormHygieneCheckExportVo;
|
||||
import org.dromara.xg.domain.vo.XgDormHygieneCheckVo;
|
||||
import org.dromara.xg.domain.XgDormHygieneCheck;
|
||||
import org.dromara.xg.domain.XgDormHygieneStudentScore;
|
||||
@@ -341,4 +342,124 @@ public class XgDormHygieneCheckServiceImpl implements IXgDormHygieneCheckService
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询宿舍卫生检查导出列表(包含学生卫生情况)
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 导出数据列表
|
||||
*/
|
||||
@Override
|
||||
public List<DormHygieneCheckExportVo> queryExportList(XgDormHygieneCheckBo bo) {
|
||||
// 调用mapper查询导出数据
|
||||
List<DormHygieneCheckExportVo> exportList = baseMapper.selectExportList(bo);
|
||||
|
||||
// 转换字典值为文本
|
||||
for (DormHygieneCheckExportVo exportVo : exportList) {
|
||||
// 转换检查类型
|
||||
exportVo.setCheckTypeText(convertCheckTypeToText(exportVo.getCheckTypeText()));
|
||||
|
||||
// 转换检查级别
|
||||
exportVo.setCheckLevelText(convertCheckLevelToText(exportVo.getCheckLevelText()));
|
||||
|
||||
// 转换卫生等级
|
||||
exportVo.setHygieneGradeText(convertHygieneGradeToText(exportVo.getHygieneGradeText()));
|
||||
|
||||
// 转换出勤状态
|
||||
exportVo.setAttendanceStatusText(convertAttendanceStatusToText(exportVo.getAttendanceStatusText()));
|
||||
|
||||
// 转换学生评级
|
||||
exportVo.setStudentGradeText(convertStudentGradeToText(exportVo.getStudentGradeText()));
|
||||
|
||||
// 转换是否寝室长
|
||||
exportVo.setIsResponsiblePersonText(convertResponsiblePersonToText(exportVo.getIsResponsiblePersonText()));
|
||||
}
|
||||
|
||||
return exportList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换检查类型代码为文本
|
||||
*/
|
||||
private String convertCheckTypeToText(String checkType) {
|
||||
if (StringUtils.isEmpty(checkType)) {
|
||||
return "";
|
||||
}
|
||||
Map<String, String> typeMap = Map.of(
|
||||
"1", "日常检查",
|
||||
"2", "专项检查",
|
||||
"3", "突击检查",
|
||||
"4", "复查");
|
||||
return typeMap.getOrDefault(checkType, checkType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换检查级别代码为文本
|
||||
*/
|
||||
private String convertCheckLevelToText(String checkLevel) {
|
||||
if (StringUtils.isEmpty(checkLevel)) {
|
||||
return "";
|
||||
}
|
||||
Map<String, String> levelMap = Map.of(
|
||||
"1", "宿管员",
|
||||
"2", "学院",
|
||||
"3", "学校");
|
||||
return levelMap.getOrDefault(checkLevel, checkLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换卫生等级代码为文本
|
||||
*/
|
||||
private String convertHygieneGradeToText(String hygieneGrade) {
|
||||
if (StringUtils.isEmpty(hygieneGrade)) {
|
||||
return "";
|
||||
}
|
||||
Map<String, String> gradeMap = Map.of(
|
||||
"A", "优秀",
|
||||
"B", "良好",
|
||||
"C", "合格",
|
||||
"D", "不合格");
|
||||
return gradeMap.getOrDefault(hygieneGrade, hygieneGrade);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换出勤状态代码为文本
|
||||
*/
|
||||
private String convertAttendanceStatusToText(String attendanceStatus) {
|
||||
if (StringUtils.isEmpty(attendanceStatus)) {
|
||||
return "";
|
||||
}
|
||||
Map<String, String> statusMap = Map.of(
|
||||
"1", "在寝",
|
||||
"2", "外出",
|
||||
"3", "请假",
|
||||
"4", "其他");
|
||||
return statusMap.getOrDefault(attendanceStatus, attendanceStatus);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换学生评级代码为文本
|
||||
*/
|
||||
private String convertStudentGradeToText(String studentGrade) {
|
||||
if (StringUtils.isEmpty(studentGrade)) {
|
||||
return "";
|
||||
}
|
||||
Map<String, String> gradeMap = Map.of(
|
||||
"A", "优秀",
|
||||
"B", "良好",
|
||||
"C", "合格",
|
||||
"D", "不合格");
|
||||
return gradeMap.getOrDefault(studentGrade, studentGrade);
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换是否寝室长代码为文本
|
||||
*/
|
||||
private String convertResponsiblePersonToText(String isResponsiblePerson) {
|
||||
if (StringUtils.isEmpty(isResponsiblePerson)) {
|
||||
return "否";
|
||||
}
|
||||
return "1".equals(isResponsiblePerson) ? "是" : "否";
|
||||
}
|
||||
|
||||
}
|
||||
+114
@@ -4,4 +4,118 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.xg.mapper.XgDormHygieneCheckMapper">
|
||||
|
||||
<resultMap type="org.dromara.xg.domain.vo.DormHygieneCheckExportVo" id="DormHygieneCheckExportResult">
|
||||
<result property="checkTitle" column="check_title" />
|
||||
<result property="checkDate" column="check_date" />
|
||||
<result property="checkerName" column="checker_name" />
|
||||
<result property="checkTypeText" column="check_type" />
|
||||
<result property="checkLevelText" column="check_level" />
|
||||
<result property="campusName" column="campus_name" />
|
||||
<result property="areaName" column="area_name" />
|
||||
<result property="buildingName" column="building_name" />
|
||||
<result property="roomName" column="room_name" />
|
||||
<result property="totalScore" column="total_score" />
|
||||
<result property="hygieneGradeText" column="hygiene_grade" />
|
||||
<result property="studentNo" column="student_no" />
|
||||
<result property="studentName" column="student_name" />
|
||||
<result property="className" column="class_name" />
|
||||
<result property="majorName" column="major_name" />
|
||||
<result property="collegeName" column="college_name" />
|
||||
<result property="bedCode" column="bed_code" />
|
||||
<result property="studentScore" column="student_score" />
|
||||
<result property="attendanceStatusText" column="attendance_status" />
|
||||
<result property="studentGradeText" column="student_grade" />
|
||||
<result property="isResponsiblePersonText" column="is_responsible_person" />
|
||||
<result property="scoreRemarks" column="score_remarks" />
|
||||
<result property="improvementNotes" column="improvement_notes" />
|
||||
<result property="checkSummary" column="check_summary" />
|
||||
<result property="improvementSuggestions" column="improvement_suggestions" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectExportList" parameterType="org.dromara.xg.domain.bo.XgDormHygieneCheckBo" resultMap="DormHygieneCheckExportResult">
|
||||
SELECT
|
||||
dhc.check_title,
|
||||
DATE_FORMAT(dhc.check_date, '%Y-%m-%d') as check_date,
|
||||
dhc.checker_name,
|
||||
dhc.check_type,
|
||||
dhc.check_level,
|
||||
dhc.campus_name,
|
||||
dhc.area_name,
|
||||
dhc.building_name,
|
||||
dhc.room_name,
|
||||
dhc.total_score,
|
||||
dhc.hygiene_grade,
|
||||
dhc.check_summary,
|
||||
dhc.improvement_suggestions,
|
||||
COALESCE(dhss.student_no, '') as student_no,
|
||||
COALESCE(dhss.student_name, '') as student_name,
|
||||
COALESCE(dhss.class_name, '') as class_name,
|
||||
COALESCE(dhss.major_name, '') as major_name,
|
||||
COALESCE(dhss.college_name, '') as college_name,
|
||||
COALESCE(dhss.bed_code, '') as bed_code,
|
||||
COALESCE(dhss.student_score, 0) as student_score,
|
||||
COALESCE(dhss.attendance_status, '') as attendance_status,
|
||||
COALESCE(dhss.student_grade, '') as student_grade,
|
||||
COALESCE(dhss.is_responsible_person, 0) as is_responsible_person,
|
||||
COALESCE(dhss.score_remarks, '') as score_remarks,
|
||||
COALESCE(dhss.improvement_notes, '') as improvement_notes
|
||||
FROM xg_dorm_hygiene_check dhc
|
||||
LEFT JOIN xg_dorm_hygiene_student_score dhss ON dhc.id = dhss.hygiene_check_id AND dhss.deleted = 0
|
||||
<where>
|
||||
dhc.deleted = 0
|
||||
<if test="checkTitle != null and checkTitle != ''">
|
||||
AND dhc.check_title LIKE CONCAT('%', #{checkTitle}, '%')
|
||||
</if>
|
||||
<if test="checkDate != null and checkDate != ''">
|
||||
AND DATE_FORMAT(dhc.check_date, '%Y-%m-%d') = #{checkDate}
|
||||
</if>
|
||||
<if test="checkerId != null">
|
||||
AND dhc.checker_id = #{checkerId}
|
||||
</if>
|
||||
<if test="checkerName != null and checkerName != ''">
|
||||
AND dhc.checker_name LIKE CONCAT('%', #{checkerName}, '%')
|
||||
</if>
|
||||
<if test="checkType != null and checkType != ''">
|
||||
AND dhc.check_type = #{checkType}
|
||||
</if>
|
||||
<if test="checkLevel != null and checkLevel != ''">
|
||||
AND dhc.check_level = #{checkLevel}
|
||||
</if>
|
||||
<if test="roomId != null">
|
||||
AND dhc.room_id = #{roomId}
|
||||
</if>
|
||||
<if test="roomName != null and roomName != ''">
|
||||
AND dhc.room_name LIKE CONCAT('%', #{roomName}, '%')
|
||||
</if>
|
||||
<if test="buildingId != null">
|
||||
AND dhc.building_id = #{buildingId}
|
||||
</if>
|
||||
<if test="buildingName != null and buildingName != ''">
|
||||
AND dhc.building_name LIKE CONCAT('%', #{buildingName}, '%')
|
||||
</if>
|
||||
<if test="areaId != null">
|
||||
AND dhc.area_id = #{areaId}
|
||||
</if>
|
||||
<if test="areaName != null and areaName != ''">
|
||||
AND dhc.area_name LIKE CONCAT('%', #{areaName}, '%')
|
||||
</if>
|
||||
<if test="campusId != null">
|
||||
AND dhc.campus_id = #{campusId}
|
||||
</if>
|
||||
<if test="campusName != null and campusName != ''">
|
||||
AND dhc.campus_name LIKE CONCAT('%', #{campusName}, '%')
|
||||
</if>
|
||||
<if test="hygieneGrade != null and hygieneGrade != ''">
|
||||
AND dhc.hygiene_grade = #{hygieneGrade}
|
||||
</if>
|
||||
<if test="params != null and params.beginTime != null and params.beginTime != ''">
|
||||
AND dhc.check_date >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params != null and params.endTime != null and params.endTime != ''">
|
||||
AND dhc.check_date <= #{params.endTime}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY dhc.check_date DESC, dhc.id ASC, dhss.student_no ASC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in new issue
Block a user