打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
文件查看下载
package com.bq.zd.web.actions;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alibaba.fastjson.JSON;
import com.bq.chzd.web.bean.ContractModel;
import com.bq.chzd.web.utils.ClassPropUtils;
import com.bq.zd.web.service.ContractService;
import com.bq.zd.web.service.TestService;
import com.bqzl.car.core.plugin.PageView;

/**
 * 
 * @author zhaohong.Luo
 *
 */
@Controller
public class ContractController {

Logger logger = Logger.getLogger(ContractController.class.toString());
@Autowired
ContractService contractService;
/**
* 查询合同
* @param request
* @throws IOException 
*/
@RequestMapping("/queryContracts.do")
public void queryContracts(ContractModel contractModel,HttpServletRequest request,HttpServletResponse rsp) throws IOException{
String contractNo = request.getParameter("contractNo");
String customerName= request.getParameter("customerName");
String applyDate= request.getParameter("applyDate");
String customerId= request.getParameter("customerId");
String certId= request.getParameter("certId");
String pageNowStr= request.getParameter("pageNow");
String pageSizeStr= request.getParameter("certId");
PageView page = new PageView();
try{
int pageNow = Integer.parseInt(request.getParameter("pageNow"));
page.setPageNow(pageNow);
}catch(Exception e){
}
try{
int pageSize = Integer.parseInt(request.getParameter("pageSize"));
page.setPageSize(pageSize);
}catch(Exception e){
}
if(customerName != null && customerName.length() != 0){
customerName = new String(customerName.getBytes("iso-8859-1"),"utf-8");
}
ContractModel model = new ContractModel();
model.setApplyDate(applyDate);
model.setContractNo(contractNo);
model.setCustomerName(customerName);
model.setCertId(certId);
model.setCustomerId(customerId);
logger.setLevel(Level.DEBUG);
logger.info(model);
System.out.println(model);
page = contractService.queryContractsWithPage(model,page);
//List<ContractModel> list;
String json = JSON.toJSONString(page);
logger.info(json);
rsp.getWriter().println(json);
//return list;
}
@RequestMapping("/common/queryContractsByArr.do")
public void queryContractsByArr(HttpServletRequest request,HttpServletResponse rsp) throws IOException{
String contractNo = request.getParameter("contractNo");
String customerName= request.getParameter("customerName");
String applyDate= request.getParameter("applyDate");
String customerId= request.getParameter("customerId");
String certId= request.getParameter("certId");
HashMap<String,Object> map = new HashMap<String,Object>();
map.put("contractNo", contractNo);
map.put("customerName", customerName);
map.put("applyDate", applyDate);
map.put("customerId", customerId);
map.put("certId", certId);
customerName = new String(customerName.getBytes(),"gbk");
ContractModel model = new ContractModel();
model.setApplyDate(applyDate);
model.setContractNo(contractNo);
model.setCustomerName(customerName);
model.setCertId(certId);
model.setCustomerId(customerId);
//List<ContractModel> list = contractService.queryContracts(model);
String o = contractService.queryContracts(map);
//String json = JSON.toJSONString(list);
//logger.info(json);
rsp.getWriter().println(o);
//return json;
}
@RequestMapping("/getQueryView.do")
public String getQueryView(){
//logger.info(ClassPropUtils.getProperty("/WEB-INF/config.properties", "asdb"));
System.out.println(ClassPropUtils.getProperty("config/config.properties", "asdb"));
//ClassPropUtils.class.getClassLoader().getResource("config.properties");
return "zd/queryContracts.jsp";
}
public ContractService getContractService() {
return contractService;
}
public void setContractService(ContractService contractService) {
this.contractService = contractService;
}
}

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
一段简单小代码 获取getParameter
Ext2.0教程二:基本表格GridPanel,从后台数据库取数据
钉钉 回调事件 消息加解密
servlet 和JSP的上传下载
JSP中一句话将乱码转为中文
JSP九大内置对象
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服