Subversion Repositories SmartDukaan

Rev

Rev 25708 | Rev 25721 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 25708 Rev 25709
Line 1535... Line 1535...
1535
						.max((x1, x2) -> x1.getCreateTimestamp().compareTo(x2.getCreateTimestamp())).get();
1535
						.max((x1, x2) -> x1.getCreateTimestamp().compareTo(x2.getCreateTimestamp())).get();
1536
				if (scanRecord.getCreateTimestamp().isAfter(scheme.getEndDateTime())
1536
				if (scanRecord.getCreateTimestamp().isAfter(scheme.getEndDateTime())
1537
						|| scanRecord.getCreateTimestamp().isBefore(scheme.getStartDateTime())) {
1537
						|| scanRecord.getCreateTimestamp().isBefore(scheme.getStartDateTime())) {
1538
					sio.setRolledBackTimestamp(LocalDateTime.now());
1538
					sio.setRolledBackTimestamp(LocalDateTime.now());
1539
					FofoOrder fofoOrder = fofoOrderRepository.selectByOrderId(scanRecord.getOrderId());
1539
					FofoOrder fofoOrder = fofoOrderRepository.selectByOrderId(scanRecord.getOrderId());
1540
					String rollbackReason = "Scheme rolledback twice for "
1540
					String rollbackReason = "Scheme reversed for "
1541
							+ itemRepository.selectById(inventoryItem.getItemId()).getItemDescription() + "/"
1541
							+ itemRepository.selectById(inventoryItem.getItemId()).getItemDescription() + "/Inv - "
1542
							+ fofoOrder.getInvoiceNumber();
1542
							+ fofoOrder.getInvoiceNumber();
1543
					walletService.rollbackAmountFromWallet(scanRecord.getFofoId(), sio.getAmount(),
1543
					walletService.rollbackAmountFromWallet(scanRecord.getFofoId(), sio.getAmount(),
1544
							scanRecord.getOrderId(), WalletReferenceType.SCHEME_OUT, rollbackReason);
1544
							scanRecord.getOrderId(), WalletReferenceType.SCHEME_OUT, rollbackReason);
1545
					System.out.printf("Amount %f,SchemeId %d,Reason %s\n", sio.getAmount(), sio.getSchemeId(),
1545
					System.out.printf("Amount %f,SchemeId %d,Reason %s\n", sio.getAmount(), sio.getSchemeId(),
1546
							rollbackReason);
1546
							rollbackReason);
1547
				}
1547
				}
1548
			}
1548
			}
1549
		}
1549
		}
1550
		throw new Exception();
1550
		//throw new Exception();
1551
	}
1551
	}
1552
}
1552
}