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/ReportController.cls | 39 ++++++++++++++++++++++++++++++++++++---
1 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/force-app/main/default/classes/ReportController.cls b/force-app/main/default/classes/ReportController.cls
index 790ccbc..d75f918 100644
--- a/force-app/main/default/classes/ReportController.cls
+++ b/force-app/main/default/classes/ReportController.cls
@@ -10,6 +10,10 @@
Report__c report = [select Status__c from Report__c where Id = :recordId];
res.status = report.Status__c;
res.profileId = UserInfo.getProfileId();
+ res.userId = UserInfo.getUserId();
+ res.luShengId = getUserIdByName(LightingButtonConstant.LU_SHENG_NAME);
+ res.huDiAnId = getUserIdByName(LightingButtonConstant.HU_DI_AN_NAME);
+ res.systemProfileId = getProfileIdByName(LightingButtonConstant.SYSTEM_PROFILE_NAME);
System.debug(LoggingLevel.INFO, '*** res: ' + res);
} catch (Exception e) {
System.debug(LoggingLevel.INFO, '*** e: ' + e);
@@ -26,6 +30,10 @@
res.isVOC = report.IsVOC__c;
res.personId = report.Responsible_Person__r.Id;
res.profileId = UserInfo.getProfileId();
+ res.userId = UserInfo.getUserId();
+ res.luShengId = getUserIdByName(LightingButtonConstant.LU_SHENG_NAME);
+ res.huDiAnId = getUserIdByName(LightingButtonConstant.HU_DI_AN_NAME);
+ res.systemProfileId = getProfileIdByName(LightingButtonConstant.SYSTEM_PROFILE_NAME);
System.debug(LoggingLevel.INFO, '*** res: ' + res);
} catch (Exception e) {
System.debug(LoggingLevel.INFO, '*** e: ' + e);
@@ -218,10 +226,10 @@
//缁欐彁浜ょ浉搴旂殑js鎻愪緵鍒濆鍖栨暟鎹�
@AuraEnabled
- public static String updateForSubmitButton(String reocrdId){
+ public static String updateForSubmitButton(String recordId){
try {
Report__c rac = new Report__c();
- rac.Id = reocrdId;
+ rac.Id = recordId;
rac.Status__c = LightingButtonConstant.RECORD_TYPE_NAME_BY_SUBMIT;
rac.Submit_time__c = Datetime.now();
rac.Submit_report_day__c = Date.today();
@@ -539,6 +547,26 @@
return eMessage.substring(left,right);
}
}
+ @AuraEnabled
+ public static string getUserIdByName(String name){
+ User user = null;
+ try {
+ user = [select Id from User where Name =:name];
+ } catch (Exception e) {
+ throw new AuraHandledException(e.getMessage());
+ }
+ return user.Id;
+ }
+ @AuraEnabled
+ public static string getProfileIdByName(String name){
+ Profile profile = null;
+ try {
+ profile = [select Id from Profile where Name =:name];
+ } catch (Exception e) {
+ throw new AuraHandledException(e.getMessage());
+ }
+ return profile.Id;
+ }
public class InitData{
@AuraEnabled
public String status;
@@ -576,7 +604,12 @@
public String DeveloperName;
@AuraEnabled
public String userId;
-
+ @AuraEnabled
+ public String luShengId;
+ @AuraEnabled
+ public String huDiAnId;
+ @AuraEnabled
+ public String systemProfileId;
--
Gitblit v1.9.1