Commit 48bbc96e authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/base-modify' into base-modify

parents 6bd474c4 973f614c
......@@ -146,8 +146,13 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
sellingWater.setCommission(commission);
insertSelective(sellingWater);
log.info("购买计算用户拥成功----payOrderWater--------userId===" + userId+"----type===="+type);
if(type!=null&&type==3){
if(type==null){
continue;
}
if(type==3){
finishOrderWater(orderWaterDTO);
}else if(type==2){
myWaterBiz.updMyWalletUnbooked(userId,commission);
}
}
......
......@@ -72,7 +72,11 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{
if (lastTime!=null&&(lastTime==0||isToday(lastTime))){
todayAmount=wallet.getTodayAmount().add(amount);
}
unbooked=wallet.getUnbooked().subtract(unbooked);
//只有拥金才会未入账
if (wallet.getUnbooked().compareTo(amount)>0&&walletDetail.getSource()!=null&&walletDetail.getSource()==1){
unbooked=wallet.getUnbooked().subtract(amount);
}
}
log.info("---我的钱包入账----userId==="+userId+"----balance===="+balance+"----totalAmount===="+totalAmount+"---todayAmount==="+todayAmount+"---unbooked=="+unbooked);
......@@ -81,6 +85,7 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{
walletDetailBiz.insertSelective(walletDetail);
Long time=System.currentTimeMillis();
wallet.setBalance(balance);
wallet.setUnbooked(unbooked);
wallet.setTodayAmount(todayAmount);
wallet.setTotalAmount(totalAmount);
wallet.setUnbooked(unbooked);
......@@ -111,6 +116,23 @@ public class MyWaterBiz extends BaseBiz<MyWalletMapper, MyWallet>{
return isToday;
}
//钱包未入账的添加
public void updMyWalletUnbooked(Integer userId,BigDecimal amount){
MyWallet wallet=new MyWallet();
wallet.setUserId(userId);
wallet=selectOne(wallet);
if(wallet==null){
wallet=new MyWallet();
wallet.setUserId(userId);
wallet.setUnbooked(amount);
insertSelective(wallet);
}else {
BigDecimal unbooked=wallet.getUnbooked().add(amount);
wallet.setUnbooked(unbooked);
mapper.updMyWater(wallet);
}
}
@Transactional(rollbackFor = Exception.class,propagation = Propagation.REQUIRED)
public int createWalletByUserId(Integer userId){
MyWallet myWallet = new MyWallet();
......
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