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;
import info.bukova.isspst.data.Requirement;
import info.bukova.isspst.services.AbstractOwnedService;
import java.util.Date;
import org.springframework.security.access.prepost.PreAuthorize;
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
protected Requirement createEntity()
{
protected Requirement createEntity() {
Requirement entity = new Requirement();
entity.setReqDate(new Date());
@ -23,8 +23,7 @@ public class RequirementServiceImpl extends AbstractOwnedService<Requirement> im
@Override
@Transactional
@PreAuthorize("hasPermission(this, 'PERM_ADD')")
public void add(Requirement entity)
{
public void add(Requirement entity) {
entity.setNumser(this.getNumberSerie());
super.add(entity);
}

@ -1,17 +1,20 @@
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.TripRequirement;
import info.bukova.isspst.services.requirement.RequirementBaseService;
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> {
private RequirementBaseService<T> reqService;
protected RequirementBaseService<T> reqService;
@SuppressWarnings("unchecked")
public void init() {
reqService = (RequirementBaseService<T>) service;
}
@Override
protected void loadLazyData(T data) {

@ -1,5 +1,11 @@
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.List;
@ -8,22 +14,12 @@ import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Init;
import org.zkoss.zk.ui.select.annotation.WireVariable;
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 info.bukova.isspst.ui.ListViewModel;
public class TripRequirementListAll extends ListViewModel<TripRequirement> {
public class TripRequirementListAll extends RequirementSubpage<TripRequirement> {
@WireVariable
private TripRequirementService tripRequirementService;
@WireVariable
private WorkgroupService workgroupService;
@WireVariable
private UserService userService;
private List<Workgroup> allCentres;
private List<Workgroup> allWorkgroups;
@ -36,6 +32,7 @@ public class TripRequirementListAll extends ListViewModel<TripRequirement> {
allCentres = workgroupService.getCentres();
allWorkgroups = workgroupService.getWorkgroups();
super.init();
}
@Override
@ -55,9 +52,5 @@ public class TripRequirementListAll extends ListViewModel<TripRequirement> {
public List<Workgroup> getAllWorkgroups() {
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.users.UserService;
import info.bukova.isspst.services.workgroups.WorkgroupService;
import info.bukova.isspst.ui.ListViewModel;
import java.util.ArrayList;
import java.util.List;
import org.springframework.security.access.AccessDeniedException;
import org.zkoss.bind.BindUtils;
import org.zkoss.bind.annotation.Command;
import org.zkoss.bind.annotation.Init;
import org.zkoss.bind.annotation.NotifyChange;
import org.zkoss.zk.ui.select.annotation.WireVariable;
public class TripRequirementListCentre extends ListViewModel<TripRequirement> {
public class TripRequirementListCentre extends RequirementSubpage<TripRequirement> {
@WireVariable
private TripRequirementService tripRequirementService;
@ -36,6 +33,7 @@ public class TripRequirementListCentre extends ListViewModel<TripRequirement> {
dataFilter = new TripRequirementFilter(getFilterTemplate());
myCentres = workgroupService.getUserCentres(userService.getCurrent());
super.init();
}
@Override

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

Loading…
Cancel
Save