|
@@ -69,7 +69,7 @@ public class FaceOuterServiceProvider extends ControllerSupport implements FaceO
|
|
@RequestParam @ApiParam(value = "操作者", required = true) String operator) {
|
|
@RequestParam @ApiParam(value = "操作者", required = true) String operator) {
|
|
|
|
|
|
if (!getSecurityRootOrgId().equals(rootOrgId)) {
|
|
if (!getSecurityRootOrgId().equals(rootOrgId)) {
|
|
- throw new StatusException("EX-1000001", "rootOrgId is wrong");
|
|
|
|
|
|
+ throw new StatusException("1000001", "rootOrgId is wrong");
|
|
}
|
|
}
|
|
|
|
|
|
if (photoUrl.startsWith("http")) {
|
|
if (photoUrl.startsWith("http")) {
|
|
@@ -77,7 +77,7 @@ public class FaceOuterServiceProvider extends ControllerSupport implements FaceO
|
|
|
|
|
|
int lastIndexOf = photoUrl.lastIndexOf(".");
|
|
int lastIndexOf = photoUrl.lastIndexOf(".");
|
|
if (0 > lastIndexOf) {
|
|
if (0 > lastIndexOf) {
|
|
- throw new StatusException("EX-100002",
|
|
|
|
|
|
+ throw new StatusException("100002",
|
|
"photoPath is not end with photo file suffix.");
|
|
"photoPath is not end with photo file suffix.");
|
|
}
|
|
}
|
|
String fileSuffix = photoUrl.substring(lastIndexOf);
|
|
String fileSuffix = photoUrl.substring(lastIndexOf);
|
|
@@ -89,7 +89,7 @@ public class FaceOuterServiceProvider extends ControllerSupport implements FaceO
|
|
try {
|
|
try {
|
|
FileUtils.writeByteArrayToFile(temp, bs);
|
|
FileUtils.writeByteArrayToFile(temp, bs);
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
- throw new StatusException("EX-100003", "文件读写失败");
|
|
|
|
|
|
+ throw new StatusException("100003", "文件读写失败");
|
|
}
|
|
}
|
|
|
|
|
|
faceService.processFace(rootOrgId, identityNumber, fileSuffix, temp, operator);
|
|
faceService.processFace(rootOrgId, identityNumber, fileSuffix, temp, operator);
|
|
@@ -107,7 +107,7 @@ public class FaceOuterServiceProvider extends ControllerSupport implements FaceO
|
|
@RequestParam @ApiParam(value = "学生照片文件(文件名称=身份证号码+文件后缀) 如:xxxxxxxxxx.jpg", required = true) CommonsMultipartFile file) {
|
|
@RequestParam @ApiParam(value = "学生照片文件(文件名称=身份证号码+文件后缀) 如:xxxxxxxxxx.jpg", required = true) CommonsMultipartFile file) {
|
|
|
|
|
|
if (!getSecurityRootOrgId().equals(rootOrgId)) {
|
|
if (!getSecurityRootOrgId().equals(rootOrgId)) {
|
|
- throw new StatusException("EX-1000001", "rootOrgId is wrong");
|
|
|
|
|
|
+ throw new StatusException("1000001", "rootOrgId is wrong");
|
|
}
|
|
}
|
|
|
|
|
|
DiskFileItem item = (DiskFileItem) file.getFileItem();
|
|
DiskFileItem item = (DiskFileItem) file.getFileItem();
|
|
@@ -115,11 +115,11 @@ public class FaceOuterServiceProvider extends ControllerSupport implements FaceO
|
|
String fileName = file.getOriginalFilename();
|
|
String fileName = file.getOriginalFilename();
|
|
|
|
|
|
if (StringUtils.containsWhitespace(fileName)) {
|
|
if (StringUtils.containsWhitespace(fileName)) {
|
|
- throw new StatusException("EX-600100", "文件名不能含有空白字符");
|
|
|
|
|
|
+ throw new StatusException("600100", "文件名不能含有空白字符");
|
|
}
|
|
}
|
|
|
|
|
|
if (!fileName.matches("[^\\.\\s]+\\.[^\\.\\s]+")) {
|
|
if (!fileName.matches("[^\\.\\s]+\\.[^\\.\\s]+")) {
|
|
- throw new StatusException("EX-600101", "文件名不合法");
|
|
|
|
|
|
+ throw new StatusException("600101", "文件名不合法");
|
|
}
|
|
}
|
|
String fileSuffix = fileName.substring(fileName.lastIndexOf("."));
|
|
String fileSuffix = fileName.substring(fileName.lastIndexOf("."));
|
|
|
|
|
|
@@ -135,7 +135,7 @@ public class FaceOuterServiceProvider extends ControllerSupport implements FaceO
|
|
@RequestParam @ApiParam(value = "学生照片文件(身份证号码+文件后缀)压缩包(ZIP文件,压缩包内不含目录)", required = true) CommonsMultipartFile file) {
|
|
@RequestParam @ApiParam(value = "学生照片文件(身份证号码+文件后缀)压缩包(ZIP文件,压缩包内不含目录)", required = true) CommonsMultipartFile file) {
|
|
|
|
|
|
if (!getSecurityRootOrgId().equals(rootOrgId)) {
|
|
if (!getSecurityRootOrgId().equals(rootOrgId)) {
|
|
- throw new StatusException("EX-1000001", "rootOrgId is wrong");
|
|
|
|
|
|
+ throw new StatusException("1000001", "rootOrgId is wrong");
|
|
}
|
|
}
|
|
|
|
|
|
DiskFileItem item = (DiskFileItem) file.getFileItem();
|
|
DiskFileItem item = (DiskFileItem) file.getFileItem();
|
|
@@ -143,11 +143,11 @@ public class FaceOuterServiceProvider extends ControllerSupport implements FaceO
|
|
String filename = file.getOriginalFilename();
|
|
String filename = file.getOriginalFilename();
|
|
|
|
|
|
if (!filename.endsWith(".zip")) {
|
|
if (!filename.endsWith(".zip")) {
|
|
- throw new StatusException("EX-620001", "文件格式不正确,必须是zip格式的压缩包");
|
|
|
|
|
|
+ throw new StatusException("620001", "文件格式不正确,必须是zip格式的压缩包");
|
|
}
|
|
}
|
|
// 文件大小限制
|
|
// 文件大小限制
|
|
if (file.getSize() > ZIP_MAX_SIZE * 1024 * 1024) {
|
|
if (file.getSize() > ZIP_MAX_SIZE * 1024 * 1024) {
|
|
- throw new StatusException("EX-620002", "文件大小超过50M,请分批导入");
|
|
|
|
|
|
+ throw new StatusException("620002", "文件大小超过50M,请分批导入");
|
|
}
|
|
}
|
|
|
|
|
|
List<Map<String, String>> ret = Lists.newArrayList();
|
|
List<Map<String, String>> ret = Lists.newArrayList();
|
|
@@ -158,13 +158,13 @@ public class FaceOuterServiceProvider extends ControllerSupport implements FaceO
|
|
try {
|
|
try {
|
|
ZipUtil.unzip(storeLocation, new File(tempDirPath));
|
|
ZipUtil.unzip(storeLocation, new File(tempDirPath));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- throw new StatusException("EX-620003", "zip文件损坏");
|
|
|
|
|
|
+ throw new StatusException("620003", "zip文件损坏");
|
|
}
|
|
}
|
|
|
|
|
|
File[] files = tempDir.listFiles();
|
|
File[] files = tempDir.listFiles();
|
|
|
|
|
|
if (null == files) {
|
|
if (null == files) {
|
|
- throw new StatusException("EX-620004", "zip文件为空");
|
|
|
|
|
|
+ throw new StatusException("620004", "zip文件为空");
|
|
}
|
|
}
|
|
|
|
|
|
for (File f : files) {
|
|
for (File f : files) {
|
|
@@ -180,11 +180,11 @@ public class FaceOuterServiceProvider extends ControllerSupport implements FaceO
|
|
}
|
|
}
|
|
try {
|
|
try {
|
|
if (StringUtils.containsWhitespace(fileName)) {
|
|
if (StringUtils.containsWhitespace(fileName)) {
|
|
- throw new StatusException("EX-600100", "文件名不能含有空白字符");
|
|
|
|
|
|
+ throw new StatusException("600100", "文件名不能含有空白字符");
|
|
}
|
|
}
|
|
|
|
|
|
if (!fileName.matches("[^\\.\\s]+\\.[^\\.\\s]+")) {
|
|
if (!fileName.matches("[^\\.\\s]+\\.[^\\.\\s]+")) {
|
|
- throw new StatusException("EX-600101", "文件名不合法");
|
|
|
|
|
|
+ throw new StatusException("600101", "文件名不合法");
|
|
}
|
|
}
|
|
String identityNumber = fileName.substring(0, fileName.lastIndexOf("."));
|
|
String identityNumber = fileName.substring(0, fileName.lastIndexOf("."));
|
|
String fileSuffix = fileName.substring(fileName.lastIndexOf("."));
|
|
String fileSuffix = fileName.substring(fileName.lastIndexOf("."));
|