Commit 7333ce0f authored by shiyu's avatar shiyu

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

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