コード例 #1
0
  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;
  }
コード例 #2
0
 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;
 }
コード例 #3
0
 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;
 }
コード例 #4
0
 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;
 }
コード例 #5
0
  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;
  }
コード例 #6
0
 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;
 }
コード例 #7
0
  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;
  }
コード例 #8
0
  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;
  }