package com.ag.account.detail.impl;

import com.ag.account.detail.AccountDetail;
import com.ag.account.feeUtil.BulkTonUtil;
import com.ag.entity.fee.ContractItem;
import com.ag.entity.fee.face.ICondition;
import com.alibaba.fastjson.JSONObject;
import org.springframework.util.Assert;

/**
 * 计费吨
 */
public class BulkShipDetail extends AccountDetail {
    

    /**
     * 计价单位=计费吨，子类获取数量属性的方法重写
     * @param property
     * @param contractItem
     * @return
     */
    protected Double getQuantity(JSONObject property, ContractItem contractItem){
        Assert.notNull(property.get(ICondition.weight), "重量不允许为空");
        Double ton = BulkTonUtil.calcTon(property, contractItem);
        return BulkTonUtil.roundTon(ton, contractItem);
    }
}
