EmmaBaBa пре 6 месеци
родитељ
комит
0da215e71e

+ 1 - 0
education-api/src/main/java/com/education/api/controller/student/StuGoalInfoController.java

@@ -42,6 +42,7 @@ public class StuGoalInfoController extends BaseController {
     @PostMapping
     //@RequiresPermissions("student:stuGoalInfo:update")
     public Result answer(@RequestBody @Validated StuGoalInfo stuGoalInfo) {
+
         stuGoalInfoService.saveOrUpdate(stuGoalInfo);
         return Result.success();
     }

+ 37 - 0
education-api/src/main/java/com/education/api/controller/student/XStepModelController.java

@@ -0,0 +1,37 @@
+package com.education.api.controller.student;
+
+import com.education.business.service.education.StepModelService;
+import com.education.common.base.BaseController;
+import com.education.common.model.PageInfo;
+import com.education.common.utils.Result;
+import com.education.model.entity.StepModel;
+import com.education.model.request.PageParam;
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+
+/**
+ * 模版管理
+ */
+@RequestMapping("/student/stepModel")
+@RestController
+public class XStepModelController extends BaseController {
+
+    @Resource
+    private StepModelService stepModelService;
+
+    /**
+     * 模版分页列表
+     * @param  subjectName
+     * @return
+     */
+    @GetMapping("selectBySubject")
+    //@RequiresPermissions("system:stepModel:list")
+    public Result selectBySubject(String subjectName) {
+        PageParam pageParam = new PageParam(0,100);
+        StepModel model = new StepModel();
+        model.setSubjectName(subjectName);
+        PageInfo<StepModel> list = stepModelService.selectPageList(pageParam,  model);
+        return Result.success( list);
+    }
+
+}

+ 8 - 0
education-business/src/main/java/com/education/business/service/education/StuGoalInfoService.java

@@ -14,6 +14,8 @@ import com.education.model.entity.StuGoalInfo;
 import com.education.model.request.PageParam;
 import org.springframework.stereotype.Service;
 
+import java.util.Date;
+
 /**
  * @author zhangj
  * @version 1.0
@@ -29,6 +31,12 @@ public class StuGoalInfoService extends BaseService<StuGoalInfoMapper, StuGoalIn
 
     @Override
     public boolean saveOrUpdate(StuGoalInfo stuGoalInfo) {
+        UserSession userSession = AuthUtil.getSession(LoginEnum.STUDENT.getValue());
+        //设置学生ID
+        stuGoalInfo.setStudentId(userSession.getId().intValue());
+        stuGoalInfo.setCorrectStatus(2);
+        stuGoalInfo.setCreateDate(new Date());
+        stuGoalInfo.setUpdateDate(new Date());
         return super.saveOrUpdate(stuGoalInfo);
     }
 

+ 4 - 1
education-business/src/main/resources/mapper/education/StepModelMapper.xml

@@ -13,8 +13,11 @@
             <if test="stepModel.agentId != null">
                 and agentid = #{stepModel.agentId}
             </if>
+            <if test="stepModel.subjectName != null">
+                and subject_name = #{stepModel.subjectName}
+            </if>
         </where>
-        order by id desc
+        order by id asc
     </select>
 
     <!-- 根据 ID 查询环节模板 -->

+ 36 - 0
education-model/src/main/java/com/education/model/entity/StepModel.java

@@ -15,8 +15,44 @@ public class StepModel extends BaseEntity<StepModel> {
     private Integer agentId;
     private String reserve;
 
+    @TableField("subject_name")
+    private String subjectName;
+    private String requires;
+    private String alias;
 
+    private Integer score;
 
+    public Integer getScore() {
+        return score;
+    }
+
+    public void setScore(Integer score) {
+        this.score = score;
+    }
+
+    public String getSubjectName() {
+        return subjectName;
+    }
+
+    public void setSubjectName(String subjectName) {
+        this.subjectName = subjectName;
+    }
+
+    public String getRequires() {
+        return requires;
+    }
+
+    public void setRequires(String requires) {
+        this.requires = requires;
+    }
+
+    public String getAlias() {
+        return alias;
+    }
+
+    public void setAlias(String alias) {
+        this.alias = alias;
+    }
 
     public String getName() {
         return name;