소스 검색

Merge branch 'dev_v3.2.0' of http://git.qmth.com.cn/wangliang/distributed-print-service into dev_v3.2.0

 Conflicts:
	distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/PrintCommonServiceImpl.java
xiaof 2 년 전
부모
커밋
3ac68a6826

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

@@ -18,6 +18,7 @@ import com.qmth.distributed.print.business.entity.*;
 import com.qmth.distributed.print.business.enums.ExamDataSourceEnum;
 import com.qmth.distributed.print.business.enums.ExamDetailStatusEnum;
 import com.qmth.distributed.print.business.enums.PrintPlanStatusEnum;
+import com.qmth.distributed.print.business.enums.StudentClazzEnum;
 import com.qmth.distributed.print.business.mapper.ExamDetailMapper;
 import com.qmth.distributed.print.business.service.*;
 import com.qmth.distributed.print.business.templete.execute.AsyncCreatePdfTempleteService;
@@ -654,6 +655,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
             examStudent.setCollegeName(collegeName);
             examStudent.setMajorName(majorName);
             examStudent.setClazzName(clazzName);
+            examStudent.setStudentClazzType(StudentClazzEnum.TEACH_CLAZZ);
             examStudent.setCreateId(userId);
             examStudent.setUpdateId(userId);
             examStudentList.add(examStudent);

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

@@ -363,7 +363,7 @@ public class ExamPaperStructureServiceImpl extends ServiceImpl<ExamPaperStructur
 //                .eq(ExamTaskDetail::getExamTaskId, examTaskId)).getCardId();
         ExamTaskDetail examTaskDetail = examTaskDetailService.getOne(new QueryWrapper<ExamTaskDetail>().lambda()
                 .eq(ExamTaskDetail::getExamTaskId, examTaskId));
