|
|
|
|
@ -62,6 +62,7 @@ import java.io.InputStream;
|
|
|
|
|
import java.net.URL;
|
|
|
|
|
import java.nio.file.Files;
|
|
|
|
|
import java.nio.file.Paths;
|
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@ -126,12 +127,14 @@ public class ArchivesQueryExe {
|
|
|
|
|
|
|
|
|
|
// 学员信息
|
|
|
|
|
StudentDO studentDO = studentRepository.getById(qry.getStuId());
|
|
|
|
|
System.out.println(studentDO.getState()+"-------------------------------------------------ccc-1--");
|
|
|
|
|
byte[] userIdCardBytes = Base64.getDecoder().decode(studentDO.getUserIdCard());
|
|
|
|
|
String userIdCardString = new String(userIdCardBytes);
|
|
|
|
|
studentDO.setUserIdCard(userIdCardString);
|
|
|
|
|
StudentE studentE = new StudentE();
|
|
|
|
|
BeanUtils.copyProperties(studentDO, studentE);
|
|
|
|
|
|
|
|
|
|
System.out.println(studentE.getState()+"-------------------------------------------------ccc2");
|
|
|
|
|
// 班级信息
|
|
|
|
|
ClassDO classDO = classRepository.getByClassId(studentDO.getClassId());
|
|
|
|
|
classE = new ClassE();
|
|
|
|
|
@ -218,7 +221,11 @@ public class ArchivesQueryExe {
|
|
|
|
|
System.out.println("4-------------------------------------------------------------");
|
|
|
|
|
}
|
|
|
|
|
if (qry.getTypeList().contains(5)){
|
|
|
|
|
byteArrayList.add(execteExamRecord(params));
|
|
|
|
|
|
|
|
|
|
byte[] examRecord = execteExamRecord(params);
|
|
|
|
|
if(examRecord != null){
|
|
|
|
|
byteArrayList.add(examRecord);
|
|
|
|
|
}
|
|
|
|
|
System.out.println("5-------------------------------------------------------------");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -233,6 +240,11 @@ public class ArchivesQueryExe {
|
|
|
|
|
BeanUtils.copyProperties(archivesPdfFileE, archivesPdfFileDO);
|
|
|
|
|
archivesPdfFileRepository.updateById(archivesPdfFileDO);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
ArchivesPdfFileE archivesPdfFileE = new ArchivesPdfFileE();
|
|
|
|
|
archivesPdfFileE.initEdit(params.getArchivesPdfFileId(), null, -1, null);
|
|
|
|
|
ArchivesPdfFileDO archivesPdfFileDO = new ArchivesPdfFileDO();
|
|
|
|
|
BeanUtils.copyProperties(archivesPdfFileE, archivesPdfFileDO);
|
|
|
|
|
archivesPdfFileRepository.updateById(archivesPdfFileDO);
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -350,7 +362,10 @@ public class ArchivesQueryExe {
|
|
|
|
|
System.out.println("4-------------------------------------------------------------");
|
|
|
|
|
}
|
|
|
|
|
if (qry.getTypeList().contains(5)){
|
|
|
|
|
byteArrayList.add(execteExamRecord(params));
|
|
|
|
|
byte[] examRecord = execteExamRecord(params);
|
|
|
|
|
if(examRecord != null){
|
|
|
|
|
byteArrayList.add(examRecord);
|
|
|
|
|
}
|
|
|
|
|
System.out.println("5-------------------------------------------------------------");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -372,6 +387,11 @@ public class ArchivesQueryExe {
|
|
|
|
|
BeanUtils.copyProperties(archivesPdfFileE, archivesPdfFileDO);
|
|
|
|
|
archivesPdfFileRepository.updateById(archivesPdfFileDO);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
ArchivesPdfFileE archivesPdfFileE = new ArchivesPdfFileE();
|
|
|
|
|
archivesPdfFileE.initEdit(personArchivesDTOList.get(0).getArchivesPdfFileId(), null, -1, null);
|
|
|
|
|
ArchivesPdfFileDO archivesPdfFileDO = new ArchivesPdfFileDO();
|
|
|
|
|
BeanUtils.copyProperties(archivesPdfFileE, archivesPdfFileDO);
|
|
|
|
|
archivesPdfFileRepository.updateById(archivesPdfFileDO);
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
log.error("execteGeneratePdfList,失败", e);
|
|
|
|
|
// throw new BizException("导出失败");
|
|
|
|
|
@ -425,8 +445,6 @@ public class ArchivesQueryExe {
|
|
|
|
|
PictureRenderData signFacePicture = Pictures.ofUrl(fileUrlConfig.getPrefixUrl() + params.getSignFaceUrl(), PictureType.JPEG).size(100, 100).create();//网络图片地址
|
|
|
|
|
workItem.put("signFacePicture", signFacePicture);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!ObjectUtils.isEmpty(params.getExamSignFaceUrl())) {
|
|
|
|
|
PictureRenderData examSignFacePicture = Pictures.ofUrl(fileUrlConfig.getPrefixUrl() + params.getExamSignFaceUrl(), PictureType.JPEG).size(100, 100).create();//网络图片地址
|
|
|
|
|
workItem.put("examSignFacePicture", examSignFacePicture);
|
|
|
|
|
@ -650,7 +668,6 @@ public class ArchivesQueryExe {
|
|
|
|
|
@Async("archivesAsyncExecutor")
|
|
|
|
|
public void execteClassGeneratePdf(ArchivesQry qry, ClassArchivesDTO params) {
|
|
|
|
|
params.setArchivesDate(DateUtil.getSdfTimes());
|
|
|
|
|
|
|
|
|
|
String tempDir = System.getProperty("java.io.tmpdir");
|
|
|
|
|
List<File> stringList = new ArrayList<>();
|
|
|
|
|
try {
|
|
|
|
|
@ -704,6 +721,11 @@ public class ArchivesQueryExe {
|
|
|
|
|
BeanUtils.copyProperties(archivesPdfFileE, archivesPdfFileDO);
|
|
|
|
|
archivesPdfFileRepository.updateById(archivesPdfFileDO);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
ArchivesPdfFileE archivesPdfFileE = new ArchivesPdfFileE();
|
|
|
|
|
archivesPdfFileE.initEdit(params.getArchivesPdfFileId(), null, -1, null);
|
|
|
|
|
ArchivesPdfFileDO archivesPdfFileDO = new ArchivesPdfFileDO();
|
|
|
|
|
BeanUtils.copyProperties(archivesPdfFileE, archivesPdfFileDO);
|
|
|
|
|
archivesPdfFileRepository.updateById(archivesPdfFileDO);
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
// } finally {
|
|
|
|
|
@ -742,7 +764,20 @@ public class ArchivesQueryExe {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public byte[] execteReviewInfo(ArchivesReviewCO params) throws Exception {
|
|
|
|
|
params.getAuditDate();
|
|
|
|
|
// 创建格式化器
|
|
|
|
|
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
|
|
// 转换为字符串
|
|
|
|
|
Map<String, Object> workItem = PropertyUtils.describe(params);
|
|
|
|
|
if(params.getWriteDate() != null){
|
|
|
|
|
workItem.put("writeDate", params.getWriteDate().format(formatter));
|
|
|
|
|
}
|
|
|
|
|
if(params.getAuditDate() != null){
|
|
|
|
|
workItem.put("auditDate", params.getAuditDate().format(formatter));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ArrayList<Object> workList = CollUtil.newArrayList();
|
|
|
|
|
String templatePath = "templates/template/review.docx";
|
|
|
|
|
if (params.getArchivesReviewRecordList() != null && params.getArchivesReviewRecordList().size() > 0){
|
|
|
|
|
@ -941,7 +976,7 @@ public class ArchivesQueryExe {
|
|
|
|
|
});
|
|
|
|
|
workItem.put("question_list", workList);
|
|
|
|
|
workItem.put("className", params.getClassName());
|
|
|
|
|
String templatePath = "templates/template/class_paper.docx";
|
|
|
|
|
String templatePath = "templates/template/class_paper_answer.docx";
|
|
|
|
|
ByteArrayOutputStream outputStream = Tools.renderTemplate(templatePath, workItem);
|
|
|
|
|
return outputStream.toByteArray();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
@ -1067,6 +1102,11 @@ public class ArchivesQueryExe {
|
|
|
|
|
BeanUtils.copyProperties(archivesPdfFileE, archivesPdfFileDO);
|
|
|
|
|
archivesPdfFileRepository.updateById(archivesPdfFileDO);
|
|
|
|
|
} catch (Exception e){
|
|
|
|
|
ArchivesPdfFileE archivesPdfFileE = new ArchivesPdfFileE();
|
|
|
|
|
archivesPdfFileE.initEdit(params.getArchivesPdfFileId(), null, -1, null);
|
|
|
|
|
ArchivesPdfFileDO archivesPdfFileDO = new ArchivesPdfFileDO();
|
|
|
|
|
BeanUtils.copyProperties(archivesPdfFileE, archivesPdfFileDO);
|
|
|
|
|
archivesPdfFileRepository.updateById(archivesPdfFileDO);
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
}
|
|
|
|
|
@ -1119,6 +1159,11 @@ public class ArchivesQueryExe {
|
|
|
|
|
BeanUtils.copyProperties(archivesPdfFileE, archivesPdfFileDO);
|
|
|
|
|
archivesPdfFileRepository.updateById(archivesPdfFileDO);
|
|
|
|
|
} catch (Exception e){
|
|
|
|
|
ArchivesPdfFileE archivesPdfFileE = new ArchivesPdfFileE();
|
|
|
|
|
archivesPdfFileE.initEdit(params.getArchivesPdfFileId(), null, -1, null);
|
|
|
|
|
ArchivesPdfFileDO archivesPdfFileDO = new ArchivesPdfFileDO();
|
|
|
|
|
BeanUtils.copyProperties(archivesPdfFileE, archivesPdfFileDO);
|
|
|
|
|
archivesPdfFileRepository.updateById(archivesPdfFileDO);
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
// throw new RuntimeException(e);
|
|
|
|
|
}
|
|
|
|
|
|