Răsfoiți Sursa

公用查询条件修改

wangliang 4 ani în urmă
părinte
comite
2a3b0de979

+ 10 - 0
teachcloud-common/src/main/java/com/qmth/teachcloud/common/domain/PrefixUrlDomain.java

@@ -29,6 +29,16 @@ public class PrefixUrlDomain implements Serializable {
 
     String reportSchool;
 
+    String reportCourse;
+
+    public String getReportCourse() {
+        return reportCourse;
+    }
+
+    public void setReportCourse(String reportCourse) {
+        this.reportCourse = reportCourse;
+    }
+
     public String getReportWuda() {
         return reportWuda;
     }

+ 7 - 8
teachcloud-common/src/main/java/com/qmth/teachcloud/common/util/ServletUtil.java

@@ -3,7 +3,6 @@ package com.qmth.teachcloud.common.util;
 import com.alibaba.fastjson.JSONObject;
 import com.qmth.boot.core.enums.Platform;
 import com.qmth.teachcloud.common.contant.SystemConstant;
-import com.qmth.teachcloud.common.entity.BasicSchool;
 import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -151,13 +150,13 @@ public class ServletUtil {
      * @return
      */
     public static Object getRequestHeaderSchoolId() {
-        BasicSchool basicSchool = (BasicSchool) getRequestSchool();
-        return basicSchool.getId();
-//        Object object = getRequest().getHeader(SystemConstant.SCHOOL_ID);
-//        if (Objects.isNull(object)) {
-//            throw ExceptionResultEnum.NOT_LOGIN.exception();
-//        }
-//        return object;
+//        BasicSchool basicSchool = (BasicSchool) getRequestSchool();
+//        return basicSchool.getId();
+        Object object = getRequest().getHeader(SystemConstant.SCHOOL_ID);
+        if (Objects.isNull(object)) {
+            throw ExceptionResultEnum.NOT_LOGIN.exception();
+        }
+        return object;
     }
 
     /**

+ 12 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/entity/TBExamCourse.java

@@ -22,6 +22,10 @@ public class TBExamCourse extends BaseEntity implements Serializable {
 
     private static final long serialVersionUID = 1L;
 
+    @ApiModelProperty(value = "学校id")
+    @TableField(value = "school_id")
+    private Long schoolId;
+
     @ApiModelProperty(value = "考试id")
     @TableField(value = "exam_id")
     private Long examId;
@@ -42,6 +46,14 @@ public class TBExamCourse extends BaseEntity implements Serializable {
     @TableField(value = "publish_status")
     private PublishStatusEnum publishStatus;
 
+    public Long getSchoolId() {
+        return schoolId;
+    }
+
+    public void setSchoolId(Long schoolId) {
+        this.schoolId = schoolId;
+    }
+
     public static long getSerialVersionUID() {
         return serialVersionUID;
     }

+ 12 - 0
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/entity/TBExamStudent.java

@@ -27,6 +27,10 @@ public class TBExamStudent implements Serializable {
     @TableId(value = "id")
     private Long id;
 
+    @ApiModelProperty(value = "学校id")
+    @TableField(value = "school_id")
+    private Long schoolId;
+
     @ApiModelProperty(value = "考试id")
     @JsonSerialize(using = ToStringSerializer.class)
     @TableField(value = "exam_id")
@@ -90,6 +94,14 @@ public class TBExamStudent implements Serializable {
     @TableField(value = "current")
     private Boolean current;
 
+    public Long getSchoolId() {
+        return schoolId;
+    }
+
+    public void setSchoolId(Long schoolId) {
+        this.schoolId = schoolId;
+    }
+
     public Long getExamId() {
         return examId;
     }

+ 8 - 4
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/mapper/TBExamStudentMapper.java

@@ -20,36 +20,40 @@ public interface TBExamStudentMapper extends BaseMapper<TBExamStudent> {
     /**
      * 查询开课学院列表
      *
+     * @param schoolId
      * @param examId
      * @param courseCode
      * @return
      */
-    List<TBExamStudentResult> selectTeachCollegeList(@Param("examId") Long examId, @Param("courseCode") String courseCode);
+    List<TBExamStudentResult> selectTeachCollegeList(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode);
 
     /**
      * 查询考察学院列表
      *
+     * @param schoolId
      * @param examId
      * @param courseCode
      * @return
      */
-    List<TBExamStudentResult> selectInspectCollegeList(@Param("examId") Long examId, @Param("courseCode") String courseCode);
+    List<TBExamStudentResult> selectInspectCollegeList(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode);
 
     /**
      * 查询老师列表
      *
+     * @param schoolId
      * @param examId
      * @param courseCode
      * @return
      */
-    List<TBExamStudentResult> selectTeachList(@Param("examId") Long examId, @Param("courseCode") String courseCode);
+    List<TBExamStudentResult> selectTeachList(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode);
 
     /**
      * 查询班级列表
      *
+     * @param schoolId
      * @param examId
      * @param courseCode
      * @return
      */
-    List<TBExamStudentResult> selectClassList(@Param("examId") Long examId, @Param("courseCode") String courseCode);
+    List<TBExamStudentResult> selectClassList(@Param("schoolId") Long schoolId, @Param("examId") Long examId, @Param("courseCode") String courseCode);
 }

+ 8 - 4
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/TBExamStudentService.java

@@ -19,36 +19,40 @@ public interface TBExamStudentService extends IService<TBExamStudent> {
     /**
      * 查询开课学院列表
      *
+     * @param schoolId
      * @param examId
      * @param courseCode
      * @return
      */
-    List<TBExamStudentResult> selectTeachCollegeList(Long examId, String courseCode);
+    List<TBExamStudentResult> selectTeachCollegeList(Long schoolId, Long examId, String courseCode);
 
     /**
      * 查询考察学院列表
      *
+     * @param schoolId
      * @param examId
      * @param courseCode
      * @return
      */
-    List<TBExamStudentResult> selectInspectCollegeList(Long examId, String courseCode);
+    List<TBExamStudentResult> selectInspectCollegeList(Long schoolId, Long examId, String courseCode);
 
     /**
      * 查询老师列表
      *
+     * @param schoolId
      * @param examId
      * @param courseCode
      * @return
      */
-    List<TBExamStudentResult> selectTeachList(Long examId, String courseCode);
+    List<TBExamStudentResult> selectTeachList(Long schoolId, Long examId, String courseCode);
 
     /**
      * 查询班级列表
      *
+     * @param schoolId
      * @param examId
      * @param courseCode
      * @return
      */
-    List<TBExamStudentResult> selectClassList(Long examId, String courseCode);
+    List<TBExamStudentResult> selectClassList(Long schoolId, Long examId, String courseCode);
 }

+ 19 - 8
teachcloud-report-business/src/main/java/com/qmth/teachcloud/report/business/service/impl/TBExamStudentServiceImpl.java

@@ -27,41 +27,52 @@ public class TBExamStudentServiceImpl extends ServiceImpl<TBExamStudentMapper, T
     /**
      * 查询开课学院列表
      *
+     * @param schoolId
      * @param examId
      * @param courseCode
      * @return
      */
     @Override
-    public List<TBExamStudentResult> selectTeachCollegeList(Long examId, String courseCode) {
-        return tbExamStudentMapper.selectTeachCollegeList(examId, courseCode);
+    public List<TBExamStudentResult> selectTeachCollegeList(Long schoolId, Long examId, String courseCode) {
+        return tbExamStudentMapper.selectTeachCollegeList(schoolId, examId, courseCode);
     }
 
     /**
      * 查询考察学院列表
      *
+     * @param schoolId
      * @param examId
      * @param courseCode
      * @return
      */
     @Override
-    public List<TBExamStudentResult> selectInspectCollegeList(Long examId, String courseCode) {
-        return tbExamStudentMapper.selectInspectCollegeList(examId, courseCode);
+    public List<TBExamStudentResult> selectInspectCollegeList(Long schoolId, Long examId, String courseCode) {
+        return tbExamStudentMapper.selectInspectCollegeList(schoolId, examId, courseCode);
     }
 
     /**
      * 查询老师列表
      *
+     * @param schoolId
      * @param examId
      * @param courseCode
      * @return
      */
     @Override
-    public List<TBExamStudentResult> selectTeachList(Long examId, String courseCode) {
-        return tbExamStudentMapper.selectTeachList(examId, courseCode);
+    public List<TBExamStudentResult> selectTeachList(Long schoolId, Long examId, String courseCode) {
+        return tbExamStudentMapper.selectTeachList(schoolId, examId, courseCode);
     }
 
+    /**
+     * 查询班级列表
+     *
+     * @param schoolId
+     * @param examId
+     * @param courseCode
+     * @return
+     */
     @Override
-    public List<TBExamStudentResult> selectClassList(Long examId, String courseCode) {
-        return tbExamStudentMapper.selectClassList(examId, courseCode);
+    public List<TBExamStudentResult> selectClassList(Long schoolId, Long examId, String courseCode) {
+        return tbExamStudentMapper.selectClassList(schoolId, examId, courseCode);
     }
 }

+ 2 - 0
teachcloud-report-business/src/main/resources/db/init-table.sql

@@ -1383,6 +1383,7 @@ DROP TABLE IF EXISTS `t_b_exam_course`;
 /*!40101 SET character_set_client = utf8 */;
 CREATE TABLE `t_b_exam_course` (
   `id` bigint(20) NOT NULL COMMENT '主键',
+  `school_id` bigint DEFAULT NULL COMMENT '学校id',
   `exam_id` bigint(20) NOT NULL COMMENT '考试id',
   `course_code` varchar(100) NOT NULL COMMENT '科目编码',
   `course_name` varchar(100) NOT NULL COMMENT '科目名称',
@@ -1443,6 +1444,7 @@ DROP TABLE IF EXISTS `t_b_exam_student`;
 /*!40101 SET character_set_client = utf8 */;
 CREATE TABLE `t_b_exam_student` (
   `id` bigint(20) NOT NULL COMMENT '主键',
+  `school_id` bigint DEFAULT NULL COMMENT '学校id',
   `exam_id` bigint(20) NOT NULL COMMENT '考试id',
   `name` varchar(100) NOT NULL COMMENT '姓名',
   `student_id` bigint(20) NOT NULL COMMENT '学生id',

+ 14 - 12
teachcloud-report-business/src/main/resources/mapper/TBExamStudentMapper.xml

@@ -3,6 +3,9 @@
 <mapper namespace="com.qmth.teachcloud.report.business.mapper.TBExamStudentMapper">
 
     <sql id="conditionSql">
+        <if test="schoolId != null and schoolId != ''">
+            and tbes.school_id = #{schoolId}
+        </if>
         <if test="examId != null and examId != ''">
             and tbes.exam_id = #{examId}
         </if>
@@ -14,12 +17,12 @@
     <select id="selectTeachCollegeList" resultType="com.qmth.teachcloud.report.business.bean.result.TBExamStudentResult">
         select
             DISTINCT tbes.teach_college_id as teachCollegeId,
-            tbsc.college_name as teachCollegeName,
-            tbsc.college_code as teachCollegeCode
+            so.name as teachCollegeName,
+            so.code as teachCollegeCode
         from
             t_b_exam_student tbes
-        join t_b_school_college tbsc on
-            tbsc.id = tbes.teach_college_id
+        join sys_org so on
+            so.id = tbes.teach_college_id
         <where>
            <include refid="conditionSql" />
         </where>
@@ -28,12 +31,12 @@
     <select id="selectInspectCollegeList" resultType="com.qmth.teachcloud.report.business.bean.result.TBExamStudentResult">
         select
             DISTINCT tbes.inspect_college_id as inspectCollegeId,
-            tbsc.college_name as inspectCollegeName,
-            tbsc.college_code as inspectCollegeCode
+            so.name as inspectCollegeName,
+            so.code as inspectCollegeCode
         from
             t_b_exam_student tbes
-        join t_b_school_college tbsc on
-            tbsc.id = tbes.inspect_college_id
+        join sys_org so on
+            so.id = tbes.inspect_college_id
         <where>
             <include refid="conditionSql" />
         </where>
@@ -42,12 +45,11 @@
     <select id="selectTeachList" resultType="com.qmth.teachcloud.report.business.bean.result.TBExamStudentResult">
         select
             DISTINCT tbes.teacher_id as teacherId,
-            tbst.teacher_name as teachName,
-            tbst.teacher_code as teachCode
+            su.real_name as teachName
         from
             t_b_exam_student tbes
-        join t_b_school_teacher tbst on
-            tbst.id = tbes.teacher_id
+        join sys_user su on
+            su.id = tbes.teacher_id
         <where>
             <include refid="conditionSql" />
         </where>

+ 27 - 0
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/CourseController.java

@@ -0,0 +1,27 @@
+package com.qmth.teachcloud.report.api;
+
+import com.qmth.boot.api.constant.ApiConstant;
+import com.qmth.teachcloud.common.util.Result;
+import com.qmth.teachcloud.common.util.ResultUtil;
+import com.qmth.teachcloud.report.business.bean.result.TBExamStudentResult;
+import com.qmth.teachcloud.report.business.enums.SemesterEnum;
+import io.swagger.annotations.*;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+@Api(tags = "课程Controller")
+@RestController
+@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.reportCourse}")
+public class CourseController {
+
+    @ApiOperation(value = "开课课程考试总览列表接口")
+    @RequestMapping(value = "/survey_teacher/list", method = RequestMethod.POST)
+    @ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TBExamStudentResult.class)})
+    public Result surveyTeacherList(@ApiParam(value = "考试id", required = true) @RequestParam String examId,
+                                    @ApiParam(value = "学期", required = true) @RequestParam SemesterEnum semester,
+                                    @ApiParam(value = "学校id", required = true) @RequestParam String schoolId) {
+        return ResultUtil.ok();
+    }
+}

+ 15 - 9
teachcloud-report/src/main/java/com/qmth/teachcloud/report/api/SysReportController.java

@@ -78,8 +78,10 @@ public class SysReportController {
     @ApiOperation(value = "课程列表")
     @RequestMapping(value = "/common/list_course", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "科目信息", response = TBExamCourse.class)})
-    public Result listCourse(@ApiParam(value = "考试id", required = true) @RequestParam String examId) {
+    public Result listCourse(@ApiParam(value = "学校id", required = true) @RequestParam String schoolId,
+                             @ApiParam(value = "考试id", required = true) @RequestParam String examId) {
         QueryWrapper<TBExamCourse> tbExamCourseQueryWrapper = new QueryWrapper<>();
+        tbExamCourseQueryWrapper.lambda().eq(TBExamCourse::getSchoolId, SystemConstant.convertIdToLong(schoolId));
         tbExamCourseQueryWrapper.lambda().eq(TBExamCourse::getExamId, SystemConstant.convertIdToLong(examId));
         return ResultUtil.ok(tbExamCourseService.list(tbExamCourseQueryWrapper));
     }
@@ -87,32 +89,36 @@ public class SysReportController {
     @ApiOperation(value = "开课学院列表")
     @RequestMapping(value = "/common/list_teach_college", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TBExamStudentResult.class)})
-    public Result listTeachCollege(@ApiParam(value = "考试id", required = true) @RequestParam String examId,
+    public Result listTeachCollege(@ApiParam(value = "学校id", required = true) @RequestParam String schoolId,
+                                   @ApiParam(value = "考试id", required = true) @RequestParam String examId,
                                    @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode) {
-        return ResultUtil.ok(tbExamStudentService.selectTeachCollegeList(SystemConstant.convertIdToLong(examId), courseCode));
+        return ResultUtil.ok(tbExamStudentService.selectTeachCollegeList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), courseCode));
     }
 
     @ApiOperation(value = "考察学院列表")
     @RequestMapping(value = "/common/list_inspect_college", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TBExamStudentResult.class)})
