From 7cfa09050726578c2cc5114e5bc8a419e6e2e466 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期二, 15 十月 2024 11:03:45 +0800
Subject: [PATCH] 人脸上传数据延迟修复
---
ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java | 56 ++++++++++++++++++++++++++++++++++++++++++++++----------
1 files changed, 46 insertions(+), 10 deletions(-)
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java
index 7109b6b..504cd1b 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/TMonitorServiceImpl.java
@@ -590,6 +590,17 @@
exportForm.setCameraFunType(Integer.valueOf(CheckConstants.Rule_Category_Video + ""));
VideoExportForm.convertTags(exportForm);
List<TMonitorResult> tMonitorResults = tMonitorMapper.selectMonitorResult(exportForm);
+ //鑾峰彇鍔ㄦ�佸垪鏁版嵁
+ List<Integer> pointIds = tMonitorResults.stream().map(TMonitorResult::getPointId).collect(Collectors.toList());
+ List<DynamicColumnVO> dynamics = dynamicColumnMapper.getDynamicsByIds("t_yw_point", pointIds);
+ //琛ュ厖鍔ㄦ�佸垪鏁版嵁
+ if(!CollectionUtils.isEmpty(dynamics)) {
+ Map<Integer, List<DynamicColumnVO>> map = dynamics.stream().collect(Collectors.groupingBy(DynamicColumnVO::getRefId));
+ for (TMonitorResult tMonitorResult : tMonitorResults) {
+ Integer pointId = tMonitorResult.getPointId();
+ tMonitorResult.setDynamicColumnList(map.get(pointId));
+ }
+ }
List<String> deviceIds = tMonitorResults.stream().map(BaseResult::getNo).collect(Collectors.toList());
Query query = getQuery(deviceIds, exportForm.getMonth());
//鏈堜唤姣忔棩褰曞儚绾挎暟鎹�
@@ -610,12 +621,19 @@
videoDailyExp.setSerialNumber(result.getNo());
videoDailyExp.setDeviceName(result.getName());
videoDailyExp.setArea(areaDeptEnum == null ? "鏈煡" : areaDeptEnum.getName());
- String tag = "" + (result.getProvinceTag() ? "鐪佸巺銆�" : "") + (result.getImportantTag() ? "閲嶇偣鐐逛綅銆�" : "") + (result.getImportantCommandImageTag() ? "閲嶇偣鎸囨尌鍥惧儚銆�" : "") + (result.getDeptTag() ? "閮ㄧ骇銆�" : "");
- // 鍒犻櫎瀛楃涓叉湯灏剧殑鈥溿�佲��
- if (tag.endsWith("銆�")) {
- tag = tag.substring(0, tag.length() - 1);
+ StringBuilder tag = new StringBuilder("" + (result.getProvinceTag() ? "鐪佸巺銆�" : "") + (result.getImportantTag() ? "閲嶇偣鐐逛綅銆�" : "") + (result.getImportantCommandImageTag() ? "閲嶇偣鎸囨尌鍥惧儚銆�" : "") + (result.getDeptTag() ? "閮ㄧ骇銆�" : ""));
+ //鍔ㄦ�佸垪澶勭悊鍔犲湪鏍囩閲�
+ if(!CollectionUtils.isEmpty(result.getDynamicColumnList())){
+ List<DynamicColumnVO> dynamicColumnList = result.getDynamicColumnList();
+ for (DynamicColumnVO dynamicColumnVO : dynamicColumnList) {
+ tag.append(dynamicColumnVO.getColumnValue()).append("銆�");
+ }
}
- videoDailyExp.setTag(tag);
+ // 鍒犻櫎瀛楃涓叉湯灏剧殑鈥溿�佲��
+ if (tag.toString().endsWith("銆�")) {
+ tag = new StringBuilder(tag.substring(0, tag.length() - 1));
+ }
+ videoDailyExp.setTag(tag.toString());
setRecordDaily(videoDailyExp, result, records);
//鍖哄幙琛�
videoDailyExps.add(videoDailyExp);
@@ -648,6 +666,17 @@
exportForm.setCameraFunType(Integer.valueOf(CheckConstants.Rule_Category_Video + ""));
VideoExportForm.convertTags(exportForm);
List<TMonitorResult> tMonitorResults = tMonitorMapper.selectMonitorResult(exportForm);
+ //鑾峰彇鍔ㄦ�佸垪鏁版嵁
+ List<Integer> pointIds = tMonitorResults.stream().map(TMonitorResult::getPointId).collect(Collectors.toList());
+ List<DynamicColumnVO> dynamics = dynamicColumnMapper.getDynamicsByIds("t_yw_point", pointIds);
+ //琛ュ厖鍔ㄦ�佸垪鏁版嵁
+ if(!CollectionUtils.isEmpty(dynamics)) {
+ Map<Integer, List<DynamicColumnVO>> map = dynamics.stream().collect(Collectors.groupingBy(DynamicColumnVO::getRefId));
+ for (TMonitorResult tMonitorResult : tMonitorResults) {
+ Integer pointId = tMonitorResult.getPointId();
+ tMonitorResult.setDynamicColumnList(map.get(pointId));
+ }
+ }
List<String> deviceIds = tMonitorResults.stream().map(BaseResult::getNo).collect(Collectors.toList());
Query query = getQuery(deviceIds, exportForm.getMonth());
//鏈堜唤姣忔棩褰曞儚绾挎暟鎹�
@@ -668,12 +697,19 @@
videoDailyExp.setSerialNumber(result.getNo());
videoDailyExp.setDeviceName(result.getName());
videoDailyExp.setArea(areaDeptEnum == null ? "鏈煡" : areaDeptEnum.getName());
- String tag = "" + (result.getProvinceTag() ? "鐪佸巺銆�" : "") + (result.getImportantTag() ? "閲嶇偣鐐逛綅銆�" : "") + (result.getImportantCommandImageTag() ? "閲嶇偣鎸囨尌鍥惧儚銆�" : "") + (result.getDeptTag() ? "閮ㄧ骇銆�" : "");
- // 鍒犻櫎瀛楃涓叉湯灏剧殑鈥溿�佲��
- if (tag.endsWith("銆�")) {
- tag = tag.substring(0, tag.length() - 1);
+ StringBuilder tag = new StringBuilder("" + (result.getProvinceTag() ? "鐪佸巺銆�" : "") + (result.getImportantTag() ? "閲嶇偣鐐逛綅銆�" : "") + (result.getImportantCommandImageTag() ? "閲嶇偣鎸囨尌鍥惧儚銆�" : "") + (result.getDeptTag() ? "閮ㄧ骇銆�" : ""));
+ //鍔ㄦ�佸垪澶勭悊鍔犲湪鏍囩閲�
+ if(!CollectionUtils.isEmpty(result.getDynamicColumnList())){
+ List<DynamicColumnVO> dynamicColumnList = result.getDynamicColumnList();
+ for (DynamicColumnVO dynamicColumnVO : dynamicColumnList) {
+ tag.append(dynamicColumnVO.getColumnValue()).append("銆�");
+ }
}
- videoDailyExp.setTag(tag);
+ // 鍒犻櫎瀛楃涓叉湯灏剧殑鈥溿�佲��
+ if (tag.toString().endsWith("銆�")) {
+ tag = new StringBuilder(tag.substring(0, tag.length() - 1));
+ }
+ videoDailyExp.setTag(tag.toString());
setLoseDaily(videoDailyExp, result, records);
videoDailyExps.add(videoDailyExp);
//鍏ㄩ噺琛�
--
Gitblit v1.8.0