xuhy
2025-01-20 39a637b561df5c2c843635bb28635f6af44fc49b
DriverOKTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java
@@ -456,6 +456,26 @@
                orderTaxi.setGetoffTime(new Date());
                if(orderTaxi.getPayManner()==3){
                    orderTaxi.setState(9);
                    Driver driver = driverService.selectById(orderTaxi.getDriverId());
                    Company company = companyService.selectById(driver.getFranchiseeId());
                    if(Objects.isNull(company)){
                        company = companyService.selectById(driver.getCompanyId());
                    }
                    TransactionDetails transactionDetails = new TransactionDetails();
                    driver.setBalance(driver.getBalance() - company.getFixedDeduction());
                    transactionDetails.setMoney(company.getFixedDeduction());
                    // 新增扣除使用费记录
                    transactionDetails.setUserId(driver.getId());
                    transactionDetails.setInsertTime(new Date());
                    transactionDetails.setRemark("软件使用费");
                    transactionDetails.setState(2);
                    transactionDetails.setType(1);
                    transactionDetails.setUserType(2);
                    transactionDetails.setOrderType(6);
                    transactionDetails.setOrderId(orderTaxi.getId());
                    transactionDetailsMapper.insert(transactionDetails);
                    driverService.updateById(driver);
                }else {
                    orderTaxi.setState(6);
                }
@@ -829,7 +849,11 @@
        map.put("couponMoney", orderTaxi.getCouponMoney());//优惠券抵扣金额
        map.put("discountMoney", orderTaxi.getDiscountMoney());//折扣抵扣金额
        map.put("discount", orderTaxi.getDiscount());//折扣
        map.put("platformFee", transactionDetails.getMoney());//折扣
        if(Objects.isNull(transactionDetails)){
            map.put("platformFee", 0);//折扣
        }else {
            map.put("platformFee", transactionDetails.getMoney());//折扣
        }
        return map;
    }