Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

Joburgess 5 vuotta sitten
vanhempi
commit
1a107b7581
15 muutettua tiedostoa jossa 473 lisäystä ja 12 poistoa
  1. 43 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamReviewController.java
  2. 32 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRoomStudentRelationController.java
  3. 9 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamReviewDao.java
  4. 9 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRoomStudentRelationDao.java
  5. 127 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamReview.java
  6. 13 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamRoomStudentRelation.java
  7. 75 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamReviewQueryInfo.java
  8. 3 3
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamRoomQueryInfo.java
  9. 9 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamReviewService.java
  10. 7 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRoomStudentRelationService.java
  11. 23 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamReviewServiceImpl.java
  12. 5 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java
  13. 83 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamReviewMapper.xml
  14. 26 4
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomMapper.xml
  15. 9 2
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml

+ 43 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamReviewController.java

@@ -0,0 +1,43 @@
+package com.keao.edu.user.controller;
+
+import com.keao.edu.common.controller.BaseController;
+import com.keao.edu.common.entity.HttpResponseResult;
+import com.keao.edu.common.page.PageInfo;
+import com.keao.edu.common.page.QueryInfo;
+import com.keao.edu.user.entity.ExamReview;
+import com.keao.edu.user.page.ExamReviewQueryInfo;
+import com.keao.edu.user.service.ExamReviewService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+@RestController
+@RequestMapping("examReview")
+@Api(tags = "考场服务")
+public class ExamReviewController extends BaseController {
+
+    @Autowired
+    private ExamReviewService examReviewService;
+
+    @ApiOperation("分页查询评审结果")
+    @GetMapping(value = "/list")
+    public HttpResponseResult<PageInfo<ExamReview>> getList(ExamReviewQueryInfo queryInfo) {
+        return succeed(examReviewService.queryPage(queryInfo));
+    }
+
+    @ApiOperation("修改评审结果")
+    @PostMapping(value = "/update")
+    public HttpResponseResult update(ExamReview examReview){
+        examReviewService.update(examReview);
+        return succeed();
+    }
+
+    @ApiModelProperty("创建评审")
+    @PostMapping(value = "/createExamReview")
+    public HttpResponseResult createExamReview(ExamReview examReview){
+        examReviewService.insert(examReview);
+        return succeed();
+    }
+}

+ 32 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRoomStudentRelationController.java

@@ -0,0 +1,32 @@
+package com.keao.edu.user.controller;
+
+import com.keao.edu.common.controller.BaseController;
+import com.keao.edu.common.entity.HttpResponseResult;
+import com.keao.edu.common.page.PageInfo;
+import com.keao.edu.common.page.QueryInfo;
+import com.keao.edu.user.entity.ExamRoomStudentRelation;
+import com.keao.edu.user.service.ExamRoomStudentRelationService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiModelProperty;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+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;
+
+@RestController
+@RequestMapping("examRoomStudentRelation")
+@Api(tags = "考场与学生关联服务")
+public class ExamRoomStudentRelationController extends BaseController {
+
+    @Autowired
+    private ExamRoomStudentRelationService examRoomStudentRelationService;
+
+    @ApiOperation("开启/关闭教室")
+    @GetMapping(value = "/list")
+    public HttpResponseResult switchClassRoom(Integer openFlag,Integer examinationBasicId,Integer studentId) {
+        examRoomStudentRelationService.switchClassRoom(openFlag,examinationBasicId,studentId);
+        return succeed();
+    }
+}

+ 9 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamReviewDao.java

@@ -0,0 +1,9 @@
+package com.keao.edu.user.dao;
+
+
+import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.user.entity.ExamReview;
+
+public interface ExamReviewDao extends BaseDAO<Long, ExamReview> {
+	
+}

+ 9 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRoomStudentRelationDao.java

@@ -2,8 +2,16 @@ package com.keao.edu.user.dao;
 
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.user.entity.ExamRoomStudentRelation;
+import org.apache.ibatis.annotations.Param;
 
 public interface ExamRoomStudentRelationDao extends BaseDAO<Long, ExamRoomStudentRelation> {
 
-	
+
+    /**
+     * 开启/关闭教室
+     * @param openFlag
+     * @param examinationBasicId
+     * @param studentId
+     */
+    void switchClassRoom(@Param("openFlag") Integer openFlag, @Param("examinationBasicId") Integer examinationBasicId, @Param("studentId") Integer studentId);
 }

+ 127 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamReview.java

