From 928399eceec50e3d37ea08669a12789a9410a9d2 Mon Sep 17 00:00:00 2001
From: 沙世明 <shashiming@prec-tech.com>
Date: 星期二, 22 十一月 2022 16:51:16 +0800
Subject: [PATCH] 111

---
 force-app/main/default/classes/NFM603Controller.cls |   41 ++++++++++++++++++++++++++++++++---------
 1 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/force-app/main/default/classes/NFM603Controller.cls b/force-app/main/default/classes/NFM603Controller.cls
index 3c47246..516cda0 100644
--- a/force-app/main/default/classes/NFM603Controller.cls
+++ b/force-app/main/default/classes/NFM603Controller.cls
@@ -41,7 +41,7 @@
         public String MultiYearContractStartDate; //澶氬勾淇濆悎鍚屽紑濮嬫棩
         public String MultiYearContractEndDate; //澶氬勾淇濆悎鍚岀粨鏉熸棩
         public String MultiYearContractData; //澶氬勾淇濆悎鍚岃褰曠被鍨�(new)
-        public Boolean isRepairWarrantyObj; //鍐嶄慨鐞嗕繚淇璞�
+        public Boolean isRepairWarrantyObj; //鍐�490淇悊淇濅慨瀵硅薄
         public String RepairType; //淇悊鍖哄垎-------------------
         public String QuotationGread; //鎶ヤ环绛夌骇(new)
         public String detectionResult; //妫�娴嬬粨鏋�
@@ -485,11 +485,11 @@
             logstr += '\nend';
             if (repairs.size() > 0) {
                 // 2022-08-19   zyh  灏忕▼搴忓紓姝ュ鐞嗭紝鎭㈠鎵归噺鍙戦��   start
-                rowData = NFMUtil.makeRowData(iflog, LOG_TYPE, repairs);
+                /*rowData = NFMUtil.makeRowData(iflog, LOG_TYPE, repairs);
                 if (String.isBlank(rowData.MessageGroupNumber__c)) {
                     rowData.MessageGroupNumber__c = nowStr;
                 }
-                execute(rowData, iflog);
+                execute(rowData, iflog);*/
                 // 2022-08-19   zyh  灏忕▼搴忓紓姝ュ鐞嗭紝鎭㈠鎵归噺鍙戦��   end
                 // 2022-05-05      zyh     update      start
                 /*for (RepairOrderInfo roi : repairs ) {
@@ -504,9 +504,31 @@
                     // rowData = NFMUtil.makeRowData(iflog, LOG_TYPE, repairs);
                     // execute(rowData, iflog);
                     repairs1 = new List < RepairOrderInfo > ();
-                }*/  // 2022-08-19   zyh  灏忕▼搴忓紓姝ュ鐞嗭紝鎭㈠鎵归噺鍙戦��
-                /*upsert logList;
-                upsert rowList;*/  // 2022-08-19   zyh  灏忕▼搴忓紓姝ュ鐞嗭紝鎭㈠鎵归噺鍙戦��
+                }  // 2022-08-19   zyh  灏忕▼搴忓紓姝ュ鐞嗭紝鎭㈠鎵归噺鍙戦��
+                */
+                for (Integer i=1;  i <= repairs.size();i++ ) {
+                    if(Math.mod(i, 20) > 0 ){
+                        repairs1.add(repairs[i-1]);
+                        if(i == repairs.size()){
+                            rowData = NFMUtil.makeRowData(iflog, LOG_TYPE, repairs1);
+                            if (String.isBlank(rowData.MessageGroupNumber__c)) {
+                                rowData.MessageGroupNumber__c = nowStr;
+                            }
+                            execute1(rowData, iflog);
+                        }
+                    }else{
+                        repairs1.add(repairs[i-1]);
+                        rowData = NFMUtil.makeRowData(iflog, LOG_TYPE, repairs1);
+                        if (String.isBlank(rowData.MessageGroupNumber__c)) {
+                            rowData.MessageGroupNumber__c = nowStr;
+                        }
+                        execute1(rowData, iflog);
+                        repairs1 = new List < RepairOrderInfo > ();
+                    }
+                    
+                } 
+                upsert logList;
+                upsert rowList;  // 2022-08-19   zyh  灏忕▼搴忓紓姝ュ鐞嗭紝鎭㈠鎵归噺鍙戦��
                 // 2022-05-11  zyh     update start
                 if (logMap.size() > 0) {
                     delete logMap.values();
@@ -624,10 +646,11 @@
 
     }
     // 2022-05-05      zyh     update      start
-    /*public static void execute1(BatchIF_Log__c rowDataSFDC, BatchIF_Log__c iflog) {
+    public static void execute1(BatchIF_Log__c rowDataSFDC, BatchIF_Log__c iflog) {
         Integer batch_retry_max_cnt = Integer.valueOf(System.Label.batch_retry_max_cnt);
 
-        String logstr = rowDataSFDC.MessageGroupNumber__c + ' start\n';
+        String logstr = rowDataSFDC.Name + ' start\n';
+        // String logstr = rowDataSFDC.MessageGroupNumber__c + ' start\n';
         if (iflog == null) {
             iflog = new BatchIF_Log__c();
             iflog.Type__c = LOG_TYPE;
@@ -703,7 +726,7 @@
         logList.add(iflog);
         rowList.add(rowDataSFDC);
 
-    }*/ // 2022-08-19   zyh  灏忕▼搴忓紓姝ュ鐞嗭紝鎭㈠鎵归噺鍙戦��   
+    } // 2022-08-19   zyh  灏忕▼搴忓紓姝ュ鐞嗭紝鎭㈠鎵归噺鍙戦��   
 
     // 2022-05-05      zyh     update      end
     // 鏁呴殰鎻忚堪

--
Gitblit v1.9.1