Commit 80ec3ed7 authored by shiyu's avatar shiyu

计算介绍佣金3

parent 2b2015f0
......@@ -108,7 +108,7 @@ public class UserBillServiceImpl implements UserBillService {
//计算介绍人的佣金(介绍人非卖家自己和平台)
if (!distributionOrder.getShareRecordId().equals(distributionOrder.getSellerId().toString())
&& distributionOrder.getSellerId().longValue() != CommConsts.SYSTEM_ACCOUNT) {
calculateIntroduceAmount(distributionOrder.getDistributionOrderId(), accountPeriod);
calculateIntroduceAmount(distributionOrder, distributorProfit, accountPeriod);
}
return Result.success();
} catch (Exception e) {
......@@ -126,14 +126,9 @@ public class UserBillServiceImpl implements UserBillService {
/**
* 计算介绍佣金
*/
private void calculateIntroduceAmount(String distributionOrderId, String accountPeriod) {
UserAccountDetail userAccountDetail = userAccountDetailDao.find(distributionOrderId, BillEnum.AccountDetailTypeEnum.INTRODUCE.getCode());
if (userAccountDetail == null) {
logger.error("********** 交易id:{}, 查询不到佣金记录 **********", distributionOrderId);
return;
}
long userId = userAccountDetail.getUserId();
long amount = userAccountDetail.getAmount();
private void calculateIntroduceAmount(DistributionOrder distributionOrder, DistributorProfit distributorProfit, String accountPeriod) {
long userId = Long.valueOf(distributionOrder.getShareRecordId());
long amount = distributorProfit.getIntroduceCost();
//查询介绍人是否有账单
UserBill userBill = userBillDao.findOne(accountPeriod, userId, BillEnum.BillStateEnum.NOT_PAID.getCode());
if (userBill == null) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment