|
@@ -1,6 +1,11 @@
|
|
package cn.com.qmth.stmms.biz.user.service.impl;
|
|
package cn.com.qmth.stmms.biz.user.service.impl;
|
|
|
|
|
|
-import java.util.*;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.Date;
|
|
|
|
+import java.util.HashSet;
|
|
|
|
+import java.util.LinkedList;
|
|
|
|
+import java.util.List;
|
|
|
|
+import java.util.Set;
|
|
|
|
|
|
import javax.persistence.criteria.CriteriaBuilder;
|
|
import javax.persistence.criteria.CriteriaBuilder;
|
|
import javax.persistence.criteria.CriteriaQuery;
|
|
import javax.persistence.criteria.CriteriaQuery;
|
|
@@ -15,8 +20,18 @@ import org.springframework.data.jpa.domain.Specification;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import cn.com.qmth.stmms.biz.exam.model.*;
|
|
|
|
-import cn.com.qmth.stmms.biz.exam.service.*;
|
|
|
|
|
|
+import com.google.gson.Gson;
|
|
|
|
+
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.Exam;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.ExamSubject;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.MarkGroup;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.Marker;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.model.SubjectUser;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.ExamService;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.ExamSubjectService;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.MarkGroupService;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.MarkerService;
|
|
|
|
+import cn.com.qmth.stmms.biz.exam.service.SubjectUserService;
|
|
import cn.com.qmth.stmms.biz.user.dao.UserDao;
|
|
import cn.com.qmth.stmms.biz.user.dao.UserDao;
|
|
import cn.com.qmth.stmms.biz.user.model.User;
|
|
import cn.com.qmth.stmms.biz.user.model.User;
|
|
import cn.com.qmth.stmms.biz.user.service.UserService;
|
|
import cn.com.qmth.stmms.biz.user.service.UserService;
|
|
@@ -419,17 +434,17 @@ public class UserServiceImpl implements UserService {
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public int findMaxNumberByLoginNameStart(String prefix) {
|
|
public int findMaxNumberByLoginNameStart(String prefix) {
|
|
- int splitCount=prefix.split("-").length;
|
|
|
|
|
|
+ int splitCount = prefix.split("-").length;
|
|
List<User> list = userDao.findStartWithLoginName(prefix);
|
|
List<User> list = userDao.findStartWithLoginName(prefix);
|
|
int number = 0;
|
|
int number = 0;
|
|
for (User user : list) {
|
|
for (User user : list) {
|
|
try {
|
|
try {
|
|
String[] str = user.getLoginName().split("-");
|
|
String[] str = user.getLoginName().split("-");
|
|
- if(str.length==splitCount+1) {
|
|
|
|
- int no = Integer.parseInt(str[str.length - 1]);
|
|
|
|
- if (number < no) {
|
|
|
|
- number = no;
|
|
|
|
- }
|
|
|
|
|
|
+ if (str.length == splitCount + 1) {
|
|
|
|
+ int no = Integer.parseInt(str[str.length - 1]);
|
|
|
|
+ if (number < no) {
|
|
|
|
+ number = no;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
@@ -443,4 +458,26 @@ public class UserServiceImpl implements UserService {
|
|
return this.userDao.findByIdIn(ids);
|
|
return this.userDao.findByIdIn(ids);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Transactional
|
|
|
|
+ @Override
|
|
|
|
+ public void updateStudentCols(Integer id, Set<String> cols) {
|
|
|
|
+ if (cols == null) {
|
|
|
|
+ cols = new HashSet<>();
|
|
|
|
+ }
|
|
|
|
+ Gson gson = new Gson();
|
|
|
|
+ String jsonString = gson.toJson(cols);
|
|
|
|
+ userDao.updateStudentCols(id, jsonString);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Transactional
|
|
|
|
+ @Override
|
|
|
|
+ public void updateScoreCols(Integer id, Set<String> cols) {
|
|
|
|
+ if (cols == null) {
|
|
|
|
+ cols = new HashSet<>();
|
|
|
|
+ }
|
|
|
|
+ Gson gson = new Gson();
|
|
|
|
+ String jsonString = gson.toJson(cols);
|
|
|
|
+ userDao.updateScoreCols(id, jsonString);
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|