Subversion Repositories SmartDukaan

Rev

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

Rev 9849 Rev 9851
Line 127... Line 127...
127
						availabilityMismatchMap.put(itemId, mismatch);
127
						availabilityMismatchMap.put(itemId, mismatch);
128
					}
128
					}
129
				}
129
				}
130
			}
130
			}
131
		}
131
		}
132
		
-
 
-
 
132
		int mismatchRecordsNumber = availabilityMismatchMap.size();
133
        String subject = availabilityMismatchMap.size() + " mismatches in inventory compared to scan Records: ";
133
        //String subject = availabilityMismatchMap.size() + " mismatches in inventory compared to scan Records: ";
134
        File file = new File("inv_mismatches.xls");
134
        File file = new File("inv_mismatches.xls");
135
 
135
 
136
        try {
136
        try {
137
            BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file));
137
            BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(file));
138
            bufferedWriter.write(StringUtils.join(new String[] { "Item Id",
138
            bufferedWriter.write(StringUtils.join(new String[] { "Item Id",
139
                    "Brand", "Model Name", "Model Number",
139
                    "Brand", "Model Name", "Model Number",
140
                    "Color", "Inventory shown", "Inventory through Scans" }, '\t'));
140
                    "Color", "Inventory shown", "Inventory through Scans" }, '\t'));
141
            for (Long itemId : availabilityMismatchMap.keySet()) {
141
            for (Long itemId : availabilityMismatchMap.keySet()) {
142
            	if(availabilityMismatchMap.get(itemId)[0].equals(availabilityMismatchMap.get(itemId)[1])){
142
            	if(availabilityMismatchMap.get(itemId)[0].equals(availabilityMismatchMap.get(itemId)[1])){
-
 
143
            		mismatchRecordsNumber--;
143
            		continue;
144
            		continue;
144
            	}
145
            	}
145
            	Item item = null;
146
            	Item item = null;
146
            	try {
147
            	try {
147
	            	in.shop2020.model.v1.catalog.CatalogService.Client catalogClient = new CatalogClient().getClient();
148
	            	in.shop2020.model.v1.catalog.CatalogService.Client catalogClient = new CatalogClient().getClient();
Line 159... Line 160...
159
            }
160
            }
160
            bufferedWriter.close();
161
            bufferedWriter.close();
161
        } catch (IOException e) {
162
        } catch (IOException e) {
162
//TODO            logger.error("Could not write mismatches to file", e);
163
//TODO            logger.error("Could not write mismatches to file", e);
163
        }
164
        }
164
 
-
 
-
 
165
        String subject = mismatchRecordsNumber + " mismatches in inventory compared to scan Records: ";
165
        GmailUtils g = new GmailUtils();
166
        GmailUtils g = new GmailUtils();
166
        g.sendSSLMessage(new String[]{ "amar.kumar@shop2020.in","sandeep.sachdeva@shop2020.in","rajveer.singh@shop2020.in" }, subject, 
167
        g.sendSSLMessage(new String[]{ "amar.kumar@shop2020.in","sandeep.sachdeva@shop2020.in","rajveer.singh@shop2020.in" }, subject, 
167
                "", "cnc.center@shop2020.in", "5h0p2o2o", file.getAbsolutePath());
168
                "", "cnc.center@shop2020.in", "5h0p2o2o", file.getAbsolutePath());
168
	}
169
	}
169
}
170
}