コード例 #1
0
ファイル: IpavsayService.java プロジェクト: Alan666156/ipav
  /**
   * 邀请同事发送邮件或者短信
   *
   * @throws Exception
   */
  public Map invitationFriend(String username, String name, String mailOrphone) throws Exception {
    Map map = new HashMap<String, String>();
    IpavuserEntity user = new IpavuserEntity();
    user.setUsername(name);
    Pattern p = Pattern.compile("^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\\.([a-zA-Z0-9_-])+)+$");
    Matcher m = p.matcher(mailOrphone);
    boolean b = m.matches();
    if (b == true) {
      user.setEmail(mailOrphone);
      user.setRegtype(ContentUtil.REGIST_TYPE_EMIAL);
      Map usersqlmap = new HashMap<String, Object>();
      usersqlmap.put("email", mailOrphone);
      usersqlmap.put("regtype", "E");
      IpavuserEntity sqluser = userMapper.getUserByUniKey(usersqlmap);
      if (sqluser != null) {
        map.put("msg", "您邀请的好友已经存在快捷管家系统中");
        return map;
      }
      Map remap = new HashMap<String, Object>();
      remap.put("user", user);
      remap.put("iname", username);
      userService.regist(remap);
      map.put("msg", "success");

    } else {
      p = Pattern.compile("^((170)|(13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$");
      m = p.matcher(mailOrphone);
      b = m.matches();
      if (b == true) {
        Map usersqlmap = new HashMap<String, Object>();
        usersqlmap.put("mobile", mailOrphone);
        usersqlmap.put("regtype", "M");
        IpavuserEntity sqluser = userMapper.getUserByUniKey(usersqlmap);
        if (sqluser != null) {
          map.put("msg", "您邀请的好友已经存在贵公司");
          return map;
        }
        user.setMobile(mailOrphone);
        user.setRegtype(ContentUtil.REGIST_TYPE_MOBILE);
        Map remap = new HashMap<String, Object>();
        remap.put("user", user);
        remap.put("iname", username);
        userService.regist(remap);
        map.put("msg", "success");
      } else {
        map.put("msg", "您的邮箱或者号码有误.");
      }
    }
    return map;
  }
コード例 #2
0
ファイル: IpavsayService.java プロジェクト: Alan666156/ipav
 /** 得到赞的用户信息 */
 public List publicSearchPraiseUser(
     Long actionid, Integer actiontype, Integer pageNo, Integer pageSize, Integer tip) {
   List<String> list =
       commReplyService.queryUserListByActionId(actionid, actiontype, pageNo, pageSize, tip);
   List<IpavuserEntity> rtnList = new ArrayList<IpavuserEntity>();
   for (String i : list) {
     Map map = new HashMap<String, Object>();
     map.put("userid", i);
     map.put("delflg", "delflg");
     IpavuserEntity user = userMapper.getUserByUniKey(map);
     rtnList.add(user);
   }
   return rtnList;
 }