Эх сурвалжийг харах

学生底照:去掉FaceToken绑定和验证机制。

deason 11 сар өмнө
parent
commit
6946589ee3

+ 87 - 87
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/controller/FaceController.java

@@ -1,87 +1,87 @@
-package cn.com.qmth.examcloud.core.basic.api.controller;
-
-import cn.com.qmth.examcloud.commons.exception.StatusException;
-import cn.com.qmth.examcloud.core.basic.api.controller.bean.StudentFaceDomain;
-import cn.com.qmth.examcloud.core.basic.dao.StudentFaceRepo;
-import cn.com.qmth.examcloud.core.basic.dao.StudentRepo;
-import cn.com.qmth.examcloud.core.basic.dao.entity.FacesetEntity;
-import cn.com.qmth.examcloud.core.basic.dao.entity.StudentFaceEntity;
-import cn.com.qmth.examcloud.core.basic.service.FaceService;
-import cn.com.qmth.examcloud.core.basic.service.bean.StudentFaceInfo;
-import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
-import cn.com.qmth.examcloud.web.support.ControllerSupport;
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.*;
-
-import java.util.List;
-
-/**
- * 人脸接口<br>
- * 废弃 by wangwei 2019年9月2日
- *
- * @author WANGWEI
- * @date 2018年9月4日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-// @RestController
-@Api(tags = "学生人脸相关接口")
-@RequestMapping("${$rmp.ctr.basic}/face")
-public class FaceController extends ControllerSupport {
-
-    @Autowired
-    StudentFaceRepo studentFaceRepo;
-
-    @Autowired
-    StudentRepo studentRepo;
-
-    @Autowired
-    FaceService studentFaceService;
-
-    @ApiOperation(value = "保存学生人脸数据")
-    @PostMapping("saveStudentFace")
-    @Transactional
-    public StudentFaceEntity saveStudentFace(@RequestBody StudentFaceDomain req) {
-        StudentFaceInfo info = new StudentFaceInfo();
-        info.setFacesetToken(req.getFacesetToken());
-        info.setFaceToken(req.getFaceToken());
-        info.setOperator(req.getOperator());
-        info.setPhotoName(req.getPhotoName());
-        info.setRootOrgId(req.getRootOrgId());
-        info.setStudentId(req.getStudentId());
-        info.setFaceCount(req.getFaceCount());
-
-        StudentFaceEntity saved = studentFaceService.saveStudentFace(info);
-        return saved;
-    }
-
-    @ApiOperation(value = "获取可用的faceset集合")
-    @GetMapping("getUsableFacesetList")
-    public List<FacesetEntity> getUsableFacesetList() {
-
-        List<FacesetEntity> facesetList = studentFaceService.getUsableFacesetList();
-
-        return facesetList;
-    }
-
-    @ApiOperation(value = "获取学生人脸信息")
-    @GetMapping("studentFace/{studentId}")
-    public StudentFaceEntity getStudentFace(@PathVariable Long studentId) {
-
-        if (null == studentId) {
-            throw new StatusException("710001", "studentId is null");
-        }
-
-        StudentFaceEntity studentFaceEntity = GlobalHelper.getEntity(studentFaceRepo, studentId,
-                StudentFaceEntity.class);
-
-        if (null == studentFaceEntity) {
-            throw new StatusException("710001", "studentFaceEntity is null");
-        }
-
-        return studentFaceEntity;
-    }
-
-}
+// package cn.com.qmth.examcloud.core.basic.api.controller;
+//
+// import cn.com.qmth.examcloud.commons.exception.StatusException;
+// import cn.com.qmth.examcloud.core.basic.api.controller.bean.StudentFaceDomain;
+// import cn.com.qmth.examcloud.core.basic.dao.StudentFaceRepo;
+// import cn.com.qmth.examcloud.core.basic.dao.StudentRepo;
+// import cn.com.qmth.examcloud.core.basic.dao.entity.FacesetEntity;
+// import cn.com.qmth.examcloud.core.basic.dao.entity.StudentFaceEntity;
+// import cn.com.qmth.examcloud.core.basic.service.FaceService;
+// import cn.com.qmth.examcloud.core.basic.service.bean.StudentFaceInfo;
+// import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
+// import cn.com.qmth.examcloud.web.support.ControllerSupport;
+// import io.swagger.annotations.Api;
+// import io.swagger.annotations.ApiOperation;
+// import org.springframework.beans.factory.annotation.Autowired;
+// import org.springframework.transaction.annotation.Transactional;
+// import org.springframework.web.bind.annotation.*;
+//
+// import java.util.List;
+//
+// /**
+//  * 人脸接口<br>
+//  * 废弃 by wangwei 2019年9月2日
+//  *
+//  * @author WANGWEI
+//  * @date 2018年9月4日
+//  * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+//  */
+// // @RestController
+// @Api(tags = "学生人脸相关接口")
+// @RequestMapping("${$rmp.ctr.basic}/face")
+// public class FaceController extends ControllerSupport {
+//
+//     @Autowired
+//     StudentFaceRepo studentFaceRepo;
+//
+//     @Autowired
+//     StudentRepo studentRepo;
+//
+//     @Autowired
+//     FaceService studentFaceService;
+//
+//     @ApiOperation(value = "保存学生人脸数据")
+//     @PostMapping("saveStudentFace")
+//     @Transactional
+//     public StudentFaceEntity saveStudentFace(@RequestBody StudentFaceDomain req) {
+//         StudentFaceInfo info = new StudentFaceInfo();
+//         info.setFacesetToken(req.getFacesetToken());
+//         info.setFaceToken(req.getFaceToken());
+//         info.setOperator(req.getOperator());
+//         info.setPhotoName(req.getPhotoName());
+//         info.setRootOrgId(req.getRootOrgId());
+//         info.setStudentId(req.getStudentId());
+//         info.setFaceCount(req.getFaceCount());
+//
+//         StudentFaceEntity saved = studentFaceService.saveStudentFace(info);
+//         return saved;
+//     }
+//
+//     @ApiOperation(value = "获取可用的faceset集合")
+//     @GetMapping("getUsableFacesetList")
+//     public List<FacesetEntity> getUsableFacesetList() {
+//
+//         List<FacesetEntity> facesetList = studentFaceService.getUsableFacesetList();
+//
+//         return facesetList;
+//     }
+//
+//     @ApiOperation(value = "获取学生人脸信息")
+//     @GetMapping("studentFace/{studentId}")
+//     public StudentFaceEntity getStudentFace(@PathVariable Long studentId) {
+//
+//         if (null == studentId) {
+//             throw new StatusException("710001", "studentId is null");
+//         }
+//
+//         StudentFaceEntity studentFaceEntity = GlobalHelper.getEntity(studentFaceRepo, studentId,
+//                 StudentFaceEntity.class);
+//
+//         if (null == studentFaceEntity) {
+//             throw new StatusException("710001", "studentFaceEntity is null");
+//         }
+//
+//         return studentFaceEntity;
+//     }
+//
+// }

