binxie
2023-06-16 da42e2995c00293af89c71fe5ba6e16cbb77e1b3
force-app/main/default/classes/LexConsumableController.cls
@@ -1651,6 +1651,7 @@
        OSHFLG = OSHFLGStr;
        coc = (Consumable_order__c)JSON.deserialize(cocStr, Consumable_order__c.class);
        contactDealer = (List<String>)JSON.deserialize(contactDealerStr, List<String>.class);
        System.debug('consumableorderdetailsRecordsviewStr:'+consumableorderdetailsRecordsviewStr);
        consumableorderdetailsRecordsview = (List<ConsumableorderdetailsInfo>)JSON.deserialize(consumableorderdetailsRecordsviewStr, List<ConsumableorderdetailsInfo>.class);
        if(coc.Offers_Price__c != null){
            String offerStr = String.valueOf(coc.Offers_Price__c);
@@ -2018,13 +2019,19 @@
    //删除附件
    @AuraEnabled
    public static Results deleteAtt(String contentVersionId){
    public static Results deleteAtt(String contentVersionId, String cocId){
        Results results = new Results();
        try {
            List<ContentVersion> cvInfo = [SELECT Id FROM ContentVersion WHERE FirstPublishLocationId = :cocId];
            ContentVersion conVersion = [SELECT ContentDocumentId FROM ContentVersion WHERE Id = :contentVersionId];
            String contentDocumentId = conVersion.ContentDocumentId;
            ContentDocument conDocument =  [SELECT Id FROM ContentDocument where Id = :contentDocumentId];
            delete conDocument;
            if(cvInfo.size() <= 1){
                Consumable_order__c c = [SELECT Id FROM Consumable_order__c WHERE Id =:cocId];
                c.Consumable_pdf_insert_day__c =null;
                update c;
            }
            results.result = 'Success';
        } catch (Exception e) {
            results.result = 'Fail';
@@ -2056,7 +2063,7 @@
        }
    }
    class ConsumableorderdetailsInfo implements Comparable {
    public class ConsumableorderdetailsInfo implements Comparable {
        @AuraEnabled
        public Boolean check { get; set; }
        @AuraEnabled