|
|
@@ -28,22 +28,21 @@ public class HYProjectService extends BaseProjectService implements ProjectServi |
|
|
|
@Override |
|
|
|
public void handlePaidOrder(Long cUserId,String cUserFinalTenantId,Product product) { |
|
|
|
//更新用户的币 |
|
|
|
wxCUserBasicInfoService.reducePoints(cUserId, cUserFinalTenantId,-product.getGlod()); |
|
|
|
wxCUserBasicInfoService.addPoints(cUserId, cUserFinalTenantId,-product.getGlod()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public CreateBilling handleCreateVideoBilling(Long cUserId,String cUserFinalTenantId,String videoSeconds, Long videoSize) { |
|
|
|
public CreateBilling handleCreateVideoBilling(Long cUserId,String cUserFinalTenantId,String videoTimes, Long videoSize) { |
|
|
|
//慧影视频按照时长来扣币 |
|
|
|
CreateBilling cb = new CreateBilling(); |
|
|
|
//每秒扣币 |
|
|
|
float poinsPerSeconds = 0.008F; |
|
|
|
cb.setTotalCostPoins(new BigDecimal(videoSeconds).multiply(new BigDecimal(poinsPerSeconds)).intValue()); |
|
|
|
cb.setDetail("每秒扣币"+poinsPerSeconds+"个,总共时长"+videoSeconds+"秒"); |
|
|
|
//每分钟扣币,不足一分钟按一分钟算 |
|
|
|
Integer minitues = new BigDecimal(videoTimes).setScale(0,BigDecimal.ROUND_UP).intValue(); |
|
|
|
float poinsPerSeconds = 1.0F; |
|
|
|
cb.setTotalCostPoins(new BigDecimal(videoTimes).multiply(new BigDecimal(poinsPerSeconds)).intValue()); |
|
|
|
cb.setDetail("每分钟扣币"+poinsPerSeconds+"个,总共时长"+videoTimes+"(分钟),按"+minitues+"分总计费。"); |
|
|
|
//扣去当前用户的币 |
|
|
|
wxCUserBasicInfoService.reducePoints(cUserId, cUserFinalTenantId,cb.getTotalCostPoins()); |
|
|
|
return cb; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |