Do požadavku na služební cestu byla přidána chybějící pole,
implementovaná validace formuláře. Do BaseValidator byly přidány metody na obecnou validaci null/empty. Do ListViewModel přidány metody pro dotažení lazy loadovaných dat. closes #108multitenant
parent
b71f3a9bef
commit
f2d9576a3f
@ -1,19 +1,15 @@
|
||||
package info.bukova.isspst.services.requirement;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import info.bukova.isspst.data.TripRequirement;
|
||||
import info.bukova.isspst.data.User;
|
||||
import info.bukova.isspst.services.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TripRequirementService extends Service<TripRequirement> {
|
||||
|
||||
public List<TripRequirement> getCentreReq();
|
||||
public List<TripRequirement> getWorkgroupReq();
|
||||
public List<TripRequirement> getFromAll();
|
||||
public void loadAuthItems(TripRequirement entity);
|
||||
public List<User> getNextApprover(TripRequirement entity);
|
||||
public boolean canApprove(TripRequirement entity);
|
||||
public void approve(TripRequirement entity);
|
||||
|
||||
public void loadPassangers(TripRequirement entity);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,52 @@
|
||||
package info.bukova.isspst.validators;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.zkoss.bind.ValidationContext;
|
||||
|
||||
public class TripRequirementFormValidator extends BaseValidator {
|
||||
|
||||
private final static Logger log = LoggerFactory.getLogger(TripRequirementFormValidator.class);
|
||||
|
||||
@Override
|
||||
protected Logger getLogger()
|
||||
{
|
||||
return log;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(ValidationContext ctx) {
|
||||
if (!this.validateIsNotNull(ctx, "centre", "RequirementCenterIsEmpty", null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.validateIsNotNull(ctx, "tripDate", "TripDateIsEmpty", null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.validateIsNotNull(ctx, "endDate", "EndDateIsEmpty", null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.validateIsNotNullOrNotEmpty(ctx, "from", "FromIsEmpty", null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.validateIsNotNullOrNotEmpty(ctx, "to", "ToIsEmpty", null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.validateIsNotNull(ctx, "vehicle", "VehicleIsEmpty", null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue