浏览代码

3.4.0 update

xiaofei 11 月之前
父节点
当前提交
415860fe8a

+ 14 - 5
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamStudentServiceImpl.java

@@ -19,6 +19,7 @@ import com.qmth.distributed.print.business.mapper.BasicExamStudentMapper;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import com.qmth.teachcloud.common.bean.examRule.CodeNameEnableDisabledValue;
+import com.qmth.teachcloud.common.bean.examRule.CodeNameEnableValue;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.*;
 import com.qmth.teachcloud.common.enums.BasicExamStudentStatusEnum;
@@ -220,7 +221,7 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
                     for (MarkStudent markStudent : markStudentList) {
                         if (markTaskService.countByStudentId(markStudent.getId()) > 0) {
                             BasicCourse basicCourse = basicCourseService.getById(markStudent.getCourseId());
-                            stringJoiner.add("课程代码[" + basicCourse.getCode() + "],学号[" + basicExamStudent.getStudentCode() + "]考生已开始评卷,无法删除");
+                            stringJoiner.add("课程[" + basicCourse.getName() + "(" + basicCourse.getCode() + ")],学号[" + basicExamStudent.getStudentCode() + "]考生已开始评卷,不允许删除");
                         }
                     }
                     if (stringJoiner.toString().length() > 0) {
@@ -288,11 +289,11 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
         }
 
         // 校验试卷编号和卷型
