v1.1 payermax-channelType
This commit is contained in:
@@ -123,13 +123,13 @@ public class ChargeProdService {
|
||||
return chargeProdVoList;
|
||||
}
|
||||
|
||||
public List<ChargeProdVo> getAllChargeProdVoList(String countryCode, ChargeWayInfoVO chargeWayInfoVO) {
|
||||
public List<ChargeProdVo> getAllChargeProdVoList(String countryCode, Byte channelType, ChargeWayInfoVO chargeWayInfoVO) {
|
||||
BaseRequestVO baseRequestVO = new BaseRequestVO();
|
||||
|
||||
ChargeProdExample chargeProdExample = new ChargeProdExample();
|
||||
ChargeProdExample.Criteria criteria = chargeProdExample.createCriteria();
|
||||
criteria.andCountryEqualTo(countryCode)
|
||||
.andChannelEqualTo(Constant.ChargeProdChannel.payermax_h5_charge)
|
||||
.andChannelEqualTo(channelType)
|
||||
.andPayChannelEqualTo(chargeWayInfoVO.getPayChannel())
|
||||
.andProdStatusIn(this.getAvailableChargeProdStatus());
|
||||
//需要特殊的产品,例如点数卡是固定数额
|
||||
|
@@ -43,7 +43,7 @@ public class FirstChargeRewardListener implements ApplicationListener<ChargeSucc
|
||||
String userFirstChargeStatus = jedisService.hget(RedisKey.first_charge_reward_user.getKey(), uid.toString());
|
||||
// 当用户满足首充资格则修改状态
|
||||
log.info("首充激励: chargeRecord {} 获取首充状态 {},", JSON.toJSONString(chargeRecord), userFirstChargeStatus);
|
||||
if (userFirstChargeStatus == null || Boolean.valueOf(userFirstChargeStatus)) {
|
||||
if (userFirstChargeStatus == null || Boolean.parseBoolean(userFirstChargeStatus)) {
|
||||
jedisService.hset(RedisKey.first_charge_reward_user.getKey(), uid.toString(), "false");
|
||||
log.info("首充激励成功: uid {} ", uid);
|
||||
// 判断首充激励开关
|
||||
|
@@ -516,12 +516,12 @@ public class ChargeService extends BaseService {
|
||||
lockResult =
|
||||
jedisLockService.lock(RedisKey.lock_pay_callback_notify.getKey(orderNo), waitSecondTime * 1000);
|
||||
if (org.apache.commons.lang3.StringUtils.isEmpty(lockResult)) {
|
||||
log.warn("訂單 {} 處理中,請稍候", orderNo);
|
||||
log.warn("订单 {} 处理中,请稍候", orderNo);
|
||||
return;
|
||||
}
|
||||
ChargeRecord chargeRecord = chargeRecordService.getChargeRecordById(orderNo);
|
||||
if (chargeRecord.getChargeStatus().equals(Constant.ChargeRecordStatus.finish)) {
|
||||
log.warn("{} 訂單已經處理完成", otherNo);
|
||||
log.warn("{} 订单已经处理完成", otherNo);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -530,7 +530,7 @@ public class ChargeService extends BaseService {
|
||||
chargeRecordService.updateChargeRecord(chargeRecord);
|
||||
updateAppPayData(chargeRecord);
|
||||
} catch (Exception e) {
|
||||
log.error("回調處理用戶錢包和賬單記錄異常", e);
|
||||
log.error("回调处理用户钱包和账单记录异常", e);
|
||||
throw new BusinessException("回調處理用戶錢包和賬單記錄異常", e);
|
||||
} finally {
|
||||
if (org.apache.commons.lang3.StringUtils.isNotBlank(lockResult)) {
|
||||
@@ -609,7 +609,7 @@ public class ChargeService extends BaseService {
|
||||
boolean isDraw,
|
||||
Long chargeUid) {
|
||||
log.info(
|
||||
"幸運塔羅充值業務處理,chargeRecordId={},luckyNum={},isDraw={}",
|
||||
"幸运塔罗充值业务处理,chargeRecordId={},luckyNum={},isDraw={}",
|
||||
chargeRecord.getChargeRecordId(),
|
||||
drawNum,
|
||||
isDraw);
|
||||
@@ -624,7 +624,7 @@ public class ChargeService extends BaseService {
|
||||
String orderNo = chargeRecord.getChargeRecordId();
|
||||
if (realAmount != amount) {
|
||||
// 充值金額與實際價格不一致 (amount以分為單位)
|
||||
log.error("非法塔羅充值. orderNo=[{}], amountLong=[{}], money=[{}]", orderNo, amount, money);
|
||||
log.error("非法塔罗充值. orderNo=[{}], amountLong=[{}], money=[{}]", orderNo, amount, money);
|
||||
throw new IllegalArgumentException(String.format("非法塔羅充值. orderNo=[%s]", orderNo));
|
||||
}
|
||||
Long chargeGoldNum = 0L;
|
||||
@@ -638,7 +638,7 @@ public class ChargeService extends BaseService {
|
||||
chargeRecord.setTotalGold(chargeGoldNum);
|
||||
int result = completedOrder(chargeRecord);
|
||||
if (result <= 0) {
|
||||
log.info("重複請求:chargeRecordId: " + chargeRecord.getChargeRecordId());
|
||||
log.info("重复请求:chargeRecordId: " + chargeRecord.getChargeRecordId());
|
||||
throw new ApiException(BusiStatus.DUPLICATE_TRANSFER_REQUEST);
|
||||
}
|
||||
// 更新塔羅充值記錄
|
||||
@@ -719,7 +719,7 @@ public class ChargeService extends BaseService {
|
||||
String mapKey = getChargeWayProdMapKey(chargeWay);
|
||||
List<ChargeProdVo> chargeProdVos = chargeWayProdMap.get(mapKey);
|
||||
if (chargeProdVos == null) {
|
||||
chargeProdVos = listChargeProdVos(countryCode, chargeWay);
|
||||
chargeProdVos = chargeProdService.getAllChargeProdVoList(countryCode, channelType, chargeWay);
|
||||
chargeWayProdMap.put(mapKey, chargeProdVos);
|
||||
}
|
||||
|
||||
@@ -760,10 +760,6 @@ public class ChargeService extends BaseService {
|
||||
return chargeWayMap;
|
||||
}
|
||||
|
||||
private List<ChargeProdVo> listChargeProdVos(String countryCode, ChargeWayInfoVO chargeWayInfoVO) {
|
||||
return chargeProdService.getAllChargeProdVoList(countryCode, chargeWayInfoVO);
|
||||
}
|
||||
|
||||
public List<ChargeAreaInfoVO> listChargeAreaInfo() {
|
||||
AreaChargeConfigDTO h5AreaChargeConfig = JSONObject.parseObject(sysConfService.getDefaultSysConfValueById(Constant.SysConfId.H5_AREA_CHARGE_CONFIG, "{}"), AreaChargeConfigDTO.class);
|
||||
Map<String, AreaChargeConfigDTO.AreaChargeConfigeItem> areaConfigMap = h5AreaChargeConfig.getAreaConfig();
|
||||
|
@@ -119,7 +119,7 @@ public class FirstChargeRewardService extends BaseService {
|
||||
firstCharge.setFirstChargeRewardList(chargeRewardList);
|
||||
firstCharge.setGiveMoney(vo.getGiveShowPrice());
|
||||
firstCharge.setChargeProdDesc(chargeProdDesc);
|
||||
String chargeProdTitle = String.format("充 %.2f 美元 额外送 %s 美元礼包", chargeMoney.doubleValue(), vo.getGiveShowPrice());
|
||||
String chargeProdTitle = String.format("充 %.2f 美元 額外送 %s 美元禮包", chargeMoney.doubleValue(), vo.getGiveShowPrice());
|
||||
firstCharge.setChargeProdTitle(chargeProdTitle);
|
||||
chargeReward.add(firstCharge);
|
||||
}
|
||||
@@ -220,7 +220,7 @@ public class FirstChargeRewardService extends BaseService {
|
||||
String lockVal = null;
|
||||
try {
|
||||
lockVal = this.jedisLockService.lock(RedisKey.first_charge_reward_send_reward_lock.getKey(uid.toString()), 1000);
|
||||
if (org.apache.commons.lang3.StringUtils.isEmpty(lockVal)) {
|
||||
if (StringUtils.isEmpty(lockVal)) {
|
||||
throw new ServiceException(BusiStatus.SERVERBUSY);
|
||||
}
|
||||
countRewardRecord = firstChargeRewardRecordService.count(rewardRecordWrapper);
|
||||
@@ -231,10 +231,10 @@ public class FirstChargeRewardService extends BaseService {
|
||||
FirstChargeLevelInfoVo rewardInfo = firstChargeRewardMapper.getFirstChargeInfoByRewardLevel(rewardLevelId);
|
||||
String firstChargeInfoStr = rewardInfo.getFirstChargeInfo();
|
||||
FirstChargeInfoVo infoVo = JSONObject.parseObject(firstChargeInfoStr, FirstChargeInfoVo.class);
|
||||
String chargeProdTitle = String.format("充 %s 元 額外送 %s 元禮包", infoVo.getChargeMoney(), rewardInfo.getGiveShowPrice());
|
||||
String chargeProdTitle = String.format("充 %s 美元 額外送 %s 美元禮包", infoVo.getChargeMoney(), rewardInfo.getGiveShowPrice());
|
||||
|
||||
// 发放奖励
|
||||
Map<String, String> sendMsgResultMap = this.sendReword(chargeRewardList, uid, message);
|
||||
Map<String, String> sendMsgResultMap = sendReword(chargeRewardList, uid, message);
|
||||
Boolean notJump = Boolean.getBoolean(sendMsgResultMap.get("notJump"));
|
||||
String jumpText = sendMsgResultMap.get("jumpText");
|
||||
message = sendMsgResultMap.get("message");
|
||||
@@ -503,7 +503,7 @@ public class FirstChargeRewardService extends BaseService {
|
||||
*/
|
||||
public Boolean checkLimitCharge(Long uid) {
|
||||
LimitFirstChargeConfig chargeConfig = getLimitFirstChargeRewardConfig();
|
||||
return this.checkLimitCharge(uid, chargeConfig);
|
||||
return checkLimitCharge(uid, chargeConfig);
|
||||
}
|
||||
|
||||
public Boolean checkLimitCharge(Long uid, LimitFirstChargeConfig chargeConfig) {
|
||||
@@ -519,13 +519,12 @@ public class FirstChargeRewardService extends BaseService {
|
||||
Users usersByUid = usersService.getUsersByUid(uid);
|
||||
if (usersByUid == null)
|
||||
return false;
|
||||
Boolean inLimitTime = this.checkUserLimitTime(usersByUid, chargeConfig.getLimitTimeDays());
|
||||
Boolean inLimitTime = checkUserLimitTime(usersByUid, chargeConfig.getLimitTimeDays());
|
||||
if (!inLimitTime) {
|
||||
return false;
|
||||
}
|
||||
// 当前用户是否完成奖励
|
||||
Boolean finishLimitFirstCharge = this.checkFinishedLimitFirstChargeByCache(uid);
|
||||
if (finishLimitFirstCharge) {
|
||||
if (checkFinishedLimitFirstChargeByCache(uid)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user