| | |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | | Object cacheObject = redisService.getCacheObject("ONLINE_" + userid); |
| | | if(null == cacheObject){ |
| | | redisService.setCacheObject("ONLINE_" + userid, 0, 15L, TimeUnit.MINUTES); |
| | | redisService.setCacheObject("ONLINE_" + userid, System.currentTimeMillis(), 1L, TimeUnit.HOURS); |
| | | }else{ |
| | | Integer duration = (Integer) cacheObject; |
| | | duration += 10; |
| | | Long duration = (Long) cacheObject; |
| | | long time = (System.currentTimeMillis() - duration) / 3600000; |
| | | //满足一个小时,开始发放积分,计时归0 |
| | | if(60 >= duration){ |
| | | redisService.setCacheObject("ONLINE_" + userid, 0, 15L, TimeUnit.MINUTES); |
| | | if(1 >= time){ |
| | | redisService.setCacheObject("ONLINE_" + userid, System.currentTimeMillis(), 1L, TimeUnit.HOURS); |
| | | AppUser appUser = this.getById(userid); |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | if(null != pointSetting){ |
| | |
| | | //变更等级 |
| | | vipUpgrade(appUser.getId()); |
| | | } |
| | | }else{ |
| | | redisService.setCacheObject("ONLINE_" + userid, duration, 15L, TimeUnit.MINUTES); |
| | | } |
| | | } |
| | | } |