浏览代码

3.1.0-发布功能bug

xiaof 3 年之前
父节点
当前提交
ccbd731433

+ 10 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/result/analyze/GradeBatchPaperResult.java

@@ -54,6 +54,8 @@ public class GradeBatchPaperResult {
     @ApiModelProperty(value = "分析批次状态")
     @ApiModelProperty(value = "分析批次状态")
     private GradeAnalyzePaperStatusEnum status;
     private GradeAnalyzePaperStatusEnum status;
 
 
+    @ApiModelProperty(value = "发布状态")
+    private Boolean publishStatus;
 
 
     public Long getId() {
     public Long getId() {
         return id;
         return id;
@@ -158,4 +160,12 @@ public class GradeBatchPaperResult {
     public void setStatus(GradeAnalyzePaperStatusEnum status) {
     public void setStatus(GradeAnalyzePaperStatusEnum status) {
         this.status = status;
         this.status = status;
     }
     }
+
+    public Boolean getPublishStatus() {
+        return publishStatus;
+    }
+
+    public void setPublishStatus(Boolean publishStatus) {
+        this.publishStatus = publishStatus;
+    }
 }
 }

+ 3 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/GradeBatchPaperService.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
 import com.qmth.distributed.print.business.bean.params.analyze.GradeBatchPaperParam;
 import com.qmth.distributed.print.business.bean.params.analyze.GradeBatchPaperParam;
 import com.qmth.distributed.print.business.bean.result.analyze.GradeBatchPaperResult;
 import com.qmth.distributed.print.business.bean.result.analyze.GradeBatchPaperResult;
 import com.qmth.distributed.print.business.entity.GradeBatchPaper;
 import com.qmth.distributed.print.business.entity.GradeBatchPaper;
+import com.qmth.teachcloud.common.entity.SysOrg;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.entity.SysUser;
 
 
 import java.util.List;
 import java.util.List;
@@ -71,5 +72,7 @@ public interface GradeBatchPaperService extends IService<GradeBatchPaper> {
      */
      */
     void checkOperateAuth(Long schoolId, String paperNumber, String paperType);
     void checkOperateAuth(Long schoolId, String paperNumber, String paperType);
 
 
+    SysOrg findTeachCollegeByOrgId(Long orgId) ;
+
     GradeBatchPaper findByThirdExamIdAndGradeCourseCode(Long schoolId, String thirdExamId, String gradeCourseCode);
     GradeBatchPaper findByThirdExamIdAndGradeCourseCode(Long schoolId, String thirdExamId, String gradeCourseCode);
 }
 }

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

@@ -112,7 +112,7 @@ public class DataSyncReportServiceImpl implements DataSyncReportService {
                 }
                 }
             }
             }
 
 
-            long batchCount = gradeBatchPaperList.stream().filter(m -> GradeAnalyzePaperStatusEnum.SETTING_GRADE_PAPER_PARAM.equals(m.getStatus())).count();
+            long batchCount = gradeBatchPaperList.stream().filter(m -> m.getEnable() && GradeAnalyzePaperStatusEnum.SETTING_GRADE_PAPER_PARAM.equals(m.getStatus())).count();
             gradeBatch.setStatus(batchCount > 0 ? GradeAnalyzePaperStatusEnum.SETTING_GRADE_PAPER_PARAM : GradeAnalyzePaperStatusEnum.READY_TO_CALCULATE);
             gradeBatch.setStatus(batchCount > 0 ? GradeAnalyzePaperStatusEnum.SETTING_GRADE_PAPER_PARAM : GradeAnalyzePaperStatusEnum.READY_TO_CALCULATE);
 
 
             // 任务结果
             // 任务结果

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

@@ -250,7 +250,8 @@ public class GradeBatchPaperServiceImpl extends ServiceImpl<GradeBatchPaperMappe
      * @param orgId 机构id(课程所在教研室)
      * @param orgId 机构id(课程所在教研室)
      * @return 开课学院
      * @return 开课学院
      */
      */
