| | |
| | | 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; |
| | |
| | | |
| | | |
| | | @Override |
| | | public IPage<NeedProblemInventoryDTO> getList(int pageNum, int pageSize, String kind, String userId,String communityId) |
| | | public IPage<NeedProblemInventoryDTO> getList(int pageNum, int pageSize,String search,String status, |
| | | String kind, |
| | | String userId, |
| | | String userIds, |
| | | String communityId) |
| | | { |
| | | Page page = new Page<>(pageNum,pageSize); |
| | | return baseMapper.getList(page,kind,userId,communityId); |
| | | return baseMapper.getList(page, search, status,kind,userId,userIds,communityId); |
| | | } |
| | | |
| | | @Override |
| | | public NeedProblemInventoryDTO getDetails(String id) { |
| | | return baseMapper.getDetails(id); |
| | | public IPage<NeedProblemInventoryDTO> getMyJoinList(int pageNum, int pageSize,String search,String status, |
| | | String kind, |
| | | String userIds, |
| | | String userId) { |
| | | Page page = new Page<>(pageNum,pageSize); |
| | | return baseMapper.getMyJoinList(page, search, status,kind,userIds,userId); |
| | | } |
| | | |
| | | @Override |
| | | public NeedProblemInventoryDTO getDetails(String id,String userIds) { |
| | | return baseMapper.getDetails(id,userIds); |
| | | } |
| | | |
| | | @Override |
| | | public int addData(NeedProblemInventoryDTO item) { |
| | | item.setStatus("1"); |
| | | return baseMapper.addData(item); |
| | | } |
| | | |
| | |
| | | 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(); |
| | | } |
| | | } |