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

import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.logging.BizLog;
import nckd.jimin.jyyy.fi.business.plugin.LocationCityPlugin;

import java.util.EventObject;

/**
 * 外办申请单扩展插件
 */
public class ErDailyVehicleBillEdit extends AbstractBillPlugIn {

    @Override
    public void afterCreateNewData(EventObject e) {
        super.afterCreateNewData(e);
        initVehiclecity();

    }

    /**
     * 外办城市默认赋值
     */
    protected void initVehiclecity(){

        DynamicObject dataEntity = this.getModel().getDataEntity(true);
        DynamicObject applier = dataEntity.getDynamicObject("applier");
        Object cityId = LocationCityPlugin.getInstance().getLocationCity(applier.getPkValue());
        BizLog.log("cityId" + cityId);
        getModel().setItemValueByID("vehiclecity",cityId);
    }
}
