| Line 36... |
Line 36... |
| 36 |
import org.springframework.core.io.ByteArrayResource;
|
36 |
import org.springframework.core.io.ByteArrayResource;
|
| 37 |
import org.springframework.mail.javamail.JavaMailSender;
|
37 |
import org.springframework.mail.javamail.JavaMailSender;
|
| 38 |
import org.springframework.stereotype.Component;
|
38 |
import org.springframework.stereotype.Component;
|
| 39 |
import org.springframework.transaction.annotation.Transactional;
|
39 |
import org.springframework.transaction.annotation.Transactional;
|
| 40 |
|
40 |
|
| - |
|
41 |
import com.google.gson.Gson;
|
| 41 |
import com.smartdukaan.cron.scheduled.SamsungIMEIActivationService;
|
42 |
import com.smartdukaan.cron.scheduled.SamsungIMEIActivationService;
|
| 42 |
import com.smartdukaan.cron.scheduled.ScheduledTasks;
|
43 |
import com.smartdukaan.cron.scheduled.ScheduledTasks;
|
| 43 |
import com.spice.profitmandi.common.enumuration.ItemType;
|
44 |
import com.spice.profitmandi.common.enumuration.ItemType;
|
| 44 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
45 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 45 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
46 |
import com.spice.profitmandi.common.model.CustomRetailer;
|
| 46 |
import com.spice.profitmandi.common.util.FileUtil;
|
47 |
import com.spice.profitmandi.common.util.FileUtil;
|
| 47 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
48 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
| 48 |
import com.spice.profitmandi.common.util.Utils;
|
49 |
import com.spice.profitmandi.common.util.Utils;
|
| 49 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
50 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| - |
|
51 |
import com.spice.profitmandi.dao.entity.catalog.Offer;
|
| 50 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
52 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
| 51 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
53 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| 52 |
import com.spice.profitmandi.dao.entity.dtr.PaymentOptionTransaction;
|
54 |
import com.spice.profitmandi.dao.entity.dtr.PaymentOptionTransaction;
|
| 53 |
import com.spice.profitmandi.dao.entity.fofo.CurrentInventorySnapshot;
|
55 |
import com.spice.profitmandi.dao.entity.fofo.CurrentInventorySnapshot;
|
| 54 |
import com.spice.profitmandi.dao.entity.fofo.DebitNote;
|
56 |
import com.spice.profitmandi.dao.entity.fofo.DebitNote;
|
| Line 83... |
Line 85... |
| 83 |
import com.spice.profitmandi.dao.model.ContentPojo;
|
85 |
import com.spice.profitmandi.dao.model.ContentPojo;
|
| 84 |
import com.spice.profitmandi.dao.model.CreateOfferRequest;
|
86 |
import com.spice.profitmandi.dao.model.CreateOfferRequest;
|
| 85 |
import com.spice.profitmandi.dao.model.MediaPojo;
|
87 |
import com.spice.profitmandi.dao.model.MediaPojo;
|
| 86 |
import com.spice.profitmandi.dao.repository.GenericRepository;
|
88 |
import com.spice.profitmandi.dao.repository.GenericRepository;
|
| 87 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
89 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| - |
|
90 |
import com.spice.profitmandi.dao.repository.catalog.OfferRepository;
|
| 88 |
import com.spice.profitmandi.dao.repository.catalog.SchemeRepository;
|
91 |
import com.spice.profitmandi.dao.repository.catalog.SchemeRepository;
|
| 89 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
92 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
| 90 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
93 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| 91 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
94 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 92 |
import com.spice.profitmandi.dao.repository.dtr.LeadRepository;
|
95 |
import com.spice.profitmandi.dao.repository.dtr.LeadRepository;
|
| Line 121... |
Line 124... |
| 121 |
import com.spice.profitmandi.dao.repository.warehouse.WarehouseInventoryItemRepository;
|
124 |
import com.spice.profitmandi.dao.repository.warehouse.WarehouseInventoryItemRepository;
|
| 122 |
import com.spice.profitmandi.dao.repository.warehouse.WarehouseScanRepository;
|
125 |
import com.spice.profitmandi.dao.repository.warehouse.WarehouseScanRepository;
|
| 123 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
126 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
| 124 |
import com.spice.profitmandi.service.inventory.PurchaseService;
|
127 |
import com.spice.profitmandi.service.inventory.PurchaseService;
|
| 125 |
import com.spice.profitmandi.service.offers.OfferService;
|
128 |
import com.spice.profitmandi.service.offers.OfferService;
|
| - |
|
129 |
import com.spice.profitmandi.service.offers.PartnerCriteria;
|
| 126 |
import com.spice.profitmandi.service.order.OrderService;
|
130 |
import com.spice.profitmandi.service.order.OrderService;
|
| 127 |
import com.spice.profitmandi.service.pricing.PriceDropService;
|
131 |
import com.spice.profitmandi.service.pricing.PriceDropService;
|
| 128 |
import com.spice.profitmandi.service.scheme.SchemeService;
|
132 |
import com.spice.profitmandi.service.scheme.SchemeService;
|
| 129 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
133 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
| 130 |
import com.spice.profitmandi.service.user.RetailerService;
|
134 |
import com.spice.profitmandi.service.user.RetailerService;
|
| Line 155... |
Line 159... |
| 155 |
@Autowired
|
159 |
@Autowired
|
| 156 |
private SaholicInventorySnapshotRepository saholicInventorySnapshotRepository;
|
160 |
private SaholicInventorySnapshotRepository saholicInventorySnapshotRepository;
|
| 157 |
|
161 |
|
| 158 |
@Autowired
|
162 |
@Autowired
|
| 159 |
private CsService csService;
|
163 |
private CsService csService;
|
| - |
|
164 |
|
| - |
|
165 |
@Autowired
|
| - |
|
166 |
private OfferRepository offerRepository;
|
| 160 |
|
167 |
|
| 161 |
@Autowired
|
168 |
@Autowired
|
| 162 |
private Mongo mongoClient;
|
169 |
private Mongo mongoClient;
|
| 163 |
|
170 |
|
| 164 |
@Autowired
|
171 |
@Autowired
|
| - |
|
172 |
private Gson gson;
|
| - |
|
173 |
|
| - |
|
174 |
@Autowired
|
| 165 |
private PaymentOptionTransactionRepository paymentOptionTransactionRepository;
|
175 |
private PaymentOptionTransactionRepository paymentOptionTransactionRepository;
|
| 166 |
|
176 |
|
| 167 |
@Autowired
|
177 |
@Autowired
|
| 168 |
private SamsungIMEIActivationService samsungActivationService;
|
178 |
private SamsungIMEIActivationService samsungActivationService;
|
| 169 |
|
179 |
|
| Line 1276... |
Line 1286... |
| 1276 |
|
1286 |
|
| 1277 |
}
|
1287 |
}
|
| 1278 |
|
1288 |
|
| 1279 |
}
|
1289 |
}
|
| 1280 |
|
1290 |
|
| - |
|
1291 |
public void fixOffer() {
|
| - |
|
1292 |
List<Integer> offerIds = Arrays.asList(228, 241,242, 243,244, 253);
|
| - |
|
1293 |
List<Integer> fofoIds = fofoStoreRepository.selectAll().stream().filter(x->x.getWarehouseId()==7673).map(x->x.getId()).collect(Collectors.toList());
|
| - |
|
1294 |
for(int offerId : offerIds) {
|
| - |
|
1295 |
Offer offer = offerRepository.selectById(offerId);
|
| - |
|
1296 |
|
| - |
|
1297 |
PartnerCriteria partnerCriteria = gson.fromJson(offer.getPartnerCriteria(), PartnerCriteria.class);
|
| - |
|
1298 |
for (int fofoId : fofoIds) {
|
| - |
|
1299 |
if(partnerCriteria.getFofoIds().contains(fofoId)) {
|
| - |
|
1300 |
partnerCriteria.getFofoIds().remove(fofoId);
|
| - |
|
1301 |
}
|
| - |
|
1302 |
}
|
| - |
|
1303 |
offer.setPartnerCriteria(gson.toJson(partnerCriteria));
|
| - |
|
1304 |
}
|
| - |
|
1305 |
}
|
| - |
|
1306 |
|
| 1281 |
}
|
1307 |
}
|
| 1282 |
|
1308 |
|
| 1283 |
//7015845171
|
1309 |
//7015845171
|
| 1284 |
|
1310 |
|