| | |
| | | public Boolean isShow { get; set; } |
| | | public List<Attachment> attachments { get; set; } |
| | | //CHAN-BC6BV2 XHL AddEnd 20190522 |
| | | |
| | | public List<ContentDocument> contents { get; set; } |
| | | //分页功能 |
| | | public Integer pageLimit {get; set;} |
| | | public String soql {get; set;} |
| | |
| | | pageLimit = Integer.valueOf(System.Label.orderdetPageLimitsize); |
| | | |
| | | attachments = new List<Attachment>(); |
| | | //update 李文涛 2023/07/13 更新lightning附件上传 start |
| | | List<ContentDocumentLink> cdlList = [SELECT ContentDocumentId |
| | | FROM ContentDocumentLink |
| | | WHERE LinkedEntityId = :Id]; |
| | | List<ID> fileIDs = new List<ID>(); |
| | | for (ContentDocumentLink docLink : cdlList) { |
| | | fileIDs.add(docLink.ContentDocumentId); |
| | | } |
| | | contents=[SELECT Title,OwnerId,ContentModifiedDate from ContentDocument WHERE id IN :fileIDs]; |
| | | //update 李文涛 2023/07/13 更新lightning附件上传 end |
| | | } |
| | | |
| | | public boolean getcheckUser() { |
| | |
| | | soql = this.makeSoql1('', ''); |
| | | assetListed = Database.query(soql); |
| | | assetListed = noSubmittedList(assetListed); |
| | | |
| | | |
| | | if (assetListed.size() > 0) { |
| | | ambc.rawAccount__c = assetListed[0].Account.Id; |
| | | } |
| | |
| | | Map<String,String> submittedMap = new Map<String,String>(); |
| | | List<AssetModifyBelongsChangeDetail__c> changeDetailList = new List<AssetModifyBelongsChangeDetail__c>(); |
| | | // 查找 保有设备所属变更明细 |
| | | changeDetailList = [select Id, Name, Asset__c,Asset__r.Id |
| | | changeDetailList = [select Id, Name, Asset__c,Asset__r.Id |
| | | from AssetModifyBelongsChangeDetail__c |
| | | where ChangeAndChangeDetail__c In:ambcIdList]; |
| | | |
| | | |
| | | if (changeDetailList.size() > 0) { |
| | | for(AssetModifyBelongsChangeDetail__c ambcDetail:changeDetailList){ |
| | | submittedMap.put(ambcDetail.Asset__r.Id, ambcDetail.Asset__r.Id); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } else { |
| | | noSubmittedList = asListed; |
| | | noSubmittedList = asListed; |
| | | } |
| | | |
| | | if (noSubmittedList.size() > 200) { |
| | |
| | | } else{ |
| | | break; |
| | | } |
| | | |
| | | |
| | | } |
| | | } else { |
| | | asListed = noSubmittedList; |
| | | } |
| | | } |
| | | |
| | | |
| | | return asListed; |
| | | // WLIG-BYZ9UF XHL 20210311 End |
| | | |
| | |
| | | if (String.isNotBlank(val1)) { |
| | | val1 = val1.trim(); |
| | | } |
| | | String soql = 'select Id,name,SerialNumber,Asset_situation__c,Order_No__c,Account.Name,Status,Installation_Site__c,CurrentContract__c from Asset where AccountId = \'' + RawAccountId + '\''; |
| | | String soql=''; |
| | | System.debug(RawAccountId); |
| | | RawAccountId=''; |
| | | if(String.isBlank(RawAccountId)){ |
| | | soql = 'select Id,name,SerialNumber,Asset_situation__c,Order_No__c,Account.Name,Status,Installation_Site__c,CurrentContract__c from Asset where AccountId = \'\''; |
| | | System.debug('id is null'); |
| | | } |
| | | else { |
| | | soql = 'select Id,name,SerialNumber,Asset_situation__c,Order_No__c,Account.Name,Status,Installation_Site__c,CurrentContract__c from Asset where AccountId = \'' + RawAccountId + '\''; |
| | | System.debug('id is not null'); |
| | | } |
| | | if (!String.isBlank(text1)) { |
| | | if (text1 == 'Order_No__c' && checkexact) { |
| | | soql += ' AND (' + text1 + ' = \'' + String.escapeSingleQuotes(val1) + '\' )'; |
| | |
| | | ref.setRedirect(true); |
| | | return ref; |
| | | } |
| | | //update 李文涛 2023/07/13 更新lightning附件上传 start |
| | | //跳转到上传附件页面(lightning) |
| | | public PageReference uploadingAttachmentLightning() { |
| | | //PageReference ref = new Pagereference('/p/attach/NoteAttach?pid=' + Id + '&retURL=%2Fapex/AssetModifyBelongs?Id=' + Id); |
| | | PageReference ref = new Pagereference('/lightning/n/lightning?backgroundContext=%2Flightning%2Fr%2FAssetModifyBelongsChange__c%2F'+Id+'%2Fedit%3Fcount%3D1&0.recordId='+Id+''); |
| | | |
| | | ref.setRedirect(true); |
| | | return ref; |
| | | } |
| | | //update 李文涛 2023/07/13 更新lightning附件上传 end |
| | | // CHAN-BC6BV2 XHL AddEnd 20190522 |
| | | // 重新刷新 |
| | | public PageReference returnChangePage() { |
| | |
| | | //提交之前验证保有设备是否在原客户下,不在报错。 |
| | | List<AssetModifyBelongsChangeDetail__c> getAmBdList = new List<AssetModifyBelongsChangeDetail__c>(); |
| | | getAmBdList = [SELECT Id, Name,Asset__r.SerialNumber,AssetNotAccount__c,Asset__r.Account.Name,ChangeAndChangeDetail__r.rawAccount__r.Name |
| | | FROM AssetModifyBelongsChangeDetail__c |
| | | FROM AssetModifyBelongsChangeDetail__c |
| | | WHERE ChangeAndChangeDetail__c = : Id AND AssetNotAccount__c = true]; |
| | | if (getAmBdList.size() > 0) { |
| | | for (AssetModifyBelongsChangeDetail__c ambcd: getAmBdList ) { |
| | |
| | | String rawAccountName = ' 不在客户 【 ' + ambcd.ChangeAndChangeDetail__r.rawAccount__r.Name +' 】 下,'; |
| | | String accountName = ' 在客户 【 ' +ambcd.Asset__r.Account.Name +' 】 下,'; |
| | | ApexPages.addmessage(new ApexPages.message(ApexPages.severity.Error, serialNumber+rawAccountName+accountName+' 无法提交,请确认')); |
| | | |
| | | |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | try { |
| | | Approval.ProcessSubmitRequest psr = new Approval.ProcessSubmitRequest(); |
| | | psr.setObjectId(Id); |
| | |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |