kongdeqiang
2022-09-26 18087f533cd48ddb9f972c0848ffe920ec58ee8e
src/main/java/com/boying/service/CostRuleService.java
@@ -274,17 +274,23 @@
    public double money(long l,Double cost,Integer maxCost){
        l=l/1000/60;
        int time = 0;
        if(((l*1.0)/60)>(l/60)){//判断停车时间是否要加1
            time = Long.valueOf(l / 60 + 1).intValue();
//        if(((l*1.0)/60)>(l/60)){//判断停车时间是否要加1
//            time = Long.valueOf(l / 60 + 1).intValue();
//        }else{
//            time = Long.valueOf(l / 60).intValue();
//        }
        if(((l*1.0)/30)>(l/30)){//判断停车时间是否要加1
            time = Long.valueOf(l / 30 + 1).intValue();
        }else{
            time = Long.valueOf(l / 60).intValue();
            time = Long.valueOf(l / 30).intValue();
        }
        if(maxCost!=null){
            if(time*cost>maxCost){//大于封顶价格
            if(time*cost+1>maxCost){//大于封顶价格
                return maxCost;
            }
        }
        return time*cost;
        return time*cost+1;
    }
    public static void main(String[] args) {