-    public Result listInspectCollege(@ApiParam(value = "考试id", required = true) @RequestParam String examId,
+    public Result listInspectCollege(@ApiParam(value = "学校id", required = true) @RequestParam String schoolId,
+                                     @ApiParam(value = "考试id", required = true) @RequestParam String examId,
                                      @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode) {
-        return ResultUtil.ok(tbExamStudentService.selectInspectCollegeList(SystemConstant.convertIdToLong(examId), courseCode));
+        return ResultUtil.ok(tbExamStudentService.selectInspectCollegeList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), courseCode));
     }
 
     @ApiOperation(value = "教师列表")
     @RequestMapping(value = "/common/list_teacher", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TBExamStudentResult.class)})
-    public Result listTeacher(@ApiParam(value = "考试id", required = true) @RequestParam String examId,
+    public Result listTeacher(@ApiParam(value = "学校id", required = true) @RequestParam String schoolId,
+                              @ApiParam(value = "考试id", required = true) @RequestParam String examId,
                               @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode) {
-        return ResultUtil.ok(tbExamStudentService.selectTeachList(SystemConstant.convertIdToLong(examId), courseCode));
+        return ResultUtil.ok(tbExamStudentService.selectTeachList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), courseCode));
     }
 
     @ApiOperation(value = "班级列表")
     @RequestMapping(value = "/common/list_class", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TBExamStudentResult.class)})
-    public Result listClass(@ApiParam(value = "考试id", required = true) @RequestParam String examId,
+    public Result listClass(@ApiParam(value = "学校id", required = true) @RequestParam String schoolId,
+                            @ApiParam(value = "考试id", required = true) @RequestParam String examId,
                             @ApiParam(value = "科目编码", required = true) @RequestParam String courseCode) {
-        return ResultUtil.ok(tbExamStudentService.selectClassList(SystemConstant.convertIdToLong(examId), courseCode));
+        return ResultUtil.ok(tbExamStudentService.selectClassList(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(examId), courseCode));
     }
 }

+ 1 - 0
teachcloud-report/src/main/resources/application.properties

@@ -16,6 +16,7 @@ prefix.url.exam=admin/exam
 prefix.url.data=admin/data
 prefix.url.reportWuda=report/wuda/open
 prefix.url.reportSchool=report/school
+prefix.url.reportCourse=report/course
 
 #\u65E5\u5FD7\u914D\u7F6E
 com.qmth.logging.root-level=info