From 86df207c37502cce1b2043e1c7c0486459eef1d6 Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期四, 13 三月 2025 19:58:45 +0800 Subject: [PATCH] 党员、诉求评论基础代码 --- 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