| Line 28... |
Line 28... |
| 28 |
import com.spice.profitmandi.dao.entity.cs.Position;
|
28 |
import com.spice.profitmandi.dao.entity.cs.Position;
|
| 29 |
import com.spice.profitmandi.dao.entity.cs.Ticket;
|
29 |
import com.spice.profitmandi.dao.entity.cs.Ticket;
|
| 30 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
30 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
| 31 |
import com.spice.profitmandi.dao.entity.dtr.*;
|
31 |
import com.spice.profitmandi.dao.entity.dtr.*;
|
| 32 |
import com.spice.profitmandi.dao.entity.fofo.*;
|
32 |
import com.spice.profitmandi.dao.entity.fofo.*;
|
| - |
|
33 |
import com.spice.profitmandi.dao.entity.inventory.PartnerAgeingModel;
|
| 33 |
import com.spice.profitmandi.dao.entity.inventory.ReporticoCacheTable;
|
34 |
import com.spice.profitmandi.dao.entity.inventory.ReporticoCacheTable;
|
| 34 |
import com.spice.profitmandi.dao.entity.inventory.SaholicCIS;
|
35 |
import com.spice.profitmandi.dao.entity.inventory.SaholicCIS;
|
| 35 |
import com.spice.profitmandi.dao.entity.inventory.SaholicPOItem;
|
36 |
import com.spice.profitmandi.dao.entity.inventory.SaholicPOItem;
|
| 36 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
37 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
| 37 |
import com.spice.profitmandi.dao.entity.user.*;
|
38 |
import com.spice.profitmandi.dao.entity.user.*;
|
| - |
|
39 |
import com.spice.profitmandi.dao.entity.warehouse.BrandRegionMapping;
|
| 38 |
import com.spice.profitmandi.dao.enumuration.auth.CollectionRemark;
|
40 |
import com.spice.profitmandi.dao.enumuration.auth.CollectionRemark;
|
| 39 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
41 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
| 40 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
42 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 41 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
43 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
| 42 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
44 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
| Line 52... |
Line 54... |
| 52 |
import com.spice.profitmandi.dao.repository.auth.PartnerCollectionRemarkRepository;
|
54 |
import com.spice.profitmandi.dao.repository.auth.PartnerCollectionRemarkRepository;
|
| 53 |
import com.spice.profitmandi.dao.repository.catalog.*;
|
55 |
import com.spice.profitmandi.dao.repository.catalog.*;
|
| 54 |
import com.spice.profitmandi.dao.repository.cs.*;
|
56 |
import com.spice.profitmandi.dao.repository.cs.*;
|
| 55 |
import com.spice.profitmandi.dao.repository.dtr.*;
|
57 |
import com.spice.profitmandi.dao.repository.dtr.*;
|
| 56 |
import com.spice.profitmandi.dao.repository.fofo.*;
|
58 |
import com.spice.profitmandi.dao.repository.fofo.*;
|
| - |
|
59 |
import com.spice.profitmandi.dao.repository.inventory.BrandAgeingLimitRepository;
|
| 57 |
import com.spice.profitmandi.dao.repository.inventory.ReporticoCacheTableRepository;
|
60 |
import com.spice.profitmandi.dao.repository.inventory.ReporticoCacheTableRepository;
|
| 58 |
import com.spice.profitmandi.dao.repository.inventory.StateRepository;
|
61 |
import com.spice.profitmandi.dao.repository.inventory.StateRepository;
|
| 59 |
import com.spice.profitmandi.dao.repository.inventory.WarehouseRepository;
|
62 |
import com.spice.profitmandi.dao.repository.inventory.WarehouseRepository;
|
| 60 |
import com.spice.profitmandi.dao.repository.transaction.*;
|
63 |
import com.spice.profitmandi.dao.repository.transaction.*;
|
| 61 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
64 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
| 62 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
65 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
| 63 |
import com.spice.profitmandi.dao.repository.warehouse.BilledImeiModel;
|
66 |
import com.spice.profitmandi.dao.repository.warehouse.BilledImeiModel;
|
| - |
|
67 |
import com.spice.profitmandi.dao.repository.warehouse.BrandRegionMappingRepository;
|
| 64 |
import com.spice.profitmandi.dao.repository.warehouse.WarehouseInventoryItemRepository;
|
68 |
import com.spice.profitmandi.dao.repository.warehouse.WarehouseInventoryItemRepository;
|
| 65 |
import com.spice.profitmandi.dao.service.solr.FofoSolr;
|
69 |
import com.spice.profitmandi.dao.service.solr.FofoSolr;
|
| 66 |
import com.spice.profitmandi.service.NotificationService;
|
70 |
import com.spice.profitmandi.service.NotificationService;
|
| 67 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
71 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
| 68 |
import com.spice.profitmandi.service.PartnerStatsService;
|
72 |
import com.spice.profitmandi.service.PartnerStatsService;
|
| 69 |
import com.spice.profitmandi.service.integrations.CCAvenuePaymentService;
|
73 |
import com.spice.profitmandi.service.integrations.CCAvenuePaymentService;
|
| 70 |
import com.spice.profitmandi.service.integrations.RazorpayPaymentService;
|
74 |
import com.spice.profitmandi.service.integrations.RazorpayPaymentService;
|
| 71 |
import com.spice.profitmandi.service.integrations.bharti.model.BAGInsuranceModel;
|
75 |
import com.spice.profitmandi.service.integrations.bharti.model.BAGInsuranceModel;
|
| 72 |
import com.spice.profitmandi.service.integrations.toffee.ToffeeService;
|
76 |
import com.spice.profitmandi.service.integrations.toffee.ToffeeService;
|
| - |
|
77 |
import com.spice.profitmandi.service.inventory.AgeingModel;
|
| - |
|
78 |
import com.spice.profitmandi.service.inventory.AgeingService;
|
| 73 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
79 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
| 74 |
import com.spice.profitmandi.service.inventory.SaholicInventoryService;
|
80 |
import com.spice.profitmandi.service.inventory.SaholicInventoryService;
|
| 75 |
import com.spice.profitmandi.service.offers.OfferService;
|
81 |
import com.spice.profitmandi.service.offers.OfferService;
|
| 76 |
import com.spice.profitmandi.service.order.OrderService;
|
82 |
import com.spice.profitmandi.service.order.OrderService;
|
| 77 |
import com.spice.profitmandi.service.pricing.PriceDropService;
|
83 |
import com.spice.profitmandi.service.pricing.PriceDropService;
|
| Line 833... |
Line 839... |
| 833 |
|
839 |
|
| 834 |
public void sendCreditNote(YearMonth yearMonth) throws Exception {
|
840 |
public void sendCreditNote(YearMonth yearMonth) throws Exception {
|
| 835 |
creditNoteService.issueMonthlyMarginsCN(yearMonth);
|
841 |
creditNoteService.issueMonthlyMarginsCN(yearMonth);
|
| 836 |
}
|
842 |
}
|
| 837 |
|
843 |
|
| - |
|
844 |
@Autowired
|
| - |
|
845 |
BrandAgeingLimitRepository brandAgeingLimitRepository;
|
| - |
|
846 |
|
| - |
|
847 |
@Autowired
|
| - |
|
848 |
AgeingService ageingService;
|
| - |
|
849 |
|
| - |
|
850 |
public void sendMailForAgeingAlert() throws Exception {
|
| - |
|
851 |
//brandAgeingLimitRepository.selectAll();
|
| - |
|
852 |
Map<String, AgeingModel> ageingModelMap = ageingService.getAllAgeingForSecondary();
|
| - |
|
853 |
|
| - |
|
854 |
System.out.println(ageingModelMap.size());
|
| - |
|
855 |
List<PartnerAgeingModel> partnerAgeingModels = ageingService.getAllAgeingForTertiary();
|
| - |
|
856 |
|
| - |
|
857 |
|
| - |
|
858 |
org.apache.commons.io.output.ByteArrayOutputStream byteArrayOutputStream = FileUtil.getCSVByteStream(Arrays.asList("InventoryItemId", "Serial Number", "Item Id", "Brand", "Model Name", "ModelNumber",
|
| - |
|
859 |
"Color", "Exceed Days", "Last ScanType", "Supplier Name", "Current Warehouse", "First Warehouse", "Invoice Number", "Invoice Date"),
|
| - |
|
860 |
ageingModelMap.values().stream().map(x -> Arrays.asList(x.getInventoryItemId(), x.getSerialNumber(), x.getItemId(), x.getBrand(), x.getModelName(), x.getModelNumber(), x.getColor(),
|
| - |
|
861 |
x.getExceedDays(), x.getLastScanType(), x.getSupplierName(), x.getCurrentWarehouse(), x.getFirstWarehouse(), x.getInvoiceNumber(), FormattingUtils.formatDate(x.getInvoiceDate())))
|
| - |
|
862 |
.collect(Collectors.toList()));
|
| - |
|
863 |
|
| - |
|
864 |
org.apache.commons.io.output.ByteArrayOutputStream byteArrayOutputStream2 = FileUtil.getCSVByteStream(Arrays.asList("InventoryItemId", "Serial Number", "Item Id", "Brand", "Model Name", "ModelNumber",
|
| - |
|
865 |
"Color", "Partner Id", "Partner Code", "Partner Name", "Activation Type", "City", "State", "Billing Date", "Exceed Days", "Max Ageing", "Activation Date"),
|
| - |
|
866 |
partnerAgeingModels.stream().map(x -> Arrays.asList(x.getInventoryItemId(), x.getSerialNumber(), x.getItemId(), x.getBrand(), x.getModelName(), x.getModelNumber(), x.getColor(),
|
| - |
|
867 |
x.getFofoId(), x.getFofoCode(), x.getFofoName(), x.getActivationType(), x.getFofoCity(), x.getFofoState(), FormattingUtils.formatDate(x.getBillingDate()), x.getExceedDays(), x.getMaxAgeingDays(), x.getActivationDate()))
|
| - |
|
868 |
.collect(Collectors.toList()));
|
| - |
|
869 |
Utils.Attachment attachment1 = new Utils.Attachment("secondary-alert.csv", new ByteArrayResource(byteArrayOutputStream.toByteArray()));
|
| - |
|
870 |
Utils.Attachment attachment2 = new Utils.Attachment("tertiary-alert.csv", new ByteArrayResource(byteArrayOutputStream2.toByteArray()));
|
| - |
|
871 |
|
| - |
|
872 |
String mailSubject = "Stock ageing Alert";
|
| - |
|
873 |
Utils.sendMailWithAttachments(mailSender, new String[]{"deena.nath@smartdukaan.com"}, null, mailSubject, "PFA", attachment1, attachment2);
|
| - |
|
874 |
}
|
| - |
|
875 |
|
| 838 |
private class SaleRoles {
|
876 |
private class SaleRoles {
|
| 839 |
|
877 |
|
| 840 |
private List<String> l1;
|
878 |
private List<String> l1;
|
| 841 |
private List<String> l2;
|
879 |
private List<String> l2;
|
| 842 |
|
880 |
|
| Line 942... |
Line 980... |
| 942 |
OfferService offerService;
|
980 |
OfferService offerService;
|
| 943 |
|
981 |
|
| 944 |
@Autowired
|
982 |
@Autowired
|
| 945 |
PurchaseReturnItemRepository purchaseReturnItemRepository;
|
983 |
PurchaseReturnItemRepository purchaseReturnItemRepository;
|
| 946 |
|
984 |
|
| - |
|
985 |
@Autowired
|
| - |
|
986 |
BrandRegionMappingRepository brandRegionMappingRepository;
|
| - |
|
987 |
|
| 947 |
public void test() throws Exception {
|
988 |
public void test() throws Exception {
|
| 948 |
//this.sendMailForSamsungRebilling();
|
989 |
//this.sendMailForSamsungRebilling();
|
| 949 |
List<PurchaseReturnItem> purchaseReturnItems = purchaseReturnItemRepository.selectPurchaseReturnByStatuses(Arrays.asList(PurchaseReturnStatus.DEBIT_NOTE_CREATED));
|
990 |
/*List<PurchaseReturnItem> purchaseReturnItems = purchaseReturnItemRepository.selectPurchaseReturnByStatuses(Arrays.asList(PurchaseReturnStatus.DEBIT_NOTE_CREATED));
|
| 950 |
Map<Integer, List<PurchaseReturnItem>> inventoryItemsMap = purchaseReturnItems.stream().collect(Collectors.groupingBy(x -> x.getDebitNoteId()));
|
991 |
Map<Integer, List<PurchaseReturnItem>> inventoryItemsMap = purchaseReturnItems.stream().collect(Collectors.groupingBy(x -> x.getDebitNoteId()));
|
| 951 |
for (Map.Entry<Integer, List<PurchaseReturnItem>> debitNotePurcahseReturnMap : inventoryItemsMap.entrySet()) {
|
992 |
for (Map.Entry<Integer, List<PurchaseReturnItem>> debitNotePurcahseReturnMap : inventoryItemsMap.entrySet()) {
|
| 952 |
List<InventoryItem> inventoryItems = inventoryItemRepository.selectAllByIds(debitNotePurcahseReturnMap.getValue().stream().map(x -> x.getInventoryItemId()).collect(Collectors.toList()));
|
993 |
List<InventoryItem> inventoryItems = inventoryItemRepository.selectAllByIds(debitNotePurcahseReturnMap.getValue().stream().map(x -> x.getInventoryItemId()).collect(Collectors.toList()));
|
| 953 |
offerService.reverseAdditionalSelloutSchemes(debitNotePurcahseReturnMap.getValue().get(0).getFofoId(), inventoryItems);
|
994 |
offerService.reverseAdditionalSelloutSchemes(debitNotePurcahseReturnMap.getValue().get(0).getFofoId(), inventoryItems);
|
| 954 |
}
|
995 |
}*/
|
| - |
|
996 |
this.sendMailForAgeingAlert();
|
| - |
|
997 |
//this.sendMailForAgeingAlert();
|
| - |
|
998 |
//System.out.println(brandRegionMappingRepository.getAvailabilityToVendorWarehouse(Arrays.asList(33353), 7720));
|
| 955 |
|
999 |
|
| 956 |
}
|
1000 |
}
|
| 957 |
|
1001 |
|
| 958 |
public void sendMailForSamsungRebilling() throws Exception {
|
1002 |
public void sendMailForSamsungRebilling() throws Exception {
|
| 959 |
List<BilledImeiModel> samsungModels = warehouseInventoryItemRepository.findByBillingDateBrand(LocalDate.now(), "Samsung");
|
1003 |
List<BilledImeiModel> samsungModels = warehouseInventoryItemRepository.findByBillingDateBrand(LocalDate.now(), "Samsung");
|