| Line 40... |
Line 40... |
| 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.catalog.TagListing;
|
| 44 |
import com.spice.profitmandi.dao.entity.fofo.CurrentInventorySnapshot;
|
44 |
import com.spice.profitmandi.dao.entity.fofo.CurrentInventorySnapshot;
|
| - |
|
45 |
import com.spice.profitmandi.dao.entity.fofo.DebitNote;
|
| 45 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
|
46 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
|
| 46 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
|
47 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
|
| 47 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
48 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 48 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
49 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
| 49 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
|
50 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
|
| 50 |
import com.spice.profitmandi.dao.entity.fofo.PrebookingOrder;
|
51 |
import com.spice.profitmandi.dao.entity.fofo.PrebookingOrder;
|
| 51 |
import com.spice.profitmandi.dao.entity.fofo.Purchase;
|
52 |
import com.spice.profitmandi.dao.entity.fofo.Purchase;
|
| - |
|
53 |
import com.spice.profitmandi.dao.entity.fofo.PurchaseReturnItem;
|
| 52 |
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
|
54 |
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
|
| 53 |
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
|
55 |
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
|
| 54 |
import com.spice.profitmandi.dao.entity.fofo.SchemeItem;
|
56 |
import com.spice.profitmandi.dao.entity.fofo.SchemeItem;
|
| 55 |
import com.spice.profitmandi.dao.entity.fofo.TargetSlab;
|
57 |
import com.spice.profitmandi.dao.entity.fofo.TargetSlab;
|
| 56 |
import com.spice.profitmandi.dao.entity.inventory.SaholicInventorySnapshot;
|
58 |
import com.spice.profitmandi.dao.entity.inventory.SaholicInventorySnapshot;
|
| Line 62... |
Line 64... |
| 62 |
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
|
64 |
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
|
| 63 |
import com.spice.profitmandi.dao.entity.user.Address;
|
65 |
import com.spice.profitmandi.dao.entity.user.Address;
|
| 64 |
import com.spice.profitmandi.dao.entity.user.User;
|
66 |
import com.spice.profitmandi.dao.entity.user.User;
|
| 65 |
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
|
67 |
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
|
| 66 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
68 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
| - |
|
69 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
| 67 |
import com.spice.profitmandi.dao.model.ContentPojo;
|
70 |
import com.spice.profitmandi.dao.model.ContentPojo;
|
| 68 |
import com.spice.profitmandi.dao.model.MediaPojo;
|
71 |
import com.spice.profitmandi.dao.model.MediaPojo;
|
| 69 |
import com.spice.profitmandi.dao.repository.GenericRepository;
|
72 |
import com.spice.profitmandi.dao.repository.GenericRepository;
|
| 70 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
73 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| 71 |
import com.spice.profitmandi.dao.repository.catalog.SchemeRepository;
|
74 |
import com.spice.profitmandi.dao.repository.catalog.SchemeRepository;
|
| Line 80... |
Line 83... |
| 80 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
83 |
import com.spice.profitmandi.dao.repository.fofo.InventoryItemRepository;
|
| 81 |
import com.spice.profitmandi.dao.repository.fofo.InvoiceNumberGenerationSequenceRepository;
|
84 |
import com.spice.profitmandi.dao.repository.fofo.InvoiceNumberGenerationSequenceRepository;
|
| 82 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTargetRepository;
|
85 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTargetRepository;
|
| 83 |
import com.spice.profitmandi.dao.repository.fofo.PrebookingOrderRepository;
|
86 |
import com.spice.profitmandi.dao.repository.fofo.PrebookingOrderRepository;
|
| 84 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseRepository;
|
87 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseRepository;
|
| - |
|
88 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseReturnItemRepository;
|
| 85 |
import com.spice.profitmandi.dao.repository.fofo.ScanRecordRepository;
|
89 |
import com.spice.profitmandi.dao.repository.fofo.ScanRecordRepository;
|
| 86 |
import com.spice.profitmandi.dao.repository.fofo.SchemeInOutRepository;
|
90 |
import com.spice.profitmandi.dao.repository.fofo.SchemeInOutRepository;
|
| 87 |
import com.spice.profitmandi.dao.repository.fofo.SchemeItemRepository;
|
91 |
import com.spice.profitmandi.dao.repository.fofo.SchemeItemRepository;
|
| 88 |
import com.spice.profitmandi.dao.repository.fofo.TargetSlabRepository;
|
92 |
import com.spice.profitmandi.dao.repository.fofo.TargetSlabRepository;
|
| 89 |
import com.spice.profitmandi.dao.repository.fofo.TargetSlabRepositoryImpl;
|
93 |
import com.spice.profitmandi.dao.repository.fofo.TargetSlabRepositoryImpl;
|
| Line 118... |
Line 122... |
| 118 |
|
122 |
|
| 119 |
@Autowired
|
123 |
@Autowired
|
| 120 |
private LineItemRepository lineItemRepository;
|
124 |
private LineItemRepository lineItemRepository;
|
| 121 |
|
125 |
|
| 122 |
@Autowired
|
126 |
@Autowired
|
| - |
|
127 |
private PurchaseReturnItemRepository purchaseReturnItemRepository;
|
| - |
|
128 |
|
| - |
|
129 |
@Autowired
|
| 123 |
private SaholicInventorySnapshotRepository saholicInventorySnapshotRepository;
|
130 |
private SaholicInventorySnapshotRepository saholicInventorySnapshotRepository;
|
| 124 |
|
131 |
|
| 125 |
@Autowired
|
132 |
@Autowired
|
| 126 |
private CsService csService;
|
133 |
private CsService csService;
|
| 127 |
|
134 |
|
| Line 798... |
Line 805... |
| 798 |
for (int catalogId : catalogIds) {
|
805 |
for (int catalogId : catalogIds) {
|
| 799 |
try {
|
806 |
try {
|
| 800 |
ContentPojo cp = mongoClient.getEntityById(catalogId);
|
807 |
ContentPojo cp = mongoClient.getEntityById(catalogId);
|
| 801 |
try {
|
808 |
try {
|
| 802 |
cp.setIconImageUrl(cp.getIconImageUrl().replace("saholic", "smartdukaan"));
|
809 |
cp.setIconImageUrl(cp.getIconImageUrl().replace("saholic", "smartdukaan"));
|
| 803 |
} catch(Exception e) {
|
810 |
} catch (Exception e) {
|
| 804 |
|
811 |
|
| 805 |
}
|
812 |
}
|
| 806 |
|
813 |
|
| 807 |
try {
|
814 |
try {
|
| 808 |
cp.setThumbnailImageUrl(cp.getThumbnailImageUrl().replace("saholic", "smartdukaan"));
|
815 |
cp.setThumbnailImageUrl(cp.getThumbnailImageUrl().replace("saholic", "smartdukaan"));
|
| 809 |
} catch(Exception e) {
|
816 |
} catch (Exception e) {
|
| 810 |
|
817 |
|
| 811 |
}
|
818 |
}
|
| 812 |
|
819 |
|
| 813 |
cp.setDefaultImageUrl(cp.getDefaultImageUrl().replace("saholic", "smartdukaan"));
|
820 |
cp.setDefaultImageUrl(cp.getDefaultImageUrl().replace("saholic", "smartdukaan"));
|
| 814 |
List<MediaPojo> mPojos = cp.getImages();
|
821 |
List<MediaPojo> mPojos = cp.getImages();
|
| 815 |
if(mPojos != null ) {
|
822 |
if (mPojos != null) {
|
| 816 |
mPojos.stream().forEach(mPojo -> {
|
823 |
mPojos.stream().forEach(mPojo -> {
|
| 817 |
mPojo.setUrl(mPojo.getUrl().replace("saholic", "smartdukaan"));
|
824 |
mPojo.setUrl(mPojo.getUrl().replace("saholic", "smartdukaan"));
|
| 818 |
});
|
825 |
});
|
| 819 |
}
|
826 |
}
|
| 820 |
mongoClient.persistEntity(cp);
|
827 |
mongoClient.persistEntity(cp);
|
| 821 |
} catch (Exception e) {
|
828 |
} catch (Exception e) {
|
| 822 |
continue;
|
829 |
continue;
|
| 823 |
}
|
830 |
}
|
| 824 |
}
|
831 |
}
|
| 825 |
}
|
832 |
}
|
| - |
|
833 |
|
| - |
|
834 |
public void cancelDn(String debitNoteNumber) throws Exception {
|
| - |
|
835 |
DebitNote debitNote = debitNoteRepository.selectDebitNoteByNumber(debitNoteNumber);
|
| - |
|
836 |
|
| - |
|
837 |
List<PurchaseReturnItem> purchaseReturnItems = purchaseReturnItemRepository.selectAllByDebitNoteId(debitNote.getId());
|
| - |
|
838 |
purchaseReturnItems.stream().forEach(x-> purchaseReturnItemRepository.delete(x));
|
| - |
|
839 |
// Select all inventory Item
|
| - |
|
840 |
Set<Integer> inventoryItemIds = purchaseReturnItems.stream().map(x -> x.getInventoryItemId())
|
| - |
|
841 |
.collect(Collectors.toSet());
|
| - |
|
842 |
List<InventoryItem> inventoryItems = inventoryItemRepository.selectByIds(inventoryItemIds);
|
| - |
|
843 |
for (InventoryItem inventoryItem : inventoryItems) {
|
| - |
|
844 |
if (!StringUtils.isEmpty(inventoryItem.getSerialNumber())) {
|
| - |
|
845 |
inventoryItem.setGoodQuantity(1);
|
| - |
|
846 |
inventoryItem.setLastScanType(ScanType.PURCHASE);
|
| - |
|
847 |
ScanRecord sr = scanRecordRepository.selectByInventoryItemId(inventoryItem.getId()).stream()
|
| - |
|
848 |
.filter(x -> x.getType().equals(ScanType.PURCHASE_RET)).findFirst().get();
|
| - |
|
849 |
scanRecordRepository.delete(sr);
|
| - |
|
850 |
CurrentInventorySnapshot cis = currentInventorySnapshotRepository
|
| - |
|
851 |
.selectByItemAndFofoId(inventoryItem.getItemId(), inventoryItem.getFofoId());
|
| - |
|
852 |
if (cis == null) {
|
| - |
|
853 |
cis = new CurrentInventorySnapshot();
|
| - |
|
854 |
cis.setFofoId(inventoryItem.getFofoId());
|
| - |
|
855 |
cis.setItemId(inventoryItem.getId());
|
| - |
|
856 |
currentInventorySnapshotRepository.persist(cis);
|
| - |
|
857 |
}
|
| - |
|
858 |
cis.setAvailability(cis.getAvailability() + 1);
|
| - |
|
859 |
schemeService.processSchemeIn(inventoryItem.getPurchaseId(), inventoryItem.getFofoId());
|
| - |
|
860 |
}
|
| - |
|
861 |
}
|
| - |
|
862 |
}
|
| 826 |
}
|
863 |
}
|
| 827 |
|
864 |
|
| 828 |
//7015845171
|
865 |
//7015845171
|
| 829 |
|
866 |
|