Commit 7333ce0f authored by shiyu's avatar shiyu

更新用户账户明细时先初始化用户账户

parent c9856f56
......@@ -341,7 +341,7 @@ public class WxPayCallbackController {
}
@Transactional
public Result handleAuctionOrder(Transaction transaction) {
try {
//商户订单号,分销订单号
......
......@@ -56,6 +56,9 @@ public class UserAccountDetailServiceImpl implements UserAccountDetailService {
@Autowired
UserAccountDao userAccountDao;
@Autowired
UserAccountService userAccountService;
......@@ -63,6 +66,7 @@ public class UserAccountDetailServiceImpl implements UserAccountDetailService {
@Override
public Result create(DistributionOrder distributionOrder, DistributorProfit distributorProfit) throws Exception {
try {
userAccountService.initAccount(distributionOrder.getSellerId());
//订单金额
long orderAmount = distributionOrder.getAmount();
//平台佣金
......@@ -111,6 +115,7 @@ public class UserAccountDetailServiceImpl implements UserAccountDetailService {
} else {
introduceAccountDetail.setUserId(distributionOrder.getIntroducerId() == null ? Long.valueOf(distributionOrder.getShareRecordId()) : distributionOrder.getIntroducerId());
//更新介绍人账户,增加待入账介绍佣金
userAccountService.initAccount(introduceAccountDetail.getUserId());
UserAccount oldIntroducerAccount = userAccountDao.findByUserId(introduceAccountDetail.getUserId());
UserAccount newIntroducerAccount = new UserAccount();
newIntroducerAccount.setUserId(introduceAccountDetail.getUserId());
......@@ -148,7 +153,7 @@ public class UserAccountDetailServiceImpl implements UserAccountDetailService {
return Result.success();
} catch (Exception e) {
logger.error("新增用户账户明细error:{}", e);
throw new Exception(e);
throw new Exception();
}
}
......
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