| Line 356... |
Line 356... |
| 356 |
if (x.getExpireTimestamp() != null && x.getExpireTimestamp().isBefore(x.getEndDateTime())) {
|
356 |
if (x.getExpireTimestamp() != null && x.getExpireTimestamp().isBefore(x.getEndDateTime())) {
|
| 357 |
endDateTime = x.getExpireTimestamp();
|
357 |
endDateTime = x.getExpireTimestamp();
|
| 358 |
}
|
358 |
}
|
| 359 |
for (SchemeInOut sio : sioList) {
|
359 |
for (SchemeInOut sio : sioList) {
|
| 360 |
InventoryItem inventoryItem = null;
|
360 |
InventoryItem inventoryItem = null;
|
| 361 |
FofoOrder fofoOrder = null;
|
- |
|
| 362 |
try {
|
- |
|
| 363 |
inventoryItem = inventoryItemRepository.selectById(sio.getInventoryItemId());
|
361 |
inventoryItem = inventoryItemRepository.selectById(sio.getInventoryItemId());
|
| 364 |
fofoOrder = fofoOrderRepository.selectByFofoIdAndSerialNumber(inventoryItem.getFofoId(), inventoryItem.getSerialNumber(),
|
362 |
FofoOrder fofoOrder = fofoOrderRepository.selectByFofoIdAndSerialNumber(inventoryItem.getFofoId(), inventoryItem.getSerialNumber(),
|
| 365 |
null, null, 0, 1).get(0);
|
363 |
null, null, 0, 1).get(0);
|
| 366 |
} catch (ProfitMandiBusinessException e) {
|
- |
|
| 367 |
// TODO Auto-generated catch block
|
- |
|
| 368 |
e.printStackTrace();
|
- |
|
| 369 |
}
|
- |
|
| 370 |
Optional<ScanRecord> record = scanRecordRepository
|
364 |
Optional<ScanRecord> record = scanRecordRepository
|
| 371 |
.selectByInventoryItemId(sio.getInventoryItemId()).stream()
|
365 |
.selectByInventoryItemId(sio.getInventoryItemId()).stream()
|
| 372 |
.filter(y -> y.getType().equals(ScanType.SALE)).findFirst();
|
366 |
.filter(y -> y.getType().equals(ScanType.SALE)).findFirst();
|
| 373 |
if (record.isPresent()) {
|
367 |
if (record.isPresent()) {
|
| 374 |
int fofoId = record.get().getFofoId();
|
368 |
int fofoId = record.get().getFofoId();
|
| Line 406... |
Line 400... |
| 406 |
Utils.sendMailWithAttachment(googleMailSender, "adeel.yazdani@smartdukaan.com",
|
400 |
Utils.sendMailWithAttachment(googleMailSender, "adeel.yazdani@smartdukaan.com",
|
| 407 |
new String[] { "amit.gupta@shop2020.in" }, "Partner Excess Amount", "PFA"
|
401 |
new String[] { "amit.gupta@shop2020.in" }, "Partner Excess Amount", "PFA"
|
| 408 |
, "ListofSchemes.csv", new ByteArrayResource(baos.toByteArray()));
|
402 |
, "ListofSchemes.csv", new ByteArrayResource(baos.toByteArray()));
|
| 409 |
|
403 |
|
| 410 |
}
|
404 |
}
|
| 411 |
|
405 |
|
| 412 |
public void processScheme(int offset) throws Exception {
|
406 |
public void processScheme(int offset) throws Exception {
|
| 413 |
LocalDateTime startDate = LocalDateTime.of(LocalDate.now(), LocalTime.MIDNIGHT).minusDays(30*offset);
|
407 |
LocalDateTime startDate = LocalDateTime.of(LocalDate.now(), LocalTime.MIDNIGHT).minusDays(30*offset);
|
| 414 |
LocalDateTime endDate = startDate.plusDays(30);
|
408 |
LocalDateTime endDate = startDate.plusDays(30);
|
| 415 |
processScheme(startDate, endDate);
|
409 |
processScheme(startDate, endDate);
|
| 416 |
}
|
410 |
}
|