Пример #1
0
 @RequestMapping(value = "delete", method = RequestMethod.DELETE)
 public @ResponseBody Object delete(@RequestBody CsContractInfoVo csContractInfoVo)
     throws Exception {
   CsContractInfo csContractInfo = new CsContractInfo();
   csContractInfo.setId(csContractInfoVo.getId());
   PropertyUtils.copyProperties(csContractInfo, csContractInfoVo);
   this.csContractInfoService.delete(csContractInfo);
   return ResponseUtils.sendSuccess("删除成功");
 }
Пример #2
0
  @RequestMapping(value = "list", method = RequestMethod.GET)
  public @ResponseBody Object list() {
    HttpServletRequest request = WebUtils.getRequestByContext();
    CsContractInfo csContractInfo = new CsContractInfo();

    // 接受查询参数
    String paramsArea = request.getParameter("paramsArea");
    String paramsCustomerName = request.getParameter("paramsCustomerName");
    String paramsCustomerType = request.getParameter("paramsCustomerType");
    String paramsContractType = request.getParameter("paramsContractType");

    if (null != paramsArea) {
      byte b[];
      try {
        b = paramsArea.getBytes("GBK");
        paramsArea = new String(b);

        b = paramsCustomerName.getBytes("GBK");
        paramsCustomerName = new String(b);

        b = paramsCustomerType.getBytes("GBK");
        paramsCustomerType = new String(b);

        b = paramsContractType.getBytes("GBK");
        paramsContractType = new String(b);
      } catch (UnsupportedEncodingException e) {
        paramsArea = null;
        paramsContractType = null;
        paramsCustomerName = null;
        paramsCustomerType = null;
      }
      if (null != paramsArea) {
        csContractInfo.setArea(paramsArea);
        csContractInfo.setContractType(paramsContractType);
        csContractInfo.setCustomerName(paramsCustomerName);
        csContractInfo.setCustomerType(paramsCustomerType);
      }
    }

    return ResponseUtils.sendPagination(csContractInfoService.list(csContractInfo));
  }