Subversion Repositories SmartDukaan

Rev

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

Rev 11605 Rev 11608
Line 136... Line 136...
136
			}
136
			}
137
		}
137
		}
138
		return pp;
138
		return pp;
139
	}
139
	}
140
	
140
	
-
 
141
	public static CatalogService.Client getCatalogCleint(CatalogService.Client catalogClient) throws Exception{
-
 
142
		if(!catalogClient.getOutputProtocol().getTransport().isOpen()) {
-
 
143
			catalogClient = new CatalogClient().getClient();
-
 
144
		}
-
 
145
		return catalogClient;
-
 
146
	}
-
 
147
	
141
	public static CartPojo getCartPojo (Cart cart, String errorMsg, String pincode, Boolean needInsuranceInfo) throws Exception{
148
	public static CartPojo getCartPojo (Cart cart, String errorMsg, String pincode, Boolean needInsuranceInfo) throws Exception{
142
	    CartPojo cartPojo = new CartPojo();
149
	    CartPojo cartPojo = new CartPojo();
143
	    cartPojo.setCouponCode(cart.getCouponCode());
150
	    cartPojo.setCouponCode(cart.getCouponCode());
144
	    cartPojo.setDiscountedPrice(cart.getDiscountedPrice());
151
	    cartPojo.setDiscountedPrice(cart.getDiscountedPrice());
145
	    cartPojo.setId(cart.getId());
152
	    cartPojo.setId(cart.getId());
Line 152... Line 159...
152
	    CatalogService.Client catalogClient;
159
	    CatalogService.Client catalogClient;
153
	    for(Line line : cart.getLines()) {
160
	    for(Line line : cart.getLines()) {
154
	        CartLinePojo linepojo = new CartLinePojo();
161
	        CartLinePojo linepojo = new CartLinePojo();
155
	        catalogClient = new CatalogClient().getClient();
162
	        catalogClient = new CatalogClient().getClient();
156
	        Item item = catalogClient.getItem(line.getItemId());
163
	        Item item = catalogClient.getItem(line.getItemId());
157
	        linepojo.setDataProtectionAvailable(catalogClient.getPrefferedInsurerForItem(line.getItemId(), InsurerType.DATA)>0);
164
	        linepojo.setDataProtectionAvailable(getCatalogCleint(catalogClient).getPrefferedInsurerForItem(line.getItemId(), InsurerType.DATA)>0);
158
	        linepojo.setTheftInsuranceAvailable(catalogClient.getPrefferedInsurerForItem(line.getItemId(), InsurerType.DEVICE)>0);
165
	        linepojo.setTheftInsuranceAvailable(getCatalogCleint(catalogClient).getPrefferedInsurerForItem(line.getItemId(), InsurerType.DEVICE)>0);
159
	        linepojo.setItemId(line.getItemId());
166
	        linepojo.setItemId(line.getItemId());
160
	        linepojo.setActualPrice(line.getActualPrice());
167
	        linepojo.setActualPrice(line.getActualPrice());
161
	        linepojo.setDataProtectionAmount(line.getDataProtectionAmount());
168
	        linepojo.setDataProtectionAmount(line.getDataProtectionAmount());
162
	        linepojo.setDataProtectionInsurer(line.getDataProtectionInsurer());
169
	        linepojo.setDataProtectionInsurer(line.getDataProtectionInsurer());
163
	        linepojo.setDiscountedPrice(line.getDiscountedPrice());
170
	        linepojo.setDiscountedPrice(line.getDiscountedPrice());