xiaofei 1 gadu atpakaļ
vecāks
revīzija
76a6ee7331

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

@@ -63,6 +63,7 @@
             AND a.type = #{type}
             AND a.card_rule_id = #{cardRuleId}
             AND a.create_time >= 1680624000000
+            AND a.enable = true
         order by a.create_time desc
     </select>
     <select id="listPage" resultMap="BaseResultMap">

+ 14 - 8
distributed-print-business/src/main/resources/mapper/ExamDetailMapper.xml

@@ -50,7 +50,8 @@
                  a.*
              FROM
                  exam_detail a
-                     LEFT JOIN basic_exam b ON a.exam_id = b.id
+                     LEFT JOIN exam_print_plan epp ON a.print_plan_id = epp.id
+                     LEFT JOIN basic_exam b ON epp.exam_id = b.id
                 <where>
                     <if test="schoolId != null">
                         and a.school_id = #{schoolId}
@@ -59,7 +60,7 @@
                         and b.semester_id = #{semesterId}
                     </if>
                     <if test="examId != null">
-                        and a.exam_id = #{examId}
+                        and epp.exam_id = #{examId}
                     </if>
                     <if test="printPlanId != null">
                         and a.print_plan_id = #{printPlanId}
@@ -102,9 +103,10 @@
                              1
                          FROM
                              exam_detail ed
+                                LEFT JOIN exam_print_plan epp ON ed.print_plan_id = epp.id
                          WHERE
                              edc.exam_detail_id = ed.id
-                           AND ed.exam_id = #{examId})
+                           AND epp.exam_id = #{examId})
              GROUP BY exam_detail_id) c ON ed.id = c.exam_detail_id
                 LEFT JOIN
             exam_print_plan epp ON ed.print_plan_id = epp.id
@@ -123,10 +125,11 @@
                                          1
                                      FROM
                                          exam_detail ed
+                                            LEFT JOIN exam_print_plan epp ON ed.print_plan_id = epp.id
                                      WHERE
                                          edc.exam_detail_id = ed.id
-                                       AND ed.exam_id = #{examId})) edc
-                            JOIN
+                                       AND epp.exam_id = #{examId})) edc
+                           LEFT JOIN
                         (SELECT
                              *
                          FROM
@@ -426,7 +429,8 @@
                  a.*
              FROM
                  exam_detail a
-                     LEFT JOIN basic_exam b ON a.exam_id = b.id
+                    LEFT JOIN exam_print_plan epp ON a.print_plan_id = epp.id
+                     LEFT JOIN basic_exam b ON epp.exam_id = b.id
                     <where>
                         <if test="schoolId != null">
                             and a.school_id = #{schoolId}
@@ -435,7 +439,7 @@
                             and b.semester_id = #{semesterId}
                         </if>
                         <if test="examId != null">
-                            and a.exam_id = #{examId}
+                            and epp.exam_id = #{examId}
                         </if>
                         <if test="printPlanId != null">
                             and a.print_plan_id = #{printPlanId}
@@ -479,9 +483,10 @@
                                          1
                                      FROM
                                          exam_detail ed
+                                            LEFT JOIN exam_print_plan epp ON ed.print_plan_id = epp.id
                                      WHERE
                                          edc.exam_detail_id = ed.id
-                                       AND ed.exam_id = #{examId})) edc
+                                       AND epp.exam_id = #{examId})) edc
                             JOIN
                         (SELECT
                              *
@@ -490,6 +495,7 @@
                          WHERE
                              exam_id = #{examId}) et ON edc.course_code = et.course_code
                             AND edc.paper_number = et.paper_number
+                            left join sys_user su ON et.user_id = su.id
                     WHERE
                         ed.id = edc.exam_detail_id
                         <if test="courseCode != null and courseCode != ''">

+ 3 - 0
distributed-print-business/src/main/resources/mapper/TCUsualScoreMapper.xml

@@ -29,6 +29,9 @@
                 <if test="dpr.requestUserId != null">
                     AND tc.user_id = #{dpr.requestUserId}
                 </if>
+                <if test="dpr.courseUserId != null">
+                    AND tc.user_id = #{dpr.courseUserId}
+                </if>
                 <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
                     AND su.org_id IN
                     <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">

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

@@ -97,7 +97,7 @@ public class BasicCardRuleController {
      */
     @ApiOperation(value = "新增/修改")
     @RequestMapping(value = "/save", method = RequestMethod.POST)
-    @OperationLogDetail(operationType = OperationTypeEnum.SAVE)
+    @OperationLogDetail(operationType = OperationTypeEnum.SAVE, detail = "新增/修改操作,题卡规则ID:{{cardRule.id}}、题卡规则名称:{{cardRule.name}}")
     public Result save(@RequestBody BasicCardRule cardRule) {
         return ResultUtil.ok(basicCardRuleService.saveCardRule(cardRule));
     }
@@ -110,7 +110,7 @@ public class BasicCardRuleController {
      */
     @ApiOperation(value = "删除")
     @RequestMapping(value = "/delete", method = RequestMethod.POST)
-    @OperationLogDetail(operationType = OperationTypeEnum.DELETE)
+    @OperationLogDetail(operationType = OperationTypeEnum.DELETE, detail = "删除操作,题卡规则ID:{{cardRule.id}}")
     public Result delete(@RequestBody BasicCardRule cardRule) {
         return ResultUtil.ok(basicCardRuleService.delete(cardRule));
     }
@@ -120,7 +120,7 @@ public class BasicCardRuleController {
      */
     @ApiOperation(value = "启用/禁用")
     @RequestMapping(value = "/enable", method = RequestMethod.POST)
-    @OperationLogDetail(operationType = OperationTypeEnum.UPDATE)
+    @OperationLogDetail(operationType = OperationTypeEnum.ENABLE, detail = "启用/禁用操作,题卡规则ID:{{basicCardRule.id}}、启用/状态:{{basicCardRule.enable}}")
     public Result enable(@RequestBody BasicCardRule basicCardRule) {
         return ResultUtil.ok(basicCardRuleService.enable(basicCardRule.getId(), basicCardRule.getEnable()));
     }

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

@@ -103,7 +103,7 @@ public class SysRoleController {
      */
     @ApiOperation(value = "启用/禁用")
     @RequestMapping(value = "/enable", method = RequestMethod.POST)
-    @OperationLogDetail(operationType = OperationTypeEnum.UPDATE, detail = "启用/禁用操作,角色ID:{{role.id}}、启用/状态:{{role.enable}}")
+    @OperationLogDetail(operationType = OperationTypeEnum.ENABLE, detail = "启用/禁用操作,角色ID:{{role.id}}、启用/状态:{{role.enable}}")
     public Result enable(@RequestBody SysRole role) throws NoSuchAlgorithmException {
         return ResultUtil.ok(sysRoleService.enableReport(role));
     }

+ 3 - 3
teachcloud-common/src/main/java/com/qmth/teachcloud/common/aspect/LogAspect.java

@@ -234,7 +234,7 @@ public class LogAspect {
                                         field.setAccessible(true);
                                         obj = field.get(v);
                                     }
-                                    detail = detail.replace("{{" + s + "}}", JSON.toJSONString(obj));
+                                    detail = detail.replace("{{" + s + "}}", JSON.toJSONString(obj == null ? "" : obj));
                                 }
                             } else if (fs.length == 3) {
                                 if (k.equals(fs[0])) {
@@ -255,12 +255,12 @@ public class LogAspect {
                                             }
                                         }
                                     }
-                                    detail = detail.replace("{{" + s + "}}", JSON.toJSONString(obj));
+                                    detail = detail.replace("{{" + s + "}}", JSON.toJSONString(obj == null ? "" : obj));
                                 }
                             }
                         } else {
                             if (k.equals(s)) {
-                                detail = detail.replace("{{" + s + "}}", JSON.toJSONString(v));
+                                detail = detail.replace("{{" + s + "}}", JSON.toJSONString(v == null ? "" : v));
                             }
                         }
                     }

+ 6 - 0
teachcloud-mark/src/main/resources/mapper/MarkPaperMapper.xml

@@ -157,6 +157,9 @@
             <if test="dpr.requestUserId != null">
                 AND s.teacher_id = #{dpr.requestUserId}
             </if>
+            <if test="dpr.courseUserId != null">
+                AND EXISTS( SELECT 1 FROM (select course_code from teach_course where exam_id = #{req.examId} and user_id = #{dpr.courseUserId}) tc WHERE tc.course_code = t.course_code)
+            </if>
             <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
                 AND bc.teaching_room_id IN
                 <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">
@@ -249,6 +252,9 @@
             <if test="dpr.requestUserId != null">
                 AND t.user_id = #{dpr.requestUserId}
             </if>
+            <if test="dpr.courseUserId != null">
+                AND EXISTS( SELECT 1 FROM (select course_code from teach_course where exam_id = #{req.examId} and user_id = #{dpr.courseUserId}) tc WHERE tc.course_code = t.course_code)
+            </if>
             <if test="dpr.orgIdSet != null and dpr.orgIdSet != '' and dpr.orgIdSet.size > 0">
                 AND su.org_id IN
                 <foreach collection="dpr.orgIdSet" item="item" index="index" open="(" separator="," close=")">