| Line 43... |
Line 43... |
| 43 |
import com.spice.profitmandi.common.web.client.RestClient;
|
43 |
import com.spice.profitmandi.common.web.client.RestClient;
|
| 44 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
44 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 45 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
45 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| 46 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
46 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| 47 |
import com.spice.profitmandi.dao.entity.fofo.CurrentInventorySnapshot;
|
47 |
import com.spice.profitmandi.dao.entity.fofo.CurrentInventorySnapshot;
|
| - |
|
48 |
import com.spice.profitmandi.dao.entity.fofo.PincodePartner;
|
| 48 |
import com.spice.profitmandi.dao.entity.inventory.ItemAvailabilityCache;
|
49 |
import com.spice.profitmandi.dao.entity.inventory.ItemAvailabilityCache;
|
| 49 |
import com.spice.profitmandi.dao.enumuration.dtr.OtpType;
|
50 |
import com.spice.profitmandi.dao.enumuration.dtr.OtpType;
|
| 50 |
import com.spice.profitmandi.dao.model.AddCartRequest;
|
51 |
import com.spice.profitmandi.dao.model.AddCartRequest;
|
| 51 |
import com.spice.profitmandi.dao.model.CartItem;
|
52 |
import com.spice.profitmandi.dao.model.CartItem;
|
| 52 |
import com.spice.profitmandi.dao.model.CartItemResponseModel;
|
53 |
import com.spice.profitmandi.dao.model.CartItemResponseModel;
|
| Line 57... |
Line 58... |
| 57 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
58 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
| 58 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
59 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
| 59 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
60 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
| 60 |
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
|
61 |
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
|
| 61 |
import com.spice.profitmandi.dao.repository.fofo.PendingOrderService;
|
62 |
import com.spice.profitmandi.dao.repository.fofo.PendingOrderService;
|
| - |
|
63 |
import com.spice.profitmandi.dao.repository.fofo.PincodePartnerRepository;
|
| 62 |
import com.spice.profitmandi.dao.repository.inventory.ItemAvailabilityCacheRepository;
|
64 |
import com.spice.profitmandi.dao.repository.inventory.ItemAvailabilityCacheRepository;
|
| 63 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
65 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
| 64 |
import com.spice.profitmandi.service.inventory.FofoAvailabilityInfo;
|
66 |
import com.spice.profitmandi.service.inventory.FofoAvailabilityInfo;
|
| 65 |
import com.spice.profitmandi.service.inventory.FofoCatalogResponse;
|
67 |
import com.spice.profitmandi.service.inventory.FofoCatalogResponse;
|
| 66 |
import com.spice.profitmandi.service.pricing.PricingService;
|
68 |
import com.spice.profitmandi.service.pricing.PricingService;
|
| Line 81... |
Line 83... |
| 81 |
public class StoreController {
|
83 |
public class StoreController {
|
| 82 |
|
84 |
|
| 83 |
private static final Logger logger = LogManager.getLogger(StoreController.class);
|
85 |
private static final Logger logger = LogManager.getLogger(StoreController.class);
|
| 84 |
|
86 |
|
| 85 |
private static final LocalTime CUTOFF_TIME = LocalTime.of(15, 0);
|
87 |
private static final LocalTime CUTOFF_TIME = LocalTime.of(15, 0);
|
| - |
|
88 |
|
| - |
|
89 |
private static final int DEFAULT_STORE = 0;
|
| 86 |
|
90 |
|
| 87 |
@Value("${python.api.host}")
|
91 |
@Value("${python.api.host}")
|
| 88 |
private String host;
|
92 |
private String host;
|
| 89 |
|
93 |
|
| 90 |
@Value("${python.api.port}")
|
94 |
@Value("${python.api.port}")
|
| Line 96... |
Line 100... |
| 96 |
|
100 |
|
| 97 |
@Autowired
|
101 |
@Autowired
|
| 98 |
private PricingService pricingService;
|
102 |
private PricingService pricingService;
|
| 99 |
|
103 |
|
| 100 |
@Autowired
|
104 |
@Autowired
|
| - |
|
105 |
private PincodePartnerRepository pincodePartnerRepository;
|
| - |
|
106 |
|
| - |
|
107 |
@Autowired
|
| 101 |
private RetailerService retailerService;
|
108 |
private RetailerService retailerService;
|
| 102 |
|
109 |
|
| 103 |
@Autowired
|
110 |
@Autowired
|
| 104 |
private PendingOrderService pendingOrderService;
|
111 |
private PendingOrderService pendingOrderService;
|
| 105 |
|
112 |
|
| Line 360... |
Line 367... |
| 360 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(storeId);
|
367 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(storeId);
|
| 361 |
|
368 |
|
| 362 |
return responseSender.ok(customRetailer.getAddress());
|
369 |
return responseSender.ok(customRetailer.getAddress());
|
| 363 |
|
370 |
|
| 364 |
}
|
371 |
}
|
| - |
|
372 |
|
| - |
|
373 |
@RequestMapping(value = "/store/address/{pincode}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
| - |
|
374 |
@ApiImplicitParams({
|
| - |
|
375 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| - |
|
376 |
@ApiOperation(value = "Get brand list and count for category")
|
| - |
|
377 |
public ResponseEntity<?> getStoresByPincode(HttpServletRequest request, @PathVariable String pincode) throws Exception {
|
| - |
|
378 |
List<PincodePartner> pincodePartners = pincodePartnerRepository.selectPartnersByPincode(pincode);
|
| - |
|
379 |
int fofoId = DEFAULT_STORE;
|
| - |
|
380 |
if(pincodePartners.size()>0) {
|
| - |
|
381 |
fofoId = pincodePartners.get(0).getFofoId();
|
| - |
|
382 |
}
|
| - |
|
383 |
return responseSender.ok(retailerService.getFofoRetailer(fofoId));
|
| - |
|
384 |
}
|
| 365 |
|
385 |
|
| 366 |
@RequestMapping(value = "/store/cart", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
386 |
@RequestMapping(value = "/store/cart", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 367 |
@ApiImplicitParams({
|
387 |
@ApiImplicitParams({
|
| 368 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
388 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 369 |
@ApiOperation(value = "Get brand list and count for category")
|
389 |
@ApiOperation(value = "Get brand list and count for category")
|