| Line 214... |
Line 214... |
| 214 |
} catch (ProfitMandiBusinessException e) {
|
214 |
} catch (ProfitMandiBusinessException e) {
|
| 215 |
model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
|
215 |
model.addAttribute("loginResponse", mvcResponseSender.createResponseString("RTLR_1009", false, "/login"));
|
| 216 |
return "response";
|
216 |
return "response";
|
| 217 |
}
|
217 |
}
|
| 218 |
FofoOrder fofoOrder = fofoOrderRepository.selectByFofoIdAndOrderId(fofoDetails.getFofoId(), orderId);
|
218 |
FofoOrder fofoOrder = fofoOrderRepository.selectByFofoIdAndOrderId(fofoDetails.getFofoId(), orderId);
|
| - |
|
219 |
List<FofoLineItem> fofoLineItems = fofoLineItemRepository.selectByOrderId(fofoOrder.getId());
|
| - |
|
220 |
CustomerAddress customerAddress = customerAddressRepository.selectById(fofoOrder.getCustomerAddressId());
|
| - |
|
221 |
List<PaymentOption> paymentOptions = paymentOptionRepository.selectByOrderId(fofoOrder.getId());
|
| 219 |
LOGGER.info(fofoOrder.toString());
|
222 |
model.addAttribute("fofoOrder", fofoOrder);
|
| - |
|
223 |
model.addAttribute("fofoLineItems", fofoLineItems);
|
| - |
|
224 |
model.addAttribute("customerBillingAddress", getBillingAddress(customerAddress));
|
| - |
|
225 |
model.addAttribute("customerBillingAddressObj", customerAddress);
|
| - |
|
226 |
model.addAttribute("paymentOptions", paymentOptions);
|
| - |
|
227 |
return "order-details";
|
| - |
|
228 |
}
|
| - |
|
229 |
|
| - |
|
230 |
private String getBillingAddress(CustomerAddress customerAddress) {
|
| - |
|
231 |
String address = "";
|
| - |
|
232 |
if ((customerAddress.getLine1() != null) && (!customerAddress.getLine1().isEmpty())) {
|
| - |
|
233 |
address = address + customerAddress.getLine1();
|
| - |
|
234 |
address = address + ", ";
|
| - |
|
235 |
}
|
| - |
|
236 |
|
| - |
|
237 |
if ((customerAddress.getLine2() != null) && (!customerAddress.getLine2().isEmpty())) {
|
| 220 |
LOGGER.info(fofoOrder.getCustomer().toString());
|
238 |
address = address + customerAddress.getLine2();
|
| - |
|
239 |
address = address + ", ";
|
| - |
|
240 |
}
|
| - |
|
241 |
|
| - |
|
242 |
if ((customerAddress.getLandmark() != null) && (!customerAddress.getLandmark().isEmpty())) {
|
| - |
|
243 |
address = address + customerAddress.getLandmark();
|
| - |
|
244 |
address = address + ", ";
|
| - |
|
245 |
}
|
| - |
|
246 |
|
| 221 |
LOGGER.info(fofoOrder.getCustomer().getCustomerAddress().toString());
|
247 |
if ((customerAddress.getCity() != null) && (!customerAddress.getCity().isEmpty())) {
|
| 222 |
LOGGER.info(fofoOrder.getFofoLineItem().toString());
|
248 |
address = address + customerAddress.getCity();
|
| - |
|
249 |
address = address + ", ";
|
| - |
|
250 |
}
|
| - |
|
251 |
|
| 223 |
LOGGER.info(fofoOrder.getFofoLineItem().get(0).getFofoLineItemSerialNumbers().toString());
|
252 |
if ((customerAddress.getState() != null) && (!customerAddress.getState().isEmpty())) {
|
| 224 |
LOGGER.info(fofoOrder.getPaymentOption().toString());
|
253 |
address = address + customerAddress.getState();
|
| - |
|
254 |
}
|
| - |
|
255 |
|
| - |
|
256 |
if ((customerAddress.getPinCode() != null) && (!customerAddress.getPinCode().isEmpty())) {
|
| - |
|
257 |
address = address + "- " + customerAddress.getPinCode();
|
| - |
|
258 |
}
|
| - |
|
259 |
|
| 225 |
return null;
|
260 |
return address;
|
| 226 |
}
|
261 |
}
|
| 227 |
|
262 |
|
| 228 |
@RequestMapping(value = "/create-order", method = RequestMethod.POST)
|
263 |
@RequestMapping(value = "/create-order", method = RequestMethod.POST)
|
| 229 |
public String createOrder(HttpServletRequest request, @RequestBody CreateOrderRequest createOrderRequest, Model model) throws Throwable{
|
264 |
public String createOrder(HttpServletRequest request, @RequestBody CreateOrderRequest createOrderRequest, Model model) throws Throwable{
|
| 230 |
LOGGER.info("request at uri {} body {}", request.getRequestURI(), createOrderRequest);
|
265 |
LOGGER.info("request at uri {} body {}", request.getRequestURI(), createOrderRequest);
|