| | |
| | | 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.ComActDynVO; |
| | | import com.panzhihua.common.model.vos.community.VolunteerActivityVO; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_community.dao.VolunteerActivityDao; |
| | | import com.panzhihua.service_community.entity.VolunteerActivity; |
| | | import com.panzhihua.service_community.service.VolunteerActivityService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | |
| | |
| | | { |
| | | state = "3"; |
| | | } |
| | | else if (newTiem>applyEndtime) |
| | | else if (newTiem>applyEndtime && newTiem <actityBegintime ) |
| | | { |
| | | //报名如果截止 报名人数为0 结束活动 |
| | | Integer num=0; |