Subversion Repositories SmartDukaan

Rev

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

Rev 28402 Rev 28405
Line 23... Line 23...
23
import org.apache.logging.log4j.Logger;
23
import org.apache.logging.log4j.Logger;
24
import org.json.JSONArray;
24
import org.json.JSONArray;
25
import org.json.JSONObject;
25
import org.json.JSONObject;
26
import org.springframework.beans.factory.annotation.Autowired;
26
import org.springframework.beans.factory.annotation.Autowired;
27
import org.springframework.beans.factory.annotation.Value;
27
import org.springframework.beans.factory.annotation.Value;
28
import org.springframework.cache.annotation.Cacheable;
-
 
29
import org.springframework.http.MediaType;
28
import org.springframework.http.MediaType;
30
import org.springframework.http.ResponseEntity;
29
import org.springframework.http.ResponseEntity;
31
import org.springframework.stereotype.Controller;
30
import org.springframework.stereotype.Controller;
32
import org.springframework.transaction.annotation.Transactional;
31
import org.springframework.transaction.annotation.Transactional;
33
import org.springframework.web.bind.annotation.GetMapping;
32
import org.springframework.web.bind.annotation.GetMapping;
34
import org.springframework.web.bind.annotation.PathVariable;
33
import org.springframework.web.bind.annotation.PathVariable;
35
import org.springframework.web.bind.annotation.RequestBody;
34
import org.springframework.web.bind.annotation.RequestBody;
36
import org.springframework.web.bind.annotation.RequestMapping;
35
import org.springframework.web.bind.annotation.RequestMapping;
37
import org.springframework.web.bind.annotation.RequestMethod;
36
import org.springframework.web.bind.annotation.RequestMethod;
38
import org.springframework.web.bind.annotation.RequestParam;
37
import org.springframework.web.bind.annotation.RequestParam;
39
import org.springframework.web.bind.annotation.ResponseBody;
-
 
40
 
38
 
41
import com.eclipsesource.json.JsonObject;
39
import com.eclipsesource.json.JsonObject;
42
import com.fasterxml.jackson.annotation.JsonProperty;
40
import com.fasterxml.jackson.annotation.JsonProperty;
43
import com.google.gson.Gson;
41
import com.google.gson.Gson;
44
import com.google.gson.reflect.TypeToken;
42
import com.google.gson.reflect.TypeToken;
Line 51... Line 49...
51
import com.spice.profitmandi.common.model.ProfitMandiConstants;
49
import com.spice.profitmandi.common.model.ProfitMandiConstants;
52
import com.spice.profitmandi.common.model.SendNotificationModel;
50
import com.spice.profitmandi.common.model.SendNotificationModel;
53
import com.spice.profitmandi.common.model.UserInfo;
51
import com.spice.profitmandi.common.model.UserInfo;
54
import com.spice.profitmandi.common.solr.SolrService;
52
import com.spice.profitmandi.common.solr.SolrService;
55
import com.spice.profitmandi.common.util.FormattingUtils;
53
import com.spice.profitmandi.common.util.FormattingUtils;
-
 
54
import com.spice.profitmandi.common.util.Utils;
56
import com.spice.profitmandi.common.web.client.RestClient;
55
import com.spice.profitmandi.common.web.client.RestClient;
57
import com.spice.profitmandi.common.web.util.ResponseSender;
56
import com.spice.profitmandi.common.web.util.ResponseSender;
58
import com.spice.profitmandi.dao.entity.catalog.Item;
57
import com.spice.profitmandi.dao.entity.catalog.Item;
59
import com.spice.profitmandi.dao.entity.catalog.TagListing;
58
import com.spice.profitmandi.dao.entity.catalog.TagListing;
60
import com.spice.profitmandi.dao.entity.dtr.User;
59
import com.spice.profitmandi.dao.entity.dtr.User;
Line 64... Line 63...
64
import com.spice.profitmandi.dao.entity.fofo.CustomerAddress;
63
import com.spice.profitmandi.dao.entity.fofo.CustomerAddress;
65
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
64
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
66
import com.spice.profitmandi.dao.entity.fofo.PendingOrder;
65
import com.spice.profitmandi.dao.entity.fofo.PendingOrder;
67
import com.spice.profitmandi.dao.entity.fofo.PendingOrderItem;
66
import com.spice.profitmandi.dao.entity.fofo.PendingOrderItem;
68
import com.spice.profitmandi.dao.entity.fofo.PincodePartner;
67
import com.spice.profitmandi.dao.entity.fofo.PincodePartner;
69
import com.spice.profitmandi.dao.entity.fofo.RazorPay;
-
 
