ibizorder-detail-service-base.ts 14.9 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
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';
    }

// 实体接口

    /**
44
     * CheckKey接口方法
45 46 47 48 49 50 51
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
52
    public async CheckKey(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
53
        if(context.ibizorder && context.ibizorderdetail){
54 55 56
            let masterData:any = {};
            Object.assign(data,masterData);
            let res:any = await Http.getInstance().post(`/ibizorders/${context.ibizorder}/ibizorderdetails/${context.ibizorderdetail}/checkkey`,data,isloading);
57 58 59
            
            return res;
        }
60
            let res:any = Http.getInstance().post(`/ibizorderdetails/${context.ibizorderdetail}/checkkey`,data,isloading);
61 62 63
            return res;
    }

64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
    /**
     * 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;
    }

80 81 82 83 84 85 86 87 88 89
    /**
     * Create接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
    public async Create(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
90 91 92 93 94 95 96 97 98 99 100 101 102 103
        if(context.ibizorder && true){
            let masterData:any = {};
            Object.assign(data,masterData);
            if(!data.srffrontuf || data.srffrontuf !== "1"){
                data[this.APPDEKEY] = null;
            }
            if(data.srffrontuf){
                delete data.srffrontuf;
            }
            let tempContext:any = JSON.parse(JSON.stringify(context));
            let res:any = await Http.getInstance().post(`/ibizorders/${context.ibizorder}/ibizorderdetails`,data,isloading);
            
            return res;
        }
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
        let masterData:any = {};
        Object.assign(data,masterData);
        if(!data.srffrontuf || data.srffrontuf !== "1"){
            data[this.APPDEKEY] = null;
        }
        if(data.srffrontuf){
            delete data.srffrontuf;
        }
        let tempContext:any = JSON.parse(JSON.stringify(context));
        let res:any = await Http.getInstance().post(`/ibizorderdetails`,data,isloading);
        
        return res;
    }

    /**
     * Get接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
    public async Get(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
128 129 130 131 132
        if(context.ibizorder && context.ibizorderdetail){
            let res:any = await Http.getInstance().get(`/ibizorders/${context.ibizorder}/ibizorderdetails/${context.ibizorderdetail}`,isloading);
            
            return res;
        }
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
            let res:any = await Http.getInstance().get(`/ibizorderdetails/${context.ibizorderdetail}`,isloading);
            
            return res;
    }

    /**
     * GetDraft接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
    public async GetDraft(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
148 149 150 151 152 153
        if(context.ibizorder && true){
            let res:any = await Http.getInstance().get(`/ibizorders/${context.ibizorder}/ibizorderdetails/getdraft`,isloading);
            res.data.ibizorderdetail = data.ibizorderdetail;
            
            return res;
        }
154 155 156 157 158 159 160
        let res:any = await  Http.getInstance().get(`/ibizorderdetails/getdraft`,isloading);
        res.data.ibizorderdetail = data.ibizorderdetail;
        
        return res;
    }

    /**
161
     * GetUnitAndPrice接口方法
162 163 164 165 166 167 168
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
169 170 171 172 173
    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;
174 175 176
    }

    /**
177
     * Remove接口方法
178 179 180 181 182 183 184
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
185 186 187 188 189 190 191
    public async Remove(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
        if(context.ibizorder && context.ibizorderdetail){
            let res:any = Http.getInstance().delete(`/ibizorders/${context.ibizorder}/ibizorderdetails/${context.ibizorderdetail}`,isloading);
            return res;
        }
            let res:any = Http.getInstance().delete(`/ibizorderdetails/${context.ibizorderdetail}`,isloading);
            return res;
192 193 194
    }

    /**
195
     * Save接口方法
196 197 198 199 200 201 202
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
203 204 205 206 207 208 209 210 211 212 213 214 215
    public async Save(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
        if(context.ibizorder && context.ibizorderdetail){
            let masterData:any = {};
            Object.assign(data,masterData);
            let res:any = await Http.getInstance().post(`/ibizorders/${context.ibizorder}/ibizorderdetails/${context.ibizorderdetail}/save`,data,isloading);
            
            return res;
        }
        let masterData:any = {};
        Object.assign(data,masterData);
            let res:any = await  Http.getInstance().post(`/ibizorderdetails/${context.ibizorderdetail}/save`,data,isloading);
            
            return res;
216 217 218
    }

    /**
219
     * Update接口方法
220 221 222 223 224 225 226
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
227
    public async Update(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
228 229 230
        if(context.ibizorder && context.ibizorderdetail){
            let masterData:any = {};
            Object.assign(data,masterData);
231
            let res:any = await Http.getInstance().put(`/ibizorders/${context.ibizorder}/ibizorderdetails/${context.ibizorderdetail}`,data,isloading);
232 233 234
            
            return res;
        }
235 236
        let masterData:any = {};
        Object.assign(data,masterData);
237
            let res:any = await  Http.getInstance().put(`/ibizorderdetails/${context.ibizorderdetail}`,data,isloading);
238 239 240 241 242 243 244 245 246 247 248 249 250 251
            
            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> {
252 253 254 255 256
        if(context.ibizorder && true){
            let tempData:any = JSON.parse(JSON.stringify(data));
            let res:any = Http.getInstance().get(`/ibizorders/${context.ibizorder}/ibizorderdetails/fetchcsmxdy`,tempData,isloading);
            return res;
        }
257 258 259 260 261
        let tempData:any = JSON.parse(JSON.stringify(data));
        let res:any = Http.getInstance().get(`/ibizorderdetails/fetchcsmxdy`,tempData,isloading);
        return res;
    }

262 263 264 265 266 267 268 269 270 271
    /**
     * searchCSMXDY接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
    public async searchCSMXDY(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
272 273 274 275
        if(context.ibizorder && true){
            let tempData:any = JSON.parse(JSON.stringify(data));
            return await Http.getInstance().post(`/ibizorders/${context.ibizorder}/ibizorderdetails/searchcsmxdy`,tempData,isloading);
        }
276 277 278 279
        let tempData:any = JSON.parse(JSON.stringify(data));
        return await Http.getInstance().post(`/ibizorderdetails/searchcsmxdy`,tempData,isloading);
    }

280 281 282 283 284 285 286 287 288 289
    /**
     * FetchDefault接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
    public async FetchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
290 291 292 293 294
        if(context.ibizorder && true){
            let tempData:any = JSON.parse(JSON.stringify(data));
            let res:any = Http.getInstance().get(`/ibizorders/${context.ibizorder}/ibizorderdetails/fetchdefault`,tempData,isloading);
            return res;
        }
295 296 297 298 299
        let tempData:any = JSON.parse(JSON.stringify(data));
        let res:any = Http.getInstance().get(`/ibizorderdetails/fetchdefault`,tempData,isloading);
        return res;
    }

300 301 302 303 304 305 306 307 308 309
    /**
     * searchDefault接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
    public async searchDefault(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
310 311 312 313
        if(context.ibizorder && true){
            let tempData:any = JSON.parse(JSON.stringify(data));
            return await Http.getInstance().post(`/ibizorders/${context.ibizorder}/ibizorderdetails/searchdefault`,tempData,isloading);
        }
314 315 316 317
        let tempData:any = JSON.parse(JSON.stringify(data));
        return await Http.getInstance().post(`/ibizorderdetails/searchdefault`,tempData,isloading);
    }

318 319 320 321 322 323 324 325 326 327
    /**
     * 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> {
328 329 330 331 332
        if(context.ibizorder && true){
            let tempData:any = JSON.parse(JSON.stringify(data));
            let res:any = Http.getInstance().get(`/ibizorders/${context.ibizorder}/ibizorderdetails/fetchlogic_0007`,tempData,isloading);
            return res;
        }
333 334 335 336 337
        let tempData:any = JSON.parse(JSON.stringify(data));
        let res:any = Http.getInstance().get(`/ibizorderdetails/fetchlogic_0007`,tempData,isloading);
        return res;
    }

338 339 340 341 342 343 344 345 346 347
    /**
     * searchLOGIC_0007接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
    public async searchLOGIC_0007(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
348 349 350 351
        if(context.ibizorder && true){
            let tempData:any = JSON.parse(JSON.stringify(data));
            return await Http.getInstance().post(`/ibizorders/${context.ibizorder}/ibizorderdetails/searchlogic_0007`,tempData,isloading);
        }
352 353 354 355
        let tempData:any = JSON.parse(JSON.stringify(data));
        return await Http.getInstance().post(`/ibizorderdetails/searchlogic_0007`,tempData,isloading);
    }

356 357 358 359 360 361 362 363 364 365
    /**
     * FetchX接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
    public async FetchX(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
366 367 368 369 370
        if(context.ibizorder && true){
            let tempData:any = JSON.parse(JSON.stringify(data));
            let res:any = Http.getInstance().get(`/ibizorders/${context.ibizorder}/ibizorderdetails/fetchx`,tempData,isloading);
            return res;
        }
371 372 373 374 375
        let tempData:any = JSON.parse(JSON.stringify(data));
        let res:any = Http.getInstance().get(`/ibizorderdetails/fetchx`,tempData,isloading);
        return res;
    }

376 377 378 379 380 381 382 383 384 385
    /**
     * searchX接口方法
     *
     * @param {*} [context={}]
     * @param {*} [data={}]
     * @param {boolean} [isloading]
     * @returns {Promise<any>}
     * @memberof IBIZOrderDetailServiceBase
     */
    public async searchX(context: any = {},data: any = {}, isloading?: boolean): Promise<any> {
386 387 388 389
        if(context.ibizorder && true){
            let tempData:any = JSON.parse(JSON.stringify(data));
            return await Http.getInstance().post(`/ibizorders/${context.ibizorder}/ibizorderdetails/searchx`,tempData,isloading);
        }
390 391 392
        let tempData:any = JSON.parse(JSON.stringify(data));
        return await Http.getInstance().post(`/ibizorderdetails/searchx`,tempData,isloading);
    }
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412

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