浏览代码

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationMapper.xml
周箭河 5 年之前
父节点
当前提交
7392e56255
共有 75 个文件被更改,包括 818 次插入676 次删除
  1. 3 3
      edu-auth/edu-auth-api/src/main/java/com/keao/edu/auth/api/entity/SysUser.java
  2. 1 0
      edu-auth/edu-auth-server/src/main/java/com/keao/edu/auth/core/handler/BaseAuthenticationSuccessEventHandler.java
  3. 4 0
      edu-auth/edu-auth-server/src/main/java/com/keao/edu/auth/dal/dao/SysUserDao.java
  4. 10 2
      edu-auth/edu-auth-server/src/main/java/com/keao/edu/auth/service/SysUserService.java
  5. 10 0
      edu-auth/edu-auth-server/src/main/java/com/keao/edu/auth/service/impl/SysUserServiceImpl.java
  6. 10 8
      edu-auth/edu-auth-server/src/main/resources/config/mybatis/SysUserMapper.xml
  7. 4 4
      edu-cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml
  8. 5 0
      edu-common/src/main/java/com/keao/edu/common/tenant/TenantContextHolder.java
  9. 1 1
      edu-datasource/src/main/resources/config/mybatis/DatabaseSourceMapper.xml
  10. 11 11
      edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/Impl/RoomServiceImpl.java
  11. 4 5
      edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/entity/ExamRoom.java
  12. 7 7
      edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/entity/ExamRoomStudentRelation.java
  13. 4 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/EmployeeController.java
  14. 1 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamOrderController.java
  15. 15 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRoomController.java
  16. 2 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRoomStudentRelationController.java
  17. 1 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamTeacherSalaryController.java
  18. 2 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/OrganizationController.java
  19. 2 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/TeacherController.java
  20. 6 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/TenantInfoController.java
  21. 2 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamOrganizationRelationDao.java
  22. 12 3
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRegistrationDao.java
  23. 1 3
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRegistrationPaymentDao.java
  24. 12 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRoomDao.java
  25. 1 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRoomStudentRelationDao.java
  26. 2 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamTeacherSalaryDao.java
  27. 1 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExaminationBasicDao.java
  28. 8 8
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamCertification.java
  29. 6 6
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamManualLedger.java
  30. 8 8
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamMusicTheory.java
  31. 6 7
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamRegistration.java
  32. 8 8
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamRegistrationPayment.java
  33. 7 7
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamTeacherSalary.java
  34. 8 8
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExaminationBasic.java
  35. 7 7
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/StudentExamResult.java
  36. 3 4
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/page/ExamRoomQueryInfo.java
  37. 1 5
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRegistrationPaymentService.java
  38. 9 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRoomService.java
  39. 2 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRoomStudentRelationService.java
  40. 2 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamTeacherSalaryService.java
  41. 8 7
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/EmployeeServiceImpl.java
  42. 2 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamCertificationServiceImpl.java
  43. 1 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRegistrationPaymentServiceImpl.java
  44. 2 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRegistrationServiceImpl.java
  45. 29 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java
  46. 47 17
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java
  47. 4 4
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamTeacherSalaryServiceImpl.java
  48. 1 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExaminationBasicServiceImpl.java
  49. 8 7
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/OrganizationServiceImpl.java
  50. 2 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/StudentExamResultServiceImpl.java
  51. 4 6
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/StudentServiceImpl.java
  52. 7 7
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/TeacherServiceImpl.java
  53. 1 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/TenantInfoServiceImpl.java
  54. 4 0
      edu-user/edu-user-server/src/main/resources/application.yml
  55. 11 2
      edu-user/edu-user-server/src/main/resources/config/mybatis/EmployeeMapper.xml
  56. 1 1
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamCertificationMapper.xml
  57. 4 1
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamLocationMapper.xml
  58. 1 1
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamMusicTheoryMapper.xml
  59. 1 1
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamOrganizationRelationMapper.xml
  60. 380 419
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationMapper.xml
  61. 1 1
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationPaymentMapper.xml
  62. 1 1
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamReviewMapper.xml
  63. 40 5
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomMapper.xml
  64. 12 11
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml
  65. 1 1
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamSubjectMapper.xml
  66. 1 1
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamSubjectSongMapper.xml
  67. 11 11
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamTeacherSalaryMapper.xml
  68. 1 1
      edu-user/edu-user-server/src/main/resources/config/mybatis/OrganizationMapper.xml
  69. 6 5
      edu-user/edu-user-server/src/main/resources/config/mybatis/StudentExamResultMapper.xml
  70. 2 2
      edu-user/edu-user-server/src/main/resources/config/mybatis/StudentMapper.xml
  71. 5 6
      edu-user/edu-user-server/src/main/resources/config/mybatis/SubjectMapper.xml
  72. 1 1
      edu-user/edu-user-server/src/main/resources/config/mybatis/SysConfigMapper.xml
  73. 4 5
      edu-user/edu-user-server/src/main/resources/config/mybatis/SysUserMapper.xml
  74. 1 1
      edu-user/edu-user-server/src/main/resources/config/mybatis/TenantInfoMapper.xml
  75. 4 4
      edu-user/edu-user-server/src/main/resources/logback-spring.xml

+ 3 - 3
edu-auth/edu-auth-api/src/main/java/com/keao/edu/auth/api/entity/SysUser.java

