Esempio n. 1
0
  public boolean isCorrectConsecutiveDate(TaskQualityFormItem item) {
    if (item.getPassed()) {
      return (isPassedPreviousItem(item)) && (isLaterToPreviousItemDate(item));
    }

    return item.getDate() == null;
  }
Esempio n. 2
0
  public boolean isLaterToPreviousItemDate(TaskQualityFormItem item) {
    Integer previousPosition = item.getPosition() - 1;
    if ((previousPosition >= 0) && (previousPosition < taskQualityFormItems.size())) {
      Date previousDate = taskQualityFormItems.get(previousPosition).getDate();
      return (previousDate != null)
          && (item.getDate() != null)
          && ((previousDate.before(item.getDate())) || (previousDate.equals(item.getDate())));
    }

    return true;
  }
Esempio n. 3
0
 private void createTaskQualityFormItems() {
   Validate.notNull(qualityForm);
   for (QualityFormItem qualityFormItem : qualityForm.getQualityFormItems()) {
     TaskQualityFormItem taskQualityFormItem = TaskQualityFormItem.create(qualityFormItem);
     taskQualityFormItems.add(taskQualityFormItem);
   }
 }
Esempio n. 4
0
  public boolean isPassedPreviousItem(TaskQualityFormItem item) {
    Integer previousPosition = item.getPosition() - 1;

    if ((previousPosition >= 0) && (previousPosition < taskQualityFormItems.size())) {
      return taskQualityFormItems.get(previousPosition).getPassed();
    }

    return true;
  }
Esempio n. 5
0
 public boolean isCorrectConsecutivePassed(TaskQualityFormItem item) {
   return !item.getPassed() || (isPassedPreviousItem(item));
 }