From 3d312e60e65de7bd0194c50ae26d11c7a4d4fc73 Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期二, 09 五月 2023 17:59:59 +0800
Subject: [PATCH] review update
---
force-app/main/default/classes/MonthlyReportController.cls | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/force-app/main/default/classes/MonthlyReportController.cls b/force-app/main/default/classes/MonthlyReportController.cls
index 3822866..e1d3f65 100644
--- a/force-app/main/default/classes/MonthlyReportController.cls
+++ b/force-app/main/default/classes/MonthlyReportController.cls
@@ -5,7 +5,8 @@
InitData res = new initData();
try{
Monthly_Report__c report = [SELECT OwnerId,Id,Next_week_plan__c FROM Monthly_Report__c WHERE Id = :recordId LIMIT 1];
- res.OwnerId = report.OwnerId;
+ res.ownerId = report.OwnerId;
+ res.userId = UserInfo.getUserId();
res.Id = report.Id;
res.nextWeekPlan = report.Next_week_plan__c;
System.debug(LoggingLevel.INFO, '*** res: ' + res);
@@ -51,7 +52,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 +60,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);
}
-
}
@@ -72,7 +74,7 @@
@AuraEnabled
public String Id;
@AuraEnabled
- public String OwnerId;
+ public String ownerId;
@AuraEnabled
public String ownerEmail;
@AuraEnabled
@@ -91,5 +93,7 @@
public String drSumUrl;
@AuraEnabled
public String userEmail;
+ @AuraEnabled
+ public String userId;
}
}
\ No newline at end of file
--
Gitblit v1.9.1