root.putAll(base);
Template temp = getConfiguration().getTemplate("adviseproduct.ftl");
ApplicationContext ac = WebApplicationContextUtils.getWebApplicationContext(this.getServletContext());
IGatewayService gatewayService = (IGatewayService) ac.getBean("gatewayService");
GatewayCategory gatewayCategory = gatewayService.findGatewayCategoryById(GatewayConstants.CTC_TCTH);
root.put("gatewayCategory", gatewayCategory);
//同城兑换类型
List<ProductVO> productVOs = gatewayService.initGatewayInfo(GatewayConstants.CTC_TCTHLX);
root.put("productVOs", productVOs);
String type = request.getParameter("typeNumber");
String pageno = request.getParameter("pageno");
String orderType = request.getParameter("orderType");
String orderStr = request.getParameter("orderStr");
String orderStrType = request.getParameter("orderStrType");
if("".equals(orderStrType)||orderStrType == null)
{
orderStrType = "0";
}
root.put("orderStrType", orderStrType);
String order = "1";
if("1".equals(orderType))
{
orderStr = " order by p.price " + orderStr;
order = "1";
}else if("2".equals(orderType))
{
orderStr = " order by p.createdate " + orderStr;
order = "2";
}else
{
orderStr = "";
}
//处理当前页
if(pageno==null) {
pageno = "1";
}
int pagenum = 1;
try {
pagenum = Integer.parseInt(pageno);
} catch (Exception e1) {
pagenum = 1;
}
String point = "0";
List<Product> products = null;
PageList pageList = null;
IPObject iPObject = (IPObject) request.getSession().getAttribute("iPObject");
if("0".equals(type)||"".equals(type)||"null".equals(type)||type == null)
{
pageList = gatewayService.findProductByConditions(5l, 0l, null, null,iPObject==null?null:iPObject.getAreaNode(),pagenum+"",orderStr);
point = "0";
}else if("1".equals(type))
{
pageList = gatewayService.findProductByConditions(5l, 0l, "0", "50",iPObject==null?null:iPObject.getAreaNode(),pagenum+"",orderStr);
point = "1";
}else if("2".equals(type))
{
pageList = gatewayService.findProductByConditions(5l, 0l, "50", "100",iPObject==null?null:iPObject.getAreaNode(),pagenum+"",orderStr);
point = "2";
}else if("3".equals(type))
{
pageList = gatewayService.findProductByConditions(5l, 0l, "100", "200",iPObject==null?null:iPObject.getAreaNode(),pagenum+"",orderStr);
point = "3";
}else if("4".equals(type))
{
pageList = gatewayService.findProductByConditions(5l, 0l, "200", "500",iPObject==null?null:iPObject.getAreaNode(),pagenum+"",orderStr);
point = "4";
}else if("5".equals(type))
{
pageList = gatewayService.findProductByConditions(5l, 0l, "500", "1000",iPObject==null?null:iPObject.getAreaNode(),pagenum+"",orderStr);
point = "5";
}else if("6".equals(type))
{
pageList = gatewayService.findProductByConditions(5l, 0l, "1000", null,iPObject==null?null:iPObject.getAreaNode(),pagenum+"",orderStr);
point = "6";
}
root.put("point", point);