| Line 9... |
Line 9... |
| 9 |
import in.shop2020.model.v1.catalog.Item;
|
9 |
import in.shop2020.model.v1.catalog.Item;
|
| 10 |
import in.shop2020.model.v1.user.Address;
|
10 |
import in.shop2020.model.v1.user.Address;
|
| 11 |
import in.shop2020.model.v1.user.AddressType;
|
11 |
import in.shop2020.model.v1.user.AddressType;
|
| 12 |
import in.shop2020.model.v1.user.Cart;
|
12 |
import in.shop2020.model.v1.user.Cart;
|
| 13 |
import in.shop2020.model.v1.user.Line;
|
13 |
import in.shop2020.model.v1.user.Line;
|
| - |
|
14 |
import in.shop2020.model.v1.user.User;
|
| 14 |
import in.shop2020.model.v1.user.UserContextService;
|
15 |
import in.shop2020.model.v1.user.UserContextService;
|
| 15 |
import in.shop2020.serving.controllers.BaseController;
|
16 |
import in.shop2020.serving.controllers.BaseController;
|
| 16 |
import in.shop2020.serving.utils.Utils;
|
17 |
import in.shop2020.serving.utils.Utils;
|
| 17 |
import in.shop2020.thrift.clients.CatalogServiceClient;
|
18 |
import in.shop2020.thrift.clients.CatalogServiceClient;
|
| 18 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
19 |
import in.shop2020.thrift.clients.UserContextServiceClient;
|
| Line 178... |
Line 179... |
| 178 |
String templateFile = "templates/shippingdetails.vm";
|
179 |
String templateFile = "templates/shippingdetails.vm";
|
| 179 |
List<Map<String,String>> items = null;
|
180 |
List<Map<String,String>> items = null;
|
| 180 |
double totalamount= 0.0;
|
181 |
double totalamount= 0.0;
|
| 181 |
List<Address> addresses = null;
|
182 |
List<Address> addresses = null;
|
| 182 |
long defaultAddressId = 0;
|
183 |
long defaultAddressId = 0;
|
| - |
|
184 |
String fullName = "";
|
| - |
|
185 |
String phoneNumber = "";
|
| 183 |
|
186 |
|
| 184 |
CatalogServiceClient catalogServiceClient = null;
|
187 |
CatalogServiceClient catalogServiceClient = null;
|
| 185 |
in.shop2020.model.v1.catalog.InventoryService.Client catalogClient = null;
|
188 |
in.shop2020.model.v1.catalog.InventoryService.Client catalogClient = null;
|
| 186 |
UserContextServiceClient userContextServiceClient = null;
|
189 |
UserContextServiceClient userContextServiceClient = null;
|
| 187 |
in.shop2020.model.v1.user.UserContextService.Client userClient = null;
|
190 |
in.shop2020.model.v1.user.UserContextService.Client userClient = null;
|
| Line 217... |
Line 220... |
| 217 |
items.add(itemdetail);
|
220 |
items.add(itemdetail);
|
| 218 |
}
|
221 |
}
|
| 219 |
}
|
222 |
}
|
| 220 |
|
223 |
|
| 221 |
addresses = userClient.getAllAddressesForUser(cart.getUserId());
|
224 |
addresses = userClient.getAllAddressesForUser(cart.getUserId());
|
| - |
|
225 |
User user = userClient.getUserById(cart.getUserId());
|
| - |
|
226 |
|
| - |
|
227 |
fullName = user.getName();
|
| - |
|
228 |
phoneNumber = user.getMobileNumber();
|
| 222 |
|
229 |
|
| 223 |
if(cart.isSetAddressId()) {
|
230 |
if(cart.isSetAddressId()) {
|
| 224 |
defaultAddressId = cart.getAddressId();
|
231 |
defaultAddressId = cart.getAddressId();
|
| 225 |
} else {
|
232 |
} else {
|
| 226 |
defaultAddressId = userClient.getDefaultAddressId(cart.getUserId());
|
233 |
defaultAddressId = userClient.getDefaultAddressId(cart.getUserId());
|
| 227 |
}
|
234 |
}
|
| 228 |
} catch (Exception e) {
|
235 |
} catch (Exception e) {
|
| 229 |
e.printStackTrace();
|
236 |
e.printStackTrace();
|
| 230 |
}
|
237 |
}
|
| - |
|
238 |
System.out.println(fullName + " | " + phoneNumber);
|
| - |
|
239 |
context.put("fullname", fullName);
|
| - |
|
240 |
context.put("phonenumber", phoneNumber);
|
| 231 |
|
241 |
|
| 232 |
context.put("items", items);
|
242 |
context.put("items", items);
|
| 233 |
context.put("totalamount", (int)totalamount+"");
|
243 |
context.put("totalamount", (int)totalamount+"");
|
| 234 |
context.put("addresses", addresses);
|
244 |
context.put("addresses", addresses);
|
| 235 |
context.put("defaultAddressId", defaultAddressId+"");
|
245 |
context.put("defaultAddressId", defaultAddressId+"");
|