Refaktorizace RequirementService.

multitenant
František Přibyl 11 years ago
parent dd4b7a2166
commit 7e87c05d92

@ -9,22 +9,21 @@ import org.zkoss.bind.annotation.NotifyChange;
public class RequirementSubpage<T extends RequirementBase> extends ListViewModel<T> {
protected RequirementBaseService<T> reqService;
@SuppressWarnings("unchecked")
public void init() {
reqService = (RequirementBaseService<T>) service;
private RequirementBaseService<T> getReqService()
{
return (RequirementBaseService<T>) service;
}
@Override
protected void loadLazyData(T data) {
reqService.loadAuthItems(data);
this.getReqService().loadAuthItems(data);
}
@Command
@NotifyChange("dataBean")
public void approve() {
reqService.approve(getDataBean());
this.getReqService().approve(getDataBean());
}
@Override
@ -35,11 +34,9 @@ public class RequirementSubpage<T extends RequirementBase> extends ListViewModel
public boolean isCanApprove() {
if (getDataBean() != null) {
return reqService.canApprove(getDataBean());
return this.getReqService().canApprove(getDataBean());
}
return false;
}
}

@ -32,7 +32,6 @@ public class TripRequirementListAll extends RequirementSubpage<TripRequirement>
allCentres = workgroupService.getCentres();
allWorkgroups = workgroupService.getWorkgroups();
super.init();
}
@Override

@ -33,7 +33,6 @@ public class TripRequirementListCentre extends RequirementSubpage<TripRequiremen
dataFilter = new TripRequirementFilter(getFilterTemplate());
myCentres = workgroupService.getUserCentres(userService.getCurrent());
super.init();
}
@Override

@ -35,7 +35,6 @@ public class TripRequirementListWorkgroup extends RequirementSubpage<TripRequire
myCentres = workgroupService.getUserCentres(userService.getCurrent());
myWorkgroups = workgroupService.getUserWorkgroups(userService.getCurrent());
super.init();
}
@Override

Loading…
Cancel
Save