From 2f4492ee18f90274582fcc2bb06f5e9bf64136e8 Mon Sep 17 00:00:00 2001
From: buli <137736985@qq.com>
Date: 星期五, 13 五月 2022 17:32:14 +0800
Subject: [PATCH] ProdBackup0513

---
 force-app/main/default/classes/RadiationUtil.cls |   64 ++-----------------------------
 1 files changed, 5 insertions(+), 59 deletions(-)

diff --git a/force-app/main/default/classes/RadiationUtil.cls b/force-app/main/default/classes/RadiationUtil.cls
index 02ebb2f..e39f810 100644
--- a/force-app/main/default/classes/RadiationUtil.cls
+++ b/force-app/main/default/classes/RadiationUtil.cls
@@ -1,9 +1,5 @@
 global class RadiationUtil {
 
-    public static Boolean oldOrder = false;
-
-    public static BOolean is_oly = false;
-
     public static Boolean EscapeOrderTriggerHandler = true;
     /**
      * [updateRadiationTypeQuantity description]鏇存柊浠g悊鍟嗚瘉鐓ф槑缁嗭紝鏇存柊濂ユ灄宸存柉浠g悊鍟嗙殑璇佺収鏄庣粏
@@ -14,8 +10,7 @@
      */
     public static void updateRadiationTypeQuantity (String Id, String orderFounder, String dealerId, Boolean toloseFlag, String operationType, String operator) {
 
-
-        String olympusAccountId =  System.label.Olympus_Id ;
+        String olympusAccountId = System.label.Olympus_Id;
 
         String orderId = Id;
         //鑾峰彇鍚堝悓鐨勮緪灏勭被鍨嬪拰鏁伴噺
@@ -25,9 +20,7 @@
             //鏌ヤ唬鐞嗗晢鐨勪唬鐞嗗晢璐拱鏄庣粏
             Map<String, PurchaseDetails__c> dealerModelQuantityMap = GetPurchaseDetailsMap(dealerId);
             //鏌ュゥ鏋楀反鏂殑浠g悊鍟嗚喘涔版槑缁�
-            is_oly = true;
             Map<String, PurchaseDetails__c> olympusModelQuantityMap = GetPurchaseDetailsMap(olympusAccountId);
-            is_oly = false;
             // 鏌ユ壘 鍚堝悓鎻愪氦瀵瑰簲鐨勪唬鐞嗗晢璐拱鏄庣粏
             Map<String, PurchaseDetails__c> dealerResult = new Map<String, PurchaseDetails__c>();
             Map<String, PurchaseDetails__c> olympusResult = new Map<String, PurchaseDetails__c>();
@@ -121,9 +114,7 @@
 
                     } else {//澧炲姞宸插敭浜у搧鏁伴噺
                         reportMap.putAll(upsertChangedReport(olympusAccountId, radiationType, operationType, orderId, quantity, operator));
-                        is_oly = true;
                         olympusModelQuantityMap = insertPurchaseDetail(olympusModelQuantityMap, olympusAccountId, radiationType, radiationTypeQuantityMap);
-                        is_oly = false;
                     }
                 } else {//鍑忓幓宸插敭浜у搧鏁伴噺
                     if (toloseFlag) {
@@ -131,9 +122,7 @@
                         olympusResult.get(radiationType).SoldNumber__c -= quantity;
                     } else {//澧炲姞宸插敭浜у搧鏁伴噺
                         reportMap.putAll(upsertChangedReport(olympusAccountId, radiationType, operationType, orderId, quantity, operator));
-                        is_oly = true;
                         olympusModelQuantityMap = insertPurchaseDetail(olympusModelQuantityMap, olympusAccountId, radiationType, radiationTypeQuantityMap);
-                        is_oly = false;
                     }
                     
                 }
@@ -148,9 +137,7 @@
 
                 if ( olympusResult.size() > 0 && olympusResult != null) {
                     upsert olympusResult.values();
-                    is_oly = true;
                     insertReportMap.putAll(insertChangedReport(olympusResult, reportMap));
-                    is_oly = false;
                 }
 
             } else {
@@ -161,9 +148,7 @@
 
                 if ( olympusModelQuantityMap.size() > 0 && olympusModelQuantityMap != null) {
                     upsert olympusModelQuantityMap.values();
-                    is_oly = true;
                     insertReportMap.putAll(insertChangedReport(olympusModelQuantityMap, reportMap));
-                    is_oly = false;
                 }
             }
                 
@@ -173,9 +158,7 @@
             
             Map<String, Integer> radiationMap =  new Map<String, Integer>();
             String accountDealerErrorMessage = updateCertificationDetails(dealerId, orderFounder, radiationMap, true);
-            is_oly = true;
             String olympusDealerErrorMessage = updateCertificationDetails(olympusAccountId, orderFounder, radiationMap, true);
-            is_oly = false;
         }
 
     }
@@ -192,7 +175,6 @@
             String accountId = detail.PurchaseAccount__c;
             //String accountIdafter = accountId.subString(0,15);
             String key = accountId.subString(0, 15) + detail.PurProductModel__c;
-
             if (reportMap.containsKey(key)) {
                 reportMap.get(key).ChangedPurchase__c = detail.Id;
             }
