puzhibing
2022-10-12 448ffdc100aade7aa1f440923abdd8ff561b4b72
DriverIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java
@@ -25,6 +25,8 @@
import java.io.FileWriter;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.util.*;
@@ -261,12 +263,12 @@
    @Override
    public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address,String phone) throws Exception {
        OrderPrivateCar orderPrivateCar = this.selectById(orderId);
        if(state==5){
            UserInfo userInfo = userInfoMapper.selectById(orderPrivateCar.getUserId());
            if(!userInfo.getPhone().substring(7, userInfo.getPhone().length()).equals(phone)){
                return ResultUtil.error("手机号错误");
            }
        }
//        if(state==5){
//            UserInfo userInfo = userInfoMapper.selectById(orderPrivateCar.getUserId());
//            if(!userInfo.getPhone().substring(7, userInfo.getPhone().length()).equals(phone)){
//                return ResultUtil.error("手机号错误");
//            }
//        }
        if(state==3 && orderPrivateCar.getState()!=2){
            return ResultUtil.error("当前订单不能触发前往预约地点");
        }
@@ -394,7 +396,7 @@
                    }
                    if(company.getIsSpeFixedOrProportional() == 1){//比例
                        Double price = orderPrivateCar.getStartMoney() + orderPrivateCar.getMileageMoney() + orderPrivateCar.getWaitMoney() + orderPrivateCar.getDurationMoney() + orderPrivateCar.getLongDistanceMoney();
                        d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                        d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN)));
                        c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);
                    }
                    incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue());