| Line 3... |
Line 3... |
| 3 |
import java.text.MessageFormat;
|
3 |
import java.text.MessageFormat;
|
| 4 |
import java.time.LocalDateTime;
|
4 |
import java.time.LocalDateTime;
|
| 5 |
import java.util.ArrayList;
|
5 |
import java.util.ArrayList;
|
| 6 |
import java.util.Arrays;
|
6 |
import java.util.Arrays;
|
| 7 |
import java.util.HashMap;
|
7 |
import java.util.HashMap;
|
| 8 |
import java.util.HashSet;
|
- |
|
| 9 |
import java.util.List;
|
8 |
import java.util.List;
|
| 10 |
import java.util.Map;
|
9 |
import java.util.Map;
|
| 11 |
import java.util.Set;
|
- |
|
| 12 |
import java.util.stream.Collectors;
|
10 |
import java.util.stream.Collectors;
|
| 13 |
|
11 |
|
| 14 |
import javax.servlet.http.HttpServletRequest;
|
12 |
import javax.servlet.http.HttpServletRequest;
|
| 15 |
import javax.transaction.Transactional;
|
13 |
import javax.transaction.Transactional;
|
| 16 |
|
14 |
|
| Line 51... |
Line 49... |
| 51 |
import com.spice.profitmandi.common.util.FileUtil;
|
49 |
import com.spice.profitmandi.common.util.FileUtil;
|
| 52 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
50 |
import com.spice.profitmandi.common.util.FormattingUtils;
|
| 53 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
51 |
import com.spice.profitmandi.dao.entity.catalog.Item;
|
| 54 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
52 |
import com.spice.profitmandi.dao.entity.catalog.TagListing;
|
| 55 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
53 |
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
|
| 56 |
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
|
- |
|
| 57 |
import com.spice.profitmandi.dao.entity.inventory.VendorItemPricing;
|
54 |
import com.spice.profitmandi.dao.entity.inventory.VendorItemPricing;
|
| 58 |
import com.spice.profitmandi.dao.entity.transaction.LineItemImei;
|
55 |
import com.spice.profitmandi.dao.entity.transaction.LineItemImei;
|
| 59 |
import com.spice.profitmandi.dao.entity.transaction.PriceDrop;
|
56 |
import com.spice.profitmandi.dao.entity.transaction.PriceDrop;
|
| 60 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
57 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| 61 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
58 |
import com.spice.profitmandi.dao.repository.catalog.TagListingRepository;
|
| Line 70... |
Line 67... |
| 70 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
67 |
import com.spice.profitmandi.service.transaction.TransactionService;
|
| 71 |
import com.spice.profitmandi.service.wallet.WalletService;
|
68 |
import com.spice.profitmandi.service.wallet.WalletService;
|
| 72 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
69 |
import com.spice.profitmandi.web.util.MVCResponseSender;
|
| 73 |
|
70 |
|
| 74 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
71 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
| 75 |
import in.shop2020.model.v1.user.ItemQuantity;
|
- |
|
| 76 |
|
72 |
|
| 77 |
@Controller
|
73 |
@Controller
|
| 78 |
@Transactional
|
74 |
@Transactional
|
| 79 |
public class PriceDropController {
|
75 |
public class PriceDropController {
|
| 80 |
|
76 |
|
| Line 235... |
Line 231... |
| 235 |
priceDrop.getAmount(), description, fofoInventoryList.size(),
|
231 |
priceDrop.getAmount(), description, fofoInventoryList.size(),
|
| 236 |
FormattingUtils.formatDate(priceDrop.getAffectedOn()), priceDropProcess.getPartnerPayout());
|
232 |
FormattingUtils.formatDate(priceDrop.getAffectedOn()), priceDropProcess.getPartnerPayout());
|
| 237 |
inventoryService.updatePriceDrop(fofoInventoryList, priceDrop.getAmount());
|
233 |
inventoryService.updatePriceDrop(fofoInventoryList, priceDrop.getAmount());
|
| 238 |
schemeService.reverseSchemes(fofoInventoryList, priceDropProcess.getPriceDropId(), reversalReason);
|
234 |
schemeService.reverseSchemes(fofoInventoryList, priceDropProcess.getPriceDropId(), reversalReason);
|
| 239 |
walletService.addAmountToWallet(fofoId, priceDrop.getId(), WalletReferenceType.PRICE_DROP, aReason,
|
235 |
walletService.addAmountToWallet(fofoId, priceDrop.getId(), WalletReferenceType.PRICE_DROP, aReason,
|
| 240 |
priceDropProcess.getPartnerPayout() * fofoInventoryList.size());
|
236 |
priceDrop.getPartnerPayout() * fofoInventoryList.size());
|
| 241 |
}
|
237 |
}
|
| 242 |
|
238 |
|
| 243 |
}
|
239 |
}
|
| 244 |
response = true;
|
240 |
response = true;
|
| 245 |
}
|
241 |
}
|