From 1727a4f4d02e429475608e60f142a63bc24127bc Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期一, 23 十月 2023 10:07:34 +0800
Subject: [PATCH] 近期修改
---
force-app/main/default/classes/ReportController.cls | 367 +++++++++++++++++++++++++++-------------------------
1 files changed, 190 insertions(+), 177 deletions(-)
diff --git a/force-app/main/default/classes/ReportController.cls b/force-app/main/default/classes/ReportController.cls
index 8535a6b..fc6ccde 100644
--- a/force-app/main/default/classes/ReportController.cls
+++ b/force-app/main/default/classes/ReportController.cls
@@ -17,7 +17,7 @@
res.recordTypeId1 = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_SIS_ENG).getRecordTypeId();
res.recordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_SIS_ET).getRecordTypeId();
} catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
}
return res;
}
@@ -36,7 +36,7 @@
res.opdPlan = rent.OPDPlan__c;
res.recordTypeId = Schema.SObjectType.Report__c.getRecordTypeInfosByName().get(lexLightingButtonConstant.RECORD_TYPE_NAME_BY_OPD).getRecordTypeId();
} catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
}
return res;
}
@@ -257,7 +257,7 @@
try {
res = new InitData();
} catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
}
return res;
}
@@ -276,7 +276,7 @@
res.datec = re.Date__c;
res.practitioner1 = re.Practitioner1__c;
} catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
}
return res;
}
@@ -293,18 +293,19 @@
update rac;
return null;
} catch (Exception e) {
- if (e.getMessage().contains(',')) {
- System.debug(LoggingLevel.INFO, '*** e: ' + e);
- String exc = '' + e.getMessage();
- Integer left = exc.indexOf(':') + 1;
- Integer right = exc.lastIndexOf(':');
- String str = exc.substring(left,right);
- left = str.indexOf(',') + 1;
- String newStr = str.substring(left);
- return newStr;
- }else {
- return e.getMessage();
- }
+ // if (e.getMessage().contains(',')) {
+ // System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ // String exc = '' + e.getMessage();
+ // Integer left = exc.indexOf(':') + 1;
+ // Integer right = exc.lastIndexOf(':');
+ // String str = exc.substring(left,right);
+ // left = str.indexOf(',') + 1;
+ // String newStr = str.substring(left);
+ // return newStr;
+ // }else {
+ // return e.getMessage();
+ // }
+ return e.getDmlMessage(0);
}
}
//OPDtoSIS鎿嶄綔鏇存柊鐩稿簲鏁版嵁
@@ -317,18 +318,19 @@
update rac;
return null;
} catch (Exception e) {
- if (e.getMessage().contains(',')) {
- System.debug(LoggingLevel.INFO, '*** e: ' + e);
- String exc = '' + e.getMessage();
- Integer left = exc.indexOf(':') + 1;
- Integer right = exc.lastIndexOf(':');
- String str = exc.substring(left,right);
- left = str.indexOf(',') + 1;
- String newStr = str.substring(left);
- return newStr;
- }else {
- return e.getMessage();
- }
+ // if (e.getMessage().contains(',')) {
+ // System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ // String exc = '' + e.getMessage();
+ // Integer left = exc.indexOf(':') + 1;
+ // Integer right = exc.lastIndexOf(':');
+ // String str = exc.substring(left,right);
+ // left = str.indexOf(',') + 1;
+ // String newStr = str.substring(left);
+ // return newStr;
+ // }else {
+ // return e.getMessage();
+ // }
+ return e.getDmlMessage(0);
}
}
@@ -344,18 +346,19 @@
update rac;
return null;
} catch (Exception e) {
- if (e.getMessage().contains(',')) {
- System.debug(LoggingLevel.INFO, '*** e: ' + e);
- String exc = '' + e.getMessage();
- Integer left = exc.indexOf(':') + 1;
- Integer right = exc.lastIndexOf(':');
- String str = exc.substring(left,right);
- left = str.indexOf(',') + 1;
- String newStr = str.substring(left);
- return newStr;
- }else {
- return e.getMessage();
- }
+ // if (e.getMessage().contains(',')) {
+ // System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ // String exc = '' + e.getMessage();
+ // Integer left = exc.indexOf(':') + 1;
+ // Integer right = exc.lastIndexOf(':');
+ // String str = exc.substring(left,right);
+ // left = str.indexOf(',') + 1;
+ // String newStr = str.substring(left);
+ // return newStr;
+ // }else {
+ // return e.getMessage();
+ // }
+ return e.getDmlMessage(0);
}
}
//瀹屾瘯鎿嶄綔鏇存柊鐩稿簲鏁版嵁
@@ -369,18 +372,19 @@
update rac;
return null;
} catch (Exception e) {
- if (e.getMessage().contains(',')) {
- System.debug(LoggingLevel.INFO, '*** e: ' + e);
- String exc = '' + e.getMessage();
- Integer left = exc.indexOf(':') + 1;
- Integer right = exc.lastIndexOf(':');
- String str = exc.substring(left,right);
- left = str.indexOf(',') + 1;
- String newStr = str.substring(left);
- return newStr;
- }else {
- return e.getMessage();
- }
+ // if (e.getMessage().contains(',')) {
+ // System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ // String exc = '' + e.getMessage();
+ // Integer left = exc.indexOf(':') + 1;
+ // Integer right = exc.lastIndexOf(':');
+ // String str = exc.substring(left,right);
+ // left = str.indexOf(',') + 1;
+ // String newStr = str.substring(left);
+ // return newStr;
+ // }else {
+ // return e.getMessage();
+ // }
+ return e.getDmlMessage(0);
}
}
//OCSM瑕佹姤鍛婃搷浣滄洿鏂扮浉搴旀暟鎹�
@@ -393,18 +397,19 @@
update rac;
return null;
} catch (Exception e) {
- if (e.getMessage().contains(',')) {
- System.debug(LoggingLevel.INFO, '*** e: ' + e);
- String exc = '' + e.getMessage();
- Integer left = exc.indexOf(':') + 1;
- Integer right = exc.lastIndexOf(':');
- String str = exc.substring(left,right);
- left = str.indexOf(',') + 1;
- String newStr = str.substring(left);
- return newStr;
- }else {
- return e.getMessage();
- }
+ // if (e.getMessage().contains(',')) {
+ // System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ // String exc = '' + e.getMessage();
+ // Integer left = exc.indexOf(':') + 1;
+ // Integer right = exc.lastIndexOf(':');
+ // String str = exc.substring(left,right);
+ // left = str.indexOf(',') + 1;
+ // String newStr = str.substring(left);
+ // return newStr;
+ // }else {
+ // return e.getMessage();
+ // }
+ return e.getDmlMessage(0);
}
}
@@ -418,18 +423,19 @@
update rac;
return null;
} catch (Exception e) {
- if (e.getMessage().contains(',')) {
- System.debug(LoggingLevel.INFO, '*** e: ' + e);
- String exc = '' + e.getMessage();
- Integer left = exc.indexOf(':') + 1;
- Integer right = exc.lastIndexOf(':');
- String str = exc.substring(left,right);
- left = str.indexOf(',') + 1;
- String newStr = str.substring(left);
- return newStr;
- }else {
- return e.getMessage();
- }
+ // if (e.getMessage().contains(',')) {
+ // System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ // String exc = '' + e.getMessage();
+ // Integer left = exc.indexOf(':') + 1;
+ // Integer right = exc.lastIndexOf(':');
+ // String str = exc.substring(left,right);
+ // left = str.indexOf(',') + 1;
+ // String newStr = str.substring(left);
+ // return newStr;
+ // }else {
+ // return e.getMessage();
+ // }
+ return e.getDmlMessage(0);
}
}
//DispatchOCSMQARA鎿嶄綔鏇存柊鐩稿簲鏁版嵁
@@ -442,18 +448,19 @@
update rac;
return null;
} catch (Exception e) {
- if (e.getMessage().contains(',')) {
- System.debug(LoggingLevel.INFO, '*** e: ' + e);
- String exc = '' + e.getMessage();
- Integer left = exc.indexOf(':') + 1;
- Integer right = exc.lastIndexOf(':');
- String str = exc.substring(left,right);
- left = str.indexOf(',') + 1;
- String newStr = str.substring(left);
- return newStr;
- }else {
- return e.getMessage();
- }
+ // if (e.getMessage().contains(',')) {
+ // System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ // String exc = '' + e.getMessage();
+ // Integer left = exc.indexOf(':') + 1;
+ // Integer right = exc.lastIndexOf(':');
+ // String str = exc.substring(left,right);
+ // left = str.indexOf(',') + 1;
+ // String newStr = str.substring(left);
+ // return newStr;
+ // }else {
+ // return e.getMessage();
+ // }
+ return e.getDmlMessage(0);
}
}
//OCSM涓嶈鎶ュ憡鎿嶄綔鏇存柊鐩稿簲鏁版嵁
@@ -466,18 +473,19 @@
update rac;
return null;
} catch (Exception e) {
- if (e.getMessage().contains(',')) {
- System.debug(LoggingLevel.INFO, '*** e: ' + e);
- String exc = '' + e.getMessage();
- Integer left = exc.indexOf(':') + 1;
- Integer right = exc.lastIndexOf(':');
- String str = exc.substring(left,right);
- left = str.indexOf(',') + 1;
- String newStr = str.substring(left);
- return newStr;
- }else {
- return e.getMessage();
- }
+ // if (e.getMessage().contains(',')) {
+ // System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ // String exc = '' + e.getMessage();
+ // Integer left = exc.indexOf(':') + 1;
+ // Integer right = exc.lastIndexOf(':');
+ // String str = exc.substring(left,right);
+ // left = str.indexOf(',') + 1;
+ // String newStr = str.substring(left);
+ // return newStr;
+ // }else {
+ // return e.getMessage();
+ // }
+ return e.getDmlMessage(0);
}
}
@@ -491,18 +499,19 @@
update rac;
return null;
} catch (Exception e) {
- if (e.getMessage().contains(',')) {
- System.debug(LoggingLevel.INFO, '*** e: ' + e);
- String exc = '' + e.getMessage();
- Integer left = exc.indexOf(':') + 1;
- Integer right = exc.lastIndexOf(':');
- String str = exc.substring(left,right);
- left = str.indexOf(',') + 1;
- String newStr = str.substring(left);
- return newStr;
- }else {
- return e.getMessage();
- }
+ // if (e.getMessage().contains(',')) {
+ // System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ // String exc = '' + e.getMessage();
+ // Integer left = exc.indexOf(':') + 1;
+ // Integer right = exc.lastIndexOf(':');
+ // String str = exc.substring(left,right);
+ // left = str.indexOf(',') + 1;
+ // String newStr = str.substring(left);
+ // return newStr;
+ // }else {
+ // return e.getMessage();
+ // }
+ return e.getDmlMessage(0);
}
}
@@ -536,18 +545,19 @@
update rac;
return null;
} catch (Exception e) {
- if (e.getMessage().contains(',')) {
- System.debug(LoggingLevel.INFO, '*** e: ' + e);
- String exc = '' + e.getMessage();
- Integer left = exc.indexOf(':') + 1;
- Integer right = exc.lastIndexOf(':');
- String str = exc.substring(left,right);
- left = str.indexOf(',') + 1;
- String newStr = str.substring(left);
- return newStr;
- }else {
- return e.getMessage();
- }
+ // if (e.getMessage().contains(',')) {
+ // System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ // String exc = '' + e.getMessage();
+ // Integer left = exc.indexOf(':') + 1;
+ // Integer right = exc.lastIndexOf(':');
+ // String str = exc.substring(left,right);
+ // left = str.indexOf(',') + 1;
+ // String newStr = str.substring(left);
+ // return newStr;
+ // }else {
+ // return e.getMessage();
+ // }
+ return e.getDmlMessage(0);
}
}
@@ -561,18 +571,19 @@
update rac;
return null;
} catch (Exception e) {
- if (e.getMessage().contains(',')) {
- System.debug(LoggingLevel.INFO, '*** e: ' + e);
- String exc = '' + e.getMessage();
- Integer left = exc.indexOf(':') + 1;
- Integer right = exc.lastIndexOf(':');
- String str = exc.substring(left,right);
- left = str.indexOf(',') + 1;
- String newStr = str.substring(left);
- return newStr;
- }else {
- return e.getMessage();
- }
+ // if (e.getMessage().contains(',')) {
+ // System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ // String exc = '' + e.getMessage();
+ // Integer left = exc.indexOf(':') + 1;
+ // Integer right = exc.lastIndexOf(':');
+ // String str = exc.substring(left,right);
+ // left = str.indexOf(',') + 1;
+ // String newStr = str.substring(left);
+ // return newStr;
+ // }else {
+ // return e.getMessage();
+ // }
+ return e.getDmlMessage(0);
}
}
@@ -589,18 +600,19 @@
update rac;
return null;
} catch (Exception e) {
- if (e.getMessage().contains(',')) {
- System.debug(LoggingLevel.INFO, '*** e: ' + e);
- String exc = '' + e.getMessage();
- Integer left = exc.indexOf(':') + 1;
- Integer right = exc.lastIndexOf(':');
- String str = exc.substring(left,right);
- left = str.indexOf(',') + 1;
- String newStr = str.substring(left);
- return newStr;
- }else {
- return e.getMessage();
- }
+ // if (e.getMessage().contains(',')) {
+ // System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ // String exc = '' + e.getMessage();
+ // Integer left = exc.indexOf(':') + 1;
+ // Integer right = exc.lastIndexOf(':');
+ // String str = exc.substring(left,right);
+ // left = str.indexOf(',') + 1;
+ // String newStr = str.substring(left);
+ // return newStr;
+ // }else {
+ // return e.getMessage();
+ // }
+ return e.getDmlMessage(0);
}
}
//VOC鍥炵瓟鏇存柊鐩稿簲鏁版嵁
@@ -649,18 +661,19 @@
update rac;
return null;
} catch (Exception e) {
- if (e.getMessage().contains(',')) {
- System.debug(LoggingLevel.INFO, '*** e: ' + e);
- String exc = '' + e.getMessage();
- Integer left = exc.indexOf(':') + 1;
- Integer right = exc.lastIndexOf(':');
- String str = exc.substring(left,right);
- left = str.indexOf(',') + 1;
- String newStr = str.substring(left);
- return newStr;
- }else {
- return e.getMessage();
- }
+ // if (e.getMessage().contains(',')) {
+ // System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ // String exc = '' + e.getMessage();
+ // Integer left = exc.indexOf(':') + 1;
+ // Integer right = exc.lastIndexOf(':');
+ // String str = exc.substring(left,right);
+ // left = str.indexOf(',') + 1;
+ // String newStr = str.substring(left);
+ // return newStr;
+ // }else {
+ // return e.getMessage();
+ // }
+ return e.getDmlMessage(0);
}
}
//VOC鍒ゅ畾鏇存柊鐩稿簲鏁版嵁
@@ -709,9 +722,7 @@
}
return null;
} catch (Exception e) {
- System.debug(LoggingLevel.INFO, '*** e: ' + e);
- String exc = e.getMessage();
- return exc;
+ return e.getDmlMessage(0);
}
}
//VOC瀹屾瘯鎿嶄綔鏇存柊鐩稿簲鏁版嵁
@@ -723,18 +734,19 @@
update report;
return null;
} catch (Exception e) {
- if (e.getMessage().contains(',')) {
- System.debug(LoggingLevel.INFO, '*** e: ' + e);
- String exc = '' + e.getMessage();
- Integer left = exc.indexOf(':') + 1;
- Integer right = exc.lastIndexOf(':');
- String str = exc.substring(left,right);
- left = str.indexOf(',') + 1;
- String newStr = str.substring(left);
- return newStr;
- }else {
- return e.getMessage();
- }
+ return e.getDmlMessage(0);
+ // if (e.getMessage().contains(',')) {
+ // System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ // String exc = '' + e.getMessage();
+ // Integer left = exc.indexOf(':') + 1;
+ // Integer right = exc.lastIndexOf(':');
+ // String str = exc.substring(left,right);
+ // left = str.indexOf(',') + 1;
+ // String newStr = str.substring(left);
+ // return newStr;
+ // }else {
+ // return e.getMessage();
+ // }
}
}
@AuraEnabled
@@ -743,7 +755,7 @@
try {
user = [select Id from User where Name =:name];
} catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
}
return user.Id;
}
@@ -753,10 +765,11 @@
try {
profile = [select Id from Profile where Name =:name];
} catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
}
return profile.Id;
}
+
public class InitData{
@AuraEnabled
public String status;
--
Gitblit v1.9.1