Subversion Repositories SmartDukaan

Rev

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

Rev 5690 Rev 5702
Line 174... Line 174...
174
            CatalogClient historyCatalogServiceClient = new CatalogClient(
174
            CatalogClient historyCatalogServiceClient = new CatalogClient(
175
                    ConfigClientKeys.inventory_history_service_server_host.toString(),
175
                    ConfigClientKeys.inventory_history_service_server_host.toString(),
176
                    ConfigClientKeys.inventory_history_service_server_port.toString());
176
                    ConfigClientKeys.inventory_history_service_server_port.toString());
177
			Client historyClient = historyCatalogServiceClient.getClient();
177
			Client historyClient = historyCatalogServiceClient.getClient();
178
 
178
 
-
 
179
			Client stagingCatalogClient = new CatalogClient(ConfigClientKeys.catalog_service_server_host_prod.toString(),
-
 
180
                    ConfigClientKeys.catalog_service_server_port.toString()).getClient();
-
 
181
 
179
		    //The snapshot client is used to update the inventory snapshot for production systems.
182
		    //The snapshot client is used to update the inventory snapshot for production systems.
180
		    TransactionClient transactionClient = new TransactionClient();
183
		    TransactionClient transactionClient = new TransactionClient();
181
			in.shop2020.model.v1.order.TransactionService.Client tClient = transactionClient.getClient();
184
			in.shop2020.model.v1.order.TransactionService.Client tClient = transactionClient.getClient();
182
 
185
 
183
			Long warehouseId = Long.parseLong(inventoryUpdate.getwarehouseId());
186
			Long warehouseId = Long.parseLong(inventoryUpdate.getwarehouseId());
Line 195... Line 198...
195
	            }			    
198
	            }			    
196
			}
199
			}
197
 
200
 
198
			//Update the snapshot before the history since that is more important.
201
			//Update the snapshot before the history since that is more important.
199
			snapshotClient.updateInventory(warehouseId, timestamp, availability);
202
			snapshotClient.updateInventory(warehouseId, timestamp, availability);
-
 
203
			stagingCatalogClient.updateInventory(warehouseId, timestamp, availability);
200
			historyClient.updateInventoryHistory(warehouseId, timestamp, availability);
204
			historyClient.updateInventoryHistory(warehouseId, timestamp, availability);
201
			
205
			
202
			List<BillingUpdate> billingUpdates = inventoryUpdate.getBillingUpdates();
206
			List<BillingUpdate> billingUpdates = inventoryUpdate.getBillingUpdates();
203
			if(billingUpdates!=null){
207
			if(billingUpdates!=null){
204
				for(BillingUpdate billingUpdate: billingUpdates){
208
				for(BillingUpdate billingUpdate: billingUpdates){
Line 217... Line 221...
217
			            else {
221
			            else {
218
	                        snapshotClient.resetAvailability(
222
	                        snapshotClient.resetAvailability(
219
	                                plbDetail.getItemKey(), 1,
223
	                                plbDetail.getItemKey(), 1,
220
	                                plbDetail.getQuantity().longValue(), warehouseId);
224
	                                plbDetail.getQuantity().longValue(), warehouseId);
221
	                        snapshotClient.markMissedInventoryUpdatesAsProcessed(
225
	                        snapshotClient.markMissedInventoryUpdatesAsProcessed(
222
	                                plbDetail.getItemKey(), warehouseId);			                
226
	                                plbDetail.getItemKey(), warehouseId);
223
			            }
227
			            }
224
                    } catch (Exception e) {
228
                    } catch (Exception e) {
225
                        logger.error("Could not reset availability of: " + plbDetail.getItemKey(), e);
229
                        logger.error("Could not reset availability of: " + plbDetail.getItemKey(), e);
226
                        GmailUtils g = new GmailUtils();
230
                        GmailUtils g = new GmailUtils();
227
                        g.sendSSLMessage(new String[]{ "mandeep.dhir@shop2020.in" }, "Error resetting availability for " + plbDetail.getItemKey() + " in warehouseId: " + warehouseId + " to " + plbDetail.getQuantity(), "", "cnc.center@shop2020.in", "5hop2o2o", new ArrayList<File>());
231
                        g.sendSSLMessage(new String[]{ "mandeep.dhir@shop2020.in" }, "Error resetting availability for " + plbDetail.getItemKey() + " in warehouseId: " + warehouseId + " to " + plbDetail.getQuantity(), "", "cnc.center@shop2020.in", "5hop2o2o", new ArrayList<File>());