19626
2023-10-31 fd9df05c48c09b4d7f39a3b401882bda226dedea
force-app/main/default/classes/OFSUploadRepairImageRest.cls
@@ -1,5 +1,6 @@
@RestResource(urlMapping='/OFSUploadRepairImage/*')
global with sharing class OFSUploadRepairImageRest {
    // 20231103 chenjingwu  Lightning文件修改 Start
    @HttpPost
    global static void doPost(String repairId, String ccImg, String acImg, String rqId) {
        system.debug('OFSUploadImageRest.start');
@@ -36,6 +37,7 @@
                //     res.responseBody = blob.valueOf(jsonResponse);
                //     return;
                // }
                // 20231103 chenjingwu  Lightning文件修改 Start
                // List<Attachment> attList = [Select Id, Name, Body, ParentId From Attachment Where Id= :repairQ.contract_consent_id__c];
                // Attachment att = null;
                List<ContentVersion> verisonList = [select Id,Title,VersionData from ContentVersion where Id =: repairQ.contract_consent_id__c];
@@ -69,6 +71,7 @@
                    }
                    ccId = version.Id;
                    repairQ.contract_consent_id__c = ccId;
                    // 20231103 chenjingwu  Lightning文件修改 End
                } catch ( Exception ex ) {
                    //TODO:
                    //error message:cannot update exception
@@ -92,6 +95,7 @@
                }
            }
            if (String.isNotBlank(acImg)) {
                // 20231103 chenjingwu  Lightning文件修改 Start
                // List<Attachment> attList = [Select Id, Name, Body, ParentId From Attachment Where Id= :repair.acceptance_id__c];
                List<ContentVersion> versionList = [select Id,Title,VersionData from ContentVersion where Id =: repair.acceptance_id__c];
                // Attachment att = null;
@@ -133,6 +137,7 @@
                    // res.responseBody = blob.valueOf(jsonResponse);
                    // return;
                }
                // 20231103 chenjingwu  Lightning文件修改 End
            }
            
            if (String.isNotBlank(ccId)) {
@@ -184,4 +189,5 @@
        res.responseBody = blob.valueOf(jsonResponse);
        return;
    }
    // 20231103 chenjingwu  Lightning文件修改 End
}