From 2a0ddb202b816ba0e05240b210ad8231a70edffa Mon Sep 17 00:00:00 2001 From: lidongdong <1459917685@qq.com> Date: 星期五, 20 九月 2024 14:28:45 +0800 Subject: [PATCH] 花城 新增社区活动 新双争双评需求问题清单自动更新未签退时间4 --- 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