Joburgess 5 éve
szülő
commit
73c5a660e2

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

@@ -68,6 +68,6 @@ public interface ExamRoomStudentRelationDao extends BaseDAO<Long, ExamRoomStuden
      * @param studentId
      * @return
      */
-    ExamRoomStudentRelation getExamRoomStudentRelations(@Param("basicId") Integer basicId, @Param("roomId") String roomId, @Param("studentId") Integer studentId);
+    List<ExamRoomStudentRelation> getExamRoomStudentRelations(@Param("basicId") Integer basicId, @Param("roomId") String roomId, @Param("studentId") Integer studentId);
 
 }

+ 12 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamTeacherSalaryDao.java

@@ -3,8 +3,19 @@ package com.keao.edu.user.dao;
 
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.user.entity.ExamTeacherSalary;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 public interface ExamTeacherSalaryDao extends BaseDAO<Long, ExamTeacherSalary> {
 
-	
+    /**
+     * @describe 获取指定考级项目下的老师分润设置
+     * @author Joburgess
+     * @date 2020.07.02
+     * @param examId:
+     * @return java.util.List<com.keao.edu.user.entity.ExamTeacherSalary>
+     */
+    List<ExamTeacherSalary> queryWithExam(@Param("examId") Integer examId);
+
 }

+ 9 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamTeacherSalaryServiceImpl.java

@@ -15,7 +15,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -42,7 +44,13 @@ public class ExamTeacherSalaryServiceImpl extends BaseServiceImpl<Long, ExamTeac
 		if(CollectionUtils.isEmpty(examRooms)){
 			return;
 		}
-		ExamRoomStudentRelation examRoomStudentRelations = examRoomStudentRelationDao.getExamRoomStudentRelations(examId, null, null);
+		List<ExamRoomStudentRelation> examRoomStudentRelations = examRoomStudentRelationDao.getExamRoomStudentRelations(examId, null, null);
+		Map<Long, List<ExamRoomStudentRelation>> examRoomStudentsMap = new HashMap<>();
+		if(!CollectionUtils.isEmpty(examRoomStudentRelations)){
+			examRoomStudentsMap=examRoomStudentRelations.stream().collect(Collectors.groupingBy(ExamRoomStudentRelation::getExamRoomId));
+		}
+		List<ExamTeacherSalary> examTeacherSalaries = examTeacherSalaryDao.queryWithExam(examId);
+		Map<Integer, ExamTeacherSalary> teacherIdSalaryMap = examTeacherSalaries.stream().collect(Collectors.toMap(ExamTeacherSalary::getTeacherId, e -> e));
 
 	}
 }

+ 3 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamTeacherSalaryMapper.xml

@@ -97,4 +97,7 @@
 		SELECT COUNT(*) FROM exam_teacher_salary
 		<include refid="queryPageCondition"/>
 	</select>
+    <select id="queryWithExam" resultMap="ExamTeacherSalary">
+		SELECT * FROM exam_teacher_salary WHERE examination_basic_id_=#{examId}
+	</select>
 </mapper>