| Line 1316... |
Line 1316... |
| 1316 |
|
1316 |
|
| 1317 |
@RequestMapping(value = "/store/clearance/bid", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
1317 |
@RequestMapping(value = "/store/clearance/bid", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 1318 |
@ApiImplicitParams({@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
|
1318 |
@ApiImplicitParams({@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header")})
|
| 1319 |
public ResponseEntity<?> saveBidding(HttpServletRequest request, @RequestBody BiddingModel biddingModel) throws Exception {
|
1319 |
public ResponseEntity<?> saveBidding(HttpServletRequest request, @RequestBody BiddingModel biddingModel) throws Exception {
|
| 1320 |
LocalDateTime now = LocalDateTime.now();
|
1320 |
LocalDateTime now = LocalDateTime.now();
|
| - |
|
1321 |
Liquidation liquidation = liquidationRepository.selectLiquidationById(biddingModel.getLiquidationId());
|
| 1321 |
LocalDateTime sixPmToday = LocalDateTime.of(LocalDate.now(), LocalTime.of(18, 0));
|
1322 |
LocalDateTime endDateTime = LocalDateTime.of(liquidation.getEndDate().toLocalDate(), LocalTime.of(ProfitMandiConstants.BID_END_HOUR, ProfitMandiConstants.BID_END_MIN));
|
| 1322 |
if (now.isAfter(sixPmToday)) {
|
1323 |
if (now.isAfter(endDateTime)) {
|
| 1323 |
return responseSender.badRequest("false");
|
1324 |
return responseSender.badRequest("false");
|
| 1324 |
}
|
1325 |
}
|
| 1325 |
Bid bid = null;
|
1326 |
Bid bid = null;
|
| 1326 |
UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
|
1327 |
UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
|
| 1327 |
if (biddingModel.getId() != null && biddingModel.getId() > 0) {
|
1328 |
if (biddingModel.getId() != null && biddingModel.getId() > 0) {
|
| Line 1330... |
Line 1331... |
| 1330 |
throw new Exception("Bidding record not found with ID: " + biddingModel.getId());
|
1331 |
throw new Exception("Bidding record not found with ID: " + biddingModel.getId());
|
| 1331 |
}
|
1332 |
}
|
| 1332 |
} else {
|
1333 |
} else {
|
| 1333 |
bid = new Bid();
|
1334 |
bid = new Bid();
|
| 1334 |
}
|
1335 |
}
|
| - |
|
1336 |
logger.info("biddingModel {}: ",biddingModel);
|
| 1335 |
bid.setLiquidationId(biddingModel.getLiquidationId());
|
1337 |
bid.setLiquidationId(biddingModel.getLiquidationId());
|
| 1336 |
bid.setBiddingAmount(biddingModel.getBiddingAmount());
|
1338 |
bid.setBiddingAmount(biddingModel.getBiddingAmount());
|
| 1337 |
bid.setFofoId(userInfo.getRetailerId());
|
1339 |
bid.setFofoId(userInfo.getRetailerId());
|
| 1338 |
bid.setItemName(biddingModel.getItemName());
|
1340 |
bid.setItemName(biddingModel.getItemName());
|
| 1339 |
bid.setQuantity(biddingModel.getBidQty());
|
1341 |
bid.setQuantity(biddingModel.getBidQty());
|