From a886e1576fd1f45db37ed84b3c8b61aea4cdd4b1 Mon Sep 17 00:00:00 2001
From: 游畅 <youchang@prec-tech.com>
Date: 星期五, 07 四月 2023 09:55:11 +0800
Subject: [PATCH] 20230407招标项目同步询价的中标信息

---
 force-app/main/default/classes/OpportunityTrigger.cls |  550 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 546 insertions(+), 4 deletions(-)

diff --git a/force-app/main/default/classes/OpportunityTrigger.cls b/force-app/main/default/classes/OpportunityTrigger.cls
index cff9db6..8815df5 100644
--- a/force-app/main/default/classes/OpportunityTrigger.cls
+++ b/force-app/main/default/classes/OpportunityTrigger.cls
@@ -1,5 +1,7 @@
 public without sharing class OpportunityTrigger {
 
+    public static Boolean isFirst = true;
+
     public static void lockOpportunityFile(List<Opportunity> newList, Map<Id, Opportunity> newMap, List<Opportunity> oldList, Map<Id, Opportunity> oldMap) {
 
         List<String> targetIds = new List<String>();
@@ -20,6 +22,7 @@
 
         update ofileList;
     }
+
     //CHAN-AZJ6JS 杩芥函绯荤粺鏉ョ殑璇环锛屽彇娑圵IN鏃讹紝缁忛攢鍟嗚鍗曡嚜鍔ㄦ敼鍒扳�滈┏鍥炩��
     public static void changeConsumableOrderStatus(List<Opportunity> newList, Map<Id, Opportunity> newMap, List<Opportunity> oldList, Map<Id, Opportunity> oldMap) {
         
@@ -40,10 +43,11 @@
                 if (String.isNotBlank(newOpp.Opportunity_No__c)) orderIds.add(newOpp.Opportunity_No__c);
                 //lastbuy  2022/2/9 fy start
                 List<LastbuyProduct__c> upLastbuyObjList = new List<LastbuyProduct__c>();
-                List<LastbuyProduct__c> LastbuyObjList=[select id,LastbuyQuantity__c,InquiryCode__c,ProductName__c from LastbuyProduct__c where InquiryCode__c= : newOpp.Id];
+                List<LastbuyProduct__c> LastbuyObjList=[select id,LastbuyQuantity__c,InquiryCode__c,ProductName__c,effectiveFLG__c from LastbuyProduct__c where InquiryCode__c= : newOpp.Id];
                 if(LastbuyObjList!=null){
                     for(LastbuyProduct__c lastbuypr :LastbuyObjList){
-                        lastbuypr.ActualQuantity__c=null;
+                        lastbuypr.ActualQuantity__c=0;
+                        lastbuypr.effectiveFLG__c=true;
                         upLastbuyObjList.add(lastbuypr);
                     }
                 }
@@ -162,10 +166,14 @@
                 //     temptender.IsReactionOpp__c = true;
                 //     tenderMap.put(temptender.id ,temptender ); 
                 // }
-                // 鍚堝苟鍒ゆ柇鏉′欢
+                // 鍚堝苟鍒ゆ柇鏉′欢 
+                //20220803 you 鎷涙爣椤圭洰澧炲姞 鍙栨秷锛屼腑鏍囩粨鏋滄洿鏂扮‘璁ゆ潯浠�
                 if((op.SAP_Send_OK__c != oldopp.SAP_Send_OK__c) || 
                     ((op.StageName__c.equals('澶卞崟') && !oldopp.StageName__c.equals('澶卞崟')) || 
-                    (!op.StageName__c.equals('澶卞崟') && oldopp.StageName__c.equals('澶卞崟')))) {
+                    (!op.StageName__c.equals('澶卞崟') && oldopp.StageName__c.equals('澶卞崟'))) ||
+                    ((op.StageName__c.equals('鍙栨秷') && !oldopp.StageName__c.equals('鍙栨秷')) || 
+                    (!op.StageName__c.equals('鍙栨秷') && oldopp.StageName__c.equals('鍙栨秷'))) ||
+                    (String.isNotBlank(op.ConfirmationofAward__c) && op.ConfirmationofAward__c!=oldopp.ConfirmationofAward__c)) {
                     for (Tender_Opportunity_Link__c link : links) {
                         if (link.Opportunity__c == op.Id) {
                             Tender_information__c temptender = new Tender_information__c();
@@ -175,6 +183,34 @@
                         }
                     }
                 }
+                //DB202304056706  you 20230406 娓呯┖ 鎵撴爣璇嗭紝閲嶆柊鎵цbatch
+                if(String.isBlank(op.ConfirmationofAward__c) && op.ConfirmationofAward__c!=oldopp.ConfirmationofAward__c){
+                   for (Tender_Opportunity_Link__c link : links) {
+                        if (link.Opportunity__c == op.Id) {
+                            Tender_information__c temptender = new Tender_information__c();
+                            temptender.Id = link.Tender_information__c;
+                            temptender.IsReactionOpp__c = true;
+                            tenderMap.put(temptender.id ,temptender); 
+                        }
+                    } 
+                }
+                //20221017  lt SWAG-CHL5XA銆怓Y23璇环鏀瑰杽銆�-缁熻涓绘満鍙版暟 start
+                // System.debug('lt123 oly涓绘満'+op.OlyNumberHosts__c);
+                // System.debug('lt123 鑰乷ly涓绘満'+oldopp.OlyNumberHosts__c);
+                // System.debug('lt123 瀵规墜涓绘満'+op.RivalHostsNumber__c);
+                // System.debug('lt123 鑰佸鎵嬩富鏈�'+oldopp.RivalHostsNumber__c);
+
+                if(op.OlyNumberHosts__c != oldopp.OlyNumberHosts__c || op.RivalHostsNumber__c != oldopp.RivalHostsNumber__c){
+                    for (Tender_Opportunity_Link__c link : links){
+                        if (link.Opportunity__c == op.Id){
+                            Tender_information__c temptender = new Tender_information__c();
+                            temptender.Id = link.Tender_information__c;
+                            temptender.IsReactionOpp__c = true;
+                            tenderMap.put(temptender.id ,temptender); 
+                        }
+                    }
+                }
+                //20221017  lt SWAG-CHL5XA銆怓Y23璇环鏀瑰杽銆�-缁熻涓绘満鍙版暟 end
 
             // }else {
             //     //鏂板缓鏃跺垽鏂浠风殑鎷涙爣椤圭洰鏄笉鏄粠鏃犲埌鏈�
@@ -259,4 +295,510 @@
         }
     } 
     // SWAG-C7P4XB end
