单据参数的获取 - IShare

单据参数的获取

以单据插件为例


public class IsOrgContractinit extends AbstractFormPlugin {
    @Override
    public void propertyChanged(PropertyChangedArgs e) {
        String name = e.getProperty().getName();

            DynamicObject org = (DynamicObject) this.getModel().getValue("org");
            DynamicObjectCollection billParameter = (DynamicObjectCollection) SystemParamServiceHelper.getBillParameter("yfsw_dcxys", "yfsw_entryentity");
            List<DynamicObject> rows = billParameter.stream().filter(prop -> getOrgEntryRow(prop, org)).collect(Collectors.toList());
            if (rows.size()>0) {
                DynamicObject row = rows.get(0);
                if (!row.getBoolean("yfsw_checkboxfield1")) {
                    this.getView().showErrorNotification("无电子合同的新增权限,当前组织电子合同集成未配置!");
                }
            }
            this.getView().updateView();

    }
    private boolean getOrgEntryRow(DynamicObject row,DynamicObject org){
        DynamicObject company = row.getDynamicObject("yfsw_companies");
        Long companyId = company.getLong("id");
        Long orgId = org.getLong("id");
        if (companyId.compareTo(orgId)==0){
            return true;
        }
        return false;
    }
}

1

无标签
打赏
评论区
头像
文章目录