Эх сурвалжийг харах

Merge remote-tracking branch 'origin/dev_v3.2.2' into dev_v3.2.2

wangliang 2 жил өмнө
parent
commit
0b68178a3b

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

@@ -1,7 +1,9 @@
 package com.qmth.distributed.print.business.service;
 
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.qmth.distributed.print.business.bean.dto.*;
+import com.qmth.teachcloud.common.bean.dto.SchoolDto;
 
 import javax.servlet.http.HttpServletResponse;
 import java.util.List;
@@ -10,7 +12,7 @@ import java.util.Map;
 public interface ClientService {
     IPage<ClientExamTaskDto> listTryTask(String machineCode, Long orgId, Long printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass, Integer pageNumber, Integer pageSize);
 
-    List<Map<String, String>> getPaperUrl(Long printPlanId, Long examTaskId);
+    List<Map<String, Object>> getPaperUrl(List<JSONObject> objects);
 
     Boolean tagPass(Long printPlanId, String courseCode, String courseName, String paperNumber, String machineCode, Boolean isPass, Long userId);
 
@@ -22,7 +24,7 @@ public interface ClientService {
 
     IPage<ClientPrintTaskDto> listClientPrintTask(String machineCode, Long orgId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate, Integer pageNumber, Integer pageSize);
 
-    Map<String, Object> getPrintData(Long examDetailId, String machineCode, Boolean isPrint, String printUser);
+    List<Map<String, Object>> getPrintData(String examDetailId, String machineCode, Boolean isPrint, String printUser);
 
     List<Map<String, Object>> getPrintDataBatch(String machineCode, Long orgId, String printPlanId, String status, String courseCode, String paperNumber, String examPlace, String examRoom, Long examStartTime, Long examEndTime, Boolean isDownload, Boolean validate);
 
@@ -43,4 +45,8 @@ public interface ClientService {
     ClientPrintStatisticsTotalDto clientStatisticsTotalData(Long orgId, String printPlanId, String examPlace, Long examStartTime, Long examEndTime, String courseCode, String paperNumber);
 
     void checkPrivilege(Long id);
+
+    boolean updatePassword(Long userId, String password);
+
+    List<SchoolDto> listSchool();
 }

+ 207 - 161
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ClientServiceImpl.java

@@ -9,13 +9,13 @@ import com.qmth.distributed.print.business.bean.dto.*;
 import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.enums.ExamDetailStatusEnum;
 import com.qmth.distributed.print.business.service.*;
+import com.qmth.teachcloud.common.bean.dto.SchoolDto;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicAttachment;
 import com.qmth.teachcloud.common.entity.SysPrivilege;
+import com.qmth.teachcloud.common.entity.SysUser;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
-import com.qmth.teachcloud.common.service.BasicAttachmentService;
-import com.qmth.teachcloud.common.service.SysPrivilegeService;
-import com.qmth.teachcloud.common.service.TeachcloudCommonService;
+import com.qmth.teachcloud.common.service.*;
 import com.qmth.teachcloud.common.util.ExcelUtil;
 import com.qmth.teachcloud.common.util.ServletUtil;
 import org.apache.commons.lang3.StringUtils;
@@ -66,7 +66,10 @@ public class ClientServiceImpl implements ClientService {
     SysPrivilegeService sysPrivilegeService;
 
     @Resource
-    BasicExamService basicExamService;
+    SysUserService sysUserService;
+
+    @Resource
+    BasicSchoolService basicSchoolService;
 
     @Override
     public IPage<ClientExamTaskDto> listTryTask(String machineCode, Long orgId, Long printPlanId, String courseCode, String paperNumber, Boolean isTry, Boolean isPass, Integer pageNumber, Integer pageSize) {
@@ -75,9 +78,23 @@ public class ClientServiceImpl implements ClientService {
     }
 
     @Override
-    public List<Map<String, String>> getPaperUrl(Long printPlanId, Long examTaskId) {
+    public List<Map<String, Object>> getPaperUrl(List<JSONObject> objects) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-        return examTaskDetailService.getPaperUrl(schoolId, printPlanId, examTaskId);
+        List<Map<String, Object>> finalList = new ArrayList<>();
+        for (JSONObject object : objects) {
+            Long printPlanId = object.getLong("printPlanId");
+            Long examTaskId = object.getLong("examTaskId");
+            ExamTask examTask = examTaskService.getById(examTaskId);
+            Map<String, Object> map = new HashMap<>();
+            map.put("printPlanId", printPlanId);
+            map.put("courseCode", examTask.getCourseCode());
+            map.put("courseName", examTask.getCourseName());
+            map.put("paperNumber", examTask.getPaperNumber());
+            List<Map<String, String>> mapList = examTaskDetailService.getPaperUrl(schoolId, printPlanId, examTaskId);
+            map.put("list", mapList);
+            finalList.add(map);
+        }
+        return finalList;
     }
 
     @Override
@@ -157,183 +174,193 @@ public class ClientServiceImpl implements ClientService {
 
     @Transactional
     @Override
-    public Map<String, Object> getPrintData(Long examDetailId, String machineCode, Boolean isPrint, String printUser) {
-        ExamDetail examDetail = examDetailService.getById(examDetailId);
-        // 撤回提示
-        if (ExamDetailStatusEnum.NEW.equals(examDetail.getStatus()) || ExamDetailStatusEnum.READY.equals(examDetail.getStatus())) {
-            throw ExceptionResultEnum.ERROR.exception("该任务已被撤回");
-        }
-        if (isPrint && StringUtils.isBlank(printUser)) {
-            throw ExceptionResultEnum.ERROR.exception("打印员不能为空");
-        }
-        if (isPrint && StringUtils.isNotBlank(examDetail.getPrintUser()) && !examDetail.getPrintUser().equals(printUser)) {
-            throw ExceptionResultEnum.ERROR.exception("该任务已被[" + examDetail.getPrintUser() + "]占用");
+    public List<Map<String, Object>> getPrintData(String examDetailIds, String machineCode, Boolean isPrint, String printUser) {
+        String[] strings = examDetailIds.split(",");
+        if (strings.length == 0) {
+            throw ExceptionResultEnum.ERROR.exception("请选择数据");
         }
 
-        // 课程、试卷信息
-        List<Map<String, Object>> examDetailCourses = examDetailCourseService.listByExamDetailId(examDetailId);
+        List<Map<String, Object>> finalList = new ArrayList<>();
+        for (String string : strings) {
+            Long examDetailId = Long.valueOf(string);
+            ExamDetail examDetail = examDetailService.getById(examDetailId);
+            // 撤回提示
+            if (ExamDetailStatusEnum.NEW.equals(examDetail.getStatus()) || ExamDetailStatusEnum.READY.equals(examDetail.getStatus())) {
+                throw ExceptionResultEnum.ERROR.exception("该任务已被撤回");
+            }
+            if (isPrint && StringUtils.isBlank(printUser)) {
+                throw ExceptionResultEnum.ERROR.exception("打印员不能为空");
+            }
+            if (isPrint && StringUtils.isNotBlank(examDetail.getPrintUser()) && !examDetail.getPrintUser().equals(printUser)) {
+                throw ExceptionResultEnum.ERROR.exception("该任务已被[" + examDetail.getPrintUser() + "]占用");
+            }
 
-        Map<String, Object> finalMap = new HashMap<>();
-        ExamPrintPlan examPrintPlan = examPrintPlanService.getById(examDetail.getPrintPlanId());
-        // 2.取生成的完整的pdf
-        String printContent = examPrintPlan.getPrintContent();
-        // 是否包含试卷、题卡
-        if (StringUtils.isNotBlank(printContent)) {
-            // 试卷、题卡map
-            Map<String, Object> detailMap = new HashMap<>();
-            // 备用试卷、备用题卡map
-            Map<String, Object> backupMap = new HashMap<>();
-            // 备份数量
-            int backupCount = examPrintPlan.getBackupCount();
-            if (printContent.contains("PAPER")) {
-                if (examDetail.getAttachmentId() == null) {
-                    throw ExceptionResultEnum.ERROR.exception("考场pdf文件未生成");
-                }
+            // 课程、试卷信息
+            List<Map<String, Object>> examDetailCourses = examDetailCourseService.listByExamDetailId(examDetailId);
+
+            Map<String, Object> finalMap = new HashMap<>();
+            ExamPrintPlan examPrintPlan = examPrintPlanService.getById(examDetail.getPrintPlanId());
+            // 2.取生成的完整的pdf
+            String printContent = examPrintPlan.getPrintContent();
+            // 是否包含试卷、题卡
+            if (StringUtils.isNotBlank(printContent)) {
+                // 试卷、题卡map
+                Map<String, Object> detailMap = new HashMap<>();
+                // 备用试卷、备用题卡map
+                Map<String, Object> backupMap = new HashMap<>();
+                // 备份数量
+                int backupCount = examPrintPlan.getBackupCount();
+                if (printContent.contains("PAPER")) {
+                    if (examDetail.getAttachmentId() == null) {
+                        throw ExceptionResultEnum.ERROR.exception("考场pdf文件未生成");
+                    }
 
-                BasicAttachment attachment = basicAttachmentService.getById(examDetail.getAttachmentId());
-                if (attachment == null) {
-                    throw ExceptionResultEnum.ERROR.exception("考场pdf文件记录异常");
-                }
+                    BasicAttachment attachment = basicAttachmentService.getById(examDetail.getAttachmentId());
+                    if (attachment == null) {
+                        throw ExceptionResultEnum.ERROR.exception("考场pdf文件记录异常");
+                    }
 
-                Map<String, String> totalPathUrl = teachcloudCommonService.filePreviewByAttachmentId(examDetail.getAttachmentId(), false);
-                if (StringUtils.isBlank(totalPathUrl.get("url"))) {
-                    throw ExceptionResultEnum.ERROR.exception("考场pdf文件丢失");
-                }
+                    Map<String, String> totalPathUrl = teachcloudCommonService.filePreviewByAttachmentId(examDetail.getAttachmentId(), false);
+                    if (StringUtils.isBlank(totalPathUrl.get("url"))) {
+                        throw ExceptionResultEnum.ERROR.exception("考场pdf文件丢失");
+                    }
 
-                finalMap.put("paperTotal", totalPathUrl);
-                // 取试卷
-                Map<String, Map<String, String>> map = mapCourseUrl(examDetailCourses);
-                // 生成试卷List
-                detailMap.put("paper", splicePaperContent(examDetailCourses, map, null, null));
-                //试卷
-                List<Map<String, String>> keyMaps = examDetailCourses.stream().map(m -> {
-                    Map<String, String> stringMap = new HashMap<>();
-                    stringMap.put("courseCode", m.get("courseCode").toString());
-                    stringMap.put("courseName", m.get("courseName").toString());
-                    stringMap.put("paperNumber", m.get("paperNumber").toString());
-                    stringMap.put("paperType", m.get("paperType").toString());
-                    return stringMap;
-                }).distinct().collect(Collectors.toList());
-                List<ClientPrintBackupDataDto> paperBackupList = new ArrayList<>();
-                for (Map<String, String> keyMap : keyMaps) {
-                    List<String> paperTypes = Arrays.stream(keyMap.get("paperType").split(",")).sorted(Comparator.comparing(String::valueOf)).collect(Collectors.toList());
-                    for (String paperType : paperTypes) {
-                        for (int i = 0; i < backupCount; i++) {
-                            ClientPrintBackupDataDto clientPrintBackupDataDto = new ClientPrintBackupDataDto();
-                            clientPrintBackupDataDto.setCourseCode(keyMap.get("courseCode"));
-                            clientPrintBackupDataDto.setCourseName(keyMap.get("courseName"));
-                            clientPrintBackupDataDto.setPaperNumber(keyMap.get("paperNumber"));
-                            clientPrintBackupDataDto.setPaperType(paperType);
-                            StringJoiner sj = new StringJoiner(SystemConstant.DELIMITER);
-                            String key = sj.add(keyMap.get("courseCode")).add(keyMap.get("paperNumber")).add(paperType).toString();
-                            clientPrintBackupDataDto.setMd5(map.get(key).get("md5"));
-                            clientPrintBackupDataDto.setUrl(map.get(key).get("url"));
-                            paperBackupList.add(clientPrintBackupDataDto);
+                    finalMap.put("paperTotal", totalPathUrl);
+                    // 取试卷
+                    Map<String, Map<String, String>> map = mapCourseUrl(examDetailCourses);
+                    // 生成试卷List
+                    detailMap.put("paper", splicePaperContent(examDetailCourses, map, null, null));
+                    //试卷
+                    List<Map<String, String>> keyMaps = examDetailCourses.stream().map(m -> {
+                        Map<String, String> stringMap = new HashMap<>();
+                        stringMap.put("courseCode", m.get("courseCode").toString());
+                        stringMap.put("courseName", m.get("courseName").toString());
+                        stringMap.put("paperNumber", m.get("paperNumber").toString());
+                        stringMap.put("paperType", m.get("paperType").toString());
+                        return stringMap;
+                    }).distinct().collect(Collectors.toList());
+                    List<ClientPrintBackupDataDto> paperBackupList = new ArrayList<>();
+                    for (Map<String, String> keyMap : keyMaps) {
+                        List<String> paperTypes = Arrays.stream(keyMap.get("paperType").split(",")).sorted(Comparator.comparing(String::valueOf)).collect(Collectors.toList());
+                        for (String paperType : paperTypes) {
+                            for (int i = 0; i < backupCount; i++) {
+                                ClientPrintBackupDataDto clientPrintBackupDataDto = new ClientPrintBackupDataDto();
+                                clientPrintBackupDataDto.setCourseCode(keyMap.get("courseCode"));
+                                clientPrintBackupDataDto.setCourseName(keyMap.get("courseName"));
+                                clientPrintBackupDataDto.setPaperNumber(keyMap.get("paperNumber"));
+                                clientPrintBackupDataDto.setPaperType(paperType);
+                                StringJoiner sj = new StringJoiner(SystemConstant.DELIMITER);
+                                String key = sj.add(keyMap.get("courseCode")).add(keyMap.get("paperNumber")).add(paperType).toString();
+                                clientPrintBackupDataDto.setMd5(map.get(key).get("md5"));
+                                clientPrintBackupDataDto.setUrl(map.get(key).get("url"));
+                                paperBackupList.add(clientPrintBackupDataDto);
+                            }
                         }
                     }
+                    backupMap.put("paper", paperBackupList);
                 }
-                backupMap.put("paper", paperBackupList);
-
-            }
 
-            if (printContent.contains("CARD")) {
-                Map<String, String> totalCardPathUrl = teachcloudCommonService.filePreviewByAttachmentId(examDetail.getCardAttachmentId(), false);
-                finalMap.put("cardTotal", totalCardPathUrl);
+                if (printContent.contains("CARD")) {
+                    Map<String, String> totalCardPathUrl = teachcloudCommonService.filePreviewByAttachmentId(examDetail.getCardAttachmentId(), false);
+                    finalMap.put("cardTotal", totalCardPathUrl);
 
-                // 生成题卡List
-                detailMap.put("card", spliceCardContent(examDetailCourses, null, null));
+                    // 生成题卡List
+                    detailMap.put("card", spliceCardContent(examDetailCourses, null, null));
 
-                // 备用题卡
-                List<ClientPrintBackupDataDto> cardBackupList = new ArrayList<>();
-                for (Map<String, Object> examDetailCours : examDetailCourses) {
-                    String attachmentIds = examDetailCours.get("cardAttachmentIds").toString();
-                    if (StringUtils.isBlank(attachmentIds)) {
-                        throw ExceptionResultEnum.ERROR.exception("备用题卡未生成");
-                    }
-                    JSONObject jsonObject = JSONObject.parseObject(attachmentIds);
-                    List<Map> backupCards = JSONObject.parseArray(JSONObject.toJSONString(jsonObject.get("card")), Map.class);
-                    for (Map backupCard : backupCards) {
-                        ClientPrintBackupDataDto clientPrintBackupDataDto = new ClientPrintBackupDataDto();
-                        clientPrintBackupDataDto.setCourseCode(examDetailCours.get("courseCode").toString());
-                        clientPrintBackupDataDto.setCourseName(examDetailCours.get("courseName").toString());
-                        clientPrintBackupDataDto.setPaperNumber(examDetailCours.get("paperNumber").toString());
-                        clientPrintBackupDataDto.setPaperType(backupCard.get("name").toString());
-                        Map<String, String> urlMap = teachcloudCommonService.filePreviewByAttachmentId(Long.valueOf(backupCard.get("attachmentId").toString()), false);
-                        clientPrintBackupDataDto.setMd5(urlMap.get("md5"));
-                        clientPrintBackupDataDto.setUrl(urlMap.get("url"));
-                        cardBackupList.add(clientPrintBackupDataDto);
+                    // 备用题卡
+                    List<ClientPrintBackupDataDto> cardBackupList = new ArrayList<>();
+                    for (Map<String, Object> examDetailCours : examDetailCourses) {
+                        String attachmentIds = examDetailCours.get("cardAttachmentIds").toString();
+                        if (StringUtils.isBlank(attachmentIds)) {
+                            throw ExceptionResultEnum.ERROR.exception("备用题卡未生成");
+                        }
+                        JSONObject jsonObject = JSONObject.parseObject(attachmentIds);
+                        List<Map> backupCards = JSONObject.parseArray(JSONObject.toJSONString(jsonObject.get("card")), Map.class);
+                        for (Map backupCard : backupCards) {
+                            ClientPrintBackupDataDto clientPrintBackupDataDto = new ClientPrintBackupDataDto();
+                            clientPrintBackupDataDto.setCourseCode(examDetailCours.get("courseCode").toString());
+                            clientPrintBackupDataDto.setCourseName(examDetailCours.get("courseName").toString());
+                            clientPrintBackupDataDto.setPaperNumber(examDetailCours.get("paperNumber").toString());
+                            clientPrintBackupDataDto.setPaperType(backupCard.get("name").toString());
+                            Map<String, String> urlMap = teachcloudCommonService.filePreviewByAttachmentId(Long.valueOf(backupCard.get("attachmentId").toString()), false);
+                            clientPrintBackupDataDto.setMd5(urlMap.get("md5"));
+                            clientPrintBackupDataDto.setUrl(urlMap.get("url"));
+                            cardBackupList.add(clientPrintBackupDataDto);
+                        }
                     }
+                    backupMap.put("card", cardBackupList);
                 }
-                backupMap.put("card", cardBackupList);
+                detailMap.put("backup", backupMap);
+                finalMap.put("detail", detailMap);
             }
-            detailMap.put("backup", backupMap);
-            finalMap.put("detail", detailMap);
-        }
 
-        //3.5
-        String variableContent = examPrintPlan.getVariableContent();
-        String ordinaryContent = examPrintPlan.getOrdinaryContent();
-        List<Map> variableList = JSONObject.parseArray(variableContent, Map.class);
-        List<Map> otherList = new ArrayList<>();
-        //印品附件信息
-        String attachmentPath = examDetail.getAttachmentPath();
-        if (StringUtils.isNotBlank(attachmentPath)) {
-            JSONObject jsonObject = JSONObject.parseObject(attachmentPath);
-            String pathString = jsonObject.getString("path");
-            List<Map> pathList = JSONObject.parseArray(pathString, Map.class);
-            if (!pathList.isEmpty()) {
-                for (Map contentMap : variableList) {
-                    int count = Integer.parseInt(contentMap.get("backupCount").toString());
-                    for (int i = 0; i < count; i++) {
-                        spliceOtherContent(otherList, pathList, contentMap);
-                    }
-                }
-                List<Map> ordinaryList = JSONObject.parseArray(ordinaryContent, Map.class);
-                for (Map contentMap : ordinaryList) {
-                    int count = Integer.parseInt(contentMap.get("backupCount").toString());
-                    for (int i = 0; i < count; i++) {
-                        spliceOtherContent(otherList, pathList, contentMap);
+            //3.5
+            String variableContent = examPrintPlan.getVariableContent();
+            String ordinaryContent = examPrintPlan.getOrdinaryContent();
+            List<Map> variableList = JSONObject.parseArray(variableContent, Map.class);
+            List<Map> otherList = new ArrayList<>();
+            //印品附件信息
+            String attachmentPath = examDetail.getAttachmentPath();
+            if (StringUtils.isNotBlank(attachmentPath)) {
+                JSONObject jsonObject = JSONObject.parseObject(attachmentPath);
+                String pathString = jsonObject.getString("path");
+                List<Map> pathList = JSONObject.parseArray(pathString, Map.class);
+                if (!pathList.isEmpty()) {
+                    for (Map contentMap : variableList) {
+                        int count = Integer.parseInt(contentMap.get("backupCount").toString());
+                        for (int i = 0; i < count; i++) {
+                            spliceOtherContent(otherList, pathList, contentMap);
+                        }
                     }
+                    List<Map> ordinaryList = JSONObject.parseArray(ordinaryContent, Map.class);
+                    for (Map contentMap : ordinaryList) {
+                        int count = Integer.parseInt(contentMap.get("backupCount").toString());
+                        for (int i = 0; i < count; i++) {
+                            spliceOtherContent(otherList, pathList, contentMap);
+                        }
 
+                    }
                 }
             }
-        }
-        finalMap.put("other", otherList);
+            finalMap.put("other", otherList);
 
-        // 更新印刷中状态,更新曝光卷型、未曝光卷型,打印开始时间
-        if (isPrint) {
-            // 更新exam_detail状态为印刷中
-            UpdateWrapper<ExamDetail> examDetailUpdateWrapper = new UpdateWrapper<>();
-            examDetailUpdateWrapper.lambda().set(ExamDetail::getStatus, ExamDetailStatusEnum.PRINTING).set(ExamDetail::getPrintStartTime, System.currentTimeMillis()).set(ExamDetail::getPrintUser, printUser).eq(ExamDetail::getId, examDetailId);
-            examDetailService.update(examDetailUpdateWrapper);
-
-            // 更新曝光卷型、未曝光卷型
-            for (Map<String, Object> examDetailCours : examDetailCourses) {
-                String examDetailCourseId = examDetailCours.get("examDetailCourseId").toString();
-                // 考生使用卷型
-                List<String> studentPaperTypes = examStudentService.listByExamDetailCourseId(examDetailCourseId);
-                Object exposedPaperType = examDetailCours.get("exposedPaperType");
-                Set<String> exposedPaperSet = Objects.isNull(exposedPaperType) ? new HashSet<>() : new HashSet<>(Arrays.asList(exposedPaperType.toString().split(",")));
-                Object unexposedPaperType = examDetailCours.get("unexposedPaperType");
-                Set<String> unexposedPaperSet = Objects.isNull(unexposedPaperType) ? new HashSet<>() : new HashSet<>(Arrays.asList(unexposedPaperType.toString().split(",")));
-                if (!studentPaperTypes.isEmpty()) {
-                    for (String studentPaperType : studentPaperTypes) {
-                        exposedPaperSet.add(studentPaperType);
-                        unexposedPaperSet.remove(studentPaperType);
+            // 更新印刷中状态,更新曝光卷型、未曝光卷型,打印开始时间
+            if (isPrint) {
+                // 更新exam_detail状态为印刷中
+                UpdateWrapper<ExamDetail> examDetailUpdateWrapper = new UpdateWrapper<>();
+                examDetailUpdateWrapper.lambda().set(ExamDetail::getStatus, ExamDetailStatusEnum.PRINTING).set(ExamDetail::getPrintStartTime, System.currentTimeMillis()).set(ExamDetail::getPrintUser, printUser).eq(ExamDetail::getId, examDetailId);
+                examDetailService.update(examDetailUpdateWrapper);
+
+                // 更新曝光卷型、未曝光卷型
+                for (Map<String, Object> examDetailCours : examDetailCourses) {
+                    String examDetailCourseId = examDetailCours.get("examDetailCourseId").toString();
+                    // 考生使用卷型
+                    List<String> studentPaperTypes = examStudentService.listByExamDetailCourseId(examDetailCourseId);
+                    Object exposedPaperType = examDetailCours.get("exposedPaperType");
+                    Set<String> exposedPaperSet = Objects.isNull(exposedPaperType) ? new HashSet<>() : new HashSet<>(Arrays.asList(exposedPaperType.toString().split(",")));
+                    Object unexposedPaperType = examDetailCours.get("unexposedPaperType");
+                    Set<String> unexposedPaperSet = Objects.isNull(unexposedPaperType) ? new HashSet<>() : new HashSet<>(Arrays.asList(unexposedPaperType.toString().split(",")));
+                    if (!studentPaperTypes.isEmpty()) {
+                        for (String studentPaperType : studentPaperTypes) {
+                            exposedPaperSet.add(studentPaperType);
+                            unexposedPaperSet.remove(studentPaperType);
+                        }
                     }
+                    String examTaskId = examDetailCours.get("examTaskId").toString();
+                    UpdateWrapper<ExamTaskDetail> examTaskDetailUpdateWrapper = new UpdateWrapper<>();
+                    String exposedPaper = String.join(",", exposedPaperSet);
+                    String unexposedPaper = String.join(",", unexposedPaperSet);
+                    examTaskDetailUpdateWrapper.lambda()
+                            .set(ExamTaskDetail::getExposedPaperType, StringUtils.isBlank(exposedPaper) ? null : exposedPaper)
+                            .set(ExamTaskDetail::getUnexposedPaperType, StringUtils.isBlank(unexposedPaper) ? null : unexposedPaper)
+                            .eq(ExamTaskDetail::getExamTaskId, examTaskId);
+                    examTaskDetailService.update(examTaskDetailUpdateWrapper);
                 }
-                String examTaskId = examDetailCours.get("examTaskId").toString();
-                UpdateWrapper<ExamTaskDetail> examTaskDetailUpdateWrapper = new UpdateWrapper<>();
-                String exposedPaper = String.join(",", exposedPaperSet);
-                String unexposedPaper = String.join(",", unexposedPaperSet);
-                examTaskDetailUpdateWrapper.lambda()
-                        .set(ExamTaskDetail::getExposedPaperType, StringUtils.isBlank(exposedPaper) ? null : exposedPaper)
-                        .set(ExamTaskDetail::getUnexposedPaperType, StringUtils.isBlank(unexposedPaper) ? null : unexposedPaper)
-                        .eq(ExamTaskDetail::getExamTaskId, examTaskId);
-                examTaskDetailService.update(examTaskDetailUpdateWrapper);
             }
+            finalMap.put("examDetailId", examDetailId);
+            finalList.add(finalMap);
         }
-        return finalMap;
+        return finalList;
     }
 
     @Override
@@ -355,9 +382,8 @@ public class ClientServiceImpl implements ClientService {
         }
         List<Map<String, Object>> finalList = new ArrayList<>();
         for (ClientPrintTaskDto clientPrintTaskDto : pirntTaskDtoList) {
-            Map<String, Object> map = getPrintData(Long.valueOf(clientPrintTaskDto.getExamDetailId()), null, false, null);
-            map.put("examDetailId", clientPrintTaskDto.getExamDetailId());
-            finalList.add(map);
+            List<Map<String, Object>> list = getPrintData(clientPrintTaskDto.getExamDetailId(), null, false, null);
+            finalList.addAll(list);
         }
         return finalList;
     }
@@ -597,6 +623,26 @@ public class ClientServiceImpl implements ClientService {
         }
     }
 
+    @Override
+    public boolean updatePassword(Long userId, String password) {
+        SysUser sysUser = sysUserService.getById(userId);
+        if (sysUser == null) {
+            throw ExceptionResultEnum.ERROR.exception("用户不存在");
+        }
+        if (StringUtils.isBlank(password)) {
+            throw ExceptionResultEnum.ERROR.exception("请输入新密码");
+        }
+        UpdateWrapper<SysUser> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.lambda().set(SysUser::getPassword, password)
+                .eq(SysUser::getId, userId);
+        return sysUserService.update(updateWrapper);
+    }
+
+    @Override
+    public List<SchoolDto> listSchool() {
+        return basicSchoolService.listSchool();
+    }
+
     /**
      * 根据考场生成试卷map
      */

+ 35 - 7
distributed-print/src/main/java/com/qmth/distributed/print/api/ClientController.java

@@ -1,5 +1,7 @@
 package com.qmth.distributed.print.api;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.qmth.boot.api.annotation.Aac;
@@ -8,6 +10,7 @@ import com.qmth.boot.api.constant.ApiConstant;
 import com.qmth.distributed.print.business.bean.dto.*;
 import com.qmth.distributed.print.business.bean.params.ClientLoginParam;
 import com.qmth.distributed.print.business.service.ClientService;
+import com.qmth.teachcloud.common.bean.dto.SchoolDto;
 import com.qmth.teachcloud.common.bean.result.LoginResult;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicSchool;
@@ -119,13 +122,13 @@ public class ClientController {
     /**
      * 试卷打样-查看/试印/重印
      *
-     * @param examTaskId 命题任务ID
+     * @param data 多任务集合
      */
     @ApiOperation(value = "试卷打样-查看/试印/重印")
     @PostMapping("/paper_try/print")
-    public Result paperTryPrint(@RequestParam("printPlanId") Long printPlanId,
-                                @RequestParam("examTaskId") Long examTaskId) {
-        List<Map<String, String>> list = clientService.getPaperUrl(printPlanId, examTaskId);
+    public Result paperTryPrint(@RequestParam("data") String data) {
+        List<JSONObject> objects = JSON.parseArray(data, JSONObject.class);
+        List<Map<String, Object>> list = clientService.getPaperUrl(objects);
         return ResultUtil.ok(list);
     }
 
@@ -303,12 +306,12 @@ public class ClientController {
      */
     @ApiOperation(value = "印刷管理-印刷/缓存数据")
     @PostMapping("/print/get_print_data")
-    public Result printGetPrintData(@RequestParam("examDetailId") Long examDetailId,
+    public Result printGetPrintData(@RequestParam("examDetailId") String examDetailId,
                                     @RequestParam("machineCode") String machineCode,
                                     @RequestParam("isPrint") Boolean isPrint,
                                     @RequestParam(value = "printUser", required = false) String printUser) {
-        Map<String, Object> map = clientService.getPrintData(examDetailId, machineCode, isPrint, printUser);
-        return ResultUtil.ok(map);
+        List<Map<String, Object>> mapList = clientService.getPrintData(examDetailId, machineCode, isPrint, printUser);
+        return ResultUtil.ok(mapList);
     }
 
     /**
@@ -469,4 +472,29 @@ public class ClientController {
         ClientPrintStatisticsTotalDto statisticsTotalDto = clientService.clientStatisticsTotalData(orgId, printPlanId, examPlace, examStartTime, examEndTime, courseCode, paperNumber);
         return ResultUtil.ok(statisticsTotalDto);
     }
+
+    /**
+     * 学校查询
+     * @return
+     */
+    @ApiOperation(value = "查询")
+    @RequestMapping(value = "/school/list", method = RequestMethod.POST)
+    @Aac(strict = BOOL.FALSE, auth = BOOL.FALSE)
+    public Result list() {
+        List<SchoolDto> list = clientService.listSchool();
+        return ResultUtil.ok(list);
+    }
+
+    /**
+     * 修改密码
+     *
+     * @return
+     */
+    @ApiOperation(value = "修改密码")
+    @RequestMapping(value = "/user/update_password", method = RequestMethod.POST)
+    @Aac(strict = BOOL.FALSE, auth = BOOL.FALSE)
+    public Result updatePassword(@RequestParam Long userId,
+                                 @RequestParam String password) {
+        return ResultUtil.ok(clientService.updatePassword(userId, password));
+    }
 }

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

@@ -93,7 +93,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
                     .collect(Collectors.toList());
             String roleName = role.getName();
             if (defaultRoleNames.contains(roleName)) {
-                throw ExceptionResultEnum.ERROR.exception("自定义角色名称不能和系统默认角色【" + roleName + "】同名");
+                throw ExceptionResultEnum.ERROR.exception("角色名称不能和系统默认角色【" + roleName + "】同名");
             }
             if (Objects.nonNull(role.getId())) {//编辑
                 List<SysRolePrivilege> sysRolePrivilegeList = commonCacheService.rolePrivilegeCache(role.getId());

+ 2 - 2
teachcloud-common/src/main/resources/mapper/SysRoleMapper.xml

@@ -50,7 +50,7 @@
         </where>
         union
         <include refid="Base_Column_List" /> join t_school_role tsr on tsr.role_id = t.id
-        where t.default_role = 1 and t.type <![CDATA[ <> ]]> 'ADMIN'
+        where t.default_role = 1 and (t.type <![CDATA[ <> ]]> 'ADMIN' or t.type is null)
             <if test="schoolId != null and schoolId != ''">
                 and tsr.school_id = #{schoolId}
             </if>
@@ -74,7 +74,7 @@
         </where>
         union
         <include refid="Base_Column_List" /> join t_school_role tsr on tsr.role_id = t.id
-        where t.default_role = 1 and t.type <![CDATA[ <> ]]> 'ADMIN'
+        where t.default_role = 1 and (t.type <![CDATA[ <> ]]> 'ADMIN' or t.type is null)
         <if test="schoolId != null and schoolId != ''">
             and tsr.school_id = #{schoolId}
         </if>