deason 5 년 전
부모
커밋
7d924f1db3
15개의 변경된 파일112개의 추가작업 그리고 88개의 파일을 삭제
  1. 0 20
      examcloud-core-questions-dao/src/main/java/cn/com/qmth/examcloud/core/questions/dao/entity/Property.java
  2. 29 0
      examcloud-core-questions-dao/src/main/java/cn/com/qmth/examcloud/core/questions/dao/entity/dto/PropertyConvert.java
  3. 0 14
      examcloud-core-questions-dao/src/main/java/cn/com/qmth/examcloud/core/questions/dao/entity/dto/PropertyDto.java
  4. 28 15
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/ImportPaperService.java
  5. 3 1
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/PaperStructService.java
  6. 2 1
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/export/InitPaperExpService.java
  7. 1 1
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/CoursePropertyServiceImpl.java
  8. 10 10
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/ExportPaperServiceImpl.java
  9. 1 1
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/ExportStructureServiceImpl.java
  10. 6 3
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/ExtractConfigServiceImpl.java
  11. 4 4
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/PaperServiceImpl.java
  12. 5 4
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/PropertyServiceImpl.java
  13. 21 12
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/QuesServiceImpl.java
  14. 1 1
      examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/QuestionProviderServiceImpl.java
  15. 1 1
      examcloud-core-questions-starter/src/main/java/cn/com/qmth/examcloud/core/questions/starter/QuestionPoolApplication.java

+ 0 - 20
examcloud-core-questions-dao/src/main/java/cn/com/qmth/examcloud/core/questions/dao/entity/Property.java

@@ -1,7 +1,6 @@
 package cn.com.qmth.examcloud.core.questions.dao.entity;
 
 import cn.com.qmth.examcloud.core.questions.dao.entity.base.IdEntity;
-import cn.com.qmth.examcloud.core.questions.dao.entity.dto.PropertyDto;
 
 import javax.persistence.Entity;
 import javax.persistence.Table;
