Преглед изворни кода

Merge remote-tracking branch 'origin/master'

Joburgess пре 5 година
родитељ
комит
753b7e881d
22 измењених фајлова са 551 додато и 84 уклоњено
  1. 0 1
      edu-im/edu-im-server/src/main/java/com/keao/edu/im/pojo/RoomResult.java
  2. 3 3
      edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/Impl/RoomServiceImpl.java
  3. 9 0
      edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/client/EduUserFeignService.java
  4. 5 0
      edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/client/fallback/EduUserFeignServiceFallback.java
  5. 2 11
      edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/entity/ExamRoom.java
  6. 72 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/AppVersionInfoController.java
  7. 7 14
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamRoomStudentRelationController.java
  8. 7 4
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/StudentExamResultController.java
  9. 17 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/AppVersionInfoDao.java
  10. 7 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/StudentExamResultDao.java
  11. 11 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/RoomStudentListDto.java
  12. 133 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/AppVersionInfo.java
  13. 1 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/StudentExamResult.java
  14. 15 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/AppVersionInfoService.java
  15. 2 6
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/ExamRoomStudentRelationService.java
  16. 7 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/StudentExamResultService.java
  17. 59 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/AppVersionInfoServiceImpl.java
  18. 64 38
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java
  19. 7 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/StudentExamResultServiceImpl.java
  20. 111 0
      edu-user/edu-user-server/src/main/resources/config/mybatis/AppVersionInfoMapper.xml
  21. 6 4
      edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml
  22. 6 2
      edu-user/edu-user-server/src/main/resources/config/mybatis/StudentExamResultMapper.xml

+ 0 - 1
edu-im/edu-im-server/src/main/java/com/keao/edu/im/pojo/RoomResult.java

