Subversion Repositories SmartDukaan

Rev

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

Rev 26632 Rev 26648
Line 32... Line 32...
32
import com.eclipsesource.json.JsonObject;
32
import com.eclipsesource.json.JsonObject;
33
import com.google.gson.Gson;
33
import com.google.gson.Gson;
34
import com.google.gson.reflect.TypeToken;
34
import com.google.gson.reflect.TypeToken;
35
import com.spice.profitmandi.common.enumuration.SchemeType;
35
import com.spice.profitmandi.common.enumuration.SchemeType;
36
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
36
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
-
 
37
import com.spice.profitmandi.common.model.CreatePendingOrderRequest;
37
import com.spice.profitmandi.common.model.ProfitMandiConstants;
38
import com.spice.profitmandi.common.model.ProfitMandiConstants;
38
import com.spice.profitmandi.common.model.UserInfo;
39
import com.spice.profitmandi.common.model.UserInfo;
39
import com.spice.profitmandi.common.solr.SolrService;
40
import com.spice.profitmandi.common.solr.SolrService;
40
import com.spice.profitmandi.common.web.client.RestClient;
41
import com.spice.profitmandi.common.web.client.RestClient;
41
import com.spice.profitmandi.common.web.util.ResponseSender;
42
import com.spice.profitmandi.common.web.util.ResponseSender;
Line 52... Line 53...
52
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
53
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
53
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
54
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
54
import com.spice.profitmandi.dao.repository.dtr.Mongo;
55
import com.spice.profitmandi.dao.repository.dtr.Mongo;
55
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
56
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
56
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
57
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
-
 
58
import com.spice.profitmandi.dao.repository.fofo.PendingOrderService;
57
import com.spice.profitmandi.dao.repository.inventory.ItemAvailabilityCacheRepository;
59
import com.spice.profitmandi.dao.repository.inventory.ItemAvailabilityCacheRepository;
58
import com.spice.profitmandi.service.authentication.RoleManager;
60
import com.spice.profitmandi.service.authentication.RoleManager;
59
import com.spice.profitmandi.service.inventory.FofoAvailabilityInfo;
61
import com.spice.profitmandi.service.inventory.FofoAvailabilityInfo;
60
import com.spice.profitmandi.service.inventory.FofoCatalogResponse;
62
import com.spice.profitmandi.service.inventory.FofoCatalogResponse;
61
import com.spice.profitmandi.service.pricing.PricingService;
63
import com.spice.profitmandi.service.pricing.PricingService;
Line 89... Line 91...
89
 
91
 
90
	@Autowired
92
	@Autowired
91
	private PricingService pricingService;
93
	private PricingService pricingService;
92
 
94
 
93
	@Autowired
95
	@Autowired
-
 
96
	private PendingOrderService   pendingOrderService;
-
 
97
 
-
 
98
	@Autowired
94
	private CategoryRepository categoryRepository;
99
	private CategoryRepository categoryRepository;
95
 
100
 
96
	@Autowired
101
	@Autowired
97
	private SolrService commonSolrService;
102
	private SolrService commonSolrService;
98
 
103
 
Line 228... Line 233...
228
 
233
 
229
		return responseSender.ok(dealBrandsResponse);
234
		return responseSender.ok(dealBrandsResponse);
230
	}
235
	}
231
 
236
 
232
	@RequestMapping(value = "/store/otp/generateOTP", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
237
	@RequestMapping(value = "/store/otp/generateOTP", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
233
	public ResponseEntity<?> cart(HttpServletRequest request, @RequestParam String email, @RequestParam String phone)
238
	public ResponseEntity<?> generateOtp(HttpServletRequest request, @RequestParam String email, @RequestParam String phone)
234
			throws Exception {
239
			throws Exception {
235
 
240
 
236
		return responseSender.ok(otpProcessor.generateOtp(email, phone, OtpType.PREBOOKING_ORDER));
241
		return responseSender.ok(otpProcessor.generateOtp(email, phone, OtpType.PREBOOKING_ORDER));
237
 
242
 
238
	}
243
	}
-
 
244
	
-
 
245
	@RequestMapping(value = "/store/confirmOrder", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
-
 
246
	public ResponseEntity<?> confirmCart(HttpServletRequest request, @RequestBody CreatePendingOrderRequest createPendingOrderRequest)
-
 
247
			throws Exception {
-
 
248
		UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
-
 
249
		Integer storeId = userInfo.getRetailerId();
-
 
250
		createPendingOrderRequest.setFofoId(storeId);
-
 
251
		this.
-
 
252
		pendingOrderService.createPendingOrder(createPendingOrderRequest);
-
 
253
		return responseSender.ok(true);
-
 
254
		
-
 
255
	}
239
 
256
 
240
	@RequestMapping(value = "/store/cart", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
257
	@RequestMapping(value = "/store/cart", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
241
	@ApiImplicitParams({
258
	@ApiImplicitParams({
242
			@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
259
			@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
243
	@ApiOperation(value = "Get brand list and count for category")
260
	@ApiOperation(value = "Get brand list and count for category")
Line 309... Line 326...
309
			cartItemResponseModels.add(cartItemResponseModel);
326
			cartItemResponseModels.add(cartItemResponseModel);
310
		}
327
		}
311
		ValidateCartResponse vc = new ValidateCartResponse(cartResponse, "Success", "Items added to cart successfully");
328
		ValidateCartResponse vc = new ValidateCartResponse(cartResponse, "Success", "Items added to cart successfully");
312
		return responseSender.ok(vc);
329
		return responseSender.ok(vc);
313
	}
330
	}
-
 
331
	
-
 
332
	private boolean validateCart(int storeId, List<CartItem> cartItems) {
-
 
333
		return false;
-
 
334
	}
314
 
335
 
315
	private List<FofoCatalogResponse> getCatalogResponse(JSONArray docs, boolean hotDeal)
336
	private List<FofoCatalogResponse> getCatalogResponse(JSONArray docs, boolean hotDeal)
316
			throws ProfitMandiBusinessException {
337
			throws ProfitMandiBusinessException {
317
		Map<Integer, TagListing> itemTagListingMap = null;
338
		Map<Integer, TagListing> itemTagListingMap = null;
318
		List<FofoCatalogResponse> dealResponse = new ArrayList<>();
339
		List<FofoCatalogResponse> dealResponse = new ArrayList<>();