import { Http,Util } from '@/utils';
import EntityService from '../entity-service';
import CountMoneyLogic from '@/service/ibizorder-detail/count-money-logic';
import GetUnitAndPriceLogic from '@/service/ibizorder-detail/get-unit-and-price-logic';



/**
 * 订单明细服务对象基类
 *
 * @export
 * @class IBIZOrderDetailServiceBase
 * @extends {EntityServie}
 */
export default class IBIZOrderDetailServiceBase extends EntityService {

    /**
     * Creates an instance of  IBIZOrderDetailServiceBase.
     * 
     * @param {*} [opts={}]
     * @memberof  IBIZOrderDetailServiceBase
     */
    constructor(opts: any = {}) {
        super(opts);
    }

    /**
     * 初始化基础数据
     *
     * @memberof IBIZOrderDetailServiceBase
     */
    public initBasicData(){
        this.APPLYDEKEY ='ibizorderdetail';
        this.APPDEKEY = 'ibizorderdetailid';
        this.APPDENAME = 'ibizorderdetails';
        this.APPDETEXT = 'ibizorderdetailname';
        this.APPNAME = 'web';
        this.SYSTEMNAME = 'demosys';
    }

// 实体接口

    /**
     * Select接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
    public async Select(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
            let res:any = Http.getInstance().post(`/ibizorderdetails/${context.ibizorderdetail}/select`,data,isloading);

            return res;
    }

    /**
     * SelectTemp接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
    public async SelectTemp(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
            let res:any = Http.getInstance().post(`/ibizorderdetails/${context.ibizorderdetail}/selecttemp`,data,isloading);
            return res;
    }

    /**
     * CountMoney接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
    public async CountMoney(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
        let appLogic:CountMoneyLogic = new CountMoneyLogic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(data))});
        data = await appLogic.onExecute(context,data,isloading?true:false);
        let res:any ={status:200,data:data};
        return res;
    }

    /**
     * GetUnitAndPrice接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
    public async GetUnitAndPrice(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
        let appLogic:GetUnitAndPriceLogic = new GetUnitAndPriceLogic({context:JSON.parse(JSON.stringify(context)),data:JSON.parse(JSON.stringify(data))});
        data = await appLogic.onExecute(context,data,isloading?true:false);
        let res:any ={status:200,data:data};
        return res;
    }

    /**
     * FetchCSMXDY接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
    public async FetchCSMXDY(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
    }

    /**
     * FetchDefault接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
    public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
    }

    /**
     * FetchLOGIC_0007接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
    public async FetchLOGIC_0007(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
    }

    /**
     * FetchX接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
    public async FetchX(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
    }
}