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_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActRegistServiceImpl.java | 26 +++++++++++++++++++++----- 1 files changed, 21 insertions(+), 5 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActRegistServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActRegistServiceImpl.java index c6f7253..776fab0 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActRegistServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActRegistServiceImpl.java @@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.common.model.vos.R; +import com.panzhihua.common.model.vos.community.ComActActRegistVO; import com.panzhihua.service_community.dao.ComActActRegistDAO; import com.panzhihua.service_community.model.dos.ComActActRegistDO; import com.panzhihua.service_community.model.dos.ComActActivityDO; @@ -9,6 +10,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import java.util.Calendar; import java.util.Date; import java.util.List; @@ -35,15 +37,29 @@ for (String aId:activityList) { ComActActivityDO comActActivityDO=baseMapper.getActivityEndTime(aId); - - if(comActActivityDO.getEndAt().getTime()<new Date().getTime()) + if(comActActivityDO!=null) { - List<String> timeList=baseMapper.getNotTimeUser(aId); - for (String user:timeList) + if(comActActivityDO.getEndAt().getTime()<new Date().getTime()) { - baseMapper.updateEndTime(user,comActActivityDO.getEndAt()); + List<ComActActRegistVO> timeList=baseMapper.getNotTimeUser(aId); + for (ComActActRegistVO user:timeList) + { + baseMapper.updateEndTime(user.getId()+"",comActActivityDO.getEndAt()); + } } } + else + { + List<ComActActRegistVO> timeList2=baseMapper.getNotTimeUser(aId); + for(ComActActRegistVO user2:timeList2) + { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(user2.getStartTime()); + calendar.add(Calendar.HOUR_OF_DAY, 3); // 加5小时 + baseMapper.updateEndTime(user2.getId()+"",calendar.getTime()); + } + } + } } -- Gitblit v1.7.1