From bfca7a84bec815da594f1d12558535ed06d2490b Mon Sep 17 00:00:00 2001
From: 沙世明 <shashiming@prec-tech.com>
Date: 星期二, 13 九月 2022 09:57:32 +0800
Subject: [PATCH] 本地提交备份

---
 force-app/main/default/classes/NFM206Rest.cls |   33 ++++++++++++++++++++++++++++++---
 1 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/force-app/main/default/classes/NFM206Rest.cls b/force-app/main/default/classes/NFM206Rest.cls
index 2845e21..86a46f7 100644
--- a/force-app/main/default/classes/NFM206Rest.cls
+++ b/force-app/main/default/classes/NFM206Rest.cls
@@ -20,7 +20,7 @@
         public String SPOApprovedQuote;                   //鍚堝悓瀹℃壒瀹屾垚鐨勬姤浠�
         //songxiaoqi ----------start
         public String IsTermination;                     //true浠h〃鍚堝悓缁堟
-
+        public String SealDate;                          // 鐢靛瓙绛炬棩鏈�
         //songxiaoqi-----------end
     }
 
@@ -69,6 +69,9 @@
         iflog.Log__c                = logstr;
         iflog.ErrorLog__c           = '';
         insert iflog;
+        // Integer  index = rowData.Log__c.indexOf('SealDate');
+        // String SealDate = rowData.Log__c.subString(index+11,index+19);
+        // system.debug('SealDate = '+ SealDate+'rowData.Log__c = ' +rowData.Log__c);
         String rowDataStr = NFMUtil.getRowDataStr(rowData);
         List<GeData> geDataList = (List<GeData>) JSON.deserialize(rowDataStr, List<GeData>.class);
         if (geDataList == null || geDataList.size() == 0) {
@@ -99,7 +102,7 @@
                                          Opportunity_No__c,
                                          Contract_DB_complite_day__c,
                                          SAP_Send_OK__c,
-                                         //Decided_Estimation__c
+                                         Decided_Estimation__c,
                                          Estimation_Decision__c,
                                          Estimation_No__c,
                                          Competitor__c,
@@ -115,6 +118,7 @@
 
             for (GeData gda : accordList) {
                 Opportunity opportunityInfo = new Opportunity();
+                
                 if (oppMap.containsKey(gda.Opportunity_No)) {
                     opportunityInfo = oppMap.get(gda.Opportunity_No);
                 } else {
@@ -129,7 +133,12 @@
                 opportunityInfo.IF_Submit__c = false;
                 opportunityInfo.if_Interface_Lock__c = false;
                 opportunityInfo.Contract_Authorize_Lock__c = false;
-
+                if (gda.SealDate!=null) {
+                    opportunityInfo.Agency_Contract_Date1__c = NFMUtil.parseStr2Date(gda.SealDate);
+                    // 鏀跺埌鏃ユ湡鏃惰嚜鍔╳in
+                    opportunityInfo.SAP_Send_OK__c = true;
+                }
+                
                 if (((gda.ContractType == '3' && gda.ApprovedType != '3') ||
                         (gda.ApprovedType == '3' && gda.ContractType == '1'))
                         && opportunityInfo.StageName == '寮曞悎') {
@@ -185,6 +194,9 @@
                     opportunityInfo.Stock_Confrim_Date__c = null;
                     //鍙栨秷win
                     opportunityInfo.SAP_Send_OK__c = false;
+                    // 2022-05-30 鍙栨秷win鐞嗙敱琛ュ厖 ssm start
+                    opportunityInfo.Reason_Cancel_WIN__c = System.Label.Opportunity_Cancel_WIN_ByAPI;
+                    // 2022-05-30 鍙栨秷win鐞嗙敱琛ュ厖 ssm end
 
                     //鎾ら攢鎿嶄綔娓呯┖鐩稿叧鍐呭
                     opportunityInfo.NotesApprovedNo__c                    = null;
@@ -196,6 +208,21 @@
                     opportunityInfo.SPOApprovedQuote__c                   = null;
                 }
                 //songxiaoqi -------end
+                // system.debug('10.OCSM-缁忛攢鍟嗙绾︽棩='+opportunityInfo.Agency_Contract_Date1__c);
+                // String Dec;
+                // if (opportunityInfo.Decided_Estimation__c!=null) {
+                //     Integer  index1 = opportunityInfo.Decided_Estimation__c.indexOf('</a>');
+                //      Dec = opportunityInfo.Decided_Estimation__c.subString(index1-18,index1);
+                // }
+                // system.debug('Dec=' + Dec+'opportunityInfo.SPOApprovedQuote__c = '+opportunityInfo.SPOApprovedQuote__c);
+                // if(opportunityInfo.SPOApprovedQuote__c!=null&&opportunityInfo.SPOApprovedQuote__c==Dec){
+                  //  opportunityInfo.SAP_Send_OK__c = true;
+                // }else{
+                //     iflog.ErrorLog__c += 'Error! '+'鍐冲畾鐨勬姤浠蜂负锛�'+Dec+'  涓庡悎鍚屽鎵瑰畬鎴愮殑鎶ヤ环涓嶄竴鑷�'+'\n';
+                //     system.debug('鎶ラ敊鍟�');
+                //     continue;
+                // }
+
                 opportunityUpsertList.add(opportunityInfo);
             }
             if (opportunityUpsertList.size() > 0) {

--
Gitblit v1.9.1