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/NFM103Controller.cls |   42 ++++++++++++++++++++----------------------
 1 files changed, 20 insertions(+), 22 deletions(-)

diff --git a/force-app/main/default/classes/NFM103Controller.cls b/force-app/main/default/classes/NFM103Controller.cls
index fb6ef82..1930268 100644
--- a/force-app/main/default/classes/NFM103Controller.cls
+++ b/force-app/main/default/classes/NFM103Controller.cls
@@ -118,6 +118,7 @@
         //URF闄愭鍚堝悓2鏈� xxf 20220811 start
         public String Series;
         //URF闄愭鍚堝悓2鏈� xxf 20220811 end
+
         //鍐嶆敞鍐屽垎鏋� 闇�姹� 鏂板瀛楁 20220811
         public String Reanalysis;
 
@@ -225,7 +226,7 @@
             iflog = [Select Id, Name from BatchIF_Log__c where Id = :iflog.Id];
             System.debug(Logginglevel.DEBUG, 'NFM103_' + iflog.Name + ' start');                  // callout 銇腑 end 銇甽og銈掑嚭銇椼伨銇�
             // 20220902 ljh XLIU-CHSD8G update start
-            // NFM103Controller.callout(iflog.Id, rprIds, null);
+            // NFM103Controller.callout(iflog.Id, rprIds);
             String uid = UserInfo.getUserId();
             String BUid = System.Label.Batch_User_Id;
             System.debug('zheli');
@@ -235,7 +236,6 @@
                 NFM103Controller.callout(iflog.Id, rprIds, null);
             }
             // 20220902 ljh XLIU-CHSD8G update end
-            
         }
         System.debug('-----NFM103Trigger end');
     }
@@ -245,14 +245,14 @@
      *
      * @param iflog_Id           銉偘銉嗐兗銉栥儷銇甀d
      * @param repairIds          閫佷俊瀵捐薄淇悊
-     * @param reanalysisFlag     鍐嶆敞鍐屽垎鏋愪娇鐢� --- 鍐嶄慨鐞嗗垎鏋愮姸鎬�
      */
     @future (callout = true)
-    public static void callout(String iflog_Id, List<Id> repairIds, String reanalysisFlag) {
-       calloutNotfuture( iflog_Id,  repairIds,  reanalysisFlag);
+    public static void callout(String iflog_Id, List<Id> repairIds, String flag) {
+       calloutNotfuture(iflog_Id, repairIds, flag);
     }
-    //20220902 ljh 鏂板(澶嶅埗callout)鏂规硶
-    public static void calloutNotfuture(String iflog_Id, List<Id> repairIds, String reanalysisFlag) {
+    //20220902 ljh 鏂板锛堝鍒讹級鏂规硶  XLIU-CHSD8G 
+    public static void calloutNotfuture(String iflog_Id, List<Id> repairIds,String flag) {
+
         if (repairIds == null || repairIds.size() == 0) {
             return;
         }
@@ -546,15 +546,7 @@
                  element.Address                    = rpr.Detailed_Address__c;   //璇︾粏鍦板潃
                  element.Postal                     = rpr.address_ZipCode__c;    //閭紪
                  element.ReturnType                 = NFMUtil.getMapValue(ReturnsProductWayMap,'Returns_Product_way__c', rpr.Returns_Product_way__c, iflog);//杩斿搧鏂瑰紡
-                 // modify by liu 20220909 鍐嶆敞鍐岄」鐩甆FM103鎺ュ彛杩為�氭祴璇曟椂杩藉姞瀵瑰簲 start
-                 // element.UpdateStatus               = rpr.Address_type__c;    //鐢宠淇悊鏃堕棿
-                 if (String.isNotBlank(reanalysisFlag)) {
-                    element.UpdateStatus               = 'X';    //鐢宠淇悊鏃堕棿
-                 } else {
-                    element.UpdateStatus               = rpr.Address_type__c;    //鐢宠淇悊鏃堕棿
-                 }
-                 // modify by liu 20220909 鍐嶆敞鍐岄」鐩甆FM103鎺ュ彛杩為�氭祴璇曟椂杩藉姞瀵瑰簲 end
-                 
+                 element.UpdateStatus               = rpr.Address_type__c;    //鐢宠淇悊鏃堕棿
                  //add by wangweipeng  2021/07/14   end
                  //add pi 瀵嗘枃 sushanhu 20220222 start
                  element.DataId                     =rpr.AWS_Data_Id__c;//aws瀛樺偍鍑瘉
@@ -565,18 +557,24 @@
                  element.OfferRental               =rpr.Offer_Rental_New__c ? 'X':'';  //鏄惁鎻愪緵澶囧搧锛圢EW锛�
                  //XLIU-CGAD3Z 銆愬鎵樸�戝鍝佺浉鍏冲瓧娈典紶杈撹嚦SAP LY 20220714 end
                  //URF闄愭鍚堝悓2鏈� xxf 20220811 start
-                 if (rpr.Maintenance_Contract__r.URF_Contract__c == true && rpr.Delivered_Product__r.Product2.ProductURF__c !=null) {
-                    element.Series                 =rpr.Delivered_Product__r.Product2.ProductURF__r.URFLimitSerial__c =='URF-P'?'P':'V';   //闄愭鍚堝悓绯诲垪 
-                 }else{
-                    element.Series                 =null;
+                 if (!String.isBlank(rpr.Maintenance_Contract__c)){
+                    if (rpr.Maintenance_Contract__r.URF_Contract__c == true && rpr.Delivered_Product__r.Product2.ProductURF__c !=null) {
+                        element.Series                 =rpr.Delivered_Product__r.Product2.ProductURF__r.URFLimitSerial__c =='URF-P'?'P':'V';   //闄愭鍚堝悓绯诲垪 
+                     }else{
+                        element.Series                 =null;
+                     }
                  }
+                 
                  //URF闄愭鍚堝悓2鏈� xxf 20220811 end
                  rprId = rpr.Id;   //2022-07-14  zyh  add
 
                  //鍐嶆敞鍐屽垎鏋� 闇�姹� 鏂板瀛楁 20220811 sx start
-                 element.Reanalysis                = reanalysisFlag;
-                 //鍐嶆敞鍐屽垎鏋� 闇�姹� 鏂板瀛楁 20220811 sx end
+                 element.Reanalysis                = flag;
 
+                 if(flag != null){
+                    element.UpdateStatus = 'X';
+                 }
+                 //鍐嶆敞鍐屽垎鏋� 闇�姹� 鏂板瀛楁 20220811 sx end
 
             }
 

--
Gitblit v1.9.1