-        List<CardJpgResult> cardJpgResultList = null;
+        List<CardJpgResult> cardJpgResultList = new ArrayList<>();
         if (Objects.nonNull(examTaskDetail) && Objects.nonNull(examTaskDetail.getPaperAttachmentIds())) {
             JSONArray jsonArrayPaper = JSONArray.parseArray(examTaskDetail.getPaperAttachmentIds());
             for (int i = 0; i < jsonArrayPaper.size(); i++) {

+ 8 - 5
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/PrintCommonServiceImpl.java

@@ -28,6 +28,7 @@ import com.qmth.distributed.print.business.util.HtmlToPdfUtil;
 import com.qmth.distributed.print.business.util.PdfUtil;
 import com.qmth.teachcloud.common.bean.dto.MqDto;
 import com.qmth.teachcloud.common.bean.params.ArraysParams;
+import com.qmth.teachcloud.common.bean.result.BasicStudentResult;
 import com.qmth.teachcloud.common.config.DictionaryConfig;
 import com.qmth.teachcloud.common.contant.SpringContextHolder;
 import com.qmth.teachcloud.common.contant.SystemConstant;
@@ -1193,11 +1194,11 @@ public class PrintCommonServiceImpl implements PrintCommonService {
             Long basicClazzId = student.getBasicClazzId();
             StudentClazzEnum studentClazzType = student.getStudentClazzType();
 
-            BasicStudent basicStudent = basicStudentService.getById(studentId);
-            if (Objects.isNull(basicStudent)) {
+            BasicStudentResult basicStudentResult = basicStudentService.findById(studentId);
+            if (Objects.isNull(basicStudentResult)){
                 throw ExceptionResultEnum.ERROR.exception("未找到基础学生信息");
             }
-            if (!Objects.equals(basicStudent.getClazzId(), basicClazzId)) {
+            if (!Objects.equals(basicStudentResult.getClazzId(), basicClazzId)){
                 throw ExceptionResultEnum.ERROR.exception("行政班数据不一致");
             }
             BasicClazz basicClazz = null;
@@ -1221,8 +1222,10 @@ public class PrintCommonServiceImpl implements PrintCommonService {
             examStudent.setId(SystemConstant.getDbUuid());
             examStudent.setOrgId(sysUser.getOrgId());
             examStudent.setExamDetailCourseId(examDetailCourseId);
-            examStudent.setStudentName(basicStudent.getStudentName());
-            examStudent.setStudentCode(basicStudent.getStudentCode());
+            examStudent.setStudentName(basicStudentResult.getStudentName());
+            examStudent.setStudentCode(basicStudentResult.getStudentCode());
+            examStudent.setCollegeName(basicStudentResult.getCollegeName());
+            examStudent.setMajorName(basicStudentResult.getMajorName());
             examStudent.setTicketNumber(createTempNumber(ticketNumberParams));
             examStudent.setSiteNumber(String.valueOf(atomicInteger.getAndIncrement()));
             examStudent.setExtendFields(extendFields);

+ 1 - 1
distributed-print-business/src/main/resources/db/2、init-table-data.sql

@@ -693,7 +693,7 @@ INSERT INTO `sys_privilege` VALUES (756, '入库审核-查询已审核数量', '
 INSERT INTO `sys_privilege` VALUES (757, '组织架构-批量导入(异步)', '/api/admin/sys/org/import', 'URL', 4, 5, 'AUTH', NULL, 1, 1, 1);
 INSERT INTO `sys_privilege` VALUES (758, '组织架构-批量导入', 'Import', 'BUTTON', 4, 4, 'AUTH', '757', 1, 0, 1);
 INSERT INTO `sys_privilege` VALUES (759, '入库申请-考生对象查询', '/api/admin/exam/task/find_exam_task_student_object', 'URL', 40, 9, 'AUTH', NULL, 1, 1, 1);
-INSERT INTO `sys_privilege` VALUES (760, '入库申请-增加考试对象', 'ExamTaslStudentObject', 'BUTTON', 40, 9, 'AUTH', '759', 1, 0, 1);
+INSERT INTO `sys_privilege` VALUES (760, '入库申请-增加考试对象', 'ExamTaskStudentObject', 'BUTTON', 40, 9, 'AUTH', '759', 1, 0, 1);
 
 INSERT INTO `sys_user` VALUES (1, NULL, 'sysadmin', 'sysadmin', NULL, 'MTIzNDU2', NULL, NULL, 1, 1, 1629353956868, NULL, NULL, NULL, NULL, 1629353956881, NULL);
 

+ 29 - 23
distributed-print-business/src/main/resources/mapper/ExamPaperStructureMapper.xml

@@ -18,7 +18,7 @@
             edc.course_name courseName,
             et.sequence,
             eps.paper_info_json paperInfoJson,
-            edc.paper_type paperType,
+            es.paper_type paperType,
             IFNULL(eps.status, 'INIT') status,
             eps.paper_answer paperAnswer,
             et.user_id propositionTeacherId,
@@ -26,20 +26,26 @@
         FROM
             exam_print_plan epp
                 LEFT JOIN
-            basic_exam be on epp.exam_id = be.id
+            basic_exam be ON epp.exam_id = be.id
                 LEFT JOIN
             basic_semester bs ON be.semester_id = bs.id
                 LEFT JOIN
             (SELECT DISTINCT
-                a.print_plan_id,
-                    a.school_id,
-                    b.paper_number,
-                    b.course_code,
-                    b.course_name,
-                    b.paper_type
-            FROM
-                exam_detail a
-            LEFT JOIN exam_detail_course b ON a.id = b.exam_detail_id) edc ON epp.id = edc.print_plan_id
+                 a.print_plan_id,
+                 a.school_id,
+                 b.paper_number,
+                 b.course_code,
+                 b.course_name,
+                 b.id AS exam_detail_course_id
+             FROM
+                 exam_detail a
+                     LEFT JOIN exam_detail_course b ON a.id = b.exam_detail_id) edc ON epp.id = edc.print_plan_id
+                LEFT JOIN
+            (SELECT
+                 exam_detail_course_id, paper_type
+             FROM
+                 exam_student
+             GROUP BY exam_detail_course_id , paper_type) es ON es.exam_detail_course_id = edc.exam_detail_course_id
                 LEFT JOIN
             exam_task et ON edc.school_id = et.school_id
                 AND et.exam_id = epp.exam_id
@@ -53,17 +59,17 @@
             epp.school_id = #{schoolId}
             and et.user_id = #{propositionTeacherId}
             and epp.sync_status = #{syncStatus}
-            <if test="semesterId != null and semesterId != ''">
-                and bs.id = #{semesterId}
-            </if>
-            <if test="examId != null and examId != ''">
-                and be.id = #{examId}
-            </if>
-            <if test="structureStatusEnums != null and structureStatusEnums != ''">
-                AND ifnull(eps.status, 'INIT') NOT IN
-                <foreach collection="structureStatusEnums" item="item" index="index" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
+        <if test="semesterId != null and semesterId != ''">
+            and bs.id = #{semesterId}
+        </if>
+        <if test="examId != null and examId != ''">
+            and be.id = #{examId}
+        </if>
+        <if test="structureStatusEnums != null and structureStatusEnums != ''">
+            AND ifnull(eps.status, 'INIT') NOT IN
+            <foreach collection="structureStatusEnums" item="item" index="index" open="(" separator="," close=")">
+                #{item}
+            </foreach>
+        </if>
     </select>
 </mapper>

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

@@ -25,10 +25,10 @@
     </sql>
     <insert id="insertBatch">
         insert into exam_student (id, school_id, org_id, exam_detail_course_id, student_name, student_code,
-        ticket_number, site_number, extend_fields, clazz_id, clazz_name, teach_clazz_id, teach_clazz_name, student_clazz_type, campus_name, create_id) values
+        ticket_number, site_number, extend_fields, college_name, major_name, clazz_id, clazz_name, teach_clazz_id, teach_clazz_name, student_clazz_type, campus_name, create_id) values
         <foreach collection="examStudents" separator="," item="item">
             (#{item.id}, #{item.schoolId}, #{item.orgId}, #{item.examDetailCourseId}, #{item.studentName},
-            #{item.studentCode}, #{item.ticketNumber}, #{item.siteNumber}, #{item.extendFields}, #{item.clazzId},
+            #{item.studentCode}, #{item.ticketNumber}, #{item.siteNumber}, #{item.extendFields}, #{item.collegeName}, #{item.majorName}, #{item.clazzId},
             #{item.clazzName},#{item.teachClazzId},#{item.teachClazzName},#{item.studentClazzType},#{item.campusName}, #{item.createId})
         </foreach>
     </insert>

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

@@ -142,17 +142,15 @@ public class MenuCustomController {
         SysConfig sysConfig = commonCacheService.addSysConfigCache(tSchoolPrivilegeParam.getSchoolId(), SystemConstant.PDF_SIZE_LIST);
         if (Objects.isNull(sysConfig)) {
             sysConfig = new SysConfig(tSchoolPrivilegeParam.getSchoolId(), SystemConstant.PDF_SIZE_LIST, "pdf格式清单", Arrays.asList(tSchoolPrivilegeParam.getPdfSize()).toString());
-            commonCacheService.updateSysConfigCache(tSchoolPrivilegeParam.getSchoolId(), SystemConstant.PDF_SIZE_LIST);
         } else {
             if (Objects.nonNull(tSchoolPrivilegeParam.getPdfSize()) && tSchoolPrivilegeParam.getPdfSize().length > 0) {
                 sysConfig.setConfigValue(Arrays.asList(tSchoolPrivilegeParam.getPdfSize()).toString());
-                commonCacheService.updateSysConfigCache(tSchoolPrivilegeParam.getSchoolId(), SystemConstant.PDF_SIZE_LIST);
             } else {
                 sysConfig.setConfigValue(null);
-                commonCacheService.removeSysConfigCache(tSchoolPrivilegeParam.getSchoolId(), SystemConstant.PDF_SIZE_LIST);
             }
         }
         sysConfigService.saveOrUpdate(sysConfig);
+        commonCacheService.removeSysConfigCache(tSchoolPrivilegeParam.getSchoolId(), SystemConstant.PDF_SIZE_LIST);
         return ResultUtil.ok(true);
     }
 

+ 4 - 4
teachcloud-common/src/main/java/com/qmth/teachcloud/common/service/impl/CommonCacheServiceImpl.java

@@ -579,7 +579,7 @@ public class CommonCacheServiceImpl implements CommonCacheService {
      * @return
      */
     @Override
-    @Cacheable(value = SystemConstant.SYS_CONFIG_CACHE, key = "#p0")
+    @Cacheable(value = SystemConstant.SYS_CONFIG_CACHE, key = "#p0", unless = "#result == null")
     public SysConfig addSysConfigCache(String key) {
         return sysConfigService.getOne(new QueryWrapper<SysConfig>().lambda().eq(SysConfig::getConfigKey, key));
     }
@@ -591,7 +591,7 @@ public class CommonCacheServiceImpl implements CommonCacheService {
      * @return
      */
     @Override
-    @CachePut(value = SystemConstant.SYS_CONFIG_CACHE, key = "#p0", condition = "#result != null")
+    @CachePut(value = SystemConstant.SYS_CONFIG_CACHE, key = "#p0", unless = "#result == null")
     public SysConfig updateSysConfigCache(String key) {
         return sysConfigService.getById(new QueryWrapper<SysConfig>().lambda().eq(SysConfig::getConfigKey, key));
     }
@@ -615,7 +615,7 @@ public class CommonCacheServiceImpl implements CommonCacheService {
      * @return
      */
     @Override
-    @Cacheable(value = SystemConstant.SYS_CONFIG_CACHE, key = "#p0 + '-' + #p1")
+    @Cacheable(value = SystemConstant.SYS_CONFIG_CACHE, key = "#p0 + '-' + #p1", unless = "#result == null")
     public SysConfig addSysConfigCache(Long schoolId, String key) {
         return sysConfigService.getOne(new QueryWrapper<SysConfig>().lambda().eq(SysConfig::getSchoolId, schoolId).eq(SysConfig::getConfigKey, key));
     }
@@ -628,7 +628,7 @@ public class CommonCacheServiceImpl implements CommonCacheService {
      * @return
      */
     @Override
-    @CachePut(value = SystemConstant.SYS_CONFIG_CACHE, key = "#p0 + '-' + #p1", condition = "#result != null")
+    @CachePut(value = SystemConstant.SYS_CONFIG_CACHE, key = "#p0 + '-' + #p1", unless = "#result != null")
     public SysConfig updateSysConfigCache(Long schoolId, String key) {
         return sysConfigService.getOne(new QueryWrapper<SysConfig>().lambda().eq(SysConfig::getSchoolId, schoolId).eq(SysConfig::getConfigKey, key));
     }