Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
  /**
   * 邀请同事发送邮件或者短信(变更)
   *
   * @throws Exception
   */
  public Map invitationColleague(IpavuserEntity ctuser, String name, String mailOrphone) {
    Map map = new HashMap<String, String>();
    IpavuserEntity user = new IpavuserEntity();
    user.setUsername(name);
    user.setSex(1 + "");
    user.setCompanyid(ctuser.getCompanyid());

    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", ctuser.getUsername());
      try {
        userService.addUser(remap);
      } catch (Exception e) {
        map.put("msg", e.getMessage());
        String[] users = {user.getUserid()};
        userService.delUser(users);
        return map;
      }
      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", ctuser.getUsername());
        try {
          userService.addUser(remap);
        } catch (Exception e) {
          map.put("msg", e.getMessage());
          String[] users = {user.getUserid()};
          userService.delUser(users);
          return map;
        }
        map.put("msg", "success");
      } else {
        map.put("msg", "您的邮箱或者号码有误.");
      }
    }
    return map;
  }