package com.yem.wm.syn.eas.form.fi;

import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.entity.ExtendedDataEntity;
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
import kd.bos.entity.plugin.PreparePropertysEventArgs;
import kd.bos.entity.plugin.args.BeforeOperationArgs;
import kd.bos.logging.Log;
import kd.bos.logging.LogFactory;

import java.util.List;

public class PayapplyUnSubmit extends AbstractOperationServicePlugIn {
    private final static Log log = LogFactory.getLog(PayapplyUnSubmit.class);

    @Override
    public void onPreparePropertys(PreparePropertysEventArgs e) {
        super.onPreparePropertys(e);
        List<String> fieldKeys = e.getFieldKeys();
        fieldKeys.add("yem_iseas");
        fieldKeys.add("yem_billtype");
    }

    @Override
    public void beforeExecuteOperationTransaction(BeforeOperationArgs e) {
        super.beforeExecuteOperationTransaction(e);
        List<ExtendedDataEntity> selectedRows = e.getSelectedRows();
        for (ExtendedDataEntity selectedRow: selectedRows) {
            DynamicObject dataEntity = selectedRow.getDataEntity();
            dataEntity.set("yem_iseas",false);
        }
    }


}
