From 70d2a5d0f9c6951b2d4cac954041ed73582ff7eb Mon Sep 17 00:00:00 2001
From: liujie <1793218484@qq.com>
Date: 星期一, 09 六月 2025 11:54:00 +0800
Subject: [PATCH] 6.9新增登录失败冻结逻辑

---
 springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/service/impl/ComPropertyAlarmSettingServiceImpl.java |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/service/impl/ComPropertyAlarmSettingServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/service/impl/ComPropertyAlarmSettingServiceImpl.java
index cbfea98..3841bc4 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/service/impl/ComPropertyAlarmSettingServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/service/impl/ComPropertyAlarmSettingServiceImpl.java
@@ -7,6 +7,7 @@
 import com.panzhihua.service_property.dao.ComPropertyAlarmSettingDao;
 import com.panzhihua.service_property.service.ComPropertyAlarmSettingService;
 import lombok.extern.slf4j.Slf4j;
+import org.springframework.data.redis.core.StringRedisTemplate;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;
@@ -22,6 +23,8 @@
 public class ComPropertyAlarmSettingServiceImpl extends ServiceImpl<ComPropertyAlarmSettingDao, ComPropertyAlarmSetting> implements ComPropertyAlarmSettingService {
     @Resource
     private ComPropertyAlarmSettingDao comPropertyAlarmSettingDao;
+    @Resource
+    private StringRedisTemplate stringRedisTemplate;
     @Override
     public R pageList(CommonPage commonPage) {
         return null;
@@ -31,4 +34,17 @@
     public R getByCommunityId(Long communityId) {
         return R.ok(comPropertyAlarmSettingDao.getByCommunityId(communityId));
     }
+
+    @Override
+    public R insert(ComPropertyAlarmSetting comPropertyAlarmSetting) {
+        boolean result=this.saveOrUpdate(comPropertyAlarmSetting);
+        if(result){
+            if(stringRedisTemplate.hasKey(comPropertyAlarmSetting.getCommunityId().toString())){
+                stringRedisTemplate.boundValueOps(comPropertyAlarmSetting.getCommunityId().toString()).set(comPropertyAlarmSetting.getTriggerTime().toString());
+            }
+            return R.ok();
+        }
+
+        return R.fail();
+    }
 }

--
Gitblit v1.7.1