| | |
| | | public with sharing class AddSubmitApprovalProcessController { |
| | | public AddSubmitApprovalProcessController() { |
| | | |
| | | } |
| | | |
| | | @AuraEnabled |
| | | public static InitData init(String recordId){ |
| | |
| | | res.applyUserId = ra.applyUser__r.Id; |
| | | res.ownerId = ra.OwnerId; |
| | | res.rentalApplyStatus = ra.Status__c; |
| | | res.demoRequestPastDataId = Schema.SObjectType.Rental_Apply__c.getRecordTypeInfosByName().get(LightingButtonConstant.RECORD_TYPE_NAME_BY_PastData).getRecordTypeId(); |
| | | |
| | | List<Rental_Apply_Equipment_Set_Detail__c> raeSet = [SELECT Id from Rental_Apply_Equipment_Set_Detail__c WHERE Rental_Apply__c = :recordId AND Draft_Appended__c=1]; |
| | | res.detailSize = raeSet.size(); |
| | | res.addApprovalStatus = '草案中'; |
| | | res.detailSize = 1; |
| | | } |
| | | catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '****e:' + e); |
| | |
| | | } |
| | | |
| | | |
| | | public Class InitData{ |
| | | //提交审批 |
| | | @AuraEnabled |
| | | public static String submitApproval(String recordId){ |
| | | Savepoint sp = Database.setSavepoint(); |
| | | try { |
| | | Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest(); |
| | | req1.setObjectId(recordId); |
| | | Approval.ProcessResult submitResult = Approval.process(req1); |
| | | return 'OK'; |
| | | } |
| | | catch (Exception e) { |
| | | Database.rollback(sp); |
| | | return e.getMessage(); |
| | | } |
| | | } |
| | | |
| | | |
| | | private class InitData{ |
| | | @AuraEnabled |
| | | public String rentalApplyId; //备品借出申请Id |
| | | @AuraEnabled |
| | |
| | | public String ownerId; //备品借出申请.所有人Id |
| | | @AuraEnabled |
| | | public String rentalApplyStatus; //备品借出申请.状态 |
| | | @AuraEnabled |
| | | public String demoRequestPastDataId; //备品申请 过去历史转移Id |
| | | } |
| | | } |