Subversion Repositories SmartDukaan

Rev

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

Rev 19032 Rev 19034
Line 49... Line 49...
49
 * 
49
 * 
50
 */
50
 */
51
public class TransactionUtils {
51
public class TransactionUtils {
52
	private static String courierDetailsPath = "/CourierDetailReports";
52
	private static String courierDetailsPath = "/CourierDetailReports";
53
	private static Logger logger = LoggerFactory.getLogger(TransactionUtils.class);
53
	private static Logger logger = LoggerFactory.getLogger(TransactionUtils.class);
-
 
54
	public static List<Long> virtualInvnetoryWarehouses;
-
 
55
 
-
 
56
	static{
-
 
57
		virtualInvnetoryWarehouses = new ArrayList<Long>();
-
 
58
		try{
-
 
59
			in.shop2020.model.v1.inventory.InventoryService.Client inventoryClient = new InventoryClient().getClient();
-
 
60
			List<Warehouse> allWarehouses = inventoryClient.getWarehouses(null, null, 0, 0, 0);
-
 
61
			for(Warehouse wh:allWarehouses){
-
 
62
				if(wh.getWarehouseType()==WarehouseType.THIRD_PARTY){
-
 
63
					virtualInvnetoryWarehouses.add(wh.getId());
-
 
64
				}
-
 
65
			}
-
 
66
		}catch(Exception e){
-
 
67
			e.printStackTrace();
-
 
68
		}
-
 
69
 
54
	
70
	}
55
	
71
	
56
	/**
72
	/**
57
	 * The human user is concerned only with a consolidated view of actionable
73
	 * The human user is concerned only with a consolidated view of actionable
58
	 * orders. Orders with different statuses in the database can be part of the
74
	 * orders. Orders with different statuses in the database can be part of the
59
	 * same consolidated view. This method uses a mapping of <i>type</i> to
75
	 * same consolidated view. This method uses a mapping of <i>type</i> to
Line 478... Line 494...
478
		long currentTime = date.getTime();
494
		long currentTime = date.getTime();
479
		currentDateTime = sdf.parse(sdf.format(date)).getTime();
495
		currentDateTime = sdf.parse(sdf.format(date)).getTime();
480
		expectedDateShippingTime = sdf.parse(sdf.format(new Date(order.getExpectedShippingTime()))).getTime();
496
		expectedDateShippingTime = sdf.parse(sdf.format(new Date(order.getExpectedShippingTime()))).getTime();
481
		if(expectedDateShippingTime >0 && order.getStatus() < 9){
497
		if(expectedDateShippingTime >0 && order.getStatus() < 9){
482
			if(expectedDateShippingTime <= currentDateTime){
498
			if(expectedDateShippingTime <= currentDateTime){
483
				if( WarehouseFinder.virtualInvnetoryWarehouses.contains(order.getFulfilmentWarehouseId())){
499
				if( virtualInvnetoryWarehouses.contains(order.getFulfilmentWarehouseId())){
484
					order.setAlert(OrderAlert.TODAY_SHIPPING_NOT_IN_STOCK);
500
					order.setAlert(OrderAlert.TODAY_SHIPPING_NOT_IN_STOCK);
485
				}else{
501
				}else{
486
					order.setAlert(OrderAlert.TODAY_SHIPPING_IN_STOCK);
502
					order.setAlert(OrderAlert.TODAY_SHIPPING_IN_STOCK);
487
				}
503
				}
488
			}else{
504
			}else{