| 21561 |
ashik.ali |
1 |
package com.spice.profitmandi.web.controller;
|
| 21555 |
kshitij.so |
2 |
|
| 21574 |
ashik.ali |
3 |
import javax.servlet.http.HttpServletRequest;
|
|
|
4 |
|
|
|
5 |
import org.slf4j.Logger;
|
|
|
6 |
import org.slf4j.LoggerFactory;
|
|
|
7 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 21555 |
kshitij.so |
8 |
import org.springframework.stereotype.Controller;
|
| 21574 |
ashik.ali |
9 |
import org.springframework.ui.Model;
|
| 21555 |
kshitij.so |
10 |
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
|
11 |
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
12 |
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
13 |
|
| 21582 |
kshitij.so |
14 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 21574 |
ashik.ali |
15 |
import com.spice.profitmandi.dao.repository.OrderRepository;
|
|
|
16 |
import com.spice.profitmandi.web.model.FofoDetails;
|
| 21582 |
kshitij.so |
17 |
import com.spice.profitmandi.web.util.CookiesFetcher;
|
| 21574 |
ashik.ali |
18 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
| 21555 |
kshitij.so |
19 |
|
|
|
20 |
@Controller
|
| 21582 |
kshitij.so |
21 |
public class PurchaseController {
|
| 21555 |
kshitij.so |
22 |
|
| 21582 |
kshitij.so |
23 |
private static final Logger LOGGER = LoggerFactory.getLogger(PurchaseController.class);
|
| 21574 |
ashik.ali |
24 |
|
|
|
25 |
@Autowired
|
|
|
26 |
OrderRepository orderRepository;
|
|
|
27 |
|
|
|
28 |
@Autowired
|
| 21582 |
kshitij.so |
29 |
CookiesFetcher cookiesFetcher;
|
|
|
30 |
|
|
|
31 |
@Autowired
|
| 21574 |
ashik.ali |
32 |
MVCResponseSender mvcResponseSender;
|
|
|
33 |
|
| 21582 |
kshitij.so |
34 |
@RequestMapping(value = "/purchase", method = RequestMethod.POST)
|
|
|
35 |
public String orderByAirwayBillOrInvoiceNumber(HttpServletRequest request, Model model) throws Exception, ProfitMandiBusinessException{
|
|
|
36 |
FofoDetails fofoDetails = cookiesFetcher.getCookiesObject(request);
|
|
|
37 |
String airwayBillOrInvoiceNumber = (String) request.getAttribute("airwayBillOrInvoiceNumber");
|
|
|
38 |
model.addAttribute("customItems", orderRepository.selectByAirwayBillOrInvoiceNumber(airwayBillOrInvoiceNumber, fofoDetails.getFofoId()));
|
|
|
39 |
return "purchase";
|
| 21555 |
kshitij.so |
40 |
}
|
|
|
41 |
|
| 21582 |
kshitij.so |
42 |
@RequestMapping(value = "/purchase", method = RequestMethod.GET)
|
|
|
43 |
public String orderByAirwayBillOrInvoiceNumber(HttpServletRequest request) throws Exception{
|
|
|
44 |
return "purchase";
|
|
|
45 |
}
|
|
|
46 |
|
| 21555 |
kshitij.so |
47 |
}
|