Subversion Repositories SmartDukaan

Rev

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

Rev 17198 Rev 18341
Line 94... Line 94...
94
    private String            customerName;
94
    private String            customerName;
95
    private String            customerMobileNumber;
95
    private String            customerMobileNumber;
96
    private User              user;
96
    private User              user;
97
    private String            orderStatus;
97
    private String            orderStatus;
98
    private List<Order>       orders;
98
    private List<Order>       orders;
-
 
99
    private Map<Long, Order>       transactions;
-
 
100
	private Map<Long, Double>    transactionShipping;
-
 
101
    private Map<Long, Double>    transactionTotal;
99
    private List<Payment>     payments;
102
    private List<Payment>     payments;
100
    private String            escalate;
103
    private String            escalate;
101
    private String            cancelReason;
104
    private String            cancelReason;
102
    private String            transactionId;
105
    private String            transactionId;
103
    private String            pickupExtension;
106
    private String            pickupExtension;
Line 174... Line 177...
174
            }
177
            }
175
 
178
 
176
            if (TicketCategory.COD_VERIFICATION.equals(ticket.getCategory())) {
179
            if (TicketCategory.COD_VERIFICATION.equals(ticket.getCategory())) {
177
                log.info("Fetching orders for " + ticket.getCustomerId());
180
                log.info("Fetching orders for " + ticket.getCustomerId());
178
                orders = new ArrayList<Order>();
181
                orders = new ArrayList<Order>();
-
 
182
                transactions = new HashMap<Long, Order>();
179
                transactionServiceClient = new TransactionClient().getClient();
183
                transactionServiceClient = new TransactionClient().getClient();
180
                for (Order order : transactionServiceClient
184
                for (Order order : transactionServiceClient
181
                        .getOrdersForCustomer(ticket.getCustomerId(), 0, 0,
185
                        .getOrdersForCustomer(ticket.getCustomerId(), 0, 0,
182
                                Collections.singletonList(OrderStatus.COD_VERIFICATION_PENDING))) {
186
                                Collections.singletonList(OrderStatus.COD_VERIFICATION_PENDING))) {
183
                    log.info("Processing Order: " + order);
187
                    log.info("Processing Order: " + order);
184
                    if (order.isCod()) {
188
                    if (order.isCod()) {
-
 
189
                    	transactions.put(order.getTransactionId(), order);
-
 
190
                    	if (transactionShipping.get(order.getTransactionId()) == null){
-
 
191
                    		transactionShipping.put(order.getTransactionId(), order.getShippingCost());
-
 
192
                    	} else {
-
 
193
                    		transactionShipping.put(order.getTransactionId(), transactionShipping.get(order.getTransactionId()) + order.getShippingCost());
-
 
194
                    	}
-
 
195
                    	if (transactionTotal.get(order.getTransactionId()) == null){
-
 
196
                    		transactionTotal.put(order.getTransactionId(), order.getTotal_amount()-order.getGvAmount());
-
 
197
                    	} else {
-
 
198
                    		transactionTotal.put(order.getTransactionId(), transactionTotal.get(order.getTransactionId()) + order.getTotal_amount()-order.getGvAmount());
-
 
199
                    	}
-
 
200
                    	transactions.put(order.getTransactionId(), order);
185
                        orders.add(order);
201
                        orders.add(order);
186
                    }
202
                    }
187
                }
203
                }
-
 
204
                
188
            }
205
            }
189
 
206
 
190
            if (TicketCategory.DOA_RECEIVED.equals(ticket.getCategory())) {
207
            if (TicketCategory.DOA_RECEIVED.equals(ticket.getCategory())) {
191
                log.info("Fetching orders for " + ticket.getCustomerId());
208
                log.info("Fetching orders for " + ticket.getCustomerId());
192
                orders = new ArrayList<Order>();
209
                orders = new ArrayList<Order>();
Line 1696... Line 1713...
1696
    }
1713
    }
1697
 
1714
 
1698
    public void setClosureType(String closureType) {
1715
    public void setClosureType(String closureType) {
1699
        this.closureType = closureType;
1716
        this.closureType = closureType;
1700
    }
1717
    }
-
 
1718
    
-
 
1719
    public Map<Long, Order> getTransactions() {
-
 
1720
		return transactions;
-
 
1721
	}
-
 
1722
 
-
 
1723
	public void setTransactions(Map<Long, Order> transactions) {
-
 
1724
		this.transactions = transactions;
-
 
1725
	}
-
 
1726
 
-
 
1727
	public Map<Long, Double> getTransactionShipping() {
-
 
1728
		return transactionShipping;
-
 
1729
	}
-
 
1730
 
-
 
1731
	public void setTransactionShipping(Map<Long, Double> transactionShipping) {
-
 
1732
		this.transactionShipping = transactionShipping;
-
 
1733
	}
-
 
1734
 
-
 
1735
	public Map<Long, Double> getTransactionTotal() {
-
 
1736
		return transactionTotal;
-
 
1737
	}
-
 
1738
 
-
 
1739
	public void setTransactionTotal(Map<Long, Double> transactionTotal) {
-
 
1740
		this.transactionTotal = transactionTotal;
-
 
1741
	}
1701
}
1742
}