Implementováno schvalování služebních cest. Společné báze pro práci s

požadavky na servisní vrstvě a pro taby na UI. 
refs #108
multitenant
Josef Rokos 11 years ago
parent 05704827a4
commit f157b9694f

@ -1,18 +1,18 @@
package info.bukova.isspst.services.requirement; package info.bukova.isspst.services.requirement;
import info.bukova.isspst.data.Requirement; import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.services.AbstractOwnedService;
import java.util.Date; import java.util.Date;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
public class RequirementServiceImpl extends AbstractOwnedService<Requirement> implements RequirementService, RequirementBaseService<Requirement> public class RequirementServiceImpl extends
{ RequirementBaseServiceImpl<Requirement> implements RequirementService,
RequirementBaseService<Requirement> {
@Override @Override
protected Requirement createEntity() protected Requirement createEntity() {
{
Requirement entity = new Requirement(); Requirement entity = new Requirement();
entity.setReqDate(new Date()); entity.setReqDate(new Date());
@ -23,8 +23,7 @@ public class RequirementServiceImpl extends AbstractOwnedService<Requirement> im
@Override @Override
@Transactional @Transactional
@PreAuthorize("hasPermission(this, 'PERM_ADD')") @PreAuthorize("hasPermission(this, 'PERM_ADD')")
public void add(Requirement entity) public void add(Requirement entity) {
{
entity.setNumser(this.getNumberSerie()); entity.setNumser(this.getNumberSerie());
super.add(entity); super.add(entity);
} }

@ -1,17 +1,20 @@
package info.bukova.isspst.ui.requirement; package info.bukova.isspst.ui.requirement;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.NotifyChange;
import info.bukova.isspst.data.RequirementBase; import info.bukova.isspst.data.RequirementBase;
import info.bukova.isspst.data.TripRequirement;
import info.bukova.isspst.services.requirement.RequirementBaseService; import info.bukova.isspst.services.requirement.RequirementBaseService;
import info.bukova.isspst.ui.ListViewModel; import info.bukova.isspst.ui.ListViewModel;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.NotifyChange;
public class RequirementSubpage<T extends RequirementBase> extends ListViewModel<T> { public class RequirementSubpage<T extends RequirementBase> extends ListViewModel<T> {
private RequirementBaseService<T> reqService; protected RequirementBaseService<T> reqService;
@SuppressWarnings("unchecked")
public void init() {
reqService = (RequirementBaseService<T>) service;
}
@Override @Override
protected void loadLazyData(T data) { protected void loadLazyData(T data) {

@ -1,5 +1,11 @@
package info.bukova.isspst.ui.requirement; package info.bukova.isspst.ui.requirement;
import info.bukova.isspst.data.TripRequirement;
import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.filters.TripRequirementFilter;
import info.bukova.isspst.services.requirement.TripRequirementService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -8,22 +14,12 @@ import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable; import org.zkoss.zk.ui.select.annotation.WireVariable;
import info.bukova.isspst.data.TripRequirement; public class TripRequirementListAll extends RequirementSubpage<TripRequirement> {
import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.filters.TripRequirementFilter;
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.ui.ListViewModel;
public class TripRequirementListAll extends ListViewModel<TripRequirement> {
@WireVariable @WireVariable
private TripRequirementService tripRequirementService; private TripRequirementService tripRequirementService;
@WireVariable @WireVariable
private WorkgroupService workgroupService; private WorkgroupService workgroupService;
@WireVariable
private UserService userService;
private List<Workgroup> allCentres; private List<Workgroup> allCentres;
private List<Workgroup> allWorkgroups; private List<Workgroup> allWorkgroups;
@ -36,6 +32,7 @@ public class TripRequirementListAll extends ListViewModel<TripRequirement> {
allCentres = workgroupService.getCentres(); allCentres = workgroupService.getCentres();
allWorkgroups = workgroupService.getWorkgroups(); allWorkgroups = workgroupService.getWorkgroups();
super.init();
} }
@Override @Override
@ -55,9 +52,5 @@ public class TripRequirementListAll extends ListViewModel<TripRequirement> {
public List<Workgroup> getAllWorkgroups() { public List<Workgroup> getAllWorkgroups() {
return allWorkgroups; return allWorkgroups;
} }
public boolean isCanApprove() {
return false;
}
} }

@ -6,19 +6,16 @@ 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.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService; import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.ListViewModel;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.springframework.security.access.AccessDeniedException; import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils; import org.zkoss.bind.BindUtils;
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.zk.ui.select.annotation.WireVariable; import org.zkoss.zk.ui.select.annotation.WireVariable;
public class TripRequirementListCentre extends ListViewModel<TripRequirement> { public class TripRequirementListCentre extends RequirementSubpage<TripRequirement> {
@WireVariable @WireVariable
private TripRequirementService tripRequirementService; private TripRequirementService tripRequirementService;
@ -36,6 +33,7 @@ public class TripRequirementListCentre extends ListViewModel<TripRequirement> {
dataFilter = new TripRequirementFilter(getFilterTemplate()); dataFilter = new TripRequirementFilter(getFilterTemplate());
myCentres = workgroupService.getUserCentres(userService.getCurrent()); myCentres = workgroupService.getUserCentres(userService.getCurrent());
super.init();
} }
@Override @Override

@ -1,5 +1,12 @@
package info.bukova.isspst.ui.requirement; package info.bukova.isspst.ui.requirement;
import info.bukova.isspst.data.TripRequirement;
import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.filters.TripRequirementFilter;
import info.bukova.isspst.services.requirement.TripRequirementService;
import info.bukova.isspst.services.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -8,15 +15,7 @@ import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Init; import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable; import org.zkoss.zk.ui.select.annotation.WireVariable;
import info.bukova.isspst.data.TripRequirement; public class TripRequirementListWorkgroup extends RequirementSubpage<TripRequirement> {
import info.bukova.isspst.data.Workgroup;
import info.bukova.isspst.filters.TripRequirementFilter;
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.ui.ListViewModel;
public class TripRequirementListWorkgroup extends ListViewModel<TripRequirement> {
@WireVariable @WireVariable
private TripRequirementService tripRequirementService; private TripRequirementService tripRequirementService;
@ -36,6 +35,7 @@ public class TripRequirementListWorkgroup extends ListViewModel<TripRequirement>
myCentres = workgroupService.getUserCentres(userService.getCurrent()); myCentres = workgroupService.getUserCentres(userService.getCurrent());
myWorkgroups = workgroupService.getUserWorkgroups(userService.getCurrent()); myWorkgroups = workgroupService.getUserWorkgroups(userService.getCurrent());
super.init();
} }
@Override @Override
@ -56,8 +56,4 @@ public class TripRequirementListWorkgroup extends ListViewModel<TripRequirement>
return myWorkgroups; return myWorkgroups;
} }
public boolean isCanApprove() {
return false;
}
} }

Loading…
Cancel
Save