package com.yem.wm.utils;

import kd.bos.base.AbstractBasePlugIn;
import kd.bos.bill.OperationStatus;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.orm.query.QCP;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;

import java.util.EventObject;

/**
 * @author zhouc
 * @date 2024/3/19 16:53
 * @className AddFormOrgFromUtils
 * @description 新增默认携带组织
 */
public class AddFormOrgFromUtils extends AbstractBasePlugIn {
    @Override
    public void afterCreateNewData(EventObject e) {
        // TODO Auto-generated method stub
        super.afterCreateNewData(e);
        OperationStatus status = this.getView().getFormShowParameter().getStatus();
        if (status.equals(OperationStatus.ADDNEW)) {
            DynamicObject bos_org = BusinessDataServiceHelper.loadSingle(YEM.getCurrentOrgId(), "bos_org");
            this.getModel().setValue("createorg", bos_org);
        }

    }
}
