| Line 4... |
Line 4... |
| 4 |
import java.time.LocalDateTime;
|
4 |
import java.time.LocalDateTime;
|
| 5 |
import java.time.LocalTime;
|
5 |
import java.time.LocalTime;
|
| 6 |
import java.util.Arrays;
|
6 |
import java.util.Arrays;
|
| 7 |
import java.util.Collections;
|
7 |
import java.util.Collections;
|
| 8 |
import java.util.HashMap;
|
8 |
import java.util.HashMap;
|
| - |
|
9 |
import java.util.HashSet;
|
| 9 |
import java.util.List;
|
10 |
import java.util.List;
|
| 10 |
import java.util.Map;
|
11 |
import java.util.Map;
|
| 11 |
|
12 |
|
| 12 |
import org.apache.commons.lang.StringUtils;
|
13 |
import org.apache.commons.lang.StringUtils;
|
| 13 |
import org.apache.logging.log4j.LogManager;
|
14 |
import org.apache.logging.log4j.LogManager;
|
| 14 |
import org.apache.logging.log4j.Logger;
|
15 |
import org.apache.logging.log4j.Logger;
|
| 15 |
import org.springframework.beans.factory.annotation.Autowired;
|
16 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 16 |
import org.springframework.stereotype.Component;
|
17 |
import org.springframework.stereotype.Component;
|
| 17 |
import org.springframework.transaction.annotation.Transactional;
|
18 |
import org.springframework.transaction.annotation.Transactional;
|
| 18 |
|
19 |
|
| - |
|
20 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
| 19 |
import com.spice.profitmandi.dao.entity.fofo.Purchase;
|
21 |
import com.spice.profitmandi.dao.entity.fofo.Purchase;
|
| 20 |
import com.spice.profitmandi.dao.entity.transaction.LineItem;
|
22 |
import com.spice.profitmandi.dao.entity.transaction.LineItem;
|
| 21 |
import com.spice.profitmandi.dao.entity.transaction.LineItemImei;
|
23 |
import com.spice.profitmandi.dao.entity.transaction.LineItemImei;
|
| 22 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
24 |
import com.spice.profitmandi.dao.entity.transaction.Order;
|
| 23 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
25 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| Line 28... |
Line 30... |
| 28 |
import com.spice.profitmandi.dao.repository.transaction.LineItemImeisRepository;
|
30 |
import com.spice.profitmandi.dao.repository.transaction.LineItemImeisRepository;
|
| 29 |
import com.spice.profitmandi.dao.repository.transaction.LineItemRepository;
|
31 |
import com.spice.profitmandi.dao.repository.transaction.LineItemRepository;
|
| 30 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
32 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
| 31 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
33 |
import com.spice.profitmandi.dao.repository.user.UserRepository;
|
| 32 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
34 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
| - |
|
35 |
import com.spice.profitmandi.service.pricing.PriceDropService;
|
| - |
|
36 |
import com.spice.profitmandi.service.scheme.SchemeService;
|
| 33 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
37 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
| 34 |
import com.spice.profitmandi.service.user.RetailerService;
|
38 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 35 |
import com.spice.profitmandi.service.wallet.WalletService;
|
39 |
import com.spice.profitmandi.service.wallet.WalletService;
|
| 36 |
|
40 |
|
| 37 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
41 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
| Line 79... |
Line 83... |
| 79 |
private DebitNoteRepository debitNoteRepository;
|
83 |
private DebitNoteRepository debitNoteRepository;
|
| 80 |
|
84 |
|
| 81 |
@Autowired
|
85 |
@Autowired
|
| 82 |
private PurchaseRepository purchaseRepository;
|
86 |
private PurchaseRepository purchaseRepository;
|
| 83 |
|
87 |
|
| - |
|
88 |
|
| - |
|
89 |
@Autowired
|
| - |
|
90 |
private PriceDropService priceDropService;
|
| - |
|
91 |
|
| - |
|
92 |
@Autowired
|
| - |
|
93 |
private SchemeService schemeService;
|
| - |
|
94 |
|
| - |
|
95 |
|
| - |
|
96 |
public void dropCorrection() throws Exception {
|
| - |
|
97 |
|
| - |
|
98 |
walletService.rollbackAmountFromWallet(175128034, 274, 4, WalletReferenceType.PRICE_DROP, "Scheme differential for Price Drop of Rs.712 on Samsung J6 J600GG, on 01-08-2018 for missing 1pc");
|
| - |
|
99 |
walletService.rollbackAmountFromWallet(175128034, -259, 4, WalletReferenceType.PRICE_DROP, "Scheme differential for Price Drop of Rs.712 on Samsung J6 J600GG, on 01-08-2018 for missing 1pc");
|
| - |
|
100 |
List<InventoryItem> iis = inventoryItemRepository.selectByIds(new HashSet<>(Arrays.asList(3518, 3516)));
|
| - |
|
101 |
schemeService.reverseSchemes(iis, 8, "Scheme differential for Price Drop of Rs.712 on Samsung J6 J600GG, on 01-08-2018. Total 2 item(s)");
|
| - |
|
102 |
List<InventoryItem> iis1 = inventoryItemRepository.selectByIds(new HashSet<>(Arrays.asList(3502, 3334,3503)));
|
| - |
|
103 |
schemeService.reverseSchemes(iis1, 13, "Scheme differential for Price Drop of Rs.485 on Samsung Galaxy J4 J400FD, on 18-07-2018. Total 3 item(s)");
|
| - |
|
104 |
|
| - |
|
105 |
List<InventoryItem> iis2 = inventoryItemRepository.selectByIds(new HashSet<>(Arrays.asList(3319)));
|
| - |
|
106 |
schemeService.reverseSchemes(iis2, 13, "Scheme differential for Price Drop of Rs.485 on Samsung Galaxy J4 J400FD, on 18-07-2018. Total 1 item(s)");
|
| - |
|
107 |
}
|
| - |
|
108 |
|
| 84 |
public void schemeRollback() {
|
109 |
public void schemeRollback() {
|
| 85 |
Map<Integer, Float> fofoIdAmount = new HashMap<>();
|
110 |
Map<Integer, Float> fofoIdAmount = new HashMap<>();
|
| 86 |
fofoIdAmount.put(175135218, 1942f);
|
111 |
fofoIdAmount.put(175135218, 1942f);
|
| 87 |
String description = "Price drop/differential rolled out as, they were already returned, Total 2pcs.";
|
112 |
String description = "Price drop/differential rolled out as, they were already returned, Total 2pcs.";
|
| 88 |
for(Map.Entry<Integer, Float> fofoIdAmountEntry: fofoIdAmount.entrySet()) {
|
113 |
for(Map.Entry<Integer, Float> fofoIdAmountEntry: fofoIdAmount.entrySet()) {
|