Joburgess пре 5 година
родитељ
комит
010023d5a3

+ 1 - 0
edu-user/edu-user-biz/src/main/java/com/keao/edu/user/service/impl/ExamRoomStudentRelationServiceImpl.java

@@ -242,6 +242,7 @@ public class ExamRoomStudentRelationServiceImpl extends BaseServiceImpl<Long, Ex
 	}
 
 	@Override
+	@Transactional(rollbackFor = Exception.class)
 	public void autoSplitStudentToRoom(Long examId, Integer selfOrganId) {
 		ExaminationBasic examinationBasic = examinationBasicDao.get(examId);
 		if(Objects.isNull(examinationBasic)){

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

@@ -286,8 +286,9 @@
 		FROM
 			exam_room_student_relation ersr
 			LEFT JOIN exam_room er ON ersr.exam_room_id_ = er.id_
-		WHERE DATE_FORMAT(er.exam_start_time_,'%Y-%m-%d') = #{day}
+		WHERE er.exam_plan_push_flag_=1 AND DATE_FORMAT(er.exam_start_time_,'%Y-%m-%d') = #{day}
 	</select>
+
     <select id="getStudentNumMap" resultType="java.util.Map">
 		SELECT ersr.exam_room_id_ 'key',COUNT(DISTINCT ersr.student_id_) 'value'
 		FROM exam_room_student_relation ersr
@@ -297,6 +298,7 @@
 		</foreach>
 		GROUP BY ersr.exam_room_id_
 	</select>
+
 	<select id="countSignInNum" resultType="java.lang.Integer">
 		SELECT COUNT(DISTINCT id_) FROM student_exam_result WHERE is_finished_exam_ = 2 AND exam_room_id_ = #{examRoomId}
 	</select>

+ 4 - 0
edu-user/edu-user-server/src/main/java/com/keao/edu/user/controller/ExamOrganizationRelationController.java

@@ -16,6 +16,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
@@ -87,6 +88,9 @@ public class ExamOrganizationRelationController extends BaseController {
         if(Objects.isNull(employee)){
             return failed("用户异常");
         }
+        if(CollectionUtils.isEmpty(organizationRelations)){
+            return failed("请选择合作单位");
+        }
         examOrganizationRelationService.addExamOrganizations(organizationRelations,employee.getOrganId());
         return succeed();
     }