@RequestMapping(value="/member/orderQuery.do")
public ModelAndView queryOrder(HttpServletRequest request,HttpServletResponse response){
System.out.println("--------------------order------------------");
RunTimeUser currentUser = RunTimeUser.getRunTimeUser(request);
if(null==currentUser) {
this.printJSON(response, (new PageList()).toJSON());
return null;
}
String orderIdStr = request.getParameter("orderId");
if(orderIdStr==null||"".equals(orderIdStr.trim())){
String hql = " from Orders o where o.user.id = ? and o.status!="+Orders.STATUS_CART;
PageList pageList = orderService.queryOrders(hql, new Object[]{currentUser.getId()}, getPageInfo(request));
this.printJSON(response, pageList.toJSON());
return null;
}
if(!isNumber(orderIdStr)){
this.printJSON(response, (new PageList()).toJSON());
return null;
}
long id = Long.parseLong(orderIdStr.trim());
String hql = " from Orders o where o.user.id = ? and o.id=? and o.status!="+Orders.STATUS_CART;
PageList pageList = orderService.queryOrders(hql, new Object[]{currentUser.getId(),id}, getPageInfo(request));
this.printJSON(response, pageList.toJSON());
return null;
}