| | |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.system.dao.DriverWorkMapper; |
| | | import com.stylefeng.guns.modular.system.dao.TUseMoneyMapper; |
| | | import com.stylefeng.guns.modular.system.dao.UserCouponRecordMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ChinaMobileUtil; |
| | |
| | | private IPaymentRecordService paymentRecordService; |
| | | @Autowired |
| | | private ITransactionDetailsService transactionDetailsService; |
| | | @Autowired |
| | | private UserCouponRecordMapper userCouponRecordMapper; |
| | | /** |
| | | * 司机手动确认收款 |
| | | * @param orderId |
| | |
| | | // 平台收入 |
| | | double money; |
| | | Driver driver = driverService.selectById(orderTaxi.getDriverId()); |
| | | Company company = companyService.selectById(driver.getFranchiseeId()); |
| | | Company company = companyService.selectById(driver.getCompanyId()); |
| | | |
| | | if(orderTaxi.getOrderSource() == 2 || orderTaxi.getOrderSource() == 3){ |
| | | double v = company.getPercentageDeduction() / 100; |
| | |
| | | money = company.getFixedDeduction(); |
| | | moneyTwo = orderTaxi.getOrderMoney()-money; |
| | | } |
| | | Double orderMoney = orderTaxi.getOrderMoney(); |
| | | if (orderTaxi.getCouponId()!=null){ |
| | | UserCouponRecord userCouponRecord = userCouponRecordMapper.selectById(orderTaxi.getCouponId()); |
| | | // if(userCouponRecord.getCompanyId() != orderTaxi.getCompanyId()){ |
| | | // return ResultUtil.error("优惠券不能用于此订单", ""); |
| | | // } |
| | | // if(userCouponRecord.getState() == 2){ |
| | | // return ResultUtil.error("优惠券已使用", ""); |
| | | // } |
| | | // if(userCouponRecord.getState() == 3){ |
| | | // return ResultUtil.error("优惠券已过期", ""); |
| | | // } |
| | | // if(userCouponRecord.getCouponUseType() != 0 && userCouponRecord.getCouponUseType() != 2){ |
| | | // return ResultUtil.error("优惠券不能用于此类型订单", ""); |
| | | // } |
| | | // if(userCouponRecord.getCouponType() == 2 && orderMoney.compareTo(userCouponRecord.getFullMoney()) < 0){ |
| | | // return ResultUtil.error("优惠券不能用于此订单", ""); |
| | | // } |
| | | orderMoney = orderMoney - userCouponRecord.getMoney(); |
| | | orderTaxi.setCouponMoney(userCouponRecord.getMoney()); |
| | | orderTaxi.setCouponId(orderTaxi.getCouponId()); |
| | | } |
| | | orderTaxi.setPayMoney(orderMoney); |
| | | orderTaxiService.updateById(orderTaxi); |
| | | |
| | | driver.setBalance(driver.getBalance() + moneyTwo); |
| | | // 新增扣除使用费记录 |
| | | transactionDetailsService.saveDataTaxi(driver.getId(), "软件使用费", money, 2, 1, 2, 6, orderTaxi.getId(),placeOrderWay,company.getId()); |