| | |
| | | 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; |
| | |
| | | //授权申请的提交按钮 |
| | | @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,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.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; |
| | | return '1'; |
| | | messageText = '1'; |
| | | return messageText; |
| | | } catch (Exception ex) { |
| | | System.debug(LoggingLevel.INFO, '*** xu: ' + ex); |
| | | return ex.getMessage(); |
| | | // return ex.getMessage().split(',')[1]; |
| | | } finally { |
| | | |
| | | 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 = '草案中'; |
| | | report.RecordTypeId = '01210000000RNXi'; |
| | | 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; |
| | | return '1'; |
| | | messageText = '1'; |
| | | return messageText; |
| | | } catch (Exception ex) { |
| | | System.debug(LoggingLevel.INFO, '*** cancelXu: ' + ex); |
| | | return ex.getMessage(); |
| | | } finally { |
| | | |
| | | messageText = ex.getMessage(); |
| | | return messageText; |
| | | } |
| | | } |
| | | |
| | | //获取当前登录人的 id |
| | | @AuraEnabled |
| | | public static UserResult UserInfo_Owner() { |
| | | public static UserResult userInfo_Owner() { |
| | | UserResult result = new UserResult(); |
| | | ID myUserID = UserInfo.getUserId(); |
| | | |
| | | try { |
| | | User tempUser = |
| | | [select id from user where id = : myUserID ]; |
| | | User tempUser = [select id from user where id = : myUserID ]; |
| | | result.id = tempUser.id; |
| | | } catch (exception e) { |
| | | |
| | | result.result = e.getMessage(); |
| | | } |
| | | return result; |
| | |
| | | } |
| | | @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; |
| | | } |