@@ -32,25 +31,6 @@ public class Property extends IdEntity {
     @NotNull
     private Long orgId;
 
-    public Property() {
-
-    }
-
-    public Property(PropertyDto propertyDto) {
-        this.id = propertyDto.getId();
-        this.name = propertyDto.getName();
-        this.parentId = propertyDto.getParentId();
-        this.number = propertyDto.getNumber();
-        this.coursePropertyId = propertyDto.getCoursePropertyId();
-        this.remark = propertyDto.getRemark();
-    }
-
-    public Property(String name, Long parentId, Long coursePropertyId) {
-        this.name = name;
-        this.parentId = parentId;
-        this.coursePropertyId = coursePropertyId;
-    }
-
     public Long getId() {
         return id;
     }

+ 29 - 0
examcloud-core-questions-dao/src/main/java/cn/com/qmth/examcloud/core/questions/dao/entity/dto/PropertyConvert.java

@@ -0,0 +1,29 @@
+package cn.com.qmth.examcloud.core.questions.dao.entity.dto;
+
+import cn.com.qmth.examcloud.core.questions.dao.entity.Property;
+
+public class PropertyConvert {
+
+    public static PropertyDto of(Property entity) {
+        PropertyDto dto = new PropertyDto();
+        dto.setId(entity.getId());
+        dto.setParentId(entity.getParentId());
+        dto.setCoursePropertyId(entity.getCoursePropertyId());
+        dto.setName(entity.getName());
+        dto.setNumber(entity.getNumber());
+        dto.setRemark(entity.getRemark());
+        return dto;
+    }
+
+    public static Property of(PropertyDto dto) {
+        Property entity = new Property();
+        entity.setId(dto.getId());
+        entity.setParentId(dto.getParentId());
+        entity.setCoursePropertyId(dto.getCoursePropertyId());
+        entity.setName(dto.getName());
+        entity.setNumber(dto.getNumber());
+        entity.setRemark(dto.getRemark());
+        return entity;
+    }
+
+}

+ 0 - 14
examcloud-core-questions-dao/src/main/java/cn/com/qmth/examcloud/core/questions/dao/entity/dto/PropertyDto.java

@@ -1,7 +1,5 @@
 package cn.com.qmth.examcloud.core.questions.dao.entity.dto;
 
-import cn.com.qmth.examcloud.core.questions.dao.entity.Property;
-
 import java.util.List;
 
 /**
@@ -25,18 +23,6 @@ public class PropertyDto {
 
     private List<PropertyDto> propertyDtos;
 
-    public PropertyDto() {
-    }
-
-    public PropertyDto(Property property) {
-        this.id = property.getId();
-        this.coursePropertyId = property.getCoursePropertyId();
-        this.name = property.getName();
-        this.number = property.getNumber();
-        this.remark = property.getRemark();
-        this.parentId = property.getParentId();
-    }
-
     public Long getId() {
         return id;
     }

+ 28 - 15
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/ImportPaperService.java

@@ -920,7 +920,8 @@ public class ImportPaperService {
             } else if (tmpText.startsWith(ImportPaperMsg.publicity)) {
                 // 检测到公安度开始段落
                 String pub = getContent(tmpText, ImportPaperMsg.publicity);
-                publicity = checkPublicity(publicity, pub, importPaperCheck, errorQuesNum);
+
+                publicity = checkPublicity(pub, importPaperCheck, errorQuesNum);
                 question.setPublicity(publicity);
                 answerStart = false;
             }
@@ -1014,14 +1015,22 @@ public class ImportPaperService {
                 throw new PaperException(importPaperCheck.getErrorInfo());
             }
             for (CourseProperty courseProperty : courseProperties) {
-                Property propertyParent = new Property(firstProperty, 0l, courseProperty.getId());
+                Property propertyParent = new Property();
+                propertyParent.setCoursePropertyId(courseProperty.getId());
+                propertyParent.setParentId(0L);
+                propertyParent.setName(firstProperty);
+
                 //查询一级属性是否存在
                 List<Property> propertieParents = propertyRepo.findAll(Example.of(propertyParent));
                 //存在一级属性
                 if (propertieParents != null && propertieParents.size() > 0) {
                     isFirstEmpty = false;
                     for (Property proParent : propertieParents) {
-                        Property propertySon = new Property(secondProperty, proParent.getId(), courseProperty.getId());
+                        Property propertySon = new Property();
+                        propertySon.setCoursePropertyId(courseProperty.getId());
+                        propertySon.setParentId(proParent.getId());
+                        propertySon.setName(secondProperty);
+
                         //查询二级属性
                         List<Property> propertieSons = propertyRepo.findAll(Example.of(propertySon));
                         //存在二级属性
@@ -1069,9 +1078,14 @@ public class ImportPaperService {
                 }
                 throw new PaperException(importPaperCheck.getErrorInfo());
             }
+
             for (CourseProperty courseProperty : courseProperties) {
                 //查询一级属性
-                Property propertyParent = new Property(firstProperty, 0l, courseProperty.getId());
+                Property propertyParent = new Property();
+                propertyParent.setCoursePropertyId(courseProperty.getId());
+                propertyParent.setParentId(0L);
+                propertyParent.setName(firstProperty);
+
                 List<Property> propertieParents = propertyRepo.findAll(Example.of(propertyParent));
                 //存在一级属性
                 if (propertieParents != null && propertieParents.size() > 0) {
@@ -1485,23 +1499,27 @@ public class ImportPaperService {
     private void checkUnitNum(List<PaperDetailUnit> paperDetailUnits, ImportPaperCheck importPaperCheck) throws PaperException {
         Map<PaperDetail, Integer> unitNumMap = new HashMap<>();
         Collections.sort(paperDetailUnits);
+
         for (PaperDetailUnit paperDetailUnit : paperDetailUnits) {
             PaperDetail key = paperDetailUnit.getPaperDetail();
             if (unitNumMap.containsKey(key)) {
                 int value = unitNumMap.get(key);
-                if (paperDetailUnit.getQuestionType() == QuesStructType.NESTED_ANSWER_QUESTION) {
+                /*if (paperDetailUnit.getQuestionType() == QuesStructType.NESTED_ANSWER_QUESTION) {
                     unitNumMap.put(key, value + 1);
                 } else {
                     unitNumMap.put(key, value + 1);
-                }
+                }*/
+                unitNumMap.put(key, value + 1);
             } else {
-                if (paperDetailUnit.getQuestionType() == QuesStructType.NESTED_ANSWER_QUESTION) {
+                /*if (paperDetailUnit.getQuestionType() == QuesStructType.NESTED_ANSWER_QUESTION) {
                     unitNumMap.put(key, 1);
                 } else {
                     unitNumMap.put(key, 1);
-                }
+                }*/
+                unitNumMap.put(key, 1);
             }
         }
