package com.steering.pss.sale.order;

import CoreFS.SA06.CoreReturnObject;
import java.sql.SQLException;
import java.util.ArrayList;

import CoreFS.SA08.CoreXmlSqlParsersFactory;
import CoreFS.SC01.CoreConstantData;

import com.steering.comm.db.DBCommon;

public class CoreCtrlOrderLine extends DBCommon {
    /**
     * 扣型数据源
     * @param saleRegion
     * @return
     */
    public CoreReturnObject BindCmbBuckle() {
        CoreReturnObject cro = this
                .getDataBySqlID("CoreTransitLine.BindCmbBuckle");
        return cro;
    }

    /**
     * 订货规格数据源
     * @param saleRegion
     * @return
     */
    public CoreReturnObject BindCmbSpec() {
        CoreReturnObject cro = this
                .getDataBySqlID("CoreTransitLine.BindCmbSpec");
        return cro;
    }

    /**
     * 新增订货规格
     * @param saleRegion
     * @return
     */
    public CoreReturnObject BindCmbSpecADD(ArrayList<Object> parm) {
        CoreReturnObject cro = new CoreReturnObject();
        String strSql = CoreXmlSqlParsersFactory
                .getSql("CoreTransitLine.BindCmbSpecADD");
        try {
            cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(
                    strSql, parm.toArray());
        }
        catch (SQLException e) {
            cro = cro.SetErrInfo(e.getMessage());
        }
        return cro;
    }

    /**
     * 修改订货规格
     * @param saleRegion
     * @return
     */
    public CoreReturnObject BindCmbSpecUpdata(ArrayList<Object> parm) {
        CoreReturnObject cro = new CoreReturnObject();
        String strSql = CoreXmlSqlParsersFactory
                .getSql("CoreTransitLine.BindCmbSpecUpdata");
        try {
            cro = this.getDao(CoreConstantData.sysbeanstr).ExcuteNonQuery(
                    strSql, parm.toArray());
        }
        catch (SQLException e) {
            cro = cro.SetErrInfo(e.getMessage());
        }
        return cro;
    }

    /**
     * 修改订货规格
     * @param saleRegion
     * @return
     */
    public CoreReturnObject BindCmbSpecSPECQUERY(String specCode, String name) {
        Object[] params = new Object[] { specCode };
        return this.getDataBySqlID("CoreTransitLine.SPECQUERY", params);
    }

    /**
     * 查询合同资金要求
     * @param saleRegion
     * @return
     */
    public CoreReturnObject BindSlmBalnceMny(String ordpk) {
        Object[] params = new Object[] { ordpk };
        return this.getDataBySqlID("CoreTransitLine.SlmBalnceMny", params);
    }

    /**
     * 合同行是否存在在途提单
     * @param ordLnPk
     * @return
     */
    public CoreReturnObject queryYdmZcBillM(String ordLnPk) {
        Object[] params = new Object[] { ordLnPk };
        return this.getDataBySqlID("CoreCtrlOrderLine.queryYdmZcBillM", params);
    }
    
    /**
     * 合同行出厂计划是否关闭
     * @param ordLnPk
     * @return
     */
    public CoreReturnObject queryYdmSendPlan(String ordLnPk) {
        Object[] params = new Object[] { ordLnPk };
        return this.getDataBySqlID("CoreCtrlOrderLine.queryYdmSendPlan", params);
    }
    
}
