Browse Source

Merge remote-tracking branch 'origin/master'

周箭河 5 years ago
parent
commit
5ea36df8b7
42 changed files with 391 additions and 239 deletions
  1. 2 2
      edu-auth/edu-auth-server/src/main/java/com/keao/edu/auth/web/controller/SysMessageController.java
  2. 2 2
      edu-auth/edu-auth-server/src/main/resources/config/mybatis/SysUserMapper.xml
  3. 7 7
      edu-im/edu-im-api/src/main/java/com/keao/edu/im/api/entity/MemberChangedMessage.java
  4. 2 1
      edu-im/edu-im-server/src/main/java/com/keao/edu/im/mec/im/IMHelper.java
  5. 3 113
      edu-im/edu-im-server/src/main/java/com/keao/edu/im/service/Impl/RoomServiceImpl.java
  6. 12 0
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/ExamCertificationDao.java
  7. 6 6
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/ExamManualLedgerDao.java
  8. 2 1
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/ExamRegistrationDao.java
  9. 6 6
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/ExamRegistrationPaymentDao.java
  10. 4 2
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/ExamRoomDao.java
  11. 2 1
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/StudentExamResultDao.java
  12. 9 0
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/SubjectDao.java
  13. 63 0
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dto/BasicNeedCheckingDetailDto.java
  14. 21 0
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dto/StudentExamResultDto.java
  15. 12 0
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/page/StudentExamResultQueryInfo.java
  16. 8 0
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/ExamCertificationService.java
  17. 1 2
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/ExaminationBasicService.java
  18. 2 1
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/StudentExamResultService.java
  19. 9 0
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/SubjectService.java
  20. 7 1
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamCertificationServiceImpl.java
  21. 4 0
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamOrganizationRelationServiceImpl.java
  22. 8 6
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java
  23. 49 36
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java
  24. 36 13
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExaminationBasicServiceImpl.java
  25. 7 3
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/StudentExamResultServiceImpl.java
  26. 5 0
      edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/SubjectServiceImpl.java
  27. 18 0
      edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamCertificationMapper.xml
  28. 3 3
      edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamManualLedgerMapper.xml
  29. 6 0
      edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamRegistrationMapper.xml
  30. 12 3
      edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamRegistrationPaymentMapper.xml
  31. 5 3
      edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamReviewMapper.xml
  32. 17 3
      edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamRoomMapper.xml
  33. 1 1
      edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml
  34. 5 3
      edu-user/edu-user-biz/src/main/resources/config/mybatis/ExaminationBasicMapper.xml
  35. 1 1
      edu-user/edu-user-biz/src/main/resources/config/mybatis/OrganizationMapper.xml
  36. 13 3
      edu-user/edu-user-biz/src/main/resources/config/mybatis/StudentExamResultMapper.xml
  37. 6 0
      edu-user/edu-user-biz/src/main/resources/config/mybatis/SubjectMapper.xml
  38. 3 3
      edu-user/edu-user-biz/src/main/resources/config/mybatis/SysConfigMapper.xml
  39. 1 2
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExaminationBasicController.java
  40. 2 10
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/OrganizationController.java
  41. 2 1
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/StudentExamResultController.java
  42. 7 0
      edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/SubjectController.java

+ 2 - 2
edu-auth/edu-auth-server/src/main/java/com/keao/edu/auth/web/controller/SysMessageController.java

