[Bug #786] Fix bug
The error was happening due to using Dates instead of LocalDates. The start of the satisfaction was in the middle of a day and the received Date was at the start, so the first day was considered outside of the criterion satisfaction's interval. Criterion satisfactions now use LocalDates instead of Dates and this problem is fixed. FEA: ItEr67S04BugFixing
This commit is contained in:
parent
7dc622d17c
commit
a5f1cf4f65
25 changed files with 197 additions and 177 deletions
|
|
@ -20,7 +20,6 @@
|
|||
package org.navalplanner.business.planner.entities;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
|
|
@ -81,14 +80,14 @@ public class AvailabilityCalculator {
|
|||
AvailabilityTimeLine result = AvailabilityTimeLine.allValid();
|
||||
LocalDate previousEnd = null;
|
||||
for (CriterionSatisfaction each : satisfactions) {
|
||||
LocalDate startDate = asLocal(each.getStartDate());
|
||||
LocalDate startDate = each.getStartDate();
|
||||
assert startDate != null : "satisfactions start date is not null";
|
||||
if (previousEnd == null) {
|
||||
result.invalidUntil(startDate);
|
||||
} else {
|
||||
result.invalidAt(previousEnd, startDate);
|
||||
}
|
||||
previousEnd = asLocal(each.getEndDate());
|
||||
previousEnd = each.getEndDate();
|
||||
if (previousEnd == null) {
|
||||
break;
|
||||
}
|
||||
|
|
@ -99,8 +98,4 @@ public class AvailabilityCalculator {
|
|||
return result;
|
||||
}
|
||||
|
||||
private static LocalDate asLocal(Date date) {
|
||||
return date != null ? LocalDate.fromDateFields(date) : null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ public class GenericResourceAllocation extends
|
|||
public boolean isSelectable(Resource resource, LocalDate day) {
|
||||
ICriterion compoundCriterion = CriterionCompounder.buildAnd(
|
||||
criterions).getResult();
|
||||
return compoundCriterion.isSatisfiedBy(resource, toDate(day));
|
||||
return compoundCriterion.isSatisfiedBy(resource, day);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@ import java.util.ArrayList;
|
|||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
|
@ -38,6 +37,7 @@ import org.hibernate.validator.AssertTrue;
|
|||
import org.hibernate.validator.NotEmpty;
|
||||
import org.hibernate.validator.NotNull;
|
||||
import org.hibernate.validator.Valid;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.navalplanner.business.common.IntegrationEntity;
|
||||
import org.navalplanner.business.common.Registry;
|
||||
import org.navalplanner.business.planner.entities.GenericResourceAllocation;
|
||||
|
|
@ -240,13 +240,13 @@ public class Criterion extends IntegrationEntity implements ICriterion {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isSatisfiedBy(Resource resource, Date start, Date end) {
|
||||
public boolean isSatisfiedBy(Resource resource, LocalDate start, LocalDate end) {
|
||||
return !resource.query().from(this).enforcedInAll(
|
||||
Interval.range(start, end)).result().isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSatisfiedBy(Resource resource, Date atThisDate) {
|
||||
public boolean isSatisfiedBy(Resource resource, LocalDate atThisDate) {
|
||||
return !resource.query().from(this).enforcedInAll(
|
||||
Interval.point(atThisDate)).result().isEmpty();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,10 +22,11 @@ package org.navalplanner.business.resources.entities;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
|
||||
/**
|
||||
* Compounds some {@link ICriterion} into one <br />
|
||||
* @author Óscar González Fernández <ogonzalez@igalia.com>
|
||||
|
|
@ -70,12 +71,12 @@ public class CriterionCompounder {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isSatisfiedBy(Resource resource, Date start, Date end) {
|
||||
public boolean isSatisfiedBy(Resource resource, LocalDate start, LocalDate end) {
|
||||
return !criterion.isSatisfiedBy(resource, start, end);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSatisfiedBy(Resource resource, Date atThisDate) {
|
||||
public boolean isSatisfiedBy(Resource resource, LocalDate atThisDate) {
|
||||
return !criterion.isSatisfiedBy(resource, atThisDate);
|
||||
}
|
||||
}
|
||||
|
|
@ -98,7 +99,7 @@ public class CriterionCompounder {
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean isSatisfiedBy(Resource resource, Date start, Date end) {
|
||||
public boolean isSatisfiedBy(Resource resource, LocalDate start, LocalDate end) {
|
||||
for (ICriterion criterion : criterions) {
|
||||
if (criterion.isSatisfiedBy(resource, start, end)) {
|
||||
return true;
|
||||
|
|
@ -108,7 +109,7 @@ public class CriterionCompounder {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isSatisfiedBy(Resource resource, Date atThisDate) {
|
||||
public boolean isSatisfiedBy(Resource resource, LocalDate atThisDate) {
|
||||
for (ICriterion criterion : criterions) {
|
||||
if (criterion.isSatisfiedBy(resource, atThisDate)) {
|
||||
return true;
|
||||
|
|
@ -152,7 +153,7 @@ public class CriterionCompounder {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isSatisfiedBy(Resource resource, Date start, Date end) {
|
||||
public boolean isSatisfiedBy(Resource resource, LocalDate start, LocalDate end) {
|
||||
for (ICriterion criterion : criterions) {
|
||||
if (!criterion.isSatisfiedBy(resource, start, end)) {
|
||||
return false;
|
||||
|
|
@ -162,7 +163,7 @@ public class CriterionCompounder {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isSatisfiedBy(Resource resource, Date atThisDate) {
|
||||
public boolean isSatisfiedBy(Resource resource, LocalDate atThisDate) {
|
||||
for (ICriterion criterion : criterions) {
|
||||
if (!criterion.isSatisfiedBy(resource, atThisDate)) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -21,13 +21,13 @@
|
|||
package org.navalplanner.business.resources.entities;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.apache.commons.lang.builder.ToStringBuilder;
|
||||
import org.hibernate.validator.AssertTrue;
|
||||
import org.hibernate.validator.NotNull;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.navalplanner.business.common.IntegrationEntity;
|
||||
import org.navalplanner.business.common.Registry;
|
||||
import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
|
||||
|
|
@ -57,12 +57,10 @@ public class CriterionSatisfaction extends IntegrationEntity {
|
|||
return create(new CriterionSatisfaction());
|
||||
}
|
||||
|
||||
public static CriterionSatisfaction create(Date startDate,
|
||||
public static CriterionSatisfaction create(LocalDate startDate,
|
||||
Criterion criterion, Resource resource) {
|
||||
|
||||
return create(
|
||||
new CriterionSatisfaction(startDate, criterion, resource));
|
||||
|
||||
}
|
||||
|
||||
public static CriterionSatisfaction create(Criterion criterion,
|
||||
|
|
@ -76,10 +74,10 @@ public class CriterionSatisfaction extends IntegrationEntity {
|
|||
* @throws InstanceNotFoundException if criterion type or criterion does
|
||||
* not exist
|
||||
*/
|
||||
public static CriterionSatisfaction createUnvalidated(
|
||||
String code, String criterionTypeName, String criterionName,
|
||||
Resource resource, Date startDate, Date finishDate)
|
||||
throws InstanceNotFoundException {
|
||||
public static CriterionSatisfaction createUnvalidated(String code,
|
||||
String criterionTypeName, String criterionName, Resource resource,
|
||||
LocalDate startDate, LocalDate finishDate)
|
||||
throws InstanceNotFoundException {
|
||||
|
||||
ICriterionTypeDAO criterionTypeDAO =
|
||||
Registry.getCriterionTypeDAO();
|
||||
|
|
@ -110,7 +108,7 @@ public class CriterionSatisfaction extends IntegrationEntity {
|
|||
* not exist
|
||||
*/
|
||||
public void updateUnvalidated(String criterionTypeName,
|
||||
String criterionName, Date startDate, Date finishDate)
|
||||
String criterionName, LocalDate startDate, LocalDate finishDate)
|
||||
throws InstanceNotFoundException {
|
||||
|
||||
CriterionType criterionType = null;
|
||||
|
|
@ -149,7 +147,7 @@ public class CriterionSatisfaction extends IntegrationEntity {
|
|||
|
||||
}
|
||||
|
||||
private CriterionSatisfaction(Date startDate, Criterion criterion,
|
||||
private CriterionSatisfaction(LocalDate startDate, Criterion criterion,
|
||||
Resource resource) {
|
||||
Validate.notNull(startDate, "startDate must be not null");
|
||||
Validate.notNull(criterion, "criterion must be not null");
|
||||
|
|
@ -167,9 +165,9 @@ public class CriterionSatisfaction extends IntegrationEntity {
|
|||
}
|
||||
}
|
||||
|
||||
private Date startDate;
|
||||
private LocalDate startDate;
|
||||
|
||||
private Date finishDate;
|
||||
private LocalDate finishDate;
|
||||
|
||||
private Criterion criterion;
|
||||
|
||||
|
|
@ -192,16 +190,12 @@ public class CriterionSatisfaction extends IntegrationEntity {
|
|||
}
|
||||
|
||||
@NotNull(message="criterion satisfaction's start date not specified")
|
||||
public Date getStartDate() {
|
||||
return startDate != null ? new Date(startDate.getTime()) : null;
|
||||
public LocalDate getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public Date getEndDate() {
|
||||
if (isFinished()) {
|
||||
return new Date(finishDate.getTime());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
public LocalDate getEndDate() {
|
||||
return finishDate;
|
||||
}
|
||||
|
||||
public Interval getInterval() {
|
||||
|
|
@ -227,11 +221,11 @@ public class CriterionSatisfaction extends IntegrationEntity {
|
|||
}
|
||||
|
||||
public boolean isCurrent() {
|
||||
Date now = new Date();
|
||||
return isEnforcedAt(now);
|
||||
LocalDate today = new LocalDate();
|
||||
return isEnforcedAt(today);
|
||||
}
|
||||
|
||||
public boolean isEnforcedAt(Date date) {
|
||||
public boolean isEnforcedAt(LocalDate date) {
|
||||
return getInterval().contains(date);
|
||||
}
|
||||
|
||||
|
|
@ -239,30 +233,31 @@ public class CriterionSatisfaction extends IntegrationEntity {
|
|||
return getInterval().includes(interval);
|
||||
}
|
||||
|
||||
public void finish(Date finish) {
|
||||
public void finish(LocalDate finish) {
|
||||
Validate.notNull(finish);
|
||||
Validate.isTrue(getStartDate() == null
|
||||
|| getStartDate().equals(finish) || getStartDate().before(finish));
|
||||
Validate.isTrue(finishDate == null || isNewObject() ||
|
||||
getEndDate().equals(finish) || getEndDate().before(finish));
|
||||
this.finishDate = new Date(finish.getTime());
|
||||
|| getStartDate().compareTo(finish) <= 0);
|
||||
Validate.isTrue(finishDate == null || isNewObject()
|
||||
|| getEndDate().equals(finish) || getEndDate().isBefore(finish));
|
||||
this.finishDate = finish;
|
||||
}
|
||||
|
||||
public boolean isFinished() {
|
||||
return finishDate != null;
|
||||
}
|
||||
|
||||
public void setEndDate(Date date) {
|
||||
if(date != null) {
|
||||
public void setEndDate(LocalDate date) {
|
||||
if (date != null) {
|
||||
finish(date);
|
||||
}
|
||||
this.finishDate = date;
|
||||
}
|
||||
|
||||
public void setStartDate(Date date) {
|
||||
public void setStartDate(LocalDate date) {
|
||||
if(date != null){
|
||||
Validate.isTrue(startDate == null || isNewObject() ||
|
||||
getStartDate().equals(date) || getStartDate().after(date));
|
||||
Validate.isTrue(startDate == null || isNewObject()
|
||||
|| getStartDate().equals(date)
|
||||
|| getStartDate().isAfter(date));
|
||||
}
|
||||
startDate = date;
|
||||
}
|
||||
|
|
@ -307,7 +302,7 @@ public class CriterionSatisfaction extends IntegrationEntity {
|
|||
return true;
|
||||
}
|
||||
|
||||
return (finishDate.after(startDate) || startDate.equals(finishDate));
|
||||
return (finishDate.isAfter(startDate) || startDate.equals(finishDate));
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@
|
|||
|
||||
package org.navalplanner.business.resources.entities;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
|
||||
/**
|
||||
* It's a predicate that can be applied on resources <br />
|
||||
|
|
@ -30,8 +31,8 @@ public interface ICriterion {
|
|||
|
||||
boolean isSatisfiedBy(Resource resource);
|
||||
|
||||
boolean isSatisfiedBy(Resource resource, Date start, Date end);
|
||||
boolean isSatisfiedBy(Resource resource, LocalDate start, LocalDate end);
|
||||
|
||||
boolean isSatisfiedBy(Resource resource, Date atThisDate);
|
||||
boolean isSatisfiedBy(Resource resource, LocalDate atThisDate);
|
||||
|
||||
}
|
||||
|
|
@ -20,28 +20,29 @@
|
|||
|
||||
package org.navalplanner.business.resources.entities;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
import org.joda.time.LocalDate;
|
||||
|
||||
/**
|
||||
* Represents a time interval <br />
|
||||
* @author Óscar González Fernández <ogonzalez@igalia.com>
|
||||
*/
|
||||
public abstract class Interval {
|
||||
protected final Date start;
|
||||
protected final Date end;
|
||||
protected final LocalDate start;
|
||||
|
||||
public static Interval from(Date start) {
|
||||
protected final LocalDate end;
|
||||
|
||||
public static Interval from(LocalDate start) {
|
||||
return new OpenEndedInterval(start);
|
||||
}
|
||||
|
||||
public static Interval point(Date date) {
|
||||
public static Interval point(LocalDate date) {
|
||||
return new Point(date);
|
||||
}
|
||||
|
||||
public static Interval range(Date start, Date end) {
|
||||
public static Interval range(LocalDate start, LocalDate end) {
|
||||
Validate.notNull(start, "start date must be not null");
|
||||
if (end == null) {
|
||||
return from(start);
|
||||
|
|
@ -52,7 +53,7 @@ public abstract class Interval {
|
|||
return new Range(start, end);
|
||||
}
|
||||
|
||||
protected Interval(Date start, Date end) {
|
||||
protected Interval(LocalDate start, LocalDate end) {
|
||||
Validate.notNull(start, "start date must be not null");
|
||||
if (end != null) {
|
||||
Validate.isTrue(start.compareTo(end) <= 0,
|
||||
|
|
@ -62,7 +63,7 @@ public abstract class Interval {
|
|||
this.end = end;
|
||||
}
|
||||
|
||||
public abstract boolean contains(Date date);
|
||||
public abstract boolean contains(LocalDate date);
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
|
@ -79,7 +80,7 @@ public abstract class Interval {
|
|||
return new HashCodeBuilder().append(start).append(end).toHashCode();
|
||||
}
|
||||
|
||||
private boolean dateEquals(Date date1, Date date2) {
|
||||
private boolean dateEquals(LocalDate date1, LocalDate date2) {
|
||||
return date1 == date2
|
||||
|| (date1 != null && date2 != null && date1.equals(date2));
|
||||
}
|
||||
|
|
@ -88,30 +89,30 @@ public abstract class Interval {
|
|||
|
||||
public abstract boolean overlapsWith(Interval interval);
|
||||
|
||||
public boolean before(Date date) {
|
||||
return start.before(date);
|
||||
public boolean before(LocalDate date) {
|
||||
return start.isBefore(date);
|
||||
}
|
||||
|
||||
public Date getStart() {
|
||||
return new Date(start.getTime());
|
||||
public LocalDate getStart() {
|
||||
return start;
|
||||
}
|
||||
|
||||
public Date getEnd() {
|
||||
return end != null ? new Date(end.getTime()) : null;
|
||||
public LocalDate getEnd() {
|
||||
return end;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Range extends Interval {
|
||||
|
||||
Range(Date start, Date end) {
|
||||
Range(LocalDate start, LocalDate end) {
|
||||
super(start, end);
|
||||
Validate.notNull(start);
|
||||
Validate.notNull(end);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(Date date) {
|
||||
public boolean contains(LocalDate date) {
|
||||
return date.compareTo(start) >= 0 && date.compareTo(end) < 0;
|
||||
}
|
||||
|
||||
|
|
@ -122,7 +123,7 @@ class Range extends Interval {
|
|||
return point.overlapsWith(this);
|
||||
}
|
||||
return start.compareTo(included.start) <= 0 && included.end != null
|
||||
&& end.after(included.end);
|
||||
&& end.isAfter(included.end);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -147,12 +148,12 @@ class Range extends Interval {
|
|||
}
|
||||
|
||||
class OpenEndedInterval extends Interval {
|
||||
OpenEndedInterval(Date start) {
|
||||
OpenEndedInterval(LocalDate start) {
|
||||
super(start, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(Date date) {
|
||||
public boolean contains(LocalDate date) {
|
||||
return date.compareTo(start) >= 0;
|
||||
}
|
||||
|
||||
|
|
@ -163,8 +164,8 @@ class OpenEndedInterval extends Interval {
|
|||
|
||||
@Override
|
||||
public boolean overlapsWith(Interval interval) {
|
||||
return start.before(interval.start) || interval.end == null
|
||||
|| start.before(interval.end);
|
||||
return start.isBefore(interval.start) || interval.end == null
|
||||
|| start.isBefore(interval.end);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -175,12 +176,12 @@ class OpenEndedInterval extends Interval {
|
|||
|
||||
class Point extends Interval {
|
||||
|
||||
Point(Date date) {
|
||||
Point(LocalDate date) {
|
||||
super(date, date);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(Date date) {
|
||||
public boolean contains(LocalDate date) {
|
||||
return start.equals(date);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ package org.navalplanner.business.resources.entities;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
import org.navalplanner.business.common.BaseEntity;
|
||||
import org.navalplanner.business.util.deepcopy.OnCopy;
|
||||
import org.navalplanner.business.util.deepcopy.Strategy;
|
||||
|
|
@ -85,4 +86,19 @@ public class MachineWorkerAssignment extends BaseEntity {
|
|||
return worker;
|
||||
}
|
||||
|
||||
public LocalDate getStart() {
|
||||
return asLocalDate(startDate);
|
||||
}
|
||||
|
||||
public LocalDate getFinish() {
|
||||
return asLocalDate(finishDate);
|
||||
}
|
||||
|
||||
private LocalDate asLocalDate(Date date) {
|
||||
if (date == null) {
|
||||
return null;
|
||||
}
|
||||
return LocalDate.fromDateFields(date);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,10 +152,9 @@ public class MachineWorkersConfigurationUnit extends BaseEntity {
|
|||
if ((each.getWorker().getId().equals(worker.getId()))
|
||||
&& (each.getId() != assignment.getId())) {
|
||||
if (each.getFinishDate() != null) {
|
||||
range = Interval.range(each.getStartDate(), each
|
||||
.getFinishDate());
|
||||
range = Interval.range(each.getStart(), each.getFinish());
|
||||
} else {
|
||||
range = Interval.from(each.getStartDate());
|
||||
range = Interval.from(each.getStart());
|
||||
}
|
||||
if ((range == null) || (interval.overlapsWith(range))) {
|
||||
assigned = true;
|
||||
|
|
@ -191,10 +190,9 @@ public class MachineWorkersConfigurationUnit extends BaseEntity {
|
|||
for (MachineWorkerAssignment each : workerAssignments) {
|
||||
if (each.getStartDate() != null) {
|
||||
if (each.getFinishDate() != null) {
|
||||
range = Interval.range(each.getStartDate(), each
|
||||
.getFinishDate());
|
||||
range = Interval.range(each.getStart(), each.getFinish());
|
||||
} else {
|
||||
range = Interval.from(each.getStartDate());
|
||||
range = Interval.from(each.getStart());
|
||||
}
|
||||
if (((range == null)
|
||||
&& existsWorkerAssignmentWithSameWorker(each) || (existsWorkerAssignmentWithSameWorker(
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ import java.util.Arrays;
|
|||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
|
|
@ -267,11 +266,11 @@ public abstract class Resource extends IntegrationEntity {
|
|||
return this;
|
||||
}
|
||||
|
||||
public Query at(Date date) {
|
||||
public Query at(LocalDate date) {
|
||||
return enforcedInAll(Interval.point(date));
|
||||
}
|
||||
|
||||
public Query between(Date start, Date end) {
|
||||
public Query between(LocalDate start, LocalDate end) {
|
||||
return enforcedInAll(Interval.range(start, end));
|
||||
}
|
||||
|
||||
|
|
@ -415,7 +414,8 @@ public abstract class Resource extends IntegrationEntity {
|
|||
|
||||
public CriterionSatisfaction addSatisfaction(
|
||||
CriterionWithItsType criterionWithItsType) {
|
||||
return addSatisfaction(criterionWithItsType, Interval.from(new Date()));
|
||||
LocalDate today = new LocalDate();
|
||||
return addSatisfaction(criterionWithItsType, Interval.from(today));
|
||||
}
|
||||
|
||||
private static class EnsureSatisfactionIsCorrect {
|
||||
|
|
@ -516,11 +516,12 @@ public abstract class Resource extends IntegrationEntity {
|
|||
|
||||
public List<CriterionSatisfaction> finish(
|
||||
CriterionWithItsType criterionWithItsType) {
|
||||
return finishEnforcedAt(criterionWithItsType.getCriterion(), new Date());
|
||||
LocalDate today = new LocalDate();
|
||||
return finishEnforcedAt(criterionWithItsType.getCriterion(), today);
|
||||
}
|
||||
|
||||
public List<CriterionSatisfaction> finishEnforcedAt(Criterion criterion,
|
||||
Date date) {
|
||||
LocalDate date) {
|
||||
ArrayList<CriterionSatisfaction> result = new ArrayList<CriterionSatisfaction>();
|
||||
for (CriterionSatisfaction criterionSatisfaction : query().from(
|
||||
criterion).at(date).result()) {
|
||||
|
|
@ -898,11 +899,7 @@ public abstract class Resource extends IntegrationEntity {
|
|||
|
||||
private boolean satisfiesCriterionAt(ICriterion criterionToSatisfy,
|
||||
LocalDate current) {
|
||||
return criterionToSatisfy.isSatisfiedBy(this, asDate(current));
|
||||
}
|
||||
|
||||
private Date asDate(LocalDate date) {
|
||||
return date.toDateTimeAtStartOfDay().toDateTime().toDate();
|
||||
return criterionToSatisfy.isSatisfiedBy(this, current);
|
||||
}
|
||||
|
||||
public void addUnvalidatedSatisfaction(CriterionSatisfaction
|
||||
|
|
|
|||
|
|
@ -52,4 +52,10 @@
|
|||
</update>
|
||||
</changeSet>
|
||||
|
||||
<changeSet id="change-types-of-start-and-finish-date-for-criterion-satisfaction" author="ogonzalez">
|
||||
<comment>Change types of start and finish date to date for criterion satisfaction table</comment>
|
||||
<modifyDataType tableName="criterion_satisfaction" columnName="start_date" newDataType="DATE"/>
|
||||
<modifyDataType tableName="criterion_satisfaction" columnName="finish_date" newDataType="DATE"/>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
|
|
|
|||
|
|
@ -145,8 +145,10 @@
|
|||
</id>
|
||||
<version name="version" access="property" type="long" />
|
||||
<property name="code" access="property" not-null="true" unique="true"/>
|
||||
<property access="field" name="startDate" not-null="true" column="start_date" />
|
||||
<property access="field" name="finishDate" column="finish_date" />
|
||||
<property access="field" name="startDate" not-null="true" column="start_date"
|
||||
type="org.joda.time.contrib.hibernate.PersistentLocalDate"/>
|
||||
<property access="field" name="finishDate" column="finish_date"
|
||||
type="org.joda.time.contrib.hibernate.PersistentLocalDate"/>
|
||||
<property access="field" name="isDeleted" column="is_deleted" />
|
||||
|
||||
<!-- Indexed. It is not probable to ask for the criterion satisfactions of a criterion -->
|
||||
|
|
|
|||
|
|
@ -114,7 +114,8 @@ public class AddAdvanceAssignmentsToOrderElementTest {
|
|||
.setupVersionUsing(scenarioManager, order);
|
||||
order.useSchedulingDataFor(orderVersion);
|
||||
order.setDescription("description");
|
||||
order.setInitDate(CriterionSatisfactionDAOTest.year(2000));
|
||||
order.setInitDate(CriterionSatisfactionDAOTest.year(2000)
|
||||
.toDateTimeAtStartOfDay().toDate());
|
||||
order.setName("name");
|
||||
order.setResponsible("responsible");
|
||||
order.setCode("code");
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ import static org.navalplanner.business.workingday.EffortDuration.zero;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
|
@ -143,8 +142,9 @@ public class GenericResourceAllocationTest {
|
|||
}
|
||||
|
||||
private void setupIsSatisfiedByAll(Criterion criterion) {
|
||||
expect(criterion.isSatisfiedBy(isA(Resource.class), isA(Date.class)))
|
||||
.andReturn(true).anyTimes();
|
||||
expect(
|
||||
criterion.isSatisfiedBy(isA(Resource.class),
|
||||
isA(LocalDate.class))).andReturn(true).anyTimes();
|
||||
}
|
||||
|
||||
private void givenWorkersWithoutLoadAndWithoutCalendar() {
|
||||
|
|
@ -199,7 +199,7 @@ public class GenericResourceAllocationTest {
|
|||
|
||||
private org.navalplanner.business.resources.entities.Interval fromVeryEarlyTime() {
|
||||
return org.navalplanner.business.resources.entities.Interval
|
||||
.from(new Date(0));
|
||||
.from(new LocalDate(0, 1, 1));
|
||||
}
|
||||
|
||||
private void givenCalendarsForResources(int capacity1, int capacity2,
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@ import static junit.framework.Assert.assertTrue;
|
|||
import static org.navalplanner.business.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_FILE;
|
||||
import static org.navalplanner.business.test.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_TEST_FILE;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.navalplanner.business.common.exceptions.InstanceNotFoundException;
|
||||
|
|
@ -109,20 +107,12 @@ public class CriterionSatisfactionDAOTest {
|
|||
satisfactionDAO.save(criterionSatisfaction);
|
||||
}
|
||||
|
||||
public static Date year(int year) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.clear();
|
||||
calendar.set(Calendar.YEAR, year);
|
||||
return calendar.getTime();
|
||||
public static LocalDate year(int year) {
|
||||
return new LocalDate(year, 1, 1);
|
||||
}
|
||||
|
||||
public static Date date(int year,int month, int day) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.clear();
|
||||
calendar.set(Calendar.YEAR, year);
|
||||
calendar.set(Calendar.MONTH, month);
|
||||
calendar.set(Calendar.DAY_OF_MONTH, day);
|
||||
return calendar.getTime();
|
||||
public static LocalDate date(int year, int month, int day) {
|
||||
return new LocalDate(year, month, day);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -29,8 +29,6 @@ import static org.junit.Assert.assertThat;
|
|||
import static org.navalplanner.business.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_FILE;
|
||||
import static org.navalplanner.business.test.BusinessGlobalNames.BUSINESS_SPRING_CONFIG_TEST_FILE;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
|
|
@ -39,6 +37,7 @@ import java.util.Set;
|
|||
import java.util.UUID;
|
||||
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.navalplanner.business.calendars.entities.ResourceCalendar;
|
||||
|
|
@ -148,19 +147,14 @@ public class ResourceDAOTest {
|
|||
|
||||
private Worker createAndSaveResourceSatisfyingAllCriterions(final Collection<Criterion> criterions) {
|
||||
Worker result = givenValidWorker();
|
||||
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
|
||||
try {
|
||||
Interval interval = Interval.range(sdf.parse("01/01/1970"), null);
|
||||
Set<CriterionSatisfaction> satisfactions = new HashSet<CriterionSatisfaction>();
|
||||
for (Criterion each: criterions) {
|
||||
satisfactions.add(CriterionSatisfaction.create(each, result, interval));
|
||||
}
|
||||
result.addSatisfactions(satisfactions);
|
||||
resourceDAO.save(result);
|
||||
} catch (ParseException e) {
|
||||
|
||||
Interval interval = Interval.range(new LocalDate(1970, 1, 1), null);
|
||||
Set<CriterionSatisfaction> satisfactions = new HashSet<CriterionSatisfaction>();
|
||||
for (Criterion each : criterions) {
|
||||
satisfactions.add(CriterionSatisfaction.create(each, result,
|
||||
interval));
|
||||
}
|
||||
result.addSatisfactions(satisfactions);
|
||||
resourceDAO.save(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ import static org.navalplanner.business.test.resources.daos.CriterionSatisfactio
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
import org.junit.Test;
|
||||
import org.navalplanner.business.resources.entities.Criterion;
|
||||
import org.navalplanner.business.resources.entities.CriterionSatisfaction;
|
||||
|
|
@ -50,20 +50,17 @@ public class CriterionSatisfactionTest {
|
|||
final Criterion criterion = CriterionDAOTest.createValidCriterion();
|
||||
Worker worker = Worker.create("firstName", "surName", "2333232");
|
||||
CriterionSatisfaction criterionSatisfaction = CriterionSatisfaction.create(year(2000), criterion, worker);
|
||||
Date end = year(2006);
|
||||
LocalDate end = year(2006);
|
||||
criterionSatisfaction.finish(end);
|
||||
assertTrue(criterionSatisfaction.isFinished());
|
||||
assertEquals(end, criterionSatisfaction.getEndDate());
|
||||
criterionSatisfaction.getEndDate().setTime(end.getTime() + 2000);
|
||||
assertEquals("endDate must be well encapsulated", end,
|
||||
criterionSatisfaction.getEndDate());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void canFinishWhenItStarted() throws Exception {
|
||||
final Criterion criterion = CriterionDAOTest.createValidCriterion();
|
||||
Worker worker = Worker.create("firstName", "surName", "2333232");
|
||||
Date start = year(2000);
|
||||
LocalDate start = year(2000);
|
||||
CriterionSatisfaction criterionSatisfaction = CriterionSatisfaction.create(start, criterion, worker);
|
||||
criterionSatisfaction.finish(start);
|
||||
assertTrue(criterionSatisfaction.isFinished());
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ import static org.navalplanner.business.resources.entities.CriterionCompounder.b
|
|||
import static org.navalplanner.business.resources.entities.CriterionCompounder.not;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import org.joda.time.LocalDate;
|
||||
import org.junit.Test;
|
||||
import org.navalplanner.business.resources.entities.Criterion;
|
||||
import org.navalplanner.business.resources.entities.CriterionCompounder;
|
||||
|
|
@ -207,12 +207,12 @@ public class CriterionTest {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isSatisfiedBy(Resource resource, Date start, Date end) {
|
||||
public boolean isSatisfiedBy(Resource resource, LocalDate start, LocalDate end) {
|
||||
return isSatisfiedBy(resource);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSatisfiedBy(Resource resource, Date atThisDate) {
|
||||
public boolean isSatisfiedBy(Resource resource, LocalDate atThisDate) {
|
||||
return isSatisfiedBy(resource);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -25,8 +25,6 @@ import static org.junit.Assert.assertFalse;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
import static org.navalplanner.business.test.resources.daos.CriterionSatisfactionDAOTest.year;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.navalplanner.business.resources.entities.Interval;
|
||||
import org.navalplanner.business.test.resources.daos.CriterionSatisfactionDAOTest;
|
||||
|
|
@ -82,9 +80,8 @@ public class IntervalTest {
|
|||
Interval range = Interval.range(year(1990), year(2000));
|
||||
assertTrue(range.contains(year(1990)));
|
||||
assertFalse(range.contains(year(2000)));
|
||||
assertFalse(range.contains(new Date(year(1990).getTime() - 1)));
|
||||
assertFalse(range.contains(new Date(year(1990).getTime() - 1)));
|
||||
assertFalse(range.contains(new Date(year(2000).getTime() + 1)));
|
||||
assertFalse(range.contains(year(1990).minusDays(1)));
|
||||
assertFalse(range.contains(year(2000).plusDays(1)));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ import static org.navalplanner.business.workingday.EffortDuration.hours;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -243,7 +242,7 @@ public class ResourceTest {
|
|||
assertThat(worker.getCurrentSatisfactionsFor(criterion).size(),
|
||||
equalTo(0));
|
||||
assertFalse(criterion.isSatisfiedBy(worker));
|
||||
Interval fromNow = Interval.from(new Date());
|
||||
Interval fromNow = Interval.from(new LocalDate());
|
||||
assertTrue(worker.canAddSatisfaction(new CriterionWithItsType(
|
||||
criterionType, criterion), fromNow));
|
||||
worker.addSatisfaction(new CriterionWithItsType(criterionType,
|
||||
|
|
@ -490,8 +489,9 @@ public class ResourceTest {
|
|||
};
|
||||
CriterionWithItsType criterionWithItsType = new CriterionWithItsType(
|
||||
type, criterion);
|
||||
assertFalse(worker.canAddSatisfaction(criterionWithItsType, Interval
|
||||
.from(new Date())));
|
||||
LocalDate today = new LocalDate();
|
||||
assertFalse(worker.canAddSatisfaction(criterionWithItsType,
|
||||
Interval.from(today)));
|
||||
worker.addSatisfaction(criterionWithItsType);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ package org.navalplanner.web.resources.machine;
|
|||
import static org.navalplanner.web.I18nHelper._;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
|
@ -390,11 +389,9 @@ public class AssignedMachineCriterionsModel extends IntegrationEntityModel
|
|||
.getCriterionSatisfaction();
|
||||
Criterion newCriterion = satisfactionDTO.getCriterionWithItsType()
|
||||
.getCriterion();
|
||||
Date newStartDate = satisfactionDTO.getStartDate();
|
||||
Date newEndDate = satisfactionDTO.getEndDate();
|
||||
satisfaction.setCriterion(newCriterion);
|
||||
satisfaction.setStartDate(newStartDate);
|
||||
satisfaction.setEndDate(newEndDate);
|
||||
satisfaction.setStartDate(satisfactionDTO.getStart());
|
||||
satisfaction.setEndDate(satisfactionDTO.getEnd());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -442,9 +439,9 @@ public class AssignedMachineCriterionsModel extends IntegrationEntityModel
|
|||
if (satisfactionDTO.isIsDeleted()) {
|
||||
satisfaction.setIsDeleted(true);
|
||||
} else {
|
||||
satisfaction.setStartDate(satisfactionDTO.getStartDate());
|
||||
satisfaction.setStartDate(satisfactionDTO.getStart());
|
||||
if (satisfactionDTO.getEndDate() != null) {
|
||||
satisfaction.finish(satisfactionDTO.getEndDate());
|
||||
satisfaction.finish(satisfactionDTO.getEnd());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -369,9 +369,9 @@ public class AssignedCriterionsModel extends IntegrationEntityModel implements
|
|||
if (satisfactionDTO.isIsDeleted()) {
|
||||
satisfaction.setIsDeleted(true);
|
||||
} else {
|
||||
satisfaction.setStartDate(satisfactionDTO.getStartDate());
|
||||
satisfaction.setStartDate(satisfactionDTO.getStart());
|
||||
if (satisfactionDTO.getEndDate() != null) {
|
||||
satisfaction.finish(satisfactionDTO.getEndDate());
|
||||
satisfaction.finish(satisfactionDTO.getEnd());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
|
||||
import org.hibernate.validator.NotNull;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.navalplanner.business.INewObject;
|
||||
import org.navalplanner.business.resources.entities.Criterion;
|
||||
import org.navalplanner.business.resources.entities.CriterionSatisfaction;
|
||||
|
|
@ -63,9 +64,9 @@ public class CriterionSatisfactionDTO implements INewObject {
|
|||
private String criterionAndType;
|
||||
|
||||
@NotNull
|
||||
private Date startDate;
|
||||
private LocalDate startDate;
|
||||
|
||||
private Date endDate;
|
||||
private LocalDate endDate;
|
||||
|
||||
@NotNull
|
||||
private CriterionWithItsType criterionWithItsType;
|
||||
|
|
@ -80,13 +81,13 @@ public class CriterionSatisfactionDTO implements INewObject {
|
|||
this.setNewObject(true);
|
||||
this.state = "";
|
||||
this.criterionAndType = "";
|
||||
this.startDate = new Date();
|
||||
this.startDate = new LocalDate();
|
||||
this.endDate = null;
|
||||
}
|
||||
|
||||
public CriterionSatisfactionDTO(CriterionSatisfaction criterionSatisfaction) {
|
||||
this.setStartDate(criterionSatisfaction.getStartDate());
|
||||
this.setEndDate(criterionSatisfaction.getEndDate());
|
||||
this.startDate = criterionSatisfaction.getStartDate();
|
||||
this.endDate = criterionSatisfaction.getEndDate();
|
||||
this.state = "";
|
||||
this.criterionAndType = "";
|
||||
this.setCriterionSatisfaction(criterionSatisfaction);
|
||||
|
|
@ -132,11 +133,26 @@ public class CriterionSatisfactionDTO implements INewObject {
|
|||
}
|
||||
|
||||
public Date getStartDate() {
|
||||
return startDate != null ? new Date(startDate.getTime()) : null;
|
||||
return asDate(startDate);
|
||||
}
|
||||
|
||||
public LocalDate getStart() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public LocalDate getEnd() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public Date getEndDate() {
|
||||
return endDate != null ? new Date(endDate.getTime()) : null;
|
||||
return asDate(endDate);
|
||||
}
|
||||
|
||||
private Date asDate(LocalDate localDate) {
|
||||
if (localDate == null) {
|
||||
return null;
|
||||
}
|
||||
return localDate.toDateTimeAtStartOfDay().toDate();
|
||||
}
|
||||
|
||||
public CriterionSatisfaction getCriterionSatisfaction() {
|
||||
|
|
@ -164,11 +180,11 @@ public class CriterionSatisfactionDTO implements INewObject {
|
|||
}
|
||||
|
||||
public void setStartDate(Date startDate) {
|
||||
this.startDate = startDate;
|
||||
this.startDate = asLocalDate(startDate);
|
||||
}
|
||||
|
||||
public void setEndDate(Date endDate) {
|
||||
this.endDate = endDate;
|
||||
this.endDate = asLocalDate(endDate);
|
||||
}
|
||||
|
||||
public void setIsDeleted(boolean isDeleted) {
|
||||
|
|
@ -194,7 +210,7 @@ public class CriterionSatisfactionDTO implements INewObject {
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean isPreviousStartDate(Date startDate){
|
||||
public boolean isPreviousStartDate(LocalDate startDate) {
|
||||
if (newObject) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -207,7 +223,11 @@ public class CriterionSatisfactionDTO implements INewObject {
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean isGreaterStartDate(Date endDate){
|
||||
public boolean isPreviousStartDate(Date value) {
|
||||
return isPreviousStartDate(asLocalDate(value));
|
||||
}
|
||||
|
||||
public boolean isGreaterStartDate(Date endDate) {
|
||||
if (getStartDate() == null || endDate == null) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -217,7 +237,7 @@ public class CriterionSatisfactionDTO implements INewObject {
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean isPostEndDate(Date endDate){
|
||||
public boolean isPostEndDate(LocalDate endDate) {
|
||||
if (newObject) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -233,6 +253,17 @@ public class CriterionSatisfactionDTO implements INewObject {
|
|||
return false;
|
||||
}
|
||||
|
||||
public boolean isPostEndDate(Date value) {
|
||||
return isPostEndDate(asLocalDate(value));
|
||||
}
|
||||
|
||||
private LocalDate asLocalDate(Date value) {
|
||||
if (value == null) {
|
||||
return null;
|
||||
}
|
||||
return LocalDate.fromDateFields(value);
|
||||
}
|
||||
|
||||
public String getCriterionAndType() {
|
||||
if (criterionWithItsType == null) {
|
||||
return criterionAndType;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ import static org.navalplanner.web.I18nHelper._;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
|
@ -33,6 +32,7 @@ import java.util.Map;
|
|||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang.Validate;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.navalplanner.business.calendars.daos.IBaseCalendarDAO;
|
||||
import org.navalplanner.business.calendars.entities.BaseCalendar;
|
||||
import org.navalplanner.business.calendars.entities.CalendarData;
|
||||
|
|
@ -437,7 +437,8 @@ public class WorkerModel extends IntegrationEntityModel implements IWorkerModel
|
|||
}
|
||||
|
||||
private CriterionSatisfaction createSatisfactionFor(Criterion criterion) {
|
||||
return CriterionSatisfaction.create(new Date(), criterion, resource);
|
||||
return CriterionSatisfaction.create(new LocalDate(), criterion,
|
||||
resource);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -167,8 +167,8 @@ public class ResourceConverter {
|
|||
StringUtils.trim(criterionSatisfactionDTO.criterionTypeName),
|
||||
StringUtils.trim(criterionSatisfactionDTO.criterionName),
|
||||
resource,
|
||||
DateConverter.toDate(criterionSatisfactionDTO.startDate),
|
||||
DateConverter.toDate(criterionSatisfactionDTO.endDate));
|
||||
DateConverter.toLocalDate(criterionSatisfactionDTO.startDate),
|
||||
DateConverter.toLocalDate(criterionSatisfactionDTO.endDate));
|
||||
|
||||
} catch (InstanceNotFoundException e) {
|
||||
|
||||
|
|
@ -340,8 +340,8 @@ public class ResourceConverter {
|
|||
criterionSatisfaction.updateUnvalidated(
|
||||
StringUtils.trim(criterionSatisfactionDTO.criterionTypeName),
|
||||
StringUtils.trim(criterionSatisfactionDTO.criterionName),
|
||||
DateConverter.toDate(criterionSatisfactionDTO.startDate),
|
||||
DateConverter.toDate(criterionSatisfactionDTO.endDate));
|
||||
DateConverter.toLocalDate(criterionSatisfactionDTO.startDate),
|
||||
DateConverter.toLocalDate(criterionSatisfactionDTO.endDate));
|
||||
|
||||
} catch (InstanceNotFoundException e) {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue