| 7283 |
kshitij.so |
1 |
package in.shop2020.support.controllers;
|
|
|
2 |
|
| 8362 |
kshitij.so |
3 |
import java.io.BufferedInputStream;
|
| 7524 |
kshitij.so |
4 |
import java.io.File;
|
| 7741 |
kshitij.so |
5 |
import java.io.FileInputStream;
|
| 8362 |
kshitij.so |
6 |
import java.io.FileWriter;
|
| 7524 |
kshitij.so |
7 |
import java.io.IOException;
|
| 8362 |
kshitij.so |
8 |
import java.io.InputStream;
|
| 8620 |
kshitij.so |
9 |
import java.util.Arrays;
|
| 7365 |
kshitij.so |
10 |
import java.util.HashMap;
|
| 7283 |
kshitij.so |
11 |
import java.util.List;
|
|
|
12 |
import java.util.Map;
|
|
|
13 |
|
| 7591 |
kshitij.so |
14 |
import javax.servlet.ServletContext;
|
| 8362 |
kshitij.so |
15 |
import javax.servlet.ServletOutputStream;
|
| 7283 |
kshitij.so |
16 |
import javax.servlet.ServletRequest;
|
|
|
17 |
import javax.servlet.http.HttpServletRequest;
|
| 8168 |
kshitij.so |
18 |
import javax.servlet.http.HttpServletResponse;
|
| 7591 |
kshitij.so |
19 |
import javax.servlet.http.HttpSession;
|
| 7283 |
kshitij.so |
20 |
|
|
|
21 |
import in.shop2020.model.v1.catalog.Amazonlisted;
|
|
|
22 |
import in.shop2020.model.v1.catalog.CatalogServiceException;
|
|
|
23 |
import in.shop2020.model.v1.catalog.Item;
|
|
|
24 |
import in.shop2020.model.v1.inventory.AmazonInventorySnapshot;
|
|
|
25 |
import in.shop2020.model.v1.catalog.CatalogService.Client;
|
|
|
26 |
import in.shop2020.model.v1.inventory.InventoryServiceException;
|
| 7741 |
kshitij.so |
27 |
import in.shop2020.model.v1.order.AmazonOrder;
|
| 7591 |
kshitij.so |
28 |
import in.shop2020.support.utils.ReportsUtils;
|
| 7283 |
kshitij.so |
29 |
import in.shop2020.thrift.clients.CatalogClient;
|
|
|
30 |
import in.shop2020.thrift.clients.InventoryClient;
|
| 7365 |
kshitij.so |
31 |
import in.shop2020.thrift.clients.LogisticsClient;
|
| 7741 |
kshitij.so |
32 |
import in.shop2020.thrift.clients.TransactionClient;
|
| 7365 |
kshitij.so |
33 |
import in.shop2020.logistics.DeliveryType;
|
|
|
34 |
import in.shop2020.logistics.LogisticsInfo;
|
|
|
35 |
import in.shop2020.logistics.LogisticsServiceException;
|
|
|
36 |
import in.shop2020.logistics.PickUpType;
|
| 7283 |
kshitij.so |
37 |
|
| 7524 |
kshitij.so |
38 |
import org.apache.commons.io.FileUtils;
|
| 7365 |
kshitij.so |
39 |
import org.apache.commons.lang.xwork.StringUtils;
|
| 7741 |
kshitij.so |
40 |
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
|
|
41 |
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
| 8168 |
kshitij.so |
42 |
import org.apache.poi.ss.usermodel.Cell;
|
| 7591 |
kshitij.so |
43 |
import org.apache.struts2.convention.annotation.InterceptorRef;
|
|
|
44 |
import org.apache.struts2.convention.annotation.InterceptorRefs;
|
| 7283 |
kshitij.so |
45 |
import org.apache.struts2.convention.annotation.Result;
|
|
|
46 |
import org.apache.struts2.convention.annotation.Results;
|
|
|
47 |
import org.apache.struts2.interceptor.ServletRequestAware;
|
| 8168 |
kshitij.so |
48 |
import org.apache.struts2.interceptor.ServletResponseAware;
|
|
|
49 |
import org.apache.struts2.util.ServletContextAware;
|
| 7283 |
kshitij.so |
50 |
import org.apache.thrift.TException;
|
| 7741 |
kshitij.so |
51 |
import org.apache.thrift.transport.TTransportException;
|
| 7283 |
kshitij.so |
52 |
import org.slf4j.Logger;
|
|
|
53 |
import org.slf4j.LoggerFactory;
|
|
|
54 |
|
|
|
55 |
import com.opensymphony.xwork2.ValidationAwareSupport;
|
|
|
56 |
|
|
|
57 |
@SuppressWarnings("serial")
|
| 8620 |
kshitij.so |
58 |
|
| 7591 |
kshitij.so |
59 |
@InterceptorRefs({
|
|
|
60 |
@InterceptorRef("defaultStack"),
|
|
|
61 |
@InterceptorRef("login")
|
|
|
62 |
})
|
| 7283 |
kshitij.so |
63 |
@Results({
|
| 7524 |
kshitij.so |
64 |
@Result(name = "redirect", location = "${url}", type = "redirect"),
|
|
|
65 |
@Result(name="authsuccess", type="redirectAction", params = {"actionName" , "reports"})
|
|
|
66 |
})
|
| 8168 |
kshitij.so |
67 |
public class AmazonListController extends ValidationAwareSupport implements ServletRequestAware ,ServletResponseAware, ServletContextAware{
|
| 7283 |
kshitij.so |
68 |
|
|
|
69 |
private static Logger logger = LoggerFactory.getLogger(AmazonListController.class);
|
|
|
70 |
|
| 7591 |
kshitij.so |
71 |
private HttpServletRequest request;
|
|
|
72 |
private HttpSession session;
|
|
|
73 |
private ServletContext context;
|
| 8362 |
kshitij.so |
74 |
private HttpServletResponse response;
|
| 7283 |
kshitij.so |
75 |
private String url;
|
|
|
76 |
private String id;
|
|
|
77 |
private String itemId;
|
|
|
78 |
private String isFba;
|
|
|
79 |
private String isNonFba;
|
|
|
80 |
private String isInventoryOverride;
|
|
|
81 |
private String fbaPrice;
|
|
|
82 |
private String sellingPrice;
|
|
|
83 |
private String saholicPrice;
|
| 7365 |
kshitij.so |
84 |
private String isTime;
|
|
|
85 |
private String handlingTime;
|
|
|
86 |
private String customHandlingTime;
|
| 7461 |
kshitij.so |
87 |
private String holdInventory;
|
|
|
88 |
private String defaultInventory;
|
| 7524 |
kshitij.so |
89 |
private String fileUploadFileName;
|
|
|
90 |
private String fileUploadContentType;
|
| 8168 |
kshitij.so |
91 |
private String suppressMfnPriceUpdate;
|
|
|
92 |
private String suppressFbaPriceUpdate;
|
| 7524 |
kshitij.so |
93 |
private File file;
|
| 8362 |
kshitij.so |
94 |
private String errMsg;
|
| 8620 |
kshitij.so |
95 |
private String next;
|
|
|
96 |
private List<Amazonlisted> amazonItems;
|
|
|
97 |
private String searchText;
|
|
|
98 |
private long searchCount;
|
|
|
99 |
private long totalCount;
|
|
|
100 |
private String taxCode;
|
| 7283 |
kshitij.so |
101 |
|
|
|
102 |
public String index() {
|
| 8620 |
kshitij.so |
103 |
if (!ReportsUtils.canAccessReport((Long) session.getAttribute(ReportsUtils.ROLE),request.getServletPath())) {
|
| 7591 |
kshitij.so |
104 |
return "authfail";
|
|
|
105 |
}
|
| 7283 |
kshitij.so |
106 |
return "index";
|
|
|
107 |
}
|
|
|
108 |
|
| 8620 |
kshitij.so |
109 |
public String fetchItems() throws TException {
|
| 7408 |
kshitij.so |
110 |
Client CatalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
|
| 8620 |
kshitij.so |
111 |
if (searchText.length() == 0) {
|
|
|
112 |
amazonItems = CatalogClient.getAmazonListedItems(Long.valueOf(next), 10);
|
|
|
113 |
totalCount = CatalogClient.getCountForAmazonlistedItems();
|
|
|
114 |
setSearchCount(totalCount);
|
|
|
115 |
} else {
|
|
|
116 |
List<String> subString = Arrays.asList(searchText.split(" "));
|
|
|
117 |
amazonItems = CatalogClient.searchAmazonItems(subString,Long.valueOf(next), 10);
|
|
|
118 |
totalCount = CatalogClient.getCountForAmazonlistedItems();
|
|
|
119 |
searchCount = CatalogClient.getAmazonSearchResultCount(subString);
|
|
|
120 |
}
|
|
|
121 |
return "amazon-item-table";
|
| 7283 |
kshitij.so |
122 |
}
|
|
|
123 |
|
| 8620 |
kshitij.so |
124 |
|
| 7408 |
kshitij.so |
125 |
public Amazonlisted fetchItemDetail() throws NumberFormatException, TException {
|
|
|
126 |
Client CatalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
|
| 7283 |
kshitij.so |
127 |
return CatalogClient.getAmazonItemDetails(Long.valueOf(id));
|
|
|
128 |
}
|
|
|
129 |
|
| 7408 |
kshitij.so |
130 |
public Item getSaholicItem(String id) throws NumberFormatException, CatalogServiceException, TException {
|
|
|
131 |
Client CatalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
|
| 7283 |
kshitij.so |
132 |
return CatalogClient.getItem(Long.valueOf(id));
|
|
|
133 |
}
|
| 7365 |
kshitij.so |
134 |
|
|
|
135 |
|
|
|
136 |
|
| 7283 |
kshitij.so |
137 |
public String update() throws NumberFormatException, TException{
|
| 7408 |
kshitij.so |
138 |
Client CatalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
|
| 8168 |
kshitij.so |
139 |
boolean flag=false;
|
|
|
140 |
boolean commit=false;
|
|
|
141 |
long delay = Long.valueOf(customHandlingTime);
|
|
|
142 |
if ( Boolean.valueOf(isTime)) {
|
|
|
143 |
flag = true;
|
|
|
144 |
}
|
|
|
145 |
changeItemInventory();
|
|
|
146 |
Amazonlisted amazonlisted = CatalogClient.getAmazonItemDetails(Long.valueOf(itemId));
|
|
|
147 |
if (amazonlisted.getSellingPrice()!=Double.valueOf(sellingPrice)){
|
|
|
148 |
amazonlisted.setSellingPrice(Double.valueOf(sellingPrice));
|
|
|
149 |
commit=true;
|
|
|
150 |
}
|
|
|
151 |
if (amazonlisted.getFbaPrice()!=Double.valueOf(fbaPrice)){
|
|
|
152 |
amazonlisted.setFbaPrice(Double.valueOf(fbaPrice));
|
|
|
153 |
commit=true;
|
|
|
154 |
}
|
|
|
155 |
if (amazonlisted.isIsFba()!=Boolean.valueOf(isFba)){
|
|
|
156 |
amazonlisted.setIsFba(Boolean.valueOf(isFba));
|
|
|
157 |
commit=true;
|
|
|
158 |
}
|
|
|
159 |
if (amazonlisted.isIsNonFba()!=Boolean.valueOf(isNonFba)){
|
|
|
160 |
amazonlisted.setIsNonFba(Boolean.valueOf(isNonFba));
|
|
|
161 |
commit=true;
|
|
|
162 |
}
|
|
|
163 |
if (amazonlisted.isIsCustomTime()!=flag){
|
|
|
164 |
amazonlisted.setIsCustomTime(flag);
|
|
|
165 |
commit=true;
|
|
|
166 |
}
|
|
|
167 |
if (amazonlisted.getHandlingTime()!=delay){
|
|
|
168 |
amazonlisted.setHandlingTime(delay);
|
|
|
169 |
commit=true;
|
|
|
170 |
}
|
|
|
171 |
if(amazonlisted.isIsInventoryOverride()!=Boolean.valueOf(isInventoryOverride)){
|
|
|
172 |
amazonlisted.setIsInventoryOverride(Boolean.valueOf(isInventoryOverride));
|
|
|
173 |
commit=true;
|
|
|
174 |
}
|
|
|
175 |
if(amazonlisted.isSuppressMfnPriceUpdate()!=Boolean.valueOf(suppressMfnPriceUpdate)){
|
|
|
176 |
amazonlisted.setSuppressMfnPriceUpdate(Boolean.valueOf(suppressMfnPriceUpdate));
|
|
|
177 |
commit=true;
|
|
|
178 |
}
|
|
|
179 |
if(amazonlisted.isSuppressFbaPriceUpdate()!=Boolean.valueOf(suppressFbaPriceUpdate)){
|
|
|
180 |
amazonlisted.setSuppressFbaPriceUpdate(Boolean.valueOf(suppressFbaPriceUpdate));
|
|
|
181 |
commit=true;
|
|
|
182 |
}
|
| 8620 |
kshitij.so |
183 |
|
|
|
184 |
if(!StringUtils.equals(amazonlisted.getTaxCode(), taxCode)){
|
|
|
185 |
amazonlisted.setTaxCode(taxCode);
|
|
|
186 |
commit=true;
|
|
|
187 |
}
|
|
|
188 |
|
| 8168 |
kshitij.so |
189 |
if(commit){
|
|
|
190 |
CatalogClient.updateAmazonItemDetails(amazonlisted);
|
|
|
191 |
}
|
|
|
192 |
else{
|
|
|
193 |
logger.info("Nothing new to commit");
|
|
|
194 |
}
|
| 7591 |
kshitij.so |
195 |
return "index";
|
| 7283 |
kshitij.so |
196 |
|
|
|
197 |
}
|
|
|
198 |
|
| 8168 |
kshitij.so |
199 |
public void upload() throws IOException, TException {
|
| 7524 |
kshitij.so |
200 |
File fileToCreate = new File("/tmp/", "Amazon-shipping.xls");
|
|
|
201 |
FileUtils.copyFile(this.file, fileToCreate);
|
| 7741 |
kshitij.so |
202 |
FileInputStream iFile = new FileInputStream(new File(file.getAbsolutePath()));
|
|
|
203 |
HSSFWorkbook workbook = new HSSFWorkbook(iFile);
|
|
|
204 |
HSSFSheet sheet = workbook.getSheetAt(0);
|
| 7762 |
kshitij.so |
205 |
Map<Long,Map<String,String>> amazonOrderMap = new HashMap<Long,Map<String,String>>();
|
| 7741 |
kshitij.so |
206 |
for (int iterator=sheet.getFirstRowNum();iterator<=sheet.getLastRowNum();iterator++){
|
|
|
207 |
TransactionClient tcl = new TransactionClient();
|
|
|
208 |
List<AmazonOrder> orders = tcl.getClient().getAmazonOrderByAmazonOrderId(sheet.getRow(iterator).getCell(0).getStringCellValue());
|
|
|
209 |
for (AmazonOrder order : orders){
|
| 7753 |
kshitij.so |
210 |
if (StringUtils.equals(order.getStatus(), "Order-Payment-Success")){
|
| 7762 |
kshitij.so |
211 |
Map<String,String> dateMap = new HashMap<String,String>();
|
|
|
212 |
dateMap.put(sheet.getRow(iterator).getCell(1).getStringCellValue(), sheet.getRow(iterator).getCell(2).getStringCellValue());
|
|
|
213 |
amazonOrderMap.put(order.getOrderId(), dateMap);
|
| 7741 |
kshitij.so |
214 |
}
|
|
|
215 |
}
|
|
|
216 |
}
|
|
|
217 |
TransactionClient tcl = new TransactionClient();
|
|
|
218 |
tcl.getClient().updateTimestampForAmazonOrder(amazonOrderMap);
|
| 7524 |
kshitij.so |
219 |
}
|
|
|
220 |
|
| 8620 |
kshitij.so |
221 |
|
|
|
222 |
|
| 7461 |
kshitij.so |
223 |
private void changeItemInventory() throws NumberFormatException, TException {
|
|
|
224 |
Client CatalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
|
| 7524 |
kshitij.so |
225 |
|
| 7461 |
kshitij.so |
226 |
if (StringUtils.isEmpty(holdInventory)) {
|
|
|
227 |
holdInventory = "0";
|
|
|
228 |
}
|
|
|
229 |
if (StringUtils.isEmpty(defaultInventory)) {
|
|
|
230 |
defaultInventory = "0";
|
|
|
231 |
}
|
|
|
232 |
CatalogClient.updateItemInventory(Long.valueOf(itemId),Long.valueOf(holdInventory),Long.valueOf(defaultInventory));
|
|
|
233 |
}
|
|
|
234 |
|
|
|
235 |
|
| 7283 |
kshitij.so |
236 |
public Map<Long, Long> getAvailableItemInventory(String itemId) throws NumberFormatException, InventoryServiceException, TException{
|
|
|
237 |
InventoryClient inventoryServiceClient = new InventoryClient();
|
|
|
238 |
in.shop2020.model.v1.inventory.InventoryService.Client inventoryClient = inventoryServiceClient.getClient();
|
|
|
239 |
in.shop2020.model.v1.inventory.ItemInventory thriftItemInventory = inventoryClient.getItemInventoryByItemId(Long.valueOf(itemId));
|
|
|
240 |
return thriftItemInventory.getAvailability();
|
|
|
241 |
|
|
|
242 |
}
|
|
|
243 |
|
|
|
244 |
public Map<Long, Long> getReservedItemInventory(String itemId) throws NumberFormatException, InventoryServiceException, TException{
|
|
|
245 |
InventoryClient inventoryServiceClient = new InventoryClient();
|
|
|
246 |
in.shop2020.model.v1.inventory.InventoryService.Client inventoryClient = inventoryServiceClient.getClient();
|
|
|
247 |
in.shop2020.model.v1.inventory.ItemInventory thriftItemInventory = inventoryClient.getItemInventoryByItemId(Long.valueOf(itemId));
|
|
|
248 |
return thriftItemInventory.getReserved();
|
|
|
249 |
|
|
|
250 |
}
|
|
|
251 |
|
|
|
252 |
public String getWarehouseName(String warehouseId) throws NumberFormatException, TException {
|
|
|
253 |
InventoryClient inventoryServiceClient = new InventoryClient();
|
|
|
254 |
return inventoryServiceClient.getClient().getWarehouseName(Long.valueOf(warehouseId));
|
|
|
255 |
}
|
|
|
256 |
|
|
|
257 |
public AmazonInventorySnapshot getInventoryForAmazonItem(String itemId) throws NumberFormatException, TException {
|
|
|
258 |
InventoryClient inventoryServiceClient = new InventoryClient();
|
| 7365 |
kshitij.so |
259 |
try {
|
|
|
260 |
return inventoryServiceClient.getClient().getAmazonInventoryForItem(Long.valueOf(itemId));
|
|
|
261 |
}
|
|
|
262 |
catch (Exception e){
|
|
|
263 |
return null;
|
|
|
264 |
}
|
| 7283 |
kshitij.so |
265 |
}
|
|
|
266 |
|
| 8620 |
kshitij.so |
267 |
public long getFbaInventoryForAmazonItem(String itemId) throws NumberFormatException, TException {
|
|
|
268 |
InventoryClient inventoryServiceClient = new InventoryClient();
|
|
|
269 |
try {
|
|
|
270 |
return inventoryServiceClient.getClient().getAmazonFbaItemInventory(Long.valueOf(itemId));
|
|
|
271 |
}
|
|
|
272 |
catch (Exception e){
|
|
|
273 |
return 0;
|
|
|
274 |
}
|
|
|
275 |
}
|
|
|
276 |
|
| 7365 |
kshitij.so |
277 |
public Long getTimetoShip(String itemId) throws LogisticsServiceException, TException{
|
|
|
278 |
LogisticsClient logisticsClient = new LogisticsClient();
|
|
|
279 |
return logisticsClient.getClient().getLogisticsInfo("110001", Long.valueOf(itemId), DeliveryType.COD, PickUpType.COURIER).getShippingTime();
|
|
|
280 |
|
|
|
281 |
}
|
|
|
282 |
|
| 8168 |
kshitij.so |
283 |
public String runAsinJob() throws IOException, InterruptedException {
|
|
|
284 |
if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0])) {
|
|
|
285 |
logger.info(request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0]);
|
|
|
286 |
return "authfail";
|
|
|
287 |
}
|
|
|
288 |
ProcessBuilder testProcess = new ProcessBuilder("/bin/bash");
|
| 8396 |
kshitij.so |
289 |
String[] command = {"/bin/bash", "-c", "sudo /root/code/trunk/AmazonFeeds/RunAsinJob.sh"};
|
| 8168 |
kshitij.so |
290 |
testProcess.command(command);
|
|
|
291 |
logger.info(testProcess.command().toString());
|
|
|
292 |
Process process = testProcess.start();
|
|
|
293 |
process.waitFor();
|
|
|
294 |
logger.info(String.valueOf(process.exitValue()));
|
|
|
295 |
return "asinjob";
|
| 8070 |
kshitij.so |
296 |
|
| 8168 |
kshitij.so |
297 |
}
|
| 8620 |
kshitij.so |
298 |
|
| 8396 |
kshitij.so |
299 |
public String runFbaListingJob() throws IOException, InterruptedException {
|
|
|
300 |
if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0])) {
|
|
|
301 |
logger.info(request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0]);
|
|
|
302 |
return "authfail";
|
|
|
303 |
}
|
|
|
304 |
ProcessBuilder testProcess = new ProcessBuilder("/bin/bash");
|
|
|
305 |
String[] command = {"/bin/bash", "-c", "sudo /root/code/trunk/AmazonFeeds/RunFbaListingJob.sh"};
|
|
|
306 |
testProcess.command(command);
|
|
|
307 |
logger.info(testProcess.command().toString());
|
|
|
308 |
Process process = testProcess.start();
|
|
|
309 |
process.waitFor();
|
|
|
310 |
logger.info(String.valueOf(process.exitValue()));
|
|
|
311 |
return "asinjob";
|
|
|
312 |
}
|
| 8620 |
kshitij.so |
313 |
|
| 8396 |
kshitij.so |
314 |
public String runNonFbaListingJob() throws IOException, InterruptedException {
|
|
|
315 |
if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0])) {
|
|
|
316 |
logger.info(request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0]);
|
|
|
317 |
return "authfail";
|
|
|
318 |
}
|
|
|
319 |
ProcessBuilder testProcess = new ProcessBuilder("/bin/bash");
|
|
|
320 |
String[] command = {"/bin/bash", "-c", "sudo /root/code/trunk/AmazonFeeds/RunNonFbaListingJob.sh"};
|
|
|
321 |
testProcess.command(command);
|
|
|
322 |
logger.info(testProcess.command().toString());
|
|
|
323 |
Process process = testProcess.start();
|
|
|
324 |
process.waitFor();
|
|
|
325 |
logger.info(String.valueOf(process.exitValue()));
|
|
|
326 |
return "asinjob";
|
|
|
327 |
}
|
| 10097 |
kshitij.so |
328 |
|
|
|
329 |
public void runFbaInventoryJob() throws IOException, InterruptedException {
|
|
|
330 |
ProcessBuilder testProcess = new ProcessBuilder("/bin/bash");
|
|
|
331 |
String[] command = {"/bin/bash", "-c", "sudo /root/code/trunk/AmazonFeeds/SubmitFBAInventoryFeed.sh"};
|
|
|
332 |
testProcess.command(command);
|
|
|
333 |
logger.info(testProcess.command().toString());
|
|
|
334 |
Process process = testProcess.start();
|
|
|
335 |
process.waitFor();
|
|
|
336 |
logger.info(String.valueOf(process.exitValue()));
|
|
|
337 |
}
|
| 8073 |
kshitij.so |
338 |
|
| 8620 |
kshitij.so |
339 |
public void uploadAsinFile() throws IOException, TException{
|
|
|
340 |
File fileToCreate = new File("/tmp/", "Amazon-asin-upload.xls");
|
|
|
341 |
FileUtils.copyFile(this.file, fileToCreate);
|
|
|
342 |
FileInputStream iFile = new FileInputStream(new File(file.getAbsolutePath()));
|
|
|
343 |
HSSFWorkbook workbook = new HSSFWorkbook(iFile);
|
|
|
344 |
HSSFSheet sheet = workbook.getSheetAt(0);
|
|
|
345 |
Map<Long,Item> amazonAsin = new HashMap<Long,Item>();
|
|
|
346 |
StringBuilder sb =new StringBuilder();
|
|
|
347 |
Client CatalogClient=null;
|
|
|
348 |
try {
|
|
|
349 |
CatalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
|
|
|
350 |
} catch (TTransportException e) {
|
|
|
351 |
e.printStackTrace();
|
|
|
352 |
}
|
|
|
353 |
for (int iterator=(sheet.getFirstRowNum()+1);iterator<=sheet.getLastRowNum();iterator++){
|
|
|
354 |
Item item=null;
|
|
|
355 |
Long sku;
|
|
|
356 |
String asin;
|
|
|
357 |
if (checkEmptyString(sheet.getRow(iterator).getCell(0))){
|
|
|
358 |
continue;
|
|
|
359 |
}
|
|
|
360 |
else {
|
|
|
361 |
sku=(long) sheet.getRow(iterator).getCell(0).getNumericCellValue();
|
|
|
362 |
try {
|
|
|
363 |
item = CatalogClient.getItem(sku);
|
|
|
364 |
} catch (Exception e) {
|
|
|
365 |
logger.info("Unable to fetch item details ID= "+sku);
|
|
|
366 |
logger.info("Unable to fetch item. "+e);
|
|
|
367 |
sb.append("Service exception ItemId not updated Id= "+sku+"\n");
|
|
|
368 |
continue;
|
|
|
369 |
}
|
|
|
370 |
}
|
|
|
371 |
|
|
|
372 |
if(item.getId() == 0){
|
|
|
373 |
logger.info("Item Id doesn't exist in catalog Id= "+sku);
|
|
|
374 |
sb.append("Item Id doesn't exist in catalog Id= "+sku+"\n");
|
|
|
375 |
continue;
|
|
|
376 |
}
|
|
|
377 |
|
|
|
378 |
if (!checkEmptyString(sheet.getRow(iterator).getCell(1))){
|
|
|
379 |
asin = sheet.getRow(iterator).getCell(1).getStringCellValue();
|
|
|
380 |
item.setAsin(asin);
|
|
|
381 |
}
|
|
|
382 |
|
|
|
383 |
if (!checkEmptyString(sheet.getRow(iterator).getCell(2))){
|
|
|
384 |
long virtualInventory =(long) sheet.getRow(iterator).getCell(2).getNumericCellValue();
|
|
|
385 |
item.setDefaultInventory(virtualInventory);
|
|
|
386 |
}
|
|
|
387 |
|
|
|
388 |
if (!checkEmptyString(sheet.getRow(iterator).getCell(3))){
|
|
|
389 |
long riskyInventory =(long) sheet.getRow(iterator).getCell(3).getNumericCellValue();
|
|
|
390 |
item.setHoldInventory(riskyInventory);
|
|
|
391 |
}
|
|
|
392 |
|
|
|
393 |
amazonAsin.put(sku, item);
|
|
|
394 |
}
|
|
|
395 |
CatalogClient.updateAsin(amazonAsin);
|
|
|
396 |
|
|
|
397 |
logger.info("Amazon Asin Map "+amazonAsin.toString());
|
|
|
398 |
CatalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
|
|
|
399 |
CatalogClient.updateAsin(amazonAsin);
|
|
|
400 |
File file = new File("/tmp/asinfile");
|
|
|
401 |
FileWriter writer = new FileWriter(file);
|
|
|
402 |
writer.append(sb.toString());
|
|
|
403 |
writer.close();
|
|
|
404 |
byte[] buffer = new byte[(int)file.length()];
|
|
|
405 |
InputStream input = null;
|
|
|
406 |
try {
|
|
|
407 |
int totalBytesRead = 0;
|
|
|
408 |
input = new BufferedInputStream(new FileInputStream(file));
|
|
|
409 |
while(totalBytesRead < buffer.length){
|
|
|
410 |
int bytesRemaining = buffer.length - totalBytesRead;
|
|
|
411 |
int bytesRead = input.read(buffer, totalBytesRead, bytesRemaining);
|
|
|
412 |
if (bytesRead > 0){
|
|
|
413 |
totalBytesRead = totalBytesRead + bytesRead;
|
|
|
414 |
}
|
|
|
415 |
}
|
|
|
416 |
}
|
|
|
417 |
finally {
|
|
|
418 |
input.close();
|
|
|
419 |
file.delete();
|
|
|
420 |
}
|
|
|
421 |
|
|
|
422 |
response.setHeader("Content-Type", "text/javascript");
|
|
|
423 |
|
|
|
424 |
ServletOutputStream sos;
|
|
|
425 |
try {
|
|
|
426 |
sos = response.getOutputStream();
|
|
|
427 |
sos.write(buffer);
|
|
|
428 |
sos.flush();
|
|
|
429 |
} catch (IOException e) {
|
|
|
430 |
System.out.println("Unable to stream the manifest file");
|
|
|
431 |
}
|
|
|
432 |
}
|
|
|
433 |
|
| 8168 |
kshitij.so |
434 |
public void uploadBulkFile() throws IOException, TException{
|
|
|
435 |
File fileToCreate = new File("/tmp/", "Amazon-bulk-upload.xls");
|
|
|
436 |
FileUtils.copyFile(this.file, fileToCreate);
|
|
|
437 |
FileInputStream iFile = new FileInputStream(new File(file.getAbsolutePath()));
|
|
|
438 |
HSSFWorkbook workbook = new HSSFWorkbook(iFile);
|
| 10097 |
kshitij.so |
439 |
|
| 8168 |
kshitij.so |
440 |
HSSFSheet sheet = workbook.getSheetAt(0);
|
|
|
441 |
Map<Long,Amazonlisted> amazonBulkUpdate = new HashMap<Long,Amazonlisted>();
|
|
|
442 |
Client CatalogClient=null;
|
| 8362 |
kshitij.so |
443 |
StringBuilder sb = new StringBuilder();
|
| 8168 |
kshitij.so |
444 |
try {
|
|
|
445 |
CatalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
|
|
|
446 |
} catch (TTransportException e) {
|
|
|
447 |
// TODO Auto-generated catch block
|
|
|
448 |
e.printStackTrace();
|
|
|
449 |
}
|
|
|
450 |
for (int iterator=(sheet.getFirstRowNum()+1);iterator<=sheet.getLastRowNum();iterator++){
|
|
|
451 |
Amazonlisted amazonlisted =null;
|
|
|
452 |
Long sku;
|
|
|
453 |
if (checkEmptyString(sheet.getRow(iterator).getCell(0))){
|
|
|
454 |
continue;
|
|
|
455 |
}
|
|
|
456 |
else {
|
|
|
457 |
sku=(long) sheet.getRow(iterator).getCell(0).getNumericCellValue();
|
| 8362 |
kshitij.so |
458 |
try {
|
|
|
459 |
amazonlisted = CatalogClient.getAmazonItemDetails(sku);
|
|
|
460 |
} catch (TException e) {
|
|
|
461 |
logger.info("Unable to fetch item details ID= "+sku);
|
|
|
462 |
sb.append("Service exception ItemId not updated Id= "+sku+"\n");
|
|
|
463 |
continue;
|
|
|
464 |
}
|
| 8168 |
kshitij.so |
465 |
}
|
| 8620 |
kshitij.so |
466 |
|
| 8362 |
kshitij.so |
467 |
if(amazonlisted.getItemid() == 0){
|
|
|
468 |
logger.info("Item Id doesn't exist in amazonlisted Id= "+sku);
|
|
|
469 |
sb.append("Item Id doesn't exist in amazonlisted Id= "+sku+"\n");
|
|
|
470 |
continue;
|
|
|
471 |
}
|
| 8168 |
kshitij.so |
472 |
|
|
|
473 |
if (!checkEmptyString(sheet.getRow(iterator).getCell(1))){
|
|
|
474 |
double mfnPrice = sheet.getRow(iterator).getCell(1).getNumericCellValue();
|
|
|
475 |
amazonlisted.setSellingPrice(mfnPrice);
|
|
|
476 |
}
|
|
|
477 |
|
|
|
478 |
if (!checkEmptyString(sheet.getRow(iterator).getCell(2))){
|
|
|
479 |
double fbaSellingPrice = sheet.getRow(iterator).getCell(2).getNumericCellValue();
|
|
|
480 |
amazonlisted.setFbaPrice(fbaSellingPrice);
|
|
|
481 |
}
|
|
|
482 |
|
|
|
483 |
if (!checkEmptyString(sheet.getRow(iterator).getCell(3))){
|
|
|
484 |
if ((long)sheet.getRow(iterator).getCell(3).getNumericCellValue()==1){
|
|
|
485 |
amazonlisted.setIsNonFba(true);
|
|
|
486 |
}
|
|
|
487 |
if ((long)sheet.getRow(iterator).getCell(3).getNumericCellValue()==0){
|
|
|
488 |
amazonlisted.setIsNonFba(false);
|
|
|
489 |
}
|
|
|
490 |
}
|
|
|
491 |
|
|
|
492 |
if (!checkEmptyString(sheet.getRow(iterator).getCell(4))){
|
|
|
493 |
if ((long)sheet.getRow(iterator).getCell(4).getNumericCellValue()==1){
|
|
|
494 |
amazonlisted.setIsFba(true);
|
|
|
495 |
}
|
|
|
496 |
if ((long)sheet.getRow(iterator).getCell(4).getNumericCellValue()==0){
|
|
|
497 |
amazonlisted.setIsFba(false);
|
|
|
498 |
}
|
|
|
499 |
}
|
|
|
500 |
if (!checkEmptyString(sheet.getRow(iterator).getCell(5))){
|
|
|
501 |
if ((long)sheet.getRow(iterator).getCell(5).getNumericCellValue()==1){
|
|
|
502 |
amazonlisted.setIsInventoryOverride(true);
|
|
|
503 |
}
|
|
|
504 |
if ((long)sheet.getRow(iterator).getCell(5).getNumericCellValue()==0){
|
|
|
505 |
amazonlisted.setIsInventoryOverride(false);
|
|
|
506 |
}
|
|
|
507 |
}
|
|
|
508 |
if (!checkEmptyString(sheet.getRow(iterator).getCell(6))){
|
|
|
509 |
if ((long)sheet.getRow(iterator).getCell(6).getNumericCellValue()==1){
|
|
|
510 |
amazonlisted.setSuppressMfnPriceUpdate(true);
|
|
|
511 |
}
|
|
|
512 |
if ((long)sheet.getRow(iterator).getCell(6).getNumericCellValue()==0){
|
|
|
513 |
amazonlisted.setSuppressMfnPriceUpdate(false);
|
|
|
514 |
}
|
|
|
515 |
}
|
|
|
516 |
|
|
|
517 |
if (!checkEmptyString(sheet.getRow(iterator).getCell(7))){
|
|
|
518 |
if ((long)sheet.getRow(iterator).getCell(7).getNumericCellValue()==1){
|
|
|
519 |
amazonlisted.setSuppressFbaPriceUpdate(true);
|
|
|
520 |
}
|
|
|
521 |
if ((long)sheet.getRow(iterator).getCell(7).getNumericCellValue()==0){
|
|
|
522 |
amazonlisted.setSuppressFbaPriceUpdate(false);
|
|
|
523 |
}
|
|
|
524 |
}
|
| 8620 |
kshitij.so |
525 |
|
|
|
526 |
if (!checkEmptyString(sheet.getRow(iterator).getCell(8))){
|
|
|
527 |
String taxCode = sheet.getRow(iterator).getCell(8).getStringCellValue();
|
|
|
528 |
amazonlisted.setTaxCode(taxCode);
|
|
|
529 |
}
|
| 8168 |
kshitij.so |
530 |
amazonBulkUpdate.put(sku, amazonlisted);
|
|
|
531 |
}
|
|
|
532 |
logger.info("Amazon Bulk Map "+amazonBulkUpdate.toString());
|
|
|
533 |
CatalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
|
| 10097 |
kshitij.so |
534 |
boolean result = CatalogClient.updateAmazonAttributesInBulk(amazonBulkUpdate);
|
|
|
535 |
if (!result){
|
|
|
536 |
sb = new StringBuilder();
|
|
|
537 |
sb.append("Error : Unable to update");
|
|
|
538 |
}
|
| 8620 |
kshitij.so |
539 |
File file = new File("/tmp/amazonbulk");
|
| 8362 |
kshitij.so |
540 |
FileWriter writer = new FileWriter(file);
|
|
|
541 |
writer.append(sb.toString());
|
|
|
542 |
writer.close();
|
|
|
543 |
byte[] buffer = new byte[(int)file.length()];
|
|
|
544 |
InputStream input = null;
|
|
|
545 |
try {
|
|
|
546 |
int totalBytesRead = 0;
|
|
|
547 |
input = new BufferedInputStream(new FileInputStream(file));
|
|
|
548 |
while(totalBytesRead < buffer.length){
|
|
|
549 |
int bytesRemaining = buffer.length - totalBytesRead;
|
|
|
550 |
int bytesRead = input.read(buffer, totalBytesRead, bytesRemaining);
|
|
|
551 |
if (bytesRead > 0){
|
|
|
552 |
totalBytesRead = totalBytesRead + bytesRead;
|
|
|
553 |
}
|
|
|
554 |
}
|
|
|
555 |
}
|
|
|
556 |
finally {
|
|
|
557 |
input.close();
|
|
|
558 |
file.delete();
|
|
|
559 |
}
|
|
|
560 |
|
|
|
561 |
response.setHeader("Content-Type", "text/javascript");
|
|
|
562 |
|
|
|
563 |
ServletOutputStream sos;
|
|
|
564 |
try {
|
|
|
565 |
sos = response.getOutputStream();
|
|
|
566 |
sos.write(buffer);
|
|
|
567 |
sos.flush();
|
|
|
568 |
} catch (IOException e) {
|
|
|
569 |
System.out.println("Unable to stream the manifest file");
|
|
|
570 |
}
|
| 8168 |
kshitij.so |
571 |
}
|
|
|
572 |
|
|
|
573 |
|
| 8620 |
kshitij.so |
574 |
|
|
|
575 |
|
| 8168 |
kshitij.so |
576 |
public boolean checkEmptyString(Cell cell){
|
|
|
577 |
if (cell==null){
|
|
|
578 |
return true;
|
|
|
579 |
}
|
|
|
580 |
return false;
|
|
|
581 |
}
|
|
|
582 |
|
|
|
583 |
public String uploadSheet(){
|
|
|
584 |
if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0])) {
|
|
|
585 |
logger.info(request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0]);
|
|
|
586 |
return "authfail";
|
|
|
587 |
}
|
|
|
588 |
return "amazon-shipping-upload";
|
|
|
589 |
}
|
|
|
590 |
|
| 8620 |
kshitij.so |
591 |
public String uploadAsin(){
|
|
|
592 |
if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0])) {
|
|
|
593 |
logger.info(request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0]);
|
|
|
594 |
return "authfail";
|
|
|
595 |
}
|
|
|
596 |
return "amazon-asin-upload";
|
|
|
597 |
}
|
|
|
598 |
|
| 8168 |
kshitij.so |
599 |
public String uploadBulkSheet(){
|
|
|
600 |
if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0])) {
|
|
|
601 |
logger.info(request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0]);
|
|
|
602 |
return "authfail";
|
|
|
603 |
}
|
|
|
604 |
return "amazon-bulk-upload";
|
|
|
605 |
}
|
|
|
606 |
|
|
|
607 |
|
| 7283 |
kshitij.so |
608 |
public String edit() {
|
| 7591 |
kshitij.so |
609 |
if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), request.getRequestURI().substring(request.getContextPath().length()).split("/")[1])) {
|
|
|
610 |
return "authfail";
|
|
|
611 |
}
|
| 7283 |
kshitij.so |
612 |
return "edit";
|
|
|
613 |
}
|
|
|
614 |
|
|
|
615 |
public String show() {
|
| 8168 |
kshitij.so |
616 |
if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), request.getRequestURI().substring(request.getContextPath().length()).split("/")[1])) {
|
|
|
617 |
logger.info(request.getRequestURI().substring(request.getContextPath().length()).split("/")[1]);
|
|
|
618 |
return "authfail";
|
|
|
619 |
}
|
|
|
620 |
|
|
|
621 |
if (StringUtils.equals(id, "options")){
|
|
|
622 |
return "options";
|
|
|
623 |
}
|
| 8620 |
kshitij.so |
624 |
|
|
|
625 |
if (StringUtils.equals(id, "item-table")){
|
|
|
626 |
return "amazon-item-table";
|
|
|
627 |
}
|
|
|
628 |
|
| 8168 |
kshitij.so |
629 |
return "id";
|
| 7283 |
kshitij.so |
630 |
}
|
|
|
631 |
|
|
|
632 |
public String editNew() {
|
|
|
633 |
return "editNew";
|
| 8168 |
kshitij.so |
634 |
}
|
| 7283 |
kshitij.so |
635 |
|
|
|
636 |
public void setId(String id) {
|
| 8168 |
kshitij.so |
637 |
logger.info(id);
|
| 7283 |
kshitij.so |
638 |
this.id = id;
|
|
|
639 |
}
|
|
|
640 |
|
|
|
641 |
public void setUrl(String url) {
|
|
|
642 |
this.url = url;
|
|
|
643 |
}
|
|
|
644 |
|
|
|
645 |
public String getUrl() {
|
|
|
646 |
return url;
|
|
|
647 |
}
|
|
|
648 |
|
|
|
649 |
public String getId() {
|
|
|
650 |
return id;
|
|
|
651 |
}
|
|
|
652 |
|
|
|
653 |
public void setItemId(String itemId) {
|
|
|
654 |
this.itemId = itemId;
|
|
|
655 |
}
|
|
|
656 |
|
|
|
657 |
public String getItemId() {
|
|
|
658 |
return itemId;
|
|
|
659 |
}
|
|
|
660 |
|
|
|
661 |
public void setIsFba(String isFba) {
|
|
|
662 |
this.isFba = isFba;
|
|
|
663 |
}
|
|
|
664 |
|
|
|
665 |
public String getIsFba() {
|
|
|
666 |
return isFba;
|
|
|
667 |
}
|
|
|
668 |
|
|
|
669 |
public void setIsNonFba(String isNonFba) {
|
|
|
670 |
this.isNonFba = isNonFba;
|
|
|
671 |
}
|
|
|
672 |
|
|
|
673 |
public String getIsNonFba() {
|
|
|
674 |
return isNonFba;
|
|
|
675 |
}
|
|
|
676 |
|
|
|
677 |
public void setIsInventoryOverride(String isInventoryOverride) {
|
|
|
678 |
this.isInventoryOverride = isInventoryOverride;
|
|
|
679 |
}
|
|
|
680 |
|
|
|
681 |
public String getIsInventoryOverride() {
|
|
|
682 |
return isInventoryOverride;
|
|
|
683 |
}
|
|
|
684 |
|
|
|
685 |
public void setSellingPrice(String sellingPrice) {
|
|
|
686 |
this.sellingPrice = sellingPrice;
|
|
|
687 |
}
|
|
|
688 |
|
|
|
689 |
public String getSellingPrice() {
|
|
|
690 |
return sellingPrice;
|
|
|
691 |
}
|
|
|
692 |
|
|
|
693 |
public void setFbaPrice(String fbaPrice) {
|
|
|
694 |
this.fbaPrice = fbaPrice;
|
|
|
695 |
}
|
|
|
696 |
|
|
|
697 |
public String getFbaPrice() {
|
|
|
698 |
return fbaPrice;
|
|
|
699 |
}
|
| 7365 |
kshitij.so |
700 |
|
| 7283 |
kshitij.so |
701 |
public void setSaholicPrice(String saholicPrice) {
|
|
|
702 |
this.saholicPrice = saholicPrice;
|
|
|
703 |
}
|
|
|
704 |
|
|
|
705 |
public String getSaholicPrice() {
|
|
|
706 |
return saholicPrice;
|
|
|
707 |
}
|
|
|
708 |
|
| 7365 |
kshitij.so |
709 |
public void setIsTime(String isTime){
|
| 8620 |
kshitij.so |
710 |
logger.info("set istime"+isTime);
|
| 7365 |
kshitij.so |
711 |
this.isTime = isTime;
|
|
|
712 |
}
|
|
|
713 |
|
| 7461 |
kshitij.so |
714 |
public String getIsTime(){
|
| 7365 |
kshitij.so |
715 |
return isTime;
|
|
|
716 |
}
|
|
|
717 |
|
|
|
718 |
public void setHandlingTime(String handlingTime){
|
|
|
719 |
this.handlingTime = handlingTime;
|
|
|
720 |
}
|
|
|
721 |
|
| 7461 |
kshitij.so |
722 |
public String getHandlingTime(){
|
| 7365 |
kshitij.so |
723 |
return handlingTime;
|
|
|
724 |
}
|
| 8168 |
kshitij.so |
725 |
|
| 7365 |
kshitij.so |
726 |
public void setCustomHandlingTime(String customHandlingTime){
|
| 8620 |
kshitij.so |
727 |
logger.info("set custom handling time"+customHandlingTime);
|
| 7365 |
kshitij.so |
728 |
this.customHandlingTime = customHandlingTime;
|
|
|
729 |
}
|
|
|
730 |
|
| 7461 |
kshitij.so |
731 |
public String getCustomHandlingTime(){
|
| 7365 |
kshitij.so |
732 |
return customHandlingTime;
|
|
|
733 |
}
|
| 7524 |
kshitij.so |
734 |
|
| 7461 |
kshitij.so |
735 |
public void setHoldInventory(String holdInventory){
|
|
|
736 |
this.holdInventory = holdInventory;
|
|
|
737 |
}
|
| 7365 |
kshitij.so |
738 |
|
| 7461 |
kshitij.so |
739 |
public String getHoldInventory(){
|
|
|
740 |
return holdInventory;
|
|
|
741 |
}
|
| 7524 |
kshitij.so |
742 |
|
| 7461 |
kshitij.so |
743 |
public void setDefaultInventory(String defaultInventory){
|
|
|
744 |
this.defaultInventory = defaultInventory;
|
|
|
745 |
}
|
|
|
746 |
|
|
|
747 |
public String getDefaultInventory(){
|
|
|
748 |
return defaultInventory;
|
|
|
749 |
}
|
|
|
750 |
|
| 7524 |
kshitij.so |
751 |
public File getFile() {
|
|
|
752 |
return file;
|
|
|
753 |
}
|
|
|
754 |
|
|
|
755 |
public void setFile(File file) {
|
|
|
756 |
this.file = file;
|
|
|
757 |
}
|
|
|
758 |
|
|
|
759 |
public String getFileUploadContentType() {
|
|
|
760 |
return fileUploadContentType;
|
|
|
761 |
}
|
|
|
762 |
|
|
|
763 |
public void setFileUploadContentType(String fileUploadContentType) {
|
|
|
764 |
this.fileUploadContentType = fileUploadContentType;
|
|
|
765 |
}
|
|
|
766 |
|
|
|
767 |
public String getFileUploadFileName() {
|
|
|
768 |
return fileUploadFileName;
|
|
|
769 |
}
|
|
|
770 |
|
|
|
771 |
public void setFileUploadFileName(String fileUploadFileName) {
|
|
|
772 |
this.fileUploadFileName = fileUploadFileName;
|
|
|
773 |
}
|
|
|
774 |
|
| 7591 |
kshitij.so |
775 |
public void setServletRequest(HttpServletRequest req) {
|
|
|
776 |
this.request = req;
|
|
|
777 |
this.session = req.getSession();
|
| 7283 |
kshitij.so |
778 |
}
|
|
|
779 |
|
| 8168 |
kshitij.so |
780 |
@Override
|
|
|
781 |
public void setServletContext(ServletContext arg0) {
|
|
|
782 |
// TODO Auto-generated method stub
|
|
|
783 |
|
|
|
784 |
}
|
|
|
785 |
|
|
|
786 |
|
|
|
787 |
public void setSuppressMfnPriceUpdate(String suppressMfnPriceUpdate) {
|
|
|
788 |
this.suppressMfnPriceUpdate = suppressMfnPriceUpdate;
|
|
|
789 |
}
|
|
|
790 |
|
|
|
791 |
public String getSuppressMfnPriceUpdate() {
|
|
|
792 |
return suppressMfnPriceUpdate;
|
|
|
793 |
}
|
|
|
794 |
|
|
|
795 |
public void setSuppressFbaPriceUpdate(String suppressFbaPriceUpdate) {
|
|
|
796 |
this.suppressFbaPriceUpdate = suppressFbaPriceUpdate;
|
|
|
797 |
}
|
|
|
798 |
|
|
|
799 |
public String getSuppressFbaPriceUpdate() {
|
|
|
800 |
return suppressFbaPriceUpdate;
|
|
|
801 |
}
|
| 8362 |
kshitij.so |
802 |
|
|
|
803 |
public void setErrMsg(String errMsg) {
|
|
|
804 |
this.errMsg = errMsg;
|
|
|
805 |
}
|
|
|
806 |
|
|
|
807 |
public String getErrMsg() {
|
|
|
808 |
return errMsg;
|
|
|
809 |
}
|
| 8620 |
kshitij.so |
810 |
|
| 8362 |
kshitij.so |
811 |
public void setServletResponse(HttpServletResponse response) {
|
|
|
812 |
this.response = response;
|
|
|
813 |
}
|
|
|
814 |
|
| 8620 |
kshitij.so |
815 |
public void setNext(String next) {
|
|
|
816 |
logger.info("next is"+next);
|
|
|
817 |
this.next = next;
|
|
|
818 |
}
|
|
|
819 |
|
|
|
820 |
public String getNext() {
|
|
|
821 |
return next;
|
|
|
822 |
}
|
|
|
823 |
|
|
|
824 |
public void setAmazonItems(List<Amazonlisted> amazonItems) {
|
|
|
825 |
this.amazonItems = amazonItems;
|
|
|
826 |
}
|
|
|
827 |
|
|
|
828 |
public List<Amazonlisted> getAmazonItems() {
|
|
|
829 |
return amazonItems;
|
|
|
830 |
}
|
|
|
831 |
|
|
|
832 |
public void setSearchText(String searchText) {
|
|
|
833 |
this.searchText = searchText;
|
|
|
834 |
}
|
|
|
835 |
|
|
|
836 |
public String getSearchText() {
|
|
|
837 |
return searchText;
|
|
|
838 |
}
|
|
|
839 |
|
|
|
840 |
public long getSearchCount() {
|
|
|
841 |
return searchCount;
|
|
|
842 |
}
|
|
|
843 |
|
|
|
844 |
public long getTotalCount() {
|
|
|
845 |
return totalCount;
|
|
|
846 |
}
|
|
|
847 |
|
|
|
848 |
public void setSearchCount(long count) {
|
|
|
849 |
this.searchCount = count;
|
|
|
850 |
}
|
|
|
851 |
|
|
|
852 |
public void setTaxCode(String taxCode) {
|
|
|
853 |
this.taxCode = taxCode;
|
|
|
854 |
}
|
|
|
855 |
|
|
|
856 |
public String getTaxCode() {
|
|
|
857 |
return taxCode;
|
|
|
858 |
}
|
|
|
859 |
|
| 7283 |
kshitij.so |
860 |
}
|