v1.1 payermax-加上channelTypec参数区分钻石、vip、首充礼包

This commit is contained in:
2022-10-21 12:46:38 +08:00
parent 5b2322ddb4
commit 7782ad5bb8
4 changed files with 18 additions and 7 deletions

View File

@@ -5,6 +5,7 @@ import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Data
public class AreaChargeConfigDTO {
@@ -33,9 +34,12 @@ public class AreaChargeConfigDTO {
@Data
public static class AreaChargeWayGroup {
private String groupName;
private List<String> chargeWays;
private Set<Byte> channelTypes;
}
private Map<String, AreaChargeConfigeItem> areaConfig;

View File

@@ -665,7 +665,7 @@ public class ChargeService extends BaseService {
luckyTarotChargeService.sendDrawResultToUsers(luckyTarotRecord);
}
public ChargePageVO getChargePageInfo(String countryCode) {
public ChargePageVO getChargePageInfo(String countryCode, Byte channelType) {
AreaChargeConfigDTO h5AreaChargeConfig = JSONObject.parseObject(sysConfService.getDefaultSysConfValueById(Constant.SysConfId.H5_AREA_CHARGE_CONFIG, "{}"), AreaChargeConfigDTO.class);
Map<String, AreaChargeConfigDTO.AreaChargeConfigeItem> areaConfigMap = h5AreaChargeConfig.getAreaConfig();
if (areaConfigMap == null) {
@@ -678,17 +678,21 @@ public class ChargeService extends BaseService {
throw new ServiceException(BusiStatus.PARAMERROR);
}
List<ChargeWayGroupInfoVO> chargeWayGroups = genChargeWayGroups(countryCode, areaChargeConfig);
List<ChargeWayGroupInfoVO> chargeWayGroups = genChargeWayGroups(areaChargeConfig, countryCode, channelType);
ChargePageVO pageVO = new ChargePageVO();
pageVO.setChargeGroups(chargeWayGroups);
return pageVO;
}
private List<ChargeWayGroupInfoVO>
genChargeWayGroups(String countryCode, AreaChargeConfigDTO.AreaChargeConfigeItem areaChargeConfig) {
private List<ChargeWayGroupInfoVO> genChargeWayGroups(AreaChargeConfigDTO.AreaChargeConfigeItem areaChargeConfig, String countryCode, Byte channelType) {
List<AreaChargeConfigDTO.AreaChargeWayGroup> chargeWayGroups = areaChargeConfig.getChargeWayGroups();
if (CollectionUtils.isEmpty(chargeWayGroups) || channelType == null) {
return Collections.emptyList();
}
//先过滤对应渠道
chargeWayGroups = chargeWayGroups.stream().filter(group->group.getChannelTypes().contains(channelType)).collect(Collectors.toList());
if (CollectionUtils.isEmpty(chargeWayGroups)) {
return Collections.emptyList();
}
@@ -697,6 +701,7 @@ public class ChargeService extends BaseService {
List<ChargeWayGroupInfoVO> groupInfos = new ArrayList<>(chargeWayGroups.size());
List<ChargeWayInfoVO> allChargeWays = new ArrayList<>();
// 构造分组
chargeWayGroups.forEach(group -> {
ChargeWayGroupInfoVO info = new ChargeWayGroupInfoVO();

View File

@@ -66,6 +66,7 @@ public class VipChargeService {
* google包贵族充值产品channel
*/
public final static Byte GOOGLE_VIP_CHARGE_CHANNEL = 2;
public final static Byte PAYERMAX_VIP_CHARGE_CHANNEL = 5;
/**
* IOS内购贵族充值产品channel
*/
@@ -172,6 +173,7 @@ public class VipChargeService {
public boolean isVipCharge(ChargeProd chargeProd) {
Byte channel = chargeProd.getChannel();
return GOOGLE_VIP_CHARGE_CHANNEL.equals(channel) || IOS_PAY_VIP_CHARGE_CHANNEL.equals(channel);
return GOOGLE_VIP_CHARGE_CHANNEL.equals(channel) || IOS_PAY_VIP_CHARGE_CHANNEL.equals(channel)
|| PAYERMAX_VIP_CHARGE_CHANNEL.equals(channel);
}
}

View File

@@ -62,8 +62,8 @@ public class ChargeController extends BaseController {
* payermax H5 根据country返回产品列表
* */
@GetMapping(value = "/getChargePageInfoForH5")
public BusiResult<ChargePageVO> getChargePageInfo(String countryCode) {
ChargePageVO vo = chargeService.getChargePageInfo(countryCode);
public BusiResult<ChargePageVO> getChargePageInfo(String countryCode, Byte channelType) {
ChargePageVO vo = chargeService.getChargePageInfo(countryCode, channelType);
return new BusiResult<>(vo);
}