| Line 44... |
Line 44... |
| 44 |
import javax.mail.internet.InternetAddress;
|
44 |
import javax.mail.internet.InternetAddress;
|
| 45 |
import javax.mail.internet.MimeMessage;
|
45 |
import javax.mail.internet.MimeMessage;
|
| 46 |
|
46 |
|
| 47 |
import com.smartdukaan.cron.itelImeiActivation.ItelImeiActivationNewService;
|
47 |
import com.smartdukaan.cron.itelImeiActivation.ItelImeiActivationNewService;
|
| 48 |
import com.spice.profitmandi.dao.enumuration.transaction.SchemePayoutStatus;
|
48 |
import com.spice.profitmandi.dao.enumuration.transaction.SchemePayoutStatus;
|
| - |
|
49 |
import com.spice.profitmandi.service.*;
|
| 49 |
import org.apache.commons.io.output.ByteArrayOutputStream;
|
50 |
import org.apache.commons.io.output.ByteArrayOutputStream;
|
| 50 |
import org.apache.commons.lang.StringUtils;
|
51 |
import org.apache.commons.lang.StringUtils;
|
| 51 |
import org.apache.http.client.methods.CloseableHttpResponse;
|
52 |
import org.apache.http.client.methods.CloseableHttpResponse;
|
| 52 |
import org.apache.http.client.methods.HttpPost;
|
53 |
import org.apache.http.client.methods.HttpPost;
|
| 53 |
import org.apache.http.conn.HttpHostConnectException;
|
54 |
import org.apache.http.conn.HttpHostConnectException;
|
| Line 261... |
Line 262... |
| 261 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
262 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
| 262 |
import com.spice.profitmandi.dao.repository.warehouse.BilledImeiModel;
|
263 |
import com.spice.profitmandi.dao.repository.warehouse.BilledImeiModel;
|
| 263 |
import com.spice.profitmandi.dao.repository.warehouse.BrandRegionMappingRepository;
|
264 |
import com.spice.profitmandi.dao.repository.warehouse.BrandRegionMappingRepository;
|
| 264 |
import com.spice.profitmandi.dao.repository.warehouse.WarehouseInventoryItemRepository;
|
265 |
import com.spice.profitmandi.dao.repository.warehouse.WarehouseInventoryItemRepository;
|
| 265 |
import com.spice.profitmandi.dao.service.solr.FofoSolr;
|
266 |
import com.spice.profitmandi.dao.service.solr.FofoSolr;
|
| 266 |
import com.spice.profitmandi.service.NotificationService;
|
- |
|
| 267 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
- |
|
| 268 |
import com.spice.profitmandi.service.PartnerStatsService;
|
- |
|
| 269 |
import com.spice.profitmandi.service.PerformanceService;
|
- |
|
| 270 |
import com.spice.profitmandi.service.integrations.CCAvenuePaymentService;
|
267 |
import com.spice.profitmandi.service.integrations.CCAvenuePaymentService;
|
| 271 |
import com.spice.profitmandi.service.integrations.RazorpayPaymentService;
|
268 |
import com.spice.profitmandi.service.integrations.RazorpayPaymentService;
|
| 272 |
import com.spice.profitmandi.service.integrations.bharti.model.BAGInsuranceModel;
|
269 |
import com.spice.profitmandi.service.integrations.bharti.model.BAGInsuranceModel;
|
| 273 |
import com.spice.profitmandi.service.integrations.toffee.ToffeeService;
|
270 |
import com.spice.profitmandi.service.integrations.toffee.ToffeeService;
|
| 274 |
import com.spice.profitmandi.service.inventory.AgeingModel;
|
271 |
import com.spice.profitmandi.service.inventory.AgeingModel;
|
| Line 901... |
Line 898... |
| 901 |
}
|
898 |
}
|
| 902 |
|
899 |
|
| 903 |
}
|
900 |
}
|
| 904 |
}
|
901 |
}
|
| 905 |
if (upgradedCount > 0) {
|
902 |
if (upgradedCount > 0) {
|
| 906 |
sendMailHtmlFormat(
|
903 |
sendMailOfHtmlFormat(googleMailSender,
|
| 907 |
new String[]{"amit.gupta@smartdukaan.com", "tarun.verma@smartdukaan.com", "neeraj.gupta@smartdukaan.com"}, sb.toString(), null, "Few Partners Category have been Upgraded");
|
904 |
new String[]{"amit.gupta@smartdukaan.com", "tarun.verma@smartdukaan.com", "neeraj.gupta@smartdukaan.com"}, sb.toString(), null, "Few Partners Category have been Upgraded");
|
| 908 |
} else {
|
905 |
} else {
|
| 909 |
sendMailHtmlFormat(
|
906 |
sendMailOfHtmlFormat(googleMailSender,
|
| 910 |
new String[]{"amit.gupta@smartdukaan.com", "tarun.verma@smartdukaan.com", "neeraj.gupta@smartdukaan.com"}, sb.toString(), null, "No partners Category have been upgraded today");
|
907 |
new String[]{"amit.gupta@smartdukaan.com", "tarun.verma@smartdukaan.com", "neeraj.gupta@smartdukaan.com"}, sb.toString(), null, "No partners Category have been upgraded today");
|
| 911 |
}
|
908 |
}
|
| 912 |
}
|
909 |
}
|
| 913 |
|
910 |
|
| 914 |
@Autowired
|
911 |
@Autowired
|
| Line 1141... |
Line 1138... |
| 1141 |
|
1138 |
|
| 1142 |
@Autowired
|
1139 |
@Autowired
|
| 1143 |
StandAlone standAlone;
|
1140 |
StandAlone standAlone;
|
| 1144 |
@Autowired
|
1141 |
@Autowired
|
| 1145 |
ItelImeiActivationNewService itelImeiActivationNewService;
|
1142 |
ItelImeiActivationNewService itelImeiActivationNewService;
|
| - |
|
1143 |
|
| 1146 |
public void checkItelImeiActivationNew(LocalDate date, Integer day) throws Exception {
|
1144 |
public void checkItelImeiActivationNew(LocalDate date, Integer day) throws Exception {
|
| 1147 |
try {
|
1145 |
try {
|
| 1148 |
itelImeiActivationNewService.checkItelImeiActivationNew(date, day);
|
1146 |
itelImeiActivationNewService.checkItelImeiActivationNew(date, day);
|
| 1149 |
} catch (Throwable e) {
|
1147 |
} catch (Throwable e) {
|
| 1150 |
throw new Exception(e);
|
1148 |
throw new Exception(e);
|
| 1151 |
}
|
1149 |
}
|
| 1152 |
}
|
1150 |
}
|
| 1153 |
|
1151 |
|
| 1154 |
public void test() throws Exception {
|
1152 |
public void test() throws Exception {
|
| 1155 |
try {
|
1153 |
try {
|
| 1156 |
|
- |
|
| - |
|
1154 |
this.sendUnscheduledFollowUpMail();
|
| 1157 |
//itelImeiActivationNewService.checkItelImeiActivationNew(LocalDate.now(), 15);
|
1155 |
//itelImeiActivationNewService.checkItelImeiActivationNew(LocalDate.now(), 15);
|
| 1158 |
} catch (Throwable e) {
|
1156 |
} catch (Throwable e) {
|
| 1159 |
throw new Exception(e);
|
1157 |
throw new Exception(e);
|
| 1160 |
}
|
1158 |
}
|
| 1161 |
|
1159 |
|
| Line 2313... |
Line 2311... |
| 2313 |
Utils.sendHtmlMailWithAttachments(googleMailSender, new String[]{email}, null, "Statewise " + subject, statewiseSaleReport, attachment);
|
2311 |
Utils.sendHtmlMailWithAttachments(googleMailSender, new String[]{email}, null, "Statewise " + subject, statewiseSaleReport, attachment);
|
| 2314 |
}
|
2312 |
}
|
| 2315 |
}
|
2313 |
}
|
| 2316 |
}
|
2314 |
}
|
| 2317 |
|
2315 |
|
| - |
|
2316 |
|
| 2318 |
private void sendMailOfHtmlFormat(String email, String body, String cc[], String subject) throws MessagingException, ProfitMandiBusinessException, IOException {
|
2317 |
private void sendMailOfHtmlFormat(JavaMailSender sender, String[] email, String body, String cc[], String subject) throws MessagingException, ProfitMandiBusinessException, IOException {
|
| 2319 |
MimeMessage message = mailSender.createMimeMessage();
|
2318 |
MimeMessage message = sender.createMimeMessage();
|
| 2320 |
MimeMessageHelper helper = new MimeMessageHelper(message);
|
2319 |
MimeMessageHelper helper = new MimeMessageHelper(message);
|
| 2321 |
helper.setSubject(subject);
|
2320 |
helper.setSubject(subject);
|
| 2322 |
helper.setText(body, true);
|
2321 |
helper.setText(body, true);
|
| 2323 |
helper.setTo(email);
|
2322 |
helper.setTo(email);
|
| 2324 |
if (cc != null) {
|
2323 |
if (cc != null) {
|
| Line 2742... |
Line 2741... |
| 2742 |
// notificationService.sendWhatsappMessage(notificationMessage, title,
|
2741 |
// notificationService.sendWhatsappMessage(notificationMessage, title,
|
| 2743 |
// authUser.getMobileNumber());
|
2742 |
// authUser.getMobileNumber());
|
| 2744 |
}
|
2743 |
}
|
| 2745 |
}
|
2744 |
}
|
| 2746 |
|
2745 |
|
| - |
|
2746 |
@Autowired
|
| - |
|
2747 |
AuthService authService;
|
| - |
|
2748 |
|
| - |
|
2749 |
public void sendUnscheduledFollowUpMail() throws Exception {
|
| - |
|
2750 |
List<Lead> missedScheduleLeads = leadRepository.selectLeadsScheduledBetweenDate(null, LocalDate.now().atStartOfDay().minusDays(30), LocalDateTime.now().toLocalDate().atStartOfDay());
|
| - |
|
2751 |
List<Lead> leadsScheduledForToday = leadRepository.selectLeadsScheduledBetweenDate(null, LocalDate.now().atStartOfDay(), LocalDate.now().atTime(LocalTime.MAX));
|
| - |
|
2752 |
List<Integer> authIds = missedScheduleLeads.stream().map(x -> x.getAssignTo()).distinct().collect(Collectors.toList());
|
| - |
|
2753 |
LOGGER.info(authIds.size());
|
| - |
|
2754 |
Map<Integer, AuthUser> authUserMap = authRepository.selectAllAuthUserByIds(authIds).stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
|
| - |
|
2755 |
LOGGER.info(authUserMap.size());
|
| - |
|
2756 |
//if(true) return;
|
| - |
|
2757 |
|
| - |
|
2758 |
missedScheduleLeads = missedScheduleLeads.stream().sorted(Comparator.comparing(Lead::getState, String.CASE_INSENSITIVE_ORDER).thenComparing(Lead::getAssignTo).thenComparing(Lead::getScheduledTimestamp)).collect(Collectors.toList());
|
| - |
|
2759 |
//leadsScheduledForToday
|
| - |
|
2760 |
List<AuthUser> authUsers = authRepository.selectAllActiveUser();
|
| - |
|
2761 |
LOGGER.info("Auth Users Size - {}", authUsers.size());
|
| - |
|
2762 |
for (AuthUser authUser : authUsers) {
|
| - |
|
2763 |
LOGGER.info("Auth Name - {}", authUser.getFullName());
|
| - |
|
2764 |
List<Integer> reporteeAuthIds = authService.getAllReportees(authUser.getId());
|
| - |
|
2765 |
reporteeAuthIds.add(authUser.getId());
|
| - |
|
2766 |
StringBuilder sb = new StringBuilder();
|
| - |
|
2767 |
sb.append("<html><body>");
|
| - |
|
2768 |
List<Lead> authMissedScheduledLeads = missedScheduleLeads.stream().filter(x -> reporteeAuthIds.contains(x.getAssignTo())).collect(Collectors.toList());
|
| - |
|
2769 |
LOGGER.info("authMissedScheduledLeads {}", authMissedScheduledLeads.size());
|
| - |
|
2770 |
if (authMissedScheduledLeads.size() > 0) {
|
| - |
|
2771 |
addMissedScheduledLeadsTable(sb, authMissedScheduledLeads, authUserMap);
|
| - |
|
2772 |
sb.append("</body></html>");
|
| - |
|
2773 |
|
| - |
|
2774 |
String subject = "Lead Updates Summary";
|
| - |
|
2775 |
//TODO: Uncomment it later
|
| - |
|
2776 |
// String[] email = Arrays.asList(authUser.getEmailId()).toArray(new String[1]);
|
| - |
|
2777 |
String[] email = Arrays.asList("amit.gupta@smartdukaan.com").toArray(new String[1]);
|
| - |
|
2778 |
this.sendMailOfHtmlFormat(googleMailSender, email, sb.toString(), null, subject);
|
| - |
|
2779 |
break;
|
| - |
|
2780 |
}
|
| - |
|
2781 |
}
|
| - |
|
2782 |
|
| - |
|
2783 |
}
|
| - |
|
2784 |
|
| - |
|
2785 |
private void addMissedScheduledLeadsTable(StringBuilder sb, List<Lead> missedScheduleLeads, Map<Integer, AuthUser> authUserMap) {
|
| - |
|
2786 |
sb.append("<h3>Leads That Missed the schedule</h3>");
|
| - |
|
2787 |
sb.append("<table style='border:1px solid black' cellspacing='0'>")
|
| - |
|
2788 |
.append("<tr>")
|
| - |
|
2789 |
.append("<th style='border:1px solid black;padding: 5px'>").append("Lead Id").append("</th>")
|
| - |
|
2790 |
.append("<th style='border:1px solid black;padding: 5px'>").append("Lead Name").append("</th>")
|
| - |
|
2791 |
.append("<th style='border:1px solid black;padding: 5px'>").append("Mobile No").append("</th>")
|
| - |
|
2792 |
.append("<th style='border:1px solid black;padding: 5px'>").append("City").append("</th>")
|
| - |
|
2793 |
.append("<th style='border:1px solid black;padding: 5px'>").append("State").append("</th>")
|
| - |
|
2794 |
.append("<th style='border:1px solid black;padding: 5px'>").append("Created On").append("</th>")
|
| - |
|
2795 |
.append("<th style='border:1px solid black;padding: 5px'>").append("Assigned To").append("</th>")
|
| - |
|
2796 |
.append("<th style='border:1px solid black;padding: 5px'>").append("Scheduled On").append("</th>")
|
| - |
|
2797 |
.append("</tr>");
|
| - |
|
2798 |
for (Lead lead : missedScheduleLeads) {
|
| - |
|
2799 |
sb.append("<tr style='background-color:").append(lead.getColor()).append("'>")
|
| - |
|
2800 |
.append("<td style='border:1px solid black;padding: 5px'>").append(lead.getId()).append("</td>")
|
| - |
|
2801 |
.append("<td style='border:1px solid black;padding: 5px'>").append(lead.getFullName()).append("</td>")
|
| - |
|
2802 |
.append("<td style='border:1px solid black;padding: 5px'>").append(lead.getLeadMobile()).append("</td>")
|
| - |
|
2803 |
.append("<td style='border:1px solid black;padding: 5px'>").append(lead.getCity()).append("</td>")
|
| - |
|
2804 |
.append("<td style='border:1px solid black;padding: 5px'>").append(lead.getState()).append("</td>")
|
| - |
|
2805 |
.append("<td style='border:1px solid black;padding: 5px'>").append(FormattingUtils.formatDate(lead.getCreatedTimestamp())).append("</td>")
|
| - |
|
2806 |
.append("<td style='border:1px solid black;padding: 5px'>").append(
|
| - |
|
2807 |
authUserMap.containsKey(lead.getAssignTo()) ? authUserMap.get(lead.getAssignTo()).getFullName() : lead.getAssignTo()).append("</td>")
|
| - |
|
2808 |
.append("<td style='border:1px solid black;padding: 5px'>").append(FormattingUtils.formatDate(lead.getScheduledTimestamp())).append("</td>")
|
| - |
|
2809 |
.append("</tr>");
|
| - |
|
2810 |
}
|
| - |
|
2811 |
sb.append("</table>");
|
| - |
|
2812 |
}
|
| - |
|
2813 |
|
| 2747 |
public void notifyVisits() throws Exception {
|
2814 |
public void notifyVisits() throws Exception {
|
| 2748 |
List<FranchiseeVisit> franchiseeVisits = franchiseeVisitRepository.selectVisitsScheduledBetweenDate(LocalDateTime.now().minusDays(15), LocalDateTime.now().plusHours(4));
|
2815 |
List<FranchiseeVisit> franchiseeVisits = franchiseeVisitRepository.selectVisitsScheduledBetweenDate(LocalDateTime.now().minusDays(15), LocalDateTime.now().plusHours(4));
|
| 2749 |
Map<Integer, String> authUserEmailMap = authRepository.selectAllActiveUser().stream().collect(Collectors.toMap(x -> x.getId(), x -> x.getEmailId()));
|
2816 |
Map<Integer, String> authUserEmailMap = authRepository.selectAllActiveUser().stream().collect(Collectors.toMap(x -> x.getId(), x -> x.getEmailId()));
|
| 2750 |
Map<String, Integer> dtrEmailMap = dtrUserRepository.selectAllByEmailIds(new ArrayList<>(authUserEmailMap.values())).stream().collect(Collectors.toMap(x -> x.getEmailId(), x -> x.getId()));
|
2817 |
Map<String, Integer> dtrEmailMap = dtrUserRepository.selectAllByEmailIds(new ArrayList<>(authUserEmailMap.values())).stream().collect(Collectors.toMap(x -> x.getEmailId(), x -> x.getId()));
|
| 2751 |
Map<Integer, Integer> authUserKeyMap = new HashMap<>();
|
2818 |
Map<Integer, Integer> authUserKeyMap = new HashMap<>();
|
| Line 3021... |
Line 3088... |
| 3021 |
}
|
3088 |
}
|
| 3022 |
sb.append("</tbody></table><br><br>");
|
3089 |
sb.append("</tbody></table><br><br>");
|
| 3023 |
String subject = "Partner Problem Alert!";
|
3090 |
String subject = "Partner Problem Alert!";
|
| 3024 |
String[] email = sendTo.toArray(new String[sendTo.size()]);
|
3091 |
String[] email = sendTo.toArray(new String[sendTo.size()]);
|
| 3025 |
|
3092 |
|
| 3026 |
this.sendMailHtmlFormat(email, sb.toString(), null, subject);
|
3093 |
this.sendMailOfHtmlFormat(googleMailSender, email, sb.toString(), null, subject);
|
| 3027 |
|
3094 |
|
| 3028 |
Map<Integer, List<Integer>> authUserPartnerMapping = csService.getAuthUserIdPartnerIdMapping();
|
3095 |
Map<Integer, List<Integer>> authUserPartnerMapping = csService.getAuthUserIdPartnerIdMapping();
|
| 3029 |
|
3096 |
|
| 3030 |
for (Entry<Integer, List<Integer>> authUserPartner : authUserPartnerMapping.entrySet()) {
|
3097 |
for (Entry<Integer, List<Integer>> authUserPartner : authUserPartnerMapping.entrySet()) {
|
| 3031 |
AuthUser authUser = authRepository.selectById(authUserPartner.getKey());
|
3098 |
AuthUser authUser = authRepository.selectById(authUserPartner.getKey());
|
| Line 3054... |
Line 3121... |
| 3054 |
}
|
3121 |
}
|
| 3055 |
|
3122 |
|
| 3056 |
}
|
3123 |
}
|
| 3057 |
sbbuilder.append("</tbody></table><br><br>");
|
3124 |
sbbuilder.append("</tbody></table><br><br>");
|
| 3058 |
|
3125 |
|
| 3059 |
this.sendMailOfHtmlFormat(authUser.getEmailId(), sbbuilder.toString(), null, subject);
|
3126 |
this.sendMailOfHtmlFormat(googleMailSender, new String[]{authUser.getEmailId()}, sbbuilder.toString(), null, subject);
|
| 3060 |
}
|
3127 |
}
|
| 3061 |
|
3128 |
|
| 3062 |
}
|
3129 |
}
|
| 3063 |
}
|
3130 |
}
|
| 3064 |
}
|
3131 |
}
|
| 3065 |
|
3132 |
|
| 3066 |
private void sendMailHtmlFormat(String email[], String body, String cc[], String subject) throws MessagingException, ProfitMandiBusinessException, IOException {
|
- |
|
| 3067 |
MimeMessage message = mailSender.createMimeMessage();
|
- |
|
| 3068 |
MimeMessageHelper helper = new MimeMessageHelper(message);
|
- |
|
| 3069 |
helper.setSubject(subject);
|
- |
|
| 3070 |
helper.setText(body, true);
|
- |
|
| 3071 |
helper.setTo(email);
|
- |
|
| 3072 |
if (cc != null) {
|
- |
|
| 3073 |
helper.setCc(cc);
|
- |
|
| 3074 |
}
|
- |
|
| 3075 |
InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "Smart Dukaan");
|
- |
|
| 3076 |
helper.setFrom(senderAddress);
|
- |
|
| 3077 |
mailSender.send(message);
|
- |
|
| 3078 |
}
|
- |
|
| 3079 |
|
- |
|
| 3080 |
@Autowired
|
3133 |
@Autowired
|
| 3081 |
WarehouseRepository warehouseRepository;
|
3134 |
WarehouseRepository warehouseRepository;
|
| 3082 |
|
3135 |
|
| 3083 |
public void getVendorWarehouses(int warehouseId) {
|
3136 |
public void getVendorWarehouses(int warehouseId) {
|
| 3084 |
LOGGER.info("Warehouses - {}", warehouseRepository.getVendorWarehouses().get(warehouseId));
|
3137 |
LOGGER.info("Warehouses - {}", warehouseRepository.getVendorWarehouses().get(warehouseId));
|
| Line 3870... |
Line 3923... |
| 3870 |
}
|
3923 |
}
|
| 3871 |
if (!filteredRows.isEmpty()) {
|
3924 |
if (!filteredRows.isEmpty()) {
|
| 3872 |
String messageText = this.getMessageForDueDateExtend(filteredRows);
|
3925 |
String messageText = this.getMessageForDueDateExtend(filteredRows);
|
| 3873 |
String[] email = new String[]{storeGuyEntry.getKey()};
|
3926 |
String[] email = new String[]{storeGuyEntry.getKey()};
|
| 3874 |
|
3927 |
|
| 3875 |
this.sendMailHtmlFormat(email, messageText, null, subject);
|
3928 |
this.sendMailOfHtmlFormat(googleMailSender, email, messageText, null, subject);
|
| 3876 |
|
3929 |
|
| 3877 |
}
|
3930 |
}
|
| 3878 |
|
3931 |
|
| 3879 |
}
|
3932 |
}
|
| 3880 |
|
3933 |
|
| Line 3986... |
Line 4039... |
| 3986 |
}
|
4039 |
}
|
| 3987 |
if (!filteredRows.isEmpty()) {
|
4040 |
if (!filteredRows.isEmpty()) {
|
| 3988 |
String messageText = this.getMessageForDueDateCross(filteredRows);
|
4041 |
String messageText = this.getMessageForDueDateCross(filteredRows);
|
| 3989 |
String[] email = new String[]{storeGuyEntry.getKey()};
|
4042 |
String[] email = new String[]{storeGuyEntry.getKey()};
|
| 3990 |
|
4043 |
|
| 3991 |
this.sendMailHtmlFormat(email, messageText, null, "Due Date Cross");
|
4044 |
this.sendMailOfHtmlFormat(googleMailSender, email, messageText, null, "Due Date Cross");
|
| 3992 |
|
4045 |
|
| 3993 |
}
|
4046 |
}
|
| 3994 |
|
4047 |
|
| 3995 |
}
|
4048 |
}
|
| 3996 |
if (!dueDateCrossLoans.isEmpty()) {
|
4049 |
if (!dueDateCrossLoans.isEmpty()) {
|
| Line 4152... |
Line 4205... |
| 4152 |
}
|
4205 |
}
|
| 4153 |
|
4206 |
|
| 4154 |
sb.append("</tbody></table></body></html>");
|
4207 |
sb.append("</tbody></table></body></html>");
|
| 4155 |
String subject = "Customer Info - Hygiene Alert";
|
4208 |
String subject = "Customer Info - Hygiene Alert";
|
| 4156 |
|
4209 |
|
| 4157 |
this.sendMailOfHtmlFormat(customRetailer.getEmail(), sb.toString(), null, subject);
|
4210 |
this.sendMailOfHtmlFormat(mailSender, new String[]{customRetailer.getEmail()}, sb.toString(), null, subject);
|
| 4158 |
|
4211 |
|
| 4159 |
}
|
4212 |
}
|
| 4160 |
|
4213 |
|
| 4161 |
}
|
4214 |
}
|
| 4162 |
|
4215 |
|
| Line 4229... |
Line 4282... |
| 4229 |
|
4282 |
|
| 4230 |
boolean partnerYearMonth = partnerYearMonthData.values().stream().allMatch(Objects::isNull);
|
4283 |
boolean partnerYearMonth = partnerYearMonthData.values().stream().allMatch(Objects::isNull);
|
| 4231 |
|
4284 |
|
| 4232 |
if (!partnerDateWise && !partnerYearMonth) {
|
4285 |
if (!partnerDateWise && !partnerYearMonth) {
|
| 4233 |
String sb = this.getMessageHygieneAlertForPartner(partnerYearMonthData, partnerDateWiseData);
|
4286 |
String sb = this.getMessageHygieneAlertForPartner(partnerYearMonthData, partnerDateWiseData);
|
| 4234 |
this.sendMailOfHtmlFormat(email, sb, null, subject);
|
4287 |
this.sendMailOfHtmlFormat(googleMailSender, new String[]{email}, sb, null, subject);
|
| 4235 |
}
|
4288 |
}
|
| 4236 |
|
4289 |
|
| 4237 |
}
|
4290 |
}
|
| 4238 |
|
4291 |
|
| 4239 |
}
|
4292 |
}
|
| Line 4378... |
Line 4431... |
| 4378 |
StringBuilder sb = new StringBuilder();
|
4431 |
StringBuilder sb = new StringBuilder();
|
| 4379 |
sb.append("<html><body><p>Dear Partner,\n");
|
4432 |
sb.append("<html><body><p>Dear Partner,\n");
|
| 4380 |
sb.append("<p>Pls note your agreed monthly target is Rs." + purchaseTarget + " and your achievement till date is Rs." + purchase + "</p>");
|
4433 |
sb.append("<p>Pls note your agreed monthly target is Rs." + purchaseTarget + " and your achievement till date is Rs." + purchase + "</p>");
|
| 4381 |
sb.append("<p>Pls note that your balance target is Rs." + balanceTarget + "</p>\n");
|
4434 |
sb.append("<p>Pls note that your balance target is Rs." + balanceTarget + "</p>\n");
|
| 4382 |
sb.append(
|
4435 |
sb.append(
|
| 4383 |
"<p>We wish you all the best and we are confident that this focussed approach towards our outlet sales will help us take our outlet to the best SmartDukaan in your city.\n" + "</p>\n");
|
4436 |
"<p>We wish you all the best and we are confident that this focused approach towards our outlet sales will help us take our outlet to the best SmartDukaan in your city.\n" + "</p>\n");
|
| 4384 |
|
- |
|
| 4385 |
this.sendMailOfHtmlFormat(customRetailer.getEmail(), sb.toString(), null, subject);
|
- |
|
| 4386 |
|
- |
|
| 4387 |
// this.sendMailOfHtmlFormat("tejbeer.kaur@smartdukaan.com", sb.toString(),
|
- |
|
| 4388 |
// null, subject);
|
- |
|
| 4389 |
|
4437 |
|
| - |
|
4438 |
this.sendMailOfHtmlFormat(mailSender, new String[]{customRetailer.getEmail()}, sb.toString(), null, subject);
|
| 4390 |
}
|
4439 |
}
|
| 4391 |
|
4440 |
|
| 4392 |
}
|
4441 |
}
|
| 4393 |
|
4442 |
|
| 4394 |
}
|
4443 |
}
|
| Line 4465... |
Line 4514... |
| 4465 |
|
4514 |
|
| 4466 |
sb.append("</tr>\n");
|
4515 |
sb.append("</tr>\n");
|
| 4467 |
|
4516 |
|
| 4468 |
}
|
4517 |
}
|
| 4469 |
|
4518 |
|
| 4470 |
this.sendMailOfHtmlFormat(email, sb.toString(), null, subject);
|
4519 |
this.sendMailOfHtmlFormat(googleMailSender, new String[]{email}, sb.toString(), null, subject);
|
| 4471 |
// this.sendMailOfHtmlFormat("tejbeer.kaur@smartdukaan.com", sb.toString(),
|
4520 |
// this.sendMailOfHtmlFormat("tejbeer.kaur@smartdukaan.com", sb.toString(),
|
| 4472 |
// null, subject);
|
4521 |
// null, subject);
|
| 4473 |
|
4522 |
|
| 4474 |
}
|
4523 |
}
|
| 4475 |
|
4524 |
|
| Line 4512... |
Line 4561... |
| 4512 |
|
4561 |
|
| 4513 |
|
4562 |
|
| 4514 |
public void migrateVendorItemPricing() {
|
4563 |
public void migrateVendorItemPricing() {
|
| 4515 |
|
4564 |
|
| 4516 |
List<VendorItemPricing> vendorItemPricings = vendorItemPricingRepository.selectAll();
|
4565 |
List<VendorItemPricing> vendorItemPricings = vendorItemPricingRepository.selectAll();
|
| 4517 |
|
- |
|
| - |
|
4566 |
LOGGER.info("At migrate VendorItemPricing");
|
| 4518 |
Map<Integer, Item> items = itemRepository.selectByIds(vendorItemPricings.stream().map(x -> x.getItemId()).collect(Collectors.toSet())).stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
|
4567 |
Map<Integer, Item> items = itemRepository.selectByIds(vendorItemPricings.stream().map(x -> x.getItemId()).collect(Collectors.toSet())).stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
|
| 4519 |
for (VendorItemPricing vendorItemPricing : vendorItemPricings) {
|
4568 |
for (VendorItemPricing vendorItemPricing : vendorItemPricings) {
|
| 4520 |
Item item = null;
|
4569 |
Item item = null;
|
| 4521 |
if (items.get(vendorItemPricing.getItemId()) != null) {
|
4570 |
if (items.get(vendorItemPricing.getItemId()) != null) {
|
| 4522 |
item = items.get(vendorItemPricing.getItemId());
|
4571 |
item = items.get(vendorItemPricing.getItemId());
|
| Line 4529... |
Line 4578... |
| 4529 |
vendorCatalogPricingModel.setAuthId(13);
|
4578 |
vendorCatalogPricingModel.setAuthId(13);
|
| 4530 |
vendorCatalogPricingModel.setDp(vendorItemPricing.getDp());
|
4579 |
vendorCatalogPricingModel.setDp(vendorItemPricing.getDp());
|
| 4531 |
|
4580 |
|
| 4532 |
vendorCatalogPricingModel.setTp(vendorItemPricing.getTp());
|
4581 |
vendorCatalogPricingModel.setTp(vendorItemPricing.getTp());
|
| 4533 |
vendorCatalogPricingModel.setMop(vendorItemPricing.getMop());
|
4582 |
vendorCatalogPricingModel.setMop(vendorItemPricing.getMop());
|
| 4534 |
vendorCatalogPricingModel.setEffectedOn(LocalDate.now().minusDays(1));
|
4583 |
vendorCatalogPricingModel.setEffectedOn(LocalDate.of(2023,8, 22));
|
| 4535 |
vendorCatalogPricingModel.setVendorId(vendorItemPricing.getVendorId());
|
4584 |
vendorCatalogPricingModel.setVendorId(vendorItemPricing.getVendorId());
|
| 4536 |
|
4585 |
|
| 4537 |
|
4586 |
|
| 4538 |
try {
|
4587 |
try {
|
| 4539 |
vendorCatalogPricingService.createVendorCatalogPricingLog(vendorCatalogPricingModel);
|
4588 |
vendorCatalogPricingService.createVendorCatalogPricingLog(vendorCatalogPricingModel);
|