Subversion Repositories SmartDukaan

Rev

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

Rev 19004 Rev 19006
Line 1... Line 1...
1
package in.shop2020.hotspot.dashbaord.shared.actions;
1
package in.shop2020.hotspot.dashbaord.shared.actions;
2
 
2
 
3
import in.shop2020.hotspot.dashbaord.server.TransactionUtils;
3
import in.shop2020.hotspot.dashbaord.server.TransactionUtils;
4
 
4
 
5
import java.text.ParseException;
-
 
6
import java.text.SimpleDateFormat;
-
 
7
import java.util.Date;
5
import java.util.Date;
8
import java.util.List;
-
 
9
import java.util.Map;
6
import java.util.Map;
10
 
7
 
-
 
8
import com.google.gwt.i18n.client.DateTimeFormat;
11
import com.google.gwt.user.client.rpc.IsSerializable;
9
import com.google.gwt.user.client.rpc.IsSerializable;
12
 
10
 
13
public class Order implements IsSerializable{
11
public class Order implements IsSerializable{
14
	
12
	
15
	private static final long serialVersionUID = 5804421607858217477L;
13
	private static final long serialVersionUID = 5804421607858217477L;
Line 162... Line 160...
162
	}
160
	}
163
 
161
 
164
	private void checkForAlerts(){
162
	private void checkForAlerts(){
165
	    this.alert = OrderAlert.NONE;
163
	    this.alert = OrderAlert.NONE;
166
	    Date date = new Date(System.currentTimeMillis());
164
	    Date date = new Date(System.currentTimeMillis());
167
	    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
165
	    DateTimeFormat sdf = DateTimeFormat.getFormat("yyyy-MM-dd");
168
	    long currentTime = date.getTime();
166
	    long currentTime = date.getTime();
169
	    long currentDateTime = 0;
167
	    long currentDateTime = 0;
170
	    long expectedDateShippingTime =0 ;
168
	    long expectedDateShippingTime =0 ;
171
	    try {
-
 
172
	    	currentDateTime = sdf.parse(sdf.format(date)).getTime();
169
	    currentDateTime = sdf.parse(sdf.format(date)).getTime();
173
			expectedDateShippingTime = sdf.parse(sdf.format(new Date(this.expectedShippingTime))).getTime();
170
		expectedDateShippingTime = sdf.parse(sdf.format(new Date(this.expectedShippingTime))).getTime();
174
		} catch (ParseException e) {
-
 
175
			e.printStackTrace();
-
 
176
		}
171
		
177
	    if(this.expectedDeliveryTime <= currentTime && this.status < 12){
172
	    if(this.expectedDeliveryTime <= currentTime && this.status < 12){
178
	        //Orders whose delivery dates have passed but which are not yet delivered
173
	        //Orders whose delivery dates have passed but which are not yet delivered
179
	        this.alert = OrderAlert.DELIVERY_TIME_EXCEEDED;
174
	        this.alert = OrderAlert.DELIVERY_TIME_EXCEEDED;
180
	        return;
175
	        return;
181
	    }
176
	    }