joygame_游戏后台
This commit is contained in:
@@ -8,6 +8,8 @@ public class GameConstant {
|
||||
LEADERCC( "灵", "game_gold_log"),
|
||||
|
||||
BAISHUN( "百顺", "bai_shun_game_record"),
|
||||
|
||||
JOYPLAY( "JOY游戏", "joy_game_record"),
|
||||
;
|
||||
|
||||
private String desc;
|
||||
|
@@ -24,6 +24,8 @@ public class JoyGameRecord implements Serializable {
|
||||
private Long uid;
|
||||
private Long roomUid;
|
||||
private Integer coin;
|
||||
private Integer bet;
|
||||
private Integer pay;
|
||||
/**
|
||||
* 1减金币,2加金币
|
||||
*/
|
||||
|
@@ -1,7 +1,14 @@
|
||||
package com.accompany.sharding.mapper;
|
||||
|
||||
import com.accompany.sharding.model.JoyGameRecord;
|
||||
import com.accompany.sharding.vo.GameDetailVo;
|
||||
import com.accompany.sharding.vo.GameUserDataDetailVo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* joy play游戏记录 Mapper 接口
|
||||
@@ -11,4 +18,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
*/
|
||||
public interface JoyGameRecordMapper extends BaseMapper<JoyGameRecord> {
|
||||
|
||||
IPage<GameUserDataDetailVo> userTotalList(IPage<GameUserDataDetailVo> iPage, @Param("uids") List<Long> uids, @Param("gameId") String gameId,
|
||||
@Param("beginTime") Date beginTime, @Param("endTime") Date endTime, @Param("partitionId") Integer partitionId);
|
||||
|
||||
GameUserDataDetailVo userTotalStat(@Param("uids") List<Long> uids, @Param("gameId") String gameId,
|
||||
@Param("beginTime") Date beginTime, @Param("endTime") Date endTime, @Param("partitionId") Integer partitionId);
|
||||
|
||||
IPage<GameDetailVo> gameDetail(IPage<GameDetailVo> iPage, @Param("gameId") String gameId,
|
||||
@Param("beginTime") Date beginTime, @Param("endTime") Date endTime, @Param("partitionId") Integer partitionId);
|
||||
}
|
||||
|
@@ -2,4 +2,72 @@
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.accompany.sharding.mapper.JoyGameRecordMapper">
|
||||
|
||||
<select id="userTotalList" resultType="com.accompany.sharding.vo.GameUserDataDetailVo">
|
||||
select date(gr.create_time) statDate,
|
||||
u.erban_no erbanNo,
|
||||
u.nick nick,
|
||||
gr.uid uid,
|
||||
u.partition_id partitionId,
|
||||
gr.game_id gameId,
|
||||
sum(if(gr.`type` = 1, gr.`coin`, '0')) payGold,
|
||||
sum(if(gr.`type` = 2, gr.`coin`, '0')) winGold
|
||||
from joy_game_record gr
|
||||
left join users u on gr.uid = u.uid
|
||||
where gr.create_time >= #{beginTime}
|
||||
and gr.create_time <= #{endTime}
|
||||
<if test="uids != null and uids.size() >0">
|
||||
<foreach collection="uids" item="iuid" open="and gr.uid in(" separator="," close=")">
|
||||
#{iuid}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="partitionId != null and partitionId != 0">
|
||||
and u.partition_id = #{partitionId}
|
||||
</if>
|
||||
<if test="gameId != null and gameId !='' and 'All' != gameId">
|
||||
and game_id = #{gameId}
|
||||
</if>
|
||||
group by statDate,gr.uid,gr.game_id
|
||||
order by statDate desc
|
||||
</select>
|
||||
|
||||
<select id="userTotalStat" resultType="com.accompany.sharding.vo.GameUserDataDetailVo">
|
||||
select
|
||||
sum(if(gr.`type` = 1, gr.`coin`, '0')) payGold,
|
||||
sum(if(gr.`type` = 2, gr.`coin`, '0')) winGold
|
||||
from joy_game_record gr
|
||||
left join users u on gr.uid = u.uid
|
||||
where gr.create_time >= #{beginTime}
|
||||
and gr.create_time <= #{endTime}
|
||||
<if test="uids != null and uids.size() >0">
|
||||
<foreach collection="uids" item="iuid" open="and gr.uid in(" separator="," close=")">
|
||||
#{iuid}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="partitionId != null and partitionId != 0">
|
||||
and u.partition_id = #{partitionId}
|
||||
</if>
|
||||
<if test="gameId != null and gameId !='' and 'All' != gameId">
|
||||
and game_id = #{gameId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="gameDetail" resultType="com.accompany.sharding.vo.GameDetailVo">
|
||||
select date(gr.create_time) statDate,
|
||||
gr.game_id gameId,
|
||||
sum(if(gr.`type` = 1, gr.`coin`, '0')) payGold,
|
||||
sum(if(gr.`type` = 2, gr.`coin`, '0')) winGold
|
||||
from joy_game_record gr
|
||||
left join users u on gr.uid = u.uid
|
||||
where gr.create_time >= #{beginTime}
|
||||
and gr.create_time <= #{endTime}
|
||||
<if test="partitionId != null and partitionId != 0">
|
||||
and u.partition_id = #{partitionId}
|
||||
</if>
|
||||
<if test="gameId != null and gameId !='' and 'All' != gameId">
|
||||
and game_id = #{gameId}
|
||||
</if>
|
||||
group by statDate,gr.game_id
|
||||
order by statDate desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
@@ -38,8 +38,7 @@ import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.accompany.common.constant.Constant.SysConfId.BAISHUN_GAME;
|
||||
import static com.accompany.common.constant.Constant.SysConfId.LEADERCC_GAME;
|
||||
import static com.accompany.common.constant.Constant.SysConfId.*;
|
||||
import static com.accompany.common.redis.RedisKey.leadercc_token;
|
||||
import static java.util.Collections.EMPTY_LIST;
|
||||
|
||||
@@ -253,6 +252,11 @@ public class GameService {
|
||||
if (StringUtils.isNotEmpty(confValueById)) {
|
||||
gameConfigVOS = JSONObject.parseArray(confValueById, GameConfigVO.class);
|
||||
}
|
||||
} else if (GameConstant.GameChannel.JOYPLAY.name().equals(channel)) {
|
||||
String confValueById = sysConfService.getSysConfValueById(JOY_PLAY_GAME);
|
||||
if (StringUtils.isNotEmpty(confValueById)) {
|
||||
gameConfigVOS = JSONObject.parseArray(confValueById, GameConfigVO.class);
|
||||
}
|
||||
} else {
|
||||
String confValueById = sysConfService.getSysConfValueById(LEADERCC_GAME);
|
||||
if (StringUtils.isNotEmpty(confValueById)) {
|
||||
|
@@ -1,8 +1,14 @@
|
||||
package com.accompany.business.service.game;
|
||||
|
||||
import com.accompany.sharding.model.JoyGameRecord;
|
||||
import com.accompany.sharding.vo.GameDetailVo;
|
||||
import com.accompany.sharding.vo.GameUserDataDetailVo;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* joy play游戏记录 服务类
|
||||
*
|
||||
@@ -11,5 +17,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface JoyGameRecordService extends IService<JoyGameRecord> {
|
||||
|
||||
IPage<GameUserDataDetailVo> userTotalList(IPage<GameUserDataDetailVo> iPage, List<Long> uids, String gameId, Date beginTime, Date endTime, Integer partitionId);
|
||||
GameUserDataDetailVo userTotalStat(List<Long> uids, String gameId, Date beginTime, Date endTime, Integer partitionId);
|
||||
|
||||
IPage<GameDetailVo> gameDetail(IPage<GameDetailVo> iPage, String gameId, Date beginTime, Date endTime, Integer partitionId);
|
||||
|
||||
}
|
||||
|
@@ -41,6 +41,9 @@ import java.util.Date;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import static cn.hutool.core.text.StrPool.DELIM_END;
|
||||
import static cn.hutool.core.text.StrPool.DELIM_START;
|
||||
import static com.accompany.common.redis.RedisKey.banner;
|
||||
import static com.accompany.common.redis.RedisKey.joy_token;
|
||||
|
||||
@Slf4j
|
||||
@@ -84,7 +87,6 @@ public class JoyGameService {
|
||||
|
||||
public JoyResponseVo<JoySubmitResult> submitFlow(String token, String data) {
|
||||
try {
|
||||
|
||||
JoyUserInfoModel joyUserInfoModel = this.checkAndGetInfo(token);
|
||||
|
||||
JoySubmitBodyVo dataVo = JSON.parseObject(data, JoySubmitBodyVo.class);
|
||||
@@ -117,23 +119,44 @@ public class JoyGameService {
|
||||
joyGameRecord.setUid(uid);
|
||||
joyGameRecord.setCoin(joySubmitBodyVo.getCoins());
|
||||
joyGameRecord.setType(joySubmitBodyVo.getType());
|
||||
joyGameRecord.setRemark(joySubmitBodyVo.getRemark());
|
||||
String remark = joySubmitBodyVo.getRemark();
|
||||
joyGameRecord.setRemark(remark);
|
||||
joyGameRecord.setCreateTime(new Date(joySubmitBodyVo.getTm()));
|
||||
switch (joySubmitBodyVo.getType()) {
|
||||
case Constant.GameGoldType.ADD:
|
||||
joyGameRecord.setPay(joySubmitBodyVo.getCoins());
|
||||
break;
|
||||
case Constant.GameGoldType.REDUCT:
|
||||
joyGameRecord.setBet(joySubmitBodyVo.getCoins());
|
||||
break;
|
||||
default:
|
||||
log.info("JoyGameService.submitFlow,not, add-reduct,token:{},data:{}", token, data);
|
||||
return JoyResponseVo.fail(500, "type error");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(remark) && remark.startsWith(DELIM_START) && remark.endsWith(DELIM_END)) {
|
||||
JSONObject jsonObject = JSONObject.parseObject(remark);
|
||||
if (jsonObject.containsKey("bet") && jsonObject.containsKey("pay")) {
|
||||
joyGameRecord.setPay(jsonObject.getInteger("pay"));
|
||||
joyGameRecord.setBet(jsonObject.getInteger("bet"));
|
||||
}
|
||||
}
|
||||
|
||||
joyGameRecordService.save(joyGameRecord);
|
||||
|
||||
UserPurse afterPurse = null;
|
||||
GameMsgMessage gameMsgMessage = new GameMsgMessage();
|
||||
if (joySubmitBodyVo.getType() == Constant.GameGoldType.ADD) {
|
||||
// 扣减用户钻石
|
||||
afterPurse = userPurseService.addDiamond(uid, goldNum, BillObjTypeEnum.JOY_GAME_IN,
|
||||
(up) -> billRecordService.insertGeneralBillRecord(uid, orderId, BillObjTypeEnum.JOY_GAME_IN, goldNum, up));
|
||||
gameMsgMessage.setPushScreen(Boolean.TRUE);
|
||||
}
|
||||
|
||||
if (joySubmitBodyVo.getType() == Constant.GameGoldType.REDUCT) {
|
||||
// 扣减用户钻石
|
||||
afterPurse = userPurseService.subDiamond(uid, goldNum, BillObjTypeEnum.JOY_GAME_OUT,
|
||||
(up)-> billRecordService.insertGeneralBillRecord(uid, orderId, BillObjTypeEnum.JOY_GAME_OUT, goldNum, up));
|
||||
switch (joySubmitBodyVo.getType()) {
|
||||
case Constant.GameGoldType.ADD:
|
||||
// 扣减用户钻石
|
||||
afterPurse = userPurseService.addDiamond(uid, goldNum, BillObjTypeEnum.JOY_GAME_IN,
|
||||
(up) -> billRecordService.insertGeneralBillRecord(uid, orderId, BillObjTypeEnum.JOY_GAME_IN, goldNum, up));
|
||||
gameMsgMessage.setPushScreen(Boolean.TRUE);
|
||||
break;
|
||||
case Constant.GameGoldType.REDUCT:
|
||||
// 扣减用户钻石
|
||||
afterPurse = userPurseService.subDiamond(uid, goldNum, BillObjTypeEnum.JOY_GAME_OUT,
|
||||
(up) -> billRecordService.insertGeneralBillRecord(uid, orderId, BillObjTypeEnum.JOY_GAME_OUT, goldNum, up));
|
||||
break;
|
||||
}
|
||||
|
||||
gameMsgMessage.setRoomUid(joyGameRecord.getRoomUid());
|
||||
@@ -156,6 +179,7 @@ public class JoyGameService {
|
||||
return JoyResponseVo.fail(BusiStatus.SERVERERROR.getCode(), BusiStatus.SERVERERROR.getName());
|
||||
}
|
||||
}
|
||||
|
||||
private JoyUserInfoModel checkAndGetInfo(String token) throws Exception {
|
||||
String decodeToken = URLDecoder.decode(token, "UTF-8");
|
||||
String desAndBase64Decrypt = DESUtils.DESAndBase64Decrypt(decodeToken, KeyStore.DES_ENCRYPT_KEY);
|
||||
@@ -172,7 +196,7 @@ public class JoyGameService {
|
||||
return joyUserInfoModel;
|
||||
}
|
||||
|
||||
private static String decryptByPrivateKey(String data, String privateKey){
|
||||
private static String decryptByPrivateKey(String data, String privateKey) {
|
||||
try {
|
||||
RSA rsa = new RSA(privateKey, null);
|
||||
return rsa.decryptStr(data, KeyType.PrivateKey);
|
||||
@@ -206,10 +230,10 @@ public class JoyGameService {
|
||||
public RBucket<String> getToketBuket(Long uid) {
|
||||
return redissonClient.getBucket(joy_token.getKey(String.valueOf(uid)), StringCodec.INSTANCE);
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
String s = decryptByPrivateKey("b296bd72a3b1fdad5c66575c2c0c4adc110fdf58dddcedc84fb07386187c617c0ad136f21a66e2c835311bda22174aae347f285c5703326f83ae784d8eaa47a06ea6946fe971db2d74758d2cd7cdea57e15c3b439de8c6ddff9f4999f6de1e10973a3289f0dbac87a68baf44589c1a275115ca580c911e5d546669183df0b27e",
|
||||
"MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBANh5Sy6U6M+38KZU9ABEBR50m6uSQH5emKoBsS2f5junk7hd0mLsJsRcRQPGqzdG/6XcBIUkisEUo1XDUTUjWTMf3hsJSoDRSSZ0h32NxOHeogk9UrF2IGMg3PBFFtlpCfejNF05muC3QxxJ3m6Zxo544CE5yOFgkY9PP5WgXP35AgMBAAECgYAGyUKkmrFztZH7POWLTpaUflZU+hhAfemuRrBNvFoE27uDR5mtVTbf5/6X4DYE3RptkiioHd2lsOZv7VgR4OJOa7ooI6cwAhv0QtKtY7CzZAVf+BBMJeuVFIT+ds9VyXdIa5M2xSSlOj95R7GlwLYZ047oQiZvQKLpQW/7V6PoiQJBAO2zofaosxOUgGfCN1OwXcx/YHuV29MG0PJv0LdrwZmJwgqF9QIWNzaz5BE7rIp27Uu/qAsoxYmmfX077IzsFL0CQQDpI1Mnhl7eS1+9CAkv6eQdAVQocNyWfHHVcwtEbQcjactzeFkYYKri2OtxpsCFFJ/pEEwxV7nEVO9C8E/YCSftAkB0gJt8YnjKuvkoYbduTD3c8f1e9Tc1udyFRqp8i9Lqpus07y0DpdHP/OFmVOIfR2TMwJXjSktvSOuuisVI2JjdAkAX9IdA0m/BC6GkvMSk5bWIvXA2T5J67AKOWinYOBO5sc8z6DPPa29jq8JVhTrW8c2UlxYdI9R0tf13tVWe7yHpAkAkfLe8t8ZM4ftvy34HYRh/oLPqCCRFfaSRXBIRlqSpMTZYhVBclvvAkmVSn6NGc9TTRZ1RP2nGukpPFsMPokHL");
|
||||
System.out.println(s);
|
||||
}
|
||||
//
|
||||
// public static void main(String[] args) throws Exception {
|
||||
// String s = decryptByPrivateKey("b296bd72a3b1fdad5c66575c2c0c4adc110fdf58dddcedc84fb07386187c617c0ad136f21a66e2c835311bda22174aae347f285c5703326f83ae784d8eaa47a06ea6946fe971db2d74758d2cd7cdea57e15c3b439de8c6ddff9f4999f6de1e10973a3289f0dbac87a68baf44589c1a275115ca580c911e5d546669183df0b27e",
|
||||
// "MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBANh5Sy6U6M+38KZU9ABEBR50m6uSQH5emKoBsS2f5junk7hd0mLsJsRcRQPGqzdG/6XcBIUkisEUo1XDUTUjWTMf3hsJSoDRSSZ0h32NxOHeogk9UrF2IGMg3PBFFtlpCfejNF05muC3QxxJ3m6Zxo544CE5yOFgkY9PP5WgXP35AgMBAAECgYAGyUKkmrFztZH7POWLTpaUflZU+hhAfemuRrBNvFoE27uDR5mtVTbf5/6X4DYE3RptkiioHd2lsOZv7VgR4OJOa7ooI6cwAhv0QtKtY7CzZAVf+BBMJeuVFIT+ds9VyXdIa5M2xSSlOj95R7GlwLYZ047oQiZvQKLpQW/7V6PoiQJBAO2zofaosxOUgGfCN1OwXcx/YHuV29MG0PJv0LdrwZmJwgqF9QIWNzaz5BE7rIp27Uu/qAsoxYmmfX077IzsFL0CQQDpI1Mnhl7eS1+9CAkv6eQdAVQocNyWfHHVcwtEbQcjactzeFkYYKri2OtxpsCFFJ/pEEwxV7nEVO9C8E/YCSftAkB0gJt8YnjKuvkoYbduTD3c8f1e9Tc1udyFRqp8i9Lqpus07y0DpdHP/OFmVOIfR2TMwJXjSktvSOuuisVI2JjdAkAX9IdA0m/BC6GkvMSk5bWIvXA2T5J67AKOWinYOBO5sc8z6DPPa29jq8JVhTrW8c2UlxYdI9R0tf13tVWe7yHpAkAkfLe8t8ZM4ftvy34HYRh/oLPqCCRFfaSRXBIRlqSpMTZYhVBclvvAkmVSn6NGc9TTRZ1RP2nGukpPFsMPokHL");
|
||||
// System.out.println(s);
|
||||
// }
|
||||
}
|
||||
|
@@ -5,10 +5,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import com.accompany.business.constant.SymbolConstants;
|
||||
import com.accompany.business.model.game.GameDayStatData;
|
||||
import com.accompany.business.mybatismapper.game.GameDayStatDataMapper;
|
||||
import com.accompany.business.service.game.BaiShunGameRecordService;
|
||||
import com.accompany.business.service.game.GameDayStatDataService;
|
||||
import com.accompany.business.service.game.GameGoldLogService;
|
||||
import com.accompany.business.service.game.GameService;
|
||||
import com.accompany.business.service.game.*;
|
||||
import com.accompany.business.service.user.UsersService;
|
||||
import com.accompany.business.vo.game.GameConfigVO;
|
||||
import com.accompany.common.constant.GameConstant;
|
||||
@@ -64,6 +61,9 @@ public class GameDayStatDataServiceImpl extends ServiceImpl<GameDayStatDataMappe
|
||||
@Autowired
|
||||
private BaiShunGameRecordService baiShunGameRecordService;
|
||||
|
||||
@Autowired
|
||||
private JoyGameRecordService joyGameRecordService;
|
||||
|
||||
@Override
|
||||
public void statDayList(String channel, Date statTime) {
|
||||
log.info("GameDayStatDataServiceImpl.statDayList-begin channel:{}, statTime:{}", channel, statTime);
|
||||
@@ -109,6 +109,12 @@ public class GameDayStatDataServiceImpl extends ServiceImpl<GameDayStatDataMappe
|
||||
" FROM\n" +
|
||||
" `" + prefixTableName + "` g\n" +
|
||||
" LEFT JOIN users u ON g.uid = u.uid\n");
|
||||
} else if (GameConstant.GameChannel.JOYPLAY.name().equals(channel)) {
|
||||
querySql.append(" IFNULL(sum(`bet`), 0) payGold,\n" +
|
||||
" IFNULL(sum(`pay`), 0) winGold\n" +
|
||||
" FROM\n" +
|
||||
" `" + prefixTableName + "` g\n" +
|
||||
" LEFT JOIN users u ON g.uid = u.uid\n");
|
||||
}
|
||||
querySql.append(" WHERE\n" +
|
||||
" g.create_time >= ?\n" +
|
||||
@@ -229,6 +235,8 @@ public class GameDayStatDataServiceImpl extends ServiceImpl<GameDayStatDataMappe
|
||||
iPage = gameGoldLogService.userTotalList(new Page<>(pageNo, pageSize), uids, gameId, beginTime, endTime, partitionId);
|
||||
} else if (GameConstant.GameChannel.BAISHUN.equals(byChannel)) {
|
||||
iPage = baiShunGameRecordService.userTotalList(new Page<>(pageNo, pageSize), uids, gameId, beginTime, endTime, partitionId);
|
||||
} else if (GameConstant.GameChannel.JOYPLAY.equals(byChannel)) {
|
||||
iPage = joyGameRecordService.userTotalList(new Page<>(pageNo, pageSize), uids, gameId, beginTime, endTime, partitionId);
|
||||
}
|
||||
|
||||
List<GameUserDataDetailVo> records = iPage.getRecords();
|
||||
@@ -264,9 +272,11 @@ public class GameDayStatDataServiceImpl extends ServiceImpl<GameDayStatDataMappe
|
||||
if (totalStat != null && totalStat.getPayGold() != null) {
|
||||
totalStat.setPayGold(totalStat.getPayGold().multiply(BigDecimal.valueOf(-1)));
|
||||
}
|
||||
} else if (GameConstant.GameChannel.JOYPLAY.equals(byChannel)) {
|
||||
totalStat = joyGameRecordService.userTotalStat(uids, gameId, beginTime, endTime, partitionId);
|
||||
}
|
||||
if (totalStat == null) {
|
||||
return pageResult;
|
||||
return pageResult;
|
||||
}
|
||||
Map<String, Object> totalMap = pageResult.getTotalMap();
|
||||
totalMap.put("totalStat", totalStat);
|
||||
@@ -313,6 +323,8 @@ public class GameDayStatDataServiceImpl extends ServiceImpl<GameDayStatDataMappe
|
||||
if (totalStat != null && totalStat.getPayGold() != null) {
|
||||
totalStat.setPayGold(totalStat.getPayGold().multiply(BigDecimal.valueOf(-1)));
|
||||
}
|
||||
} else if (GameConstant.GameChannel.JOYPLAY.equals(byChannel)) {
|
||||
totalStat = joyGameRecordService.userTotalStat(uids, gameId, beginTime, endTime, partitionId);
|
||||
}
|
||||
if (totalStat == null) {
|
||||
totalStat = new GameUserDataDetailVo();
|
||||
@@ -332,6 +344,8 @@ public class GameDayStatDataServiceImpl extends ServiceImpl<GameDayStatDataMappe
|
||||
if (totalStat != null && totalStat.getPayGold() != null) {
|
||||
totalStat.setPayGold(totalStat.getPayGold().multiply(BigDecimal.valueOf(-1)));
|
||||
}
|
||||
} else if (GameConstant.GameChannel.JOYPLAY.equals(byChannel)) {
|
||||
totalStat = joyGameRecordService.userTotalStat(uids, gameId, beginTime, endTime, partitionId);
|
||||
}
|
||||
if (totalStat == null) {
|
||||
totalStat = new GameUserDataDetailVo();
|
||||
@@ -374,6 +388,8 @@ public class GameDayStatDataServiceImpl extends ServiceImpl<GameDayStatDataMappe
|
||||
iPage = gameGoldLogService.gameDetail(new Page<>(pageNo, pageSize), gameId, beginTime, endTime, partitionId);
|
||||
} else if (GameConstant.GameChannel.BAISHUN.equals(byChannel)) {
|
||||
iPage = baiShunGameRecordService.gameDetail(new Page<>(pageNo, pageSize), gameId, beginTime, endTime, partitionId);
|
||||
} else if (GameConstant.GameChannel.JOYPLAY.equals(byChannel)) {
|
||||
iPage = joyGameRecordService.gameDetail(new Page<>(pageNo, pageSize), gameId, beginTime, endTime, partitionId);
|
||||
}
|
||||
List<GameDetailVo> records = iPage.getRecords();
|
||||
if (CollectionUtils.isEmpty(records)) {
|
||||
@@ -421,11 +437,16 @@ public class GameDayStatDataServiceImpl extends ServiceImpl<GameDayStatDataMappe
|
||||
" IFNULL(sum(if(g.`type` = 2, g.`coin`, '0')), 0) winGold\n" +
|
||||
" FROM " + gameChannel.getPrefixTableName(splitMonth) + " g" +
|
||||
" LEFT JOIN users u ON g.uid = u.uid");
|
||||
} else {
|
||||
} else if (GameConstant.GameChannel.BAISHUN.name().equals(channel)) {
|
||||
querySql.append(" ifnull(abs(sum(if(g.currency_diff < 0, g.`currency_diff`, '0'))), 0) payGold,\n" +
|
||||
" ifnull(sum(if(g.currency_diff > 0, g.`currency_diff`, '0')), 0) winGold\n" +
|
||||
" FROM " + gameChannel.getPrefixTableName(splitMonth) + " g" +
|
||||
" LEFT JOIN users u ON g.uid = u.uid");
|
||||
} else if (GameConstant.GameChannel.JOYPLAY.name().equals(channel)) {
|
||||
querySql.append(" IFNULL(sum(`bet`), 0) payGold,\n" +
|
||||
" IFNULL(sum(`pay`), 0) winGold\n" +
|
||||
" FROM " + gameChannel.getPrefixTableName(splitMonth) + " g" +
|
||||
" LEFT JOIN users u ON g.uid = u.uid");
|
||||
}
|
||||
querySql.append(" WHERE\n" +
|
||||
" g.create_time >= ?\n" +
|
||||
|
@@ -3,9 +3,15 @@ package com.accompany.business.service.game.impl;
|
||||
import com.accompany.business.service.game.JoyGameRecordService;
|
||||
import com.accompany.sharding.mapper.JoyGameRecordMapper;
|
||||
import com.accompany.sharding.model.JoyGameRecord;
|
||||
import com.accompany.sharding.vo.GameDetailVo;
|
||||
import com.accompany.sharding.vo.GameUserDataDetailVo;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* joy play游戏记录 服务实现类
|
||||
*
|
||||
@@ -16,4 +22,19 @@ import org.springframework.stereotype.Service;
|
||||
public class JoyGameRecordServiceImpl extends ServiceImpl<JoyGameRecordMapper, JoyGameRecord> implements JoyGameRecordService {
|
||||
|
||||
|
||||
@Override
|
||||
public IPage<GameUserDataDetailVo> userTotalList(IPage<GameUserDataDetailVo> iPage, List<Long> uids, String gameId, Date beginTime, Date endTime, Integer partitionId) {
|
||||
|
||||
return baseMapper.userTotalList(iPage, uids, gameId, beginTime, endTime, partitionId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameUserDataDetailVo userTotalStat(List<Long> uids, String gameId, Date beginTime, Date endTime, Integer partitionId) {
|
||||
return baseMapper.userTotalStat(uids, gameId, beginTime, endTime, partitionId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<GameDetailVo> gameDetail(IPage<GameDetailVo> iPage, String gameId, Date beginTime, Date endTime, Integer partitionId) {
|
||||
return baseMapper.gameDetail(iPage, gameId, beginTime, endTime, partitionId);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user