Subversion Repositories SmartDukaan

Rev

Rev 15462 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15462 Rev 15703
Line 136... Line 136...
136
    private String isFbg;
136
    private String isFbg;
137
    private String fbgPrice;
137
    private String fbgPrice;
138
    private String suppressFbgPriceUpdate;
138
    private String suppressFbgPriceUpdate;
139
    private String fbgPromoPrice;
139
    private String fbgPromoPrice;
140
    private String isFbgPromotionActive;
140
    private String isFbgPromotionActive;
-
 
141
    private String fbdTaxCode;
-
 
142
    private String isFbd;
-
 
143
    private String fbdPrice;
-
 
144
    private String suppressFbdPriceUpdate;
-
 
145
    private String fbdPromoPrice;
-
 
146
    private String isFbdPromotionActive;
141
 
147
 
142
    public String getOtherCost() {
148
    public String getOtherCost() {
143
        return otherCost;
149
        return otherCost;
144
    }
150
    }
145
 
151
 
Line 337... Line 343...
337
 
343
 
338
        if (amazonlisted.isIsFbg()!=Boolean.valueOf(isFbg)){
344
        if (amazonlisted.isIsFbg()!=Boolean.valueOf(isFbg)){
339
            amazonlisted.setIsFbg(Boolean.valueOf(isFbg));
345
            amazonlisted.setIsFbg(Boolean.valueOf(isFbg));
340
            commit=true;
346
            commit=true;
341
        }
347
        }
-
 
348
        
-
 
349
        if(!StringUtils.equals(amazonlisted.getFbdtaxCode(), fbdTaxCode)){
-
 
350
            amazonlisted.setFbdtaxCode(fbdTaxCode);
-
 
351
            commit=true;
-
 
352
        }
-
 
353
 
-
 
354
        if(amazonlisted.isSuppressFbdPriceUpdate()!=Boolean.valueOf(suppressFbdPriceUpdate)){
-
 
355
            amazonlisted.setSuppressFbdPriceUpdate(Boolean.valueOf(suppressFbdPriceUpdate));
-
 
356
            commit=true;
-
 
357
        }
-
 
358
 
-
 
359
        if (amazonlisted.getFbdPrice()!=Double.valueOf(fbdPrice)){
-
 
360
            amazonlisted.setFbdPrice(Double.valueOf(fbdPrice));
-
 
361
            commit=true;
-
 
362
        }
-
 
363
 
-
 
364
        if (amazonlisted.isIsFbd()!=Boolean.valueOf(isFbd)){
-
 
365
            amazonlisted.setIsFbd(Boolean.valueOf(isFbd));
-
 
366
            commit=true;
-
 
367
        }
-
 
368
 
342
 
369
 
343
        if(commit){
370
        if(commit){
344
            CatalogClient.updateAmazonItemDetails(amazonlisted);
371
            CatalogClient.updateAmazonItemDetails(amazonlisted);
345
        }
372
        }
346
        else{
373
        else{
Line 365... Line 392...
365
        }
392
        }
366
 
393
 
367
        if(Boolean.valueOf(isFbgPromotionActive)){
394
        if(Boolean.valueOf(isFbgPromotionActive)){
368
            amazonlisted.setFbgPromoPrice(Double.valueOf(fbgPromoPrice));
395
            amazonlisted.setFbgPromoPrice(Double.valueOf(fbgPromoPrice));
369
        }
396
        }
-
 
397
        
-
 
398
        if(Boolean.valueOf(isFbdPromotionActive)){
-
 
399
            amazonlisted.setFbdPromoPrice(Double.valueOf(fbdPromoPrice));
-
 
400
        }
370
 
401
 
371
        catalogClient.updateAmazonItemDetails(amazonlisted);
402
        catalogClient.updateAmazonItemDetails(amazonlisted);
372
        return "index";
403
        return "index";
373
    }
404
    }
374
 
405
 
Line 616... Line 647...
616
        Process process = testProcess.start();
647
        Process process = testProcess.start();
