| Line 44... |
Line 44... |
| 44 |
|
44 |
|
| 45 |
@Autowired
|
45 |
@Autowired
|
| 46 |
CookiesFetcher cookiesFetcher;
|
46 |
CookiesFetcher cookiesFetcher;
|
| 47 |
|
47 |
|
| 48 |
@RequestMapping(value = "/orders", method = RequestMethod.POST)
|
48 |
@RequestMapping(value = "/orders", method = RequestMethod.POST)
|
| 49 |
public String orderByAirwayBillOrInvoiceNumber(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.AIRWAY_BILL_OR_INVOICE_NUMBER) String airwayBillOrInvoiceNumber, @ModelAttribute Model model) throws Throwable{
|
49 |
public String orderByAirwayBillOrInvoiceNumber(HttpServletRequest request, @RequestParam(name = ProfitMandiConstants.AIRWAY_BILL_OR_INVOICE_NUMBER) String airwayBillOrInvoiceNumber, Model model) throws Throwable{
|
| 50 |
FofoDetails fofoDetails = cookiesFetcher.getCookiesObject(request);
|
50 |
FofoDetails fofoDetails = cookiesFetcher.getCookiesObject(request);
|
| 51 |
List<Object[]> rows = orderRepository.selectByAirwayBillOrInvoiceNumber(airwayBillOrInvoiceNumber, fofoDetails.getFofoId());
|
51 |
List<Object[]> rows = orderRepository.selectByAirwayBillOrInvoiceNumber(airwayBillOrInvoiceNumber, fofoDetails.getFofoId());
|
| 52 |
Set<Integer> itemIds = new HashSet<>();
|
52 |
Set<Integer> itemIds = new HashSet<>();
|
| 53 |
String invoiceNumber = null;
|
53 |
String invoiceNumber = null;
|
| 54 |
for(Object[] row : rows){
|
54 |
for(Object[] row : rows){
|
| Line 63... |
Line 63... |
| 63 |
customItems.add(this.createCustomLineItem(row, (int)row[1] == (int)itemIdCount[1] ? true : false));
|
63 |
customItems.add(this.createCustomLineItem(row, (int)row[1] == (int)itemIdCount[1] ? true : false));
|
| 64 |
}
|
64 |
}
|
| 65 |
}
|
65 |
}
|
| 66 |
}
|
66 |
}
|
| 67 |
model.addAttribute("customItems", customItems);
|
67 |
model.addAttribute("customItems", customItems);
|
| 68 |
return "orders";
|
68 |
return "purchase";
|
| - |
|
69 |
}
|
| - |
|
70 |
|
| - |
|
71 |
@RequestMapping(value = "/purchase", method = RequestMethod.GET)
|
| - |
|
72 |
public String orderByAirwayBillOrInvoiceNumber(HttpServletRequest request) throws Exception{
|
| - |
|
73 |
return "purchase";
|
| 69 |
}
|
74 |
}
|
| 70 |
|
75 |
|
| 71 |
|
76 |
|
| 72 |
private CustomItem createCustomLineItem(Object[] row, boolean scanned){
|
77 |
private CustomItem createCustomLineItem(Object[] row, boolean scanned){
|
| 73 |
CustomItem customItem = new CustomItem();
|
78 |
CustomItem customItem = new CustomItem();
|