Merge branch 'develop' into test/for_fix_develop
This commit is contained in:
commit
7d1794900f
2 changed files with 99 additions and 1 deletions
|
|
@ -0,0 +1,70 @@
|
||||||
|
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,6 +214,34 @@
|
||||||
</entry>
|
</entry>
|
||||||
</properties>
|
</properties>
|
||||||
</scripts>
|
</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>
|
||||||
<children id="2069b8e0-a22a-45e0-b0db-45049cc163b4">
|
<children id="2069b8e0-a22a-45e0-b0db-45049cc163b4">
|
||||||
<prototypeId>b310f98a-69c6-4e7b-8cdb-f1ab9f9c0d94</prototypeId>
|
<prototypeId>b310f98a-69c6-4e7b-8cdb-f1ab9f9c0d94</prototypeId>
|
||||||
|
|
@ -19833,7 +19861,7 @@
|
||||||
<entry>
|
<entry>
|
||||||
<key>loadOnStart</key>
|
<key>loadOnStart</key>
|
||||||
<value>
|
<value>
|
||||||
<simple>true</simple>
|
<simple>false</simple>
|
||||||
</value>
|
</value>
|
||||||
</entry>
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue