| Line 89... |
Line 89... |
| 89 |
String lastTimestampString = org.apache.commons.io.FileUtils.readFileToString(new File(REPORT_DIR + File.separator + "last.timestamp"));
|
89 |
String lastTimestampString = org.apache.commons.io.FileUtils.readFileToString(new File(REPORT_DIR + File.separator + "last.timestamp"));
|
| 90 |
lastTimestampString = lastTimestampString.replace("\"", "").replace("\n", "");
|
90 |
lastTimestampString = lastTimestampString.replace("\"", "").replace("\n", "");
|
| 91 |
long lastTimestamp = Long.parseLong(lastTimestampString);
|
91 |
long lastTimestamp = Long.parseLong(lastTimestampString);
|
| 92 |
|
92 |
|
| 93 |
String filename = "inventory-report." + year + "-" + month + "-" + day + "-" + lastTimestamp + ".xls";
|
93 |
String filename = "inventory-report." + year + "-" + month + "-" + day + "-" + lastTimestamp + ".xls";
|
| 94 |
if(lastTimestamp-currentTimestamp > REPORT_GENERATION_INTERVAL*60*60*1000){
|
94 |
if(currentTimestamp - lastTimestamp > REPORT_GENERATION_INTERVAL*60*60*1000){
|
| 95 |
filename = "inventory-report." + year + "-" + month + "-" + day + "-" + currentTimestamp + ".xls";
|
95 |
filename = "inventory-report." + year + "-" + month + "-" + day + "-" + currentTimestamp + ".xls";
|
| 96 |
File inventoryReportFile = new File(REPORT_DIR + File.separator + filename);
|
96 |
File inventoryReportFile = new File(REPORT_DIR + File.separator + filename);
|
| 97 |
ByteArrayOutputStream baosXLS = generateInventoryStockReport();
|
97 |
ByteArrayOutputStream baosXLS = generateInventoryStockReport();
|
| 98 |
if (baosXLS == null) {
|
98 |
if (baosXLS == null) {
|
| 99 |
errorMsg = "Could not get output";
|
99 |
errorMsg = "Could not get output";
|