deason преди 6 години
родител
ревизия
837679b73e

+ 5 - 0
examcloud-core-print-service/src/main/java/cn/com/qmth/examcloud/core/print/service/impl/CoursePaperServiceImpl.java

@@ -131,6 +131,11 @@ public class CoursePaperServiceImpl implements CoursePaperService {
         }
         if (paperP == 0) {
             throw new StatusException(PRT_CODE_500, "试卷页数不能为0!");
+        } else {
+            //试卷页数为奇数时加一
+            if (paperP % 2 != 0) {
+                paperP++;
+            }
         }
 
         CoursePaper oldCoursePaper = coursePaperRepository.findByExamIdAndPaperId(coursePaper.getExamId(), coursePaper.getPaperId());