| Line 33... |
Line 33... |
| 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.CreatePendingOrderRequest;
|
| - |
|
38 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
| 38 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
39 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 39 |
import com.spice.profitmandi.common.model.UserInfo;
|
40 |
import com.spice.profitmandi.common.model.UserInfo;
|
| 40 |
import com.spice.profitmandi.common.solr.SolrService;
|
41 |
import com.spice.profitmandi.common.solr.SolrService;
|
| 41 |
import com.spice.profitmandi.common.web.client.RestClient;
|
42 |
import com.spice.profitmandi.common.web.client.RestClient;
|
| 42 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
43 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| Line 59... |
Line 60... |
| 59 |
import com.spice.profitmandi.dao.repository.inventory.ItemAvailabilityCacheRepository;
|
60 |
import com.spice.profitmandi.dao.repository.inventory.ItemAvailabilityCacheRepository;
|
| 60 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
61 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
| 61 |
import com.spice.profitmandi.service.inventory.FofoAvailabilityInfo;
|
62 |
import com.spice.profitmandi.service.inventory.FofoAvailabilityInfo;
|
| 62 |
import com.spice.profitmandi.service.inventory.FofoCatalogResponse;
|
63 |
import com.spice.profitmandi.service.inventory.FofoCatalogResponse;
|
| 63 |
import com.spice.profitmandi.service.pricing.PricingService;
|
64 |
import com.spice.profitmandi.service.pricing.PricingService;
|
| - |
|
65 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 64 |
import com.spice.profitmandi.web.processor.OtpProcessor;
|
66 |
import com.spice.profitmandi.web.processor.OtpProcessor;
|
| 65 |
import com.spice.profitmandi.web.res.DealBrands;
|
67 |
import com.spice.profitmandi.web.res.DealBrands;
|
| 66 |
import com.spice.profitmandi.web.res.DealObjectResponse;
|
68 |
import com.spice.profitmandi.web.res.DealObjectResponse;
|
| 67 |
import com.spice.profitmandi.web.res.DealsResponse;
|
69 |
import com.spice.profitmandi.web.res.DealsResponse;
|
| 68 |
import com.spice.profitmandi.web.res.ValidateCartResponse;
|
70 |
import com.spice.profitmandi.web.res.ValidateCartResponse;
|
| Line 91... |
Line 93... |
| 91 |
|
93 |
|
| 92 |
@Autowired
|
94 |
@Autowired
|
| 93 |
private PricingService pricingService;
|
95 |
private PricingService pricingService;
|
| 94 |
|
96 |
|
| 95 |
@Autowired
|
97 |
@Autowired
|
| - |
|
98 |
private RetailerService retailerService;
|
| - |
|
99 |
|
| - |
|
100 |
@Autowired
|
| 96 |
private PendingOrderService pendingOrderService;
|
101 |
private PendingOrderService pendingOrderService;
|
| 97 |
|
102 |
|
| 98 |
@Autowired
|
103 |
@Autowired
|
| 99 |
private CategoryRepository categoryRepository;
|
104 |
private CategoryRepository categoryRepository;
|
| 100 |
|
105 |
|
| Line 252... |
Line 257... |
| 252 |
pendingOrderService.createPendingOrder(createPendingOrderRequest);
|
257 |
pendingOrderService.createPendingOrder(createPendingOrderRequest);
|
| 253 |
return responseSender.ok(true);
|
258 |
return responseSender.ok(true);
|
| 254 |
|
259 |
|
| 255 |
}
|
260 |
}
|
| 256 |
|
261 |
|
| 257 |
@RequestMapping(value = "/store/cart", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
262 |
@RequestMapping(value = "/store/address", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 258 |
@ApiImplicitParams({
|
263 |
@ApiImplicitParams({
|
| 259 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
264 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 260 |
@ApiOperation(value = "Get brand list and count for category")
|
265 |
@ApiOperation(value = "Get brand list and count for category")
|
| 261 |
public ResponseEntity<?> cart(HttpServletRequest request, @RequestBody AddCartRequest cartRequest)
|
266 |
public ResponseEntity<?> getAddress(HttpServletRequest request, @RequestBody AddCartRequest cartRequest)
|
| 262 |
throws Exception {
|
267 |
throws Exception {
|
| - |
|
268 |
UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
|
| - |
|
269 |
Integer storeId = userInfo.getRetailerId();
|
| - |
|
270 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(storeId);
|
| - |
|
271 |
|
| - |
|
272 |
return responseSender.ok(customRetailer.getAddress());
|
| - |
|
273 |
|
| - |
|
274 |
}
|
| - |
|
275 |
@RequestMapping(value = "/store/cart", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
| - |
|
276 |
@ApiImplicitParams({
|
| - |
|
277 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| - |
|
278 |
@ApiOperation(value = "Get brand list and count for category")
|
| - |
|
279 |
public ResponseEntity<?> cart(HttpServletRequest request, @RequestBody AddCartRequest cartRequest)
|
| - |
|
280 |
throws Exception {
|
| 263 |
CartResponse cartResponse = new CartResponse();
|
281 |
CartResponse cartResponse = new CartResponse();
|
| 264 |
List<CartItemResponseModel> cartItemResponseModels = new ArrayList<>();
|
282 |
List<CartItemResponseModel> cartItemResponseModels = new ArrayList<>();
|
| 265 |
cartResponse.setCartItems(cartItemResponseModels);
|
283 |
cartResponse.setCartItems(cartItemResponseModels);
|
| 266 |
|
284 |
|
| 267 |
UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
|
285 |
UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
|