liuyn
2024-03-11 a87f1c3df03078814ee97ad0c8ac200a232419e9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
public with sharing class LexInventoryHeaderClearStatusController {
 
    @AuraEnabled
    public static List<Inventory_Header__c> init(String recordId){
        List<Inventory_Header__c> inventoryList = new List<Inventory_Header__c>([SELECT Id, Name, Inventory_Status__c FROM Inventory_Header__c WHERE Id = :recordId OR Fixture_Header__c = :recordId]);
        return inventoryList;
    }
 
    @AuraEnabled
    public static String updateStatus(List<Inventory_Header__c> inventoryList){
        List<Inventory_Header__c> tempList = new List<Inventory_Header__c>();
        try {
            for(Inventory_Header__c inventory : inventoryList){
                Inventory_Header__c temp = new Inventory_Header__c();
                temp.Id = inventory.Id;
                temp.Inventory_Status__c = null;
                tempList.add(temp);
            }
            UPDATE tempList;
            return '清除盘点状态完毕';
        }
        catch (Exception e) {
            return e.getMessage();
        }
        
    } 
}