@@ -209,11 +191,9 @@
      * @return              [description]
      */
     public static String updateCertificationDetails( String accountId, String orderFounder, Map<String, Decimal> dataMap, Boolean updateFlag) {
-        
-        Map<String, CertificationDetails__c> certificationDetailMap = GetAccountCertificationDetail(accountId);
-        
-        Map<String, CertificationDetails__c> temporaryCertificationDetailMap = GetAccountCertificationDetail(accountId);
 
+        Map<String, CertificationDetails__c> certificationDetailMap = GetAccountCertificationDetail(accountId);
+        Map<String, CertificationDetails__c> temporaryCertificationDetailMap = GetAccountCertificationDetail(accountId);
         Map<String, PurchaseDetails__c> purchaseDetailMap = GetPurchaseDetailsMap(accountId);
 
         Map<String, CertificationDetails__c> updatecertificationDetailMap = new Map<String, CertificationDetails__c>();
@@ -387,19 +367,7 @@
      */
     public static Map<String, CertificationDetails__c> GetAccountCertificationDetail (String accountId) {
         Map<String, CertificationDetails__c> result = new Map<String, CertificationDetails__c>();
-        List<CertificationDetails__c> certificationDetailsList = new List<CertificationDetails__c>();
-        if (oldOrder && is_oly) {
-            certificationDetailsList = [ select Id, Name, ProdustionType__c, 
-                                    ProductModelNumber__c, Ceiling80__c, Record80__c, Ceiling90__c, Record90__c , 
-                                    CertificationDetailAccount__c, CertificationDetailAccountName__c,
-                                    LicenseInformation__r.IfQuantityCtrl__c,AccountRecordType__c,Record100__c,
-                                    Ceiling100__c
-                                    from CertificationDetails__c 
-                                    where CertificationDetailAccount__c = :accountId  
-                                        and ActivitieTypes__c = '閿�鍞�' and IsActive__c = false];
-            
-        }else{
-            certificationDetailsList = [ select Id, Name, ProdustionType__c, 
+        List<CertificationDetails__c> certificationDetailsList = [ select Id, Name, ProdustionType__c, 
                                     ProductModelNumber__c, Ceiling80__c, Record80__c, Ceiling90__c, Record90__c , 
                                     CertificationDetailAccount__c, CertificationDetailAccountName__c,
                                     LicenseInformation__r.IfQuantityCtrl__c,AccountRecordType__c,Record100__c,
@@ -407,8 +375,6 @@
                                     from CertificationDetails__c 
                                     where CertificationDetailAccount__c = :accountId  
                                         and ActivitieTypes__c = '閿�鍞�' and IsActive__c = true];
-        }
-        
 
         for  (CertificationDetails__c detail : certificationDetailsList) {
             result.put(detail.ProdustionType__c, detail);
@@ -438,11 +404,6 @@
         purchaseDetail.PurProductModel__c = productModel;
         purchaseDetail.PurchaseAccount__c = id;
         purchaseDetail.TakeEffectInYear__c = effectiveYear;
-        if (oldOrder && is_oly) {
-            purchasedetail.company__c = '濂ユ灄宸存柉';
-        }else if(is_oly){
-            purchaseDetail.company__c = '浠櫙閫氬厜瀛︾鎶�';
-        }
 
         for (String model:certificationDetailMap.keySet()) {
             if ('Delta鍜孷anta'.equals(model)) {
@@ -499,25 +460,10 @@
     public static Map<String, PurchaseDetails__c> GetPurchaseDetailsMap( String accountId) {
         String effectiveYear = String.valueOf(Date.today().year());
         Map<String, PurchaseDetails__c> result = new Map<String, PurchaseDetails__c>();
-        List<PurchaseDetails__c> purchaseDetailsList = new List<PurchaseDetails__c>();
-        if(is_oly == false){
-            purchaseDetailsList = [select Id, Name, RemainingNumber__c, SoldNumber__c,
+        List<PurchaseDetails__c> purchaseDetailsList = [select Id, Name, RemainingNumber__c, SoldNumber__c,
                                  PurProductModel__c, PurchaseAccount__c
                                  from PurchaseDetails__c
                                  where TakeEffectInYear__c = :effectiveYear and PurchaseAccount__c = :accountId];
-        }else{
-            if (oldOrder) {
-                purchaseDetailsList = [select Id, Name, RemainingNumber__c, SoldNumber__c,
-                                 PurProductModel__c, PurchaseAccount__c
-                                 from PurchaseDetails__c
-                                 where TakeEffectInYear__c = :effectiveYear and PurchaseAccount__c = :accountId and company__c = '濂ユ灄宸存柉'];
-            }else{
-                purchaseDetailsList = [select Id, Name, RemainingNumber__c, SoldNumber__c,
-                                 PurProductModel__c, PurchaseAccount__c
-                                 from PurchaseDetails__c
-                                 where TakeEffectInYear__c = :effectiveYear and PurchaseAccount__c = :accountId and company__c = '浠櫙閫氬厜瀛︾鎶�'];
-            }
-        }
         if (purchaseDetailsList.size() > 0) {
             for (PurchaseDetails__c purchaseDetail : purchaseDetailsList) {
                 result.put(purchaseDetail.PurProductModel__c, purchaseDetail);

--
Gitblit v1.9.1