@@ -15,7 +15,6 @@ public class RoomResult {
     private @Getter @Setter String roomId;
     private @Getter @Setter Date startTime;
     private @Getter @Setter int surplusTime;
-    private @Getter @Setter int examFlag;
     private @Getter @Setter Long registrationId;
     private @Getter @Setter String imToken;
     private @Getter @Setter String authorization;

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

@@ -200,10 +200,10 @@ public class RoomServiceImpl implements RoomService {
     public BaseResponse joinRoom(Long registrationId, boolean isAudience, boolean isDisableCamera, boolean isMusicMode, String roomId) throws ApiException, Exception {
         if(registrationId != null){
             StudentExamResultApiDto examResult = eduUserFeignService.getExamResult(registrationId);
-            Integer recordFlag = examResult.getRecordFlag();
+            /*Integer recordFlag = examResult.getRecordFlag();
             if(recordFlag != null && recordFlag == 1){
                 joinRecorded(registrationId);
-            }
+            }*/
             roomId = examResult.getRoomId();
         }
 
@@ -333,12 +333,12 @@ public class RoomServiceImpl implements RoomService {
         if (registrationId != null){
             roomResult.setRegistrationId(registrationId);
         }
-        roomResult.setExamFlag(examRoom.getExamFlag());
         roomResult.setMembers(roomMemberDao.findByRid(roomId));
 //        List<Whiteboard> whiteboardList = whiteboardDao.findByRid(roomId);
 //        roomResult.setWhiteboards(whiteboardList);
         log.info("join success: roomId = {}, userId = {}, userName={}, role = {}", roomId, userId, roleEnum);
         if(registrationId != null){
+            eduUserFeignService.updateFinishedExam(registrationId,0);
             this.publishMessage(eduUserFeignService.getPublishMessage(registrationId));
         }
         return baseResponse;

+ 9 - 0
edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/client/EduUserFeignService.java

@@ -8,6 +8,7 @@ import com.keao.edu.user.api.client.fallback.EduUserFeignServiceFallback;
 import com.keao.edu.user.api.entity.ExamRoom;
 import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
 import com.keao.edu.user.api.enums.StudentExamResultApiDto;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
@@ -64,4 +65,12 @@ public interface EduUserFeignService {
 	 */
 	@PostMapping(value = "examRoomStudentRelation/api/getExamRoomStudentRelation")
 	ExamRoomStudentRelation getExamRoomStudentRelation(@RequestParam("registrationId") Long registrationId);
+
+	/**
+	 * 修改学员考试状态
+	 * @param examRegistrationId
+	 * @param finishedExam
+	 */
+	@PostMapping(value = "studentExamResult/api/updateFinishedExam")
+	void updateFinishedExam(@RequestParam("examRegistrationId") Long examRegistrationId, @RequestParam("finishedExam") Integer finishedExam);
 }

+ 5 - 0
edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/client/fallback/EduUserFeignServiceFallback.java

@@ -39,4 +39,9 @@ public class EduUserFeignServiceFallback implements EduUserFeignService {
 	public ExamRoomStudentRelation getExamRoomStudentRelation(Long registrationId) {
 		return null;
 	}
+
+	@Override
+	public void updateFinishedExam(Long examRegistrationId, Integer finishedExam) {
+
+	}
 }

+ 2 - 11
edu-user/edu-user-client-api/src/main/java/com/keao/edu/user/api/entity/ExamRoom.java

@@ -1,6 +1,5 @@
 package com.keao.edu.user.api.entity;
 
-import com.keao.edu.common.enums.YesOrNoEnum;
 import com.keao.edu.user.api.enums.ExamModeEnum;
 import io.swagger.annotations.ApiModelProperty;
 import org.apache.commons.lang3.builder.ToStringBuilder;
@@ -55,8 +54,8 @@ public class ExamRoom {
 	@ApiModelProperty(value = "考场状态0关闭1开启")
 	private Integer openFlag;
 
-	@ApiModelProperty(value = "考试状态1开始0关闭")
-	private Integer examFlag;
+//	@ApiModelProperty(value = "考试状态1开始0关闭")
+//	private Integer examFlag;
 
 	private Integer examPlanPushFlag;
 
@@ -73,14 +72,6 @@ public class ExamRoom {
 	/**  */
 	private String tenantId;
 
-	public Integer getExamFlag() {
-		return examFlag;
-	}
-
-	public void setExamFlag(Integer examFlag) {
-		this.examFlag = examFlag;
-	}
-
 	public ExamRoom() {
 	}
 

+ 72 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/AppVersionInfoController.java

@@ -0,0 +1,72 @@
+package com.keao.edu.user.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiOperation;
+
+import java.util.List;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.keao.edu.common.controller.BaseController;
+import com.keao.edu.common.page.QueryInfo;
+import com.keao.edu.user.entity.AppVersionInfo;
+import com.keao.edu.user.service.AppVersionInfoService;
+
+@RequestMapping("appVersionInfo")
+@Api(tags = "APP版本信息服务")
+@RestController
+public class AppVersionInfoController extends BaseController {
+
+	@Autowired
+	private AppVersionInfoService appVersionInfoService;
+
+	@ApiOperation("分页查询")
+	@GetMapping(value = "/list")
+	@PreAuthorize("@pcs.hasPermissions('appVersionInfo/list')")
+	public Object getList(QueryInfo queryInfo) {
+		return succeed(appVersionInfoService.queryPage(queryInfo));
+	}
+
+	@ApiOperation("根据app客户端查询对象")
+	@ApiImplicitParam(name = "platform", value = "平台名称", required = true, dataType = "String", paramType = "path")
+	@GetMapping(value = "/queryByPlatform")
+	public Object queryByPlatform(String platform) {
+		List<AppVersionInfo> list = appVersionInfoService.queryNewestByPlatform(platform);
+		if (list.size() > 0) {
+			return succeed(list.get(0));
+		}
+		return failed();
+	}
+
+	@ApiOperation("单查询")
+	@ApiImplicitParam(name = "id", value = "ID编号", required = true, dataType = "Integer", paramType = "path")
+	@GetMapping(value = "/query")
+	@PreAuthorize("@pcs.hasPermissions('appVersionInfo/query')")
+	public Object query(Integer id) {
+		return succeed(appVersionInfoService.get(id));
+	}
+
+	@ApiOperation("新增")
+	@PostMapping(value = "/add", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PreAuthorize("@pcs.hasPermissions('appVersionInfo/add')")
+	public Object add(AppVersionInfo appVersionInfo) {
+		appVersionInfoService.add(appVersionInfo);
+		return succeed();
+	}
+
+	@ApiOperation("更新")
+	@PostMapping(value = "/update", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
+	@PreAuthorize("@pcs.hasPermissions('appVersionInfo/update')")
+	public Object update(AppVersionInfo appVersionInfo) {
+		appVersionInfoService.updateVersion(appVersionInfo);
+		return succeed();
+	}
+
+}

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

@@ -51,29 +51,22 @@ public class ExamRoomStudentRelationController extends BaseController {
 
     @ApiOperation("下一位")
     @PostMapping(value = "/nextBit")
-    public HttpResponseResult nextBit(Long nextExamRoomStudentRelationId,Long examRoomStudentRelationId,Integer examStatus,Long roomId) {
-        examRoomStudentRelationService.nextBit(nextExamRoomStudentRelationId,examRoomStudentRelationId,examStatus,roomId);
+    public HttpResponseResult nextBit(Integer examStatus,Long roomId) {
+        examRoomStudentRelationService.nextBit(examStatus,roomId);
         return succeed();
     }
 
-    @ApiOperation("开始考试")
+    /*@ApiOperation("开始考试")
     @PostMapping(value = "/actionExam")
     public HttpResponseResult actionExam(Long examRoomStudentRelationId) {
         examRoomStudentRelationService.actionExam(examRoomStudentRelationId);
         return succeed();
-    }
-
-    @ApiOperation("关闭考试")
-    @PostMapping(value = "/closeExam")
-    public HttpResponseResult closeExam(Long examRoomStudentRelationId) {
-        examRoomStudentRelationService.actionExam(examRoomStudentRelationId);
-        return succeed();
-    }
+    }*/
 
-    @ApiOperation("监考端指定学员去录播")
+    @ApiOperation("监考端选择去录播")
     @PostMapping(value = "/webRecorded")
-    public HttpResponseResult webRecorded(Long nextExamRoomStudentRelationId,Long examRoomStudentRelationId,Long roomId) {
-        examRoomStudentRelationService.recorded(nextExamRoomStudentRelationId,examRoomStudentRelationId,roomId);
+    public HttpResponseResult webRecorded(Long roomId) {
+        examRoomStudentRelationService.recorded(roomId);
         return succeed();
     }
 

+ 7 - 4
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/StudentExamResultController.java

@@ -15,10 +15,7 @@ import com.keao.edu.user.service.StudentExamResultService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.util.Objects;
 
@@ -59,6 +56,12 @@ public class StudentExamResultController extends BaseController {
         return succeed();
     }
 
+    @ApiOperation("修改考试状态")
+    @PostMapping(value = "/api/updateFinishedExam")
+    public void updateFinishedExam(Long examRegistrationId,Integer finishedExam){
+        studentExamResultService.updateFinishedExam(examRegistrationId,finishedExam);
+    }
+
     @ApiOperation("获取考试结果")
     @PostMapping(value = "/api/get")
     public StudentExamResultApiDto get(Long id){

+ 17 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/AppVersionInfoDao.java

@@ -0,0 +1,17 @@
+package com.keao.edu.user.dao;
+
+import java.util.List;
+
+import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.user.entity.AppVersionInfo;
+
+public interface AppVersionInfoDao extends BaseDAO<Integer, AppVersionInfo> {
+
+	List<AppVersionInfo> queryNewestByPlatform(String platform);
+
+	/**
+	 * 修改所有的为历史
+	 * @param platform
+	 */
+	void batchUpdateStatus(String platform);
+}

+ 7 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dao/StudentExamResultDao.java

@@ -70,4 +70,11 @@ public interface StudentExamResultDao extends BaseDAO<Long, StudentExamResult> {
      * @param examRegistrationId
      */
     void confirmStudent(Long examRegistrationId);
+
+    /**
+     * 修改学员考试状态
+     * @param examRegistrationId
+     * @param finishedExam
+     */
+    void updateFinishedExam(@Param("examRegistrationId") Long examRegistrationId, @Param("finishedExam") Integer finishedExam);
 }

+ 11 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/dto/RoomStudentListDto.java

@@ -22,12 +22,23 @@ public class RoomStudentListDto {
     @ApiModelProperty(value = "级别")
     private Integer level;
 
+    @ApiModelProperty(value = "学员考试状态 0考试中,1呼叫中,2已签到,3未签到,4录播中,5已完成")
+    private Integer finishedExam;
+
     @ApiModelProperty(value = "房间编号")
     private Long examRoomId;
 
     @ApiModelProperty(value = "学员编号")
     private Integer studentId;
 
+    public Integer getFinishedExam() {
+        return finishedExam;
+    }
+
+    public void setFinishedExam(Integer finishedExam) {
+        this.finishedExam = finishedExam;
+    }
+
     public String getSignInTime() {
         return signInTime;
     }

+ 133 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/entity/AppVersionInfo.java

@@ -0,0 +1,133 @@
+package com.keao.edu.user.entity;
+
+import org.apache.commons.lang3.builder.ToStringBuilder;
+
+/**
+ * 对应数据库表(app_version_info):
+ */
+public class AppVersionInfo {
+
+	/**  */
+	private Integer id;
+	
+	/** 平台(andorid/ios) */
+	private String platform;
+	
+	/** 版本号(以V开头) */
+	private String version;
+	
+	/** 状态(newest/history) */
+	private String status;
+	
+	/** 是否强制更新 */
+	private boolean isForceUpdate;
+	
+	/** 更新描述 */
+	private String description;
+	
+	/** 下载地址 */
+	private byte[] downloadUrl;
+	
+	/** 创建人 */
+	private Integer operatorId;
+	
+	/**  */
+	private java.util.Date updateTime;
+	
+	/**  */
+	private java.util.Date createTime;
+
+	public boolean isForceUpdate() {
+		return isForceUpdate;
+	}
+
+	public void setForceUpdate(boolean forceUpdate) {
+		isForceUpdate = forceUpdate;
+	}
+
+	public void setId(Integer id){
+		this.id = id;
+	}
+	
+	public Integer getId(){
+		return this.id;
+	}
+			
+	public void setPlatform(String platform){
+		this.platform = platform;
+	}
+	
+	public String getPlatform(){
+		return this.platform;
+	}
+			
+	public void setVersion(String version){
+		this.version = version;
+	}
+	
+	public String getVersion(){
+		return this.version;
+	}
+			
+	public void setStatus(String status){
+		this.status = status;
+	}
+	
+	public String getStatus(){
+		return this.status;
+	}
+			
+	public void setIsForceUpdate(boolean isForceUpdate){
+		this.isForceUpdate = isForceUpdate;
+	}
+	
+	public boolean getIsForceUpdate(){
+		return this.isForceUpdate;
+	}
+			
+	public void setDescription(String description){
+		this.description = description;
+	}
+	
+	public String getDescription(){
+		return this.description;
+	}
+			
+	public void setDownloadUrl(byte[] downloadUrl){
+		this.downloadUrl = downloadUrl;
+	}
+	
+	public byte[] getDownloadUrl(){
+		return this.downloadUrl;
+	}
+			
+	public void setOperatorId(Integer operatorId){
+		this.operatorId = operatorId;
+	}
+	
+	public Integer getOperatorId(){
+		return this.operatorId;
+	}
+			
+	public void setUpdateTime(java.util.Date updateTime){
+		this.updateTime = updateTime;
+	}
+	
+	public java.util.Date getUpdateTime(){
+		return this.updateTime;
+	}
+			
+	public void setCreateTime(java.util.Date createTime){
+		this.createTime = createTime;
+	}
+	
+	public java.util.Date getCreateTime(){
+		return this.createTime;
+	}
+			
+	@Override
+	public String toString() {
+		return ToStringBuilder.reflectionToString(this);
+	}
+
+}

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

@@ -43,7 +43,7 @@ public class StudentExamResult {
 	@ApiModelProperty(value = "操作者")
 	private Integer operatorId;
 
-	@ApiModelProperty(value = "是否参与考试")
+	@ApiModelProperty(value = "学员考试状态 0考试中,1呼叫中,2已签到,3未签到,4录播中,5已完成")
 	private Integer isFinishedExam;
 
 	@ApiModelProperty(value = "视频连接")

+ 15 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/AppVersionInfoService.java

@@ -0,0 +1,15 @@
+package com.keao.edu.user.service;
+
+import java.util.List;
+
+import com.keao.edu.common.service.BaseService;
+import com.keao.edu.user.entity.AppVersionInfo;
+
+public interface AppVersionInfoService extends BaseService<Integer, AppVersionInfo> {
+
+	List<AppVersionInfo> queryNewestByPlatform(String platform);
+
+	void add(AppVersionInfo appVersionInfo);
+
+	void updateVersion(AppVersionInfo appVersionInfo);
+}

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

@@ -71,11 +71,9 @@ public interface ExamRoomStudentRelationService extends BaseService<Long, ExamRo
 
     /**
      * 下一位
-     * @param nextExamRoomStudentRelationId 下一位学员
-     * @param examRoomStudentRelationId 学员考场关联
      * @param examStatus 是否完成考试1是0否
      */
-    void nextBit(Long nextExamRoomStudentRelationId, Long examRoomStudentRelationId, Integer examStatus,Long roomId);
+    void nextBit(Integer examStatus,Long roomId);
 
     public void publishMessage(ExamRoomStudentRelation examRoomStudentRelation,Integer action,Boolean isPush);
 
@@ -103,11 +101,9 @@ public interface ExamRoomStudentRelationService extends BaseService<Long, ExamRo
 
     /**
      * 监考端去录播
-     * @param nextExamRoomStudentRelationId 下一位学员房间关联id
-     * @param examRoomStudentRelationId 当前学员房间关联id
      * @param roomId 房间编号
      */
-    void recorded(Long nextExamRoomStudentRelationId, Long examRoomStudentRelationId, Long roomId);
+    void recorded(Long roomId);
 
     /**
      * 学生端去录播

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

@@ -50,4 +50,11 @@ public interface StudentExamResultService extends BaseService<Long, StudentExamR
      * @param examRegistrationId
      */
     void confirmStudent(Long examRegistrationId);
+
+    /**
+     * 修改学员考试状态
+     * @param examRegistrationId
+     * @param finishedExam
+     */
+    void updateFinishedExam(Long examRegistrationId, Integer finishedExam);
 }

+ 59 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/AppVersionInfoServiceImpl.java

@@ -0,0 +1,59 @@
+package com.keao.edu.user.service.impl;
+
+import java.util.Date;
+import java.util.List;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.common.exception.BizException;
+import com.keao.edu.common.service.impl.BaseServiceImpl;
+import com.keao.edu.user.dao.AppVersionInfoDao;
+import com.keao.edu.user.entity.AppVersionInfo;
+import com.keao.edu.user.service.AppVersionInfoService;
+
+@Service
+public class AppVersionInfoServiceImpl extends BaseServiceImpl<Integer, AppVersionInfo>  implements AppVersionInfoService {
+	
+	@Autowired
+	private AppVersionInfoDao appVersionInfoDao;
+
+	@Override
+	public BaseDAO<Integer, AppVersionInfo> getDAO() {
+		return appVersionInfoDao;
+	}
+
+	@Override
+	public List<AppVersionInfo> queryNewestByPlatform(String platform) {
+		return appVersionInfoDao.queryNewestByPlatform(platform);
+	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void add(AppVersionInfo appVersionInfo) {
+		if(StringUtils.isEmpty(appVersionInfo.getPlatform())){
+			throw new BizException("参数校验异常");
+		}
+		if (StringUtils.equals(appVersionInfo.getStatus(), "newest")) {
+			//修改其他的为历史版本
+			appVersionInfoDao.batchUpdateStatus(appVersionInfo.getPlatform());
+		}
+		appVersionInfoDao.insert(appVersionInfo);
+	}
+
+	@Override
+	public void updateVersion(AppVersionInfo appVersionInfo) {
+		if(StringUtils.isEmpty(appVersionInfo.getPlatform())){
+			throw new BizException("参数校验异常");
+		}
+		if (StringUtils.equals(appVersionInfo.getStatus(), "newest")) {
+			appVersionInfoDao.batchUpdateStatus(appVersionInfo.getPlatform());
+		}
+		appVersionInfo.setUpdateTime(new Date());
+		appVersionInfoDao.update(appVersionInfo);
+	}
+
+}

+ 64 - 38
edu-user/edu-user-server/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -293,17 +293,33 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void recorded(Long nextExamRoomStudentRelationId, Long examRoomStudentRelationId, Long roomId) {
-		if(examRoomStudentRelationId != null){
-			ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(examRoomStudentRelationId);
+	public void recorded(Long roomId) {
+		List<RoomStudentListDto> roomStudentListDtos = examRoomStudentRelationDao.queryStudentList(roomId);
+		if(roomStudentListDtos != null && roomStudentListDtos.size() > 0){
+			RoomStudentListDto roomStudentListDto = roomStudentListDtos.get(0);
+			if(roomStudentListDto.getFinishedExam() != 0){
+				throw new BizException("操作失败:当前学员状态不支持录播");
+			}
+			ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(roomStudentListDto.getExamRoomStudentRelationId());
+
+			//修改学员考试状态
+			StudentExamResult studentExamResult = studentExamResultDao.findByRegistrationId(examRoomStudentRelation.getExamRegistrationId());
+			studentExamResult.setRecordFlag(1);
+			studentExamResult.setIsFinishedExam(4);
+			studentExamResultDao.update(studentExamResult);
+			//关闭学员房间入口
 			examRoomStudentRelation.setClassroomSwitch(0);
 			examRoomStudentRelationDao.update(examRoomStudentRelation);
-			StudentExamResult byRegistrationId = studentExamResultDao.findByRegistrationId(examRoomStudentRelation.getExamRegistrationId());
-			byRegistrationId.setRecordFlag(1);
-			studentExamResultDao.update(byRegistrationId);
 			publishMessage(examRoomStudentRelation,MemberChangedMessage.Action_Recorded,true);
+			if(roomStudentListDtos.size() > 1){
+				RoomStudentListDto roomStudentListDto1 = roomStudentListDtos.get(1);
+				if(roomStudentListDto1.getFinishedExam() == 2){
+					nextStudent(roomStudentListDto1.getExamRoomStudentRelationId(),false);
+				}
+			}
+			//将当前学员退出教室
+			imFeignService.leaveRoom(new ReqUserData(examRoomStudentRelation.getExamRegistrationId()));
 		}
-		nextStudent(nextExamRoomStudentRelationId,false);
 	}
 
 	@Override
@@ -388,23 +404,22 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 	@Transactional(rollbackFor = Exception.class)
 	public void stuEndRecord(Long examRegistrationId, String videoUrl) {
 		StudentExamResult studentExamResult = studentExamResultDao.findByRegistrationId(examRegistrationId);
-		//当前学员是否完成考试
 		if(studentExamResult.getIsFinishedExam() == 1){
 			throw new BizException("提交失败:您的考试已完成");
 		}
-		//是否允许录播
-		if(studentExamResult.getRecordFlag() == 0){
-			throw new BizException("提交失败:当前考试不允许录播");
+		//当前学员是否完成考试
+		if(studentExamResult.getIsFinishedExam() != 4){
+			throw new BizException("提交失败:当前考试状态不允许录播");
 		}
 		studentExamResult.setVideoUrl(videoUrl);
-		studentExamResult.setIsFinishedExam(1);
+		studentExamResult.setIsFinishedExam(5);
 		studentExamResultDao.update(studentExamResult);
 	}
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
 	public void actionExam(Long examRoomStudentRelationId) {
-		ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(examRoomStudentRelationId);
+		/*ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(examRoomStudentRelationId);
 		examRoomStudentRelation.setClassroomSwitch(1);
 
 		ExamRoom examRoom = examRoomDao.get(examRoomStudentRelation.getExamRoomId());
@@ -414,38 +429,47 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		examRoomStudentRelationDao.update(examRoomStudentRelation);
 		examRoom.setExamFlag(1);
 		examRoomDao.update(examRoom);
-		publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,true);
+		publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,true);*/
 	}
 
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void nextBit(Long nextExamRoomStudentRelationId, Long currentExamRoomStudentRelationId, Integer examStatus,Long examRoomId) {
-		Boolean isPush = true;
-		if(currentExamRoomStudentRelationId != null){
-			ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(currentExamRoomStudentRelationId);
-			//将当前学员退出教室并添加参考状态,如果考试未完成,清除签到时间,重新签到
-			imFeignService.leaveRoom(new ReqUserData(examRoomStudentRelation.getExamRegistrationId()));
-			if(examStatus == 0){
-				//未完成
-				examRoomStudentRelationDao.cleanSignInTime(examRoomStudentRelation.getExamRegistrationId());
-			}else {
-				//结束考试
-				studentExamResultDao.endExam(examRoomStudentRelation.getExamRegistrationId());
+	public void nextBit(Integer examStatus,Long examRoomId) {
+		List<RoomStudentListDto> roomStudentListDtos = examRoomStudentRelationDao.queryStudentList(examRoomId);
+		if(roomStudentListDtos != null && roomStudentListDtos.size() > 0){
+			RoomStudentListDto roomStudentListDto = roomStudentListDtos.get(0);
+			if(roomStudentListDto.getFinishedExam() == 0 || roomStudentListDto.getFinishedExam() == 1){
+				//考试中
+				currentStudent(roomStudentListDto.getExamRoomStudentRelationId(),true,examStatus);
+				if(roomStudentListDtos.size() > 1){
+					RoomStudentListDto roomStudentListDto1 = roomStudentListDtos.get(1);
+					if(roomStudentListDto1.getFinishedExam() == 2){
+						nextStudent(roomStudentListDto1.getExamRoomStudentRelationId(),false);
+					}
+				}
+			}else if(roomStudentListDto.getFinishedExam() == 2){
+				//未开始
+				nextStudent(roomStudentListDto.getExamRoomStudentRelationId(),true);
 			}
-			//关闭学员房间入口
-			examRoomStudentRelation.setClassroomSwitch(0);
-			examRoomStudentRelationDao.update(examRoomStudentRelation);
-			publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,isPush);
 		}
-		nextStudent(nextExamRoomStudentRelationId,false);
+	}
 
-		/*try {
-			SysUser sysUser = sysUserFeignService.queryUserInfo();
-			String message = JSONObject.toJSONString(this.queryNeedCheckingList(examRoomId));
-			WebSocketServer.sendInfo(message,sysUser.getId().toString());
-		} catch (IOException e) {
-			e.printStackTrace();
-		}*/
+	private void currentStudent(Long examRoomStudentRelationId,Boolean isPush,Integer examStatus){
+		ExamRoomStudentRelation examRoomStudentRelation = examRoomStudentRelationDao.get(examRoomStudentRelationId);
+		//将当前学员退出教室并添加参考状态,如果考试未完成,清除签到时间,重新签到
+		imFeignService.leaveRoom(new ReqUserData(examRoomStudentRelation.getExamRegistrationId()));
+		if(examStatus == 0){
+			//未完成
+			examRoomStudentRelationDao.cleanSignInTime(examRoomStudentRelation.getExamRegistrationId());
+			studentExamResultDao.updateFinishedExam(examRoomStudentRelation.getExamRegistrationId(),2);
+		}else {
+			//结束考试
+			studentExamResultDao.updateFinishedExam(examRoomStudentRelation.getExamRegistrationId(),4);
+		}
+		//关闭学员房间入口
+		examRoomStudentRelation.setClassroomSwitch(0);
+		examRoomStudentRelationDao.update(examRoomStudentRelation);
+		publishMessage(examRoomStudentRelation,MemberChangedMessage.Student_Queue,isPush);
 	}
 
 	private void nextStudent(Long nextExamRoomStudentRelationId,Boolean isPush){
@@ -539,6 +563,8 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 //		msg.setAppParamJson(needCheckingDetailDto.getWaitNum());
 		msg.setWaitNum(needCheckingDetailDto.getWaitNum());
 		publishMessageDto.setMemberChangedMessage(msg);
+		//修改签到状态
+		studentExamResultDao.updateFinishedExam(examRegistrationId,2);
 		imFeignService.publishMessage(publishMessageDto);
 	}
 }

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

@@ -23,6 +23,7 @@ import com.keao.edu.user.service.StudentExamResultService;
 import com.keao.edu.util.collection.MapUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
 
 import java.util.*;
 import java.util.stream.Collectors;
@@ -138,4 +139,10 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
 	public void confirmStudent(Long examRegistrationId) {
 		studentExamResultDao.confirmStudent(examRegistrationId);
 	}
+
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public void updateFinishedExam(Long examRegistrationId, Integer finishedExam) {
+		studentExamResultDao.updateFinishedExam(examRegistrationId,finishedExam);
+	}
 }

+ 111 - 0
edu-user/edu-user-server/src/main/resources/config/mybatis/AppVersionInfoMapper.xml

@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
+<mapper namespace="com.keao.edu.user.dao.AppVersionInfoDao">
+
+	<resultMap type="com.keao.edu.user.entity.AppVersionInfo" id="AppVersionInfo">
+		<result column="id_" property="id" />
+		<result column="platform_" property="platform" />
+		<result column="version_" property="version" />
+		<result column="status_" property="status" />
+		<result column="is_force_update_" property="isForceUpdate" />
+		<result column="description_" property="description" />
+		<result column="download_url_" property="downloadUrl" />
+		<result column="operator_id_" property="operatorId" />
+		<result column="update_time_" property="updateTime" />
+		<result column="create_time_" property="createTime" />
+	</resultMap>
+
+	<!-- 根据主键查询一条记录 -->
+	<select id="get" resultMap="AppVersionInfo">
+		SELECT * FROM
+		app_version_info WHERE id_ = #{id}
+	</select>
+	
+	<select id="queryNewestByPlatform" resultMap="AppVersionInfo">
+		SELECT * FROM app_version_info WHERE platform_ = #{platform} and status_ = 'newest'
+	</select>
+
+	<!-- 全查询 -->
+	<select id="findAll" resultMap="AppVersionInfo">
+		SELECT * FROM app_version_info
+		<where>
+			<if test="search != null and search != ''">
+				platform_ LIKE CONCAT('%',#{search},'%')
+			</if>
+		</where>
+		ORDER BY status_ DESC
+	</select>
+
+	<!-- 向数据库增加一条记录 -->
+	<insert id="insert" parameterType="com.keao.edu.user.entity.AppVersionInfo"
+		useGeneratedKeys="true" keyColumn="id" keyProperty="id">
+		<!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval 
+			AS ID FROM DUAL </selectKey> -->
+		INSERT INTO app_version_info
+		(id_,platform_,version_,status_,is_force_update_,description_,download_url_,operator_id_,update_time_,create_time_)
+		VALUES(#{id},#{platform},#{version},#{status},#{isForceUpdate},#{description},#{downloadUrl},#{operatorId},NOW(),NOW())
+	</insert>
+
+	<!-- 根据主键查询一条记录 -->
+	<update id="update" parameterType="com.keao.edu.user.entity.AppVersionInfo">
+		UPDATE app_version_info
+		<set>
+			<if test="operatorId != null">
+				operator_id_ = #{operatorId},
+			</if>
+			<if test="status != null">
+				status_ = #{status},
+			</if>
+			<if test="downloadUrl != null">
+				download_url_ = #{downloadUrl},
+			</if>
+			<if test="platform != null">
+				platform_ = #{platform},
+			</if>
+			<if test="updateTime != null">
+				update_time_ = #{updateTime},
+			</if>
+			<if test="version != null">
+				version_ = #{version},
+			</if>
+			<if test="description != null">
+				description_ = #{description},
+			</if>
+			<if test="isForceUpdate != null">
+				is_force_update_ = #{isForceUpdate},
+			</if>
+		</set>
+		WHERE id_ = #{id}
+	</update>
+	<update id="batchUpdateStatus">
+		UPDATE app_version_info SET status_ = 'history',update_time_ = NOW() WHERE platform_ = #{platform} AND status_ = 'newest'
+	</update>
+
+	<!-- 根据主键删除一条记录 -->
+	<delete id="delete">
+		DELETE FROM app_version_info WHERE id_ = #{id}
+	</delete>
+
+	<!-- 分页查询 -->
+	<select id="queryPage" resultMap="AppVersionInfo" parameterType="map">
+		SELECT * FROM app_version_info
+		<where>
+			<if test="search != null and search != ''">
+				platform_ LIKE CONCAT('%',#{search},'%')
+			</if>
+		</where>
+		ORDER BY status_ DESC
+		<include refid="global.limit" />
+	</select>
+
+	<!-- 查询当前表的总记录数 -->
+	<select id="queryCount" resultType="int">
+		SELECT COUNT(*) FROM app_version_info
+		<where>
+			<if test="search != null and search != ''">
+				platform_ LIKE CONCAT('%',#{search},'%')
+			</if>
+		</where>
+	</select>
+</mapper>

+ 6 - 4
edu-user/edu-user-server/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml

@@ -207,16 +207,18 @@
 		<result property="examRoomId" column="exam_room_id_"/>
 		<result property="signInTime" column="sign_in_time_"/>
 		<result property="examRoomStudentRelationId" column="exam_room_student_relation_id_"/>
+		<result property="finishedExam" column="is_finished_exam_"/>
 	</resultMap>
 	<select id="queryStudentList" resultMap="RoomStudentListDtoMap">
 		SELECT ersr.id_ exam_room_student_relation_id_,ersr.exam_registration_id_,su.real_name_,ersr.sign_in_time_,
-		s.name_ subject_name_,ec.level_,ersr.exam_room_id_,ersr.student_id_ FROM exam_room_student_relation ersr
+		s.name_ subject_name_,ec.level_,ersr.exam_room_id_,ersr.student_id_,ser.is_finished_exam_
+		FROM exam_room_student_relation ersr
 		LEFT JOIN exam_certification ec ON ec.exam_registration_id_ = ersr.exam_registration_id_
 		LEFT JOIN `subject` s ON s.id_ = ec.subject_id_
 		LEFT JOIN sys_user su ON ersr.student_id_ = su.id_
 		LEFT JOIN student_exam_result ser ON ser.exam_registration_id_ = ersr.exam_registration_id_
-		WHERE ersr.exam_room_id_ = #{roomId} AND ser.is_finished_exam_ = 0
-		ORDER BY ersr.sign_in_time_ IS NULL,ersr.sign_in_time_ ASC
+		WHERE ersr.exam_room_id_ = #{roomId}
+		ORDER BY ersr.sign_in_time_ IS NULL,ersr.sign_in_time_ ASC,ser.is_finished_exam_
 	</select>
     <select id="querySignTotalNum" resultType="java.lang.Integer">
 		SELECT COUNT(ersr.id_) FROM exam_room_student_relation ersr
@@ -236,7 +238,7 @@
 		FROM exam_room_student_relation ersr
 		LEFT JOIN student_exam_result ser ON ser.exam_registration_id_ = ersr.exam_registration_id_
 		WHERE ersr.exam_registration_id_ = #{examRegistrationId} AND ersr.sign_in_time_ IS NOT NULL
-		AND ser.is_finished_exam_ = 0 AND ersr.student_id_ != #{studentId}
+		AND ser.is_finished_exam_ IN (0,1,2) AND ersr.student_id_ != #{studentId}
 		<if test="signInTime != null and signInTime != ''">
 			AND ersr.sign_in_time_ &lt; #{signInTime}
 		</if>

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

@@ -101,14 +101,18 @@
 		</set> WHERE id_ = #{id}
 	</update>
     <update id="endExam">
-		UPDATE student_exam_result SET is_finished_exam_ = 1 AND update_time_ = NOW() WHERE exam_registration_id_ = #{examRegistrationId}
+		UPDATE student_exam_result SET is_finished_exam_ = 4 AND update_time_ = NOW() WHERE exam_registration_id_ = #{examRegistrationId}
 	</update>
     <update id="confirmStudent">
 		UPDATE student_exam_result SET confirm_status_ = 1 AND update_time_ = NOW()
 		WHERE exam_registration_id_ = #{examRegistrationId}
 	</update>
+	<update id="updateFinishedExam">
+		UPDATE student_exam_result SET is_finished_exam_ = #{finishedExam} AND update_time_ = NOW()
+		WHERE exam_registration_id_ = #{examRegistrationId}
+	</update>
 
-    <!-- 根据主键删除一条记录 -->
+	<!-- 根据主键删除一条记录 -->
 	<delete id="delete" >
 		DELETE FROM student_exam_result WHERE id_ = #{id} 
 	</delete>