| Line 104... |
Line 104... |
| 104 |
import com.spice.profitmandi.service.wallet.CommonPaymentService;
|
104 |
import com.spice.profitmandi.service.wallet.CommonPaymentService;
|
| 105 |
import com.spice.profitmandi.service.wallet.WalletService;
|
105 |
import com.spice.profitmandi.service.wallet.WalletService;
|
| 106 |
import com.spice.profitmandi.service.warehouse.PurchaseOrderService;
|
106 |
import com.spice.profitmandi.service.warehouse.PurchaseOrderService;
|
| 107 |
import com.spice.profitmandi.service.warehouse.WarehouseInventoryService;
|
107 |
import com.spice.profitmandi.service.warehouse.WarehouseInventoryService;
|
| 108 |
import com.spice.profitmandi.service.warehouse.WarehouseService;
|
108 |
import com.spice.profitmandi.service.warehouse.WarehouseService;
|
| - |
|
109 |
import com.sun.corba.se.impl.logging.UtilSystemException;
|
| 109 |
import in.shop2020.model.v1.order.OrderStatus;
|
110 |
import in.shop2020.model.v1.order.OrderStatus;
|
| 110 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
111 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
| 111 |
import org.apache.commons.io.output.ByteArrayOutputStream;
|
112 |
import org.apache.commons.io.output.ByteArrayOutputStream;
|
| 112 |
import org.apache.commons.lang.StringUtils;
|
113 |
import org.apache.commons.lang.StringUtils;
|
| 113 |
import org.apache.http.client.methods.CloseableHttpResponse;
|
114 |
import org.apache.http.client.methods.CloseableHttpResponse;
|
| Line 2403... |
Line 2404... |
| 2403 |
LOGGER.info("regionPartnerMap - {}", regionPartnerMap.keySet());
|
2404 |
LOGGER.info("regionPartnerMap - {}", regionPartnerMap.keySet());
|
| 2404 |
for (Map.Entry<Set<Integer>, List<Integer>> regionPartnerEntry : regionPartnerMap.entrySet()) {
|
2405 |
for (Map.Entry<Set<Integer>, List<Integer>> regionPartnerEntry : regionPartnerMap.entrySet()) {
|
| 2405 |
LOGGER.info("regionPartnerEntry - {}", regionPartnerEntry.getKey());
|
2406 |
LOGGER.info("regionPartnerEntry - {}", regionPartnerEntry.getKey());
|
| 2406 |
Set<Integer> regionIds = regionPartnerEntry.getKey();
|
2407 |
Set<Integer> regionIds = regionPartnerEntry.getKey();
|
| 2407 |
List<Integer> partnerIds = regionPartnerEntry.getValue();
|
2408 |
List<Integer> partnerIds = regionPartnerEntry.getValue();
|
| - |
|
2409 |
if(regionIds.contains(5)) {
|
| - |
|
2410 |
partnerIds.addAll(fofoStoreMap.keySet());
|
| - |
|
2411 |
partnerIds = partnerIds.stream().distinct().collect(toList());
|
| - |
|
2412 |
}
|
| 2408 |
LOGGER.info("regionIds" + regionIds);
|
2413 |
LOGGER.info("regionIds" + regionIds);
|
| 2409 |
if (regionIds == null || regionIds.size() == 0) {
|
2414 |
if (regionIds == null || regionIds.size() == 0) {
|
| 2410 |
LOGGER.info("No region found for partner {}", partnerIds);
|
2415 |
LOGGER.info("No region found for partner {}", partnerIds);
|
| 2411 |
continue;
|
2416 |
continue;
|
| 2412 |
}
|
2417 |
}
|
| Line 2560... |
Line 2565... |
| 2560 |
try {
|
2565 |
try {
|
| 2561 |
baos = FileUtil.getCSVByteStream(headers, entry.getValue());
|
2566 |
baos = FileUtil.getCSVByteStream(headers, entry.getValue());
|
| 2562 |
} catch (Exception e2) {
|
2567 |
} catch (Exception e2) {
|
| 2563 |
e2.printStackTrace();
|
2568 |
e2.printStackTrace();
|
| 2564 |
}
|
2569 |
}
|
| 2565 |
String[] sendToArray = new String[]{
|
2570 |
String[] sendToArray = new String[]{entry.getKey()};
|
| 2566 |
|
- |
|
| 2567 |
entry.getKey(), "alok.divedi@smartdukaan.com", "ranu.rajput@smartdukaan.com"
|
- |
|
| 2568 |
|
- |
|
| 2569 |
};
|
- |
|
| 2570 |
|
2571 |
|
| 2571 |
|
2572 |
|
| 2572 |
try {
|
2573 |
try {
|
| 2573 |
Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Stock Alert", "PFA", fileName, new ByteArrayResource(baos.toByteArray()));
|
2574 |
Utils.sendMailWithAttachment(googleMailSender, sendToArray, null, "Stock Alert", "PFA", fileName, new ByteArrayResource(baos.toByteArray()));
|
| 2574 |
} catch (Exception e1) { // TODO Auto-generated catch block
|
2575 |
} catch (Exception e1) { // TODO Auto-generated catch block
|