| | |
| | | Report__c report = [select Status__c from Report__c where Id = :recordId]; |
| | | res.status = report.Status__c; |
| | | res.profileId = UserInfo.getProfileId(); |
| | | res.userId = UserInfo.getUserId(); |
| | | res.luShengId = getUserIdByName(LightingButtonConstant.LU_SHENG_NAME); |
| | | res.huDiAnId = getUserIdByName(LightingButtonConstant.HU_DI_AN_NAME); |
| | | res.systemProfileId = getProfileIdByName(LightingButtonConstant.SYSTEM_PROFILE_NAME); |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | } catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | |
| | | res.isVOC = report.IsVOC__c; |
| | | res.personId = report.Responsible_Person__r.Id; |
| | | res.profileId = UserInfo.getProfileId(); |
| | | res.userId = UserInfo.getUserId(); |
| | | res.luShengId = getUserIdByName(LightingButtonConstant.LU_SHENG_NAME); |
| | | res.huDiAnId = getUserIdByName(LightingButtonConstant.HU_DI_AN_NAME); |
| | | res.systemProfileId = getProfileIdByName(LightingButtonConstant.SYSTEM_PROFILE_NAME); |
| | | System.debug(LoggingLevel.INFO, '*** res: ' + res); |
| | | } catch (Exception e) { |
| | | System.debug(LoggingLevel.INFO, '*** e: ' + e); |
| | |
| | | |
| | | //给提交相应的js提供初始化数据 |
| | | @AuraEnabled |
| | | public static String updateForSubmitButton(String reocrdId){ |
| | | public static String updateForSubmitButton(String recordId){ |
| | | try { |
| | | Report__c rac = new Report__c(); |
| | | rac.Id = reocrdId; |
| | | rac.Id = recordId; |
| | | rac.Status__c = LightingButtonConstant.RECORD_TYPE_NAME_BY_SUBMIT; |
| | | rac.Submit_time__c = Datetime.now(); |
| | | rac.Submit_report_day__c = Date.today(); |
| | |
| | | return eMessage.substring(left,right); |
| | | } |
| | | } |
| | | @AuraEnabled |
| | | public static string getUserIdByName(String name){ |
| | | User user = null; |
| | | try { |
| | | user = [select Id from User where Name =:name]; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | return user.Id; |
| | | } |
| | | @AuraEnabled |
| | | public static string getProfileIdByName(String name){ |
| | | Profile profile = null; |
| | | try { |
| | | profile = [select Id from Profile where Name =:name]; |
| | | } catch (Exception e) { |
| | | throw new AuraHandledException(e.getMessage()); |
| | | } |
| | | return profile.Id; |
| | | } |
| | | public class InitData{ |
| | | @AuraEnabled |
| | | public String status; |
| | |
| | | public String DeveloperName; |
| | | @AuraEnabled |
| | | public String userId; |
| | | |
| | | @AuraEnabled |
| | | public String luShengId; |
| | | @AuraEnabled |
| | | public String huDiAnId; |
| | | @AuraEnabled |
| | | public String systemProfileId; |
| | | |
| | | |
| | | |