From 74e6a383570060d05c58f731fa7cd9f241db50bd Mon Sep 17 00:00:00 2001
From: twysparks <twysparks@163.com>
Date: 星期四, 20 四月 2023 14:07:42 +0800
Subject: [PATCH] Merge branch 'LEX_dev' of http://47.92.229.245:8089/r/lightningupdate into LEX_dev

---
 force-app/main/default/classes/MonthlyReportController.cls |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/force-app/main/default/classes/MonthlyReportController.cls b/force-app/main/default/classes/MonthlyReportController.cls
index 3822866..1448292 100644
--- a/force-app/main/default/classes/MonthlyReportController.cls
+++ b/force-app/main/default/classes/MonthlyReportController.cls
@@ -51,7 +51,7 @@
     }
     //鍙栨秷鎻愪氦鎿嶄綔鏇存柊鐩稿簲鏁版嵁
     @AuraEnabled
-    public static void cancel(String recordId) {
+    public static String cancel(String recordId) {
        try {
         Monthly_Report__c report = [SELECT 	Id,Status__c,Submit_check_flag__c,RecordTypeId,Submit_time__c FROM Monthly_Report__c WHERE Id = :recordId LIMIT 1];
         report.Status__c = LightingButtonConstant.STATUS_DRAFT;
@@ -59,12 +59,13 @@
         report.Submit_check_flag__c = false;
         report.Submit_time__c = null;
         update report;
+        return null;
        } catch (Exception e) {
-        System.debug(LoggingLevel.INFO, '*** e: ' + e);
-       } finally {
-
+        String eMessage = e.getMessage();
+        Integer left = eMessage.indexOf(',') + 1;
+        Integer right = eMessage.length();
+        return eMessage.substring(left,right);
        }
-
     }
 
 

--
Gitblit v1.9.1