Browse Source

Merge remote-tracking branch 'origin/master'

周箭河 5 năm trước cách đây
mục cha
commit
23b275458d

+ 12 - 0
edu-auth/edu-auth-server/src/main/java/com/keao/edu/auth/dal/dao/SysRoleDao.java

@@ -22,4 +22,16 @@ public interface SysRoleDao extends BaseDAO<Integer, SysRole> {
      * @return
      */
     SysRole findRoleByCode(@Param("code") String code);
+
+    /**
+     * @describe 根据角色名和机构编号获取角色
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/8/12
+     * @time 17:39
+     * @param roleName:
+     * @param tenantId:
+     * @return com.keao.edu.auth.api.entity.SysRole
+     */
+    SysRole findROleByNameAndTenantId(@Param("roleName") String roleName, @Param("tenantId") String tenantId);
 }

+ 4 - 0
edu-auth/edu-auth-server/src/main/java/com/keao/edu/auth/service/impl/SysRoleServiceImpl.java

@@ -44,6 +44,10 @@ public class SysRoleServiceImpl extends BaseServiceImpl<Integer, SysRole>  imple
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void addRole(SysRole sysRole) {
+		SysRole sysRole1 = sysRoleDao.findROleByNameAndTenantId(sysRole.getRoleName(),sysRole.getTenantId());
+		if(sysRole1 != null){
+			throw new BizException("创建失败:角色已存在");
+		}
 		sysRoleDao.insert(sysRole);
 		batchSave(sysRole);
 	}

+ 3 - 0
edu-auth/edu-auth-server/src/main/resources/config/mybatis/SysRoleMapper.xml

@@ -92,4 +92,7 @@
     <select id="findRoleByCode" resultMap="SysRole">
         SELECT sr.* FROM sys_role WHERE role_code_ = #{code} AND sr.del_flag_ = 0
     </select>
+    <select id="findROleByNameAndTenantId" resultMap="SysRole">
+        SELECT * FROM sys_role sr WHERE sr.role_name_ = #{roleName} AND sr.del_flag_ = 0 AND sr.tenant_id_ = #{tenantId} LIMIT 1
+    </select>
 </mapper>

+ 41 - 8
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/ExamRoomStudentRelationService.java

@@ -71,26 +71,59 @@ public interface ExamRoomStudentRelationService extends BaseService<Long, ExamRo
     void deleteStudentFromRoom(Long examRoomId, String registIds, Integer organId);
 
     /**
-     * 获取教室学员关联
-     * @param registrationId
-     * @return
+     * @describe 获取教室学员关联
+     * @author zouxuan
+     * @date 2020/8/12
+     * @time 13:15
+     * @param registrationId:
+     * @return com.keao.edu.user.api.entity.ExamRoomStudentRelation
      */
     ExamRoomStudentRelation getExamRoomStudentRelation(Long registrationId);
 
     /**
-     * 下一位
-     * @param examStatus 是否完成考试1是0否
+     * @describe 下一位
+     * @author zouxuan
+     * @date 2020/8/12
+     * @time 13:15
+     * @param examStatus: 是否完成考试1是0否
+     * @param roomId:
+     * @return void
      */
     void nextBit(Integer examStatus,Long roomId);
 
+    /**
+     * @describe 推送im消息
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/8/12
+     * @time 13:15
+     * @param examRoomStudentRelation: 考场学员关联
+     * @param action: 推送消息类型
+     * @param isPush: 是否推送
+     * @param operator: 推送人
+     * @return void
+     */
     public void publishMessage(ExamRoomStudentRelation examRoomStudentRelation,Integer action,Boolean isPush,Integer operator);
 
+    /**
+     * @describe
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/8/12
+     * @time 16:02
+     * @param examRegistrationId:
+     * @return com.keao.edu.im.api.entity.PublishMessageDto
+     */
     public PublishMessageDto getPublishMessage(Long examRegistrationId);
 
     /**
-     * 队列
-     * @param roomId
-     * @return
+     * @describe 获取学员待考队列
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/8/12
+     * @time 16:04
+     * @param roomId: 房间号
+     * @return java.util.Map<java.lang.String,java.lang.Object>
      */
     Map<String,Object> queryNeedCheckingList(Long roomId);
 

+ 2 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExaminationBasicServiceImpl.java

@@ -449,6 +449,8 @@ public class ExaminationBasicServiceImpl extends BaseServiceImpl<Long, Examinati
     @Override
     public Map<String, Object> getHomePageExams(Integer organId) {
         Map<String, Object> result=new HashMap<>();
+        result.put("exams", null);
+        result.put("statistics", null);
         List<Integer> childOrganIds = organizationService.getChildOrganIds(organId, true);
         List<ExaminationBasicDto> dataList = examinationBasicDao.getUnderwayExams(organId,childOrganIds);
         if(CollectionUtils.isEmpty(dataList)){

+ 9 - 5
edu-user/edu-user-biz/src/main/resources/config/mybatis/SysConfigMapper.xml

@@ -45,12 +45,16 @@
 	</insert>
 	<insert id="initSysConfig">
 		INSERT INTO `sys_config` (`param_name_`, `paran_value_`, `description_`, `annotation_`, `create_on_`, `modify_on_`, `group_`, `tenant_id_`)
-		VALUES ('exam_core_section', '[{\"excellent\":{\"startCore\":91,\"endCore\":100},\"good\":{\"startCore\":81,\"endCore\":90},\"general\":{\"startCore\":61,\"endCore\":80},\"flunk\":{\"startCore\":0,\"endCore\":60}}]',
-		'考试结果分数段设置', '考试结果分数段设置', NOW(), NOW(), 'default', #{tenantId});
+		SELECT param_name_,paran_value_,description_,annotation_,create_on_,modify_on_,group_,#{tenantId}
+		FROM sys_config WHERE tenant_id_ = '0' AND param_name_ = 'exam_score_section';
+
+		INSERT INTO `sys_config` (`param_name_`, `paran_value_`, `description_`, `annotation_`, `create_on_`, `modify_on_`, `group_`, `tenant_id_`)
+		SELECT param_name_,paran_value_,description_,annotation_,create_on_,modify_on_,group_,#{tenantId}
+		FROM sys_config WHERE tenant_id_ = '0' AND param_name_ = 'record_minutes';
+
 		INSERT INTO `sys_config` (`param_name_`, `paran_value_`, `description_`, `annotation_`, `create_on_`, `modify_on_`, `group_`, `tenant_id_`)
-		VALUES ('record_minutes', '15', '学员录播时长{}分钟', '学员录播时长', NOW(), NOW(), 'default', #{tenantId});
-		INSERT INTO `sys_config` (`param_name_`, `paran_value_`, `description_`, `annotation_`, `create_on_`, `modify_on_`, `group_`, `tenant_id_`) VALUES
-		 ('single_song_record_minutes', '5', '单首曲目录制{}分钟', '单首曲目录制时长',NOW(), NOW(), 'default', #{tenantId});
+		SELECT param_name_,paran_value_,description_,annotation_,create_on_,modify_on_,group_,#{tenantId}
+		FROM sys_config WHERE tenant_id_ = '0' AND param_name_ = 'single_song_record_minutes';
 	</insert>
 
 	<!-- 根据主键查询一条记录 -->