Subversion Repositories SmartDukaan

Rev

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

Rev 33634 Rev 33704
Line 57... Line 57...
57
import javax.persistence.criteria.CriteriaBuilder;
57
import javax.persistence.criteria.CriteriaBuilder;
58
import javax.persistence.criteria.CriteriaQuery;
58
import javax.persistence.criteria.CriteriaQuery;
59
import javax.persistence.criteria.Predicate;
59
import javax.persistence.criteria.Predicate;
60
import javax.persistence.criteria.Root;
60
import javax.persistence.criteria.Root;
61
import java.text.MessageFormat;
61
import java.text.MessageFormat;
62
import java.time.LocalDate;
-
 
63
import java.time.LocalDateTime;
-
 
64
import java.time.LocalTime;
-
 
65
import java.time.YearMonth;
62
import java.time.*;
66
import java.util.*;
63
import java.util.*;
67
import java.util.stream.Collectors;
64
import java.util.stream.Collectors;
68
 
65
 
69
@Component
66
@Component
70
public class SchemeServiceImpl implements SchemeService {
67
public class SchemeServiceImpl implements SchemeService {
Line 1052... Line 1049...
1052
    public Scheme getStaticScheme(int fofoId) throws ProfitMandiBusinessException {
1049
    public Scheme getStaticScheme(int fofoId) throws ProfitMandiBusinessException {
1053
        FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
1050
        FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
1054
        Scheme scheme = null;
1051
        Scheme scheme = null;
1055
        if (fofoStore.getTarget() > 0) {
1052
        if (fofoStore.getTarget() > 0) {
1056
            scheme = new Scheme();
1053
            scheme = new Scheme();
1057
            scheme.setName("Super Retailer Club");
1054
            scheme.setName("Super Retailer - Club 3");
1058
            scheme.setStartDateTime(LocalDate.of(2024, 2, 1).atStartOfDay());
1055
            scheme.setStartDateTime(LocalDate.of(2024, 8, 1).atStartOfDay());
1059
            scheme.setEndDateTime(LocalDate.of(2024, 6, 30).atTime(LocalTime.MAX));
1056
            scheme.setEndDateTime(LocalDate.of(2024, 11, 30).atTime(LocalTime.MAX));
1060
            scheme.setTarget(fofoStore.getTarget());
1057
            scheme.setTarget(fofoStore.getTarget());
1061
 
1058
 
1062
            if (scheme.getEndDateTime().isBefore(LocalDateTime.now())) return null;
1059
            if (scheme.getEndDateTime().plusDays(5).isBefore(LocalDateTime.now())) return null;
1063
        }
1060
        }
1064
        return scheme;
1061
        return scheme;
1065
    }
1062
    }
1066
 
1063
 
1067
    @Override
1064
    @Override