19626
2023-09-09 e14d6d0619330cad423f06493e3aa2371faa2a8f
force-app/main/default/classes/AssetModifyBelongsController.cls
@@ -7,6 +7,7 @@
    public Boolean checkexact { get; set; }  // 20230110 gzw 订单号精确查询用
    public AssetModifyBelongsChange__c ambc { get; set; }
    public static List<SelectOption> textOpts { get; private set; }
    public static Account ir { get; set; }
    //public static List<SelectOption> changeReasonOpts { get; private set; }
    static {
        textOpts = new List<SelectOption>();
@@ -61,6 +62,7 @@
        Id = ApexPages.currentPage().getParameters().get('Id');
        statusEdit = ApexPages.currentPage().getParameters().get('KeyWords');
        System.debug('Id:'+Id+'   accountId:'+RawAccountId+'  KeyWords:'+statusEdit);
        assetModifyBelongsChangeDetailRecords = new List<AssetModifyBelongsChangeDetailInfo>();
        assetModifyBelongsChangeDetailRecordsview = new List<AssetModifyBelongsChangeDetailInfo>();
        editAble = false;
@@ -68,6 +70,8 @@
        pageLimit = Integer.valueOf(System.Label.orderdetPageLimitsize);
        attachments = new List<Attachment>();
        //update 李文涛 2023/07/13 更新lightning附件上传 start
        if(String.isNotBlank(Id)){
        List<ContentDocumentLink> cdlList = [SELECT ContentDocumentId
                                                   FROM ContentDocumentLink
                                                   WHERE LinkedEntityId = :Id];
@@ -76,6 +80,8 @@
            fileIDs.add(docLink.ContentDocumentId);
        }
        contents=[SELECT Title,OwnerId,ContentModifiedDate from ContentDocument WHERE id IN :fileIDs];
        }
        //update 李文涛 2023/07/13 更新lightning附件上传 end
    }
    public boolean getcheckUser() {
@@ -269,17 +275,7 @@
        if (String.isNotBlank(val1)) {
            val1 = val1.trim();
        }
        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');
        }
        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 + '\'';
        if (!String.isBlank(text1)) {
            if (text1 == 'Order_No__c' && checkexact) {
                soql += ' AND (' + text1 + ' = \'' + String.escapeSingleQuotes(val1) + '\' )';
@@ -345,20 +341,19 @@
    public PageReference uploadingAttachment() {
        PageReference ref = new Pagereference('/p/attach/NoteAttach?pid=' + Id + '&retURL=%2Fapex/AssetModifyBelongs?Id=' + Id);
        
        //PageReference ref = new Pagereference('/lightning/n/Excel?objectApiName&context=RECORD_DETAIL&backgroundContext=%2Flightning%2Fr%2FAssetModifyBelongsChange__c%2F'+Id+'%2Fedit%3F0.source%3DalohaHeader&0.source='+Id+'&0.recordId='+Id+'');
        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+'');
        PageReference ref = new Pagereference('/lightning/n/LexUploadPage?0.recordId='+Id+'');
        
        ref.setRedirect(true);
        return ref;
    }
    //update 李文涛 2023/07/13 更新lightning附件上传 end
    // CHAN-BC6BV2 XHL AddEnd 20190522
    //  重新刷新
    public PageReference returnChangePage() {