예제 #1
0
 public void updateChouJiang() {
   init();
   long uid = getLongData("uid");
   int choujiangSize = getIntData("cjSize");
   boolean isok = uDao.updateChouJiang(uid, choujiangSize);
   if (isok) {
     json.put("isok", true);
   } else {
     json.put("isok", false);
   }
   write();
 }
예제 #2
0
 public void addYQMP() {
   init();
   if (!isPasswordOk(request.getParameter("password"))) {
     return;
   }
   String yqmString = request.getParameter("yqm");
   String jinbi = request.getParameter("jinbi");
   int money = Integer.parseInt(jinbi);
   User user = uDao.getOneUser(uid);
   if (yqmString == null || "".equals(yqmString)) {
     json.put("isok", false);
   } else {
     boolean b = uDao.addYQM(user, yqmString, money);
     if (b) {
       json.put("isok", true);
     } else {
       json.put("isok", false);
     }
   }
   write();
 }
예제 #3
0
 public void updateUserShareQQ() {
   init();
   String uid = request.getParameter("uid");
   String jinbi = request.getParameter("jinbi");
   String typeString = request.getParameter("type");
   int type = Integer.parseInt(typeString);
   long id = Long.parseLong(uid);
   User user = uDao.getOneUser(id);
   boolean b = uDao.updateUser(user);
   if (b) {
     addMoney(Long.parseLong(uid), Long.parseLong(jinbi), typeString);
     if (b) {
       json.put("isok", true);
       json.put("type", typeString);
     } else {
       json.put("isok", false);
       json.put("type", typeString);
     }
   }
   write();
   user = null;
 }
예제 #4
0
 public void updateUser() {
   init();
   String uid = request.getParameter("uid");
   String nicheng = request.getParameter("nicheng");
   String phone = request.getParameter("phone");
   String qqString = request.getParameter("qq");
   String zhifubao = request.getParameter("zhifubao");
   long id = Long.parseLong(uid);
   User user = uDao.getOneUser(id);
   user.setNicheng(nicheng);
   user.setPhone(phone);
   user.setQq(qqString);
   user.setZhifubao(zhifubao);
   boolean b = uDao.updateUser(user);
   if (b) {
     json.put("isok", true);
   } else {
     json.put("isok", false);
   }
   write();
   user = null;
 }
예제 #5
0
 public void updateUserNiChengP() {
   init();
   if (!isPasswordOk(request.getParameter("password"))) {
     return;
   }
   String nc = request.getParameter("nicheng");
   if (nc == null || "".equals(nc)) {
     return;
   }
   user = uDao.updateUser(nc, uid);
   if (user == null) {
     json.put("isok", false);
   } else {
     json.put("isok", true);
   }
   write();
 }
예제 #6
0
  public void addUserP() {

    usermoney = new Usermoney();
    User user2 = null;
    init();
    if (!isPasswordOk(request.getParameter("password"))) {
      return;
    }
    imie = request.getParameter("mac");
    String phone = request.getParameter("phone");
    String initPoint = request.getParameter("point");
    String xh = request.getParameter("xh");
    long shangjia1 = getLongData("shangjia1");
    long shangjia2 = getLongData("shangjia2");
    long shangjia3 = getLongData("shangjia3");
    long shangjia4 = getLongData("shangjia4");
    long shangjia5 = getLongData("shangjia5");
    long point = 0;
    if (initPoint != null) {
      point = Long.parseLong(initPoint);
    }
    if (phone == null || "".equals(phone)) {
      phone = "无";
    }
    if (StringUtils.IsNull(imie)) {
      return;
    } else {
      user2 = uDao.isExit(imie);
      if (user2 == null) {
        user = new User();
        user.setPhone(phone);
        user.setMac(imie);
        user.setTime(new Timestamp(System.currentTimeMillis()));
        user.setXinghao(xh);
        if (imie.length() >= 7) {
          user.setNicheng("蝌蚪" + imie.substring(2, 7));
        } else {
          user.setNicheng("蝌蚪" + imie);
        }
        if (shangjia1 > 0) {
          tServer.updateTGUrlSize(shangjia1);
          user.setShangjia1(shangjia1);
          addHongBao(user.getShangjia1(), user.getNicheng());
          uDao.updateUserTgSize(shangjia1);
        }
        if (shangjia2 > 0) {
          user.setShangjia2(shangjia2);
          uDao.updateUserTgSize(shangjia2);
        }
        if (shangjia3 > 0) {
          user.setShangjia3(shangjia3);
          uDao.updateUserTgSize(shangjia3);
        }
        if (shangjia4 > 0) {
          user.setShangjia4(shangjia4);
          uDao.updateUserTgSize(shangjia4);
        }
        if (shangjia5 > 0) {
          user.setShangjia5(shangjia5);
          uDao.updateUserTgSize(shangjia5);
        }
        user.setIsok(1);
        user.setTj(0l);
        user2 = uDao.addUser(user);
        usermoney.setAllmoney(0l);
        usermoney.setAlljifeng(point);
        addMoney(user2, point);
        if (user2 != null) {
          addFirstRegestHongBao(user2.getId());
        }
      }
      if (user2 == null) {
        json.put("isok", false);
      } else {
        if (!userMoneyDao.isExit(user2.getId())) {
          addMoney(user2, point);
        }
        usermoney = userMoneyDao.getUsermoney(user2.getId());
        json.put("isok", true);
        json.put("user", changeBean(user2, usermoney));
      }
      write();
    }
  }