+
+    //LastBuy 棰勭暀浜у搧 lt 20220315 start
+    //璇环澶卞崟鎴栧彇娑堟椂锛岄鐣欎骇鍝佺殑"鏄惁鏈夋晥"璁剧疆涓哄惁
+    public static void ReservedProFlg(List<Opportunity> newList, Map<Id, Opportunity> newMap, List<Opportunity> oldList, Map<Id, Opportunity> oldMap){
+        List<Id> oppList = new List<Id>();
+        List<LastbuyProduct__c> lbpflgList = new List<LastbuyProduct__c>();
+
+        for (Opportunity lbOpp : newList){
+            Opportunity OldLbOpp = oldMap.get(lbOpp.Id);
+            if(OldLbOpp.StageName != lbOpp.StageName){
+                if(lbOpp.StageName == '鏁楁垿' || lbOpp.StageName == '鍓婇櫎'){
+                    oppList.add(lbOpp.Id);
+                }
+            }
+        }
+
+        if(oppList.size() > 0){
+            List<LastbuyProduct__c> lbpList = [select id, effectiveFLG__c,InquiryCode__c from LastbuyProduct__c where InquiryCode__c in :oppList];
+            if(lbpList.size() > 0){
+                for(LastbuyProduct__c lbp : lbpList){
+                    if(lbp.effectiveFLG__c == true){ 
+                        lbp.effectiveFLG__c = false;
+                        lbpflgList.add(lbp);
+                    }
+                }
+            }
+        }
+
+        if(lbpflgList.size() > 0){
+            update lbpflgList;
+        }
+    }
+    //LastBuy 棰勭暀浜у搧 lt 20220315 end
+//SWAG-CHL67J 銆愬鎵樸�戙�怓Y23璇环鏀瑰杽銆�-璇环椤甸潰/鎷涙爣椤圭洰澧炲姞缁熻瀛楁 fy start 
+// public static void UpdateBidNumber(List<Opportunity> newList, Map<Id, Opportunity> newMap, List<Opportunity> oldList, Map<Id, Opportunity> oldMap){
+//     List<Id> OpportunityIdList = new List<Id>();
+//     Boolean flag = true;
+//     for (Opportunity opp : newList) {
+//         OpportunityIdList.add(opp.Id);
+//         Opportunity oldopp = oldMap == null? null : oldMap.get(opp.Id); 
+//         if(oldopp==null){
+//             if(opp.NumberOfBids__c!=null||opp.BidWinningNumber__c!=null){
+//                 flag = true;
+//             }
+//         }else{
+//             if(opp.NumberOfBids__c!=oldopp.NumberOfBids__c||opp.NumberOfBids__c!=oldopp.NumberOfBids__c){
+//                 flag = true;
+//             }
+//         }
+//     }
+//     system.debug('newList+++'+newList);
+//     system.debug('oldList+++'+oldList);
+//     if(flag){
+//         List<Tender_Opportunity_Link__c> TenderOpportunityLinkList = [select Tender_information__c from Tender_Opportunity_Link__c where Opportunity__c in:OpportunityIdList];
+//         Set<Id> enderOpportunityId = new Set<Id>();
+//         if(TenderOpportunityLinkList.size()>0){
+//             for (Tender_Opportunity_Link__c TenderOpportunity : TenderOpportunityLinkList) {
+//                 enderOpportunityId.add(TenderOpportunity.Tender_information__c);
+//             }
+//         }
+//         system.debug('TenderOpportunityLinkList+++'+TenderOpportunityLinkList);
+//         List<Tender_Opportunity_Link__c> TenderOpportunityLinkList2 = [select Tender_information__c,Opportunity__r.NumberOfBids__c,Opportunity__r.BidWinningNumber__c from Tender_Opportunity_Link__c where Tender_information__c in:enderOpportunityId];
+//         Map<String,Tender_information__c> TenderinformationMap = new Map<String,Tender_information__c>();
+//         system.debug('TenderOpportunityLinkList2+++'+TenderOpportunityLinkList2);
+//         if(TenderOpportunityLinkList2.size()>0){
+//             for(Tender_Opportunity_Link__c TenderOpportunity2 :TenderOpportunityLinkList2){
+//                     if(TenderinformationMap.containsKey(TenderOpportunity2.Tender_information__c)){
+//                         Tender_information__c Tender_informationvalue = new Tender_information__c();
+//                         Tender_informationvalue = TenderinformationMap.get(TenderOpportunity2.Tender_information__c);
+//                         Tender_informationvalue.NumberOfBids__c=Tender_informationvalue.NumberOfBids__c+TenderOpportunity2.Opportunity__r.NumberOfBids__c;
+//                         Tender_informationvalue.BidWinningNumber__c=Tender_informationvalue.BidWinningNumber__c+TenderOpportunity2.Opportunity__r.BidWinningNumber__c;
+//                         TenderinformationMap.put(TenderOpportunity2.Tender_information__c, Tender_informationvalue);
+//                     }else{
+//                         Tender_information__c Tender_informationvalue = new Tender_information__c();
+//                         Tender_informationvalue.Id=TenderOpportunity2.Tender_information__c;
+//                         Tender_informationvalue.NumberOfBids__c=TenderOpportunity2.Opportunity__r.NumberOfBids__c;
+//                         Tender_informationvalue.BidWinningNumber__c=TenderOpportunity2.Opportunity__r.BidWinningNumber__c;
+//                         TenderinformationMap.put(TenderOpportunity2.Tender_information__c, Tender_informationvalue);
+//                     }
+//             }
+//         }
+//         List<Tender_information__c> Tender_informationList = new List<Tender_information__c>();
+//         for (Tender_information__c value : TenderinformationMap.values()) {
+//             Tender_informationList.add(value);
+//         }
+//         system.debug('Tender_informationList+++'+Tender_informationList);
+//         update Tender_informationList;
+//     }
+// }
+//SWAG-CHL67J 銆愬鎵樸�戙�怓Y23璇环鏀瑰杽銆�-璇环椤甸潰/鎷涙爣椤圭洰澧炲姞缁熻瀛楁 fy end
+    //add 璇环璺熻繘浠诲姟寮�鍙� - 3.鍒涘缓澶卞崟浠诲姟 sx 20220617 start
+    //璇环涓爣缁撴灉纭绔炰簤瀵规墜涓爣鏃跺疄鏃跺垱寤哄け鍗曚换鍔�
+    public static void createTaskByOppConfirmationofAward(List<Opportunity> newList, Map<Id, Opportunity> newMap, List<Opportunity> oldList, Map<Id, Opportunity> oldMap){
+
+        if (!isFirst) {
+            return;
+        }
+
+        Set<Id> oppoIds = new Set<Id>();
+        Map<Id,String> mapoppid = new Map<Id,String>();
+        list<task__c> taskUpdateList = new list<task__c>();
+        for(Opportunity op : newList){
+            Opportunity oldopp =  oldMap.get(op.Id);
+            //璇环涓爣缁撴灉纭绔炰簤瀵规墜涓爣鏃跺疄鏃跺垱寤哄け鍗曚换鍔� 涓� 璇环鐘舵��1绛変簬璇环
+            if (oldopp.ConfirmationofAward__c != '绔炰簤瀵规墜涓爣' && op.ConfirmationofAward__c == '绔炰簤瀵规墜涓爣' && op.StageName__c == '璇环' && !op.DirectLossFLG__c ){
+                oppoIds.add(op.Id);
+            }
+            //20220929 you  SWAG-CJP7TL 鎵嬪姩鏇存敼璇环鎵�鏈変汉锛屽悓姝ヤ慨鏀逛换鍔℃墍鏈変汉
+            if(String.isNotBlank(op.OwnerId) && op.OwnerId !=oldopp.OwnerId){
+                 mapoppid.put(op.id,op.OwnerId);
+            }
+        }
+        if(mapoppid.size() > 0){
+            List<Task__c> taskList = [
+                    SELECT Id,OpportunityId__c,taskStatus__c 
+                    FROM task__c 
+                    WHERE OpportunityId__c in :mapoppid.keySet()
+                    AND (RecordType.Name = '涓爣缁撴灉纭' OR RecordType.Name = '澶卞崟鎶ュ憡浠诲姟')
+                    AND taskStatus__c = '02 鎺ュ彈'];
+            system.debug(mapoppid.keySet()+'test1-----'+taskList);
+            for(Task__c t: taskList){
+                if(mapoppid.containsKey(t.OpportunityId__c)){
+                   t.Ownerid = mapoppid.get(t.OpportunityId__c);
+                   t.assignee__c = mapoppid.get(t.OpportunityId__c);
+                   taskUpdateList.add(t);
+                }
+                           
+            }
+             if (taskUpdateList != null && taskUpdateList.size() > 0) {
+                update taskUpdateList;
+            }
+        }    
+
+        if (!oppoIds.isEmpty()) {
+            // 20221206  DB202211594688 start
+            // // 鏈夋晥澶卞崟鐘舵�佷竴瑙�
+            // List<String> validStatus = new List<String>{'鐢宠涓�', '鎻愪氦', '鎵瑰噯'};
+            // // 璇环澶卞崟/鍙栨秷鎶ュ憡鏌ヨ 
+            // List<Lost_cancel_report__c> lostCancelReportList = [SELECT Id, Opportunity__c from Lost_cancel_report__c WHERE Opportunity__c in :oppoIds and Report_Status__c in: validStatus];
+           
+            // List<Lost_cancel_report__c> lostCancelReportList1 = [SELECT Id, Opportunity__c,DeveloperName__c from Lost_cancel_report__c WHERE Opportunity__c in :oppoIds and Report_Status__c ='鑽夋'];
+            
+            // //<璇环Id, 澶卞崟鎶ュ憡>
+            // Map<String, Lost_cancel_report__c> lostCancelReportMap = new Map<String, Lost_cancel_report__c>();
+            // for(Lost_cancel_report__c lcr : lostCancelReportList){
+            //     if (!lostCancelReportMap.isEmpty() && lostCancelReportMap.containsKey(lcr.Opportunity__c)) {
+            //         // no action
+            //     } else {
+            //         lostCancelReportMap.put(lcr.Opportunity__c, lcr);
+            //     }
+            // }
+             
+            //鏈夋晥澶卞崟鐘舵�佷竴瑙�
+            List<String> validStatus = new List<String>{'鐢宠涓�', '鎻愪氦', '鎵瑰噯'};
+            List<String> allStatus = new List<String>{'鐢宠涓�', '鎻愪氦', '鎵瑰噯','鑽夋'};
+            // 璇环澶卞崟/鍙栨秷鎶ュ憡鏌ヨ  
+            List<Lost_cancel_report__c> lostCancelReportList = [SELECT Id, Opportunity__c,Report_Status__c,DeveloperName__c  from Lost_cancel_report__c WHERE Opportunity__c in :oppoIds and Report_Status__c in: allStatus];
+           
+            //<璇环Id, 澶卞崟鎶ュ憡>
+            Map<String, Lost_cancel_report__c> lostCancelReportMap = new Map<String, Lost_cancel_report__c>();
+            Map<String, Lost_cancel_report__c> lostCancelReportMap1 = new Map<String, Lost_cancel_report__c>();
+            for(Lost_cancel_report__c lcr : lostCancelReportList){
+                if(validStatus.contains(lcr.Report_Status__c)){
+                    if (!lostCancelReportMap.isEmpty() && lostCancelReportMap.containsKey(lcr.Opportunity__c)) {
+                        // no action
+                    } else {
+                        lostCancelReportMap.put(lcr.Opportunity__c, lcr);
+                    }
+                }else{
+                    // 鑽夋
+                    if (!lostCancelReportMap1.isEmpty() && lostCancelReportMap1.containsKey(lcr.Opportunity__c)) {
+                    // no action
+                    } else {
+                        lostCancelReportMap1.put(lcr.Opportunity__c, lcr);
+                    }
+                } 
+            }                
+            // 20221206  DB202211594688 start
+            List<Task__c> insTaskList = new List<Task__c>();
+            
+            // 瀹氫箟闇�瑕佹洿鏂扮殑璇环浠诲姟
+            List<Opportunity> updateOpportunity = new List<Opportunity>();
+            
+            // 璁板綍绫诲瀷锛氬け鍗曟姤鍛婁换鍔�
+            List<RecordType> recordTypes = [select Id from RecordType where IsActive = true and SobjectType = 'task__c' and DeveloperName = 'LoseListTask'];
+            Id loseListTask_TaskId = recordTypes.get(0).Id;
+            //String taskName = '';
+                
+            for(Opportunity opp : newList) {
+                //娌℃湁宸叉彁浜ょ殑澶卞崟鎶ュ憡
+                if(!lostCancelReportMap.containsKey(opp.Id) && oppoIds.contains(opp.Id)) {
+
+                    //鍒涘缓澶卞崟浠诲姟鎻愰啋
+                    Task__c tempTask = new Task__c();
+                    tempTask.RecordTypeId = loseListTask_TaskId;
+                    tempTask.taskDifferent__c = '琚姩浠诲姟';
+                    tempTask.taskStatus__c = '02 鎺ュ彈';       //浠诲姟鐘舵��2
+                    tempTask.assignee__c = opp.OwnerId;    //琚垎閰嶈��
+                    tempTask.account__c = opp.AccountId;
+                    tempTask.Name = '澶卞崟缁撴灉纭锛�' + opp.Opportunity_No__c;
+                    tempTask.OwnerId = opp.OwnerId;   //鎵�鏈変汉
+                    tempTask.OpportunityId__c = opp.Id;
+                    tempTask.ConfirmDate__c = Date.today();
+                    insTaskList.add(tempTask);
+                    
+                    //鏇存柊璇环  Task_createTime__c  
+                    Opportunity uopp  = new Opportunity();
+                    uopp.Id = opp.Id;
+                    uopp.LostTask_createTime__c  = Date.today();
+                    //20221205 you DB202211594688  閮ㄥ垎澶卞崟娲惧彂浠诲姟锛屼絾鏄腑鏍囩粨鏋滀笉璧嬪��
+                    
+                    if(null!=lostCancelReportMap1.get(opp.Id) && lostCancelReportMap1.get(opp.Id).DeveloperName__c =='PCL_PartLost_report'){
+                   
+                        uopp.ConfirmationofAward__c = '';
+                        uopp.ConfirmationofAward_createTime__c = null;
+                        uopp.Is_ConfirmationofAward__c =null;
+                    }else{
+                        if(oldMap.get(opp.Id).ConfirmationofAward__c != '绔炰簤瀵规墜涓爣' && opp.ConfirmationofAward__c == '绔炰簤瀵规墜涓爣'){
+                          uopp.Closing_Bid_Date__c = null;
+                        }
+                    }
+                    updateOpportunity.add(uopp);
+                }
+            }
+
+            if (!insTaskList.isEmpty()) {
+                insert insTaskList;
+            }
+            if (!updateOpportunity.isEmpty()) {
+                update updateOpportunity;
+            }
+        }
+        isFirst = false;
+    }
+    //add 璇环璺熻繘浠诲姟寮�鍙� - 3.鍒涘缓澶卞崟浠诲姟 sx 20220617 end
+
+
+    //璇环璺熻繘浠诲姟寮�鍙� 
+    public static void opportunityTasks(List<Opportunity> newList, Map<Id, Opportunity> newMap, List<Opportunity> oldList, Map<Id, Opportunity> oldMap){
+        Set<Id> oppoIds = new Set<Id>();
+    
+        for(Opportunity op : newList){
+            Opportunity oldopp =  oldMap.get(op.Id);
+            
+            //璇环涓爣缁撴灉纭绔炰簤瀵规墜涓爣鏃跺疄鏃跺垱寤哄け鍗曚换鍔� 涓� 璇环鐘舵��1绛変簬璇环
+            if (oldopp.ConfirmationofAward__c != 'OLY涓爣' && op.ConfirmationofAward__c == 'OLY涓爣' && op.StageName__c == '璇环'){
+                oppoIds.add(op.Id);
+                //纭涓爣缁撴灉鏃堕棿 鍒涘缓浠诲姟鏃堕棿  20220629 sx
+                op.ConfirmationofAward_createTime__c = Date.today();
+                if(op.Task_createTime__c!=null){
+                    
+                    //鏄惁鎸夋椂纭锛�3涓伐浣滄棩鍐呮寜鏃�1锛屼笉鎸夋椂0
+                    String inttemp = CalendarUtil.getWorkDayNum(String.valueOf(op.Task_createTime__c), String.valueOf(op.ConfirmationofAward_createTime__c));
+                    op.Is_ConfirmationofAward__c = Integer.valueOf(inttemp) > 3 ? 0 : 1;   
+                }
+            }
+
+            //20220628浼氳鏂伴渶姹�  瀵规墜涓爣 7.涓爣鏃ユ竻绌�
+            if(oldopp.ConfirmationofAward__c != '绔炰簤瀵规墜涓爣' && op.ConfirmationofAward__c == '绔炰簤瀵规墜涓爣'){
+                //op.Closing_Bid_Date__c = null; // 20221206 you
+                op.ConfirmationofAward_createTime__c = Date.today(); 
+                if(op.Task_createTime__c!=null){
+                   
+                    //鏄惁鎸夋椂纭锛�3涓伐浣滄棩鍐呮寜鏃�1锛屼笉鎸夋椂0
+                    String inttemp = CalendarUtil.getWorkDayNum(String.valueOf(op.Task_createTime__c), String.valueOf(op.ConfirmationofAward_createTime__c));
+                    op.Is_ConfirmationofAward__c = Integer.valueOf(inttemp) > 3 ? 0 : 1;    
+                }              
+            }
+        }
+
+        if(!oppoIds.isEmpty()){
+
+            // 2022-12-02 ssm DB202211552746 澧炲姞娴佹爣搴熸爣鏃舵竻绌虹粨鏋滆褰曟棩鐨勯�昏緫锛岄渶瑕佸垽鏂笉鏄祦鏍囧簾鏍囩殑缁撴灉鏁版嵁鎵嶆洿鏂颁腑鏍囨棩
+            list<Tender_Opportunity_Link__c> toppLinkList = [Select Id, Opportunity__c, Tender_information__c,Tender_information__r.ResultDate__c,Tender_information__r.InfoType__c 
+                                                            FROM Tender_Opportunity_Link__c 
+                                                            WHERE Opportunity__c in :oppoIds 
+                                                            and Tender_information__r.InfoType__c = '3锛氱粨鏋�' 
+                                                            and Tender_information__r.subInfoType__c != '3-1锛氬簾鏍囧叕鍛�' 
+                                                            and Tender_information__r.subInfoType__c != '3-2锛氭祦鏍囧叕鍛�'];
+            Map<String, Tender_Opportunity_Link__c> toopLinkMap = new Map<String, Tender_Opportunity_Link__c>();
+            
+            for(Tender_Opportunity_Link__c tol : toppLinkList){
+                Opportunity oppoTemp = newMap.get(tol.Opportunity__c);
+                //璇环鍏宠仈鍒版嫑鏍囬」鐩墠杩涜鎿嶄綔
+                if(oppoTemp.Bidding_Project_Name_Bid__c == tol.Tender_information__c){
+                    toopLinkMap.put(tol.Opportunity__c, tol);
+                }
+                
+            }
+            
+            for (String key : toopLinkMap.keySet()) {
+                Opportunity oppoTemp = newMap.get(key);
+                //20220628浼氳鏂伴渶姹�  OLY涓爣 7.涓爣鏃ワ紙缁撴灉璁板綍鏃ワ級= 鎷涙爣椤圭洰.缁撴灉璁板綍鏃�
+                oppoTemp.Closing_Bid_Date__c = toopLinkMap.get(key).Tender_information__r.ResultDate__c;
+                System.debug('============'+toopLinkMap.get(key).Tender_information__r.ResultDate__c);
+                
+                //鏄惁鎸夋椂纭锛�3涓伐浣滄棩鍐呮寜鏃�1锛屼笉鎸夋椂0
+                //String inttemp = CalendarUtil.getWorkDayNum(String.valueOf(oppoTemp.Task_createTime__c), String.valueOf(oppoTemp.ConfirmationofAward_createTime__c));
+                //oppoTemp.Is_ConfirmationofAward__c = Integer.valueOf(inttemp) > 3 ? 0 : 1;    
+            }
+
+        }  
+        Integer i = 0;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+        i++;
+
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.1