| | |
| | | String query = 'Select Id, Opportunity__c, Tender_information__c, ' |
| | | + 'Tender_information__r.status__c, Tender_information__r.TenderManageCode__c,Tender_information__r.RecordTypeId, Tender_information__r.CreatedDate,' |
| | | + 'Opportunity__r.OwnerId, Opportunity__r.AccountId, Opportunity__r.StageName__c, ' |
| | | + 'Opportunity__r.Assistant_Applied_Date__c, Opportunity__r.Cnt_Lost_cancel_Draft__c, Opportunity__r.ConfirmationofAward__c, ' |
| | | + 'Opportunity__r.Assistant_Applied_Date__c, Opportunity__r.Cnt_Lost_cancel_Draft__c, Opportunity__r.Cnt_Lost_cancel_report__c, Opportunity__r.DirectLossFLG__c, Opportunity__r.ConfirmationofAward__c, ' |
| | | + 'Opportunity__r.Contract_DB_complite_day__c, Opportunity__r.Contract_Authorize_Lock__c, Opportunity__r.LeakageNumber__c, ' |
| | | + 'Opportunity__r.ConfirmationofAward_createTime__c ' |
| | | + 'FROM Tender_Opportunity_Link__c ' |
| | | + 'WHERE Tender_information__r.InfoType__c = \'3:结果\' ' |
| | | + 'AND (Tender_information__r.subInfoType__c = \'3-5:中标通知\' OR Tender_information__r.subInfoType__c = \'3-6:合同公告\') ' |
| | | + 'AND Tender_information__r.RecordTypeId = \'01210000000VLUI\' '; |
| | | + 'AND Opportunity__r.ConfirmationofAward__c = null AND Tender_information__r.TerminateApprovalStatus__c != \'批准\' '; //lt DB202304062844 20230515 项目终止流程开发 add |
| | | //+ 'AND Tender_information__r.RecordTypeId = \'01210000000VLUI\' '; |
| | | |
| | | //20220715 you 招标任务 start |
| | | if(TenderIds !=null && TenderIds.size() > 0){ |
| | |
| | | system.debug('test3'+topp.Opportunity__c); |
| | | logstr += 'Batch execute ' + '\r\n 询价进入for----- :'+ topp; |
| | | // 已存在有效状态任务的询价,不用再次产生任务 |
| | | if (mapTask.isEmpty() |
| | | || (!mapTask.isEmpty() && !mapTask.containsKey(topp.Opportunity__c))){ |
| | | if ((mapTask.isEmpty() |
| | | || (!mapTask.isEmpty() && !mapTask.containsKey(topp.Opportunity__c))) && !(topp.Opportunity__r.DirectLossFLG__c || topp.Opportunity__r.StageName__c == '失单' || topp.Opportunity__r.Cnt_Lost_cancel_report__c > 0) && !(topp.Opportunity__r.Contract_DB_complite_day__c != null && topp.Opportunity__r.Contract_Authorize_Lock__c)){ |
| | | |
| | | //1.内部确认状态为05.询价中且关联询价的状态1为询价 且 价格申请 不等于 真 -- > 创建并派发任务 |
| | | if (topp.Tender_information__r.status__c == '05.询价中' && topp.Opportunity__r.StageName__c == '询价' && topp.Opportunity__r.Assistant_Applied_Date__c == null && topp.Opportunity__r.LeakageNumber__c !=1){ |
| | | if (topp.Tender_information__r.status__c == '05.询价中' && topp.Opportunity__r.StageName__c == '询价' && topp.Opportunity__r.Assistant_Applied_Date__c == null && !topp.Opportunity__r.DirectLossFLG__c){ |
| | | logstr += 'Batch execute ' + '\r\n 询价进入第一个判断条件----- :'+ topp.Opportunity__c ; |
| | | Task__c tempTask = new Task__c(); |
| | | tempTask.RecordTypeId = winBiddingTask_TaskId; |
| | |
| | | |
| | | //2. 存在已提交的失单报告或者询价状态1=失单 -- >中标确认:竞争对手中标 |
| | | // 招标项目中的中标确认更改在Batch中更新 |
| | | if (topp.Opportunity__r.Cnt_Lost_cancel_Draft__c > 0 || topp.Opportunity__r.StageName__c == '失单'){ |
| | | if (topp.Opportunity__r.DirectLossFLG__c || topp.Opportunity__r.StageName__c == '失单'){ |
| | | logstr += 'Batch execute ' + '\r\n 询价进入第二个判断条件----- :'+ topp.Opportunity__c ; |
| | | //中标确认字段赋值竞争对手中标 |
| | | if(oppMap.isEmpty() || !oppMap.containsKey(topp.Opportunity__c)){ |