一期一档档案下载

dev
zhangyue 2026-02-11 11:16:56 +08:00
parent 53849a7693
commit 4bf73dc66c
15 changed files with 191 additions and 61 deletions

36
pom.xml
View File

@ -23,6 +23,42 @@
</dependencies> </dependencies>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<!--处理图片旋转-->
<dependency>
<groupId>net.coobird</groupId>
<artifactId>thumbnailator</artifactId>
<version>0.4.20</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.17</version>
</dependency>
<dependency>
<groupId>com.deepoove</groupId>
<artifactId>poi-tl</artifactId>
<version>1.12.2</version>
</dependency>
<dependency> <dependency>
<groupId>com.jjb.saas</groupId> <groupId>com.jjb.saas</groupId>
<artifactId>jjb-saas-system-client</artifactId> <artifactId>jjb-saas-system-client</artifactId>

View File

@ -83,6 +83,12 @@ public class ArchivesController {
archivesService.downloadClassArchives(qry); archivesService.downloadClassArchives(qry);
return Response.buildSuccess(); return Response.buildSuccess();
} }
@ApiOperation("单独下载教材会审表")
@PostMapping("/downloadReviewRevision")
public Response downloadReviewRevision(@RequestBody ArchivesQry qry) {
archivesService.downloadReviewRevision(qry);
return Response.buildSuccess();
}
} }

View File

