Commit 80ec3ed7 authored by shiyu's avatar shiyu

计算介绍佣金3

parent 2b2015f0
...@@ -108,7 +108,7 @@ public class UserBillServiceImpl implements UserBillService { ...@@ -108,7 +108,7 @@ public class UserBillServiceImpl implements UserBillService {
//计算介绍人的佣金(介绍人非卖家自己和平台) //计算介绍人的佣金(介绍人非卖家自己和平台)
if (!distributionOrder.getShareRecordId().equals(distributionOrder.getSellerId().toString()) if (!distributionOrder.getShareRecordId().equals(distributionOrder.getSellerId().toString())
&& distributionOrder.getSellerId().longValue() != CommConsts.SYSTEM_ACCOUNT) { && distributionOrder.getSellerId().longValue() != CommConsts.SYSTEM_ACCOUNT) {
calculateIntroduceAmount(distributionOrder.getDistributionOrderId(), accountPeriod); calculateIntroduceAmount(distributionOrder, distributorProfit, accountPeriod);
} }
return Result.success(); return Result.success();
} catch (Exception e) { } catch (Exception e) {
...@@ -126,14 +126,9 @@ public class UserBillServiceImpl implements UserBillService { ...@@ -126,14 +126,9 @@ public class UserBillServiceImpl implements UserBillService {
/** /**
* 计算介绍佣金 * 计算介绍佣金
*/ */
private void calculateIntroduceAmount(String distributionOrderId, String accountPeriod) { private void calculateIntroduceAmount(DistributionOrder distributionOrder, DistributorProfit distributorProfit, String accountPeriod) {
UserAccountDetail userAccountDetail = userAccountDetailDao.find(distributionOrderId, BillEnum.AccountDetailTypeEnum.INTRODUCE.getCode()); long userId = Long.valueOf(distributionOrder.getShareRecordId());
if (userAccountDetail == null) { long amount = distributorProfit.getIntroduceCost();
logger.error("********** 交易id:{}, 查询不到佣金记录 **********", distributionOrderId);
return;
}
long userId = userAccountDetail.getUserId();
long amount = userAccountDetail.getAmount();
//查询介绍人是否有账单 //查询介绍人是否有账单
UserBill userBill = userBillDao.findOne(accountPeriod, userId, BillEnum.BillStateEnum.NOT_PAID.getCode()); UserBill userBill = userBillDao.findOne(accountPeriod, userId, BillEnum.BillStateEnum.NOT_PAID.getCode());
if (userBill == null) { 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