package com.yem.wm.im.sourceapply.op;

import com.yem.wm.es.Util.ZJUtils;
import com.yem.wm.im.intauditbusa.validator.IntAuditBuSaDelValidator;
import com.yem.wm.utils.FunctionalCommon;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.AddValidatorsEventArgs;
import kd.bos.entity.plugin.PreparePropertysEventArgs;
import kd.bos.entity.plugin.args.EndOperationTransactionArgs;
import kd.sdk.plugin.Plugin;

import java.util.List;

/**
 * 单据操作
 */
public class SourceApplyDelOp extends AbstractOperationServicePlugIn implements Plugin {
    @Override
    public void onPreparePropertys(PreparePropertysEventArgs e) {
        List<String> fieldKeys = e.getFieldKeys();
        fieldKeys.add("yem_sourcebilltype");
        fieldKeys.add("yem_sourcebillid");
        fieldKeys.add("yem_sourceentryid");
        fieldKeys.add("yem_billtype");
        fieldKeys.add("yem_sourceentryids");

    }

    @Override
    public void endOperationTransaction(EndOperationTransactionArgs e) {
        super.endOperationTransaction(e);
        DynamicObject[] dataEntities = e.getDataEntities();
        for(DynamicObject dataEntitie : dataEntities){
            ZJUtils.delSourceApply(dataEntitie);
        }
    }


}