70
import com.spice.profitmandi.dao.enumuration.dtr.OtpType;
68
import com.spice.profitmandi.dao.enumuration.dtr.OtpType;
71
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
69
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
72
import com.spice.profitmandi.dao.model.AddCartRequest;
70
import com.spice.profitmandi.dao.model.AddCartRequest;
73
import com.spice.profitmandi.dao.model.CartItem;
71
import com.spice.profitmandi.dao.model.CartItem;
74
import com.spice.profitmandi.dao.model.CartItemResponseModel;
72
import com.spice.profitmandi.dao.model.CartItemResponseModel;
Line 87... Line 85...
87
import com.spice.profitmandi.dao.repository.fofo.CustomerRepository;
85
import com.spice.profitmandi.dao.repository.fofo.CustomerRepository;
88
import com.spice.profitmandi.dao.repository.fofo.PendingOrderItemRepository;
86
import com.spice.profitmandi.dao.repository.fofo.PendingOrderItemRepository;
89
import com.spice.profitmandi.dao.repository.fofo.PendingOrderRepository;
87
import com.spice.profitmandi.dao.repository.fofo.PendingOrderRepository;
90
import com.spice.profitmandi.dao.repository.fofo.PendingOrderService;
88
import com.spice.profitmandi.dao.repository.fofo.PendingOrderService;
91
import com.spice.profitmandi.dao.repository.fofo.PincodePartnerRepository;
89
import com.spice.profitmandi.dao.repository.fofo.PincodePartnerRepository;
92
import com.spice.profitmandi.dao.repository.fofo.RazorPayRepository;
-
 
93
import com.spice.profitmandi.dao.repository.inventory.ItemAvailabilityCacheRepository;
90
import com.spice.profitmandi.dao.repository.inventory.ItemAvailabilityCacheRepository;
94
import com.spice.profitmandi.service.CustomerService;
91
import com.spice.profitmandi.service.CustomerService;
95
import com.spice.profitmandi.service.EmailService;
92
import com.spice.profitmandi.service.EmailService;
96
import com.spice.profitmandi.service.NotificationService;
93
import com.spice.profitmandi.service.NotificationService;
97
import com.spice.profitmandi.service.authentication.RoleManager;
94
import com.spice.profitmandi.service.authentication.RoleManager;
Line 378... Line 375...
378
			Map<String, Object> emailModel = pendingOrderService.sendCreateOrderMail(pendingOrder);
375
			Map<String, Object> emailModel = pendingOrderService.sendCreateOrderMail(pendingOrder);
379
 
376
 
380
			CustomRetailer customRetailer = retailerService.getFofoRetailer(pendingOrder.getFofoId());
377
			CustomRetailer customRetailer = retailerService.getFofoRetailer(pendingOrder.getFofoId());
381
			Customer customer = customerRepository.selectById(pendingOrder.getCustomerId());
378
			Customer customer = customerRepository.selectById(pendingOrder.getCustomerId());
382
			String[] customerEmail = null;
379
			String[] customerEmail = null;
383
			if (customer.getEmailId() != null) {
380
			if (Utils.validateEmail(customer.getEmailId())) {
384
				customerEmail = new String[] { customer.getEmailId() };
381
				customerEmail = new String[] { customer.getEmailId() };
385
			}
382
			}
386
 
383
 
387
			List<String> bccTo = Arrays.asList("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com",
384
			List<String> bccTo = Arrays.asList("kamini.sharma@smartdukaan.com", "tarun.verma@smartdukaan.com",
388
					"hemant.kaura@smartdukaan.com", "niranjan.kala@smartdukaan.com", "sm@smartdukaan.com",
385
					"hemant.kaura@smartdukaan.com", "niranjan.kala@smartdukaan.com", "sm@smartdukaan.com",
Line 788... Line 785...
788
						fdi.setItem_id(itemId);
785
						fdi.setItem_id(itemId);
789
						Float cashBack = schemeService.getItemSchemeCashBack().get(itemId);
786
						Float cashBack = schemeService.getItemSchemeCashBack().get(itemId);
790
						cashBack = cashBack == null ? 0 : cashBack;
787
						cashBack = cashBack == null ? 0 : cashBack;
791
						// TODO:Dont commit
788
						// TODO:Dont commit
792
						// fdi.setCashback(Math.min(100, fdi.getMop()));
789
						// fdi.setCashback(Math.min(100, fdi.getMop()));
-
 
790
						fdi.setCashback(cashBack);
793
						fdi.setMinBuyQuantity(1);
791
						fdi.setMinBuyQuantity(1);
794
						int partnerAvailability = partnerStockAvailabilityMap.get(itemId) == null ? 0
792
						int partnerAvailability = partnerStockAvailabilityMap.get(itemId) == null ? 0
795
								: partnerStockAvailabilityMap.get(itemId);
793
								: partnerStockAvailabilityMap.get(itemId);
796
						int ourStockAvailability = ourItemAvailabilityMap.get(itemId) == null ? 0
794
						int ourStockAvailability = ourItemAvailabilityMap.get(itemId) == null ? 0
797
								: Math.max(0, ourItemAvailabilityMap.get(itemId));
795
								: Math.max(0, ourItemAvailabilityMap.get(itemId));