Beispiel #1
0
  /**
   * 客户列表
   *
   * @param customerCompany
   * @param request
   * @param response
   * @return
   */
  @RequestMapping(value = "/customerinfo.do")
  public String logInit(
      CustomerCompany customerCompany, HttpServletRequest request, HttpServletResponse response) {
    if (customerCompany.getPageNo() == null) customerCompany.setPageNo(1);
    customerCompany.setPageSize(Constants.DEFAULT_PAGE_SIZE);

    List<CustomerCompany> lc = customerService.getCustomerCompanyPageList(customerCompany);
    int totalCount = customerService.getCustomerCompanyPageListCount(customerCompany);
    customerCompany.setTotalCount(totalCount);
    request.setAttribute("customerCompany", customerCompany);
    request.setAttribute("customerCompanylist", lc);
    return "web/customer/customerInfoList";
  }
Beispiel #2
0
 /**
  * 新增或保存客户资料
  *
  * @param customerCompany
  * @param request
  * @param response
  * @return
  */
 @ResponseBody
 @RequestMapping(
     value = "/jsonSaveOrupdateCompany.do",
     method = RequestMethod.POST,
     produces = {"text/html;charset=UTF-8"})
 public JsonResult<CustomerCompany> saveOrupdateCompany(
     CustomerCompany customerCompany, HttpServletRequest request, HttpServletResponse response) {
   JsonResult<CustomerCompany> js = new JsonResult<CustomerCompany>();
   js.setCode(new Integer(1));
   js.setMessage("保存失败!");
   try {
     customerCompany.setFlag(0);
     customerCompany.setCreateUser(this.getLoginUser().getId());
     customerCompany.setCreatetTime(new Date());
     customerService.saveCustomerCompany(customerCompany);
     js.setCode(new Integer(0));
     js.setMessage("保存成功!");
   } catch (Exception e) {
     e.printStackTrace();
   }
   return js;
 }