@@ -97,7 +97,7 @@ public class SysUser implements Serializable{
 	@ApiModelProperty(value = "用户角色",required = false)
 	private Set<Integer> roles;
 
-	private String tenantId;
+//	private String tenantId;
 
 	public SysUser() {
 	}
@@ -107,13 +107,13 @@ public class SysUser implements Serializable{
 		this.realName = realName;
 	}
 
-	public String getTenantId() {
+	/*public String getTenantId() {
 		return tenantId;
 	}
 
 	public void setTenantId(String tenantId) {
 		this.tenantId = tenantId;
-	}
+	}*/
 
 	public String getRealName() {
 		return realName;

+ 1 - 0
edu-auth/edu-auth-server/src/main/java/com/keao/edu/auth/core/handler/BaseAuthenticationSuccessEventHandler.java

@@ -124,6 +124,7 @@ public class BaseAuthenticationSuccessEventHandler extends SavedRequestAwareAuth
 			map.put("password", StringUtils.isEmpty(sysUser.getPassword())?false:true);
 			map.put("authentication",oAuth2AccessToken);
 			map.put("tenantId", sysUserService.queryUserTenantId(clientId,sysUser.getId()));
+			map.put("organId", sysUserService.queryUserOrganId(clientId,sysUser.getId()));
 
 			response.setContentType("application/json; charset=utf-8");
 			HttpResponseResult result = new HttpResponseResult(true, HttpStatus.OK.value(), map, "");

+ 4 - 0
edu-auth/edu-auth-server/src/main/java/com/keao/edu/auth/dal/dao/SysUserDao.java

@@ -62,4 +62,8 @@ public interface SysUserDao extends BaseDAO<Integer, SysUser> {
     Integer getEmployeeTenantId(Integer userId);
 
 	Integer getTeacherTenantId(Integer userId);
+
+	Integer getTeacherOrganId(Integer userId);
+
+	Integer getEmployeeOrganId(Integer userId);
 }

+ 10 - 2
edu-auth/edu-auth-server/src/main/java/com/keao/edu/auth/service/SysUserService.java

@@ -106,8 +106,16 @@ public interface SysUserService extends BaseService<Integer, SysUser> {
 	/**
 	 * 获取用户tenantId
 	 * @param clientId
-	 * @param id
+	 * @param userId
+	 * @return
+	 */
+	Integer queryUserTenantId(String clientId, Integer userId);
+
+	/**
+	 * 获取用户organId
+	 * @param clientId
+	 * @param userId
 	 * @return
 	 */
-	Integer queryUserTenantId(String clientId, Integer id);
+    Integer queryUserOrganId(String clientId, Integer userId);
 }

+ 10 - 0
edu-auth/edu-auth-server/src/main/java/com/keao/edu/auth/service/impl/SysUserServiceImpl.java

@@ -162,4 +162,14 @@ public class SysUserServiceImpl extends BaseServiceImpl<Integer, SysUser> implem
 		return null;
 	}
 
+	@Override
+	public Integer queryUserOrganId(String clientId, Integer userId) {
+		if(StringUtils.equalsIgnoreCase(clientId,"SYSTEM")){
+			return sysUserDao.getEmployeeOrganId(userId);
+		}else if(StringUtils.equalsIgnoreCase(clientId,"TEACHER")){
+			return sysUserDao.getTeacherOrganId(userId);
+		}
+		return null;
+	}
+
 }

+ 10 - 8
edu-auth/edu-auth-server/src/main/resources/config/mybatis/SysUserMapper.xml

@@ -29,13 +29,12 @@
         <result column="id_card_no_" property="idCardNo"/>
         <result column="wechat_id_" property="wechatId"/>
         <result column="is_super_admin_" property="isSuperAdmin"/>
-        <result column="tenant_id_" property="tenantId"/>
+        <!--<result column="tenant_id_" property="tenantId"/>-->
     </resultMap>
 
     <!-- 查询条件 -->
     <sql id="queryCondition">
         <where>
-            tenant_id_ = #{tenantId}
             <if test="userStartDate != null">
                 AND create_time_ &gt;= #{createStartDate}
             </if>
@@ -55,7 +54,7 @@
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="SysUser">
-		SELECT * FROM sys_user WHERE tenant_id_ = #{tenantId} ORDER BY id_
+		SELECT * FROM sys_user ORDER BY id_
 	</select>
 
     <!-- 向数据库增加一条记录 -->
@@ -63,9 +62,9 @@
             keyProperty="id">
         INSERT INTO sys_user
         (is_super_admin_,im_token_,id_,username_,salt_,phone_,avatar_,create_time_,update_time_,wx_openid_,qq_openid_,user_type_,
-        gender_,nation_,birthdate_,email_,id_card_no_,wechat_id_,real_name_,tenant_id_)
+        gender_,nation_,birthdate_,email_,id_card_no_,wechat_id_,real_name_)
         VALUES(#{isSuperAdmin},#{imToken},#{id},#{username},#{salt},#{phone},#{avatar},now(),now(),#{wxOpenid},#{qqOpenid},#{userType},
-        #{gender},#{nation},#{birthdate},#{email},#{idCardNo},#{wechatId},#{realName},#{tenantId})
+        #{gender},#{nation},#{birthdate},#{email},#{idCardNo},#{wechatId},#{realName})
     </insert>
 
     <!-- 根据主键查询一条记录 -->
@@ -132,9 +131,6 @@
             <if test="isSuperAdmin != null">
                 is_super_admin_ = #{isSuperAdmin},
             </if>
-            <if test="tenantId != null">
-                tenant_id_ = #{tenantId},
-            </if>
         </set>
         WHERE id_ = #{id}
     </update>
@@ -194,5 +190,11 @@
     <select id="getTeacherTenantId" resultType="java.lang.Integer">
         SELECT t.tenant_id_ FROM teacher t WHERE t.user_id_ = #{userId} LIMIT 1
     </select>
+    <select id="getEmployeeOrganId" resultType="java.lang.Integer">
+        SELECT e.organ_id_ FROM employee e WHERE e.user_id_ = #{userId} LIMIT 1
+    </select>
+    <select id="getTeacherOrganId" resultType="java.lang.Integer">
+        SELECT t.organ_id_ FROM teacher t WHERE t.user_id_ = #{userId} LIMIT 1
+    </select>
 
 </mapper>

+ 4 - 4
edu-cms/src/main/resources/config/mybatis/SysNewsInformationMapper.xml

@@ -29,7 +29,7 @@
 			<if test="type != null">
 				and type_ = #{type}
 			</if>
-			<if test="tenantId != null">
+			<if test="tenantId != null and tenantId != 0">
 				and tenant_id_ = #{tenantId}
 			</if>
 			<if test="status != null">
@@ -70,7 +70,7 @@
 			<if test="title != null">
 				title_ = #{title},
 			</if>
-			<if test="tenantId != null">
+			<if test="tenantId != null and tenantId != 0">
 				tenant_id_ = #{tenantId},
 			</if>
 			<if test="updateTime != null">
@@ -154,7 +154,7 @@
 		<if test="search != null">
 			and title_ like '%' #{search} '%'
 		</if>
-		<if test="tenantId != null">
+		<if test="tenantId != null and tenantId != 0">
 			and tenant_id_ = #{tenantId}
 		</if>
 		<choose>
@@ -185,7 +185,7 @@
 		<if test="search != null">
 			and title_ like '%' #{search} '%'
 		</if>
-		<if test="tenantId != null">
+		<if test="tenantId != null and tenantId != 0">
 			and tenant_id_ = #{tenantId}
 		</if>
 		<choose>

+ 5 - 0
edu-common/src/main/java/com/keao/edu/common/tenant/TenantContextHolder.java

@@ -1,6 +1,8 @@
 package com.keao.edu.common.tenant;
 
 
+import org.apache.commons.lang3.StringUtils;
+
 public class TenantContextHolder {
 	
 
@@ -15,6 +17,9 @@ public class TenantContextHolder {
 	 * @return
 	 */
 	public static String getTenantId() {
+		if (StringUtils.isEmpty(tenantContextHolder.get())){
+			return "0";
+		}
 		return tenantContextHolder.get();
 	}
 

+ 1 - 1
edu-datasource/src/main/resources/config/mybatis/DatabaseSourceMapper.xml

@@ -49,7 +49,7 @@
 			<if test="id != null">
 				id_ = #{id},
 			</if>
-			<if test="tenantId != null">
+			<if test="tenantId != null and tenantId != 0">
 				tenant_id_ = #{tenantId},
 			</if>
 			<if test="url != null">

+ 11 - 11
edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/Impl/RoomServiceImpl.java

@@ -131,7 +131,7 @@ public class RoomServiceImpl implements RoomService {
             }else if(isAssistant){
                 roleEnum = RoleEnum.AssistantTeacher;
             }else {
-                ExamRoomStudentRelation examRoomStudentRelation = eduUserFeignService.getExamRoomStudentRelation(examRoom.getExaminationBasicId(), roomId, sysUser.getId());
+                ExamRoomStudentRelation examRoomStudentRelation = eduUserFeignService.getExamRoomStudentRelation(examRoom.getExaminationBasicId().intValue(), roomId, sysUser.getId());
                 if(examRoomStudentRelation == null){
                     throw new BizException("学员考试数据异常");
                 }
@@ -154,7 +154,7 @@ public class RoomServiceImpl implements RoomService {
             RoomMember roomMember = memberList.get(0);
             roleEnum = RoleEnum.getEnumByValue(roomMember.getRole());
             if(roleEnum == Student){
-                ExamRoomStudentRelation examRoomStudentRelation = eduUserFeignService.getExamRoomStudentRelation(examRoom.getExaminationBasicId(), roomId, sysUser.getId());
+                ExamRoomStudentRelation examRoomStudentRelation = eduUserFeignService.getExamRoomStudentRelation(examRoom.getExaminationBasicId().intValue(), roomId, sysUser.getId());
                 if(examRoomStudentRelation == null){
                     throw new BizException("学员考试数据异常");
                 }
@@ -228,7 +228,7 @@ public class RoomServiceImpl implements RoomService {
             }
         }
         if(userId.equals(examRoom.getMainTeacherUserId()) || isAssistant){
-            TeacherAttendance attendance = teacherAttendanceDao.findByTeacherIdAndExaminationBasicIdAndExamRoomId(userId, examRoom.getExaminationBasicId(), examRoom.getId());
+            TeacherAttendance attendance = teacherAttendanceDao.findByTeacherIdAndExaminationBasicIdAndExamRoomId(userId, examRoom.getExaminationBasicId().intValue(), examRoom.getId());
             if(attendance != null){
                 return;
             }
@@ -238,10 +238,10 @@ public class RoomServiceImpl implements RoomService {
             teacherAttendance.setTeacherId(userId);
             teacherAttendance.setTenantId(examRoom.getTenantId());
             teacherAttendance.setCreateTime(date);
-            teacherAttendance.setExaminationBasicId(examRoom.getExaminationBasicId());
+            teacherAttendance.setExaminationBasicId(examRoom.getExaminationBasicId().intValue());
             teacherAttendanceDao.save(teacherAttendance);
         }else {
-            StudentAttendance attendance = studentAttendanceDao.findByUserIdAndExaminationBasicIdAndExamRoomId(userId, examRoom.getExaminationBasicId(), examRoom.getId());
+            StudentAttendance attendance = studentAttendanceDao.findByUserIdAndExaminationBasicIdAndExamRoomId(userId, examRoom.getExaminationBasicId().intValue(), examRoom.getId());
             if(attendance != null){
                 return;
             }
@@ -250,7 +250,7 @@ public class RoomServiceImpl implements RoomService {
             studentAttendance.setSignInTime(date);
             studentAttendance.setUserId(userId);
             studentAttendance.setCreateTime(date);
-            studentAttendance.setExaminationBasicId(examRoom.getExaminationBasicId());
+            studentAttendance.setExaminationBasicId(examRoom.getExaminationBasicId().intValue());
             studentAttendanceDao.save(studentAttendance);
         }
     }
@@ -271,7 +271,7 @@ public class RoomServiceImpl implements RoomService {
             }
         }
         if(userId.equals(examRoom.getMainTeacherUserId()) || isAssistant){
-            TeacherAttendance attendance = teacherAttendanceDao.findByTeacherIdAndExaminationBasicIdAndExamRoomId(userId, examRoom.getExaminationBasicId(), examRoom.getId());
+            TeacherAttendance attendance = teacherAttendanceDao.findByTeacherIdAndExaminationBasicIdAndExamRoomId(userId, examRoom.getExaminationBasicId().intValue(), examRoom.getId());
             if(attendance == null){
                 attendance = new TeacherAttendance();
                 attendance.setExamRoomId(examRoom.getId());
@@ -280,14 +280,14 @@ public class RoomServiceImpl implements RoomService {
                 attendance.setTeacherId(userId);
                 attendance.setTenantId(examRoom.getTenantId());
                 attendance.setCreateTime(date);
-                attendance.setExaminationBasicId(examRoom.getExaminationBasicId());
+                attendance.setExaminationBasicId(examRoom.getExaminationBasicId().intValue());
                 teacherAttendanceDao.save(attendance);
             }else {
                 attendance.setSignOutTime(date);
                 teacherAttendanceDao.saveAndFlush(attendance);
             }
         }else {
-            StudentAttendance attendance = studentAttendanceDao.findByUserIdAndExaminationBasicIdAndExamRoomId(userId, examRoom.getExaminationBasicId(), examRoom.getId());
+            StudentAttendance attendance = studentAttendanceDao.findByUserIdAndExaminationBasicIdAndExamRoomId(userId, examRoom.getExaminationBasicId().intValue(), examRoom.getId());
             if(attendance == null){
                 attendance = new StudentAttendance();
                 attendance.setExamRoomId(examRoom.getId());
@@ -295,7 +295,7 @@ public class RoomServiceImpl implements RoomService {
                 attendance.setSignOutTime(date);
                 attendance.setUserId(userId);
                 attendance.setCreateTime(date);
-                attendance.setExaminationBasicId(examRoom.getExaminationBasicId());
+                attendance.setExaminationBasicId(examRoom.getExaminationBasicId().intValue());
                 studentAttendanceDao.save(attendance);
             }else {
                 attendance.setSignOutTime(date);
@@ -1407,4 +1407,4 @@ public class RoomServiceImpl implements RoomService {
         }
         return result;
     }
-}
+}

+ 4 - 5
edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/entity/ExamRoom.java

@@ -15,7 +15,7 @@ public class ExamRoom {
 	private Long id;
 
 	@ApiModelProperty(value = "考级项目编号")
-	private Integer examinationBasicId;
+	private Long examinationBasicId;
 	
 	@ApiModelProperty(value = "考试模式")
 	private ExamModeEnum examMode;
@@ -55,8 +55,7 @@ public class ExamRoom {
 	private YesOrNoEnum examPlanPushFlag;
 
 	private Integer examRoomStudentNum;
-	
-	/**  */
+
 	private boolean delFlag;
 	
 	/**  */
@@ -76,11 +75,11 @@ public class ExamRoom {
 		return this.id;
 	}
 
-	public Integer getExaminationBasicId() {
+	public Long getExaminationBasicId() {
 		return examinationBasicId;
 	}
 
-	public void setExaminationBasicId(Integer examinationBasicId) {
+	public void setExaminationBasicId(Long examinationBasicId) {
 		this.examinationBasicId = examinationBasicId;
 	}
 

+ 7 - 7
edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/entity/ExamRoomStudentRelation.java

@@ -12,7 +12,7 @@ public class ExamRoomStudentRelation {
 	private Long id;
 
 	@ApiModelProperty(value = "考级项目编号")
-	private Integer examinationBasicId;
+	private Long examinationBasicId;
 
 	@ApiModelProperty(value = "学员报名编号")
 	private Long examRegistrationId;
@@ -47,13 +47,13 @@ public class ExamRoomStudentRelation {
 	public Long getId(){
 		return this.id;
 	}
-			
-	public void setExaminationBasicId(Integer examinationBasicId){
-		this.examinationBasicId = examinationBasicId;
+
+	public Long getExaminationBasicId() {
+		return examinationBasicId;
 	}
-	
-	public Integer getExaminationBasicId(){
-		return this.examinationBasicId;
+
+	public void setExaminationBasicId(Long examinationBasicId) {
+		this.examinationBasicId = examinationBasicId;
 	}
 
 	public Long getExamRegistrationId() {

+ 4 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/EmployeeController.java

@@ -6,6 +6,7 @@ import com.keao.edu.auth.api.entity.SysUser;
 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.tenant.TenantContextHolder;
 import com.keao.edu.user.entity.Employee;
 import com.keao.edu.user.page.EmployeeQueryInfo;
 import com.keao.edu.user.service.EmployeeService;
@@ -43,8 +44,9 @@ public class EmployeeController extends BaseController {
 	@ApiOperation("新增员工")
 	@PostMapping(value = "/add")
 	public HttpResponseResult add(@RequestBody Employee employee) {
-        SysUser sysUser = sysUserFeignService.queryUserInfo();
-        employee.setOrganId(sysUser.getId());
+//        SysUser sysUser = sysUserFeignService.queryUserInfo();
+//        employee.setOrganId(sysUser.getId());
+		employee.setTenantId(TenantContextHolder.getTenantId());
 	    employeeService.add(employee);
 		return succeed();
 	}

+ 1 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamOrderController.java

@@ -11,7 +11,6 @@ import com.keao.edu.thirdparty.adapay.Payment;
 import com.keao.edu.thirdparty.yqpay.Msg;
 import com.keao.edu.user.dto.ExamPaymentInfo;
 import com.keao.edu.user.dto.ExamRegistrationPaymentDto;
-import com.keao.edu.user.dto.StudentExamPaymentDto;
 import com.keao.edu.user.entity.Employee;
 import com.keao.edu.user.entity.ExamRegistrationPayment;
 import com.keao.edu.user.enums.TransStatusEnum;
@@ -63,7 +62,7 @@ public class ExamOrderController extends BaseController {
     @ApiImplicitParams({
             @ApiImplicitParam(name = "examinationBasicId", value = "项目id", required = true, dataType = "Integer")})
     @GetMapping(value = "/getExamIngOrder")
-    public HttpResponseResult<ExamRegistrationPayment> getExamIngOrder(Integer examinationBasicId) {
+    public HttpResponseResult<ExamRegistrationPayment> getExamIngOrder(Long examinationBasicId) {
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         return succeed(examRegistrationPaymentService.getExamIngOrder(examinationBasicId, sysUser.getId()));
     }

+ 15 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRoomController.java

@@ -46,6 +46,20 @@ public class ExamRoomController extends BaseController {
         return succeed(examRoomService.queryExamRoomPage(queryInfo));
     }
 
+    @ApiOperation("获取考级项目教室列表")
+    @GetMapping(value = "/queryExamRooms")
+    public HttpResponseResult<PageInfo<ExamRoomDto>> queryExamRooms(ExamRoomQueryInfo queryInfo) {
+        SysUser sysUser = sysUserFeignService.queryUserInfo();
+        if(!sysUser.getIsSuperAdmin()&&Objects.isNull(queryInfo.getOrganId())){
+            Employee employee = employeeService.get(sysUser.getId());
+            if(Objects.isNull(employee)){
+                return failed("用户信息异常");
+            }
+            queryInfo.setOrganId(employee.getOrganId());
+        }
+        return succeed(examRoomService.queryExamRooms(queryInfo));
+    }
+
     @ApiOperation("更新考场")
     @PostMapping(value = "/update")
     public HttpResponseResult update(@RequestBody ExamRoom examRoom){
@@ -99,7 +113,7 @@ public class ExamRoomController extends BaseController {
 
     @ApiOperation("获取考场统计信息")
     @GetMapping(value = "/getExamRoomStatisticsInfo")
-    public HttpResponseResult<ExamRoomStatisticsDto> getExamRoomStatisticsInfo(Integer examId){
+    public HttpResponseResult<ExamRoomStatisticsDto> getExamRoomStatisticsInfo(Long examId){
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         return succeed(examRoomService.getExamRoomStatisticsInfo(sysUser.getId(), examId));
     }

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

@@ -48,8 +48,8 @@ public class ExamRoomStudentRelationController extends BaseController {
 
     @ApiOperation("给教室分配学员")
     @PostMapping(value = "/addStudentForRoom")
-    public HttpResponseResult addStudentForRoom(Long examRoomId, String studentIds){
-        examRoomStudentRelationService.addStudentForRoom(examRoomId, studentIds);
+    public HttpResponseResult addStudentForRoom(Long examRoomId, String registIds){
+        examRoomStudentRelationService.addStudentForRoom(examRoomId, registIds);
         return succeed();
     }
 

+ 1 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamTeacherSalaryController.java

@@ -52,7 +52,7 @@ public class ExamTeacherSalaryController extends BaseController {
 
     @ApiOperation("新增考级教师")
     @PostMapping(value = "/addExamTeacherSalary")
-    public HttpResponseResult addExamTeacherSalary(Integer examId, String teacherIdsStr) {
+    public HttpResponseResult addExamTeacherSalary(Long examId, String teacherIdsStr) {
         examTeacherSalaryService.addExamTeacherSalary(examId, teacherIdsStr);
         return succeed();
     }

+ 2 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/OrganizationController.java

@@ -6,6 +6,7 @@ import com.keao.edu.auth.api.entity.SysUser;
 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.tenant.TenantContextHolder;
 import com.keao.edu.user.entity.Organization;
 import com.keao.edu.user.page.OrganizationQueryInfo;
 import com.keao.edu.user.service.OrganizationService;
@@ -51,6 +52,7 @@ public class OrganizationController extends BaseController {
 	@PostMapping(value = "add")
     @PreAuthorize("@pcs.hasPermissions('organization/add')")
 	public HttpResponseResult addConfig(@RequestBody Organization organization) {
+		organization.setTenantId(TenantContextHolder.getTenantId());
 		organizationService.add(organization);
 		return succeed();
 	}

+ 2 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/TeacherController.java

@@ -5,6 +5,7 @@ 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.common.tenant.TenantContextHolder;
 import com.keao.edu.user.entity.Teacher;
 import com.keao.edu.user.page.TeacherQueryInfo;
 import com.keao.edu.user.service.TeacherService;
@@ -44,6 +45,7 @@ public class TeacherController extends BaseController {
 	@PostMapping(value = "add")
     @PreAuthorize("@pcs.hasPermissions('teacher/add')")
 	public HttpResponseResult add(@RequestBody Teacher teacher) {
+		teacher.setTenantId(TenantContextHolder.getTenantId());
 		return succeed(teacherService.add(teacher));
 	}
 

+ 6 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/TenantInfoController.java

@@ -14,6 +14,7 @@ import com.keao.edu.user.service.TenantInfoService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiOperation;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
@@ -39,7 +40,11 @@ public class TenantInfoController extends BaseController {
 	@GetMapping(value = "/query")
 	public HttpResponseResult<TenantInfo> query() {
 		String tenantId = TenantContextHolder.getTenantId();
-		return succeed(tenantInfoService.get(Integer.parseInt(tenantId)));
+		if(StringUtils.isNotEmpty(tenantId)){
+			return succeed(tenantInfoService.get(Integer.parseInt(tenantId)));
+		}else {
+			return succeed(new TenantInfo());
+		}
 	}
 
 	@ApiOperation("新增机构")

+ 2 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamOrganizationRelationDao.java

@@ -56,7 +56,7 @@ public interface ExamOrganizationRelationDao extends BaseDAO<Long, ExamOrganizat
      */
     List<ExamOrganizationRelation> getWithExam(@Param("examId") Integer examId);
 
-    List<ExamOrganizationRelation> getWithExams(@Param("examIds") List<Integer> examIds);
+    List<ExamOrganizationRelation> getWithExams(@Param("examIds") List<Long> examIds);
 
     /**
      * @param examId:
@@ -104,6 +104,6 @@ public interface ExamOrganizationRelationDao extends BaseDAO<Long, ExamOrganizat
      * @param OrganId
      * @return
      */
-    ExamOrganizationRelation getExamOrganizationRelation(@Param("examId") Integer examId, @Param("OrganId") Integer OrganId);
+    ExamOrganizationRelation getExamOrganizationRelation(@Param("examId") Long examId, @Param("OrganId") Integer OrganId);
 
 }

+ 12 - 3
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRegistrationDao.java

@@ -36,7 +36,7 @@ public interface ExamRegistrationDao extends BaseDAO<Long, ExamRegistration> {
      * @date 2020.06.30
      */
     int countInExamRoomStudentNum(@Param("organIds") List<Integer> organIds,
-                                  @Param("examId") Integer examId);
+                                  @Param("examId") Long examId);
 
     /**
      * @param organIds:
@@ -47,7 +47,7 @@ public interface ExamRegistrationDao extends BaseDAO<Long, ExamRegistration> {
      * @date 2020.06.30
      */
     int countTotalRegistrationStudentNumWithExam(@Param("organIds") List<Integer> organIds,
-                                                 @Param("examId") Integer examId);
+                                                 @Param("examId") Long examId);
 
     /**
      * @param selfOrganId: 本级合作单位编号
@@ -70,10 +70,19 @@ public interface ExamRegistrationDao extends BaseDAO<Long, ExamRegistration> {
      * @author Joburgess
      * @date 2020.07.02
      */
-    List<ExamRegistration> getWithExamAndStudents(@Param("examId") Integer examId,
+    List<ExamRegistration> getWithExamAndStudents(@Param("examId") Long examId,
                                                   @Param("studentIds") List<Integer> studentIds);
 
     /**
+     * @describe 获取指定报名记录
+     * @author Joburgess
+     * @date 2020.07.12
+     * @param registIds:
+     * @return java.util.List<com.keao.edu.user.entity.ExamRegistration>
+     */
+    List<ExamRegistration> getRegists(@Param("registIds") List<Long> registIds);
+
+    /**
      * COUNT学员报考记录
      *
      * @param params

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

@@ -2,11 +2,9 @@ package com.keao.edu.user.dao;
 
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.user.dto.ExamRegistrationPaymentDto;
-import com.keao.edu.user.dto.StudentExamPaymentDto;
 import com.keao.edu.user.entity.ExamRegistrationPayment;
 import com.keao.edu.user.enums.TransStatusEnum;
 import org.apache.ibatis.annotations.Param;
-import org.apache.poi.ss.formula.functions.T;
 
 import java.util.Date;
 import java.util.List;
@@ -21,7 +19,7 @@ public interface ExamRegistrationPaymentDao extends BaseDAO<Long, ExamRegistrati
      * @param userId
      * @return
      */
-    ExamRegistrationPayment getExamIngOrder(@Param("examinationBasicId") Integer examinationBasicId, @Param("userId") Integer userId);
+    ExamRegistrationPayment getExamIngOrder(@Param("examinationBasicId") Long examinationBasicId, @Param("userId") Integer userId);
 
     /**
      * 根据订单号获取订单

+ 12 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/ExamRoomDao.java

@@ -28,6 +28,16 @@ public interface ExamRoomDao extends BaseDAO<Long, ExamRoom> {
     List<ExamRoomDto> queryExamRoomPage(Map<String, Object> params);
 
     /**
+     * @describe 获取考级教师列表
+     * @author Joburgess
+     * @date 2020.07.12
+     * @param params:
+     * @return java.util.List<com.keao.edu.user.api.entity.ExamRoom>
+     */
+    List<ExamRoomDto> queryExamRoom(Map<String, Object> params);
+    int countExamRoom(Map<String, Object> params);
+
+    /**
      * @describe 删除指定教室
      * @author Joburgess
      * @date 2020.06.24
@@ -44,7 +54,7 @@ public interface ExamRoomDao extends BaseDAO<Long, ExamRoom> {
      * @return java.util.List<com.keao.edu.user.api.entity.ExamRoom>
      */
     List<ExamRoom> getWithExam(@Param("organIds") List<Integer> organIds,
-                                @Param("examId") Integer examId);
+                                @Param("examId") Long examId);
 
     int updateSL(ExamRoom examRoom);
 
@@ -67,6 +77,6 @@ public interface ExamRoomDao extends BaseDAO<Long, ExamRoom> {
      * @param subjectId:
      * @return java.util.List<com.keao.edu.user.api.entity.ExamRoom>
      */
-    List<ExamRoom> getWithExamAndSubject(@Param("examId") Integer examId,
+    List<ExamRoom> getWithExamAndSubject(@Param("examId") Long examId,
                                          @Param("subjectId") Integer subjectId);
 }

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

@@ -68,7 +68,7 @@ public interface ExamRoomStudentRelationDao extends BaseDAO<Long, ExamRoomStuden
      * @param studentId
      * @return
      */
-    List<ExamRoomStudentRelation> getExamRoomStudentRelations(@Param("basicId") Integer basicId, @Param("roomId") String roomId, @Param("studentId") Integer studentId);
+    List<ExamRoomStudentRelation> getExamRoomStudentRelations(@Param("basicId") Long basicId, @Param("roomId") String roomId, @Param("studentId") Integer studentId);
 
     /**
      * @describe 获取报名学员所在教室

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

@@ -28,7 +28,7 @@ public interface ExamTeacherSalaryDao extends BaseDAO<Long, ExamTeacherSalary> {
      * @param examId:
      * @return java.util.List<com.keao.edu.user.entity.ExamTeacherSalary>
      */
-    List<ExamTeacherSalary> queryWithExam(@Param("examId") Integer examId);
+    List<ExamTeacherSalary> queryWithExam(@Param("examId") Long examId);
 
     /**
      * @describe 获取指定考级项目下教师的基本信息
@@ -47,7 +47,7 @@ public interface ExamTeacherSalaryDao extends BaseDAO<Long, ExamTeacherSalary> {
      * @param teacherIds:
      * @return java.util.List<com.keao.edu.user.entity.ExamTeacherSalary>
      */
-    List<ExamTeacherSalary> getWithExamAndTeacher(@Param("examId") Integer examId,
+    List<ExamTeacherSalary> getWithExamAndTeacher(@Param("examId") Long examId,
                                                   @Param("teacherIds") List<Integer> teacherIds);
 
     /**

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

@@ -25,6 +25,6 @@ public interface ExaminationBasicDao extends BaseDAO<Long, ExaminationBasic> {
      */
     List<ExaminationBasic> getNeedUpdateStatusExams();
 
-    List<ExaminationBasicDto> getExams(@Param("examIds") List<Integer> examIds);
+    List<ExaminationBasicDto> getExams(@Param("examIds") List<Long> examIds);
 	
 }

+ 8 - 8
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamCertification.java

@@ -14,7 +14,7 @@ public class ExamCertification {
 	private Long examRegistrationId;
 
 	@ApiModelProperty(value = "考级项目编号")
-	private Integer examinationBasicId;
+	private Long examinationBasicId;
 
 	@ApiModelProperty(value = "学生编号")
 	private Integer studentId;
@@ -58,15 +58,15 @@ public class ExamCertification {
 	public Long getId(){
 		return this.id;
 	}
-			
-	public void setExaminationBasicId(Integer examinationBasicId){
-		this.examinationBasicId = examinationBasicId;
+
+	public Long getExaminationBasicId() {
+		return examinationBasicId;
 	}
-	
-	public Integer getExaminationBasicId(){
-		return this.examinationBasicId;
+
+	public void setExaminationBasicId(Long examinationBasicId) {
+		this.examinationBasicId = examinationBasicId;
 	}
-			
+
 	public void setStudentId(Integer studentId){
 		this.studentId = studentId;
 	}

+ 6 - 6
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamManualLedger.java

@@ -19,7 +19,7 @@ public class ExamManualLedger {
 	private Organization organization;
 
 	@ApiModelProperty(value = "考级项目编号")
-	private Integer examinationBasicId;
+	private Long examinationBasicId;
 	
 	@ApiModelProperty(value = "转账方向")
 	private TransDirectionEnum transDirection;
@@ -59,12 +59,12 @@ public class ExamManualLedger {
 		this.organId = organId;
 	}
 
-	public void setExaminationBasicId(Integer examinationBasicId){
-		this.examinationBasicId = examinationBasicId;
+	public Long getExaminationBasicId() {
+		return examinationBasicId;
 	}
-	
-	public Integer getExaminationBasicId(){
-		return this.examinationBasicId;
+
+	public void setExaminationBasicId(Long examinationBasicId) {
+		this.examinationBasicId = examinationBasicId;
 	}
 
 	public Organization getOrganization() {

+ 8 - 8
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamMusicTheory.java

@@ -11,7 +11,7 @@ public class ExamMusicTheory {
 	private Integer id;
 	
 	/**  */
-	private Integer examinationBasicId;
+	private Long examinationBasicId;
 	
 	/** 等级 */
 	private Integer level;
@@ -35,15 +35,15 @@ public class ExamMusicTheory {
 	public Integer getId(){
 		return this.id;
 	}
-			
-	public void setExaminationBasicId(Integer examinationBasicId){
-		this.examinationBasicId = examinationBasicId;
+
+	public Long getExaminationBasicId() {
+		return examinationBasicId;
 	}
-	
-	public Integer getExaminationBasicId(){
-		return this.examinationBasicId;
+
+	public void setExaminationBasicId(Long examinationBasicId) {
+		this.examinationBasicId = examinationBasicId;
 	}
-			
+
 	public void setLevel(Integer level){
 		this.level = level;
 	}

+ 6 - 7
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamRegistration.java

@@ -1,6 +1,5 @@
 package com.keao.edu.user.entity;
 
-import com.keao.edu.auth.api.entity.SysUser;
 import com.keao.edu.user.api.entity.Student;
 import com.keao.edu.user.enums.StudentRegistrationStatusEnum;
 import io.swagger.annotations.ApiModelProperty;
@@ -16,7 +15,7 @@ public class ExamRegistration {
 	private Integer id;
 	
 	@ApiModelProperty(value = "考级项目编号")
-	private Integer examinationBasicId;
+	private Long examinationBasicId;
 
 	@ApiModelProperty(value = "考级项目详情")
 	private ExaminationBasic examinationBasic;
@@ -133,12 +132,12 @@ public class ExamRegistration {
 		this.subject = subject;
 	}
 
-	public void setExaminationBasicId(Integer examinationBasicId){
-		this.examinationBasicId = examinationBasicId;
+	public Long getExaminationBasicId() {
+		return examinationBasicId;
 	}
-	
-	public Integer getExaminationBasicId(){
-		return this.examinationBasicId;
+
+	public void setExaminationBasicId(Long examinationBasicId) {
+		this.examinationBasicId = examinationBasicId;
 	}
 
 	public ExaminationBasic getExaminationBasic() {

+ 8 - 8
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamRegistrationPayment.java

@@ -18,7 +18,7 @@ public class ExamRegistrationPayment {
 	private Integer studentId;
 
 	@ApiModelProperty(value = "报考项目编号")
-	private Integer examinationBasicId;
+	private Long examinationBasicId;
 
 	@ApiModelProperty(value = "订单号(系统自动生成)")
 	private String orderNo;
@@ -80,15 +80,15 @@ public class ExamRegistrationPayment {
 	public Integer getStudentId(){
 		return this.studentId;
 	}
-			
-	public void setExaminationBasicId(Integer examinationBasicId){
-		this.examinationBasicId = examinationBasicId;
+
+	public Long getExaminationBasicId() {
+		return examinationBasicId;
 	}
-	
-	public Integer getExaminationBasicId(){
-		return this.examinationBasicId;
+
+	public void setExaminationBasicId(Long examinationBasicId) {
+		this.examinationBasicId = examinationBasicId;
 	}
-			
+
 	public void setOrderNo(String orderNo){
 		this.orderNo = orderNo;
 	}

+ 7 - 7
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExamTeacherSalary.java

@@ -16,7 +16,7 @@ public class ExamTeacherSalary {
 	private Long id;
 
 	@ApiModelProperty(value = "考级项目编号")
-	private Integer examinationBasicId;
+	private Long examinationBasicId;
 
 	@ApiModelProperty(value = "考试类型")
 	private ExamModeEnum examMode;
@@ -71,14 +71,14 @@ public class ExamTeacherSalary {
 		this.settlementType = settlementType;
 	}
 
-	public void setExaminationBasicId(Integer examinationBasicId){
-		this.examinationBasicId = examinationBasicId;
+	public Long getExaminationBasicId() {
+		return examinationBasicId;
 	}
-	
-	public Integer getExaminationBasicId(){
-		return this.examinationBasicId;
+
+	public void setExaminationBasicId(Long examinationBasicId) {
+		this.examinationBasicId = examinationBasicId;
 	}
-			
+
 	public void setTeacherId(Integer teacherId){
 		this.teacherId = teacherId;
 	}

+ 8 - 8
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/ExaminationBasic.java

@@ -14,7 +14,7 @@ import java.util.List;
 public class ExaminationBasic {
 
 	@ApiModelProperty(value = "考级项目编号")
-	private Integer id;
+	private Long id;
 	
 	@ApiModelProperty(value = "项目名称")
 	private String name;
@@ -78,7 +78,7 @@ public class ExaminationBasic {
 	public ExaminationBasic() {
 	}
 
-	public ExaminationBasic(Integer id, String name) {
+	public ExaminationBasic(Long id, String name) {
 		this.id = id;
 		this.name = name;
 	}
@@ -91,14 +91,14 @@ public class ExaminationBasic {
 		this.memo = memo;
 	}
 
-	public void setId(Integer id){
-		this.id = id;
+	public Long getId() {
+		return id;
 	}
-	
-	public Integer getId(){
-		return this.id;
+
+	public void setId(Long id) {
+		this.id = id;
 	}
-			
+
 	public void setName(String name){
 		this.name = name;
 	}

+ 7 - 7
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/StudentExamResult.java

@@ -15,7 +15,7 @@ public class StudentExamResult {
 	private Long examRegistrationId;
 	
 	@ApiModelProperty(value = "考级项目编号")
-	private Integer examinationBasicId;
+	private Long examinationBasicId;
 
 	@ApiModelProperty(value = "考级项目")
 	private ExaminationBasic examinationBasic;
@@ -97,14 +97,14 @@ public class StudentExamResult {
 		this.isFinishedExam = isFinishedExam;
 	}
 
-	public void setExaminationBasicId(Integer examinationBasicId){
-		this.examinationBasicId = examinationBasicId;
+	public Long getExaminationBasicId() {
+		return examinationBasicId;
 	}
-	
-	public Integer getExaminationBasicId(){
-		return this.examinationBasicId;
+
+	public void setExaminationBasicId(Long examinationBasicId) {
+		this.examinationBasicId = examinationBasicId;
 	}
-			
+
 	public void setStudentId(Integer studentId){
 		this.studentId = studentId;
 	}

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

@@ -1,7 +1,6 @@
 package com.keao.edu.user.page;
 
 import com.keao.edu.common.page.QueryInfo;
-import com.keao.edu.user.enums.ExamStatusEnum;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.util.Date;
@@ -15,7 +14,7 @@ public class ExamRoomQueryInfo extends QueryInfo {
     private Long examRoomId;
 
     @ApiModelProperty(value = "考级项目编号")
-    private Date examId;
+    private Long examId;
 
     @ApiModelProperty(value = "考试开始时间")
     private Date StartTime;
@@ -48,11 +47,11 @@ public class ExamRoomQueryInfo extends QueryInfo {
         this.examRoomId = examRoomId;
     }
 
-    public Date getExamId() {
+    public Long getExamId() {
         return examId;
     }
 
-    public void setExamId(Date examId) {
+    public void setExamId(Long examId) {
         this.examId = examId;
     }
 

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

@@ -4,13 +4,9 @@ import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.service.BaseService;
 import com.keao.edu.user.dto.ExamPaymentInfo;
 import com.keao.edu.user.dto.ExamRegistrationPaymentDto;
-import com.keao.edu.user.dto.StudentExamPaymentDto;
-import com.keao.edu.user.entity.ExamRegistration;
 import com.keao.edu.user.entity.ExamRegistrationPayment;
 import com.keao.edu.user.page.ExamRegistrationPaymentQueryInfo;
-import com.keao.edu.user.page.ExamRegistrationQueryInfo;
 
-import java.util.List;
 import java.util.Map;
 
 public interface ExamRegistrationPaymentService extends BaseService<Long, ExamRegistrationPayment> {
@@ -22,7 +18,7 @@ public interface ExamRegistrationPaymentService extends BaseService<Long, ExamRe
      * @param userId
      * @return
      */
-    ExamRegistrationPayment getExamIngOrder(Integer examinationBasicId, Integer userId);
+    ExamRegistrationPayment getExamIngOrder(Long examinationBasicId, Integer userId);
 
     /**
      * 根据订单号获取订单

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

@@ -20,6 +20,14 @@ public interface ExamRoomService extends BaseService<Long, ExamRoom> {
     PageInfo<ExamRoomDto> queryExamRoomPage(ExamRoomQueryInfo queryInfo);
 
     /**
+     * @describe 获取考级项目教室列表
+     * @author Joburgess
+     * @date 2020.07.12
+     * @return com.keao.edu.common.page.PageInfo<com.keao.edu.user.dto.ExamRoomDto>
+     */
+    PageInfo<ExamRoomDto> queryExamRooms(ExamRoomQueryInfo queryInfo);
+
+    /**
      * @describe 创建教室
      * @author Joburgess
      * @date 2020.06.23
@@ -62,7 +70,7 @@ public interface ExamRoomService extends BaseService<Long, ExamRoom> {
      * @param examId:
      * @return com.keao.edu.user.dto.ExamRoomStatisticsDto
      */
-    ExamRoomStatisticsDto getExamRoomStatisticsInfo(Integer organId, Integer examId);
+    ExamRoomStatisticsDto getExamRoomStatisticsInfo(Integer organId, Long examId);
 
     /**
      * @describe 教师教室冲突检测

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

@@ -21,10 +21,10 @@ public interface ExamRoomStudentRelationService extends BaseService<Long, ExamRo
      * @author Joburgess
      * @date 2020.06.24
      * @param examRoomId:
-     * @param studentIds:
+     * @param registIds:
      * @return void
      */
-    void addStudentForRoom(Long examRoomId, String studentIds);
+    void addStudentForRoom(Long examRoomId, String registIds);
 
     /**
      * @describe 更换学员考场

+ 2 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamTeacherSalaryService.java

@@ -20,7 +20,7 @@ public interface ExamTeacherSalaryService extends BaseService<Long, ExamTeacherS
      * @param examId:
      * @return void
      */
-    void teacherSalarySettlementWithExam(Integer examId);
+    void teacherSalarySettlementWithExam(Long examId);
 
     /**
      * @describe
@@ -48,7 +48,7 @@ public interface ExamTeacherSalaryService extends BaseService<Long, ExamTeacherS
      * @param teacherIdsStr:
      * @return void
      */
-    void addExamTeacherSalary(Integer examId, String teacherIdsStr);
+    void addExamTeacherSalary(Long examId, String teacherIdsStr);
 
     /**
      * @describe 获取指定考级项目可排考教师

+ 8 - 7
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/EmployeeServiceImpl.java

@@ -42,15 +42,16 @@ public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee> impl
 	@Transactional(rollbackFor = Exception.class)
 	public void add(Employee employee) {
 		SysUser queryUserInfo = sysUserFeignService.queryUserInfo();
-		String tenantId = queryUserInfo.getTenantId();
-
+		Integer organId = employeeDao.get(queryUserInfo.getId()).getOrganId();
+//		String tenantId = queryUserInfo.getTenantId();
+		employee.setOrganId(organId);
 		SysUser sysUser = employee.getSysUser();
-		employee.setTenantId(tenantId);
+//		employee.setTenantId(tenantId);
 		SysUser user = sysUserDao.queryByPhone(sysUser.getPhone());
 		if(user != null && user.getId() != null){
-			if(!user.getTenantId().equals(tenantId)){
-				throw new BizException("手机号已被占用");
-			}
+//			if(!user.getTenantId().equals(tenantId)){
+//				throw new BizException("手机号已被占用");
+//			}
 			if(StringUtils.isNotEmpty(user.getUserType()) && user.getUserType().contains("SYSTEM")){
 				throw new BizException("手机号已被占用");
 			}
@@ -87,7 +88,7 @@ public class EmployeeServiceImpl extends BaseServiceImpl<Integer, Employee> impl
 			}
 			return;
 		}
-		sysUser.setTenantId(tenantId);
+//		sysUser.setTenantId(tenantId);
 		sysUser.setPassword(new BCryptPasswordEncoder().encode("123456"));
 		sysUser.setUserType("SYSTEM");
 		sysUserDao.insert(sysUser);

+ 2 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamCertificationServiceImpl.java

@@ -48,7 +48,7 @@ public class ExamCertificationServiceImpl extends BaseServiceImpl<Long, ExamCert
 			pageInfo.setTotal(count);
 			params.put("offset", pageInfo.getOffset());
 			dataList = JSON.parseArray(JSON.toJSONString(this.getDAO().queryPage(params)),ExamCertificationDto.class);
-			List<Integer> basicIds = dataList.stream().map(e -> e.getExaminationBasicId()).collect(Collectors.toList());
+			List<Long> basicIds = dataList.stream().map(e -> e.getExaminationBasicId()).collect(Collectors.toList());
 			List<Integer> studentIds = dataList.stream().map(e -> e.getStudentId()).collect(Collectors.toList());
 			List<Integer> subjectIds = dataList.stream().map(e -> e.getSubjectId()).collect(Collectors.toList());
 			Map<Integer, String> basicNameMap = this.getMap("examination_basic", "id_", "name_", basicIds, Integer.class, String.class);
@@ -69,4 +69,4 @@ public class ExamCertificationServiceImpl extends BaseServiceImpl<Long, ExamCert
 		pageInfo.setRows(dataList);
 		return pageInfo;
 	}
-}
+}

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

@@ -56,7 +56,7 @@ public class ExamRegistrationPaymentServiceImpl extends BaseServiceImpl<Long, Ex
     }
 
     @Override
-    public ExamRegistrationPayment getExamIngOrder(Integer examinationBasicId, Integer userId) {
+    public ExamRegistrationPayment getExamIngOrder(Long examinationBasicId, Integer userId) {
         return examRegistrationPaymentDao.getExamIngOrder(examinationBasicId, userId);
     }
 

+ 2 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRegistrationServiceImpl.java

@@ -166,7 +166,7 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
             pageInfo.setTotal(count);
             params.put("offset", pageInfo.getOffset());
             dataList = examRegistrationDao.queryExamRegist(params);
-            List<Integer> examIds = dataList.stream().filter(e -> Objects.nonNull(e.getOrganId())).map(ExamRegistration::getExaminationBasicId).collect(Collectors.toList());
+            List<Long> examIds = dataList.stream().filter(e -> Objects.nonNull(e.getOrganId())).map(ExamRegistration::getExaminationBasicId).collect(Collectors.toList());
             Map<Integer, String> examIdNameMap = this.getMap("examination_basic", "id_", "name_", examIds, Integer.class, String.class);
 
             List<Integer> organIds = dataList.stream().filter(e -> Objects.nonNull(e.getOrganId())).map(ExamRegistration::getOrganId).collect(Collectors.toList());
@@ -242,7 +242,7 @@ public class ExamRegistrationServiceImpl extends BaseServiceImpl<Long, ExamRegis
             params.put("offset", pageInfo.getOffset());
             dataList = examRegistrationDao.queryExamList(params);
             List<Integer> subjectIds = dataList.stream().map(e -> e.getSubjectId()).collect(Collectors.toList());
-            List<Integer> basicIds = dataList.stream().map(e -> e.getExaminationBasicId()).collect(Collectors.toList());
+            List<Long> basicIds = dataList.stream().map(e -> e.getExaminationBasicId()).collect(Collectors.toList());
             List<Integer> registrationIds = dataList.stream().map(e -> e.getId()).collect(Collectors.toList());
             Map<Integer, String> subjectNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
             Map<Integer, String> examNameMap = this.getMap("examination_basic", "id_", "name_", basicIds, Integer.class, String.class);

+ 29 - 1
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java

@@ -77,6 +77,29 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 	}
 
 	@Override
+	public PageInfo<ExamRoomDto> queryExamRooms(ExamRoomQueryInfo queryInfo) {
+		PageInfo<ExamRoomDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+		Map<String, Object> params = new HashMap<>();
+		MapUtil.populateMap(params, queryInfo);
+
+		List<Integer> childOrganIds = organizationService.getChildOrganIds(queryInfo.getOrganId(), true);
+		params.put("organIds", childOrganIds);
+
+		List<ExamRoomDto> dataList = null;
+		int count = examRoomDao.countExamRoom(params);
+		if (count > 0) {
+			pageInfo.setTotal(count);
+			params.put("offset", pageInfo.getOffset());
+			dataList = examRoomDao.queryExamRoom(params);
+		}
+		if (count == 0) {
+			dataList = new ArrayList<>();
+		}
+		pageInfo.setRows(dataList);
+		return pageInfo;
+	}
+
+	@Override
 	public void createExamRoom(ExamRoom examRoom) {
 		if(Objects.isNull(examRoom.getExaminationBasicId())){
 			throw new BizException("请指定考级项目");
@@ -102,6 +125,7 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 		}
 		examRoom.setTenantId(TenantContextHolder.getTenantId());
 		examRoom.setExamPlanPushFlag(YesOrNoEnum.NO);
+		examRoom.setExamRoomStudentNum(0);
 		if(StringUtils.isBlank(examRoom.getExamTimeJson())){
 			examRoomDao.insert(examRoom);
 			return;
@@ -125,6 +149,10 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 			examRoom.setAssistantTeacherUserNameList(StringUtils.join(assistantTeacherNames, ","));
 		}
 
+		List<Integer> subjectIds = Arrays.stream(examRoom.getSubjectIdList().split(",")).map(e -> Integer.valueOf(e)).collect(Collectors.toList());
+		Map<Integer, String> subjectIdNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
+		examRoom.setSubjectNameList(StringUtils.join(subjectIdNameMap.keySet(),","));
+
 		List<ExamRoom> examRooms=new ArrayList<>();
 		List<JSONObject> examTimes = JSON.parseArray(examRoom.getExamTimeJson(), JSONObject.class);
 		for (JSONObject examTime : examTimes) {
@@ -212,7 +240,7 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 	}
 
 	@Override
-	public ExamRoomStatisticsDto getExamRoomStatisticsInfo(Integer organId, Integer examId) {
+	public ExamRoomStatisticsDto getExamRoomStatisticsInfo(Integer organId, Long examId) {
 		ExamRoomStatisticsDto examRoomStatisticsInfo=new ExamRoomStatisticsDto();
 
         List<Integer> childOrganIds = organizationService.getChildOrganIds(organId, true);

+ 47 - 17
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -10,6 +10,7 @@ import com.keao.edu.common.service.impl.BaseServiceImpl;
 import com.keao.edu.common.tenant.TenantContextHolder;
 import com.keao.edu.user.api.entity.ExamRoom;
 import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
+import com.keao.edu.user.api.enums.ExamModeEnum;
 import com.keao.edu.user.dao.*;
 import com.keao.edu.user.dto.ExamRoomStudentRelationDto;
 import com.keao.edu.user.entity.*;
@@ -62,68 +63,82 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 
 	@Override
 	@Transactional(rollbackFor = Exception.class, isolation = Isolation.READ_COMMITTED)
-	public void addStudentForRoom(Long examRoomId, String studentIdsStr) {
+	public void addStudentForRoom(Long examRoomId, String registIdsStr) {
 		if(Objects.isNull(examRoomId)){
 			throw new BizException("请指定教室");
 		}
-		if(StringUtils.isBlank(studentIdsStr)){
-			throw new BizException("请指定学员");
+		if(StringUtils.isBlank(registIdsStr)){
+			throw new BizException("请指定学员报名编号");
 		}
 		ExamRoom examRoom = examRoomDao.lockRoom(examRoomId);
 		if(Objects.isNull(examRoom)){
 			throw new BizException("教室不存在");
 		}
-		ExamLocation examLocation = examLocationDao.get(examRoom.getExamLocationId());
+		ExamLocation examLocation = null;
+		if(ExamModeEnum.OFFLINE.equals(examRoom.getExamMode())){
+			examLocation = examLocationDao.get(examRoom.getExamLocationId());
+			if(Objects.isNull(examLocation)){
+				throw new BizException("考点信息错误");
+			}
+		}
 
 		List<ExamRoomStudentRelation> studentsWithExamRoom = examRoomStudentRelationDao.findStudentsWithExamRoom(examRoomId);
-		Set<Integer> existStudentIds = studentsWithExamRoom.stream().map(ExamRoomStudentRelation::getStudentId).collect(Collectors.toSet());
-		String[] studentIds = studentIdsStr.split(",");
+		Set<Long> existRegistIds = studentsWithExamRoom.stream().map(ExamRoomStudentRelation::getExamRegistrationId).collect(Collectors.toSet());
 
-		List<ExamRegistration> examRegistrations = examRegistrationDao.getWithExamAndStudents(examRoom.getExaminationBasicId(), Arrays.asList(studentIds).stream().map(e -> Integer.valueOf(e)).collect(Collectors.toList()));
-		Map<Integer, ExamRegistration> studentRegistMap = examRegistrations.stream().collect(Collectors.toMap(ExamRegistration::getStudentId, e -> e));
+		String[] registIds = registIdsStr.split(",");
+
+		List<ExamRegistration> examRegistrations = examRegistrationDao.getRegists(Arrays.asList(registIds).stream().map(e -> Long.valueOf(e)).collect(Collectors.toList()));
+		Map<Integer, ExamRegistration> studentRegistMap = examRegistrations.stream().collect(Collectors.toMap(ExamRegistration::getId, e -> e));
 
 		List<ExamRoomStudentRelation> examRoomStudentRelations=new ArrayList<>();
 		List<StudentExamResult> studentExamResults=new ArrayList<>();
 		List<ExamCertification> examCertifications=new ArrayList<>();
-		for (String studentId : studentIds) {
-			if(existStudentIds.contains(Integer.valueOf(studentId))){
+		for (String registId : registIds) {
+			if(existRegistIds.contains(Long.valueOf(registId))){
 				continue;
 			}
-			ExamRegistration examRegistration = studentRegistMap.get(Integer.valueOf(studentId));
+			ExamRegistration examRegistration = studentRegistMap.get(Integer.valueOf(registId));
 			if(Objects.isNull(examRegistration)){
 				throw new BizException("学员信息错误");
 			}
 
 			ExamRoomStudentRelation e=new ExamRoomStudentRelation();
+			e.setExamRegistrationId(Long.valueOf(registId));
 			e.setExaminationBasicId(examRoom.getExaminationBasicId());
 			e.setExamRoomId(examRoom.getId());
-			e.setStudentId(Integer.valueOf(studentId));
+			e.setStudentId(examRegistration.getStudentId());
 			e.setTenantId(TenantContextHolder.getTenantId());
 			examRoomStudentRelations.add(e);
 
 			StudentExamResult ser = new StudentExamResult();
+			ser.setExamRegistrationId(examRegistration.getId().longValue());
 			ser.setExaminationBasicId(examRoom.getExaminationBasicId());
-			ser.setStudentId(Integer.valueOf(studentId));
+			ser.setStudentId(examRegistration.getStudentId());
 			ser.setIsFinishedExam(0);
 			ser.setConfirmStatus(0);
 			ser.setTenantId(TenantContextHolder.getTenantId());
 			studentExamResults.add(ser);
 
 			ExamCertification ec=new ExamCertification();
+			ec.setExamRegistrationId(examRegistration.getId().longValue());
 			ec.setExaminationBasicId(examRoom.getExaminationBasicId());
-			ec.setStudentId(Integer.valueOf(studentId));
+			ec.setStudentId(examRegistration.getStudentId());
 			ec.setCardNo(String.valueOf(idGeneratorService.generatorId()));
 			ec.setSubjectId(examRegistration.getSubjectId());
 			ec.setLevel(examRegistration.getLevel());
 			ec.setExamStartTime(examRoom.getExamStartTime());
 			ec.setExamEndTime(examRoom.getExamEndTime());
-			ec.setExamAddress(examLocation.getAddress());
+			if(ExamModeEnum.OFFLINE.equals(examRoom.getExamMode())){
+				ec.setExamAddress(examLocation.getAddress());
+			}
 			ec.setTenantId(TenantContextHolder.getTenantId());
 			examCertifications.add(ec);
 		}
 		if(!CollectionUtils.isEmpty(examRoomStudentRelations)){
 			examRoomStudentRelationDao.batchInsert(examRoomStudentRelations);
 			examTeacherSalaryService.teacherSalarySettlementWithExam(examRoom.getExaminationBasicId());
+			examRoom.setExamRoomStudentNum(examRoom.getExamRoomStudentNum()+examRoomStudentRelations.size());
+			examRoomDao.update(examRoom);
 		}
 		if(!CollectionUtils.isEmpty(studentExamResults)){
 			studentExamResultDao.batchInsert(studentExamResults);
@@ -167,10 +182,25 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 
 	@Override
 	public PageInfo<ExamRoomStudentRelationDto> findExamRoomStudents(ExamRoomStudentRelationQueryInfo queryInfo) {
+		if(Objects.nonNull(queryInfo.getInRoom())&&Objects.isNull(queryInfo.getExamRoomId())){
+			throw new BizException("请指定考场");
+		}
+
 		PageInfo<ExamRoomStudentRelationDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
 		Map<String, Object> params = new HashMap<String, Object>();
 		MapUtil.populateMap(params, queryInfo);
 
+		if(Objects.nonNull(queryInfo.getExamRoomId())){
+			ExamRoom examRoom = examRoomDao.get(queryInfo.getExamRoomId());
+			if(Objects.isNull(examRoom)){
+				throw new BizException("考场不存在");
+			}
+			if(!examRoom.getExaminationBasicId().equals(queryInfo.getExamId())){
+				throw new BizException("考场信息异常");
+			}
+			params.put("subjectIds", examRoom.getSubjectIdList());
+		}
+
 		List<Integer> nextLevelOrganIds = organizationService.getChildOrganIds(queryInfo.getOrganId(), true);
 		params.put("organIds", nextLevelOrganIds);
 
@@ -180,12 +210,12 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 			pageInfo.setTotal(count);
 			params.put("offset", pageInfo.getOffset());
 			dataList = examRoomStudentRelationDao.findExamRoomStudents(params);
-			List<Integer> studentIds = dataList.stream().map(ExamRoomStudentRelationDto::getStudentId).collect(Collectors.toList());
+			List<Integer> studentIds = dataList.stream().map(e->e.getExamRegistration().getStudentId()).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> subjectIdNameMap = this.getMap("subject", "id_", "name_", subjectIds, Integer.class, String.class);
 			for (ExamRoomStudentRelationDto e : dataList) {
-				e.setStudentInfo(new SysUser(e.getStudentId(),studentIdNameMap.get(e.getStudentId())));
+				e.setStudentInfo(new SysUser(e.getStudentId(),studentIdNameMap.get(e.getExamRegistration().getStudentId())));
 				e.setSubject(new Subject(e.getExamRegistration().getSubjectId(), subjectIdNameMap.get(e.getExamRegistration().getSubjectId())));
 			}
 		}

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

@@ -43,7 +43,7 @@ public class ExamTeacherSalaryServiceImpl extends BaseServiceImpl<Long, ExamTeac
 	}
 
 	@Override
-	public void teacherSalarySettlementWithExam(Integer examId) {
+	public void teacherSalarySettlementWithExam(Long examId) {
 		List<ExamRoom> examRooms = examRoomDao.getWithExam(null, examId);
 		if(CollectionUtils.isEmpty(examRooms)){
 			return;
@@ -98,9 +98,9 @@ public class ExamTeacherSalaryServiceImpl extends BaseServiceImpl<Long, ExamTeac
 			pageInfo.setTotal(count);
 			params.put("offset", pageInfo.getOffset());
 			dataList = examTeacherSalaryDao.queryExamTeacherSalary(params);
-			List<Integer> examIds = dataList.stream().map(ExamTeacherSalaryDto::getExaminationBasicId).collect(Collectors.toList());
+			List<Long> examIds = dataList.stream().map(ExamTeacherSalaryDto::getExaminationBasicId).collect(Collectors.toList());
 			List<ExaminationBasicDto> exams = examinationBasicDao.getExams(examIds);
-			Map<Integer, ExaminationBasicDto> idExamMap = exams.stream().collect(Collectors.toMap(ExaminationBasicDto::getId, e -> e));
+			Map<Long, ExaminationBasicDto> idExamMap = exams.stream().collect(Collectors.toMap(ExaminationBasicDto::getId, e -> e));
 			for (ExamTeacherSalaryDto examTeacherSalaryDto : dataList) {
 				examTeacherSalaryDto.setExaminationBasic(idExamMap.get(examTeacherSalaryDto.getExaminationBasicId()));
 			}
@@ -122,7 +122,7 @@ public class ExamTeacherSalaryServiceImpl extends BaseServiceImpl<Long, ExamTeac
 	}
 
 	@Override
-	public void addExamTeacherSalary(Integer examId, String teacherIdsStr) {
+	public void addExamTeacherSalary(Long examId, String teacherIdsStr) {
 		if(Objects.isNull(examId)){
 			throw new BizException("请指定考级项目");
 		}

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

@@ -134,7 +134,7 @@ public class ExaminationBasicServiceImpl extends BaseServiceImpl<Long, Examinati
             pageInfo.setTotal(count);
             params.put("offset", pageInfo.getOffset());
             dataList = examinationBasicDao.findExaminationBasics(params);
-            List<Integer> examIds = dataList.stream().map(ExaminationBasicDto::getId).collect(Collectors.toList());
+            List<Long> examIds = dataList.stream().map(ExaminationBasicDto::getId).collect(Collectors.toList());
             List<ExamOrganizationRelation> examOrgans = new ArrayList<>();
             if (!CollectionUtils.isEmpty(examIds)) {
                 examOrganizationRelationDao.getWithExams(examIds);

+ 8 - 7
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/OrganizationServiceImpl.java

@@ -62,17 +62,17 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 			}
 		}
 		SysUser sysUser = organ.getSysUser();
-		String tenantId = queryUserInfo.getTenantId();
-		organ.setTenantId(tenantId);
-		sysUser.setTenantId(tenantId);
+//		String tenantId = queryUserInfo.getTenantId();
+//		organ.setTenantId(tenantId);
+//		sysUser.setTenantId(tenantId);
 		SysUser user = sysUserDao.queryByPhone(sysUser.getPhone());
 		organ.setParentOrganId(queryUserInfo.getId());
 		organ.setLevel(currentOrganization.getLevel() + 1);
 
 		if(user != null && user.getId() != null){
-			if(!user.getTenantId().equals(tenantId)){
-				throw new BizException("手机号已被占用");
-			}
+//			if(!user.getTenantId().equals(tenantId)){
+//				throw new BizException("手机号已被占用");
+//			}
 			if(StringUtils.isNotEmpty(user.getUserType()) && user.getUserType().contains("SYSTEM")){
 				throw new BizException("手机号已被占用");
 			}
@@ -108,6 +108,7 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 				}
 				Employee employee = employeeDao.get(sysUser.getId());
 				employee.setDelFlag(false);
+				employee.setTenantId(organ.getTenantId());
 				employeeDao.update(employee);
 				organ.setDelFlag(YesOrNoEnum.NO);
 				organ.setId(organization.getId());
@@ -134,7 +135,7 @@ public class OrganizationServiceImpl extends BaseServiceImpl<Integer, Organizati
 		Employee employee = new Employee();
 		employee.setOrganId(organ.getId());
 		employee.setUserId(sysUser.getId());
-		employee.setTenantId(tenantId);
+		employee.setTenantId(organ.getTenantId());
 		employeeDao.insert(employee);
 
 		ImResult imResult = imFeignService.register(new ImUserModel(sysUser.getId().toString(), sysUser.getRealName(),null));

+ 2 - 2
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/StudentExamResultServiceImpl.java

@@ -56,7 +56,7 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
 			pageInfo.setTotal(count);
 			params.put("offset", pageInfo.getOffset());
 			dataList = studentExamResultDao.queryStudentExamResult(params);
-			List<Integer> examIds = dataList.stream().map(StudentExamResult::getExaminationBasicId).collect(Collectors.toList());
+			List<Long> examIds = dataList.stream().map(StudentExamResult::getExaminationBasicId).collect(Collectors.toList());
 			List<Integer> studentIds = dataList.stream().map(StudentExamResult::getStudentId).collect(Collectors.toList());
 			List<Integer> subjectIds = dataList.stream().map(e -> e.getExamRegistration().getSubjectId()).collect(Collectors.toList());
 			List<Integer> organIds = dataList.stream().map(e -> e.getExamRegistration().getOrganId()).collect(Collectors.toList());
@@ -65,7 +65,7 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
 			Map<Integer, String> organIdNameMap = this.getMap("organization", "id_", "name_", organIds, Integer.class, String.class);
 
 			List<ExaminationBasicDto> exams = examinationBasicDao.getExams(examIds);
-			Map<Integer, ExaminationBasicDto> idExamMap = exams.stream().collect(Collectors.toMap(ExaminationBasic::getId, e -> e));
+			Map<Long, ExaminationBasicDto> idExamMap = exams.stream().collect(Collectors.toMap(ExaminationBasic::getId, e -> e));
 
 			for (StudentExamResult s : dataList) {
 				Student student=new Student(s.getStudentId(), studentIdNameMap.get(s.getStudentId()));

+ 4 - 6
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/StudentServiceImpl.java

@@ -9,18 +9,16 @@ import com.keao.edu.common.service.impl.BaseServiceImpl;
 import com.keao.edu.im.api.client.ImFeignService;
 import com.keao.edu.im.api.entity.ImResult;
 import com.keao.edu.im.api.entity.ImUserModel;
+import com.keao.edu.user.api.entity.Student;
 import com.keao.edu.user.dao.StudentDao;
 import com.keao.edu.user.dao.StudentExamResultDao;
 import com.keao.edu.user.dao.SysUserDao;
-import com.keao.edu.user.api.entity.Student;
 import com.keao.edu.user.dto.StudentExamPaymentDto;
 import com.keao.edu.user.entity.Organization;
-import com.keao.edu.user.enums.YesOrNoEnum;
 import com.keao.edu.user.page.StudentApplyQueryInfo;
 import com.keao.edu.user.service.OrganizationService;
 import com.keao.edu.user.service.StudentService;
 import com.keao.edu.util.collection.MapUtil;
-import org.apache.commons.collections.MapUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -77,9 +75,9 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
             }
             return;
         }
-        Organization organization = organizationService.get(student.getOrganId());
+//        Organization organization = organizationService.get(student.getOrganId());
 //        student.setTenantId(organization.getTenantId());
-        sysUser.setTenantId(organization.getTenantId());
+//        sysUser.setTenantId(organization.getTenantId());
         sysUser.setUserType("STUDENT");
         sysUserDao.insert(sysUser);
         ImResult imResult = imFeignService.register(new ImUserModel(sysUser.getId().toString(), sysUser.getRealName(), null));
@@ -131,7 +129,7 @@ public class StudentServiceImpl extends BaseServiceImpl<Integer, Student> implem
             pageInfo.setTotal(count);
             params.put("offset", pageInfo.getOffset());
             dataList = studentDao.queryApplyList(params);
-            List<Integer> basicIds = dataList.stream().map(e -> e.getExamRegistration().getExaminationBasicId()).collect(Collectors.toList());
+            List<Long> basicIds = dataList.stream().map(e -> e.getExamRegistration().getExaminationBasicId()).collect(Collectors.toList());
             Map<Integer, String> basicNameMap = this.getMap("examination_basic", "id_", "name_", basicIds, Integer.class, String.class);
             Map<Integer, String> organNameMap = this.getMap("organization", "id_", "name_", basicIds, Integer.class, String.class);
             Map<Integer, String> subjectNameMap = this.getMap("subject", "id_", "name_", basicIds, Integer.class, String.class);

+ 7 - 7
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/TeacherServiceImpl.java

@@ -46,17 +46,17 @@ public class TeacherServiceImpl extends BaseServiceImpl<Integer, Teacher> implem
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public int add(Teacher teacher) {
-		SysUser queryUserInfo = sysUserFeignService.queryUserInfo();
+//		SysUser queryUserInfo = sysUserFeignService.queryUserInfo();
 		SysUser sysUser = teacher.getSysUser();
 		SysUser user = sysUserDao.queryByPhone(sysUser.getPhone());
 		Date date = new Date();
-		String tenantId = queryUserInfo.getTenantId();
-		teacher.setTenantId(tenantId);
-		sysUser.setTenantId(tenantId);
+//		String tenantId = queryUserInfo.getTenantId();
+//		teacher.setTenantId(tenantId);
+//		sysUser.setTenantId(tenantId);
 		if(user != null && user.getId() != null){
-			if(!user.getTenantId().equals(tenantId)){
-				throw new BizException("手机号已被占用");
-			}
+//			if(!user.getTenantId().equals(tenantId)){
+//				throw new BizException("手机号已被占用");
+//			}
 			Integer id = user.getId();
 			sysUser.setId(id);
 			Teacher teacher1 = teacherDao.get(id);

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

@@ -62,7 +62,7 @@ public class TenantInfoServiceImpl extends BaseServiceImpl<Integer, TenantInfo>
 		tenantInfoDao.insert(tenantInfo);
 
 		SysUser sysUser = new SysUser();
-		sysUser.setTenantId(tenantInfo.getId().toString());
+//		sysUser.setTenantId(tenantInfo.getId().toString());
 		sysUser.setPassword(new BCryptPasswordEncoder().encode("123456"));
 		sysUser.setUserType("SYSTEM");
 		sysUser.setRealName(tenantInfo.getContactName());

+ 4 - 0
edu-user/edu-user-server/src/main/resources/application.yml

@@ -71,6 +71,8 @@ spring:
 
 mybatis:
     mapperLocations: classpath:config/mybatis/*.xml
+    configuration:
+      log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
 
 swagger:
   base-package: com.keao.edu.user.controller
@@ -103,6 +105,8 @@ message:
 logging:
   level:
     com.keao.edu.user.api.client.EduUserFeignService: INFO
+    com.keao.edu.user.dao: DEBUG
+
 
 push:
   jiguang:

+ 11 - 2
edu-user/edu-user-server/src/main/resources/config/mybatis/EmployeeMapper.xml

@@ -88,7 +88,7 @@
             <if test="demissionDate != null">
                 demission_date_ = #{demissionDate},
             </if>
-            <if test="tenantId != null">
+			<if test="tenantId != null">
                 tenant_id_=#{tenantId},
             </if>
             <if test="organId != null">
@@ -106,13 +106,22 @@
 	</update>
 	<sql id="employeeQueryPage">
 		<where>
-				e.del_flag_ = 0 AND e.tenant_id_ = #{tenantId} AND e.user_id_ != #{userId}
+				e.del_flag_ = 0 AND e.user_id_ != #{userId}
 			<if test="search != null and search != ''">
 				AND (e.user_id_ = #{search} OR su.phone_ LIKE CONCAT('%',#{search},'%') OR su.real_name_ LIKE CONCAT('%',#{search},'%'))
 			</if>
 			<if test="roleId != null">
 				AND sur.role_id_ = #{roleId}
 			</if>
+			<if test="tenantId != null and tenantId != 0">
+				AND e.tenant_id_ = #{tenantId}
+			</if>
+			<if test="organIds != null">
+				AND e.organ_id_ IN
+				<foreach collection="organIds" item="organId" open="(" close=")" separator=",">
+					#{organId}
+				</foreach>
+			</if>
 		</where>
 	</sql>
 	

+ 1 - 1
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamCertificationMapper.xml

@@ -69,7 +69,7 @@
 			<if test="examStartTime != null">
 				exam_start_time_ = #{examStartTime},
 			</if>
-			<if test="tenantId != null">
+			<if test="tenantId != null and tenantId != 0">
 				tenant_id_ = #{tenantId},
 			</if>
 			<if test="cardNo != null">

+ 4 - 1
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamLocationMapper.xml

@@ -76,13 +76,16 @@
 
 	<sql id="queryCondition">
 		<where>
-			del_flag_=0 AND tenant_id_ = #{tenantId}
+			del_flag_=0
 			<if test="isAvailable!=null">
 				AND is_available_=#{isAvailable}
 			</if>
 			<if test="search!=null">
 				AND (id_=#{search} OR name_ LIKE CONCAT('%', #{serch}, '%'))
 			</if>
+			<if test="tenantId != null and tenantId != 0">
+				AND tenant_id_ = #{tenantId}
+			</if>
 		</where>
 	</sql>
 	

+ 1 - 1
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamMusicTheoryMapper.xml

@@ -55,7 +55,7 @@
 			<if test="fee != null">
 				fee_ = #{fee},
 			</if>
-			<if test="tenantId != null">
+			<if test="tenantId != null and tenantId != 0">
 				tenant_id_ = #{tenantId},
 			</if>
 			<if test="level != null">

+ 1 - 1
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamOrganizationRelationMapper.xml

@@ -81,7 +81,7 @@
 			<if test="url != null">
 				url_ = #{url},
 			</if>
-			<if test="tenantId != null">
+			<if test="tenantId != null and tenantId != 0">
 				tenant_id_ = #{tenantId},
 			</if>
 			<if test="shareProfitAmount != null">

+ 380 - 419
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationMapper.xml

@@ -6,447 +6,408 @@
 -->
 <mapper namespace="com.keao.edu.user.dao.ExamRegistrationDao">
 
-    <resultMap type="com.keao.edu.user.entity.ExamRegistration" id="ExamRegistration">
-        <id column="id_" property="id"/>
-        <result column="examination_basic_id_" property="examinationBasicId"/>
-        <result column="student_id_" property="studentId"/>
-        <result column="organ_id_" property="organId"/>
-        <result column="subject_id_" property="subjectId"/>
-        <result column="level_" property="level"/>
-        <result column="level_fee_" property="levelFee"/>
-        <result column="song_json_" property="songJson"/>
-        <result column="last_exam_level_" property="lastExamLevel"/>
-        <result column="last_exam_certificate_url_" property="lastExamCertificateUrl"/>
-        <result column="exam_music_theory_level_" property="examMusicTheoryLevel"/>
-        <result column="theory_level_fee_" property="theoryLevelFee"/>
-        <result column="last_music_theory_level_" property="lastMusicTheoryLevel"/>
-        <result column="last_music_theory_certificate_url_" property="lastMusicTheoryCertificateUrl"/>
-        <result column="adviser_name_" property="adviserName"/>
-        <result column="adviser_phone_" property="adviserPhone"/>
-        <result column="card_no_" property="cardNo"/>
-        <result column="status_" property="status"/>
-        <result column="create_time_" property="createTime"/>
-        <result column="update_time_" property="updateTime"/>
-        <result column="tenant_id_" property="tenantId"/>
-        <result column="memo_" property="memo"/>
-        <association property="sysUser" columnPrefix="sys_user_" resultMap="com.keao.edu.user.dao.StudentDao.Student"/>
-        <association property="subject" columnPrefix="subject_" resultMap="com.keao.edu.user.dao.SubjectDao.Subject"/>
-        <association property="examinationBasic" columnPrefix="examination_basic_"
-                     resultMap="com.keao.edu.user.dao.ExaminationBasicDao.ExaminationBasic"/>
-    </resultMap>
+	<resultMap type="com.keao.edu.user.entity.ExamRegistration" id="ExamRegistration">
+		<id column="id_" property="id" />
+		<result column="examination_basic_id_" property="examinationBasicId" />
+		<result column="student_id_" property="studentId" />
+		<result column="organ_id_" property="organId" />
+		<result column="subject_id_" property="subjectId" />
+		<result column="level_" property="level" />
+		<result column="level_fee_" property="levelFee" />
+		<result column="song_json_" property="songJson" />
+		<result column="last_exam_level_" property="lastExamLevel" />
+		<result column="last_exam_certificate_url_" property="lastExamCertificateUrl" />
+		<result column="exam_music_theory_level_" property="examMusicTheoryLevel" />
+		<result column="theory_level_fee_" property="theoryLevelFee" />
+		<result column="last_music_theory_level_" property="lastMusicTheoryLevel" />
+		<result column="last_music_theory_certificate_url_" property="lastMusicTheoryCertificateUrl" />
+		<result column="adviser_name_" property="adviserName" />
+		<result column="adviser_phone_" property="adviserPhone" />
+		<result column="card_no_" property="cardNo" />
+		<result column="status_" property="status" />
+		<result column="create_time_" property="createTime" />
+		<result column="update_time_" property="updateTime" />
+		<result column="tenant_id_" property="tenantId" />
+		<result column="memo_" property="memo" />
+		<association property="sysUser" columnPrefix="sys_user_" resultMap="com.keao.edu.user.dao.StudentDao.Student"/>
+		<association property="subject" columnPrefix="subject_" resultMap="com.keao.edu.user.dao.SubjectDao.Subject"/>
+		<association property="examinationBasic" columnPrefix="examination_basic_" resultMap="com.keao.edu.user.dao.ExaminationBasicDao.ExaminationBasic"/>
+	</resultMap>
 
-    <resultMap id="ExamRegistrationRoomDto" type="com.keao.edu.user.dto.ExamRegistrationRoomDto"
-               extends="ExamRegistration">
-        <result column="exam_room_id_" property="examRoomId"/>
-        <result column="exam_start_time_" property="examStartTime"/>
-        <result column="exam_end_time_" property="examEndTime"/>
-    </resultMap>
+	<resultMap id="ExamRegistrationRoomDto" type="com.keao.edu.user.dto.ExamRegistrationRoomDto" extends="ExamRegistration">
+		<result column="exam_room_id_" property="examRoomId"/>
+		<result column="exam_start_time_" property="examStartTime"/>
+		<result column="exam_end_time_" property="examEndTime"/>
+	</resultMap>
 
-    <!-- 根据主键查询一条记录 -->
-    <select id="get" resultMap="ExamRegistration">
-        SELECT *
-        FROM exam_registration
-        WHERE id_ = #{id}
-    </select>
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="ExamRegistration" >
+		SELECT * FROM exam_registration WHERE id_ = #{id}
+	</select>
 
-    <!-- 全查询 -->
-    <select id="findAll" resultMap="ExamRegistration">
-        SELECT *
-        FROM exam_registration
-        ORDER BY id_
-    </select>
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="ExamRegistration">
+		SELECT * FROM exam_registration ORDER BY id_
+	</select>
 
-    <!-- 向数据库增加一条记录 -->
-    <insert id="insert" parameterType="com.keao.edu.user.entity.ExamRegistration" useGeneratedKeys="true" keyColumn="id"
-            keyProperty="id">
-        INSERT INTO exam_registration (examination_basic_id_, student_id_, organ_id_, subject_id_, level_, level_fee_,
-                                       song_json_, last_exam_level_, last_exam_certificate_url_,
-                                       exam_music_theory_level_, theory_level_fee_,
-                                       last_music_theory_level_, last_music_theory_certificate_url_, adviser_name_,
-                                       adviser_phone_, card_no_, status_,
-                                       create_time_, update_time_, tenant_id_, memo_)
-        VALUES (#{examinationBasicId}, #{studentId}, #{organId}, #{subjectId}, #{level}, #{levelFee}, #{songJson},
-                #{lastExamLevel}, #{lastExamCertificateUrl}, #{examMusicTheoryLevel}, #{theoryLevelFee},
-                #{lastMusicTheoryLevel},
-                #{lastMusicTheoryCertificateUrl}, #{adviserName}, #{adviserPhone}, #{cardNo}, #{status}, #{createTime},
-                #{updateTime}, #{tenantId}, #{memo})
-    </insert>
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.keao.edu.user.entity.ExamRegistration" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		INSERT INTO  exam_registration (examination_basic_id_, student_id_, organ_id_,subject_id_, level_, level_fee_,
+		song_json_, last_exam_level_, last_exam_certificate_url_,exam_music_theory_level_, theory_level_fee_,
+		last_music_theory_level_,last_music_theory_certificate_url_, adviser_name_,adviser_phone_, card_no_, status_,
+		create_time_, update_time_, tenant_id_,memo_)
+		VALUES (#{examinationBasicId}, #{studentId}, #{organId}, #{subjectId}, #{level}, #{levelFee}, #{songJson},
+		#{lastExamLevel}, #{lastExamCertificateUrl}, #{examMusicTheoryLevel}, #{theoryLevelFee}, #{lastMusicTheoryLevel},
+		#{lastMusicTheoryCertificateUrl}, #{adviserName}, #{adviserPhone}, #{cardNo}, #{status},#{createTime},
+		#{updateTime}, #{tenantId}, #{memo})
+	</insert>
 
-    <!-- 根据主键查询一条记录 -->
-    <update id="update" parameterType="com.keao.edu.user.entity.ExamRegistration">
-        UPDATE exam_registration
-        <set>
-            <if test="examinationBasicId != null">
-                examination_basic_id_ = #{examinationBasicId},
-            </if>
-            <if test="studentId != null != null">
-                student_id_ = #{studentId},
-            </if>
-            <if test="organId != null">
-                organ_id_ = #{organId},
-            </if>
-            <if test="subjectId != null">
-                subject_id_ = #{subjectId},
-            </if>
-            <if test="level != null">
-                level_ = #{level},
-            </if>
-            <if test="levelFee != null">
-                level_fee_ = #{levelFee},
-            </if>
-            <if test="songJson != null">
-                song_json_ = #{songJson},
-            </if>
-            <if test="lastExamLevel != null">
-                last_exam_level_ = #{lastExamLevel},
-            </if>
-            <if test="lastExamCertificateUrl != null">
-                last_exam_certificate_url_ = #{lastExamCertificateUrl},
-            </if>
-            <if test="examMusicTheoryLevel!= null">
-                exam_music_theory_level_ = #{examMusicTheoryLevel},
-            </if>
-            <if test="theoryLevelFee!= null">
-                theory_level_fee_ = #{theoryLevelFee},
-            </if>
-            <if test="lastMusicTheoryLevel != null">
-                last_music_theory_level_ = #{lastMusicTheoryLevel},
-            </if>
-            <if test="lastMusicTheoryCertificateUrl != null">
-                last_music_theory_certificate_url_ = #{lastMusicTheoryCertificateUrl},
-            </if>
-            <if test="adviserName != null">
-                adviser_name_ = #{adviserName},
-            </if>
-            <if test="adviserPhone != null">
-                adviser_phone_ = #{adviserPhone},
-            </if>
-            <if test="cardNo!=null">
-                card_no_ =#{cardNo},
-            </if>
-            <if test="status!=null">
-                status_ = #{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
-            </if>
-            <if test="tenantId != null">
-                tenant_id_ = #{tenantId},
-            </if>
-            <if test="createTime != null">
-                create_time_ = #{createTime},
-            </if>
-            <if test="memo!=null">
-                memo_ = #{memo},
-            </if>
-            update_time_ = NOW()
-        </set>
-        WHERE id_ = #{id}
-    </update>
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.keao.edu.user.entity.ExamRegistration">
+		UPDATE exam_registration
+		<set>
+			<if test="examinationBasicId != null">
+				examination_basic_id_ = #{examinationBasicId},
+			</if>
+			<if test="subjectId != null">
+				subject_id_ = #{subjectId},
+			</if>
+			<if test="adviserPhone != null">
+				adviser_phone_ = #{adviserPhone},
+			</if>
+			<if test="lastExamLevel != null">
+				last_exam_level_ = #{lastExamLevel},
+			</if>
+			<if test="tenantId != null and tenantId != 0">
+				tenant_id_ = #{tenantId},
+			</if>
+			<if test="level != null">
+				level_ = #{level},
+			</if>
+			<if test="organId != null">
+				organ_id_ = #{organId},
+			</if>
+			<if test="songJson != null">
+				song_json_ = #{songJson},
+			</if>
+			<if test="adviserName != null">
+				adviser_name_ = #{adviserName},
+			</if>
+			<if test="studentId != null">
+				student_id_ = #{studentId},
+			</if>
+			<if test="lastExamCertificateUrl != null">
+				last_exam_certificate_url_ = #{lastExamCertificateUrl},
+			</if>
+			<if test="cardNo!=null">
+				card_no_ =#{cardNo},
+			</if>
+			<if test="status!=null">
+				status_ = #{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
+			</if>
+			<if test="memo!=null">
+				memo_ = #{memo},
+			</if>
+				update_time_ = NOW()
+		</set> WHERE id_ = #{id}
+	</update>
 
-    <!-- 根据主键删除一条记录 -->
-    <delete id="delete">
-        DELETE
-        FROM exam_registration
-        WHERE id_ = #{id}
-    </delete>
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete" >
+		DELETE FROM exam_registration WHERE id_ = #{id}
+	</delete>
 
-    <sql id="queryCondition">
-        <where>
-            <if test="organIds!=null">
-                AND er.organ_id_ IN
-                <foreach collection="organIds" item="organId" separator="," open="(" close=")">
-                    #{organId}
-                </foreach>
-            </if>
-            <if test="examId!=null">
-                AND er.examination_basic_id_ = #{examId}
-            </if>
-            <if test="organId!=null">
-                AND er.organ_id_ = #{organId}
-            </if>
-            <if test="subjectId!=null">
-                AND er.subject_id_ = #{subjectId}
-            </if>
-            <if test="level!=null">
-                AND er.level_ = #{level}
-            </if>
-            <if test="status!=null">
-                AND er.status_ = #{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}
-            </if>
-        </where>
-    </sql>
+	<sql id="queryCondition">
+		<where>
+			<if test="organIds!=null">
+				AND er.organ_id_ IN
+				<foreach collection="organIds" item="organId" separator="," open="(" close=")">
+					#{organId}
+				</foreach>
+			</if>
+			<if test="examId!=null">
+				AND er.examination_basic_id_ = #{examId}
+			</if>
+			<if test="organId!=null">
+				AND er.organ_id_ = #{organId}
+			</if>
+			<if test="subjectId!=null">
+				AND er.subject_id_ = #{subjectId}
+			</if>
+			<if test="level!=null">
+				AND er.level_ = #{level}
+			</if>
+			<if test="status!=null">
+				AND er.status_ = #{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}
+			</if>
+		</where>
+	</sql>
 
-    <!-- 分页查询 -->
-    <select id="queryPage" resultMap="ExamRegistration" parameterType="map">
-        SELECT
-        er.id_,
-        er.examination_basic_id_,
-        er.exam_music_theory_level_,
-        er.card_no_,
-        er.student_id_,
-        er.memo_,
-        su.real_name_ sys_user_real_name_,
-        er.last_exam_certificate_url_,
-        er.last_music_theory_certificate_url_,
-        er.level_fee_,
-        er.theory_level_fee_,
-        er.organ_id_,
-        er.subject_id_,
-        er.level_,
-        erp.trans_amount_,
-        er.status_,
-        er.create_time_
-        FROM
-        exam_registration er
-        LEFT JOIN sys_user su ON er.student_id_ = su.id_
-        LEFT JOIN exam_registration_payment erp ON er.id_ = erp.exam_registration_id_
-        <include refid="queryCondition"/>
-        ORDER BY er.id_
-        <include refid="global.limit"/>
-    </select>
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="ExamRegistration" parameterType="map">
+		SELECT
+			er.id_,
+			er.examination_basic_id_,
+			er.exam_music_theory_level_,
+			er.card_no_,
+			er.student_id_,
+			er.memo_,
+			su.real_name_ sys_user_real_name_,
+			er.last_exam_certificate_url_,
+			er.last_music_theory_certificate_url_,
+			er.level_fee_,
+			er.theory_level_fee_,
+			er.organ_id_,
+			er.subject_id_,
+			er.level_,
+			erp.trans_amount_,
+			er.status_,
+			er.create_time_
+		FROM
+			exam_registration er
+			LEFT JOIN sys_user su ON er.student_id_ = su.id_
+			LEFT JOIN exam_registration_payment erp ON er.id_ = erp.exam_registration_id_
+		<include refid="queryCondition"/>
+		ORDER BY er.id_
+		<include refid="global.limit"/>
+	</select>
 
-    <!-- 查询当前表的总记录数 -->
-    <select id="queryCount" resultType="int">
-        SELECT COUNT(*) FROM exam_registration er
-        <include refid="queryCondition"/>
-    </select>
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM exam_registration er
+		<include refid="queryCondition"/>
+	</select>
 
-    <sql id="queryExamRegistCondition">
-        <where>
-            <if test="organIds!=null">
-                AND er.organ_id_ IN
-                <foreach collection="organIds" item="organId" separator="," open="(" close=")">
-                    #{organId}
-                </foreach>
-            </if>
-            <if test="examId!=null">
-                AND er.examination_basic_id_ = #{examId}
-            </if>
-            <if test="organId!=null">
-                AND er.organ_id_ = #{organId}
-            </if>
-            <if test="subjectId!=null">
-                AND er.subject_id_ = #{subjectId}
-            </if>
-            <if test="level!=null">
-                AND er.level_ = #{level}
-            </if>
-            <if test="status!=null">
-                AND er.status_ = #{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}
-            </if>
-            <if test="inRoom!=null and inRoom=0">
-                AND ersr.exam_room_id_ IS NULL
-            </if>
-            <if test="inRoom!=null and inRoom=1">
-                AND ersr.exam_room_id_ IS NOT NULL
-            </if>
-        </where>
-    </sql>
+	<sql id="queryExamRegistCondition">
+		<where>
+			<if test="organIds!=null">
+				AND er.organ_id_ IN
+				<foreach collection="organIds" item="organId" separator="," open="(" close=")">
+					#{organId}
+				</foreach>
+			</if>
+			<if test="examId!=null">
+				AND er.examination_basic_id_ = #{examId}
+			</if>
+			<if test="organId!=null">
+				AND er.organ_id_ = #{organId}
+			</if>
+			<if test="subjectId!=null">
+				AND er.subject_id_ = #{subjectId}
+			</if>
+			<if test="level!=null">
+				AND er.level_ = #{level}
+			</if>
+			<if test="status!=null">
+				AND er.status_ = #{status,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}
+			</if>
+			<if test="inRoom!=null and inRoom=0">
+				AND ersr.exam_room_id_ IS NULL
+			</if>
+			<if test="inRoom!=null and inRoom=1">
+				AND ersr.exam_room_id_ IS NOT NULL
+			</if>
+		</where>
+	</sql>
 
-    <select id="queryExamRegist" resultMap="ExamRegistrationRoomDto" parameterType="map">
-        SELECT
-        er.id_,
-        er.examination_basic_id_,
-        er.exam_music_theory_level_,
-        er.card_no_,
-        er.student_id_,
-        er.memo_,
-        su.real_name_ sys_user_real_name_,
-        su.phone_ sys_user_phone_,
-        er.last_exam_certificate_url_,
-        er.last_music_theory_certificate_url_,
-        er.level_fee_,
-        er.theory_level_fee_,
-        er.organ_id_,
-        er.subject_id_,
-        er.level_,
-        erp.trans_amount_,
-        er.status_,
-        er.create_time_,
-        ersr.exam_room_id_,
-        ero.exam_start_time_,
-        ero.exam_end_time_
-        FROM
-        exam_registration er
-        LEFT JOIN sys_user su ON er.student_id_ = su.id_
-        LEFT JOIN exam_registration_payment erp ON er.id_ = erp.exam_registration_id_
-        LEFT JOIN exam_room_student_relation ersr ON ersr.exam_registration_id_ = er.id_
-        LEFT JOIN exam_room ero ON ero.id_ = ersr.exam_room_id_
-        <include refid="queryCondition"/>
-        ORDER BY er.id_
-        <include refid="global.limit"/>
-    </select>
+	<select id="queryExamRegist" resultMap="ExamRegistrationRoomDto" parameterType="map">
+		SELECT
+			er.id_,
+			er.examination_basic_id_,
+			er.exam_music_theory_level_,
+			er.card_no_,
+			er.student_id_,
+			er.memo_,
+			su.real_name_ sys_user_real_name_,
+			su.phone_ sys_user_phone_,
+			er.last_exam_certificate_url_,
+			er.last_music_theory_certificate_url_,
+			er.level_fee_,
+			er.theory_level_fee_,
+			er.organ_id_,
+			er.subject_id_,
+			er.level_,
+			erp.trans_amount_,
+			er.status_,
+			er.create_time_,
+			ersr.exam_room_id_,
+			ero.exam_start_time_,
+			ero.exam_end_time_
+		FROM
+			exam_registration er
+			LEFT JOIN sys_user su ON er.student_id_ = su.id_
+			LEFT JOIN exam_registration_payment erp ON er.id_ = erp.exam_registration_id_
+			LEFT JOIN exam_room_student_relation ersr ON ersr.exam_registration_id_ = er.id_
+			LEFT JOIN exam_room ero ON ero.id_ = ersr.exam_room_id_
+		<include refid="queryCondition"/>
+		ORDER BY er.id_
+		<include refid="global.limit"/>
+	</select>
 
-    <select id="countExamRegist" resultType="int">
-        SELECT COUNT(*) FROM exam_registration er
-        LEFT JOIN exam_room_student_relation ersr ON ersr.exam_registration_id_ = er.id_
-        <include refid="queryCondition"/>
-    </select>
+	<select id="countExamRegist" resultType="int">
+		SELECT COUNT(*) FROM exam_registration er
+		LEFT JOIN exam_room_student_relation ersr ON ersr.exam_registration_id_ = er.id_
+		<include refid="queryCondition"/>
+	</select>
 
     <select id="countWithoutExamRoomStudentNum" resultType="int">
-        SELECT
-        COUNT(ersr.id_)
-        FROM
-        exam_registration er
-        LEFT JOIN exam_room_student_relation ersr ON ersr.student_id_ = er.student_id_
-        WHERE 1=1
-        <if test="organIds!=null">
-            AND ersr.organ_id_ IN
-            <foreach collection="organIds" item="organI" separator="," open="(" close=")">
-                #{organI}
-            </foreach>
-        </if>
-        AND er.examination_basic_id_ = #{examId}
-        AND ersr.id_ IS NULL
-    </select>
+		SELECT
+			COUNT(ersr.id_)
+		FROM
+			exam_registration er
+		LEFT JOIN exam_room_student_relation ersr ON ersr.student_id_ = er.student_id_
+		WHERE 1=1
+		<if test="organIds!=null">
+			AND ersr.organ_id_ IN
+			<foreach collection="organIds" item="organI" separator="," open="(" close=")">
+				#{organI}
+			</foreach>
+		</if>
+		AND er.examination_basic_id_ = #{examId}
+		AND ersr.id_ IS NULL
+	</select>
 
-    <select id="countInExamRoomStudentNum" resultType="int">
-        SELECT
-        COUNT(ersr.id_)
-        FROM
-        exam_room_student_relation ersr
-        LEFT JOIN exam_registration er ON ersr.exam_registration_id_ = er.id_
-        WHERE 1=1
-        <if test="organIds!=null">
-            AND er.organ_id_ IN
-            <foreach collection="organIds" item="organI" separator="," open="(" close=")">
-                #{organI}
-            </foreach>
-        </if>
-        AND ersr.examination_basic_id_ = #{examId}
-    </select>
+	<select id="countInExamRoomStudentNum" resultType="int">
+		SELECT
+			COUNT(ersr.id_)
+		FROM
+			exam_room_student_relation ersr
+		LEFT JOIN exam_registration er ON ersr.exam_registration_id_ = er.id_
+		WHERE 1=1
+		<if test="organIds!=null">
+			AND er.organ_id_ IN
+			<foreach collection="organIds" item="organI" separator="," open="(" close=")">
+				#{organI}
+			</foreach>
+		</if>
+		AND ersr.examination_basic_id_ = #{examId}
+	</select>
 
-    <resultMap id="ExamRegistrationStatisticsDto" type="com.keao.edu.user.dto.ExamRegistrationStatisticsDto">
-        <result property="totalRegistrationStudentNum" column="totalRegistrationStudentNum"/>
-        <result property="childOrganRegistrationStudentNum" column="childOrganRegistrationStudentNum"/>
-        <result property="waitAuditStudentNum" column="waitAuditStudentNum"/>
-        <result property="refundedStudentNum" column="refundedStudentNum"/>
-    </resultMap>
+	<resultMap id="ExamRegistrationStatisticsDto" type="com.keao.edu.user.dto.ExamRegistrationStatisticsDto">
+		<result property="totalRegistrationStudentNum" column="totalRegistrationStudentNum"/>
+		<result property="childOrganRegistrationStudentNum" column="childOrganRegistrationStudentNum"/>
+		<result property="waitAuditStudentNum" column="waitAuditStudentNum"/>
+		<result property="refundedStudentNum" column="refundedStudentNum"/>
+	</resultMap>
 
     <select id="getExamRegistrationStaticsInfo" resultMap="ExamRegistrationStatisticsDto">
-        SELECT
-        SUM( CASE WHEN er.organ_id_ = #{selfOrganId} THEN 1 ELSE 0 END ) totalRegistrationStudentNum,
-        SUM( CASE WHEN er.organ_id_ != #{selfOrganId} THEN 1 ELSE 0 END ) childOrganRegistrationStudentNum,
-        SUM( CASE WHEN er.status_ = 'AUDIT_WAIT' THEN 1 ELSE 0 END ) waitAuditStudentNum,
-        SUM( CASE WHEN er.status_ = 'REFUNDED' THEN 1 ELSE 0 END ) refundedStudentNum
-        FROM
-        exam_registration er
-        WHERE
-        er.examination_basic_id_ = #{examId}
-        <if test="organIds!=null">
-            AND er.organ_id_ IN
-            <foreach collection="organIds" item="organId" separator="," open="(" close=")">
-                #{organId}
-            </foreach>
-        </if>
+		SELECT
+			SUM( CASE WHEN er.organ_id_ = #{selfOrganId} THEN 1 ELSE 0 END ) totalRegistrationStudentNum,
+			SUM( CASE WHEN er.organ_id_ != #{selfOrganId} THEN 1 ELSE 0 END ) childOrganRegistrationStudentNum,
+			SUM( CASE WHEN er.status_ = 'AUDIT_WAIT' THEN 1 ELSE 0 END ) waitAuditStudentNum,
+			SUM( CASE WHEN er.status_ = 'REFUNDED' THEN 1 ELSE 0 END ) refundedStudentNum
+		FROM
+			exam_registration er
+		WHERE
+			er.examination_basic_id_ = #{examId}
+			<if test="organIds!=null">
+				AND er.organ_id_ IN
+				<foreach collection="organIds" item="organId" separator="," open="(" close=")">
+					#{organId}
+				</foreach>
+			</if>
     </select>
 
-    <select id="countTotalRegistrationStudentNumWithExam" resultType="int">
-        SELECT
-        COUNT(er.id_)
-        FROM
-        exam_registration er
-        WHERE 1=1
-        <if test="organIds!=null">
-            AND er.organ_id_ IN
-            <foreach collection="organIds" item="organI" separator="," open="(" close=")">
-                #{organI}
-            </foreach>
-        </if>
-        AND er.examination_basic_id_ = #{examId}
-        AND er.status_ != ''
-    </select>
+	<select id="countTotalRegistrationStudentNumWithExam" resultType="int">
+		SELECT
+			COUNT(er.id_)
+		FROM
+		exam_registration er
+		WHERE 1=1
+		<if test="organIds!=null">
+			AND er.organ_id_ IN
+			<foreach collection="organIds" item="organI" separator="," open="(" close=")">
+				#{organI}
+			</foreach>
+		</if>
+		AND er.examination_basic_id_ = #{examId}
+		AND er.status_ != ''
+	</select>
+
     <select id="getWithExamAndStudents" resultMap="ExamRegistration">
-        SELECT * FROM exam_registration WHERE examination_basic_id_=#{examId} AND student_id_ IN
-        <foreach collection="studentIds" item="studentId" separator="," open="(" close=")">
-            #{studentId}
-        </foreach>
-    </select>
-    <resultMap id="ExamRegistrationDtoMap" type="com.keao.edu.user.dto.ExamRegistrationDto" extends="ExamRegistration">
-        <result property="studentName" column="studentName"/>
-        <result property="subjectName" column="subjectName"/>
-        <result property="examBaseName" column="examBaseName"/>
-        <result property="examStartTime" column="expect_exam_start_time_"/>
-        <result property="examEndTime" column="expect_exam_end_time_"/>
-        <result property="enrollEndTime" column="enroll_end_time_"/>
-        <result property="enrollStartTime" column="enroll_start_time_"/>
-    </resultMap>
+		SELECT * FROM exam_registration WHERE examination_basic_id_=#{examId} AND student_id_ IN
+		<foreach collection="studentIds" item="studentId" separator="," open="(" close=")">
+			#{studentId}
+		</foreach>
+	</select>
+
+	<select id="getRegists" resultMap="ExamRegistration">
+		SELECT * FROM exam_registration WHERE id_ IN
+		<foreach collection="registIds" item="registId" separator="," open="(" close=")">
+			#{registId}
+		</foreach>
+	</select>
+
+	<resultMap id="ExamRegistrationDtoMap" type="com.keao.edu.user.dto.ExamRegistrationDto" extends="ExamRegistration">
+		<result property="studentName" column="studentName"/>
+		<result property="subjectName" column="subjectName"/>
+		<result property="examBaseName" column="examBaseName"/>
+		<result property="examStartTime" column="expect_exam_start_time_"/>
+		<result property="examEndTime" column="expect_exam_end_time_"/>
+		<result property="enrollEndTime" column="enroll_end_time_"/>
+		<result property="enrollStartTime" column="enroll_start_time_"/>
+	</resultMap>
     <select id="countStudentList" resultType="java.lang.Integer">
-        SELECT COUNT(er.id_) FROM exam_registration er
-        <include refid="queryStudentListSql"/>
-    </select>
-    <sql id="queryStudentListSql">
-        <where>
-            <if test="studentId != null">
-                er.student_id_ = #{studentId}
-            </if>
-            <if test="examRegistrationId != null">
-                er.id_ = #{examRegistrationId}
-            </if>
-            <if test="tenantId != null">
-                er.tenant_id_ = #{tenantId}
-            </if>
-            <if test="status != null and status != ''">
-                er.status_ = #{status}
-            </if>
-        </where>
-    </sql>
-    <select id="queryStudentList" resultMap="ExamRegistrationDtoMap">
-        SELECT
-        er.*,eb.enroll_end_time_,eb.enroll_start_time_,eb.expect_exam_end_time_,eb.expect_exam_start_time_,eb.name_
-        examBaseName
-        FROM exam_registration er
-        LEFT JOIN examination_basic eb ON er.examination_basic_id_ = eb.id_
-        <include refid="queryStudentListSql"/>
-        ORDER BY er.update_time_ DESC
-        <include refid="global.limit"/>
-    </select>
-    <resultMap id="ExamRecordDtoMap" type="com.keao.edu.user.dto.ExamRecordDto" extends="ExamRegistration">
-        <result property="subjectName" column="subjectName"/>
-        <result property="examBaseName" column="examBaseName"/>
-        <result property="examCertificationId" column="examCertificationId"/>
-        <association property="studentExamResult"
-                     resultMap="com.keao.edu.user.dao.StudentExamResultDao.StudentExamResult"/>
-    </resultMap>
-    <select id="queryExamList" resultMap="ExamRecordDtoMap">
-        SELECT er.*, ser.*
-        FROM exam_registration er
-                 LEFT JOIN student_exam_result ser ON er.id_ = ser.exam_registration_id_
-        WHERE ser.id_ IS NOT NULL
-          AND er.student_id_ = #{studentId}
-    </select>
-    <select id="countExamList" resultType="java.lang.Integer">
-        SELECT COUNT(er.id_)
-        FROM exam_registration er
-                 LEFT JOIN student_exam_result ser ON er.id_ = ser.exam_registration_id_
-        WHERE ser.id_ IS NOT NULL
-          AND er.student_id_ = #{studentId}
-    </select>
+		SELECT COUNT(er.id_) FROM exam_registration er
+		<include refid="queryStudentListSql"/>
+	</select>
+	<sql id="queryStudentListSql">
+		<where>
+			<if test="studentId != null">
+				er.student_id_ = #{studentId}
+			</if>
+			<if test="examRegistrationId != null">
+				er.id_ = #{examRegistrationId}
+			</if>
+			<if test="tenantId != null and tenantId != 0">
+				er.tenant_id_ = #{tenantId}
+			</if>
+			<if test="status != null and status != ''">
+				er.status_ = #{status}
+			</if>
+		</where>
+	</sql>
+	<select id="queryStudentList" resultMap="ExamRegistrationDtoMap">
+		SELECT er.*,eb.enroll_end_time_,eb.enroll_start_time_,eb.expect_exam_end_time_,eb.expect_exam_start_time_,eb.name_ examBaseName
+		FROM exam_registration er
+		LEFT JOIN examination_basic eb ON er.examination_basic_id_ = eb.id_
+		<include refid="queryStudentListSql"/>
+		ORDER BY er.update_time_ DESC
+		<include refid="global.limit"/>
+	</select>
+	<resultMap id="ExamRecordDtoMap" type="com.keao.edu.user.dto.ExamRecordDto" extends="ExamRegistration">
+		<result property="subjectName" column="subjectName"/>
+		<result property="examBaseName" column="examBaseName"/>
+		<result property="examCertificationId" column="examCertificationId"/>
+		<association property="studentExamResult" resultMap="com.keao.edu.user.dao.StudentExamResultDao.StudentExamResult"/>
+	</resultMap>
+	<select id="queryExamList" resultMap="ExamRecordDtoMap">
+		SELECT er.*,ser.* FROM exam_registration er
+		LEFT JOIN student_exam_result ser ON er.id_ = ser.exam_registration_id_
+		WHERE ser.id_ IS NOT NULL AND er.student_id_ = #{studentId}
+	</select>
+	<select id="countExamList" resultType="java.lang.Integer">
+		SELECT COUNT(er.id_) FROM exam_registration er
+		LEFT JOIN student_exam_result ser ON er.id_ = ser.exam_registration_id_
+		WHERE ser.id_ IS NOT NULL AND er.student_id_ = #{studentId}
+	</select>
 
-    <!-- 获取报名信息 -->
-    <select id="getExamRegistration" resultMap="ExamRegistrationDtoMap">
-        SELECT er.*,
-               s.name_       subjectName,
-               su.real_name_ studentName,
-               eb.expect_exam_start_time_,
-               eb.expect_exam_end_time_
-        FROM exam_registration er
-                 LEFT JOIN sys_user su ON su.id_ = er.subject_id_
-                 LEFT JOIN examination_basic eb ON er.examination_basic_id_ = eb.id_
-                 LEFT JOIN subject s on er.subject_id_ = s.id_
-        WHERE er.id_ = #{examRegistrationId}
-    </select>
+	<!-- 获取报名信息 -->
+	<select id="getExamRegistration" resultMap="ExamRegistrationDtoMap">
+		SELECT er.*,s.name_ subjectName,su.real_name_ studentName,eb.expect_exam_start_time_,eb.expect_exam_end_time_ FROM exam_registration er
+		LEFT JOIN sys_user su ON su.id_ = er.subject_id_
+		LEFT JOIN examination_basic eb ON er.examination_basic_id_ = eb.id_
+		LEFT JOIN subject s on er.subject_id_ = s.id_
+		WHERE er.id_ = #{examRegistrationId}
+	</select>
 
-    <select id="getExamRegistrationInfo" resultMap="ExamRegistration">
-        SELECT er.*,
-               su.id_        sys_user_id_,
-               su.real_name_ sys_user_real_name_,
-               su.phone_     sys_user_phone_,
-               s.id_         subject_id_,
-               s.name_       subject_name_,
-               eb.name_      examination_basic_name_
-        FROM exam_registration er
-                 LEFT JOIN examination_basic eb ON eb.id_ = er.examination_basic_id_
-                 LEFT JOIN sys_user su ON er.student_id_ = su.id_
-                 LEFT JOIN subject s on er.subject_id_ = s.id_
-        WHERE er.id_ = #{id}
-    </select>
+	<select id="getExamRegistrationInfo" resultMap="ExamRegistration">
+		SELECT er.*, su.id_ sys_user_id_, su.real_name_ sys_user_real_name_,su.phone_ sys_user_phone_ , s.id_ subject_id_,
+		s.name_ subject_name_ ,eb.name_ examination_basic_name_
+		FROM exam_registration er
+		LEFT JOIN examination_basic eb ON eb.id_=er.examination_basic_id_
+		LEFT JOIN sys_user su ON er.student_id_ = su.id_
+		LEFT JOIN subject s on er.subject_id_ = s.id_
+		WHERE er.id_ = #{id}
+	</select>
 </mapper>

+ 1 - 1
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRegistrationPaymentMapper.xml

@@ -65,7 +65,7 @@
             <if test="id != null">
                 id_ = #{id},
             </if>
-            <if test="tenantId != null">
+            <if test="tenantId != null and tenantId != 0">
                 tenant_id_ = #{tenantId},
             </if>
             <if test="examRegistrationId != null">

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

@@ -60,7 +60,7 @@
 			<if test="evaluationResult != null">
 				evaluation_result_ = #{evaluationResult},
 			</if>
-			<if test="tenantId != null">
+			<if test="tenantId != null and tenantId != 0">
 				tenant_id_ = #{tenantId},
 			</if>
 			<if test="studentId != null">

+ 40 - 5
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomMapper.xml

@@ -87,7 +87,7 @@
 			<if test="subjectNameList != null">
 				subject_name_list_ = #{subjectNameList},
 			</if>
-			<if test="tenantId != null">
+			<if test="tenantId != null and tenantId != 0">
 				tenant_id_ = #{tenantId},
 			</if>
 			<if test="examMode != null">
@@ -142,7 +142,7 @@
 			<if test="subjectNameList != null">
 				subject_name_list_ = #{subjectNameList},
 			</if>
-			<if test="tenantId != null">
+			<if test="tenantId != null and tenantId != 0">
 				tenant_id_ = #{tenantId},
 			</if>
 			<if test="examMode != null">
@@ -212,7 +212,7 @@
 			<if test="examId!=null">
 				AND er.examination_basic_id_ = #{examId}
 			</if>
-			<if test="tenantId != null">
+			<if test="tenantId != null and tenantId != 0">
 				AND er.tenant_id_ = #{tenantId}
 			</if>
 			<if test="startTime != null">
@@ -255,6 +255,41 @@
 		ORDER BY eb.expect_exam_start_time_ DESC
 		<include refid="global.limit"/>
 	</select>
+
+	<sql id="queryExamRoomCondition">
+		<where>
+			<if test="organIds!=null">
+				AND er.organ_id_ IN
+				<foreach collection="organIds" item="organId" separator="," open="(" close=")">
+					#{organId}
+				</foreach>
+			</if>
+			<if test="examRoomId!=null">
+				AND er.id_=#{examRoomId}
+			</if>
+			<if test="examId!=null">
+				AND er.examination_basic_id_ = #{examId}
+			</if>
+		</where>
+	</sql>
+
+	<select id="queryExamRoom" resultMap="ExamRoomDto">
+		SELECT
+			er.*,
+			el.id_ el_id_,
+			el.name_ el_name_
+		FROM exam_room er
+			LEFT JOIN exam_location el ON er.exam_location_id_ = el.id_
+		<include refid="queryExamRoomCondition"/>
+		ORDER BY er.id_ DESC
+		<include refid="global.limit"/>
+	</select>
+
+	<select id="countExamRoom" resultType="java.lang.Integer">
+		SELECT COUNT(er.id_) FROM exam_room er
+		LEFT JOIN exam_location el ON er.exam_location_id_ = el.id_
+		<include refid="queryExamRoomCondition"/>
+	</select>
 	
     <select id="getWithExam" resultMap="ExamRoom">
 		SELECT * FROM exam_room WHERE examination_basic_id_=#{examId}
@@ -266,10 +301,10 @@
 		</if>
     </select>
 
-	<select id="lockRoom" resultType="com.keao.edu.user.api.entity.ExamRoom">
+	<select id="lockRoom" resultMap="ExamRoom">
 		SELECT * FROM exam_room WHERE id_=#{examRoomId} FOR UPDATE
 	</select>
-    <select id="getWithDays" resultType="com.keao.edu.user.api.entity.ExamRoom">
+    <select id="getWithDays" resultMap="ExamRoom">
 		SELECT
 			* 
 		FROM

+ 12 - 11
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml

@@ -61,7 +61,7 @@
 			<if test="classroomSwitch != null">
 				classroom_switch_ = #{classroomSwitch,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
 			</if>
-			<if test="tenantId != null">
+			<if test="tenantId != null and tenantId != 0">
 				tenant_id_ = #{tenantId},
 			</if>
 			<if test="examRoomId != null">
@@ -118,13 +118,13 @@
 				</foreach>
 			</if>
 			<if test="examId!=null">
-				AND er.examination_basic_id_ = 1
+				AND er.examination_basic_id_ = #{examId}
 			</if>
-			<if test="inRoom!=null and inRoom=0">
-				AND ersr.id_ IS NULL
+			<if test="inRoom!=null and inRoom==0">
+				AND ersr.id_ IS NULL AND FIND_IN_SET(er.subject_id_, #{subjectIds})
 			</if>
-			<if test="inRoom!=null and inRoom=1">
-				AND ersr.exam_room_id_ =1
+			<if test="inRoom!=null and inRoom==1">
+				AND ersr.exam_room_id_ =#{examRoomId}
 			</if>
 		</where>
 	</sql>
@@ -132,28 +132,29 @@
 	<select id="findExamRoomStudents" resultMap="ExamRoomStudentRelationDto" parameterType="map">
 		SELECT
 			ersr.id_,
-			ersr.student_id_,
+			er.id_ regist_id_,
+			er.student_id_ regist_student_id_,
 			er.subject_id_ regist_subject_id_,
 			er.level_ regist_level_,
 			er.create_time_ regist_create_time_
 		FROM
 			exam_registration er
-		LEFT JOIN exam_room_student_relation ersr ON ersr.student_id_ = er.student_id_ ON ersr.examination_basic_id_=er.examination_basic_id_
+		LEFT JOIN exam_room_student_relation ersr ON ersr.exam_registration_id_ = er.id_
 		<include refid="queryCondition"/>
 		ORDER BY id_ <include refid="global.limit"/>
 	</select>
 
 	<select id="countExamRoomStudents" resultType="int">
 		SELECT
-			COUNT(ersr.id_)
+			COUNT(er.id_)
 		FROM
 		exam_registration er
-		LEFT JOIN exam_room_student_relation ersr ON ersr.student_id_ = er.student_id_
+		LEFT JOIN exam_room_student_relation ersr ON ersr.exam_registration_id_ = er.id_
 		<include refid="queryCondition"/>
 	</select>
 
 	<select id="findStudentsWithExamRoom" resultMap="ExamRoomStudentRelation">
-		SELECT id_, examination_basic_id_, exam_room_id_, student_id_ FROM exam_room_student_relation WHERE exam_room_id_=#{examRoomId}
+		SELECT id_, exam_registration_id_, examination_basic_id_, exam_room_id_, student_id_ FROM exam_room_student_relation WHERE exam_room_id_=#{examRoomId}
 	</select>
 	<select id="getExamRoomStudentRelation" resultMap="ExamRoomStudentRelation">
 		SELECT * FROM exam_room_student_relation

+ 1 - 1
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamSubjectMapper.xml

@@ -51,7 +51,7 @@
 			<if test="id != null">
 				id_ = #{id},
 			</if>
-			<if test="tenantId != null">
+		<if test="tenantId != null and tenantId != 0">
 				tenant_id_ = #{tenantId},
 			</if>
 			update_time_ = NOW()

+ 1 - 1
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamSubjectSongMapper.xml

@@ -70,7 +70,7 @@
 			<if test="practiceNum != null">
 			practice_num_ = #{practiceNum},
 			</if>
-			<if test="tenantId != null">
+			<if test="tenantId != null and tenantId != 0">
 			tenant_id_ = #{tenantId},
 			</if>
 			<if test="examSubjectId != null">

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

@@ -65,7 +65,7 @@
 			<if test="teacherId != null">
 				teacher_id_ = #{teacherId},
 			</if>
-			<if test="tenantId != null">
+			<if test="tenantId != null and tenantId != 0">
 				tenant_id_ = #{tenantId},
 			</if>
 			<if test="examMode != null">
@@ -94,35 +94,35 @@
 		<foreach collection="teacherSalaries" item="ts" separator=";">
 			UPDATE exam_teacher_salary
 			<set>
-				<if test="examinationBasicId != null">
+				<if test="ts.examinationBasicId != null">
 					examination_basic_id_ = #{ts.examinationBasicId},
 				</if>
-				<if test="teacherId != null">
+				<if test="ts.teacherId != null">
 					teacher_id_ = #{ts.teacherId},
 				</if>
-				<if test="tenantId != null">
+				<if test="ts.tenantId != null">
 					tenant_id_ = #{ts.tenantId},
 				</if>
-				<if test="examMode != null">
+				<if test="ts.examMode != null">
 					exam_mode_ = #{ts.examMode,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
 				</if>
-				<if test="shareProfitAmount != null">
+				<if test="ts.shareProfitAmount != null">
 					share_profit_amount_ = #{ts.shareProfitAmount},
 				</if>
-				<if test="settlementType != null">
+				<if test="ts.settlementType != null">
 					settlement_type_ = #{ts.settlementType,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
 				</if>
-				<if test="totalInvigilationNum != null">
+				<if test="ts.totalInvigilationNum != null">
 					total_invigilation_num_ = #{ts.totalInvigilationNum},
 				</if>
-				<if test="totalInvigilationStudentNum != null">
+				<if test="ts.totalInvigilationStudentNum != null">
 					total_invigilation_student_num_ = #{ts.totalInvigilationStudentNum},
 				</if>
-				<if test="totalSettlementCost != null">
+				<if test="ts.totalSettlementCost != null">
 					total_settlement_fee_ = #{ts.totalSettlementCost},
 				</if>
 				update_time_ = NOW()
-			</set> WHERE id_ = #{id}
+			</set> WHERE id_ = #{ts.id}
 		</foreach>
 	</update>
 	

+ 1 - 1
edu-user/edu-user-server/src/main/resources/config/mybatis/OrganizationMapper.xml

@@ -85,7 +85,7 @@
 			<if test="delFlag != null">
 				del_flag_ = #{delFlag,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler},
 			</if>
-			<if test="tenantId != null">
+			<if test="tenantId != null and tenantId != 0">
 				tenant_id_ = #{tenantId},
 			</if>
 			<if test="userId != null">

+ 6 - 5
edu-user/edu-user-server/src/main/resources/config/mybatis/StudentExamResultMapper.xml

@@ -65,7 +65,7 @@
 			<if test="operatorId != null">
 				operator_id_ = #{operatorId},
 			</if>
-			<if test="tenantId != null">
+			<if test="tenantId != null and tenantId != 0">
 				tenant_id_ = #{tenantId},
 			</if>
 			<if test="confirmStatus != null">
@@ -143,10 +143,10 @@
 			<if test="result!=null">
 				AND ser.result_=#{result,typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}
 			</if>
-			<if test="resultConfirm!=null and resultConfirm=1">
+			<if test="resultConfirm!=null and resultConfirm==1">
 				AND eb.status_='RESULT_CONFIRM'
 			</if>
-			<if test="resultConfirm!=null and resultConfirm=0">
+			<if test="resultConfirm!=null and resultConfirm==0">
 				AND eb.status_!='RESULT_CONFIRM'
 			</if>
 		</where>
@@ -174,8 +174,9 @@
 			COUNT(er.id_)
 		FROM
 			student_exam_result ser
-			LEFT JOIN exam_registration er ON er.examination_basic_id_ = ser.examination_basic_id_
-			AND er.student_id_ = ser.student_id_
+			LEFT JOIN examination_basic eb ON ser.examination_basic_id_=eb.id_
+			LEFT JOIN exam_registration er ON ser.exam_registration_id_=er.id_
+			LEFT JOIN sys_user su ON ser.student_id_=su.id_
 		<include refid="queryStudentExamResultCondition"/>
 	</select>
 

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

@@ -40,7 +40,7 @@
 			<if test="certificatePhoto != null">
 				certificate_photo_ = #{certificatePhoto},
 			</if>
-			<if test="tenantId != null">
+			<if test="tenantId != null and tenantId != 0">
 				tenant_id_ = #{tenantId},
 			</if>
 			<if test="organId != null">
@@ -101,7 +101,7 @@
 			<if test="studentId != null">
 				AND er.student_id_ = #{studentId}
 			</if>
-			<if test="tenantId != null">
+			<if test="tenantId != null and tenantId != 0">
 				AND er.tenant_id_ = #{tenantId}
 			</if>
 		</where>

+ 5 - 6
edu-user/edu-user-server/src/main/resources/config/mybatis/SubjectMapper.xml

@@ -85,7 +85,7 @@
 	</select>
 
     <select id="findByParentId" resultMap="Subject">
-        SELECT * FROM subject <include refid="querySubPageSql"/>
+        SELECT * FROM subject s <include refid="querySubPageSql"/>
     </select>
 
     <select id="findBySubIds" resultType="string">
@@ -99,23 +99,22 @@
     <select id="findSubSubjects" resultMap="Subject">
         SELECT * FROM `subject`
         WHERE parent_subject_id_ != 0 AND del_flag_ = 0
-        <if test="tenantId != null">
+        <if test="tenantId != null and tenantId != 0">
             AND tenant_id_ = #{tenantId}
         </if>
     </select>
 
     <sql id="querySubPageSql">
         <where>
-            s.tenant_id_ = #{tenantId}
+            <if test="tenantId != null and tenantId != 0">
+                AND s.tenant_id_ = #{tenantId}
+            </if>
             <if test="parentId != null">
                 AND s.parent_subject_id_ = #{parentId}
             </if>
             <if test="parentId == null">
                 AND s.parent_subject_id_ != 0
             </if>
-            <if test="tenantId != null">
-                AND s.tenant_id_ = #{tenantId}
-            </if>
             <if test="delFlag != null">
                 AND s.del_flag_ = #{delFlag}
             </if>

+ 1 - 1
edu-user/edu-user-server/src/main/resources/config/mybatis/SysConfigMapper.xml

@@ -61,7 +61,7 @@
 			<if test="group != null">
 				group_ = #{group},
 			</if>
-			<if test="tenantId != null">
+			<if test="tenantId != null and tenantId != 0">
 				tenant_id_ = #{tenantId},
 			</if>
 		</set>

+ 4 - 5
edu-user/edu-user-server/src/main/resources/config/mybatis/SysUserMapper.xml

@@ -29,7 +29,7 @@
         <result column="id_card_no_" property="idCardNo"/>
         <result column="wechat_id_" property="wechatId"/>
         <result column="is_super_admin_" property="isSuperAdmin"/>
-        <result column="tenant_id_" property="tenantId"/>
+        <!--<result column="tenant_id_" property="tenantId"/>-->
         <!--<collection property="roles" ofType="java.lang.Integer" column="role_id_"/>-->
     </resultMap>
 
@@ -46,7 +46,6 @@
 
     <!-- 查询条件 -->
     <sql id="queryCondition">
-        tenant_id_ = #{tenantId}
         <if test="userStartDate != null">
             and create_time_ &gt;= #{createStartDate}
         </if>
@@ -65,7 +64,7 @@
 
     <!-- 全查询 -->
     <select id="findAll" resultMap="SysUser">
-		SELECT * FROM sys_user WHERE tenant_id_ = #{tenantId} ORDER BY id_
+		SELECT * FROM sys_user ORDER BY id_
 	</select>
 
     <!-- 向数据库增加一条记录 -->
@@ -73,9 +72,9 @@
             keyProperty="id">
         INSERT INTO sys_user
         (is_super_admin_,im_token_,id_,username_,salt_,phone_,avatar_,create_time_,update_time_,wx_openid_,qq_openid_,user_type_,
-        gender_,nation_,birthdate_,email_,id_card_no_,wechat_id_,real_name_,tenant_id_)
+        gender_,nation_,birthdate_,email_,id_card_no_,wechat_id_,real_name_)
         VALUES(#{isSuperAdmin},#{imToken},#{id},#{username},#{salt},#{phone},#{avatar},now(),now(),#{wxOpenid},#{qqOpenid},#{userType},
-        #{gender},#{nation},#{birthdate},#{email},#{idCardNo},#{wechatId},#{realName},#{tenantId})
+        #{gender},#{nation},#{birthdate},#{email},#{idCardNo},#{wechatId},#{realName})
     </insert>
 
     <!-- 根据主键查询一条记录 -->

+ 1 - 1
edu-user/edu-user-server/src/main/resources/config/mybatis/TenantInfoMapper.xml

@@ -25,7 +25,7 @@
 	
 	<!-- 根据主键查询一条记录 -->
 	<select id="get" resultMap="TenantInfo" >
-		SELECT * FROM tenant_info WHERE id_ = #{id} 
+		SELECT * FROM tenant_info WHERE id_ = #{id}
 	</select>
 	
 	<!-- 全查询 -->

+ 4 - 4
edu-user/edu-user-server/src/main/resources/logback-spring.xml

@@ -30,9 +30,9 @@
 	<logger name="com.keao.edu" level="INFO" />
 
 	<!--开发环境:打印控制台 -->
-		<root level="INFO">
-			<appender-ref ref="stdout" />
-			<appender-ref ref="file" />
-		</root>
+	<root level="INFO">
+		<appender-ref ref="stdout" />
+		<appender-ref ref="file" />
+	</root>
 
 </configuration>