Пример #1
0
 /** * WEB我发布的说说 */
 public List myReleaseSays(String userid, Integer pageNo, Integer pageSize) {
   if (pageNo == null) pageNo = 1;
   if (pageSize == null) pageSize = 10;
   List<IpavsayEntity> saylist = new ArrayList<IpavsayEntity>();
   IpavuserEntity user = userService.queryUserId(userid);
   Map<String, Object> sqlMap = new HashMap<String, Object>();
   sqlMap.put("companyid", user.getCompanyid());
   sqlMap.put("orgid", user.getOrgid());
   sqlMap.put("userid", userid);
   sqlMap.put("pageNo", (pageNo - 1) * pageSize);
   sqlMap.put("pageSize", pageSize);
   saylist = sayMapper.querymyReleaseSays(sqlMap);
   for (IpavsayEntity say : saylist) {
     IpavuserEntity userr = userService.queryUserId(say.getSayuserid());
     if (userr != null) {
       say.setSayuserimg(
           ContentUtil.IMAGE_ROOT + ContentUtil.IMAGEPATHS.get("user") + userr.getPicpath());
     }
     Map map = new HashMap<String, Object>();
     map.put("actiontype", 1);
     map.put("actionid", say.getSayid());
     List<String> sayimages = sayImageMapper.queryActionfileUrlList(map);
     List<String> newsayimages = new ArrayList<String>();
     for (String simg : sayimages) {
       newsayimages.add(ContentUtil.IMAGE_ROOT + ContentUtil.IMAGEPATHS.get("say") + simg);
     }
     say.setImages(newsayimages);
   }
   return SayListToMap(saylist, userid);
 }
Пример #2
0
  /**
   * 邀请同事发送邮件或者短信
   *
   * @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;
  }
Пример #3
0
 /** 模糊查询用户 */
 public List getUserForName(String username, Integer companyid) {
   if (username.equals("")) {
     return null;
   }
   Map map = new HashMap<String, Object>();
   map.put("username", username);
   map.put("companyid", companyid);
   return userService.getUserForName(map);
 }
Пример #4
0
 /** 根据组织id查询出组织id下面所有用户信息 */
 public List getUserListForOrgid(Integer orgid, String[] orgnoids, Long companyid) {
   return userService.getUserListForOrgid(orgid, orgnoids, companyid);
 }