From d8dc84a3d56df839895f1c417a4d9cbee763d262 Mon Sep 17 00:00:00 2001
From: 高章伟 <gaozhangwei@prec-tech.com>
Date: 星期五, 03 三月 2023 14:50:59 +0800
Subject: [PATCH] gzw 测试环境代码更新

---
 force-app/main/default/classes/TenderInformationHandler.cls |   47 ++++++++++++++++++++++++++++++-----------------
 1 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/force-app/main/default/classes/TenderInformationHandler.cls b/force-app/main/default/classes/TenderInformationHandler.cls
index 8ed2f99..de9c2b1 100644
--- a/force-app/main/default/classes/TenderInformationHandler.cls
+++ b/force-app/main/default/classes/TenderInformationHandler.cls
@@ -67,7 +67,8 @@
         updateWin();
 
         // 涓爣浠诲姟 搴熸爣娴佹爣鏃舵竻绌轰腑鏍囨棩
-        clearConfirmationofAward();
+        //20221208 you DB202211594688
+        //clearConfirmationofAward();
 
         //2022-3-29 yjk SWAG-CCL6R7
         //updateOpportunity();//2022-5-18 yjk XLIU-CEJ38N 娉ㄩ噴鎺� 
@@ -103,15 +104,20 @@
             }
         }
         if (null!=oppTens && oppTens.size()>0) {
-          List<Opportunity> opportunities = [select id, Bidding_Project_Name_Bid__c, TenderBeginDate_Text__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)];
+            //20221208 you DB202211594688 鏈夌‘璁や换鍔$殑璇环涓嶆竻
+          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,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){
-                tsk.taskStatus__c = '04 鍙栨秷';
-                tsk.cancelDate__c = date.today();
-                if(null!=InfoTypeMap && InfoTypeMap.containsKey(tsk.OpportunityId__c)){
-                   tsk.cancelReasonSelect__c = '淇敼椤圭洰闃舵';
+                if(tsk.RecordType.Name =='澶卞崟鎶ュ憡浠诲姟' && oppIds.contains(tsk.OpportunityId__c) && tsk.taskStatus__c !='03 瀹屾垚'){
+                  //涓嶅仛鎿嶄綔
                 }else{
-                   tsk.cancelReasonSelect__c = '娴佹爣/搴熸爣'; 
+                    tsk.taskStatus__c = '04 鍙栨秷';
+                    tsk.cancelDate__c = date.today();
+                    if(null!=InfoTypeMap && InfoTypeMap.containsKey(tsk.OpportunityId__c)){
+                       tsk.cancelReasonSelect__c = '淇敼椤圭洰闃舵';
+                    }else{
+                       tsk.cancelReasonSelect__c = '娴佹爣/搴熸爣'; 
+                    }
                 }
             }
              update taskList;
@@ -119,15 +125,19 @@
                 for (task__c tlink : taskList) {
                     for (Opportunity opp : opportunities) {
                         if (opp.Id == tlink.OpportunityId__c) {
-                           //20220718 you 璇环浠诲姟 start
-                            opp.ConfirmationofAward__c = null;
-                            opp.Task_createTime__c = null;
-                            opp.ConfirmationofAward_createTime__c =null;
-                            opp.LostTask_comfirmTime__c =null;
-                            opp.Is_ConfirmationofAward__c =null;
-                            opp.LostTask_createTime__c =null;
-                            opp.Closing_Bid_Date__c = null;
-                            //20220718 you 璇环浠诲姟 end
+                            if(tlink.RecordType.Name =='澶卞崟鎶ュ憡浠诲姟' && tlink.taskStatus__c !='03 瀹屾垚'){
+                              //涓嶅仛鎿嶄綔
+                            }else{
+                               //20220718 you 璇环浠诲姟 start
+                                opp.ConfirmationofAward__c = null;
+                                opp.Task_createTime__c = null;
+                                opp.ConfirmationofAward_createTime__c =null;
+                                opp.LostTask_comfirmTime__c =null;
+                                opp.Is_ConfirmationofAward__c =null;
+                                opp.LostTask_createTime__c =null;
+                                //opp.Closing_Bid_Date__c = null;
+                                //20220718 you 璇环浠诲姟 end
+                            }
                        }  
                     }
                 }
@@ -1289,6 +1299,8 @@
             }
         }
     }
+    /** 
+    //20221208 you DB202211594688
     // 涓爣浠诲姟 搴熸爣娴佹爣鏃舵竻绌轰腑鏍囨棩
     public void clearConfirmationofAward() {
         List<String> tenders = new List<String>();
@@ -1324,4 +1336,5 @@
             }
         }
     }
+    **/
 }
\ No newline at end of file

--
Gitblit v1.9.1