Subversion Repositories SmartDukaan

Rev

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

Rev 10097 Rev 10922
Line 96... Line 96...
96
	private List<Amazonlisted> amazonItems;
96
	private List<Amazonlisted> amazonItems;
97
	private String searchText;
97
	private String searchText;
98
	private long searchCount;
98
	private long searchCount;
99
	private long totalCount;
99
	private long totalCount;
100
	private String taxCode;
100
	private String taxCode;
-
 
101
	private String fbbTaxCode;
-
 
102
	private String isFbb;
-
 
103
	private String fbbPrice;
-
 
104
	private String suppressFbbPriceUpdate;
101
 
105
 
102
	public String index() {
106
	public String index() {
103
		if (!ReportsUtils.canAccessReport((Long) session.getAttribute(ReportsUtils.ROLE),request.getServletPath())) {
107
		if (!ReportsUtils.canAccessReport((Long) session.getAttribute(ReportsUtils.ROLE),request.getServletPath())) {
104
			return "authfail";
108
			return "authfail";
105
		}
109
		}
Line 183... Line 187...
183
 
187
 
184
		if(!StringUtils.equals(amazonlisted.getTaxCode(), taxCode)){
188
		if(!StringUtils.equals(amazonlisted.getTaxCode(), taxCode)){
185
			amazonlisted.setTaxCode(taxCode);
189
			amazonlisted.setTaxCode(taxCode);
186
			commit=true;
190
			commit=true;
187
		}
191
		}
-
 
192
		
-
 
193
		if(!StringUtils.equals(amazonlisted.getFbbtaxCode(), fbbTaxCode)){
-
 
194
            amazonlisted.setFbbtaxCode(fbbTaxCode);
-
 
195
            commit=true;
-
 
196
        }
-
 
197
		
-
 
198
		if(amazonlisted.isSuppressFbbPriceUpdate()!=Boolean.valueOf(suppressFbbPriceUpdate)){
-
 
199
            amazonlisted.setSuppressFbbPriceUpdate(Boolean.valueOf(suppressFbbPriceUpdate));
-
 
200
            commit=true;
-
 
201
        }
-
 
202
		
-
 
203
		if (amazonlisted.getFbbPrice()!=Double.valueOf(fbbPrice)){
-
 
204
            amazonlisted.setFbbPrice(Double.valueOf(fbbPrice));
-
 
205
            commit=true;
-
 
206
        }
-
 
207
		if (amazonlisted.isIsFbb()!=Boolean.valueOf(isFbb)){
-
 
208
            amazonlisted.setIsFbb(Boolean.valueOf(isFbb));
-
 
209
            commit=true;
-
 
210
        }
188
 
211
 
189
		if(commit){
212
		if(commit){
190
			CatalogClient.updateAmazonItemDetails(amazonlisted);
213
			CatalogClient.updateAmazonItemDetails(amazonlisted);
191
		}
214
		}
192
		else{
215
		else{
Line 477... Line 500...
477
 
500
 
478
			if (!checkEmptyString(sheet.getRow(iterator).getCell(2))){
501
			if (!checkEmptyString(sheet.getRow(iterator).getCell(2))){
479
				double fbaSellingPrice = sheet.getRow(iterator).getCell(2).getNumericCellValue();
502
				double fbaSellingPrice = sheet.getRow(iterator).getCell(2).getNumericCellValue();
480
				amazonlisted.setFbaPrice(fbaSellingPrice);
503
				amazonlisted.setFbaPrice(fbaSellingPrice);
481
			}
504
			}
482
 
505
			
483
			if (!checkEmptyString(sheet.getRow(iterator).getCell(3))){
506
			if (!checkEmptyString(sheet.getRow(iterator).getCell(3))){
-
 
507
                double fbbSellingPrice = sheet.getRow(iterator).getCell(3).getNumericCellValue();
-
 
508
                amazonlisted.setFbbPrice(fbbSellingPrice);
-
 
509
            }
-
 
510
 
-
 
511
			if (!checkEmptyString(sheet.getRow(iterator).getCell(4))){
484
				if ((long)sheet.getRow(iterator).getCell(3).getNumericCellValue()==1){
512
				if ((long)sheet.getRow(iterator).getCell(4).getNumericCellValue()==1){
485
					amazonlisted.setIsNonFba(true);
513
					amazonlisted.setIsNonFba(true);
486
				}
514
				}
487
				if ((long)sheet.getRow(iterator).getCell(3).getNumericCellValue()==0){
515
				if ((long)sheet.getRow(iterator).getCell(4).getNumericCellValue()==0){
488
					amazonlisted.setIsNonFba(false);
516
					amazonlisted.setIsNonFba(false);
489
				}
517
				}
490
			}
518
			}
491
 
519
 
492
			if (!checkEmptyString(sheet.getRow(iterator).getCell(4))){
520
			if (!checkEmptyString(sheet.getRow(iterator).getCell(5))){
493
				if ((long)sheet.getRow(iterator).getCell(4).getNumericCellValue()==1){
521
				if ((long)sheet.getRow(iterator).getCell(5).getNumericCellValue()==1){
494
					amazonlisted.setIsFba(true);
522
					amazonlisted.setIsFba(true);
495
				}
523
				}
496
				if ((long)sheet.getRow(iterator).getCell(4).getNumericCellValue()==0){
524
				if ((long)sheet.getRow(iterator).getCell(5).getNumericCellValue()==0){
497
					amazonlisted.setIsFba(false);
525
					amazonlisted.setIsFba(false);
498
				}
526
				}
499
			}
527
			}
-
 
528
			
500
			if (!checkEmptyString(sheet.getRow(iterator).getCell(5))){
529
			if (!checkEmptyString(sheet.getRow(iterator).getCell(6))){
-
 
530
                if ((long)sheet.getRow(iterator).getCell(6).getNumericCellValue()==1){
-
 
531
                    amazonlisted.setIsFbb(true);
-
 
532
                }
-
 
533
                if ((long)sheet.getRow(iterator).getCell(6).getNumericCellValue()==0){
-
 
534
                    amazonlisted.setIsFbb(false);
-
 
535
                }
-
 
536
            }
-
 
537
			
-
 
538
			if (!checkEmptyString(sheet.getRow(iterator).getCell(7))){
501
				if ((long)sheet.getRow(iterator).getCell(5).getNumericCellValue()==1){
539
				if ((long)sheet.getRow(iterator).getCell(7).getNumericCellValue()==1){
502
					amazonlisted.setIsInventoryOverride(true);
540
					amazonlisted.setIsInventoryOverride(true);
503
				}
541
				}
504
				if ((long)sheet.getRow(iterator).getCell(5).getNumericCellValue()==0){
542
				if ((long)sheet.getRow(iterator).getCell(7).getNumericCellValue()==0){
505
					amazonlisted.setIsInventoryOverride(false);
543
					amazonlisted.setIsInventoryOverride(false);
506
				}
544
				}
507
			}
545
			}
508
			if (!checkEmptyString(sheet.getRow(iterator).getCell(6))){
546
			if (!checkEmptyString(sheet.getRow(iterator).getCell(8))){
509
				if ((long)sheet.getRow(iterator).getCell(6).getNumericCellValue()==1){
547
				if ((long)sheet.getRow(iterator).getCell(8).getNumericCellValue()==1){
510
					amazonlisted.setSuppressMfnPriceUpdate(true);
548
					amazonlisted.setSuppressMfnPriceUpdate(true);
511
				}
549
				}
512
				if ((long)sheet.getRow(iterator).getCell(6).getNumericCellValue()==0){
550
				if ((long)sheet.getRow(iterator).getCell(8).getNumericCellValue()==0){
513
					amazonlisted.setSuppressMfnPriceUpdate(false);
551
					amazonlisted.setSuppressMfnPriceUpdate(false);
514
				}
552
				}
515
			}
553
			}
516
 
554
 
517
			if (!checkEmptyString(sheet.getRow(iterator).getCell(7))){
555
			if (!checkEmptyString(sheet.getRow(iterator).getCell(9))){
518
				if ((long)sheet.getRow(iterator).getCell(7).getNumericCellValue()==1){
556
				if ((long)sheet.getRow(iterator).getCell(9).getNumericCellValue()==1){
519
					amazonlisted.setSuppressFbaPriceUpdate(true);
557
					amazonlisted.setSuppressFbaPriceUpdate(true);
520
				}
558
				}
521
				if ((long)sheet.getRow(iterator).getCell(7).getNumericCellValue()==0){
559
				if ((long)sheet.getRow(iterator).getCell(9).getNumericCellValue()==0){
522
					amazonlisted.setSuppressFbaPriceUpdate(false);
560
					amazonlisted.setSuppressFbaPriceUpdate(false);
523
				}
561
				}
524
			}
562
			}
-
 
563
			
-
 
564
			if (!checkEmptyString(sheet.getRow(iterator).getCell(10))){
-
 
565
                if ((long)sheet.getRow(iterator).getCell(10).getNumericCellValue()==1){
-
 
566
                    amazonlisted.setSuppressFbbPriceUpdate(true);
-
 
567
                }
-
 
568
                if ((long)sheet.getRow(iterator).getCell(10).getNumericCellValue()==0){
-
 
569
                    amazonlisted.setSuppressFbbPriceUpdate(false);
-
 
570
                }
-
 
571
            }
525
 
572
 
526
			if (!checkEmptyString(sheet.getRow(iterator).getCell(8))){
573
			if (!checkEmptyString(sheet.getRow(iterator).getCell(11))){
527
				String taxCode = sheet.getRow(iterator).getCell(8).getStringCellValue();
574
				String taxCode = sheet.getRow(iterator).getCell(11).getStringCellValue();
528
				amazonlisted.setTaxCode(taxCode);
575
				amazonlisted.setTaxCode(taxCode);
529
			}
576
			}
-
 
577
			
-
 
578
			if (!checkEmptyString(sheet.getRow(iterator).getCell(12))){
-
 
579
                String fbbTaxCode = sheet.getRow(iterator).getCell(12).getStringCellValue();
-
 
580
                amazonlisted.setFbbtaxCode(fbbTaxCode);
-
 
581
            }
-
 
582
			
530
			amazonBulkUpdate.put(sku, amazonlisted);
583
			amazonBulkUpdate.put(sku, amazonlisted);
531
		}
584
		}
532
		logger.info("Amazon Bulk Map "+amazonBulkUpdate.toString());
585
		logger.info("Amazon Bulk Map "+amazonBulkUpdate.toString());
533
		CatalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
586
		CatalogClient = new CatalogClient("catalog_service_server_host_amazon","catalog_service_server_port").getClient();
534
		boolean result = CatalogClient.updateAmazonAttributesInBulk(amazonBulkUpdate);
587
		boolean result = CatalogClient.updateAmazonAttributesInBulk(amazonBulkUpdate);
Line 855... Line 908...
855
 
908
 
856
	public String getTaxCode() {
909
	public String getTaxCode() {
857
		return taxCode;
910
		return taxCode;
858
	}
911
	}
859
 
912
 
-
 
913
    public void setFbbTaxCode(String fbbTaxCode) {
-
 
914
        this.fbbTaxCode = fbbTaxCode;
-
 
915
    }
-
 
916
 
-
 
917
    public String get() {
-
 
918
        return fbbTaxCode;
-
 
919
    }
-
 
920
 
-
 
921
    public void setIsFbb(String isFbb) {
-
 
922
        this.isFbb = isFbb;
-
 
923
    }
-
 
924
 
-
 
925
    public String getIsFbb() {
-
 
926
        return isFbb;
-
 
927
    }
-
 
928
 
-
 
929
    public void setFbbPrice(String fbbPrice) {
-
 
930
        this.fbbPrice = fbbPrice;
-
 
931
    }
-
 
932
 
-
 
933
    public String getFbbPrice() {
-
 
934
        return fbbPrice;
-
 
935
    }
-
 
936
 
-
 
937
    public void setSuppressFbbPriceUpdate(String suppressFbbPriceUpdate) {
-
 
938
        this.suppressFbbPriceUpdate = suppressFbbPriceUpdate;
-
 
939
    }
-
 
940
 
-
 
941
    public String getSuppressFbbPriceUpdate() {
-
 
942
        return suppressFbbPriceUpdate;
-
 
943
    }
-
 
944
 
860
}
945
}