|
@@ -8,6 +8,7 @@
|
|
package cn.com.qmth.examcloud.core.oe.admin.service.bean.examstudent;
|
|
package cn.com.qmth.examcloud.core.oe.admin.service.bean.examstudent;
|
|
|
|
|
|
import cn.com.qmth.examcloud.commons.exception.ExamCloudRuntimeException;
|
|
import cn.com.qmth.examcloud.commons.exception.ExamCloudRuntimeException;
|
|
|
|
+import cn.com.qmth.examcloud.commons.util.DateUtil;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamStudentEntity;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.entity.ExamStudentEntity;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.enums.CourseLevel;
|
|
import cn.com.qmth.examcloud.core.oe.admin.dao.enums.CourseLevel;
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
@@ -32,228 +33,236 @@ import java.util.stream.Collectors;
|
|
*/
|
|
*/
|
|
public class ExamStudentEntityConvert {
|
|
public class ExamStudentEntityConvert {
|
|
|
|
|
|
- public static ExamStudentEntity of(ExamStudentInfo info) {
|
|
|
|
- if (info == null) {
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
- ExamStudentEntity entity = new ExamStudentEntity();
|
|
|
|
- entity.setId(info.getId());
|
|
|
|
- entity.setExamStudentId(info.getExamStudentId());
|
|
|
|
- entity.setExamId(info.getExamId());
|
|
|
|
- entity.setStudentId(info.getStudentId());
|
|
|
|
- entity.setStudentCode(info.getStudentCode());
|
|
|
|
- entity.setStudentName(info.getStudentName());
|
|
|
|
- entity.setIdentityNumber(info.getIdentityNumber());
|
|
|
|
- entity.setCourseId(info.getCourseId());
|
|
|
|
- entity.setCourseCode(info.getCourseCode());
|
|
|
|
- entity.setCourseLevel(info.getCourseLevel());
|
|
|
|
- entity.setOrgId(info.getOrgId());
|
|
|
|
- entity.setRootOrgId(info.getRootOrgId());
|
|
|
|
- entity.setSpecialtyCode(info.getSpecialtyCode());
|
|
|
|
- entity.setSpecialtyName(info.getSpecialtyName());
|
|
|
|
- entity.setPaperType(info.getPaperType());
|
|
|
|
- entity.setInfoCollector(info.getInfoCollector());
|
|
|
|
- entity.setFinished(info.getFinished());
|
|
|
|
- entity.setUsedNum(info.getUsedNum());
|
|
|
|
- entity.setExtraNum(info.getExtraNum());
|
|
|
|
- return entity;
|
|
|
|
- }
|
|
|
|
|
|
+ public static ExamStudentEntity of(ExamStudentInfo info) {
|
|
|
|
+ if (info == null) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ ExamStudentEntity entity = new ExamStudentEntity();
|
|
|
|
+ entity.setId(info.getId());
|
|
|
|
+ entity.setExamStudentId(info.getExamStudentId());
|
|
|
|
+ entity.setExamId(info.getExamId());
|
|
|
|
+ entity.setStudentId(info.getStudentId());
|
|
|
|
+ entity.setStudentCode(info.getStudentCode());
|
|
|
|
+ entity.setStudentName(info.getStudentName());
|
|
|
|
+ entity.setIdentityNumber(info.getIdentityNumber());
|
|
|
|
+ entity.setCourseId(info.getCourseId());
|
|
|
|
+ entity.setCourseCode(info.getCourseCode());
|
|
|
|
+ entity.setCourseLevel(info.getCourseLevel());
|
|
|
|
+ entity.setOrgId(info.getOrgId());
|
|
|
|
+ entity.setRootOrgId(info.getRootOrgId());
|
|
|
|
+ entity.setSpecialtyCode(info.getSpecialtyCode());
|
|
|
|
+ entity.setSpecialtyName(info.getSpecialtyName());
|
|
|
|
+ entity.setPaperType(info.getPaperType());
|
|
|
|
+ entity.setInfoCollector(info.getInfoCollector());
|
|
|
|
+ entity.setFinished(info.getFinished());
|
|
|
|
+ entity.setUsedNum(info.getUsedNum());
|
|
|
|
+ entity.setExtraNum(info.getExtraNum());
|
|
|
|
+ return entity;
|
|
|
|
+ }
|
|
|
|
|
|
- public static ExamStudentInfo of(ExamStudentEntity entity) {
|
|
|
|
- if (entity == null) {
|
|
|
|
- return null;
|
|
|
|
- }
|
|
|
|
- ExamStudentInfo info = new ExamStudentInfo();
|
|
|
|
- info.setId(entity.getId());
|
|
|
|
- info.setExamStudentId(entity.getExamStudentId());
|
|
|
|
- info.setExamId(entity.getExamId());
|
|
|
|
- info.setStudentId(entity.getStudentId());
|
|
|
|
- info.setStudentCode(entity.getStudentCode());
|
|
|
|
- info.setStudentName(entity.getStudentName());
|
|
|
|
- info.setIdentityNumber(entity.getIdentityNumber());
|
|
|
|
- info.setCourseId(entity.getCourseId());
|
|
|
|
- info.setCourseCode(entity.getCourseCode());
|
|
|
|
- info.setCourseLevel(CourseLevel.getCourseLevelTitle(entity.getCourseLevel()));
|
|
|
|
- info.setOrgId(entity.getOrgId());
|
|
|
|
- info.setRootOrgId(entity.getRootOrgId());
|
|
|
|
- info.setSpecialtyCode(entity.getSpecialtyCode());
|
|
|
|
- info.setSpecialtyName(entity.getSpecialtyName());
|
|
|
|
- info.setPaperType(entity.getPaperType());
|
|
|
|
- info.setInfoCollector(entity.getInfoCollector());
|
|
|
|
- info.setFinished(entity.getFinished());
|
|
|
|
- info.setUsedNum(entity.getUsedNum());
|
|
|
|
- info.setExtraNum(entity.getExtraNum());
|
|
|
|
- info.setGrade(entity.getGrade());
|
|
|
|
- info.setExamStageOrder(entity.getExamStageOrder());
|
|
|
|
- return info;
|
|
|
|
- }
|
|
|
|
|
|
+ public static ExamStudentInfo of(ExamStudentEntity entity) {
|
|
|
|
+ if (entity == null) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+ ExamStudentInfo info = new ExamStudentInfo();
|
|
|
|
+ info.setId(entity.getId());
|
|
|
|
+ info.setExamStudentId(entity.getExamStudentId());
|
|
|
|
+ info.setExamId(entity.getExamId());
|
|
|
|
+ info.setStudentId(entity.getStudentId());
|
|
|
|
+ info.setStudentCode(entity.getStudentCode());
|
|
|
|
+ info.setStudentName(entity.getStudentName());
|
|
|
|
+ info.setIdentityNumber(entity.getIdentityNumber());
|
|
|
|
+ info.setCourseId(entity.getCourseId());
|
|
|
|
+ info.setCourseCode(entity.getCourseCode());
|
|
|
|
+ info.setCourseLevel(CourseLevel.getCourseLevelTitle(entity.getCourseLevel()));
|
|
|
|
+ info.setOrgId(entity.getOrgId());
|
|
|
|
+ info.setRootOrgId(entity.getRootOrgId());
|
|
|
|
+ info.setSpecialtyCode(entity.getSpecialtyCode());
|
|
|
|
+ info.setSpecialtyName(entity.getSpecialtyName());
|
|
|
|
+ info.setPaperType(entity.getPaperType());
|
|
|
|
+ info.setInfoCollector(entity.getInfoCollector());
|
|
|
|
+ info.setFinished(entity.getFinished());
|
|
|
|
+ info.setUsedNum(entity.getUsedNum());
|
|
|
|
+ info.setExtraNum(entity.getExtraNum());
|
|
|
|
+ info.setGrade(entity.getGrade());
|
|
|
|
+ info.setExamStageId(entity.getExamStageId());
|
|
|
|
+ return info;
|
|
|
|
+ }
|
|
|
|
|
|
- public static List<ExamStudentExcel> ofExcel(List<ExamStudentInfo> examStudentInfoList) {
|
|
|
|
- List<ExamStudentExcel> list = new ArrayList<>();
|
|
|
|
- if (examStudentInfoList == null || examStudentInfoList.size() == 0) {
|
|
|
|
- return list;
|
|
|
|
- }
|
|
|
|
- examStudentInfoList.forEach(e -> {
|
|
|
|
- ExamStudentExcel excel = new ExamStudentExcel();
|
|
|
|
- excel.setStudentCode(e.getStudentCode());
|
|
|
|
- excel.setStudentName(e.getStudentName());
|
|
|
|
- excel.setIdentityNumber(e.getIdentityNumber());
|
|
|
|
- excel.setGrade(e.getGrade());
|
|
|
|
- excel.setPhone(e.getPhone());
|
|
|
|
- excel.setInfoCollector(e.getInfoCollector());
|
|
|
|
- excel.setCourseCode(e.getCourseCode());
|
|
|
|
- excel.setCourseName(e.getCourseName());
|
|
|
|
- excel.setOrgName(e.getOrgName());
|
|
|
|
- excel.setFinished(e.getFinishedStatus());
|
|
|
|
- excel.setExamStageOrder(e.getExamStageOrder());
|
|
|
|
- list.add(excel);
|
|
|
|
- });
|
|
|
|
- return list;
|
|
|
|
- }
|
|
|
|
|
|
+ public static List<ExamStudentExcel> ofExcel(List<ExamStudentInfo> examStudentInfoList) {
|
|
|
|
+ List<ExamStudentExcel> list = new ArrayList<>();
|
|
|
|
+ if (examStudentInfoList == null || examStudentInfoList.size() == 0) {
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+ examStudentInfoList.forEach(e -> {
|
|
|
|
+ ExamStudentExcel excel = new ExamStudentExcel();
|
|
|
|
+ excel.setStudentCode(e.getStudentCode());
|
|
|
|
+ excel.setStudentName(e.getStudentName());
|
|
|
|
+ excel.setIdentityNumber(e.getIdentityNumber());
|
|
|
|
+ excel.setGrade(e.getGrade());
|
|
|
|
+ excel.setPhone(e.getPhone());
|
|
|
|
+ excel.setInfoCollector(e.getInfoCollector());
|
|
|
|
+ excel.setCourseCode(e.getCourseCode());
|
|
|
|
+ excel.setCourseName(e.getCourseName());
|
|
|
|
+ excel.setOrgName(e.getOrgName());
|
|
|
|
+ excel.setFinished(e.getFinishedStatus());
|
|
|
|
+ excel.setExamStageId(e.getExamStageId());
|
|
|
|
+ excel.setExamId(e.getExamId());
|
|
|
|
+ list.add(excel);
|
|
|
|
+ });
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
|
|
- public static List<ExamStudentUnFinishedExcel> ofUnFinishedExcel(Page<ExamStudentInfo> page) {
|
|
|
|
- List<ExamStudentUnFinishedExcel> list = new ArrayList<>();
|
|
|
|
- if (page == null || page.getContent() == null) {
|
|
|
|
- return list;
|
|
|
|
- }
|
|
|
|
- page.getContent().forEach(e -> {
|
|
|
|
- ExamStudentUnFinishedExcel excel = new ExamStudentUnFinishedExcel();
|
|
|
|
- excel.setStudentCode(e.getStudentCode());
|
|
|
|
- excel.setStudentName(e.getStudentName());
|
|
|
|
- excel.setIdentityNumber(e.getIdentityNumber());
|
|
|
|
- excel.setCourseCode(e.getCourseCode());
|
|
|
|
- excel.setCourseName(e.getCourseName());
|
|
|
|
- excel.setOrgCode(e.getOrgCode());
|
|
|
|
- excel.setOrgName(e.getOrgName());
|
|
|
|
- excel.setInfoCollector(e.getInfoCollector());
|
|
|
|
- excel.setPaperType(e.getPaperType());
|
|
|
|
- excel.setSpecialtyName(e.getSpecialtyName());
|
|
|
|
- excel.setExamSiteName(e.getExamSiteName());
|
|
|
|
- excel.setGrade(e.getGrade());
|
|
|
|
- excel.setPhone(e.getPhone());
|
|
|
|
- list.add(excel);
|
|
|
|
- });
|
|
|
|
- return list;
|
|
|
|
- }
|
|
|
|
|
|
+ public static List<ExamStudentUnFinishedExcel> ofUnFinishedExcel(Page<ExamStudentInfo> page) {
|
|
|
|
+ List<ExamStudentUnFinishedExcel> list = new ArrayList<>();
|
|
|
|
+ if (page == null || page.getContent() == null) {
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+ page.getContent().forEach(e -> {
|
|
|
|
+ ExamStudentUnFinishedExcel excel = new ExamStudentUnFinishedExcel();
|
|
|
|
+ excel.setStudentCode(e.getStudentCode());
|
|
|
|
+ excel.setStudentName(e.getStudentName());
|
|
|
|
+ excel.setIdentityNumber(e.getIdentityNumber());
|
|
|
|
+ excel.setCourseCode(e.getCourseCode());
|
|
|
|
+ excel.setCourseName(e.getCourseName());
|
|
|
|
+ excel.setOrgCode(e.getOrgCode());
|
|
|
|
+ excel.setOrgName(e.getOrgName());
|
|
|
|
+ excel.setInfoCollector(e.getInfoCollector());
|
|
|
|
+ excel.setPaperType(e.getPaperType());
|
|
|
|
+ excel.setSpecialtyName(e.getSpecialtyName());
|
|
|
|
+ excel.setExamSiteName(e.getExamSiteName());
|
|
|
|
+ excel.setGrade(e.getGrade());
|
|
|
|
+ excel.setPhone(e.getPhone());
|
|
|
|
+ list.add(excel);
|
|
|
|
+ });
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public static List<ExamStudentUnFinishedExcel> ofUnFinishedExcel(List<ExamStudentInfo> examStudentInfos) {
|
|
|
|
+ List<ExamStudentUnFinishedExcel> list = new ArrayList<>();
|
|
|
|
+ if (examStudentInfos == null || examStudentInfos.size() == 0) {
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+ examStudentInfos.forEach(e -> {
|
|
|
|
+ ExamStudentUnFinishedExcel excel = new ExamStudentUnFinishedExcel();
|
|
|
|
+ excel.setStudentCode(e.getStudentCode());
|
|
|
|
+ excel.setStudentName(e.getStudentName());
|
|
|
|
+ excel.setIdentityNumber(e.getIdentityNumber());
|
|
|
|
+ excel.setCourseCode(e.getCourseCode());
|
|
|
|
+ excel.setCourseName(e.getCourseName());
|
|
|
|
+ excel.setOrgCode(e.getOrgCode());
|
|
|
|
+ excel.setOrgName(e.getOrgName());
|
|
|
|
+ excel.setInfoCollector(e.getInfoCollector());
|
|
|
|
+ excel.setPaperType(e.getPaperType());
|
|
|
|
+ excel.setSpecialtyName(e.getSpecialtyName());
|
|
|
|
+ excel.setExamSiteName(e.getExamSiteName());
|
|
|
|
+ excel.setGrade(e.getGrade());
|
|
|
|
+ excel.setPhone(e.getPhone());
|
|
|
|
+ excel.setExamStageOrder(e.getExamStageOrder());
|
|
|
|
+ excel.setStartTime(e.getStartTime());
|
|
|
|
+ excel.setEndTime(e.getEndTime());
|
|
|
|
+ if (e.getExamStageOrder() != null) {
|
|
|
|
+ excel.setExamStage(e.getExamStageOrder() + "("
|
|
|
|
+ + DateUtil.format(e.getStartTime(), DateUtil.DatePatterns.CHINA_DEFAULT) + "至"
|
|
|
|
+ + DateUtil.format(e.getEndTime(), DateUtil.DatePatterns.CHINA_DEFAULT) + ")");
|
|
|
|
+ }
|
|
|
|
+ list.add(excel);
|
|
|
|
+ });
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
|
|
- public static List<ExamStudentUnFinishedExcel> ofUnFinishedExcel(List<ExamStudentInfo> examStudentInfos) {
|
|
|
|
- List<ExamStudentUnFinishedExcel> list = new ArrayList<>();
|
|
|
|
- if (examStudentInfos == null || examStudentInfos.size() == 0) {
|
|
|
|
- return list;
|
|
|
|
- }
|
|
|
|
- examStudentInfos.forEach(e -> {
|
|
|
|
- ExamStudentUnFinishedExcel excel = new ExamStudentUnFinishedExcel();
|
|
|
|
- excel.setStudentCode(e.getStudentCode());
|
|
|
|
- excel.setStudentName(e.getStudentName());
|
|
|
|
- excel.setIdentityNumber(e.getIdentityNumber());
|
|
|
|
- excel.setCourseCode(e.getCourseCode());
|
|
|
|
- excel.setCourseName(e.getCourseName());
|
|
|
|
- excel.setOrgCode(e.getOrgCode());
|
|
|
|
- excel.setOrgName(e.getOrgName());
|
|
|
|
- excel.setInfoCollector(e.getInfoCollector());
|
|
|
|
- excel.setPaperType(e.getPaperType());
|
|
|
|
- excel.setSpecialtyName(e.getSpecialtyName());
|
|
|
|
- excel.setExamSiteName(e.getExamSiteName());
|
|
|
|
- excel.setGrade(e.getGrade());
|
|
|
|
- excel.setPhone(e.getPhone());
|
|
|
|
- excel.setExamStageOrder(e.getExamStageOrder());
|
|
|
|
- list.add(excel);
|
|
|
|
- });
|
|
|
|
- return list;
|
|
|
|
- }
|
|
|
|
|
|
+ public static Page<ExamStudentInfo> of(Page<ExamStudentEntity> page) {
|
|
|
|
+ Pageable pageable = PageRequest.of(page.getNumber(), page.getSize());
|
|
|
|
+ List<ExamStudentEntity> entities = page.getContent();
|
|
|
|
+ if (entities == null || entities.size() == 0) {
|
|
|
|
+ return new PageImpl<>(Lists.newArrayList(), pageable, page.getTotalElements());
|
|
|
|
+ }
|
|
|
|
+ List<ExamStudentInfo> list = entities.stream().map(entity -> of(entity)).collect(Collectors.toList());
|
|
|
|
+ return new PageImpl<>(list, pageable, page.getTotalElements());
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public static List<ExamStudentInfo> of(List<HashMap> maps) {
|
|
|
|
+ if (maps == null || maps.size() == 0) {
|
|
|
|
+ return Lists.newArrayList();
|
|
|
|
+ }
|
|
|
|
+ List<ExamStudentInfo> list = new ArrayList<>();
|
|
|
|
+ for (Map map : maps) {
|
|
|
|
+ try {
|
|
|
|
+ // 转换Map数据
|
|
|
|
+ ExamStudentInfo info = new ExamStudentInfo();
|
|
|
|
+ BeanUtils.populate(info, map);
|
|
|
|
+ // 转换枚举名称
|
|
|
|
+ info.setCourseLevel(CourseLevel.getCourseLevelTitle(info.getCourseLevel()));
|
|
|
|
+ list.add(info);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new ExamCloudRuntimeException(e.getMessage(), e.getCause());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
|
|
- public static Page<ExamStudentInfo> of(Page<ExamStudentEntity> page) {
|
|
|
|
- Pageable pageable = PageRequest.of(page.getNumber(), page.getSize());
|
|
|
|
- List<ExamStudentEntity> entities = page.getContent();
|
|
|
|
- if (entities == null || entities.size() == 0) {
|
|
|
|
- return new PageImpl<>(Lists.newArrayList(), pageable, page.getTotalElements());
|
|
|
|
- }
|
|
|
|
- List<ExamStudentInfo> list = entities.stream().map(entity -> of(entity)).collect(Collectors.toList());
|
|
|
|
- return new PageImpl<>(list, pageable, page.getTotalElements());
|
|
|
|
- }
|
|
|
|
|
|
+ public static List<ExamStudentOrgStatistic> ofList(List<HashMap> maps) {
|
|
|
|
+ if (maps == null || maps.size() == 0) {
|
|
|
|
+ return Lists.newArrayList();
|
|
|
|
+ }
|
|
|
|
+ List<ExamStudentOrgStatistic> list = new ArrayList<>();
|
|
|
|
+ for (Map map : maps) {
|
|
|
|
+ try {
|
|
|
|
+ // 转换Map数据
|
|
|
|
+ ExamStudentOrgStatistic info = new ExamStudentOrgStatistic();
|
|
|
|
+ BeanUtils.populate(info, map);
|
|
|
|
+ if (info.getTotalCount() == 0 || info.getFinishedCount() == 0) {
|
|
|
|
+ info.setFinishedPercent("0");
|
|
|
|
+ } else {
|
|
|
|
+ double percent = (double) info.getFinishedCount() / info.getTotalCount();
|
|
|
|
+ info.setFinishedPercent(new DecimalFormat("#.00").format(percent * 100));
|
|
|
|
+ }
|
|
|
|
+ list.add(info);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new ExamCloudRuntimeException(e.getMessage(), e.getCause());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
|
|
- public static List<ExamStudentInfo> of(List<HashMap> maps) {
|
|
|
|
- if (maps == null || maps.size() == 0) {
|
|
|
|
- return Lists.newArrayList();
|
|
|
|
- }
|
|
|
|
- List<ExamStudentInfo> list = new ArrayList<>();
|
|
|
|
- for (Map map : maps) {
|
|
|
|
- try {
|
|
|
|
- //转换Map数据
|
|
|
|
- ExamStudentInfo info = new ExamStudentInfo();
|
|
|
|
- BeanUtils.populate(info, map);
|
|
|
|
- //转换枚举名称
|
|
|
|
- info.setCourseLevel(CourseLevel.getCourseLevelTitle(info.getCourseLevel()));
|
|
|
|
- list.add(info);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- throw new ExamCloudRuntimeException(e.getMessage(), e.getCause());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return list;
|
|
|
|
- }
|
|
|
|
|
|
+ public static List<CourseCompleteProgressExcel> copyFromCourseProgressInfo(
|
|
|
|
+ List<CourseProgressInfo> courseProgressInfoList) {
|
|
|
|
+ List<CourseCompleteProgressExcel> resultList = new ArrayList<>();
|
|
|
|
+ if (courseProgressInfoList == null || courseProgressInfoList.isEmpty()) {
|
|
|
|
+ return resultList;
|
|
|
|
+ }
|
|
|
|
|
|
- public static List<ExamStudentOrgStatistic> ofList(List<HashMap> maps) {
|
|
|
|
- if (maps == null || maps.size() == 0) {
|
|
|
|
- return Lists.newArrayList();
|
|
|
|
- }
|
|
|
|
- List<ExamStudentOrgStatistic> list = new ArrayList<>();
|
|
|
|
- for (Map map : maps) {
|
|
|
|
- try {
|
|
|
|
- //转换Map数据
|
|
|
|
- ExamStudentOrgStatistic info = new ExamStudentOrgStatistic();
|
|
|
|
- BeanUtils.populate(info, map);
|
|
|
|
- if (info.getTotalCount() == 0 || info.getFinishedCount() == 0) {
|
|
|
|
- info.setFinishedPercent("0");
|
|
|
|
- } else {
|
|
|
|
- double percent = (double) info.getFinishedCount() / info.getTotalCount();
|
|
|
|
- info.setFinishedPercent(new DecimalFormat("#.00").format(percent * 100));
|
|
|
|
- }
|
|
|
|
- list.add(info);
|
|
|
|
- } catch (Exception e) {
|
|
|
|
- throw new ExamCloudRuntimeException(e.getMessage(), e.getCause());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- return list;
|
|
|
|
- }
|
|
|
|
|
|
+ courseProgressInfoList.forEach(info -> {
|
|
|
|
+ CourseCompleteProgressExcel excel = new CourseCompleteProgressExcel();
|
|
|
|
+ excel.setAllNum(info.getAllNum());
|
|
|
|
+ excel.setCompletedNum(info.getCompletedNum());
|
|
|
|
+ excel.setCompletedProportion(info.getCompletedProportion());
|
|
|
|
+ excel.setCourseCode(info.getCourseCode());
|
|
|
|
+ excel.setCourseName(info.getCourseName());
|
|
|
|
+ resultList.add(excel);
|
|
|
|
+ });
|
|
|
|
|
|
- public static List<CourseCompleteProgressExcel> copyFromCourseProgressInfo(List<CourseProgressInfo> courseProgressInfoList) {
|
|
|
|
- List<CourseCompleteProgressExcel> resultList = new ArrayList<>();
|
|
|
|
- if (courseProgressInfoList == null || courseProgressInfoList.isEmpty()) {
|
|
|
|
- return resultList;
|
|
|
|
- }
|
|
|
|
|
|
+ return resultList;
|
|
|
|
+ }
|
|
|
|
|
|
- courseProgressInfoList.forEach(info -> {
|
|
|
|
- CourseCompleteProgressExcel excel = new CourseCompleteProgressExcel();
|
|
|
|
- excel.setAllNum(info.getAllNum());
|
|
|
|
- excel.setCompletedNum(info.getCompletedNum());
|
|
|
|
- excel.setCompletedProportion(info.getCompletedProportion());
|
|
|
|
- excel.setCourseCode(info.getCourseCode());
|
|
|
|
- excel.setCourseName(info.getCourseName());
|
|
|
|
- resultList.add(excel);
|
|
|
|
- });
|
|
|
|
|
|
+ public static List<OrgCompleteProgressExcel> copyFromExamStudentOrgStatistic(
|
|
|
|
+ List<ExamStudentOrgStatistic> examStudentOrgStatisticList) {
|
|
|
|
+ List<OrgCompleteProgressExcel> resultList = new ArrayList<>();
|
|
|
|
+ if (examStudentOrgStatisticList == null || examStudentOrgStatisticList.isEmpty()) {
|
|
|
|
+ return resultList;
|
|
|
|
+ }
|
|
|
|
|
|
- return resultList;
|
|
|
|
- }
|
|
|
|
|
|
+ examStudentOrgStatisticList.forEach(info -> {
|
|
|
|
+ OrgCompleteProgressExcel excel = new OrgCompleteProgressExcel();
|
|
|
|
+ excel.setFinishedCount(info.getFinishedCount());
|
|
|
|
+ excel.setFinishedPercent(info.getFinishedPercent());
|
|
|
|
+ excel.setOrgCode(info.getOrgCode());
|
|
|
|
+ excel.setOrgName(info.getOrgName());
|
|
|
|
+ excel.setTotalCount(info.getTotalCount());
|
|
|
|
+ resultList.add(excel);
|
|
|
|
+ });
|
|
|
|
|
|
- public static List<OrgCompleteProgressExcel> copyFromExamStudentOrgStatistic(List<ExamStudentOrgStatistic> examStudentOrgStatisticList) {
|
|
|
|
- List<OrgCompleteProgressExcel> resultList = new ArrayList<>();
|
|
|
|
- if (examStudentOrgStatisticList == null || examStudentOrgStatisticList.isEmpty()) {
|
|
|
|
- return resultList;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- examStudentOrgStatisticList.forEach(info -> {
|
|
|
|
- OrgCompleteProgressExcel excel = new OrgCompleteProgressExcel();
|
|
|
|
- excel.setFinishedCount(info.getFinishedCount());
|
|
|
|
- excel.setFinishedPercent(info.getFinishedPercent());
|
|
|
|
- excel.setOrgCode(info.getOrgCode());
|
|
|
|
- excel.setOrgName(info.getOrgName());
|
|
|
|
- excel.setTotalCount(info.getTotalCount());
|
|
|
|
- resultList.add(excel);
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- return resultList;
|
|
|
|
- }
|
|
|
|
|
|
+ return resultList;
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|