夏文涛 2 лет назад
Родитель
Сommit
5b17979397

+ 6 - 0
src/main/java/com/template/controller/SmartEvaluateStudentController.java

@@ -194,6 +194,12 @@ public class SmartEvaluateStudentController implements SmartEvaluateStudentContr
         }
         queryWrapper1.orderByDesc("id");
         PageUtils<SmartEvaluateStudent> list = smartEvaluateStudentService.queryPageSmartEvaluateStudent(currentPage, pageCount, queryWrapper1);
+        if(list.getList() != null && list.getList().size() > 0){
+            for (SmartEvaluateStudent student:list.getList()) {
+
+            }
+        }
+
         return CommonResult.ok(list);
     }
 

+ 4 - 4
src/main/java/com/template/controller/SmartEvaluateStudentController2.java

@@ -93,8 +93,8 @@ public class SmartEvaluateStudentController2 implements SmartEvaluateStudentCont
         SmartSubjectTemplate smartSubjectTemplate = smartTemplateRuleList.getSmartSubjectTemplate();
         QueryWrapper<SmartSubjectTemplate> queryWrapper1 = new QueryWrapper<>();
         queryWrapper1.eq("deleted", 0);
-        queryWrapper1.eq("grade", smartSubjectTemplate.getGrade());
-        queryWrapper1.eq("term", smartSubjectTemplate.getTerm());
+        queryWrapper1.eq("grade_id", smartSubjectTemplate.getGrade());
+        queryWrapper1.eq("term_id", smartSubjectTemplate.getTerm());
         // queryWrapper1.eq("exam_type", smartSubjectTemplate.getExamType());
         List<SmartSubjectTemplate> listc = smartSubjectTemplateService.list(queryWrapper1);
         if (!listc.isEmpty() && !Objects.equals(listc.get(0).getId(), smartSubjectTemplate.getId())){
@@ -106,8 +106,8 @@ public class SmartEvaluateStudentController2 implements SmartEvaluateStudentCont
         }
         QueryWrapper<SmartEvaluateStudent> queryWrapper2 = new QueryWrapper<>();
         queryWrapper2.eq("deleted", 0);
-        queryWrapper2.eq("grade_name", smartSubjectTemplate.getGrade());
-        queryWrapper2.eq("term", smartSubjectTemplate.getTerm());
+        queryWrapper2.eq("grade_id", smartSubjectTemplate.getGradeId());
+        queryWrapper2.eq("term_id", smartSubjectTemplate.getTermId());
         // queryWrapper2.eq("exam_type", smartSubjectTemplate.getExamType());
         queryWrapper2.isNotNull("score_level");
         List<SmartEvaluateStudent> evaluateData = smartEvaluateStudentService.getSmartEvaluateStudentByKey(queryWrapper2);

+ 5 - 4
src/main/java/com/template/controller/SmartScoreController.java

@@ -310,10 +310,6 @@ public class SmartScoreController implements SmartScoreControllerAPI {
         ss.setExamType(isr.getExamType());
         ss.setScore(isr.getScore());
 
-        int result = smartScoreService.insertSmartScore(ss);
-        if (result <= 0) {
-            return CommonResult.fail("添加失败");
-        }
 
         SmartExamtype examType = smartExamtypeService.getSmartById(isr.getExamType());
         if (examType == null) {
@@ -362,6 +358,11 @@ public class SmartScoreController implements SmartScoreControllerAPI {
             //endregion
         }
 
+        int result = smartScoreService.insertSmartScore(ss);
+        if (result <= 0) {
+            return CommonResult.fail("添加失败");
+        }
+
         return CommonResult.ok("添加成功");
     }
 

+ 6 - 0
src/main/java/com/template/model/evaluate/student/SmartEvaluateStudent.java

@@ -1,5 +1,6 @@
 package com.template.model.evaluate.student;
 
+import com.baomidou.mybatisplus.annotation.*;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
@@ -11,7 +12,10 @@ import lombok.experimental.Accessors;
 @Accessors(chain = true)
 @ApiModel(value="smartSubjectRule", description="")
 public class SmartEvaluateStudent {
+    private static final long serialVersionUID = 1L;
 
+    @ApiModelProperty(value = "主键id")
+    @TableId(value = "id", type = IdType.AUTO)
     public Integer id;
 
     @ApiModelProperty(value = "学期")
@@ -57,5 +61,7 @@ public class SmartEvaluateStudent {
     public String scoreComment;
 
     @ApiModelProperty(value = "逻辑删除 未删除:0;删除:1")
+    @TableField(fill = FieldFill.INSERT)
+    @TableLogic
     public Integer deleted;
 }

+ 13 - 0
src/main/java/com/template/model/evaluate/student/SmartSubjectTemplate.java

@@ -8,8 +8,10 @@ import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
 import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 /**
  * <p>
@@ -35,14 +37,25 @@ public class SmartSubjectTemplate implements Serializable {
     @NotBlank(message = "年级不能为空")
     private String grade;
 
+    @ApiModelProperty(value = "年级")
+    @NotNull(message = "年级不能为空")
+    private Integer gradeId;
+
     @ApiModelProperty(value = "学期")
     @NotBlank(message = "学期不能为空")
     private String term;
 
+    @ApiModelProperty(value = "学期ID")
+    @NotNull(message = "学期ID不能为空")
+    private Integer termId;
+
     @ApiModelProperty(value = "考试类型")
     @NotBlank(message = "考试类型不能为空")
     private String examType;
 
+    @TableField(exist = false)
+    private List<SmartTermTemplate> examTypes;
+
     @ApiModelProperty(value = "创建时间")
     @TableField(fill = FieldFill.INSERT)
     private Date createTime;

+ 21 - 0
src/main/java/com/template/model/evaluate/student/SmartTermTemplate.java

@@ -0,0 +1,21 @@
+package com.template.model.evaluate.student;
+
+import lombok.Data;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 平分项管理
+ * </p>
+ *
+ * @author ceshi
+ * @since 2024-03-14
+ */
+@Data
+public class SmartTermTemplate implements Serializable {
+
+    private Integer id;
+
+    private String name;
+
+}