@Override protected void onSave() { task.setDuration(ganttObject.getDuration()); taskDao.update(task); }
private boolean isDurationModified(final GanttTask ganttObject, final TaskDO task) { return task != null && NumberHelper.isEqual(ganttObject.getDuration(), task.getDuration()) == false; }
return node.getCalculatedStartDate(); final int durationDays = node.getDuration() != null ? node.getDuration().setScale(0, RoundingMode.HALF_UP).intValue() : 0; if (node.getDuration() != null && node.getEndDate() != null) { final Date startDate = calculateDate(node.getEndDate(), -durationDays); node.setCalculatedStartDate(startDate).setStartDateCalculated(true); if (startDate == null && node.getDuration() != null) { final Date calculatedEndDate = getCalculatedEndDate(node, startDateSet, endDateSet); if (calculatedEndDate != null) {
return node.getCalculatedEndDate(); final int durationDays = node.getDuration() != null ? node.getDuration().setScale(0, RoundingMode.HALF_UP).intValue() : 0; if (node.getDuration() != null && node.getStartDate() != null) { final Date endDate = calculateDate(node.getStartDate(), durationDays); node.setCalculatedEndDate(endDate).setEndDateCalculated(true); GanttRelationType.START_FINISH) == false)) && node.getChildren() != null && node.getDuration() == null) { if (endDate == null && node.getDuration() != null) { final Date calculatedStartDate = getCalculatedStartDate(node, startDateSet, endDateSet); if (calculatedStartDate != null) {
private void assertDurationAndProgress(final GanttTask root, final Integer id, final BigDecimal expectedDuration, final Integer expectedProgress) { final GanttTask task = root.findById(id); assertTrue(NumberHelper.isEqual(expectedDuration, task.getDuration())); if (expectedProgress == null) { assertNull(task.getProgress()); } else { assertEquals(expectedProgress, task.getProgress()); } }
task.setFinish(ganttTask.getEndDate()); final BigDecimal duration = ganttTask.getDuration(); final double value; if (duration == null) {
/** * Creates a new GanttTask and copies all fields from the given task (excluding the predecessor and any children). * @param task * @return */ public static final TaskDO convertToTask(final GanttTask ganttObject) { final TaskDO task = new TaskDO(); // Do not copy the id! The id is given by the data base. task.setGanttPredecessorOffset(ganttObject.getPredecessorOffset()); task.setGanttRelationType(ganttObject.getRelationType()); task.setDuration(ganttObject.getDuration()); task.setStartDate(ganttObject.getStartDate()); task.setEndDate(ganttObject.getEndDate()); task.setProgress(ganttObject.getProgress()); task.setGanttObjectType(ganttObject.getType()); task.setDescription(ganttObject.getDescription()); task.setTitle(ganttObject.getTitle()); return task; }