From 7ae632cdf459e9860a01b6520e10afb57c0761b3 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期五, 06 三月 2026 10:01:37 +0800
Subject: [PATCH] 最新版本541200007
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java | 67 ++-------------------------------
1 files changed, 4 insertions(+), 63 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
index bf7cb52..eb48099 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
@@ -26,7 +26,6 @@
import com.doumee.dao.business.model.*;
import com.doumee.dao.business.model.Member;
import com.doumee.dao.web.reqeust.SavePlatformWarnEventDTO;
-import com.doumee.dao.web.response.platformReport.CarmeraListVO;
import com.doumee.service.business.VisitsService;
import com.doumee.service.business.impl.JkCabinetGridServiceImpl;
import com.doumee.service.business.impl.PlatformWarnEventServiceImpl;
@@ -38,7 +37,6 @@
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
@@ -500,15 +498,12 @@
warningEvent.setEventId(request.getEventId());
warningEvent.setEventType(request.getEventType().toString());
warningEvent.setHappenTime(request.getHappenTime());
- if(Objects.nonNull(request.getData())){
- warningEvent.setJsonContent(request.getData().toJSONString());
- }
+ warningEvent.setJsonContent(request.getData().toJSONString());
warningEvent.setSrcIndex(request.getSrcIndex());
warningEvent.setSrcType(request.getSrcType());
warningEvent.setSrcName(request.getSrcName());
warningEvent.setWarningId(warning.getId());
warningEvent.setDeviceId(request.getSrcIndex());
- warningEvent.setRegion(this.getRegionsName(warningEvent.getSrcIndex(),warning.getType()));
warningEventMapper.insert(warningEvent);
if(Objects.nonNull(warningConfig)){
@@ -534,7 +529,8 @@
warningPush.setContent(content);
warningPush.setStatus(Constants.ZERO);
warningPush.setPushType(Constants.ZERO);
- warningPush.setRegion( warningEvent.getRegion());
+ //TODO 鏍规嵁鍏蜂綋鏁版嵁瀵规瘮鑾峰彇
+ warningPush.setRegion( "鏈煡浣嶇疆");
if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(memberList)) {
warningPush.setMemberIds(
StringUtils.join(memberList.stream().map(i -> i.getId()).collect(Collectors.toList()), ",")
@@ -573,63 +569,8 @@
}
saveInterfaceLog(param,"/business/hksync/push/notice",result,true);
return null;
+
}
-
- @Autowired
- private RedisTemplate<String,Object> stringRedisTemplate;
-
- public String getRegionsName(String srcIndex,Integer warningType){
- log.error("銆愬尮閰嶈澶囦笌鍖哄煙鍏崇郴淇℃伅銆�========寮�濮�=======锛�"+srcIndex);
- String regionName = "鏈煡鍖哄煙";
- if(StringUtils.isBlank(srcIndex)){
- return regionName;
- }
- try{
- if(Constants.equalsInteger(warningType,Constants.ZERO)){
- List<CarmeraListVO> carmeraListVOList = (List<CarmeraListVO>) stringRedisTemplate.opsForValue().get(Constants.RedisKeys.HK_CAMERAS);//鎵�鏈夌洃鎺х偣鏁版嵁
- if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(carmeraListVOList)){
- if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(carmeraListVOList)){
- for (CarmeraListVO c:carmeraListVOList) {
- if(c.getIndexCode().equals(srcIndex)){
- log.error("銆愮洃鎺у尯鍩熷尮閰嶇粨鏋溿��===============锛�"+c.getRegionName());
- return c.getRegionName();
- }
- }
- }
- }
- }else{
- List<CarmeraListVO> fireDeviceListVOList = (List<CarmeraListVO>) stringRedisTemplate.opsForValue().get(Constants.RedisKeys.HK_FIRE_DEVICE);//鎵�鏈夋秷闃茶澶囨暟鎹�
- List<CarmeraListVO> sensorListVOList = (List<CarmeraListVO>) stringRedisTemplate.opsForValue().get(Constants.RedisKeys.HK_SENSOR);//鎵�鏈変紶鎰熷櫒
- if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(fireDeviceListVOList)){
- if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(fireDeviceListVOList)){
- for (CarmeraListVO c:fireDeviceListVOList) {
- if(c.getIndexCode().equals(srcIndex)){
- log.error("銆愭秷闃插尯鍩熷尮閰嶇粨鏋溿��===============锛�"+c.getRegionName());
- return c.getRegionName();
- }
- }
- }
- }
-
- if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(sensorListVOList)){
- if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(sensorListVOList)){
- for (CarmeraListVO c:sensorListVOList) {
- if(c.getIndexCode().equals(srcIndex)){
- log.error("銆愪紶鎰熷櫒鍖哄煙鍖归厤缁撴灉銆�==============锛�"+c.getRegionName());
- return c.getRegionName();
- }
- }
- }
- }
- }
-
- }catch (Exception e){
- e.printStackTrace();
- }
- log.error("銆愬尮閰嶈澶囦笌鍖哄煙鍏崇郴淇℃伅銆�========缁撴潫=======锛�"+srcIndex);
- return regionName;
- }
-
/**
* 娴峰悍璁垮浜嬩欢鎺ㄩ��
--
Gitblit v1.9.3