| Line 1049... |
Line 1049... |
| 1049 |
|
1049 |
|
| 1050 |
@Autowired
|
1050 |
@Autowired
|
| 1051 |
WarehouseProviderRepository warehouseProviderRepository;
|
1051 |
WarehouseProviderRepository warehouseProviderRepository;
|
| 1052 |
public void test() throws Exception {
|
1052 |
public void test() throws Exception {
|
| 1053 |
//this.checkfocusedModelInPartnerStock();
|
1053 |
//this.checkfocusedModelInPartnerStock();
|
| 1054 |
List<SDCreditRequirement> sdCreditRequirements = sdCreditRequirementRepository.selectAll();
|
1054 |
// List<SDCreditRequirement> sdCreditRequirements = sdCreditRequirementRepository.selectAll();
|
| 1055 |
/*for (SDCreditRequirement sdCreditRequirement : sdCreditRequirements) {
|
1055 |
/*for (SDCreditRequirement sdCreditRequirement : sdCreditRequirements) {
|
| 1056 |
long utilizationAmount = sdCreditService.getUtilizationAmount(sdCreditRequirement.getFofoId());
|
1056 |
long utilizationAmount = sdCreditService.getUtilizationAmount(sdCreditRequirement.getFofoId());
|
| 1057 |
if (Math.abs(sdCreditRequirement.getUtilizedAmount().doubleValue() - utilizationAmount) > 5) {
|
1057 |
if (Math.abs(sdCreditRequirement.getUtilizedAmount().doubleValue() - utilizationAmount) > 5) {
|
| 1058 |
sdCreditRequirement.setUtilizedAmount(BigDecimal.valueOf(utilizationAmount));
|
1058 |
sdCreditRequirement.setUtilizedAmount(BigDecimal.valueOf(utilizationAmount));
|
| 1059 |
}
|
1059 |
}
|
| Line 2808... |
Line 2808... |
| 2808 |
if (poItemAvailability != null) {
|
2808 |
if (poItemAvailability != null) {
|
| 2809 |
allColorPoAvailability += poItemAvailability.stream().collect(Collectors.summingInt(SaholicPOItem::getUnfulfilledQty));
|
2809 |
allColorPoAvailability += poItemAvailability.stream().collect(Collectors.summingInt(SaholicPOItem::getUnfulfilledQty));
|
| 2810 |
}
|
2810 |
}
|
| 2811 |
|
2811 |
|
| 2812 |
}
|
2812 |
}
|
| 2813 |
LOGGER.info("partnerIdSalesHeadersMap {}",partnerIdSalesHeadersMap);
|
- |
|
| - |
|
2813 |
|
| 2814 |
FocusedModelShortageModel fm = new FocusedModelShortageModel();
|
2814 |
FocusedModelShortageModel fm = new FocusedModelShortageModel();
|
| 2815 |
fm.setFofoId(fofoId);
|
2815 |
fm.setFofoId(fofoId);
|
| 2816 |
fm.setStoreCode(fofoStore.getCode());
|
2816 |
fm.setStoreCode(fofoStore.getCode());
|
| 2817 |
fm.setStoreName(customRetailer.getBusinessName());
|
2817 |
fm.setStoreName(customRetailer.getBusinessName());
|
| 2818 |
fm.setBrandName(items.get(0).getBrand());
|
2818 |
fm.setBrandName(items.get(0).getBrand());
|
| Line 2826... |
Line 2826... |
| 2826 |
fm.setWarehouseName(warehouseMap.get(customRetailer.getWarehouseId()));
|
2826 |
fm.setWarehouseName(warehouseMap.get(customRetailer.getWarehouseId()));
|
| 2827 |
if(partnerIdSalesHeadersMap.get(fofoId) != null){
|
2827 |
if(partnerIdSalesHeadersMap.get(fofoId) != null){
|
| 2828 |
fm.setStateManager(partnerIdSalesHeadersMap.get(fofoId).getRegionalManager());
|
2828 |
fm.setStateManager(partnerIdSalesHeadersMap.get(fofoId).getRegionalManager());
|
| 2829 |
fm.setTerritoryManager(partnerIdSalesHeadersMap.get(fofoId).getTerritoryManager());
|
2829 |
fm.setTerritoryManager(partnerIdSalesHeadersMap.get(fofoId).getTerritoryManager());
|
| 2830 |
}else {
|
2830 |
}else {
|
| 2831 |
LOGGER.info("fofoId - {}",fofoId);
|
2831 |
LOGGER.info("else fofoId - {}",fofoId);
|
| 2832 |
fm.setStateManager("");
|
2832 |
fm.setStateManager("");
|
| 2833 |
fm.setTerritoryManager("");
|
2833 |
fm.setTerritoryManager("");
|
| 2834 |
}
|
2834 |
}
|
| 2835 |
|
2835 |
|
| 2836 |
fm.setItemName(items.get(0).getBrand() + items.get(0).getModelNumber() + items.get(0).getModelName());
|
2836 |
fm.setItemName(items.get(0).getBrand() + items.get(0).getModelNumber() + items.get(0).getModelName());
|
| Line 2838... |
Line 2838... |
| 2838 |
|
2838 |
|
| 2839 |
focusedModelShortageList.add(fm);
|
2839 |
focusedModelShortageList.add(fm);
|
| 2840 |
}
|
2840 |
}
|
| 2841 |
|
2841 |
|
| 2842 |
}
|
2842 |
}
|
| - |
|
2843 |
LOGGER.info("focusedModelShortageReportMap {}",focusedModelShortageReportMap);
|
| 2843 |
if (!focusedModelShortageReportMap.isEmpty()) {
|
2844 |
if (!focusedModelShortageReportMap.isEmpty()) {
|
| 2844 |
String fileName = "Stock Alert-" + FormattingUtils.formatDate(LocalDateTime.now()) + ".csv";
|
2845 |
String fileName = "Stock Alert-" + FormattingUtils.formatDate(LocalDateTime.now()) + ".csv";
|
| 2845 |
Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
|
2846 |
Map<String, Set<Integer>> storeGuyMap = csService.getAuthUserPartnerIdMapping();
|
| 2846 |
Map<String, List<List<?>>> emailRowsMap = new HashMap<>();
|
2847 |
Map<String, List<List<?>>> emailRowsMap = new HashMap<>();
|
| 2847 |
|
2848 |
|
| Line 2870... |
Line 2871... |
| 2870 |
} catch (Exception e2) {
|
2871 |
} catch (Exception e2) {
|
| 2871 |
e2.printStackTrace();
|
2872 |
e2.printStackTrace();
|
| 2872 |
}
|
2873 |
}
|
| 2873 |
String[] sendToArray = new String[]{
|
2874 |
String[] sendToArray = new String[]{
|
| 2874 |
|
2875 |
|
| 2875 |
entry.getKey(), "apurve.shrivastava@smartdukaan.com", "puneet.bisht@smartdukaan.com","ranu.rajput@smartdukaan.com"
|
2876 |
entry.getKey(), "alok.divedi@smartdukaan.com","ranu.rajput@smartdukaan.com"
|
| 2876 |
|
2877 |
|
| 2877 |
};
|
2878 |
};
|
| 2878 |
|
2879 |
|
| 2879 |
|
2880 |
|
| 2880 |
try {
|
2881 |
try {
|