| 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.ReporticoCacheTable;
|
| 33 |
import com.spice.profitmandi.dao.entity.inventory.SaholicCIS;
|
34 |
import com.spice.profitmandi.dao.entity.inventory.SaholicCIS;
|
| 34 |
import com.spice.profitmandi.dao.entity.inventory.SaholicPOItem;
|
35 |
import com.spice.profitmandi.dao.entity.inventory.SaholicPOItem;
|
| 35 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
36 |
import com.spice.profitmandi.dao.entity.transaction.*;
|
| 36 |
import com.spice.profitmandi.dao.entity.user.*;
|
37 |
import com.spice.profitmandi.dao.entity.user.*;
|
| 37 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
38 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
| 38 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
39 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 39 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
40 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
| 40 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
41 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
| 41 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
42 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
| 42 |
import com.spice.profitmandi.dao.enumuration.transaction.PriceDropImeiStatus;
|
43 |
import com.spice.profitmandi.dao.enumuration.transaction.PriceDropImeiStatus;
|
| - |
|
44 |
import com.spice.profitmandi.dao.model.PartnerDetailModel;
|
| 43 |
import com.spice.profitmandi.dao.model.SimpleCampaign;
|
45 |
import com.spice.profitmandi.dao.model.SimpleCampaign;
|
| 44 |
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
|
46 |
import com.spice.profitmandi.dao.model.SimpleCampaignParams;
|
| 45 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
47 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 46 |
import com.spice.profitmandi.dao.repository.catalog.*;
|
48 |
import com.spice.profitmandi.dao.repository.catalog.*;
|
| 47 |
import com.spice.profitmandi.dao.repository.cs.*;
|
49 |
import com.spice.profitmandi.dao.repository.cs.*;
|
| 48 |
import com.spice.profitmandi.dao.repository.dtr.*;
|
50 |
import com.spice.profitmandi.dao.repository.dtr.*;
|
| 49 |
import com.spice.profitmandi.dao.repository.fofo.*;
|
51 |
import com.spice.profitmandi.dao.repository.fofo.*;
|
| - |
|
52 |
import com.spice.profitmandi.dao.repository.inventory.ReporticoCacheTableRepository;
|
| 50 |
import com.spice.profitmandi.dao.repository.inventory.StateRepository;
|
53 |
import com.spice.profitmandi.dao.repository.inventory.StateRepository;
|
| 51 |
import com.spice.profitmandi.dao.repository.inventory.WarehouseRepository;
|
54 |
import com.spice.profitmandi.dao.repository.inventory.WarehouseRepository;
|
| 52 |
import com.spice.profitmandi.dao.repository.transaction.*;
|
55 |
import com.spice.profitmandi.dao.repository.transaction.*;
|
| 53 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
56 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
| 54 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
57 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
| 55 |
import com.spice.profitmandi.service.NotificationService;
|
58 |
import com.spice.profitmandi.service.NotificationService;
|
| 56 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
59 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
| - |
|
60 |
import com.spice.profitmandi.service.PartnerStatsService;
|
| 57 |
import com.spice.profitmandi.service.integrations.RazorpayPaymentService;
|
61 |
import com.spice.profitmandi.service.integrations.RazorpayPaymentService;
|
| 58 |
import com.spice.profitmandi.service.integrations.toffee.ToffeeService;
|
62 |
import com.spice.profitmandi.service.integrations.toffee.ToffeeService;
|
| 59 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
63 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
| 60 |
import com.spice.profitmandi.service.inventory.SaholicInventoryService;
|
64 |
import com.spice.profitmandi.service.inventory.SaholicInventoryService;
|
| 61 |
import com.spice.profitmandi.service.order.OrderService;
|
65 |
import com.spice.profitmandi.service.order.OrderService;
|
| Line 94... |
Line 98... |
| 94 |
import org.springframework.transaction.annotation.Transactional;
|
98 |
import org.springframework.transaction.annotation.Transactional;
|
| 95 |
|
99 |
|
| 96 |
import javax.mail.MessagingException;
|
100 |
import javax.mail.MessagingException;
|
| 97 |
import javax.mail.internet.InternetAddress;
|
101 |
import javax.mail.internet.InternetAddress;
|
| 98 |
import javax.mail.internet.MimeMessage;
|
102 |
import javax.mail.internet.MimeMessage;
|
| - |
|
103 |
import java.io.FileOutputStream;
|
| 99 |
import java.io.IOException;
|
104 |
import java.io.IOException;
|
| - |
|
105 |
import java.io.ObjectOutputStream;
|
| 100 |
import java.io.Serializable;
|
106 |
import java.io.Serializable;
|
| 101 |
import java.nio.file.Files;
|
107 |
import java.nio.file.Files;
|
| 102 |
import java.nio.file.Paths;
|
108 |
import java.nio.file.Paths;
|
| 103 |
import java.sql.Timestamp;
|
109 |
import java.sql.Timestamp;
|
| 104 |
import java.time.*;
|
110 |
import java.time.*;
|
| Line 781... |
Line 787... |
| 781 |
|
787 |
|
| 782 |
}
|
788 |
}
|
| 783 |
}
|
789 |
}
|
| 784 |
if (upgradedCount > 0) {
|
790 |
if (upgradedCount > 0) {
|
| 785 |
sendMailHtmlFormat(
|
791 |
sendMailHtmlFormat(
|
| 786 |
new String[] { "amit.gupta@smartdukaan.com", "tarun.verma@smartdukaan.com",
|
792 |
new String[]{"amit.gupta@smartdukaan.com", "tarun.verma@smartdukaan.com",
|
| 787 |
"neeraj.gupta@smartdukaan.com" },
|
793 |
"neeraj.gupta@smartdukaan.com"},
|
| 788 |
sb.toString(), null, "Few Partners Category have been Upgraded");
|
794 |
sb.toString(), null, "Few Partners Category have been Upgraded");
|
| 789 |
} else {
|
795 |
} else {
|
| 790 |
sendMailHtmlFormat(
|
796 |
sendMailHtmlFormat(
|
| 791 |
new String[] { "amit.gupta@smartdukaan.com", "tarun.verma@smartdukaan.com",
|
797 |
new String[]{"amit.gupta@smartdukaan.com", "tarun.verma@smartdukaan.com",
|
| 792 |
"neeraj.gupta@smartdukaan.com" },
|
798 |
"neeraj.gupta@smartdukaan.com"},
|
| 793 |
sb.toString(), null, "No partners Category have been upgraded today");
|
799 |
sb.toString(), null, "No partners Category have been upgraded today");
|
| 794 |
}
|
800 |
}
|
| 795 |
}
|
801 |
}
|
| 796 |
|
802 |
|
| - |
|
803 |
@Autowired
|
| - |
|
804 |
private PartnerStatsService partnerStatsService;
|
| - |
|
805 |
private ReporticoCacheTableRepository reporticoCacheTableRepository;
|
| - |
|
806 |
|
| - |
|
807 |
public void fetchParnterStats() throws Exception {
|
| - |
|
808 |
Map<Integer, PartnerDetailModel> partnerStats = partnerStatsService.getAllPartnerStats();
|
| - |
|
809 |
ObjectOutputStream oos = null;
|
| - |
|
810 |
FileOutputStream fout = null;
|
| - |
|
811 |
try {
|
| - |
|
812 |
fout = new FileOutputStream("/tmp/partnerStat.tmp", false);
|
| - |
|
813 |
oos = new ObjectOutputStream(fout);
|
| - |
|
814 |
oos.writeObject(partnerStats);
|
| - |
|
815 |
|
| - |
|
816 |
} catch (Exception ex) {
|
| - |
|
817 |
ex.printStackTrace();
|
| - |
|
818 |
} finally {
|
| - |
|
819 |
if (oos != null) {
|
| - |
|
820 |
oos.close();
|
| - |
|
821 |
}
|
| - |
|
822 |
}
|
| - |
|
823 |
ReporticoCacheTable rct = reporticoCacheTableRepository.selectByTableName("partnerStat");
|
| - |
|
824 |
if (rct == null) {
|
| - |
|
825 |
rct = new ReporticoCacheTable();
|
| - |
|
826 |
rct.setTableName("partnerStat");
|
| - |
|
827 |
|
| - |
|
828 |
}
|
| - |
|
829 |
rct.setLastCreatedTimestamp(LocalDateTime.now());
|
| - |
|
830 |
reporticoCacheTableRepository.persist(rct);
|
| - |
|
831 |
}
|
| - |
|
832 |
|
| 797 |
private class SaleRoles {
|
833 |
private class SaleRoles {
|
| 798 |
|
834 |
|
| 799 |
private List<String> l1;
|
835 |
private List<String> l1;
|
| 800 |
private List<String> l2;
|
836 |
private List<String> l2;
|
| 801 |
|
837 |
|