| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | 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; |
| | | import com.panzhihua.service_community.service.ComActActRegistService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Calendar; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * title: ComActActRegistServiceImpl 社区》活动》活动签到表服务实现类 |
| | |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class ComActActRegistServiceImpl extends ServiceImpl<ComActActRegistDAO, ComActActRegistDO> implements ComActActRegistService { |
| | | public class ComActActRegistServiceImpl extends ServiceImpl<ComActActRegistDAO, ComActActRegistDO> implements ComActActRegistService |
| | | { |
| | | |
| | | @Override |
| | | public R updateEndTime() |
| | | { |
| | | //获取未签退的活动id |
| | | List<String> activityList=baseMapper.getNotTimeActivityList(); |
| | | if(activityList!=null && activityList.size()>0) |
| | | { |
| | | for (String aId:activityList) |
| | | { |
| | | ComActActivityDO comActActivityDO=baseMapper.getActivityEndTime(aId); |
| | | if(comActActivityDO!=null) |
| | | { |
| | | if(comActActivityDO.getEndAt().getTime()<new Date().getTime()) |
| | | { |
| | | 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()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | } |