|  | @@ -1591,6 +1591,62 @@ module.exports = app => {
 | 
	
		
			
				|  |  |              return this.resultStageJgcl;
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +        async _gatherStageYjcl(tender, stage) {
 | 
	
		
			
				|  |  | +            const data = await this.ctx.service.stageYjcl.getStageData(stage);
 | 
	
		
			
				|  |  | +            for (const d of data) {
 | 
	
		
			
				|  |  | +                d.end_qty = this.ctx.helper.add(d.pre_qty, qty);
 | 
	
		
			
				|  |  | +                d.end_tp = this.ctx.helper.add(d.pre_tp, tp);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +            this.resultStageJgcl.push(...data);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        async _gatherMonthStageYjcl(sTender, month) {
 | 
	
		
			
				|  |  | +            const tender = await this.ctx.service.tender.getCheckTender(sTender.tid);
 | 
	
		
			
				|  |  | +            const stages = await this._getValidStages(tender.id);
 | 
	
		
			
				|  |  | +            const stage = this.ctx.helper._.find(stages, {s_time: month});
 | 
	
		
			
				|  |  | +            await this._gatherStageYjcl(tender, stage);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        async _gatherOrderStageYjcl(sTender, order) {
 | 
	
		
			
				|  |  | +            const tender = await this.ctx.service.tender.getCheckTender(sTender.tid);
 | 
	
		
			
				|  |  | +            const stages = await this._getValidStages(tender.id);
 | 
	
		
			
				|  |  | +            const stage = this.ctx.helper._.find(stages, {order: order});
 | 
	
		
			
				|  |  | +            await this._gatherStageYjcl(tender, stage);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        async _gatherFinalStageYjcl(sTender) {
 | 
	
		
			
				|  |  | +            const tender = await this.ctx.service.tender.getCheckTender(sTender.tid);
 | 
	
		
			
				|  |  | +            const stages = await this._getValidStages(tender.id);
 | 
	
		
			
				|  |  | +            await this._gatherStageYjcl(tender, stages[0]);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        async _gatherCheckedFinalStageYjcl(sTender) {
 | 
	
		
			
				|  |  | +            const tender = await this.ctx.service.tender.getCheckTender(sTender.tid);
 | 
	
		
			
				|  |  | +            const stages = await this._getCheckedStages(tender.id);
 | 
	
		
			
				|  |  | +            await this._gatherStageYjcl(tender, stages[0]);
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +        async getGatherStageYjcl(memFieldKeys, gsDefine, gsCustom) {
 | 
	
		
			
				|  |  | +            if (!gsDefine || !gsDefine.enable) return [];
 | 
	
		
			
				|  |  | +            if (!gsCustom || !gsCustom.tenders || gsCustom.tenders.length === 0) return [];
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            this.resultStageYjcl = [];
 | 
	
		
			
				|  |  | +            const gsSetting = JSON.parse(gsDefine.setting);
 | 
	
		
			
				|  |  | +            for (const tender of gsCustom.tenders) {
 | 
	
		
			
				|  |  | +                switch (gsSetting.type) {
 | 
	
		
			
				|  |  | +                    case 'month':
 | 
	
		
			
				|  |  | +                        await this._gatherMonthStageYjcl(tender, gsCustom.month);
 | 
	
		
			
				|  |  | +                        break;
 | 
	
		
			
				|  |  | +                    case 'final':
 | 
	
		
			
				|  |  | +                        await this._gatherFinalStageYjcl(tender);
 | 
	
		
			
				|  |  | +                        break;
 | 
	
		
			
				|  |  | +                    case 'checked-final':
 | 
	
		
			
				|  |  | +                        await this._gatherCheckedFinalStageYjcl(tender);
 | 
	
		
			
				|  |  | +                        break;
 | 
	
		
			
				|  |  | +                    case 'stage':
 | 
	
		
			
				|  |  | +                        await this._gatherOrderStageYjcl(tender, gsCustom.stage);
 | 
	
		
			
				|  |  | +                        break;
 | 
	
		
			
				|  |  | +                }
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +            return this.resultStageYjcl;
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          async _gatherStageBonus(tender, stage) {
 | 
	
		
			
				|  |  |              const data = await this.ctx.service.stageBonus.getEndStageData(tender.id, stage.order);
 | 
	
		
			
				|  |  |              for (const d of data) {
 |