Subversion Repositories SmartDukaan

Rev

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

Rev 28528 Rev 28529
Line 2191... Line 2191...
2191
					focusedModelShortageList.add(fm);
2191
					focusedModelShortageList.add(fm);
2192
				}
2192
				}
2193
 
2193
 
2194
			}
2194
			}
2195
 
2195
 
2196
			/*
-
 
2197
			 * if (!focusedModelShortageList.isEmpty()) { String subject = "Stock Alert";
2196
			if (!focusedModelShortageList.isEmpty()) {
-
 
2197
				String subject = "Stock Alert";
2198
			 * String messageText = this.getMessage(focusedModelShortageList);
2198
				String messageText = this.getMessage(focusedModelShortageList);
2199
			 * 
2199
 
2200
			 * this.sendMailWithAttachments(subject, messageText,
2200
				this.sendMailWithAttachments(subject, messageText, customRetailer.getEmail());
2201
			 * customRetailer.getEmail()); String notificationMessage =
-
 
2202
			 * this.getNotificationMessage(focusedModelShortageList);
2201
				String notificationMessage = this.getNotificationMessage(focusedModelShortageList);
2203
			 * 
2202
 
2204
			 * LOGGER.info("notificationMessage" + notificationMessage);
2203
				LOGGER.info("notificationMessage" + notificationMessage);
2205
			 * 
2204
 
2206
			 * SendNotificationModel sendNotificationModel = new SendNotificationModel();
2205
				SendNotificationModel sendNotificationModel = new SendNotificationModel();
2207
			 * sendNotificationModel.setCampaignName("Stock Alert");
2206
				sendNotificationModel.setCampaignName("Stock Alert");
2208
			 * sendNotificationModel.setTitle("Alert");
2207
				sendNotificationModel.setTitle("Alert");
2209
			 * sendNotificationModel.setMessage(notificationMessage);
2208
				sendNotificationModel.setMessage(notificationMessage);
2210
			 * sendNotificationModel.setType("url"); sendNotificationModel.setUrl(
2209
				sendNotificationModel.setType("url");
2211
			 * "https://app.smartdukaan.com/pages/home/notifications");
2210
				sendNotificationModel.setUrl("https://app.smartdukaan.com/pages/home/notifications");
2212
			 * sendNotificationModel.setExpiresat(LocalDateTime.now().plusDays(2));
2211
				sendNotificationModel.setExpiresat(LocalDateTime.now().plusDays(2));
2213
			 * sendNotificationModel.setMessageType(MessageType.notification); int userId =
2212
				sendNotificationModel.setMessageType(MessageType.notification);
2214
			 * userAccountRepository.selectUserIdByRetailerId(fofoId);
2213
				int userId = userAccountRepository.selectUserIdByRetailerId(fofoId);
2215
			 * sendNotificationModel.setUserIds(Arrays.asList(userId));
2214
				sendNotificationModel.setUserIds(Arrays.asList(userId));
2216
			 * notificationService.sendNotification(sendNotificationModel);
2215
				notificationService.sendNotification(sendNotificationModel);
2217
			 * 
2216
 
2218
			 * }
2217
			}
2219
			 */
-
 
2220
 
2218
 
2221
		}
2219
		}
2222
		if (!focusedModelShortageReportMap.isEmpty()) {
2220
		if (!focusedModelShortageReportMap.isEmpty()) {
2223
			String fileName = "Stock Alert-" + FormattingUtils.formatDate(LocalDateTime.now()) + ".csv";
2221
			String fileName = "Stock Alert-" + FormattingUtils.formatDate(LocalDateTime.now()) + ".csv";
2224
			Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
2222
			Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
Line 2254... Line 2252...
2254
				try {
2252
				try {
2255
					baos = FileUtil.getCSVByteStream(headers, entry.getValue());
2253
					baos = FileUtil.getCSVByteStream(headers, entry.getValue());
2256
				} catch (Exception e2) {
2254
				} catch (Exception e2) {
2257
					e2.printStackTrace();
2255
					e2.printStackTrace();
2258
				}
2256
				}
2259
				String[] sendToArray = new String[] { // entry.getKey()
2257
				String[] sendToArray = new String[] { entry.getKey() };
2260
						"tejbeer.kaur@smartdukaan.com" };
-
 
2261
 
2258
 
2262
				try {
2259
				try {
2263
					Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Stock Alert", "PFA", fileName,
2260
					Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Stock Alert", "PFA", fileName,
2264
							new ByteArrayResource(baos.toByteArray()));
2261
							new ByteArrayResource(baos.toByteArray()));
2265
				} catch (Exception e1) { // TODO Auto-generated catch block
2262
				} catch (Exception e1) { // TODO Auto-generated catch block