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/VolunteerActivityServiceImpl.java | 54 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 44 insertions(+), 10 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerActivityServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerActivityServiceImpl.java index 6569ab1..97bab78 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerActivityServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerActivityServiceImpl.java @@ -3,16 +3,13 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.panzhihua.common.model.vos.community.MostBeautifulVolunteerVO; import com.panzhihua.common.model.vos.community.VolunteerActivityVO; import com.panzhihua.common.utlis.StringUtils; -import com.panzhihua.service_community.dao.MostBeautifulVolunteerDao; import com.panzhihua.service_community.dao.VolunteerActivityDao; -import com.panzhihua.service_community.entity.MostBeautifulVolunteer; import com.panzhihua.service_community.entity.VolunteerActivity; -import com.panzhihua.service_community.service.MostBeautifulVolunteerService; import com.panzhihua.service_community.service.VolunteerActivityService; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import java.util.Date; @@ -25,8 +22,8 @@ { @Override - public VolunteerActivity queryById(String Id) { - return baseMapper.queryById(Id); + public VolunteerActivity queryById(String Id,String userId) { + return baseMapper.queryById(Id,userId); } @Override @@ -34,15 +31,48 @@ String name, String acState, String acType, + String userId, Date actityBeginTime, Date actityEndTime) { Page page = new Page<VolunteerActivity>(pageNum,pageSize); - return baseMapper.queryList(page, name, acState, acType, actityBeginTime, actityEndTime); + return baseMapper.queryList(page, name, acState, acType, userId, actityBeginTime, actityEndTime); } @Override - public int insertVolunteer(VolunteerActivityVO mostBeautifulVolunteerVO) { + public int insertVolunteer(VolunteerActivityVO mostBeautifulVolunteerVO) + { + Long applyBegintime = mostBeautifulVolunteerVO.getApplyBeginTime().getTime(); + //活动报名结束时间 + Long applyEndtime = mostBeautifulVolunteerVO.getApplyEndTime().getTime(); + + //活动开始时间 + Long actityBegintime = mostBeautifulVolunteerVO.getActityBeginTime().getTime(); + //活动结束时间 + Long actityEndtime = mostBeautifulVolunteerVO.getActityEndTime().getTime(); + + Long newTiem=System.currentTimeMillis(); + + //判断是否在报名中 + if (newTiem >= applyBegintime && newTiem < applyEndtime) + { + mostBeautifulVolunteerVO.setAcState("3"); + } + else if (newTiem>applyEndtime && newTiem <actityBegintime ) + { + mostBeautifulVolunteerVO.setAcState("4"); + } + else if (newTiem >= actityBegintime && newTiem <= actityEndtime) + { + //判断是否活动进行中 + mostBeautifulVolunteerVO.setAcState("4"); + } + else if(newTiem>actityEndtime) + { + //活动结束 + mostBeautifulVolunteerVO.setAcState("5"); + } + return baseMapper.insertVolunteer(mostBeautifulVolunteerVO); } @@ -87,7 +117,7 @@ { state = "3"; } - else if (newTiem>applyEndtime) + else if (newTiem>applyEndtime && newTiem <actityBegintime ) { //报名如果截止 报名人数为0 结束活动 Integer num=0; @@ -114,7 +144,11 @@ if(!StringUtils.equals(state,itemDate.getAcState())) { itemDate.setAcState(state); - baseMapper.updateById(itemDate); + + VolunteerActivityVO comActDynVO = new VolunteerActivityVO(); + comActDynVO.setId(itemDate.getId()); + BeanUtils.copyProperties(itemDate, comActDynVO); + baseMapper.updateById(comActDynVO); } } } -- Gitblit v1.7.1