-        if(StringUtils.isNoneBlank(basicExamStudentParam.getPaperNumber(), basicExamStudentParam.getPaperType())){
+        if (StringUtils.isNoneBlank(basicExamStudentParam.getPaperNumber(), basicExamStudentParam.getPaperType())) {
             ExamTaskDetail examTaskDetail = examTaskDetailService.getByExamIdAndCourseIdAndPaperNumber(basicExamStudentParam.getExamId(), basicExamStudentParam.getCourseId(), basicExamStudentParam.getPaperNumber());
-            if(examTaskDetail!= null){
-                if(!examTaskDetail.getPaperType().contains(basicExamStudentParam.getPaperType())){
-                    throw ExceptionResultEnum.ERROR.exception("试卷编号["+basicExamStudentParam.getPaperNumber()+"]的命题任务卷型为["+examTaskDetail.getPaperType()+"],只能从中取一个");
+            if (examTaskDetail != null) {
+                if (!examTaskDetail.getPaperType().contains(basicExamStudentParam.getPaperType())) {
+                    throw ExceptionResultEnum.ERROR.exception("试卷编号[" + basicExamStudentParam.getPaperNumber() + "]的命题任务卷型为[" + examTaskDetail.getPaperType() + "],只能从中取一个");
                 }
             }
         }
@@ -430,9 +431,17 @@ public class BasicExamStudentServiceImpl extends ServiceImpl<BasicExamStudentMap
     @Override
     public void updatePaperNumberAndPaperTypeById(List<ExamStudent> examStudentList) {
         for (ExamStudent examStudent : examStudentList) {
+            BasicExamStudent basicExamStudent = this.getById(examStudent.getBasicStudentId());
+            List<CodeNameEnableValue> requiredFieldList = basicExamStudent.getRequiredFieldList();
+            for (CodeNameEnableValue codeNameEnableValue : requiredFieldList) {
+                if (RequiredFieldsEnum.PAPER_NUMBER.getCode().equals(codeNameEnableValue.getCode())) {
+                    codeNameEnableValue.setValue(examStudent.getPaperNumber());
+                }
+            }
             this.update(new UpdateWrapper<BasicExamStudent>().lambda()
                     .set(BasicExamStudent::getPaperNumber, examStudent.getPaperNumber())
                     .set(BasicExamStudent::getPaperType, examStudent.getPaperType())
+                    .set(BasicExamStudent::getRequiredFields, JSON.toJSONString(requiredFieldList))
                     .eq(BasicExamStudent::getId, examStudent.getBasicStudentId()));
         }
     }

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

@@ -576,7 +576,7 @@ public class ExamCardServiceImpl extends ServiceImpl<ExamCardMapper, ExamCard> i
     @Override
     public ExamCard createJpgImage(ExamCard examCard) {
         BasicCardRule basicCardRule = basicCardRuleService.getById(examCard.getCardRuleId());
-        String replaceBackupCardHtmlContent = createPdfUtil.replaceBackupCardHtmlParam(examCard, null, basicCardRule, null);
+        String replaceBackupCardHtmlContent = createPdfUtil.replaceBackupCardHtmlParam(null,examCard, null, basicCardRule, null);
         File pdfFile = PdfUtil.htmlToPdf(replaceBackupCardHtmlContent);
         try {
             String fileName = PdfUtil.md5FileName("BLANK" + examCard.getId()) + SystemConstant.PDF_PREFIX;

+ 33 - 18
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskWholeServiceImpl.java

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.qmth.boot.api.exception.ApiException;
 import com.qmth.distributed.print.business.entity.ExamDetail;
 import com.qmth.distributed.print.business.entity.ExamTaskWhole;
 import com.qmth.distributed.print.business.enums.ExamTaskWholeStatusEnum;
@@ -23,6 +24,8 @@ import com.qmth.teachcloud.common.enums.UploadFileEnum;
 import com.qmth.teachcloud.common.service.BasicAttachmentService;
 import com.qmth.teachcloud.common.service.FileUploadService;
 import com.qmth.teachcloud.common.util.FileUtil;
+import com.sun.mail.smtp.DigestMD5;
+import org.apache.commons.codec.digest.DigestUtils;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
@@ -36,9 +39,12 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
+import static java.lang.String.valueOf;
+
 @Service
 public class ExamTaskWholeServiceImpl extends ServiceImpl<ExamTaskWholeMapper, ExamTaskWhole> implements ExamTaskWholeService {
 
+    private Map<String, String> map = new HashMap();
     @Resource
     private BasicAttachmentService basicAttachmentService;
     @Resource
@@ -53,26 +59,35 @@ public class ExamTaskWholeServiceImpl extends ServiceImpl<ExamTaskWholeMapper, E
         boolean isAllPrintFinish = examDetailService.allExamDetailIsFinish(examId, courseId, paperNumber);
         ExamTaskWhole examTaskWhole = this.getByExamIdAndCourseIdAndPaperNumber(examId, courseId, paperNumber);
         if (isAllPrintFinish) {
-            if (examTaskWhole != null) {
-                if (examTaskWhole != null && ExamTaskWholeStatusEnum.RUNNING.equals(examTaskWhole.getStatus())) {
-                    throw ExceptionResultEnum.ERROR.exception("文件生成中,请稍后再试");
+            String key = examId + valueOf(courseId) + paperNumber;
+            if(map.containsKey(key)){
+                return;
+            }
+            try {
+                if (examTaskWhole != null) {
+                    if (ExamTaskWholeStatusEnum.RUNNING.equals(examTaskWhole.getStatus())) {
+                        throw ExceptionResultEnum.ERROR.exception("文件生成中,请稍后再试");
+                    }
+                    examTaskWhole.setAttachmentPath(null);
+                    examTaskWhole.setStatus(ExamTaskWholeStatusEnum.INIT);
+                    this.updateById(examTaskWhole);
+                } else {
+                    examTaskWhole = new ExamTaskWhole();
+                    examTaskWhole.setId(SystemConstant.getDbUuid());
+                    examTaskWhole.setExamId(examId);
+                    examTaskWhole.setCourseId(courseId);
+                    examTaskWhole.setPaperNumber(paperNumber);
+                    examTaskWhole.setStatus(ExamTaskWholeStatusEnum.INIT);
+                    examTaskWhole.setCreateTime(System.currentTimeMillis());
+                    this.save(examTaskWhole);
                 }
-                examTaskWhole.setAttachmentPath(null);
-                examTaskWhole.setStatus(ExamTaskWholeStatusEnum.INIT);
-                this.updateById(examTaskWhole);
-            } else {
-                examTaskWhole = new ExamTaskWhole();
-                examTaskWhole.setId(SystemConstant.getDbUuid());
-                examTaskWhole.setExamId(examId);
-                examTaskWhole.setCourseId(courseId);
-                examTaskWhole.setPaperNumber(paperNumber);
-                examTaskWhole.setStatus(ExamTaskWholeStatusEnum.INIT);
-                examTaskWhole.setCreateTime(System.currentTimeMillis());
-                this.save(examTaskWhole);
+                // 开始生成
+                asyncCreateWholePdfTemplateService.createWholePdf(examTaskWhole);
+            } catch (ApiException e) {
+                throw new RuntimeException(e);
+            } finally {
+                map.remove(key);
             }
-            // 开始生成
-            asyncCreateWholePdfTemplateService.createWholePdf(examTaskWhole);
-
         } else {
             this.removeById(examTaskWhole.getId());
             throw ExceptionResultEnum.ERROR.exception("部分考场未生成PDF,无法合并文件");

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

@@ -1139,6 +1139,7 @@ public class ImportLogicServiceImpl implements ImportLogicService {
                 if (courseIdStudentCodeMap.containsKey(studentKey)) {
                     BasicExamStudent student = courseIdStudentCodeMap.get(studentKey);
                     basicExamStudent.setId(student.getId());
+                    basicExamStudent.setPaperType(student.getPaperType());
                     // 更新requiredFields中的任课老师和任课老师工号
                     for (CodeNameEnableValue codeNameEnableValue : student.getRequiredFieldList()) {
                         if (codeNameEnableValue.getCode().equals(RequiredFieldsEnum.TEACHER_CODE.getCode())) {

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

@@ -22,10 +22,12 @@ import com.qmth.teachcloud.common.bean.vo.FilePathVo;
 import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicAttachment;
+import com.qmth.teachcloud.common.entity.BasicCourse;
 import com.qmth.teachcloud.common.entity.BasicExam;
 import com.qmth.teachcloud.common.entity.BasicSchool;
 import com.qmth.teachcloud.common.enums.*;
 import com.qmth.teachcloud.common.service.BasicAttachmentService;
+import com.qmth.teachcloud.common.service.BasicCourseService;
 import com.qmth.teachcloud.common.service.CommonCacheService;
 import com.qmth.teachcloud.common.service.FileUploadService;
 import com.qmth.teachcloud.common.util.FileUtil;
@@ -71,6 +73,8 @@ public class PdfTaskLogicServiceImpl implements PdfTaskLogicService {
     CreatePdfUtil createPdfUtil;
     @Resource
     BasicCardRuleService basicCardRuleService;
+    @Resource
+    private BasicCourseService basicCourseService;
     @Autowired
     ExamDetailCourseService examDetailCourseService;
     @Resource
@@ -226,6 +230,7 @@ public class PdfTaskLogicServiceImpl implements PdfTaskLogicService {
         ExamPrintPlan examPrintPlan = createPdfDto.getExamPrintPlan();
 
         for (ExamDetailCourse examDetailCourse : createPdfDto.getExamDetailCourseList()) {
+            BasicCourse basicCourse = basicCourseService.getById(examDetailCourse.getCourseId());
             String[] paperTypes = examDetailCourse.getPaperType().split(",");
 
             //查询命题任务绑定的试卷和题卡
@@ -323,7 +328,8 @@ public class PdfTaskLogicServiceImpl implements PdfTaskLogicService {
                     examCard = examCardMap.get(s);
                     for (int i = 1; i <= backupCount; i++) {
                         String backupPackageCode = examDetail.getPackageCode() + String.format(SystemConstant.DATE_TIME_FORMAT, i);
-                        String replaceBackupCardHtmlContent = createPdfUtil.replaceBackupCardHtmlParam(examCard, s, basicCardRule, backupPackageCode);
+
+                        String replaceBackupCardHtmlContent = createPdfUtil.replaceBackupCardHtmlParam(basicCourse != null ? basicCourse.getCode() : null, examCard, s, basicCardRule, backupPackageCode);
                         File pdfFile = PdfUtil.htmlToPdf(replaceBackupCardHtmlContent);
                         PdfDto pdfDto = PdfUtil.addPdfPage(pdfFile);
                         FilePathVo filePathVo = fileUploadService.uploadFile(pdfFile, UploadFileEnum.PDF, pdfFile.getName());

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

@@ -21,6 +21,7 @@ import com.qmth.teachcloud.common.bean.vo.PaperInfoVo;
 import com.qmth.teachcloud.common.bean.vo.PrintPathVo;
 import com.qmth.teachcloud.common.contant.SystemConstant;
 import com.qmth.teachcloud.common.entity.BasicAttachment;
+import com.qmth.teachcloud.common.entity.BasicCourse;
 import com.qmth.teachcloud.common.entity.BasicPrintConfig;
 import com.qmth.teachcloud.common.entity.BasicSemester;
 import com.qmth.teachcloud.common.enums.*;
@@ -336,6 +337,7 @@ public class CreatePdfUtil {
     public String replaceBlankHtmlContent(String htmlContent) {
         // 替换条码参数
         htmlContent = htmlContent.replaceAll("<img src=\"data:image/png;base64,\\$\\{examNumber\\}\">", "");
+        htmlContent = htmlContent.replaceAll("<img src=\"data:image/png;base64,\\$\\{courseCodeBarcodeSrc\\}\">", "");
         // 正则匹配所有参数,填入空值
         htmlContent = htmlContent.replaceAll("\\$\\{[A-Za-z0-9]+\\}", "");
         return htmlContent;
@@ -548,6 +550,8 @@ public class CreatePdfUtil {
                 studentHtml = studentHtml.replaceAll("\\$\\{ticketNumberBarcode\\}", "");
                 studentHtml = studentHtml.replaceAll("\\$\\{examNumber\\}", examStudent != null && examStudent.getStudentCode() != null ? GoogleBarCodeUtil.createBarCode(examStudent.getStudentCode(), false) : "");
                 studentHtml = studentHtml.replaceAll("\\$\\{examNumberStr\\}", examStudent != null && examStudent.getStudentCode() != null ? examStudent.getStudentCode() : "");
+                studentHtml = studentHtml.replaceAll("\\$\\{courseCodeBarcodeSrc\\}", examStudent != null && examStudent.getCourseCode() != null ? GoogleBarCodeUtil.createBarCode(examStudent.getCourseCode(), false) : "");
+                studentHtml = studentHtml.replaceAll("\\$\\{courseCodeBarcodeName\\}", examStudent != null && examStudent.getCourseCode() != null ? examStudent.getCourseCode() : "");
                 // 随机生成学生试卷条码并将图片转成base64
                 studentHtml = studentHtml.replaceAll("\\$\\{paperType\\}", examStudent != null && examStudent.getPaperType() != null ? GoogleBarCodeUtil.createBarCode(SystemConstant.convertPaperType(examStudent.getPaperType()), false) : StringUtils.isNotBlank(paperType) ? GoogleBarCodeUtil.createBarCode(SystemConstant.convertPaperType(paperType), false) : "");
                 // 替换考生卷型
@@ -566,6 +570,8 @@ public class CreatePdfUtil {
                     }
                 }
             } else if (ExamNumberStyleEnum.FILL.equals(basicCardRule.getExamNumberStyle())) {
+                studentHtml = studentHtml.replaceAll("\\$\\{courseCodeBarcodeSrc\\}", examStudent != null && examStudent.getCourseCode() != null ? "data:image/png;base64," + GoogleBarCodeUtil.createBarCode(examStudent.getCourseCode(), false) : "");
+                studentHtml = studentHtml.replaceAll("\\$\\{courseCodeBarcodeName\\}", examStudent != null && examStudent.getCourseCode() != null ? examStudent.getCourseCode() : "");
                 String fillFields = basicCardRule.getFillFields();
                 if (StringUtils.isNotBlank(fillFields)) {
                     if (examStudent != null) {
@@ -590,6 +596,8 @@ public class CreatePdfUtil {
             // 替换条码参数
             studentHtml = studentHtml.replaceAll("<img src=\"data:image/png;base64,\\$\\{examNumber\\}\">", "");
             studentHtml = studentHtml.replaceAll("\\$\\{examNumberStr\\}", "");
+            studentHtml = studentHtml.replaceAll("<img src=\"data:image/png;base64,\\$\\{courseCodeBarcodeSrc\\}\">", "");
+            studentHtml = studentHtml.replaceAll("\\$\\{courseCodeBarcodeName\\}", "");
         }
 
         studentHtml = studentHtml.replaceAll("\\$\\{packageCodeDom\\}", "");
@@ -611,12 +619,15 @@ public class CreatePdfUtil {
      * @param basicCardRule     题卡规则
      * @param backupPackageCode 备用题卡条码号
      */
-    public String replaceBackupCardHtmlParam(ExamCard examCard, String paperType, BasicCardRule basicCardRule, String backupPackageCode) {
+    public String replaceBackupCardHtmlParam(String courseCode, ExamCard examCard, String paperType, BasicCardRule basicCardRule, String backupPackageCode) {
         String htmlContent = examCard.getHtmlContent();
         // 替换条码参数
         htmlContent = htmlContent.replaceAll("<img src=\"data:image/png;base64,\\$\\{examNumber\\}\">", "");
         htmlContent = htmlContent.replaceAll("\\$\\{examNumberStr\\}", "");
 
+        htmlContent = htmlContent.replaceAll("\\$\\{courseCodeBarcodeSrc\\}", StringUtils.isNotBlank(courseCode) ? "data:image/png;base64," + GoogleBarCodeUtil.createBarCode(courseCode, false) : "");
+        htmlContent = htmlContent.replaceAll("\\$\\{courseCodeBarcodeName\\}", StringUtils.isNotBlank(courseCode) ? courseCode : "");
+
         //替换卷型参数
         htmlContent = htmlContent.replaceAll("\\$\\{paperTypeName\\}", StringUtils.isBlank(paperType) ? "" : paperType);
         //替换卷型条码(base64)

+ 7 - 0
distributed-print/install/mysql/upgrade/3.4.0.sql

@@ -186,6 +186,13 @@ ALTER TABLE `scan_student_paper`
 
 ALTER TABLE `mark_paper`
     ADD INDEX `index3`(`status` ASC) USING BTREE;
+
+ALTER TABLE `sys_user` ADD COLUMN `allow_course_scan` TINYINT(1) NULL DEFAULT 1 COMMENT '是否允许识别课程条码' AFTER `allow_manual_card`;
+
+ALTER TABLE `exam_student` ADD INDEX `idx_4` (`exam_id` ASC, `paper_number` ASC, `student_code` ASC);
+ALTER TABLE `t_r_exam_student` ADD INDEX `idx_1` (`r_basic_info_id` ASC, `student_code` ASC);
+
+
 -- drop table if exists exam_detail_course_paper_type;
 -- drop table if exists basic_template_org;
 -- drop table if exists cloud_user_push_status;

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

@@ -97,6 +97,7 @@ public class ScanController {
         LoginClientResult loginClientResult = new LoginClientResult(sysUser, loginResult);
         loginClientResult.setRoleList(roles);
         loginClientResult.setCanAddCard(sysUser.getAllowManualCard());
+        loginClientResult.setCanScanCourse(sysUser.getAllowCourseScan());
         return ResultUtil.ok(loginClientResult);
     }
 

+ 9 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/bean/dto/UserDto.java

@@ -22,6 +22,7 @@ public class UserDto {
     private String orgName;
     private String code;
     private Boolean allowManualCard;
+    private Boolean allowCourseScan;
 
     private List<SysRole> roles;
 
@@ -130,4 +131,12 @@ public class UserDto {
     public void setAllowManualCard(Boolean allowManualCard) {
         this.allowManualCard = allowManualCard;
     }
+
+    public Boolean getAllowCourseScan() {
+        return allowCourseScan;
+    }
+
+    public void setAllowCourseScan(Boolean allowCourseScan) {
+        this.allowCourseScan = allowCourseScan;
+    }
 }

+ 10 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/bean/result/LoginClientResult.java

@@ -72,6 +72,8 @@ public class LoginClientResult implements Serializable {
     String version;
     @ApiModelProperty(name = "是否允许新增卡格式")
     private Boolean canAddCard;
+    @ApiModelProperty(name = "是否允许识别课程条码")
+    private Boolean canScanCourse;
 
     public String getReturnUrl() {
         return returnUrl;
@@ -229,6 +231,14 @@ public class LoginClientResult implements Serializable {
         this.canAddCard = canAddCard;
     }
 
+    public Boolean getCanScanCourse() {
+        return canScanCourse;
+    }
+
+    public void setCanScanCourse(Boolean canScanCourse) {
+        this.canScanCourse = canScanCourse;
+    }
+
     public class SchoolNativeBean implements Serializable {
 
         @ApiModelProperty(value = "id")

+ 12 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/entity/SysUser.java

@@ -96,6 +96,10 @@ public class SysUser extends BaseEntity implements Serializable {
      * 是否允许新增卡格式
      */
     private Boolean allowManualCard;
+    /**
+     * 是否允许识别课程条码
+     */
+    private Boolean allowCourseScan;
 
     @TableField(exist = false)
     private String oldPassword;
@@ -236,6 +240,14 @@ public class SysUser extends BaseEntity implements Serializable {
         this.allowManualCard = allowManualCard;
     }
 
+    public Boolean getAllowCourseScan() {
+        return allowCourseScan;
+    }
+
+    public void setAllowCourseScan(Boolean allowCourseScan) {
+        this.allowCourseScan = allowCourseScan;
+    }
+
     public Long[] getRoleIds() {
         return roleIds;
     }

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

@@ -456,7 +456,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
     @Transactional
     public Long saveUserCommon(UserSaveParams userSaveParams, Long requestUserId) {
         SysUserService sysUserService = SpringContextHolder.getBean(SysUserService.class);
-        boolean isSuccess = true;
         Long resultUserId = null;
         try {
             Long schoolId = userSaveParams.getSchoolId();
@@ -515,6 +514,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
                         .set(SysUser::getRealName, sysUser.getRealName())
                         .set(SysUser::getCode, sysUser.getLoginName())
                         .set(SysUser::getAllowManualCard, sysUser.getAllowManualCard())
+                        .set(SysUser::getAllowCourseScan, sysUser.getAllowCourseScan())
                         .set(SysUser::getMobileNumber, sysUser.getMobileNumber())
                         .set(SysUser::getOrgId, sysUser.getOrgId())
                         .set(SysUser::getEnable, dbUser.getEnable())
@@ -552,7 +552,6 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
             }
         } catch (Exception e) {
             log.error(SystemConstant.LOG_ERROR, e);
-            isSuccess = false;
             if (e instanceof DuplicateKeyException) {
                 String errorColumn = e.getCause().toString();
                 String columnStr = errorColumn.substring(errorColumn.lastIndexOf("key") + 3).replaceAll("'", "");

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

@@ -47,7 +47,8 @@
             a.org_id orgId,
             a.code code,
             b.name orgName,
-            a.allow_manual_card allowManualCard
+            a.allow_manual_card allowManualCard,
+            a.allow_course_scan allowCourseScan
         FROM
             sys_user a
                 left join