Požadavky na materiály a služby

- do záložek [Má střediska], [Mé komise] a [Vše] přidán sloupec
[Vytvořil]
- opraveno plnění a filtrování středisek na všech záložkách
- služba userService přesunuta do třídy RequirementSubpage

closes #144
multitenant
František Přibyl 10 years ago
parent 60a87e5d52
commit ab5ed12772

@ -3,6 +3,8 @@ package info.bukova.isspst.filters;
import info.bukova.isspst.DateTimeUtils; import info.bukova.isspst.DateTimeUtils;
import info.bukova.isspst.StringUtils; import info.bukova.isspst.StringUtils;
import info.bukova.isspst.data.Requirement; import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.data.User;
import info.bukova.isspst.data.Workgroup;
import org.hamcrest.Description; import org.hamcrest.Description;
import org.hamcrest.Factory; import org.hamcrest.Factory;
@ -40,9 +42,11 @@ public class RequirementFilter implements Filter<Requirement>
{ {
boolean foundNumser = StringUtils.isEqualForFilter(item.getNumser(), condition.getNumser()); boolean foundNumser = StringUtils.isEqualForFilter(item.getNumser(), condition.getNumser());
boolean foundReqDate = DateTimeUtils.isEqualByDateForFilter(item.getReqDate(), condition.getReqDate()); boolean foundReqDate = DateTimeUtils.isEqualByDateForFilter(item.getReqDate(), condition.getReqDate());
boolean foundCenter = Workgroup.isEqualByWorkgroupForFilter(item.getCentre(), condition.getCentre());
boolean foundDescription = StringUtils.isEqualForFilter(item.getDescription(), condition.getDescription()); boolean foundDescription = StringUtils.isEqualForFilter(item.getDescription(), condition.getDescription());
boolean foundDeliveryDate = DateTimeUtils.isEqualByDateForFilter(item.getDeliveryDate(), condition.getDeliveryDate()); boolean foundDeliveryDate = DateTimeUtils.isEqualByDateForFilter(item.getDeliveryDate(), condition.getDeliveryDate());
return foundNumser && foundReqDate && foundDescription && foundDeliveryDate; boolean foundUser = User.isEqualByUserForFilter(item.getOwnedBy(), condition.getOwnedBy());
return (foundNumser && foundReqDate && foundCenter && foundDescription && foundDeliveryDate && foundUser);
} }
@Factory @Factory

@ -4,7 +4,6 @@ import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.filters.RequirementFilter; import info.bukova.isspst.filters.RequirementFilter;
import info.bukova.isspst.services.requirement.RequirementService; import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.requirement.RequirementSubpage; import info.bukova.isspst.ui.requirement.RequirementSubpage;
@ -21,15 +20,12 @@ public class ReqListMy extends RequirementSubpage<Requirement>
@WireVariable @WireVariable
protected RequirementService requirementService; protected RequirementService requirementService;
@WireVariable
protected UserService userService;
@WireVariable @WireVariable
protected WorkgroupService workgroupService; protected WorkgroupService workgroupService;
public List<Workgroup> getCentres() public List<Workgroup> getCentres()
{ {
return workgroupService.getUserCentres(userService.getCurrent()); return workgroupService.getCentres();
} }
@Init @Init

@ -4,7 +4,6 @@ import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.filters.RequirementFilter; import info.bukova.isspst.filters.RequirementFilter;
import info.bukova.isspst.services.requirement.RequirementService; import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.requirement.RequirementSubpage; import info.bukova.isspst.ui.requirement.RequirementSubpage;
@ -23,15 +22,12 @@ public class ReqListMyAll extends RequirementSubpage<Requirement>
@WireVariable @WireVariable
protected RequirementService requirementService; protected RequirementService requirementService;
@WireVariable
protected UserService userService;
@WireVariable @WireVariable
protected WorkgroupService workgroupService; protected WorkgroupService workgroupService;
public List<Workgroup> getCentres() public List<Workgroup> getCentres()
{ {
return workgroupService.getUserCentres(userService.getCurrent()); return workgroupService.getCentres();
} }
@Init @Init