-    private SysOrg findTeachCollegeByOrgId(Long orgId) {
+    @Override
+    public SysOrg findTeachCollegeByOrgId(Long orgId) {
         if (!SystemConstant.longNotNull(orgId)) {
         if (!SystemConstant.longNotNull(orgId)) {
             throw ExceptionResultEnum.ERROR.exception("机构id不存在");
             throw ExceptionResultEnum.ERROR.exception("机构id不存在");
         }
         }

+ 89 - 11
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/GradeBatchServiceImpl.java

@@ -12,22 +12,27 @@ import com.qmth.distributed.print.business.bean.dto.ExamStudentCourseDto;
 import com.qmth.distributed.print.business.bean.dto.GradeBatchStudentDto;
 import com.qmth.distributed.print.business.bean.dto.GradeBatchStudentDto;
 import com.qmth.distributed.print.business.bean.params.analyze.GradeBatchParam;
 import com.qmth.distributed.print.business.bean.params.analyze.GradeBatchParam;
 import com.qmth.distributed.print.business.bean.result.analyze.GradeBatchResult;
 import com.qmth.distributed.print.business.bean.result.analyze.GradeBatchResult;
+import com.qmth.distributed.print.business.entity.ExamTask;
 import com.qmth.distributed.print.business.entity.GradeBatch;
 import com.qmth.distributed.print.business.entity.GradeBatch;
 import com.qmth.distributed.print.business.entity.GradeBatchPaper;
 import com.qmth.distributed.print.business.entity.GradeBatchPaper;
 import com.qmth.distributed.print.business.entity.GradeBatchStudent;
 import com.qmth.distributed.print.business.entity.GradeBatchStudent;
 import com.qmth.distributed.print.business.mapper.ExamStudentMapper;
 import com.qmth.distributed.print.business.mapper.ExamStudentMapper;
 import com.qmth.distributed.print.business.mapper.GradeBatchMapper;
 import com.qmth.distributed.print.business.mapper.GradeBatchMapper;
+import com.qmth.distributed.print.business.service.ExamTaskService;
 import com.qmth.distributed.print.business.service.GradeBatchPaperService;
 import com.qmth.distributed.print.business.service.GradeBatchPaperService;
 import com.qmth.distributed.print.business.service.GradeBatchService;
 import com.qmth.distributed.print.business.service.GradeBatchService;
 import com.qmth.distributed.print.business.service.GradeBatchStudentService;
 import com.qmth.distributed.print.business.service.GradeBatchStudentService;
 import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SpringContextHolder;
 import com.qmth.teachcloud.common.contant.SpringContextHolder;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.contant.SystemConstant;
+import com.qmth.teachcloud.common.entity.SysOrg;
+import com.qmth.teachcloud.common.entity.SysRole;
 import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.entity.SysUser;
-import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
-import com.qmth.teachcloud.common.enums.GradeAnalyzePaperStatusEnum;
-import com.qmth.teachcloud.common.enums.TaskResultEnum;
-import com.qmth.teachcloud.common.enums.UploadFileEnum;
+import com.qmth.teachcloud.common.entity.SysUserRole;
+import com.qmth.teachcloud.common.enums.*;
+import com.qmth.teachcloud.common.service.SysRoleService;
+import com.qmth.teachcloud.common.service.SysUserRoleService;
+import com.qmth.teachcloud.common.service.SysUserService;
 import com.qmth.teachcloud.common.service.TeachcloudCommonService;
 import com.qmth.teachcloud.common.service.TeachcloudCommonService;
 import com.qmth.teachcloud.common.util.ExcelUtil;
 import com.qmth.teachcloud.common.util.ExcelUtil;
 import com.qmth.teachcloud.common.util.FileStoreUtil;
 import com.qmth.teachcloud.common.util.FileStoreUtil;
@@ -75,13 +80,25 @@ public class GradeBatchServiceImpl extends ServiceImpl<GradeBatchMapper, GradeBa
     @Resource
     @Resource
     TeachcloudCommonService teachcloudCommonService;
     TeachcloudCommonService teachcloudCommonService;
 
 
+    @Resource
+    SysUserService sysUserService;
+
+    @Resource
+    SysRoleService sysRoleService;
+
+    @Resource
+    SysUserRoleService sysUserRoleService;
+
+    @Resource
+    ExamTaskService examTaskService;
+
     @Override
     @Override
     public IPage<GradeBatchResult> gradeBatchPage(String batchName, int pageNumber, int pageSize, SysUser requestUser) {
     public IPage<GradeBatchResult> gradeBatchPage(String batchName, int pageNumber, int pageSize, SysUser requestUser) {
         batchName = SystemConstant.translateSpecificSign(batchName);
         batchName = SystemConstant.translateSpecificSign(batchName);
         IPage<GradeBatchResult> page = this.baseMapper.findGradeBatchPage(new Page<>(pageNumber, pageSize), batchName, requestUser.getSchoolId());
         IPage<GradeBatchResult> page = this.baseMapper.findGradeBatchPage(new Page<>(pageNumber, pageSize), batchName, requestUser.getSchoolId());
         for (GradeBatchResult record : page.getRecords()) {
         for (GradeBatchResult record : page.getRecords()) {
             String txtPath = record.getReportFilePath();
             String txtPath = record.getReportFilePath();
-            if (SystemConstant.strNotNull(txtPath)){
+            if (SystemConstant.strNotNull(txtPath)) {
                 record.setReportFilePath(teachcloudCommonService.filePreview(txtPath));
                 record.setReportFilePath(teachcloudCommonService.filePreview(txtPath));
             }
             }
         }
         }
@@ -96,7 +113,7 @@ public class GradeBatchServiceImpl extends ServiceImpl<GradeBatchMapper, GradeBa
         Long id = gradeBatchParam.getId();
         Long id = gradeBatchParam.getId();
         String batchName = gradeBatchParam.getBatchName();
         String batchName = gradeBatchParam.getBatchName();
         Long batchTime = gradeBatchParam.getBatchTime();
         Long batchTime = gradeBatchParam.getBatchTime();
-        if (!SystemConstant.longNotNull(batchTime)){
+        if (!SystemConstant.longNotNull(batchTime)) {
             batchTime = System.currentTimeMillis();
             batchTime = System.currentTimeMillis();
         }
         }
 
 
@@ -227,6 +244,7 @@ public class GradeBatchServiceImpl extends ServiceImpl<GradeBatchMapper, GradeBa
     @Override
     @Override
     public void uploadFile(Long batchId, MultipartFile file) throws IOException, NoSuchFieldException {
     public void uploadFile(Long batchId, MultipartFile file) throws IOException, NoSuchFieldException {
         List<GradeBatchStudentDto> list = new ArrayList<>();
         List<GradeBatchStudentDto> list = new ArrayList<>();
+        Map<String, String> teacherMap = new HashMap<>();
         List<LinkedMultiValueMap<Integer, Object>> finalList = ExcelUtil.excelReader(file.getInputStream(), Lists.newArrayList(GradeBatchStudentDto.class), (finalExcelList, finalColumnNameList, finalExcelErrorList) -> {
         List<LinkedMultiValueMap<Integer, Object>> finalList = ExcelUtil.excelReader(file.getInputStream(), Lists.newArrayList(GradeBatchStudentDto.class), (finalExcelList, finalColumnNameList, finalExcelErrorList) -> {
             List<ExcelError> excelErrorTemp = new ArrayList<>();
             List<ExcelError> excelErrorTemp = new ArrayList<>();
             // 只允许导入一个sheet
             // 只允许导入一个sheet
@@ -234,7 +252,6 @@ public class GradeBatchServiceImpl extends ServiceImpl<GradeBatchMapper, GradeBa
                 throw ExceptionResultEnum.ERROR.exception("excel中只允许有一个sheet");
                 throw ExceptionResultEnum.ERROR.exception("excel中只允许有一个sheet");
             }
             }
 
 
-            Map<String, String> teacherMap = new HashMap<>();
             for (int i = 0; i < finalExcelList.size(); i++) {
             for (int i = 0; i < finalExcelList.size(); i++) {
                 LinkedMultiValueMap<Integer, Object> excelMap = finalExcelList.get(i);
                 LinkedMultiValueMap<Integer, Object> excelMap = finalExcelList.get(i);
                 List<Object> gradeBatchStudentTempList = excelMap.get(i);
                 List<Object> gradeBatchStudentTempList = excelMap.get(i);
@@ -269,7 +286,7 @@ public class GradeBatchServiceImpl extends ServiceImpl<GradeBatchMapper, GradeBa
                     if (StringUtils.isBlank(teacherNumber)) {
                     if (StringUtils.isBlank(teacherNumber)) {
                         excelErrorTemp.add(new ExcelError(y + 1, "excel第" + (i + 1) + "个sheet第" + (y + 1) + "行[任课老师工号]必填"));
                         excelErrorTemp.add(new ExcelError(y + 1, "excel第" + (i + 1) + "个sheet第" + (y + 1) + "行[任课老师工号]必填"));
                     }
                     }
-                    if(teacherMap.containsKey(teacherNumber) && !teacherName.equals(teacherMap.get(teacherNumber))){
+                    if (teacherMap.containsKey(teacherNumber) && !teacherName.equals(teacherMap.get(teacherNumber))) {
                         excelErrorTemp.add(new ExcelError(y + 1, "excel中同一个任课老师工号有多个姓名"));
                         excelErrorTemp.add(new ExcelError(y + 1, "excel中同一个任课老师工号有多个姓名"));
                     }
                     }
 
 
@@ -290,9 +307,9 @@ public class GradeBatchServiceImpl extends ServiceImpl<GradeBatchMapper, GradeBa
     }
     }
 
 
     @Override
     @Override
-    public void createTxt(GradeBatch gradeBatch,String exception) {
+    public void createTxt(GradeBatch gradeBatch, String exception) {
         final String TXT_PREFIX = ".txt";
         final String TXT_PREFIX = ".txt";
-        if (Objects.isNull(gradeBatch)){
+        if (Objects.isNull(gradeBatch)) {
             throw ExceptionResultEnum.ERROR.exception("批次不存在");
             throw ExceptionResultEnum.ERROR.exception("批次不存在");
         }
         }
         FileStoreUtil fileStoreUtil = SpringContextHolder.getBean(FileStoreUtil.class);
         FileStoreUtil fileStoreUtil = SpringContextHolder.getBean(FileStoreUtil.class);
@@ -301,7 +318,7 @@ public class GradeBatchServiceImpl extends ServiceImpl<GradeBatchMapper, GradeBa
         InputStream inputStream = null;
         InputStream inputStream = null;
         try {
         try {
             // 有异常才创建txt文件
             // 有异常才创建txt文件
-            if (SystemConstant.strNotNull(exception)){
+            if (SystemConstant.strNotNull(exception)) {
                 boolean oss = dictionaryConfig.sysDomain().isOss();
                 boolean oss = dictionaryConfig.sysDomain().isOss();
                 LocalDateTime nowTime = LocalDateTime.now();
                 LocalDateTime nowTime = LocalDateTime.now();
                 StringJoiner stringJoiner = new StringJoiner("");
                 StringJoiner stringJoiner = new StringJoiner("");
@@ -383,5 +400,66 @@ public class GradeBatchServiceImpl extends ServiceImpl<GradeBatchMapper, GradeBa
         }).collect(Collectors.toList());
         }).collect(Collectors.toList());
 
 
         gradeBatchStudentService.saveBatch(gradeBatchStudents);
         gradeBatchStudentService.saveBatch(gradeBatchStudents);
+
+        GradeBatch gradeBatch = this.getById(batchId);
+
+        if (gradeBatch == null) {
+            throw ExceptionResultEnum.SUCCESS.exception("未找到批次信息");
+        }
+        Long schoolId = gradeBatch.getSchoolId();
+
+        QueryWrapper<SysRole> sysRoleQueryWrapper = new QueryWrapper<>();
+        sysRoleQueryWrapper.lambda().eq(SysRole::getType, RoleTypeEnum.TEACHER).eq(SysRole::getEnable, true);
+        List<SysRole> sysRoleList = sysRoleService.list(sysRoleQueryWrapper);
+        if (sysRoleList.isEmpty()) {
+            throw ExceptionResultEnum.SUCCESS.exception("未找到任课老师角色,请联系管理员");
+        }
+        Map<String, List<GradeBatchStudentDto>> listMap = list.stream().collect(Collectors.groupingBy(m -> m.getTeacherNumber() + "##" + m.getTeacherName()));
+        for (Map.Entry<String, List<GradeBatchStudentDto>> entry : listMap.entrySet()) {
+            String[] key = entry.getKey().split("##");
+            List<GradeBatchStudentDto> dtoList = entry.getValue();
+            List<SysUser> sysUserList = sysUserService.findBySchoolIdAndCode(schoolId, key[0]);
+            if (!sysUserList.isEmpty() && sysUserList.size() > 1) {
+                throw ExceptionResultEnum.SUCCESS.exception(key[0] + "找到多条用户记录");
+            }
+
+            List<Long> orgIds = dtoList.stream().map(m -> m.getCourseCode() + "##" + m.getPaperNumber()).distinct().map(m -> {
+                String[] strings = m.split("##");
+                ExamTask examTask = examTaskService.getByCourseCodeAndPaperNumber(schoolId, strings[0], strings[1]);
+                SysOrg sysOrg = gradeBatchPaperService.findTeachCollegeByOrgId(examTask.getTeachingRoomId());
+                return sysOrg.getId();
+            }).distinct().collect(Collectors.toList());
+            if (orgIds.size() != 1) {
+                throw ExceptionResultEnum.SUCCESS.exception("任课老师" + key[0] + "对应课程不能属于不同学院");
+            }
+
+            SysUser sysUser;
+            if (sysUserList.isEmpty()) {
+                //新增
+                sysUser = new SysUser(schoolId, key[0], key[1], null, true);
+                sysUser.setCode(key[0]);
+                sysUser.setOrgId(orgIds.get(0));
+                sysUserService.save(sysUser);
+            } else {
+                //修改
+                sysUser = sysUserList.get(0);
+                sysUser.setRealName(key[1]);
+                sysUser.setEnable(true);
+                sysUser.setOrgId(orgIds.get(0));
+                sysUserService.updateById(sysUser);
+            }
+
+            // 绑定角色
+            List<SysRole> sysUserRoles = sysUserRoleService.listRoleByUserId(sysUser.getId());
+            long count = sysUserRoles.stream().filter(m -> m.getId().longValue() == sysRoleList.get(0).getId().longValue()).count();
+            if (count == 0) {
+                SysUserRole sysUserRole = new SysUserRole();
+                sysUserRole.setId(SystemConstant.getDbUuid());
+                sysUserRole.setUserId(sysUser.getId());
+                sysUserRole.setRoleId(sysRoleList.get(0).getId());
+                sysUserRole.setEnable(true);
+                sysUserRoleService.save(sysUserRole);
+            }
+        }
     }
     }
 }
 }

+ 7 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TBSyncTaskServiceImpl.java

@@ -7,10 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.qmth.distributed.print.business.entity.TBSyncTask;
 import com.qmth.distributed.print.business.entity.TBSyncTask;
 import com.qmth.distributed.print.business.mapper.TBSyncTaskMapper;
 import com.qmth.distributed.print.business.mapper.TBSyncTaskMapper;
-import com.qmth.distributed.print.business.service.ExamPaperStructureService;
-import com.qmth.distributed.print.business.service.ExamPrintPlanService;
-import com.qmth.distributed.print.business.service.GradeBatchService;
-import com.qmth.distributed.print.business.service.TBSyncTaskService;
+import com.qmth.distributed.print.business.service.*;
 import com.qmth.distributed.print.business.templete.execute.AsyncCloudMarkingTaskService;
 import com.qmth.distributed.print.business.templete.execute.AsyncCloudMarkingTaskService;
 import com.qmth.distributed.print.business.templete.execute.AsyncTeachCloudReportService;
 import com.qmth.distributed.print.business.templete.execute.AsyncTeachCloudReportService;
 import com.qmth.teachcloud.common.bean.result.SyncListResult;
 import com.qmth.teachcloud.common.bean.result.SyncListResult;
@@ -55,6 +52,9 @@ public class TBSyncTaskServiceImpl extends ServiceImpl<TBSyncTaskMapper, TBSyncT
     @Resource
     @Resource
     GradeBatchService gradeBatchService;
     GradeBatchService gradeBatchService;
 
 
+    @Resource
+    GradeBatchPaperService gradeBatchPaperService;
+
     @Transactional
     @Transactional
     @Override
     @Override
     public TBSyncTask saveTask(Long schoolId, Long objectId, PushTypeEnum type) {
     public TBSyncTask saveTask(Long schoolId, Long objectId, PushTypeEnum type) {
@@ -153,6 +153,9 @@ public class TBSyncTaskServiceImpl extends ServiceImpl<TBSyncTaskMapper, TBSyncT
             case GRADE_BATCH_PUSH:
             case GRADE_BATCH_PUSH:
                 asyncTeachCloudReportService.syncGradeBatch(gradeBatchService.getById(tbSyncTask.getObjectId()));
                 asyncTeachCloudReportService.syncGradeBatch(gradeBatchService.getById(tbSyncTask.getObjectId()));
                 break;
                 break;
+            case PUBLISH:
+                asyncTeachCloudReportService.publish(gradeBatchPaperService.getById(tbSyncTask.getObjectId()));
+                break;
         }
         }
 
 
 
 

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

@@ -4,7 +4,9 @@ import com.qmth.distributed.print.business.entity.GradeBatch;
 import com.qmth.distributed.print.business.entity.GradeBatchPaper;
 import com.qmth.distributed.print.business.entity.GradeBatchPaper;
 import com.qmth.distributed.print.business.entity.TBSyncTask;
 import com.qmth.distributed.print.business.entity.TBSyncTask;
 import com.qmth.distributed.print.business.service.DataSyncReportService;
 import com.qmth.distributed.print.business.service.DataSyncReportService;
+import com.qmth.distributed.print.business.service.GradeBatchService;
 import com.qmth.distributed.print.business.service.TBSyncTaskService;
 import com.qmth.distributed.print.business.service.TBSyncTaskService;
+import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import com.qmth.teachcloud.common.enums.PushTypeEnum;
 import com.qmth.teachcloud.common.enums.PushTypeEnum;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
@@ -28,6 +30,9 @@ public class AsyncTeachCloudReportService {
     @Resource
     @Resource
     private TBSyncTaskService tbSyncTaskService;
     private TBSyncTaskService tbSyncTaskService;
 
 
+    @Resource
+    private GradeBatchService gradeBatchService;
+
     /**
     /**
      * 同步分析批次
      * 同步分析批次
      *
      *
@@ -47,7 +52,11 @@ public class AsyncTeachCloudReportService {
         dataSyncReportService.startCalc(gradeBatch, tbSyncTask);
         dataSyncReportService.startCalc(gradeBatch, tbSyncTask);
     }
     }
 
 
-    public void publish(GradeBatch gradeBatch, GradeBatchPaper gradeBatchPaper) {
+    public void publish(GradeBatchPaper gradeBatchPaper) {
+        GradeBatch gradeBatch = gradeBatchService.getById(gradeBatchPaper.getBatchId());
+        if(gradeBatch == null){
+            throw ExceptionResultEnum.ERROR.exception("没有批次信息");
+        }
         TBSyncTask tbSyncTask = tbSyncTaskService.saveTask(gradeBatchPaper.getSchoolId(), gradeBatchPaper.getId(), PushTypeEnum.PUBLISH);
         TBSyncTask tbSyncTask = tbSyncTaskService.saveTask(gradeBatchPaper.getSchoolId(), gradeBatchPaper.getId(), PushTypeEnum.PUBLISH);
         dataSyncReportService.publish(gradeBatch, gradeBatchPaper, tbSyncTask);
         dataSyncReportService.publish(gradeBatch, gradeBatchPaper, tbSyncTask);
     }
     }

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

@@ -33,7 +33,8 @@
         gbp.paper_number AS paperNumber,
         gbp.paper_number AS paperNumber,
         gbp.paper_type AS paperType,
         gbp.paper_type AS paperType,
         gbp.paper_name AS paperName,
         gbp.paper_name AS paperName,
-        gbp.status AS status
+        gbp.status AS status,
+        gbp.publish_status AS publishStatus
         FROM
         FROM
         grade_batch_paper gbp
         grade_batch_paper gbp
         LEFT JOIN
         LEFT JOIN

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

@@ -118,11 +118,7 @@ public class GradeBatchPaperController {
         if(gradeBatchPaper == null){
         if(gradeBatchPaper == null){
             throw ExceptionResultEnum.ERROR.exception("没有批次课程信息");
             throw ExceptionResultEnum.ERROR.exception("没有批次课程信息");
         }
         }
-        GradeBatch gradeBatch = gradeBatchService.getById(batchId);
-        if(gradeBatch == null){
-            throw ExceptionResultEnum.ERROR.exception("没有批次信息");
-        }
-        asyncTeachCloudReportService.publish(gradeBatch, gradeBatchPaper);
+        asyncTeachCloudReportService.publish(gradeBatchPaper);
         return ResultUtil.success(true);
         return ResultUtil.success(true);
     }
     }
 }
 }

+ 2 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/SysUserService.java

@@ -274,4 +274,6 @@ public interface SysUserService extends IService<SysUser> {
      * @return
      * @return
      */
      */
     public List<ApproveUserResult> findByRoldIdAndMemberName(Long roleId, String name);
     public List<ApproveUserResult> findByRoldIdAndMemberName(Long roleId, String name);
+
+    List<SysUser> findBySchoolIdAndCode(Long schoolId, String code);
 }
 }

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

@@ -1183,6 +1183,13 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
         return sysUserMapper.findByRoldIdAndMemberName(roleId, name);
         return sysUserMapper.findByRoldIdAndMemberName(roleId, name);
     }
     }
 
 
+    @Override
+    public List<SysUser> findBySchoolIdAndCode(Long schoolId, String code) {
+        QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
+        queryWrapper.lambda().eq(SysUser::getSchoolId, schoolId).eq(SysUser::getCode, code);
+        return sysUserMapper.selectList(queryWrapper);
+    }
+
     /**
     /**
      * 批量处理用户信息帮助类
      * 批量处理用户信息帮助类
      *
      *