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

import kd.bos.entity.operate.result.OperationResult;
import kd.bos.form.MobileFormShowParameter;
import kd.bos.form.ShowType;
import kd.bos.form.events.AfterDoOperationEventArgs;
import kd.bos.form.events.BeforeDoOperationEventArgs;
import kd.bos.list.ListShowParameter;
import kd.bos.list.MobileListShowParameter;
import kd.bos.list.plugin.AbstractMobListPlugin;
import kd.bos.mvc.list.MobileListView;
import java.util.HashMap;
import java.util.Map;

public class DailyVehicleCusMobListPlugin extends AbstractMobListPlugin {
    @Override
    public void beforeDoOperation(BeforeDoOperationEventArgs args) {
        super.beforeDoOperation(args);
    }

    @Override
    public void afterDoOperation(AfterDoOperationEventArgs e) {
        super.afterDoOperation(e);

        String opKey = e.getOperateKey();

        if ("unaudit".equalsIgnoreCase(opKey)) {
            OperationResult operationResult = e.getOperationResult();
            if (operationResult.isSuccess()) {
                MobileListShowParameter mobparameter = (MobileListShowParameter)this.getView().getFormShowParameter();
                Map<String, Object> customParam = new HashMap();
                Long billId = (Long)((MobileListView)this.getView()).getFocusRowPkId();

                kd.bos.bill.MobileBillShowParameter formShowParameter = new kd.bos.bill.MobileBillShowParameter();
                formShowParameter.setFormId("er_dailyvehiclebill_mob");
                formShowParameter.getOpenStyle().setShowType(ShowType.Floating);
                formShowParameter.setPkId(billId);

                this.getView().showForm(formShowParameter);
            }
        }
    }

    protected String getEntityName() {
        return ((MobileListView)this.getView()).getListModel().getEntityId();
    }
}
