Pārlūkot izejas kodu

3.4.5 update-20250514

xiaofei 1 mēnesi atpakaļ
vecāks
revīzija
abfef592ba

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

@@ -50,7 +50,7 @@ public class PdfFillUtils {
     static {
         try {
             //解决中文不显示问题
-            BaseFont bfChinese = BaseFont.createFont(AsianFontMapper.ChineseSimplifiedFont, AsianFontMapper.ChineseSimplifiedEncoding_H, BaseFont.NOT_EMBEDDED);
+            BaseFont bfChinese = BaseFont.createFont(AsianFontMapper.ChineseSimplifiedFont, AsianFontMapper.ChineseSimplifiedEncoding_H, BaseFont.EMBEDDED);
             textFont28 = new Font(bfChinese, 28);
             textFont24 = new Font(bfChinese, 24);
             textFont22 = new Font(bfChinese, 22);

+ 13 - 3
distributed-print/src/main/java/com/qmth/distributed/print/api/mark/MarkController.java

@@ -34,6 +34,7 @@ import javax.annotation.Resource;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -66,14 +67,23 @@ public class MarkController extends BaseController {
      * @param examId      考试ID
      * @param paperNumber 试卷编号
      */
-    @PostMapping(value = "/")
+    @GetMapping(value = "/lock_list")
     @Aac(auth = false)
     public Object getTaskLock(@RequestParam(required = false) Long examId,
-                              @RequestParam(required = false) String paperNumber) {
+                              @RequestParam(required = false) String paperNumber,
+                              @RequestParam(required = false) Long questionId,
+                              @RequestParam(required = false) Long userId) {
         Map<String, TaskLock> formalTaskMap = TaskLockUtil.getFormalTaskMap();
         if (examId != null && StringUtils.isNotBlank(paperNumber)) {
             TaskLock taskLock = TaskLockUtil.getFormalTask(examId + "_" + paperNumber);
-            return taskLock.list();
+            List<Map<String, Object>> mapList = taskLock.list();
+            if (questionId != null) {
+                mapList = mapList.stream().filter(m -> m.get("questions").toString().indexOf(String.valueOf(questionId)) > 0).collect(Collectors.toList());
+            }
+            if (userId != null) {
+                mapList = mapList.stream().filter(m -> m.get("markerId").toString().equals(userId.toString())).collect(Collectors.toList());
+            }
+            return mapList;
         }
         Map<String, List<Map<String, Object>>> map = new HashMap<>();
         for (Map.Entry<String, TaskLock> entry : formalTaskMap.entrySet()) {