Subversion Repositories SmartDukaan

Rev

Rev 8251 | Rev 8283 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8251 Rev 8281
Line 81... Line 81...
81
            	Long price = new Double(row.getCell(PRICE_INDEX).getNumericCellValue()).longValue();
81
            	Long price = new Double(row.getCell(PRICE_INDEX).getNumericCellValue()).longValue();
82
            	Date expiryDate = null;
82
            	Date expiryDate = null;
83
            	try {
83
            	try {
84
            		//TODO Test getDateCellValue
84
            		//TODO Test getDateCellValue
85
            		//row.getCell(EXPIRY_DATE_INDEX).setCellType(Cell.CELL_TYPE_STRING);
85
            		//row.getCell(EXPIRY_DATE_INDEX).setCellType(Cell.CELL_TYPE_STRING);
-
 
86
            		//row.getCell(EXPIRY_DATE_INDEX).setCellType(Cell.CELL_TYPE_STRING);
86
            		String expiryDateString = row.getCell(EXPIRY_DATE_INDEX).getStringCellValue();
87
            		//String expiryDateString = row.getCell(EXPIRY_DATE_INDEX).getStringCellValue();
87
            		expiryDate = sdf.parse(expiryDateString);
88
            		//expiryDate = sdf.parse(expiryDateString);
88
            	} catch (Exception e) {
89
            	} catch (Exception e) {
89
            		logger.warn("Error in updating expiry timestamp for Ebay Listing", e);
90
            		logger.warn("Error in updating expiry timestamp for Ebay Listing", e);
90
            	}
91
            	}
91
            	Double subsidy = row.getCell(SUBSIDY_INDEX).getNumericCellValue();
92
            	Double subsidy = row.getCell(SUBSIDY_INDEX).getNumericCellValue();
92
            	Cell warehouseCell = row.getCell(DEFAULT_WAREHOUSE_INDEX);
93
            	Cell warehouseCell = row.getCell(DEFAULT_WAREHOUSE_INDEX);
Line 101... Line 102...
101
            	ebayItem.setEbayListingId(listingId);
102
            	ebayItem.setEbayListingId(listingId);
102
            	ebayItem.setItemId(itemId);
103
            	ebayItem.setItemId(itemId);
103
            	ebayItem.setListingName(listingName);
104
            	ebayItem.setListingName(listingName);
104
            	ebayItem.setListingPrice(price);
105
            	ebayItem.setListingPrice(price);
105
            	try {
106
            	try {
106
            		ebayItem.setListingExpiryDate(expiryDate.getTime());
107
            		ebayItem.setListingExpiryDate(interchangeDateAndMonth(row.getCell(EXPIRY_DATE_INDEX).getDateCellValue()).getTime());
107
            	} catch (Exception e) {
108
            	} catch (Exception e) {
108
            		logger.warn("Error while setting expiry time for Ebay Listing", e);
109
            		logger.warn("Error while setting expiry time for Ebay Listing", e);
109
            	}
110
            	}
110
            	ebayItem.setSubsidy(subsidy);
111
            	ebayItem.setSubsidy(subsidy);
111
            	ebayItem.setDefaultWarehouseId(warehouseId);
112
            	ebayItem.setDefaultWarehouseId(warehouseId);
Line 128... Line 129...
128
        if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), "/ebay-dashboard"))
129
        if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), "/ebay-dashboard"))
129
            return "authfail";
130
            return "authfail";
130
        return "authsuccess";
131
        return "authsuccess";
131
    }
132
    }
132
	
133
	
-
 
134
	private Date interchangeDateAndMonth(Date date) {
-
 
135
		Date updatedDate = new Date(date.getTime());
-
 
136
		updatedDate.setDate(date.getMonth());
-
 
137
		updatedDate.setMonth(date.getDate());
-
 
138
		return updatedDate;
-
 
139
	}
-
 
140
	
133
	@Override
141
	@Override
134
	public void setServletRequest(HttpServletRequest request) {
142
	public void setServletRequest(HttpServletRequest request) {
135
		this.request = request;
143
		this.request = request;
136
        this.session = request.getSession();
144
        this.session = request.getSession();
137
	}
145
	}