以单据插件为例
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;
}
}
本文链接:https://www.naiteiy.site/index.php/archives/85/