|
@@ -11,6 +11,7 @@ import com.keao.edu.common.page.PageInfo;
|
|
|
import com.keao.edu.common.service.impl.BaseServiceImpl;
|
|
|
import com.keao.edu.common.tenant.TenantContextHolder;
|
|
|
import com.keao.edu.user.api.entity.ExamRoom;
|
|
|
+import com.keao.edu.user.api.entity.ExamRoomStudentRelation;
|
|
|
import com.keao.edu.user.api.enums.ExamModeEnum;
|
|
|
import com.keao.edu.user.dao.*;
|
|
|
import com.keao.edu.user.dto.ExamRoomDto;
|
|
@@ -19,6 +20,7 @@ import com.keao.edu.user.entity.ExamRegistration;
|
|
|
import com.keao.edu.user.entity.ExaminationBasic;
|
|
|
import com.keao.edu.user.page.ExamRoomQueryInfo;
|
|
|
import com.keao.edu.user.service.ExamRoomService;
|
|
|
+import com.keao.edu.user.service.ExamTeacherSalaryService;
|
|
|
import com.keao.edu.user.service.OrganizationService;
|
|
|
import com.keao.edu.util.collection.MapUtil;
|
|
|
import com.keao.edu.util.date.DateUtil;
|
|
@@ -27,6 +29,7 @@ import org.apache.commons.lang.time.DateUtils;
|
|
|
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 org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import java.util.*;
|
|
@@ -47,6 +50,12 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
|
|
|
private ExaminationBasicDao examinationBasicDao;
|
|
|
@Autowired
|
|
|
private SysUserDao sysUserDao;
|
|
|
+ @Autowired
|
|
|
+ private ExamTeacherSalaryService examTeacherSalaryService;
|
|
|
+ @Autowired
|
|
|
+ private ExamCertificationDao examCertificationDao;
|
|
|
+ @Autowired
|
|
|
+ private StudentExamResultDao studentExamResultDao;
|
|
|
|
|
|
@Override
|
|
|
public BaseDAO<Long, ExamRoom> getDAO() {
|
|
@@ -191,6 +200,8 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
|
|
|
}
|
|
|
examRoomDao.batchInsert(examRooms);
|
|
|
examinationBasicDao.update(examinationBasic);
|
|
|
+
|
|
|
+ examTeacherSalaryService.teacherSalarySettlementWithExam(examinationBasic.getId());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -221,13 +232,27 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public void deleteExamRooms(String examRoomIdsStr) {
|
|
|
if(StringUtils.isBlank(examRoomIdsStr)){
|
|
|
return;
|
|
|
}
|
|
|
List<Long> examRoomIds = Arrays.asList(examRoomIdsStr.split(",")).stream().map(e -> Long.valueOf(e)).collect(Collectors.toList());
|
|
|
- examRoomDao.batchDeleteExamRooms(examRoomIds);
|
|
|
+
|
|
|
+ ExamRoom examRoom = examRoomDao.get(examRoomIds.get(0));
|
|
|
+
|
|
|
+ List<ExamRoomStudentRelation> roomStudents = examRoomStudentRelationDao.findStudentsWithExamRooms(examRoomIds);
|
|
|
+ List<Long> registIds = roomStudents.stream().map(ExamRoomStudentRelation::getExamRegistrationId).collect(Collectors.toList());
|
|
|
+
|
|
|
examRoomStudentRelationDao.deleteWithExamRooms(examRoomIds);
|
|
|
+
|
|
|
+ examCertificationDao.deleteWithRegist(registIds);
|
|
|
+
|
|
|
+ studentExamResultDao.deleteWithRegists(registIds);
|
|
|
+
|
|
|
+ examTeacherSalaryService.teacherSalarySettlementWithExam(examRoom.getExaminationBasicId());
|
|
|
+
|
|
|
+ examRoomDao.batchDeleteExamRooms(examRoomIds);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -237,7 +262,6 @@ public class ExamRoomServiceImpl extends BaseServiceImpl<Long, ExamRoom> impleme
|
|
|
if(withoutExamRoomStudentNum>0){
|
|
|
throw new BizException("存在未安排教室的学员");
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
|
|
|
@Override
|