From 94de735233383fe644ec0401465e8e85c8999179 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期五, 06 三月 2026 10:01:09 +0800
Subject: [PATCH] 钥匙柜开门添加 指纹方式
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java | 90 ++++++++------------------------------------
1 files changed, 17 insertions(+), 73 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..c9f4e40 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,30 +498,28 @@
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)){
List<Integer> ruleIdList = impl.processWarnFront(warningConfig);
-
Boolean falg = true;
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(ruleIdList)){
- Set<Integer> ruleIdSet = new HashSet<>(ruleIdList);
- for (Integer ruleId:ruleIdSet) {
+ for (Integer ruleId:ruleIdList) {
WarningRule warningRule = warningRuleMapper.selectById(ruleId);
if (Objects.isNull(warningRule)) {
break;
}
List<Member> memberList = impl.getWarningRuleMemberList(warningRule);
+ if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(memberList)) {
+ break;
+ }
try {
WarningPush warningPush = new WarningPush();
warningPush.setCreateDate(new Date());
@@ -534,14 +530,17 @@
warningPush.setContent(content);
warningPush.setStatus(Constants.ZERO);
warningPush.setPushType(Constants.ZERO);
- warningPush.setRegion( warningEvent.getRegion());
- if (com.github.xiaoymin.knife4j.core.util.CollectionUtils.isEmpty(memberList)) {
- warningPush.setMemberIds(
- StringUtils.join(memberList.stream().map(i -> i.getId()).collect(Collectors.toList()), ",")
- );
- warningPush.setMemberNames(StringUtils.join(memberList.stream().map(i -> i.getName()).collect(Collectors.toList()), ",")
- );
- }
+ //TODO 鏍规嵁鍏蜂綋鏁版嵁瀵规瘮鑾峰彇
+ warningPush.setRegion( "鏈煡浣嶇疆");
+ warningPush.setMemberIds(
+ StringUtils.join(memberList.stream().map(i -> i.getId()).collect(Collectors.toList()), ",")
+ );
+ warningPush.setMemberIds(
+ StringUtils.join(memberList.stream().map(i -> i.getId()).collect(Collectors.toList()), ",")
+ );
+ warningPush.setMemberNames(StringUtils.join(memberList.stream().map(i -> i.getName()).collect(Collectors.toList()), ",")
+ );
+
if(Constants.equalsInteger(warningRule.getMemberNotice(),Constants.ONE)){
// Boolean noticeFlag = dingTalk.workInfoOANotice(Long.valueOf(systemDictDataBiz.queryByCode(Constants.DD_TALK,Constants.AGENT_ID).getCode()),
// StringUtils.join(memberList.stream().filter(i->StringUtils.isNotBlank(i.getDdId())).map(i->i.getDdId()).collect(Collectors.toList()),","),
@@ -573,63 +572,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