| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.common.constant.state.BalanceChangeType; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.shunfeng.model.*; |
| | | import com.stylefeng.guns.modular.shunfeng.model.vo.ApiJson; |
| | |
| | | String finNum=OrdersUtil.getOrderNoForPrefix("fin"); |
| | | //todo 退款金额大于0需要退款 |
| | | if(orderRide.getPayType()==1){//余额 |
| | | userInfo.setBalanceChangeType(BalanceChangeType.REFUND.getCode()); |
| | | userInfo.setBalance(userInfo.getBalance()+orderRide.getTuiMoney()); |
| | | userInfoService.updateById(userInfo); |
| | | }else if(orderRide.getPayType()==2){ |
| | |
| | | UserInfo userInfo=userInfoService.selectOne(new EntityWrapper<UserInfo>().eq("driverId",orderTravel.getDriverId())); |
| | | if(userInfo!=null){ |
| | | //用户余额可以为负数 |
| | | userInfo.setBalanceChangeType(BalanceChangeType.CONSUME.getCode()); |
| | | userInfo.setBalance(userInfo.getBalance()-orderTravel.getServiceMoney()); |
| | | userInfoService.updateById(userInfo); |
| | | } |
| | |
| | | driverRide.setTotalOrders(driverRide.getTotalOrders()+1); |
| | | driverRideService.updateById(driverRide); |
| | | /*修改用户接单数和司机提成*/ |
| | | |
| | | userInfo.setBalanceChangeType(BalanceChangeType.REFUND.getCode()); |
| | | userInfo.setBalance(userInfo.getBalance()+(orderRide.getMoney()-orderRide.getPlatformMoney())); |
| | | userInfo.setTotalOrders(userInfo.getTotalOrders() + 1); |
| | | userInfoService.updateById(userInfo); |