xiaofei преди 11 месеца
родител
ревизия
781123e636
променени са 22 файла, в които са добавени 148 реда и са изтрити 123 реда
  1. 59 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/ExamTaskImportTaskUserDto.java
  2. 4 3
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamTask.java
  3. 13 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamTaskTemp.java
  4. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/TFFlowApproveMapper.java
  5. 2 4
      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/TFFlowApproveService.java
  7. 7 21
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamStudentServiceImpl.java
  8. 25 31
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java
  9. 0 6
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/PrintCommonServiceImpl.java
  10. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TFFlowApproveServiceImpl.java
  11. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncBasicExamStudentImportService.java
  12. 3 3
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/ImportLogicServiceImpl.java
  13. 5 2
      distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml
  14. 2 2
      distributed-print-business/src/main/resources/mapper/TFFlowApproveMapper.xml
  15. 4 1
      distributed-print/install/mysql/upgrade/3.4.0.sql
  16. 1 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPrintTaskController.java
  17. 2 2
      distributed-print/src/main/java/com/qmth/distributed/print/api/TFCustomFlowController.java
  18. 1 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/obe/TCUsualScoreController.java
  19. 1 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/obe/TRBasicInfoController.java
  20. 1 10
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/score/StudentScoreDetailDto.java
  21. 13 29
      teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java
  22. 0 1
      teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml

+ 59 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/ExamTaskImportTaskUserDto.java

@@ -0,0 +1,59 @@
+package com.qmth.distributed.print.business.bean.dto;
+
+public class ExamTaskImportTaskUserDto {
+
+    private Long courseId;
+    private String courseCode;
+    private String courseName;
+    private String paperNumber;
+    private String specialty;
+    private Long userId;
+
+    public Long getCourseId() {
+        return courseId;
+    }
+
+    public void setCourseId(Long courseId) {
+        this.courseId = courseId;
+    }
+
+    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 getPaperNumber() {
+        return paperNumber;
+    }
+
+    public void setPaperNumber(String paperNumber) {
+        this.paperNumber = paperNumber;
+    }
+
+    public String getSpecialty() {
+        return specialty;
+    }
+
+    public void setSpecialty(String specialty) {
+        this.specialty = specialty;
+    }
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+}

+ 4 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamTask.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.distributed.print.business.bean.dto.ExamTaskImportTaskUserDto;
 import com.qmth.distributed.print.business.enums.ExamStatusEnum;
 import com.qmth.distributed.print.business.enums.ExamTaskSourceEnum;
 import com.qmth.distributed.print.business.enums.ReviewStatusEnum;
@@ -127,7 +128,7 @@ public class ExamTask extends BaseEntity implements Serializable {
     private String cancelRemark;
 
     @TableField(exist = false)
-    private List<Map<String, String>> users;
+    private List<ExamTaskImportTaskUserDto> users;
 
     @ApiModelProperty(value = "流程id")
     @JsonSerialize(using = ToStringSerializer.class)
@@ -364,11 +365,11 @@ public class ExamTask extends BaseEntity implements Serializable {
         this.cancelRemark = cancelRemark;
     }
 
-    public List<Map<String, String>> getUsers() {
+    public List<ExamTaskImportTaskUserDto> getUsers() {
         return users;
     }
 
-    public void setUsers(List<Map<String, String>> users) {
+    public void setUsers(List<ExamTaskImportTaskUserDto> users) {
         this.users = users;
     }
 

+ 13 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamTaskTemp.java

@@ -38,6 +38,11 @@ public class ExamTaskTemp extends BaseEntity implements Serializable {
      */
     @TableField("batch_no")
     private String batchNo;
+    /**
+     * 课程ID
+     */
+    @TableField("course_id")
+    private Long courseId;
     /**
      * 课程代码
      */
@@ -101,6 +106,14 @@ public class ExamTaskTemp extends BaseEntity implements Serializable {
         this.teachingRoomName = teachingRoomName;
     }
 
+    public Long getCourseId() {
+        return courseId;
+    }
+
+    public void setCourseId(Long courseId) {
+        this.courseId = courseId;
+    }
+
     public String getCourseCode() {
         return courseCode;
     }

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/TFFlowApproveMapper.java

@@ -45,7 +45,7 @@ public interface TFFlowApproveMapper extends BaseMapper<TFFlowApprove> {
     public IPage<FlowApproveListResult> findApproveList(@Param("iPage") IPage<Map> iPage,
                                                         @Param("semesterId") Long semesterId,
                                                         @Param("examId") Long examId,
-                                                        @Param("courseCode") String courseCode,
+                                                        @Param("courseId") Long courseId,
                                                         @Param("paperNumber") String paperNumber,
                                                         @Param("status") String status,
                                                         @Param("teacherUserName") String teacherUserName,

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

@@ -14,9 +14,7 @@ import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.BasicExamStudentStatusEnum;
 
 import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
 import java.util.List;
-import java.util.Map;
 
 /**
  * <p>
@@ -68,7 +66,7 @@ public interface BasicExamStudentService extends IService<BasicExamStudent> {
      */
     BasicExamStudent editEntityHelp(BasicExamStudentParam basicExamStudentParam, BasicExam basicExam, SysUser requestUser);
 
-    List<BasicExamStudent> listByExamIdAndPaperNumber(Long examId, String paperNumber);
+    List<BasicExamStudent> listByExamIdAndCourseIdAndPaperNumber(Long examId, Long courseId, String paperNumber);
 
     List<BasicExamStudentResult> listByParams(BasicExamStudentQuery basicExamStudentQuery);
 
@@ -78,7 +76,7 @@ public interface BasicExamStudentService extends IService<BasicExamStudent> {
 
     void updatePaperNumberAndPaperTypeById(List<ExamStudent> examStudentList);
 
-    void updateMarkData(Long examId, List<BasicExamStudent> basicExamStudentList, List<String> oldPaperNumberList, Long createId);
+    void updateMarkData(Long examId, List<BasicExamStudent> basicExamStudentList, Long createId);
 
     List<DeleteBasicExamStudentStatusDto> getStudentMarkStatus(List<Long> idList);
 

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

@@ -43,7 +43,7 @@ public interface TFFlowApproveService extends IService<TFFlowApprove> {
     public IPage<FlowApproveListResult> findApproveList(IPage<Map> iPage,
                                                         Long semesterId,
                                                         Long examId,
-                                                        String courseCode,
+                                                        Long courseId,
                                                         String paperNumber,
                                                         FlowStatusEnum status,
                                                         String teacherUserName,

+ 7 - 21
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamStudentServiceImpl.java

@@ -2,7 +2,6 @@ package com.qmth.distributed.print.business.service.impl;
 
 import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.baomidou.mybatisplus.core.conditions.update.Update;
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -152,11 +151,10 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
     @Override
     public Long save(BasicExamStudentParam basicExamStudentParam, SysUser requestUser) {
         BasicExam basicExam = basicExamService.getById(basicExamStudentParam.getExamId());
-        BasicExamStudent basicExamStudentOld = this.getById(basicExamStudentParam.getId());
         BasicExamStudent basicExamStudent = this.editEntityHelp(basicExamStudentParam, basicExam, requestUser);
         this.saveOrUpdate(basicExamStudent);
         // 更新扫描阅卷数据
-        this.updateMarkData(basicExam.getId(), Arrays.asList(basicExamStudent), Arrays.asList(basicExamStudentOld.getPaperNumber()), requestUser.getId());
+        this.updateMarkData(basicExam.getId(), Arrays.asList(basicExamStudent), requestUser.getId());
         // 自动创建课程管理数据
         teachCourseService.batchCreateTeachCourse(basicExamStudent.getSchoolId(), basicExamStudent.getExamId(), Arrays.asList(basicExamStudent));
         return basicExamStudent.getId();
@@ -298,7 +296,7 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
             if (!basicExamStudent.getStudentCode().equals(dbBasicExamStudent.getStudentCode())) {
                 throw ExceptionResultEnum.ERROR.exception("不允许修改学号");
             }
-            if (StringUtils.isNotBlank(dbBasicExamStudent.getPaperNumber()) && dbBasicExamStudent.getPaperNumber().equals(paperNumber)) {
+            if (StringUtils.isNotBlank(dbBasicExamStudent.getPaperNumber()) && !dbBasicExamStudent.getPaperNumber().equals(paperNumber)) {
                 throw ExceptionResultEnum.ERROR.exception("不允许修改试卷编号");
             }
             if (StringUtils.isNotBlank(dbBasicExamStudent.getPaperType()) && dbBasicExamStudent.getPaperNumber().equals(paperType)) {
@@ -383,9 +381,10 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
     }
 
     @Override
-    public List<BasicExamStudent> listByExamIdAndPaperNumber(Long examId, String paperNumber) {
+    public List<BasicExamStudent> listByExamIdAndCourseIdAndPaperNumber(Long examId, Long courseId, String paperNumber) {
         QueryWrapper<BasicExamStudent> queryWrapper = new QueryWrapper<>();
         queryWrapper.lambda().eq(BasicExamStudent::getExamId, examId)
+                .eq(BasicExamStudent::getCourseId, courseId)
                 .eq(BasicExamStudent::getPaperNumber, paperNumber)
                 .orderByAsc(BasicExamStudent::getStudentCode);
         return this.list(queryWrapper);
@@ -416,8 +415,8 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
     public void updatePaperNumberAndPaperTypeById(List<ExamStudent> examStudentList) {
         for (ExamStudent examStudent : examStudentList) {
             BasicExamStudent basicExamStudent = this.getById(examStudent.getBasicStudentId());
-            if (StringUtils.isNoneBlank(basicExamStudent.getPaperNumber(), basicExamStudent.getPaperType())) {
-                throw ExceptionResultEnum.ERROR.exception(String.format("试卷编号[%s],学号[%s]考生在试卷编号[%s]生成了印刷任务", examStudent.getPaperNumber(), examStudent.getStudentCode(), basicExamStudent.getPaperNumber()));
+            if (StringUtils.isNoneBlank(basicExamStudent.getPaperNumber(), basicExamStudent.getPaperType()) && !examStudent.getPaperNumber().equals(basicExamStudent.getPaperNumber())) {
+                throw ExceptionResultEnum.ERROR.exception(String.format("试卷编号[%s],学号[%s]考生在试卷编号[%s]生成了印刷任务", examStudent.getPaperNumber(), basicExamStudent.getStudentCode(), basicExamStudent.getPaperNumber()));
             }
             List<CodeNameEnableValue> requiredFieldList = basicExamStudent.getRequiredFieldList();
             for (CodeNameEnableValue codeNameEnableValue : requiredFieldList) {
@@ -434,7 +433,7 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
     }
 
     @Override
-    public void updateMarkData(Long examId, List<BasicExamStudent> basicExamStudentList, List<String> oldPaperNumberList, Long createId) {
+    public void updateMarkData(Long examId, List<BasicExamStudent> basicExamStudentList, Long createId) {
         BasicExam basicExam = basicExamService.getById(examId);
         Map<String, List<BasicExamStudent>> stringMap = basicExamStudentList.stream().filter(m -> StringUtils.isNotBlank(m.getPaperNumber())).collect(Collectors.groupingBy(BasicExamStudent::getPaperNumber));
         for (Map.Entry<String, List<BasicExamStudent>> entry : stringMap.entrySet()) {
@@ -453,19 +452,6 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
                 markPaperService.updateUploadCount(examId, entry.getKey(), markStudentService.countUploadedByExamIdAndPaperNumber(examId, entry.getKey()));
             }
         }
-
-        // 更新历史数据试卷编号
-//        if (CollectionUtils.isNotEmpty(oldPaperNumberList)) {
-//            for (String paperNumber : oldPaperNumberList) {
-//                long studentCount = markStudentService.countByExamIdAndPaperNumber(examId, paperNumber, null);
-//                if (studentCount > 0) {
-//                    markPaperService.updateStudentCountByExamIdAndPaperNumberAndPaperType(examId, paperNumber, null);
-//                    markPaperService.updateUploadCount(examId, paperNumber, markStudentService.countUploadedByExamIdAndPaperNumber(examId, paperNumber));
-//                } else {
-//                    markPaperService.deleteByExamIdAndPaperNumber(examId, paperNumber);
-//                }
-//            }
-//        }
     }
 
     @Override

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

@@ -365,7 +365,6 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                     ExamTaskImportDto userImportDto = (ExamTaskImportDto) examTaskTempList.get(y);
 
                     String excelCourseCode = userImportDto.getCourseCode();
-                    String excelCourseName = userImportDto.getCourseName();
                     String teachingRoomName = userImportDto.getTeachingRoomName();
                     String excelPaperNumber = userImportDto.getPaperNumber();
                     String excelTeacherAccount = userImportDto.getUserAccount();
@@ -379,10 +378,9 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                     BasicCourse basicCourse = basicCourseService.getByTeachRoomIdAndCode(sysOrgList.get(0).getId(), excelCourseCode);
                     // 校验课程名称和课程代码
                     if (basicCourse == null) {
-                        excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行课程代码[" + excelCourseCode + "]在系统中不存在"));
-                    } else if (!basicCourse.getName().equals(excelCourseName)) {
-                        excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行课程代码[" + excelCourseCode + "]对应的课程名称与课程管理中不一致。文件中为[" + excelCourseName + "],课程管理为[" + basicCourse.getName() + "]"));
+                        excelErrorTemp.add(new ExcelError(y + 1, "第" + (y + 1) + "行开课学院[" + teachingRoomName + "]下无课程代码[" + excelCourseCode + "]的课程"));
                     }
+
                     if (courseCodePaperNumberMap.containsKey(excelCourseCode)) {
                         String paperNumber = courseCodePaperNumberMap.get(excelCourseCode);
                         if (paperNumber != null && paperNumber.equals(excelPaperNumber)) {
@@ -456,7 +454,6 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         examTaskImportResultDto.setBatchNo(batchNo);
         List<ExamTaskDto> tasks = new ArrayList<>();
 
-        List<BasicCourse> userCourses = printCommonService.list(null, null, null);
         // 错误信息
         StringJoiner stringJoiner = new StringJoiner(";");
         for (int i = 0; i < finalList.size(); i++) {
@@ -466,11 +463,14 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                 ExamTaskImportDto examTaskImportDto = (ExamTaskImportDto) examTaskTempList.get(y);
                 ExamTaskTemp examTaskTemp = gson.fromJson(gson.toJson(examTaskImportDto), ExamTaskTemp.class);
                 // 校验该用户是否有科目
-                long matchCourseCount = userCourses.stream().filter(m -> examTaskTemp.getCourseCode().equals(m.getCode())).count();
-                if (matchCourseCount == 0) {
-                    throw ExceptionResultEnum.ERROR.exception("用户没有科目[" + examTaskTemp.getCourseName() + "(" + examTaskTemp.getCourseCode() + ")]权限");
-                }
+                List<SysOrg> sysOrgList = sysOrgService.getSecondOrg(schoolId, examTaskTemp.getTeachingRoomName());
+                // 课程是否存在并且与名称对应
+                BasicCourse basicCourse = basicCourseService.getByTeachRoomIdAndCode(sysOrgList.get(0).getId(), examTaskTemp.getCourseCode());
                 examTaskTemp.setId(SystemConstant.getDbUuid());
+                if (basicCourse == null) {
+                    throw ExceptionResultEnum.ERROR.exception("开课学院[" + examTaskTemp.getTeachingRoomName() + "]没有课程代码[" + examTaskTemp.getCourseCode() + "]的课程");
+                }
+                examTaskTemp.setCourseId(basicCourse.getId());
                 examTaskTemp.setBatchNo(batchNo);
                 examTaskTemp.setSchoolId(schoolId);
                 examTaskTemp.setCreateId(sysUser.getId());
@@ -479,9 +479,6 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                 examTaskTempService.save(examTaskTemp);
 
                 ExamTaskDto examTaskDto = new ExamTaskDto();
-                List<SysOrg> sysOrgList = sysOrgService.getSecondOrg(schoolId, examTaskTemp.getTeachingRoomName());
-                // 课程是否存在并且与名称对应
-                BasicCourse basicCourse = basicCourseService.getByTeachRoomIdAndCode(sysOrgList.get(0).getId(), examTaskTemp.getCourseCode());
                 examTaskDto.setCourseId(basicCourse.getId());
                 examTaskDto.setCourseCode(examTaskTemp.getCourseCode());
                 examTaskDto.setCourseName(examTaskTemp.getCourseName());
@@ -513,14 +510,14 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                     }
 
                     if (Objects.nonNull(assignTeacherDto) && !CollectionUtils.isEmpty(assignTeacherDto.getCourseUserList())) {
-                        List<SysUserResult> matchCouserUser = assignTeacherDto.getCourseUserList().stream()
+                        List<SysUserResult> matchCourseUser = assignTeacherDto.getCourseUserList().stream()
                                 .filter(e -> e.getLoginName().equals(userAccount) && e.getRealName().equals(userName))
                                 .collect(Collectors.toList());
-                        if (matchCouserUser.size() > 1) {
+                        if (matchCourseUser.size() > 1) {
                             throw ExceptionResultEnum.ERROR.exception("数据异常");
                         }
-                        if (matchCouserUser.size() == 1) {
-                            SysUserResult tmp = matchCouserUser.get(0);
+                        if (matchCourseUser.size() == 1) {
+                            SysUserResult tmp = matchCourseUser.get(0);
                             examTaskDto.setUserId(String.valueOf(tmp.getId()));
                             examTaskDto.setUserName(tmp.getRealName());
                         }
@@ -555,26 +552,24 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         }
 
         List<ExamTask> list = new ArrayList<>();
-        List<Map<String, String>> userList = task.getUsers();
+        List<ExamTaskImportTaskUserDto> userList = task.getUsers();
 
         StringJoiner stringJoiner = new StringJoiner(",");
-        for (Map<String, String> userMap : userList) {
-            String courseCode = userMap.get("courseCode");
+        for (ExamTaskImportTaskUserDto dto : userList) {
             // 配置信息
             BasicPrintConfig basicPrintConfig = basicPrintConfigService.getByExamId(examId);
             Long cardRuleId = basicPrintConfig.getCardRuleId();
 
             ExamTask examTask = new ExamTask();
             examTask.setSchoolId(task.getSchoolId());
-            examTask.setCourseCode(userMap.get("courseCode"));
-            examTask.setCourseName(userMap.get("courseName"));
+            examTask.setCourseId(dto.getCourseId());
             examTask.setExamId(examId);
             examTask.setCardRuleId(cardRuleId);
 
-            String paperNumber = userMap.get("paperNumber");
+            String paperNumber = dto.getPaperNumber();
             if (StringUtils.isNotBlank(paperNumber)) {
                 QueryWrapper<ExamTask> taskQueryWrapper = new QueryWrapper<>();
-                taskQueryWrapper.lambda().eq(ExamTask::getSchoolId, schoolId).eq(ExamTask::getExamId, examId).eq(ExamTask::getPaperNumber, paperNumber);
+                taskQueryWrapper.lambda().eq(ExamTask::getExamId, examId).eq(ExamTask::getPaperNumber, paperNumber);
                 ExamTask task1 = this.getOne(taskQueryWrapper);
                 if (task1 != null) {
                     stringJoiner.add(String.format("试卷编号[%s]在考试[%s]下已使用", paperNumber, basicExam.getName()));
@@ -595,9 +590,9 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             BasicCourse basicCourse = basicCourseService.getById(examTask.getCourseId());
             examTask.setTeachingRoomId(basicCourse.getTeachingRoomId());
 
-            String userId = userMap.get("userId");
-            if (userId != null && userId.length() > 0 && !userId.equals("null")) {
-                examTask.setUserId(SystemConstant.convertIdToLong(userId));
+            Long userId = dto.getUserId();
+            if (userId != null) {
+                examTask.setUserId(userId);
                 examTask.setStatus(ExamStatusEnum.STAGE);
             } else {
                 examTask.setStatus(ExamStatusEnum.DRAFT);
@@ -995,9 +990,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
     @Transactional
     @Override
     public void removeByExamTaskId(Long examTaskId) {
-        // 删除任务
-        this.removeById(examTaskId);
-        ExamTaskDetail examTaskDetail = examTaskDetailService.getByExamTaskId(examTaskId);
+        ExamTaskDetail examTaskDetail = examTaskDetailService.getByExamTaskIdNotValid(examTaskId);
         if (examTaskDetail != null) {
             examTaskDetailService.removeById(examTaskDetail.getId());
 
@@ -1017,6 +1010,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                 }
             }
         }
+        this.removeById(examTaskId);
     }
 
     /**
@@ -1647,7 +1641,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
     }
 
     @Override
-    public ExamTask getByExamIdAndPaperNumber(Long examId,String paperNumber) {
+    public ExamTask getByExamIdAndPaperNumber(Long examId, String paperNumber) {
         QueryWrapper<ExamTask> queryWrapper = new QueryWrapper<>();
         LambdaQueryWrapper<ExamTask> lambdaQueryWrapper = queryWrapper.lambda();
         lambdaQueryWrapper.eq(ExamTask::getExamId, examId).eq(ExamTask::getPaperNumber, paperNumber);
@@ -1775,7 +1769,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
     @Transactional
     @Override
     public List<ExamDetail> matchBasicExamStudent(BasicExam basicExam, ExamTask examTask, ExamTaskDetail examTaskDetail, SysUser sysUser) {
-        List<BasicExamStudent> basicExamStudentList = basicExamStudentService.listByExamIdAndPaperNumber(examTask.getExamId(), examTask.getPaperNumber());
+        List<BasicExamStudent> basicExamStudentList = basicExamStudentService.listByExamIdAndCourseIdAndPaperNumber(examTask.getExamId(), examTask.getCourseId(), examTask.getPaperNumber());
         if (CollectionUtils.isEmpty(basicExamStudentList)) {
             return null;
         }

+ 0 - 6
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/PrintCommonServiceImpl.java

@@ -633,12 +633,6 @@ public class PrintCommonServiceImpl implements PrintCommonService {
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         SysOrg sysOrg = sysOrgService.getById(requestUser.getOrgId());
         Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(teachingRoomId);
-//        DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(schoolId, requestUser.getId(), ServletUtil.getRequest().getServletPath());
-        /*if (Objects.nonNull(teachingRoomId)) {
-            orgIds = new HashSet<>(Arrays.asList(teachingRoomId));
-        } else {
-            orgIds = teachcloudCommonService.listSubOrgIds(teachingRoomId);
-        }*/
         if (CollectionUtils.isEmpty(printPlanIdList)) {
             QueryWrapper<BasicCourse> queryWrapper = new QueryWrapper<>();
             queryWrapper.lambda().eq(BasicCourse::getSchoolId, schoolId)

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

@@ -60,14 +60,14 @@ public class TFFlowApproveServiceImpl extends ServiceImpl<TFFlowApproveMapper, T
      * @return
      */
     @Override
-    public IPage<FlowApproveListResult> findApproveList(IPage<Map> iPage,Long semesterId, Long examId, String courseCode, String paperNumber, FlowStatusEnum status, String teacherUserName, Long teachingRoomId, Long startTime, Long endTime, String pendApproveUserName, Long schoolId, Long orgId) {
+    public IPage<FlowApproveListResult> findApproveList(IPage<Map> iPage,Long semesterId, Long examId, Long courseId, String paperNumber, FlowStatusEnum status, String teacherUserName, Long teachingRoomId, Long startTime, Long endTime, String pendApproveUserName, Long schoolId, Long orgId) {
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         Long privilegeId = ServletUtil.getCurrentPrivilegeId();
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(privilegeId);;
         return tfFlowApproveMapper.findApproveList(iPage,
                 semesterId,
                 examId,
-                courseCode,
+                courseId,
                 paperNumber,
                 Objects.nonNull(status) ? status.name() : null,
                 teacherUserName,

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/execute/AsyncBasicExamStudentImportService.java

@@ -120,7 +120,7 @@ public class AsyncBasicExamStudentImportService extends AsyncImportTaskTemplete
                 // 更改过试卷编号后,该试卷编号下没有考生则删除该试卷
                 List<String> oldPaperNumberList = JSON.parseArray(JSON.toJSONString(result.get("oldPaperNumberList")), String.class);
                 // 更新扫描阅卷数据
-                basicExamStudentService.updateMarkData(tbTask.getExamId(), basicExamStudentList, oldPaperNumberList, tbTask.getCreateId());
+                basicExamStudentService.updateMarkData(tbTask.getExamId(), basicExamStudentList, tbTask.getCreateId());
                 // 自动创建课程管理数据
                 teachCourseService.batchCreateTeachCourse(tbTask.getSchoolId(), tbTask.getExamId(), basicExamStudentList);
                 tbTask.setResult(TaskResultEnum.SUCCESS);

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

@@ -237,7 +237,7 @@ public class ImportLogicServiceImpl implements ImportLogicService {
             if (basicExamStudent.getCourseId() != null) {
                 if (courseIdStudentCodeMap.containsKey(basicExamStudent.getCourseId() + SystemConstant.HYPHEN + basicExamStudent.getStudentCode())) {
                     BasicExamStudent student = courseIdStudentCodeMap.get(basicExamStudent.getCourseId() + SystemConstant.HYPHEN + basicExamStudent.getStudentCode());
-                    if (StringUtils.isNotBlank(student.getPaperNumber()) && student.getPaperNumber().equals(basicExamStudent.getPaperNumber())) {
+                    if (StringUtils.isNotBlank(student.getPaperNumber()) && !student.getPaperNumber().equals(basicExamStudent.getPaperNumber())) {
                         throw ExceptionResultEnum.ERROR.exception("不允许修改试卷编号");
                     } else {
                         basicExamStudent.setId(student.getId());
@@ -729,7 +729,7 @@ public class ImportLogicServiceImpl implements ImportLogicService {
                         try {
                             Field declaredField = aClass.getDeclaredField(enumResult.getCode());
                             declaredField.setAccessible(true);
-                            declaredField.set(basicExamStudentImport, entry.getValue());
+                            declaredField.set(basicExamStudentImport, StringUtils.deleteWhitespace(entry.getValue()));
                         } catch (NoSuchFieldException e) {
                             throw ExceptionResultEnum.ERROR.exception("未获取到表头为[" + entry.getKey() + "]的属性值");
                         } catch (IllegalAccessException e) {
@@ -789,7 +789,7 @@ public class ImportLogicServiceImpl implements ImportLogicService {
                         try {
                             Field declaredField = aClass.getDeclaredField(enumResult.getCode());
                             declaredField.setAccessible(true);
-                            declaredField.set(basicExamStudentImport, entry.getValue());
+                            declaredField.set(basicExamStudentImport, StringUtils.deleteWhitespace(entry.getValue()));
                         } catch (NoSuchFieldException e) {
                             throw ExceptionResultEnum.ERROR.exception("未获取到表头为[" + entry.getKey() + "]的属性值");
                         } catch (IllegalAccessException e) {

+ 5 - 2
distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml

@@ -967,8 +967,9 @@
         SELECT
             a.id,
             a.school_id schoolId,
-            a.course_code courseCode,
-            a.course_name courseName,
+            a.course_id courseId,
+            bc.code courseCode,
+            bc.name courseName,
             a.specialty,
             a.paper_number paperNumber,
             a.card_rule_id cardRuleId,
@@ -1001,6 +1002,8 @@
             sys_org d ON a.teaching_room_id = d.id
         LEFT JOIN
             t_f_flow_approve e ON a.flow_id = e.flow_id
+        LEFT JOIN
+            basic_course bc ON a.course_id = bc.id
         where a.id = #{examTaskId}
     </select>
     <select id="listExamTaskDetailDownload"

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

@@ -78,8 +78,8 @@
             <if test="examId != null and examId != ''">
                 and be.id = #{examId}
             </if>
-            <if test="courseCode != null and courseCode != ''">
-                and et.course_code = #{courseCode}
+            <if test="courseId != null">
+                and et.course_id = #{courseId}
             </if>
             <if test="paperNumber != null and paperNumber != ''">
                 and et.paper_number = #{paperNumber}

+ 4 - 1
distributed-print/install/mysql/upgrade/3.4.0.sql

@@ -312,4 +312,7 @@ INSERT INTO sys_privilege
 VALUES(2106, '导出扫描进度', 'Export', 'BUTTON', 2089, 2, 'AUTH', '2107', 1, 0, 1);
 INSERT INTO sys_privilege
 (id, name, url, `type`, parent_id, `sequence`, property, related, enable, default_auth, front_display)
-VALUES(2107, '扫描任务统计导出', '/api/admin/statistics/scan/count/export', 'URL', 2089, 2, 'AUTH', NULL, 1, 1, 1);
+VALUES(2107, '扫描任务统计导出', '/api/admin/statistics/scan/count/export', 'URL', 2089, 2, 'AUTH', NULL, 1, 1, 1);
+
+UPDATE `sys_privilege` SET `related` = '71,167,286,287,424,477,417,420,421,441,442,640,641,636' WHERE (`id` = '283');
+ALTER TABLE `exam_task_temp` ADD COLUMN `course_id` BIGINT(20) NULL COMMENT '课程ID' AFTER `batch_no`;

+ 1 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPrintTaskController.java

@@ -206,7 +206,7 @@ public class ExamPrintTaskController {
     @ApiOperation(value = "印刷任务管理-完整pdf查询")
     @RequestMapping(value = "/get_whole_pdf", method = RequestMethod.POST)
     public Result getWholePdf(@ApiParam(value = "考试ID") @RequestParam Long examId,
-                              @ApiParam(value = "课程ID") @RequestParam Long courseId,
+                              @ApiParam(value = "课程ID") @RequestParam(required = false) Long courseId,
                               @ApiParam(value = "试卷编号") @RequestParam String paperNumber) {
         return ResultUtil.success(examTaskWholeService.getWholePdf(examId, courseId, paperNumber));
     }

+ 2 - 2
distributed-print/src/main/java/com/qmth/distributed/print/api/TFCustomFlowController.java

@@ -186,7 +186,7 @@ public class TFCustomFlowController {
     @RequestMapping(value = "/approve/list", method = RequestMethod.POST)
     public Result taskApproveList(@ApiParam(value = "学期", required = false) @RequestParam(value = "semesterId", required = false) Long semesterId,
                                   @ApiParam(value = "考试", required = false) @RequestParam(value = "examId", required = false) Long examId,
-                                  @ApiParam(value = "课程代码", required = false) @RequestParam(value = "courseCode", required = false) String courseCode,
+                                  @ApiParam(value = "课程代码", required = false) @RequestParam(value = "courseId", required = false) Long courseId,
                                   @ApiParam(value = "试着编号", required = false) @RequestParam(value = "paperNumber", required = false) String paperNumber,
                                   @ApiParam(value = "状态", required = false) @RequestParam(required = false) FlowStatusEnum status,
                                   @ApiParam(value = "提交人名称", required = false) @RequestParam(required = false) String teacherUserName,
@@ -202,7 +202,7 @@ public class TFCustomFlowController {
         if (examId == null) {
             throw ExceptionResultEnum.ERROR.exception("请选择考试");
         }
-        return ResultUtil.ok(tfFlowApproveService.findApproveList(new Page<>(pageNumber, pageSize), semesterId, examId, courseCode, paperNumber, status, teacherUserName, SystemConstant.convertIdToLong(teachingRoomId), startTime, endTime, pendApproveUserName, SystemConstant.getHeadOrUserSchoolId(), null));
+        return ResultUtil.ok(tfFlowApproveService.findApproveList(new Page<>(pageNumber, pageSize), semesterId, examId, courseId, paperNumber, status, teacherUserName, SystemConstant.convertIdToLong(teachingRoomId), startTime, endTime, pendApproveUserName, SystemConstant.getHeadOrUserSchoolId(), null));
     }
 
     @ApiOperation(value = "流程列表")

+ 1 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/obe/TCUsualScoreController.java

@@ -76,7 +76,7 @@ public class TCUsualScoreController {
     @ApiOperation(value = "成绩管理列表")
     @RequestMapping(value = "/score/list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "分页查询", response = ObeScoreResult.class)})
-    public Result scoreList(@ApiParam(value = "培养方案ID", required = true) @RequestParam Long cultureProgramId, @ApiParam(value = "学期ID", required = true) @RequestParam Long semesterId,
+    public Result scoreList(@ApiParam(value = "培养方案ID") @RequestParam(required = false) Long cultureProgramId, @ApiParam(value = "学期ID") @RequestParam(required = false) Long semesterId,
                             @ApiParam(value = "课程id") @RequestParam(required = false) Long courseId, @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                             @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
         return ResultUtil.ok(

+ 1 - 1
distributed-print/src/main/java/com/qmth/distributed/print/api/obe/TRBasicInfoController.java

@@ -109,7 +109,7 @@ public class TRBasicInfoController {
     @ApiOperation(value = "报告管理列表")
     @RequestMapping(value = "/report/list", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "分页查询", response = ObeScoreResult.class)})
-    public Result reportList(@ApiParam(value = "培养方案ID", required = true) @RequestParam Long cultureProgramId,
+    public Result reportList(@ApiParam(value = "培养方案ID") @RequestParam(required = false) Long cultureProgramId,
                              @ApiParam(value = "学期ID") @RequestParam(required = false) Long semesterId,
                              @ApiParam(value = "课程id", required = true) Long courseId,
                              @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,

+ 1 - 10
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/score/StudentScoreDetailDto.java

@@ -55,15 +55,6 @@ public class StudentScoreDetailDto {
     private BasicExamStudentStatusEnum studentStatus;
     private String studentStatusDisplay;
     private String collegeName;
-    private BasicExamStudentStatusEnum status;
-
-    public BasicExamStudentStatusEnum getStatus() {
-        return status;
-    }
-
-    public void setStatus(BasicExamStudentStatusEnum status) {
-        this.status = status;
-    }
 
     public String getCollegeName() {
         return collegeName;
@@ -346,7 +337,7 @@ public class StudentScoreDetailDto {
     }
 
     public String getStudentStatusDisplay() {
-        return this.studentStatus != null ? this.studentStatus.getName() : "";
+        return this.studentStatusDisplay;
     }
 
     public void setStudentStatusDisplay(String studentStatusDisplay) {

+ 13 - 29
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkStudentServiceImpl.java

@@ -260,12 +260,18 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
             scoreDetailDto.setSheetUrls(buildSheetUrls(scoreDetailDto.getStudentId()));
             scoreDetailDto.setSheetPath(null);
             // 状态
-            if (ScanStatus.UNEXIST.equals(scoreDetailDto.getScanStatus())) {
-                scoreDetailDto.setStatusDisplay("未扫描");
-            } else if (ScanStatus.MANUAL_ABSENT.equals(scoreDetailDto.getScanStatus()) || scoreDetailDto.getAbsent() || scoreDetailDto.getOmrAbsent()) {
-                scoreDetailDto.setStatusDisplay("缺考");
-            } else if (!scoreDetailDto.getAbsent() && !scoreDetailDto.getOmrAbsent() && scoreDetailDto.getUpload() && ScanStatus.SCANNED.equals(scoreDetailDto.getScanStatus())) {
-                scoreDetailDto.setStatusDisplay("正常");
+//            if (ScanStatus.UNEXIST.equals(scoreDetailDto.getScanStatus())) {
+//                scoreDetailDto.setStatusDisplay("未扫描");
+//            } else if (ScanStatus.MANUAL_ABSENT.equals(scoreDetailDto.getScanStatus()) || scoreDetailDto.getAbsent() || scoreDetailDto.getOmrAbsent()) {
+//                scoreDetailDto.setStatusDisplay("缺考");
+//            } else if (!scoreDetailDto.getAbsent() && !scoreDetailDto.getOmrAbsent() && scoreDetailDto.getUpload() && ScanStatus.SCANNED.equals(scoreDetailDto.getScanStatus())) {
+//                scoreDetailDto.setStatusDisplay("正常");
+//            }
+
+            if (ScanStatus.UNEXIST.equals(scoreDetailDto.getScanStatus()) && BasicExamStudentStatusEnum.N.equals(scoreDetailDto.getStudentStatus())) {
+                scoreDetailDto.setStudentStatusDisplay(ScanStatus.UNEXIST.getName());
+            } else {
+                scoreDetailDto.setStudentStatusDisplay(scoreDetailDto.getStudentStatus() != null ? scoreDetailDto.getStudentStatus().getName() : null);
             }
 
             // 主观题检查标记
@@ -351,27 +357,6 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
                     }
                 }
             }
-            // 原图
-            scoreDetailDto.setSheetUrls(buildSheetUrls(scoreDetailDto.getStudentId()));
-            scoreDetailDto.setSheetPath(null);
-            // 状态
-            if (ScanStatus.UNEXIST.equals(scoreDetailDto.getScanStatus())) {
-                scoreDetailDto.setStatusDisplay("未扫描");
-            } else if (ScanStatus.MANUAL_ABSENT.equals(scoreDetailDto.getScanStatus()) || scoreDetailDto.getAbsent() || scoreDetailDto.getOmrAbsent()) {
-                scoreDetailDto.setStatusDisplay("缺考");
-            } else if (!scoreDetailDto.getAbsent() && !scoreDetailDto.getOmrAbsent() && scoreDetailDto.getUpload() && ScanStatus.SCANNED.equals(scoreDetailDto.getScanStatus())) {
-                scoreDetailDto.setStatusDisplay("正常");
-            }
-
-            // 主观题检查标记
-            scoreDetailDto.setSubjectiveCheckFlag(
-                    !scoreDetailDto.getAbsent() && !scoreDetailDto.getOmrAbsent() && scoreDetailDto.getUpload() && ScanStatus.SCANNED.equals(scoreDetailDto.getScanStatus())
-                            && SubjectiveStatus.MARKED.equals(scoreDetailDto.getSubjectiveStatus()) && StringUtils.isNotBlank(scoreDetailDto.getSubjectiveScore()) && StringUtils.isNotBlank(
-                            scoreDetailDto.getSubjectiveScoreList()));
-            // 客观题检查标记
-            scoreDetailDto.setObjectiveCheckFlag(
-                    !scoreDetailDto.getAbsent() && !scoreDetailDto.getOmrAbsent() && scoreDetailDto.getUpload() && ScanStatus.SCANNED.equals(scoreDetailDto.getScanStatus()) && StringUtils.isNotBlank(
-                            scoreDetailDto.getObjectiveScore()) && StringUtils.isNotBlank(scoreDetailDto.getObjectiveScoreList()));
 
             // 格式化分数
             scoreDetailDto.setObjectiveScore(Calculator.round(scoreDetailDto.getObjectiveScore(), 1));
@@ -402,7 +387,6 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
         String[] columnNames = columnNameList.toArray(new String[0]);
         //生成动态内容
         List<String[]> columnValues = new ArrayList<>();
-//        List<ArchiveStudentVo> ret = baseMapper.studentList(schoolId, query, null);
         for (StudentScoreDetailDto s : studentScoreDetailDtoList) {
             List<String> valueList = new ArrayList<>();
             valueList.add(s.getStudentName());
@@ -411,7 +395,7 @@ public class MarkStudentServiceImpl extends ServiceImpl<MarkStudentMapper, MarkS
             valueList.add(s.getClassName());
             valueList.add(s.getCourseCode());
             valueList.add(s.getCourseName());
-            valueList.add(Objects.nonNull(s.getStatus()) ? s.getStatus().getName() : null);
+            valueList.add(Objects.nonNull(s.getStudentStatus()) ? s.getStudentStatus().getName() : null);
             valueList.add(s.getObjectiveScore() == null ? "" : s.getObjectiveScore().toString());
             valueList.add(s.getSubjectiveScore() == null ? "" : s.getSubjectiveScore().toString());
             valueList.add(s.getTotalScore() == null ? "" : s.getTotalScore().toString());

+ 0 - 1
teachcloud-mark/src/main/resources/mapper/MarkStudentMapper.xml

@@ -49,7 +49,6 @@
         bes.student_name studentName,
         bes.student_code studentCode,
         bes.college_name collegeName,
-        bes.status,
         ms.secret_number secretNumber,
         bes.college_name college,
         bes.major_name majorName,