@ -12,6 +12,7 @@ import com.zcloud.edu.command.convertor.archives.ArchivesPdfFileCoConvertor;
import com.zcloud.edu.command.convertor.archives.ArchivesReviewCoConvertor; import com.zcloud.edu.command.convertor.archives.ArchivesReviewCoConvertor;
import com.zcloud.edu.command.convertor.archives.ArchivesReviewRecordCoConvertor; import com.zcloud.edu.command.convertor.archives.ArchivesReviewRecordCoConvertor;
import com.zcloud.edu.command.convertor.study.*; import com.zcloud.edu.command.convertor.study.*;
import com.zcloud.edu.config.FileUrlConfig;
import com.zcloud.edu.domain.model.archives.ArchivesPdfFileE; import com.zcloud.edu.domain.model.archives.ArchivesPdfFileE;
import com.zcloud.edu.domain.model.archives.ClassArchivesE; import com.zcloud.edu.domain.model.archives.ClassArchivesE;
import com.zcloud.edu.domain.model.archives.PersonArchivesE; import com.zcloud.edu.domain.model.archives.PersonArchivesE;
@ -43,6 +44,7 @@ import org.apache.commons.beanutils.PropertyUtils;
import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.commons.io.output.ByteArrayOutputStream;
import org.apache.dubbo.config.annotation.DubboReference; import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
@ -88,17 +90,10 @@ public class ArchivesQueryExe {
private final ClassExamPaperRepository classExamPaperRepository; private final ClassExamPaperRepository classExamPaperRepository;
private final QuestionRepository questionRepository; private final QuestionRepository questionRepository;
private final StudentSignCoConvertor studentSignCoConvertor; private final StudentSignCoConvertor studentSignCoConvertor;
@Autowired
private FileUrlConfig fileUrlConfig;
private static String prefixUrl;
// = "https://jpfz.qhdsafety.com/gbsFileTest/";
// public static Integer corePoolSize;
@Value("${file.url}")
public void setPrefixUrl(String prefixUrlProperties) {
System.out.println("prefixUrlProperties-----"+prefixUrlProperties);
prefixUrl = prefixUrlProperties;
}
@DubboReference @DubboReference
private ZcloudImgFilesFacade zcloudImgFilesFacade; private ZcloudImgFilesFacade zcloudImgFilesFacade;
/** /**
@ -253,9 +248,7 @@ public class ArchivesQueryExe {
public byte[] execteStudentRecord(PersonArchivesDTO params){ public byte[] execteStudentRecord(PersonArchivesDTO params){
try { try {
Map<String, Object> workItem = PropertyUtils.describe( params); Map<String, Object> workItem = PropertyUtils.describe( params);
String url = "https://jpfz.qhdsafety.com/gbsFileTest/"; PictureRenderData picture = Pictures.ofUrl(fileUrlConfig.getPrefixUrl() + params.getUserAvatarUrl(), PictureType.JPEG).size(100, 100).create();//网络图片地址
System.out.println("prefixUrl-----"+prefixUrl);
PictureRenderData picture = Pictures.ofUrl(url + params.getUserAvatarUrl(), PictureType.JPEG).size(100, 100).create();//网络图片地址
workItem.put("img", picture); workItem.put("img", picture);
String templatePath = "templates/template/studentInfo.docx"; String templatePath = "templates/template/studentInfo.docx";
ByteArrayOutputStream outputStream = Tools.renderTemplate(templatePath, workItem); ByteArrayOutputStream outputStream = Tools.renderTemplate(templatePath, workItem);
@ -271,17 +264,13 @@ public class ArchivesQueryExe {
try { try {
Map<String, Object> workItem = PropertyUtils.describe( params); Map<String, Object> workItem = PropertyUtils.describe( params);
if(!ObjectUtils.isEmpty(params.getSignFaceUrl())){ if(!ObjectUtils.isEmpty(params.getSignFaceUrl())){
PictureRenderData signFacePicture = Pictures.ofUrl(prefixUrl + params.getSignFaceUrl(), PictureType.JPEG).size(100, 100).create();//网络图片地址 PictureRenderData signFacePicture = Pictures.ofUrl(fileUrlConfig.getPrefixUrl() + params.getSignFaceUrl(), PictureType.JPEG).size(100, 100).create();//网络图片地址
workItem.put("signFacePicture", signFacePicture); workItem.put("signFacePicture", signFacePicture);
} }
// if(!ObjectUtils.isEmpty(params.getExamSignFlag())){
// PictureRenderData examSignFacePicture = Pictures.ofUrl(prefixUrl + params.getExamSignFaceUrl(), PictureType.JPEG).size(100, 100).create();//网络图片地址
// workItem.put("examSignFacePicture", examSignFacePicture);
// }
if (!ObjectUtils.isEmpty(params.getExamSignFlag())) { if (!ObjectUtils.isEmpty(params.getExamSignFlag())) {
String imageUrl = prefixUrl + params.getExamSignFaceUrl(); String imageUrl = fileUrlConfig.getPrefixUrl() + params.getExamSignFaceUrl();
try (InputStream is = new URL(imageUrl).openStream()) { try (InputStream is = new URL(imageUrl).openStream()) {
ByteArrayOutputStream baos = new ByteArrayOutputStream(); ByteArrayOutputStream baos = new ByteArrayOutputStream();
@ -349,7 +338,7 @@ public class ArchivesQueryExe {
workItem.put("name", params.getName()); workItem.put("name", params.getName());
workItem.put("className", params.getClassName()); workItem.put("className", params.getClassName());
if(!ObjectUtils.isEmpty(params.getStudentExamRecord().getSignUrl())){ if(!ObjectUtils.isEmpty(params.getStudentExamRecord().getSignUrl())){
PictureRenderData signPicture = Pictures.ofUrl(prefixUrl + params.getStudentExamRecord().getSignUrl(), PictureType.JPEG).size(50, 15).create();//网络图片地址 PictureRenderData signPicture = Pictures.ofUrl(fileUrlConfig.getPrefixUrl() + params.getStudentExamRecord().getSignUrl(), PictureType.JPEG).size(50, 15).create();//网络图片地址
workItem.put("signPicture", signPicture); workItem.put("signPicture", signPicture);
} }
String templatePath = "templates/template/exam.docx"; String templatePath = "templates/template/exam.docx";
@ -560,7 +549,6 @@ public class ArchivesQueryExe {
List<byte[]> byteArrayList = new ArrayList<>(); List<byte[]> byteArrayList = new ArrayList<>();
byteArrayList.add(word); byteArrayList.add(word);
byte[] pdf = WordToPdfUtil.mergeWordToPdf(byteArrayList); byte[] pdf = WordToPdfUtil.mergeWordToPdf(byteArrayList);
// String filepath = zcloudImgFilesFacade.saveFile(pdf, item.getCurriculumName()+"-教材会审表-"+ DateUtil.getSdfTimes()+".pdf","classArchives", params.getCorpinfoId());
byteArrayMap.put(item.getCurriculumName()+"-教材会审表-"+ DateUtil.getSdfTimes()+".pdf", pdf); byteArrayMap.put(item.getCurriculumName()+"-教材会审表-"+ DateUtil.getSdfTimes()+".pdf", pdf);
} }
@ -595,6 +583,8 @@ public class ArchivesQueryExe {
/** /**
* *
* @param params * @param params
@ -610,7 +600,6 @@ public class ArchivesQueryExe {
List<byte[]> byteArrayList = new ArrayList<>(); List<byte[]> byteArrayList = new ArrayList<>();
byteArrayList.add(word); byteArrayList.add(word);
byte[] pdf = WordToPdfUtil.mergeWordToPdf(byteArrayList); byte[] pdf = WordToPdfUtil.mergeWordToPdf(byteArrayList);
// String filepath = zcloudImgFilesFacade.saveFile(pdf, item.getCurriculumName()+"-教材会审表-"+ DateUtil.getSdfTimes()+".pdf","classArchives", params.getCorpinfoId());
byteArrayMap.put(item.getCurriculumName()+"-安全培训教材或课程讲义-"+ DateUtil.getSdfTimes()+".pdf", pdf); byteArrayMap.put(item.getCurriculumName()+"-安全培训教材或课程讲义-"+ DateUtil.getSdfTimes()+".pdf", pdf);
} }
@ -666,14 +655,12 @@ public class ArchivesQueryExe {
public byte[] execteSign(ClassArchivesDTO params){ public byte[] execteSign(ClassArchivesDTO params){
try { try {
Map<String, Object> workItem = PropertyUtils.describe( params); Map<String, Object> workItem = PropertyUtils.describe( params);
String url = "https://jpfz.qhdsafety.com/gbsFileTest/";
// String url = "http://192.168.20.240:9787/mnt/";
ArrayList<Object> workList = CollUtil.newArrayList(); ArrayList<Object> workList = CollUtil.newArrayList();
if (params.getSignList() != null && params.getSignList().size() > 0){ if (params.getSignList() != null && params.getSignList().size() > 0){
AtomicInteger atomicIndex = new AtomicInteger(1); AtomicInteger atomicIndex = new AtomicInteger(1);
for (StudentSignCO item : params.getSignList()){ for (StudentSignCO item : params.getSignList()){
Map<String, Object> itemMap = PropertyUtils.describe(item); Map<String, Object> itemMap = PropertyUtils.describe(item);
PictureRenderData picture = Pictures.ofUrl(url + item.getSignUrl(), PictureType.JPEG).size(100, 100).create();//网络图片地址 PictureRenderData picture = Pictures.ofUrl(fileUrlConfig.getPrefixUrl() + item.getSignUrl(), PictureType.JPEG).size(100, 100).create();//网络图片地址
itemMap.put("picture", picture); itemMap.put("picture", picture);
int index = atomicIndex.getAndIncrement(); int index = atomicIndex.getAndIncrement();
itemMap.put("index", index); itemMap.put("index", index);
@ -697,8 +684,6 @@ public class ArchivesQueryExe {
public byte[] exectePicture(ClassArchivesDTO params){ public byte[] exectePicture(ClassArchivesDTO params){
try { try {
Map<String, Object> workItem = PropertyUtils.describe( params); Map<String, Object> workItem = PropertyUtils.describe( params);
// String url = "https://jpfz.qhdsafety.com/gbsFileTest/";
String url = "http://192.168.20.240:9787/mnt/";
ArrayList<Object> workList = CollUtil.newArrayList(); ArrayList<Object> workList = CollUtil.newArrayList();
if (params.getSignList() != null && params.getSignList().size() > 0){ if (params.getSignList() != null && params.getSignList().size() > 0){
AtomicInteger atomicIndex = new AtomicInteger(1); AtomicInteger atomicIndex = new AtomicInteger(1);
@ -708,15 +693,15 @@ public class ArchivesQueryExe {
item.setUserIdCard(userIdCardString); item.setUserIdCard(userIdCardString);
Map<String, Object> itemMap = PropertyUtils.describe(item); Map<String, Object> itemMap = PropertyUtils.describe(item);
if(!ObjectUtils.isEmpty(item.getSignFaceUrl())){ if(!ObjectUtils.isEmpty(item.getSignFaceUrl())){
PictureRenderData signPicture = Pictures.ofUrl(url + item.getSignFaceUrl(), PictureType.JPEG).size(50, 50).create();//网络图片地址 PictureRenderData signPicture = Pictures.ofUrl(fileUrlConfig.getPrefixUrl() + item.getSignFaceUrl(), PictureType.JPEG).size(50, 50).create();//网络图片地址
itemMap.put("signPicture", signPicture); itemMap.put("signPicture", signPicture);
} }
if(!ObjectUtils.isEmpty(item.getExamFaceUrl())){ if(!ObjectUtils.isEmpty(item.getExamFaceUrl())){
PictureRenderData examPicture = Pictures.ofUrl(url + item.getExamFaceUrl(), PictureType.JPEG).size(50, 50).create();//网络图片地址 PictureRenderData examPicture = Pictures.ofUrl(fileUrlConfig.getPrefixUrl() + item.getExamFaceUrl(), PictureType.JPEG).size(50, 50).create();//网络图片地址
itemMap.put("examPicture", examPicture); itemMap.put("examPicture", examPicture);
} }
if(!ObjectUtils.isEmpty(item.getExamFaceUrl())){ if(!ObjectUtils.isEmpty(item.getExamFaceUrl())){
PictureRenderData facePicture = Pictures.ofUrl(url + item.getUserAvatarUrl(), PictureType.JPEG).size(50, 50).create();//网络图片地址 PictureRenderData facePicture = Pictures.ofUrl(fileUrlConfig.getPrefixUrl() + item.getUserAvatarUrl(), PictureType.JPEG).size(50, 50).create();//网络图片地址
itemMap.put("facePicture", facePicture); itemMap.put("facePicture", facePicture);
} }
int index = atomicIndex.getAndIncrement(); int index = atomicIndex.getAndIncrement();
@ -844,5 +829,65 @@ public class ArchivesQueryExe {
return "男"; return "男";
} }
} }
public ClassArchivesDTO downloadReviewInfoById(ArchivesQry qry){
HashMap<String, Object> params = new HashMap<String, Object>();
List<ArchivesReviewCO> reviewCOList = new ArrayList<>();
params.put("classId", qry.getClassId());
params.put("classCurriculumId", qry.getClassCurriculumId());
// 教材会审表
ArchivesReviewDO reviewInfo = archivesReviewRepository.getInfoByClassCur(params);
ArchivesReviewCO reviewInfoCO = new ArchivesReviewCO();
BeanUtils.copyProperties(reviewInfo, reviewInfoCO);
reviewCOList.add(reviewInfoCO);
ClassDO classDO = classRepository.getByClassId(qry.getClassId());
if (reviewInfo != null && !ObjectUtils.isEmpty(reviewInfo.getArchivesReviewId())){
params.put("eqArchivesReviewId", reviewInfo.getArchivesReviewId());
List<ArchivesReviewRecordDO> reviewRecordList = archivesReviewRecordRepository.listAll(params);
if(reviewRecordList != null && reviewRecordList.size() > 0){
List<ArchivesReviewRecordCO> reviewRecordCOList = archivesReviewRecordCoConvertor.converDOsToCOs(reviewRecordList);
// 子表放到主表下
Map<String, List<ArchivesReviewRecordCO>> reviewRecordCOMap = reviewRecordCOList.stream().collect(Collectors.groupingBy(ArchivesReviewRecordCO::getArchivesReviewId));
reviewCOList.forEach(reviewCO -> {
reviewCO.setArchivesReviewRecordList(reviewRecordCOMap.get(reviewCO.getArchivesReviewId()));
});
}
}
// 查询子表
ClassArchivesDTO classArchivesDTO = new ClassArchivesDTO();
classArchivesDTO.setClassName(classDO.getName());
SSOUser ssoUser = AuthContext.getCurrentUser();
classArchivesDTO.setCorpinfoId(ssoUser.getTenantId());
classArchivesDTO.setArchivesReviewList(reviewCOList);
// 新增档案下载记录
ArchivesPdfFileE archivesPdfFileE = new ArchivesPdfFileE();
archivesPdfFileE.init("archives_review", qry.getClassCurriculumId(), 2, ssoUser.getTenantId(), classDO.getName()+"-"+reviewInfo.getCurriculumName()+"教材会审表-");
ArchivesPdfFileDO archivesPdfFileDO = new ArchivesPdfFileDO();
BeanUtils.copyProperties(archivesPdfFileE, archivesPdfFileDO);
archivesPdfFileRepository.save(archivesPdfFileDO);
classArchivesDTO.setArchivesPdfFileId(archivesPdfFileDO.getId());
return classArchivesDTO;
}
@Async("archivesAsyncExecutor")
public void execteDownloadReviewInfo(ClassArchivesDTO params){
try {
byte[] word = execteReviewInfo(params.getArchivesReviewList().get(0));
List<byte[]> byteArrayList = new ArrayList<>();
byteArrayList.add(word);
byte[] pdf = WordToPdfUtil.mergeWordToPdf(byteArrayList);
String filepath = zcloudImgFilesFacade.saveFile(pdf, params.getClassName()+"-"+params.getArchivesReviewList().get(0).getCurriculumName()+"-教材会审表-"+ DateUtil.getSdfTimes()+".pdf","classArchives", params.getCorpinfoId());
ArchivesPdfFileE archivesPdfFileE = new ArchivesPdfFileE();
archivesPdfFileE.initEdit(params.getArchivesPdfFileId(), filepath, 1, null);
ArchivesPdfFileDO archivesPdfFileDO = new ArchivesPdfFileDO();
BeanUtils.copyProperties(archivesPdfFileE, archivesPdfFileDO);
archivesPdfFileRepository.updateById(archivesPdfFileDO);
} catch (Exception e){
e.printStackTrace();
throw new RuntimeException(e);
}
}
} }

View File

@ -62,7 +62,7 @@ public class StudentSignQueryExe {
public MultiResponse<StudentSignCO> executeListAll(ClassAppSignQry qry) { public MultiResponse<StudentSignCO> executeListAll(ClassAppSignQry qry) {
Map<String, Object> params = PageQueryHelper.toHashMap(qry); Map<String, Object> params = PageQueryHelper.toHashMap(qry);
List<StudentSignDO> list = studentSignRepository.listAll(params); List<StudentSignDO> list = studentSignRepository.listAllByStudent(params);
List<StudentSignCO> studentSignCOS = studentSignCoConvertor.converDOsToCOs(list); List<StudentSignCO> studentSignCOS = studentSignCoConvertor.converDOsToCOs(list);
return MultiResponse.of(studentSignCOS); return MultiResponse.of(studentSignCOS);
} }

View File

@ -1,6 +1,7 @@
package com.zcloud.edu.command.study; package com.zcloud.edu.command.study;
import com.alibaba.cola.exception.BizException; import com.alibaba.cola.exception.BizException;
import com.zcloud.edu.config.FileUrlConfig;
import com.zcloud.edu.domain.gateway.study.StudentSignGateway; import com.zcloud.edu.domain.gateway.study.StudentSignGateway;
import com.zcloud.edu.domain.model.study.StudentSignE; import com.zcloud.edu.domain.model.study.StudentSignE;
import com.zcloud.edu.dto.clientobject.study.StudentSignCO; import com.zcloud.edu.dto.clientobject.study.StudentSignCO;
@ -13,6 +14,7 @@ import com.zcloud.gbscommon.zcloudimgfiles.facade.ZcloudImgFilesFacade;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.apache.dubbo.config.annotation.DubboReference; import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
@ -33,6 +35,8 @@ public class StudentSignAddExe {
private final StudentRepository studentRepository; private final StudentRepository studentRepository;
@DubboReference @DubboReference
private ZcloudImgFilesFacade zcloudImgFilesFacade; private ZcloudImgFilesFacade zcloudImgFilesFacade;
@Autowired
private FileUrlConfig fileUrlConfig;
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public StudentSignCO execute(StudentSignAddCmd cmd) { public StudentSignCO execute(StudentSignAddCmd cmd) {
@ -47,7 +51,7 @@ public class StudentSignAddExe {
String faceUrl = null; String faceUrl = null;
try { try {
faceUrl = Base64Util.getBase64String(studentSignE.getFiles()[0]); faceUrl = Base64Util.getBase64String(studentSignE.getFiles()[0]);
studentSignE.compareFace(student.getUserAvatarUrl(), faceUrl); studentSignE.compareFace(student.getUserAvatarUrl(), faceUrl, fileUrlConfig.getPrefixUrl());
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }

View File

@ -61,5 +61,12 @@ public class ArchivesServiceImpl implements ArchivesServiceI {
archivesQueryExe.execteClassGeneratePdf(qry,classArchivesDTO); archivesQueryExe.execteClassGeneratePdf(qry,classArchivesDTO);
System.out.println("下载成功"); System.out.println("下载成功");
} }
@Override
public void downloadReviewRevision(ArchivesQry qry) {
ClassArchivesDTO classArchivesDTO = archivesQueryExe.downloadReviewInfoById(qry);
archivesQueryExe.execteDownloadReviewInfo(classArchivesDTO);
System.out.println("下载成功");
}
} }

View File

@ -17,5 +17,6 @@ import com.zcloud.edu.dto.clientobject.archives.ArchivesReviewCO;
public interface ArchivesServiceI { public interface ArchivesServiceI {
void downloadPersonArchives(ArchivesQry qry); void downloadPersonArchives(ArchivesQry qry);
void downloadClassArchives(ArchivesQry qry); void downloadClassArchives(ArchivesQry qry);
void downloadReviewRevision(ArchivesQry qry);
} }

View File

@ -7,6 +7,7 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.ThreadPoolExecutor;
/** /**
* @author zhangyue * @author zhangyue
* @date 2026/2/2 17:24 * @date 2026/2/2 17:24

View File

@ -0,0 +1,20 @@
package com.zcloud.edu.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
/**
* @author zhangyue
* @date 2026/2/11 10:05
*/
@Configuration
public class FileUrlConfig {
private String prefixUrl;
@Value("${file.url}")
public void setPrefixUrl(String prefixUrlProperties) {
prefixUrl = prefixUrlProperties;
}
public String getPrefixUrl() {
return prefixUrl;
}
}

View File

@ -29,6 +29,7 @@ public class ArchivesQry {
private String studentId; private String studentId;
private Long stuId; private Long stuId;
private String classId; private String classId;
private String classCurriculumId;
} }

