Przeglądaj źródła

3.4.4 update-20250207优化

xiaofei 4 miesięcy temu
rodzic
commit
a33e79b223
22 zmienionych plików z 495 dodań i 146 usunięć
  1. 130 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/pdf/ExamStudentInfo.java
  2. 0 30
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/BasicExamStudentResult.java
  3. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/BasicExamStudentMapper.java
  4. 3 3
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ConditionMapper.java
  5. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/BasicExamStudentService.java
  6. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamStudentService.java
  7. 15 31
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamStudentServiceImpl.java
  8. 4 3
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ConditionServiceImpl.java
  9. 3 3
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java
  10. 37 10
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamStudentServiceImpl.java
  11. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java
  12. 103 5
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/DownloadLogicServiceImpl.java
  13. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/PdfTaskLogicServiceImpl.java
  14. 10 10
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/util/CreatePdfUtil.java
  15. 25 23
      distributed-print-business/src/main/resources/mapper/BasicExamStudentMapper.xml
  16. 18 12
      distributed-print-business/src/main/resources/mapper/ConditionMapper.xml
  17. 21 1
      distributed-print-business/src/main/resources/mapper/ExamStudentMapper.xml
  18. 1 1
      distributed-print-business/src/main/resources/mapper/TFFlowApproveMapper.xml
  19. 19 0
      distributed-print/install/mysql/upgrade/3.4.4.sql
  20. 3 3
      distributed-print/src/test/java/com/qmth/distributed/print/ServiceTest.java
  21. 92 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/BasicExamStudent.java
  22. 3 3
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/ConvertUtil.java

+ 130 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/pdf/ExamStudentInfo.java

