Subversion Repositories SmartDukaan

Rev

Rev 34724 | Rev 34730 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 34724 Rev 34729
Line 2... Line 2...
2
 
2
 
3
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
3
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
4
import com.spice.profitmandi.common.model.BrandStockPrice;
4
import com.spice.profitmandi.common.model.BrandStockPrice;
5
import com.spice.profitmandi.common.model.CustomRetailer;
5
import com.spice.profitmandi.common.model.CustomRetailer;
6
import com.spice.profitmandi.common.model.ProfitMandiConstants;
6
import com.spice.profitmandi.common.model.ProfitMandiConstants;
7
import com.spice.profitmandi.common.util.FileUtil;
-
 
8
import com.spice.profitmandi.common.util.FormattingUtils;
7
import com.spice.profitmandi.common.util.FormattingUtils;
9
import com.spice.profitmandi.common.util.Utils;
8
import com.spice.profitmandi.common.util.Utils;
10
import com.spice.profitmandi.dao.cart.CartService;
-
 
11
import com.spice.profitmandi.dao.cart.SmartCartService;
9
import com.spice.profitmandi.dao.cart.SmartCartService;
12
import com.spice.profitmandi.dao.entity.auth.AuthUser;
10
import com.spice.profitmandi.dao.entity.auth.AuthUser;
13
import com.spice.profitmandi.dao.entity.fofo.*;
11
import com.spice.profitmandi.dao.entity.fofo.*;
14
import com.spice.profitmandi.dao.entity.logistics.AST;
12
import com.spice.profitmandi.dao.entity.logistics.AST;
15
import com.spice.profitmandi.dao.entity.logistics.ASTRepository;
13
import com.spice.profitmandi.dao.entity.logistics.ASTRepository;
16
import com.spice.profitmandi.dao.entity.logistics.AreaRepository;
-
 
17
import com.spice.profitmandi.dao.entity.transaction.*;
14
import com.spice.profitmandi.dao.entity.transaction.*;
18
import com.spice.profitmandi.dao.entity.user.User;
15
import com.spice.profitmandi.dao.entity.user.User;
19
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
16
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
20
import com.spice.profitmandi.dao.enumuration.transaction.LoanReferenceType;
17
import com.spice.profitmandi.dao.enumuration.transaction.LoanReferenceType;
21
import com.spice.profitmandi.dao.model.*;
18
import com.spice.profitmandi.dao.model.*;
Line 37... Line 34...
37
import org.apache.commons.io.output.ByteArrayOutputStream;
34
import org.apache.commons.io.output.ByteArrayOutputStream;
38
import org.apache.logging.log4j.LogManager;
35
import org.apache.logging.log4j.LogManager;
39
import org.apache.logging.log4j.Logger;
36
import org.apache.logging.log4j.Logger;
40
import org.apache.poi.common.usermodel.HyperlinkType;
37
import org.apache.poi.common.usermodel.HyperlinkType;
41
import org.apache.poi.ss.usermodel.*;
38
import org.apache.poi.ss.usermodel.*;
42
import org.apache.poi.xssf.usermodel.XSSFColor;
-
 
43
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
39
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
44
import org.springframework.beans.factory.annotation.Autowired;
40
import org.springframework.beans.factory.annotation.Autowired;
45
import org.springframework.beans.factory.annotation.Qualifier;
41
import org.springframework.beans.factory.annotation.Qualifier;
46
import org.springframework.beans.factory.annotation.Value;
-
 
47
import org.springframework.core.io.ByteArrayResource;
42
import org.springframework.core.io.ByteArrayResource;
48
import org.springframework.mail.javamail.JavaMailSender;
43
import org.springframework.mail.javamail.JavaMailSender;
49
import org.springframework.mail.javamail.MimeMessageHelper;
44
import org.springframework.mail.javamail.MimeMessageHelper;
50
import org.springframework.stereotype.Component;
45
import org.springframework.stereotype.Component;
51
import org.springframework.transaction.annotation.Transactional;
46
import org.springframework.transaction.annotation.Transactional;
Line 57... Line 52...
57
import java.math.BigDecimal;
52
import java.math.BigDecimal;
58
import java.time.*;
53
import java.time.*;
59
import java.time.temporal.ChronoUnit;
54
import java.time.temporal.ChronoUnit;
60
import java.util.*;
55
import java.util.*;
61
import java.util.stream.Collectors;
56
import java.util.stream.Collectors;
62
import java.util.stream.Stream;
-
 
63
 
57
 
64
@Component
58
@Component
65
@Transactional(rollbackFor = {Throwable.class, ProfitMandiBusinessException.class})
59
@Transactional(rollbackFor = {Throwable.class, ProfitMandiBusinessException.class})
66
public class ScheduledTasksTest {
60
public class ScheduledTasksTest {
67
 
61
 
Line 462... Line 456...
462
 
456
 
463
        List<Integer> retailerIds = Arrays.asList(175139615,175139391,175135707,175139854,175139302,175139710,175139749);
457
        List<Integer> retailerIds = Arrays.asList(175139615,175139391,175135707,175139854,175139302,175139710,175139749);
464
        Map<Integer,CustomRetailer> customRetailers = retailerService.getFofoRetailers(retailerIds);
458
        Map<Integer,CustomRetailer> customRetailers = retailerService.getFofoRetailers(retailerIds);
465
 
459
 
466
        //partner daily investment
460
        //partner daily investment
467
        List<Loan> defaultLoans = sdCreditService.getDefaultLoan();
461
        List<Loan> defaultLoans = sdCreditService.getDefaultLoans();
468
        Map<Integer,List<Loan>> defaultLoanMap = defaultLoans.stream().collect(Collectors.groupingBy(Loan::getFofoId));
462
        Map<Integer,List<Loan>> defaultLoanMap = defaultLoans.stream().collect(Collectors.groupingBy(Loan::getFofoId));
469
 
463
 
470
        Map<Integer, PartnerDailyInvestment> partnerDailyInvestmentMap = new HashMap<>();
464
        Map<Integer, PartnerDailyInvestment> partnerDailyInvestmentMap = new HashMap<>();
471
        List<PartnerDailyInvestment> partnerDailyInvestments = partnerDailyInvestmentRepository
465
        List<PartnerDailyInvestment> partnerDailyInvestments = partnerDailyInvestmentRepository
472
                .selectAll(new ArrayList<>(retailerIds), LocalDate.now().minusDays(1));
466
                .selectAll(new ArrayList<>(retailerIds), LocalDate.now().minusDays(1));