+ 89 - 103
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/provider/FaceCloudServiceProvider.java

@@ -1,36 +1,21 @@
 package cn.com.qmth.examcloud.core.basic.api.provider;
 
-import cn.com.qmth.examcloud.commons.exception.StatusException;
 import cn.com.qmth.examcloud.core.basic.api.FaceCloudService;
-import cn.com.qmth.examcloud.core.basic.api.bean.FacesetBean;
-import cn.com.qmth.examcloud.core.basic.api.bean.StudentFaceBean;
 import cn.com.qmth.examcloud.core.basic.api.request.GetStudentFaceReq;
 import cn.com.qmth.examcloud.core.basic.api.request.GetUsableFacesetListReq;
 import cn.com.qmth.examcloud.core.basic.api.request.SaveStudentFaceReq;
 import cn.com.qmth.examcloud.core.basic.api.response.GetStudentFaceResp;
 import cn.com.qmth.examcloud.core.basic.api.response.GetUsableFacesetListResp;
 import cn.com.qmth.examcloud.core.basic.api.response.SaveStudentFaceResp;
-import cn.com.qmth.examcloud.core.basic.dao.FacesetRepo;
-import cn.com.qmth.examcloud.core.basic.dao.StudentFaceRepo;
-import cn.com.qmth.examcloud.core.basic.dao.StudentRepo;
-import cn.com.qmth.examcloud.core.basic.dao.entity.FacesetEntity;
-import cn.com.qmth.examcloud.core.basic.dao.entity.StudentFaceEntity;
-import cn.com.qmth.examcloud.core.basic.service.FaceService;
-import cn.com.qmth.examcloud.core.basic.service.bean.StudentFaceInfo;
-import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
 import cn.com.qmth.examcloud.web.support.ControllerSupport;
