| Line 79... |
Line 79... |
| 79 |
liquidationsMap.put("basePrice",liquidation.getPrice());
|
79 |
liquidationsMap.put("basePrice",liquidation.getPrice());
|
| 80 |
liquidationsMap.put("openingStock",liquidation.getQuantity());
|
80 |
liquidationsMap.put("openingStock",liquidation.getQuantity());
|
| 81 |
liquidationsMap.put("endDate",StringUtils.toLocalDateTime(String.valueOf(liquidation.getEndDate())));
|
81 |
liquidationsMap.put("endDate",StringUtils.toLocalDateTime(String.valueOf(liquidation.getEndDate())));
|
| 82 |
List<Bid> bidsList = new ArrayList<>();
|
82 |
List<Bid> bidsList = new ArrayList<>();
|
| 83 |
if (bids.size() > 0) {
|
83 |
if (bids.size() > 0) {
|
| - |
|
84 |
ProfitMandiConstants.BID_ENUM bidStatus = ProfitMandiConstants.BID_ENUM.PENDING;
|
| 84 |
for (Bid bid : bids) {
|
85 |
for (Bid bid : bids) {
|
| 85 |
LOGGER.info("remainingQty: {}", remainingQty);
|
86 |
LOGGER.info("remainingQty: {}", remainingQty);
|
| 86 |
if (remainingQty >= bid.getQuantity()) {
|
87 |
if (remainingQty >= bid.getQuantity()) {
|
| 87 |
try {
|
88 |
try {
|
| 88 |
List<BulkOrderModel> bulkOrderModels = new ArrayList<>();
|
89 |
List<BulkOrderModel> bulkOrderModels = new ArrayList<>();
|
| Line 94... |
Line 95... |
| 94 |
bulkOrderModel.setDescription(items.get(0).getItemDescription());
|
95 |
bulkOrderModel.setDescription(items.get(0).getItemDescription());
|
| 95 |
bulkOrderModel.setItemPrice(bid.getBiddingAmount());
|
96 |
bulkOrderModel.setItemPrice(bid.getBiddingAmount());
|
| 96 |
|
97 |
|
| 97 |
bulkOrderModels.add(bulkOrderModel);
|
98 |
bulkOrderModels.add(bulkOrderModel);
|
| 98 |
|
99 |
|
| 99 |
bulkOrderService.generatePurchaseOrder(bulkOrderModels, bid.getFofoId(), ProfitMandiConstants.PO_TYPE.AUTO, type);
|
100 |
bidStatus = bulkOrderService.generatePurchaseOrder(bulkOrderModels, bid.getFofoId(), ProfitMandiConstants.PO_TYPE.AUTO, type);
|
| 100 |
remainingQty -= bid.getQuantity();
|
101 |
remainingQty -= bid.getQuantity();
|
| 101 |
} catch (Exception exception) {
|
102 |
} catch (Exception exception) {
|
| 102 |
LOGGER.info("generatePurchaseOrder if exception: ", exception);
|
103 |
LOGGER.info("generatePurchaseOrder if exception: ", exception);
|
| 103 |
}
|
104 |
}
|
| 104 |
} else {
|
105 |
} else {
|
| 105 |
try {
|
106 |
try {
|
| 106 |
bidService.cancelYesterdayProcessBid(bid);
|
107 |
bidStatus = bidService.cancelYesterdayProcessBid(bid);
|
| 107 |
} catch (Exception exception) {
|
108 |
} catch (Exception exception) {
|
| 108 |
LOGGER.info("generatePurchaseOrder else exception: ", exception);
|
109 |
LOGGER.info("generatePurchaseOrder else exception: ", exception);
|
| 109 |
}
|
110 |
}
|
| 110 |
}
|
111 |
}
|
| - |
|
112 |
bid.setStatus(bidStatus);
|
| 111 |
bidsList.add(bid);
|
113 |
bidsList.add(bid);
|
| 112 |
}
|
114 |
}
|
| 113 |
}
|
115 |
}
|
| 114 |
liquidationsMap.put("bids",bidsList);
|
116 |
liquidationsMap.put("bids",bidsList);
|
| 115 |
liquidation.setQuantity((int) remainingQty);
|
117 |
liquidation.setQuantity((int) remainingQty);
|