浏览代码

add 教务端增加添加维修

周箭河 5 年之前
父节点
当前提交
fdeb2bb676

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/RepairStudentQueryInfo.java

@@ -22,6 +22,8 @@ public class RepairStudentQueryInfo extends QueryInfo {
 
     private Date endTime;
 
+    private Integer studentId;
+
     public Integer getSubjectId() {
         return subjectId;
     }
@@ -77,4 +79,12 @@ public class RepairStudentQueryInfo extends QueryInfo {
     public void setOrganIdList(String organIdList) {
         this.organIdList = organIdList;
     }
+
+    public Integer getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Integer studentId) {
+        this.studentId = studentId;
+    }
 }

+ 3 - 0
mec-biz/src/main/resources/config/mybatis/StudentRepairMapper.xml

@@ -169,6 +169,9 @@
             <if test="employeeId != null">
                 AND sr.employee_id_ = #{employeeId}
             </if>
+            <if test="studentId != null">
+                AND sr.student_id_ = #{studentId}
+            </if>
             <if test="organIdList != null">
                 AND FIND_IN_SET(sr.organ_id_,#{organIdList})
             </if>

+ 47 - 0
mec-student/src/main/java/com/ym/mec/student/controller/RepairController.java

@@ -0,0 +1,47 @@
+package com.ym.mec.student.controller;
+
+
+import com.ym.mec.auth.api.client.SysUserFeignService;
+import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.EmployeeDao;
+import com.ym.mec.biz.dal.entity.Employee;
+import com.ym.mec.biz.dal.entity.StudentRepair;
+import com.ym.mec.biz.dal.page.RepairStudentQueryInfo;
+import com.ym.mec.biz.service.StudentRepairService;
+import com.ym.mec.common.controller.BaseController;
+import com.ym.mec.common.entity.HttpResponseResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Objects;
+
+@RequestMapping("repair")
+@Api(tags = "维修服务")
+@RestController
+public class RepairController extends BaseController {
+
+    @Autowired
+    private SysUserFeignService sysUserFeignService;
+
+    @Autowired
+    private StudentRepairService studentRepairService;
+
+    @ApiOperation("获取维修记录")
+    @GetMapping(value = "/getStudentRepairList")
+    public HttpResponseResult getStudentRepairList(RepairStudentQueryInfo queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        queryInfo.setStudentId(sysUser.getId());
+        return succeed(studentRepairService.queryPage(queryInfo));
+    }
+
+
+}

+ 14 - 0
mec-web/src/main/java/com/ym/mec/web/controller/education/EduRepairController.java

@@ -13,6 +13,7 @@ import com.ym.mec.common.entity.HttpResponseResult;
 import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -20,6 +21,8 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.Arrays;
+import java.util.List;
 import java.util.Objects;
 
 @RequestMapping("eduRepair")
@@ -64,5 +67,16 @@ public class EduRepairController extends BaseController {
         return succeed(studentRepairService.addRepair(repairInfo));
     }
 
+    @ApiOperation("获取学生的维修记录")
+    @GetMapping(value = "/getStudentRepairList")
+    public HttpResponseResult getStudentRepairList(RepairStudentQueryInfo queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if (sysUser == null) {
+            return failed("用户信息获取失败");
+        }
+        queryInfo.setEmployeeId(sysUser.getId());
+        return succeed(studentRepairService.queryPage(queryInfo));
+    }
+
 
 }