-import com.google.common.collect.Lists;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
-import java.util.List;
-
 /**
  * 类注释
  *
@@ -45,112 +30,113 @@ public class FaceCloudServiceProvider extends ControllerSupport implements FaceC
 
     private static final long serialVersionUID = 8674317301051207328L;
 
-    @Autowired
-    StudentFaceRepo studentFaceRepo;
-
-    @Autowired
-    FacesetRepo facesetRepo;
-
-    @Autowired
-    StudentRepo studentRepo;
-
-    @Autowired
-    FaceService studentFaceService;
+    // @Autowired
+    // StudentFaceRepo studentFaceRepo;
+    //
+    // @Autowired
+    // FacesetRepo facesetRepo;
+    //
+    // @Autowired
+    // StudentRepo studentRepo;
+    //
+    // @Autowired
+    // FaceService studentFaceService;
 
     @ApiOperation(value = "保存学生人脸数据")
     @PostMapping("saveStudentFace")
     @Transactional
     @Override
     public SaveStudentFaceResp saveStudentFace(@RequestBody SaveStudentFaceReq req) {
-        trim(req);
-        StudentFaceInfo info = new StudentFaceInfo();
-        info.setFacesetToken(req.getFacesetToken());
-        info.setFaceToken(req.getFaceToken());
-        info.setOperator(req.getOperator());
-        info.setPhotoName(req.getPhotoName());
-        info.setRootOrgId(req.getRootOrgId());
-        info.setStudentId(req.getStudentId());
-        info.setFaceCount(req.getFaceCount());
-        info.setPhotoTreatyPath(req.getPhotoTreatyPath());
-
-        StudentFaceEntity saved = studentFaceService.saveStudentFace(info);
-        SaveStudentFaceResp resp = new SaveStudentFaceResp();
-        resp.setId(saved.getStudentId());
-        return resp;
+        // trim(req);
+        // StudentFaceInfo info = new StudentFaceInfo();
+        // info.setFacesetToken(req.getFacesetToken());
+        // info.setFaceToken(req.getFaceToken());
+        // info.setOperator(req.getOperator());
+        // info.setPhotoName(req.getPhotoName());
+        // info.setRootOrgId(req.getRootOrgId());
+        // info.setStudentId(req.getStudentId());
+        // info.setFaceCount(req.getFaceCount());
+        // info.setPhotoTreatyPath(req.getPhotoTreatyPath());
+        //
+        // StudentFaceEntity saved = studentFaceService.saveStudentFace(info);
+        // SaveStudentFaceResp resp = new SaveStudentFaceResp();
+        // resp.setId(saved.getStudentId());
+        // return resp;
+        return new SaveStudentFaceResp();
     }
 
     @ApiOperation(value = "获取可用的faceset集合")
     @PostMapping("getUsableFacesetList")
     @Override
     public GetUsableFacesetListResp getUsableFacesetList(@RequestBody GetUsableFacesetListReq req) {
-
-        List<FacesetEntity> facesetList = studentFaceService.getUsableFacesetList();
-
-        List<FacesetBean> list = Lists.newArrayList();
-
-        for (FacesetEntity cur : facesetList) {
-            FacesetBean bean = new FacesetBean();
-            list.add(bean);
-
-            bean.setDisplayName(cur.getDisplayName());
-            bean.setFaceCount(cur.getFaceCount());
-            bean.setFacesetToken(cur.getFacesetToken());
-            bean.setId(cur.getId());
-            bean.setOuterId(cur.getOuterId());
-            bean.setTags(cur.getTags());
-        }
-
-        GetUsableFacesetListResp resp = new GetUsableFacesetListResp();
-        resp.setFacesetBeanList(list);
-        return resp;
+        // List<FacesetEntity> facesetList = studentFaceService.getUsableFacesetList();
+        //
+        // List<FacesetBean> list = Lists.newArrayList();
+        // for (FacesetEntity cur : facesetList) {
+        //     FacesetBean bean = new FacesetBean();
+        //     list.add(bean);
+        //
+        //     bean.setDisplayName(cur.getDisplayName());
+        //     bean.setFaceCount(cur.getFaceCount());
+        //     bean.setFacesetToken(cur.getFacesetToken());
+        //     bean.setId(cur.getId());
+        //     bean.setOuterId(cur.getOuterId());
+        //     bean.setTags(cur.getTags());
+        // }
+        //
+        // GetUsableFacesetListResp resp = new GetUsableFacesetListResp();
+        // resp.setFacesetBeanList(list);
+        // return resp;
+        return new GetUsableFacesetListResp();
     }
 
     @ApiOperation(value = "获取学生人脸数据")
     @PostMapping("getStudentFace")
     @Override
     public GetStudentFaceResp getStudentFace(@RequestBody GetStudentFaceReq req) {
-        Long studentId = req.getStudentId();
-
-        if (null == studentId) {
-            throw new StatusException("710001", "studentId is null");
-        }
-
-        StudentFaceEntity studentFaceEntity = GlobalHelper.getEntity(studentFaceRepo, studentId,
-                StudentFaceEntity.class);
-
-        if (null == studentFaceEntity) {
-            throw new StatusException("710001", "studentFaceEntity is null");
-        }
-
-        StudentFaceBean studentFaceBean = new StudentFaceBean();
-
-        studentFaceBean.setCreator(studentFaceEntity.getCreator());
-        studentFaceBean.setFacesetId(studentFaceEntity.getFacesetId());
-        studentFaceBean.setFaceToken(studentFaceEntity.getFaceToken());
-        studentFaceBean.setModifiedBy(studentFaceEntity.getModifiedBy());
-        studentFaceBean.setStudentId(studentFaceEntity.getStudentId());
-
-        GetStudentFaceResp resp = new GetStudentFaceResp();
-        resp.setStudentFaceBean(studentFaceBean);
-
-        if (null != studentFaceEntity.getFacesetId()) {
-            FacesetEntity facesetEntity = GlobalHelper.getEntity(facesetRepo,
-                    studentFaceEntity.getFacesetId(), FacesetEntity.class);
-            if (null != facesetEntity) {
-                FacesetBean facesetBean = new FacesetBean();
-                facesetBean.setDisplayName(facesetEntity.getDisplayName());
-                facesetBean.setFaceCount(facesetEntity.getFaceCount());
-                facesetBean.setFacesetToken(facesetEntity.getFacesetToken());
-                facesetBean.setId(facesetEntity.getId());
-                facesetBean.setOuterId(facesetEntity.getOuterId());
-                facesetBean.setTags(facesetEntity.getTags());
-
-                resp.setFacesetBean(facesetBean);
-            }
-
-        }
-
-        return resp;
+        // Long studentId = req.getStudentId();
+        //
+        // if (null == studentId) {
+        //     throw new StatusException("710001", "studentId is null");
+        // }
+        //
+        // StudentFaceEntity studentFaceEntity = GlobalHelper.getEntity(studentFaceRepo, studentId,
+        //         StudentFaceEntity.class);
+        //
+        // if (null == studentFaceEntity) {
+        //     throw new StatusException("710001", "studentFaceEntity is null");
+        // }
+        //
+        // StudentFaceBean studentFaceBean = new StudentFaceBean();
+        //
+        // studentFaceBean.setCreator(studentFaceEntity.getCreator());
+        // studentFaceBean.setFacesetId(studentFaceEntity.getFacesetId());
+        // studentFaceBean.setFaceToken(studentFaceEntity.getFaceToken());
+        // studentFaceBean.setModifiedBy(studentFaceEntity.getModifiedBy());
+        // studentFaceBean.setStudentId(studentFaceEntity.getStudentId());
+        //
+        // GetStudentFaceResp resp = new GetStudentFaceResp();
+        // resp.setStudentFaceBean(studentFaceBean);
+        //
+        // if (null != studentFaceEntity.getFacesetId()) {
+        //     FacesetEntity facesetEntity = GlobalHelper.getEntity(facesetRepo,
+        //             studentFaceEntity.getFacesetId(), FacesetEntity.class);
+        //     if (null != facesetEntity) {
+        //         FacesetBean facesetBean = new FacesetBean();
+        //         facesetBean.setDisplayName(facesetEntity.getDisplayName());
+        //         facesetBean.setFaceCount(facesetEntity.getFaceCount());
+        //         facesetBean.setFacesetToken(facesetEntity.getFacesetToken());
+        //         facesetBean.setId(facesetEntity.getId());
+        //         facesetBean.setOuterId(facesetEntity.getOuterId());
+        //         facesetBean.setTags(facesetEntity.getTags());
+        //
+        //         resp.setFacesetBean(facesetBean);
+        //     }
+        //
+        // }
+        //
+        // return resp;
+        return new GetStudentFaceResp();
     }
 
 }

+ 35 - 35
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/FaceService.java

@@ -1,35 +1,35 @@
-package cn.com.qmth.examcloud.core.basic.service;
-
-import java.util.List;
-
-import cn.com.qmth.examcloud.core.basic.dao.entity.FacesetEntity;
-import cn.com.qmth.examcloud.core.basic.dao.entity.StudentFaceEntity;
-import cn.com.qmth.examcloud.core.basic.service.bean.StudentFaceInfo;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年9月3日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-public interface FaceService {
-
-	/**
-	 * 保存学生人脸信息
-	 *
-	 * @author WANGWEI
-	 * @param info
-	 * @return
-	 */
-	StudentFaceEntity saveStudentFace(StudentFaceInfo info);
-
-	/**
-	 * 获取可用的facecset集合
-	 *
-	 * @author WANGWEI
-	 * @return
-	 */
-	List<FacesetEntity> getUsableFacesetList();
-
-}
+// package cn.com.qmth.examcloud.core.basic.service;
+//
+// import java.util.List;
+//
+// import cn.com.qmth.examcloud.core.basic.dao.entity.FacesetEntity;
+// import cn.com.qmth.examcloud.core.basic.dao.entity.StudentFaceEntity;
+// import cn.com.qmth.examcloud.core.basic.service.bean.StudentFaceInfo;
+//
+// /**
+//  * 类注释
+//  *
+//  * @author WANGWEI
+//  * @date 2018年9月3日
+//  * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+//  */
+// public interface FaceService {
+//
+// 	/**
+// 	 * 保存学生人脸信息
+// 	 *
+// 	 * @author WANGWEI
+// 	 * @param info
+// 	 * @return
+// 	 */
+// 	StudentFaceEntity saveStudentFace(StudentFaceInfo info);
+//
+// 	/**
+// 	 * 获取可用的facecset集合
+// 	 *
+// 	 * @author WANGWEI
+// 	 * @return
+// 	 */
+// 	List<FacesetEntity> getUsableFacesetList();
+//
+// }

