| Line 38... |
Line 38... |
| 38 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
38 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
| 39 |
import com.spice.profitmandi.dao.entity.user.*;
|
39 |
import com.spice.profitmandi.dao.entity.user.*;
|
| 40 |
import com.spice.profitmandi.dao.entity.warehouse.WarehouseInventoryItem;
|
40 |
import com.spice.profitmandi.dao.entity.warehouse.WarehouseInventoryItem;
|
| 41 |
import com.spice.profitmandi.dao.entity.warehouse.WarehouseScan;
|
41 |
import com.spice.profitmandi.dao.entity.warehouse.WarehouseScan;
|
| 42 |
import com.spice.profitmandi.dao.enumuration.auth.CollectionRemark;
|
42 |
import com.spice.profitmandi.dao.enumuration.auth.CollectionRemark;
|
| - |
|
43 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
| 43 |
import com.spice.profitmandi.dao.enumuration.catalog.StockTransactionType;
|
44 |
import com.spice.profitmandi.dao.enumuration.catalog.StockTransactionType;
|
| 44 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
45 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 45 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
46 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
| 46 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
47 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
| 47 |
import com.spice.profitmandi.dao.enumuration.fofo.PaymentStatus;
|
48 |
import com.spice.profitmandi.dao.enumuration.fofo.PaymentStatus;
|
| Line 1025... |
Line 1026... |
| 1025 |
PartnerDealerRepository partnerDealerRepository;
|
1026 |
PartnerDealerRepository partnerDealerRepository;
|
| 1026 |
|
1027 |
|
| 1027 |
@Autowired
|
1028 |
@Autowired
|
| 1028 |
PurSaleService purSaleService;
|
1029 |
PurSaleService purSaleService;
|
| 1029 |
|
1030 |
|
| - |
|
1031 |
@Autowired
|
| - |
|
1032 |
CatalogRepository catalogRepository;
|
| - |
|
1033 |
|
| - |
|
1034 |
private void reverseOppoPayout() throws Exception {
|
| - |
|
1035 |
List<Integer> schemeIds = Arrays.asList(5540, 5542, 5544,5918, 5919, 5920, 5921, 5922);
|
| - |
|
1036 |
/*List<Integer> schemeIds = Arrays.asList(5540, 5542, 5544, 5545, 5550, 5555, 5556, 5557, 5564, 5565, 5566, 5567, 5569, 5570, 5582, 5590, 5592, 5593, 5594,
|
| - |
|
1037 |
5595, 5598, 5602, 5604, 5605, 5606, 5607, 5608, 5611, 5618, 5620, 5621, 5622, 5623, 5624, 5625, 5626, 5629, 5631,
|
| - |
|
1038 |
5633, 5634, 5635, 5637, 5644, 5649, 5655, 5659, 5662, 5668, 5672, 5674, 5679, 5683, 5684, 5685, 5688, 5689, 5690,
|
| - |
|
1039 |
5692, 5694, 5697, 5699, 5700, 5706, 5718, 5729, 5730, 5754, 5756, 5758, 5759, 5761, 5762, 5766, 5769, 5771, 5772,
|
| - |
|
1040 |
5773, 5774, 5775, 5776, 5781, 5782, 5783, 5786, 5788, 5790, 5795, 5800, 5803, 5804, 5807, 5809, 5815, 5816, 5819,
|
| - |
|
1041 |
5820, 5821, 5822, 5823, 5824, 5825, 5826, 5827, 5828, 5829, 5830, 5832, 5833, 5834, 5835, 5836, 5837, 5839, 5840,
|
| - |
|
1042 |
5841, 5842, 5843, 5844, 5845, 5846, 5847, 5848, 5849, 5850, 5851, 5852, 5853, 5854, 5855, 5857, 5859, 5860, 5863,
|
| - |
|
1043 |
5864, 5866, 5869, 5870, 5871, 5872, 5873, 5874, 5875, 5877, 5878, 5879, 5880, 5885, 5888, 5889, 5891, 5892, 5894,
|
| - |
|
1044 |
5899, 5901, 5903, 5905, 5908, 5910, 5913, 5916, 5917, 5918, 5919, 5920, 5921, 5922, 5923, 5924, 5925, 5926, 5927,
|
| - |
|
1045 |
5928, 5929, 5930, 5931, 5932, 5933, 5934, 5935, 5936, 5938, 5939, 5940, 5941, 5942, 5943, 5944, 5945, 5946, 5947,
|
| - |
|
1046 |
5948, 5949, 5950, 5951, 5952, 5953, 5954, 5955, 5956, 5957, 5958, 5959, 5960, 5961, 5962, 5963, 5964, 5965, 5966,
|
| - |
|
1047 |
5967, 5968, 5969, 5970, 5971, 5972, 5973, 5974, 5975, 5976, 5977, 5979, 5980, 5981, 5982, 5983, 5984, 5985, 5986,
|
| - |
|
1048 |
5987, 5989, 5990, 5991, 5992, 5996, 5997, 5998, 5999, 6000, 6001, 6002, 6003, 6004, 6005, 6006, 6007, 6008, 6010,
|
| - |
|
1049 |
6011, 6012, 6013, 6014, 6015, 6016, 6017, 6018, 6019, 6020, 6021, 6022, 6023, 6024, 6025, 6026, 6028, 6029, 6030,
|
| - |
|
1050 |
6031, 6032, 6033, 6034, 6035, 6036, 6037, 6038, 6039, 6040, 6041, 6042, 6043, 6044, 6045, 6046, 6047, 6048, 6049,
|
| - |
|
1051 |
6050, 6051, 6052, 6053, 6054, 6055, 6056, 6057, 6058, 6059, 6060, 6061, 6062, 6063, 6064, 6065, 6066, 6067, 6068,
|
| - |
|
1052 |
6069, 6070, 6071, 6072, 6073, 6078, 6079, 6080, 6081, 6082, 6083, 6084, 6085, 6086, 6087, 6088, 6089, 6091, 6092,
|
| - |
|
1053 |
6093, 6094, 6095, 6098, 6102);*/
|
| - |
|
1054 |
Map<Integer, List<SchemeInOut>> inventoryItemSiosMap = schemeInOutRepository.selectBySchemeIds(new HashSet<>(schemeIds)).stream().collect(Collectors.groupingBy(x -> x.getInventoryItemId()));
|
| - |
|
1055 |
Map<Integer, InventoryItem> inventoryItemMap = inventoryItemRepository.selectByIds(inventoryItemSiosMap.keySet()).stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
|
| - |
|
1056 |
Set<Integer> itemIds = itemRepository.selectAllByBrand("Oppo", 10006).stream().map(x -> x.getId()).collect(toSet());
|
| - |
|
1057 |
List<InventoryItem> filteredInventoryItems = inventoryItemMap.values().stream().filter(x -> itemIds.contains(x.getItemId())).collect(Collectors.toList());
|
| - |
|
1058 |
for (InventoryItem filteredInventoryItem : filteredInventoryItems) {
|
| - |
|
1059 |
System.out.println("Serial Number is - " + filteredInventoryItem.getSerialNumber());
|
| - |
|
1060 |
List<ScanRecord> scanRecords = scanRecordRepository.selectByInventoryItemId(filteredInventoryItem.getId());
|
| - |
|
1061 |
ScanRecord scanRecord = scanRecords.stream().filter(x -> x.getType().equals(ScanType.SALE)).findFirst().orElse(null);
|
| - |
|
1062 |
if (scanRecord == null) {
|
| - |
|
1063 |
System.out.println("Could not find sale scan record for " + filteredInventoryItem.getSerialNumber());
|
| - |
|
1064 |
continue;
|
| - |
|
1065 |
//schemeService.reverseSchemes(inventoryItems, fofoOrder.getId(), reversalReason, Arrays.asList(SchemeType.INVESTMENT));
|
| - |
|
1066 |
}
|
| - |
|
1067 |
int orderId = scanRecord.getOrderId();
|
| - |
|
1068 |
schemeService.reverseSchemes(Arrays.asList(filteredInventoryItem), orderId, "Reissuing margins as incorrect margin disbursed", SchemeType.OUT_SCHEME_TYPES);
|
| - |
|
1069 |
}
|
| - |
|
1070 |
Map<Integer, List<InventoryItem>> purchaseInventoryItemsMap = filteredInventoryItems.stream().filter(x -> x.getCreateTimestamp().isAfter(YearMonth.now().atDay(1).atStartOfDay())).collect(Collectors.groupingBy(x -> x.getPurchaseId()));
|
| - |
|
1071 |
List<Purchase> purchases = purchaseRepository.selectAllByIds(new ArrayList<>(purchaseInventoryItemsMap.keySet()));
|
| - |
|
1072 |
for (Purchase purchase : purchases) {
|
| - |
|
1073 |
String invoiceNumber = purchase.getPurchaseReference();
|
| - |
|
1074 |
LocalDateTime billingTime = orderRepository.selectByInvoiceNumber(invoiceNumber).get(0).getBillingTimestamp();
|
| - |
|
1075 |
if(billingTime.isAfter(YearMonth.now().atDay(1).atStartOfDay()) ) {
|
| - |
|
1076 |
List<Integer> inventoryItems = purchaseInventoryItemsMap.get(purchase.getId()).stream().map(x -> x.getId()).collect(toList());
|
| - |
|
1077 |
schemeService.rollbackSchemes(inventoryItems, "Reissuing margins as incorrect margin disbursed");
|
| - |
|
1078 |
}
|
| - |
|
1079 |
}
|
| - |
|
1080 |
}
|
| - |
|
1081 |
|
| 1030 |
public void test() throws Exception {
|
1082 |
public void test() throws Exception {
|
| - |
|
1083 |
this.reverseOppoPayout();
|
| 1031 |
//List<TotalLoanAmountDueModel> totalLoanAmountDueModels = loanRepository.getDueLoansByFofoId(175139438);
|
1084 |
//List<TotalLoanAmountDueModel> totalLoanAmountDueModels = loanRepository.getDueLoansByFofoId(175139438);
|
| 1032 |
//System.out.println(totalLoanAmountDueModels);
|
1085 |
//System.out.println(totalLoanAmountDueModels);
|
| 1033 |
//runOnceTasks.findCNDiff();
|
1086 |
//runOnceTasks.findCNDiff();
|
| 1034 |
/*this.updatePartnerLimit();
|
1087 |
/*this.updatePartnerLimit();
|
| 1035 |
System.out.println(getSuggestedLimit(300000d));
|
1088 |
System.out.println(getSuggestedLimit(300000d));
|
| Line 2387... |
Line 2440... |
| 2387 |
}
|
2440 |
}
|
| 2388 |
|
2441 |
|
| 2389 |
public void checkfocusedModelInPartnerStock() throws Exception {
|
2442 |
public void checkfocusedModelInPartnerStock() throws Exception {
|
| 2390 |
|
2443 |
|
| 2391 |
//List<FofoStore> fofoStores = fofoStoreRepository.selectAll().stream().filter(x -> x.isActive()).limit(20).collect(Collectors.toList());
|
2444 |
//List<FofoStore> fofoStores = fofoStoreRepository.selectAll().stream().filter(x -> x.isActive()).limit(20).collect(Collectors.toList());
|
| 2392 |
Map<Integer, FofoStore> fofoStoreMap = fofoStoreRepository.selectActiveStores().stream().collect(Collectors.toMap(x->x.getId(),x->x));
|
2445 |
Map<Integer, FofoStore> fofoStoreMap = fofoStoreRepository.selectActiveStores().stream().collect(Collectors.toMap(x -> x.getId(), x -> x));
|
| 2393 |
Map<Integer, Map<Integer, List<SaholicCIS>>> warehouseItemAvailabilityMap = saholicInventoryService.getSaholicStock();
|
2446 |
Map<Integer, Map<Integer, List<SaholicCIS>>> warehouseItemAvailabilityMap = saholicInventoryService.getSaholicStock();
|
| 2394 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
2447 |
Map<Integer, String> warehouseMap = ProfitMandiConstants.WAREHOUSE_MAP;
|
| 2395 |
Map<Integer, FofoReportingModel> partnerIdSalesHeadersMap = this.getPartnerIdSalesHeaders();
|
2448 |
Map<Integer, FofoReportingModel> partnerIdSalesHeadersMap = this.getPartnerIdSalesHeaders();
|
| 2396 |
Map<Integer, List<FocusedModel>> regionFocusedModelsMap = focusedModelRepository.selectAll().stream().collect(Collectors.groupingBy(x -> x.getRegionId()));
|
2449 |
Map<Integer, List<FocusedModel>> regionFocusedModelsMap = focusedModelRepository.selectAll().stream().collect(Collectors.groupingBy(x -> x.getRegionId()));
|
| 2397 |
LOGGER.info("/ - {}", regionFocusedModelsMap);
|
2450 |
LOGGER.info("/ - {}", regionFocusedModelsMap);
|
| Line 2411... |
Line 2464... |
| 2411 |
LOGGER.info("regionPartnerMap - {}", regionPartnerMap.keySet());
|
2464 |
LOGGER.info("regionPartnerMap - {}", regionPartnerMap.keySet());
|
| 2412 |
for (Map.Entry<Set<Integer>, List<Integer>> regionPartnerEntry : regionPartnerMap.entrySet()) {
|
2465 |
for (Map.Entry<Set<Integer>, List<Integer>> regionPartnerEntry : regionPartnerMap.entrySet()) {
|
| 2413 |
//LOGGER.info("regionPartnerEntry - {}", regionPartnerEntry.getKey());
|
2466 |
//LOGGER.info("regionPartnerEntry - {}", regionPartnerEntry.getKey());
|
| 2414 |
Set<Integer> regionIds = regionPartnerEntry.getKey();
|
2467 |
Set<Integer> regionIds = regionPartnerEntry.getKey();
|
| 2415 |
List<Integer> partnerIds = regionPartnerEntry.getValue();
|
2468 |
List<Integer> partnerIds = regionPartnerEntry.getValue();
|
| 2416 |
if(regionIds.stream().anyMatch(x->!regionFocusedModelsMap.containsKey(x))) continue;
|
2469 |
if (regionIds.stream().anyMatch(x -> !regionFocusedModelsMap.containsKey(x))) continue;
|
| 2417 |
|
2470 |
|
| 2418 |
LOGGER.info("regionIds" + regionIds);
|
2471 |
LOGGER.info("regionIds" + regionIds);
|
| 2419 |
if (regionIds == null || regionIds.size() == 0) {
|
2472 |
if (regionIds == null || regionIds.size() == 0) {
|
| 2420 |
LOGGER.info("No region found for partner {}", partnerIds);
|
2473 |
LOGGER.info("No region found for partner {}", partnerIds);
|
| 2421 |
continue;
|
2474 |
continue;
|
| 2422 |
}
|
2475 |
}
|
| 2423 |
if(regionIds.contains(5)) {
|
2476 |
if (regionIds.contains(5)) {
|
| 2424 |
partnerIds.addAll(fofoStoreMap.keySet());
|
2477 |
partnerIds.addAll(fofoStoreMap.keySet());
|
| 2425 |
}
|
2478 |
}
|
| 2426 |
Map<Integer, Optional<Integer>> focusedCatalogIdAndQtyMap = regionIds.stream().map(regionFocusedModelsMap::get).flatMap(x -> x != null ? x.stream() : Stream.empty())
|
2479 |
Map<Integer, Optional<Integer>> focusedCatalogIdAndQtyMap = regionIds.stream().map(regionFocusedModelsMap::get).flatMap(x -> x != null ? x.stream() : Stream.empty())
|
| 2427 |
.collect(groupingBy(FocusedModel::getCatalogId, mapping(FocusedModel::getObsMinimumQty, Collectors.maxBy(Integer::compareTo))));
|
2480 |
.collect(groupingBy(FocusedModel::getCatalogId, mapping(FocusedModel::getObsMinimumQty, Collectors.maxBy(Integer::compareTo))));
|
| 2428 |
//LOGGER.info("focusedCatalogIdAndQtyMap {}",focusedCatalogIdAndQtyMap);
|
2481 |
//LOGGER.info("focusedCatalogIdAndQtyMap {}",focusedCatalogIdAndQtyMap);
|
| 2429 |
if(focusedCatalogIdAndQtyMap.size() == 0) continue;
|
2482 |
if (focusedCatalogIdAndQtyMap.size() == 0) continue;
|
| 2430 |
for (int partnerId : partnerIds) {
|
2483 |
for (int partnerId : partnerIds) {
|
| 2431 |
if(partnerId==0) continue;
|
2484 |
if (partnerId == 0) continue;
|
| 2432 |
FofoStore fofoStore = fofoStoreMap.get(partnerId);
|
2485 |
FofoStore fofoStore = fofoStoreMap.get(partnerId);
|
| 2433 |
List<FocusedModelShortageModel> focusedModelShortageList = new ArrayList<>();
|
2486 |
List<FocusedModelShortageModel> focusedModelShortageList = new ArrayList<>();
|
| 2434 |
focusedModelShortageReportMap.put(fofoStore.getId(), focusedModelShortageList);
|
2487 |
focusedModelShortageReportMap.put(fofoStore.getId(), focusedModelShortageList);
|
| 2435 |
LOGGER.info("Before retailerService.getFofoRetailer(fofoId)");
|
2488 |
LOGGER.info("Before retailerService.getFofoRetailer(fofoId)");
|
| 2436 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoStore.getId());
|
2489 |
CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoStore.getId());
|
| Line 2553... |
Line 2606... |
| 2553 |
focusedModelShortageReportMap.entrySet().forEach(x -> {
|
2606 |
focusedModelShortageReportMap.entrySet().forEach(x -> {
|
| 2554 |
storeGuyMap.entrySet().stream()
|
2607 |
storeGuyMap.entrySet().stream()
|
| 2555 |
//.filter(entry->entry.getKey().equals(email))
|
2608 |
//.filter(entry->entry.getKey().equals(email))
|
| 2556 |
.forEach(y -> {
|
2609 |
.forEach(y -> {
|
| 2557 |
|
2610 |
|
| 2558 |
if (y.getValue().contains(x.getKey())) {
|
2611 |
if (y.getValue().contains(x.getKey())) {
|
| 2559 |
if (!emailRowsMap.containsKey(y.getKey())) {
|
2612 |
if (!emailRowsMap.containsKey(y.getKey())) {
|
| 2560 |
emailRowsMap.put(y.getKey(), new ArrayList<>());
|
2613 |
emailRowsMap.put(y.getKey(), new ArrayList<>());
|
| 2561 |
}
|
2614 |
}
|
| 2562 |
List<List<? extends Serializable>> fms = x.getValue().stream().map(r -> Arrays.asList(r.getStoreCode(), r.getStoreName(), r.getBrandName(), r.getModelName(), r.getModelNumber(), r.getDp(), r.getWarehouseName(), r.getStateManager(), r.getTerritoryManager(), r.getPendingIndentQty(), r.getGrnStockQty(), r.getShortageQty(), r.getAvailability())).collect(Collectors.toList());
|
2615 |
List<List<? extends Serializable>> fms = x.getValue().stream().map(r -> Arrays.asList(r.getStoreCode(), r.getStoreName(), r.getBrandName(), r.getModelName(), r.getModelNumber(), r.getDp(), r.getWarehouseName(), r.getStateManager(), r.getTerritoryManager(), r.getPendingIndentQty(), r.getGrnStockQty(), r.getShortageQty(), r.getAvailability())).collect(Collectors.toList());
|
| 2563 |
emailRowsMap.get(y.getKey()).addAll(fms);
|
2616 |
emailRowsMap.get(y.getKey()).addAll(fms);
|
| 2564 |
|
2617 |
|
| 2565 |
}
|
2618 |
}
|
| 2566 |
|
2619 |
|
| 2567 |
});
|
2620 |
});
|
| 2568 |
|
2621 |
|
| 2569 |
});
|
2622 |
});
|
| 2570 |
//LOGGER.info("emailRowsMap {}", emailRowsMap);
|
2623 |
//LOGGER.info("emailRowsMap {}", emailRowsMap);
|
| 2571 |
|
2624 |
|
| 2572 |
List<String> headers = Arrays.asList("Store Code", "Store Name", "Brand", "Model Name", "Model Number", "DP", "Warehouse Name", "State Manager", "Territory Manager", "Pending Indent", "InStock", "Shortage Qty", "Availability");
|
2625 |
List<String> headers = Arrays.asList("Store Code", "Store Name", "Brand", "Model Name", "Model Number", "DP", "Warehouse Name", "State Manager", "Territory Manager", "Pending Indent", "InStock", "Shortage Qty", "Availability");
|
| Line 3601... |
Line 3654... |
| 3601 |
}
|
3654 |
}
|
| 3602 |
|
3655 |
|
| 3603 |
}
|
3656 |
}
|
| 3604 |
|
3657 |
|
| 3605 |
}
|
3658 |
}
|
| - |
|
3659 |
|
| 3606 |
private static final NavigableMap<Double, Double> discountMap = new TreeMap<>();
|
3660 |
private static final NavigableMap<Double, Double> discountMap = new TreeMap<>();
|
| - |
|
3661 |
|
| 3607 |
static {
|
3662 |
static {
|
| 3608 |
discountMap.put(4*ProfitMandiConstants.ONE_LAC-1, 0.2); // Up to 6 -> 20%
|
3663 |
discountMap.put(4 * ProfitMandiConstants.ONE_LAC - 1, 0.2); // Up to 6 -> 20%
|
| 3609 |
discountMap.put(10*ProfitMandiConstants.ONE_LAC-1, 0.25); // 6-10 -> 25%
|
3664 |
discountMap.put(10 * ProfitMandiConstants.ONE_LAC - 1, 0.25); // 6-10 -> 25%
|
| 3610 |
discountMap.put(20*ProfitMandiConstants.ONE_LAC-1, 0.3); // Above 10 -> 30%
|
3665 |
discountMap.put(20 * ProfitMandiConstants.ONE_LAC - 1, 0.3); // Above 10 -> 30%
|
| 3611 |
discountMap.put(Double.MAX_VALUE, 0.4); // Above 10 -> 30%
|
3666 |
discountMap.put(Double.MAX_VALUE, 0.4); // Above 10 -> 30%
|
| 3612 |
}
|
3667 |
}
|
| - |
|
3668 |
|
| 3613 |
public BigDecimal getSuggestedLimit(double investmentValue) {
|
3669 |
public BigDecimal getSuggestedLimit(double investmentValue) {
|
| 3614 |
double percentageValue = discountMap.ceilingEntry(investmentValue).getValue();
|
3670 |
double percentageValue = discountMap.ceilingEntry(investmentValue).getValue();
|
| 3615 |
return BigDecimal.valueOf(investmentValue * percentageValue);
|
3671 |
return BigDecimal.valueOf(investmentValue * percentageValue);
|
| 3616 |
}
|
3672 |
}
|
| - |
|
3673 |
|
| 3617 |
private BigDecimal getSuggestedAmount(CreditAccount creditAccount, CurrentPartnerDailyInvestment currentPartnerDailyInvestment, long utilizationAmount, BigDecimal sidbiLimit) {
|
3674 |
private BigDecimal getSuggestedAmount(CreditAccount creditAccount, CurrentPartnerDailyInvestment
|
| - |
|
3675 |
currentPartnerDailyInvestment, long utilizationAmount, BigDecimal sidbiLimit) {
|
| 3618 |
BigDecimal suggestedAmount = BigDecimal.ZERO;
|
3676 |
BigDecimal suggestedAmount = BigDecimal.ZERO;
|
| 3619 |
//1 LAC
|
3677 |
//1 LAC
|
| 3620 |
if (creditAccount == null || creditAccount.getGateway().equals(Gateway.SDDIRECT)) {
|
3678 |
if (creditAccount == null || creditAccount.getGateway().equals(Gateway.SDDIRECT)) {
|
| 3621 |
|
3679 |
|
| 3622 |
if (currentPartnerDailyInvestment != null) {
|
3680 |
if (currentPartnerDailyInvestment != null) {
|
| Line 4287... |
Line 4345... |
| 4287 |
}
|
4345 |
}
|
| 4288 |
|
4346 |
|
| 4289 |
}
|
4347 |
}
|
| 4290 |
|
4348 |
|
| 4291 |
|
4349 |
|
| - |
|
4350 |
public void findAllLiveDemoBrandItemsByBillingDate() throws
|
| 4292 |
public void findAllLiveDemoBrandItemsByBillingDate() throws MessagingException, ProfitMandiBusinessException, IOException {
|
4351 |
MessagingException, ProfitMandiBusinessException, IOException {
|
| 4293 |
LocalDateTime endDate = LocalDate.now().atStartOfDay().minusDays(8);
|
4352 |
LocalDateTime endDate = LocalDate.now().atStartOfDay().minusDays(8);
|
| 4294 |
|
4353 |
|
| 4295 |
List<LiveDemoOrderLineItemModel> liveDemoOrderLineItemModels = orderRepository.findAllLiveDemoBrandItemsByBillingDate(endDate.minusDays(60), endDate);
|
4354 |
List<LiveDemoOrderLineItemModel> liveDemoOrderLineItemModels = orderRepository.findAllLiveDemoBrandItemsByBillingDate(endDate.minusDays(60), endDate);
|
| 4296 |
LOGGER.info("liveDemoOrderLineItemModels {}", liveDemoOrderLineItemModels);
|
4355 |
LOGGER.info("liveDemoOrderLineItemModels {}", liveDemoOrderLineItemModels);
|
| 4297 |
String subject = "Billed Live Demo Model";
|
4356 |
String subject = "Billed Live Demo Model";
|
| Line 4676... |
Line 4735... |
| 4676 |
// Return the constructed HTML message
|
4735 |
// Return the constructed HTML message
|
| 4677 |
sb.append("</body></html>");
|
4736 |
sb.append("</body></html>");
|
| 4678 |
return sb.toString();
|
4737 |
return sb.toString();
|
| 4679 |
}
|
4738 |
}
|
| 4680 |
|
4739 |
|
| 4681 |
private String getWhatsAppMessageForDueDateExtend(Loan defaultLoan, double amount) throws ProfitMandiBusinessException {
|
4740 |
private String getWhatsAppMessageForDueDateExtend(Loan defaultLoan, double amount) throws
|
| - |
|
4741 |
ProfitMandiBusinessException {
|
| 4682 |
|
4742 |
|
| 4683 |
double absoluteAmount = Math.abs(amount);
|
4743 |
double absoluteAmount = Math.abs(amount);
|
| 4684 |
long roundedAmount = Math.round(absoluteAmount);
|
4744 |
long roundedAmount = Math.round(absoluteAmount);
|
| 4685 |
String formattedAmount = (amount < 0) ? "" + roundedAmount : "" + roundedAmount;
|
4745 |
String formattedAmount = (amount < 0) ? "" + roundedAmount : "" + roundedAmount;
|
| 4686 |
|
4746 |
|
| Line 4761... |
Line 4821... |
| 4761 |
|
4821 |
|
| 4762 |
public void createOpeningStockPartyWise() throws Exception {
|
4822 |
public void createOpeningStockPartyWise() throws Exception {
|
| 4763 |
// Get all partner stock data
|
4823 |
// Get all partner stock data
|
| 4764 |
Map<Integer, List<PartnerOpeningStockByTodayModel>> partnerOpeningStockByTodayMap = currentInventorySnapshotRepository.getAllPartnerTodayStock();
|
4824 |
Map<Integer, List<PartnerOpeningStockByTodayModel>> partnerOpeningStockByTodayMap = currentInventorySnapshotRepository.getAllPartnerTodayStock();
|
| 4765 |
Map<Integer, Map<Integer, Integer>> activatedButNotBilledCatalogQtyMap = smartCartService.activatedButNotBilledCatalogQtyMap();
|
4825 |
Map<Integer, Map<Integer, Integer>> activatedButNotBilledCatalogQtyMap = smartCartService.activatedButNotBilledCatalogQtyMap();
|
| 4766 |
LOGGER.info("PartnerOpeningStockByTodayModel {}",partnerOpeningStockByTodayMap);
|
4826 |
LOGGER.info("PartnerOpeningStockByTodayModel {}", partnerOpeningStockByTodayMap);
|
| 4767 |
for (Map.Entry<Integer, List<PartnerOpeningStockByTodayModel>> entry : partnerOpeningStockByTodayMap.entrySet()) {
|
4827 |
for (Map.Entry<Integer, List<PartnerOpeningStockByTodayModel>> entry : partnerOpeningStockByTodayMap.entrySet()) {
|
| 4768 |
int fofoId = entry.getKey();
|
4828 |
int fofoId = entry.getKey();
|
| 4769 |
List<PartnerOpeningStockByTodayModel> partnerStockList = entry.getValue();
|
4829 |
List<PartnerOpeningStockByTodayModel> partnerStockList = entry.getValue();
|
| 4770 |
// Get the sold (activated-but-not-billed) quantity for this fofo and catalog
|
4830 |
// Get the sold (activated-but-not-billed) quantity for this fofo and catalog
|
| 4771 |
Map<Integer, Integer> activatedButNotBilledQtyMap = activatedButNotBilledCatalogQtyMap.getOrDefault(fofoId, Collections.emptyMap());
|
4831 |
Map<Integer, Integer> activatedButNotBilledQtyMap = activatedButNotBilledCatalogQtyMap.getOrDefault(fofoId, Collections.emptyMap());
|