| Line 38... |
Line 38... |
| 38 |
import com.spice.profitmandi.common.util.FileUtil;
|
38 |
import com.spice.profitmandi.common.util.FileUtil;
|
| 39 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
39 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
| 40 |
import com.spice.profitmandi.common.util.Utils;
|
40 |
import com.spice.profitmandi.common.util.Utils;
|
| 41 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
41 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| 42 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
42 |
import com.spice.profitmandi.dao.entity.catalog.Scheme;
|
| - |
|
43 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| 43 |
import com.spice.profitmandi.dao.entity.fofo.CurrentInventorySnapshot;
|
44 |
import com.spice.profitmandi.dao.entity.fofo.CurrentInventorySnapshot;
|
| 44 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
|
45 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
|
| 45 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
|
46 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
|
| 46 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
47 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 47 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
48 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
| Line 61... |
Line 62... |
| 61 |
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
|
62 |
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
|
| 62 |
import com.spice.profitmandi.dao.entity.user.Address;
|
63 |
import com.spice.profitmandi.dao.entity.user.Address;
|
| 63 |
import com.spice.profitmandi.dao.entity.user.User;
|
64 |
import com.spice.profitmandi.dao.entity.user.User;
|
| 64 |
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
|
65 |
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
|
| 65 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
66 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
| - |
|
67 |
import com.spice.profitmandi.dao.model.ContentPojo;
|
| - |
|
68 |
import com.spice.profitmandi.dao.model.MediaPojo;
|
| 66 |
import com.spice.profitmandi.dao.repository.GenericRepository;
|
69 |
import com.spice.profitmandi.dao.repository.GenericRepository;
|
| 67 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
70 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| 68 |
import com.spice.profitmandi.dao.repository.catalog.SchemeRepository;
|
71 |
import com.spice.profitmandi.dao.repository.catalog.SchemeRepository;
|
| - |
|
72 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
| 69 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
73 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| 70 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
74 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| - |
|
75 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
| 71 |
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
|
76 |
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
|
| 72 |
import com.spice.profitmandi.dao.repository.fofo.DebitNoteRepository;
|
77 |
import com.spice.profitmandi.dao.repository.fofo.DebitNoteRepository;
|
| 73 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
|
78 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
|
| 74 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderRepository;
|
79 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderRepository;
|
| 75 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
80 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
| Line 119... |
Line 124... |
| 119 |
|
124 |
|
| 120 |
@Autowired
|
125 |
@Autowired
|
| 121 |
private CsService csService;
|
126 |
private CsService csService;
|
| 122 |
|
127 |
|
| 123 |
@Autowired
|
128 |
@Autowired
|
| - |
|
129 |
private Mongo mongoClient;
|
| - |
|
130 |
|
| - |
|
131 |
@Autowired
|
| 124 |
private SamsungIMEIActivationService samsungActivationService;
|
132 |
private SamsungIMEIActivationService samsungActivationService;
|
| 125 |
|
133 |
|
| 126 |
@Autowired
|
134 |
@Autowired
|
| 127 |
private PrebookingOrderRepository prebookingOrderRepository;
|
135 |
private PrebookingOrderRepository prebookingOrderRepository;
|
| 128 |
|
136 |
|
| Line 195... |
Line 203... |
| 195 |
|
203 |
|
| 196 |
@Autowired
|
204 |
@Autowired
|
| 197 |
private InventoryItemRepository inventoryItemRepository;
|
205 |
private InventoryItemRepository inventoryItemRepository;
|
| 198 |
|
206 |
|
| 199 |
@Autowired
|
207 |
@Autowired
|
| - |
|
208 |
private TagListingRepository tagListingRepository;
|
| - |
|
209 |
|
| - |
|
210 |
@Autowired
|
| 200 |
private InvoiceNumberGenerationSequenceRepository invoiceNumberGenerationSequenceRepository;
|
211 |
private InvoiceNumberGenerationSequenceRepository invoiceNumberGenerationSequenceRepository;
|
| 201 |
|
212 |
|
| 202 |
@Autowired
|
213 |
@Autowired
|
| 203 |
private RetailerService retailerService;
|
214 |
private RetailerService retailerService;
|
| 204 |
|
215 |
|
| Line 233... |
Line 244... |
| 233 |
private ScanRecordRepository scanRecordRepository;
|
244 |
private ScanRecordRepository scanRecordRepository;
|
| 234 |
|
245 |
|
| 235 |
@Autowired
|
246 |
@Autowired
|
| 236 |
private JavaMailSender mailSender;
|
247 |
private JavaMailSender mailSender;
|
| 237 |
|
248 |
|
| 238 |
|
- |
|
| 239 |
public void populateGrnTimestamp() {
|
249 |
public void populateGrnTimestamp() {
|
| 240 |
List<Purchase> allPurchases = purchaseRepository.selectAll();
|
250 |
List<Purchase> allPurchases = purchaseRepository.selectAll();
|
| 241 |
for (Purchase p : allPurchases) {
|
251 |
for (Purchase p : allPurchases) {
|
| 242 |
String invoiceNumber = p.getPurchaseReference();
|
252 |
String invoiceNumber = p.getPurchaseReference();
|
| 243 |
if (p.getCompleteTimestamp() == null) {
|
253 |
if (p.getCompleteTimestamp() == null) {
|
| Line 255... |
Line 265... |
| 255 |
|
265 |
|
| 256 |
}
|
266 |
}
|
| 257 |
|
267 |
|
| 258 |
public void fetchImeiActivation(int ym) throws Exception {
|
268 |
public void fetchImeiActivation(int ym) throws Exception {
|
| 259 |
LocalDate endDate = LocalDate.now().minusMonths(ym);
|
269 |
LocalDate endDate = LocalDate.now().minusMonths(ym);
|
| 260 |
samsungActivationService.getActivationsBetweenNew(endDate.withDayOfMonth(1), endDate.withDayOfMonth(endDate.lengthOfMonth()));
|
270 |
samsungActivationService.getActivationsBetweenNew(endDate.withDayOfMonth(1),
|
| - |
|
271 |
endDate.withDayOfMonth(endDate.lengthOfMonth()));
|
| 261 |
}
|
272 |
}
|
| 262 |
|
273 |
|
| 263 |
public void migarateLineItemsToNewTable() throws Exception {
|
274 |
public void migarateLineItemsToNewTable() throws Exception {
|
| 264 |
LOGGER.info("Before Migrated LineItems Successfully");
|
275 |
LOGGER.info("Before Migrated LineItems Successfully");
|
| 265 |
int lineItemImeiId = 0;
|
276 |
int lineItemImeiId = 0;
|
| Line 776... |
Line 787... |
| 776 |
|
787 |
|
| 777 |
}
|
788 |
}
|
| 778 |
}
|
789 |
}
|
| 779 |
// throw new Exception();
|
790 |
// throw new Exception();
|
| 780 |
}
|
791 |
}
|
| - |
|
792 |
|
| - |
|
793 |
public void mongom() {
|
| - |
|
794 |
List<TagListing> tls = tagListingRepository.selectAll(false);
|
| - |
|
795 |
Set<Integer> itemIds = tls.stream().map(x -> x.getItemId()).collect(Collectors.toSet());
|
| - |
|
796 |
Set<Integer> catalogIds = itemRepository.selectByIds(itemIds).stream().map(x -> x.getCatalogItemId())
|
| - |
|
797 |
.collect(Collectors.toSet());
|
| - |
|
798 |
for (int catalogId : catalogIds) {
|
| - |
|
799 |
try {
|
| - |
|
800 |
ContentPojo cp = mongoClient.getEntityById(catalogId);
|
| - |
|
801 |
cp.setIconImageUrl(cp.getIconImageUrl().replace("saholic", "smartdukaan"));
|
| - |
|
802 |
cp.setDefaultImageUrl(cp.getDefaultImageUrl().replace("saholic", "smartdukaan"));
|
| - |
|
803 |
List<MediaPojo> mPojos = cp.getImages();
|
| - |
|
804 |
mPojos.stream().forEach(mPojo -> {
|
| - |
|
805 |
mPojo.setUrl(mPojo.getUrl().replace("saholic", "smartdukaan"));
|
| - |
|
806 |
});
|
| - |
|
807 |
mongoClient.persistEntity(cp);
|
| - |
|
808 |
} catch (Exception e) {
|
| - |
|
809 |
continue;
|
| - |
|
810 |
}
|
| - |
|
811 |
}
|
| - |
|
812 |
}
|
| 781 |
}
|
813 |
}
|
| 782 |
|
814 |
|
| 783 |
//7015845171
|
815 |
//7015845171
|
| 784 |
|
816 |
|