parent
7d1794900f
commit
e506f062f7
2 changed files with 1 additions and 99 deletions
|
|
@ -1,70 +0,0 @@
|
|||
package ervu_business_metrics.component.combobox;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import model.ComboBoxModel;
|
||||
import service.field.ComboBoxServiceImpl;
|
||||
|
||||
import ru.cg.webbpm.modules.database.api.bean.TableRow;
|
||||
import ru.cg.webbpm.modules.database.bean.entity_graph.EntityColumn;
|
||||
import ru.cg.webbpm.modules.database.bean.filter.EntityFilter;
|
||||
import ru.cg.webbpm.modules.standard_annotations.editor.AdvancedProperty;
|
||||
|
||||
/**
|
||||
* @author r.latypov
|
||||
*/
|
||||
public class ErvuComboBoxServiceImpl extends ComboBoxServiceImpl {
|
||||
@AdvancedProperty
|
||||
public boolean isBusinessId;
|
||||
@AdvancedProperty
|
||||
public ErvuEntityFilterService[] entityFilterServices;
|
||||
|
||||
@Override
|
||||
public List<ComboBoxModel> loadData() {
|
||||
return super.loadData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ComboBoxModel> loadDataWithFilter(Object filterValue) {
|
||||
return super.loadDataWithFilter(filterValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ComboBoxModel> loadDataByParentValueWithFilter(Object parentValue,
|
||||
Object filterValue) {
|
||||
return super.loadDataByParentValueWithFilter(parentValue, filterValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ComboBoxModel convertToComboBoxModel(TableRow row) {
|
||||
ComboBoxModel comboBoxModel = super.convertToComboBoxModel(row);
|
||||
if (isBusinessId) {
|
||||
comboBoxModel.setBusinessId(null);
|
||||
}
|
||||
return comboBoxModel;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Set<EntityColumn> getColumnsToLoad() {
|
||||
Set<EntityColumn> entityColumns = super.getColumnsToLoad();
|
||||
if (hasEntityFilters()) {
|
||||
Arrays.stream(entityFilterServices)
|
||||
.forEach(ervuEntityFilterService -> entityColumns.add(
|
||||
ervuEntityFilterService.getEntityColumn()));
|
||||
}
|
||||
return entityColumns;
|
||||
}
|
||||
|
||||
private List<EntityFilter> getEntityFilters() {
|
||||
return Arrays.stream(entityFilterServices)
|
||||
.map(ErvuEntityFilterService::getEntityFilter)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private boolean hasEntityFilters() {
|
||||
return entityFilterServices != null && entityFilterServices.length > 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -214,34 +214,6 @@
|
|||
</entry>
|
||||
</properties>
|
||||
</scripts>
|
||||
<scripts id="7e818be0-38c2-4ac1-8f92-e4d72b00c474">
|
||||
<classRef type="JAVA">
|
||||
<className>ErvuFilterControl</className>
|
||||
<packageName>ervu_business_metrics.component.filter</packageName>
|
||||
</classRef>
|
||||
<enabled>true</enabled>
|
||||
<expanded>true</expanded>
|
||||
<properties>
|
||||
<entry>
|
||||
<key>column</key>
|
||||
<value>
|
||||
<simple>"idm_id"</simple>
|
||||
</value>
|
||||
</entry>
|
||||
<entry>
|
||||
<key>dataConverter</key>
|
||||
<value>
|
||||
<implRef/>
|
||||
</value>
|
||||
</entry>
|
||||
<entry>
|
||||
<key>table</key>
|
||||
<value>
|
||||
<simple>"recruitment"</simple>
|
||||
</value>
|
||||
</entry>
|
||||
</properties>
|
||||
</scripts>
|
||||
</children>
|
||||
<children id="2069b8e0-a22a-45e0-b0db-45049cc163b4">
|
||||
<prototypeId>b310f98a-69c6-4e7b-8cdb-f1ab9f9c0d94</prototypeId>
|
||||
|
|
@ -19861,7 +19833,7 @@
|
|||
<entry>
|
||||
<key>loadOnStart</key>
|
||||
<value>
|
||||
<simple>false</simple>
|
||||
<simple>true</simple>
|
||||
</value>
|
||||
</entry>
|
||||
<entry>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue