|
@@ -6,6 +6,7 @@ import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.game.business.domain.*;
|
|
|
import com.game.business.dto.AppItemCountDTO;
|
|
|
import com.game.business.service.*;
|
|
|
+import com.game.business.util.im.TencentCloudImUtil;
|
|
|
import com.game.business.vo.AppGameItemBettingVO;
|
|
|
import com.game.common.constant.finance.FinTranType1;
|
|
|
import com.game.common.constant.finance.FinTranType2;
|
|
@@ -231,9 +232,12 @@ public class AppGameBettingTask {
|
|
|
|
|
|
this.updateItme(appGame.getId(), gameLotterySucc);
|
|
|
|
|
|
- this.gameBettingTask(appGameClassify.getId(), appGame.getId(), gameDate, gameLotterySucc);
|
|
|
+ List<String> userIds = this.gameBettingTask(appGameClassify.getId(), appGame.getId(), gameDate, gameLotterySucc);
|
|
|
|
|
|
appUserCountService.staticsUserCount(appGame.getId(),null,appGame.getGameDate());
|
|
|
+
|
|
|
+
|
|
|
+ sendMsg(userIds);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -280,11 +284,12 @@ public class AppGameBettingTask {
|
|
|
redisCache.setCacheObject("G:GameCount:" + gameId, JSON.toJSONString(nowItemCountList));
|
|
|
}
|
|
|
|
|
|
- public void gameBettingTask(Long classId, Long gameId, String gameDate, String bettingItem){
|
|
|
+ public List<String> gameBettingTask(Long classId, Long gameId, String gameDate, String bettingItem){
|
|
|
+ List<String> userIds = new ArrayList<>();
|
|
|
List<AppGameBetting> list = appGameBettingService.getIsWinning(classId, gameId, gameDate, 0);
|
|
|
|
|
|
if(list == null || list.isEmpty()){
|
|
|
- return;
|
|
|
+ return userIds;
|
|
|
}
|
|
|
|
|
|
for (int i = 0; i < list.size(); i++) {
|
|
@@ -333,7 +338,7 @@ public class AppGameBettingTask {
|
|
|
appGameBettingService.updateById(appGameBetting);
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
+ userIds.add(appUser.getUserid() + "");
|
|
|
|
|
|
if(appGameBetting.getBettingType() == 0){
|
|
|
appUser.setDiamondCoin(appUser.getDiamondCoin() + bettingAmount );
|
|
@@ -414,8 +419,19 @@ public class AppGameBettingTask {
|
|
|
|
|
|
finTranRecord.setOrderId(appGameBetting.getId());
|
|
|
finTranRecordService.insertFinTranRecord(finTranRecord);
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
+ return userIds;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void sendMsg(List<String> userIdList){
|
|
|
+ if(userIdList == null || userIdList.isEmpty()){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ JSONObject paramJson = new JSONObject();
|
|
|
+ paramJson.put("type", "UserSystemNotify");
|
|
|
+ paramJson.put("subType", "UserRefreshBalance");
|
|
|
+ paramJson.put("content", "刷新余额");
|
|
|
+ TencentCloudImUtil.imPushBatchSendMsg(userIdList, paramJson.toString());
|
|
|
}
|
|
|
}
|