@@ -87,9 +87,9 @@ public class SysMessageController extends BaseController {
         if (sysUser == null) {
             return failed(HttpStatus.FORBIDDEN, "请登录");
         }
-        if(!sysUser.getIsSuperAdmin()){
+//        if(!sysUser.getIsSuperAdmin()){
             queryInfo.setUserId(sysUser.getId());
-        }
+//        }
         queryInfo.setType(MessageSendMode.PUSH.getCode());
         PageInfo<SysMessage> pageInfo = sysMessageService.queryPage(queryInfo);
         return succeed(pageInfo);

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

@@ -158,11 +158,11 @@
     </select>
 
     <select id="queryByUsername" resultMap="SysUser">
-		select * from sys_user where real_name_ = #{username} OR phone_ = #{username} LIMIT 1 FOR UPDATE
+		select * from sys_user where phone_ = #{username} LIMIT 1 FOR UPDATE
 	</select>
 
     <select id="queryByPhone" resultMap="SysUser">
-		select * from sys_user where phone_ = #{phone} OR real_name_ = #{phone} LIMIT 1 FOR UPDATE
+		select * from sys_user where phone_ = #{phone} LIMIT 1 FOR UPDATE
 	</select>
     
     <select id="queryByStatus" resultMap="SysUser">

+ 7 - 7
edu-im/edu-im-api/src/main/java/com/keao/edu/im/api/entity/MemberChangedMessage.java

@@ -16,7 +16,7 @@ public class MemberChangedMessage extends BaseMessage{
     private String userId;
     private String userName;
     private String roomId;
-//    private String appParamJson;
+    private Object appParamJson;
     private Integer waitNum;
     private Integer openFlag;
     private String shieldUserId;
@@ -64,13 +64,13 @@ public class MemberChangedMessage extends BaseMessage{
         this.waitNum = waitNum;
     }
 
-//    public String getAppParamJson() {
-//        return appParamJson;
-//    }
+    public Object getAppParamJson() {
+        return appParamJson;
+    }
 
-//    public void setAppParamJson(String appParamJson) {
-//        this.appParamJson = appParamJson;
-//    }
+    public void setAppParamJson(Object appParamJson) {
+        this.appParamJson = appParamJson;
+    }
 
     public String getWebParamJson() {
         return webParamJson;

+ 2 - 1
edu-im/edu-im-server/src/main/java/com/keao/edu/im/mec/im/IMHelper.java

@@ -16,7 +16,6 @@ import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Component;
 
-import javax.validation.constraints.Size;
 import java.net.HttpURLConnection;
 import java.net.URLEncoder;
 import java.util.List;
@@ -308,6 +307,8 @@ public class IMHelper {
         IMApiResultInfo resultInfo = JSON.parseObject(httpHelper.returnResult(conn, body), IMApiResultInfo.class);
         if(resultInfo.getResultCode() == 10000){
             redisTemplate.opsForValue().set(resultInfo.getRecordId(),registrationId.toString());
+        }else {
+            log.error("直播视频录制失败:body : {},resultInfo : {}",body,resultInfo);
         }
         return resultInfo;
     }

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

@@ -211,10 +211,6 @@ public class RoomServiceImpl implements RoomService {
         StudentExamResultApiDto examResult = null;
         if(registrationId != null){
             examResult = eduUserFeignService.getExamResult(registrationId);
-            /*Integer recordFlag = examResult.getRecordFlag();
-            if(recordFlag != null && recordFlag == 1){
-                joinRecorded(registrationId);
-            }*/
             roomId = examResult.getRoomId();
         }
 
@@ -233,22 +229,11 @@ public class RoomServiceImpl implements RoomService {
                 isAssistant = true;
             }
         }
-//        String display = "";
         Date curTime = DateTimeUtils.currentUTC();
         List<Room> roomList = roomDao.findByRid(roomId);
         if (roomList.isEmpty()) {
             saveRoom(roomId, roomId, curTime, null);
-            /*IMApiResultInfo resultInfo = imHelper.createGroup(new String[]{userId}, roomId, roomId);
-            if (!resultInfo.isSuccess()) {
-                log.error("joinRoom IM error: roomId={}, {}", roomId, resultInfo.getErrorMessage());
-                throw new ApiException(ErrorEnum.ERR_CREATE_ROOM_ERROR, resultInfo.getErrorMessage());
-            }
-            else {
-                scheduleManager.addExpiredTask(this, roomId);
-            }*/
-        }/* else {
-            display = roomList.get(0).getDisplay();
-        }*/
+        }
         RoleEnum roleEnum;
         RoomResult roomResult = new RoomResult();
         BaseResponse baseResponse = new BaseResponse(roomResult);
@@ -275,10 +260,7 @@ public class RoomServiceImpl implements RoomService {
                 roleEnum = Student;
             }
             saveRoomMember(userId,sysUser.getAvatar(), realName, roomId, roleEnum.getValue(), !isDisableCamera,!isMusicMode, curTime,registrationId);
-            /*IMApiResultInfo resultInfo = imHelper.joinGroup(new String[]{userId}, roomId, roomId);
-            if (!resultInfo.isSuccess()) {
-                throw new ApiException(ErrorEnum.ERR_CREATE_ROOM_ERROR, resultInfo.getErrorMessage());
-            }*/
+
             userResult.setMicrophone(true);
             userResult.setCamera(!isDisableCamera);
             userResult.setHandUp(false);
@@ -299,7 +281,6 @@ public class RoomServiceImpl implements RoomService {
                     return getBaseResponse(baseResponse);
                 }
             }
-//            roomMemberDao.updateCameraByRidAndUid(roomId, userId, !isDisableCamera);
             userResult.setCamera(roomMember.isCamera());
             userResult.setHandUp(roomMember.isHand());
             userResult.setJoinTime(roomMember.getJoinDt());
@@ -311,15 +292,6 @@ public class RoomServiceImpl implements RoomService {
         msg.setUserName(realName);
         msg.setCamera(!isDisableCamera);
         imHelper.publishMessage(userId, roomId, msg);
-        /*if (roleEnum == RoleEnum.MainTeacher) {
-            display = "display://type=0?userId=" + userId + "?uri=";
-            updateDisplay(roomId, userId, display, 0);
-            log.info("joinRoom, display changed: roomId={}, {}, userId={}", roomId, display, userId);
-        } else if (roleEnum == RoleEnum.AssistantTeacher && display.isEmpty()) {
-            display = "display://type=1?userId=" + userId + "?uri=";
-            updateDisplay(roomId, userId, display, 0);
-            log.info("joinRoom, display changed: roomId={}, {}, userId={}", roomId, display, userId);
-        }*/
 
         List<UserInfo> userInfoList = userDao.findByUid(userId);
         if (userInfoList.isEmpty()) {
@@ -339,7 +311,6 @@ public class RoomServiceImpl implements RoomService {
         userResult.setUserId(userId);
         userResult.setRole(roleEnum.getValue());
         roomResult.setUserInfo(userResult);
-//        roomResult.setDisplay(display);
         roomResult.setRoomId(roomId);
         if (registrationId != null){
             roomResult.setRegistrationId(registrationId);
@@ -347,8 +318,6 @@ public class RoomServiceImpl implements RoomService {
         roomResult.setExamFlag(examRoom.getExamFlag());
         List<RoomMember> roomMembers = roomMemberDao.findByRid(roomId);
         roomResult.setMembers(roomMembers,examRoom.getShieldUserId());
-//        List<Whiteboard> whiteboardList = whiteboardDao.findByRid(roomId);
-//        roomResult.setWhiteboards(whiteboardList);
         log.info("join success: roomId = {}, userId = {}, userName={}, role = {}", roomId, userId, roleEnum);
         if(registrationId != null){
             if(examResult.getIsFinishedExam() == 1){
@@ -357,10 +326,9 @@ public class RoomServiceImpl implements RoomService {
             this.publishMessage(eduUserFeignService.getPublishMessage(registrationId));
             eduUserFeignService.upsetStudentAttendance(registrationId,0);
             imHelper.startRecord(userId,roomId, registrationId,roomMembers);
-//            eduUserFeignService.updateSessionId(registrationId,imApiResultInfo.getSessionId());
+            //踢出其他学员
         }else {
             eduUserFeignService.upsetTeacherAttendance(examRoom.getId(),sysUser.getId(),0);
-//            imHelper.configRecord(roomId, registrationId,roomMembers);
         }
         return baseResponse;
     }
@@ -371,7 +339,6 @@ public class RoomServiceImpl implements RoomService {
         room.setName(roomName);
         room.setCreateDt(createTime);
         room.setDisplay(display);
-//        room.setWhiteboardNameIndex(0);
         try {
             roomDao.save(room);
         }catch (Exception e){
@@ -398,10 +365,6 @@ public class RoomServiceImpl implements RoomService {
     public Boolean leaveRoom(Long registrationId,String roomId,String userId) throws Exception {
         if(registrationId != null){
             StudentExamResultApiDto examResult = eduUserFeignService.getExamResult(registrationId);
-            /*Integer recordFlag = examResult.getRecordFlag();
-            if(recordFlag != null && recordFlag == 1){
-                levelRecorded(registrationId);
-            }*/
             roomId = examResult.getRoomId();
         }
         SysUser user;
@@ -411,12 +374,6 @@ public class RoomServiceImpl implements RoomService {
         }else {
             user = sysUserFeignService.queryUserById(Integer.parseInt(userId));
         }
-        /*if(StringUtils.isEmpty(userId)){
-            user = sysUserFeignService.queryUserInfo();
-            userId = user.getId().toString();
-        }else {
-            user = sysUserFeignService.queryUserById(Integer.parseInt(userId));
-        }*/
         log.info("leaveRoom: roomId={}, userId={}", roomId,userId);
 
         CheckUtils.checkArgument(userId != null, "userId must't be null");
@@ -425,50 +382,19 @@ public class RoomServiceImpl implements RoomService {
         if (roomList.size() == 0) {
             log.error("room : {} not exist ", roomId);
             return false;
-//            throw new ApiException(ErrorEnum.ERR_ROOM_NOT_EXIST);
         }
         RoomMember roomMember = roomMemberDao.findByRidAndUid(roomId, userId);
         if (roomMember == null) {
             log.error("{} not exist in room: {}", userId, roomId);
             return false;
-//            throw new ApiException(ErrorEnum.ERR_USER_NOT_EXIST_IN_ROOM);
         }
 
         int userRole = roomMember.getRole();
         log.info("leaveRoom: roomId={}, role={}", roomId, RoleEnum.getEnumByValue(userRole));
 
-        /*if (userRole == RoleEnum.MainTeacher.getValue() || userRole == RoleEnum.AssistantTeacher.getValue()) {
-            if (isUserDisplay(roomList.get(0), userId)) {
-                updateDisplay(roomId, userId, "", 0);
-                log.info("clear display cause speaker leave: roomId={}", roomId);
-            } else {
-                log.info("don't update current display: room={}, role={}", roomList.get(0), RoleEnum.getEnumByValue(userRole));
-            }
-        } else {
-            log.info("don't update current display: room={}, userRole={}", roomList.get(0), RoleEnum.getEnumByValue(userRole));
-        }*/
-
         if (roomMemberDao.countByRid(roomId) == 1) {
             roomMemberDao.deleteUserByRidAndUid(roomId, userId);
             roomDao.deleteByRid(roomId);
-            /*IMApiResultInfo apiResultInfo = null;
-            try {
-                roomMemberDao.deleteUserByRidAndUid(roomId, userId);
-                roomDao.deleteByRid(roomId);
-                apiResultInfo = imHelper.dismiss(userId, roomId);
-                if (apiResultInfo.getCode() == 200) {
-                    roomMemberDao.deleteUserByRidAndUid(roomId, userId);
-                    roomDao.deleteByRid(roomId);
-//                    deleteWhiteboardByUser(roomId, userId);
-                    log.info("dismiss the room: {},userId: {}", roomId,userId);
-                } else {
-                    log.error("{} exit {} room error: {}", userId, roomId, apiResultInfo.getErrorMessage());
-                    throw new ApiException(ErrorEnum.ERR_EXIT_ROOM_ERROR, apiResultInfo.getErrorMessage());
-                }
-            } catch (Exception e) {
-                log.error("{} exit {} room error: {}", userId, roomId, e.getMessage());
-                throw new ApiException(ErrorEnum.ERR_EXIT_ROOM_ERROR, e.getMessage());
-            }*/
         } else {
             roomMemberDao.deleteUserByRidAndUid(roomId, userId);
             MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Action_Leave, userId, userRole);
@@ -477,8 +403,6 @@ public class RoomServiceImpl implements RoomService {
             log.info("quit group: roomId={},userId: {}", roomId,userId);
         }
         userDao.deleteByUid(userId);
-//        this.signOut(Long.parseLong(roomId));
-//        this.publishMessage(eduUserFeignService.getPublishMessage(registrationId));
         if(registrationId != null){
             eduUserFeignService.upsetStudentAttendance(registrationId,1);
             imHelper.stopRecord(userId,roomId);
@@ -516,42 +440,8 @@ public class RoomServiceImpl implements RoomService {
         if (roomMemberDao.countByRid(roomId) == 1) {
             roomMemberDao.deleteUserByRidAndUid(roomId, userId);
             roomDao.deleteByRid(roomId);
-
-            /*IMApiResultInfo apiResultInfo = null;
-            try {
-                apiResultInfo = imHelper.dismiss(userId, roomId);
-                if (apiResultInfo.getCode() == 200) {
-                    roomMemberDao.deleteUserByRidAndUid(roomId, userId);
-                    roomDao.deleteByRid(roomId);
-                    log.info("levelRecorded dismiss the room: {},userId: {}", roomId,userId);
-                } else {
-                    log.error("levelRecorded {} exit {} room error: {}", userId, roomId, apiResultInfo.getErrorMessage());
-                    throw new ApiException(ErrorEnum.ERR_EXIT_ROOM_ERROR, apiResultInfo.getErrorMessage());
-                }
-            } catch (Exception e) {
-                log.error("levelRecorded {} exit {} room error: {}", userId, roomId, e.getMessage());
-                throw new ApiException(ErrorEnum.ERR_EXIT_ROOM_ERROR, e.getMessage());
-            }*/
         } else {
             roomMemberDao.deleteUserByRidAndUid(roomId, userId);
-
-            /*IMApiResultInfo apiResultInfo = null;
-            try {
-                apiResultInfo = imHelper.quit(new String[]{userId}, roomId);
-                if (apiResultInfo.isSuccess()) {
-                    roomMemberDao.deleteUserByRidAndUid(roomId, userId);
-                    MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Action_Leave, userId, userRole);
-                    msg.setUserName(user.getUsername());
-                    imHelper.publishMessage(userId, roomId, msg);
-                    imHelper.quit(new String[]{userId}, roomId);
-                    log.info("levelRecorded quit group: roomId={},userId: {}", roomId,userId);
-                } else {
-                    throw new ApiException(ErrorEnum.ERR_EXIT_ROOM_ERROR, apiResultInfo.getErrorMessage());
-                }
-            } catch (Exception e) {
-                log.error("levelRecorded leave room error: roomId={}, {}", roomId, e.getMessage());
-                throw new ApiException(ErrorEnum.ERR_EXIT_ROOM_ERROR);
-            }*/
         }
         userDao.deleteByUid(userId);
         if(registrationId != null){

+ 12 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/ExamCertificationDao.java

@@ -1,6 +1,7 @@
 package com.keao.edu.user.dao;
 
 import com.keao.edu.common.dal.BaseDAO;
+import com.keao.edu.user.dto.BasicNeedCheckingDetailDto;
 import com.keao.edu.user.dto.ExamCertificationDto;
 import com.keao.edu.user.dto.NeedCheckingDetailDto;
 import com.keao.edu.user.entity.ExamCertification;
@@ -51,4 +52,15 @@ public interface ExamCertificationDao extends BaseDAO<Long, ExamCertification> {
      * @return
      */
     ExamCertificationDto getExamCertificationDto(@Param("examRegistrationId") Long examRegistrationId);
+
+    /**
+     * @describe 获取学员等待详情列表
+     * @apiNote 时光荏苒,认真工作的时间总是过得很快,而我、享受这一刻!
+     * @author zouxuan
+     * @date 2020/8/14
+     * @time 11:42
+     * @param examRoomId:
+     * @return java.util.List<com.keao.edu.user.dto.BasicNeedCheckingDetailDto>
+     */
+    List<BasicNeedCheckingDetailDto> basicNeedCheckingDetail(Long examRoomId);
 }

+ 6 - 6
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/ExamManualLedgerDao.java

@@ -55,23 +55,23 @@ public interface ExamManualLedgerDao extends BaseDAO<Long, ExamManualLedger> {
 
     /**
      * 获取每天支出
-     * @param tenantId
+     * @param organId
      * @param days
      * @return
      */
-    List<Map<String, BigDecimal>> getDayPayment(@Param("tenantId") String tenantId, @Param("days") List<String> days);
+    List<Map<String, BigDecimal>> getDayPayment(@Param("organId") Integer organId, @Param("days") List<String> days);
 
     /**
      * 获取当年支出
-     * @param tenantId
+     * @param organId
      * @return
      */
-    BigDecimal getAnnualPayment(String tenantId);
+    BigDecimal getAnnualPayment(Integer organId);
 
     /**
      * 获取当月支出
-     * @param tenantId
+     * @param organId
      * @return
      */
-    BigDecimal getMonthPayment(String tenantId);
+    BigDecimal getMonthPayment(Integer organId);
 }

+ 2 - 1
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/ExamRegistrationDao.java

@@ -176,7 +176,8 @@ public interface ExamRegistrationDao extends BaseDAO<Long, ExamRegistration> {
      * @param examId:
      * @return java.util.List<com.keao.edu.user.entity.ExamRegistration>
      */
-    List<ExamRegistration> getNotInRoomStudents(@Param("examId") Long examId);
+    List<ExamRegistration> getNotInRoomStudents(@Param("examId") Long examId,
+                                                @Param("organIds") List<Integer> organIds);
 
     /**
      * @describe 统计合作单位的招生人数

+ 6 - 6
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/ExamRegistrationPaymentDao.java

@@ -92,22 +92,22 @@ public interface ExamRegistrationPaymentDao extends BaseDAO<Long, ExamRegistrati
 
     /**
      * 年收入
-     * @param tenantId
+     * @param childOrganIds
      * @return
      */
-    BigDecimal getAnnualIncome(@Param("tenantId") String tenantId);
+    BigDecimal getAnnualIncome(@Param("childOrganIds") List<Integer> childOrganIds);
 
     /**
      * 月收入
-     * @param tenantId
+     * @param childOrganIds
      * @return
      */
-    BigDecimal getMonthIncome(@Param("tenantId") String tenantId);
+    BigDecimal getMonthIncome(@Param("childOrganIds") List<Integer> childOrganIds);
 
     /**
      * 日收入
-     * @param tenantId
+     * @param childOrganIds
      * @return
      */
-    List<Map<String, BigDecimal>> getDayIncome(@Param("tenantId") String tenantId, @Param("days") List<String> days);
+    List<Map<String, BigDecimal>> getDayIncome(@Param("childOrganIds") List<Integer> childOrganIds, @Param("days") List<String> days);
 }

+ 4 - 2
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/ExamRoomDao.java

@@ -78,7 +78,8 @@ public interface ExamRoomDao extends BaseDAO<Long, ExamRoom> {
      * @return java.util.List<com.keao.edu.user.api.entity.ExamRoom>
      */
     List<ExamRoom> getWithExamAndSubjects(@Param("examId") Long examId,
-                                          @Param("subjectIds") List<Integer> subjectIds);
+                                          @Param("subjectIds") List<Integer> subjectIds,
+                                          @Param("organIds") List<Integer> organIds);
 
     int updateSL(ExamRoom examRoom);
 
@@ -128,7 +129,8 @@ public interface ExamRoomDao extends BaseDAO<Long, ExamRoom> {
      * @param examId:
      * @return int
      */
-    int countSendExamPlanRooms(@Param("examId") Long examId);
+    int countSendExamPlanRooms(@Param("examId") Long examId,
+                               @Param("organIds") List<Integer> organIds);
 
     /**
      * @describe 统计指定项目中教师所在考场数量

+ 2 - 1
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/StudentExamResultDao.java

@@ -2,6 +2,7 @@ package com.keao.edu.user.dao;
 
 import com.keao.edu.common.dal.BaseDAO;
 import com.keao.edu.user.api.enums.StudentExamResultApiDto;
+import com.keao.edu.user.dto.StudentExamResultDto;
 import com.keao.edu.user.dto.StudentExamResultStatisticsDto;
 import com.keao.edu.user.entity.StudentExamResult;
 import org.apache.ibatis.annotations.Param;
@@ -32,7 +33,7 @@ public interface StudentExamResultDao extends BaseDAO<Long, StudentExamResult> {
      * @param params:
      * @return java.util.List<com.keao.edu.user.entity.StudentExamResult>
      */
-    List<StudentExamResult> queryStudentExamResult(Map<String, Object> params);
+    List<StudentExamResultDto> queryStudentExamResult(Map<String, Object> params);
 
     int countStudentExamResult(Map<String, Object> params);
 

+ 9 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dao/SubjectDao.java

@@ -41,6 +41,15 @@ public interface SubjectDao extends BaseDAO<Integer, Subject> {
      */
     List<Subject> findSubSubjects();
 
+    /**
+     * @describe 获取考级项目学员报考声部列表
+     * @author Joburgess
+     * @date 2020.08.17
+     * @param examId:
+     * @return java.util.List<com.keao.edu.user.entity.Subject>
+     */
+    List<Subject> findExamRegistSubjects(@Param("examId") Long examId);
+
     List<Subject> findBySubjectByIdList(@Param("subjectIdList") String subjectIdList);
 
     List<Subject> findBySubjectIds(@Param("subjectIds") List<Integer> subjectIds);

+ 63 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dto/BasicNeedCheckingDetailDto.java

@@ -0,0 +1,63 @@
+package com.keao.edu.user.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+
+import java.util.Date;
+
+public class BasicNeedCheckingDetailDto {
+
+    @ApiModelProperty(value = "房间入口开启状态")
+    private Integer classroomSwitch;
+
+    @ApiModelProperty(value = "考试是否开始")
+    private Integer openFlag;
+
+    @ApiModelProperty(value = "是否录制")
+    private Integer recordFlag;
+
+    @ApiModelProperty(value = "学员是否考试")
+    private Integer finishedExam;
+
+    @ApiModelProperty(value = "学员编号")
+    private Integer studentId;
+
+    public Integer getClassroomSwitch() {
+        return classroomSwitch;
+    }
+
+    public void setClassroomSwitch(Integer classroomSwitch) {
+        this.classroomSwitch = classroomSwitch;
+    }
+
+    public Integer getOpenFlag() {
+        return openFlag;
+    }
+
+    public void setOpenFlag(Integer openFlag) {
+        this.openFlag = openFlag;
+    }
+
+    public Integer getRecordFlag() {
+        return recordFlag;
+    }
+
+    public void setRecordFlag(Integer recordFlag) {
+        this.recordFlag = recordFlag;
+    }
+
+    public Integer getFinishedExam() {
+        return finishedExam;
+    }
+
+    public void setFinishedExam(Integer finishedExam) {
+        this.finishedExam = finishedExam;
+    }
+
+    public Integer getStudentId() {
+        return studentId;
+    }
+
+    public void setStudentId(Integer studentId) {
+        this.studentId = studentId;
+    }
+}

+ 21 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/dto/StudentExamResultDto.java

@@ -0,0 +1,21 @@
+package com.keao.edu.user.dto;
+
+import com.keao.edu.user.api.enums.ExamModeEnum;
+import com.keao.edu.user.entity.StudentExamResult;
+
+/**
+ * @Author Joburgess
+ * @Date 2020.08.14
+ */
+public class StudentExamResultDto extends StudentExamResult {
+
+    private ExamModeEnum examMode;
+
+    public ExamModeEnum getExamMode() {
+        return examMode;
+    }
+
+    public void setExamMode(ExamModeEnum examMode) {
+        this.examMode = examMode;
+    }
+}

+ 12 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/page/StudentExamResultQueryInfo.java

@@ -2,6 +2,7 @@ package com.keao.edu.user.page;
 
 import com.keao.edu.common.page.QueryInfo;
 import com.keao.edu.user.api.enums.ExamEvaluationResultEnum;
+import com.keao.edu.user.api.enums.ExamModeEnum;
 import io.swagger.annotations.ApiModelProperty;
 
 import java.util.Date;
@@ -51,6 +52,9 @@ public class StudentExamResultQueryInfo extends QueryInfo {
     @ApiModelProperty(value = "考级项目状态")
     private Integer resultConfirm;
 
+    @ApiModelProperty(value = "考试模式")
+    private ExamModeEnum examMode;
+
     public Integer getStudentId() {
         return studentId;
     }
@@ -154,4 +158,12 @@ public class StudentExamResultQueryInfo extends QueryInfo {
     public void setResultConfirm(Integer resultConfirm) {
         this.resultConfirm = resultConfirm;
     }
+
+    public ExamModeEnum getExamMode() {
+        return examMode;
+    }
+
+    public void setExamMode(ExamModeEnum examMode) {
+        this.examMode = examMode;
+    }
 }

+ 8 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/ExamCertificationService.java

@@ -3,6 +3,7 @@ package com.keao.edu.user.service;
 
 import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.service.BaseService;
+import com.keao.edu.user.dto.BasicNeedCheckingDetailDto;
 import com.keao.edu.user.dto.ExamCertificationDto;
 import com.keao.edu.user.dto.NeedCheckingDetailDto;
 import com.keao.edu.user.entity.ExamCertification;
@@ -34,6 +35,13 @@ public interface ExamCertificationService extends BaseService<Long, ExamCertific
     NeedCheckingDetailDto needCheckingDetail(Long examRegistrationId);
 
     /**
+     * 学生端待考详情
+     * @param examRoomId
+     * @return
+     */
+    List<BasicNeedCheckingDetailDto> basicNeedCheckingDetail(Long examRoomId);
+
+    /**
      * 获取后台准考证详情
      * @param examRegistrationId
      * @return

+ 1 - 2
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/ExaminationBasicService.java

@@ -97,10 +97,9 @@ public interface ExaminationBasicService extends BaseService<Long, ExaminationBa
      * @describe 获取首页收入支出
      * @author zouxuan
      * @date 15:42
-     * @param tenantId:
      * @param day:
      * @return java.lang.Object
      */
-    Object homeBalanceOfPayment(String tenantId,Integer day);
+    Object homeBalanceOfPayment(Integer day);
 
 }

+ 2 - 1
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/StudentExamResultService.java

@@ -4,6 +4,7 @@ import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.common.service.BaseService;
 import com.keao.edu.user.api.enums.StudentExamResultApiDto;
 import com.keao.edu.user.dto.RecordNotify;
+import com.keao.edu.user.dto.StudentExamResultDto;
 import com.keao.edu.user.dto.StudentExamResultStatisticsDto;
 import com.keao.edu.user.entity.StudentExamResult;
 import com.keao.edu.user.page.StudentExamResultQueryInfo;
@@ -17,7 +18,7 @@ public interface StudentExamResultService extends BaseService<Long, StudentExamR
      * @param queryInfo:
      * @return com.keao.edu.common.page.PageInfo<com.keao.edu.user.entity.StudentExamResult>
      */
-    PageInfo<StudentExamResult> queryStudentExamResult(StudentExamResultQueryInfo queryInfo);
+    PageInfo<StudentExamResultDto> queryStudentExamResult(StudentExamResultQueryInfo queryInfo);
 
     /**
      * @describe 更新考试结果

+ 9 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/SubjectService.java

@@ -31,6 +31,15 @@ public interface SubjectService extends BaseService<Integer, Subject> {
      */
     List<Subject> findSubSubjects();
 
+    /**
+     * @describe 获取考级项目学员报考科目列表
+     * @author Joburgess
+     * @date 2020.08.17
+     * @param examId:
+     * @return java.util.List<com.keao.edu.user.entity.Subject>
+     */
+    List<Subject> findExamRegistSubjects(Long examId);
+
     List<Subject> findBySubjectByIdList(List<Integer> subjectIdList);
 
     List<Subject> findBySubjectByIdList(String subjectIdList);

+ 7 - 1
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamCertificationServiceImpl.java

@@ -4,10 +4,10 @@ package com.keao.edu.user.service.impl;
 import com.keao.edu.auth.api.client.SysUserFeignService;
 import com.keao.edu.auth.api.entity.SysUser;
 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.api.entity.Student;
 import com.keao.edu.user.dao.*;
+import com.keao.edu.user.dto.BasicNeedCheckingDetailDto;
 import com.keao.edu.user.dto.ExamCertificationDto;
 import com.keao.edu.user.dto.NeedCheckingDetailDto;
 import com.keao.edu.user.entity.ExamCertification;
@@ -101,6 +101,12 @@ public class ExamCertificationServiceImpl extends BaseServiceImpl<Long, ExamCert
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public List<BasicNeedCheckingDetailDto> basicNeedCheckingDetail(Long examRoomId) {
+		return examCertificationDao.basicNeedCheckingDetail(examRoomId);
+	}
+
+	@Override
 	public ExamCertificationDto findDetailByStudentId(Long examRegistrationId) {
 		ExamCertificationDto examCertificationDto = examCertificationDao.getExamCertificationDto(examRegistrationId);
 		Subject subject = subjectDao.get(examCertificationDto.getSubjectId());

+ 4 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamOrganizationRelationServiceImpl.java

@@ -297,6 +297,10 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 
 		List<ExamOrganizationRelation> examOrgans = examOrganizationRelationDao.getExamOrganizationRelations(examId.longValue(), null);
 
+		if(CollectionUtils.isEmpty(examOrgans)||examOrgans.size()<=1){
+			throw new BizException("请添加合作单位");
+		}
+
 		ExaminationBasic examinationBasic = examinationBasicDao.get(examId.longValue());
 		if(Objects.isNull(examinationBasic)){
 			throw new BizException("考级项目不存在");

+ 8 - 6
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamRoomServiceImpl.java

@@ -810,6 +810,7 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 		//加群退群
 		if(openFlag == 1){
 			String studentIds = examRoomStudentRelationService.getStudentIds(examRoomId);
+
 			StringBuffer stringBuffer = new StringBuffer();
 			stringBuffer.append(examRoom.getMainTeacherUserId());
 			if(StringUtils.isNotEmpty(studentIds)){
@@ -823,12 +824,13 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
 			publishMessageDto.setUserId(sysUser.getId().toString());
 			publishMessageDto.setRoomId(examRoomId.toString());
 			MemberChangedMessage msg = new MemberChangedMessage(5, sysUser.getId().toString(),3);
-			msg.setWaitNum(0);
-			msg.setClassroomSwitch(0);
-			msg.setOpenFlag(openFlag);
-			Map<String,Object> paramMap = new HashMap<>(1);
-			paramMap.put("studentQueue",examRoomStudentRelationService.queryNeedCheckingList(examRoomId));
-			msg.setWebParamJson(JSONObject.toJSONString(paramMap));
+			msg.setAppParamJson(examCertificationService.basicNeedCheckingDetail(examRoomId));
+//			msg.setWaitNum(0);
+//			msg.setClassroomSwitch(0);
+//			msg.setOpenFlag(openFlag);
+//			Map<String,Object> paramMap = new HashMap<>(1);
+//			paramMap.put("studentQueue",examRoomStudentRelationService.queryNeedCheckingList(examRoomId));
+//			msg.setWebParamJson(JSONObject.toJSONString(paramMap));
 			publishMessageDto.setMemberChangedMessage(msg);
 			imFeignService.publishMessage(publishMessageDto);
 			if(StringUtils.isNotEmpty(studentIds)){

+ 49 - 36
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -250,19 +250,27 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		if(Objects.isNull(examinationBasic)){
 			throw new BizException("考级项目不存在");
 		}
-		int sendExamPlanRooms = examRoomDao.countSendExamPlanRooms(examId);
+
+		ExamOrganizationRelation examOrganizationRelation = examOrganizationRelationDao.getExamOrganizationRelation(examId, selfOrganId);
+		if(Objects.isNull(examOrganizationRelation)||examOrganizationRelation.getIsAllowArrangeExam()==0){
+			throw new BizException("无权操作");
+		}
+
+		List<Integer> childOrganIds = organizationService.getChildOrganIds(selfOrganId, true);
+
+		int sendExamPlanRooms = examRoomDao.countSendExamPlanRooms(examId, childOrganIds);
 		if(sendExamPlanRooms>0){
 			throw new BizException("已发送考试安排,请手动处理未排考学员");
 		}
 		//未排考学员
-		List<ExamRegistration> notInRoomStudents = examRegistrationDao.getNotInRoomStudents(examId);
+		List<ExamRegistration> notInRoomStudents = examRegistrationDao.getNotInRoomStudents(examId, childOrganIds);
 		if(CollectionUtils.isEmpty(notInRoomStudents)){
 			throw new BizException("所有学员都已安排考场");
 		}
 		Map<Integer, List<ExamRegistration>> subjectRegistMap = notInRoomStudents.stream().collect(Collectors.groupingBy(ExamRegistration::getSubjectId));
 		Set<Integer> subjectIds = subjectRegistMap.keySet();
 		//未排考学员可排考考场
-		List<ExamRoom> examRooms = examRoomDao.getWithExamAndSubjects(examId, new ArrayList<>(subjectIds));
+		List<ExamRoom> examRooms = examRoomDao.getWithExamAndSubjects(examId, new ArrayList<>(subjectIds), childOrganIds);
 		if(CollectionUtils.isEmpty(examRooms)){
 			throw new BizException("请先建立考场");
 		}
@@ -638,16 +646,25 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		if(roomStudentListDtos != null && roomStudentListDtos.size() > 0){
 			RoomStudentListDto roomStudentListDto = roomStudentListDtos.get(0);
 			SysUser sysUser = sysUserFeignService.queryUserInfo();
+			//当前用户是呼叫中或者考试中
 			if(roomStudentListDto.getFinishedExam() == 0 || roomStudentListDto.getFinishedExam() == 1){
+				boolean isPush = true;
+				if(roomStudentListDtos.size() > 1){
+					RoomStudentListDto roomStudentListDto1 = roomStudentListDtos.get(1);
+					if(roomStudentListDto1.getFinishedExam() == 2){
+						isPush = false;
+					}
+				}
+				currentStudent(roomStudentListDto.getExamRoomStudentRelationId(),isPush,examStatus,sysUser.getId());
 				//考试中
-				currentStudent(roomStudentListDto.getExamRoomStudentRelationId(),true,examStatus,sysUser.getId());
 				if(roomStudentListDtos.size() > 1){
 					RoomStudentListDto roomStudentListDto1 = roomStudentListDtos.get(1);
 					if(roomStudentListDto1.getFinishedExam() == 2){
-						nextStudent(roomStudentListDto1.getExamRoomStudentRelationId(),false,sysUser.getId());
+						nextStudent(roomStudentListDto1.getExamRoomStudentRelationId(),true,sysUser.getId());
 					}
 				}
 				roomStudentListDtos.remove(0);
+				//当前用户是已签到
 			}else if(roomStudentListDto.getFinishedExam() == 2){
 				//未开始
 				nextStudent(roomStudentListDto.getExamRoomStudentRelationId(),true,sysUser.getId());
@@ -717,22 +734,17 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		publishMessageDto.setUserId(operator.toString());
 		publishMessageDto.setRoomId(examRoomStudentRelation.getExamRoomId().toString());
 		MemberChangedMessage msg = new MemberChangedMessage(action, examRoomStudentRelation.getStudentId().toString(),3);
-		/*if(action == 3 || action == 4){
-			msg = new MemberChangedMessage(action, examRoomStudentRelation.getStudentId().toString(),3);
-		}else {
-			msg = new MemberChangedMessage(action, examRoomStudentRelation.getStudentId(),3);
-		}*/
-//		String jsonString = JSONObject.toJSONString(examCertificationService.needCheckingDetail(examRoomStudentRelation.getExamRegistrationId()));
-		NeedCheckingDetailDto needCheckingDetailDto = examCertificationService.needCheckingDetail(examRoomStudentRelation.getExamRegistrationId());
-		msg.setWaitNum(needCheckingDetailDto.getWaitNum());
-		msg.setClassroomSwitch(needCheckingDetailDto.getClassroomSwitch());
-		msg.setOpenFlag(needCheckingDetailDto.getOpenFlag());
-//		msg.setAppParamJson(jsonString);
-		Map<String,Object> paramMap = new HashMap<>(2);
-
-		paramMap.put("studentQueue",this.queryNeedCheckingList(examRoomStudentRelation.getExamRoomId()));
-		paramMap.put("examCertification",examCertificationService.findDetailByStudentId(examRoomStudentRelation.getExamRegistrationId()));
-		msg.setWebParamJson(JSONObject.toJSONString(paramMap));
+
+//		NeedCheckingDetailDto needCheckingDetailDto = examCertificationService.needCheckingDetail(examRoomStudentRelation.getExamRegistrationId());
+//		msg.setWaitNum(needCheckingDetailDto.getWaitNum());
+//		msg.setClassroomSwitch(needCheckingDetailDto.getClassroomSwitch());
+//		msg.setOpenFlag(needCheckingDetailDto.getOpenFlag());
+
+		msg.setAppParamJson(examCertificationService.basicNeedCheckingDetail(examRoomStudentRelation.getExamRoomId()));
+//		Map<String,Object> paramMap = new HashMap<>(2);
+//		paramMap.put("studentQueue",this.queryNeedCheckingList(examRoomStudentRelation.getExamRoomId()));
+//		paramMap.put("examCertification",examCertificationService.findDetailByStudentId(examRoomStudentRelation.getExamRegistrationId()));
+//		msg.setWebParamJson(JSONObject.toJSONString(paramMap));
 		publishMessageDto.setMemberChangedMessage(msg);
 		imFeignService.publishMessage(publishMessageDto);
 	}
@@ -751,17 +763,17 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		publishMessageDto.setUserId(userId);
 		publishMessageDto.setRoomId(examRoomStudentRelation.getExamRoomId().toString());
 		MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Student_Queue, examRoomStudentRelation.getStudentId().toString(),3);
-//		String jsonString = JSONObject.toJSONString(examCertificationService.needCheckingDetail(examRoomStudentRelation.getExamRegistrationId()));
-//		msg.setAppParamJson(jsonString);
-		NeedCheckingDetailDto needCheckingDetailDto = examCertificationService.needCheckingDetail(examRoomStudentRelation.getExamRegistrationId());
-		msg.setWaitNum(needCheckingDetailDto.getWaitNum());
-		msg.setClassroomSwitch(needCheckingDetailDto.getClassroomSwitch());
-		msg.setOpenFlag(needCheckingDetailDto.getOpenFlag());
-		Map<String,Object> paramMap = new HashMap<>(2);
-		this.queryNeedCheckingList(examRoomStudentRelation.getExamRoomId());
-		paramMap.put("studentQueue",this.queryNeedCheckingList(examRoomStudentRelation.getExamRoomId()));
-		paramMap.put("examCertification",examCertificationService.findDetailByStudentId(examRoomStudentRelation.getExamRegistrationId()));
-		msg.setWebParamJson(JSONObject.toJSONString(paramMap));
+
+		msg.setAppParamJson(examCertificationService.basicNeedCheckingDetail(examRoomStudentRelation.getExamRoomId()));
+
+//		NeedCheckingDetailDto needCheckingDetailDto = examCertificationService.needCheckingDetail(examRoomStudentRelation.getExamRegistrationId());
+//		msg.setWaitNum(needCheckingDetailDto.getWaitNum());
+//		msg.setClassroomSwitch(needCheckingDetailDto.getClassroomSwitch());
+//		msg.setOpenFlag(needCheckingDetailDto.getOpenFlag());
+//		Map<String,Object> paramMap = new HashMap<>(2);
+//		paramMap.put("studentQueue",this.queryNeedCheckingList(examRoomStudentRelation.getExamRoomId()));
+//		paramMap.put("examCertification",examCertificationService.findDetailByStudentId(examRoomStudentRelation.getExamRegistrationId()));
+//		msg.setWebParamJson(JSONObject.toJSONString(paramMap));
 		publishMessageDto.setMemberChangedMessage(msg);
 		return publishMessageDto;
 	}
@@ -797,14 +809,15 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 		publishMessageDto.setRoomId(studentExamRoom.getExamRoomId().toString());
 		MemberChangedMessage msg = new MemberChangedMessage(MemberChangedMessage.Student_Queue, userId,3);
 //		String jsonString = JSONObject.toJSONString(examCertificationService.needCheckingDetail(examRegistrationId));
-		NeedCheckingDetailDto needCheckingDetailDto = examCertificationService.needCheckingDetail(examRegistrationId);
+//		NeedCheckingDetailDto needCheckingDetailDto = examCertificationService.needCheckingDetail(examRegistrationId);
 //		msg.setAppParamJson(needCheckingDetailDto.getWaitNum());
-		msg.setWaitNum(needCheckingDetailDto.getWaitNum());
-		msg.setClassroomSwitch(0);
-		msg.setOpenFlag(needCheckingDetailDto.getOpenFlag());
+//		msg.setWaitNum(needCheckingDetailDto.getWaitNum());
+//		msg.setClassroomSwitch(0);
+//		msg.setOpenFlag(needCheckingDetailDto.getOpenFlag());
 		publishMessageDto.setMemberChangedMessage(msg);
 		//修改签到状态
 		studentExamResultDao.updateFinishedExam(examRegistrationId,2);
+		msg.setAppParamJson(examCertificationService.basicNeedCheckingDetail(studentExamRoom.getExamRoomId()));
 		imFeignService.publishMessage(publishMessageDto);
 	}
 }

+ 36 - 13
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExaminationBasicServiceImpl.java

@@ -7,6 +7,7 @@ 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.common.tenant.OrganContextHolder;
 import com.keao.edu.common.tenant.TenantContextHolder;
 import com.keao.edu.thirdparty.message.provider.YimeiSmsPlugin;
 import com.keao.edu.user.api.enums.ExamModeEnum;
@@ -260,7 +261,7 @@ public class ExaminationBasicServiceImpl extends BaseServiceImpl<Long, Examinati
     @Override
     public PageInfo<ExaminationBasicDto> findExaminationBasics(ExaminationQueryInfo queryInfo) {
         PageInfo<ExaminationBasicDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
-        Map<String, Object> params = new HashMap<String, Object>();
+        Map<String, Object> params = new HashMap<>();
         MapUtil.populateMap(params, queryInfo);
 
         List<Integer> childOrganIds = organizationService.getChildOrganIds(queryInfo.getOrganId(), true);
@@ -449,11 +450,15 @@ 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);
+
+        ExamStatisticsDto tenantExamStatistics = examinationBasicDao.getTenantExamStatistics(childOrganIds);
+        result.put("statistics", tenantExamStatistics);
+
         List<ExaminationBasicDto> dataList = examinationBasicDao.getUnderwayExams(organId,childOrganIds);
         if(CollectionUtils.isEmpty(dataList)){
+            result.put("exams", Collections.EMPTY_LIST);
             return result;
         }
 
@@ -477,21 +482,18 @@ public class ExaminationBasicServiceImpl extends BaseServiceImpl<Long, Examinati
             examinationBasicDto.setTotalPaymentAmount(totalPaymentAmount);
         }
         result.put("exams", dataList);
-        ExamStatisticsDto tenantExamStatistics = examinationBasicDao.getTenantExamStatistics(childOrganIds);
-        result.put("statistics", tenantExamStatistics);
         return result;
     }
 
 
     @Override
-    public Object homeBalanceOfPayment(String tenantId,Integer day) {
+    public Object homeBalanceOfPayment(Integer day) {
         if(day == null){
             day = 7;
         }
         day = day * -1;
-
-        BigDecimal annualIncome = examRegistrationPaymentDao.getAnnualIncome(tenantId);
-        BigDecimal monthIncome = examRegistrationPaymentDao.getMonthIncome(tenantId);
+        Integer organId = OrganContextHolder.getOrganId();
+        List<Integer> childOrganIds = organizationService.getChildOrganIds(organId, true);
 
         LocalDate today = LocalDate.now();
         List<String> days=new ArrayList<>();
@@ -499,8 +501,31 @@ public class ExaminationBasicServiceImpl extends BaseServiceImpl<Long, Examinati
         for (int i = -1 ;i > day;i--){
             days.add(today.plusDays(i).toString());
         }
-        Map<String,BigDecimal> dayIncomes = MapUtil.convertMybatisMap(examRegistrationPaymentDao.getDayIncome(tenantId,days),String.class,BigDecimal.class);
-        Map<String,BigDecimal> dayPayments = MapUtil.convertMybatisMap(examManualLedgerDao.getDayPayment(tenantId,days),String.class,BigDecimal.class);
+        BigDecimal annualIncome;
+        BigDecimal monthIncome;
+        Map<String,BigDecimal> dayIncomes;
+        if(childOrganIds == null){
+            annualIncome = BigDecimal.ZERO;
+            monthIncome = BigDecimal.ZERO;
+            dayIncomes = new LinkedHashMap<>(days.size());
+        }else {
+            annualIncome = examRegistrationPaymentDao.getAnnualIncome(childOrganIds);
+            monthIncome = examRegistrationPaymentDao.getMonthIncome(childOrganIds);
+            dayIncomes = MapUtil.convertMybatisMap(examRegistrationPaymentDao.getDayIncome(childOrganIds,days),String.class,BigDecimal.class);
+        }
+        BigDecimal annualPayment;
+        BigDecimal monthPayment;
+        Map<String,BigDecimal> dayPayments;
+        if(organId == null){
+            annualPayment = BigDecimal.ZERO;
+            monthPayment = BigDecimal.ZERO;
+            dayPayments = new LinkedHashMap<>(days.size());
+        }else {
+            annualPayment = examManualLedgerDao.getAnnualPayment(organId);
+            monthPayment = examManualLedgerDao.getMonthPayment(organId);
+            dayPayments = MapUtil.convertMybatisMap(examManualLedgerDao.getDayPayment(organId,days),String.class,BigDecimal.class);
+        }
+
         days.forEach(e->{
             if(dayIncomes.get(e) == null){
                 dayIncomes.put(e,BigDecimal.ZERO);
@@ -516,8 +541,6 @@ public class ExaminationBasicServiceImpl extends BaseServiceImpl<Long, Examinati
         dayPayments.entrySet().stream().sorted(Map.Entry.comparingByKey())
                 .forEachOrdered(e -> hashMap2.put(e.getKey(), e.getValue()));
 
-        BigDecimal annualPayment = examManualLedgerDao.getAnnualPayment(tenantId);
-        BigDecimal monthPayment = examManualLedgerDao.getMonthPayment(tenantId);
         HashMap<Object, Object> resultMap = new HashMap<>(6);
         resultMap.put("annualIncome",annualIncome);
         resultMap.put("monthIncome",monthIncome);

+ 7 - 3
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/StudentExamResultServiceImpl.java

@@ -26,6 +26,7 @@ import com.keao.edu.user.dao.ExaminationBasicDao;
 import com.keao.edu.user.dao.StudentExamResultDao;
 import com.keao.edu.user.dto.ExaminationBasicDto;
 import com.keao.edu.user.dto.RecordNotify;
+import com.keao.edu.user.dto.StudentExamResultDto;
 import com.keao.edu.user.dto.StudentExamResultStatisticsDto;
 import com.keao.edu.user.entity.*;
 import com.keao.edu.user.enums.ExamStatusEnum;
@@ -80,15 +81,15 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
 	}
 
 	@Override
-	public PageInfo<StudentExamResult> queryStudentExamResult(StudentExamResultQueryInfo queryInfo) {
-		PageInfo<StudentExamResult> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
+	public PageInfo<StudentExamResultDto> queryStudentExamResult(StudentExamResultQueryInfo queryInfo) {
+		PageInfo<StudentExamResultDto> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
 		Map<String, Object> params = new HashMap<String, Object>();
 		MapUtil.populateMap(params, queryInfo);
 
 		List<Integer> childOrganIds = organizationService.getChildOrganIds(queryInfo.getOrganId(), true);
 		params.put("organIds", childOrganIds);
 
-		List<StudentExamResult> dataList = new ArrayList<>();
+		List<StudentExamResultDto> dataList = new ArrayList<>();
 		int count = studentExamResultDao.countStudentExamResult(params);
 		if (count > 0) {
 			pageInfo.setTotal(count);
@@ -204,6 +205,9 @@ public class StudentExamResultServiceImpl extends BaseServiceImpl<Long, StudentE
 			if(studentExamResult.getIsFinishedExam()==3){
 				continue;
 			}
+			if(Objects.nonNull(studentExamResult.getResult())){
+				continue;
+			}
 			List<ExamReview> reviews = registReviewMap.get(studentExamResult.getExamRegistrationId());
 			if(CollectionUtils.isEmpty(reviews)){
 				continue;

+ 5 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/SubjectServiceImpl.java

@@ -102,6 +102,11 @@ public class SubjectServiceImpl extends BaseServiceImpl<Integer, Subject> implem
     }
 
     @Override
+    public List<Subject> findExamRegistSubjects(Long examId) {
+        return subjectDao.findExamRegistSubjects(examId);
+    }
+
+    @Override
     public List<Subject> findBySubjectByIdList(List<Integer> subjectIdList) {
         return subjectDao.findBySubjectByIdList(StringUtils.join(subjectIdList,","));
     }

+ 18 - 0
edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamCertificationMapper.xml

@@ -182,4 +182,22 @@
 		LEFT JOIN student_exam_result ser ON ser.exam_registration_id_ = ersr.exam_registration_id_
 		WHERE ersr.exam_registration_id_ = #{examRegistrationId} LIMIT 1
 	</select>
+
+	<resultMap id="BasicNeedCheckingDetailDtoMap" type="com.keao.edu.user.dto.BasicNeedCheckingDetailDto">
+		<result property="classroomSwitch" column="classroom_switch_"/>
+		<result property="openFlag" column="open_flag_"/>
+		<result property="finishedExam" column="is_finished_exam_"/>
+		<result property="recordFlag" column="record_flag_"/>
+		<result property="studentId" column="student_id_"/>
+	</resultMap>
+    <select id="basicNeedCheckingDetail" resultMap="BasicNeedCheckingDetailDtoMap">
+		SELECT er.open_flag_,ser.is_finished_exam_,ersr.classroom_switch_,ser.record_flag_,ersr.student_id_
+		FROM exam_room_student_relation ersr
+		LEFT JOIN examination_basic eb ON eb.id_ = ersr.examination_basic_id_
+		LEFT JOIN exam_room er ON er.id_ = ersr.exam_room_id_
+		LEFT JOIN student_exam_result ser ON ser.exam_registration_id_ = ersr.exam_registration_id_
+		LEFT JOIN sys_user su ON ersr.student_id_ = su.id_
+		WHERE ersr.exam_room_id_ = #{examRoomId} AND ser.is_finished_exam_ != 5
+		ORDER BY ser.is_finished_exam_ ASC,ersr.sign_in_time_ ASC,ersr.id_ ASC
+	</select>
 </mapper>

+ 3 - 3
edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamManualLedgerMapper.xml

@@ -208,7 +208,7 @@
     </select>
     <select id="getDayPayment" resultType="java.util.Map">
 		SELECT DATE_FORMAT(eml.trans_time_,'%Y-%m-%d') 'key',SUM(eml.amount_) 'value' FROM exam_manual_ledger eml
-		WHERE eml.tenant_id_ = #{tenantId} AND eml.trans_direction_ = 'EXPENDITURE'
+		WHERE eml.organ_id_ = #{organId} AND eml.trans_direction_ = 'EXPENDITURE'
 		AND DATE_FORMAT(eml.trans_time_,'%Y-%m-%d') IN
 		<foreach collection="days" open="(" close=")" item="day" separator=",">
 			#{day}
@@ -218,11 +218,11 @@
 	<select id="getAnnualPayment" resultType="java.math.BigDecimal">
 		SELECT SUM(eml.amount_) FROM exam_manual_ledger eml
         WHERE eml.trans_direction_ = 'EXPENDITURE' AND DATE_FORMAT(eml.trans_time_,'%Y') = DATE_FORMAT(NOW(),'%Y')
-        AND eml.tenant_id_ = #{tenantId}
+        AND eml.organ_id_ = #{organId}
 	</select>
 	<select id="getMonthPayment" resultType="java.math.BigDecimal">
 		SELECT SUM(eml.amount_) FROM exam_manual_ledger eml
         WHERE eml.trans_direction_ = 'EXPENDITURE' AND DATE_FORMAT(eml.trans_time_,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')
-        AND eml.tenant_id_ = #{tenantId}
+        AND eml.organ_id_ = #{organId}
 	</select>
 </mapper>

+ 6 - 0
edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamRegistrationMapper.xml

@@ -645,6 +645,12 @@
 			examination_basic_id_ = #{examId}
 			AND er.status_ IN ('AUDIT_PASS', 'AUDIT_WAIT')
 			AND NOT EXISTS ( SELECT id_ FROM exam_room_student_relation WHERE examination_basic_id_ = #{examId} AND er.id_ = exam_registration_id_ )
+			<if test="organIds!=null">
+				AND er.organ_id_ IN
+				<foreach collection="organIds" item="organId" separator="," open="(" close=")">
+					#{organId}
+				</foreach>
+			</if>
 	</select>
 
     <select id="getOrganExamRegistStatistics" resultType="com.keao.edu.user.dto.OrganExamRegistStatisticsDto">

+ 12 - 3
edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamRegistrationPaymentMapper.xml

@@ -247,16 +247,25 @@
     <select id="getAnnualIncome" resultType="java.math.BigDecimal">
         SELECT SUM(erp.trans_amount_) FROM exam_registration_payment erp
         WHERE erp.trans_status_ = 'SUCCESS' AND DATE_FORMAT(erp.trans_successed_time_,'%Y') = DATE_FORMAT(NOW(),'%Y')
-        AND erp.tenant_id_ = #{tenantId};
+        AND erp.organ_id_ IN
+        <foreach collection="childOrganIds" separator="," item="organId" open="(" close=")">
+            #{organId}
+        </foreach>
     </select>
     <select id="getMonthIncome" resultType="java.math.BigDecimal">
         SELECT SUM(erp.trans_amount_) FROM exam_registration_payment erp
         WHERE erp.trans_status_ = 'SUCCESS' AND DATE_FORMAT(erp.trans_successed_time_,'%Y-%m') = DATE_FORMAT(NOW(),'%Y-%m')
-        AND erp.tenant_id_ = #{tenantId}
+        AND erp.organ_id_ IN
+        <foreach collection="childOrganIds" separator="," item="organId" open="(" close=")">
+            #{organId}
+        </foreach>
     </select>
     <select id="getDayIncome" resultType="java.util.Map">
         SELECT DATE_FORMAT(erp.trans_successed_time_,'%Y-%m-%d') 'key',SUM(erp.trans_amount_) 'value' FROM exam_registration_payment erp
-        WHERE erp.tenant_id_ = #{tenantId} AND erp.trans_status_ = 'SUCCESS'
+        WHERE erp.organ_id_ IN
+        <foreach collection="childOrganIds" separator="," item="organId" open="(" close=")">
+            #{organId}
+        </foreach> AND erp.trans_status_ = 'SUCCESS'
         AND DATE_FORMAT(erp.trans_successed_time_,'%Y-%m-%d') IN
         <foreach collection="days" open="(" close=")" item="day" separator=",">
             #{day}

+ 5 - 3
edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamReviewMapper.xml

@@ -200,12 +200,14 @@
 	</resultMap>
 	<sql id="queryExamReviewRecordListSql">
 		<where>
-			ersr.sign_in_time_ IS NOT NULL
 			<if test="reviewFlag != null and reviewFlag == 1">
-				AND er.id_ IS NOT NULL
+				AND ersr.sign_in_time_ IS NOT NULL AND er.id_ IS NOT NULL
 			</if>
 			<if test="reviewFlag != null and reviewFlag == 0">
-				AND er.id_ IS NULL AND ser.is_finished_exam_ IN (0,5)
+				AND ersr.sign_in_time_ IS NOT NULL AND er.id_ IS NULL AND ser.is_finished_exam_ IN (0,5)
+			</if>
+			<if test="reviewFlag == null">
+				AND ser.is_finished_exam_ != 3
 			</if>
 			<if test="roomId != 0">
 				AND ersr.exam_room_id_ = #{roomId}

+ 17 - 3
edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamRoomMapper.xml

@@ -245,9 +245,9 @@
     <update id="updateExamRoomStudentNum">
 		UPDATE exam_room er
 		LEFT JOIN ( SELECT exam_room_id_, COUNT( exam_registration_id_ ) stu_num_ FROM exam_room_student_relation WHERE examination_basic_id_ = #{examId} GROUP BY exam_room_id_ ) ers ON er.id_ = ers.exam_room_id_
-		SET er.exam_room_student_num_ = ers.stu_num_
+		SET er.exam_room_student_num_ = CASE WHEN ers.stu_num_ IS NULL THEN 0 ELSE ers.stu_num_ END
 		WHERE
-			er.examination_basic_id_ = #{examId}
+			er.examination_basic_id_ = #{examId} AND er.id_ = ers.exam_room_id_
 	</update>
 
     <!-- 根据主键删除一条记录 -->
@@ -447,7 +447,15 @@
 	</select>
 
     <select id="countSendExamPlanRooms" resultType="int">
-		SELECT COUNT(id_) FROM exam_room WHERE examination_basic_id_=#{examId} AND exam_plan_push_flag_=1
+		SELECT COUNT(id_) FROM exam_room
+		WHERE examination_basic_id_=#{examId}
+		AND exam_plan_push_flag_=1
+		<if test="organIds!=null">
+			AND organ_id_ IN
+			<foreach collection="organIds" item="organId" separator="," open="(" close=")">
+				#{organId}
+			</foreach>
+		</if>
 	</select>
 
 	<select id="getWithExamAndSubjects" resultMap="ExamRoom">
@@ -457,6 +465,12 @@
 		<foreach collection="subjectIds" item="subjectId" separator="," open="(" close=")">
 			#{subjectId}
 		</foreach>
+		<if test="organIds!=null">
+			AND organ_id_ IN
+			<foreach collection="organIds" item="organId" separator="," open="(" close=")">
+				#{organId}
+			</foreach>
+		</if>
 	</select>
 
     <select id="countTeacherRooms" resultType="int">

+ 1 - 1
edu-user/edu-user-biz/src/main/resources/config/mybatis/ExamRoomStudentRelationMapper.xml

@@ -239,7 +239,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_room_id_ = #{examRoomId} AND ersr.sign_in_time_ IS NOT NULL
-		AND ser.is_finished_exam_ IN (0,1,2) AND ersr.student_id_ != #{studentId}
+		AND ser.is_finished_exam_ IN (0,1,2)
 		<if test="signInTime != null and signInTime != ''">
 			AND (ersr.sign_in_time_ &lt; #{signInTime} OR (ersr.sign_in_time_ = #{signInTime} AND ersr.id_ &lt; #{ersrId}))
 		</if>

+ 5 - 3
edu-user/edu-user-biz/src/main/resources/config/mybatis/ExaminationBasicMapper.xml

@@ -304,7 +304,7 @@
 				)
 		</if>
 		ORDER BY
-		create_time_ DESC
+		eb.id_
 		LIMIT 6;
 	</select>
 
@@ -313,14 +313,16 @@
 			COUNT(id_) 'totalExamNum',
 			SUM(CASE WHEN status_!='RESULT_CONFIRM' THEN 1 ELSE 0 END) 'underWayExamNum'
 		FROM
-			examination_basic
+			examination_basic eb
 		WHERE
 			status_ NOT IN ( 'CLOSE', 'DELETE' )
 			<if test="organIds!=null">
-				AND organ_id_ IN
+				AND EXISTS (SELECT examination_basic_id_ FROM exam_organization_relation WHERE
+				eb.id_=examination_basic_id_ AND organ_id_ IN
 				<foreach collection="organIds" item="organId" separator="," open="(" close=")">
 					#{organId}
 				</foreach>
+				)
 			</if>
 	</select>
 </mapper>

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

@@ -130,7 +130,7 @@
 		SELECT <include refid="organizationColumn"/>,e.lock_flag_ FROM organization o
 		LEFT JOIN employee e ON o.user_id_ = e.user_id_
 		<include refid="organQueryPage"/>
-		ORDER BY o.update_time_ DESC
+		ORDER BY o.id_ DESC
 		<include refid="global.limit"/>
 	</select>
 	

+ 13 - 3
edu-user/edu-user-biz/src/main/resources/config/mybatis/StudentExamResultMapper.xml

@@ -27,7 +27,11 @@
 		<result column="exam_room_id_" property="examRoomId" />
 		<association property="examRegistration" columnPrefix="regist_" resultMap="com.keao.edu.user.dao.ExamRegistrationDao.ExamRegistration"/>
 	</resultMap>
-	
+
+	<resultMap id="StudentExamResultDto" type="com.keao.edu.user.dto.StudentExamResultDto" extends="StudentExamResult">
+		<result column="exam_mode_" property="examMode" typeHandler="com.keao.edu.common.dal.CustomEnumTypeHandler"/>
+	</resultMap>
+
 	<!-- 根据主键查询一条记录 -->
 	<select id="get" resultMap="StudentExamResult" >
 		SELECT * FROM student_exam_result WHERE id_ = #{id} 
@@ -194,13 +198,16 @@
 			<if test="resultConfirm!=null and resultConfirm==0">
 				AND eb.status_='EXAM_END'
 			</if>
+			<if test="examMode!=null">
+				AND ero.exam_mode_ = #{examMode, typeHandler=com.keao.edu.common.dal.CustomEnumTypeHandler}
+			</if>
 			<!--<if test="resultConfirm==null">-->
 				<!--AND eb.status_ IN ('EXAM_ING', 'EXAM_END','RESULT_CONFIRM')-->
 			<!--</if>-->
 		</where>
 	</sql>
 
-	<select id="queryStudentExamResult" resultMap="StudentExamResult" parameterType="map">
+	<select id="queryStudentExamResult" resultMap="StudentExamResultDto" parameterType="map">
 		SELECT
 			ser.*,
 			er.id_ regist_id_,
@@ -208,12 +215,14 @@
 			er.student_id_ regist_student_id_,
 			er.organ_id_ regist_organ_id_,
 			er.subject_id_ regist_subject_id_,
-			er.level_ regist_level_
+			er.level_ regist_level_,
+			ero.exam_mode_
 		FROM
 			student_exam_result ser
 			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_
+			LEFT JOIN exam_room ero ON ser.exam_room_id_=ero.id_
 		<include refid="queryStudentExamResultCondition"/>
 		ORDER BY er.id_ <include refid="global.limit"/>
 	</select>
@@ -226,6 +235,7 @@
 			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_
+			LEFT JOIN exam_room ero ON ser.exam_room_id_=ero.id_
 		<include refid="queryStudentExamResultCondition"/>
 	</select>
 

+ 6 - 0
edu-user/edu-user-biz/src/main/resources/config/mybatis/SubjectMapper.xml

@@ -126,4 +126,10 @@
         SELECT COUNT(0) FROM exam_subject es
         WHERE es.subject_id_ IN (SELECT s.id_ FROM `subject` s WHERE s.id_ = #{id});
     </select>
+
+    <select id="findExamRegistSubjects" resultType="com.keao.edu.user.entity.Subject">
+        SELECT DISTINCT s.* FROM exam_registration er
+        LEFT JOIN `subject` s ON er.subject_id_=s.id_
+        WHERE er.examination_basic_id_=#{examId}
+    </select>
 </mapper>

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

@@ -45,15 +45,15 @@
 	</insert>
 	<insert id="initSysConfig">
 		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}
+		SELECT param_name_,paran_value_,description_,annotation_,NOW(),NOW(),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}
+		SELECT param_name_,paran_value_,description_,annotation_,NOW(),NOW(),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_`)
-		SELECT param_name_,paran_value_,description_,annotation_,create_on_,modify_on_,group_,#{tenantId}
+		SELECT param_name_,paran_value_,description_,annotation_,NOW(),NOW(),group_,#{tenantId}
 		FROM sys_config WHERE tenant_id_ = '0' AND param_name_ = 'single_song_record_minutes';
 	</insert>
 

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

@@ -136,7 +136,6 @@ public class ExaminationBasicController extends BaseController {
     @PostMapping(value = "/homeBalanceOfPayment")
     @PreAuthorize("@pcs.hasPermissions('examinationBasic/homeBalanceOfPayment')")
     public HttpResponseResult homeBalanceOfPayment(Integer day){
-        String tenantId = TenantContextHolder.getTenantId();
-        return succeed(examinationBasicService.homeBalanceOfPayment(tenantId,day));
+        return succeed(examinationBasicService.homeBalanceOfPayment(day));
     }
 }

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

@@ -7,31 +7,25 @@ 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.dao.SysUserDao;
 import com.keao.edu.user.entity.Organization;
 import com.keao.edu.user.page.OrganizationQueryInfo;
 import com.keao.edu.user.service.OrganizationService;
 import com.keao.edu.util.date.DateUtil;
-import com.keao.edu.util.excel.POIUtil;
-import com.keao.edu.util.iniFile.IniFileEntity;
-import com.keao.edu.util.iniFile.IniFileUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.apache.poi.hssf.usermodel.HSSFWorkbook;
 import org.apache.tomcat.util.http.fileupload.IOUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.util.ResourceUtils;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
-import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.util.*;
+import java.util.Date;
+import java.util.List;
 
 /**
  * 合作单位服务
@@ -45,8 +39,6 @@ public class OrganizationController extends BaseController {
     private OrganizationService organizationService;
     @Autowired
     private SysUserFeignService sysUserFeignService;
-    @Autowired
-    private SysUserDao sysUserDao;
 
     @ApiOperation(value = "合作单位列表")
     @GetMapping(value = "list")

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

@@ -8,6 +8,7 @@ import com.keao.edu.common.entity.HttpResponseResult;
 import com.keao.edu.common.page.PageInfo;
 import com.keao.edu.user.api.enums.StudentExamResultApiDto;
 import com.keao.edu.user.dto.RecordNotify;
+import com.keao.edu.user.dto.StudentExamResultDto;
 import com.keao.edu.user.dto.StudentExamResultStatisticsDto;
 import com.keao.edu.user.entity.Employee;
 import com.keao.edu.user.entity.StudentExamResult;
@@ -48,7 +49,7 @@ public class StudentExamResultController extends BaseController {
     @ApiOperation("查询考试结果")
     @GetMapping(value = "/queryStudentExamResult")
     @PreAuthorize("@pcs.hasPermissions('studentExamResult/queryStudentExamResult')")
-    public HttpResponseResult<PageInfo<StudentExamResult>> queryStudentExamResult(StudentExamResultQueryInfo queryInfo){
+    public HttpResponseResult<PageInfo<StudentExamResultDto>> queryStudentExamResult(StudentExamResultQueryInfo queryInfo){
         SysUser sysUser = sysUserFeignService.queryUserInfo();
         if(!sysUser.getIsSuperAdmin()&&Objects.isNull(queryInfo.getOrganId())){
             Employee employee = employeeService.get(sysUser.getId());

+ 7 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/SubjectController.java

@@ -55,6 +55,13 @@ public class SubjectController extends BaseController {
         return succeed(subjectService.queryPage(queryInfo));
     }
 
+    @ApiOperation(value = "获取考级项目学员报考科目列表")
+    @GetMapping("/findExamRegistSubjects")
+    @PreAuthorize("@pcs.hasPermissions('subject/findExamRegistSubjects')")
+    public HttpResponseResult findExamRegistSubjects(Long examId){
+        return succeed(subjectService.findExamRegistSubjects(examId));
+    }
+
     @ApiOperation(value = "学生端分页查询科目列表")
     @GetMapping("/studentQueryPage")
     @PreAuthorize("@pcs.hasPermissions('studentExamResult/studentQueryPage')")