示例#1
0
 /**
  * 获取招标合同号
  *
  * @param request
  * @param response
  * @param keyword
  * @return
  * @throws IOException
  */
 @RequestMapping("refContractNo")
 public @ResponseBody Map<String, String> getRefContractNo(
     HttpSession session, HttpServletRequest request, HttpServletResponse response, String keyword)
     throws IOException {
   ContractQuery query = new ContractQuery();
   if (keyword != "" && keyword != null) {
     query.setEngAddress(keyword);
   }
   SupervisorPrincipal userBean = (SupervisorPrincipal) session.getAttribute("userinfo");
   query.setMemberIdB(userBean.getMember().getMemberNo());
   List<ContractModel> list = contractService.queryContracts(query);
   List strlist = new ArrayList();
   String sb = "";
   for (ContractModel cm : list) {
     if (cm != null) {
       sb =
           "{\"title\":\""
               + cm.getContract().getEngAddress()
               + "\",\"result\":\""
               + cm.getContract().getContractNo()
               + "\"}";
       strlist.add(sb);
     }
   }
   String json = "{\"data\":" + strlist.toString() + "}";
   response.setCharacterEncoding("UTF-8");
   PrintWriter out = response.getWriter();
   out.print(json);
   out.flush();
   out.close();
   return null;
 }
 /**
  * 获取合同详细
  *
  * @param model
  * @param contractNo
  * @param rfid
  * @return
  * @throws WebException
  */
 @RequestMapping("contractInfo")
 public String queryContractInfo(ModelMap model, String contractNo, String id)
     throws WebException {
   try {
     ContractModel cmodel = contractService.getContractModelByContractNo(contractNo);
     ContractModel contractModel = contractService.getContract(cmodel.getContract().getId());
     model.put("contractModel", contractModel);
     model.put("contractId", id);
     return "manage/contract/contract-info";
   } catch (Exception e) {
     SxjLogger.error("查询合同信息错误", e, this.getClass());
     throw new WebException("查询合同信息错误");
   }
 }