package com.steering.pss.sale.order;

import CoreFS.SA06.CoreReturnObject;
import CoreFS.SA08.CoreXmlSqlParsersFactory;

import com.steering.comm.db.DBCommon;

import com.steering.comm.tools.StringTool;

public class CoreOrderReviewTechnologyList extends DBCommon {

    /**
     * 合同状态数据源绑定
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
    public CoreReturnObject GetSts() {
        return this.getDataBySqlID("CoreOrderReviewTechnologyList.GetSts");
    }

    /**
     * 合同状态数据源绑定
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
    public CoreReturnObject GetDesignSts() {
        return this
                .getDataBySqlID("CoreOrderReviewTechnologyList.GetDesignSts");
    }

    /**
     * 获取合同行主信息
     * @param includeDeleted 是否包含已删除数据
     * @param name 专用线描述
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
    public CoreReturnObject doQuery(String ordLnPk, String orderSts,
            String designSts) {
        Object[] params = new Object[] { ordLnPk, orderSts, designSts };
        return this.getDataBySqlID("CoreOrderReviewTechnologyList.doQuery",
                params);
    }

    /**
     * 获取合同行从表交货信息
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
    public CoreReturnObject GetOrderLineDelivery(String ordLnPk,
            String orderSts, String designSts) {
        Object[] params = new Object[] { ordLnPk, orderSts, designSts };
        return this.getDataBySqlID(
                "CoreOrderReviewTechnologyList.GetOrderLineDelivery", params);
    }

    /**
     * 产品交付要求数据绑定
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
    public CoreReturnObject GetDesignStd(String ordLnPk) {
        Object[] obj = new Object[] { ordLnPk };
        return this.getDataBySqlID("CoreOrderReviewTechnologyList.GetDesignStd",
                obj);
    }

    /**
     * 生产制程，全程途径数据绑定
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
    public CoreReturnObject GetDesignMscPl(String ordLnPk) {
        Object[] obj = new Object[] { ordLnPk };
        return this.getDataBySqlID(
                "CoreOrderReviewTechnologyList.GetDesignMscPl", obj);
    }

    /**
     * 依据全程途径获取对应钢种
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
    public CoreReturnObject GetDesignMscPlGz(String designKey) {
        Object[] obj = new Object[] { designKey };
        return this.getDataBySqlID(
                "CoreOrderReviewTechnologyList.GetDesignMscPlGz", obj);
    }

    /**
     * 依据全程途径获取工序投入产出物料
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
    public CoreReturnObject GetDesignMscPlIn(String designKey) {
        Object[] obj = new Object[] { designKey };
        return this.getDataBySqlID(
                "CoreOrderReviewTechnologyList.GetDesignMscPlIn", obj);
    }

    /**
     * 依据工序获取适用产线
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
    public CoreReturnObject GetDesignMscPlGxPrl(String designKey,
            String processCode) {
        Object[] obj = new Object[] { designKey, processCode };
        return this.getDataBySqlID(
                "CoreOrderReviewTechnologyList.GetDesignMscPlGxPrl", obj);
    }

    /**
     * 依据工序获取适用产线
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
    public CoreReturnObject GetComMscJg(String designKey) {
        Object[] obj = new Object[] { designKey };
        return this.getDataBySqlID("CoreOrderReviewTechnologyList.GetComMscJg",
                obj);
    }

    /**
     * 获取接箍备料信息
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
    public CoreReturnObject GetJgBl(String designKey, String codeJg) {
        Object[] obj = new Object[] { designKey, codeJg };
        return this.getDataBySqlID("CoreOrderReviewTechnologyList.GetJgBl",
                obj);
    }

    /**
     * 备料码
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
    public CoreReturnObject GetMscBl(String ordLnPk) {
        Object[] obj = new Object[] { ordLnPk };
        return this.getDataBySqlID("CoreOrderReviewTechnologyList.GetMscBl",
                obj);
    }

    /**
     * 交货行数据绑定
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
    public CoreReturnObject GetMscPlPc(String ordLnPk, String mscPline) {
        Object[] obj = new Object[] { ordLnPk, mscPline, mscPline, mscPline };
        return this.getDataBySqlID("CoreOrderReviewTechnologyList.GetMscPlPc",
                obj);
    }

    /**
     * 获取交货行对应的工序
     * @return CoreReturnObject 必须返回CoreReturnObject
     */
    public CoreReturnObject GetMscPlPcLst(String designKey) {
        Object[] obj = new Object[] { designKey };
        return this.getDataBySqlID(
                "CoreOrderReviewTechnologyList.GetMscPlPcLst", obj);
    }

    /**
     * 获取Bom
     * @param ordLnPk 和同行
     * @return
     */
    public CoreReturnObject getBomLst(String designKey) {
        String sql = CoreXmlSqlParsersFactory
                .getSql("CoreOrderReviewTechnologyList.getBomLst");
        sql = StringTool.ReplaceAll(sql, "#DESGIN_KEY#", designKey);

        return this.getData(sql);
    }

    /**
     * 获取Bom
     * @param ordLnPk 和同行
     * @return
     */
    public CoreReturnObject getCraftBomLst(String designKey) {
        String sql = CoreXmlSqlParsersFactory
                .getSql("CoreOrderReviewTechnologyList.getCraftBomLst");
        sql = StringTool.ReplaceAll(sql, "#DESGIN_KEY#", designKey);

        return this.getData(sql);
    }

    /**
     * 获取Bom
     * @param bom bom编码
     * @return
     */
    public CoreReturnObject getBomLstByBomJg(String bom, String bomJg) {
        String sql = CoreXmlSqlParsersFactory
                .getSql("CoreOrderReviewTechnologyList.getBomLstByBomJg");
        sql = StringTool.ReplaceAll(sql, "#BOM#", bom);
        sql = StringTool.ReplaceAll(sql, "#BOM_JG#", bomJg);

        return this.getData(sql);
    }

    /**
     * 获取BomJg
     * @param bom
     * @return
     */
    public CoreReturnObject getBomJgLst(String bom) {
        String sql = CoreXmlSqlParsersFactory
                .getSql("CoreOrderReviewTechnologyList.getBomJgLst");
        sql = StringTool.ReplaceAll(sql, "#BOM#", bom);

        return this.getData(sql);
    }

    /**
     * 获取BomBl
     * @param bom
     * @return
     */
    public CoreReturnObject getBomBlLst(String bom) {
        String sql = CoreXmlSqlParsersFactory
                .getSql("CoreOrderReviewTechnologyList.getBomBlLst");
        sql = StringTool.ReplaceAll(sql, "#BOM#", bom);

        return this.getData(sql);
    }

    /**
     * 获取加工bom
     * @param bom
     * @return
     */
    public CoreReturnObject getBomILst(String bom) {
        String sql = CoreXmlSqlParsersFactory
                .getSql("CoreOrderReviewTechnologyList.getBomILst");
        sql = StringTool.ReplaceAll(sql, "#BOM#", bom);

        return this.getData(sql);
    }

    /**
     * 查询引用的MPS文本
     * @param ordLnPk
     * @return
     */
    public CoreReturnObject selectMpsAddr(String ordLnPk) {
        String sql = CoreXmlSqlParsersFactory
                .getSql("CoreOrderReviewTechnologyList.selectMpsAddr");
        sql = StringTool.ReplaceAll(sql, "#ORD_LN_PK#", ordLnPk);

        return this.getData(sql);
    }

}