Pu Zhibing
2025-07-17 93655c74c94446f31f1bed1783c054a5d171f10b
UserQYTTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java
@@ -517,20 +517,22 @@
    /**
     * 批量订单
     *
     * @throws Exception
     */
    @Override
    public ResultUtil<BaseWarpper> saveOrderPrivateCars(String serverCarModel, Date travelTime, Integer reservation, Integer instead, String placementLon, String placementLat, String startLon, String startLat, String startAddress, String endLon, String endLat, String endAddress, String name, String phone, Integer orderSource, Integer driverId, Integer uid, Integer peopleNum) throws Exception {
    public ResultUtil<BaseWarpper> saveOrderPrivateCars(String serverCarModel, Date travelTime, Integer reservation, Integer instead, String placementLon, String placementLat, String startLon, String startLat, String startAddress, String endLon,
                                                        String endLat, String endAddress, String name, String phone, Integer orderSource, Integer driverId, Integer uid, Integer peopleNum) throws Exception {
        BaseWarpper baseWarpper = new BaseWarpper();
        if (lock.tryLock()) {
            try{
            //如果出行时间大于当前10分钟则默认为预约单
            if(travelTime.getTime() > (System.currentTimeMillis() + 600000)){
                reservation = 2;
            }
            /**
             * 1.出租车、专车、跨城有待支付的订单不能叫车
            try {
                //如果出行时间大于当前10分钟则默认为预约单
                if (travelTime.getTime() > (System.currentTimeMillis() + 600000)) {
                    reservation = 2;
                }
                /**
                 * 1.出租车、专车、跨城有待支付的订单不能叫车
             * 2.小件物流有未完成的订单可以下跨城、专车、出租车
             * 3.出租车、专车、跨城有预约单可以下即时单
             */
@@ -1092,23 +1094,23 @@
                paymentRecordService.saveData(1, orderPrivateCar.getUserId(), 1, id, 1, 2, query.getMoney(), "", 1);//添加预支付数据
            }
            if(payType == 3){//余额支付
                if(userInfo.getBalance() != null && userInfo.getBalance() < query.getMoney()){
                if (userInfo.getBalance() != null && userInfo.getBalance() < query.getMoney()) {
                    return ResultUtil.error("余额不足,无法完成支付");
                }
                resultUtil= appOrderController.moneyPay(id,userInfo.getId(),query.getMoney());
                if(resultUtil.getCode()==500){
                    return ResultUtil.error("电子余额不足,无法完成支付");
                }
//                resultUtil= appOrderController.moneyPay(id,userInfo.getId(),query.getMoney());
//                if(resultUtil.getCode()==500){
//                    return ResultUtil.error("电子余额不足,无法完成支付");
//                }
                userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(query.getMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
                //添加交易明细
                transactionDetailsService.saveData(uid, "快车取消订单", query.getMoney(), 2, 1, 1, 1, id);
                userInfoService.updateById(userInfo);
                //解除小号绑定
                if(orderPrivateCar.getBindId() != null){
                if (orderPrivateCar.getBindId() != null) {
                    chinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId(), orderPrivateCar.getTelX(), (System.currentTimeMillis() + 600000));
                }
                orderPrivateCar.setState(10);
                orderPrivateCar.setTelX("");
                orderPrivateCar.setBindId("");
@@ -2609,23 +2611,23 @@
            resultUtil = payMoneyUtil.alipay("感谢费", "感谢费", "", orderId + "_1_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/aliPayThankYouFee");
            paymentRecordService.saveData(3, uid, 1, orderId, 1, 2, money, "", 1);//添加预支付数据
        }
        if(payType == 3){//余额支付
            if(userInfo.getBalance() == null || userInfo.getBalance() < money){
        if(payType == 3) {//余额支付
            if (userInfo.getBalance() == null || userInfo.getBalance() < money) {
                return ResultUtil.error("余额不足,无法完成支付");
            }
            resultUtil= appOrderController.moneyPay(orderId,userInfo.getId(),money);
            if(resultUtil.getCode()==500){
                return ResultUtil.error("电子余额不足,无法完成支付");
            }
//            resultUtil= appOrderController.moneyPay(orderId,userInfo.getId(),money);
//            if(resultUtil.getCode()==500){
//                return ResultUtil.error("电子余额不足,无法完成支付");
//            }
            userInfo.setBalance(new BigDecimal(userInfo.getBalance()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());
            SysIntegral query1 = sysIntegralMapper.query(orderPrivateCar.getCompanyId());
            userInfo.setIntegral(userInfo.getIntegral() + (money.intValue() * query1.getIntegral()));//积分
            //添加交易明细
            transactionDetailsService.saveData(uid, "快车订单-感谢费", money, 2, 1, 1, 1, orderId);
            userInfoService.updateById(userInfo);
            orderPrivateCar.setThankYouFee(money);
            this.updateById(orderPrivateCar);