|
@@ -9,11 +9,14 @@ import com.keao.edu.common.exception.BizException;
|
|
|
import com.keao.edu.common.page.PageInfo;
|
|
|
import com.keao.edu.common.service.SysMessageService;
|
|
|
import com.keao.edu.common.service.impl.BaseServiceImpl;
|
|
|
+import com.keao.edu.im.api.client.ImFeignService;
|
|
|
+import com.keao.edu.im.api.entity.MemberChangedMessage;
|
|
|
+import com.keao.edu.im.api.entity.PublishMessageDto;
|
|
|
import com.keao.edu.thirdparty.message.provider.JiguangPushPlugin;
|
|
|
+import com.keao.edu.user.api.entity.ExamRoom;
|
|
|
import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
|
|
|
import com.keao.edu.user.api.entity.Student;
|
|
|
import com.keao.edu.user.api.enums.StudentExamResultApiDto;
|
|
|
-import com.keao.edu.user.dao.ExamRoomStudentRelationDao;
|
|
|
import com.keao.edu.user.dao.ExaminationBasicDao;
|
|
|
import com.keao.edu.user.dao.StudentExamResultDao;
|
|
|
import com.keao.edu.user.dto.ExaminationBasicDto;
|
|
@@ -27,6 +30,8 @@ import com.keao.edu.user.entity.Subject;
|
|
|
import com.keao.edu.user.enums.ExamStatusEnum;
|
|
|
import com.keao.edu.user.enums.LevelEnum;
|
|
|
import com.keao.edu.user.page.StudentExamResultQueryInfo;
|
|
|
+import com.keao.edu.user.service.ExamRoomService;
|
|
|
+import com.keao.edu.user.service.ExamRoomStudentRelationService;
|
|
|
import com.keao.edu.user.service.OrganizationService;
|
|
|
import com.keao.edu.user.service.StudentExamResultService;
|
|
|
import com.keao.edu.util.collection.MapUtil;
|
|
@@ -48,13 +53,17 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
|
|
|
@Autowired
|
|
|
private StudentExamResultDao studentExamResultDao;
|
|
|
@Autowired
|
|
|
- private ExamRoomStudentRelationDao examRoomStudentRelationDao;
|
|
|
+ private ExamRoomStudentRelationService examRoomStudentRelationService;
|
|
|
@Autowired
|
|
|
private OrganizationService organizationService;
|
|
|
@Autowired
|
|
|
private SysMessageService sysMessageService;
|
|
|
@Autowired
|
|
|
private SysUserFeignService sysUserFeignService;
|
|
|
+ @Autowired
|
|
|
+ private ImFeignService imFeignService;
|
|
|
+ @Autowired
|
|
|
+ private ExamRoomService examRoomService;
|
|
|
|
|
|
private final static Logger logger = LoggerFactory.getLogger(StudentExamResultServiceImpl.class);
|
|
|
|
|
@@ -171,7 +180,7 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
|
|
|
@Override
|
|
|
public StudentExamResultApiDto getStudentExamResultApiDto(Long id) {
|
|
|
StudentExamResultApiDto resultApiDto = studentExamResultDao.getStudentExamResultApiDto(id);
|
|
|
- ExamRoomStudentRelation studentExamRoom = examRoomStudentRelationDao.getStudentExamRoom(id);
|
|
|
+ ExamRoomStudentRelation studentExamRoom = examRoomStudentRelationService.getStudentExamRoom(id);
|
|
|
resultApiDto.setRoomId(studentExamRoom.getExamRoomId().toString());
|
|
|
return resultApiDto;
|
|
|
}
|
|
@@ -212,21 +221,43 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
|
|
|
studentExamResultDao.updateSessionId(examRegistrationId,sessionId);
|
|
|
}
|
|
|
|
|
|
- /*@Override
|
|
|
- public void shieldUserId(Long roomId) {
|
|
|
- List<RoomStudentListDto> roomStudentListDtos = examRoomStudentRelationDao.queryStudentList(roomId);
|
|
|
- if(roomStudentListDtos != null && roomStudentListDtos.size() > 0){
|
|
|
- RoomStudentListDto roomStudentListDto = roomStudentListDtos.get(0);
|
|
|
- SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
- String shieldUserId = roomStudentListDto.getShieldUserId();
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public void shieldUserId(Long roomId,Integer shieldFlag) {
|
|
|
+ ExamRoom examRoom = examRoomService.get(roomId);
|
|
|
+ SysUser sysUser = sysUserFeignService.queryUserInfo();
|
|
|
+ String userToString = sysUser.getId().toString();
|
|
|
+ String shieldUserId = examRoom.getShieldUserId();
|
|
|
+ //取消屏蔽
|
|
|
+ if(shieldFlag == 0){
|
|
|
+ if(StringUtils.isNotEmpty(shieldUserId)){
|
|
|
+ if(shieldUserId.contains("," + userToString)){
|
|
|
+ shieldUserId = shieldUserId.replace("," + userToString,"");
|
|
|
+ }else if(shieldUserId.contains(userToString + ",")){
|
|
|
+ shieldUserId = shieldUserId.replace(userToString + ",","");
|
|
|
+ }else {
|
|
|
+ shieldUserId = "";
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ shieldUserId = "";
|
|
|
+ }
|
|
|
+ }else {
|
|
|
if(StringUtils.isNotEmpty(shieldUserId)){
|
|
|
- if(!shieldUserId.contains(sysUser.getId().toString())) {
|
|
|
- shieldUserId += "," + sysUser.getId();
|
|
|
+ if(!shieldUserId.contains(userToString)) {
|
|
|
+ shieldUserId += "," + userToString;
|
|
|
}
|
|
|
}else {
|
|
|
- shieldUserId = sysUser.getId().toString();
|
|
|
+ shieldUserId = userToString;
|
|
|
}
|
|
|
- examRoomStudentRelationDao.updateShield();
|
|
|
}
|
|
|
- }*/
|
|
|
+ examRoom.setShieldUserId(shieldUserId);
|
|
|
+ examRoomService.update(examRoom);
|
|
|
+ PublishMessageDto publishMessageDto = new PublishMessageDto();
|
|
|
+ publishMessageDto.setUserId(userToString);
|
|
|
+ publishMessageDto.setRoomId(roomId.toString());
|
|
|
+ MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Shield_UserId, userToString,3);
|
|
|
+ msg.setShieldUserId(shieldUserId);
|
|
|
+ publishMessageDto.setMemberChangedMessage(msg);
|
|
|
+ imFeignService.publishMessage(publishMessageDto);
|
|
|
+ }
|
|
|
}
|