|
@@ -37,10 +37,7 @@ import java.io.FileOutputStream;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.io.InputStream;
|
|
import java.net.URLEncoder;
|
|
import java.net.URLEncoder;
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.UUID;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
*
|
|
*
|
|
@@ -103,8 +100,9 @@ public class TraceService {
|
|
* 图像识别,使用特征码查询图像库,得到图库表中对应的数据列表
|
|
* 图像识别,使用特征码查询图像库,得到图库表中对应的数据列表
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- public List<TraceVO> listUploadImagesTrace(String imageNames, String beginTime, String endTime, UserLoginedConvertVO loginUser) {
|
|
|
|
- List<TraceVO> result = new ArrayList<>();
|
|
|
|
|
|
+ public Map<String,List<TraceVO>> listUploadImagesTrace(String imageNames, String beginTime, String endTime, UserLoginedConvertVO loginUser) {
|
|
|
|
+ Map<String,List<TraceVO>> result = new HashMap<>();
|
|
|
|
+
|
|
Date dateBegin = null;
|
|
Date dateBegin = null;
|
|
if(StringUtils.isNotEmpty(beginTime)){
|
|
if(StringUtils.isNotEmpty(beginTime)){
|
|
dateBegin = DateUtils.strToDate(beginTime,"yyyy-MM-dd HH:mm:ss");
|
|
dateBegin = DateUtils.strToDate(beginTime,"yyyy-MM-dd HH:mm:ss");
|
|
@@ -151,32 +149,41 @@ public class TraceService {
|
|
}
|
|
}
|
|
|
|
|
|
FaceMonitor faceMonitorFaceImag = FaceIdenTool.initFaceMonitorWithDataset(idenRoot,dataset);
|
|
FaceMonitor faceMonitorFaceImag = FaceIdenTool.initFaceMonitorWithDataset(idenRoot,dataset);
|
|
- for(FaceModel faceModel : faceModels) {
|
|
|
|
|
|
+ for(int i = 0; i < faceModels.length; i++) {
|
|
|
|
+ FaceModel faceModel = faceModels[i];
|
|
|
|
+ List<TraceVO> traceVOList = new ArrayList<>();
|
|
FaceRetrieveResultVO faceRetrieveResultVO = FaceIdenTool.getHitResult(faceMonitorFaceImag,faceModel,true);
|
|
FaceRetrieveResultVO faceRetrieveResultVO = FaceIdenTool.getHitResult(faceMonitorFaceImag,faceModel,true);
|
|
if (faceRetrieveResultVO != null) {
|
|
if (faceRetrieveResultVO != null) {
|
|
long hitIndex = faceRetrieveResultVO.getIndex();
|
|
long hitIndex = faceRetrieveResultVO.getIndex();
|
|
IdenFaceImage idenFaceImage = idenFaceImageService.getById(hitIndex);
|
|
IdenFaceImage idenFaceImage = idenFaceImageService.getById(hitIndex);
|
|
if(idenFaceImage != null){
|
|
if(idenFaceImage != null){
|
|
- TraceVO vo = new TraceVO();
|
|
|
|
- BeanUtil.copyProperties(idenFaceImage,vo);
|
|
|
|
- if(vo.getCameraId() != null){
|
|
|
|
- IdenCamera idenCamera = this.idenCameraService.getById(vo.getCameraId());
|
|
|
|
- if(idenCamera != null) {
|
|
|
|
- vo.setDistrict(idenCamera.getDistrict());
|
|
|
|
- vo.setSubdistrict(idenCamera.getSubdistrict());
|
|
|
|
-
|
|
|
|
- Long communityId = idenCamera.getCommunityId();
|
|
|
|
- if(communityId != null ){
|
|
|
|
- IdenCommunity idenCommunity = this.idenCommunityService.getById(communityId);
|
|
|
|
- if(idenCommunity != null) {
|
|
|
|
- vo.setCommunityName(idenCommunity.getName());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- result.add(vo);
|
|
|
|
|
|
+
|
|
|
|
+ for(IdenFaceImage idenFaceImage1 : idenFaceImageList){
|
|
|
|
+ if(idenFaceImage.getUid().equals(idenFaceImage1.getUid())) {
|
|
|
|
+ TraceVO vo = new TraceVO();
|
|
|
|
+ BeanUtil.copyProperties(idenFaceImage1,vo);
|
|
|
|
+ if(vo.getCameraId() != null){
|
|
|
|
+ IdenCamera idenCamera = this.idenCameraService.getById(vo.getCameraId());
|
|
|
|
+ if(idenCamera != null) {
|
|
|
|
+ vo.setDistrict(idenCamera.getDistrict());
|
|
|
|
+ vo.setSubdistrict(idenCamera.getSubdistrict());
|
|
|
|
+
|
|
|
|
+ Long communityId = idenCamera.getCommunityId();
|
|
|
|
+ if(communityId != null ){
|
|
|
|
+ IdenCommunity idenCommunity = this.idenCommunityService.getById(communityId);
|
|
|
|
+ if(idenCommunity != null) {
|
|
|
|
+ vo.setCommunityName(idenCommunity.getName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ traceVOList.add(vo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ result.put(imageNameArr[i],traceVOList);
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
@@ -210,7 +217,15 @@ public class TraceService {
|
|
return vos;
|
|
return vos;
|
|
}
|
|
}
|
|
|
|
|
|
- public void exportToExcel(List<TraceVO> records, UserLoginedConvertVO loginUser, HttpServletResponse response) throws Exception {
|
|
|
|
|
|
+ public void exportToExcel(Map<String,List<TraceVO>> map, UserLoginedConvertVO loginUser, HttpServletResponse response) throws Exception {
|
|
|
|
+
|
|
|
|
+ if(map == null || map.size() == 0){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ List<TraceVO> records = new ArrayList<>();
|
|
|
|
+ map.keySet().forEach(item->{
|
|
|
|
+ records.addAll(map.get(item));
|
|
|
|
+ });
|
|
|
|
|
|
InputStream excelTemplateIs = null;
|
|
InputStream excelTemplateIs = null;
|
|
try {
|
|
try {
|