高章伟
2023-03-03 d8dc84a3d56df839895f1c417a4d9cbee763d262
force-app/main/default/classes/TenderOpportunityLinkHandler.cls
@@ -351,18 +351,27 @@
            }
        }
        if (null!=oppTens && oppTens.size()>0) {
          //20221208 you DB202211594688 有确认任务的询价不清空中标信息 taskStatus__c <> '完成'
          List<Opportunity> opportunities = [select id, Bidding_Project_Name_Bid__c,Opp_Order__c from Opportunity where id in :oppIds];
           List<task__c> taskList = [select id,taskStatus__c,Tender_information_Task__c,OpportunityId__c from task__c where (RecordType.Name ='失单报告任务' and OpportunityId__c in:oppIds) or (RecordType.Name ='中标结果确认' and Opp_Tender__c in :oppTens)];
           List<task__c> taskList = [select id,taskStatus__c,RecordType.Name,Tender_information_Task__c,OpportunityId__c from task__c where ((RecordType.Name ='失单报告任务' and OpportunityId__c in:oppIds) or (RecordType.Name ='中标结果确认' and Opp_Tender__c in :oppTens)) and taskStatus__c <> '03 完成'];
            for(task__c tsk : taskList){
                if(tsk.RecordType.Name =='失单报告任务' && oppIds.contains(tsk.OpportunityId__c) && tsk.taskStatus__c !='03 完成'){
                  //不做操作
                }else{
                tsk.taskStatus__c = '04 取消';
                tsk.cancelDate__c = date.today();
                tsk.cancelReasonSelect__c = '取消询价关联';
                }
            }
             update taskList;
            if(taskList.size() > 0){
                for (task__c tlink : taskList) {
                    for (Opportunity opp : opportunities) {
                        if (opp.Id == tlink.OpportunityId__c) {
                            if(tlink.RecordType.Name =='失单报告任务' && tlink.taskStatus__c !='03 完成'){
                              //不做操作
                            }else{
                           //20220718 you 询价任务 start
                            opp.ConfirmationofAward__c = null;
                            opp.Task_createTime__c = null;
@@ -370,8 +379,9 @@
                            opp.LostTask_comfirmTime__c =null;
                            opp.Is_ConfirmationofAward__c =null;
                            opp.LostTask_createTime__c =null;
                            opp.Closing_Bid_Date__c = null;
                                //opp.Closing_Bid_Date__c = null;
                            //20220718 you 询价任务 end
                            }
                       }  
                    }
                }
@@ -423,6 +433,7 @@
                        opp.Bidding_Project_Name_Bid__c = null;
                        //opp.TenderBeginDate_Text__c = null;
                        opp.InfoTypeBid_text__c = null;
                        /** 20221208 you DB202211594688 无任务询价,不清空招标信息
                        //20220718 you 询价任务 start
                        opp.ConfirmationofAward__c = null;
                        opp.Task_createTime__c = null;
@@ -431,6 +442,7 @@
                        opp.Is_ConfirmationofAward__c =null;
                        opp.Closing_Bid_Date__c = null;
                        //20220718 you 询价任务 end
                        **/
                        // 20221028 ljh SWAG-CKL5UC start
                        opp.LeakageNumber__c = null;
                        // 20221028 ljh SWAG-CKL5UC end