From fd9df05c48c09b4d7f39a3b401882bda226dedea Mon Sep 17 00:00:00 2001
From: 19626 <1962676589@qq.com>
Date: 星期二, 31 十月 2023 20:38:18 +0800
Subject: [PATCH] 近期修改
---
force-app/main/default/classes/lexSolutionProjectRequirementsController.cls | 75 +++++++++++++++++++++++++++++++------
1 files changed, 63 insertions(+), 12 deletions(-)
diff --git a/force-app/main/default/classes/lexSolutionProjectRequirementsController.cls b/force-app/main/default/classes/lexSolutionProjectRequirementsController.cls
index 0b4b579..529c935 100644
--- a/force-app/main/default/classes/lexSolutionProjectRequirementsController.cls
+++ b/force-app/main/default/classes/lexSolutionProjectRequirementsController.cls
@@ -1,24 +1,47 @@
public with sharing class lexSolutionProjectRequirementsController {
@AuraEnabled
- public static InitData initSubmitSolutionForApprovalButton(String recordId){
+ public static Map<String,Object> initSubmitSolutionForApprovalButton(String recordId){
InitData res = new InitData();
+ Map<String,Object> maps = new Map<String,Object>();
try {
SolutionProjectRequirements__c so = [
select
Status__c,
Submit_Date_YouWant__c,
CreatedDate,
- Department_Class__r.Id,
+ Department_Class__c,
Product_Leader__c
from SolutionProjectRequirements__c where Id =: recordId
];
res.status = so.Status__c;
res.submitDateYouWant = so.Submit_Date_YouWant__c;
res.createdDate = so.CreatedDate;
- res.departmentClassId = so.Department_Class__r.Id;
+ res.departmentClassId = so.Department_Class__c;
res.productLeader = so.Product_Leader__c;
+ res.userId = UserInfo.getUserId();
+ res.userName = [select Name from User where Id =: res.userId].Name;
+ maps.put('res', res);
} catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
+ String message = e.getMessage();
+ maps.put('error', message);
+ return maps;
+ }
+ return maps;
+ }
+ @AuraEnabled
+ public static InitData initForApplyAgainButton(String recordId){
+ InitData res = new InitData();
+ try {
+ SolutionProjectRequirements__c so = [
+ select
+ Department_Class__c,
+ Hospital__c
+ from SolutionProjectRequirements__c where Id =: recordId
+ ];
+ res.hospital = so.Hospital__c;
+ res.departmentClass = so.Department_Class__c;
+ } catch (Exception e) {
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
}
return res;
}
@@ -34,9 +57,9 @@
];
res.status = so.Status__c;
res.profileId = UserInfo.getProfileId();
- res.m2ProfileId = lexLightingButtonConstant.M2_PROFILE_NAME;
+ res.m2ProfileId = [select Id from Profile where Name =: lexLightingButtonConstant.M2_PROFILE_NAME].Id;
} catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
}
return res;
}
@@ -53,7 +76,18 @@
update so;
return '';
} catch (Exception e) {
- 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();
+ }
}
}
@AuraEnabled
@@ -65,7 +99,18 @@
update so;
return '';
} catch (Exception e) {
- 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();
+ }
}
}
@@ -81,7 +126,7 @@
];
} catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
}
return accList;
}
@@ -97,7 +142,7 @@
from Solution_Programme__c where SolutionProjectRequirements__c =: recordId and Scheme_Type__c = '缁撴'
];
} catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
}
return so;
}
@@ -110,11 +155,11 @@
select id,name from solutionClosingAttachment__c where Solution_Programme__c =: solprogrammeId
];
} catch (Exception e) {
- throw new AuraHandledException(e.getMessage());
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
}
return so;
}
- class InitData{
+ public class InitData{
@AuraEnabled
public String status;
@AuraEnabled
@@ -133,5 +178,11 @@
public String profileId;
@AuraEnabled
public String m2ProfileId;
+ @AuraEnabled
+ public String oldProjectNo;
+ @AuraEnabled
+ public String departmentClass;
+ @AuraEnabled
+ public String hospital;
}
}
\ No newline at end of file
--
Gitblit v1.9.1