Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class ReleaseFlagI077Processor extends AbstractFlaggedReleaseFlagProcesso
frequentSuppliersMap;

private Date now;
private Double nowDouble;

@Autowired
private FrequentSuppliersTimeIntervalController frequentSuppliersTimeIntervalController;
Expand All @@ -45,8 +46,8 @@ protected void setFlag(Flag flag, FlaggedRelease flaggable) {
}

protected Integer getInterval(Date awardDate) {
return new Double(Math.ceil((now.getTime() - awardDate.getTime())
/ (GenericOCDSController.DAY_MS * INTERVAL_DAYS))).intValue();
return new Double(Math.ceil((nowDouble - awardDate.getTime())
/ GenericOCDSController.DAY_MS / INTERVAL_DAYS)).intValue();
}

@Override
Expand All @@ -59,7 +60,7 @@ protected Boolean calculateFlag(FlaggedRelease flaggable, StringBuffer rationale
supplier.getId(), getInterval(award.getDate()))
))
).map(award -> rationale
.append("Award ").append(award.getId()).append(" flagged"))
.append("Award ").append(award.getId()).append(" flagged; "))
.count() > 0;
}

Expand All @@ -70,6 +71,7 @@ protected Boolean calculateFlag(FlaggedRelease flaggable, StringBuffer rationale
@Override
public void reInitialize() {
now = new Date();
nowDouble = new Double(now.getTime());
List<FrequentSuppliersTimeIntervalController.FrequentSuppliersResponse> frequentSuppliersTimeInterval
= frequentSuppliersTimeIntervalController.frequentSuppliersTimeInterval(getIntervalDays(),
getMaxAwards(), now);
Expand Down