Subversion Repositories SmartDukaan

Rev

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

Rev 8362 Rev 8396
Line 201... Line 201...
201
			holdInventory = "0";
201
			holdInventory = "0";
202
		}
202
		}
203
		if (StringUtils.isEmpty(defaultInventory)) {
203
		if (StringUtils.isEmpty(defaultInventory)) {
204
			defaultInventory = "0";
204
			defaultInventory = "0";
205
		}
205
		}
206
 
-
 
207
		CatalogClient.updateItemInventory(Long.valueOf(itemId),Long.valueOf(holdInventory),Long.valueOf(defaultInventory));
206
		CatalogClient.updateItemInventory(Long.valueOf(itemId),Long.valueOf(holdInventory),Long.valueOf(defaultInventory));
208
	}
207
	}
209
 
208
 
210
 
209
 
211
	public Map<Long, Long> getAvailableItemInventory(String itemId) throws NumberFormatException, InventoryServiceException, TException{
210
	public Map<Long, Long> getAvailableItemInventory(String itemId) throws NumberFormatException, InventoryServiceException, TException{
Line 278... Line 277...
278
		if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0])) {
277
		if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0])) {
279
			logger.info(request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0]);
278
			logger.info(request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0]);
280
			return "authfail";
279
			return "authfail";
281
		}
280
		}
282
		ProcessBuilder testProcess = new ProcessBuilder("/bin/bash");
281
		ProcessBuilder testProcess = new ProcessBuilder("/bin/bash");
283
		String[] command = {"/bin/bash", "-c", "sudo /root/code/trunk/AmazonFeeds/Test.sh"};
282
		String[] command = {"/bin/bash", "-c", "sudo /root/code/trunk/AmazonFeeds/RunAsinJob.sh"};
284
		testProcess.command(command);
283
		testProcess.command(command);
285
		logger.info(testProcess.command().toString());
284
		logger.info(testProcess.command().toString());
286
		Process process = testProcess.start();
285
		Process process = testProcess.start();
287
		process.waitFor();
286
		process.waitFor();
288
		logger.info(String.valueOf(process.exitValue()));
287
		logger.info(String.valueOf(process.exitValue()));
289
		return "asinjob";
288
		return "asinjob";
290
 
289
 
291
	}
290
	}
-
 
291
	
-
 
292
	public String runFbaListingJob() throws IOException, InterruptedException {
-
 
293
		if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0])) {
-
 
294
			logger.info(request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0]);
-
 
295
			return "authfail";
-
 
296
		}
-
 
297
		ProcessBuilder testProcess = new ProcessBuilder("/bin/bash");
-
 
298
		String[] command = {"/bin/bash", "-c", "sudo /root/code/trunk/AmazonFeeds/RunFbaListingJob.sh"};
-
 
299
		testProcess.command(command);
-
 
300
		logger.info(testProcess.command().toString());
-
 
301
		Process process = testProcess.start();
-
 
302
		process.waitFor();
-
 
303
		logger.info(String.valueOf(process.exitValue()));
-
 
304
		return "asinjob";
-
 
305
	}
-
 
306
	
-
 
307
	public String runNonFbaListingJob() throws IOException, InterruptedException {
-
 
308
		if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0])) {
-
 
309
			logger.info(request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0]);
-
 
310
			return "authfail";
-
 
311
		}
-
 
312
		ProcessBuilder testProcess = new ProcessBuilder("/bin/bash");
-
 
313
		String[] command = {"/bin/bash", "-c", "sudo /root/code/trunk/AmazonFeeds/RunNonFbaListingJob.sh"};
-
 
314
		testProcess.command(command);
-
 
315
		logger.info(testProcess.command().toString());
-
 
316
		Process process = testProcess.start();
-
 
317
		process.waitFor();
-
 
318
		logger.info(String.valueOf(process.exitValue()));
-
 
319
		return "asinjob";
-
 
320
	}
292
 
321
 
293
	public void uploadBulkFile() throws IOException, TException{
322
	public void uploadBulkFile() throws IOException, TException{
294
		File fileToCreate = new File("/tmp/", "Amazon-bulk-upload.xls");
323
		File fileToCreate = new File("/tmp/", "Amazon-bulk-upload.xls");
295
		FileUtils.copyFile(this.file, fileToCreate);
324
		FileUtils.copyFile(this.file, fileToCreate);
296
		FileInputStream iFile = new FileInputStream(new File(file.getAbsolutePath()));
325
		FileInputStream iFile = new FileInputStream(new File(file.getAbsolutePath()));