Pu Zhibing
2025-04-24 818937959bb19d3669585fa87a526bffe9ce77a4
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);
                }
@@ -744,6 +764,9 @@
            System.err.println("订单数据异常:" + orderId);
            return false;
        }
        if(orderTaxi.getState() != 5){
            return false;
        }
        OrderPosition orderPosition = orderPositionService.queryNew(orderId, 2);
        String now = lon + "," + lat;
        String old = null;
@@ -829,7 +852,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;
    }