Merge branch 'main-ae'
commit
61d956b88a
|
@ -213,7 +213,10 @@ public class Constants {
|
|||
*/
|
||||
public static final String DG_API_BASE_URL = "dg.api.base.url";
|
||||
|
||||
|
||||
/**
|
||||
* ae api基本url
|
||||
*/
|
||||
public static final String AE_API_BASE_URL = "ae.api.base.url";
|
||||
/**
|
||||
* sa-api基本url
|
||||
*/
|
||||
|
|
|
@ -13,7 +13,7 @@ import java.util.stream.Stream;
|
|||
*/
|
||||
@Getter
|
||||
public enum ErrorCode {
|
||||
ERROR(500, "系统业务异常"),
|
||||
ERROR(500, "业务异常"),
|
||||
GAME_ACCOUNT_CREATION_FAILED(1001, "当前游戏账号已存在"),
|
||||
ACCOUNT_NOT_EXIST(1002, "当前游戏账号不存在"),
|
||||
PLATFORM_NOT_EXIST(1003, "游戏平台不存在"),
|
||||
|
|
|
@ -11,6 +11,7 @@ public enum GamePlatforms {
|
|||
FC("FC", "FC"),
|
||||
SA("SA", "SA"),
|
||||
DG("DG", "DG"),
|
||||
AE("AE", "AE"),
|
||||
;
|
||||
|
||||
private final String code;
|
||||
|
|
|
@ -171,6 +171,7 @@ public class ApiGameController extends BaseController {
|
|||
.currency(secretKeyCurrencyDTO.getCurrency())
|
||||
.gameId(game.getGameCode())
|
||||
.homeUrl(memberCreateApiRequest.getHomeUrl())
|
||||
.betLimit(memberCreateApiRequest.getBetLimit())
|
||||
.platform(memberCreateApiRequest.getPlatform())
|
||||
.disableFullScreen(memberCreateApiRequest.getDisableFullScreen())
|
||||
.lang(gameSecretKeyLangDTO.getLang())
|
||||
|
|
|
@ -132,6 +132,7 @@ public class ApiMemberController extends BaseController {
|
|||
.account(gameAccount)
|
||||
.agentId(gameSecretKey.getCode())
|
||||
.agentKey(gameSecretKey.getKey())
|
||||
.betLimit(memberCreateApiRequest.getBetLimit())
|
||||
.currency(gameSecretKey.getCurrency())
|
||||
.build();
|
||||
Boolean result = iGamesService.createMember(gamesBaseRequestDTO);
|
||||
|
|
|
@ -6,6 +6,7 @@ import org.hibernate.validator.constraints.Length;
|
|||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 游戏登录请求
|
||||
|
@ -59,4 +60,9 @@ public class GameLoginRequest implements Serializable {
|
|||
* 带入 1 即关闭全屏幕模式
|
||||
*/
|
||||
private Integer disableFullScreen;
|
||||
|
||||
/**
|
||||
* ae 平台 投注限额
|
||||
*/
|
||||
private Map<String, Map<String, Map<String, Object>>> betLimit;
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@ import javax.validation.constraints.NotBlank;
|
|||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 创建成员请求
|
||||
|
@ -34,4 +35,9 @@ public class MemberCreateApiRequest implements Serializable{
|
|||
@Length(max = 32, message = "currencyCode长度不能超过32个字符")
|
||||
private String currencyCode;
|
||||
|
||||
/**
|
||||
* 投注限额
|
||||
*/
|
||||
private Map<String, Map<String, Map<String, Object>>> betLimit;
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
package com.ff.game.api.ae.address;
|
||||
|
||||
import com.dtflys.forest.callback.AddressSource;
|
||||
import com.dtflys.forest.http.ForestAddress;
|
||||
import com.dtflys.forest.http.ForestRequest;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.system.service.ISysConfigService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
/**
|
||||
* 我jili address来源
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@Component
|
||||
public class MyAEAddressSource implements AddressSource {
|
||||
|
||||
@Resource
|
||||
private ISysConfigService configService;
|
||||
|
||||
|
||||
@Override
|
||||
public ForestAddress getAddress(ForestRequest request) {
|
||||
String apiBaseUrl = configService.selectConfigByKey(Constants.AE_API_BASE_URL);
|
||||
return new ForestAddress("https",apiBaseUrl, 443,"");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,101 @@
|
|||
package com.ff.game.api.ae.client;
|
||||
|
||||
import com.dtflys.forest.annotation.*;
|
||||
import com.ff.game.api.ae.address.MyAEAddressSource;
|
||||
import com.ff.game.api.ae.dto.*;
|
||||
import com.ff.game.api.jili.dto.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* xk 请求
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/02/10
|
||||
*/
|
||||
@Address(source = MyAEAddressSource.class)
|
||||
public interface AEClient {
|
||||
/**
|
||||
* 创建成员
|
||||
*
|
||||
* @param params 参数
|
||||
* @return {@link String }
|
||||
*/
|
||||
@Post(url ="/wallet/createMember",
|
||||
headers = {
|
||||
"Content-type: application/x-www-form-urlencoded"
|
||||
})
|
||||
AEResponse createMember(@Body Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 获取会员信息
|
||||
*
|
||||
* @param params 参数
|
||||
* @return {@link AEMemberInfo }
|
||||
*/
|
||||
@Post(url ="/wallet/getBalance",
|
||||
headers = {
|
||||
"Content-type: application/x-www-form-urlencoded"
|
||||
})
|
||||
AEMemberInfo getMemberInfo(@Body Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 无重定向登录
|
||||
*
|
||||
* @param params 参数
|
||||
* @return {@link AELoginResponse }
|
||||
*/
|
||||
@Post("/wallet/login")
|
||||
AELoginResponse loginWithoutRedirect(@Body Map<String, Object> params);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 按代理id进行交换转账
|
||||
*
|
||||
* @param params 参数
|
||||
* @return {@link JILIExchangeMoneyResponseDTO }
|
||||
*/
|
||||
@Post(url ="/wallet/deposit",
|
||||
headers = {
|
||||
"Content-type: application/x-www-form-urlencoded"
|
||||
})
|
||||
AETransactionResponse deposit(@Body Map<String, Object> params);
|
||||
|
||||
|
||||
@Post(url ="/wallet/withdraw",
|
||||
headers = {
|
||||
"Content-type: application/x-www-form-urlencoded"
|
||||
})
|
||||
AETransactionResponse withdraw(@Body Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 按时间获取投注记录
|
||||
*
|
||||
* @param params 参数
|
||||
* @return {@link XKBetRecordResponseDTO }
|
||||
*/
|
||||
@Post(url = "/getGameRecordByTime")
|
||||
XKBetRecordResponseDTO getBetRecordByTime(@JSONBody Map<String, Object> params);
|
||||
|
||||
|
||||
/**
|
||||
* 踢出队员
|
||||
*
|
||||
* @param params 参数
|
||||
* @return {@link JILIKickMemberDTO }
|
||||
*/
|
||||
@Post("/kickMember")
|
||||
XKKickMemberDTO kickMember(@JSONBody Map<String, Object> params);
|
||||
|
||||
/**
|
||||
* 踢出所有队员
|
||||
*
|
||||
* @param params 参数
|
||||
* @return {@link JILIKickMemberAllDTO }
|
||||
*/
|
||||
@Get("/kickMemberAll")
|
||||
XKKickMemberAllDTO kickMemberAll(@JSONBody Map<String, Object> params);
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package com.ff.game.api.ae.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* aelogin回应
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/04/01
|
||||
*/
|
||||
@Data
|
||||
public class AELoginResponse {
|
||||
/**
|
||||
* 响应状态
|
||||
*/
|
||||
@JsonProperty("status")
|
||||
private Integer status;
|
||||
|
||||
|
||||
/**
|
||||
* 描述信息 (String类型)
|
||||
* "Success" - 请求成功
|
||||
* 其他 - 错误信息
|
||||
*/
|
||||
private String desc;
|
||||
|
||||
/**
|
||||
* 登录 URL
|
||||
*/
|
||||
@JsonProperty("url")
|
||||
private String url;
|
||||
|
||||
/**
|
||||
* 扩展字段,类型为列表,可以存储多项数据
|
||||
*/
|
||||
@JsonProperty("extension")
|
||||
private List<String> extension;
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package com.ff.game.api.ae.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* AEMEMBER信息
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/03/31
|
||||
*/
|
||||
@Data
|
||||
public class AEMemberInfo {
|
||||
/**
|
||||
* 响应结果列表,包含用户信息
|
||||
*/
|
||||
@JsonProperty("results")
|
||||
private List<UserInfo> result;
|
||||
|
||||
/**
|
||||
* 记录数量
|
||||
*/
|
||||
@JsonProperty("count")
|
||||
private int count;
|
||||
|
||||
/**
|
||||
* 查询时间
|
||||
*/
|
||||
@JsonProperty("querytime")
|
||||
private Date queryTime;
|
||||
|
||||
/**
|
||||
* 响应状态
|
||||
*/
|
||||
@JsonProperty("status")
|
||||
private Integer status;
|
||||
|
||||
@Data
|
||||
public static class UserInfo {
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
@JsonProperty("userId")
|
||||
private String userId;
|
||||
|
||||
/**
|
||||
* 用户余额
|
||||
*/
|
||||
@JsonProperty("balance")
|
||||
private BigDecimal balance;
|
||||
|
||||
/**
|
||||
* 最后修改时间
|
||||
*/
|
||||
@JsonProperty("lastModified")
|
||||
private Date lastModified;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.ff.game.api.ae.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 航空响应
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/03/28
|
||||
*/
|
||||
@Data
|
||||
public class AEResponse {
|
||||
/**
|
||||
* 状态码 (String类型)
|
||||
* 0000 - 成功
|
||||
* 其他 - 错误状态码
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 描述信息 (String类型)
|
||||
* "Success" - 请求成功
|
||||
* 其他 - 错误信息
|
||||
*/
|
||||
private String desc;
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package com.ff.game.api.ae.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
/**
|
||||
* 电子交易响应
|
||||
*
|
||||
* @author shi
|
||||
* @date 2025/04/01
|
||||
*/
|
||||
@Data
|
||||
public class AETransactionResponse {
|
||||
|
||||
/**
|
||||
* 响应状态
|
||||
*/
|
||||
@JsonProperty("status")
|
||||
private String status;
|
||||
|
||||
|
||||
/**
|
||||
* 金额
|
||||
*/
|
||||
@JsonProperty("amount")
|
||||
private BigDecimal amount;
|
||||
|
||||
/**
|
||||
* 交易方法(如:DEPOSIT, WITHDRAW)
|
||||
*/
|
||||
@JsonProperty("method")
|
||||
private String method;
|
||||
|
||||
/**
|
||||
* 数据库ID
|
||||
*/
|
||||
@JsonProperty("databaseId")
|
||||
private int databaseId;
|
||||
|
||||
/**
|
||||
* 当前余额
|
||||
*/
|
||||
@JsonProperty("currentBalance")
|
||||
private BigDecimal currentBalance;
|
||||
|
||||
/**
|
||||
* 最后修改时间
|
||||
*/
|
||||
@JsonProperty("lastModified")
|
||||
private ZonedDateTime lastModified;
|
||||
|
||||
/**
|
||||
* 交易代码
|
||||
*/
|
||||
@JsonProperty("txCode")
|
||||
private String txCode;
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
package com.ff.game.api.ae.dto;
|
||||
|
||||
import io.jsonwebtoken.lang.Collections;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class XKBetRecordResponseDTO {
|
||||
|
||||
private Integer code;
|
||||
private String msg;
|
||||
private DataBean data;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class DataBean {
|
||||
private Integer currentPage;
|
||||
private Integer totalPages;
|
||||
private Integer pageLimit;
|
||||
private Integer totalNumber;
|
||||
private List<ResultBean> result;
|
||||
|
||||
public List<ResultBean> getResult() {
|
||||
if (Collections.isEmpty(result)) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class ResultBean {
|
||||
private String account;
|
||||
private Long wagersId;
|
||||
private String gameId;
|
||||
private Long wagersTime;
|
||||
private BigDecimal betAmount;
|
||||
private Long payoffTime;
|
||||
private BigDecimal payoffAmount;
|
||||
private Integer status;
|
||||
private Long settlementTime;
|
||||
private Integer gameCategoryId;
|
||||
private Integer type;
|
||||
private String agentId;
|
||||
private BigDecimal turnover;
|
||||
private Long roundIndex;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.ff.game.api.ae.dto;
|
||||
|
||||
|
||||
import com.ff.game.api.request.GamesBaseRequestDTO;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
/**
|
||||
* 创建成员响应dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/22
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class XKCreateMemberResponseDTO extends GamesBaseRequestDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 代码
|
||||
*/
|
||||
private int code;
|
||||
/**
|
||||
* 数据
|
||||
*/
|
||||
private String data;
|
||||
/**
|
||||
* msg
|
||||
*/
|
||||
private String msg;
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.ff.game.api.ae.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class XKExchangeMoneyResponseDTO {
|
||||
|
||||
private int code;
|
||||
private String msg;
|
||||
private DataBean data;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class DataBean {
|
||||
/**
|
||||
* 交易序号,额度转移纪录唯一值, 长度上限 50
|
||||
*/
|
||||
private String transactionId;
|
||||
/**
|
||||
* 转账前金额(游戏币)
|
||||
*/
|
||||
private BigDecimal coinBefore;
|
||||
/**
|
||||
* 转账后金额(游戏币)
|
||||
*/
|
||||
private BigDecimal coinAfter;
|
||||
/**
|
||||
* 转账前金额(指定货币)
|
||||
*/
|
||||
private BigDecimal currencyBefore;
|
||||
/**
|
||||
* 转账后金额(指定货币)
|
||||
*/
|
||||
private BigDecimal currencyAfter;
|
||||
/**
|
||||
* 状态:
|
||||
* 1: 成功
|
||||
* 2: 失败
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.ff.game.api.ae.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* xkkick会员全部dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/11/13
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public class XKKickMemberAllDTO {
|
||||
/**
|
||||
* 代码
|
||||
*/
|
||||
private int code;
|
||||
/**
|
||||
* 数据
|
||||
*/
|
||||
private String data;
|
||||
/**
|
||||
* msg
|
||||
*/
|
||||
private String msg;
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.ff.game.api.ae.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class XKKickMemberDTO {
|
||||
|
||||
private int code;
|
||||
private String msg;
|
||||
private Object data;
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.ff.game.api.ae.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 登录时不重定向响应dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/22
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class XKLoginWithoutRedirectResponseDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 代码
|
||||
*/
|
||||
private int code;
|
||||
/**
|
||||
* 数据
|
||||
*/
|
||||
private String data;
|
||||
/**
|
||||
* msg
|
||||
*/
|
||||
private String msg;
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.ff.game.api.ae.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员信息dto
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/10/30
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class XKMemberInfoDTO {
|
||||
|
||||
|
||||
/**
|
||||
* 代码
|
||||
*/
|
||||
private Integer code;
|
||||
/**
|
||||
* msg
|
||||
*/
|
||||
private String msg;
|
||||
/**
|
||||
* 数据
|
||||
*/
|
||||
private List<DataBean> data;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public static class DataBean {
|
||||
/**
|
||||
* 账户
|
||||
*/
|
||||
private String account;
|
||||
/**
|
||||
* 平衡
|
||||
*/
|
||||
private BigDecimal balance;
|
||||
/**
|
||||
* 地位
|
||||
*/
|
||||
private Integer status;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,585 @@
|
|||
package com.ff.game.api.ae.impl;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.ff.base.constant.CacheConstants;
|
||||
import com.ff.base.constant.Constants;
|
||||
import com.ff.base.core.redis.RedisCache;
|
||||
import com.ff.base.enums.*;
|
||||
import com.ff.base.exception.base.ApiException;
|
||||
import com.ff.base.exception.base.BaseException;
|
||||
import com.ff.base.system.service.ISysConfigService;
|
||||
import com.ff.base.utils.DateUtils;
|
||||
import com.ff.base.utils.JsonUtil;
|
||||
import com.ff.base.utils.uuid.IdUtils;
|
||||
import com.ff.config.KeyConfig;
|
||||
import com.ff.game.api.IGamesService;
|
||||
import com.ff.game.api.ae.client.AEClient;
|
||||
import com.ff.game.api.ae.dto.*;
|
||||
import com.ff.game.api.request.*;
|
||||
import com.ff.game.api.xk.dto.XKGamesDTO;
|
||||
import com.ff.game.domain.*;
|
||||
import com.ff.game.dto.GameSecretKeyCurrencyDTO;
|
||||
import com.ff.game.service.*;
|
||||
import com.ff.member.domain.Member;
|
||||
import com.ff.member.service.IMemberService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
/**
|
||||
* AE 游戏 impl
|
||||
*
|
||||
* @author shi
|
||||
* @date 2024/11/12
|
||||
*/
|
||||
@Service("AEService")
|
||||
@Slf4j
|
||||
public class GamesAEServiceImpl implements IGamesService {
|
||||
|
||||
|
||||
@Resource
|
||||
private ISysConfigService configService;
|
||||
|
||||
@Resource
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Resource
|
||||
private IGameExchangeMoneyService gameExchangeMoneyService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IGamePlatformService gamePlatformService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IGameService gameService;
|
||||
|
||||
|
||||
@Resource
|
||||
private IMemberService memberService;
|
||||
|
||||
@Resource
|
||||
private IGameFreeRecordService gameFreeRecordService;
|
||||
@Resource
|
||||
private IGameSecretKeyService gameSecretKeyService;
|
||||
|
||||
@Resource
|
||||
private IGameSecretKeyCurrencyService gameSecretKeyCurrencyService;
|
||||
|
||||
@Resource
|
||||
private AEClient AEClient;
|
||||
|
||||
|
||||
@Resource
|
||||
private KeyConfig keyConfig;
|
||||
|
||||
@Resource
|
||||
private IGameBettingDetailsService gameBettingDetailsService;
|
||||
|
||||
@Resource
|
||||
private IGameNameService gameNameService;
|
||||
|
||||
|
||||
/**
|
||||
* 游戏id
|
||||
*/
|
||||
private static final Long GAME_ID = 1904452832756013817L;
|
||||
|
||||
/**
|
||||
* 平台ID
|
||||
*/
|
||||
private static final Long PLATFORM_ID = 1904411420257108325L;
|
||||
|
||||
/**
|
||||
* 游戏名称id
|
||||
*/
|
||||
private static final Long GAME_NAME_ID = 1904452833756002317L;
|
||||
|
||||
/**
|
||||
* 获得就是成功
|
||||
*
|
||||
* @param errorCode 错误代码
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
private Boolean getIsSuccess(Integer errorCode) {
|
||||
return 0 == errorCode;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取密钥
|
||||
*
|
||||
* @param gamesBaseRequestDTO 游戏请求dto
|
||||
* @return {@link Map }<{@link String }, {@link Object }>
|
||||
*/
|
||||
private Map<String, Object> getKey(GamesBaseRequestDTO gamesBaseRequestDTO) {
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("cert", gamesBaseRequestDTO.getAgentKey());
|
||||
params.put("agentId", gamesBaseRequestDTO.getAgentId());
|
||||
return params;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建成员
|
||||
*
|
||||
* @param createMemberRequestDTO 创建成员请求dto
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean createMember(CreateMemberRequestDTO createMemberRequestDTO) {
|
||||
log.info("GamesAEServiceImpl [createMember] 请求参数 {}", createMemberRequestDTO);
|
||||
|
||||
Map<String, Object> params = this.getKey(createMemberRequestDTO);
|
||||
params.put("userId", createMemberRequestDTO.getAccount());
|
||||
params.put("currency", createMemberRequestDTO.getCurrency());
|
||||
params.put("betLimit", JsonUtil.objToString(createMemberRequestDTO.getBetLimit()));
|
||||
AEResponse aeResponse = AEClient.createMember(params);
|
||||
String errorCode = aeResponse.getStatus();
|
||||
if (this.getIsSuccess(Integer.valueOf(errorCode))) {
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
//判断是否获取成功
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取会员信息
|
||||
*
|
||||
* @param memberInfoRequestDTO 会员信息请求dto
|
||||
* @return {@link MemberInfoResponseDTO }
|
||||
*/
|
||||
@Override
|
||||
public MemberInfoResponseDTO getMemberInfo(MemberInfoRequestDTO memberInfoRequestDTO) {
|
||||
log.info("GamesAEServiceImpl [getMemberInfo] 请求参数 {}", memberInfoRequestDTO);
|
||||
Map<String, Object> params = this.getKey(memberInfoRequestDTO);
|
||||
params.put("alluser", 0);
|
||||
params.put("userIds", memberInfoRequestDTO.getAccounts());
|
||||
AEMemberInfo memberInfo = AEClient.getMemberInfo(params);
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(memberInfo.getStatus())) {
|
||||
AEMemberInfo.UserInfo userInfo = memberInfo.getResult().get(0);
|
||||
return MemberInfoResponseDTO.builder()
|
||||
.status(GameMemberStatus.UNKNOWN.getCode())
|
||||
.balance(userInfo.getBalance())
|
||||
.account(memberInfoRequestDTO.getAccounts())
|
||||
.build();
|
||||
} else {
|
||||
throw new ApiException(ErrorCode.ERROR.getCode());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 无重定向登录
|
||||
*
|
||||
* @param gamesLogin 游戏登录
|
||||
* @return {@link String }
|
||||
*/
|
||||
@Override
|
||||
public String loginWithoutRedirect(GamesLogin gamesLogin) {
|
||||
log.info("GamesAEServiceImpl [loginWithoutRedirect] 请求参数 {}", gamesLogin);
|
||||
|
||||
Map<String, Object> params = this.getKey(gamesLogin);
|
||||
params.put("userId", gamesLogin.getAccount());
|
||||
params.put("externalURL", gamesLogin.getHomeUrl());
|
||||
params.put("language", gamesLogin.getLang());
|
||||
params.put("betLimit", gamesLogin.getBetLimit());
|
||||
AELoginResponse aeLoginResponse = AEClient.loginWithoutRedirect(params);
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(aeLoginResponse.getStatus())) {
|
||||
return aeLoginResponse.getUrl();
|
||||
} else {
|
||||
throw new BaseException(aeLoginResponse.getDesc());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取游戏列表
|
||||
*
|
||||
* @param gamesBaseRequestDTO 游戏请求dto
|
||||
* @return {@link String }
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public String getGameList(GamesBaseRequestDTO gamesBaseRequestDTO) {
|
||||
GamePlatform gamePlatform = gamePlatformService.selectGamePlatformById(PLATFORM_ID);
|
||||
//没有此平台就新增一个平台
|
||||
if (ObjectUtils.isEmpty(gamePlatform)) {
|
||||
gamePlatform = new GamePlatform();
|
||||
gamePlatform.setId(PLATFORM_ID);
|
||||
gamePlatform.setPlatformCode(GamePlatforms.AE.getInfo());
|
||||
gamePlatform.setPlatformType(PlatformType.GAME_HALL.getCode());
|
||||
gamePlatform.setPlatformName(GamePlatforms.AE.getInfo() + PlatformType.GAME_HALL.getName());
|
||||
gamePlatform.setSortNo(gamePlatformService.selectMaxSortNo() + 1);
|
||||
gamePlatform.setCreateBy(Constants.SYSTEM);
|
||||
gamePlatformService.insertGamePlatform(gamePlatform);
|
||||
}
|
||||
Game game = gameService.selectGameById(GAME_ID);
|
||||
//不存在这个游戏
|
||||
if (ObjectUtils.isEmpty(game)) {
|
||||
game = new Game();
|
||||
game.setId(GAME_ID);
|
||||
game.setSortNo(gameService.selectMaxSortNoByPlatformId(gamePlatform.getId()) + 1);
|
||||
game.setPlatformId(gamePlatform.getId());
|
||||
game.setGameCode("1");
|
||||
game.setGameSourceType(String.valueOf(1));
|
||||
game.setGameName("AE大厅");
|
||||
game.setCreateBy(Constants.SYSTEM);
|
||||
gameService.insertGame(game);
|
||||
}
|
||||
GameName gameName = gameNameService.selectGameNameById(GAME_NAME_ID);
|
||||
if (ObjectUtils.isEmpty(gameName)) {
|
||||
gameNameService.insertGameName(GameName.builder()
|
||||
.id(GAME_NAME_ID)
|
||||
.gameId(game.getId())
|
||||
.gameName(game.getGameName())
|
||||
.langCode("zh-CN")
|
||||
.createBy(Constants.SYSTEM)
|
||||
.build());
|
||||
}
|
||||
|
||||
return CacheConstants.XK_GAMES;
|
||||
}
|
||||
|
||||
/**
|
||||
* 按代理id进行交换转账
|
||||
*
|
||||
* @param exchangeTransferMoneyRequestDTO 外汇转账moeny dto
|
||||
* @return {@link Long }
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public Long exchangeTransferByAgentId(ExchangeTransferMoneyRequestDTO exchangeTransferMoneyRequestDTO) {
|
||||
log.info("GamesAEServiceImpl [exchangeTransferByAgentId] 请求参数 {}", exchangeTransferMoneyRequestDTO);
|
||||
GameSecretKeyCurrency currencyDTO = gameSecretKeyCurrencyService.findByGameSecretKeyCurrencyDTO(GameSecretKeyCurrencyDTO.builder()
|
||||
.platformCode(GamePlatforms.AE.getInfo())
|
||||
.code(exchangeTransferMoneyRequestDTO.getAgentId())
|
||||
.build());
|
||||
|
||||
Member member = memberService.selectMemberByGameAccount(exchangeTransferMoneyRequestDTO.getAccount());
|
||||
String transactionId = GamePlatforms.AE.getCode() + IdUtils.simpleUUID();
|
||||
List<GameExchangeMoney> gameExchangeMonies = gameExchangeMoneyService.selectGameExchangeMoneyList(
|
||||
GameExchangeMoney.builder()
|
||||
.tenantKey(exchangeTransferMoneyRequestDTO.getTenantKey())
|
||||
.orderId(exchangeTransferMoneyRequestDTO.getOrderId())
|
||||
.build()
|
||||
);
|
||||
Assert.isTrue(CollectionUtils.isEmpty(gameExchangeMonies), "订单号重复");
|
||||
|
||||
//获取下一个自增id
|
||||
GameExchangeMoney exchangeMoney = GameExchangeMoney
|
||||
.builder()
|
||||
.tenantKey(exchangeTransferMoneyRequestDTO.getTenantKey())
|
||||
.orderId(exchangeTransferMoneyRequestDTO.getOrderId())
|
||||
.quota(exchangeTransferMoneyRequestDTO.getQuota())
|
||||
.balance(exchangeTransferMoneyRequestDTO.getAmount())
|
||||
.exchangeType(exchangeTransferMoneyRequestDTO.getTransferType())
|
||||
.currencyCode(currencyDTO.getSystemCurrency())
|
||||
.memberId(member.getId())
|
||||
.transactionId(transactionId)
|
||||
.platformCode(GamePlatforms.AE.getInfo())
|
||||
.build();
|
||||
exchangeMoney.setCreateBy(Constants.SYSTEM);
|
||||
Map<String, Object> params = this.getKey(exchangeTransferMoneyRequestDTO);
|
||||
AETransactionResponse deposit = null;
|
||||
try {
|
||||
if (TransferType.GAMES.getCode().equals(exchangeTransferMoneyRequestDTO.getTransferType())) {
|
||||
|
||||
params.put("userId", exchangeTransferMoneyRequestDTO.getAccount());
|
||||
params.put("txCode", transactionId);
|
||||
params.put("transferAmount", exchangeTransferMoneyRequestDTO.getAmount());
|
||||
deposit = AEClient.deposit(params);
|
||||
|
||||
} else {
|
||||
params.put("userId", exchangeTransferMoneyRequestDTO.getAccount());
|
||||
params.put("txCode", transactionId);
|
||||
params.put("withdrawType", 1);
|
||||
deposit = AEClient.withdraw(params);
|
||||
}
|
||||
} finally {
|
||||
|
||||
//更新数据
|
||||
exchangeMoney.setBalance(deposit.getAmount());
|
||||
exchangeMoney.setCoinBefore(NumberUtil.sub(deposit.getCurrentBalance(), deposit.getAmount()));
|
||||
exchangeMoney.setCoinAfter(deposit.getCurrentBalance());
|
||||
exchangeMoney.setCurrencyBefore(exchangeMoney.getCoinBefore());
|
||||
exchangeMoney.setCurrencyAfter(exchangeMoney.getCoinAfter());
|
||||
//判断是否转移成功
|
||||
if ("0000".equals(deposit.getStatus())) {
|
||||
exchangeMoney.setStatus(StatusType.SUCCESS.getValue());
|
||||
} else {
|
||||
exchangeMoney.setStatus(StatusType.IN_PROGRESS.getValue());
|
||||
}
|
||||
|
||||
gameExchangeMoneyService.insertGameExchangeMoney(exchangeMoney);
|
||||
}
|
||||
|
||||
|
||||
return exchangeMoney.getId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 汇兑转移状态
|
||||
*
|
||||
* @param exchangeTransferMoneyRequestDTO 兑换转账请求dto
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean exchangeTransferStatus(ExchangeTransferStatusRequestDTO exchangeTransferMoneyRequestDTO) {
|
||||
log.info("GamesAEServiceImpl [exchangeTransferStatus] 请求参数 {}", exchangeTransferMoneyRequestDTO);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 按时间获取投注记录
|
||||
*
|
||||
* @param betRecordByTimeDTO 按时间dto投注记录
|
||||
* @return {@link List }<{@link GameBettingDetails }>
|
||||
*/
|
||||
@Override
|
||||
public Boolean getBetRecordByTime(BetRecordByTimeDTO betRecordByTimeDTO) {
|
||||
List<GameBettingDetails> gameBettingDetails = new ArrayList<>();
|
||||
//请求参数
|
||||
log.info("GamesXKServiceImpl [getBetRecordByTime] 请求参数 {}", betRecordByTimeDTO);
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("startTime", betRecordByTimeDTO.getStartTime());
|
||||
params.put("endTime", betRecordByTimeDTO.getEndTime());
|
||||
params.put("page", betRecordByTimeDTO.getPage());
|
||||
params.put("pageLimit", betRecordByTimeDTO.getPageLimit());
|
||||
params.put("agentId", betRecordByTimeDTO.getAgentId());
|
||||
String query = JsonUtil.mapToQueryString(params);
|
||||
betRecordByTimeDTO.setQuery(query);
|
||||
Map<String, Object> key = this.getKey(betRecordByTimeDTO);
|
||||
params.put("key", key);
|
||||
XKBetRecordResponseDTO xkBetRecordResponseDTO = AEClient.getBetRecordByTime(params);
|
||||
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(xkBetRecordResponseDTO.getCode())) {
|
||||
//数据组装
|
||||
XKBetRecordResponseDTO.DataBean dataBean = xkBetRecordResponseDTO.getData();
|
||||
this.batchInsert(xkBetRecordResponseDTO);
|
||||
|
||||
//获取下一页数据
|
||||
while (!Objects.equals(dataBean.getCurrentPage(), dataBean.getTotalPages()) && dataBean.getTotalPages() > 0) {
|
||||
betRecordByTimeDTO.setPage(dataBean.getCurrentPage() + 1);
|
||||
//请求参数
|
||||
params = new LinkedHashMap<>();
|
||||
params.put("startTime", betRecordByTimeDTO.getStartTime());
|
||||
params.put("endTime", betRecordByTimeDTO.getEndTime());
|
||||
params.put("page", betRecordByTimeDTO.getPage());
|
||||
params.put("pageLimit", betRecordByTimeDTO.getPageLimit());
|
||||
params.put("agentId", betRecordByTimeDTO.getAgentId());
|
||||
query = JsonUtil.mapToQueryString(params);
|
||||
betRecordByTimeDTO.setQuery(query);
|
||||
key = this.getKey(betRecordByTimeDTO);
|
||||
params.put("key", key);
|
||||
xkBetRecordResponseDTO = AEClient.getBetRecordByTime(params);
|
||||
this.batchInsert(xkBetRecordResponseDTO);
|
||||
}
|
||||
|
||||
|
||||
return Boolean.TRUE;
|
||||
} else {
|
||||
log.error("GamesXKServiceImpl [getBetRecordByTime] 获取投注记录失败,错误代码{},错误信息{}", xkBetRecordResponseDTO.getCode(), xkBetRecordResponseDTO.getMsg());
|
||||
throw new BaseException(xkBetRecordResponseDTO.getMsg());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 按历史时间获取投注记录
|
||||
*
|
||||
* @param betRecordByTimeDTO 按时间dto投注记录
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean getBetRecordByHistoryTime(BetRecordByTimeDTO betRecordByTimeDTO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 赠送免费局数
|
||||
*
|
||||
* @param createFreeSpinRequest 创建自由旋转请求
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean createFreeSpin(CreateFreeSpinRequestDTO createFreeSpinRequest) {
|
||||
throw new ApiException(ErrorCode.PLATFORM_NOT_METHODS.getCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取游戏详细信息
|
||||
*
|
||||
* @param getGameDetailRequestDTO 获取游戏详细信息请求dto
|
||||
* @return {@link GetGameDetailResponseDTO }
|
||||
*/
|
||||
@Override
|
||||
public GetGameDetailResponseDTO getGameDetail(GetGameDetailRequestDTO getGameDetailRequestDTO) {
|
||||
throw new ApiException(ErrorCode.PLATFORM_NOT_METHODS.getCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* 强制会员从游戏注销
|
||||
*
|
||||
* @param kickMemberRequestDTO 踢会员请求dto
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean kickMember(KickMemberRequestDTO kickMemberRequestDTO) {
|
||||
log.info("GamesXKServiceImpl [kickMember] 请求参数 {}", kickMemberRequestDTO);
|
||||
Map<String, Object> params = new LinkedHashMap<>();
|
||||
params.put("account", kickMemberRequestDTO.getAccount());
|
||||
params.put("agentId", kickMemberRequestDTO.getAgentId());
|
||||
String query = JsonUtil.mapToQueryString(params);
|
||||
kickMemberRequestDTO.setQuery(query);
|
||||
Map<String, Object> key = this.getKey(kickMemberRequestDTO);
|
||||
params.put("key", key);
|
||||
XKKickMemberDTO xkKickMemberDTO = AEClient.kickMember(params);
|
||||
//判断是否获取成功
|
||||
if (this.getIsSuccess(xkKickMemberDTO.getCode())) {
|
||||
return Boolean.TRUE;
|
||||
} else {
|
||||
throw new BaseException(xkKickMemberDTO.getMsg());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 踢成员全部
|
||||
*
|
||||
* @param kickMemberAllDTO 踢成员全部dto
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean kickMemberAll(KickMemberAllDTO kickMemberAllDTO) {
|
||||
throw new ApiException(ErrorCode.PLATFORM_NOT_METHODS.getCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* 免费游戏玩家使用的纪录
|
||||
*
|
||||
* @param getFreeSpinDashflowRequestDTO 获取自由旋转dashflow请求dto
|
||||
* @return {@link List }<{@link GameFreeRecord }>
|
||||
*/
|
||||
@Override
|
||||
public List<GameFreeRecord> getFreeSpinDashflow(GetFreeSpinDashflowRequestDTO getFreeSpinDashflowRequestDTO) {
|
||||
throw new ApiException(ErrorCode.PLATFORM_NOT_METHODS.getCode());
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消赠送免费局数
|
||||
*
|
||||
* @param cancelFreeSpinRequestDTO 取消免费旋转请求
|
||||
* @return {@link Boolean }
|
||||
*/
|
||||
@Override
|
||||
public Boolean cancelFreeSpin(CancelFreeSpinRequestDTO cancelFreeSpinRequestDTO) {
|
||||
throw new ApiException(ErrorCode.PLATFORM_NOT_METHODS.getCode());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量插入
|
||||
*
|
||||
* @param xkBetRecordResponseDTO xk下注记录响应dto
|
||||
*/
|
||||
private void batchInsert(XKBetRecordResponseDTO xkBetRecordResponseDTO) {
|
||||
List<GameBettingDetails> gameBettingDetails = new ArrayList<>();
|
||||
List<String> wagersIds = new ArrayList<>();
|
||||
//数据组装
|
||||
XKBetRecordResponseDTO.DataBean dataBean = xkBetRecordResponseDTO.getData();
|
||||
//数据转化
|
||||
for (XKBetRecordResponseDTO.DataBean.ResultBean bean : dataBean.getResult()) {
|
||||
GameBettingDetails bettingDetails = this.dataBuild(GamesDataBuildDTO.builder().data(bean).build());
|
||||
if (!ObjectUtils.isEmpty(bettingDetails)) {
|
||||
bettingDetails.setId(IdUtil.getSnowflakeNextId());
|
||||
gameBettingDetails.add(bettingDetails);
|
||||
}
|
||||
wagersIds.add(String.valueOf(bean.getWagersId()));
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(gameBettingDetails)) {
|
||||
//查询重复数据id
|
||||
List<String> removeWagersIds = gameBettingDetailsService.selectGameBettingDetailsByWagersId(wagersIds,GamePlatforms.AE.getInfo());
|
||||
//用steam流清除list中与wagersIds集合相同的数据
|
||||
gameBettingDetails = gameBettingDetails.stream()
|
||||
.filter(detail -> !removeWagersIds.contains(detail.getWagersId()))
|
||||
.collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(gameBettingDetails)) {
|
||||
gameBettingDetailsService.batchInsert(gameBettingDetails);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据构建
|
||||
*
|
||||
* @param gamesDataBuildDTO 数据
|
||||
* @return {@link GameBettingDetails }
|
||||
*/
|
||||
@Override
|
||||
public GameBettingDetails dataBuild(GamesDataBuildDTO gamesDataBuildDTO) {
|
||||
//转化类
|
||||
XKBetRecordResponseDTO.DataBean.ResultBean resultBean = (XKBetRecordResponseDTO.DataBean.ResultBean) gamesDataBuildDTO.getData();
|
||||
|
||||
GameSecretKeyCurrency currencyDTO = gameSecretKeyCurrencyService.findByGameSecretKeyCurrencyDTO(GameSecretKeyCurrencyDTO.builder()
|
||||
.platformCode(GamePlatforms.XK.getInfo())
|
||||
.code(resultBean.getAgentId())
|
||||
.build());
|
||||
|
||||
Member member = memberService.selectMemberByGameAccount(resultBean.getAccount());
|
||||
if (ObjectUtils.isEmpty(member)) {
|
||||
return null;
|
||||
}
|
||||
List<XKGamesDTO.DataBean> gamesDatas = redisCache.getCacheList(CacheConstants.XK_GAMES);
|
||||
Map<String, XKGamesDTO.DataBean> dataDTOMap = gamesDatas.stream().collect(Collectors.toMap(XKGamesDTO.DataBean::getGameId, e -> e));
|
||||
XKGamesDTO.DataBean gamesDataDTO = dataDTOMap.get(resultBean.getGameId());
|
||||
BigDecimal payoffAmount = BigDecimal.ZERO;
|
||||
|
||||
if (GameStatus.WIN.getCode().equals(resultBean.getStatus())) {
|
||||
payoffAmount = NumberUtil.sub(resultBean.getPayoffAmount(), resultBean.getTurnover());
|
||||
} else if (GameStatus.FAIL.getCode().equals(resultBean.getStatus())) {
|
||||
payoffAmount = NumberUtil.sub(resultBean.getPayoffAmount(), resultBean.getTurnover()).negate();
|
||||
}
|
||||
//数据构造
|
||||
GameBettingDetails gameBettingDetails = GameBettingDetails.builder()
|
||||
.tenantKey(member.getTenantKey())
|
||||
//保存我们的币种id
|
||||
.currencyCode(currencyDTO.getSystemCurrency())
|
||||
.memberId(member.getId())
|
||||
.gameCode(resultBean.getGameId())
|
||||
.gameType(XKGameType.findSystemByCode(resultBean.getGameCategoryId()))
|
||||
.platformCode(GamePlatforms.XK.getCode())
|
||||
.gameId(gamesDataDTO.getSystemGameId())
|
||||
.gameName(gamesDataDTO.getName())
|
||||
.gameStatus(resultBean.getStatus())
|
||||
.gameStatusType(resultBean.getType())
|
||||
.gameCurrencyCode(resultBean.getAgentId())
|
||||
.account(String.valueOf(resultBean.getAccount()))
|
||||
.wagersId(String.valueOf(resultBean.getWagersId()))
|
||||
.wagersTime(resultBean.getWagersTime())
|
||||
.betAmount(resultBean.getBetAmount().abs())
|
||||
.payoffTime(resultBean.getPayoffTime())
|
||||
.payoffAmount(payoffAmount)
|
||||
.settlementTime(resultBean.getSettlementTime())
|
||||
.turnover(resultBean.getTurnover())
|
||||
.orderNo(String.valueOf(resultBean.getRoundIndex()))
|
||||
.settlementStatus(SettlementStatusEnum.COMPLETED.getCode())
|
||||
.build();
|
||||
gameBettingDetails.setCreateBy(Constants.SYSTEM);
|
||||
gameBettingDetails.setCreateTime(DateUtils.getNowDate());
|
||||
return gameBettingDetails;
|
||||
}
|
||||
}
|
|
@ -534,7 +534,7 @@ public class GamesDGServiceImpl implements IGamesService {
|
|||
}
|
||||
if (!CollectionUtils.isEmpty(gameBettingDetails)) {
|
||||
//查询重复数据id
|
||||
List<String> removeWagersIds = gameBettingDetailsService.selectGameBettingDetailsByWagersId(wagersIds);
|
||||
List<String> removeWagersIds = gameBettingDetailsService.selectGameBettingDetailsByWagersId(wagersIds,GamePlatforms.DG.getInfo());
|
||||
//用steam流清除list中与wagersIds集合相同的数据
|
||||
gameBettingDetails = gameBettingDetails.stream()
|
||||
.filter(detail -> !removeWagersIds.contains(detail.getWagersId()))
|
||||
|
|
|
@ -278,7 +278,7 @@ public class GamesFCServiceImpl implements IGamesService {
|
|||
Map<String, ApiFCGameListResponseDTO.GameDetails> integerGameDetailsMap = gameList.getGetGameIconList().get(gameTypeKey);
|
||||
GamePlatform gamePlatform = GamePlatform.builder()
|
||||
.platformType(FCGameType.findSystemByCode(gameTypeKey))
|
||||
.platformCode(GamePlatforms.FC.getCode())
|
||||
.platformCode(GamePlatforms.FC.getInfo())
|
||||
.build();
|
||||
List<GamePlatform> gamePlatforms = gamePlatformService.selectGamePlatformList(gamePlatform);
|
||||
//没有此平台就新增一个平台
|
||||
|
@ -360,13 +360,13 @@ public class GamesFCServiceImpl implements IGamesService {
|
|||
log.info("GamesFCServiceImpl [exchangeTransferByAgentId] 请求参数 {}", exchangeTransferMoneyRequestDTO);
|
||||
|
||||
GameSecretKeyCurrency currencyDTO = gameSecretKeyCurrencyService.findByGameSecretKeyCurrencyDTO(GameSecretKeyCurrencyDTO.builder()
|
||||
.platformCode(GamePlatforms.FC.getCode())
|
||||
.platformCode(GamePlatforms.FC.getInfo())
|
||||
.code(exchangeTransferMoneyRequestDTO.getAgentId())
|
||||
.currency(exchangeTransferMoneyRequestDTO.getCurrency())
|
||||
.build());
|
||||
|
||||
Member member = memberService.selectMemberByGameAccount(exchangeTransferMoneyRequestDTO.getAccount());
|
||||
String transactionId = gameExchangeMoneyService.getTransactionId(GamePlatforms.FC.getCode(), 30);
|
||||
String transactionId = gameExchangeMoneyService.getTransactionId(GamePlatforms.FC.getInfo(), 30);
|
||||
List<GameExchangeMoney> gameExchangeMonies = gameExchangeMoneyService.selectGameExchangeMoneyList(
|
||||
GameExchangeMoney.builder()
|
||||
.tenantKey(exchangeTransferMoneyRequestDTO.getTenantKey())
|
||||
|
@ -386,7 +386,7 @@ public class GamesFCServiceImpl implements IGamesService {
|
|||
.currencyCode(currencyDTO.getSystemCurrency())
|
||||
.memberId(member.getId())
|
||||
.transactionId(transactionId)
|
||||
.platformCode(GamePlatforms.FC.getCode())
|
||||
.platformCode(GamePlatforms.FC.getInfo())
|
||||
.build();
|
||||
exchangeMoney.setCreateBy(Constants.SYSTEM);
|
||||
|
||||
|
@ -461,7 +461,7 @@ public class GamesFCServiceImpl implements IGamesService {
|
|||
|
||||
|
||||
List<GameSecretKeyCurrencyDTO> gameSecretKeyCurrencies = gameSecretKeyCurrencyService.findByGameSecretKeyCurrencyDTOList(GameSecretKeyCurrencyDTO.builder()
|
||||
.platformCode(GamePlatforms.FC.getCode())
|
||||
.platformCode(GamePlatforms.FC.getInfo())
|
||||
.build());
|
||||
|
||||
for (GameSecretKeyCurrency gameSecretKeyCurrency : gameSecretKeyCurrencies) {
|
||||
|
@ -494,7 +494,7 @@ public class GamesFCServiceImpl implements IGamesService {
|
|||
@Override
|
||||
public Boolean getBetRecordByHistoryTime(BetRecordByTimeDTO betRecordByTimeDTO) {
|
||||
List<GameSecretKeyCurrencyDTO> gameSecretKeyCurrencies = gameSecretKeyCurrencyService.findByGameSecretKeyCurrencyDTOList(GameSecretKeyCurrencyDTO.builder()
|
||||
.platformCode(GamePlatforms.FC.getCode())
|
||||
.platformCode(GamePlatforms.FC.getInfo())
|
||||
.build());
|
||||
|
||||
for (GameSecretKeyCurrency gameSecretKeyCurrency : gameSecretKeyCurrencies) {
|
||||
|
@ -649,7 +649,7 @@ public class GamesFCServiceImpl implements IGamesService {
|
|||
.memberId(member.getId())
|
||||
.gameCode(resultBean.getGameID())
|
||||
.gameType(FCGameType.findSystemByCode(resultBean.getGametype()))
|
||||
.platformCode(GamePlatforms.FC.getCode())
|
||||
.platformCode(GamePlatforms.FC.getInfo())
|
||||
.gameId(gamesDataDTO.getSystemGameId())
|
||||
.gameName(gamesDataDTO.getGameNameOfChinese())
|
||||
.gameStatus(gameStatus)
|
||||
|
@ -692,7 +692,7 @@ public class GamesFCServiceImpl implements IGamesService {
|
|||
}
|
||||
if (!CollectionUtils.isEmpty(gameBettingDetails)) {
|
||||
//查询重复数据id
|
||||
List<String> removeWagersIds = gameBettingDetailsService.selectGameBettingDetailsByWagersId(wagersIds);
|
||||
List<String> removeWagersIds = gameBettingDetailsService.selectGameBettingDetailsByWagersId(wagersIds,GamePlatforms.FC.getInfo());
|
||||
//用steam流清除list中与wagersIds集合相同的数据
|
||||
gameBettingDetails = gameBettingDetails.stream()
|
||||
.filter(detail -> !removeWagersIds.contains(detail.getWagersId()))
|
||||
|
|
|
@ -237,7 +237,7 @@ public class GamesJILIServiceImpl implements IGamesService {
|
|||
for (JILIGamesDataDTO gamesDataDTO : jiliGames.getData()) {
|
||||
GamePlatform gamePlatform = GamePlatform.builder()
|
||||
.platformType(JILIGameType.findSystemByCode(gamesDataDTO.getGameCategoryId()))
|
||||
.platformCode(GamePlatforms.JILI.getCode())
|
||||
.platformCode(GamePlatforms.JILI.getInfo())
|
||||
.build();
|
||||
List<GamePlatform> gamePlatforms = gamePlatformService.selectGamePlatformList(gamePlatform);
|
||||
//没有此平台就新增一个平台
|
||||
|
@ -313,7 +313,7 @@ public class GamesJILIServiceImpl implements IGamesService {
|
|||
.currency(exchangeTransferMoneyRequestDTO.getCurrency()).build());
|
||||
|
||||
Member member = memberService.selectMemberByGameAccount(exchangeTransferMoneyRequestDTO.getAccount());
|
||||
String transactionId = GamePlatforms.JILI.getCode() + IdUtils.simpleUUID();
|
||||
String transactionId = GamePlatforms.JILI.getInfo() + IdUtils.simpleUUID();
|
||||
|
||||
List<GameExchangeMoney> gameExchangeMonies = gameExchangeMoneyService.selectGameExchangeMoneyList(
|
||||
GameExchangeMoney.builder()
|
||||
|
@ -335,7 +335,7 @@ public class GamesJILIServiceImpl implements IGamesService {
|
|||
.currencyCode(gameSecretKey.getSystemCurrency())
|
||||
.memberId(member.getId())
|
||||
.transactionId(transactionId)
|
||||
.platformCode(GamePlatforms.JILI.getCode())
|
||||
.platformCode(GamePlatforms.JILI.getInfo())
|
||||
.build();
|
||||
exchangeMoney.setCreateBy(Constants.SYSTEM);
|
||||
//接口限制限制50字符
|
||||
|
@ -473,7 +473,7 @@ public class GamesJILIServiceImpl implements IGamesService {
|
|||
.map(Game::getGameCode)
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.joining(","));
|
||||
String referenceId = GamePlatforms.JILI.getCode() + IdUtils.simpleUUID();
|
||||
String referenceId = GamePlatforms.JILI.getInfo() + IdUtils.simpleUUID();
|
||||
//请求参数
|
||||
String query = "Account=" + createFreeSpinRequest.getAccount()
|
||||
+ "&Currency=" + createFreeSpinRequest.getCurrency()
|
||||
|
@ -716,7 +716,7 @@ public class GamesJILIServiceImpl implements IGamesService {
|
|||
}
|
||||
if (!CollectionUtils.isEmpty(gameBettingDetails)) {
|
||||
//查询重复数据id
|
||||
List<String> removeWagersIds = gameBettingDetailsService.selectGameBettingDetailsByWagersId(wagersIds);
|
||||
List<String> removeWagersIds = gameBettingDetailsService.selectGameBettingDetailsByWagersId(wagersIds,GamePlatforms.JILI.getInfo());
|
||||
//用steam流清除list中与wagersIds集合相同的数据
|
||||
gameBettingDetails = gameBettingDetails.stream()
|
||||
.filter(detail -> !removeWagersIds.contains(detail.getWagersId()))
|
||||
|
@ -766,7 +766,7 @@ public class GamesJILIServiceImpl implements IGamesService {
|
|||
.memberId(member.getId())
|
||||
.gameCode(jiliBetRecordDataResponseDTO.getGameId())
|
||||
.gameType(JILIGameType.findSystemByCode(jiliBetRecordDataResponseDTO.getGameCategoryId()))
|
||||
.platformCode(GamePlatforms.JILI.getCode())
|
||||
.platformCode(GamePlatforms.JILI.getInfo())
|
||||
.gameId(gamesDataDTO.getSystemGameId())
|
||||
.gameName(gamesDataDTO.getName().getZhCN())
|
||||
.gameStatus(jiliBetRecordDataResponseDTO.getStatus())
|
||||
|
|
|
@ -826,7 +826,7 @@ public class GamesPGServiceImpl implements IGamesService {
|
|||
}
|
||||
if (!CollectionUtils.isEmpty(gameBettingDetails)) {
|
||||
//查询重复数据id
|
||||
List<String> removeWagersIds = gameBettingDetailsService.selectGameBettingDetailsByWagersId(wagersIds);
|
||||
List<String> removeWagersIds = gameBettingDetailsService.selectGameBettingDetailsByWagersId(wagersIds,NGPlatforms.PG.getPlatform());
|
||||
//用steam流清除list中与wagersIds集合相同的数据
|
||||
gameBettingDetails = gameBettingDetails.stream()
|
||||
.filter(detail -> !removeWagersIds.contains(detail.getWagersId()))
|
||||
|
|
|
@ -244,7 +244,7 @@ public class GamesPGXServiceImpl implements IGamesService {
|
|||
for (PGXGameListResponse.Game gamesDataDTO : gameLists) {
|
||||
GamePlatform gamePlatform = GamePlatform.builder()
|
||||
.platformType(GPXGameType.SL.getSystemCode())
|
||||
.platformCode(GamePlatforms.PGX.getCode())
|
||||
.platformCode(GamePlatforms.PGX.getInfo())
|
||||
.build();
|
||||
List<GamePlatform> gamePlatforms = gamePlatformService.selectGamePlatformList(gamePlatform);
|
||||
//没有此平台就新增一个平台
|
||||
|
@ -308,13 +308,13 @@ public class GamesPGXServiceImpl implements IGamesService {
|
|||
log.info("GamesPGXServiceImpl [exchangeTransferByAgentId] 请求参数 {}", exchangeTransferMoneyRequestDTO);
|
||||
|
||||
GameSecretKeyCurrency currencyDTO = gameSecretKeyCurrencyService.findByGameSecretKeyCurrencyDTO(GameSecretKeyCurrencyDTO.builder()
|
||||
.platformCode(GamePlatforms.PGX.getCode())
|
||||
.platformCode(GamePlatforms.PGX.getInfo())
|
||||
.code(exchangeTransferMoneyRequestDTO.getAgentId())
|
||||
.currency(exchangeTransferMoneyRequestDTO.getCurrency())
|
||||
.build());
|
||||
|
||||
Member member = memberService.selectMemberByGameAccount(exchangeTransferMoneyRequestDTO.getAccount());
|
||||
String transactionId = gameExchangeMoneyService.getTransactionId(GamePlatforms.PGX.getCode(), 17);
|
||||
String transactionId = gameExchangeMoneyService.getTransactionId(GamePlatforms.PGX.getInfo(), 17);
|
||||
List<GameExchangeMoney> gameExchangeMonies = gameExchangeMoneyService.selectGameExchangeMoneyList(
|
||||
GameExchangeMoney.builder()
|
||||
.tenantKey(exchangeTransferMoneyRequestDTO.getTenantKey())
|
||||
|
@ -336,7 +336,7 @@ public class GamesPGXServiceImpl implements IGamesService {
|
|||
.currencyCode(currencyDTO.getSystemCurrency())
|
||||
.memberId(member.getId())
|
||||
.transactionId(transactionId)
|
||||
.platformCode(GamePlatforms.PGX.getCode())
|
||||
.platformCode(GamePlatforms.PGX.getInfo())
|
||||
.build();
|
||||
exchangeMoney.setCreateBy(Constants.SYSTEM);
|
||||
|
||||
|
@ -421,7 +421,7 @@ public class GamesPGXServiceImpl implements IGamesService {
|
|||
if (this.getIsSuccess(exchangeTransferStatusResponse.getErrCode())) {
|
||||
List<GameExchangeMoney> gameExchangeMonies = gameExchangeMoneyService.selectGameExchangeMoneyList(
|
||||
GameExchangeMoney.builder()
|
||||
.platformCode(GamePlatforms.PGX.getCode())
|
||||
.platformCode(GamePlatforms.PGX.getInfo())
|
||||
.transactionId(exchangeTransferMoneyRequestDTO.getOrderId())
|
||||
.build()
|
||||
);
|
||||
|
@ -580,7 +580,7 @@ public class GamesPGXServiceImpl implements IGamesService {
|
|||
}
|
||||
if (!CollectionUtils.isEmpty(gameBettingDetails)) {
|
||||
//查询重复数据id
|
||||
List<String> removeWagersIds = gameBettingDetailsService.selectGameBettingDetailsByWagersId(wagersIds);
|
||||
List<String> removeWagersIds = gameBettingDetailsService.selectGameBettingDetailsByWagersId(wagersIds,GamePlatforms.PGX.getInfo());
|
||||
//用steam流清除list中与wagersIds集合相同的数据
|
||||
gameBettingDetails = gameBettingDetails.stream()
|
||||
.filter(detail -> !removeWagersIds.contains(detail.getWagersId()))
|
||||
|
@ -644,7 +644,7 @@ public class GamesPGXServiceImpl implements IGamesService {
|
|||
.memberId(member.getId())
|
||||
.gameCode(resultBean.getGameId())
|
||||
.gameType(GPXGameType.SL.getSystemCode())
|
||||
.platformCode(GamePlatforms.PGX.getCode())
|
||||
.platformCode(GamePlatforms.PGX.getInfo())
|
||||
.gameId(gamesDataDTO.getSystemGameId())
|
||||
.gameName(gamesDataDTO.getGameName())
|
||||
.gameStatus(gameStatus)
|
||||
|
|
|
@ -6,6 +6,8 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 创建成员请求dto
|
||||
*
|
||||
|
@ -22,5 +24,10 @@ public class CreateMemberRequestDTO extends GamesBaseRequestDTO {
|
|||
*/
|
||||
private String account;
|
||||
|
||||
/**
|
||||
* ae 平台 投注限额
|
||||
*/
|
||||
private Map<String, Map<String, Map<String, Object>>> betLimit;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 游戏登录
|
||||
*
|
||||
|
@ -46,4 +48,10 @@ public class GamesLogin extends GamesBaseRequestDTO{
|
|||
* 游戏类型
|
||||
*/
|
||||
private String gameType;
|
||||
|
||||
|
||||
/**
|
||||
* ae 平台 投注限额
|
||||
*/
|
||||
private Map<String, Map<String, Map<String, Object>>> betLimit;
|
||||
}
|
||||
|
|
|
@ -321,7 +321,7 @@ public class GamesSAServiceImpl implements IGamesService {
|
|||
.currencyCode(currencyDTO.getSystemCurrency())
|
||||
.memberId(member.getId())
|
||||
.transactionId(transactionId)
|
||||
.platformCode(GamePlatforms.SA.getCode())
|
||||
.platformCode(GamePlatforms.SA.getInfo())
|
||||
.build();
|
||||
exchangeMoney.setCreateBy(Constants.SYSTEM);
|
||||
if (TransferType.ALL.getCode().equals(exchangeTransferMoneyRequestDTO.getTransferType())) {
|
||||
|
@ -546,7 +546,7 @@ public class GamesSAServiceImpl implements IGamesService {
|
|||
}
|
||||
if (!CollectionUtils.isEmpty(gameBettingDetails)) {
|
||||
//查询重复数据id
|
||||
List<String> removeWagersIds = gameBettingDetailsService.selectGameBettingDetailsByWagersId(wagersIds);
|
||||
List<String> removeWagersIds = gameBettingDetailsService.selectGameBettingDetailsByWagersId(wagersIds,GamePlatforms.SA.getInfo());
|
||||
//用steam流清除list中与wagersIds集合相同的数据
|
||||
gameBettingDetails = gameBettingDetails.stream()
|
||||
.filter(detail -> !removeWagersIds.contains(detail.getWagersId()))
|
||||
|
@ -599,7 +599,7 @@ public class GamesSAServiceImpl implements IGamesService {
|
|||
.memberId(member.getId())
|
||||
.gameCode(resultBean.getGameID())
|
||||
.gameType(PlatformType.CARD_GAME.getCode())
|
||||
.platformCode(GamePlatforms.SA.getCode())
|
||||
.platformCode(GamePlatforms.SA.getInfo())
|
||||
.gameId(GAME_ID)
|
||||
.gameName(game.getGameName())
|
||||
.gameStatus(gameStatus)
|
||||
|
|
|
@ -558,7 +558,7 @@ public class GamesXKServiceImpl implements IGamesService {
|
|||
}
|
||||
if (!CollectionUtils.isEmpty(gameBettingDetails)) {
|
||||
//查询重复数据id
|
||||
List<String> removeWagersIds = gameBettingDetailsService.selectGameBettingDetailsByWagersId(wagersIds);
|
||||
List<String> removeWagersIds = gameBettingDetailsService.selectGameBettingDetailsByWagersId(wagersIds,GamePlatforms.XK.getInfo());
|
||||
//用steam流清除list中与wagersIds集合相同的数据
|
||||
gameBettingDetails = gameBettingDetails.stream()
|
||||
.filter(detail -> !removeWagersIds.contains(detail.getWagersId()))
|
||||
|
|
|
@ -26,10 +26,11 @@ public interface GameBettingDetailsMapper
|
|||
/**
|
||||
* 按投注id选择游戏投注详细信息
|
||||
*
|
||||
* @param wagersIds 投注ID
|
||||
* @param wagersIds 投注ID
|
||||
* @param platformCode 平台代码
|
||||
* @return {@link List }<{@link Long }>
|
||||
*/
|
||||
List<String> selectGameBettingDetailsByWagersId(@Param("wagersIds") List<String> wagersIds);
|
||||
List<String> selectGameBettingDetailsByWagersId(@Param("wagersIds") List<String> wagersIds, @Param("platformCode") String platformCode);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,7 +29,7 @@ public interface IGameBettingDetailsService
|
|||
* @param wagersIds 投注ID
|
||||
* @return {@link List }<{@link Long }>
|
||||
*/
|
||||
List<String> selectGameBettingDetailsByWagersId(List<String> wagersIds);
|
||||
List<String> selectGameBettingDetailsByWagersId(List<String> wagersIds,String platformCode);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -43,8 +43,8 @@ public class GameBettingDetailsServiceImpl implements IGameBettingDetailsService
|
|||
* @return {@link List }<{@link Long }>
|
||||
*/
|
||||
@Override
|
||||
public List<String> selectGameBettingDetailsByWagersId(List<String> wagersIds) {
|
||||
return gameBettingDetailsMapper.selectGameBettingDetailsByWagersId(wagersIds);
|
||||
public List<String> selectGameBettingDetailsByWagersId(List<String> wagersIds, String platformCode) {
|
||||
return gameBettingDetailsMapper.selectGameBettingDetailsByWagersId(wagersIds,platformCode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,57 +1,57 @@
|
|||
package com.ff.quartz.config;//package com.ff.quartz.config;
|
||||
//
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.scheduling.quartz.SchedulerFactoryBean;
|
||||
//import javax.sql.DataSource;
|
||||
//import java.util.Properties;
|
||||
//
|
||||
///**
|
||||
// * 定时任务配置(单机部署建议删除此类和qrtz数据库表,默认走内存会最高效)
|
||||
// *
|
||||
// * @author ff
|
||||
// */
|
||||
//@Configuration
|
||||
//public class ScheduleConfig
|
||||
//{
|
||||
// @Bean
|
||||
// public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource)
|
||||
// {
|
||||
// SchedulerFactoryBean factory = new SchedulerFactoryBean();
|
||||
// factory.setDataSource(dataSource);
|
||||
//
|
||||
// // quartz参数
|
||||
// Properties prop = new Properties();
|
||||
// prop.put("org.quartz.scheduler.instanceName", "ffScheduler");
|
||||
// prop.put("org.quartz.scheduler.instanceId", "AUTO");
|
||||
// // 线程池配置
|
||||
// prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
|
||||
// prop.put("org.quartz.threadPool.threadCount", "20");
|
||||
// prop.put("org.quartz.threadPool.threadPriority", "5");
|
||||
// // JobStore配置
|
||||
// prop.put("org.quartz.jobStore.class", "org.springframework.scheduling.quartz.LocalDataSourceJobStore");
|
||||
// // 集群配置
|
||||
// prop.put("org.quartz.jobStore.isClustered", "true");
|
||||
// prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000");
|
||||
// prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "10");
|
||||
// prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true");
|
||||
//
|
||||
// // sqlserver 启用
|
||||
// // prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
|
||||
// prop.put("org.quartz.jobStore.misfireThreshold", "12000");
|
||||
// prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
|
||||
// factory.setQuartzProperties(prop);
|
||||
//
|
||||
// factory.setSchedulerName("ffScheduler");
|
||||
// // 延时启动
|
||||
// factory.setStartupDelay(1);
|
||||
// factory.setApplicationContextSchedulerContextKey("applicationContextKey");
|
||||
// // 可选,QuartzScheduler
|
||||
// // 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
|
||||
// factory.setOverwriteExistingJobs(true);
|
||||
// // 设置自动启动,默认为true
|
||||
// factory.setAutoStartup(true);
|
||||
//
|
||||
// return factory;
|
||||
// }
|
||||
//}
|
||||
package com.ff.quartz.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
|
||||
import javax.sql.DataSource;
|
||||
import java.util.Properties;
|
||||
|
||||
/**
|
||||
* 定时任务配置(单机部署建议删除此类和qrtz数据库表,默认走内存会最高效)
|
||||
*
|
||||
* @author ff
|
||||
*/
|
||||
@Configuration
|
||||
public class ScheduleConfig
|
||||
{
|
||||
@Bean
|
||||
public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource)
|
||||
{
|
||||
SchedulerFactoryBean factory = new SchedulerFactoryBean();
|
||||
factory.setDataSource(dataSource);
|
||||
|
||||
// quartz参数
|
||||
Properties prop = new Properties();
|
||||
prop.put("org.quartz.scheduler.instanceName", "ffScheduler");
|
||||
prop.put("org.quartz.scheduler.instanceId", "AUTO");
|
||||
// 线程池配置
|
||||
prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
|
||||
prop.put("org.quartz.threadPool.threadCount", "20");
|
||||
prop.put("org.quartz.threadPool.threadPriority", "5");
|
||||
// JobStore配置
|
||||
prop.put("org.quartz.jobStore.class", "org.springframework.scheduling.quartz.LocalDataSourceJobStore");
|
||||
// 集群配置
|
||||
prop.put("org.quartz.jobStore.isClustered", "true");
|
||||
prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000");
|
||||
prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "10");
|
||||
prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true");
|
||||
|
||||
// sqlserver 启用
|
||||
// prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
|
||||
prop.put("org.quartz.jobStore.misfireThreshold", "12000");
|
||||
prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
|
||||
factory.setQuartzProperties(prop);
|
||||
|
||||
factory.setSchedulerName("ffScheduler");
|
||||
// 延时启动
|
||||
factory.setStartupDelay(1);
|
||||
factory.setApplicationContextSchedulerContextKey("applicationContextKey");
|
||||
// 可选,QuartzScheduler
|
||||
// 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
|
||||
factory.setOverwriteExistingJobs(true);
|
||||
// 设置自动启动,默认为true
|
||||
factory.setAutoStartup(true);
|
||||
|
||||
return factory;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where wagers_id in
|
||||
<foreach item="wagersId" collection="wagersIds" open="(" separator="," close=")">
|
||||
#{wagersId}
|
||||
</foreach>
|
||||
</foreach> and platform_code = #{platformCode}
|
||||
and settlement_status !=1
|
||||
|
||||
</select>
|
||||
|
|
Loading…
Reference in New Issue