@ -4,7 +4,6 @@ import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.filters.RequirementFilter; import info.bukova.isspst.filters.RequirementFilter;
import info.bukova.isspst.services.requirement.RequirementService; import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.requirement.RequirementSubpage; import info.bukova.isspst.ui.requirement.RequirementSubpage;
@ -23,9 +22,6 @@ public class ReqListMyCenters extends RequirementSubpage<Requirement>
@WireVariable @WireVariable
protected RequirementService requirementService; protected RequirementService requirementService;
@WireVariable
protected UserService userService;
@WireVariable @WireVariable
protected WorkgroupService workgroupService; protected WorkgroupService workgroupService;

@ -4,7 +4,6 @@ import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.filters.RequirementFilter; import info.bukova.isspst.filters.RequirementFilter;
import info.bukova.isspst.services.requirement.RequirementService; import info.bukova.isspst.services.requirement.RequirementService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.requirement.RequirementSubpage; import info.bukova.isspst.ui.requirement.RequirementSubpage;
@ -23,15 +22,12 @@ public class ReqListMyWorkgroups extends RequirementSubpage<Requirement>
@WireVariable @WireVariable
protected RequirementService requirementService; protected RequirementService requirementService;
@WireVariable
protected UserService userService;
@WireVariable @WireVariable
protected WorkgroupService workgroupService; protected WorkgroupService workgroupService;
public List<Workgroup> getCentres() public List<Workgroup> getCentres()
{ {
return workgroupService.getUserCentres(userService.getCurrent()); return workgroupService.getCentres();
} }
@Init @Init

