Пример #1
0
  public void insert(User user) {
    String userId = SessionUtils.getCurrentUserId();
    if (StringUtils.isEmpty(userId)) {
      userId = user.getUserId();
    }

    user.setPassword(MD5Utils.getMD5String(user.getPassword()));

    user.setDelflag("1");

    Timestamp sysdate = new Timestamp(System.currentTimeMillis());
    user.setCreateUser(userId);
    user.setCreateTime(sysdate);
    user.setUpdateUser(userId);
    user.setUpdateTime(sysdate);
    this.userDao.insert(user);
  }
Пример #2
0
 public void update(User user) {
   Timestamp sysdate = new Timestamp(System.currentTimeMillis());
   user.setUpdateUser(SessionUtils.getCurrentUserId());
   user.setUpdateTime(sysdate);
   this.userDao.updateByPrimaryKey(user);
 }