wangliang 1 жил өмнө
parent
commit
f966db79b2

+ 12 - 3
server/src/main/java/com/qmth/jkserver/dto/ExamKjProgressDto.java

@@ -41,9 +41,18 @@ public class ExamKjProgressDto implements Serializable {
 	private String uploadedPercent;//比例
 	
 	private Long attachmentId;
-	
-	
-	/**
+
+    private Attachment attachment;
+
+    public Attachment getAttachment() {
+        return attachment;
+    }
+
+    public void setAttachment(Attachment attachment) {
+        this.attachment = attachment;
+    }
+
+    /**
 	 * @return the uploadedPercent
 	 */
 	public String getUploadedPercent() {

+ 9 - 6
server/src/main/java/com/qmth/jkserver/service/impl/ExamKjHZServiceImpl.java

@@ -9,7 +9,6 @@ import com.qmth.jkserver.enums.ExamType;
 import com.qmth.jkserver.model.*;
 import com.qmth.jkserver.service.*;
 import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Lazy;
 import org.springframework.context.annotation.Scope;
 import org.springframework.context.annotation.ScopedProxyMode;
@@ -22,10 +21,7 @@ import org.springframework.util.CollectionUtils;
 import javax.annotation.Resource;
 import java.math.BigDecimal;
 import java.text.DecimalFormat;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * 汇总统计service
@@ -74,6 +70,9 @@ public class ExamKjHZServiceImpl implements ExamKjHZService {
     @Resource
     JkExamSolfegeRecordDao jkExamSolfegeRecordDao;
 
+    @Resource
+    AttachmentService attachmentService;
+
     private static final DecimalFormat FORMAT = new DecimalFormat("0.00%");
 
     @Override
@@ -272,7 +271,11 @@ public class ExamKjHZServiceImpl implements ExamKjHZService {
                 ExamKjProgress examKjProgress = findProgress(examRoom.getExamCode(), examRoom.getPlaceCode(),
                         examRoom.getRoomCode());
                 if (examKjProgress != null) {
-                    dto.setAttachmentId(examKjProgress.getAttachmentId());
+                    if (Objects.nonNull(examKjProgress.getAttachmentId())) {
+                        dto.setAttachmentId(examKjProgress.getAttachmentId());
+                        Attachment attachment = attachmentService.getById(examKjProgress.getAttachmentId());
+                        dto.setAttachment(attachment);
+                    }
                     dto.setTime(examKjProgress.getStartTime());
                     dto.setType(examKjProgress.getType());
                 }