|
@@ -4,8 +4,10 @@ import java.util.Date;
|
|
|
|
|
|
import javax.transaction.Transactional;
|
|
import javax.transaction.Transactional;
|
|
|
|
|
|
|
|
+import cn.com.qmth.examcloud.common.uac.entity.AccessUser;
|
|
import cn.com.qmth.examcloud.service.core.entity.Student;
|
|
import cn.com.qmth.examcloud.service.core.entity.Student;
|
|
import cn.com.qmth.examcloud.service.core.repo.StudentRepo;
|
|
import cn.com.qmth.examcloud.service.core.repo.StudentRepo;
|
|
|
|
+
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -23,7 +25,7 @@ public class StudentFaceInfoService {
|
|
StudentRepo studentRepo;
|
|
StudentRepo studentRepo;
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
- public StudentFaceInfo save(StudentFaceInfo studentFaceInfo) {
|
|
|
|
|
|
+ public StudentFaceInfo save(StudentFaceInfo studentFaceInfo,AccessUser accessUser) {
|
|
StudentFaceInfo old = studentFaceInfoRepo.findByStudentId(studentFaceInfo.getStudent().getId());
|
|
StudentFaceInfo old = studentFaceInfoRepo.findByStudentId(studentFaceInfo.getStudent().getId());
|
|
|
|
|
|
Student student = studentRepo.findOne(studentFaceInfo.getStudent().getId());
|
|
Student student = studentRepo.findOne(studentFaceInfo.getStudent().getId());
|
|
@@ -31,11 +33,14 @@ public class StudentFaceInfoService {
|
|
student.setPhotoPath(student.getIdentityNumber()+"/"+studentFaceInfo.getPhotoMD5());
|
|
student.setPhotoPath(student.getIdentityNumber()+"/"+studentFaceInfo.getPhotoMD5());
|
|
studentRepo.save(student);
|
|
studentRepo.save(student);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if(old == null){
|
|
if(old == null){
|
|
studentFaceInfo.setCreateTime(new Date());
|
|
studentFaceInfo.setCreateTime(new Date());
|
|
return studentFaceInfoRepo.save(studentFaceInfo);
|
|
return studentFaceInfoRepo.save(studentFaceInfo);
|
|
}
|
|
}
|
|
|
|
+ if(accessUser!=null){
|
|
|
|
+ studentFaceInfo.setUpdateUser(accessUser.getName());
|
|
|
|
+ }
|
|
old.setUpdateTime(new Date());
|
|
old.setUpdateTime(new Date());
|
|
old.setFaceSetToken(studentFaceInfo.getFaceSetToken());
|
|
old.setFaceSetToken(studentFaceInfo.getFaceSetToken());
|
|
old.setFaceToken(studentFaceInfo.getFaceToken());
|
|
old.setFaceToken(studentFaceInfo.getFaceToken());
|