@ -1,17 +1,30 @@
package info.bukova.isspst.ui.requirement; package info.bukova.isspst.ui.requirement;
import info.bukova.isspst.data.RequirementBase; import info.bukova.isspst.data.RequirementBase;
import info.bukova.isspst.data.User;
import info.bukova.isspst.services.requirement.RequirementBaseService; import info.bukova.isspst.services.requirement.RequirementBaseService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.ui.BigDecimalConverter; import info.bukova.isspst.ui.BigDecimalConverter;
import info.bukova.isspst.ui.ListViewModel; import info.bukova.isspst.ui.ListViewModel;
import java.util.List;
import org.zkoss.bind.BindUtils; import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command; import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange; import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.select.annotation.WireVariable;
public class RequirementSubpage<T extends RequirementBase> extends ListViewModel<T> { public class RequirementSubpage<T extends RequirementBase> extends ListViewModel<T> {
@WireVariable
protected UserService userService;
public List<User> getAllUsers()
{
return userService.getAll();
}
private BigDecimalConverter bigDecimalConverter; private BigDecimalConverter bigDecimalConverter;
public BigDecimalConverter getBigDecimalConverter() public BigDecimalConverter getBigDecimalConverter()

@ -4,7 +4,6 @@ import info.bukova.isspst.data.TripRequirement;
import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.filters.TripRequirementFilter; import info.bukova.isspst.filters.TripRequirementFilter;
import info.bukova.isspst.services.requirement.TripRequirementService; import info.bukova.isspst.services.requirement.TripRequirementService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.services.workgroups.WorkgroupService;
import java.util.ArrayList; import java.util.ArrayList;
@ -21,10 +20,10 @@ public class TripRequirementListCentre extends RequirementSubpage<TripRequiremen
@WireVariable @WireVariable
private TripRequirementService tripRequirementService; private TripRequirementService tripRequirementService;
@WireVariable @WireVariable
private WorkgroupService workgroupService; private WorkgroupService workgroupService;
@WireVariable
private UserService userService;
private List<Workgroup> myCentres; private List<Workgroup> myCentres;
@Init @Init

@ -4,7 +4,6 @@ import info.bukova.isspst.data.TripRequirement;
import info.bukova.isspst.data.Workgroup; import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.filters.TripRequirementFilter; import info.bukova.isspst.filters.TripRequirementFilter;
import info.bukova.isspst.services.requirement.TripRequirementService; import info.bukova.isspst.services.requirement.TripRequirementService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.services.workgroups.WorkgroupService;
import java.util.ArrayList; import java.util.ArrayList;
@ -21,11 +20,12 @@ public class TripRequirementListWorkgroup extends RequirementSubpage<TripRequire
@WireVariable @WireVariable
private TripRequirementService tripRequirementService; private TripRequirementService tripRequirementService;
@WireVariable @WireVariable
private WorkgroupService workgroupService; private WorkgroupService workgroupService;
@WireVariable
private UserService userService;
private List<Workgroup> myCentres; private List<Workgroup> myCentres;
private List<Workgroup> myWorkgroups; private List<Workgroup> myWorkgroups;
@Init @Init

@ -8,28 +8,28 @@
<listheader <listheader
label="${labels.RequirementsGridNumberSerie}" label="${labels.RequirementsGridNumberSerie}"
sort="czech(numser)" sort="czech(numser)"
width="7%" /> hflex="7" />
<listheader <listheader
label="${labels.RequirementsGridReqDate}" label="${labels.RequirementsGridReqDate}"
sort="auto(reqDate)" sort="auto(reqDate)"
width="13%" /> hflex="13" />
<listheader <listheader
label="${labels.RequirementsGridCenter}" label="${labels.RequirementsGridCenter}"
sort="czech(description)" sort="auto(centre)"
width="10%" /> hflex="15" />
<listheader <listheader
label="${labels.RequirementsGridDeliveryDate}" label="${labels.RequirementsGridDeliveryDate}"
sort="auto(reqDate)" sort="auto(reqDate)"
width="13%" /> hflex="13" />
<listheader <listheader
label="${labels.Amount}" label="${labels.Amount}"
sort="auto(sumTotal)" sort="auto(sumTotal)"
align="right" align="right"
width="10%" /> hflex="10" />
<listheader <listheader
label="${labels.RequirementsGridDescription}" label="${labels.RequirementsGridDescription}"
sort="czech(description)" sort="czech(description)"
width="60%" /> hflex="20" />
</listhead> </listhead>
<auxhead <auxhead
sclass="category-center" sclass="category-center"
@ -66,10 +66,13 @@
<auxheader> <auxheader>
<div sclass="find-grid-cell"> <div sclass="find-grid-cell">
<combobox <combobox
ctrlKeys="${labels.HandleComboKeyFilter}"
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
onChange="@command('doFilter')"
model="@load(vm.centres)" model="@load(vm.centres)"
readonly="true" readonly="true"
width="100%" width="100%"
selectedItem="@bind(vm.filterTemplate.workgroup)"> selectedItem="@bind(vm.filterTemplate.centre)">
<template name="model"> <template name="model">
<comboitem label="@load(each.fullName)" /> <comboitem label="@load(each.fullName)" />
</template> </template>

@ -10,28 +10,32 @@
<listheader <listheader
label="${labels.RequirementsGridNumberSerie}" label="${labels.RequirementsGridNumberSerie}"
sort="czech(numser)" sort="czech(numser)"
width="7%" /> hflex="7" />
<listheader <listheader
label="${labels.RequirementsGridReqDate}" label="${labels.RequirementsGridReqDate}"
sort="auto(reqDate)" sort="auto(reqDate)"
width="13%" /> hflex="13" />
<listheader <listheader
label="${labels.RequirementsGridCenter}" label="${labels.RequirementsGridCenter}"
sort="czech(description)" sort="auto(centre)"
width="10%" /> hflex="15" />
<listheader <listheader
label="${labels.RequirementsGridDeliveryDate}" label="${labels.RequirementsGridDeliveryDate}"
sort="auto(reqDate)" sort="auto(reqDate)"
width="13%" /> hflex="13" />
<listheader <listheader
label="${labels.Amount}" label="${labels.Amount}"
sort="auto(sumTotal)" sort="auto(sumTotal)"
align="right" align="right"
width="10%" /> hflex="10" />
<listheader <listheader
label="${labels.RequirementsGridDescription}" label="${labels.RequirementsGridDescription}"
sort="czech(description)" sort="czech(description)"
width="60%" /> hflex="20" />
<listheader
sort="auto(ownedBy.fullName)"
label="${labels.ownedBy}"
hflex="15" />
</listhead> </listhead>
<auxhead <auxhead
sclass="category-center" sclass="category-center"
@ -68,10 +72,13 @@
<auxheader> <auxheader>
<div sclass="find-grid-cell"> <div sclass="find-grid-cell">
<combobox <combobox
ctrlKeys="${labels.HandleComboKeyFilter}"
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
onChange="@command('doFilter')"
model="@load(vm.centres)" model="@load(vm.centres)"
readonly="true" readonly="true"
width="100%" width="100%"
selectedItem="@bind(vm.filterTemplate.workgroup)"> selectedItem="@bind(vm.filterTemplate.centre)">
<template name="model"> <template name="model">
<comboitem label="@load(each.fullName)" /> <comboitem label="@load(each.fullName)" />
</template> </template>
@ -124,6 +131,27 @@
</div> </div>
</div> </div>
</auxheader> </auxheader>
<auxheader>
<div zclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<combobox
ctrlKeys="${labels.HandleComboKeyFilter}"
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
onChange="@command('doFilter')"
width="100%"
selectedItem="@bind(vm.filterTemplate.ownedBy)"
model="@load(vm.allUsers)"
readonly="true">
<template name="model">
<comboitem label="@load(each.fullName)" />
</template>
</combobox>
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
</auxhead> </auxhead>
<template name="model"> <template name="model">
<listitem> <listitem>
@ -133,6 +161,7 @@
<listcell label="@load(each.deliveryDate) @converter('formatedDate', format=labels.DateFormat)" /> <listcell label="@load(each.deliveryDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.sumTotal) @converter(vm.bigDecimalConverter)" /> <listcell label="@load(each.sumTotal) @converter(vm.bigDecimalConverter)" />
<listcell label="@load(each.description)" /> <listcell label="@load(each.description)" />
<listcell label="@load(each.ownedBy.fullName)" />
</listitem> </listitem>
</template> </template>
</listbox> </listbox>

@ -10,28 +10,32 @@
<listheader <listheader
label="${labels.RequirementsGridNumberSerie}" label="${labels.RequirementsGridNumberSerie}"
sort="czech(numser)" sort="czech(numser)"
width="7%" /> hflex="7" />
<listheader <listheader
label="${labels.RequirementsGridReqDate}" label="${labels.RequirementsGridReqDate}"
sort="auto(reqDate)" sort="auto(reqDate)"
width="13%" /> hflex="13" />
<listheader <listheader
label="${labels.RequirementsGridCenter}" label="${labels.RequirementsGridCenter}"
sort="czech(description)" sort="auto(centre)"
width="10%" /> hflex="15" />
<listheader <listheader
label="${labels.RequirementsGridDeliveryDate}" label="${labels.RequirementsGridDeliveryDate}"
sort="auto(reqDate)" sort="auto(reqDate)"
width="13%" /> hflex="13" />
<listheader <listheader
label="${labels.Amount}" label="${labels.Amount}"
sort="auto(sumTotal)" sort="auto(sumTotal)"
align="right" align="right"
width="10%" /> hflex="10" />
<listheader <listheader
label="${labels.RequirementsGridDescription}" label="${labels.RequirementsGridDescription}"
sort="czech(description)" sort="czech(description)"
width="60%" /> hflex="20" />
<listheader
sort="auto(ownedBy.fullName)"
label="${labels.ownedBy}"
hflex="15" />
</listhead> </listhead>
<auxhead <auxhead
sclass="category-center" sclass="category-center"
@ -68,10 +72,13 @@
<auxheader> <auxheader>
<div sclass="find-grid-cell"> <div sclass="find-grid-cell">
<combobox <combobox
ctrlKeys="${labels.HandleComboKeyFilter}"
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
onChange="@command('doFilter')"
model="@load(vm.centres)" model="@load(vm.centres)"
readonly="true" readonly="true"
width="100%" width="100%"
selectedItem="@bind(vm.filterTemplate.workgroup)"> selectedItem="@bind(vm.filterTemplate.centre)">
<template name="model"> <template name="model">
<comboitem label="@load(each.fullName)" /> <comboitem label="@load(each.fullName)" />
</template> </template>
@ -124,6 +131,27 @@
</div> </div>
</div> </div>
</auxheader> </auxheader>
<auxheader>
<div zclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<combobox
ctrlKeys="${labels.HandleComboKeyFilter}"
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
onChange="@command('doFilter')"
width="100%"
selectedItem="@bind(vm.filterTemplate.ownedBy)"
model="@load(vm.allUsers)"
readonly="true">
<template name="model">
<comboitem label="@load(each.fullName)" />
</template>
</combobox>
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
</auxhead> </auxhead>
<template name="model"> <template name="model">
<listitem> <listitem>
@ -133,6 +161,7 @@
<listcell label="@load(each.deliveryDate) @converter('formatedDate', format=labels.DateFormat)" /> <listcell label="@load(each.deliveryDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.sumTotal) @converter(vm.bigDecimalConverter)" /> <listcell label="@load(each.sumTotal) @converter(vm.bigDecimalConverter)" />
<listcell label="@load(each.description)" /> <listcell label="@load(each.description)" />
<listcell label="@load(each.ownedBy.fullName)" />
</listitem> </listitem>
</template> </template>
</listbox> </listbox>

@ -10,28 +10,32 @@
<listheader <listheader
label="${labels.RequirementsGridNumberSerie}" label="${labels.RequirementsGridNumberSerie}"
sort="czech(numser)" sort="czech(numser)"
width="7%" /> hflex="7" />
<listheader <listheader
label="${labels.RequirementsGridReqDate}" label="${labels.RequirementsGridReqDate}"
sort="auto(reqDate)" sort="auto(reqDate)"
width="13%" /> hflex="13" />
<listheader <listheader
label="${labels.RequirementsGridCenter}" label="${labels.RequirementsGridCenter}"
sort="czech(description)" sort="auto(centre)"
width="10%" /> hflex="15" />
<listheader <listheader
label="${labels.RequirementsGridDeliveryDate}" label="${labels.RequirementsGridDeliveryDate}"
sort="auto(reqDate)" sort="auto(reqDate)"
width="13%" /> hflex="13" />
<listheader <listheader
label="${labels.Amount}" label="${labels.Amount}"
sort="auto(sumTotal)" sort="auto(sumTotal)"
align="right" align="right"
width="10%" /> hflex="10" />
<listheader <listheader
label="${labels.RequirementsGridDescription}" label="${labels.RequirementsGridDescription}"
sort="czech(description)" sort="czech(description)"
width="60%" /> hflex="20" />
<listheader
sort="auto(ownedBy.fullName)"
label="${labelsownedBy}"
hflex="15" />
</listhead> </listhead>
<auxhead <auxhead
sclass="category-center" sclass="category-center"
@ -68,10 +72,13 @@
<auxheader> <auxheader>
<div sclass="find-grid-cell"> <div sclass="find-grid-cell">
<combobox <combobox
ctrlKeys="${labels.HandleComboKeyFilter}"
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
onChange="@command('doFilter')"
model="@load(vm.centres)" model="@load(vm.centres)"
readonly="true" readonly="true"
width="100%" width="100%"
selectedItem="@bind(vm.filterTemplate.workgroup)"> selectedItem="@bind(vm.filterTemplate.centre)">
<template name="model"> <template name="model">
<comboitem label="@load(each.fullName)" /> <comboitem label="@load(each.fullName)" />
</template> </template>
@ -124,6 +131,27 @@
</div> </div>
</div> </div>
</auxheader> </auxheader>
<auxheader>
<div zclass="find-grid-cell">
<div sclass="find-grid-divtextbox">
<combobox
ctrlKeys="${labels.HandleComboKeyFilter}"
onCtrlKey="@command('handleComboKeyFilter', ctrl=self, keyEvent=event)"
onChange="@command('doFilter')"
width="100%"
selectedItem="@bind(vm.filterTemplate.ownedBy)"
model="@load(vm.allUsers)"
readonly="true">
<template name="model">
<comboitem label="@load(each.fullName)" />
</template>
</combobox>
</div>
<div sclass="find-grid-img">
<image src="/img/funnel.png" />
</div>
</div>
</auxheader>
</auxhead> </auxhead>
<template name="model"> <template name="model">
<listitem> <listitem>
@ -133,6 +161,7 @@
<listcell label="@load(each.deliveryDate) @converter('formatedDate', format=labels.DateFormat)" /> <listcell label="@load(each.deliveryDate) @converter('formatedDate', format=labels.DateFormat)" />
<listcell label="@load(each.sumTotal) @converter(vm.bigDecimalConverter)" /> <listcell label="@load(each.sumTotal) @converter(vm.bigDecimalConverter)" />
<listcell label="@load(each.description)" /> <listcell label="@load(each.description)" />
<listcell label="@load(each.ownedBy.fullName)" />
</listitem> </listitem>
</template> </template>
</listbox> </listbox>

Loading…
Cancel
Save