package org.ta.pddserver.utils;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class PddJYPriceTool {

    public static int calculateWeight( int length, int width, int height, int weight, boolean international) {
        if (international) {
            // 国际件
            return PddOverseaPriceTool.calculateWeight(length, width, height, weight);
        } else {
            // 国内件 属于退件
            return PddNationalPriceTool.calculateWeight(length, width, height, weight);
        }
    }

    public static long calculateFreightFee(int weight, String type, int exchange, boolean international) {
        if (international) {
            return PddOverseaPriceTool.calculatePrice(exchange, weight, type);
        }
        else {
            return PddNationalPriceTool.calculatePrice(weight);
        }
    }

    public static long calculateRent(String enterTime, boolean international) {
        if (international) {
            return PddOverseaPriceTool.calculateRent(enterTime);
        }
        else {
            return PddNationalPriceTool.calculateRent(enterTime);
        }
    }

    /*

    public static FeeResult getTotalFee(String type, int length, int width, int height, int weight, boolean international, String enterTime) {
        log.info("length = {}, width = {}, height={}, weight = {}", length, width, height, weight);
        if (international) {
            // 国际件
            int exchange = 1;
            return PddOverseaPriceTool.FreightCostCalculation(type, length, width, height, weight, exchange, enterTime);
        } else {
            // 国内件 属于退件
            return PddNationalPriceTool.FreightCostCalculation(length, width, height, weight, enterTime);
        }
    }

    @Data
    public static class FeeResult {
        int weight;
        int rentFee;
        int freightFee;
    }

     */
}
