From 87861ae5f1ed5456685f97f8a8e7625e47b9576d Mon Sep 17 00:00:00 2001
From: KKbes <1620284052@qq.com>
Date: 星期四, 13 四月 2023 11:12:26 +0800
Subject: [PATCH] Merge branch 'LEX_dev' of http://47.92.229.245:8089/r/lightningupdate into LEX_dev
---
force-app/main/default/classes/ApplicationButtonController.cls | 85 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 85 insertions(+), 0 deletions(-)
diff --git a/force-app/main/default/classes/ApplicationButtonController.cls b/force-app/main/default/classes/ApplicationButtonController.cls
new file mode 100644
index 0000000..9910696
--- /dev/null
+++ b/force-app/main/default/classes/ApplicationButtonController.cls
@@ -0,0 +1,85 @@
+public class OppSubmitController {
+ @AuraEnabled
+ public static InitData initSubmitButton (String recordId){
+ InitData res = new initData();
+ try{
+ Request_tedner_doc__c report = [SELECT OwnerId,Id FROM Request_tedner_doc__c WHERE Id = :recordId LIMIT 1];
+ res.OwnerId = report.OwnerId;
+ res.Id = report.Id;
+ System.debug(LoggingLevel.INFO, '*** res: ' + res);
+ }catch(Exception e){
+ System.debug(LoggingLevel.INFO, '*** e: ' + e);
+ }
+ return res;
+ }
+
+ //鎺堟潈鐢宠鐨勬彁浜ゆ寜閽�
+ @AuraEnabled
+ public static String submit(String recordId) {
+ String messageText = '';
+ try {
+ Request_tedner_doc__c rac = [SELECT Id,Status__c,Submit_check_flag__c,RecordTypeId,Submit_time__c FROM Request_tedner_doc__c WHERE Id = :recordId LIMIT 1];
+ rac.Status__c = LightingButtonConstant.STATUS_Application_Submitted;
+ rac.RecordTypeId = rac.RecordTypeId = Schema.SObjectType.Request_tedner_doc__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_Application + LightingButtonConstant.STATUS_Application_Submitted).getRecordTypeId();
+ rac.Submit_check_flag__c = true;
+ rac.Submit_time__c = Datetime.now();
+ update rac;
+ messageText = '1';
+ return messageText;
+ } catch (Exception ex) {
+ System.debug(LoggingLevel.INFO, '*** xu: ' + ex);
+ messageText = ex.getMessage();
+ return messageText;
+ }
+ }
+
+ //鎺堟潈鐢宠鐨勫彇娑堟彁浜ゆ寜閽�
+ @AuraEnabled
+ public static String submitCancel(String recordId) {
+ String messageText = '';
+ try {
+ Request_tedner_doc__c report = [SELECT Id,Status__c,Submit_check_flag__c,RecordTypeId,Submit_time__c FROM Request_tedner_doc__c WHERE Id = :recordId LIMIT 1];
+ report.Status__c = LightingButtonConstant.STATUS_Application_CancelSubmit;
+ report.RecordTypeId = Schema.SObjectType.Request_tedner_doc__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_Application).getRecordTypeId();
+ report.Submit_check_flag__c = false;
+ report.Submit_time__c = null;
+ update report;
+ messageText = '1';
+ return messageText;
+ } catch (Exception ex) {
+ System.debug(LoggingLevel.INFO, '*** cancelXu: ' + ex);
+ messageText = ex.getMessage();
+ return messageText;
+ }
+ }
+
+ //鑾峰彇褰撳墠鐧诲綍浜虹殑 id
+ @AuraEnabled
+ public static UserResult userInfo_Owner() {
+ UserResult result = new UserResult();
+ ID myUserID = UserInfo.getUserId();
+ try {
+ User tempUser = [select id from user where id = : myUserID ];
+ result.id = tempUser.id;
+ } catch (exception e) {
+ result.result = e.getMessage();
+ }
+ return result;
+ }
+
+ public class InitData{
+ @AuraEnabled
+ public String Id;
+ @AuraEnabled
+ public String OwnerId;
+ }
+ public class UserResult {
+ @AuraEnabled
+ public string result;
+ public UserResult( ) {
+ result = 'Success';
+ }
+ @AuraEnabled
+ public string id;
+ }
+}
\ No newline at end of file
--
Gitblit v1.9.1