|
@@ -1,6 +1,7 @@
|
|
package com.qmth.themis.backend.api;
|
|
package com.qmth.themis.backend.api;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.qmth.themis.business.annotation.ApiJsonObject;
|
|
import com.qmth.themis.business.annotation.ApiJsonObject;
|
|
@@ -127,10 +128,8 @@ public class TEExamStudentController {
|
|
if (Objects.isNull(s.getId())) {
|
|
if (Objects.isNull(s.getId())) {
|
|
QueryWrapper<TEStudent> teExamStudentQueryWrapper = new QueryWrapper<>();
|
|
QueryWrapper<TEStudent> teExamStudentQueryWrapper = new QueryWrapper<>();
|
|
teExamStudentQueryWrapper.lambda().eq(TEStudent::getName, s.getName())
|
|
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());
|
|
|
|
- }
|
|
|
|
|
|
+ .eq(TEStudent::getIdentity, s.getIdentity())
|
|
|
|
+ .eq(TEStudent::getOrgId, tbOrg.getId());
|
|
int count = teStudentService.count(teExamStudentQueryWrapper);
|
|
int count = teStudentService.count(teExamStudentQueryWrapper);
|
|
if (count == 0) {
|
|
if (count == 0) {
|
|
TEStudent teStudent = new TEStudent(tbOrg.getId(), s.getIdentity(), s.getName(), tbUser.getId());
|
|
TEStudent teStudent = new TEStudent(tbOrg.getId(), s.getIdentity(), s.getName(), tbUser.getId());
|
|
@@ -139,6 +138,16 @@ public class TEExamStudentController {
|
|
s.setCreateId(tbUser.getId());
|
|
s.setCreateId(tbUser.getId());
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
|
|
+ UpdateWrapper<TEExamStudent> teExamStudentUpdateWrapper = new UpdateWrapper<>();
|
|
|
|
+ teExamStudentUpdateWrapper.lambda().set(TEExamStudent::getName, s.getName())
|
|
|
|
+ .eq(TEExamStudent::getIdentity, s.getIdentity());
|
|
|
|
+ teExamStudentService.update(teExamStudentUpdateWrapper);
|
|
|
|
+
|
|
|
|
+ UpdateWrapper<TEStudent> teStudentUpdateWrapper = new UpdateWrapper<>();
|
|
|
|
+ teStudentUpdateWrapper.lambda().set(TEStudent::getName, s.getName())
|
|
|
|
+ .eq(TEStudent::getIdentity, s.getIdentity());
|
|
|
|
+ teStudentService.update(teStudentUpdateWrapper);
|
|
|
|
+
|
|
s.setUpdateId(tbUser.getId());
|
|
s.setUpdateId(tbUser.getId());
|
|
}
|
|
}
|
|
});
|
|
});
|