|
@@ -133,7 +133,7 @@ public class AdServiceImpl implements AdService {
|
|
|
YtDyzAdRecord insertEntity;
|
|
YtDyzAdRecord insertEntity;
|
|
|
List<String> filter = new ArrayList<>();
|
|
List<String> filter = new ArrayList<>();
|
|
|
List<YtDyzAdRecord> saveList = new ArrayList<>();
|
|
List<YtDyzAdRecord> saveList = new ArrayList<>();
|
|
|
- BigDecimal totalRevenue = BigDecimal.ZERO;
|
|
|
|
|
|
|
+ BigDecimal totalRevenue = BigDecimal.ZERO; // 用户总收益
|
|
|
BigDecimal redPackRevenue = BigDecimal.ZERO; // 用户红包收益
|
|
BigDecimal redPackRevenue = BigDecimal.ZERO; // 用户红包收益
|
|
|
BigDecimal userRevenueRate = appUserService.getUserRevenueRate(user.getAppId()); // 用户红包收益比例
|
|
BigDecimal userRevenueRate = appUserService.getUserRevenueRate(user.getAppId()); // 用户红包收益比例
|
|
|
boolean isLoginAfter = param.getLoginStatus() != null && AdRecordEnum.LOGIN_BEFORE.getCode().equals(param.getLoginStatus());
|
|
boolean isLoginAfter = param.getLoginStatus() != null && AdRecordEnum.LOGIN_BEFORE.getCode().equals(param.getLoginStatus());
|
|
@@ -160,6 +160,9 @@ public class AdServiceImpl implements AdService {
|
|
|
insertEntity.setRecordId(IdUtil.fastSimpleUUID());
|
|
insertEntity.setRecordId(IdUtil.fastSimpleUUID());
|
|
|
insertEntity.setUserId(user.getUserId());
|
|
insertEntity.setUserId(user.getUserId());
|
|
|
insertEntity.setNetworkName(AdPlatformTypeEnum.getDesc(Integer.parseInt(adParam.getNetworkFormId())));
|
|
insertEntity.setNetworkName(AdPlatformTypeEnum.getDesc(Integer.parseInt(adParam.getNetworkFormId())));
|
|
|
|
|
+ if (userRevenueRate != null) {
|
|
|
|
|
+ insertEntity.setRevenueRate(userRevenueRate.toPlainString());
|
|
|
|
|
+ }
|
|
|
saveList.add(insertEntity);
|
|
saveList.add(insertEntity);
|
|
|
if (AdRecordEnum.LOGIN_BEFORE.getCode().equals(param.getLoginStatus())
|
|
if (AdRecordEnum.LOGIN_BEFORE.getCode().equals(param.getLoginStatus())
|
|
|
&& AdSourceTypeEnum.rewarded_video.getAdSourceType() == adParam.getAdSourceType()) {
|
|
&& AdSourceTypeEnum.rewarded_video.getAdSourceType() == adParam.getAdSourceType()) {
|
|
@@ -167,7 +170,7 @@ public class AdServiceImpl implements AdService {
|
|
|
}
|
|
}
|
|
|
if (insertEntity.getRevenue() != null) {
|
|
if (insertEntity.getRevenue() != null) {
|
|
|
totalRevenue = totalRevenue.add(insertEntity.getRevenue());
|
|
totalRevenue = totalRevenue.add(insertEntity.getRevenue());
|
|
|
- if (isLoginAfter ) {
|
|
|
|
|
|
|
+ if (isLoginAfter && userRevenueRate != null) {
|
|
|
redPackRevenue = redPackRevenue.add(insertEntity.getRevenue().multiply(userRevenueRate));
|
|
redPackRevenue = redPackRevenue.add(insertEntity.getRevenue().multiply(userRevenueRate));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|