package com.lgx8.management.action;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.context.ApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;
import com.lgx8.common.util.StrUtil;
import com.lgx8.gateway.dao.IOrderDao;
import com.lgx8.gateway.entities.Orders;
/**
* Servlet implementation class WriteOrderRemarkServlet
*/
public class WriteOrderRemarkServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public WriteOrderRemarkServlet() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doPost(request, response);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String orderId = request.getParameter("orderid");
String remark = request.getParameter("remark");
ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
IOrderDao orderDao = (IOrderDao)ac.getBean("orderDao");
Orders o = orderDao.findOrders(StrUtil.parseLong(orderId));
o.setRemark(remark);
orderDao.updateOrders(o);
PrintWriter out = response.getWriter();
out.println("1");
}
}