+ 168 - 168
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/FaceServiceImpl.java

@@ -1,168 +1,168 @@
-package cn.com.qmth.examcloud.core.basic.service.impl;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.persistence.criteria.Predicate;
-
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.PageRequest;
-import org.springframework.data.domain.Sort;
-import org.springframework.data.domain.Sort.Direction;
-import org.springframework.data.jpa.domain.Specification;
-import org.springframework.stereotype.Service;
-
-import com.google.common.collect.Lists;
-
-import cn.com.qmth.examcloud.commons.exception.StatusException;
-import cn.com.qmth.examcloud.core.basic.dao.FacesetRepo;
-import cn.com.qmth.examcloud.core.basic.dao.StudentFaceRepo;
-import cn.com.qmth.examcloud.core.basic.dao.StudentRepo;
-import cn.com.qmth.examcloud.core.basic.dao.entity.FacesetEntity;
-import cn.com.qmth.examcloud.core.basic.dao.entity.StudentEntity;
-import cn.com.qmth.examcloud.core.basic.dao.entity.StudentFaceEntity;
-import cn.com.qmth.examcloud.core.basic.service.FaceService;
-import cn.com.qmth.examcloud.core.basic.service.bean.StudentFaceInfo;
-import cn.com.qmth.examcloud.core.basic.service.cache.StudentCache;
-import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
-
-/**
- * 类注释
- *
- * @author WANGWEI
- * @date 2018年9月3日
- * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
- */
-@Service
-public class FaceServiceImpl implements FaceService {
-
-	@Autowired
-	StudentFaceRepo studentFaceRepo;
-
-	@Autowired
-	FacesetRepo facesetRepo;
-
-	@Autowired
-	StudentRepo studentRepo;
-
-	@Autowired
-	StudentCache studentCache;
-
-	@Override
-	public StudentFaceEntity saveStudentFace(StudentFaceInfo info) {
-		String facesetToken = info.getFacesetToken();
-		String faceToken = info.getFaceToken();
-		String operator = info.getOperator();
-		String photoName = info.getPhotoName();
-		Long rootOrgId = info.getRootOrgId();
-		Long studentId = info.getStudentId();
-		Long faceCount = info.getFaceCount();
-
-		if (null == studentId) {
-			throw new StatusException("680001", "studentId is null");
-		}
-		if (null == rootOrgId) {
-			throw new StatusException("680002", "rootOrgId is null");
-		}
-		if (StringUtils.isBlank(facesetToken)) {
-			throw new StatusException("680003", "facesetToken is null");
-		}
-		if (StringUtils.isBlank(faceToken)) {
-			throw new StatusException("680004", "faceToken is null");
-		}
-		if (StringUtils.isBlank(operator)) {
-			throw new StatusException("680005", "operator is null");
-		}
-		if (StringUtils.isBlank(photoName)) {
-			throw new StatusException("680006", "photoName is null");
-		}
-		if (!photoName.matches("\\w+\\.\\w+")) {
-			throw new StatusException("680006", "photoName is wrong");
-		}
-		
-		if (StringUtils.isBlank(photoName)) {
-			throw new StatusException("680015", "photoTreatyPath is null");
-		}
-
-		if (null == faceCount) {
-			throw new StatusException("680008", "faceCount is null");
-		}
-		if (1 > faceCount) {
-			throw new StatusException("680013", "faceCount is less than 1");
-		}
-
-		StudentEntity studentEntity = GlobalHelper.getEntity(studentRepo, studentId,
-				StudentEntity.class);
-
-		if (null == studentEntity) {
-			throw new StatusException("680009", "studentEntity is null");
-		}
-
-		if (!studentEntity.getRootOrgId().equals(rootOrgId)) {
-			throw new StatusException("680010", "studentId,rootOrgId is not matched");
-		}
-
-		FacesetEntity facesetEntity = facesetRepo.findByFacesetToken(facesetToken);
-		if (null == facesetEntity) {
-			throw new StatusException("680011", "facesetEntity is null");
-		}
-
-//		String photoPath = rootOrgId + "/" + studentId + "/" + photoName;
-		String photoPath =info.getPhotoTreatyPath();
-		studentEntity.setPhotoPath(photoPath);
-
-		StudentFaceEntity studentFaceEntity = GlobalHelper.getEntity(studentFaceRepo, studentId,
-				StudentFaceEntity.class);
-		if (null == studentFaceEntity) {
-			studentFaceEntity = new StudentFaceEntity();
-			studentFaceEntity.setStudentId(studentId);
-			studentFaceEntity.setCreator(operator);
-		}
-
-		studentFaceEntity.setFacesetId(facesetEntity.getId());
-		studentFaceEntity.setFaceToken(faceToken);
-		studentFaceEntity.setModifiedBy(operator);
-
-		if (null == facesetEntity.getFaceCount() || facesetEntity.getFaceCount() < faceCount) {
-			facesetEntity.setFaceCount(faceCount);
-		}
-
-		facesetRepo.save(facesetEntity);
-		studentRepo.save(studentEntity);
-		StudentFaceEntity saved = studentFaceRepo.save(studentFaceEntity);
-
-		studentCache.remove(studentId);
-
-		return saved;
-	}
-
-	@Override
-	public List<FacesetEntity> getUsableFacesetList() {
-
-		Specification<FacesetEntity> specification = (root, query, cb) -> {
-			List<Predicate> predicates = new ArrayList<>();
-			predicates.add(cb.lessThan(root.get("faceCount"), 8000));
-			predicates.add(cb.equal(root.get("enable"), true));
-
-			return cb.and(predicates.toArray(new Predicate[predicates.size()]));
-		};
-
-		PageRequest pageRequest = PageRequest.of(0, 10, Sort.by(Direction.DESC, "updateTime"));
-
-		Page<FacesetEntity> studentList = facesetRepo.findAll(specification, pageRequest);
-
-		Iterator<FacesetEntity> iterator = studentList.iterator();
-
-		List<FacesetEntity> list = Lists.newArrayList();
-
-		while (iterator.hasNext()) {
-			list.add(iterator.next());
-		}
-
-		return list;
-	}
-
-}
+// package cn.com.qmth.examcloud.core.basic.service.impl;
+//
+// import java.util.ArrayList;
+// import java.util.Iterator;
+// import java.util.List;
+//
+// import javax.persistence.criteria.Predicate;
+//
+// import org.apache.commons.lang3.StringUtils;
+// import org.springframework.beans.factory.annotation.Autowired;
+// import org.springframework.data.domain.Page;
+// import org.springframework.data.domain.PageRequest;
+// import org.springframework.data.domain.Sort;
+// import org.springframework.data.domain.Sort.Direction;
+// import org.springframework.data.jpa.domain.Specification;
+// import org.springframework.stereotype.Service;
+//
+// import com.google.common.collect.Lists;
+//
+// import cn.com.qmth.examcloud.commons.exception.StatusException;
+// import cn.com.qmth.examcloud.core.basic.dao.FacesetRepo;
+// import cn.com.qmth.examcloud.core.basic.dao.StudentFaceRepo;
+// import cn.com.qmth.examcloud.core.basic.dao.StudentRepo;
+// import cn.com.qmth.examcloud.core.basic.dao.entity.FacesetEntity;
+// import cn.com.qmth.examcloud.core.basic.dao.entity.StudentEntity;
+// import cn.com.qmth.examcloud.core.basic.dao.entity.StudentFaceEntity;
+// import cn.com.qmth.examcloud.core.basic.service.FaceService;
+// import cn.com.qmth.examcloud.core.basic.service.bean.StudentFaceInfo;
+// import cn.com.qmth.examcloud.core.basic.service.cache.StudentCache;
+// import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
+//
+// /**
+//  * 类注释
+//  *
+//  * @author WANGWEI
+//  * @date 2018年9月3日
+//  * @Copyright (c) 2018-? http://qmth.com.cn All Rights Reserved.
+//  */
+// @Service
+// public class FaceServiceImpl implements FaceService {
+//
+// 	@Autowired
+// 	StudentFaceRepo studentFaceRepo;
+//
+// 	@Autowired
+// 	FacesetRepo facesetRepo;
+//
+// 	@Autowired
+// 	StudentRepo studentRepo;
+//
+// 	@Autowired
+// 	StudentCache studentCache;
+//
+// 	@Override
+// 	public StudentFaceEntity saveStudentFace(StudentFaceInfo info) {
+// 		String facesetToken = info.getFacesetToken();
+// 		String faceToken = info.getFaceToken();
+// 		String operator = info.getOperator();
+// 		String photoName = info.getPhotoName();
+// 		Long rootOrgId = info.getRootOrgId();
+// 		Long studentId = info.getStudentId();
+// 		Long faceCount = info.getFaceCount();
+//
+// 		if (null == studentId) {
+// 			throw new StatusException("680001", "studentId is null");
+// 		}
+// 		if (null == rootOrgId) {
+// 			throw new StatusException("680002", "rootOrgId is null");
+// 		}
+// 		if (StringUtils.isBlank(facesetToken)) {
+// 			throw new StatusException("680003", "facesetToken is null");
+// 		}
+// 		if (StringUtils.isBlank(faceToken)) {
+// 			throw new StatusException("680004", "faceToken is null");
+// 		}
+// 		if (StringUtils.isBlank(operator)) {
+// 			throw new StatusException("680005", "operator is null");
+// 		}
+// 		if (StringUtils.isBlank(photoName)) {
+// 			throw new StatusException("680006", "photoName is null");
+// 		}
+// 		if (!photoName.matches("\\w+\\.\\w+")) {
+// 			throw new StatusException("680006", "photoName is wrong");
+// 		}
+//
+// 		if (StringUtils.isBlank(photoName)) {
+// 			throw new StatusException("680015", "photoTreatyPath is null");
+// 		}
+//
+// 		if (null == faceCount) {
+// 			throw new StatusException("680008", "faceCount is null");
+// 		}
+// 		if (1 > faceCount) {
+// 			throw new StatusException("680013", "faceCount is less than 1");
+// 		}
+//
+// 		StudentEntity studentEntity = GlobalHelper.getEntity(studentRepo, studentId,
+// 				StudentEntity.class);
+//
+// 		if (null == studentEntity) {
+// 			throw new StatusException("680009", "studentEntity is null");
+// 		}
+//
+// 		if (!studentEntity.getRootOrgId().equals(rootOrgId)) {
+// 			throw new StatusException("680010", "studentId,rootOrgId is not matched");
+// 		}
+//
+// 		FacesetEntity facesetEntity = facesetRepo.findByFacesetToken(facesetToken);
+// 		if (null == facesetEntity) {
+// 			throw new StatusException("680011", "facesetEntity is null");
+// 		}
+//
+// //		String photoPath = rootOrgId + "/" + studentId + "/" + photoName;
+// 		String photoPath =info.getPhotoTreatyPath();
+// 		studentEntity.setPhotoPath(photoPath);
+//
+// 		StudentFaceEntity studentFaceEntity = GlobalHelper.getEntity(studentFaceRepo, studentId,
+// 				StudentFaceEntity.class);
+// 		if (null == studentFaceEntity) {
+// 			studentFaceEntity = new StudentFaceEntity();
+// 			studentFaceEntity.setStudentId(studentId);
+// 			studentFaceEntity.setCreator(operator);
+// 		}
+//
+// 		studentFaceEntity.setFacesetId(facesetEntity.getId());
+// 		studentFaceEntity.setFaceToken(faceToken);
+// 		studentFaceEntity.setModifiedBy(operator);
+//
+// 		if (null == facesetEntity.getFaceCount() || facesetEntity.getFaceCount() < faceCount) {
+// 			facesetEntity.setFaceCount(faceCount);
+// 		}
+//
+// 		facesetRepo.save(facesetEntity);
+// 		studentRepo.save(studentEntity);
+// 		StudentFaceEntity saved = studentFaceRepo.save(studentFaceEntity);
+//
+// 		studentCache.remove(studentId);
+//
+// 		return saved;
+// 	}
+//
+// 	@Override
+// 	public List<FacesetEntity> getUsableFacesetList() {
+//
+// 		Specification<FacesetEntity> specification = (root, query, cb) -> {
+// 			List<Predicate> predicates = new ArrayList<>();
+// 			predicates.add(cb.lessThan(root.get("faceCount"), 8000));
+// 			predicates.add(cb.equal(root.get("enable"), true));
+//
+// 			return cb.and(predicates.toArray(new Predicate[predicates.size()]));
+// 		};
+//
+// 		PageRequest pageRequest = PageRequest.of(0, 10, Sort.by(Direction.DESC, "updateTime"));
+//
+// 		Page<FacesetEntity> studentList = facesetRepo.findAll(specification, pageRequest);
+//
+// 		Iterator<FacesetEntity> iterator = studentList.iterator();
+//
+// 		List<FacesetEntity> list = Lists.newArrayList();
+//
+// 		while (iterator.hasNext()) {
+// 			list.add(iterator.next());
+// 		}
+//
+// 		return list;
+// 	}
+//
+// }