Przeglądaj źródła

1.0.4 优化联调bug

xiaofei 1 rok temu
rodzic
commit
3e078d4441

+ 3 - 0
paper-library-business/src/main/java/com/qmth/paper/library/business/bean/result/PaperLibraryImageResult.java

@@ -1,5 +1,7 @@
 package com.qmth.paper.library.business.bean.result;
 
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.io.Serializable;
@@ -11,6 +13,7 @@ import java.util.List;
 public class PaperLibraryImageResult implements Serializable {
 
     @ApiModelProperty(value = "图片ID")
+    @JsonSerialize(using = ToStringSerializer.class)
     private Long paperLibraryId;
     @ApiModelProperty(value = "图片访问地址(解析后地址)")
     private List<String> fileUrls;

+ 1 - 1
paper-library-business/src/main/java/com/qmth/paper/library/business/mapper/DocManageMapper.java

@@ -18,7 +18,7 @@ public interface DocManageMapper {
 
     IPage<DocManageResult> pageData(@Param("page") Page<DocManageResult> page, @Param("examId") Long examId, @Param("courseCode") String courseCode, @Param("orgIds") Set<Long> orgIds);
 
-    IPage<DocManageDetailResult> pageDetail(@Param("page") Page<DocManageDetailResult> page, @Param("paperScanTaskId") Long paperScanTaskId, @Param("collegeName") String collegeName, @Param("majorName") String majorName, @Param("className") String className, @Param("courseName") String courseName, @Param("teacher") String teacher, @Param("teachClass") String teachClass, @Param("isBind") Boolean isBind, @Param("param") String param, @Param("minScore") Double minScore, @Param("maxScore") Double maxScore, @Param("minBindCount") Integer minBindCount, @Param("maxBindCount") Integer maxBindCount);
+    IPage<DocManageDetailResult> pageDetail(@Param("page") Page<DocManageDetailResult> page, @Param("paperScanTaskId") Long paperScanTaskId, @Param("collegeName") String collegeName, @Param("majorName") String majorName, @Param("className") String className, @Param("courseCode") String courseCode, @Param("teacher") String teacher, @Param("teachClass") String teachClass, @Param("isBind") Boolean isBind, @Param("param") String param, @Param("minScore") Double minScore, @Param("maxScore") Double maxScore, @Param("minBindCount") Integer minBindCount, @Param("maxBindCount") Integer maxBindCount);
 
     List<DocManageDetailResult> pageDetail(@Param("paperScanTaskId") Long paperScanTaskId, @Param("collegeName") String collegeName, @Param("majorName") String majorName, @Param("className") String className, @Param("courseName") String courseName, @Param("teacher") String teacher, @Param("teachClass") String teachClass, @Param("isBind") Boolean isBind, @Param("param") String param, @Param("minScore") Double minScore, @Param("maxScore") Double maxScore, @Param("minBindCount") Integer minBindCount, @Param("maxBindCount") Integer maxBindCount);
 

+ 1 - 1
paper-library-business/src/main/java/com/qmth/paper/library/business/service/DocManageService.java

@@ -17,7 +17,7 @@ public interface DocManageService {
 
     IPage<DocManageResult> pageData(Long examId, String courseCode, Integer pageNumber, Integer pageSize);
 
-    IPage<DocManageDetailResult> pageDetail(Long paperScanTaskId, String collegeName, String majorName, String clazzName, String courseName, String teacher, String teachClass, Boolean isBind, String param, Double minScore, Double maxScore, Integer minBindCount, Integer maxBindCount, Integer pageNumber, Integer pageSize);
+    IPage<DocManageDetailResult> pageDetail(Long paperScanTaskId, String collegeName, String majorName, String className, String courseCode, String teacher, String teachClass, Boolean isBind, String param, Double minScore, Double maxScore, Integer minBindCount, Integer maxBindCount, Integer pageNumber, Integer pageSize);
 
     List<DocManageDetailResult> listDetail(DownLoadPaperParams downLoadPaperParams);
 

+ 2 - 2
paper-library-business/src/main/java/com/qmth/paper/library/business/service/impl/DocManageServiceImpl.java

@@ -54,8 +54,8 @@ public class DocManageServiceImpl implements DocManageService {
     }
 
     @Override
-    public IPage<DocManageDetailResult> pageDetail(Long paperScanTaskId, String collegeName, String majorName, String className, String courseName, String teacher, String teachClass, Boolean isBind, String param, Double minScore, Double maxScore, Integer minBindCount, Integer maxBindCount, Integer pageNumber, Integer pageSize) {
-        IPage<DocManageDetailResult> detailResultIPage = docManageMapper.pageDetail(new Page<>(pageNumber, pageSize), paperScanTaskId, collegeName, majorName, className, courseName, teacher, teachClass, isBind, param, minScore, maxScore, minBindCount, maxBindCount);
+    public IPage<DocManageDetailResult> pageDetail(Long paperScanTaskId, String collegeName, String majorName, String className, String courseCode, String teacher, String teachClass, Boolean isBind, String param, Double minScore, Double maxScore, Integer minBindCount, Integer maxBindCount, Integer pageNumber, Integer pageSize) {
+        IPage<DocManageDetailResult> detailResultIPage = docManageMapper.pageDetail(new Page<>(pageNumber, pageSize), paperScanTaskId, collegeName, majorName, className, courseCode, teacher, teachClass, isBind, param, minScore, maxScore, minBindCount, maxBindCount);
         return detailResultIPage;
     }
 

+ 4 - 3
paper-library-business/src/main/java/com/qmth/paper/library/business/service/impl/PaperLibraryServiceImpl.java

@@ -75,7 +75,7 @@ public class PaperLibraryServiceImpl extends ServiceImpl<PaperLibraryMapper, Pap
     public PaperLibraryResult listStudentPicture(Long paperScanTaskId, Long studentId) {
         PaperLibraryResult paperLibraryResult = new PaperLibraryResult();
         ExamStudent examStudent = examStudentService.getById(studentId);
-        if (examStudent == null) {
+        if (examStudent != null) {
             paperLibraryResult.setStudentName(examStudent.getStudentName());
             paperLibraryResult.setStudentCode(examStudent.getStudentCode());
             paperLibraryResult.setCourseCode(examStudent.getCourseCode());
@@ -137,7 +137,8 @@ public class PaperLibraryServiceImpl extends ServiceImpl<PaperLibraryMapper, Pap
         String fileName = file.getOriginalFilename();
         String prefixFileName = fileName.substring(0, fileName.lastIndexOf("."));
         String suffix = fileName.substring(fileName.lastIndexOf("."));
-        File outFile = new File(cutRootPath, prefixFileName + "-" + SystemConstant.getNanoId() + suffix);
+        String nanoId = SystemConstant.getNanoId();
+        File outFile = new File(cutRootPath, "original" + File.separator + prefixFileName + "-" + nanoId + suffix);
         if (!outFile.exists()) {
             outFile.getParentFile().mkdirs();
         }
@@ -157,7 +158,7 @@ public class PaperLibraryServiceImpl extends ServiceImpl<PaperLibraryMapper, Pap
         }
 
         // 旋转
-        File rotateOutFile = new File(cutRootPath, "rotate" + file.getName());
+        File rotateOutFile = new File(cutRootPath, "rotate" + File.separator + prefixFileName + "-" + nanoId + suffix);
         File rotateFile = ImageUtil.rotate(outFile, rotate, rotateOutFile);
 
         List<String> stringList = new ArrayList<>();

+ 1 - 1
paper-library-business/src/main/resources/mapper/DocManageMapper.xml

@@ -95,7 +95,7 @@
                 and es.bind_count &lt;= #{maxBindCount}
             </if>
         </where>
-        order by pst.scan_task_name, bs.student_code
+        order by pst.scan_task_name, es.student_code
     </select>
     <select id="listDetail" resultType="com.qmth.paper.library.business.bean.result.DocManageDetailResult">
         SELECT

+ 1 - 1
paper-library-business/src/main/resources/mapper/PaperLibraryMapper.xml

@@ -54,7 +54,7 @@
                 and es.course_code = #{courseCode}
             </if>
             <if test="studentCode != null and studentCode != ''">
-                and es.student_code like concat(#{param}, '%')
+                and es.student_code like concat(#{studentCode}, '%')
             </if>
         </where>
     </select>

+ 3 - 2
paper-library-common/src/main/java/com/qmth/paper/library/common/util/ImageUtil.java

@@ -77,9 +77,10 @@ public class ImageUtil {
     public static File rotate(File sourceFile, int rotate, File outFile) {
         try {
             // rotate为0,不旋转
-            if (rotate != 0) {
-                Thumbnails.of(sourceFile).scale(0.8).rotate(rotate).toFile(outFile);
+            if (rotate == 0) {
+                return sourceFile;
             }
+            Thumbnails.of(sourceFile).scale(0.8).rotate(rotate).toFile(outFile);
         } catch (IOException e) {
             e.printStackTrace();
         }

+ 2 - 2
paper-library/src/main/java/com/qmth/paper/library/api/DocManageController.java

@@ -64,7 +64,7 @@ public class DocManageController {
                              @ApiParam(value = "学院") @RequestParam(required = false) String collegeName,
                              @ApiParam(value = "专业") @RequestParam(required = false) String majorName,
                              @ApiParam(value = "班级") @RequestParam(required = false) String className,
-                             @ApiParam(value = "课程") @RequestParam(required = false) String courseName,
+                             @ApiParam(value = "课程") @RequestParam(required = false) String courseCode,
                              @ApiParam(value = "任课老师") @RequestParam(required = false) String teacher,
                              @ApiParam(value = "教学班") @RequestParam(required = false) String teachClass,
                              @ApiParam(value = "是否绑定") @RequestParam(required = false) Boolean isBind,
@@ -75,7 +75,7 @@ public class DocManageController {
                              @ApiParam(value = "绑定数量(大)") @RequestParam(required = false) Integer maxBindCount,
                              @ApiParam(value = "分页页码", required = true) @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                              @ApiParam(value = "分页数", required = true) @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        return ResultUtil.ok(docManageService.pageDetail(paperScanTaskId, collegeName, majorName, className, courseName, teacher, teachClass, isBind, param, minScore, maxScore, minBindCount, maxBindCount, pageNumber, pageSize));
+        return ResultUtil.ok(docManageService.pageDetail(paperScanTaskId, collegeName, majorName, className, courseCode, teacher, teachClass, isBind, param, minScore, maxScore, minBindCount, maxBindCount, pageNumber, pageSize));
     }
 
     @ApiOperation(value = "批量下载")

+ 1 - 4
paper-library/src/main/resources/application.properties

@@ -25,11 +25,8 @@ sys.config.sessionActive=24h
 spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/
 
 #----------------fss config-----------------
-#com.qmth.fss.config=/Users/xiaofei/qmth/temporary/paperlibrary/file-temp
-#com.qmth.fss.server=http://192.168.10.140:8001
-
 com.qmth.fss.config=/Users/xiaofei/qmth/temporary/paperlibrary/file-temp
-com.qmth.fss.server=http://192.168.11.31:8001
+com.qmth.fss.server=http://192.168.11.111:8001
 
 #-----------------qmth boot config--------------
 com.qmth.api.metrics-endpoint=/metrics-count