| Line 940... |
Line 940... |
| 940 |
try {
|
940 |
try {
|
| 941 |
CatalogClient catalogServiceClient = new CatalogClient();
|
941 |
CatalogClient catalogServiceClient = new CatalogClient();
|
| 942 |
Client catalogClient = catalogServiceClient.getClient();
|
942 |
Client catalogClient = catalogServiceClient.getClient();
|
| 943 |
InventoryClient inventoryServiceClient = new InventoryClient();
|
943 |
InventoryClient inventoryServiceClient = new InventoryClient();
|
| 944 |
in.shop2020.model.v1.inventory.InventoryService.Client inventoryClient = inventoryServiceClient.getClient();
|
944 |
in.shop2020.model.v1.inventory.InventoryService.Client inventoryClient = inventoryServiceClient.getClient();
|
| 945 |
|
- |
|
| 946 |
in.shop2020.model.v1.catalog.Item thriftItem = catalogClient.getItem(itemId);
|
945 |
in.shop2020.model.v1.catalog.Item thriftItem = catalogClient.getItem(itemId);
|
| - |
|
946 |
in.shop2020.model.v1.catalog.PrivateDeal tPrivateDeal = catalogClient.getPrivateDealDetails(itemId);
|
| 947 |
List<in.shop2020.model.v1.inventory.VendorItemPricing> vip = inventoryClient.getAllItemPricing(thriftItem.getId());
|
947 |
List<in.shop2020.model.v1.inventory.VendorItemPricing> vip = inventoryClient.getAllItemPricing(thriftItem.getId());
|
| 948 |
List<in.shop2020.model.v1.inventory.VendorItemMapping> vim = inventoryClient.getVendorItemMappings(thriftItem.getId());
|
948 |
List<in.shop2020.model.v1.inventory.VendorItemMapping> vim = inventoryClient.getVendorItemMappings(thriftItem.getId());
|
| 949 |
List<in.shop2020.model.v1.catalog.SourceItemPricing> sip = catalogClient.getAllSourcePricing(thriftItem.getId());
|
949 |
List<in.shop2020.model.v1.catalog.SourceItemPricing> sip = catalogClient.getAllSourcePricing(thriftItem.getId());
|
| 950 |
items.add(getItemFromThriftItem(thriftItem, vip, vim, sip, null, null, null, null, null, null));
|
950 |
items.add(getItemFromThriftItem(thriftItem, vip, vim, sip, null, null, null, null, null, null,null,tPrivateDeal));
|
| 951 |
} catch (Exception e) {
|
951 |
} catch (Exception e) {
|
| 952 |
logger.error("Could not fetch item for : " + itemId, e);
|
952 |
logger.error("Could not fetch item for : " + itemId, e);
|
| 953 |
return "Could not push to production. No item got pushed.";
|
953 |
return "Could not push to production. No item got pushed.";
|
| 954 |
}
|
954 |
}
|
| 955 |
}
|
955 |
}
|
| Line 1040... |
Line 1040... |
| 1040 |
catalogClient_Prod.addSourceItemPricing(tSourcePricing);
|
1040 |
catalogClient_Prod.addSourceItemPricing(tSourcePricing);
|
| 1041 |
logger.info("SourceItemPricing updated. " + tSourcePricing.toString());
|
1041 |
logger.info("SourceItemPricing updated. " + tSourcePricing.toString());
|
| 1042 |
sb.append("[SId:" + s.getSourceId() + ",MRP=" + s.getMrp() + ",SP=" + s.getSellingPrice() + "], ");
|
1042 |
sb.append("[SId:" + s.getSourceId() + ",MRP=" + s.getMrp() + ",SP=" + s.getSellingPrice() + "], ");
|
| 1043 |
}
|
1043 |
}
|
| 1044 |
}
|
1044 |
}
|
| 1045 |
|
- |
|
| 1046 |
pushToProdLogger.info("Id=" + it.getId() + ",MRP=" + it.getMrp() + ",SP=" + " " + it.getSellingPrice() + sb.toString());
|
1045 |
pushToProdLogger.info("Id=" + it.getId() + ",MRP=" + it.getMrp() + ",SP=" + " " + it.getSellingPrice() + sb.toString());
|
| - |
|
1046 |
in.shop2020.model.v1.catalog.PrivateDeal privateDeal = new in.shop2020.model.v1.catalog.PrivateDeal();
|
| - |
|
1047 |
privateDeal.setItem_id(item.getId());
|
| - |
|
1048 |
privateDeal.setDealFreebieItemId(item.getPrivateDeal().getDealFreebieItemId());
|
| - |
|
1049 |
privateDeal.setDealPrice(item.getPrivateDeal().getDealPrice());
|
| - |
|
1050 |
privateDeal.setDealText(item.getPrivateDeal().getDealText());
|
| - |
|
1051 |
privateDeal.setDealFreebieOption(item.getPrivateDeal().getDealFreebieOption());
|
| - |
|
1052 |
privateDeal.setDealTextOption(item.getPrivateDeal().getDealTextOption());
|
| - |
|
1053 |
privateDeal.setEndDate(item.getPrivateDeal().getEndDate());
|
| - |
|
1054 |
privateDeal.setStartDate(item.getPrivateDeal().getStartDate());
|
| - |
|
1055 |
privateDeal.setIsCod(item.getPrivateDeal().isCod());
|
| - |
|
1056 |
privateDeal.setRank(item.getPrivateDeal().getRank());
|
| - |
|
1057 |
privateDeal.setIsActive(item.getPrivateDeal().isActive());
|
| - |
|
1058 |
if(privateDeal.getDealPrice() > 0 && privateDeal.getEndDate()!=0 && privateDeal.getStartDate()!=0){
|
| - |
|
1059 |
logger.info("Updating Private deal: " + item.getId());
|
| - |
|
1060 |
logger.info("Deal Price "+privateDeal.getDealPrice());
|
| - |
|
1061 |
logger.info("Deal Start Date "+privateDeal.getStartDate());
|
| - |
|
1062 |
logger.info("Deal End Date "+privateDeal.getEndDate());
|
| - |
|
1063 |
logger.info("Has COD on deal: " + privateDeal.isIsCod());
|
| - |
|
1064 |
logger.info("Response" + catalogClient_Prod.addOrUpdatePrivateDeal(privateDeal));
|
| - |
|
1065 |
logger.info("Updated Private deal: " + item.getId());
|
| - |
|
1066 |
}
|
| - |
|
1067 |
else{
|
| - |
|
1068 |
logger.info("Skipping Private deal: " + item.getId());
|
| - |
|
1069 |
logger.info("Deal Price "+privateDeal.getDealPrice());
|
| - |
|
1070 |
logger.info("Deal Start Date "+privateDeal.getStartDate());
|
| - |
|
1071 |
logger.info("Deal End Date "+privateDeal.getEndDate());
|
| - |
|
1072 |
}
|
| - |
|
1073 |
|
| 1047 |
} catch (Exception e) {
|
1074 |
} catch (Exception e) {
|
| 1048 |
logger.error("Error while updating prices on production", e);
|
1075 |
logger.error("Error while updating prices on production", e);
|
| 1049 |
return "Error while updating all prices on production. Some of the prices may not have been updated";
|
1076 |
return "Error while updating all prices on production. Some of the prices may not have been updated";
|
| 1050 |
}
|
1077 |
}
|
| 1051 |
}
|
1078 |
}
|
| Line 1706... |
Line 1733... |
| 1706 |
stockPurchaseParams.setNumOfDaysStock(tStockPurchaseParams.getNumOfDaysStock());
|
1733 |
stockPurchaseParams.setNumOfDaysStock(tStockPurchaseParams.getNumOfDaysStock());
|
| 1707 |
}
|
1734 |
}
|
| 1708 |
in.shop2020.catalog.dashboard.shared.PrivateDeal privateDeal=null;
|
1735 |
in.shop2020.catalog.dashboard.shared.PrivateDeal privateDeal=null;
|
| 1709 |
if(tPrivateDeal!=null){
|
1736 |
if(tPrivateDeal!=null){
|
| 1710 |
privateDeal= new in.shop2020.catalog.dashboard.shared.PrivateDeal();
|
1737 |
privateDeal= new in.shop2020.catalog.dashboard.shared.PrivateDeal();
|
| - |
|
1738 |
if(tPrivateDeal.isSetDealFreebieItemId()){
|
| 1711 |
privateDeal.setDealFreebieItemId(tPrivateDeal.getDealFreebieItemId());
|
1739 |
privateDeal.setDealFreebieItemId(tPrivateDeal.getDealFreebieItemId());
|
| - |
|
1740 |
}
|
| - |
|
1741 |
else{
|
| - |
|
1742 |
privateDeal.setDealFreebieItemId(freebieItemId);
|
| - |
|
1743 |
}
|
| 1712 |
privateDeal.setItem_id(tPrivateDeal.getItem_id());
|
1744 |
privateDeal.setItem_id(tPrivateDeal.getItem_id());
|
| 1713 |
privateDeal.setDealPrice(tPrivateDeal.getDealPrice());
|
1745 |
privateDeal.setDealPrice(tPrivateDeal.getDealPrice());
|
| 1714 |
privateDeal.setDealFreebieItemId(tPrivateDeal.getDealFreebieItemId());
|
- |
|
| 1715 |
if(tPrivateDeal.isSetStartDate()){
|
1746 |
if(tPrivateDeal.isSetStartDate()){
|
| 1716 |
privateDeal.setStartDate(tPrivateDeal.getStartDate());
|
1747 |
privateDeal.setStartDate(tPrivateDeal.getStartDate());
|
| 1717 |
}
|
1748 |
}
|
| 1718 |
else{
|
1749 |
else{
|
| 1719 |
privateDeal.setStartDate(null);
|
1750 |
privateDeal.setStartDate(null);
|
| Line 1722... |
Line 1753... |
| 1722 |
privateDeal.setEndDate(tPrivateDeal.getEndDate());
|
1753 |
privateDeal.setEndDate(tPrivateDeal.getEndDate());
|
| 1723 |
}
|
1754 |
}
|
| 1724 |
else{
|
1755 |
else{
|
| 1725 |
privateDeal.setEndDate(null);
|
1756 |
privateDeal.setEndDate(null);
|
| 1726 |
}
|
1757 |
}
|
| 1727 |
privateDeal.setDealTextOption(tPrivateDeal.getDealTextOption());
|
- |
|
| 1728 |
privateDeal.setRank(tPrivateDeal.getRank());
|
1758 |
privateDeal.setRank(tPrivateDeal.getRank());
|
| - |
|
1759 |
if(tPrivateDeal.isSetIsCod()){
|
| 1729 |
privateDeal.setCod(tPrivateDeal.isIsCod());
|
1760 |
privateDeal.setCod(tPrivateDeal.isIsCod());
|
| - |
|
1761 |
}
|
| - |
|
1762 |
else{
|
| - |
|
1763 |
privateDeal.setCod(true);
|
| - |
|
1764 |
}
|
| - |
|
1765 |
if(tPrivateDeal.isSetDealFreebieOption()){
|
| 1730 |
privateDeal.setDealFreebieOption(tPrivateDeal.getDealFreebieOption());
|
1766 |
privateDeal.setDealFreebieOption(tPrivateDeal.getDealFreebieOption());
|
| - |
|
1767 |
}
|
| - |
|
1768 |
else{
|
| - |
|
1769 |
privateDeal.setDealFreebieOption(1L);
|
| - |
|
1770 |
}
|
| 1731 |
if(tPrivateDeal.getDealText()!=null){
|
1771 |
if(tPrivateDeal.isSetDealText()){
|
| 1732 |
privateDeal.setDealText(tPrivateDeal.getDealText());
|
1772 |
privateDeal.setDealText(tPrivateDeal.getDealText());
|
| 1733 |
}
|
1773 |
}
|
| 1734 |
else{
|
1774 |
else{
|
| - |
|
1775 |
if(thriftItem.isSetBestDealText()){
|
| - |
|
1776 |
privateDeal.setDealText(thriftItem.getBestDealText());
|
| - |
|
1777 |
}
|
| - |
|
1778 |
else{
|
| 1735 |
privateDeal.setDealText("");
|
1779 |
privateDeal.setDealText("");
|
| - |
|
1780 |
}
|
| - |
|
1781 |
}
|
| - |
|
1782 |
if(tPrivateDeal.isSetDealTextOption()){
|
| - |
|
1783 |
privateDeal.setDealTextOption(tPrivateDeal.getDealTextOption());
|
| - |
|
1784 |
}
|
| - |
|
1785 |
else{
|
| - |
|
1786 |
privateDeal.setDealTextOption(1L);
|
| - |
|
1787 |
}
|
| - |
|
1788 |
if(tPrivateDeal.isSetIsActive()){
|
| - |
|
1789 |
privateDeal.setActive(tPrivateDeal.isIsActive());
|
| - |
|
1790 |
}
|
| - |
|
1791 |
else{
|
| - |
|
1792 |
privateDeal.setActive(false);
|
| 1736 |
}
|
1793 |
}
|
| 1737 |
|
- |
|
| 1738 |
privateDeal.setActive(tPrivateDeal.isIsActive());
|
- |
|
| 1739 |
}
|
1794 |
}
|
| 1740 |
Item item = new Item(thriftItem.getId(),
|
1795 |
Item item = new Item(thriftItem.getId(),
|
| 1741 |
thriftItem.getProductGroup(),
|
1796 |
thriftItem.getProductGroup(),
|
| 1742 |
thriftItem.getBrand(),
|
1797 |
thriftItem.getBrand(),
|
| 1743 |
thriftItem.getModelNumber(),
|
1798 |
thriftItem.getModelNumber(),
|