Reimplemented getHoursAdvancePercentage() to avoid calling OrderElementDAO.getHoursAdvancePercentage().
The DAO method makes recursive calls over all the children of the order. The reimplementation uses the pre-calculated data on the TaskElement to prevent recursive calls. FEA: ItEr61S03RFPerformanceCompanyView
This commit is contained in:
parent
222c966f20
commit
79425a183f
1 changed files with 14 additions and 4 deletions
|
|
@ -337,11 +337,21 @@ public class TaskElementAdapter implements ITaskElementAdapter {
|
|||
@Override
|
||||
public BigDecimal getHoursAdvancePercentage() {
|
||||
OrderElement orderElement = taskElement.getOrderElement();
|
||||
if (orderElement != null) {
|
||||
return orderElementDAO.getHoursAdvancePercentage(orderElement);
|
||||
} else {
|
||||
return new BigDecimal(0);
|
||||
if (orderElement == null) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
Integer totalChargedHours = orderElement.getSumChargedHours() != null ? orderElement
|
||||
.getSumChargedHours().getTotalChargedHours() : new Integer(0);
|
||||
BigDecimal assignedHours = new BigDecimal(totalChargedHours).setScale(2);
|
||||
|
||||
BigDecimal estimatedHours = new BigDecimal(taskElement.getSumOfHoursAllocated())
|
||||
.setScale(2);
|
||||
|
||||
if (estimatedHours.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return assignedHours.divide(estimatedHours, RoundingMode.DOWN);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue