Exemplo n.º 1
0
 /**
  * 保存客户联系人信息
  *
  * @param user
  * @param request
  * @param response
  * @return
  */
 @ResponseBody
 @RequestMapping(
     value = "/saveOrupdateUser.do",
     method = RequestMethod.POST,
     produces = "application/json;charset=UTF-8")
 public JsonResult<CustomerUser> saveOrupdateUser(
     CustomerUser user, HttpServletRequest request, HttpServletResponse response) {
   JsonResult<CustomerUser> js = new JsonResult<CustomerUser>();
   js.setCode(new Integer(1));
   js.setMessage("保存失败!");
   try {
     user.setFlag(0);
     if (user.getPhone() != null) {
       user.setAccount(user.getPhone());
     }
     User u = EndecryptUtils.md5Password(user.getAccount(), "111111");
     if (u != null) {
       user.setPassword(u.getPassword());
       user.setSalt(u.getSalt());
     }
     user.setCreateUser(this.getLoginUser().getId());
     user.setCreateTime(new Date());
     customerService.saveCustomerUser(user);
     js.setCode(new Integer(0));
     js.setMessage("保存成功!");
   } catch (Exception e) {
     e.printStackTrace();
   }
   return js;
 }
Exemplo n.º 2
0
  /**
   * 加载客户上级机构
   *
   * @param request
   * @param response
   * @return
   */
  @ResponseBody
  @RequestMapping(
      value = "/jsonLoadCustomerCompanyParent.do",
      produces = {"text/html;charset=UTF-8"})
  public JsonResult<CustomerCompany> loadCustomerCompanyParent(
      HttpServletRequest request, HttpServletResponse response) {
    JsonResult<CustomerCompany> js = new JsonResult<CustomerCompany>();
    js.setCode(new Integer(1));
    js.setMessage("查询失败!");
    try {

    } catch (Exception e) {
      e.printStackTrace();
    }

    return js;
  }
Exemplo n.º 3
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;
 }