From 2b6adf750ca9ae5d0094029b25ba474635558109 Mon Sep 17 00:00:00 2001
From: 游畅 <youchang@prec-tech.com>
Date: 星期二, 29 三月 2022 17:30:38 +0800
Subject: [PATCH] opd计划提交审批报错

---
 force-app/main/default/classes/OPDPlanHandler.cls |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/force-app/main/default/classes/OPDPlanHandler.cls b/force-app/main/default/classes/OPDPlanHandler.cls
index 623c89a..7b036ff 100644
--- a/force-app/main/default/classes/OPDPlanHandler.cls
+++ b/force-app/main/default/classes/OPDPlanHandler.cls
@@ -174,7 +174,7 @@
                             nobj.SkipValidationRulesAndWorkflows__c = true;//璺宠繃楠岃瘉瑙勫垯鎴栧伐浣滄祦
                             nObj.supplementaryApplication__c = true;
                             nobj.originalOpdRentalApply__c = originalOpdPlanApplication.Rental_Apply2__c;
-                            nobj.originalOpdRentalApplyName__c = originalOpdPlanApplication.Rental_Apply2__r.Name;
+                            //nobj.originalOpdRentalApplyName__c = originalOpdPlanApplication.Rental_Apply2__r.Name;
                             if (nObj.Account_Laboratory__c != originalOpdPlanApplication.Account_Laboratory__c) {
                                 nObj.Account_Laboratory__c.addError('琛ュ厖鐢宠鐨凮PD璁″垝,涓嶅彲淇敼绉戝鐨勫��');
 
@@ -865,6 +865,7 @@
 
                     from Account_Number_of_target__c
                     where id in :OpdTargetAcc.values()]);//鏌ヨ鐩爣瀹㈡埛 鏈储骞寸殑 
+            system.debug('==鏈储骞�' + acctarList.size());
             Map<id, Account_Number_of_target__c> acctarlastList = new Map<id, Account_Number_of_target__c>([select id,
                     OPD_amount_290MiroBF__c,
                     OPD_amount_290MiroGI__c,
@@ -924,7 +925,7 @@
                     OPDPlan__c opdplan = new OPDPlan__c();
                     for (String opd : OpdPlanDetail) {
                         opdplan.id = t.id;
-                        if(acctarList !=null){
+                        if(acctarList !=null && acctarList.size() >0){
                         if (column != null) {
                             for (Integer i = 0; i < column.size(); i++) { //鏄惁浜у搧OPD鐩爣瀹㈡埛
                                 List<String>  titleAccout = tempImportantProduct.get(column[i]);
@@ -1041,7 +1042,7 @@
                             for (Integer i = 0; i < columnOPDAmount.size(); i++) { //鏈湡OPD娆℃暟
                                 String  titleAccout5 = tempImportantOPDAmount.get(columnOPDAmount[i]);
                                 if (opd == titleAccout5) {
-                                    if(acctarList !=null){
+                                    if(acctarList !=null && acctarList.size()>0){
                                         if (acctarList.containskey(opdct) && acctarList.get(opdct).get(columnOPDAmount[i]) != null && acctarList.get(opdct).get(columnOPDAmount[i]) != 0) {
                                             system.debug('=columnOPDAmount[i]==' + columnOPDAmount[i] + '=鏈湡OPD娆℃暟=' + acctarList.get(opdct).get(columnOPDAmount[i]));
                                             Decimal aa = acctarList.get(opdct).get(columnOPDAmount[i]) == null ? 0 : Decimal.valueOf(String.valueOf(acctarList.get(opdct).get(columnOPDAmount[i])));
@@ -1058,7 +1059,7 @@
                                             }
                                         }
                                     }
-                                    if(acctarlastList !=null){
+                                    if(acctarlastList !=null && acctarlastList.size()>0){
                                         if (acctarlastList.containskey(opdla) && acctarlastList.get(opdla).get(columnOPDAmount[i]) != null && acctarlastList.get(opdla).get(columnOPDAmount[i]) != 0) {
                                             system.debug('=columnOPDAmount[i]==' + columnOPDAmount[i] + '=涓婃湡OPD娆℃暟=' + acctarlastList.get(opdla).get(columnOPDAmount[i]));
                                             Decimal bb = acctarlastList.get(opdla).get(columnOPDAmount[i]) == null ? 0 : Decimal.valueOf(String.valueOf(acctarlastList.get(opdla).get(columnOPDAmount[i])));

--
Gitblit v1.9.1