|
@@ -68,6 +68,9 @@ public class TEExamStudentController {
|
|
@Resource
|
|
@Resource
|
|
SystemConfig systemConfig;
|
|
SystemConfig systemConfig;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ TEStudentService teStudentService;
|
|
|
|
+
|
|
@ApiOperation(value = "考生查询接口")
|
|
@ApiOperation(value = "考生查询接口")
|
|
@RequestMapping(value = "/query", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/query", method = RequestMethod.POST)
|
|
@ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TEExamStudentDto.class)})
|
|
@ApiResponses({@ApiResponse(code = 200, message = "考生信息", response = TEExamStudentDto.class)})
|
|
@@ -119,8 +122,25 @@ public class TEExamStudentController {
|
|
throw new BusinessException(ExceptionResultEnum.EXAM_STUDENT_INFO_IS_NULL);
|
|
throw new BusinessException(ExceptionResultEnum.EXAM_STUDENT_INFO_IS_NULL);
|
|
}
|
|
}
|
|
TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
TBUser tbUser = (TBUser) ServletUtil.getRequestAccount();
|
|
|
|
+ TBOrg tbOrg = (TBOrg) ServletUtil.getRequestOrg();
|
|
teExamStudentList.forEach(s -> {
|
|
teExamStudentList.forEach(s -> {
|
|
- s.setUpdateId(tbUser.getId());
|
|
|
|
|
|
+ if (Objects.isNull(s.getId())) {
|
|
|
|
+ QueryWrapper<TEStudent> teExamStudentQueryWrapper = new QueryWrapper<>();
|
|
|
|
+ teExamStudentQueryWrapper.lambda().eq(TEStudent::getName, s.getName())
|
|
|
|
+ .eq(TEStudent::getIdentity, s.getIdentity());
|
|
|
|
+ if (Objects.nonNull(tbOrg) && Objects.nonNull(tbOrg.getId())) {
|
|
|
|
+ teExamStudentQueryWrapper.lambda().eq(TEStudent::getOrgId, tbOrg.getId());
|
|
|
|
+ }
|
|
|
|
+ int count = teStudentService.count(teExamStudentQueryWrapper);
|
|
|
|
+ if (count == 0) {
|
|
|
|
+ TEStudent teStudent = new TEStudent(tbOrg.getId(), s.getIdentity(), s.getName(), tbUser.getId());
|
|
|
|
+ teStudentService.save(teStudent);
|
|
|
|
+ s.setStudentId(teStudent.getId());
|
|
|
|
+ s.setCreateId(tbUser.getId());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ s.setUpdateId(tbUser.getId());
|
|
|
|
+ }
|
|
});
|
|
});
|
|
teExamStudentService.saveOrUpdateBatch(teExamStudentList);
|
|
teExamStudentService.saveOrUpdateBatch(teExamStudentList);
|
|
teExamStudentList.forEach(s -> {
|
|
teExamStudentList.forEach(s -> {
|