| Line 75... |
Line 75... |
| 75 |
{
|
75 |
{
|
| 76 |
sdf = new java.text.SimpleDateFormat("yyyy-MM-dd-HH:mm:ss");
|
76 |
sdf = new java.text.SimpleDateFormat("yyyy-MM-dd-HH:mm:ss");
|
| 77 |
emailFromAddress = "build@shop2020.in";
|
77 |
emailFromAddress = "build@shop2020.in";
|
| 78 |
password = "cafe@nes";
|
78 |
password = "cafe@nes";
|
| 79 |
mailer = new GmailUtils();
|
79 |
mailer = new GmailUtils();
|
| 80 |
//sendTo = new String[]{"vikram.raghav@shop2020.in"};
|
80 |
sendTo = new String[]{"vikram.raghav@shop2020.in"};
|
| 81 |
sendTo = new String[]{ "sandeep.sachdeva@shop2020.in", "vikram.raghav@shop2020.in", "rajneesh.arora@shop2020.in",
|
81 |
/* sendTo = new String[]{ "sandeep.sachdeva@shop2020.in", "vikram.raghav@shop2020.in", "rajneesh.arora@shop2020.in",
|
| 82 |
"khushal.bhatia@shop2020.in","manoj.kumar@saholic.com","chaitnaya.vats@saholic.com",
|
82 |
"khushal.bhatia@shop2020.in","manoj.kumar@saholic.com","chaitnaya.vats@saholic.com",
|
| 83 |
"yukti.jain@shop2020.in","manoj.pal@shop2020.in","chandan.kumar@shop2020.in","ankush.dhingra@shop2020.in","amar.kumar@shop2020.in"};
|
83 |
"yukti.jain@shop2020.in","manoj.pal@shop2020.in","chandan.kumar@shop2020.in","ankush.dhingra@shop2020.in","amar.kumar@shop2020.in"};
|
| 84 |
List<String> flipkartorderids = null;
|
84 |
*/ List<String> flipkartorderids = null;
|
| 85 |
Client catalogServiceClient = null;
|
85 |
Client catalogServiceClient = null;
|
| 86 |
try {
|
86 |
try {
|
| 87 |
catalogServiceClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
|
87 |
catalogServiceClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
|
| 88 |
} catch (TTransportException e) {
|
88 |
} catch (TTransportException e) {
|
| 89 |
e.printStackTrace();
|
89 |
e.printStackTrace();
|
| Line 197... |
Line 197... |
| 197 |
|
197 |
|
| 198 |
String tableFooter = "</table></html>";
|
198 |
String tableFooter = "</table></html>";
|
| 199 |
Item item;
|
199 |
Item item;
|
| 200 |
StringBuffer feedResponse= new StringBuffer();
|
200 |
StringBuffer feedResponse= new StringBuffer();
|
| 201 |
List<FlipkartInventorySnapshot> inventorysnapshotlist = new ArrayList<FlipkartInventorySnapshot>();
|
201 |
List<FlipkartInventorySnapshot> inventorysnapshotlist = new ArrayList<FlipkartInventorySnapshot>();
|
| - |
|
202 |
long timestamp = System.currentTimeMillis();
|
| 202 |
for(Entry<Long, FlipkartInventoryItem> entry:flipkartItemsInventoryMap.entrySet()){
|
203 |
for(Entry<Long, FlipkartInventoryItem> entry:flipkartItemsInventoryMap.entrySet()){
|
| 203 |
if(snapdealItemsMap.containsKey(entry.getKey()) && snapdealItemsMap.get(entry.getKey()).isIsListedOnSnapdeal()){
|
204 |
if(snapdealItemsMap.containsKey(entry.getKey()) && snapdealItemsMap.get(entry.getKey()).isIsListedOnSnapdeal()){
|
| 204 |
allocation = (float) 0.33;
|
205 |
allocation = (float) 0.33;
|
| 205 |
}
|
206 |
}
|
| 206 |
else{
|
207 |
else{
|
| Line 285... |
Line 286... |
| 285 |
"{\"procurement_sla\""+":"+"\""+logisticinfo.getShippingTime()+
|
286 |
"{\"procurement_sla\""+":"+"\""+logisticinfo.getShippingTime()+
|
| 286 |
"\","+"\"stock_count\""+":"+"\""+stock+"\""+"}}");
|
287 |
"\","+"\"stock_count\""+":"+"\""+stock+"\""+"}}");
|
| 287 |
FlipkartInventorySnapshot inventorySnapshot = new FlipkartInventorySnapshot();
|
288 |
FlipkartInventorySnapshot inventorySnapshot = new FlipkartInventorySnapshot();
|
| 288 |
inventorySnapshot.setItem_id(entry.getKey());
|
289 |
inventorySnapshot.setItem_id(entry.getKey());
|
| 289 |
inventorySnapshot.setAvailability(stock);
|
290 |
inventorySnapshot.setAvailability(stock);
|
| - |
|
291 |
if(stock > 0){
|
| - |
|
292 |
inventorySnapshot.setIs_oos(false);
|
| - |
|
293 |
}
|
| - |
|
294 |
else{
|
| - |
|
295 |
inventorySnapshot.setIs_oos(true);
|
| - |
|
296 |
}
|
| 290 |
if(heldOrdersMap.containsKey(entry.getValue().getSkuAtflipkart())){
|
297 |
if(heldOrdersMap.containsKey(entry.getValue().getSkuAtflipkart())){
|
| 291 |
inventorySnapshot.setHeldOrders(heldOrdersMap.get(entry.getValue().getSkuAtflipkart()));
|
298 |
inventorySnapshot.setHeldOrders(heldOrdersMap.get(entry.getValue().getSkuAtflipkart()));
|
| 292 |
heldorders = heldOrdersMap.get(entry.getValue().getSkuAtflipkart());
|
299 |
heldorders = heldOrdersMap.get(entry.getValue().getSkuAtflipkart());
|
| 293 |
}
|
300 |
}
|
| 294 |
else{
|
301 |
else{
|
| Line 382... |
Line 389... |
| 382 |
while ((line = rd.readLine()) != null) {
|
389 |
while ((line = rd.readLine()) != null) {
|
| 383 |
System.out.println("Response " + line);
|
390 |
System.out.println("Response " + line);
|
| 384 |
if(line.equalsIgnoreCase("{\"status\":\"success\"}")){
|
391 |
if(line.equalsIgnoreCase("{\"status\":\"success\"}")){
|
| 385 |
inventoryServiceClient = new InventoryClient().getClient();
|
392 |
inventoryServiceClient = new InventoryClient().getClient();
|
| 386 |
try{
|
393 |
try{
|
| 387 |
inventoryServiceClient.addOrUpdateFlipkartInventorySnapshot(inventorysnapshotlist);
|
394 |
inventoryServiceClient.addOrUpdateFlipkartInventorySnapshot(inventorysnapshotlist,timestamp);
|
| 388 |
}
|
395 |
}
|
| 389 |
catch(TTransportException e){
|
396 |
catch(TTransportException e){
|
| 390 |
inventoryServiceClient = new InventoryClient().getClient();
|
397 |
inventoryServiceClient = new InventoryClient().getClient();
|
| 391 |
inventoryServiceClient.addOrUpdateFlipkartInventorySnapshot(inventorysnapshotlist);
|
398 |
inventoryServiceClient.addOrUpdateFlipkartInventorySnapshot(inventorysnapshotlist,timestamp);
|
| 392 |
}
|
399 |
}
|
| 393 |
inventorysnapshotlist = new ArrayList<FlipkartInventorySnapshot>();
|
400 |
inventorysnapshotlist = new ArrayList<FlipkartInventorySnapshot>();
|
| 394 |
}
|
401 |
}
|
| 395 |
else{
|
402 |
else{
|
| 396 |
feedResponse.append(line);
|
403 |
feedResponse.append(line);
|