Subversion Repositories SmartDukaan

Rev

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

Rev 31088 Rev 31090
Line 71... Line 71...
71
import com.spice.profitmandi.service.pricing.PriceDropService;
71
import com.spice.profitmandi.service.pricing.PriceDropService;
72
import com.spice.profitmandi.service.scheme.SchemeService;
72
import com.spice.profitmandi.service.scheme.SchemeService;
73
import com.spice.profitmandi.service.transaction.TransactionService;
73
import com.spice.profitmandi.service.transaction.TransactionService;
74
import com.spice.profitmandi.service.transaction.invoicing.InvoiceService;
74
import com.spice.profitmandi.service.transaction.invoicing.InvoiceService;
75
import com.spice.profitmandi.service.user.RetailerService;
75
import com.spice.profitmandi.service.user.RetailerService;
-
 
76
import com.spice.profitmandi.service.wallet.CommonPaymentService;
76
import com.spice.profitmandi.service.wallet.WalletService;
77
import com.spice.profitmandi.service.wallet.WalletService;
77
import com.spice.profitmandi.service.warehouse.WarehouseInventoryService;
78
import com.spice.profitmandi.service.warehouse.WarehouseInventoryService;
78
import in.shop2020.model.v1.order.OrderStatus;
79
import in.shop2020.model.v1.order.OrderStatus;
79
import in.shop2020.model.v1.order.WalletReferenceType;
80
import in.shop2020.model.v1.order.WalletReferenceType;
80
import okhttp3.OkHttpClient;
81
import okhttp3.OkHttpClient;
Line 1115... Line 1116...
1115
	CartRepository cartRepository;
1116
	CartRepository cartRepository;
1116
 
1117
 
1117
	@Autowired
1118
	@Autowired
1118
	CartService cartService;
1119
	CartService cartService;
1119
 
1120
 
-
 
1121
	@Autowired
-
 
1122
	private CommonPaymentService commonPaymentService;
-
 
1123
	;
-
 
1124
 
1120
	public void getSweet() throws Exception {
1125
	public void getSweet() throws Exception {
1121
		List<Integer> fofoIds = Arrays.asList(175139179, 175139178, 175138987, 175138174, 175138843, 175139094, 175135227, 175138908, 175138814, 175139015, 175135707, 175138886, 175139211, 175139130, 159690067, 175139161, 175138842, 175138867, 175139218, 175127215, 175139238, 175139267, 175138541, 175139248, 175138989, 175139232, 175139257, 175138840, 175138829, 175138836, 175139242, 175139217, 175139246, 175139222, 175139256, 175139261, 175139154, 175139266, 175138906, 175138820, 175138951, 175139255, 175139172, 175139264, 175138863, 175139029, 175138934, 175139258, 175139270, 175138408, 175139180, 175139230, 175135923, 175139237, 175139227, 175139191, 175139268, 175139203, 166900459, 175138982, 175139236, 175139205, 175139241, 175138875, 175139184, 175138948, 175139176, 175139189, 175139019, 175139233, 175139204, 175138868, 175139138, 175139262, 175139207, 175138871, 175139188, 175138929, 175139199, 167996137, 175139102, 175139259, 175139260, 175138827, 175139082, 175139158, 175139229, 175139149, 175139073, 175139215, 175139249, 175139223, 175139235, 175139006, 175139107, 175138970, 175139123, 175139114, 175139074, 175139135, 175138883, 175139187, 175139247, 175138856, 175138983, 175138832, 175139190, 175139231, 175139079, 157327507, 175138864, 175139129, 175139214, 175138876, 175139212, 175139146, 175139150, 175139069, 175139025, 175139202, 175139224, 175139243, 175138958, 175139045, 175139108, 175139195, 175139164, 175139181, 175139013, 175138844, 175139226, 175138816, 175139219, 175139088, 175138897, 175139081, 175139197, 175138931);
1126
		List<Integer> fofoIds = Arrays.asList(175139179, 175139178, 175138987, 175138174, 175138843, 175139094, 175135227, 175138908, 175138814, 175139015, 175135707, 175138886, 175139211, 175139130, 159690067, 175139161, 175138842, 175138867, 175139218, 175127215, 175139238, 175139267, 175138541, 175139248, 175138989, 175139232, 175139257, 175138840, 175138829, 175138836, 175139242, 175139217, 175139246, 175139222, 175139256, 175139261, 175139154, 175139266, 175138906, 175138820, 175138951, 175139255, 175139172, 175139264, 175138863, 175139029, 175138934, 175139258, 175139270, 175138408, 175139180, 175139230, 175135923, 175139237, 175139227, 175139191, 175139268, 175139203, 166900459, 175138982, 175139236, 175139205, 175139241, 175138875, 175139184, 175138948, 175139176, 175139189, 175139019, 175139233, 175139204, 175138868, 175139138, 175139262, 175139207, 175138871, 175139188, 175138929, 175139199, 167996137, 175139102, 175139259, 175139260, 175138827, 175139082, 175139158, 175139229, 175139149, 175139073, 175139215, 175139249, 175139223, 175139235, 175139006, 175139107, 175138970, 175139123, 175139114, 175139074, 175139135, 175138883, 175139187, 175139247, 175138856, 175138983, 175138832, 175139190, 175139231, 175139079, 157327507, 175138864, 175139129, 175139214, 175138876, 175139212, 175139146, 175139150, 175139069, 175139025, 175139202, 175139224, 175139243, 175138958, 175139045, 175139108, 175139195, 175139164, 175139181, 175139013, 175138844, 175139226, 175138816, 175139219, 175139088, 175138897, 175139081, 175139197, 175138931);
1122
		for (int fofoId : fofoIds) {
1127
		for (int fofoId : fofoIds) {
1123
			User user = userRepository.selectById(fofoId);
1128
			User user = userRepository.selectById(fofoId);
1124
			UserCart uc = new UserCart();
1129
			UserCart uc = new UserCart();
Line 1129... Line 1134...
1129
			cartItem.setItemId(33855);
1134
			cartItem.setItemId(33855);
1130
			cartItem.setSellingPrice(0.1d);
1135
			cartItem.setSellingPrice(0.1d);
1131
			cartItem.setQuantity(1);
1136
			cartItem.setQuantity(1);
1132
			cartItems.add(cartItem);
1137
			cartItems.add(cartItem);
1133
			cartService.addItemsToCart(uc.getCartId(), cartItems);
1138
			cartService.addItemsToCart(uc.getCartId(), cartItems);
1134
			transactionService.createTransaction(uc, 0.1, 0);
1139
			int transactionId = transactionService.createTransaction(uc, 0.1, 0);
-
 
1140
			commonPaymentService.payThroughWallet(transactionId);
-
 
1141
			// Once paid let proceed to process the order further.
-
 
1142
 
-
 
1143
			transactionService.processTransaction(transactionId);
1135
		}
1144
		}
1136
	}
1145
	}
1137
 
1146
 
1138
	private class SioTuple {
1147
	private class SioTuple {
1139
		int inventoryId;
1148
		int inventoryId;