|
|
@@ -75,6 +75,10 @@ import com.zhongzheng.modules.user.domain.UserStudyRecordPhoto;
|
|
|
import com.zhongzheng.modules.user.mapper.UserStudyRecordPhotoMapper;
|
|
|
import com.zhongzheng.modules.user.service.*;
|
|
|
import com.zhongzheng.modules.user.vo.*;
|
|
|
+import org.apache.poi.ss.usermodel.ClientAnchor;
|
|
|
+import org.apache.poi.ss.usermodel.Workbook;
|
|
|
+import org.apache.poi.util.Units;
|
|
|
+import org.apache.poi.xssf.usermodel.*;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -83,9 +87,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
-import java.io.File;
|
|
|
-import java.io.FileOutputStream;
|
|
|
-import java.io.IOException;
|
|
|
+import java.io.*;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
@@ -3882,7 +3884,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
|
|
|
//next
|
|
|
for (ClassPeriodStudentVo classPeriodStudentVo : classPeriodStudentVos) {
|
|
|
- String goodsDirPath = dirPath+"/"+classPeriodStudentVo.getGoodsName()+"/学时记录";
|
|
|
+ String goodsDirPath = dirPath + "/" + classPeriodStudentVo.getGoodsName() + "/学时记录";
|
|
|
List<DangAnPeriodExportAllVo> studyList = new ArrayList<>();
|
|
|
ClassGradeUserQueryBo bo = new ClassGradeUserQueryBo();
|
|
|
bo.setUserId(classPeriodStudentVo.getUserId());
|
|
|
@@ -3900,7 +3902,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
//为模块搜索下面的章 和节 并搜索学时记录
|
|
|
if (classPeriodVo.getType() == 1) {
|
|
|
CourseModuleVo moduleVo = iCourseModuleService.queryById(classPeriodVo.getId());
|
|
|
- List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), bo.getGradeId(),bo.getOrderGoodsId());
|
|
|
+ List<ClassPeriodChapterVo> classPeriodChapterVos = baseMapper.listperiodChapter(classPeriodVo.getId(), bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), bo.getGradeId(), bo.getOrderGoodsId());
|
|
|
Collections.sort(classPeriodChapterVos);
|
|
|
classPeriodChapterVos.addAll(baseMapper.listperiodModuleExam(bo.getGoodsId(), classPeriodVo.getCourseId(), bo.getUserId(), classPeriodVo.getId()));
|
|
|
for (ClassPeriodChapterVo classPeriodChapterVo : classPeriodChapterVos) {
|
|
|
@@ -3925,7 +3927,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
|
|
|
if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
|
|
|
int index = 0;
|
|
|
- for(UserPeriodStatusVo userPeriodStatusVo : userPeriodStatusVos){
|
|
|
+ for (UserPeriodStatusVo userPeriodStatusVo : userPeriodStatusVos) {
|
|
|
index++;
|
|
|
LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
|
|
|
@@ -3937,9 +3939,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
classPeriodSectionVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
|
|
|
classPeriodSectionVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
|
|
|
if (Validator.isNotEmpty(photoList) && photoList.size() > 0) {
|
|
|
- if(fullName.contains("继续教育")&&fullName.contains("施工现场专业人员")){
|
|
|
+ if (fullName.contains("继续教育") && fullName.contains("施工现场专业人员")) {
|
|
|
classPeriodSectionVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
classPeriodSectionVo.setStudyStartTime(photoList.get(0).getCreateTime());
|
|
|
}
|
|
|
}
|
|
|
@@ -3954,23 +3956,26 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
exportAllVo.setModuleName(moduleVo.getModuleName());
|
|
|
exportAllVo.setChapterName(classPeriodChapterVo.getTypeName());
|
|
|
exportAllVo.setSectionName(classPeriodSectionVo.getTypeName());
|
|
|
- exportAllVo.setNumIndex("第"+index+"次");
|
|
|
- exportAllVo.setStartTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getStudyStartTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
- exportAllVo.setEndTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getStudyEndTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
- exportAllVo.setAuditTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getAuditTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
+ exportAllVo.setNumIndex("第" + index + "次");
|
|
|
+ exportAllVo.setStartTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getStudyStartTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ exportAllVo.setEndTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getStudyEndTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ exportAllVo.setAuditTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getAuditTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
exportAllVo.setAuditPeopleTxt(classPeriodSectionVo.getAuditUserName());
|
|
|
exportAllVo.setSectionType("节");
|
|
|
BigDecimal secTime = new BigDecimal(userPeriodStatusVo.getDurationTime());
|
|
|
- exportAllVo.setClassHour(secTime.divide(new BigDecimal(45*60),BigDecimal.ROUND_HALF_UP).toString());
|
|
|
+ exportAllVo.setClassHour(secTime.divide(new BigDecimal(45 * 60), BigDecimal.ROUND_HALF_UP).toString());
|
|
|
+ if (photoList.size() > 0) {
|
|
|
+ exportAllVo.setStudyImg(readImageAsBytes(photoList.get(0).getPhoto()));
|
|
|
+ }
|
|
|
studyList.add(exportAllVo);
|
|
|
|
|
|
- String imgDirPath = goodsDirPath+"/模块_"+exportAllVo.getModuleName()+"/章_"+exportAllVo.getChapterName()+"/节_"+exportAllVo.getSectionName();
|
|
|
+ String imgDirPath = goodsDirPath + "/模块_" + exportAllVo.getModuleName() + "/章_" + exportAllVo.getChapterName() + "/节_" + exportAllVo.getSectionName();
|
|
|
File dir = new File(imgDirPath);
|
|
|
- if(!dir.exists()){
|
|
|
+ if (!dir.exists()) {
|
|
|
dir.mkdirs();
|
|
|
}
|
|
|
- for(UserStudyRecordPhotoVo photoVo:photoList){
|
|
|
- ossService.fileDownloadLocal(photoVo.getPhoto(),imgDirPath+"/"+photoVo.getCreateTime()+".jpg");
|
|
|
+ for (UserStudyRecordPhotoVo photoVo : photoList) {
|
|
|
+ ossService.fileDownloadLocal(photoVo.getPhoto(), imgDirPath + "/" + photoVo.getCreateTime() + ".jpg");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -3988,7 +3993,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
|
|
|
if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
|
|
|
int index = 0;
|
|
|
- for(UserPeriodStatusVo userPeriodStatusVo : userPeriodStatusVos){
|
|
|
+ for (UserPeriodStatusVo userPeriodStatusVo : userPeriodStatusVos) {
|
|
|
index++;
|
|
|
LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
|
|
|
@@ -4010,22 +4015,25 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
exportAllVo.setModuleName(moduleVo.getModuleName());
|
|
|
exportAllVo.setChapterName(classPeriodChapterVo.getTypeName());
|
|
|
exportAllVo.setSectionName(classPeriodSectionVo.getTypeName());
|
|
|
- exportAllVo.setNumIndex("第"+index+"次");
|
|
|
- exportAllVo.setStartTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getStudyStartTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
- exportAllVo.setEndTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getStudyEndTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
- exportAllVo.setAuditTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getAuditTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
+ exportAllVo.setNumIndex("第" + index + "次");
|
|
|
+ exportAllVo.setStartTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getStudyStartTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ exportAllVo.setEndTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getStudyEndTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ exportAllVo.setAuditTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getAuditTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
exportAllVo.setAuditPeopleTxt(classPeriodSectionVo.getAuditUserName());
|
|
|
exportAllVo.setSectionType("试卷");
|
|
|
exportAllVo.setScore(classPeriodSectionVo.getPerformance());
|
|
|
+ if (photoList.size() > 0) {
|
|
|
+ exportAllVo.setStudyImg(readImageAsBytes(photoList.get(0).getPhoto()));
|
|
|
+ }
|
|
|
studyList.add(exportAllVo);
|
|
|
|
|
|
- String imgDirPath = goodsDirPath+"/模块_"+exportAllVo.getModuleName()+"/章_"+exportAllVo.getChapterName()+"/卷_"+exportAllVo.getSectionName();
|
|
|
+ String imgDirPath = goodsDirPath + "/模块_" + exportAllVo.getModuleName() + "/章_" + exportAllVo.getChapterName() + "/卷_" + exportAllVo.getSectionName();
|
|
|
File dir = new File(imgDirPath);
|
|
|
- if(!dir.exists()){
|
|
|
+ if (!dir.exists()) {
|
|
|
dir.mkdirs();
|
|
|
}
|
|
|
- for(UserStudyRecordPhotoVo photoVo:photoList){
|
|
|
- ossService.fileDownloadLocal(photoVo.getPhoto(),imgDirPath+"/"+photoVo.getCreateTime()+".jpg");
|
|
|
+ for (UserStudyRecordPhotoVo photoVo : photoList) {
|
|
|
+ ossService.fileDownloadLocal(photoVo.getPhoto(), imgDirPath + "/" + photoVo.getCreateTime() + ".jpg");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -4053,7 +4061,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
|
|
|
if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
|
|
|
int index = 0;
|
|
|
- for(UserPeriodStatusVo userPeriodStatusVo : userPeriodStatusVos) {
|
|
|
+ for (UserPeriodStatusVo userPeriodStatusVo : userPeriodStatusVos) {
|
|
|
index++;
|
|
|
LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
|
|
|
@@ -4074,22 +4082,25 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
DangAnPeriodExportAllVo exportAllVo = BeanUtil.toBean(classPeriodStudentVo, DangAnPeriodExportAllVo.class);
|
|
|
exportAllVo.setModuleName(moduleVo.getModuleName());
|
|
|
exportAllVo.setSectionName(classPeriodChapterVo.getTypeName());
|
|
|
- exportAllVo.setNumIndex("第"+index+"次");
|
|
|
- exportAllVo.setStartTimeTxt(DateUtils.timestampToDateFormat(classPeriodChapterVo.getStudyStartTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
- exportAllVo.setEndTimeTxt(DateUtils.timestampToDateFormat(classPeriodChapterVo.getStudyEndTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
- exportAllVo.setAuditTimeTxt(DateUtils.timestampToDateFormat(classPeriodChapterVo.getAuditTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
+ exportAllVo.setNumIndex("第" + index + "次");
|
|
|
+ exportAllVo.setStartTimeTxt(DateUtils.timestampToDateFormat(classPeriodChapterVo.getStudyStartTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ exportAllVo.setEndTimeTxt(DateUtils.timestampToDateFormat(classPeriodChapterVo.getStudyEndTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ exportAllVo.setAuditTimeTxt(DateUtils.timestampToDateFormat(classPeriodChapterVo.getAuditTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
exportAllVo.setAuditPeopleTxt(classPeriodChapterVo.getAuditUserName());
|
|
|
exportAllVo.setSectionType("试卷");
|
|
|
exportAllVo.setScore(classPeriodChapterVo.getPerformance());
|
|
|
+ if (photoList.size() > 0) {
|
|
|
+ exportAllVo.setStudyImg(readImageAsBytes(photoList.get(0).getPhoto()));
|
|
|
+ }
|
|
|
studyList.add(exportAllVo);
|
|
|
|
|
|
- String imgDirPath = goodsDirPath+"/模块_"+exportAllVo.getModuleName()+"/卷_"+exportAllVo.getSectionName();
|
|
|
+ String imgDirPath = goodsDirPath + "/模块_" + exportAllVo.getModuleName() + "/卷_" + exportAllVo.getSectionName();
|
|
|
File dir = new File(imgDirPath);
|
|
|
- if(!dir.exists()){
|
|
|
+ if (!dir.exists()) {
|
|
|
dir.mkdirs();
|
|
|
}
|
|
|
- for(UserStudyRecordPhotoVo photoVo:photoList){
|
|
|
- ossService.fileDownloadLocal(photoVo.getPhoto(),imgDirPath+"/"+photoVo.getCreateTime()+".jpg");
|
|
|
+ for (UserStudyRecordPhotoVo photoVo : photoList) {
|
|
|
+ ossService.fileDownloadLocal(photoVo.getPhoto(), imgDirPath + "/" + photoVo.getCreateTime() + ".jpg");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -4117,7 +4128,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
|
|
|
if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
|
|
|
int index = 0;
|
|
|
- for(UserPeriodStatusVo userPeriodStatusVo : userPeriodStatusVos){
|
|
|
+ for (UserPeriodStatusVo userPeriodStatusVo : userPeriodStatusVos) {
|
|
|
index++;
|
|
|
LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
|
|
|
@@ -4129,9 +4140,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
classPeriodSectionVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
|
|
|
classPeriodSectionVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
|
|
|
if (Validator.isNotEmpty(photoList) && photoList.size() > 0) {
|
|
|
- if(fullName.contains("继续教育")&&fullName.contains("施工现场专业人员")){
|
|
|
+ if (fullName.contains("继续教育") && fullName.contains("施工现场专业人员")) {
|
|
|
classPeriodSectionVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
classPeriodSectionVo.setStudyStartTime(photoList.get(0).getCreateTime());
|
|
|
}
|
|
|
}
|
|
|
@@ -4145,23 +4156,26 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
DangAnPeriodExportAllVo exportAllVo = BeanUtil.toBean(classPeriodStudentVo, DangAnPeriodExportAllVo.class);
|
|
|
exportAllVo.setChapterName(classPeriodVo.getTypeName());
|
|
|
exportAllVo.setSectionName(classPeriodSectionVo.getTypeName());
|
|
|
- exportAllVo.setNumIndex("第"+index+"次");
|
|
|
- exportAllVo.setStartTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getStudyStartTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
- exportAllVo.setEndTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getStudyEndTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
- exportAllVo.setAuditTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getAuditTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
+ exportAllVo.setNumIndex("第" + index + "次");
|
|
|
+ exportAllVo.setStartTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getStudyStartTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ exportAllVo.setEndTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getStudyEndTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ exportAllVo.setAuditTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getAuditTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
exportAllVo.setAuditPeopleTxt(classPeriodSectionVo.getAuditUserName());
|
|
|
exportAllVo.setSectionType("节");
|
|
|
BigDecimal secTime = new BigDecimal(userPeriodStatusVo.getDurationTime());
|
|
|
- exportAllVo.setClassHour(secTime.divide(new BigDecimal(45*60),BigDecimal.ROUND_HALF_UP).toString());
|
|
|
+ exportAllVo.setClassHour(secTime.divide(new BigDecimal(45 * 60), BigDecimal.ROUND_HALF_UP).toString());
|
|
|
+ if (photoList.size() > 0) {
|
|
|
+ exportAllVo.setStudyImg(readImageAsBytes(photoList.get(0).getPhoto()));
|
|
|
+ }
|
|
|
studyList.add(exportAllVo);
|
|
|
|
|
|
- String imgDirPath = goodsDirPath+"/章_"+exportAllVo.getChapterName()+"/节_"+exportAllVo.getSectionName();
|
|
|
+ String imgDirPath = goodsDirPath + "/章_" + exportAllVo.getChapterName() + "/节_" + exportAllVo.getSectionName();
|
|
|
File dir = new File(imgDirPath);
|
|
|
- if(!dir.exists()){
|
|
|
+ if (!dir.exists()) {
|
|
|
dir.mkdirs();
|
|
|
}
|
|
|
- for(UserStudyRecordPhotoVo photoVo:photoList){
|
|
|
- ossService.fileDownloadLocal(photoVo.getPhoto(),imgDirPath+"/"+photoVo.getCreateTime()+".jpg");
|
|
|
+ for (UserStudyRecordPhotoVo photoVo : photoList) {
|
|
|
+ ossService.fileDownloadLocal(photoVo.getPhoto(), imgDirPath + "/" + photoVo.getCreateTime() + ".jpg");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -4181,7 +4195,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
|
|
|
if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
|
|
|
int index = 0;
|
|
|
- for(UserPeriodStatusVo userPeriodStatusVo : userPeriodStatusVos){
|
|
|
+ for (UserPeriodStatusVo userPeriodStatusVo : userPeriodStatusVos) {
|
|
|
index++;
|
|
|
LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
|
|
|
@@ -4203,22 +4217,25 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
DangAnPeriodExportAllVo exportAllVo = BeanUtil.toBean(classPeriodStudentVo, DangAnPeriodExportAllVo.class);
|
|
|
exportAllVo.setChapterName(classPeriodVo.getTypeName());
|
|
|
exportAllVo.setSectionName(classPeriodSectionVo.getTypeName());
|
|
|
- exportAllVo.setNumIndex("第"+index+"次");
|
|
|
- exportAllVo.setStartTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getStudyStartTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
- exportAllVo.setEndTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getStudyEndTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
- exportAllVo.setAuditTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getAuditTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
+ exportAllVo.setNumIndex("第" + index + "次");
|
|
|
+ exportAllVo.setStartTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getStudyStartTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ exportAllVo.setEndTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getStudyEndTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ exportAllVo.setAuditTimeTxt(DateUtils.timestampToDateFormat(classPeriodSectionVo.getAuditTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
exportAllVo.setAuditPeopleTxt(classPeriodSectionVo.getAuditUserName());
|
|
|
exportAllVo.setSectionType("试卷");
|
|
|
exportAllVo.setScore(classPeriodSectionVo.getPerformance());
|
|
|
+ if (photoList.size() > 0) {
|
|
|
+ exportAllVo.setStudyImg(readImageAsBytes(photoList.get(0).getPhoto()));
|
|
|
+ }
|
|
|
studyList.add(exportAllVo);
|
|
|
|
|
|
- String imgDirPath = goodsDirPath+"/章_"+exportAllVo.getChapterName()+"/卷_"+exportAllVo.getSectionName();
|
|
|
+ String imgDirPath = goodsDirPath + "/章_" + exportAllVo.getChapterName() + "/卷_" + exportAllVo.getSectionName();
|
|
|
File dir = new File(imgDirPath);
|
|
|
- if(!dir.exists()){
|
|
|
+ if (!dir.exists()) {
|
|
|
dir.mkdirs();
|
|
|
}
|
|
|
- for(UserStudyRecordPhotoVo photoVo:photoList){
|
|
|
- ossService.fileDownloadLocal(photoVo.getPhoto(),imgDirPath+"/"+photoVo.getCreateTime()+".jpg");
|
|
|
+ for (UserStudyRecordPhotoVo photoVo : photoList) {
|
|
|
+ ossService.fileDownloadLocal(photoVo.getPhoto(), imgDirPath + "/" + photoVo.getCreateTime() + ".jpg");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -4249,7 +4266,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
List<UserPeriodStatusVo> userPeriodStatusVos = userPeriodStatusService.selectPeriodStatus(userPeriodQueryBo);
|
|
|
if (!CollectionUtils.isEmpty(userPeriodStatusVos)) {
|
|
|
int index = 0;
|
|
|
- for(UserPeriodStatusVo userPeriodStatusVo : userPeriodStatusVos){
|
|
|
+ for (UserPeriodStatusVo userPeriodStatusVo : userPeriodStatusVos) {
|
|
|
index++;
|
|
|
LambdaQueryWrapper<UserStudyRecordPhoto> lqw = Wrappers.lambdaQuery();
|
|
|
lqw.eq(UserStudyRecordPhoto::getPeriodId, userPeriodStatusVo.getId());
|
|
|
@@ -4261,9 +4278,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
classPeriodVo.setNumList(Convert.toLong(userPeriodStatusVos.size()));
|
|
|
classPeriodVo.setStudyEndTime(userPeriodStatusVo.getRecordEndTime());
|
|
|
if (photoList.size() > 0) {
|
|
|
- if(fullName.contains("继续教育")&&fullName.contains("施工现场专业人员")){
|
|
|
+ if (fullName.contains("继续教育") && fullName.contains("施工现场专业人员")) {
|
|
|
classPeriodVo.setStudyStartTime(userPeriodStatusVo.getRecordStartTime());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
classPeriodVo.setStudyStartTime(photoList.get(0).getCreateTime());
|
|
|
}
|
|
|
|
|
|
@@ -4277,36 +4294,55 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
|
|
|
|
|
|
DangAnPeriodExportAllVo exportAllVo = BeanUtil.toBean(classPeriodStudentVo, DangAnPeriodExportAllVo.class);
|
|
|
exportAllVo.setSectionName(classPeriodVo.getTypeName());
|
|
|
- exportAllVo.setNumIndex("第"+index+"次");
|
|
|
- exportAllVo.setStartTimeTxt(DateUtils.timestampToDateFormat(classPeriodVo.getStudyStartTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
- exportAllVo.setEndTimeTxt(DateUtils.timestampToDateFormat(classPeriodVo.getStudyEndTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
- exportAllVo.setAuditTimeTxt(DateUtils.timestampToDateFormat(classPeriodVo.getAuditTime(),"yyyy-MM-dd HH:mm:ss"));
|
|
|
+ exportAllVo.setNumIndex("第" + index + "次");
|
|
|
+ exportAllVo.setStartTimeTxt(DateUtils.timestampToDateFormat(classPeriodVo.getStudyStartTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ exportAllVo.setEndTimeTxt(DateUtils.timestampToDateFormat(classPeriodVo.getStudyEndTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
+ exportAllVo.setAuditTimeTxt(DateUtils.timestampToDateFormat(classPeriodVo.getAuditTime(), "yyyy-MM-dd HH:mm:ss"));
|
|
|
exportAllVo.setAuditPeopleTxt(classPeriodVo.getAuditUserName());
|
|
|
exportAllVo.setSectionType("节");
|
|
|
BigDecimal secTime = new BigDecimal(userPeriodStatusVo.getDurationTime());
|
|
|
- exportAllVo.setClassHour(secTime.divide(new BigDecimal(45*60),BigDecimal.ROUND_HALF_UP).toString());
|
|
|
+ exportAllVo.setClassHour(secTime.divide(new BigDecimal(45 * 60), BigDecimal.ROUND_HALF_UP).toString());
|
|
|
+ if (photoList.size() > 0) {
|
|
|
+ exportAllVo.setStudyImg(readImageAsBytes(photoList.get(0).getPhoto()));
|
|
|
+ }
|
|
|
studyList.add(exportAllVo);
|
|
|
|
|
|
- String imgDirPath = goodsDirPath+"/节_"+exportAllVo.getSectionName();
|
|
|
+ String imgDirPath = goodsDirPath + "/节_" + exportAllVo.getSectionName();
|
|
|
File dir = new File(imgDirPath);
|
|
|
- if(!dir.exists()){
|
|
|
+ if (!dir.exists()) {
|
|
|
dir.mkdirs();
|
|
|
}
|
|
|
- for(UserStudyRecordPhotoVo photoVo:photoList){
|
|
|
- ossService.fileDownloadLocal(photoVo.getPhoto(),imgDirPath+"/"+photoVo.getCreateTime()+".jpg");
|
|
|
+ for (UserStudyRecordPhotoVo photoVo : photoList) {
|
|
|
+ ossService.fileDownloadLocal(photoVo.getPhoto(), imgDirPath + "/" + photoVo.getCreateTime() + ".jpg");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- String goodsPeriodPath = goodsDirPath+"/学时记录"+System.currentTimeMillis()+".xlsx";
|
|
|
+ String goodsPeriodPath = goodsDirPath + "/学时记录" + System.currentTimeMillis() + ".xlsx";
|
|
|
ExcelUtil<DangAnPeriodExportAllVo> util3 = new ExcelUtil<DangAnPeriodExportAllVo>(DangAnPeriodExportAllVo.class);
|
|
|
- util3.exportEasyExcelUtil(studyList,DangAnPeriodExportAllVo.class,goodsPeriodPath);
|
|
|
+ util3.exportEasyExcelUtil(studyList, DangAnPeriodExportAllVo.class, goodsPeriodPath);
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+ public byte[] readImageAsBytes(String ossPath){
|
|
|
+ try{
|
|
|
+ InputStream is = ossService.getStreamByObject(ossPath);
|
|
|
+ ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
|
|
|
+ byte[] buffer = new byte[1024];
|
|
|
+ int length;
|
|
|
+ while ((length = is.read(buffer)) != -1) {
|
|
|
+ byteArrayOutputStream.write(buffer, 0, length);
|
|
|
+ }
|
|
|
+ byteArrayOutputStream.close();
|
|
|
+ return byteArrayOutputStream.toByteArray();
|
|
|
+ }catch (Exception e){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
public Boolean sevenPushAuthCallBack(SevenPushAuthAddBo bo) {
|
|
|
if(Validator.isEmpty(bo.getGradeUserId())||Validator.isEmpty(bo.getPushStatus())){
|