| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.partybuilding.NeedProblemInventoryDTO; |
| | | import com.panzhihua.common.model.dtos.partybuilding.UserRankDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.jinhui.JinhuiExperienceActivityVO; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.service_dangjian.dao.NeedProblemInventoryDAO; |
| | | import com.panzhihua.service_dangjian.dao.NewStriveForDAO; |
| | |
| | | public int expurgateData(String id) { |
| | | return baseMapper.expurgateData(id); |
| | | } |
| | | |
| | | @Override |
| | | public R timedNewFightNeedProblemInventoryHandler() { |
| | | // 定时任务 |
| | | List<NeedProblemInventoryDTO> list = baseMapper.getTimeList(); |
| | | |
| | | for (NeedProblemInventoryDTO item : list) { |
| | | //当前时间 |
| | | long newTime = System.currentTimeMillis(); |
| | | //活动报名时间 |
| | | long applyStartTime = item.getClaimStartTime().getTime(); |
| | | //报名结束时间 |
| | | long applyEndTime = item.getClaimEndTime().getTime(); |
| | | //活动开始时间 |
| | | long activityStartTime = item.getNeedStartTime().getTime(); |
| | | //活动结束时间 |
| | | long activityEndTime = item.getNeedEndTime().getTime(); |
| | | |
| | | |
| | | switch (item.getStatus()) { |
| | | //待开始 |
| | | case "1": |
| | | if (newTime >= applyStartTime && newTime <= applyEndTime) { |
| | | NeedProblemInventoryDTO vo = new NeedProblemInventoryDTO(); |
| | | vo.setId(item.getId()); |
| | | vo.setStatus("1"); |
| | | baseMapper.editData(vo); |
| | | } |
| | | |
| | | if (newTime > applyEndTime && newTime < activityStartTime) { |
| | | //报名结束 |
| | | NeedProblemInventoryDTO vo = new NeedProblemInventoryDTO(); |
| | | vo.setId(item.getId()); |
| | | vo.setStatus("2"); |
| | | baseMapper.editData(vo); |
| | | } |
| | | |
| | | break; |
| | | //报名中 |
| | | case "2": |
| | | if (newTime >= activityStartTime && newTime <= activityEndTime) { |
| | | NeedProblemInventoryDTO vo = new NeedProblemInventoryDTO(); |
| | | vo.setId(item.getId()); |
| | | vo.setStatus("2"); |
| | | baseMapper.editData(vo); |
| | | } |
| | | break; |
| | | //已开始 |
| | | case "3": |
| | | if (newTime <= activityEndTime) { |
| | | NeedProblemInventoryDTO vo = new NeedProblemInventoryDTO(); |
| | | vo.setId(item.getId()); |
| | | vo.setStatus("3"); |
| | | baseMapper.editData(vo); |
| | | } |
| | | break; |
| | | } |
| | | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | } |