Joburgess 5 anni fa
parent
commit
6b5d212896

+ 12 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamReview.java

@@ -1,5 +1,6 @@
 package com.keao.edu.user.entity;
 
+import com.keao.edu.auth.api.entity.SysUser;
 import com.keao.edu.user.enums.YesOrNoEnum;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -21,6 +22,8 @@ public class ExamReview {
 	/**  */
 	@ApiModelProperty(value = "教师编号")
 	private Integer teacherId;
+
+	private SysUser teacher;
 	
 	/**  */
 	@ApiModelProperty(value = "学员编号")
@@ -69,7 +72,15 @@ public class ExamReview {
 	public Long getId(){
 		return this.id;
 	}
-			
+
+	public SysUser getTeacher() {
+		return teacher;
+	}
+
+	public void setTeacher(SysUser teacher) {
+		this.teacher = teacher;
+	}
+
 	public void setExaminationBasicId(Integer examinationBasicId){
 		this.examinationBasicId = examinationBasicId;
 	}

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

@@ -1,17 +1,17 @@
 package com.keao.edu.user.page;
 
 import com.keao.edu.common.page.QueryInfo;
-import com.keao.edu.user.enums.ExamStatusEnum;
 import com.keao.edu.user.enums.StudentRegistrationStatusEnum;
 import io.swagger.annotations.ApiModelProperty;
 
-import java.util.Date;
-
 public class ExamReviewQueryInfo extends QueryInfo {
 
     @ApiModelProperty(value = "考试项目编号")
     private Integer examinationBaseId;
 
+    @ApiModelProperty(value = "学员报名编号")
+    private Long registId;
+
     @ApiModelProperty(value = "准考证号")
     private String cardNo;
 
@@ -42,6 +42,14 @@ public class ExamReviewQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "评审时间")
     private String endTime;
 
+    public Long getRegistId() {
+        return registId;
+    }
+
+    public void setRegistId(Long registId) {
+        this.registId = registId;
+    }
+
     public String getStartTime() {
         return startTime;
     }

+ 9 - 8
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamReviewServiceImpl.java

@@ -8,19 +8,20 @@ import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.service.impl.BaseServiceImpl;
 import com.keao.edu.user.dao.ExamReviewDao;
 import com.keao.edu.user.dto.ExamReviewDto;
-import com.keao.edu.user.dto.ExamRoomStudentRelationDto;
 import com.keao.edu.user.entity.ExamReview;
 import com.keao.edu.user.entity.Subject;
 import com.keao.edu.user.enums.YesOrNoEnum;
 import com.keao.edu.user.page.ExamReviewQueryInfo;
 import com.keao.edu.user.service.ExamReviewService;
 import com.keao.edu.util.collection.MapUtil;
-import org.apache.poi.ss.formula.functions.T;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.*;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
 import java.util.stream.Collectors;
 
 @Service
@@ -42,8 +43,8 @@ public class ExamReviewServiceImpl extends BaseServiceImpl<Long, ExamReview> imp
 		Map<String, Object> params = new HashMap<String, Object>();
 		MapUtil.populateMap(params, queryInfo);
 
-		List<Integer> nextLevelOrganIds = organizationService.getChildOrganIds(queryInfo.getOrganId(), true);
-		params.put("organIds", nextLevelOrganIds);
+//		List<Integer> nextLevelOrganIds = organizationService.getChildOrganIds(queryInfo.getOrganId(), true);
+//		params.put("organIds", nextLevelOrganIds);
 
 		List<ExamReviewDto> dataList = null;
 		int count = examReviewDao.countExamResult(params);
@@ -51,12 +52,12 @@ public class ExamReviewServiceImpl extends BaseServiceImpl<Long, ExamReview> imp
 			pageInfo.setTotal(count);
 			params.put("offset", pageInfo.getOffset());
 			dataList = examReviewDao.findExamResult(params);
-			List<Integer> studentIds = dataList.stream().map(ExamReviewDto::getStudentId).collect(Collectors.toList());
+			List<Integer> teacherIds = dataList.stream().map(ExamReviewDto::getTeacherId).collect(Collectors.toList());
 			List<Integer> subjectIds = dataList.stream().map(e->e.getExamRegistration().getSubjectId()).collect(Collectors.toList());
-			Map<Integer, String> studentIdNameMap = this.getMap("sys_user", "id_", "real_name_", studentIds, Integer.class, String.class);
+			Map<Integer, String> teacherIdNameMap = this.getMap("sys_user", "id_", "real_name_", teacherIds, Integer.class, String.class);
 			Map<Integer, String> subjectIdNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
 			for (ExamReviewDto e : dataList) {
-				e.setStudentInfo(new SysUser(e.getStudentId(),studentIdNameMap.get(e.getStudentId())));
+				e.setTeacher(new SysUser(e.getStudentId(),teacherIdNameMap.get(e.getStudentId())));
 				e.getExamRegistration().setSubject(new Subject(e.getExamRegistration().getSubjectId(), subjectIdNameMap.get(e.getExamRegistration().getSubjectId())));
 			}
 		}

+ 13 - 10
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamReviewMapper.xml

@@ -13,7 +13,7 @@
 		<result column="teacher_id_" property="teacherId" />
 		<result column="student_id_" property="studentId" />
 		<result column="evaluation_content_" property="evaluationContent" />
-		<result column="evaluation_result_" property="evaluationResult" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler"/>
+		<result column="evaluation_result_" property="evaluationResult"/>
 		<result column="create_time_" property="createTime" />
 		<result column="update_time_" property="updateTime" />
 		<result column="tenant_id_" property="tenantId" />
@@ -40,7 +40,7 @@
 		INSERT INTO exam_review (id_,examination_basic_id_,teacher_id_,student_id_,evaluation_content_,
 		evaluation_result_,create_time_,update_time_,tenant_id_,enable_edit_,exam_registration_id_)
 		VALUES(#{id},#{examinationBasicId},#{teacherId},#{studentId},#{evaluationContent},
-		#{evaluationResult,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},NOW(),NOW(),
+		#{evaluationResult},NOW(),NOW(),
 		#{tenantId},#{enableEdit,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},#{examRegistrationId})
 	</insert>
 	
@@ -58,7 +58,7 @@
 				teacher_id_ = #{teacherId},
 			</if>
 			<if test="evaluationResult != null">
-				evaluation_result_ = #{evaluationResult,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+				evaluation_result_ = #{evaluationResult},
 			</if>
 			<if test="tenantId != null">
 				tenant_id_ = #{tenantId},
@@ -101,6 +101,9 @@
 					#{organId}
 				</foreach>
 			</if>
+			<if test="registId!=null">
+				AND er.exam_registration_id_=#{registId}
+			</if>
 			<if test="examinationBaseId!=null">
 				AND ere.examination_basic_id_ = #{examinationBaseId}
 			</if>
@@ -123,26 +126,26 @@
 	</sql>
 	<select id="findExamResult" resultMap="ExamReviewDto">
 		SELECT
+			er.*,
 			ere.id_ regist_id_,
 			ere.student_id_ regist_student_id_,
 			ere.organ_id_ regist_organ_id_,
 			ere.subject_id_ regist_subject_id_,
 			ere.level_ regist_level_,
-			ere.status_ regist_status_,
-			er.evaluation_result_
+			ere.status_ regist_status_
 		FROM
-			exam_registration ere
-			LEFT JOIN exam_review er ON ere.student_id_ = er.student_id_ AND ere.examination_basic_id_=er.examination_basic_id_
+			exam_review er
+			LEFT JOIN exam_registration ere ON ere.id_=er.exam_registration_id_
 		<include refid="findExamResultCondition"/>
 		ORDER BY ere.id_ DESC
 		<include refid="global.limit"/>
 	</select>
 	<select id="countExamResult" resultType="int">
 		SELECT
-			COUNT(ere.id_)
+			COUNT(er.id_)
 		FROM
-			exam_registration ere
-			LEFT JOIN exam_review er ON ere.student_id_ = er.student_id_ AND ere.examination_basic_id_=er.examination_basic_id_
+			exam_review er
+			LEFT JOIN exam_registration ere ON ere.id_=er.exam_registration_id_
 		<include refid="findExamResultCondition"/>
 	</select>
 </mapper>