|
|
@ -12,18 +12,12 @@ import com.ccsens.game.bean.po.GameRecord; |
|
|
|
import com.ccsens.game.bean.po.GameUserJoin; |
|
|
|
import com.ccsens.game.bean.po.GameUserJoinExample; |
|
|
|
import com.ccsens.game.bean.vo.ClientVo; |
|
|
|
import com.ccsens.game.persist.dao.GameRecordDao; |
|
|
|
import com.ccsens.game.persist.dao.GameUserJoinDao; |
|
|
|
import com.ccsens.game.util.GameConstant; |
|
|
|
import com.ccsens.game.util.SendMsg; |
|
|
|
import com.ccsens.util.CodeEnum; |
|
|
|
import com.ccsens.util.JsonResponse; |
|
|
|
import com.ccsens.util.RedisUtil; |
|
|
|
import com.ccsens.util.exception.BaseException; |
|
|
|
import com.ccsens.util.mq.DelayProducer; |
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.data.redis.core.ZSetOperations; |
|
|
@ -33,10 +27,6 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
import com.ccsens.util.bean.dto.QueryDto; |
|
|
|
|
|
|
|
import java.util.*; |
|
|
|
import java.util.concurrent.Executors; |
|
|
|
import java.util.concurrent.ScheduledExecutorService; |
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* @description: |
|
|
@ -51,16 +41,12 @@ public class ClientService implements IClientService { |
|
|
|
@Autowired |
|
|
|
private GameUserJoinDao gameUserJoinDao; |
|
|
|
@Autowired |
|
|
|
private GameRecordDao gameRecordDao; |
|
|
|
@Autowired |
|
|
|
private Snowflake snowflake; |
|
|
|
@Autowired |
|
|
|
private RedisUtil redisUtil; |
|
|
|
@Autowired |
|
|
|
private TallFeignClient tallFeignClient; |
|
|
|
@Autowired |
|
|
|
private SendMsg sendMsg; |
|
|
|
@Autowired |
|
|
|
private IScreenService screenService; |
|
|
|
|
|
|
|
|
|
|
@ -157,7 +143,7 @@ public class ClientService implements IClientService { |
|
|
|
ClientVo.CompletedData completedData = new ClientVo.CompletedData(); |
|
|
|
completedData.setTimes(join.getTimes()); |
|
|
|
completedData.setScore(join.getScore()); |
|
|
|
Integer sort = gameUserJoinDao.getRanking(join.getUserId(), join.getUserId()); |
|
|
|
Integer sort = gameUserJoinDao.getRanking(join.getUserId(), gameRecord.getId()); |
|
|
|
if(ObjectUtil.isNotNull(sort)){ |
|
|
|
completedData.setSort(sort); |
|
|
|
}else { |
|
|
@ -167,7 +153,7 @@ public class ClientService implements IClientService { |
|
|
|
GameUserJoinExample joinExample = new GameUserJoinExample(); |
|
|
|
joinExample.createCriteria().andRecordIdEqualTo(gameRecord.getId()); |
|
|
|
long count = gameUserJoinDao.countByExample(joinExample); |
|
|
|
completedData.setOver((int) (low/count * 100)); |
|
|
|
completedData.setOver((int) (low * 100/count)); |
|
|
|
joinVo.setCompletedData(completedData); |
|
|
|
break; |
|
|
|
default: break; |
|
|
|