|
|
@@ -713,7 +713,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
boolean resultBool = smartUserService.saveBatch(studentDatas);
|
|
|
if (!resultBool) {
|
|
|
return CommonResult.fail("导入失败");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
// 需添加到海康平台
|
|
|
ArrayList<SmartOperationUser> operationUsers = new ArrayList<>();
|
|
|
for (SmartUser studentData : studentDatas) {
|
|
|
@@ -999,7 +999,7 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
boolean resultBool = smartUserService.saveBatch(teacherDatas);
|
|
|
if (!resultBool) {
|
|
|
return CommonResult.fail("导入失败");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
// 需添加到海康平台
|
|
|
ArrayList<SmartOperationUser> operationUsers = new ArrayList<>();
|
|
|
for (SmartUser teacherData : teacherDatas) {
|
|
|
@@ -3309,9 +3309,22 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
}
|
|
|
}
|
|
|
if (eTeachers != null && eTeachers.size() > 0) {
|
|
|
- boolean teacherBatch = smartEvaluateTeacherService.saveBatch(eTeachers);
|
|
|
- if (!teacherBatch) {
|
|
|
- throw new Exception("教师综合评价添加失败!");
|
|
|
+ List<SmartEvaluateTeacher> insertEts = new ArrayList<>();
|
|
|
+
|
|
|
+ //已存在在老师综合评价里的就不再加进去了
|
|
|
+ List<SmartEvaluateTeacher> teachers = smartEvaluateTeacherService.queryEvaluateTeachersByUserId(su.getId());
|
|
|
+ for (SmartEvaluateTeacher et:eTeachers) {
|
|
|
+ long existCount = teachers.stream().filter(e -> e.getUserId().equals(et.getUserId()) && e.getTermId().equals(et.getTermId())
|
|
|
+ && e.getGradeId().equals(et.getGradeId()) && e.getSubjectId().equals(et.getSubjectId()) && e.getClassId().equals(et.getClassId())).count();
|
|
|
+ if(existCount <= 0){
|
|
|
+ insertEts.add(et);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(insertEts != null && insertEts.size() > 0){
|
|
|
+ boolean teacherBatch = smartEvaluateTeacherService.saveBatch(insertEts);
|
|
|
+ if (!teacherBatch) {
|
|
|
+ throw new Exception("教师综合评价添加失败!");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
//endregion
|
|
|
@@ -5361,11 +5374,11 @@ public class SmartUserController implements SmartUserControllerAPI {
|
|
|
int result = smartUserService.deleteSmartUserByIds(ur.getUserIds());
|
|
|
if (result <= 0) {
|
|
|
return CommonResult.fail("删除失败");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
// 删除同步到海康平台
|
|
|
for (SmartUser user : users) {
|
|
|
Integer identityId = user.getIdentityId();
|
|
|
- if (2==identityId || identityId==3) {
|
|
|
+ if (2 == identityId || identityId == 3) {
|
|
|
Integer id = user.getId();
|
|
|
SmartOperationUser smartOperationUser = new SmartOperationUser();
|
|
|
smartOperationUser.setOperationId(id);
|