public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType("text/plain");
		PrintWriter out = response.getWriter();

		String requestContent = readRequestContent(request);
		String ids = retriveIdsFromJson(requestContent);
		
		if (null == ids) {
			out.println(returnMsg(ReturnInfo.Status.err,
					ReturnInfo.Reason.jsonFormatErr, ""));
			out.flush();
			out.close();
			return;
		}
		else if (ids.equals("")) {
			out.println(returnMsg(ReturnInfo.Status.err,
					ReturnInfo.Reason.noIdErr, ""));
			out.flush();
			out.close();
			return;
		}
		
		String[] id_array = ids.split(","); 
		DealsDAO dealsDAO = new DealsDAO();
		MerchantsDAO merchantsDAO = new MerchantsDAO();
		PicturesDAO picturesDAO = new PicturesDAO();
		MerchantDealMapDAO merchantDealMapDAO = new MerchantDealMapDAO();
		
		List<Deals> deals = new ArrayList<Deals>();
		List<Merchants> merchantsList = new ArrayList<Merchants>();
		List<String> dealPicURLList = new ArrayList<String>();
		for (String s : id_array) {
			int id = parseInteger(s);
			if (id == -1) {
				out.println(returnMsg(ReturnInfo.Status.err,
						ReturnInfo.Reason.notNumbericIDErr, ""));
				out.flush();
				out.close();
				return;
			} else {
				Deals deal = dealsDAO.selectById(id);
				if (null == deal) {
					out.println(returnMsg(ReturnInfo.Status.err,
							ReturnInfo.Reason.idNotExistInDBErr, String.valueOf(id)));
					out.flush();
					out.close();
					return;
				}
				merchantsList.add(merchantsDAO.selectById(merchantDealMapDAO.getMerchantIdByDealId(deal.getDealId())));
				dealPicURLList.add(picturesDAO.selectById(deal.getPicId()).getPicLink());
				deals.add(deal);
			}
		}

		out.println(convertEncoding(convertDealsToJson(deals, merchantsList,
				dealPicURLList)));

		out.flush();
		out.close();
	}