| Line 31... |
Line 31... |
| 31 |
|
31 |
|
| 32 |
import com.spice.profitmandi.common.enumuration.ItemType;
|
32 |
import com.spice.profitmandi.common.enumuration.ItemType;
|
| 33 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
33 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 34 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
34 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 35 |
import com.spice.profitmandi.common.model.SchemeModel;
|
35 |
import com.spice.profitmandi.common.model.SchemeModel;
|
| - |
|
36 |
import com.spice.profitmandi.common.services.ReporticoService;
|
| 36 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
37 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
| 37 |
import com.spice.profitmandi.common.util.StringUtils;
|
38 |
import com.spice.profitmandi.common.util.StringUtils;
|
| 38 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
39 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| 39 |
import com.spice.profitmandi.dao.entity.catalog.RetailerScheme;
|
- |
|
| 40 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
40 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
| 41 |
import com.spice.profitmandi.dao.entity.fofo.ActivatedImei;
|
41 |
import com.spice.profitmandi.dao.entity.fofo.ActivatedImei;
|
| 42 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
|
42 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
|
| 43 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
43 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
| 44 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
44 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
| Line 59... |
Line 59... |
| 59 |
import com.spice.profitmandi.dao.repository.fofo.ActivatedImeiRepository;
|
59 |
import com.spice.profitmandi.dao.repository.fofo.ActivatedImeiRepository;
|
| 60 |
import com.spice.profitmandi.dao.repository.fofo.FofoLineItemRepository;
|
60 |
import com.spice.profitmandi.dao.repository.fofo.FofoLineItemRepository;
|
| 61 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
|
61 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
|
| 62 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderRepository;
|
62 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderRepository;
|
| 63 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
63 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
| - |
|
64 |
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
|
| 64 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
65 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
| 65 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseRepository;
|
66 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseRepository;
|
| 66 |
import com.spice.profitmandi.dao.repository.fofo.ScanRecordRepository;
|
67 |
import com.spice.profitmandi.dao.repository.fofo.ScanRecordRepository;
|
| 67 |
import com.spice.profitmandi.dao.repository.fofo.SchemeInOutRepository;
|
68 |
import com.spice.profitmandi.dao.repository.fofo.SchemeInOutRepository;
|
| 68 |
import com.spice.profitmandi.dao.repository.fofo.SchemeItemRepository;
|
69 |
import com.spice.profitmandi.dao.repository.fofo.SchemeItemRepository;
|
| Line 91... |
Line 92... |
| 91 |
@Autowired
|
92 |
@Autowired
|
| 92 |
private PurchaseService purchaseService;
|
93 |
private PurchaseService purchaseService;
|
| 93 |
|
94 |
|
| 94 |
@Autowired
|
95 |
@Autowired
|
| 95 |
private ScanRecordRepository scanRecordRepository;
|
96 |
private ScanRecordRepository scanRecordRepository;
|
| - |
|
97 |
|
| - |
|
98 |
@Autowired
|
| - |
|
99 |
private PartnerDailyInvestmentRepository partnerDailyInvestmentRepository;
|
| - |
|
100 |
|
| - |
|
101 |
|
| 96 |
|
102 |
|
| 97 |
@Autowired
|
103 |
@Autowired
|
| 98 |
private SessionFactory sessionFactory;
|
104 |
private SessionFactory sessionFactory;
|
| 99 |
|
105 |
|
| 100 |
private Set<Integer> tagIds = new HashSet<Integer>(Arrays.asList(4));
|
106 |
private Set<Integer> tagIds = new HashSet<Integer>(Arrays.asList(4));
|
| Line 108... |
Line 114... |
| 108 |
@Autowired
|
114 |
@Autowired
|
| 109 |
private RoleManager roleManager;
|
115 |
private RoleManager roleManager;
|
| 110 |
|
116 |
|
| 111 |
@Autowired
|
117 |
@Autowired
|
| 112 |
private RetailerRepository retailerRepository;
|
118 |
private RetailerRepository retailerRepository;
|
| - |
|
119 |
|
| - |
|
120 |
@Autowired
|
| - |
|
121 |
private ReporticoService reporticoService;
|
| 113 |
|
122 |
|
| - |
|
123 |
|
| 114 |
@Autowired
|
124 |
@Autowired
|
| 115 |
private TagListingRepository tagListingRepository;
|
125 |
private TagListingRepository tagListingRepository;
|
| 116 |
|
126 |
|
| 117 |
@Autowired
|
127 |
@Autowired
|
| 118 |
private SchemeInOutRepository schemeInOutRepository;
|
128 |
private SchemeInOutRepository schemeInOutRepository;
|
| Line 202... |
Line 212... |
| 202 |
scheme.setEndDateTime(createSchemeRequest.getEndDate());
|
212 |
scheme.setEndDateTime(createSchemeRequest.getEndDate());
|
| 203 |
scheme.setCreatedBy(creatorId);
|
213 |
scheme.setCreatedBy(creatorId);
|
| 204 |
scheme.setCashback(createSchemeRequest.isCashback());
|
214 |
scheme.setCashback(createSchemeRequest.isCashback());
|
| 205 |
return scheme;
|
215 |
return scheme;
|
| 206 |
}
|
216 |
}
|
| - |
|
217 |
|
| - |
|
218 |
|
| 207 |
|
219 |
|
| 208 |
private void validateItemIds(CreateSchemeRequest createSchemeRequest) throws ProfitMandiBusinessException {
|
220 |
private void validateItemIds(CreateSchemeRequest createSchemeRequest) throws ProfitMandiBusinessException {
|
| 209 |
if (createSchemeRequest.getItemIds() == null || createSchemeRequest.getItemIds().isEmpty()) {
|
221 |
if (createSchemeRequest.getItemIds() == null || createSchemeRequest.getItemIds().isEmpty()) {
|
| 210 |
throw new ProfitMandiBusinessException(ProfitMandiConstants.ITEM_ID, createSchemeRequest.getItemIds(),
|
222 |
throw new ProfitMandiBusinessException(ProfitMandiConstants.ITEM_ID, createSchemeRequest.getItemIds(),
|
| 211 |
"SCHM_1003");
|
223 |
"SCHM_1003");
|