@@ -26,6 +26,32 @@ public class ExamStudentInfo {
     private String courseCode;
     @ApiModelProperty("课程名称")
     private String courseName;
+    @ApiModelProperty("座位号")
+    private String siteNumber;
+    @ApiModelProperty("试卷编号")
+    private String paperNumber;
+    @ApiModelProperty("考试日期")
+    private String examDate;
+    @ApiModelProperty("考试时间")
+    private String examTime;
+    @ApiModelProperty("考点")
+    private String examPlace;
+    @ApiModelProperty("考场")
+    private String examRoom;
+    @ApiModelProperty("学院")
+    private String collegeName;
+    @ApiModelProperty("专业")
+    private String majorName;
+    @ApiModelProperty("教学班")
+    private String teachClassName;
+    @ApiModelProperty("行政班")
+    private String className;
+    @ApiModelProperty("任课老师工号")
+    private String teacherCode;
+    @ApiModelProperty("任课老师姓名")
+    private String teacherName;
+    @ApiModelProperty("开课学院")
+    private String teachingRoomName;
     @ApiModelProperty("考生题卡ID")
     private Long attachmentId;
     @ApiModelProperty("基础字段")
@@ -92,6 +118,110 @@ public class ExamStudentInfo {
         this.courseName = courseName;
     }
 
+    public String getSiteNumber() {
+        return siteNumber;
+    }
+
+    public void setSiteNumber(String siteNumber) {
+        this.siteNumber = siteNumber;
+    }
+
+    public String getPaperNumber() {
+        return paperNumber;
+    }
+
+    public void setPaperNumber(String paperNumber) {
+        this.paperNumber = paperNumber;
+    }
+
+    public String getExamDate() {
+        return examDate;
+    }
+
+    public void setExamDate(String examDate) {
+        this.examDate = examDate;
+    }
+
+    public String getExamTime() {
+        return examTime;
+    }
+
+    public void setExamTime(String examTime) {
+        this.examTime = examTime;
+    }
+
+    public String getExamPlace() {
+        return examPlace;
+    }
+
+    public void setExamPlace(String examPlace) {
+        this.examPlace = examPlace;
+    }
+
+    public String getExamRoom() {
+        return examRoom;
+    }
+
+    public void setExamRoom(String examRoom) {
+        this.examRoom = examRoom;
+    }
+
+    public String getCollegeName() {
+        return collegeName;
+    }
+
+    public void setCollegeName(String collegeName) {
+        this.collegeName = collegeName;
+    }
+
+    public String getMajorName() {
+        return majorName;
+    }
+
+    public void setMajorName(String majorName) {
+        this.majorName = majorName;
+    }
+
+    public String getTeachClassName() {
+        return teachClassName;
+    }
+
+    public void setTeachClassName(String teachClassName) {
+        this.teachClassName = teachClassName;
+    }
+
+    public String getClassName() {
+        return className;
+    }
+
+    public void setClassName(String className) {
+        this.className = className;
+    }
+
+    public String getTeacherCode() {
+        return teacherCode;
+    }
+
+    public void setTeacherCode(String teacherCode) {
+        this.teacherCode = teacherCode;
+    }
+
+    public String getTeacherName() {
+        return teacherName;
+    }
+
+    public void setTeacherName(String teacherName) {
+        this.teacherName = teacherName;
+    }
+
+    public String getTeachingRoomName() {
+        return teachingRoomName;
+    }
+
+    public void setTeachingRoomName(String teachingRoomName) {
+        this.teachingRoomName = teachingRoomName;
+    }
+
     public Long getAttachmentId() {
         return attachmentId;
     }

+ 0 - 30
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/BasicExamStudentResult.java

@@ -35,11 +35,6 @@ public class BasicExamStudentResult extends BasicExamStudent {
     @ApiModelProperty("任课老师工号")
     private String teacherCode;
 
-    @ApiModelProperty("考试日期")
-    private String examDate;
-
-    @ApiModelProperty("考试时间")
-    private String examTime;
     @ApiModelProperty("扩展字段")
     private String extendFields;
 
@@ -99,29 +94,4 @@ public class BasicExamStudentResult extends BasicExamStudent {
         this.teacherCode = teacherCode;
     }
 
-    public String getExamDate() {
-        return examDate;
-    }
-
-    public void setExamDate(String examDate) {
-        this.examDate = examDate;
-    }
-
-    public String getExamTime() {
-        return examTime;
-    }
-
-    public void setExamTime(String examTime) {
-        this.examTime = examTime;
-    }
-
-    @Override
-    public String getExtendFields() {
-        return extendFields;
-    }
-
-    @Override
-    public void setExtendFields(String extendFields) {
-        this.extendFields = extendFields;
-    }
 }

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/BasicExamStudentMapper.java

@@ -23,12 +23,12 @@ import java.util.List;
  */
 public interface BasicExamStudentMapper extends BaseMapper<BasicExamStudent> {
 
-    IPage<BasicExamStudentResult> findBasicExamStudentPage(@Param("iPage") Page<BasicExamStudentResult> iPage, @Param("query") BasicExamStudentPageQuery query, @Param("dpr") DataPermissionRule dpr);
+    IPage<BasicExamStudent> findBasicExamStudentPage(@Param("iPage") Page<BasicExamStudentResult> iPage, @Param("query") BasicExamStudentPageQuery query, @Param("dpr") DataPermissionRule dpr);
 
     /**
      * 列表查询
      */
-    List<BasicExamStudentResult> findBasicExamStudentPage(@Param("query") BasicExamStudentPageQuery query, @Param("dpr") DataPermissionRule dpr);
+    List<BasicExamStudent> findBasicExamStudentPage(@Param("query") BasicExamStudentPageQuery query, @Param("dpr") DataPermissionRule dpr);
 
     /**
      * 查询被绑定的考生字典

+ 3 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ConditionMapper.java

@@ -36,7 +36,7 @@ public interface ConditionMapper {
 
     List<PrintPlanBrief> listPrintPlanForClient(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("examDetailStatus") String[] examDetailStatus);
 
-    List<BasicCourse> listCourseForPlanTask(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanIds") List<String> printPlanIds, @Param("dpr") DataPermissionRule dpr);
+    List<BasicCourse> listCourseForPlanTask(@Param("schoolId") Long schoolId, @Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanIds") List<String> printPlanIds, @Param("dpr") DataPermissionRule dpr);
 
     List<String> listPaperNumberPlanTask(@Param("semesterId") Long semesterId, @Param("examId") Long examId, @Param("printPlanIds") List<String> printPlanIds, @Param("courseId") Long courseId,
             @Param("dpr") DataPermissionRule dpr);
@@ -50,7 +50,7 @@ public interface ConditionMapper {
 
     List<String> listPaperNumberFromMarkPaper(@Param("examId") Long examId,@Param("openCollegeId") Long openCollegeId, @Param("courseId") Long courseId, @Param("dpr") DataPermissionRule dpr);
 
-    List<BasicCourse> listCourseFromExamTaskByCreateId(@Param("examId") Long examId, @Param("openCollegeId") Long openCollegeId, @Param("dpr") DataPermissionRule dpr);
+    List<BasicCourse> listCourseFromExamTaskByCreateId(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("openCollegeId") Long openCollegeId, @Param("dpr") DataPermissionRule dpr);
 
     List<BasicCourse> listCourseFromExamTaskByUserId(@Param("examId") Long examId, @Param("dpr") DataPermissionRule dpr);
 
@@ -58,7 +58,7 @@ public interface ConditionMapper {
 
     List<String> listPaperNumberFromExamTaskByUserIdAndPass(@Param("examId") Long examId, @Param("courseId") Long courseId, @Param("dpr") DataPermissionRule dpr);
 
-    List<BasicCourse> listCourseForQuery(@Param("examId") Long examId, @Param("openCollegeId") Long openCollegeId, @Param("dpr") DataPermissionRule dpr);
+    List<BasicCourse> listCourseForQuery(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("openCollegeId") Long openCollegeId, @Param("dpr") DataPermissionRule dpr);
 
     List<String> listPaperNumberForQuery(@Param("examId") Long examId,@Param("openCollegeId") Long openCollegeId, @Param("courseId") Long courseId, @Param("dpr") DataPermissionRule dpr);
 

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/BasicExamStudentService.java

@@ -29,12 +29,12 @@ import java.util.Map;
  */
 public interface BasicExamStudentService extends IService<BasicExamStudent> {
 
-    IPage<BasicExamStudentResult> queryPage(BasicExamStudentPageQuery query);
+    IPage<BasicExamStudent> queryPage(BasicExamStudentPageQuery query);
 
     /**
      * 列表查询
      */
-    List<BasicExamStudentResult> exportList(BasicExamStudentPageQuery query, SysUser sysUser, Long privilegeId);
+    List<BasicExamStudent> exportList(BasicExamStudentPageQuery query, SysUser sysUser, Long privilegeId);
 
     /**
      * 新增编辑

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamStudentService.java

@@ -33,7 +33,7 @@ public interface ExamStudentService extends IService<ExamStudent> {
 
     List<ExamStudent> saveStudentForExamApply(ExamTask examTask, String extendFields, List<Long> examTaskStudentObjectParamList, Long examDetailCourseId, SysUser sysUser);
 
-    List<ExamStudentInfo> listStudentByExamDetailCourseId(Long examDetailCourseId);
+    List<ExamStudentInfo> listStudentByExamDetailCourseId(Long schoolId, Long examDetailCourseId);
 
     void updateAttachmentIdById(ExamStudentInfo t);
 

+ 15 - 31
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamStudentServiceImpl.java

@@ -95,42 +95,18 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
     private AsyncBasicExamStudentExportService asyncBasicExamStudentExportService;
 
     @Override
-    public IPage<BasicExamStudentResult> queryPage(BasicExamStudentPageQuery query) {
+    public IPage<BasicExamStudent> queryPage(BasicExamStudentPageQuery query) {
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(requestUser.getSchoolId(), requestUser.getId(),
                 ServletUtil.getRequest().getServletPath());
         query.setSchoolId(requestUser.getSchoolId());
-        IPage<BasicExamStudentResult> page = this.baseMapper.findBasicExamStudentPage(new Page<>(query.getPageNumber(), query.getPageSize()), query, dpr);
-        for (BasicExamStudentResult record : page.getRecords()) {
-            Long examStartTime = record.getExamStartTime();
-            Long examEndTime = record.getExamEndTime();
-            if (SystemConstant.longNotNull(examStartTime) && SystemConstant.longNotNull(examEndTime)) {
-                Map<String, Object> dateMap = ConvertUtil.analyzeDateAndTime(examStartTime, examEndTime);
-                String date = String.valueOf(dateMap.get("date"));
-                String time = String.valueOf(dateMap.get("time"));
-                record.setExamDate(date);
-                record.setExamTime(time);
-            }
-        }
-        return page;
+        return this.baseMapper.findBasicExamStudentPage(new Page<>(query.getPageNumber(), query.getPageSize()), query, dpr);
     }
 
     @Override
-    public List<BasicExamStudentResult> exportList(BasicExamStudentPageQuery query, SysUser sysUser, Long privilegeId) {
+    public List<BasicExamStudent> exportList(BasicExamStudentPageQuery query, SysUser sysUser, Long privilegeId) {
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(privilegeId, sysUser);
-        List<BasicExamStudentResult> list = this.baseMapper.findBasicExamStudentPage(query, dpr);
-        for (BasicExamStudentResult basicExamStudentResult : list) {
-            Long examStartTime = basicExamStudentResult.getExamStartTime();
-            Long examEndTime = basicExamStudentResult.getExamEndTime();
-            if (SystemConstant.longNotNull(examStartTime) && SystemConstant.longNotNull(examEndTime)) {
-                Map<String, Object> dateMap = ConvertUtil.analyzeDateAndTime(examStartTime, examEndTime);
-                String date = String.valueOf(dateMap.get("date"));
-                String time = String.valueOf(dateMap.get("time"));
-                basicExamStudentResult.setExamDate(date);
-                basicExamStudentResult.setExamTime(time);
-            }
-        }
-        return list;
+        return this.baseMapper.findBasicExamStudentPage(query, dpr);
     }
 
     @Transactional
@@ -379,6 +355,14 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
             }
         }
 
+        if (basicExamStudent.getExamStartTime() != null && basicExamStudent.getExamEndTime() != null) {
+            Map<String, String> dateMap = ConvertUtil.analyzeDateAndTime(basicExamStudent.getExamStartTime(), basicExamStudent.getExamEndTime());
+            String date = dateMap.get("date");
+            String time = dateMap.get("time");
+            basicExamStudent.setExamDate(date);
+            basicExamStudent.setExamTime(time);
+        }
+
         parserRequiredField(basicExamStudent);
         return basicExamStudent;
     }
@@ -427,9 +411,9 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
                     Long examStartTime = basicExamStudent.getExamStartTime();
                     Long examEndTime = basicExamStudent.getExamEndTime();
                     if (SystemConstant.longNotNull(examStartTime) && SystemConstant.longNotNull(examEndTime) && !examDateHasValue) {
-                        Map<String, Object> dateMap = ConvertUtil.analyzeDateAndTime(examStartTime, examEndTime);
-                        String date = String.valueOf(dateMap.get("date"));
-                        String time = String.valueOf(dateMap.get("time"));
+                        Map<String, String> dateMap = ConvertUtil.analyzeDateAndTime(examStartTime, examEndTime);
+                        String date = dateMap.get("date");
+                        String time = dateMap.get("time");
                         requiredFields.add(new CodeNameEnableDisabledValue(RequiredFieldsEnum.EXAM_DATE.getCode(), RequiredFieldsEnum.EXAM_DATE.getName(), RequiredFieldsEnum.EXAM_DATE.getEnable(), RequiredFieldsEnum.EXAM_DATE.getDisabled(), date));
                         requiredFields.add(new CodeNameEnableDisabledValue(RequiredFieldsEnum.EXAM_TIME.getCode(), RequiredFieldsEnum.EXAM_TIME.getName(), RequiredFieldsEnum.EXAM_TIME.getEnable(), RequiredFieldsEnum.EXAM_TIME.getDisabled(), time));
                         examDateHasValue = true;

+ 4 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ConditionServiceImpl.java

@@ -89,13 +89,14 @@ public class ConditionServiceImpl implements ConditionService {
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(privilegeId);
         // 未找到权限菜单,默认为本人权限
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
+        Long schoolId = sysUser.getSchoolId();
         // 考生管理(1100)
         if ("1100".equals(privilegeIdString)) {
             return conditionMapper.listCourseForBasicExamStudent(examId, openCollegeId, dpr);
         }
         // 命题任务管理(39)
         else if ("39".equals(privilegeIdString)) {
-            return conditionMapper.listCourseFromExamTaskByCreateId(examId, openCollegeId, dpr);
+            return conditionMapper.listCourseFromExamTaskByCreateId(schoolId, examId, openCollegeId, dpr);
         }
         // 入库申请(40)
         else if ("40".equals(privilegeIdString)) {
@@ -107,7 +108,7 @@ public class ConditionServiceImpl implements ConditionService {
         }
         // 卷库查询(42)
         else if ("42".equals(privilegeIdString)) {
-            return conditionMapper.listCourseForQuery(examId, openCollegeId, dpr);
+            return conditionMapper.listCourseForQuery(schoolId, examId, openCollegeId, dpr);
         }
         // 考务数据导入(44)、考务明细查询(45)
         else if ("44".equals(privilegeIdString) || "45".equals(privilegeIdString)) {
@@ -115,7 +116,7 @@ public class ConditionServiceImpl implements ConditionService {
         }
         // 印刷任务管理(47)
         else if ("47".equals(privilegeIdString)) {
-            return conditionMapper.listCourseForPlanTask(semesterId, examId, printPlanIds, dpr);
+            return conditionMapper.listCourseForPlanTask(schoolId, semesterId, examId, printPlanIds, dpr);
         }
         // 流程审批记录管理(403)
         else if ("403".equals(privilegeIdString)) {

+ 3 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java

@@ -380,9 +380,9 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
             // 处理时间
             Long startTime = examinationResult.getExamStartTime();
             Long endTime = examinationResult.getExamEndTime();
-            Map<String, Object> dateMap = ConvertUtil.analyzeDateAndTime(startTime, endTime);
-            String date = String.valueOf(dateMap.get("date"));
-            String time = String.valueOf(dateMap.get("time"));
+            Map<String, String> dateMap = ConvertUtil.analyzeDateAndTime(startTime, endTime);
+            String date = dateMap.get("date");
+            String time = dateMap.get("time");
             examinationResult.setExamDate(date);
             examinationResult.setExamTime(time);
 

+ 37 - 10
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamStudentServiceImpl.java

@@ -1,27 +1,28 @@
 package com.qmth.distributed.print.business.service.impl;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.distributed.print.business.bean.dto.ExamStudentCourseDto;
 import com.qmth.distributed.print.business.bean.dto.ExamStudentDto;
+import com.qmth.distributed.print.business.bean.dto.importFile.BasicExamStudentImport;
 import com.qmth.distributed.print.business.bean.dto.pdf.ExamStudentInfo;
 import com.qmth.distributed.print.business.bean.params.ExamTaskSubmitContent;
-import com.qmth.distributed.print.business.entity.ExamDetail;
-import com.qmth.distributed.print.business.entity.ExamDetailCourse;
-import com.qmth.distributed.print.business.entity.ExamStudent;
-import com.qmth.distributed.print.business.entity.ExamTask;
+import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.enums.ExamDetailStatusEnum;
+import com.qmth.distributed.print.business.enums.RequiredFieldsEnum;
 import com.qmth.distributed.print.business.mapper.ExamDetailCourseMapper;
 import com.qmth.distributed.print.business.mapper.ExamStudentMapper;
-import com.qmth.distributed.print.business.service.BasicExamStudentService;
-import com.qmth.distributed.print.business.service.ExamDetailCourseService;
-import com.qmth.distributed.print.business.service.ExamDetailService;
-import com.qmth.distributed.print.business.service.ExamStudentService;
+import com.qmth.distributed.print.business.service.*;
+import com.qmth.teachcloud.common.bean.examRule.CodeNameEnableDisabledValue;
+import com.qmth.teachcloud.common.bean.examRule.CodeNameEnableValue;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicExamStudent;
 import com.qmth.teachcloud.common.entity.SysUser;
+import com.qmth.teachcloud.common.enums.EnumResult;
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.mark.entity.MarkStudent;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -29,6 +30,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.lang.reflect.Field;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -51,6 +53,8 @@ public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentMapper, ExamS
     private ExamDetailService examDetailService;
     @Resource
     private ExamDetailCourseService examDetailCourseService;
+    @Resource
+    private BasicExamRuleService basicExamRuleService;
 
     @Override
     public List<String> listPaperTypeByExamDetailCourseId(String examDetailCourseId) {
@@ -123,8 +127,31 @@ public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentMapper, ExamS
     }
 
     @Override
-    public List<ExamStudentInfo> listStudentByExamDetailCourseId(Long examDetailCourseId) {
-        return this.baseMapper.listByExamDetailCourseId(examDetailCourseId);
+    public List<ExamStudentInfo> listStudentByExamDetailCourseId(Long schoolId, Long examDetailCourseId) {
+        BasicExamRule basicExamRule = basicExamRuleService.getBySchoolId(schoolId);
+        if (basicExamRule == null) {
+            throw ExceptionResultEnum.ERROR.exception("通用规则未设置");
+        }
+        List<ExamStudentInfo> examStudentInfoList = this.baseMapper.listByExamDetailCourseId(examDetailCourseId);
+        for (ExamStudentInfo examStudentInfo : examStudentInfoList) {
+            List<CodeNameEnableValue> codeNameEnableValueList = new ArrayList<>();
+            Class<ExamStudentInfo> aClass = (Class<ExamStudentInfo>) examStudentInfo.getClass();
+            for (EnumResult enumResult : basicExamRule.getRequiredFieldList()) {
+                try {
+                    Field declaredField = aClass.getDeclaredField(enumResult.getCode());
+                    declaredField.setAccessible(true);
+                    // 获取字段值
+                    Object value = declaredField.get(examStudentInfo);
+                    codeNameEnableValueList.add(new CodeNameEnableDisabledValue(enumResult.getCode(), enumResult.getName(), enumResult.getEnable(), enumResult.getDisabled(), value != null ? String.valueOf(value) : null));
+                } catch (NoSuchFieldException e) {
+                    throw ExceptionResultEnum.ERROR.exception("未获取到表头为[" + enumResult.getCode() + "]的属性值");
+                } catch (IllegalAccessException e) {
+                    throw ExceptionResultEnum.ERROR.exception("表头为[" + enumResult.getCode() + "]的值取值失败");
+                }
+            }
+            examStudentInfo.setRequiredFields(JSON.toJSONString(codeNameEnableValueList));
+        }
+        return examStudentInfoList;
     }
 
     @Override

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java

@@ -1407,7 +1407,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
 
                 if (!CollectionUtils.isEmpty(examDetailCourseList)) {
                     examDetailCourseList.stream().filter(m -> StringUtils.isNotBlank(m.getClazzName())).forEach(m -> {
-                        examStudentService.listStudentByExamDetailCourseId(m.getId()).stream().filter(t -> t.getBasicStudentId() != null).forEach(s -> basicStudentIdUserMap.put(s.getBasicStudentId(), String.format("%s(%s)", m.getRealName(), m.getLoginName())));
+                        examStudentService.listStudentByExamDetailCourseId(schoolId, m.getId()).stream().filter(t -> t.getBasicStudentId() != null).forEach(s -> basicStudentIdUserMap.put(s.getBasicStudentId(), String.format("%s(%s)", m.getRealName(), m.getLoginName())));
                     });
                 }
 

+ 103 - 5
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/DownloadLogicServiceImpl.java

@@ -9,15 +9,14 @@ import com.google.gson.Gson;
 import com.qmth.boot.api.exception.ApiException;
 import com.qmth.boot.tools.excel.ExcelWriter;
 import com.qmth.boot.tools.excel.enums.ExcelType;
+import com.qmth.boot.tools.excel.model.CellValue;
 import com.qmth.distributed.print.business.bean.dto.*;
+import com.qmth.distributed.print.business.bean.dto.pdf.ExamStudentInfo;
 import com.qmth.distributed.print.business.bean.params.DownloadPaperFileParam;
 import com.qmth.distributed.print.business.bean.query.BasicExamStudentPageQuery;
 import com.qmth.distributed.print.business.bean.result.BasicExamStudentResult;
 import com.qmth.distributed.print.business.bean.result.TSyncExamStudentScoreResult;
-import com.qmth.distributed.print.business.entity.ExamCard;
-import com.qmth.distributed.print.business.entity.ExamTaskDetail;
-import com.qmth.distributed.print.business.entity.TSyncExamStudentScore;
-import com.qmth.distributed.print.business.entity.TeachClazz;
+import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.enums.ImageTrajectoryEnum;
 import com.qmth.distributed.print.business.enums.PaperFileDownloadContentEnum;
 import com.qmth.distributed.print.business.enums.PaperFileDownloadExposureStatusEnum;
@@ -26,6 +25,7 @@ import com.qmth.distributed.print.business.templete.service.DownloadLogicService
 import com.qmth.distributed.print.business.util.CreatePdfUtil;
 import com.qmth.distributed.print.business.util.ExamTaskUtil;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
+import com.qmth.teachcloud.common.bean.examRule.CodeNameEnableDisabledValue;
 import com.qmth.teachcloud.common.bean.params.ArraysParams;
 import com.qmth.teachcloud.common.bean.result.DictionaryResult;
 import com.qmth.teachcloud.common.bean.vo.FilePathVo;
@@ -53,6 +53,7 @@ import org.springframework.util.FileCopyUtils;
 
 import javax.annotation.Resource;
 import java.io.*;
+import java.lang.reflect.Field;
 import java.nio.charset.StandardCharsets;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -101,6 +102,8 @@ public class DownloadLogicServiceImpl implements DownloadLogicService {
     @Resource
     private BasicExamStudentService basicExamStudentService;
     @Resource
+    private BasicExamRuleService basicExamRuleService;
+    @Resource
     DictionaryConfig dictionaryConfig;
     @Resource
     FileUploadService fileUploadService;
@@ -680,7 +683,7 @@ public class DownloadLogicServiceImpl implements DownloadLogicService {
         return map;
     }
 
-    @Override
+    /*@Override
     public void executeExportBasicExamStudentLogic(Map<String, Object> map) {
         TBTask tbTask = (TBTask) map.get(SystemConstant.TASK);
         SysUser sysUser = (SysUser) map.get(SystemConstant.USER);
@@ -736,6 +739,101 @@ public class DownloadLogicServiceImpl implements DownloadLogicService {
                 }
             }
         }
+    }*/
+
+    @Override
+    public void executeExportBasicExamStudentLogic(Map<String, Object> map) {
+        TBTask tbTask = (TBTask) map.get(SystemConstant.TASK);
+        SysUser sysUser = (SysUser) map.get(SystemConstant.USER);
+        Long privilegeId = (Long) map.get("privilegeId");
+        File file = null;
+        FileOutputStream outputStream = null;
+        try {
+            BasicExamRule basicExamRule = basicExamRuleService.getBySchoolId(sysUser.getSchoolId());
+            if (basicExamRule == null) {
+                throw ExceptionResultEnum.ERROR.exception("通用规则未设置");
+            }
+
+            List<String> columnNameList = new ArrayList<>();
+            List<EnumResult> requiredFieldList = basicExamRule.getRequiredFieldList().stream().filter(m -> m.getEnable()).collect(Collectors.toList());
+            requiredFieldList.forEach(m -> columnNameList.add(m.getName()));
+            List<EnumResult> extendFieldList = basicExamRule.getExtendFieldList().stream().filter(m -> m.getEnable()).collect(Collectors.toList());
+            extendFieldList.forEach(m -> columnNameList.add(m.getName()));
+
+            String[] columnNames = columnNameList.toArray(new String[0]);
+
+            BasicExamStudentPageQuery query = (BasicExamStudentPageQuery) map.get("query");
+            List<BasicExamStudent> list = basicExamStudentService.exportList(query, sysUser, privilegeId);
+//            List<BasicExamStudentDto> examStudentDtoList = list.stream().flatMap(e -> {
+//                BasicExamStudentDto basicExamStudentDto = new BasicExamStudentDto();
+//                BeanUtils.copyProperties(e, basicExamStudentDto);
+//                return Stream.of(basicExamStudentDto);
+//            }).collect(Collectors.toList());
+
+            file = SystemConstant.getFileTempDirVar(SystemConstant.EXCEL_PREFIX);
+            // 生成excel文件
+            outputStream = new FileOutputStream(file);
+            ExcelWriter writer = ExcelWriter.create(ExcelType.XLSX);
+
+            List<CellValue[]> columnValues = new ArrayList<>();
+            int sheetCount = 1;
+            for (BasicExamStudent s : list) {
+                List<CellValue> valueList = new ArrayList<>();
+                Class<BasicExamStudentResult> aClass = (Class<BasicExamStudentResult>) s.getClass();
+                for (EnumResult enumResult : requiredFieldList) {
+                    try {
+                        Field declaredField = aClass.getDeclaredField(enumResult.getCode());
+                        declaredField.setAccessible(true);
+                        // 获取字段值
+                        Object value = declaredField.get(s);
+                        valueList.add(value != null ? CellValue.of(String.valueOf(value)) : CellValue.of(""));
+                    } catch (NoSuchFieldException e) {
+                        throw ExceptionResultEnum.ERROR.exception("未获取到表头为[" + enumResult.getCode() + "]的属性值");
+                    } catch (IllegalAccessException e) {
+                        throw ExceptionResultEnum.ERROR.exception("表头为[" + enumResult.getCode() + "]的值取值失败");
+                    }
+                }
+                Map<String, String> extendMap = s.getExtendFieldList().stream().collect(Collectors.toMap(m -> m.getCode(), n -> n.getValue()));
+                for (EnumResult enumResult : extendFieldList) {
+                    if (extendMap.containsKey(enumResult.getCode())) {
+                        String extendValue = extendMap.get(enumResult.getCode());
+                        valueList.add(StringUtils.isNotBlank(extendValue) ? CellValue.of(extendValue) : CellValue.of(""));
+                    } else {
+                        valueList.add(CellValue.of(""));
+                    }
+                }
+                columnValues.add(valueList.toArray(new CellValue[0]));
+                if (columnValues.size() == ExcelUtil.DEFAULT_SHEET_COUNT) {
+                    writer.writeDataArrays("sheet" + sheetCount, null, columnNames, columnValues.listIterator());
+                    columnValues.clear();
+                    sheetCount++;
+                }
+            }
+            if (columnValues.size() > 0) {
+                writer.writeDataArrays("sheet" + sheetCount, null, columnNames, columnValues.listIterator());
+                columnValues.clear();
+            }
+            writer.output(outputStream);
+
+            String fileName = SystemConstant.getNanoId() + SystemConstant.EXCEL_PREFIX;
+            FilePathVo filePathVo = fileUploadService.uploadFile(file, UploadFileEnum.FILE, fileName);
+            tbTask.setResultFilePath(JSON.toJSONString(filePathVo));
+            map.put(SystemConstant.DATA_COUNT, list.size());
+        } catch (Exception e) {
+            throw ExceptionResultEnum.ERROR.exception(e.getMessage());
+        } finally {
+            if (Objects.nonNull(file)) {
+                file.delete();
+            }
+            if (outputStream != null) {
+                try {
+                    outputStream.flush();
+                    outputStream.close();
+                } catch (IOException e) {
+                    throw new RuntimeException(e);
+                }
+            }
+        }
     }
 
     /**

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/PdfTaskLogicServiceImpl.java

@@ -233,7 +233,7 @@ public class PdfTaskLogicServiceImpl implements PdfTaskLogicService {
             // 计算备份数量,默认最小为1份。
             int backupCount = SystemConstant.calcBackupCount(examDetail.getBackupCount(), examDetail.getTotalSubjects(), 1);
 
-            List<ExamStudentInfo> examStudentInfoList = examStudentService.listStudentByExamDetailCourseId(examDetailCourse.getId());
+            List<ExamStudentInfo> examStudentInfoList = examStudentService.listStudentByExamDetailCourseId(examDetail.getSchoolId(), examDetailCourse.getId());
             //查询题卡规则
             BasicCardRule basicCardRule = basicCardRuleService.getById(examTask.getCardRuleId());
 
@@ -383,7 +383,7 @@ public class PdfTaskLogicServiceImpl implements PdfTaskLogicService {
             if (StringUtils.isNotBlank(variableContent)) {
                 List<ExamStudentInfo> examStudentInfoList = new ArrayList<>();
                 for (ExamDetailCourse examDetailCourse : examDetailCourseList) {
-                    CollectionUtils.addAll(examStudentInfoList, examStudentService.listStudentByExamDetailCourseId(examDetailCourse.getId()));
+                    CollectionUtils.addAll(examStudentInfoList, examStudentService.listStudentByExamDetailCourseId(examDetail.getSchoolId(), examDetailCourse.getId()));
                 }
 
                 if (ExamModelEnum.MODEL2.equals(basicExam.getExamModel()) && CollectionUtils.isEmpty(examStudentInfoList) && examDetail.getTotalSubjects() > 0) {

+ 10 - 10
distributed-print-business/src/main/java/com/qmth/distributed/print/business/util/CreatePdfUtil.java

@@ -584,11 +584,11 @@ public class CreatePdfUtil {
                     for (CodeNameEnableValue extendDto : examStudent.getFieldList()) {
                         String value = extendDto.getValue();
                         // 考点和考场数据,用考场表中的值
-                        if (RequiredFieldsEnum.EXAM_PLACE.getCode().equals(extendDto.getCode())) {
-                            value = examDetail.getExamPlace();
-                        } else if (RequiredFieldsEnum.EXAM_ROOM.getCode().equals(extendDto.getCode())) {
-                            value = examDetail.getExamRoom();
-                        }
+//                        if (RequiredFieldsEnum.EXAM_PLACE.getCode().equals(extendDto.getCode())) {
+//                            value = examDetail.getExamPlace();
+//                        } else if (RequiredFieldsEnum.EXAM_ROOM.getCode().equals(extendDto.getCode())) {
+//                            value = examDetail.getExamRoom();
+//                        }
                         // 江西中医药大学题卡回填字段clazzName单独处理
                         if(RequiredFieldsEnum.CLASS_NAME.getCode().equals(extendDto.getCode())) {
                             studentHtml = studentHtml.replaceAll("\\$\\{clazzName\\}", value);
@@ -608,11 +608,11 @@ public class CreatePdfUtil {
                                 CodeNameEnableValue studentExtendDto = extendDto.get();
                                 String value = String.valueOf(studentExtendDto.getValue());
                                 // 考点和考场数据,用考场表中的值
-                                if (RequiredFieldsEnum.EXAM_PLACE.getCode().equals(studentExtendDto.getCode())) {
-                                    value = examDetail.getExamPlace();
-                                } else if (RequiredFieldsEnum.EXAM_ROOM.getCode().equals(studentExtendDto.getCode())) {
-                                    value = examDetail.getExamRoom();
-                                }
+//                                if (RequiredFieldsEnum.EXAM_PLACE.getCode().equals(studentExtendDto.getCode())) {
+//                                    value = examDetail.getExamPlace();
+//                                } else if (RequiredFieldsEnum.EXAM_ROOM.getCode().equals(studentExtendDto.getCode())) {
+//                                    value = examDetail.getExamRoom();
+//                                }
                                 studentHtml = studentHtml.replaceAll("\\$\\{" + studentExtendDto.getCode() + "\\}", value);
                             }
                         }

+ 25 - 23
distributed-print-business/src/main/resources/mapper/BasicExamStudentMapper.xml

@@ -23,32 +23,34 @@
     </update>
 
     <select id="findBasicExamStudentPage"
-            resultType="com.qmth.distributed.print.business.bean.result.BasicExamStudentResult">
+            resultType="com.qmth.teachcloud.common.entity.BasicExamStudent">
         SELECT
             bes.id,
-            bes.semester_id AS semesterId,
-            bes.exam_id AS examId,
-            bes.course_id courseId,
-            bc.name AS courseName,
-            bc.code AS courseCode,
-            bc.teaching_room_id AS teachingRoomId,
-            so.name AS teachingRoomName,
-            bes.student_name AS studentName,
-            bes.student_code AS studentCode,
-            bes.site_number AS siteNumber,
-            bes.college_name AS collegeName,
-            bes.major_name AS majorName,
-            bes.teach_class_name AS teachClassName,
-            bes.class_name AS className,
-            bes.paper_number AS paperNumber,
+            bes.semester_id,
+            bes.exam_id,
+            bes.course_id,
+            bc.name courseName,
+            bc.code courseCode,
+            bc.teaching_room_id,
+            so.name teachingRoomName,
+            bes.student_name,
+            bes.student_code,
+            bes.site_number,
+            bes.college_name,
+            bes.major_name,
+            bes.teach_class_name,
+            bes.class_name,
+            bes.paper_number,
             bes.paper_type,
-            teacher.real_name AS teacherName,
-            teacher.code AS teacherCode,
-            bes.exam_start_time AS examStartTime,
-            bes.exam_end_time AS examEndTime,
-            bes.exam_place AS examPlace,
-            bes.exam_room AS examRoom,
-            bes.extend_fields AS extendFields,
+            teacher.real_name teacherName,
+            teacher.code teacherCode,
+            bes.exam_start_time,
+            bes.exam_date,
+            bes.exam_time,
+            bes.exam_end_time,
+            bes.exam_place,
+            bes.exam_room,
+            bes.extend_fields,
             bes.status
         FROM
             basic_exam_student bes

+ 18 - 12
distributed-print-business/src/main/resources/mapper/ConditionMapper.xml

@@ -276,11 +276,11 @@
             bc.id,
             bc.code,
             bc.name
-            from basic_course bc
+            from (select * from basic_course where school_id = #{schoolId}) bc
                 where
                 exists (select 1
                     FROM
-                    exam_print_plan a
+                    (select * from exam_print_plan where school_id = #{schoolId}) a
                     JOIN
                     exam_detail b ON a.id = b.print_plan_id
                     JOIN
@@ -482,21 +482,24 @@
         SELECT bc.id,
             bc.code,
             bc.name
-        from basic_course bc
+        from (select * from basic_course where school_id = #{schoolId}) bc
             <where>
                 <if test="openCollegeId != null">
                     AND bc.teaching_room_id = #{openCollegeId}
                 </if>
                 and exists (select 1
                     FROM
-                    exam_task a
+                    (select * from exam_task
+                        <where>
+                            <if test="examId != null">
+                                and exam_id = #{examId}
+                            </if>
+                        </where>
+                    ) a
                     LEFT JOIN
                     sys_user d ON a.create_id = d.id
                     <where>
                         and bc.id = a.course_id
-                        <if test="examId != null">
-                            and a.exam_id = #{examId}
-                        </if>
                         <if test="dpr != null">
                             <if test="dpr.requestUserId != null">
                                 AND a.create_id = #{dpr.requestUserId}
@@ -623,14 +626,20 @@
             bc.id,
             bc.code,
             bc.name
-        from basic_course bc
+        from (select * from basic_course where school_id = #{schoolId}) bc
             <where>
                 <if test="openCollegeId != null">
                     AND bc.teaching_room_id = #{openCollegeId}
                 </if>
                 and exists (select 1
                         FROM
-                    exam_task a
+                    (select * from exam_task
+                        <where>
+                            <if test="examId != null">
+                                and exam_id = #{examId}
+                            </if>
+                        </where>
+                    ) a
                         LEFT JOIN
                     t_f_flow_approve g ON g.flow_id = a.flow_id
                         LEFT JOIN
@@ -638,9 +647,6 @@
                 <where>
                     and bc.id = a.course_id
                     and a.status = 'SUBMIT' and (a.flow_id is null or (a.flow_id is not null and g.status = 'FINISH'))
-                    <if test="examId != null">
-                        and a.exam_id = #{examId}
-                    </if>
                     <if test="dpr != null">
                         <if test="dpr.requestUserId != null">
                             AND a.create_id = #{dpr.requestUserId}

+ 21 - 1
distributed-print-business/src/main/resources/mapper/ExamStudentMapper.xml

@@ -82,14 +82,34 @@
             bes.student_name studentName,
             bc.code courseCode,
             bc.name courseName,
-            bes.required_fields requiredFields,
+            bes.site_number siteNumber,
+            es.paper_number paperNumber,
+            ed.exam_date examDate,
+            ed.exam_time examTime,
+            ed.exam_place examPlace,
+            ed.exam_room examRoom,
+            bes.college_name collegeName,
+            bes.major_name majorName,
+            bes.teach_class_name teachClassName,
+            bes.class_name className,
+            su.login_name teacherCode,
+            su.real_name teacherName,
+            so.name teachingRoomName,
             bes.extend_fields extendFields
         FROM
             exam_student es
                 LEFT JOIN
+            exam_detail_course edc ON es.exam_detail_course_id = edc.id
+                LEFT JOIN
+            exam_detail ed ON edc.exam_detail_id = ed.id
+                LEFT JOIN
             basic_exam_student bes ON es.basic_student_id = bes.id
                 LEFT JOIN
             basic_course bc ON bes.course_id = bc.id
+                LEFT JOIN
+            sys_org so ON bc.teaching_room_id = so.id
+                LEFT JOIN
+            sys_user su ON bes.teacher_id = su.id
         WHERE
             es.exam_detail_course_id = #{examDetailCourseId}
     </select>

+ 1 - 1
distributed-print-business/src/main/resources/mapper/TFFlowApproveMapper.xml

@@ -19,7 +19,7 @@
         select
         group_concat(su.real_name,'(',so.name,')')
         from
-        sys_user su join sys_org so on so.id = su.org_id
+        (select * from sys_user where school_id = #{schoolId}) su join sys_org so on so.id = su.org_id
         where
         FIND_IN_SET(su.id,replace(tffl.pend_approve_id,', ',','))) as pendApproveUserName
         from

+ 19 - 0
distributed-print/install/mysql/upgrade/3.4.4.sql

@@ -1,3 +1,22 @@
 USE teachcloud_db;
 
 ALTER TABLE `mark_question` ADD INDEX `index_1` (`exam_id` ASC, `paper_number` ASC, `main_number` ASC, `sub_number` ASC);
+
+ALTER TABLE `basic_exam_student`
+    ADD COLUMN `exam_date` VARCHAR(20) NULL COMMENT '考试日期' AFTER `exam_end_time`,
+ADD COLUMN `exam_time` VARCHAR(20) NULL COMMENT '考试时间' AFTER `exam_date`;
+
+update basic_exam_student set exam_date = DATE_FORMAT(FROM_UNIXTIME(exam_start_time/1000), '%Y-%m-%d') where exam_start_time is not null and exam_date is null;
+update basic_exam_student set exam_time = concat(DATE_FORMAT(FROM_UNIXTIME(exam_start_time/1000), '%H:%i'),'-',DATE_FORMAT(FROM_UNIXTIME(exam_end_time/1000), '%H:%i')) where exam_start_time is not null and exam_time is null;
+
+ALTER TABLE `exam_detail`
+    ADD COLUMN `exam_date` VARCHAR(20) NULL COMMENT '考试日期' AFTER `exam_end_time`,
+ADD COLUMN `exam_time` VARCHAR(20) NULL COMMENT '考试时间' AFTER `exam_date`;
+
+update exam_detail set exam_date = DATE_FORMAT(FROM_UNIXTIME(exam_start_time/1000), '%Y-%m-%d') where exam_start_time is not null and exam_date is null;
+update exam_detail set exam_time = concat(DATE_FORMAT(FROM_UNIXTIME(exam_start_time/1000), '%H:%i'),'-',DATE_FORMAT(FROM_UNIXTIME(exam_end_time/1000), '%H:%i')) where exam_start_time is not null and exam_time is null;
+
+ALTER TABLE `sys_user_role` ADD INDEX `idx_1` (`role_id` ASC, `user_id` ASC);
+ALTER TABLE `t_f_flow_log` DROP INDEX `flow_log_idx` , ADD INDEX `flow_log_idx` USING BTREE (`flow_id`);
+ALTER TABLE `exam_task` ADD INDEX `idx_1` (`flow_id` ASC);
+

+ 3 - 3
distributed-print/src/test/java/com/qmth/distributed/print/ServiceTest.java

@@ -117,9 +117,9 @@ public class ServiceTest {
         Long startTime = 1618308000000L;
         Long endTime = 1618315200000L;
 
-        Map<String, Object> map = ConvertUtil.analyzeDateAndTime(startTime, endTime);
-        String date = String.valueOf(map.get("date"));
-        String time = String.valueOf(map.get("time"));
+        Map<String, String> map = ConvertUtil.analyzeDateAndTime(startTime, endTime);
+        String date = map.get("date");
+        String time = map.get("time");
         System.out.println("date = " + date);
         System.out.println("time = " + time);
 

+ 92 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/BasicExamStudent.java

@@ -90,6 +90,12 @@ public class BasicExamStudent extends BaseEntity {
     @ApiModelProperty(value = "考试结束时间")
     private Long examEndTime;
 
+    @ApiModelProperty(value = "考试日期")
+    private String examDate;
+
+    @ApiModelProperty(value = "考试时间")
+    private String examTime;
+
     @ApiModelProperty("考点(校区)")
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     private String examPlace;
@@ -123,6 +129,28 @@ public class BasicExamStudent extends BaseEntity {
     @TableField(exist = false)
     private String coursePaperId;
 
+    @ApiModelProperty("课程代码")
+    @TableField(exist = false)
+    private String courseCode;
+    @ApiModelProperty("课程名称")
+    @TableField(exist = false)
+    private String courseName;
+
+    @ApiModelProperty("开课学院Id")
+    @TableField(exist = false)
+    private String teachingRoomId;
+    @ApiModelProperty("开课学院")
+    @TableField(exist = false)
+    private String teachingRoomName;
+
+    @ApiModelProperty("任课老师工号")
+    @TableField(exist = false)
+    private String teacherCode;
+    @ApiModelProperty("任课老师")
+    @TableField(exist = false)
+    private String teacherName;
+
+
     public Long getSchoolId() {
         return schoolId;
     }
@@ -251,6 +279,22 @@ public class BasicExamStudent extends BaseEntity {
         this.examEndTime = examEndTime;
     }
 
+    public String getExamDate() {
+        return examDate;
+    }
+
+    public void setExamDate(String examDate) {
+        this.examDate = examDate;
+    }
+
+    public String getExamTime() {
+        return examTime;
+    }
+
+    public void setExamTime(String examTime) {
+        this.examTime = examTime;
+    }
+
     public String getExamPlace() {
         return examPlace;
     }
@@ -330,4 +374,52 @@ public class BasicExamStudent extends BaseEntity {
     public void setCoursePaperId(String coursePaperId) {
         this.coursePaperId = coursePaperId;
     }
+
+    public String getCourseCode() {
+        return courseCode;
+    }
+
+    public void setCourseCode(String courseCode) {
+        this.courseCode = courseCode;
+    }
+
+    public String getCourseName() {
+        return courseName;
+    }
+
+    public void setCourseName(String courseName) {
+        this.courseName = courseName;
+    }
+
+    public String getTeachingRoomId() {
+        return teachingRoomId;
+    }
+
+    public void setTeachingRoomId(String teachingRoomId) {
+        this.teachingRoomId = teachingRoomId;
+    }
+
+    public String getTeachingRoomName() {
+        return teachingRoomName;
+    }
+
+    public void setTeachingRoomName(String teachingRoomName) {
+        this.teachingRoomName = teachingRoomName;
+    }
+
+    public String getTeacherCode() {
+        return teacherCode;
+    }
+
+    public void setTeacherCode(String teacherCode) {
+        this.teacherCode = teacherCode;
+    }
+
+    public String getTeacherName() {
+        return teacherName;
+    }
+
+    public void setTeacherName(String teacherName) {
+        this.teacherName = teacherName;
+    }
 }

+ 3 - 3
teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/ConvertUtil.java

@@ -136,8 +136,8 @@ public class ConvertUtil {
      * @param endTime   结束时间
      * @return 键值对
      */
-    public static Map<String, Object> analyzeDateAndTime(Long startTime, Long endTime) {
-        Map<String, Object> map = new HashMap<>();
+    public static Map<String, String> analyzeDateAndTime(Long startTime, Long endTime) {
+        Map<String, String> map = new HashMap<>();
         if (startTime != null && startTime > 0 && endTime != null && endTime > 0) {
             String tmpDateStart;
             String tmpDateEnd;
@@ -160,7 +160,7 @@ public class ConvertUtil {
             }
 
             date = tmpDateStart;
-            time = tmpTimeStart + " - " + tmpTimeEnd;
+            time = tmpTimeStart + "-" + tmpTimeEnd;
             map.put("date", date);
             map.put("time", time);
         } else {