zhibing.pu
2024-07-25 01d8de48c76467ff3b99b204e66d3ef86506fa52
ManagementIGOTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/controller/specialTrain/TOrderPrivateCarController.java
@@ -212,7 +212,7 @@
    @ResponseBody
    public Object frozenOrder(@RequestParam Integer tOrderPrivateCarId) throws Exception {
        TOrderPrivateCar orderPrivateCar = tOrderPrivateCarService.selectById(tOrderPrivateCarId);
        orderPrivateCar = this.setMoney(orderPrivateCar, 0D, 0D);//计算费用
        //添加已收入明细
        TCompany company = companyService.selectById(orderPrivateCar.getCompanyId());
        Double taxi = company.getSpeMoney().doubleValue();
@@ -245,19 +245,15 @@
        }
        orderPrivateCar.setIsFrozen(orderPrivateCar.getIsFrozen()==1?2:1);
        if(orderPrivateCar.getArriveTime()==null){
            orderPrivateCar.setArriveTime(orderPrivateCar.getStartServiceTime());
        }
        orderPrivateCar = this.setMoney(orderPrivateCar, 0D, 0D);//计算费用
        orderPrivateCar.setState(7);
        tOrderPrivateCarService.updateAllColumnById(orderPrivateCar);
        return SUCCESS_TIP;
    }
    @Resource
    private TSystemPriceMapper systemPriceMapper;
    public TOrderPrivateCar setMoney(TOrderPrivateCar orderPrivateCar, Double parkingFee, Double crossingFee) throws Exception {
        System.err.println("计算金额:"+orderPrivateCar);
        Map<String, Object> query1 = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId());
        //开始根据不同的方式计算金额
        double amount = 0;
@@ -295,7 +291,15 @@
        Date date = new Date();
        double d = (null == orderPrivateCar.getMileage() ? 0D : orderPrivateCar.getMileage()) / 1000;//实际公里
        double t = ((orderPrivateCar.getEndServiceTime().getTime() - orderPrivateCar.getStartServiceTime().getTime()) / 60000) + 1;//实际时间(不满一分钟按一分钟算)
        if (orderPrivateCar.getEndServiceTime() == null){
            orderPrivateCar.setEndServiceTime(new Date());
        }
        double t=1;
        if (orderPrivateCar.getStartServiceTime() == null){
            t = 1;//实际时间(不满一分钟按一分钟算)
        }else{
            t = ((orderPrivateCar.getEndServiceTime().getTime() - orderPrivateCar.getStartServiceTime().getTime()) / 60000) + 1;//实际时间(不满一分钟按一分钟算)
        }
        double w = ((orderPrivateCar.getStartServiceTime().getTime() - orderPrivateCar.getArriveTime().getTime()) / 60000) + 1;//等待分钟(不满一分钟按一分钟算)
        double d1 = (d - num2) < 0 ? 0 : d - num2;//超出起步里程的公里
        double t1 = (t - num3) < 0 ? 0 : new BigDecimal(t - num3).setScale(0, BigDecimal.ROUND_UP).doubleValue();//超过起步分钟数的时间