Commit ee9a082f authored by hezhen's avatar hezhen

123

parent 37e63ed8
...@@ -128,7 +128,6 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A ...@@ -128,7 +128,6 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
sellingWater.setExtract(acceptDetailed.getExtract()); sellingWater.setExtract(acceptDetailed.getExtract());
sellingWater.setGoodNumber(goodsNumber); sellingWater.setGoodNumber(goodsNumber);
sellingWater.setCommission(acceptDetailed.getDivisionAmount()); sellingWater.setCommission(acceptDetailed.getDivisionAmount());
sellingWater.setSourceId(acceptId);
insertSelective(sellingWater); insertSelective(sellingWater);
log.info("购买计算用户未入账----payOrderWater--------userId===" + acceptDetailed.getMchId() + "----amount====" + acceptDetailed.getDivisionAmount() + "--orderType===" + orderType); log.info("购买计算用户未入账----payOrderWater--------userId===" + acceptDetailed.getMchId() + "----amount====" + acceptDetailed.getDivisionAmount() + "--orderType===" + orderType);
if (orderType == 3) { if (orderType == 3) {
...@@ -139,7 +138,7 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A ...@@ -139,7 +138,7 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
} }
//订单完成计算用户拥金 //订单完成计算用户拥金
public void finishOrderWater(OrderWaterDTO orderWaterDTO) { public BigDecimal finishOrderWater(OrderWaterDTO orderWaterDTO) {
AppUserSellingWater sellingWater=new AppUserSellingWater(); AppUserSellingWater sellingWater=new AppUserSellingWater();
sellingWater.setAcceptId(orderWaterDTO.getAcceptId()); sellingWater.setAcceptId(orderWaterDTO.getAcceptId());
sellingWater.setWaiting(0); sellingWater.setWaiting(0);
...@@ -147,13 +146,15 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A ...@@ -147,13 +146,15 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
if (sellingWater != null ){ if (sellingWater != null ){
sellingWater.setWaiting(1); sellingWater.setWaiting(1);
updateSelectiveById(sellingWater); updateSelectiveById(sellingWater);
return sellingWater.getCommission();
} }
return BigDecimal.ZERO;
} }
//订单完成计算用户拥金 //订单完成计算用户拥金
public void finishOrderFWater(OrderWaterDTO orderWaterDTO) { public void finishOrderFWater(OrderWaterDTO orderWaterDTO) {
Integer acceptId = orderWaterDTO.getAcceptId() == null ? 0 :orderWaterDTO.getAcceptId(); Integer acceptId = orderWaterDTO.getAcceptId() == null ? 0 :orderWaterDTO.getAcceptId();
Integer zAcceptId = orderWaterDTO.getZAcceptId()== null ? 0 :orderWaterDTO.getAcceptId(); Integer zAcceptId = orderWaterDTO.getZAcceptId()== null ? 0 :orderWaterDTO.getZAcceptId();
BigDecimal orderAmount = orderWaterDTO.getOrderAmount() == null ? BigDecimal.ZERO : orderWaterDTO.getOrderAmount(); BigDecimal orderAmount = orderWaterDTO.getOrderAmount() == null ? BigDecimal.ZERO : orderWaterDTO.getOrderAmount();
log.info("---分账id===="+acceptId+"----zAcceptId=="+zAcceptId+"---orderAmount===="+orderAmount); log.info("---分账id===="+acceptId+"----zAcceptId=="+zAcceptId+"---orderAmount===="+orderAmount);
if (acceptId == 0 || zAcceptId == 0 || orderAmount.compareTo(BigDecimal.ZERO) == 0){ if (acceptId == 0 || zAcceptId == 0 || orderAmount.compareTo(BigDecimal.ZERO) == 0){
...@@ -214,9 +215,13 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A ...@@ -214,9 +215,13 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
myWaterBiz.updMyWalletUnbooked(userId,price,2); myWaterBiz.updMyWalletUnbooked(userId,price,2);
} }
if (commission.compareTo(BigDecimal.ZERO) > 0){ if (commission.compareTo(BigDecimal.ZERO) > 0){
MyWalletDetail myWalletDetail=new MyWalletDetail(); MyWalletDetail detail=new MyWalletDetail();
myWalletDetail detail.setUserId(userId);
myWaterBiz.updMyWater(myWalletDetail); detail.setAmount(commission);
detail.setCono(orderId);
detail.setWithDrawOrderNo(appUserSellingWater.getOrderNo());
detail.setSource(1);
myWaterBiz.updMyWater(detail);
} }
} }
} }
......
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