public LotStatusResponse getLotStatus(StatusRequest statusRequest) { LotStatusResponse lotResponse = null; try { LotsDAO lotsDAO = new LotsDAO(); LotStatusDTO lotStatusDto = lotsDAO.getLotStatus(statusRequest); if (lotStatusDto != null) { String lotStatus = getLotImplementationStatus(lotStatusDto.getStartDate(), lotStatusDto.getEndDate()); lotResponse = new LotStatusResponse( lotStatusDto.getHasHigestBidChanged(), lotStatusDto.getHighestBid(), lotStatusDto.getHigestBidUser(), lotStatusDto.getCurrentServerTime(), lotStatus); } else { LotDTO lotDTo = lotsDAO.getLotById(statusRequest.getLotid()); String lotStatus = getLotImplementationStatus(lotDTo.getStartDate(), lotDTo.getEndDate()); lotResponse = new LotStatusResponse(false, 0, 0, DateUtil.getCurrentServerTime(), lotStatus); } } catch (SQLException s) { s.printStackTrace(); } catch (IOException s) { s.printStackTrace(); } return lotResponse; }
public List<BidHistoryResponse> getBidHistory(int lotId, int isTender) { List<BidHistoryResponse> bidHistoryList = null; try { LotsDAO lotsDAO = new LotsDAO(); bidHistoryList = lotsDAO.getBidHistoryList(lotId, isTender == 1); } catch (SQLException s) { s.printStackTrace(); } catch (IOException s) { s.printStackTrace(); } return bidHistoryList; }
public LotsResponse getLotById(int id) { LotsResponse lotsResponse = null; try { LotsDAO lotsDAO = new LotsDAO(); LotDTO lotDTO = lotsDAO.getLotById(id); lotsResponse = buildLotResponseFromDTOs(lotDTO); } catch (SQLException s) { s.printStackTrace(); } catch (IOException s) { s.printStackTrace(); } return lotsResponse; }
public List<LotsResponse> getAllLots(int auctionId) { List<LotsResponse> lotsResponseList = new ArrayList<LotsResponse>(); try { LotsDAO lotsDAO = new LotsDAO(); List<LotDTO> lotDTOs = lotsDAO.getAllLots(auctionId, null); lotsResponseList = buildListOfLotsFromDTOs(lotDTOs); } catch (SQLException s) { s.printStackTrace(); } catch (IOException s) { s.printStackTrace(); } return lotsResponseList; }
public UpdateLotResponseBO updateLot(UpdateLotBO updateLotRequestBO) { UpdateLotResponseBO updateLotResponse = null; try { LotsDAO lotsDAO = new LotsDAO(); updateLotResponse = lotsDAO.updateLot(updateLotRequestBO); } catch (SQLException s) { s.printStackTrace(); } catch (IOException s) { s.printStackTrace(); } return updateLotResponse; }
public synchronized Boolean insertTenderBid(BidRequestBO tenderBidRequestBO) { LotsDAO lotsDAO = new LotsDAO(); boolean isProcessed = false; try { if (lotsDAO.insertTenderBid(tenderBidRequestBO)) { isProcessed = true; } } catch (SQLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return isProcessed; }
public CreateLotResponseBO createLot(CreateLotRequestBO createLotRequestBO) { CreateLotResponseBO createLotResponseBO = null; LotsDAO lotsDAO = new LotsDAO(); try { createLotResponseBO = new CreateLotResponseBO( lotsDAO.createLot(buildCreateLotRequestDTOFromBO(createLotRequestBO)).getId()); } catch (SQLException s) { s.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return createLotResponseBO; }
public List<LotsByAccessResponse> getLotsByAccess(int userId, int auctionId, int isTender) { List<LotsByAccessResponse> lotsResponseList = new ArrayList<LotsByAccessResponse>(); try { LotsDAO lotsDAO = new LotsDAO(); if (isTender == 1) { List<LotByAccessInTenderDTO> lotByAccessInTenderDTOs = lotsDAO.getLotsByUser(userId, auctionId, isTender); lotsResponseList = buildListOfLotsByAccessInLotsFromDTOs(lotByAccessInTenderDTOs); } else { List<LotDTO> lotDTO = lotsDAO.getLotsByUser(userId, auctionId); lotsResponseList = buildListOfLotsByAccessFromDTOs(lotDTO); } } catch (SQLException s) { s.printStackTrace(); } catch (IOException s) { s.printStackTrace(); } return lotsResponseList; }