| Line 193... |
Line 193... |
| 193 |
|
193 |
|
| 194 |
List<VendorItemMapping> mappings = snapshotClient.getVendorItemMappings(item.getId());
|
194 |
List<VendorItemMapping> mappings = snapshotClient.getVendorItemMappings(item.getId());
|
| 195 |
if (mappings != null) {
|
195 |
if (mappings != null) {
|
| 196 |
for (VendorItemMapping mapping : mappings) {
|
196 |
for (VendorItemMapping mapping : mappings) {
|
| 197 |
if (mapping.getVendorId() == 1) {
|
197 |
if (mapping.getVendorId() == 1) {
|
| - |
|
198 |
try {
|
| 198 |
if (!item.getItemInventory().getAvailability().get(warehouseId).equals(currentInventory.get(mapping.getItemKey()).getQuantity().longValue())) {
|
199 |
if (!item.getItemInventory().getAvailability().get(warehouseId).equals(currentInventory.get(mapping.getItemKey()).getQuantity().longValue())) {
|
| - |
|
200 |
mismatches.put(item, currentInventory.get(mapping.getItemKey()));
|
| - |
|
201 |
}
|
| - |
|
202 |
} catch (Exception e) {
|
| 199 |
mismatches.put(item, currentInventory.get(mapping.getItemKey()));
|
203 |
mismatches.put(item, currentInventory.get(mapping.getItemKey()));
|
| 200 |
}
|
204 |
}
|
| 201 |
}
|
205 |
}
|
| 202 |
}
|
206 |
}
|
| 203 |
}
|
207 |
}
|
| 204 |
}
|
208 |
}
|
| 205 |
|
209 |
|
| 206 |
String subject = mismatches.size() + " mismatches with PLB sync for warehouse id: " + warehouseId;
|
210 |
String subject = mismatches.size() + " mismatches with PLB sync for warehouse id: " + warehouseId;
|
| 207 |
StringBuilder body = new StringBuilder("");
|
211 |
StringBuilder body = new StringBuilder("");
|
| 208 |
for (Item item : mismatches.keySet()) {
|
212 |
for (Item item : mismatches.keySet()) {
|
| - |
|
213 |
PLBDetails plbDetails = mismatches.get(item);
|
| - |
|
214 |
if (plbDetails != null) {
|
| 209 |
body.append(item.getId() + " " + mismatches.get(item).getItemKey() + " " + item.getItemInventory().getAvailability().get(warehouseId) + " " + mismatches.get(item).getQuantity().longValue() + "\n");
|
215 |
body.append(item.getId() + " " + plbDetails.getItemKey() + " " + item.getItemInventory().getAvailability().get(warehouseId) + " " + plbDetails.getQuantity().longValue() + "\n");
|
| - |
|
216 |
}
|
| - |
|
217 |
else {
|
| - |
|
218 |
body.append(item.getId() + " " + item.getBrand() + "|" + item.getModelName() + "|" + item.getModelNumber() + "|" + item.getColor() + " " + item.getItemInventory().getAvailability().get(warehouseId) + " 0\n");
|
| - |
|
219 |
}
|
| 210 |
}
|
220 |
}
|
| 211 |
GmailUtils g = new GmailUtils();
|
221 |
GmailUtils g = new GmailUtils();
|
| 212 |
g.sendSSLMessage(new String[]{ "mandeep.dhir@shop2020.in" }, subject, body.toString(), "cnc.center@shop2020.in", "5hop2o2o", new ArrayList<File>());
|
222 |
g.sendSSLMessage(new String[]{ "mandeep.dhir@shop2020.in" }, subject, body.toString(), "cnc.center@shop2020.in", "5hop2o2o", new ArrayList<File>());
|
| 213 |
}
|
223 |
}
|
| 214 |
}
|
224 |
}
|