package nckd.jimin.jyyy.bd.plugin.form;

import kd.bos.form.control.events.ItemClickEvent;
import kd.bos.list.plugin.AbstractListPlugin;
import kd.bos.logging.Log;
import kd.bos.logging.LogFactory;
import kd.sdk.plugin.Plugin;
import nckd.jimin.jyyy.bd.task.SynSupplierFromSAPTask;
import nckd.jimin.jyyy.bd.task.impl.SynSapServiceImpl;

import java.util.EventObject;
import java.util.HashMap;
import java.util.Map;

/**
 * 标准单据列表插件
 */
public class SynSpeakerForOAListPlugin extends AbstractListPlugin implements Plugin {
    private static final Log logger = LogFactory.getLog(SynSupplierFromSAPTask.class);
    @Override
    public void registerListener(EventObject e) {
        super.registerListener(e);
        this.addClickListeners("_toolbar_");
    }
    @Override
    public void itemClick(ItemClickEvent evt) {
        super.itemClick(evt);
        if(evt.getItemKey().equalsIgnoreCase("nckd_oa")){
            SynSapServiceImpl synSapService = new SynSapServiceImpl();
            Map<String, String> result = new HashMap<>();
            result=synSapService.synSpeakerForOA();
            this.getView().showMessage(result.get("msg"));

        }
    }
}