Example #1
0
  /** hkf 验证手机号码唯一 2013.1.22 */
  @POST
  public String validateMobileNumber() {
    String mobilenumber = this.getParam("mobilenumber").toString();
    Map map = new HashMap();
    map.put("mobilenumber", mobilenumber);
    OperatorService operatorService =
        (OperatorService) SofaSpringContext.getBean("operatorService");
    String msg = operatorService.checkMobileNumber(map);
    HttpServletResponse response = this.getResponseHelper().getResponse();
    response.setContentType("application/json;charset=UTF-8");
    response.setCharacterEncoding("UTF-8");
    if (msg.equals("ok")) {

      try {
        PrintWriter pw = response.getWriter();
        pw.print(true);
        pw.flush();
      } catch (IOException e) {
        e.printStackTrace();
      }

    } else {
      try {
        PrintWriter pw = response.getWriter();
        pw.print(false);
        pw.flush();
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
    return null;
  }
Example #2
0
  /** hkf 子账号列表 2013.1.9 */
  @POST
  public String list_json() {
    Map paramsMap = this.getParams();
    paramsMap = SysUtil.removeFilter(paramsMap);
    HttpServletRequest request = this.getResponseHelper().getRequest();
    SessionBean sessionBean = SessionUtil.getSession(request);
    paramsMap.put("partyid", sessionBean.getPartyid());
    OperatorService operatorService =
        (OperatorService) SofaSpringContext.getBean("operatorService");
    String backlist = operatorService.selectPageByKey(paramsMap);

    HttpServletResponse response = this.getResponseHelper().getResponse();
    return new JsonResponse().responseJson(response, backlist);
  }
Example #3
0
  /** hkf 重置密码 2013.1.15 */
  @POST
  public String updateoldpassword() {
    Map map = this.getParams();
    map = SysUtil.removeFilter(map);
    map.put("password", MD5.md5("123456s"));
    OperatorService operatorService =
        (OperatorService) SofaSpringContext.getBean("operatorService");
    String msg = operatorService.updateoldpassword(map);
    msg = JsonGenerateUtil.getMsgJson(msg);

    HttpServletResponse response = this.getResponseHelper().getResponse();

    return new JsonResponse().responseJson(response, msg);
  }
Example #4
0
  /** hkf 删除子账号 2013.1.9 */
  @GET
  public String delete() {
    Map map = this.getParams();
    map = SysUtil.removeFilter(map);
    OperatorService operatorService =
        (OperatorService) SofaSpringContext.getBean("operatorService");
    HttpServletRequest request = this.getResponseHelper().getRequest();
    SessionBean sessionBean = SessionUtil.getSession(request);
    map.put("partyid", sessionBean.getPartyid());
    String msg = operatorService.delete(map);
    String jsonmsg = JsonGenerateUtil.getMsgJson(msg);
    HttpServletResponse response = this.getResponseHelper().getResponse();

    return new JsonResponse().responseJson(response, jsonmsg);
  }
Example #5
0
  /**
   * hkf 用partyid查询admin操作员信息 2013.7.11
   *
   * @return
   */
  @GET
  public String selectMsgByPartyid() {
    Map paramsMap = new HashMap();
    HttpServletRequest request = this.getResponseHelper().getRequest();
    SessionBean sessionBean = SessionUtil.getSession(request);

    paramsMap.put("partyid", sessionBean.getPartyid());
    OperatorService operatorService =
        (OperatorService) SofaSpringContext.getBean("operatorService");
    String str = operatorService.selectAdminMsgByPartyid(paramsMap);

    HttpServletResponse response = this.getResponseHelper().getResponse();

    return new JsonResponse().responseJson(response, str);
  }
Example #6
0
  /**
   * hkf 更新操作员信息
   *
   * <p>2013.1.15
   */
  @POST
  public String updateoperatormsg() {
    Map map = this.getParams();
    map = SysUtil.removeFilter(map);
    // String operator=SysUtil.getDecode(this.getParam("operator").toString());
    HttpServletRequest request = this.getResponseHelper().getRequest();
    SessionBean sessionBean = SessionUtil.getSession(request);
    map.put("partyid", sessionBean.getPartyid());
    //	map.put("partyid", "1");
    OperatorService operatorService =
        (OperatorService) SofaSpringContext.getBean("operatorService");
    String msg = operatorService.updateoperatormsg(map);
    msg = JsonGenerateUtil.getMsgJson(msg);

    HttpServletResponse response = this.getResponseHelper().getResponse();

    return new JsonResponse().responseJson(response, msg);
  }
Example #7
0
  /** hkf 验证子账号名 2013.1.9 */
  @GET
  public String checkoperator() {
    String operator = SysUtil.getDecode(this.getParam("operator").toString());
    OperatorService operatorService =
        (OperatorService) SofaSpringContext.getBean("operatorService");
    HttpServletResponse response = this.getResponseHelper().getResponse();
    if (operator.equals("admin")) {
      String jsonmsg = JsonGenerateUtil.getMsgJson("sorry");
      return new JsonResponse().responseJson(response, jsonmsg);
    }

    Map map = new HashMap();
    map.put("operator", operator);
    HttpServletRequest request = this.getResponseHelper().getRequest();
    SessionBean sessionBean = SessionUtil.getSession(request);
    map.put("partyid", sessionBean.getPartyid());
    String msg = operatorService.checkoperator(map);
    msg = JsonGenerateUtil.getMsgJson(msg);
    return new JsonResponse().responseJson(response, msg);
  }
Example #8
0
  /** hkf 根据operatorid查询操作员 */
  @GET
  public String list_query_detail_json() {
    String id = this.getParam("id").toString();

    Map map = new HashMap();

    if (id.contains("/")) {
      map.put("operatorid", id.split("/")[0]);
    } else {
      map.put("operatorid", id);
    }
    // map.put("operator", id.split("/")[1]);
    HttpServletRequest request = this.getResponseHelper().getRequest();
    SessionBean sessionBean = SessionUtil.getSession(request);

    map.put("partyid", sessionBean.getPartyid());
    OperatorService operatorService =
        (OperatorService) SofaSpringContext.getBean("operatorService");
    String msg = operatorService.selectbyid(map);
    HttpServletResponse response = this.getResponseHelper().getResponse();
    return new JsonResponse().responseJson(response, msg);
  }
Example #9
0
  /** hkf 插入操作员 2013.1.10 */
  @POST
  public String save() {
    Map map = this.getParams();
    map = SysUtil.removeFilter(map);
    Map mymap = new HashMap();
    mymap.put("operator", map.get("username"));
    mymap.put("realname", map.get("realname"));
    mymap.put("mobilenumber", map.get("mobileInfo"));
    mymap.put("telephonenumber", map.get("tel"));
    mymap.put("password", MD5.md5(map.get("pwd").toString()));
    mymap.put("securitypermission", map.get("securitypermission"));
    //		mymap.put("partyid", "1");
    HttpServletRequest request = this.getResponseHelper().getRequest();
    SessionBean sessionBean = SessionUtil.getSession(request);
    mymap.put("partyid", sessionBean.getPartyid());

    OperatorService operatorService =
        (OperatorService) SofaSpringContext.getBean("operatorService");
    String msg = operatorService.save(mymap);
    msg = JsonGenerateUtil.getMsgJson(msg);

    HttpServletResponse response = this.getResponseHelper().getResponse();
    return new JsonResponse().responseJson(response, msg);
  }