@@ -0,0 +1,127 @@
+package com.keao.edu.user.entity;
+
+import io.swagger.annotations.ApiModelProperty;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(exam_review):
+ */
+public class ExamReview {
+
+	/**  */
+	private Long id;
+
+	@ApiModelProperty(value = "考试编号")
+	private Integer examinationBasicId;
+	
+	/**  */
+	@ApiModelProperty(value = "教师编号")
+	private Integer teacherId;
+	
+	/**  */
+	@ApiModelProperty(value = "学员编号")
+	private Integer studentId;
+	
+	/** 评价 */
+	@ApiModelProperty(value = "评价")
+	private String evaluationContent;
+	
+	/** 结果 */
+	@ApiModelProperty(value = "结果")
+	private String evaluationResult;
+	
+	private java.util.Date createTime;
+	
+	private java.util.Date updateTime;
+	
+	private String tenantId;
+
+	@ApiModelProperty(value = "考试基本信息")
+	private ExaminationBasic examinationBasic;
+
+	public ExaminationBasic getExaminationBasic() {
+		return examinationBasic;
+	}
+
+	public void setExaminationBasic(ExaminationBasic examinationBasic) {
+		this.examinationBasic = examinationBasic;
+	}
+
+	public void setId(Long id){
+		this.id = id;
+	}
+	
+	public Long getId(){
+		return this.id;
+	}
+			
+	public void setExaminationBasicId(Integer examinationBasicId){
+		this.examinationBasicId = examinationBasicId;
+	}
+	
+	public Integer getExaminationBasicId(){
+		return this.examinationBasicId;
+	}
+			
+	public void setTeacherId(Integer teacherId){
+		this.teacherId = teacherId;
+	}
+	
+	public Integer getTeacherId(){
+		return this.teacherId;
+	}
+			
+	public void setStudentId(Integer studentId){
+		this.studentId = studentId;
+	}
+	
+	public Integer getStudentId(){
+		return this.studentId;
+	}
+			
+	public void setEvaluationContent(String evaluationContent){
+		this.evaluationContent = evaluationContent;
+	}
+	
+	public String getEvaluationContent(){
+		return this.evaluationContent;
+	}
+			
+	public void setEvaluationResult(String evaluationResult){
+		this.evaluationResult = evaluationResult;
+	}
+	
+	public String getEvaluationResult(){
+		return this.evaluationResult;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	public void setTenantId(String tenantId){
+		this.tenantId = tenantId;
+	}
+	
+	public String getTenantId(){
+		return this.tenantId;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

+ 13 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamRoomStudentRelation.java

@@ -1,5 +1,6 @@
 package com.keao.edu.user.entity;
 
+import com.keao.edu.user.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
 
@@ -24,7 +25,18 @@ public class ExamRoomStudentRelation {
 	private java.util.Date updateTime;
 
 	private String tenantId;
-	
+
+	@ApiModelProperty(value = "房间是否开启")
+	private YesOrNoEnum classroomSwitch;
+
+	public YesOrNoEnum getClassroomSwitch() {
+		return classroomSwitch;
+	}
+
+	public void setClassroomSwitch(YesOrNoEnum classroomSwitch) {
+		this.classroomSwitch = classroomSwitch;
+	}
+
 	public void setId(Long id){
 		this.id = id;
 	}

+ 75 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamReviewQueryInfo.java

@@ -0,0 +1,75 @@
+package com.keao.edu.user.page;
+
+import com.keao.edu.common.page.QueryInfo;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+public class ExamReviewQueryInfo extends QueryInfo {
+
+    @ApiModelProperty(value = "考试项目编号")
+    private Integer examinationBaseId;
+
+    @ApiModelProperty(value = "考官编号")
+    private Integer teacherId;
+
+    @ApiModelProperty(value = "考生编号")
+    private Integer studentId;
+
+    @ApiModelProperty(value = "评审结果")
+    private String evaluationResult;
+
+    @ApiModelProperty(value = "评审时间")
+    private String startTime;
+
+    @ApiModelProperty(value = "评审时间")
+    private String endTime;
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public Integer getExaminationBaseId() {
+        return examinationBaseId;
+    }
+
+    public void setExaminationBaseId(Integer examinationBaseId) {
+        this.examinationBaseId = examinationBaseId;
+    }
+
+    public Integer getTeacherId() {
+        return teacherId;
+    }
+
+    public void setTeacherId(Integer teacherId) {
+        this.teacherId = teacherId;
+    }
+
+    public Integer getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Integer studentId) {
+        this.studentId = studentId;
+    }
+
+    public String getEvaluationResult() {
+        return evaluationResult;
+    }
+
+    public void setEvaluationResult(String evaluationResult) {
+        this.evaluationResult = evaluationResult;
+    }
+}

+ 3 - 3
edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamRoomQueryInfo.java

@@ -18,7 +18,7 @@ public class ExamRoomQueryInfo extends QueryInfo {
     private Integer examinationBaseId;
 
     @ApiModelProperty(value = "考试项目状态")
-    private ExamStatusEnum examStatusEnum;
+    private String examStatusEnum;
 
     @ApiModelProperty(value = "主考官")
     private Integer teacherId;
@@ -47,11 +47,11 @@ public class ExamRoomQueryInfo extends QueryInfo {
         this.examinationBaseId = examinationBaseId;
     }
 
-    public ExamStatusEnum getExamStatusEnum() {
+    public String getExamStatusEnum() {
         return examStatusEnum;
     }
 
-    public void setExamStatusEnum(ExamStatusEnum examStatusEnum) {
+    public void setExamStatusEnum(String examStatusEnum) {
         this.examStatusEnum = examStatusEnum;
     }
 

+ 9 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamReviewService.java

@@ -0,0 +1,9 @@
+package com.keao.edu.user.service;
+
+
+import com.keao.edu.common.service.BaseService;
+import com.keao.edu.user.entity.ExamReview;
+
+public interface ExamReviewService extends BaseService<Long, ExamReview> {
+
+}

+ 7 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRoomStudentRelationService.java

@@ -5,4 +5,11 @@ import com.keao.edu.user.entity.ExamRoomStudentRelation;
 
 public interface ExamRoomStudentRelationService extends BaseService<Long, ExamRoomStudentRelation> {
 
+    /**
+     * 开启/关闭教室
+     * @param openFlag
+     * @param examinationBasicId
+     * @param studentId
+     */
+    void switchClassRoom(Integer openFlag, Integer examinationBasicId, Integer studentId);
 }

+ 23 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamReviewServiceImpl.java

@@ -0,0 +1,23 @@
+package com.keao.edu.user.service.impl;
+
+
+import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.common.service.impl.BaseServiceImpl;
+import com.keao.edu.user.dao.ExamReviewDao;
+import com.keao.edu.user.entity.ExamReview;
+import com.keao.edu.user.service.ExamReviewService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class ExamReviewServiceImpl extends BaseServiceImpl<Long, ExamReview> implements ExamReviewService {
+	
+	@Autowired
+	private ExamReviewDao examReviewDao;
+
+	@Override
+	public BaseDAO<Long, ExamReview> getDAO() {
+		return examReviewDao;
+	}
+	
+}

+ 5 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -18,5 +18,9 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 	public BaseDAO<Long, ExamRoomStudentRelation> getDAO() {
 		return examRoomStudentRelationDao;
 	}
-	
+
+	@Override
+	public void switchClassRoom(Integer openFlag, Integer examinationBasicId, Integer studentId) {
+		examRoomStudentRelationDao.switchClassRoom(openFlag,examinationBasicId,studentId);
+	}
 }

+ 83 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamReviewMapper.xml

@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!--
+这个文件是自动生成的。
+不要修改此文件。所有改动将在下次重新自动生成时丢失。
+-->
+<mapper namespace="com.keao.edu.user.dao.ExamReviewDao">
+	
+	<resultMap type="com.keao.edu.user.entity.ExamReview" id="ExamReview">
+		<result column="id_" property="id" />
+		<result column="examination_basic_id_" property="examinationBasicId" />
+		<result column="teacher_id_" property="teacherId" />
+		<result column="student_id_" property="studentId" />
+		<result column="evaluation_content_" property="evaluationContent" />
+		<result column="evaluation_result_" property="evaluationResult" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+		<result column="tenant_id_" property="tenantId" />
+		<association property="examinationBasic" javaType="com.keao.edu.user.entity.ExaminationBasic"/>
+	</resultMap>
+	
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="ExamReview" >
+		SELECT * FROM exam_review WHERE id_ = #{id} 
+	</select>
+	
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="ExamReview">
+		SELECT * FROM exam_review ORDER BY id_
+	</select>
+	
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.keao.edu.user.entity.ExamReview" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO exam_review (id_,examination_basic_id_,teacher_id_,student_id_,evaluation_content_,
+		evaluation_result_,create_time_,update_time_,tenant_id_)
+		VALUES(#{id},#{examinationBasicId},#{teacherId},#{studentId},#{evaluationContent},
+		#{evaluationResult},NOW(),NOW(),#{tenantId})
+	</insert>
+	
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.keao.edu.user.entity.ExamReview">
+		UPDATE exam_review <set>
+		<if test="examinationBasicId != null">
+		examination_basic_id_ = #{examinationBasicId},
+		</if>
+		<if test="teacherId != null">
+		teacher_id_ = #{teacherId},
+		</if>
+		<if test="evaluationResult != null">
+		evaluation_result_ = #{evaluationResult},
+		</if>
+		<if test="tenantId != null">
+		tenant_id_ = #{tenantId},
+		</if>
+		<if test="updateTime != null">
+		update_time_ = #{updateTime},
+		</if>
+		<if test="studentId != null">
+		student_id_ = #{studentId},
+		</if>
+		<if test="evaluationContent != null">
+		evaluation_content_ = #{evaluationContent},
+		</if>
+		</set> WHERE id_ = #{id}
+	</update>
+	
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM exam_review WHERE id_ = #{id} 
+	</delete>
+	
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="ExamReview" parameterType="map">
+		SELECT * FROM exam_review
+		ORDER BY id_
+		<include refid="global.limit"/>
+	</select>
+	
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM exam_review
+	</select>
+</mapper>

+ 26 - 4
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomMapper.xml

@@ -86,19 +86,41 @@
 		SELECT COUNT(*) FROM exam_room
 	</select>
 
+	<sql id="queryExamRoomPageSql">
+		<where>
+			<if test="tenantId != null">
+				er.tenant_id_ = #{tenantId}
+			</if>
+			<if test="startTime != null">
+				AND eb.expect_exam_start_time_ >= #{startTime}
+			</if>
+			<if test="endTime != null">
+				AND eb.expect_exam_end_time_ &lt;= #{endTime}
+			</if>
+			<if test="search != null and search != ''">
+				AND eb.name_ LIKE CONCAT('%',#{search},'%')
+			</if>
+			<if test="examStatusEnum != null and examStatusEnum != ''">
+				AND eb.status_ = #{examStatusEnum}
+			</if>
+		</where>
+	</sql>
 	<resultMap type="com.keao.edu.user.dto.ExamRoomDto" id="ExamRoomDto" extends="ExamRoom">
 		<association property="examLocation" javaType="com.keao.edu.user.entity.ExamLocation" resultMap="com.keao.edu.user.dao.ExamLocationDao.ExamLocation"/>
 		<association property="examinationBasic" javaType="com.keao.edu.user.entity.ExaminationBasic" resultMap="com.keao.edu.user.dao.ExaminationBasicDao.ExaminationBasic"/>
 	</resultMap>
-
     <select id="countExamRoomPage" resultType="java.lang.Integer">
-
+		SELECT COUNT(er.id_) FROM exam_room er
+		LEFT JOIN exam_location el ON er.exam_location_id_ = el.id_ AND er.tenant_id_ = el.tenant_id_
+		LEFT JOIN examination_basic eb ON FIND_IN_SET(er.exam_location_id_,eb.exam_location_id_list_) AND er.tenant_id_ = eb.tenant_id_
+		<include refid="queryExamRoomPageSql"/>
 	</select>
 	<select id="queryExamRoomPage" resultMap="ExamRoomDto">
 		SELECT er.*,eb.* FROM exam_room er
 		LEFT JOIN exam_location el ON er.exam_location_id_ = el.id_ AND er.tenant_id_ = el.tenant_id_
 		LEFT JOIN examination_basic eb ON FIND_IN_SET(er.exam_location_id_,eb.exam_location_id_list_) AND er.tenant_id_ = eb.tenant_id_
-		WHERE er.tenant_id_ = 1 AND eb.expect_exam_start_time_ >= #{startTime} AND eb.expect_exam_end_time_ &lt;= '' AND eb.name_ LIKE CONCAT('%','','%')
-		AND eb.status_ = ''
+		<include refid="queryExamRoomPageSql"/>
+		ORDER BY eb.expect_exam_start_time_ DESC
+		<include refid="global.limit"/>
 	</select>
 </mapper>

+ 9 - 2
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml

@@ -11,6 +11,7 @@
 		<result column="examination_basic_id_" property="examinationBasicId" />
 		<result column="exam_room_id_" property="examRoomId" />
 		<result column="student_id_" property="studentId" />
+		<result column="classroom_switch_" property="classroomSwitch" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler"/>
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="tenant_id_" property="tenantId" />
@@ -39,6 +40,9 @@
 			<if test="examinationBasicId != null">
 				examination_basic_id_ = #{examinationBasicId},
 			</if>
+			<if test="classroomSwitch != null">
+				classroom_switch_ = #{classroomSwitch,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+			</if>
 			<if test="id != null">
 				id_ = #{id},
 			</if>
@@ -54,8 +58,11 @@
 				update_time_ = NOW()
 		</set> WHERE id_ = #{id}
 	</update>
-	
-	<!-- 根据主键删除一条记录 -->
+    <update id="switchClassRoom">
+
+	</update>
+
+    <!-- 根据主键删除一条记录 -->
 	<delete id="delete" >
 		DELETE FROM exam_room_student_relation WHERE id_ = #{id} 
 	</delete>