|
@@ -120,7 +120,9 @@ public class LapiServiceImpl implements ILapiService {
|
|
map3.put("FaceID", personInfo.getId());
|
|
map3.put("FaceID", personInfo.getId());
|
|
map3.put("Name", personInfo.getId() + ".jpg");
|
|
map3.put("Name", personInfo.getId() + ".jpg");
|
|
|
|
|
|
- map3.put("Size", base64Data.length());
|
|
|
|
|
|
+ //照片base64长度
|
|
|
|
+ Integer imageSize = base64Data.length();
|
|
|
|
+ map3.put("Size", imageSize);
|
|
map3.put("Data", base64Data);
|
|
map3.put("Data", base64Data);
|
|
List listMap3 = new ArrayList();
|
|
List listMap3 = new ArrayList();
|
|
listMap3.add(map3);
|
|
listMap3.add(map3);
|
|
@@ -130,7 +132,9 @@ public class LapiServiceImpl implements ILapiService {
|
|
map.put("PersonInfoList", listMap1);
|
|
map.put("PersonInfoList", listMap1);
|
|
|
|
|
|
try {
|
|
try {
|
|
- if (base64Data.length() > 512 * 1024 || base64Data.length() < 10 * 1024) {
|
|
|
|
|
|
+ //照片字节大小
|
|
|
|
+ Integer fileSize = imageSize - (imageSize/8)*2;
|
|
|
|
+ if (fileSize > 512 * 1024 || fileSize < 10 * 1024) {
|
|
throw new Exception("人员照片大小限定为10k~512k");
|
|
throw new Exception("人员照片大小限定为10k~512k");
|
|
}
|
|
}
|
|
//获取人员人脸库id
|
|
//获取人员人脸库id
|
|
@@ -207,7 +211,9 @@ public class LapiServiceImpl implements ILapiService {
|
|
map3.put("FaceID", personInfo.getId());
|
|
map3.put("FaceID", personInfo.getId());
|
|
map3.put("Name", personInfo.getId() + ".jpg");
|
|
map3.put("Name", personInfo.getId() + ".jpg");
|
|
|
|
|
|
- map3.put("Size", base64Data.length());
|
|
|
|
|
|
+ //照片base64长度
|
|
|
|
+ Integer imageSize = base64Data.length();
|
|
|
|
+ map3.put("Size", imageSize);
|
|
map3.put("Data", base64Data);
|
|
map3.put("Data", base64Data);
|
|
List listMap3 = new ArrayList();
|
|
List listMap3 = new ArrayList();
|
|
listMap3.add(map3);
|
|
listMap3.add(map3);
|
|
@@ -216,7 +222,10 @@ public class LapiServiceImpl implements ILapiService {
|
|
listMap1.add(map1);
|
|
listMap1.add(map1);
|
|
map.put("PersonInfoList", listMap1);
|
|
map.put("PersonInfoList", listMap1);
|
|
|
|
|
|
- if (base64Data.length() > 512 * 1024 || base64Data.length() < 10 * 1024) {
|
|
|
|
|
|
+ //照片字节大小
|
|
|
|
+ Integer fileSize = imageSize - (imageSize/8)*2;
|
|
|
|
+
|
|
|
|
+ if (fileSize > 512 * 1024 || fileSize < 10 * 1024) {
|
|
throw new Exception("人员照片大小限定为10k~512k");
|
|
throw new Exception("人员照片大小限定为10k~512k");
|
|
}
|
|
}
|
|
//获取人员人脸库id
|
|
//获取人员人脸库id
|
|
@@ -324,7 +333,7 @@ public class LapiServiceImpl implements ILapiService {
|
|
@Override
|
|
@Override
|
|
public List<LapiMsgResult> deletePerson(Long id) throws Exception {
|
|
public List<LapiMsgResult> deletePerson(Long id) throws Exception {
|
|
|
|
|
|
- PersonInfo personInfo = personInfoService.get(id);
|
|
|
|
|
|
+ PersonInfo personInfo = personInfoService.getIgnoreDelFlag(id);
|
|
if (personInfo == null) {
|
|
if (personInfo == null) {
|
|
throw new Exception("人员不存在");
|
|
throw new Exception("人员不存在");
|
|
}
|
|
}
|
|
@@ -384,7 +393,7 @@ public class LapiServiceImpl implements ILapiService {
|
|
if (StringUtils.isBlank(deviceIds)) {
|
|
if (StringUtils.isBlank(deviceIds)) {
|
|
throw new Exception("相关设备不能为空");
|
|
throw new Exception("相关设备不能为空");
|
|
}
|
|
}
|
|
- PersonInfo personInfo = personInfoService.get(id);
|
|
|
|
|
|
+ PersonInfo personInfo = personInfoService.getIgnoreDelFlag(id);
|
|
if (personInfo == null) {
|
|
if (personInfo == null) {
|
|
throw new Exception("人员信息不存在");
|
|
throw new Exception("人员信息不存在");
|
|
}
|
|
}
|