From 75915dc490276eff029702863493e4935dcc9c94 Mon Sep 17 00:00:00 2001
From: 黄千龙 <huangqianlong@prec-tech.com>
Date: 星期二, 04 四月 2023 14:46:22 +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 |   99 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 99 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..4dadb0d
--- /dev/null
+++ b/force-app/main/default/classes/ApplicationButtonController.cls
@@ -0,0 +1,99 @@
+public class OppSubmitController {
+    @AuraEnabled
+    public static InitData initSubmitButton (String recordId){
+        InitData res = new initData();
+        try{
+            // Request_tedner_doc__c report = [SELECT 	OwnerId,Id,Product_discription__c,Status__c FROM Request_tedner_doc__c WHERE Id = :recordId LIMIT 1];
+            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) {
+       try {
+        // Request_tedner_doc__c rac = [SELECT 	Id,Status__c,Submit_check_flag__c,RecordTypeId,Submit_time__c,Request_target__c,Document_format__c,Bid_distributor__c,Product_discription__c,Tedner_date__c,Tender_active_day__c,tender_inactive_date__c,Tender_request_reason__c FROM Request_tedner_doc__c WHERE Id = :recordId LIMIT 1];
+        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 = '宸叉彁浜�';
+        rac.RecordTypeId = '01210000000RNXn';
+        rac.Submit_check_flag__c = true;
+        rac.Submit_time__c = Datetime.now();
+        update rac;
+        return '1';
+       } catch (Exception ex) {
+        System.debug(LoggingLevel.INFO, '*** xu: ' + ex);
+        return ex.getMessage();
+        // return ex.getMessage().split(',')[1];
+       } finally {
+
+       }
+    }
+
+    //鎺堟潈鐢宠鐨勫彇娑堟彁浜ゆ寜閽�
+    @AuraEnabled
+    public static String submitCancel(String recordId) {
+       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 = '鑽夋涓�';
+        report.RecordTypeId = '01210000000RNXi';
+        report.Submit_check_flag__c = false;
+        report.Submit_time__c = null;
+        update report;
+        return '1';
+       } catch (Exception ex) {
+        System.debug(LoggingLevel.INFO, '*** cancelXu: ' + ex);
+        return ex.getMessage();
+       } finally {
+
+       }
+    }
+
+    //鑾峰彇褰撳墠鐧诲綍浜虹殑 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;
+        //20210105 CHAN-BWX3YU you end
+    }
+}
+
+    // if("{!Request_tedner_doc__c.OwnerId}" == "{!$User.Id}") {
+    //     var rac = new sforce.SObject("Request_tedner_doc__c");
+    //     rac.Id = "{!Request_tedner_doc__c.Id}";
+    //     rac.Status__c = "宸叉彁浜�";
+    //     rac.Submit_check_flag__c = "true";
+    //     rac.RecordTypeId = "01210000000RNXn";
+    //     var serverTimestamp = sforce.connection.getServerTimestamp();
+    //     rac.Submit_time__c = serverTimestamp.timestamp;
\ No newline at end of file

--
Gitblit v1.9.1