View File

@ -5,19 +5,11 @@ import com.jjb.saas.framework.domain.model.BaseE;
import com.zcloud.gbscommon.utils.Base64Util; import com.zcloud.gbscommon.utils.Base64Util;
import com.zcloud.gbscommon.utils.FaceUtil; import com.zcloud.gbscommon.utils.FaceUtil;
import com.zcloud.gbscommon.utils.Tools; import com.zcloud.gbscommon.utils.Tools;
import com.zcloud.gbscommon.zcloudimgfiles.facade.ZcloudImgFilesFacade;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import org.apache.dubbo.config.annotation.DubboReference; import org.springframework.beans.factory.annotation.Autowired;
import org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.File;
import java.io.InputStream;
import java.net.URL;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Base64;
/** /**
* web-domain * web-domain
@ -71,22 +63,9 @@ public class StudentSignE extends BaseE {
private Long createId; private Long createId;
//修改人id //修改人id
private Long updateId; private Long updateId;
private static String prefixUrl;
// = "https://jpfz.qhdsafety.com/gbsFileTest/";
// public static Integer corePoolSize;
@Value("${file.url}")
public void setPrefixUrl(String prefixUrlProperties) {
System.out.println("prefixUrlProperties-----"+prefixUrlProperties); public void compareFace(String templateFaceUrl, String faceUrl, String prefixUrl) throws Exception {
prefixUrl = prefixUrlProperties; String templateFace = Base64Util.urlToBase64(prefixUrl + templateFaceUrl);
}
@DubboReference
private ZcloudImgFilesFacade zcloudImgFilesFacade;
public void compareFace(String templateFaceUrl, String faceUrl) throws Exception {
System.out.println("prefixUrl-----"+prefixUrl);
String templateFace = Base64Util.urlToBase64("https://jpfz.qhdsafety.com/gbsFileTest/" + templateFaceUrl);
String confidence = FaceUtil.compareFace(templateFace, faceUrl); String confidence = FaceUtil.compareFace(templateFace, faceUrl);
if (Double.valueOf(confidence) < 75) { if (Double.valueOf(confidence) < 75) {

View File

@ -24,5 +24,6 @@ public interface ArchivesReviewMapper extends BaseMapper<ArchivesReviewDO> {
ArchivesReviewDO getInfoById(@Param("id") Long id); ArchivesReviewDO getInfoById(@Param("id") Long id);
List<ArchivesReviewDO> listAll(@Param("params") Map<String, Object> params); List<ArchivesReviewDO> listAll(@Param("params") Map<String, Object> params);
ArchivesReviewDO getInfoByClassCur(@Param("params") Map<String, Object> params);
} }

View File

@ -19,5 +19,8 @@ public interface ArchivesReviewRepository extends BaseRepository<ArchivesReviewD
ArchivesReviewDO getInfoById(Long id); ArchivesReviewDO getInfoById(Long id);
List<ArchivesReviewDO> listAll(Map<String, Object> params); List<ArchivesReviewDO> listAll(Map<String, Object> params);
ArchivesReviewDO getInfoByClassCur(Map<String, Object> params);
} }

View File

@ -47,5 +47,10 @@ public class ArchivesReviewRepositoryImpl extends BaseRepositoryImpl<ArchivesRev
public List<ArchivesReviewDO> listAll(Map<String, Object> params) { public List<ArchivesReviewDO> listAll(Map<String, Object> params) {
return archivesReviewMapper.listAll(params); return archivesReviewMapper.listAll(params);
} }
@Override
public ArchivesReviewDO getInfoByClassCur(Map<String, Object> params) {
return archivesReviewMapper.getInfoByClassCur(params);
}
} }

View File

@ -28,13 +28,13 @@
<select id="listAll" resultType="com.zcloud.edu.persistence.dataobject.archives.ArchivesReviewDO"> <select id="listAll" resultType="com.zcloud.edu.persistence.dataobject.archives.ArchivesReviewDO">
SELECT SELECT
cc.curriculum_name, cc.curriculum_name,
cc.class_curriculum_id, cc.class_curriculum_id,
cc.class_id, cc.class_id,
ar.* ar.*
FROM FROM
class_curriculum cc class_curriculum cc
LEFT JOIN archives_review ar ON cc.class_curriculum_id = ar.class_curriculum_id and ar.delete_enum = 'FALSE' LEFT JOIN archives_review ar ON cc.class_curriculum_id = ar.class_curriculum_id and ar.delete_enum = 'FALSE'
<where> <where>
cc.delete_enum = 'FALSE' cc.delete_enum = 'FALSE'
@ -43,5 +43,26 @@
</if> </if>
</where> </where>
</select> </select>
<select id="getInfoByClassCur" resultType="com.zcloud.edu.persistence.dataobject.archives.ArchivesReviewDO">
SELECT
cc.curriculum_name,
cc.class_curriculum_id,
cc.class_id,
ar.*
FROM
class_curriculum cc
LEFT JOIN archives_review ar ON cc.class_curriculum_id = ar.class_curriculum_id and ar.delete_enum = 'FALSE'
<where>
cc.delete_enum = 'FALSE'
<if test="params.classId != null and params.classId != ''">
and cc.class_id = #{params.classId}
</if>
<if test="params.classCurriculumId != null and params.classCurriculumId != ''">
and cc.class_curriculum_id = #{params.classCurriculumId}
</if>
</where>
</select>
</mapper> </mapper>