feat(archives): 添加一人一档PDF生成功能的日志记录
parent
4cea031d1e
commit
4a3f438864
|
|
@ -16,6 +16,8 @@ import com.zcloud.edu.command.convertor.archives.ArchivesReviewCoConvertor;
|
|||
import com.zcloud.edu.command.convertor.archives.ArchivesReviewRecordCoConvertor;
|
||||
import com.zcloud.edu.command.convertor.study.*;
|
||||
import com.zcloud.edu.config.FileUrlConfig;
|
||||
import com.zcloud.edu.domain.enums.ArchivesClassTypeEnum;
|
||||
import com.zcloud.edu.domain.enums.ArchivesPersonTypeEnum;
|
||||
import com.zcloud.edu.domain.model.archives.ArchivesPdfFileE;
|
||||
import com.zcloud.edu.domain.model.archives.ClassArchivesE;
|
||||
import com.zcloud.edu.domain.model.archives.PersonArchivesE;
|
||||
|
|
@ -312,7 +314,8 @@ public class ArchivesQueryExe {
|
|||
// 新增档案下载记录
|
||||
|
||||
ArchivesPdfFileE archivesPdfFileE = new ArchivesPdfFileE();
|
||||
archivesPdfFileE.init("student",personArchivesDTOList.get(0).getPhone() , 1, AuthContext.getTenantId(), personArchivesDTOList.get(0).getName()+"-"+DateUtil.getSdfTimes()+"-一人一档");
|
||||
String desc = ArchivesPersonTypeEnum.getDesc(qry.getTypeList());
|
||||
archivesPdfFileE.init("student",personArchivesDTOList.get(0).getPhone() , 1, AuthContext.getTenantId(), personArchivesDTOList.get(0).getName()+"-一人一档-"+desc);
|
||||
ArchivesPdfFileDO archivesPdfFileDO = new ArchivesPdfFileDO();
|
||||
BeanUtils.copyProperties(archivesPdfFileE, archivesPdfFileDO);
|
||||
archivesPdfFileRepository.save(archivesPdfFileDO);
|
||||
|
|
@ -534,10 +537,7 @@ public class ArchivesQueryExe {
|
|||
ClassE classE = new ClassE();
|
||||
BeanUtils.copyProperties(classDO, classE);
|
||||
// 教材会审表
|
||||
// 档案类型 1-首页 2-学时证明 3-学员学习档案 4-学习记录 5-考卷信息
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (qry.getTypeList().contains(1)){
|
||||
sb.append("-安全培训教材会审表");
|
||||
// 查询所有教材会审表
|
||||
List<ArchivesReviewDO> reviewList = archivesReviewRepository.listAll(params);
|
||||
String reviewIds = reviewList.stream()
|
||||
|
|
@ -562,7 +562,6 @@ public class ArchivesQueryExe {
|
|||
|
||||
// 安全培训教材或课程讲义
|
||||
if (qry.getTypeList().contains(2)){
|
||||
sb.append("-安全培训教材或课程讲义");
|
||||
List<ClassCurriculumDO> curList = classCurriculumRepository.listAll(params);
|
||||
List<String> classCurriculumIds = curList.stream().map(ClassCurriculumDO::getClassCurriculumId).collect(Collectors.toList());
|
||||
List<ClassCurriculumChapterDO> chapterList = classCurriculumChapterRepository.listByClassCurriculumIds(classCurriculumIds);
|
||||
|
|
@ -605,15 +604,7 @@ public class ArchivesQueryExe {
|
|||
}
|
||||
|
||||
}
|
||||
if (qry.getTypeList().contains(3)){
|
||||
sb.append("-安全培训教育记录及签字表");
|
||||
}
|
||||
if (qry.getTypeList().contains(4)){
|
||||
sb.append("-培训影像资料");
|
||||
}
|
||||
if (qry.getTypeList().contains(6)){
|
||||
sb.append("-学员考核成绩统计表");
|
||||
}
|
||||
|
||||
// if (qry.getTypeList().contains(4)){
|
||||
//
|
||||
// ClassDO classDO = classRepository.getByClassId(qry.getClassId());
|
||||
|
|
@ -623,7 +614,6 @@ public class ArchivesQueryExe {
|
|||
// classArchivesDTO.setSignList(BeanUtil.copyToList(studentSignList, StudentSignCO.class));
|
||||
// }
|
||||
if(qry.getTypeList().contains(5)){
|
||||
sb.append("-培训考核试卷");
|
||||
ClassExamPaperDO classExamPaperDO = classExamPaperRepository.findByClassId(qry.getClassId());
|
||||
List<QuestionDO> questionDOList = questionRepository.getInfoByExamPaperId(classExamPaperDO.getExamPaperId());
|
||||
List<QuestionCO> questionCOList = BeanUtil.copyToList(questionDOList, QuestionCO.class);
|
||||
|
|
@ -646,8 +636,9 @@ public class ArchivesQueryExe {
|
|||
classArchivesDTO.setClassCurriculumList(curriculumList);
|
||||
|
||||
// 新增档案下载记录
|
||||
String desc = ArchivesClassTypeEnum.getDesc(qry.getTypeList());
|
||||
ArchivesPdfFileE archivesPdfFileE = new ArchivesPdfFileE();
|
||||
archivesPdfFileE.init("class", classArchivesDTO.getClassId(), 2, AuthContext.getTenantId(), classArchivesDTO.getClassName()+"-一期一档"+sb.toString());
|
||||
archivesPdfFileE.init("class", classArchivesDTO.getClassId(), 2, AuthContext.getTenantId(), classArchivesDTO.getClassName()+"-一期一档-"+desc);
|
||||
ArchivesPdfFileDO archivesPdfFileDO = new ArchivesPdfFileDO();
|
||||
BeanUtils.copyProperties(archivesPdfFileE, archivesPdfFileDO);
|
||||
archivesPdfFileRepository.save(archivesPdfFileDO);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
package com.zcloud.edu.domain.enums;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 一人一档枚举
|
||||
* 档案类型 1-安全培训教材会审表 2-安全培训教材或课程讲义 3-安全培训教育记录及签字表 4-培训影像资料 5-培训考核试卷 6-学员考核成绩统计表
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ArchivesClassTypeEnum {
|
||||
SAFE_TEACHING_MATERIAL_AUDIT(1, "安全培训教材会审表"),
|
||||
SAFE_TEACHING_MATERIAL_OR_COURSE_LESSON(2, "安全培训教材或课程讲义"),
|
||||
SAFE_TEACHING_EDUCATION_RECORD_AND_SIGNATURE(3, "安全培训教育记录及签字表"),
|
||||
SAFE_TEACHING_IMAGE_DATA(4, "培训影像资料"),
|
||||
SAFE_TEACHING_EXAM_PAPER(5, "培训考核试卷"),
|
||||
STUDENT_EXAM_STATISTICS_TABLE(6, "学员考核成绩统计表");
|
||||
|
||||
|
||||
|
||||
private final Integer code;
|
||||
private final String desc;
|
||||
|
||||
public static ArchivesClassTypeEnum of(Integer code) {
|
||||
for (ArchivesClassTypeEnum status : values()) {
|
||||
if (status.getCode().equals(code)) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
throw new BizException("未知的申请状态: " + code);
|
||||
}
|
||||
//根据code list,获取描述String,中间加"-"
|
||||
|
||||
public static String getDesc(List<Integer> codeList) {
|
||||
if (codeList == null || codeList.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
return codeList.stream()
|
||||
.map(code -> {
|
||||
for (ArchivesClassTypeEnum type : values()) {
|
||||
if (type.getCode().equals(code)) {
|
||||
return type.getDesc();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
})
|
||||
.filter(desc -> !desc.isEmpty())
|
||||
.collect(Collectors.joining("-"));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
package com.zcloud.edu.domain.enums;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 一人一档枚举
|
||||
* 档案类型 1-首页 2-学时证明 3-学员学习档案 4-学习记录 5-考卷信息
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ArchivesPersonTypeEnum {
|
||||
HOME_PAGE(1, "首页"),
|
||||
STUDENT_PROVE(2, "学时证明"),
|
||||
STUDENT_ARCHIVES(3, "学员学习档案"),
|
||||
STUDENT_LEARN_RECORD(4, "学习记录"),
|
||||
STUDENT_EXAM_INFO(5, "考卷信息");
|
||||
|
||||
|
||||
|
||||
private final Integer code;
|
||||
private final String desc;
|
||||
|
||||
public static ArchivesPersonTypeEnum of(Integer code) {
|
||||
for (ArchivesPersonTypeEnum status : values()) {
|
||||
if (status.getCode().equals(code)) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
throw new BizException("未知的申请状态: " + code);
|
||||
}
|
||||
//根据code list,获取描述String,中间加"-"
|
||||
|
||||
public static String getDesc(List<Integer> codeList) {
|
||||
if (codeList == null || codeList.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
return codeList.stream()
|
||||
.map(code -> {
|
||||
for (ArchivesPersonTypeEnum type : values()) {
|
||||
if (type.getCode().equals(code)) {
|
||||
return type.getDesc();
|
||||
}
|
||||
}
|
||||
return "";
|
||||
})
|
||||
.filter(desc -> !desc.isEmpty())
|
||||
.collect(Collectors.joining("-"));
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue