ソースを参照

Merge branch 'dev_v2.2.0' into release_v2.2.0

xiaof 3 年 前
コミット
8d1633af8d
27 ファイル変更456 行追加215 行削除
  1. 19 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/ExamTaskPrintDetailDto.java
  2. 15 7
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/ExamTaskPrintDto.java
  3. 29 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/params/ExamTaskPrintParams.java
  4. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/BasicCardRuleMapper.java
  5. 2 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamDetailCourseMapper.java
  6. 3 0
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamTaskPrintMapper.java
  7. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/BasicCardRuleService.java
  8. 2 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailCourseService.java
  9. 5 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamTaskPrintService.java
  10. 1 1
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ActivitiServiceImpl.java
  11. 2 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicCardRuleServiceImpl.java
  12. 44 43
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicMessageServiceImpl.java
  13. 3 2
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailCourseServiceImpl.java
  14. 65 22
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskPrintServiceImpl.java
  15. 67 30
      distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskServiceImpl.java
  16. 5 2
      distributed-print-business/src/main/resources/mapper/BasicCardRuleMapper.xml
  17. 1 1
      distributed-print-business/src/main/resources/mapper/BasicStudentMapper.xml
  18. 6 0
      distributed-print-business/src/main/resources/mapper/ExamDetailCourseMapper.xml
  19. 53 40
      distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml
  20. 33 0
      distributed-print-business/src/main/resources/mapper/ExamTaskPrintMapper.xml
  21. 5 3
      distributed-print/src/main/java/com/qmth/distributed/print/api/BasicCardRuleController.java
  22. 0 1
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPrintPlanController.java
  23. 22 22
      distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskController.java
  24. 15 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/bean/dto/BlurryUserDto.java
  25. 8 0
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/BasicCourseService.java
  26. 48 33
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicCourseServiceImpl.java
  27. 1 1
      teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/SysUserServiceImpl.java

+ 19 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/ExamTaskPrintDetailDto.java

@@ -0,0 +1,19 @@
+package com.qmth.distributed.print.business.bean.dto;
+
+import com.qmth.distributed.print.business.entity.ExamTaskPrint;
+
+/**
+ * @Date: 2021/8/27.
+ */
+public class ExamTaskPrintDetailDto extends ExamTaskPrint {
+
+    private String status;
+
+    public String getStatus() {
+        return status;
+    }
+
+    public void setStatus(String status) {
+        this.status = status;
+    }
+}

+ 15 - 7
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/ExamTaskPrintDto.java

@@ -1,7 +1,6 @@
 package com.qmth.distributed.print.business.bean.dto;
 
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.qmth.distributed.print.business.entity.ExamTaskPrint;
+import java.util.List;
 
 /**
  * @Date: 2021/3/31.
@@ -9,9 +8,10 @@ import com.qmth.distributed.print.business.entity.ExamTaskPrint;
 public class ExamTaskPrintDto {
 
     private Long printPlanId;
+    private Boolean isSubmit;
     private Long examStartTime;
     private Long examEndTime;
-    private IPage<ExamTaskPrint> iPage;
+    private List<ExamTaskPrintDetailDto> list;
 
     public Long getPrintPlanId() {
         return printPlanId;
@@ -37,11 +37,19 @@ public class ExamTaskPrintDto {
         this.examEndTime = examEndTime;
     }
 
-    public IPage<ExamTaskPrint> getiPage() {
-        return iPage;
+    public Boolean getSubmit() {
+        return isSubmit;
     }
 
-    public void setiPage(IPage<ExamTaskPrint> iPage) {
-        this.iPage = iPage;
+    public void setSubmit(Boolean submit) {
+        isSubmit = submit;
+    }
+
+    public List<ExamTaskPrintDetailDto> getList() {
+        return list;
+    }
+
+    public void setList(List<ExamTaskPrintDetailDto> list) {
+        this.list = list;
     }
 }

+ 29 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/params/ExamTaskPrintParams.java

@@ -0,0 +1,29 @@
+package com.qmth.distributed.print.business.bean.params;
+
+import java.util.List;
+
+/**
+ * @Description: 批量提交命题任务-卷库查询入口
+ * @Date: 2021-08-26
+ */
+public class ExamTaskPrintParams {
+
+    private Long printPlanId;
+    private List<Long> list;
+
+    public Long getPrintPlanId() {
+        return printPlanId;
+    }
+
+    public void setPrintPlanId(Long printPlanId) {
+        this.printPlanId = printPlanId;
+    }
+
+    public List<Long> getList() {
+        return list;
+    }
+
+    public void setList(List<Long> list) {
+        this.list = list;
+    }
+}

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

@@ -21,7 +21,7 @@ import java.util.Set;
  */
 public interface BasicCardRuleMapper extends BaseMapper<BasicCardRule> {
 
-    IPage<CardRuleDto> listPage(Page<CardRuleDto> page, @Param("schoolId") Long schoolId, @Param("enable") Boolean enable, @Param("name") String name, @Param("createTime") Long createTime);
+    IPage<CardRuleDto> listPage(Page<CardRuleDto> page, @Param("schoolId") Long schoolId, @Param("enable") Boolean enable, @Param("name") String name, @Param("createStartTime") Long createStartTime, @Param("createEndTime") Long createEndTime);
 
     List<BasicCardRule> list(@Param("schoolId") Long schoolId, @Param("param") String param, @Param("orgIds") Set<Long> orgIds);
 }

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

@@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * <p>
@@ -24,7 +25,7 @@ public interface ExamDetailCourseMapper extends BaseMapper<ExamDetailCourse> {
 
     List<BasicCourse> listCoursesByPrintPlanId(@Param("param") String param, @Param("printPlanIdList") List<Long> printPlanIdList);
 
-    List<String> listPaperNumberByPrintPlanId(@Param("param") String param, @Param("printPlanIdList") List<Long> printPlanIdList);
+    List<String> listPaperNumberByPrintPlanId(@Param("param") String param, @Param("printPlanIdList") List<Long> printPlanIdList, @Param("orgIds") Set<Long> orgIds);
 
     List<ExamDetailCourse> listByPrintPlanIdAndCourseCodeAndPaperNumber(@Param("schoolId") Long schoolId, @Param("printPlanId") Long printPlanId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber);
 

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

@@ -1,6 +1,7 @@
 package com.qmth.distributed.print.business.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.qmth.distributed.print.business.bean.dto.ExamTaskPrintDetailDto;
 import com.qmth.distributed.print.business.bean.dto.TaskPrintHouseDto;
 import com.qmth.distributed.print.business.entity.ExamTaskPrint;
 import org.apache.ibatis.annotations.Param;
@@ -19,4 +20,6 @@ public interface ExamTaskPrintMapper extends BaseMapper<ExamTaskPrint> {
     List<TaskPrintHouseDto> listTaskPrintHouse(@Param("schoolId") Long schoolId, @Param("type") String type);
 
     List<TaskPrintHouseDto> listTaskPrintHouseAll(@Param("schoolId") Long schoolId, @Param("type") String type);
+
+    List<ExamTaskPrintDetailDto> listByPrintPlanIdAndCourseCodeAndPaperNumber(@Param("printPlanId") Long printPlanId, @Param("courseCode") String courseCode, @Param("paperNumber") String paperNumber);
 }

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

@@ -17,7 +17,7 @@ import java.util.List;
  */
 public interface BasicCardRuleService extends IService<BasicCardRule> {
 
-    IPage<CardRuleDto> list(Boolean enable, String name, Long createTime, Integer pageNumber, Integer pageSize);
+    IPage<CardRuleDto> list(Boolean enable, String name, Long createStartTime, Long createEndTime, Integer pageNumber, Integer pageSize);
 
     List<BasicCardRule> list(String param);
 

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

@@ -6,6 +6,7 @@ import com.qmth.teachcloud.common.entity.BasicCourse;
 
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * <p>
@@ -32,7 +33,7 @@ public interface ExamDetailCourseService extends IService<ExamDetailCourse> {
 
     List<BasicCourse> listCoursesByPrintPlanId(String param, List<Long> printPlanIdList);
 
-    List<String> listPaperNumberByPrintPlanId(String param, List<Long> printPlanIdList);
+    List<String> listPaperNumberByPrintPlanId(String param, List<Long> printPlanIdList, Set<Long> orgIds);
 
     List<ExamDetailCourse> listByPrintPlanIdAndCourseCodeAndPaperNumber(Long schoolId, Long printPlanId, String courseCode, String paperNumber);
 

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

@@ -6,10 +6,12 @@ import com.qmth.distributed.print.business.bean.dto.ExamTaskPrintDto;
 import com.qmth.distributed.print.business.bean.dto.TaskPrintClassDto;
 import com.qmth.distributed.print.business.bean.dto.TaskPrintExtendFieldsDto;
 import com.qmth.distributed.print.business.bean.dto.TaskPrintHouseDto;
+import com.qmth.distributed.print.business.bean.params.ExamTaskPrintParams;
 import com.qmth.distributed.print.business.entity.BasicStudent;
 import com.qmth.distributed.print.business.entity.ExamDetail;
 import com.qmth.distributed.print.business.entity.ExamTaskPrint;
 
+import java.io.IOException;
 import java.util.List;
 
 /**
@@ -25,7 +27,7 @@ public interface ExamTaskPrintService extends IService<ExamTaskPrint> {
 
     void remove(Long examTaskPrintId);
 
-    ExamTaskPrintDto listTaskPrint(Long printPlanId, String courseCode, String paperNumber, Integer pageNumber, Integer pageSize);
+    ExamTaskPrintDto listTaskPrint(Long printPlanId, String courseCode, String paperNumber);
 
     ExamDetail createTaskPrint(ExamTaskPrint examTaskPrint);
 
@@ -34,4 +36,6 @@ public interface ExamTaskPrintService extends IService<ExamTaskPrint> {
     List<TaskPrintHouseDto> listHouse();
 
     List<TaskPrintExtendFieldsDto> listTaskPrintExtendFields();
+
+    void submitTaskPrint(ExamTaskPrintParams examTaskPrintParams) throws IOException;
 }

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

@@ -485,7 +485,7 @@ public class ActivitiServiceImpl implements ActivitiService {
             if (flowElement instanceof UserTask) {
                 UserTask userTask = (UserTask) flowElement;
                 if (Objects.nonNull(userTask)) {
-                    //广东科大学流程
+                    //广东科大学流程
                     if (Objects.nonNull(processDefinitionEntity) && processDefinitionEntity.getKey().contains(SystemConstant.GDYKDX_FLOW_KEY)) {
                         FlowGdykdxApproveSetupEnum flowGdykdxApproveSetupEnum = FlowGdykdxApproveSetupEnum.convertToInstance(userTask.getId());
                         flowTaskResultList.add(new FlowTaskResult(Long.parseLong(flowId), userTask.getName(), flowGdykdxApproveSetupEnum.getId(), flowGdykdxApproveSetupEnum.getSetup()));

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

@@ -45,10 +45,10 @@ public class BasicCardRuleServiceImpl extends ServiceImpl<BasicCardRuleMapper, B
     TeachcloudCommonService teachcloudCommonService;
 
     @Override
-    public IPage<CardRuleDto> list(Boolean enable, String name, Long createTime, Integer pageNumber, Integer pageSize) {
+    public IPage<CardRuleDto> list(Boolean enable, String name, Long createStartTime, Long createEndTime, Integer pageNumber, Integer pageSize) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         Page<CardRuleDto> page = new Page<>(pageNumber, pageSize);
-        IPage<CardRuleDto> cardRuleDtoIPage = this.baseMapper.listPage(page, schoolId, enable, SystemConstant.translateSpecificSign(name), createTime);
+        IPage<CardRuleDto> cardRuleDtoIPage = this.baseMapper.listPage(page, schoolId, enable, SystemConstant.translateSpecificSign(name), createStartTime, createEndTime);
         if (cardRuleDtoIPage.getRecords().size() > 0) {
             cardRuleDtoIPage.getRecords().forEach(m -> {
                 //查询适用学院

+ 44 - 43
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicMessageServiceImpl.java

@@ -58,56 +58,57 @@ public class BasicMessageServiceImpl extends ServiceImpl<BasicMessageMapper, Bas
         String templateContent = enumInfo.get("templateContent");
 
         String errorMessage = null;
+        if (SystemConstant.strNotNull(mobileNumber)){
+            try {
+                // 其他方法调用所传入的参数,必须校验有值
+                this.checkData(userId, variableParams, messageType);
 
-        try {
-            // 其他方法调用所传入的参数,必须校验有值
-            this.checkData(userId, mobileNumber, variableParams, messageType);
-
-            // 短信提示系统是否启用配置验证
-            SysConfig sysConfig = sysConfigService.getByKey("sys.message.enable");
-            if (sysConfig == null) {
-                throw ExceptionResultEnum.ERROR.exception("未找到短信配置");
-            }
-            if (sysConfig.getConfigValue() == null) {
-                throw ExceptionResultEnum.ERROR.exception("短信消息提示启用开关未设置");
-            }
-            if (sysConfig.getConfigValue().equals("false")) {
-                throw ExceptionResultEnum.ERROR.exception("短信消息提示已关闭");
-            }
+                // 短信提示系统是否启用配置验证
+                SysConfig sysConfig = sysConfigService.getByKey("sys.message.enable");
+                if (sysConfig == null) {
+                    throw ExceptionResultEnum.ERROR.exception("未找到短信配置");
+                }
+                if (sysConfig.getConfigValue() == null) {
+                    throw ExceptionResultEnum.ERROR.exception("短信消息提示启用开关未设置");
+                }
+                if (sysConfig.getConfigValue().equals("false")) {
+                    throw ExceptionResultEnum.ERROR.exception("短信消息提示已关闭");
+                }
 
-            SendSmsResponse sendSmsResponse = sendSms(mobileNumber, templateCode, variableParams);
+                SendSmsResponse sendSmsResponse = sendSms(mobileNumber, templateCode, variableParams);
 
-            if (sendSmsResponse.getCode() != null) {
+                if (sendSmsResponse.getCode() != null) {
 
-                basicMessage.setSendStatus(sendSmsResponse.getCode());
-                basicMessage.setSendResult(sendSmsResponse.getMessage());
+                    basicMessage.setSendStatus(sendSmsResponse.getCode());
+                    basicMessage.setSendResult(sendSmsResponse.getMessage());
 
-            } else {
-                throw ExceptionResultEnum.ERROR.exception(sendSmsResponse.getMessage());
-            }
-        } catch (Exception e) {
-            errorMessage = e.getMessage();
-        } finally {
-            // 传入的必填字段
-            basicMessage.setUserId(userId);
-            basicMessage.setMobileNumber(mobileNumber);
-            basicMessage.setBusinessId(businessId);
-            basicMessage.setVariableParams(variableParams);
-            basicMessage.setCreateId(createId);
-            basicMessage.setMessageType(messageType);
-            basicMessage.setRemark(remark);
-            basicMessage.setResendCount(0);
+                } else {
+                    throw ExceptionResultEnum.ERROR.exception(sendSmsResponse.getMessage());
+                }
+            } catch (Exception e) {
+                errorMessage = e.getMessage();
+            } finally {
+                // 传入的必填字段
+                basicMessage.setUserId(userId);
+                basicMessage.setMobileNumber(mobileNumber);
+                basicMessage.setBusinessId(businessId);
+                basicMessage.setVariableParams(variableParams);
+                basicMessage.setCreateId(createId);
+                basicMessage.setMessageType(messageType);
+                basicMessage.setRemark(remark);
+                basicMessage.setResendCount(0);
 
-            // 经过处理的新字段
-            basicMessage.setId(SystemConstant.getDbUuid());
-            basicMessage.setBusinessOperate(messageType.getName());
-            basicMessage.setCreateTime(System.currentTimeMillis());
-            basicMessage.setTemplateCode(templateCode);
-            if (errorMessage != null && errorMessage.length() > 0) {
-                basicMessage.setSendStatus("SYSTEM_ERROR");
-                basicMessage.setSendResult(errorMessage);
+                // 经过处理的新字段
+                basicMessage.setId(SystemConstant.getDbUuid());
+                basicMessage.setBusinessOperate(messageType.getName());
+                basicMessage.setCreateTime(System.currentTimeMillis());
+                basicMessage.setTemplateCode(templateCode);
+                if (errorMessage != null && errorMessage.length() > 0) {
+                    basicMessage.setSendStatus("SYSTEM_ERROR");
+                    basicMessage.setSendResult(errorMessage);
+                }
+                this.save(basicMessage);
             }
-            this.save(basicMessage);
         }
     }
 

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

@@ -17,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.stream.Collectors;
 
 /**
@@ -62,8 +63,8 @@ public class ExamDetailCourseServiceImpl extends ServiceImpl<ExamDetailCourseMap
     }
 
     @Override
-    public List<String> listPaperNumberByPrintPlanId(String param, List<Long> printPlanIdList) {
-        return this.baseMapper.listPaperNumberByPrintPlanId(SystemConstant.translateSpecificSign(param), printPlanIdList);
+    public List<String> listPaperNumberByPrintPlanId(String param, List<Long> printPlanIdList, Set<Long> orgIds) {
+        return this.baseMapper.listPaperNumberByPrintPlanId(SystemConstant.translateSpecificSign(param), printPlanIdList,orgIds);
     }
 
     @Override

+ 65 - 22
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskPrintServiceImpl.java

@@ -8,10 +8,8 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.qmth.distributed.print.business.bean.dto.ExamTaskPrintDto;
-import com.qmth.distributed.print.business.bean.dto.TaskPrintClassDto;
-import com.qmth.distributed.print.business.bean.dto.TaskPrintExtendFieldsDto;
-import com.qmth.distributed.print.business.bean.dto.TaskPrintHouseDto;
+import com.qmth.distributed.print.business.bean.dto.*;
+import com.qmth.distributed.print.business.bean.params.ExamTaskPrintParams;
 import com.qmth.distributed.print.business.bean.params.SerialNumberParams;
 import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.enums.ExamDataSourceEnum;
@@ -19,12 +17,17 @@ import com.qmth.distributed.print.business.enums.ExamDetailStatusEnum;
 import com.qmth.distributed.print.business.enums.PrintPlanStatusEnum;
 import com.qmth.distributed.print.business.mapper.ExamTaskPrintMapper;
 import com.qmth.distributed.print.business.service.*;
+import com.qmth.distributed.print.business.templete.execute.AsyncCreatePdfTempleteService;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicUserCourse;
 import com.qmth.teachcloud.common.entity.SysUser;
+import com.qmth.teachcloud.common.entity.TBTask;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.OrgTypeEnum;
+import com.qmth.teachcloud.common.enums.TaskStatusEnum;
+import com.qmth.teachcloud.common.enums.TaskTypeEnum;
 import com.qmth.teachcloud.common.service.BasicUserCourseService;
+import com.qmth.teachcloud.common.service.TBTaskService;
 import com.qmth.teachcloud.common.util.ConvertUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
 import org.apache.commons.lang3.StringUtils;
@@ -34,6 +37,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.CollectionUtils;
 
 import javax.annotation.Resource;
+import java.io.IOException;
 import java.util.*;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.stream.Collectors;
@@ -65,6 +69,12 @@ public class ExamTaskPrintServiceImpl extends ServiceImpl<ExamTaskPrintMapper, E
     @Autowired
     private BasicUserCourseService basicUserCourseService;
 
+    @Resource
+    TBTaskService tbTaskService;
+
+    @Resource
+    AsyncCreatePdfTempleteService asyncCreatePdfTempleteService;
+
     @Resource
     ConvertUtil convertUtil;
 
@@ -78,8 +88,19 @@ public class ExamTaskPrintServiceImpl extends ServiceImpl<ExamTaskPrintMapper, E
     @Transactional
     @Override
     public void remove(Long examTaskPrintId) {
-        // todo xf删除逻辑校验
         ExamTaskPrint examTaskPrint = this.getById(examTaskPrintId);
+        ExamDetail examDetail = examDetailService.getById(examTaskPrint.getExamDetailId());
+        if (!examDetail.getStatus().name().equals(ExamDetailStatusEnum.NEW.name()) &&
+                !examDetail.getStatus().name().equals(ExamDetailStatusEnum.READY.name())) {
+            throw ExceptionResultEnum.ERROR.exception("当前状态不可删除");
+        }
+
+        List<Long> entityId = Arrays.asList(examTaskPrint.getExamDetailId());
+        boolean isFinish = tbTaskService.countByPrintPlanIdAndEntityId(examTaskPrint.getSchoolId(), examTaskPrint.getPrintPlanId(), entityId);
+        if(!isFinish){
+            throw ExceptionResultEnum.ERROR.exception("任务正在生成pdf,不能删除");
+        }
+
         QueryWrapper<ExamDetailCourse> examDetailCourseQueryWrapper = new QueryWrapper<>();
         examDetailCourseQueryWrapper.lambda().eq(ExamDetailCourse::getExamDetailId, examTaskPrint.getExamDetailId());
         List<ExamDetailCourse> examDetailCourses = examDetailCourseService.list(examDetailCourseQueryWrapper);
@@ -97,23 +118,29 @@ public class ExamTaskPrintServiceImpl extends ServiceImpl<ExamTaskPrintMapper, E
         examDetailService.removeById(examTaskPrint.getExamDetailId());
         // 删除exam_task_print
         this.removeById(examTaskPrintId);
-
-
     }
 
     @Override
-    public ExamTaskPrintDto listTaskPrint(Long printPlanId, String courseCode, String paperNumber, Integer pageNumber, Integer pageSize) {
-        QueryWrapper<ExamTaskPrint> queryWrapper = new QueryWrapper<>();
-        queryWrapper.lambda().eq(ExamTaskPrint::getPrintPlanId, printPlanId)
-                .eq(ExamTaskPrint::getCourseCode, courseCode)
-                .eq(ExamTaskPrint::getPaperNumber, paperNumber);
-        Page<ExamTaskPrint> page = new Page<>(pageNumber, pageSize);
-        IPage<ExamTaskPrint> examTaskPrintIPage = this.baseMapper.selectPage(page, queryWrapper);
+    public ExamTaskPrintDto listTaskPrint(Long printPlanId, String courseCode, String paperNumber) {
+        List<ExamTaskPrintDetailDto> examTaskPrintList = this.baseMapper.listByPrintPlanIdAndCourseCodeAndPaperNumber(printPlanId, courseCode, paperNumber);
         ExamTaskPrintDto examTaskPrintDto = new ExamTaskPrintDto();
-        if (examTaskPrintIPage.getRecords().size() > 0) {
-            examTaskPrintDto.setiPage(examTaskPrintIPage);
-            List<Long> startTimes = examTaskPrintIPage.getRecords().stream().map(m -> m.getExamStartTime()).distinct().collect(Collectors.toList());
-            List<Long> endTimes = examTaskPrintIPage.getRecords().stream().map(m -> m.getExamEndTime()).distinct().collect(Collectors.toList());
+        if (!CollectionUtils.isEmpty(examTaskPrintList)) {
+            ExamPrintPlan examPrintPlan = examPrintPlanService.getById(printPlanId);
+            if (PrintPlanStatusEnum.NEW.equals(examPrintPlan.getStatus()) || PrintPlanStatusEnum.READY.equals(examPrintPlan.getStatus())) {
+                // 是否在任务中
+                List<Long> entityIds = examTaskPrintList.stream().map(m -> m.getExamDetailId()).collect(Collectors.toList());
+                QueryWrapper<TBTask> tbTaskQueryWrapper = new QueryWrapper<>();
+                tbTaskQueryWrapper.lambda().isNotNull(TBTask::getStatus)
+                        .eq(TBTask::getType, TaskTypeEnum.CREATE_PDF)
+                        .eq(TBTask::getPrintPlanId, printPlanId)
+                        .in(TBTask::getEntityId, entityIds);
+                examTaskPrintDto.setSubmit(tbTaskService.count(tbTaskQueryWrapper) > 0);
+            } else {
+                examTaskPrintDto.setSubmit(true);
+            }
+            examTaskPrintDto.setList(examTaskPrintList);
+            List<Long> startTimes = examTaskPrintList.stream().map(m -> m.getExamStartTime()).distinct().collect(Collectors.toList());
+            List<Long> endTimes = examTaskPrintList.stream().map(m -> m.getExamEndTime()).distinct().collect(Collectors.toList());
             if (startTimes.size() != 1 || endTimes.size() != 1) {
                 throw ExceptionResultEnum.ERROR.exception("考试时间有误");
             }
@@ -261,13 +288,13 @@ public class ExamTaskPrintServiceImpl extends ServiceImpl<ExamTaskPrintMapper, E
             }
         }
 
-        if(Objects.nonNull(examTaskPrintId)){
+        if (Objects.nonNull(examTaskPrintId)) {
             ExamTaskPrint examTaskPrint = this.getById(examTaskPrintId);
-            if(Objects.isNull(examTaskPrint)){
+            if (Objects.isNull(examTaskPrint)) {
                 throw ExceptionResultEnum.ERROR.exception("数据不存在");
             }
             String classId = examTaskPrint.getClassId();
-            if(StringUtils.isNotBlank(classId)){
+            if (StringUtils.isNotBlank(classId)) {
                 String[] classIds = classId.split(",");
                 for (String id : classIds) {
                     stringList.add(id);
@@ -275,7 +302,7 @@ public class ExamTaskPrintServiceImpl extends ServiceImpl<ExamTaskPrintMapper, E
             }
         }
 
-        if(!CollectionUtils.isEmpty(stringList)) {
+        if (!CollectionUtils.isEmpty(stringList)) {
             List<TaskPrintClassDto> taskPrintClassDtos = basicStudentService.listByClass(schoolId, stringList);
             return taskPrintClassDtos;
         }
@@ -310,6 +337,22 @@ public class ExamTaskPrintServiceImpl extends ServiceImpl<ExamTaskPrintMapper, E
         return null;
     }
 
+    @Override
+    public void submitTaskPrint(ExamTaskPrintParams examTaskPrintParams) throws IOException {
+        if (Objects.isNull(examTaskPrintParams.getPrintPlanId())) {
+            throw ExceptionResultEnum.ERROR.exception("印刷计划不能为空");
+        }
+        List<Long> list = examTaskPrintParams.getList();
+        if (CollectionUtils.isEmpty(list)) {
+            throw ExceptionResultEnum.ERROR.exception("没有可提交数据");
+        }
+        // 调用生成pdf方法
+        for (Long examDetailId : list) {
+            Map<String, Object> map = tbTaskService.saveTask(TaskTypeEnum.CREATE_PDF, examTaskPrintParams.getPrintPlanId(), (SysUser) ServletUtil.getRequestUser(), examDetailId);
+            asyncCreatePdfTempleteService.createPdf(map, null);
+        }
+    }
+
     private void saveBatchStudent(ExamTaskPrint examTaskPrint, List<String> classIds, Long examDetailCourseId, SysUser sysUser) {
         QueryWrapper<BasicStudent> queryWrapper1 = new QueryWrapper<>();
         queryWrapper1.lambda().eq(BasicStudent::getSchoolId, examTaskPrint.getSchoolId()).in(BasicStudent::getClazz, classIds);

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

@@ -30,6 +30,7 @@ import com.qmth.teachcloud.common.util.ExcelUtil;
 import com.qmth.teachcloud.common.util.ResultUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
 import com.qmth.teachcloud.common.util.excel.ExcelError;
+import javafx.beans.binding.ObjectExpression;
 import org.activiti.engine.ActivitiObjectNotFoundException;
 import org.activiti.engine.TaskService;
 import org.activiti.engine.runtime.ProcessInstance;
@@ -164,10 +165,14 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
     @Override
     public List<String> listPaperNumber(String param, List<Long> printPlanIdList) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
+        Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
         if (printPlanIdList.size() == 0) {
             // 查询命题任务中的试卷编号
             QueryWrapper<ExamTask> queryWrapperExamTask = new QueryWrapper<>();
             queryWrapperExamTask.lambda().eq(ExamTask::getSchoolId, schoolId);
+            if (orgIds.size() > 0){
+                queryWrapperExamTask.lambda().in(ExamTask::getOrgId,orgIds);
+            }
             List<String> list = new ArrayList<>();
             if (StringUtils.isNotBlank(param)) {
                 queryWrapperExamTask.lambda().and(i -> i.like(ExamTask::getCourseCode, SystemConstant.translateSpecificSign(param)).or().like(ExamTask::getCourseName, SystemConstant.translateSpecificSign(param)));
@@ -180,6 +185,9 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             // 查询考务-科目中的试卷编号
             QueryWrapper<ExamDetailCourse> queryWrapperExamDetailCourse = new QueryWrapper<>();
             queryWrapperExamDetailCourse.lambda().eq(ExamDetailCourse::getSchoolId, schoolId);
+            if (orgIds.size() > 0){
+                queryWrapperExamDetailCourse.lambda().in(ExamDetailCourse::getOrgId,orgIds);
+            }
             List<String> list2 = new ArrayList<>();
             if (StringUtils.isNotBlank(param)) {
                 queryWrapperExamDetailCourse.lambda().and(i -> i.like(ExamDetailCourse::getCourseCode, SystemConstant.translateSpecificSign(param))
@@ -192,7 +200,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             list.addAll(list2);
             return list.stream().distinct().collect(Collectors.toList());
         } else {
-            return examDetailCourseService.listPaperNumberByPrintPlanId(param, printPlanIdList);
+            return examDetailCourseService.listPaperNumberByPrintPlanId(param, printPlanIdList,orgIds);
         }
     }
 
@@ -218,7 +226,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                 throw ExceptionResultEnum.ERROR.exception("命题任务已禁用,不能指派命题老师");
             }
 
-            if(Objects.nonNull(examTask.getUserId())) {
+            if (Objects.nonNull(examTask.getUserId())) {
                 examStatusEnum = ExamStatusEnum.STAGE;
                 //TODO 这里以后要判断学校code来取流程key
                 Map<String, Object> map = new HashMap<>();
@@ -228,7 +236,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             }
         }
         // 更改命题老师
-       else if (task.getStatus().name().equals(ExamStatusEnum.STAGE.name())) {
+        else if (task.getStatus().name().equals(ExamStatusEnum.STAGE.name())) {
             if (task.getEnable()) {
                 throw ExceptionResultEnum.ERROR.exception("命题任务禁用后,才能更改命题老师");
             }
@@ -238,7 +246,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             } else {
                 examStatusEnum = ExamStatusEnum.STAGE;
 
-                if(examTask.getUserId().longValue() != task.getUserId().longValue()) {
+                if (examTask.getUserId().longValue() != task.getUserId().longValue()) {
                     Map<String, Object> map = new HashMap<>();
                     map.computeIfAbsent(SystemConstant.APPROVE_ID, v -> String.valueOf(examTask.getUserId()));
                     ProcessInstance processInstance = activitiService.startActivity(SystemConstant.GDYKDX_FLOW_KEY, map);
@@ -356,7 +364,8 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             examTask.insertInfo(sysUser.getId());
             examTask.updateInfo(sysUser.getId());
             examTask.setReview(basicExamRule.getReview());
-            examTask.setOrgId(sysUser.getOrgId());
+            // 取课程所在机构
+            examTask.setOrgId(basicCourseService.getOrgIdBySchoolIdAndCourseCode(schoolId, examTask.getCourseCode()));
             if (examTask.getUserId() == null) {
                 examTask.setStatus(ExamStatusEnum.DRAFT);
             } else if (examTask.getReview()) {
@@ -427,13 +436,29 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
                     String excelTeacherAccount = userImportDto.getUserAccount();
                     String excelTeacherName = userImportDto.getUserName();
 
-                    if (Objects.nonNull(excelTeacherAccount) || Objects.nonNull(excelTeacherName)) {
-                        List<CourseInfoDto> courseInfoDtoList = basicCourseService.findByUserLoginNameAndRealName(excelTeacherAccount, excelTeacherName);
-                        if (!courseInfoDtoList.stream().map(CourseInfoDto::getCourseCode).collect(Collectors.toList()).contains(excelCourseCode)) {
-                            excelErrorTemp.add(new ExcelError(y + 1, "excel第" + (i + 1) + "个sheet第" + (y + 1) + "行[命题教师]身份信息有误"));
+                    List<BlurryUserDto> listUser = sysUserService.listUser(excelCourseCode, null);
+                    Map<String, String> userMap = listUser.stream().collect(Collectors.toMap(BlurryUserDto::getLoginName, BlurryUserDto::getName));
+                    if (userMap == null) {
+                        excelErrorTemp.add(new ExcelError(y + 1, "excel第" + (i + 1) + "个sheet第" + (y + 1) + "行[命题老师账号]不存在"));
+                    } else {
+                        if (StringUtils.isNotBlank(excelTeacherAccount)) {
+                            if (StringUtils.isBlank(excelTeacherName)) {
+                                excelErrorTemp.add(new ExcelError(y + 1, "excel第" + (i + 1) + "个sheet第" + (y + 1) + "行[命题老师姓名]不能为空"));
+                            } else {
+                                if (StringUtils.isBlank(userMap.get(excelTeacherAccount))) {
+                                    excelErrorTemp.add(new ExcelError(y + 1, "excel第" + (i + 1) + "个sheet第" + (y + 1) + "行[命题老师账号]不存在"));
+                                } else {
+                                    if(!excelTeacherName.equals(userMap.get(excelTeacherAccount))){
+                                        excelErrorTemp.add(new ExcelError(y + 1, "excel第" + (i + 1) + "个sheet第" + (y + 1) + "行[命题老师姓名]与系统不匹配"));
+                                    }
+                                }
+                            }
+                        } else {
+                            if (StringUtils.isNotBlank(excelTeacherName)) {
+                                excelErrorTemp.add(new ExcelError(y + 1, "excel第" + (i + 1) + "个sheet第" + (y + 1) + "行[命题老师账号]不能为空"));
+                            }
                         }
                     }
-
                 }
             }
             if (excelErrorTemp.size() > 0) {
@@ -566,6 +591,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         for (Map<String, String> userMap : userList) {
             ExamTask examTask = new ExamTask();
             examTask.setSchoolId(task.getSchoolId());
+            examTask.setOrgId(basicCourseService.getOrgIdBySchoolIdAndCourseCode(schoolId, userMap.get("courseCode")));
             examTask.setCourseCode(userMap.get("courseCode"));
             examTask.setCourseName(userMap.get("courseName"));
             examTask.setSpecialty(userMap.get("specialty"));
@@ -614,6 +640,16 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
             list.add(examTask);
         }
         this.saveBatch(list);
+        for (ExamTask examTask : list) {
+            if (examTask.getReview() && Objects.nonNull(examTask.getUserId()) && Objects.isNull(examTask.getFlowId())) {
+                //TODO 这里以后要判断学校code来取流程key
+                Map<String, Object> map = new HashMap<>();
+                map.computeIfAbsent(SystemConstant.APPROVE_ID, v -> String.valueOf(examTask.getUserId()));
+                ProcessInstance processInstance = activitiService.startActivity(SystemConstant.GDYKDX_FLOW_KEY, map);
+                examTask.setFlowId(Long.parseLong(processInstance.getId()));
+                this.updateById(examTask);
+            }
+        }
         return list;
     }
 
@@ -1293,28 +1329,29 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
         if (examTaskDetail == null) {
             throw ExceptionResultEnum.ERROR.exception("命题任务不存在");
         }
-        if (examTaskDetail.getCardId() == null) {
-            throw ExceptionResultEnum.ERROR.exception("命题任务没有绑定题卡");
-        }
-        ExamCard examCard = examCardService.getById(examTaskDetail.getCardId());
-        if (examCard == null) {
-            throw ExceptionResultEnum.ERROR.exception("题卡不存在");
-        }
-        if (MakeMethodEnum.CUST.equals(examCard.getMakeMethod())) {
-            throw ExceptionResultEnum.ERROR.exception("客服制卡方式,不能切换");
-        }
+        if (Objects.nonNull(examTaskDetail.getCardId())) {
+            ExamCard examCard = examCardService.getById(examTaskDetail.getCardId());
+            if (examCard == null) {
+                throw ExceptionResultEnum.ERROR.exception("题卡不存在");
+            }
+            if (MakeMethodEnum.CUST.equals(examCard.getMakeMethod())) {
+                throw ExceptionResultEnum.ERROR.exception("客服制卡方式,不能切换");
+            }
 
-        if (MakeMethodEnum.SELF.equals(examCard.getMakeMethod())) {
-            UpdateWrapper<ExamCardDetail> updateWrapper = new UpdateWrapper<>();
-            updateWrapper.lambda().eq(ExamCardDetail::getCardId, examTaskDetail.getCardId());
-            examCardDetailService.remove(updateWrapper);
+            if (MakeMethodEnum.SELF.equals(examCard.getMakeMethod())) {
+                UpdateWrapper<ExamCardDetail> updateWrapper = new UpdateWrapper<>();
+                updateWrapper.lambda().eq(ExamCardDetail::getCardId, examTaskDetail.getCardId());
+                examCardDetailService.remove(updateWrapper);
 
-            examCardService.removeById(examTaskDetail.getCardId());
-        }
+                examCardService.removeById(examTaskDetail.getCardId());
+            }
 
-        UpdateWrapper<ExamTaskDetail> examTaskDetailUpdateWrapper = new UpdateWrapper<>();
-        examTaskDetailUpdateWrapper.lambda().set(ExamTaskDetail::getCardId, null).eq(ExamTaskDetail::getId, examTaskDetail.getId());
-        examTaskDetailService.update(examTaskDetailUpdateWrapper);
+            UpdateWrapper<ExamTaskDetail> examTaskDetailUpdateWrapper = new UpdateWrapper<>();
+            examTaskDetailUpdateWrapper.lambda().set(ExamTaskDetail::getCardId, null)
+                    .set(ExamTaskDetail::getMakeMethod, null)
+                    .eq(ExamTaskDetail::getId, examTaskDetail.getId());
+            examTaskDetailService.update(examTaskDetailUpdateWrapper);
+        }
     }
 
     /**
@@ -1384,7 +1421,7 @@ public class ExamTaskServiceImpl extends ServiceImpl<ExamTaskMapper, ExamTask> i
 
             examTask.setId(Objects.isNull(examTask.getId()) ? SystemConstant.getDbUuid() : examTask.getId());
             examTask.setSchoolId(schoolId);
-            examTask.setOrgId(sysUser.getOrgId());
+            examTask.setOrgId(basicCourseService.getOrgIdBySchoolIdAndCourseCode(schoolId, examTask.getCourseCode()));
             examTask.setCreateId(sysUser.getId());
             examTask.setReview(basicExamRule.getReview());
             examTask.setUserId(sysUser.getId());

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

@@ -41,8 +41,11 @@
             <if test="name != null and name != ''">
                 and name like concat('%',#{name},'%')
             </if>
-            <if test="createTime != null and createTime != ''">
-                and create_time = #{createTime}
+            <if test="createStartTime != null and createStartTime != ''">
+                and create_time >= #{createStartTime}
+            </if>
+            <if test="createEndTime != null and createEndTime != ''">
+                and create_time &lt;= #{createEndTime}
             </if>
         </where>
         order by create_time desc

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

@@ -46,7 +46,7 @@
             <if test="schoolId != null and schoolId > 0">
                 and stu.school_id = #{schoolId}
             </if>
-            <if test="orgIds != null and orgIds.size > 0">
+            <if test="orgIds != null">
                 AND stu.org_id IN
                 <foreach collection="orgIds" item="item" index="index" open="(" separator="," close=")">
                     #{item}

+ 6 - 0
distributed-print-business/src/main/resources/mapper/ExamDetailCourseMapper.xml

@@ -92,6 +92,12 @@
             <if test="param != null and param != ''">
                 and a.paper_number like concat('%', #{param},'%')
             </if>
+            <if test="orgIds != null">
+                AND a.org_id IN
+                <foreach collection="orgIds" item="item" index="index" open="(" separator="," close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
     </select>
     <select id="listByPrintPlanIdAndCourseCodeAndPaperNumber" resultMap="BaseResultMap">

+ 53 - 40
distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml

@@ -301,7 +301,7 @@
                 and d.real_name like concat('%',#{createName},'%')
             </if>
             <if test="orgIds != null">
-                AND d.org_id IN
+                AND a.org_id IN
                 <foreach collection="orgIds" item="item" index="index" open="(" separator="," close=")">
                     #{item}
                 </foreach>
@@ -312,47 +312,48 @@
     </select>
     <select id="listTaskReviewAudited" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDto">
         SELECT
-        distinct a.id,
-        a.school_id schoolId,
-        a.course_code courseCode,
-        a.course_name courseName,
-        a.specialty,
-        a.paper_number paperNumber,
-        a.card_rule_id cardRuleId,
-        case a.card_rule_id when -1 then '全部通卡' else b.name end cardRuleName,
-        a.user_id userId,
-        c.real_name userName,
-        d.real_name createName,
-        a.start_time startTime,
-        a.end_time endTime,
-        f.status auditStatus,
-        a.review_status reviewStatus,
-        a.enable,
-        a.create_id createId,
-        a.create_time createTime,
-        a.status,
-        a.flow_id flowId,
-        f.setup,
-        f.status as flowStatus,
-        a.teacher_name teacherName,
-        a.lecturer_name lecturerName,
-        e.name teachingRoomName
+            distinct a.id,
+            a.school_id schoolId,
+            a.course_code courseCode,
+            a.course_name courseName,
+            a.specialty,
+            a.paper_number paperNumber,
+            a.card_rule_id cardRuleId,
+            case a.card_rule_id when -1 then '全部通卡' else b.name end cardRuleName,
+            a.user_id userId,
+            c.real_name userName,
+            d.real_name createName,
+            a.start_time startTime,
+            a.end_time endTime,
+            f.status auditStatus,
+            a.review_status reviewStatus,
+            a.enable,
+            a.create_id createId,
+            a.create_time createTime,
+            a.status,
+            a.flow_id flowId,
+            f.setup,
+            f.status as flowStatus,
+            a.teacher_name teacherName,
+            a.lecturer_name lecturerName,
+            e.name teachingRoomName
         FROM
-        exam_task a
+            exam_task a
         LEFT JOIN
-        basic_card_rule b ON a.card_rule_id = b.id
+            basic_card_rule b ON a.card_rule_id = b.id
         LEFT JOIN
-        sys_user c ON a.user_id = c.id
+            sys_user c ON a.user_id = c.id
         LEFT JOIN
-        sys_user d ON a.create_id = d.id
+            sys_user d ON a.create_id = d.id
         LEFT JOIN t_f_flow_approve f ON
-        a.flow_id = f.flow_id
+            a.flow_id = f.flow_id
         LEFT JOIN t_f_flow_approve_log tffal ON
-        a.flow_id = tffal.flow_id
+            a.flow_id = tffal.flow_id
         LEFT JOIN
-        sys_org e ON a.teaching_room_id = e.id
+            sys_org e ON a.teaching_room_id = e.id
         <where>
             a.enable = true and a.review = true
+            and f.status = 'FINISH'
             and EXISTS (select distinct t.PROC_INST_ID_ from ACT_HI_TASKINST t where t.TASK_DEF_KEY_ <![CDATA[ <> ]]> 'usertask1' and t.PROC_INST_ID_ = a.flow_id)
             <if test="schoolId != null and schoolId != ''">
                 and a.school_id = #{schoolId}
@@ -367,7 +368,7 @@
                 and a.paper_number = #{paperNumber}
             </if>
             <if test="userId != null and userId != ''">
-                and (tffal.primary_approve_id = #{userId} or tffal.second_approve_id = #{userId})
+                and a.user_id = #{userId}
             </if>
             <if test="cardRuleId != null and cardRuleId != ''">
                 and a.card_rule_id = #{cardRuleId}
@@ -388,7 +389,7 @@
                 and d.real_name like concat('%',#{createName},'%')
             </if>
             <if test="orgIds != null">
-                AND d.org_id IN
+                AND a.org_id IN
                 <foreach collection="orgIds" item="item" index="index" open="(" separator="," close=")">
                     #{item}
                 </foreach>
@@ -448,14 +449,20 @@
                 and a.paper_number = #{paperNumber}
             </if>
             <if test="startTime != null and startTime != ''">
-                and a.create_time &gt;= #{startTime}
+                AND if(g.update_time != '',g.update_time >= #{startTime},a.update_time >= #{startTime})
             </if>
             <if test="endTime != null and endTime != ''">
-                and a.create_time &lt;= #{endTime}
+                AND if(g.update_time != '',#{endTime} >= g.update_time,#{endTime} >= a.update_time)
             </if>
             <if test="containsQuestionTeacher">
                 and a.user_id = #{userId}
             </if>
+            <if test="cardRuleId != null and cardRuleId != ''">
+                and a.card_rule_id = #{cardRuleId}
+            </if>
+            <if test="makeMethod != null">
+                and f.make_method = #{makeMethod}
+            </if>
             <if test="!containsQuestionTeacher and orgIds != null">
                 AND d.org_id IN
                 <foreach collection="orgIds" item="item" index="index" open="(" separator="," close=")">
@@ -774,7 +781,7 @@
                 tffa.status,
                 tffa.status auditStatus,
                 et.enable,
-                et.update_time createTime,
+                det.create_time as createTime,
                 art.EXECUTION_ID_ as executionId,
                 et.flow_id as flowId,
                 art.NAME_ as taskName,
@@ -799,6 +806,8 @@
                 et.user_id= d.id
             LEFT JOIN
                 sys_org so ON et.teaching_room_id = so.id
+            LEFT JOIN exam_task_detail det ON
+                det.exam_task_id = et.id
             where
                  art.ASSIGNEE_ = cast(#{userId} as char)
                 and et.school_id = #{schoolId}
@@ -823,7 +832,7 @@
                 tffa.status,
                 tffa.status auditStatus,
                 et.enable,
-                et.update_time createTime,
+                det.create_time as createTime,
                 art.EXECUTION_ID_ as executionId,
                 et.flow_id as flowId,
                 art.NAME_ as taskName,
@@ -850,6 +859,8 @@
                     et.user_id= d.id
             LEFT JOIN
                 sys_org so ON et.teaching_room_id = so.id
+            LEFT JOIN exam_task_detail det ON
+                    det.exam_task_id = et.id
             where
                 art.ASSIGNEE_ is null
                 and ari.USER_ID_ = cast(#{userId} as char)
@@ -876,7 +887,7 @@
                 et.flowStatus as status,
                 et.flowStatus as auditStatus,
                 et.enable,
-                et.update_time createTime,
+                det.create_time as createTime,
                 et.EXECUTION_ID_ as executionId,
                 et.flow_id as flowId,
                 et.NAME_ as taskName,
@@ -917,6 +928,8 @@
                 et.card_rule_id = b.id
             left join sys_user c ON
                 et.userId = c.id
+            LEFT JOIN exam_task_detail det ON
+                    det.exam_task_id = et.id
             LEFT JOIN
                 sys_org so ON et.teaching_room_id = so.id) t order by t.createTime desc
     </select>

+ 33 - 0
distributed-print-business/src/main/resources/mapper/ExamTaskPrintMapper.xml

@@ -28,4 +28,37 @@
             o.school_id = #{schoolId} AND o.type = #{type}
         ORDER BY o.name
     </select>
+    <select id="listByPrintPlanIdAndCourseCodeAndPaperNumber"
+            resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskPrintDetailDto">
+        SELECT
+            a.id,
+            a.school_id schoolId,
+            a.org_id orgId,
+            a.print_plan_id printPlanId,
+            a.course_code courseCode,
+            a.course_name courseName,
+            a.paper_number paperNumber,
+            a.exam_start_time examStartTime,
+            a.exam_end_time examEndTime,
+            a.exam_place examPlace,
+            a.exam_room examRoom,
+            a.class_id classId,
+            a.class_name className,
+            a.student_count studentCount,
+            a.print_house_id printHouseId,
+            c.name printHouseName,
+            a.exam_detail_id examDetailId,
+            a.extend_fields extendFields,
+            b.status
+        FROM
+            exam_task_print a
+                LEFT JOIN
+            exam_detail b ON a.exam_detail_id = b.id
+                LEFT JOIN
+            sys_org c ON a.print_house_id = c.id
+        WHERE
+            a.print_plan_id = #{printPlanId}
+                AND a.course_code = #{courseCode}
+                AND a.paper_number = #{paperNumber}
+    </select>
 </mapper>

+ 5 - 3
distributed-print/src/main/java/com/qmth/distributed/print/api/BasicCardRuleController.java

@@ -38,7 +38,8 @@ public class BasicCardRuleController {
      *
      * @param enable
      * @param name
-     * @param createTime
+     * @param createStartTime
+     * @param createEndTime
      * @param pageNumber
      * @param pageSize
      * @return
@@ -47,10 +48,11 @@ public class BasicCardRuleController {
     @RequestMapping(value = "/list", method = RequestMethod.POST)
     public Result list(@RequestParam(value = "enable", required = false) Boolean enable,
                        @RequestParam(value = "name", required = false) String name,
-                       @RequestParam(value = "createTime", required = false) Long createTime,
+                       @RequestParam(value = "createStartTime", required = false) Long createStartTime,
+                       @RequestParam(value = "createEndTime", required = false) Long createEndTime,
                        @RequestParam("pageNumber") Integer pageNumber,
                        @RequestParam("pageSize") Integer pageSize) {
-        IPage<CardRuleDto> cardRuleDtoIPage = basicCardRuleService.list(enable, name, createTime, pageNumber, pageSize);
+        IPage<CardRuleDto> cardRuleDtoIPage = basicCardRuleService.list(enable, name, createStartTime, createEndTime, pageNumber, pageSize);
         return ResultUtil.ok(cardRuleDtoIPage);
     }
 

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

@@ -133,7 +133,6 @@ public class ExamPrintPlanController {
      * @param courseCode
      * @param paperNumber
      * @param userName 命题老师
-     * @param cardRuleName 题卡规则
      * @param pageNumber
      * @param pageSize
      * @return

+ 22 - 22
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamTaskController.java

@@ -6,6 +6,7 @@ import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailCardDto;
 import com.qmth.distributed.print.business.bean.dto.ExamTaskImportDto;
 import com.qmth.distributed.print.business.bean.dto.ExamTaskPrintDto;
 import com.qmth.distributed.print.business.bean.params.ExamTaskApplyParam;
+import com.qmth.distributed.print.business.bean.params.ExamTaskPrintParams;
 import com.qmth.distributed.print.business.bean.result.EditResult;
 import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.enums.ExamStatusEnum;
@@ -70,9 +71,6 @@ public class ExamTaskController {
     @Autowired
     private BasicAttachmentService basicAttachmentService;
 
-    @Resource
-    private TBTaskService tbTaskService;
-
     @Resource
     private AsyncTaskReviewSampleExportService asyncTaskReviewSampleExportService;
 
@@ -85,9 +83,6 @@ public class ExamTaskController {
     @Autowired
     private ExamTaskPrintService examTaskPrintService;
 
-    @Resource
-    AsyncCreatePdfTempleteService asyncCreatePdfTempleteService;
-
     @Resource
     TaskService taskService;
 
@@ -226,12 +221,12 @@ public class ExamTaskController {
     }
 
     /**
-     * 批量保存
+     * 批量保存命题任务
      *
      * @param task
      * @return
      */
-    @ApiOperation(value = "批量保存")
+    @ApiOperation(value = "批量保存命题任务")
     @RequestMapping(value = "/save_batch", method = RequestMethod.POST)
     public Result saveBatch(@RequestBody ExamTask task) {
         List<ExamTask> examTasks = examTaskService.saveBatch(task);
@@ -596,7 +591,7 @@ public class ExamTaskController {
      */
     @ApiOperation(value = "入库申请-新建命题任务-取消/删除")
     @RequestMapping(value = "/remove_task_apply", method = RequestMethod.POST)
-    public Result removeTaskApply(@RequestParam(value = "examTaskId") Long examTaskId) throws IOException {
+    public Result removeTaskApply(@RequestParam(value = "examTaskId") Long examTaskId) {
         examTaskService.removeByExamTaskId(examTaskId);
         return ResultUtil.ok(true, "");
     }
@@ -620,18 +615,14 @@ public class ExamTaskController {
      * @param printPlanId
      * @param courseCode
      * @param paperNumber
-     * @param pageNumber
-     * @param pageSize
      * @return
      */
     @ApiOperation(value = "卷库查询-发布印刷任务-查看列表")
     @RequestMapping(value = "/list_task_print", method = RequestMethod.POST)
     public Result listTaskPrintStudent(@RequestParam(value = "printPlanId") Long printPlanId,
                                        @RequestParam(value = "courseCode") String courseCode,
-                                       @RequestParam(value = "paperNumber") String paperNumber,
-                                       @RequestParam Integer pageNumber,
-                                       @RequestParam Integer pageSize) {
-        ExamTaskPrintDto examTaskPrintDto = examTaskPrintService.listTaskPrint(printPlanId, courseCode, paperNumber, pageNumber, pageSize);
+                                       @RequestParam(value = "paperNumber") String paperNumber) {
+        ExamTaskPrintDto examTaskPrintDto = examTaskPrintService.listTaskPrint(printPlanId, courseCode, paperNumber);
         return ResultUtil.ok(examTaskPrintDto);
     }
 
@@ -681,11 +672,21 @@ public class ExamTaskController {
      */
     @ApiOperation(value = "卷库查询-发布印刷任务")
     @RequestMapping(value = "/save_task_print", method = RequestMethod.POST)
-    public Result createTaskPrint(@RequestBody ExamTaskPrint examTaskPrint) throws IOException {
-        ExamDetail examDetail = examTaskPrintService.createTaskPrint(examTaskPrint);
-        // 调用生成pdf方法
-        Map<String, Object> map = tbTaskService.saveTask(TaskTypeEnum.CREATE_PDF, examDetail.getPrintPlanId(), (SysUser) ServletUtil.getRequestUser(), examDetail.getId());
-        asyncCreatePdfTempleteService.createPdf(map, null);
+    public Result createTaskPrint(@RequestBody ExamTaskPrint examTaskPrint) {
+        examTaskPrintService.createTaskPrint(examTaskPrint);
+        return ResultUtil.ok(true, "");
+    }
+
+    /**
+     * 提交印刷任务
+     *
+     * @param examTaskPrintParams
+     * @return
+     */
+    @ApiOperation(value = "卷库查询-批量提交印刷任务")
+    @RequestMapping(value = "/submit_task_print", method = RequestMethod.POST)
+    public Result submitTaskPrint(@RequestBody ExamTaskPrintParams examTaskPrintParams) throws IOException {
+        examTaskPrintService.submitTaskPrint(examTaskPrintParams);
         return ResultUtil.ok(true, "");
     }
 
@@ -704,7 +705,7 @@ public class ExamTaskController {
     }
 
     /**
-     * 查看考生
+     * 卷库查询-发布印刷任务-删除
      *
      * @param examTaskPrintId
      * @return
@@ -719,7 +720,6 @@ public class ExamTaskController {
     @ApiOperation(value = "题卡标题查询")
     @RequestMapping(value = "/find_card_title", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
-//    @Aac(auth = BOOL.FALSE)
     public Result findCardTitle(@ApiParam(value = "题卡规则id", required = true) @RequestParam String cardRuleId) {
         return ResultUtil.ok((Object) examTaskService.findCardTitle(SystemConstant.convertIdToLong(cardRuleId)));
     }

+ 15 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/bean/dto/BlurryUserDto.java

@@ -10,6 +10,7 @@ public class BlurryUserDto {
 
     @JsonSerialize(using = ToStringSerializer.class)
     private Long id;
+    private String loginName;
     private String name;
 
     public BlurryUserDto() {
@@ -21,6 +22,12 @@ public class BlurryUserDto {
         this.name = name;
     }
 
+    public BlurryUserDto(Long id, String loginName, String name) {
+        this.id = id;
+        this.loginName = loginName;
+        this.name = name;
+    }
+
     public Long getId() {
         return id;
     }
@@ -29,6 +36,14 @@ public class BlurryUserDto {
         this.id = id;
     }
 
+    public String getLoginName() {
+        return loginName;
+    }
+
+    public void setLoginName(String loginName) {
+        this.loginName = loginName;
+    }
+
     public String getName() {
         return name;
     }

+ 8 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/BasicCourseService.java

@@ -86,4 +86,12 @@ public interface BasicCourseService extends IService<BasicCourse> {
      * @return 结果
      */
     Map<String, Object> executeBasicCourseImportLogic(List<LinkedMultiValueMap<Integer, Object>> finalList, Map<String, Object> map);
+
+    /**
+     *
+     * @param schoolId
+     * @param courseCode
+     * @return
+     */
+    Long getOrgIdBySchoolIdAndCourseCode(Long schoolId, String courseCode);
 }

+ 48 - 33
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/BasicCourseServiceImpl.java

@@ -29,6 +29,7 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.LinkedMultiValueMap;
 
 import javax.annotation.Resource;
+import javax.websocket.RemoteEndpoint;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -53,7 +54,6 @@ public class BasicCourseServiceImpl extends ServiceImpl<BasicCourseMapper, Basic
     private BasicUserCourseService basicUserCourseService;
 
 
-
     @Override
     public List<BasicCourse> listCoursesByUserId(Long userId) {
         return this.baseMapper.listCoursesByUserId(userId);
@@ -97,7 +97,7 @@ public class BasicCourseServiceImpl extends ServiceImpl<BasicCourseMapper, Basic
 
     @Override
     public BasicCourse findByCourseCode(String courseCode) {
-        return this.getOne(new QueryWrapper<BasicCourse>().lambda().eq(BasicCourse::getCode,courseCode));
+        return this.getOne(new QueryWrapper<BasicCourse>().lambda().eq(BasicCourse::getCode, courseCode));
     }
 
     @Transactional(rollbackFor = Exception.class)
@@ -105,8 +105,8 @@ public class BasicCourseServiceImpl extends ServiceImpl<BasicCourseMapper, Basic
     public void createCourse(Long schoolId, String courseCode, String courseName) {
         // 向'basic_course'表新增数据 - 教研分析用
         List<BasicCourse> basicCourseList = this.list(new QueryWrapper<BasicCourse>().lambda()
-                .eq(BasicCourse::getSchoolId,schoolId).eq(BasicCourse::getCode,courseCode));
-        if (basicCourseList.size() > 0){
+                .eq(BasicCourse::getSchoolId, schoolId).eq(BasicCourse::getCode, courseCode));
+        if (basicCourseList.size() > 0) {
             throw ExceptionResultEnum.ERROR.exception("已存在学校id为【" + schoolId + "】,课程编号为【" + courseCode + "】的课程");
         }
         BasicCourse basicCourse = new BasicCourse();
@@ -122,15 +122,15 @@ public class BasicCourseServiceImpl extends ServiceImpl<BasicCourseMapper, Basic
         Long schoolId = SystemConstant.convertIdToLong(ServletUtil.getRequestHeaderSchoolId().toString());
         Set<Long> orgIds = teachcloudCommonService.listSubOrgIds(null);
         courseName = SystemConstant.translateSpecificSign(courseName);
-        return basicCourseMapper.findBasicCoursePage(new Page<>(pageNumber,pageSize),courseName,startCreateTime,endCreateTime,schoolId,orgIds);
+        return basicCourseMapper.findBasicCoursePage(new Page<>(pageNumber, pageSize), courseName, startCreateTime, endCreateTime, schoolId, orgIds);
     }
 
     @Transactional(rollbackFor = Exception.class)
     @Override
-    public Long saveBasicCourse(BasicCourseParams basicCourseParams,SysUser sysUser) {
+    public Long saveBasicCourse(BasicCourseParams basicCourseParams, SysUser sysUser) {
         List<BasicCourseParams> basicCourseParamsList = new ArrayList<>();
         basicCourseParamsList.add(basicCourseParams);
-        BasicCourse editBasicCourse = this.editEntityHelp(basicCourseParamsList,sysUser).get(0);
+        BasicCourse editBasicCourse = this.editEntityHelp(basicCourseParamsList, sysUser).get(0);
         this.saveOrUpdate(editBasicCourse);
         return editBasicCourse.getId();
     }
@@ -138,18 +138,18 @@ public class BasicCourseServiceImpl extends ServiceImpl<BasicCourseMapper, Basic
     @Transactional(rollbackFor = Exception.class)
     @Override
     public Boolean removeBasicCourseBatch(List<Long> idList) {
-        if (idList.size() == 0){
+        if (idList.size() == 0) {
             throw ExceptionResultEnum.ERROR.exception("请选择要删除的目标");
         }
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
-        basicUserCourseService.remove(new QueryWrapper<BasicUserCourse>().lambda().in(BasicUserCourse::getCourseId,idList).eq(BasicUserCourse::getSchoolId,sysUser.getSchoolId()));
+        basicUserCourseService.remove(new QueryWrapper<BasicUserCourse>().lambda().in(BasicUserCourse::getCourseId, idList).eq(BasicUserCourse::getSchoolId, sysUser.getSchoolId()));
 
         UpdateWrapper<BasicCourse> updateWrapper = new UpdateWrapper<>();
         updateWrapper.lambda()
-                .set(BasicCourse::getEnable,false)
-                .in(BasicCourse::getId,idList)
-                .set(BasicCourse::getOrgId,sysUser.getOrgId())
-                .set(BasicCourse::getUpdateId,sysUser.getId());
+                .set(BasicCourse::getEnable, false)
+                .in(BasicCourse::getId, idList)
+                .set(BasicCourse::getOrgId, sysUser.getOrgId())
+                .set(BasicCourse::getUpdateId, sysUser.getId());
 
         return this.update(updateWrapper);
     }
@@ -168,7 +168,7 @@ public class BasicCourseServiceImpl extends ServiceImpl<BasicCourseMapper, Basic
             LinkedMultiValueMap<Integer, Object> excelMap = finalList.get(i);
             List<Object> basicCourseImportDtoList = excelMap.get(i);
             assert basicCourseImportDtoList != null;
-            if (basicCourseImportDtoList.get(0) instanceof DescribeImportDto){
+            if (basicCourseImportDtoList.get(0) instanceof DescribeImportDto) {
                 continue;
             }
             map.put("dataCount", basicCourseImportDtoList.size());
@@ -179,7 +179,7 @@ public class BasicCourseServiceImpl extends ServiceImpl<BasicCourseMapper, Basic
                 String teachingRoomName = basicCourseImportDto.getTeachingRoomName();
                 String clazz = basicCourseImportDto.getClazz();
 
-                SysOrg sysOrg = sysOrgService.getOne(new QueryWrapper<SysOrg>().lambda().eq(SysOrg::getSchoolId, schoolId).eq(SysOrg::getEnable, true).eq(SysOrg::getType, OrgTypeEnum.TEACHING_ROOM).eq(SysOrg::getName,teachingRoomName));
+                SysOrg sysOrg = sysOrgService.getOne(new QueryWrapper<SysOrg>().lambda().eq(SysOrg::getSchoolId, schoolId).eq(SysOrg::getEnable, true).eq(SysOrg::getType, OrgTypeEnum.TEACHING_ROOM).eq(SysOrg::getName, teachingRoomName));
                 if (Objects.isNull(sysOrg)) {
                     throw ExceptionResultEnum.ERROR.exception("输入的教研室【" + teachingRoomName + "】不存在");
                 }
@@ -190,20 +190,35 @@ public class BasicCourseServiceImpl extends ServiceImpl<BasicCourseMapper, Basic
                 basicCourseParams.setCourseName(courseName);
                 basicCourseParams.setTeachingRoomId(teachingRoomId);
                 basicCourseParams.setClazzList(clazzList);
-                BasicCourse old = this.getOne(new QueryWrapper<BasicCourse>().lambda().eq(BasicCourse::getSchoolId,schoolId).eq(BasicCourse::getEnable,true).eq(BasicCourse::getCode,courseCode));
-                if (Objects.nonNull(old)){
+                BasicCourse old = this.getOne(new QueryWrapper<BasicCourse>().lambda().eq(BasicCourse::getSchoolId, schoolId).eq(BasicCourse::getEnable, true).eq(BasicCourse::getCode, courseCode));
+                if (Objects.nonNull(old)) {
                     basicCourseParams.setId(old.getId());
                 }
 
                 addBasicCourseParamsList.add(basicCourseParams);
             }
-            List<BasicCourse> editBasicCourse = this.editEntityHelp(addBasicCourseParamsList,sysUser);
+            List<BasicCourse> editBasicCourse = this.editEntityHelp(addBasicCourseParamsList, sysUser);
             this.saveOrUpdateBatch(editBasicCourse);
         }
         return map;
     }
 
-    private List<BasicCourse> editEntityHelp(List<BasicCourseParams> basicCourseParamsList,SysUser sysUser){
+    @Override
+    public Long getOrgIdBySchoolIdAndCourseCode(Long schoolId, String courseCode) {
+        if (Objects.isNull(schoolId)) {
+            schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
+        }
+        QueryWrapper<BasicCourse> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda().eq(BasicCourse::getSchoolId, schoolId).eq(BasicCourse::getCode, courseCode);
+        BasicCourse basicCourse = this.getOne(queryWrapper);
+        if (Objects.isNull(basicCourse)) {
+            throw ExceptionResultEnum.ERROR.exception("课程不存在");
+        }
+
+        return basicCourse.getTeachingRoomId();
+    }
+
+    private List<BasicCourse> editEntityHelp(List<BasicCourseParams> basicCourseParamsList, SysUser sysUser) {
         Long schoolId = sysUser.getSchoolId();
         List<BasicCourse> basicCourseList = new ArrayList<>();
         for (BasicCourseParams basicCourseParams : basicCourseParamsList) {
@@ -212,25 +227,25 @@ public class BasicCourseServiceImpl extends ServiceImpl<BasicCourseMapper, Basic
             // 校验课程编号
             String courseCode = basicCourseParams.getCourseCode();
             BasicCourse checkCode = this.getOne(new QueryWrapper<BasicCourse>().lambda()
-                    .eq(BasicCourse::getCode,courseCode)
-                    .eq(BasicCourse::getSchoolId,schoolId)
-                    .eq(BasicCourse::getEnable,true));
-            if (Objects.nonNull(checkCode)){
-                if (!checkCode.getId().equals(id)){
-                    throw ExceptionResultEnum.ERROR.exception("课程编号【" + courseCode +"】重复");
+                    .eq(BasicCourse::getCode, courseCode)
+                    .eq(BasicCourse::getSchoolId, schoolId)
+                    .eq(BasicCourse::getEnable, true));
+            if (Objects.nonNull(checkCode)) {
+                if (!checkCode.getId().equals(id)) {
+                    throw ExceptionResultEnum.ERROR.exception("课程编号【" + courseCode + "】重复");
                 }
             }
             // 校验教研室id
             Long teachingRoomId = basicCourseParams.getTeachingRoomId();
             if (Objects.isNull(sysOrgService.getOne(new QueryWrapper<SysOrg>().lambda()
-                    .eq(SysOrg::getId,teachingRoomId)
-                    .eq(SysOrg::getEnable,true)
-                    .eq(SysOrg::getType, OrgTypeEnum.TEACHING_ROOM)))){
+                    .eq(SysOrg::getId, teachingRoomId)
+                    .eq(SysOrg::getEnable, true)
+                    .eq(SysOrg::getType, OrgTypeEnum.TEACHING_ROOM)))) {
                 throw ExceptionResultEnum.ERROR.exception("所选教研室不存在");
             }
             // 校验班级
             List<String> clazzList = basicCourseParams.getClazzList();
-            if (clazzList.size() != clazzList.stream().distinct().count()){
+            if (clazzList.size() != clazzList.stream().distinct().count()) {
                 throw ExceptionResultEnum.ERROR.exception("输入的班级重复");
             }
 
@@ -242,17 +257,17 @@ public class BasicCourseServiceImpl extends ServiceImpl<BasicCourseMapper, Basic
             basicCourse.setTeachingRoomId(teachingRoomId);
             basicCourse.setSchoolId(schoolId);
 
-            if (!SystemConstant.longNotNull(id)){
+            if (!SystemConstant.longNotNull(id)) {
                 // 没有id -》新增
                 id = SystemConstant.getDbUuid();
                 basicCourse.setId(id);
                 basicCourse.setCreateId(sysUser.getId());
                 basicCourse.setEnable(true);
                 orgId = sysUser.getOrgId();
-            }else {
+            } else {
                 // 有id -》 更新
                 BasicCourse old = this.getById(id);
-                if (Objects.isNull(old) || old.getEnable().equals(false)){
+                if (Objects.isNull(old) || old.getEnable().equals(false)) {
                     throw ExceptionResultEnum.ERROR.exception("课程主键不存在或被禁用");
                 }
                 orgId = old.getOrgId();
@@ -262,7 +277,7 @@ public class BasicCourseServiceImpl extends ServiceImpl<BasicCourseMapper, Basic
             basicCourse.setOrgId(orgId);
 
             // 根据课程id和授课班级集合更新'basic_user_course'表
-            basicUserCourseService.updateByCourseIdAndClazzList(id,clazzList,sysUser,orgId);
+            basicUserCourseService.updateByCourseIdAndClazzList(id, clazzList, sysUser, orgId);
 
             basicCourseList.add(basicCourse);
         }

+ 1 - 1
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/SysUserServiceImpl.java

@@ -232,7 +232,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         List<ApproveUserResult> sysUserList = sysUserService.filterFlowPrivilege(schoolId, orgIds, false, null);
         List<BlurryUserDto> blurryUserDtoList = new ArrayList<>();
         for (ApproveUserResult sysUser : sysUserList) {
-            blurryUserDtoList.add(new BlurryUserDto(sysUser.getId(), sysUser.getRealName()));
+            blurryUserDtoList.add(new BlurryUserDto(sysUser.getId(), sysUser.getLoginName(), sysUser.getRealName()));
         }
         return blurryUserDtoList;
     }