617
        process.waitFor();
648
        process.waitFor();
618
        logger.info(String.valueOf(process.exitValue()));
649
        logger.info(String.valueOf(process.exitValue()));
619
        return "asinjob";
650
        return "asinjob";
620
    }
651
    }
-
 
652
    
-
 
653
    public String runFbdListingJob() throws IOException, InterruptedException {
-
 
654
        if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0])) {
-
 
655
            logger.info(request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0]);
-
 
656
            return "authfail";
-
 
657
        }
-
 
658
        ProcessBuilder testProcess = new ProcessBuilder("/bin/bash");
-
 
659
        String[] command = {"/bin/bash", "-c", "sudo /root/code/trunk/AmazonFeeds/RunFbdListingJob.sh"};
-
 
660
        testProcess.command(command);
-
 
661
        logger.info(testProcess.command().toString());
-
 
662
        Process process = testProcess.start();
-
 
663
        process.waitFor();
-
 
664
        logger.info(String.valueOf(process.exitValue()));
-
 
665
        return "asinjob";
-
 
666
    }
-
 
667
 
621
 
668
 
622
 
669
 
623
    public String runFbaListingJob() throws IOException, InterruptedException {
670
    public String runFbaListingJob() throws IOException, InterruptedException {
624
        if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0])) {
671
        if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0])) {
625
            logger.info(request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0]);
672
            logger.info(request.getRequestURI().substring(request.getContextPath().length()).split("/")[1].split("!")[0]);
Line 1408... Line 1455...
1408
 
1455
 
1409
    public String getIsFbgPromotionActive() {
1456
    public String getIsFbgPromotionActive() {
1410
        return isFbgPromotionActive;
1457
        return isFbgPromotionActive;
1411
    }
1458
    }
1412
 
1459
 
-
 
1460
	public void setFbdTaxCode(String fbdTaxCode) {
-
 
1461
		this.fbdTaxCode = fbdTaxCode;
-
 
1462
	}
-
 
1463
 
-
 
1464
	public String getFbdTaxCode() {
-
 
1465
		return fbdTaxCode;
-
 
1466
	}
-
 
1467
 
-
 
1468
	public void setIsFbd(String isFbd) {
-
 
1469
		this.isFbd = isFbd;
-
 
1470
	}
-
 
1471
 
-
 
1472
	public String getIsFbd() {
-
 
1473
		return isFbd;
-
 
1474
	}
-
 
1475
 
-
 
1476
	public void setFbdPrice(String fbdPrice) {
-
 
1477
		this.fbdPrice = fbdPrice;
-
 
1478
	}
-
 
1479
 
-
 
1480
	public String getFbdPrice() {
-
 
1481
		return fbdPrice;
-
 
1482
	}
-
 
1483
 
-
 
1484
	public void setSuppressFbdPriceUpdate(String suppressFbdPriceUpdate) {
-
 
1485
		this.suppressFbdPriceUpdate = suppressFbdPriceUpdate;
-
 
1486
	}
-
 
1487
 
-
 
1488
	public String getSuppressFbdPriceUpdate() {
-
 
1489
		return suppressFbdPriceUpdate;
-
 
1490
	}
-
 
1491
 
-
 
1492
	public void setFbdPromoPrice(String fbdPromoPrice) {
-
 
1493
		this.fbdPromoPrice = fbdPromoPrice;
-
 
1494
	}
-
 
1495
 
-
 
1496
	public String getFbdPromoPrice() {
-
 
1497
		return fbdPromoPrice;
-
 
1498
	}
-
 
1499
 
-
 
1500
	public void setIsFbdPromotionActive(String isFbdPromotionActive) {
-
 
1501
		this.isFbdPromotionActive = isFbdPromotionActive;
-
 
1502
	}
-
 
1503
 
-
 
1504
	public String getIsFbdPromotionActive() {
-
 
1505
		return isFbdPromotionActive;
-
 
1506
	}
-
 
1507
 
1413
}
1508
}