From ae3dbaacd49b295337c5c53dbf5cf732898ed6f8 Mon Sep 17 00:00:00 2001 From: GWY <guweiyiscp096@foxmail.com> Date: 星期四, 17 三月 2022 09:49:00 +0800 Subject: [PATCH] PJ1降类修复 --- force-app/main/default/classes/ProRegisterHandler.cls | 180 +---------------------------- force-app/main/default/classes/Product2TriggerHandler.cls | 139 ++++++++++------------ 2 files changed, 73 insertions(+), 246 deletions(-) diff --git a/force-app/main/default/classes/ProRegisterHandler.cls b/force-app/main/default/classes/ProRegisterHandler.cls index 65515f8..ff0ddb9 100644 --- a/force-app/main/default/classes/ProRegisterHandler.cls +++ b/force-app/main/default/classes/ProRegisterHandler.cls @@ -116,181 +116,19 @@ prlList = [select Product2__r.id,Product2__r.demoteer_Sap__c,Product2__r.Diedatvanink__c,Product_Register__r.MedPrdClass__c,Product_Register__r.Stelsedag__c,Product_Register__r.ValidTo__c,Product_Register__r.ValidFrom__c from Product_Register_Link__c where Product_Register__r.Id in : prcList]; - //鏌ヨ鍑轰骇鍝両D - List<Id> pro2IdList = new List<Id>(); - for (Product_Register_Link__c prl1: prlList) { - pro2IdList.add(prl1.Product2__r.id); + + List<ID> proIdList = new List<ID>(); + for (Product_Register_Link__c prl: prlList) { + proIdList.add(prl.Product2__r.id); } - - List<Product_Register_Link__c> prl1List = new List<Product_Register_Link__c>(); - prl1List = [select Product2__r.id,Product2__r.demoteer_Sap__c,Product2__r.Diedatvanink__c,Product_Register__r.Stelsedag__c,Product_Register__r.MedPrdClass__c,Product_Register__r.ValidTo__c,Product_Register__r.ValidFrom__c - from Product_Register_Link__c - where Product2__r.Id in : pro2IdList]; - - //鏍规嵁Id瀛樻斁浜у搧鎵�灞炵殑鎵�鏈夋敞鍐岃瘉涓嬬殑鍣ㄦ鍒嗙被銆� - Map<Id,List<String>> pro2Map = new Map<Id,List<String>>(); - //瀛樻斁娉ㄥ唽璇佷笂鏈�鍓嶇殑缁存姢鏃� - Map<Id,Date> prSteMap = new Map<Id,Date>(); - Map<Id,Date> prSte1Map = new Map<Id,Date>(); - if (prl1List.size()>0) { - for (Product_Register_Link__c prl: prl1List) { - if (pro2Map.containsKey(prl.Product2__r.Id)) { - pro2Map.get(prl.Product2__r.Id).add(prl.Product_Register__r.MedPrdClass__c); - }else { - pro2Map.put(prl.Product2__r.Id, new List<String>()); - pro2Map.get(prl.Product2__r.Id).add(prl.Product_Register__r.MedPrdClass__c); - } - - if (prl.Product_Register__r.MedPrdClass__c == '1' && prl.Product_Register__r.Stelsedag__c <> null) { - if (prSteMap.containsKey(prl.Product2__r.Id)) { - if (prSteMap.get(prl.Product2__r.Id) > prl.Product_Register__r.Stelsedag__c) { - prSteMap.put(prl.Product2__r.Id,prl.Product_Register__r.Stelsedag__c); - } - }else { - prSteMap.put(prl.Product2__r.Id,prl.Product_Register__r.Stelsedag__c); - } - } - - if ((prl.Product_Register__r.MedPrdClass__c == '2' || prl.Product_Register__r.MedPrdClass__c == '2') && prl.Product_Register__r.Stelsedag__c <> null) { - if (prSte1Map.containsKey(prl.Product2__r.Id)) { - if (prSte1Map.get(prl.Product2__r.Id) > prl.Product_Register__r.Stelsedag__c) { - prSte1Map.put(prl.Product2__r.Id,prl.Product_Register__r.Stelsedag__c); - } - }else { - prSte1Map.put(prl.Product2__r.Id,prl.Product_Register__r.Stelsedag__c); - } - } - } - } - System.debug('pro2Map='+pro2Map); - System.debug('prSteMap='+prSteMap); - System.debug('prSte1Map='+prSte1Map); - //浜у搧Id涓庣瓑绾х被鍒� - Map<Id,String> prlMap = new Map<Id,String>(); - Map<Id,String> prl1Map = new Map<Id,String>(); - Map<Id,String> prl2Map = new Map<Id,String>(); - List<ID> pidList = new List<ID>(); - Date stedate; - - if (pro2Map.size()>0) { - for (Product_Register_Link__c pr: prl1List) { - if (pro2Map.containsKey(pr.Product2__r.Id) && (prSteMap.containsKey(pr.Product2__r.Id) || prSte1Map.containsKey(pr.Product2__r.Id))) { - stedate = prSteMap.get(pr.Product2__r.Id)==null?prSte1Map.get(pr.Product2__r.Id)==null?null:prSte1Map.get(pr.Product2__r.Id):prSte1Map.get(pr.Product2__r.Id); - pidList.add(pr.Product2__r.Id); - if (pr.Product2__r.demoteer_Sap__c <> null && pr.Product2__r.Diedatvanink__c <> null) { - if (pr.Product_Register__r.Stelsedag__c <> null) { - if (pr.Product2__r.Diedatvanink__c <= stedate) { - if (pr.Product2__r.demoteer_Sap__c <= pr.Product_Register__r.ValidTo__c && pr.Product2__r.demoteer_Sap__c >= pr.Product_Register__r.ValidFrom__c - && pr.Product_Register__r.MedPrdClass__c == '2' || pr.Product_Register__r.MedPrdClass__c == '3') { - if (prlMap.get(pr.Product2__r.Id) == null) { - prlMap.put(pr.Product2__r.Id, '浜岀被'); - }else { - String Lins = prlMap.get(pr.Product2__r.Id); - Lins += '浜岀被'; - prlMap.put(pr.Product2__r.Id, Lins); - } - } - else if (pr.Product2__r.demoteer_Sap__c <= pr.Product_Register__r.ValidTo__c && pr.Product2__r.demoteer_Sap__c >= pr.Product_Register__r.ValidFrom__c - && (pr.Product_Register__r.MedPrdClass__c == '1')) { - if (prlMap.get(pr.Product2__r.Id) == null) { - prlMap.put(pr.Product2__r.Id, '涓�绫�'); - }else { - String Lins = prlMap.get(pr.Product2__r.Id); - Lins += '涓�绫�'; - prlMap.put(pr.Product2__r.Id, Lins); - } - }else { - if (prlMap.get(pr.Product2__r.Id) == null) { - prlMap.put(pr.Product2__r.Id, '闈炵洃绠�'); - }else { - String Lins = prlMap.get(pr.Product2__r.Id); - Lins += '闈炵洃绠�'; - prlMap.put(pr.Product2__r.Id, Lins); - } - } - }else if (pr.Product2__r.Diedatvanink__c > stedate) { - if (pr.Product2__r.demoteer_Sap__c <= pr.Product_Register__r.ValidTo__c && pr.Product2__r.demoteer_Sap__c >= pr.Product_Register__r.ValidFrom__c - && pr.Product_Register__r.MedPrdClass__c == '1') { - if (prl1Map.get(pr.Product2__r.Id) == null) { - prl1Map.put(pr.Product2__r.Id, '涓�绫�'); - }else { - String Lins = prl1Map.get(pr.Product2__r.Id); - Lins += '涓�绫�'; - prl1Map.put(pr.Product2__r.Id, Lins); - } - }else if (pr.Product2__r.demoteer_Sap__c <= pr.Product_Register__r.ValidTo__c && pr.Product2__r.demoteer_Sap__c >= pr.Product_Register__r.ValidFrom__c - && pr.Product_Register__r.MedPrdClass__c == '2' || pr.Product_Register__r.MedPrdClass__c == '3') { - if (prl1Map.get(pr.Product2__r.Id) == null) { - prl1Map.put(pr.Product2__r.Id, '浜岀被'); - }else { - String Lins = prl1Map.get(pr.Product2__r.Id); - Lins += '浜岀被'; - prl1Map.put(pr.Product2__r.Id, Lins); - } - }else { - if (prlMap.get(pr.Product2__r.Id) == null) { - prlMap.put(pr.Product2__r.Id, '闈炵洃绠�'); - }else { - String Lins = prlMap.get(pr.Product2__r.Id); - Lins += '闈炵洃绠�'; - prlMap.put(pr.Product2__r.Id, Lins); - } - } - } - }else { - prl2Map.put(pr.Product2__r.Id, '绌�'); - } - } - } - } - } - System.debug('prlMap='+prlMap); - System.debug('prl1Map='+prl1Map); - System.debug('prl2Map='+prl2Map); - + List<Product2> por2Lsit = new List<Product2>(); //鏌ュ嚭浜у搧鐨刬d鍜岀瓑绾х被鍒殑瀛楁 - por2Lsit = [select Id,Level_Category__c,demoteer_Sap__c,Diedatvanink__c from Product2 where Id in : pidList]; - if (por2Lsit.size() > 0) { - for (Product2 pr2: por2Lsit) { - if (prlMap.containsKey(pr2.Id)) { - if ((prlMap.get(pr2.Id).contains('浜岀被') && prlMap.get(pr2.Id).contains('涓�绫�')) || - (!prlMap.get(pr2.Id).contains('涓�绫�') && prlMap.get(pr2.Id).contains('浜岀被'))){ - pr2.Level_Category__c = '浜岀被'; - prt2Map.put(pr2.Id, pr2); - }else if (prlMap.get(pr2.Id).contains('涓�绫�') && !prlMap.get(pr2.Id).contains('浜岀被')) { - pr2.Level_Category__c = '涓�绫�'; - prt2Map.put(pr2.Id, pr2); - }else if (prlMap.get(pr2.Id).contains('闈炵洃绠�') && !prl2Map.containsKey(pr2.Id)) { - pr2.Level_Category__c = '闈炵洃绠�'; - prt2Map.put(pr2.Id, pr2); - }else { - pr2.Level_Category__c = null; - prt2Map.put(pr2.Id, pr2); - } - } - if (prl1Map.containsKey(pr2.Id)) { - if (prl1Map.get(pr2.Id).contains('涓�绫�')) { - pr2.Level_Category__c = '涓�绫�'; - prt2Map.put(pr2.Id, pr2); - }else if (prl1Map.get(pr2.Id).contains('浜岀被') && !prl1Map.get(pr2.Id).contains('涓�绫�')) { - pr2.Level_Category__c = '浜岀被'; - prt2Map.put(pr2.Id, pr2); - }else if (prl1Map.get(pr2.Id).contains('闈炵洃绠�') && !prl2Map.containsKey(pr2.Id)) { - pr2.Level_Category__c = '闈炵洃绠�'; - prt2Map.put(pr2.Id, pr2); - }else { - pr2.Level_Category__c = null; - prt2Map.put(pr2.Id, pr2); - } - } - if (pr2.demoteer_Sap__c == null || pr2.Diedatvanink__c == null) { - pr2.Level_Category__c = null; - prt2Map.put(pr2.Id, pr2); - } - } + por2Lsit = [select Id,Level_Category__c from Product2 where Id in : proIdList]; + for (Product2 pro: por2Lsit) { + pro.Level_Category__c = null; + prt2Map.put(pro.Id, pro); } - System.debug('prt2Map='+prt2Map); if (prt2Map.size() > 0) { update prt2Map.values(); diff --git a/force-app/main/default/classes/Product2TriggerHandler.cls b/force-app/main/default/classes/Product2TriggerHandler.cls index 2b34f41..d0ec9c5 100644 --- a/force-app/main/default/classes/Product2TriggerHandler.cls +++ b/force-app/main/default/classes/Product2TriggerHandler.cls @@ -59,11 +59,11 @@ from Product_Register_Link__c where Product2__r.Id in : p2ids]; System.debug('pro2List='+pro2List); - //瀛樻斁浜у搧鐨刬d鍜岀瓑绾х被鍒瓧娈电殑鍊肩殑闆嗗悎 + //瀛樻斁浜у搧鐨刬d鍜屾敞鍐岃瘉鍖荤枟鍣ㄦ鍒嗙被鐨勫�肩殑闆嗗悎 Map<Id,List<String>> pro2Map = new Map<Id,List<String>>(); //瀛樻斁娉ㄥ唽璇佷笂鏈�鍓嶇殑缁存姢鏃�,涓�绫昏瘉浼樺厛,鍚﹀垯浜岀被璇併�� - Map<Id,Date> prSteMap = new Map<Id,Date>(); - Map<Id,Date> prSte1Map = new Map<Id,Date>(); + Map<Id,Date> prSteMap = new Map<Id,Date>();//瀛樹竴绫荤淮鎶ゆ棩 + Map<Id,Date> prSte1Map = new Map<Id,Date>();//瀛樹簩绫荤淮鎶ゆ棩 if (pro2List.size()>0) { for (Product_Register_Link__c prl: pro2List) { if (pro2Map.containsKey(prl.Product2__r.Id)) { @@ -73,7 +73,8 @@ pro2Map.get(prl.Product2__r.Id).add(prl.Product_Register__r.MedPrdClass__c); } - if (prl.Product_Register__r.MedPrdClass__c == '1' && prl.Product_Register__r.Stelsedag__c <> null) { + if (prl.Product_Register__r.MedPrdClass__c == '1' && prl.Product_Register__r.Stelsedag__c <> null && + newMap.get(prl.Product2__r.Id).demoteer_Sap__c <= prl.Product_Register__r.ValidTo__c && newMap.get(prl.Product2__r.Id).demoteer_Sap__c >= prl.Product_Register__r.ValidFrom__c) { if (prSteMap.containsKey(prl.Product2__r.Id)) { if (prSteMap.get(prl.Product2__r.Id) > prl.Product_Register__r.Stelsedag__c) { prSteMap.put(prl.Product2__r.Id,prl.Product_Register__r.Stelsedag__c); @@ -81,9 +82,14 @@ }else { prSteMap.put(prl.Product2__r.Id,prl.Product_Register__r.Stelsedag__c); } + }else { + if (!prSteMap.containsKey(prl.Product2__r.Id) || prSteMap.get(prl.Product2__r.Id) == null) { + prSteMap.put(prl.Product2__r.Id,null); + } } - if ((prl.Product_Register__r.MedPrdClass__c == '2' || prl.Product_Register__r.MedPrdClass__c == '2') && prl.Product_Register__r.Stelsedag__c <> null) { + if ((prl.Product_Register__r.MedPrdClass__c == '2' || prl.Product_Register__r.MedPrdClass__c == '3') && prl.Product_Register__r.Stelsedag__c <> null && + newMap.get(prl.Product2__r.Id).demoteer_Sap__c <= prl.Product_Register__r.ValidTo__c && newMap.get(prl.Product2__r.Id).demoteer_Sap__c >= prl.Product_Register__r.ValidFrom__c) { if (prSte1Map.containsKey(prl.Product2__r.Id)) { if (prSte1Map.get(prl.Product2__r.Id) > prl.Product_Register__r.Stelsedag__c) { prSte1Map.put(prl.Product2__r.Id,prl.Product_Register__r.Stelsedag__c); @@ -91,6 +97,10 @@ }else { prSte1Map.put(prl.Product2__r.Id,prl.Product_Register__r.Stelsedag__c); } + }else { + if (!prSte1Map.containsKey(prl.Product2__r.Id) || prSte1Map.get(prl.Product2__r.Id) == null) { + prSte1Map.put(prl.Product2__r.Id,null); + } } } } @@ -108,81 +118,67 @@ if (pro2Map.size()>0) { for (Product_Register_Link__c pr: pro2List) { if (pro2Map.containsKey(pr.Product2__r.Id) && (prSteMap.containsKey(pr.Product2__r.Id) || prSte1Map.containsKey(pr.Product2__r.Id))) { - stedate = prSteMap.get(pr.Product2__r.Id)==null?prSte1Map.get(pr.Product2__r.Id)==null?null:prSte1Map.get(pr.Product2__r.Id):prSte1Map.get(pr.Product2__r.Id); - if (newMap.get(pr.Product2__r.Id).demoteer_Sap__c <> null && newMap.get(pr.Product2__r.Id).Diedatvanink__c <> null) { - if (pr.Product_Register__r.Stelsedag__c <> null) { - if (newMap.get(pr.Product2__r.Id).Diedatvanink__c <= stedate) { - if (newMap.get(pr.Product2__r.Id).demoteer_Sap__c <= pr.Product_Register__r.ValidTo__c && newMap.get(pr.Product2__r.Id).demoteer_Sap__c >= pr.Product_Register__r.ValidFrom__c - && pr.Product_Register__r.MedPrdClass__c == '2' || pr.Product_Register__r.MedPrdClass__c == '3') { - System.debug('2'); - if (prlMap.get(pr.Product2__r.Id) == null) { - prlMap.put(pr.Product2__r.Id, '浜岀被'); - }else { - String Lins = prlMap.get(pr.Product2__r.Id); - Lins += '浜岀被'; - prlMap.put(pr.Product2__r.Id, Lins); - } - }else if (newMap.get(pr.Product2__r.Id).demoteer_Sap__c <= pr.Product_Register__r.ValidTo__c && newMap.get(pr.Product2__r.Id).demoteer_Sap__c >= pr.Product_Register__r.ValidFrom__c - && (pr.Product_Register__r.MedPrdClass__c == '1')) { - System.debug('1'); - if (prlMap.get(pr.Product2__r.Id) == null) { - prlMap.put(pr.Product2__r.Id, '涓�绫�'); + stedate = prSteMap.get(pr.Product2__r.Id)==null?(prSte1Map.get(pr.Product2__r.Id)==null?null:prSte1Map.get(pr.Product2__r.Id)):prSteMap.get(pr.Product2__r.Id); + if (stedate <> null) { + if (newMap.get(pr.Product2__r.Id).demoteer_Sap__c <> null && newMap.get(pr.Product2__r.Id).Diedatvanink__c <> null) { + if (pr.Product_Register__r.Stelsedag__c <> null) { + if (newMap.get(pr.Product2__r.Id).Diedatvanink__c <= stedate) { + if (newMap.get(pr.Product2__r.Id).demoteer_Sap__c <= pr.Product_Register__r.ValidTo__c && newMap.get(pr.Product2__r.Id).demoteer_Sap__c >= pr.Product_Register__r.ValidFrom__c + && pr.Product_Register__r.MedPrdClass__c == '2' || pr.Product_Register__r.MedPrdClass__c == '3') { + System.debug('2'); + if (prlMap.get(pr.Product2__r.Id) == null || !prlMap.containsKey(pr.Product2__r.Id)) { + prlMap.put(pr.Product2__r.Id, '浜岀被'); }else { String Lins = prlMap.get(pr.Product2__r.Id); - Lins += '涓�绫�'; + Lins += '浜岀被'; prlMap.put(pr.Product2__r.Id, Lins); } - }else { - System.debug('闈�'); - if (prlMap.get(pr.Product2__r.Id) == null) { - prlMap.put(pr.Product2__r.Id, '闈炵洃绠�'); - }else { - String Lins = prlMap.get(pr.Product2__r.Id); - Lins += '闈炵洃绠�'; - prlMap.put(pr.Product2__r.Id, Lins); + }else if (newMap.get(pr.Product2__r.Id).demoteer_Sap__c <= pr.Product_Register__r.ValidTo__c && newMap.get(pr.Product2__r.Id).demoteer_Sap__c >= pr.Product_Register__r.ValidFrom__c + && (pr.Product_Register__r.MedPrdClass__c == '1')) { + System.debug('1'); + if (prlMap.get(pr.Product2__r.Id) == null || !prlMap.containsKey(pr.Product2__r.Id)) { + prlMap.put(pr.Product2__r.Id, '涓�绫�'); + }else { + String Lins = prlMap.get(pr.Product2__r.Id); + Lins += '涓�绫�'; + prlMap.put(pr.Product2__r.Id, Lins); + } + } + }else if (newMap.get(pr.Product2__r.Id).Diedatvanink__c > stedate) { + if (newMap.get(pr.Product2__r.Id).demoteer_Sap__c <= pr.Product_Register__r.ValidTo__c && newMap.get(pr.Product2__r.Id).demoteer_Sap__c >= pr.Product_Register__r.ValidFrom__c + && pr.Product_Register__r.MedPrdClass__c == '1') { + if (prl1Map.get(pr.Product2__r.Id) == null || !prl1Map.containsKey(pr.Product2__r.Id)) { + prl1Map.put(pr.Product2__r.Id, '涓�绫�'); + }else { + String Lins = prl1Map.get(pr.Product2__r.Id); + Lins += '涓�绫�'; + prl1Map.put(pr.Product2__r.Id, Lins); + } + }else if (newMap.get(pr.Product2__r.Id).demoteer_Sap__c <= pr.Product_Register__r.ValidTo__c && newMap.get(pr.Product2__r.Id).demoteer_Sap__c >= pr.Product_Register__r.ValidFrom__c + && pr.Product_Register__r.MedPrdClass__c == '2' || pr.Product_Register__r.MedPrdClass__c == '3') { + if (prl1Map.get(pr.Product2__r.Id) == null || !prl1Map.containsKey(pr.Product2__r.Id)) { + prl1Map.put(pr.Product2__r.Id, '浜岀被'); + }else { + String Lins = prl1Map.get(pr.Product2__r.Id); + Lins += '浜岀被'; + prl1Map.put(pr.Product2__r.Id, Lins); + } } } - }else if (newMap.get(pr.Product2__r.Id).Diedatvanink__c > stedate) { - if (newMap.get(pr.Product2__r.Id).demoteer_Sap__c <= pr.Product_Register__r.ValidTo__c && newMap.get(pr.Product2__r.Id).demoteer_Sap__c >= pr.Product_Register__r.ValidFrom__c - && pr.Product_Register__r.MedPrdClass__c == '1') { - if (prl1Map.get(pr.Product2__r.Id) == null) { - prl1Map.put(pr.Product2__r.Id, '涓�绫�'); - }else { - String Lins = prl1Map.get(pr.Product2__r.Id); - Lins += '涓�绫�'; - prl1Map.put(pr.Product2__r.Id, Lins); - } - }else if (newMap.get(pr.Product2__r.Id).demoteer_Sap__c <= pr.Product_Register__r.ValidTo__c && newMap.get(pr.Product2__r.Id).demoteer_Sap__c >= pr.Product_Register__r.ValidFrom__c - && pr.Product_Register__r.MedPrdClass__c == '2' || pr.Product_Register__r.MedPrdClass__c == '3') { - if (prl1Map.get(pr.Product2__r.Id) == null) { - prl1Map.put(pr.Product2__r.Id, '浜岀被'); - }else { - String Lins = prl1Map.get(pr.Product2__r.Id); - Lins += '浜岀被'; - prl1Map.put(pr.Product2__r.Id, Lins); - } - }else { - if (prlMap.get(pr.Product2__r.Id) == null) { - prlMap.put(pr.Product2__r.Id, '闈炵洃绠�'); - }else { - String Lins = prlMap.get(pr.Product2__r.Id); - Lins += '闈炵洃绠�'; - prlMap.put(pr.Product2__r.Id, Lins); - } - } + }else { + prl2Map.put(pr.Product2__r.Id, '绌�'); } - }else { - prl2Map.put(pr.Product2__r.Id, '绌�'); } + }else { + prl2Map.put(pr.Product2__r.Id, '绌�'); } } } } - System.debug('stedate='+stedate); System.debug('prlMap='+prlMap); System.debug('prl1Map='+prl1Map); - + System.debug('prl2Map='+prl2Map); //缁欎骇鍝佷笂鐨勭瓑绾х被鍒瓧娈佃祴鍊� for (Product2 pr2: newList) { if (prlMap.containsKey(pr2.Id)) { @@ -191,22 +187,15 @@ pr2.Level_Category__c = '浜岀被'; }else if (prlMap.get(pr2.Id).contains('涓�绫�') && !prlMap.get(pr2.Id).contains('浜岀被')) { pr2.Level_Category__c = '涓�绫�'; - }else if (prlMap.get(pr2.Id).contains('闈炵洃绠�') && !prl2Map.containsKey(pr2.Id)) { - pr2.Level_Category__c = '闈炵洃绠�'; - }else { - pr2.Level_Category__c = null; } - } - if (prl1Map.containsKey(pr2.Id)) { + }else if (prl1Map.containsKey(pr2.Id)) { if (prl1Map.get(pr2.Id).contains('涓�绫�')) { pr2.Level_Category__c = '涓�绫�'; }else if (prl1Map.get(pr2.Id).contains('浜岀被') && !prl1Map.get(pr2.Id).contains('涓�绫�')) { pr2.Level_Category__c = '浜岀被'; - }else if (prl1Map.get(pr2.Id).contains('闈炵洃绠�') && !prl2Map.containsKey(pr2.Id)) { - pr2.Level_Category__c = '闈炵洃绠�'; - }else { - pr2.Level_Category__c = null; } + }else if (prl2Map.containsKey(pr2.Id)) { + pr2.Level_Category__c = '闈炵洃绠�'; } if (pr2.demoteer_Sap__c == null || pr2.Diedatvanink__c == null) { pr2.Level_Category__c = null; -- Gitblit v1.9.1