| Line 13... |
Line 13... |
| 13 |
import in.shop2020.model.v1.inventory.OOSStatus;
|
13 |
import in.shop2020.model.v1.inventory.OOSStatus;
|
| 14 |
import in.shop2020.model.v1.inventory.Warehouse;
|
14 |
import in.shop2020.model.v1.inventory.Warehouse;
|
| 15 |
import in.shop2020.model.v1.inventory.WarehouseType;
|
15 |
import in.shop2020.model.v1.inventory.WarehouseType;
|
| 16 |
import in.shop2020.model.v1.order.SnapdealOrder;
|
16 |
import in.shop2020.model.v1.order.SnapdealOrder;
|
| 17 |
import in.shop2020.support.utils.ReportsUtils;
|
17 |
import in.shop2020.support.utils.ReportsUtils;
|
| - |
|
18 |
import in.shop2020.support.utils.UpdateSDPricingUsingPanel;
|
| 18 |
import in.shop2020.thrift.clients.CatalogClient;
|
19 |
import in.shop2020.thrift.clients.CatalogClient;
|
| 19 |
import in.shop2020.thrift.clients.InventoryClient;
|
20 |
import in.shop2020.thrift.clients.InventoryClient;
|
| 20 |
import in.shop2020.thrift.clients.TransactionClient;
|
21 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 21 |
import in.shop2020.utils.GmailUtils;
|
22 |
import in.shop2020.utils.GmailUtils;
|
| 22 |
import javax.mail.MessagingException;
|
23 |
import javax.mail.MessagingException;
|
| Line 347... |
Line 348... |
| 347 |
}
|
348 |
}
|
| 348 |
|
349 |
|
| 349 |
public String update() throws NumberFormatException, TException, InventoryServiceException, CatalogServiceException, JSONException{
|
350 |
public String update() throws NumberFormatException, TException, InventoryServiceException, CatalogServiceException, JSONException{
|
| 350 |
Client catalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
|
351 |
Client catalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
|
| 351 |
//Client catalogClientProd = new CatalogClient().getClient();
|
352 |
//Client catalogClientProd = new CatalogClient().getClient();
|
| - |
|
353 |
Long timestamp = System.currentTimeMillis();
|
| 352 |
SnapdealItem snapdealItem = catalogClient.getSnapdealItem(Long.valueOf(itemId));
|
354 |
SnapdealItem snapdealItem = catalogClient.getSnapdealItem(Long.valueOf(itemId));
|
| 353 |
Item item = catalogClient.getItem(Long.valueOf(itemId));
|
355 |
Item item = catalogClient.getItem(Long.valueOf(itemId));
|
| 354 |
MarketplacePercentage mpCosting = catalogClient.getCostingForMarketplace(7, Long.valueOf(itemId));
|
356 |
MarketplacePercentage mpCosting = catalogClient.getCostingForMarketplace(7, Long.valueOf(itemId));
|
| 355 |
if (mpCosting.getSource()==0){
|
357 |
if (mpCosting.getSource()==0){
|
| 356 |
throw new CatalogServiceException();
|
358 |
throw new CatalogServiceException();
|
| Line 400... |
Line 402... |
| 400 |
|
402 |
|
| 401 |
if (t_mpItem.getCurrentSp()< t_mpItem.getMinimumPossibleSp()){
|
403 |
if (t_mpItem.getCurrentSp()< t_mpItem.getMinimumPossibleSp()){
|
| 402 |
sendAlert(t_mpItem.getItemId(),t_mpItem.getCurrentSp(),t_mpItem.getMinimumPossibleSp());
|
404 |
sendAlert(t_mpItem.getItemId(),t_mpItem.getCurrentSp(),t_mpItem.getMinimumPossibleSp());
|
| 403 |
}
|
405 |
}
|
| 404 |
logger.info("\nUpdate Method Item Id "+itemId+"\nSelling Price "+sellingPrice+"\nWarehouse Id "+warehouseId+"\nMax Nlc "+maxNlc+"\nUpdated By: "+session.getAttribute(ReportsUtils.USER_NAME).toString());
|
406 |
logger.info("\nUpdate Method Item Id "+itemId+"\nSelling Price "+sellingPrice+"\nWarehouse Id "+warehouseId+"\nMax Nlc "+maxNlc+"\nUpdated By: "+session.getAttribute(ReportsUtils.USER_NAME).toString());
|
| - |
|
407 |
if(snapdealItem.getSellingPrice()!=Double.valueOf(sellingPrice)){
|
| - |
|
408 |
UpdateSDPricingUsingPanel updatePriceOnSnapdeal = new UpdateSDPricingUsingPanel(Float.valueOf(sellingPrice),supc,item,timestamp);
|
| - |
|
409 |
updatePriceOnSnapdeal.start();
|
| - |
|
410 |
}
|
| 405 |
return "snapdeal-update-result";
|
411 |
return "snapdeal-update-result";
|
| 406 |
}
|
412 |
}
|
| 407 |
|
413 |
|
| 408 |
|
414 |
|
| 409 |
public boolean compareParameters(MarketplaceItems mpItem, SnapdealItem snapdealItem, Warehouse warehouse,double weight) throws TException, JSONException, CatalogServiceException{
|
415 |
public boolean compareParameters(MarketplaceItems mpItem, SnapdealItem snapdealItem, Warehouse warehouse,double weight) throws TException, JSONException, CatalogServiceException{
|
| Line 604... |
Line 610... |
| 604 |
}
|
610 |
}
|
| 605 |
else{
|
611 |
else{
|
| 606 |
setComparsionResult("1");
|
612 |
setComparsionResult("1");
|
| 607 |
}
|
613 |
}
|
| 608 |
snapdealItem.setMarketplaceItems(t_mpItem);
|
614 |
snapdealItem.setMarketplaceItems(t_mpItem);
|
| - |
|
615 |
Long timestamp = System.currentTimeMillis();
|
| 609 |
boolean result = catalogClient.addOrUpdateSnapdealItem(snapdealItem);
|
616 |
boolean result = catalogClient.addOrUpdateSnapdealItem(snapdealItem);
|
| 610 |
if(!result){
|
617 |
if(!result){
|
| 611 |
throw new CatalogServiceException();
|
618 |
throw new CatalogServiceException();
|
| 612 |
}
|
619 |
}
|
| 613 |
if (t_mpItem.getCurrentSp()< t_mpItem.getMinimumPossibleSp()){
|
620 |
if (t_mpItem.getCurrentSp()< t_mpItem.getMinimumPossibleSp()){
|
| 614 |
sendAlert(t_mpItem.getItemId(),t_mpItem.getCurrentSp(),t_mpItem.getMinimumPossibleSp());
|
621 |
sendAlert(t_mpItem.getItemId(),t_mpItem.getCurrentSp(),t_mpItem.getMinimumPossibleSp());
|
| 615 |
}
|
622 |
}
|
| - |
|
623 |
UpdateSDPricingUsingPanel updatePriceOnSnapdeal = new UpdateSDPricingUsingPanel(Float.valueOf(sellingPrice),supc,item,timestamp);
|
| - |
|
624 |
updatePriceOnSnapdeal.start();
|
| 616 |
return "snapdeal-update-result";
|
625 |
return "snapdeal-update-result";
|
| 617 |
}
|
626 |
}
|
| 618 |
|
627 |
|
| 619 |
|
628 |
|
| 620 |
public String getAddNewItemForm(){
|
629 |
public String getAddNewItemForm(){
|
| Line 1059... |
Line 1068... |
| 1059 |
|
1068 |
|
| 1060 |
for(int i=0;i<slabs;i++){
|
1069 |
for(int i=0;i<slabs;i++){
|
| 1061 |
courierCost = courierCost + 35;
|
1070 |
courierCost = courierCost + 35;
|
| 1062 |
}
|
1071 |
}
|
| 1063 |
}
|
1072 |
}
|
| 1064 |
|
1073 |
|
| 1065 |
warehouse = inventoryClient.getWarehouse(snapdealItem.getWarehouseId());
|
1074 |
warehouse = inventoryClient.getWarehouse(snapdealItem.getWarehouseId());
|
| 1066 |
snapdealItem.setCourierCost(courierCost);
|
1075 |
snapdealItem.setCourierCost(courierCost);
|
| 1067 |
marketplaceItem.setCourierCost(courierCost);
|
1076 |
marketplaceItem.setCourierCost(courierCost);
|
| 1068 |
transferPrice = roundTwoDecimals(snapdealItem.getSellingPrice()- snapdealItem.getSellingPrice()*(marketplaceItem.getCommission()/100+marketplaceItem.getEmiFee()/100)*(1+(marketplaceItem.getServiceTax()/100))-(snapdealItem.getCourierCost()+marketplaceItem.getClosingFee())*(1+(marketplaceItem.getServiceTax()/100)));
|
1077 |
transferPrice = roundTwoDecimals(snapdealItem.getSellingPrice()- snapdealItem.getSellingPrice()*(marketplaceItem.getCommission()/100+marketplaceItem.getEmiFee()/100)*(1+(marketplaceItem.getServiceTax()/100))-(snapdealItem.getCourierCost()+marketplaceItem.getClosingFee())*(1+(marketplaceItem.getServiceTax()/100)));
|
| 1069 |
snapdealItem.setTransferPrice(transferPrice);
|
1078 |
snapdealItem.setTransferPrice(transferPrice);
|