Przeglądaj źródła

修改视频回放

konghl 4 lat temu
rodzic
commit
74cb14124e

+ 9 - 7
monitor-manage-service/src/main/java/com/ai/bss/monitorManage/service/impl/KafkaProcessImpl.java

@ -116,19 +116,21 @@ public class KafkaProcessImpl implements KafkaProcess {
116 116
				filePath.length());
117 117
		if (fileType.equals(MonitorManageConsts.FILE_TYPE_IMG)) {
118 118
			bucketName = minioConfig.getBucketAiImage();
119
			time = fileName.substring(3, 17);
120
			//dateTime = DateUtils.formatDate(DateUtils.convertDate(time, DateUtils.PURE_DATETIMEHHMM_PATTERN),
119
			//fileName:img202101121630016.png、img202101121630017.png、img202101121630018.png
120
			//time = fileName.substring(3, 17);
121
			//dateTime = DateUtils.formatDate(DateUtils.convertDate(time, DateUtils.PURE_DATETIME_PATTERN),
121 122
			//		DateUtils.NORM_DATETIME_PATTERN);
122
			// aiIdenLogDto.setTaskExecuteTime(DateUtils.getSysDateTime());
123
			dateTime = DateUtils.formatDate(DateUtils.convertDate(time, DateUtils.PURE_DATETIME_PATTERN),
123
			time = fileName.substring(3, 15);
124
			dateTime = DateUtils.formatDate(DateUtils.convertDate(time, DateUtils.PURE_DATETIMEHHMM_PATTERN),
124 125
					DateUtils.NORM_DATETIME_PATTERN);
125
			aiIdenLogDto.setTaskExecuteTime(StringUtils.isEmpty(dateTime) ? DateUtils.getSysDateTime() : dateTime);
126
			// aiIdenLogDto.setTaskExecuteTime(StringUtils.isEmpty(dateTime) ? DateUtils.getSysDateTime() : dateTime);
127
			aiIdenLogDto.setTaskExecuteTime(DateUtils.getSysDateTime());
126 128
			aiIdenLogDto.setIdenPictureSnapDate(dateTime);
127 129
		}
128 130
		// 文件上传到 minio文件服务器
129 131
		multipartFile = new CommonsMultipartFile(FileUtils.createFileItem(new File(filePath), fileName));
130 132
131
		log.info("保存图片文件");
133
		log.info("保存图片文件:"+fileName);
132 134
		minioFileMap = fileManageService.uploadFile(multipartFile, bucketName, deviceCode, null);
133 135
134 136
		if (fileType.equals(MonitorManageConsts.FILE_TYPE_IMG)) {
@ -431,7 +433,7 @@ public class KafkaProcessImpl implements KafkaProcess {
431 433
			}
432 434
433 435
			resourceToolInfoList = JSON.parseArray(resultData.getString("data"), Map.class);
434
			log.info("getResourceToolAllInfo method return result: " + resultData.getString("data"));
436
			log.debug("getResourceToolAllInfo method return result: " + resultData.getString("data"));
435 437
		} catch (Exception e) {
436 438
			log.error("getResourceToolAllInfo is error");
437 439
		}

+ 1 - 1
security-protection-service/src/main/java/com/ai/bss/security/protection/controller/InAndOutRecordController.java

@ -75,7 +75,7 @@ public class InAndOutRecordController {
75 75
	}
76 76
	
77 77
	/**
78
	 * 首页查询进出记录
78
	 * 查询首页进出记录
79 79
	 * @return
80 80
	 * @throws Exception
81 81
	 */

+ 2 - 3
security-protection-service/src/main/java/com/ai/bss/security/protection/controller/MonitorVideoLogManageController.java

@ -49,7 +49,6 @@ public class MonitorVideoLogManageController {
49 49
		return monitorVideoLogManageService.queryMonitorVideoLogByTime(monitorVideoLogCondition);
50 50
	}
51 51
52
53 52
	/**
54 53
	 * 查询监控视频日志(按时间段)
55 54
	 * @param attendanceReport
@ -76,7 +75,7 @@ public class MonitorVideoLogManageController {
76 75
	 */
77 76
	@ResponseBody
78 77
	@RequestMapping("/queryOneMonitorVideoLog")
79
	public CommonResponse<EbcMonitorVideoLog> queryOneMonitorVideoLog(@RequestParam String monitorVideoLogId)
78
	public CommonResponse<String> queryOneMonitorVideoLog(@RequestParam String monitorVideoLogId)
80 79
			throws Exception {
81 80
		if (StringUtils.isEmpty(monitorVideoLogId)) {
82 81
			return CommonResponse.fail("500", "操作失败");
@ -94,7 +93,7 @@ public class MonitorVideoLogManageController {
94 93
	 */
95 94
	@ResponseBody
96 95
	@RequestMapping("/getMonitorVideoLogByPictureTime")
97
	public CommonResponse<List<EbcMonitorVideoLog>> getMonitorVideoLogByPictureTime(@RequestParam String imageTime,@RequestParam String resourceToolId)
96
	public CommonResponse<String> getMonitorVideoLogByPictureTime(@RequestParam String imageTime,@RequestParam String resourceToolId)
98 97
			throws Exception {
99 98
		if (StringUtils.isEmpty(imageTime)||StringUtils.isEmpty(resourceToolId)) {
100 99
			return CommonResponse.fail("500", "获取视频失败");

+ 5 - 3
security-protection-service/src/main/java/com/ai/bss/security/protection/service/impl/AiAlarmManageServiceImpl.java

@ -164,17 +164,19 @@ public class AiAlarmManageServiceImpl implements AiAlarmManageService {
164 164
		Map<String, String> pictureMap= uploadFileService.getFileUrlToMap(workTaskSafetyAlarmMap.get("idenPictureUrl"));
165 165
		
166 166
		//视频信息
167
		List<EbcMonitorVideoLog> logsList=monitorVideoLogManageService.getMonitorVideoLogByPictureTime(pictureMap.get("fileDateTimeStr"), workTaskSafetyAlarmMap.get("resourceToolId")).getData();
167
		/*List<EbcMonitorVideoLog> logsList=monitorVideoLogManageService.getMonitorVideoLogByPictureTime(pictureMap.get("fileDateTimeStr"), workTaskSafetyAlarmMap.get("resourceToolId")).getData();
168 168
		EbcMonitorVideoLog ebcMonitorVideoLog=null;
169 169
		if (!CollectionUtils.isEmpty(logsList)) {
170 170
			ebcMonitorVideoLog=logsList.get(0);
171 171
			ebcMonitorVideoLog.setVideoFileUrl(uploadFileService.getFileUrl(ebcMonitorVideoLog.getVideoUrl()));
172
		}
172
		}*/
173
		String videoFileUrl =monitorVideoLogManageService.getMonitorVideoLogByPictureTime(pictureMap.get("fileDateTimeStr"), workTaskSafetyAlarmMap.get("resourceToolId")).getData();
173 174
		
174 175
		Map<String,Object> resultMap= new HashMap<String, Object>();
175 176
		resultMap.put("alarmInfo", workTaskSafetyAlarmMap);
176 177
		resultMap.put("pictureInfo", pictureMap);
177
		resultMap.put("videoInfo", ebcMonitorVideoLog);
178
		//resultMap.put("videoInfo", ebcMonitorVideoLog);
179
		resultMap.put("videoInfo", videoFileUrl);
178 180
		return CommonResponse.ok(resultMap);
179 181
	}
180 182

+ 7 - 3
security-protection-service/src/main/java/com/ai/bss/security/protection/service/impl/AiIdenLogManageServiceImpl.java

@ -252,19 +252,23 @@ public class AiIdenLogManageServiceImpl implements AiIdenLogManageService {
252 252
		Map<String, String> pictureMap = uploadFileService.getFileUrlToMap(aiIdenLog.getIdenPictureUrl());
253 253
254 254
		// 视频信息
255
		List<EbcMonitorVideoLog> logsList = monitorVideoLogManageService
255
		/*List<EbcMonitorVideoLog> logsList = monitorVideoLogManageService
256 256
				.getMonitorVideoLogByPictureTime(pictureMap.get("fileDateTimeStr"), aiIdenLog.getResourceToolId())
257 257
				.getData();
258 258
		EbcMonitorVideoLog ebcMonitorVideoLog = null;
259 259
		if (!CollectionUtils.isEmpty(logsList)) {
260 260
			ebcMonitorVideoLog = logsList.get(0);
261 261
			ebcMonitorVideoLog.setVideoFileUrl(uploadFileService.getFileUrl(ebcMonitorVideoLog.getVideoUrl()));
262
		}
262
		}*/
263
		String videoFileUrl =monitorVideoLogManageService
264
				.getMonitorVideoLogByPictureTime(pictureMap.get("fileDateTimeStr"), aiIdenLog.getResourceToolId())
265
				.getData();
263 266
264 267
		Map<String, Object> resultMap = new HashMap<String, Object>();
265 268
		resultMap.put("alarmInfo", aiIdenLogInfoMap);
266 269
		resultMap.put("pictureInfo", pictureMap);
267
		resultMap.put("videoInfo", ebcMonitorVideoLog);
270
		//resultMap.put("videoInfo", ebcMonitorVideoLog);
271
		resultMap.put("videoInfo", videoFileUrl);
268 272
		return CommonResponse.ok(resultMap);
269 273
	}
270 274

+ 21 - 12
security-protection-service/src/main/java/com/ai/bss/security/protection/service/impl/MonitorVideoLogManageServiceImpl.java

@ -46,6 +46,7 @@ public class MonitorVideoLogManageServiceImpl implements MonitorVideoLogManageSe
46 46
	private SecurityProtectionMinioConfig minioConfig;
47 47
48 48
	@Override
49
	@Deprecated
49 50
	public CommonResponse<List<EbcMonitorVideoLog>> queryMonitorVideoLogByTime(MonitorVideoLog monitorVideoLogCondition)
50 51
			throws Exception {
51 52
		CommonRequest<MonitorVideoLog> request = new CommonRequest<MonitorVideoLog>(monitorVideoLogCondition);
@ -103,38 +104,46 @@ public class MonitorVideoLogManageServiceImpl implements MonitorVideoLogManageSe
103 104
	}
104 105
105 106
	@Override
106
	public CommonResponse<EbcMonitorVideoLog> queryMonitorVideoLogById(Long monitorVideoLogId) throws Exception {
107
	public CommonResponse<String> queryMonitorVideoLogById(Long monitorVideoLogId) throws Exception {
107 108
		CommonRequest<Long> request = new CommonRequest<Long>(monitorVideoLogId);
108 109
		CommonResponse<MonitorVideoLog> response = monitorSceneQuery.loadMonitorVideoLog(request);
109 110
110 111
		if (response == null || response.getData() == null) {
111 112
			return CommonResponse.fail("504", "监控视频不存在");
112 113
		}
113
114
		EbcMonitorVideoLog ebcMonitorVideoLog = getEbcMonitorVideoLog(response.getData());
115
		return CommonResponse.ok(ebcMonitorVideoLog);
114
		
115
		//EbcMonitorVideoLog ebcMonitorVideoLog = getEbcMonitorVideoLog(response.getData());
116
		//return CommonResponse.ok(ebcMonitorVideoLog);
117
		return queryMonitorVideoLogByTimeForM3u8(response.getData());
116 118
	}
117 119
118 120
	@Override
119
	public CommonResponse<List<EbcMonitorVideoLog>> getMonitorVideoLogByPictureTime(String imageTime,
121
	public CommonResponse<String> getMonitorVideoLogByPictureTime(String imageTime,
120 122
			String resourceToolId) throws Exception {
121
		Map<String, Object> conditionMap = new HashMap<String, Object>();
123
		MonitorVideoLog monitorVideoLogCondition = new MonitorVideoLog();
124
		monitorVideoLogCondition.setResourceToolId(resourceToolId);
125
		monitorVideoLogCondition.setBeginTime(DateUtil.convertDate(imageTime));
126
		monitorVideoLogCondition.setEndTime(DateUtil.convertDate(imageTime));
127
		
128
		return queryMonitorVideoLogByTimeForM3u8(monitorVideoLogCondition);
129
		
130
		
131
		/*Map<String, Object> conditionMap = new HashMap<String, Object>();
122 132
		conditionMap.put("resourceToolId", resourceToolId);
123 133
		conditionMap.put("imageTime", imageTime);
124 134
		CommonRequest<Map<String, Object>> conditionMapRequest = new CommonRequest<Map<String, Object>>(conditionMap);
125 135
		CommonResponse<List<MonitorVideoLog>> response = monitorSceneQuery.selectMonitorVideoLog(conditionMapRequest);
126
127
		List<EbcMonitorVideoLog> list = new ArrayList<EbcMonitorVideoLog>();
136
		
128 137
		if (response == null || CollectionUtils.isEmpty(response.getData())) {
129
			return CommonResponse.ok(list);
138
			return CommonResponse.ok("");
130 139
		}
131
140
		
132 141
		for (MonitorVideoLog monitorVideoLog : response.getData()) {
133 142
			EbcMonitorVideoLog ebcMonitorVideoLog = getEbcMonitorVideoLog(monitorVideoLog);
134 143
			list.add(ebcMonitorVideoLog);
135 144
		}
136
137
		return CommonResponse.ok(list);
145
		
146
		return CommonResponse.ok(list);*/
138 147
	}
139 148
140 149
	/**

+ 1 - 1
security-protection-service/src/main/java/com/ai/bss/security/protection/service/interfaces/AiIdenLogManageService.java

@ -45,7 +45,7 @@ public interface AiIdenLogManageService {
45 45
	CommonResponse<Map<String, Object>> queryOneAiIdenLog(Long aiIdenLogId) throws Exception;
46 46
47 47
	/**
48
	 * 查询所有设备最后一个识别记录
48
	 * 根据场景ID查询最后一条进出记录
49 49
	 * @param params
50 50
	 * @return
51 51
	 * @throws Exception

+ 9 - 3
security-protection-service/src/main/java/com/ai/bss/security/protection/service/interfaces/MonitorVideoLogManageService.java

@ -19,10 +19,16 @@ public interface MonitorVideoLogManageService {
19 19
	 * @return
20 20
	 * @throws Exception
21 21
	 */
22
	@Deprecated
22 23
	CommonResponse<List<EbcMonitorVideoLog>> queryMonitorVideoLogByTime(MonitorVideoLog monitorVideoLogCondition)
23 24
			throws Exception;
24 25
25
26
	/**
27
	 * 按时间段查询监控视频日志
28
	 * @param monitorVideoLogCondition
29
	 * @return
30
	 * @throws Exception
31
	 */
26 32
	CommonResponse<String> queryMonitorVideoLogByTimeForM3u8(MonitorVideoLog monitorVideoLogCondition) throws Exception;
27 33
28 34
	/**
@ -31,7 +37,7 @@ public interface MonitorVideoLogManageService {
31 37
	 * @return
32 38
	 * @throws Exception
33 39
	 */
34
	CommonResponse<EbcMonitorVideoLog> queryMonitorVideoLogById(Long monitorVideoLogId) throws Exception;
40
	CommonResponse<String> queryMonitorVideoLogById(Long monitorVideoLogId) throws Exception;
35 41
36 42
	/**
37 43
	 * 根据设备图片时间查询视频日志
@ -40,7 +46,7 @@ public interface MonitorVideoLogManageService {
40 46
	 * @return
41 47
	 * @throws Exception
42 48
	 */
43
	CommonResponse<List<EbcMonitorVideoLog>> getMonitorVideoLogByPictureTime(String imageTime,String resourceToolId) throws Exception;
49
	CommonResponse<String> getMonitorVideoLogByPictureTime(String imageTime,String resourceToolId) throws Exception;
44 50
	
45 51
	/**
46 52
	 * 创建监控视频日志