+
         for (Map.Entry<PaperDetail, Integer> entry : unitNumMap.entrySet()) {
             PaperDetail paperDetail = entry.getKey();
             if (paperDetail.getUnitCount().intValue() != entry.getValue().intValue()) {
@@ -1606,14 +1624,9 @@ public class ImportPaperService {
 
     /**
      * 校验试题公开度
-     *
-     * @param publicity
-     * @param tmpText
-     * @param importPaperCheck
-     * @param subQuesNum
-     * @throws Exception
      */
-    private Boolean checkPublicity(Boolean publicity, String tmpText, ImportPaperCheck importPaperCheck, int subQuesNum) throws Exception {
+    private Boolean checkPublicity(String tmpText, ImportPaperCheck importPaperCheck, int subQuesNum) throws Exception {
+        Boolean publicity;
         if (StringUtils.isBlank(tmpText)) {
             //如果为空,默认是公开
             publicity = true;

+ 3 - 1
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/PaperStructService.java

@@ -83,10 +83,12 @@ public class PaperStructService {
                 query.addCriteria(Criteria.where("courseNo").is(searchInfo.getCourseNo()));
             }
         }
+
         long count = this.mongoTemplate.count(query, PaperStruct.class);
         query.with(new Sort(new Sort.Order(Sort.Direction.DESC, "createTime")));
         query.limit(pageSize);
-        query.skip((curPage - 1) * pageSize);
+        query.skip((curPage - 1L) * pageSize);
+
         List<PaperStruct> paperList = this.mongoTemplate.find(query, PaperStruct.class);
         //远程调用rmi,查询课程名称
         if (paperList != null && paperList.size() > 0) {

+ 2 - 1
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/export/InitPaperExpService.java

@@ -216,12 +216,13 @@ public class InitPaperExpService {
                 if (o1.getSortNumber() > o2.getSortNumber()) {
                     return 1;
                 }
-                if (o1.getSortNumber() == o2.getSortNumber()) {
+                if (o1.getSortNumber().equals(o2.getSortNumber())) {
                     return 0;
                 }
                 return -1;
             }
         });
+
         if (paperDetailExps != null && paperDetailExps.size() > 0) {
             //循环所有大题,给大题排序
             for (int i = 0; i < paperDetailExps.size(); i++) {

+ 1 - 1
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/CoursePropertyServiceImpl.java

@@ -59,7 +59,7 @@ public class CoursePropertyServiceImpl implements CoursePropertyService {
             for (CourseProperty courseProperty : list) {
                 GetCourseReq req = new GetCourseReq();
                 req.setId(courseProperty.getCourseId());
-                req.setRootOrgId(Long.valueOf(courseProperty.getOrgId()));
+                req.setRootOrgId(courseProperty.getOrgId());
                 GetCourseResp resp = courseCloudService.getCourse(req);
                 courseProperty.setCourseName(resp.getCourseBean().getName());
             }

+ 10 - 10
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/ExportPaperServiceImpl.java

@@ -705,20 +705,20 @@ public class ExportPaperServiceImpl implements ExportPaperService {
             if (question.getPublicity()) {
                 //公开
                 if (question.getDifficulty() != null && question.getDifficulty().equals("难") || question.getDifficultyDegree() < 0.4 && question.getDifficultyDegree() > 0) {
-                    map = buildMapSum(questionType * 100 + 1, map);
+                    map = buildMapSum(questionType * 100L + 1L, map);
                 } else if (question.getDifficulty() != null && question.getDifficulty().equals("中") || question.getDifficultyDegree() < 0.8 && question.getDifficultyDegree() > 0.3) {
-                    map = buildMapSum(questionType * 100 + 2, map);
+                    map = buildMapSum(questionType * 100L + 2L, map);
                 } else {
-                    map = buildMapSum(questionType * 100 + 3, map);
+                    map = buildMapSum(questionType * 100L + 3L, map);
                 }
             } else {
                 //非公开
                 if (question.getDifficulty() != null && question.getDifficulty().equals("难") || question.getDifficultyDegree() < 0.4 && question.getDifficultyDegree() > 0) {
-                    map = buildMapSum(questionType * 100 + 11, map);
+                    map = buildMapSum(questionType * 100L + 11L, map);
                 } else if (question.getDifficulty() != null && question.getDifficulty().equals("中") || question.getDifficultyDegree() < 0.8 && question.getDifficultyDegree() > 0.3) {
-                    map = buildMapSum(questionType * 100 + 12, map);
+                    map = buildMapSum(questionType * 100L + 12L, map);
                 } else {
-                    map = buildMapSum(questionType * 100 + 13, map);
+                    map = buildMapSum(questionType * 100L + 13L, map);
                 }
             }
         }
@@ -740,10 +740,10 @@ public class ExportPaperServiceImpl implements ExportPaperService {
         query.addCriteria(Criteria.where("quesProperties.coursePropertyName").is(courseProperty.getName()));
         //二级属性不为空,那么一级属性也不为空
         if (sonProperty != null && sonProperty.getId() != null) {
-            query.addCriteria(Criteria.where("quesProperties").elemMatch(Criteria.where("firstProperty.id").is(Long.valueOf(parentProperty.getId())).and("secondProperty.id").is(Long.valueOf(sonProperty.getId()))));
+            query.addCriteria(Criteria.where("quesProperties").elemMatch(Criteria.where("firstProperty.id").is(parentProperty.getId()).and("secondProperty.id").is(sonProperty.getId())));
         } else {
             if (parentProperty != null && parentProperty.getId() != null) {
-                query.addCriteria(Criteria.where("quesProperties").elemMatch(Criteria.where("firstProperty.id").is(Long.valueOf(parentProperty.getId()))));
+                query.addCriteria(Criteria.where("quesProperties").elemMatch(Criteria.where("firstProperty.id").is(parentProperty.getId())));
             }
         }
         List<Question> questionList = this.mongoTemplate.find(query, Question.class);
@@ -751,7 +751,7 @@ public class ExportPaperServiceImpl implements ExportPaperService {
     }
 
     public List<Question> questionList2(String courseNo, CourseProperty courseProperty, QuesStructType quesStructType, Property parentProperty, Property sonProperty, List<Question> questions) {
-        List<Question> questionList = new ArrayList<Question>();
+        List<Question> questionList = new ArrayList<>();
         String id = courseNo + quesStructType.name() + courseProperty.getName();
         //二级属性不为空,那么一级属性也不为空
         if (sonProperty != null && sonProperty.getId() != null) {
@@ -762,7 +762,7 @@ public class ExportPaperServiceImpl implements ExportPaperService {
             }
         }
         for (Question question : questions) {
-            List<String> idStrings = new ArrayList<String>();
+            List<String> idStrings = new ArrayList<>();
             String id_Q = question.getCourseNo() + question.getQuestionType();
             List<QuesProperty> quesProperties = question.getQuesProperties();
             if (quesProperties != null && quesProperties.size() > 0) {

+ 1 - 1
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/ExportStructureServiceImpl.java

@@ -97,7 +97,7 @@ public class ExportStructureServiceImpl implements ExportStructureService {
         }
         long count = this.mongoTemplate.count(query, ExportStructure.class);
         query.limit(pageSize);
-        query.skip((curPage - 1) * pageSize);
+        query.skip((curPage - 1L) * pageSize);
         List<ExportStructure> list = this.mongoTemplate.find(query, ExportStructure.class);
         return new PageImpl<ExportStructure>(list, new PageRequest(curPage - 1, pageSize), count);
     }

+ 6 - 3
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/ExtractConfigServiceImpl.java

@@ -928,9 +928,11 @@ public class ExtractConfigServiceImpl implements ExtractConfigService {
         if (!StringUtils.isBlank(courseCode)) {
             query.addCriteria(Criteria.where("course.code").is(courseCode));
         }
+
         long count = this.mongoTemplate.count(query, ExtractConfig.class);
         query.limit(pageSize);
-        query.skip((currentPage - 1) * pageSize);
+        query.skip((currentPage - 1L) * pageSize);
+
         List<ExtractConfig> extractConfigList = this.mongoTemplate.find(query, ExtractConfig.class);
         if (extractConfigList != null && extractConfigList.size() > 0) {
             //调用考务rmi,获取考试信息
@@ -943,7 +945,8 @@ public class ExtractConfigServiceImpl implements ExtractConfigService {
                 extractConfig.setExamType(bean.getExamType());
             }
         }
-        return new PageImpl<ExtractConfig>(extractConfigList, new PageRequest(currentPage - 1, pageSize), count);
+
+        return new PageImpl<>(extractConfigList, PageRequest.of(currentPage - 1, pageSize), count);
     }
 
     @Override
@@ -1092,7 +1095,7 @@ public class ExtractConfigServiceImpl implements ExtractConfigService {
         //从考务查询改考试下的所有开启课程
         List<CouresInfo> courseInfoList = new ArrayList<>();
         GetExamCourseListReq req = new GetExamCourseListReq();
-        req.setExamId(Long.valueOf(examId));
+        req.setExamId(examId);
         req.setCourseEnable(true);
         Long start = 1l;
         int count = 0;

+ 4 - 4
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/PaperServiceImpl.java

@@ -154,7 +154,7 @@ public class PaperServiceImpl implements PaperService {
         long count = this.mongoTemplate.count(query, Paper.class);
         query.with(new Sort(new Order(Direction.DESC, "createTime")));
         query.limit(pageSize);
-        query.skip((curPage - 1) * pageSize);
+        query.skip((curPage - 1L) * pageSize);
         List<Paper> paperList = this.mongoTemplate.find(query, Paper.class);
         return new PageImpl<Paper>(paperList, new PageRequest(curPage - 1, pageSize), count);
     }
@@ -182,7 +182,7 @@ public class PaperServiceImpl implements PaperService {
         }
         long totalNumber = this.mongoTemplate.count(query, Paper.class);
         query.limit(pageSize);
-        query.skip((curPage - 1) * pageSize);
+        query.skip((curPage - 1L) * pageSize);
         List<Paper> paperList = this.mongoTemplate.find(query, Paper.class);
         return new PageImpl<Paper>(paperList, new PageRequest(curPage - 1, pageSize), totalNumber);
     }
@@ -300,7 +300,7 @@ public class PaperServiceImpl implements PaperService {
         long count = this.mongoTemplate.count(query, Paper.class);
         query.with(new Sort(new Order(Direction.DESC, "createTime")));
         query.limit(pageSize);
-        query.skip((curPage - 1) * pageSize);
+        query.skip((curPage - 1L) * pageSize);
         List<Paper> paperList = this.mongoTemplate.find(query, Paper.class);
         return new PageImpl<Paper>(paperList, new PageRequest(curPage - 1, pageSize), count);
     }
@@ -970,7 +970,7 @@ public class PaperServiceImpl implements PaperService {
         long total = this.mongoTemplate.count(query, Paper.class);
         query.with(new Sort(new Order(Direction.DESC, "createTime")));
         query.limit(pageSize);
-        query.skip((curPage - 1) * pageSize);
+        query.skip((curPage - 1L) * pageSize);
         List<Paper> paperList = this.mongoTemplate.find(query, Paper.class);
         Page<Paper> paperPageList = new PageImpl<Paper>(paperList, new PageRequest(curPage - 1, pageSize), total);
         return paperPageList;

+ 5 - 4
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/PropertyServiceImpl.java

@@ -4,6 +4,7 @@ import cn.com.qmth.examcloud.api.commons.security.bean.User;
 import cn.com.qmth.examcloud.core.questions.base.Model;
 import cn.com.qmth.examcloud.core.questions.dao.PropertyRepo;
 import cn.com.qmth.examcloud.core.questions.dao.entity.Property;
+import cn.com.qmth.examcloud.core.questions.dao.entity.dto.PropertyConvert;
 import cn.com.qmth.examcloud.core.questions.dao.entity.dto.PropertyDto;
 import cn.com.qmth.examcloud.core.questions.service.PropertyService;
 import cn.com.qmth.examcloud.core.questions.service.bean.PropertyAssembler;
@@ -51,13 +52,13 @@ public class PropertyServiceImpl implements PropertyService {
         List<Property> propertieParents = propertyRepo.findByOrgIdAndCoursePropertyIdAndParentIdOrderByNumber(user.getRootOrgId(), coursePropertyId, 0l);
         if (propertieParents != null && propertieParents.size() > 0) {
             for (Property property : propertieParents) {
-                PropertyDto propertyDtoParent = new PropertyDto(property);
+                PropertyDto propertyDtoParent = PropertyConvert.of(property);
                 //查询所有子节点对象
                 List<Property> propertiesSons = propertyRepo.findByOrgIdAndCoursePropertyIdAndParentIdOrderByNumber(user.getRootOrgId(), coursePropertyId, property.getId());
                 if (propertiesSons != null && propertiesSons.size() > 0) {
                     List<PropertyDto> propertyDtosSons = new ArrayList<>();
                     for (Property property2 : propertiesSons) {
-                        PropertyDto propertyDto2 = new PropertyDto(property2);
+                        PropertyDto propertyDto2 = PropertyConvert.of(property2);
                         propertyDtosSons.add(propertyDto2);
                     }
                     propertyDtoParent.setPropertyDtos(propertyDtosSons);
@@ -116,11 +117,11 @@ public class PropertyServiceImpl implements PropertyService {
         List<Property> properties = new ArrayList<>();
         if (propertyDtos != null && propertyDtos.size() > 0) {
             for (PropertyDto propertyDto : propertyDtos) {
-                Property property = new Property(propertyDto);
+                Property property = PropertyConvert.of(propertyDto);
                 properties.add(property);
                 if (propertyDto.getPropertyDtos() != null && propertyDto.getPropertyDtos().size() > 0) {
                     for (PropertyDto propertyDtoSon : propertyDto.getPropertyDtos()) {
-                        Property propertySon = new Property(propertyDtoSon);
+                        Property propertySon = PropertyConvert.of(propertyDtoSon);
                         properties.add(propertySon);
                     }
                 }

+ 21 - 12
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/QuesServiceImpl.java

@@ -247,21 +247,25 @@ public class QuesServiceImpl implements QuesService {
         }
         //二级属性不为空,那么一级属性也不为空
         if (searchCondition.getSecondPropertyId() != null) {
-            query.addCriteria(Criteria.where("quesProperties").elemMatch(Criteria.where("firstProperty.id").is(Long.valueOf(searchCondition.getFirstPropertyId())).and("secondProperty.id").is(Long.valueOf(searchCondition.getSecondPropertyId()))));
+            query.addCriteria(Criteria.where("quesProperties").elemMatch(
+                    Criteria.where("firstProperty.id").is(Long.parseLong(searchCondition.getFirstPropertyId()))
+                            .and("secondProperty.id").is(Long.parseLong(searchCondition.getSecondPropertyId()))));
         } else {
             if (searchCondition.getFirstPropertyId() != null) {
-                query.addCriteria(Criteria.where("quesProperties").elemMatch(Criteria.where("firstProperty.id").is(Long.valueOf(searchCondition.getFirstPropertyId()))));
+                query.addCriteria(Criteria.where("quesProperties").elemMatch(
+                        Criteria.where("firstProperty.id").is(Long.parseLong(searchCondition.getFirstPropertyId()))));
             }
         }
+
         long count = this.mongoTemplate.count(query, Question.class);
-//      query.with(new Sort(new Sort.Order(Sort.Direction.DESC,"createTime")));
         query.limit(pageSize);
-        query.skip((curPage - 1) * pageSize);
+        query.skip((curPage - 1L) * pageSize);
         List<Question> questionList = this.mongoTemplate.find(query, Question.class);
         for (Question question : questionList) {
             formatQues(question);
         }
-        return new PageImpl<Question>(questionList, new PageRequest(curPage - 1, pageSize), count);
+
+        return new PageImpl<>(questionList, PageRequest.of(curPage - 1, pageSize), count);
     }
 
     public void formatQuesCondition(QuestionSearchCondition searchCondition) {
@@ -316,7 +320,7 @@ public class QuesServiceImpl implements QuesService {
         long total = this.mongoTemplate.count(query, Question.class);
         query.with(new Sort(new Order(Direction.DESC, "id")));
         query.limit(pageSize);
-        query.skip((curPage - 1) * pageSize);
+        query.skip((curPage - 1L) * pageSize);
         List<Question> questionList = this.mongoTemplate.find(query, Question.class);
         Page<Question> questionPageList = new PageImpl<Question>(questionList, new PageRequest(curPage - 1, pageSize), total);
         for (Question question : questionPageList) {
@@ -466,15 +470,15 @@ public class QuesServiceImpl implements QuesService {
                                         if (extent.getCx() > 6000000) {
                                             long cx = extent.getCx();
                                             long cy = extent.getCy();
-                                            Double ncy = (double) ((cy * 6000000) / cx);
-                                            extent.setCx(6000000);
+                                            Double ncy = (cy * 6000000D) / cx;
+                                            extent.setCx(6000000L);
                                             extent.setCy(ncy.longValue());
                                         }
                                         if (extent.getCy() > 6000000) {
                                             long cx = extent.getCx();
                                             long cy = extent.getCy();
-                                            Double ncx = (double) ((cx * 6000000) / cy);
-                                            extent.setCy(6000000);
+                                            Double ncx = (cx * 6000000D) / cy;
+                                            extent.setCy(6000000L);
                                             extent.setCx(ncx.longValue());
                                         }
                                     }
@@ -602,14 +606,19 @@ public class QuesServiceImpl implements QuesService {
         if (searchCondition.getDifficulty() != null) {
             query.addCriteria(Criteria.where("difficulty").is(searchCondition.getDifficulty()));
         }
+
         //二级属性不为空,那么一级属性也不为空
         if (searchCondition.getSecondPropertyId() != null) {
-            query.addCriteria(Criteria.where("quesProperties").elemMatch(Criteria.where("firstProperty.id").is(Long.valueOf(searchCondition.getFirstPropertyId())).and("secondProperty.id").is(Long.valueOf(searchCondition.getSecondPropertyId()))));
+            query.addCriteria(Criteria.where("quesProperties").elemMatch(
+                    Criteria.where("firstProperty.id").is(Long.parseLong(searchCondition.getFirstPropertyId()))
+                            .and("secondProperty.id").is(Long.parseLong(searchCondition.getSecondPropertyId()))));
         } else {
             if (searchCondition.getFirstPropertyId() != null) {
-                query.addCriteria(Criteria.where("quesProperties").elemMatch(Criteria.where("firstProperty.id").is(Long.valueOf(searchCondition.getFirstPropertyId()))));
+                query.addCriteria(Criteria.where("quesProperties").elemMatch(
+                        Criteria.where("firstProperty.id").is(Long.parseLong(searchCondition.getFirstPropertyId()))));
             }
         }
+
         long count = 0;
         List<Question> questionList = this.mongoTemplate.find(query, Question.class);
         if (questionList == null || questionList.size() < 1) {

+ 1 - 1
examcloud-core-questions-service/src/main/java/cn/com/qmth/examcloud/core/questions/service/impl/QuestionProviderServiceImpl.java

@@ -255,7 +255,7 @@ public class QuestionProviderServiceImpl implements QuestionProviderService {
         }
         long count = this.mongoTemplate.count(query, Question.class);
         query.limit(pageSize);
-        query.skip((curPage - 1) * pageSize);
+        query.skip((curPage - 1L) * pageSize);
         List<Question> questionList = this.mongoTemplate.find(query, Question.class);
         List<DefaultQuestion> defaultQuestions = buildDefaultQuestions(questionList);
         Page<DefaultQuestion> questions = new PageImpl<DefaultQuestion>(defaultQuestions, new PageRequest(curPage - 1, pageSize), count);

+ 1 - 1
examcloud-core-questions-starter/src/main/java/cn/com/qmth/examcloud/core/questions/starter/QuestionPoolApplication.java

@@ -51,7 +51,7 @@ public class QuestionPoolApplication {
         resolver.setDefaultEncoding("UTF-8");
         resolver.setResolveLazily(true);
         resolver.setMaxInMemorySize(40960);
-        resolver.setMaxUploadSize(200 * 1024 * 1024);
+        resolver.setMaxUploadSize(200L * 1024L * 1024L);
         return resolver;
     }