|
@@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.google.gson.Gson;
|
|
|
import com.qmth.themis.business.cache.bean.ExamCourseCacheBean;
|
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
|
-import com.qmth.themis.business.dao.*;
|
|
|
+import com.qmth.themis.business.dao.TEExamCourseMapper;
|
|
|
import com.qmth.themis.business.dto.ExamStudentImportDto;
|
|
|
import com.qmth.themis.business.dto.RoomCodeImportDto;
|
|
|
import com.qmth.themis.business.entity.*;
|
|
@@ -19,6 +19,7 @@ import com.qmth.themis.common.contanst.Constants;
|
|
|
import com.qmth.themis.common.exception.BusinessException;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.util.LinkedMultiValueMap;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -53,23 +54,11 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
|
@Resource
|
|
|
TEExamCourseService teExamCourseService;
|
|
|
|
|
|
- @Resource
|
|
|
- TEStudentMapper teStudentMapper;
|
|
|
-
|
|
|
- @Resource
|
|
|
- TEExamStudentMapper teExamStudentMapper;
|
|
|
-
|
|
|
- @Resource
|
|
|
- TBExamInvigilateUserMapper tbExamInvigilateUserMapper;
|
|
|
-
|
|
|
@Resource
|
|
|
TEExamCourseMapper teExamCourseMapper;
|
|
|
|
|
|
@Resource
|
|
|
- TBUserMapper tbUserMapper;
|
|
|
-
|
|
|
- @Resource
|
|
|
- TBUserRoleMapper tbUserRoleMapper;
|
|
|
+ TBUserRoleService tbUserRoleService;
|
|
|
|
|
|
/**
|
|
|
* 考生导入逻辑
|
|
@@ -202,8 +191,12 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
|
max = size;
|
|
|
}
|
|
|
}
|
|
|
- teStudentMapper.insertOrUpdateBath(teStudentList);
|
|
|
- teExamStudentMapper.insertOrUpdateBath(teExamStudentList);
|
|
|
+ if (!CollectionUtils.isEmpty(teStudentList)) {
|
|
|
+ teStudentService.saveOrUpdateBatch(teStudentList);
|
|
|
+ }
|
|
|
+ if (!CollectionUtils.isEmpty(teExamStudentList)) {
|
|
|
+ teExamStudentService.saveOrUpdateBatch(teExamStudentList);
|
|
|
+ }
|
|
|
}
|
|
|
map.put("line", line);
|
|
|
//考场创建
|
|
@@ -214,12 +207,13 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
|
if (Objects.isNull(tbExamInvigilateUserMap) || (Objects.nonNull(tbExamInvigilateUserMap) && Objects.isNull(tbExamInvigilateUserMap.get(s)))) {
|
|
|
String[] strs = s.split(":");
|
|
|
TBExamInvigilateUser tbExamInvigilateUser = new TBExamInvigilateUser(Long.parseLong(strs[0]), orgId, strs[1], strs[2]);
|
|
|
-// tbExamInvigilateUserService.save(tbExamInvigilateUser);
|
|
|
tbExamInvigilateUserList.add(tbExamInvigilateUser);
|
|
|
count.getAndIncrement();
|
|
|
}
|
|
|
});
|
|
|
- tbExamInvigilateUserMapper.insertOrUpdateBath(tbExamInvigilateUserList);
|
|
|
+ if (!CollectionUtils.isEmpty(tbExamInvigilateUserList)) {
|
|
|
+ tbExamInvigilateUserService.saveOrUpdateBatch(tbExamInvigilateUserList);
|
|
|
+ }
|
|
|
if (count.get() > 0) {
|
|
|
txtList.add(DateUtil.format(new Date(), Constants.DEFAULT_DATE_PATTERN) + "->创建了" + count + "条考场数据");
|
|
|
}
|
|
@@ -292,9 +286,15 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
|
.in(TBExamInvigilateUser::getRoomName, roomNameSet);
|
|
|
tbExamInvigilateUserService.remove(wrapper);
|
|
|
|
|
|
- tbUserMapper.insertOrUpdateBath(tbUserList);
|
|
|
- tbUserRoleMapper.insertOrUpdateBath(tbUserRoleList);
|
|
|
- tbExamInvigilateUserMapper.insertOrUpdateBath(tbExamInvigilateUserList);
|
|
|
+ if (!CollectionUtils.isEmpty(tbUserList)) {
|
|
|
+ tbUserService.saveOrUpdateBatch(tbUserList);
|
|
|
+ }
|
|
|
+ if (!CollectionUtils.isEmpty(tbUserRoleList)) {
|
|
|
+ tbUserRoleService.saveOrUpdateBatch(tbUserRoleList);
|
|
|
+ }
|
|
|
+ if (!CollectionUtils.isEmpty(tbExamInvigilateUserList)) {
|
|
|
+ tbExamInvigilateUserService.saveOrUpdateBatch(tbExamInvigilateUserList);
|
|
|
+ }
|
|
|
map.put("line", line);
|
|
|
return map;
|
|
|
}
|