wangwei 6 年之前
父節點
當前提交
0db768c6d9

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

@@ -77,24 +77,31 @@ public class FaceServiceImpl implements FaceService {
 		}
 
 		if (StringUtils.isBlank(photoName)) {
-			throw new StatusException("B-680006", "photoName is null");
+			throw new StatusException("B-680007", "photoName is null");
+		}
+
+		if (null == faceCount) {
+			throw new StatusException("B-680008", "faceCount is null");
+		}
+		if (1 > faceCount) {
+			throw new StatusException("B-680013", "faceCount is less than 1");
 		}
 
 		StudentEntity studentEntity = studentRepo.findOne(studentId);
 
 		if (null == studentEntity) {
-			throw new StatusException("B-680007", "studentEntity is null");
+			throw new StatusException("B-680009", "studentEntity is null");
 		}
 
 		if (!studentEntity.getRootOrgId().equals(rootOrgId)) {
-			throw new StatusException("B-680008", "studentId,rootOrgId is not matched");
+			throw new StatusException("B-680010", "studentId,rootOrgId is not matched");
 		}
 
 		String identityNumber = studentEntity.getIdentityNumber();
 
 		FacesetEntity facesetEntity = facesetRepo.findByFacesetToken(facesetToken);
 		if (null == facesetEntity) {
-			throw new StatusException("B-680003", "facesetEntity is null");
+			throw new StatusException("B-680011", "facesetEntity is null");
 		}
 
 		String photoPath = rootOrgId + "/" + UrlUtil.encode(identityNumber) + "/" + photoName;
@@ -111,7 +118,7 @@ public class FaceServiceImpl implements FaceService {
 		studentFaceEntity.setFaceToken(faceToken);
 		studentFaceEntity.setModifiedBy(operator);
 
-		if (facesetEntity.getFaceCount() < faceCount) {
+		if (null == facesetEntity.getFaceCount() || facesetEntity.getFaceCount() < faceCount) {
 			facesetEntity.setFaceCount(faceCount);
 		}