package com.ag.account.detail;

import com.ag.account.detail.AccountDetail;
import com.ag.account.detail.impl.*;
import com.ag.entity.fee.vo.ContractItemVO;
import org.springframework.util.Assert;

/**
 * Created by Administrator on 2017/6/1 0001.
 */
public class CalcManager {

    //计价单位0=(拼)箱 4=票 5=箱*天 6=吨*天
    // 9=阶梯包干价 14=计费吨 18=阶梯单价
    public static AccountDetail getInstance(ContractItemVO vo){
        Assert.notNull(vo.getUnit(), "计费单位不能为空！费目编号："+vo.getItemId());
        if("0".equals(vo.getUnit())){
            return new CntrShipDetail();
        }
        if("4".equals(vo.getUnit())){
            return new BillShipDetail();
        }
        if("5".equals(vo.getUnit())){
            return new CntrStoreDetail();
        }
        if("6".equals(vo.getUnit())){
            return new BulkStoreDetail();
        }
        if("9".equals(vo.getUnit())){
            return new StepSumDetail();
        }
        if("14".equals(vo.getUnit())){
            return new BulkShipDetail();
        }
        if ("18".equals(vo.getUnit())){
            return new StepRateDetail();
        }
        return null;
    }
}
