xiaofei 1 жил өмнө
parent
commit
eea61d92e1

+ 9 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/dto/mark/manage/MarkManageDto.java

@@ -15,6 +15,7 @@ public class MarkManageDto {
     private String paperNumber;
     private String paperNumber;
     private Integer totalCount;
     private Integer totalCount;
     private Integer markedCount;
     private Integer markedCount;
+    private String percent;
     private String status;
     private String status;
     private String statusDisplay;
     private String statusDisplay;
 
 
@@ -66,6 +67,14 @@ public class MarkManageDto {
         this.markedCount = markedCount;
         this.markedCount = markedCount;
     }
     }
 
 
+    public String getPercent() {
+        return percent;
+    }
+
+    public void setPercent(String percent) {
+        this.percent = percent;
+    }
+
     public String getStatus() {
     public String getStatus() {
         return status;
         return status;
     }
     }

+ 14 - 1
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/entity/MarkGroupStudent.java

@@ -1,5 +1,6 @@
 package com.qmth.teachcloud.mark.entity;
 package com.qmth.teachcloud.mark.entity;
 
 
+import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
 import java.io.Serializable;
 import java.io.Serializable;
@@ -24,9 +25,13 @@ public class MarkGroupStudent implements Serializable {
 
 
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "ID")
+    @TableId(value = "id", type = IdType.INPUT)
+    private Long id;
+
     @JsonSerialize(using = ToStringSerializer.class)
     @JsonSerialize(using = ToStringSerializer.class)
     @ApiModelProperty(value = "考生ID")
     @ApiModelProperty(value = "考生ID")
-    @TableId(value = "student_id")
     private Long studentId;
     private Long studentId;
 
 
     @ApiModelProperty(value = "分组ID")
     @ApiModelProperty(value = "分组ID")
@@ -42,6 +47,14 @@ public class MarkGroupStudent implements Serializable {
     @ApiModelProperty(value = "状态")
     @ApiModelProperty(value = "状态")
     private SubjectiveStatus status;
     private SubjectiveStatus status;
 
 
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
     public Long getStudentId() {
     public Long getStudentId() {
         return studentId;
         return studentId;
     }
     }

+ 2 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkServiceImpl.java

@@ -11,6 +11,7 @@ import java.util.concurrent.ConcurrentHashMap;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 
 
+import com.qmth.teachcloud.common.contant.SystemConstant;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.CollectionUtils;
 import org.slf4j.Logger;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.slf4j.LoggerFactory;
@@ -236,6 +237,7 @@ public class MarkServiceImpl implements MarkService {
 		MarkGroupStudent gs = markGroupStudentService.getByStudentIdAndGroupNumber(studentId, groupNumber);
 		MarkGroupStudent gs = markGroupStudentService.getByStudentIdAndGroupNumber(studentId, groupNumber);
 		if(gs ==null) {
 		if(gs ==null) {
 			gs = new MarkGroupStudent();
 			gs = new MarkGroupStudent();
+			gs.setId(SystemConstant.getDbUuid());
 			gs.setStudentId(studentId);
 			gs.setStudentId(studentId);
 			gs.setExamId(examId);
 			gs.setExamId(examId);
 			gs.setPaperNumber(paperNumber);
 			gs.setPaperNumber(paperNumber);

+ 3 - 0
teachcloud-mark/src/main/java/com/qmth/teachcloud/mark/service/impl/MarkTaskServiceImpl.java

@@ -62,6 +62,9 @@ public class MarkTaskServiceImpl extends ServiceImpl<MarkTaskMapper, MarkTask> i
             MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(record.getExamId(), record.getPaperNumber());
             MarkPaper markPaper = markPaperService.getByExamIdAndPaperNumber(record.getExamId(), record.getPaperNumber());
             record.setStatus(markPaper == null ? null : markPaper.getStatus().name());
             record.setStatus(markPaper == null ? null : markPaper.getStatus().name());
             record.setStatusDisplay(markPaper == null ? null : markPaper.getStatus().getName());
             record.setStatusDisplay(markPaper == null ? null : markPaper.getStatus().getName());
+
+            String percent = record.getTotalCount() > 0 ? new DecimalFormat("####.###").format(record.getMarkedCount() * 100.0 / record.getTotalCount()) : "0";
+            record.setPercent(percent);
         }
         }
         return markManageDtoIPage;
         return markManageDtoIPage;
     }
     }