Subversion Repositories SmartDukaan

Rev

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

Rev 27291 Rev 27292
Line 18... Line 18...
18
 
18
 
19
import org.apache.commons.io.output.ByteArrayOutputStream;
19
import org.apache.commons.io.output.ByteArrayOutputStream;
20
import org.apache.commons.lang.StringUtils;
20
import org.apache.commons.lang.StringUtils;
21
import org.apache.logging.log4j.LogManager;
21
import org.apache.logging.log4j.LogManager;
22
import org.apache.logging.log4j.Logger;
22
import org.apache.logging.log4j.Logger;
-
 
23
import org.apache.solr.common.util.Hash;
23
import org.openqa.selenium.Dimension;
24
import org.openqa.selenium.Dimension;
24
import org.openqa.selenium.OutputType;
25
import org.openqa.selenium.OutputType;
25
import org.openqa.selenium.TakesScreenshot;
26
import org.openqa.selenium.TakesScreenshot;
26
import org.openqa.selenium.WebDriver;
27
import org.openqa.selenium.WebDriver;
27
import org.openqa.selenium.chrome.ChromeDriver;
28
import org.openqa.selenium.chrome.ChromeDriver;
Line 1010... Line 1011...
1010
					List<UserWalletHistory> userWalletHistory = userWalletHistoryRepository.selectAllByreferenceIdandreferenceType(fofoOrder.getId(), WalletReferenceType.SCHEME_OUT);
1011
					List<UserWalletHistory> userWalletHistory = userWalletHistoryRepository.selectAllByreferenceIdandreferenceType(fofoOrder.getId(), WalletReferenceType.SCHEME_OUT);
1011
					totalAmount += userWalletHistory.stream().collect(Collectors.summingInt(y->y.getAmount()));
1012
					totalAmount += userWalletHistory.stream().collect(Collectors.summingInt(y->y.getAmount()));
1012
					/*walletService.rollbackAmountFromWallet(fofoOrder.getFofoId(), totalAmount, fofoOrder.getId(), WalletReferenceType.SCHEME_OUT, 
1013
					/*walletService.rollbackAmountFromWallet(fofoOrder.getFofoId(), totalAmount, fofoOrder.getId(), WalletReferenceType.SCHEME_OUT, 
1013
							"Same order for Invoice-"+ invoiceNumber + "created twice, duplicate invoice rollback", fofoOrder.getCancelledTimestamp());*/
1014
							"Same order for Invoice-"+ invoiceNumber + "created twice, duplicate invoice rollback", fofoOrder.getCancelledTimestamp());*/
1014
					List<SchemeInOut> schemeInOuts = schemeInOutRepository.selectByInventoryItemIds(new HashSet<>(Arrays.asList(inventoryItemId)));
1015
					List<SchemeInOut> schemeInOuts = schemeInOutRepository.selectByInventoryItemIds(new HashSet<>(Arrays.asList(inventoryItemId)));
-
 
1016
					Set<Integer> schemeIds = new HashSet<>();
1015
					for(SchemeInOut sio : schemeInOuts) {
1017
					for(SchemeInOut sio : schemeInOuts) {
1016
						if(Math.abs(sio.getCreateTimestamp().getMinute() - fofoOrder.getCreateTimestamp().getMinute()) <= 1) {
1018
						if(Math.abs(sio.getCreateTimestamp().getMinute() - fofoOrder.getCreateTimestamp().getMinute()) <= 1) {
1017
							LOGGER.info(sio);
1019
							LOGGER.info(sio);
-
 
1020
							if(!schemeIds.contains(sio.getSchemeId())) {
-
 
1021
								schemeIds.add(sio.getSchemeId());
-
 
1022
							} else {
1018
							schemeReverseAmount += sio.getAmount();
1023
								schemeReverseAmount += sio.getAmount();
-
 
1024
							}
1019
						}
1025
						}
1020
					}
1026
					}
1021
					
1027
					
1022
				} 
1028
				} 
1023
				//Remove order id
1029
				//Remove order id