global class InvocableUtil {
|
global class LoggingRequest {
|
@InvocableVariable(required=true)
|
public ID objId;
|
}
|
|
@InvocableMethod(label='耗材审批驳回取消,删除明细')
|
global static void createLog(List<LoggingRequest> requests){
|
List<Id> objIdList = new List<Id>();
|
for(LoggingRequest requestObj:requests){
|
objIdList.add(requestObj.objId);
|
}
|
Set<String> selectAssetIdSet = new Set<String>();
|
List<Consum_Apply_Equipment_Set_Detail__c> caesdList = [SELECT Id, Asset__c
|
FROM Consum_Apply_Equipment_Set_Detail__c
|
WHERE Consum_Apply__c = :objIdList];
|
for (Consum_Apply_Equipment_Set_Detail__c caesd : caesdList) {
|
if (String.isNotBlank(caesd.Asset__c)) {
|
selectAssetIdSet.add(caesd.Asset__c);
|
}
|
}
|
List<Asset> ass = [SELECT Id FROM Asset Where Id =:selectAssetIdSet FOR UPDATE];
|
Delete caesdList;
|
}
|
}
|