@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED) public boolean create(String operator, User user) throws Exception { int ret = userDao.insert(user); SysLog sysLog = new SysLog(); sysLog.setUserName(operator); sysLog.setAction(Thread.currentThread().getStackTrace()[1].getMethodName()); sysLog.setClassName(this.getClass().getName()); sysLog.setClassObj(user.toString()); sysLog.setResult(ret + ""); sysLogDao.insert(sysLog); return ret > 0 ? true : false; }
public boolean modifyUsersGroup(String operator, Map map) { int ret = userDao.modifyUsersGroup(map); if (ret > 0) { SysLog sysLog = new SysLog(); sysLog.setUserName(operator); sysLog.setAction(Thread.currentThread().getStackTrace()[1].getMethodName()); sysLog.setClassName(this.getClass().getName()); sysLog.setClassObj( "userGroup:" + map.get("userGroup") + ";userIds:" + map.get("userIds").toString()); sysLog.setResult(ret + ""); sysLogDao.insert(sysLog); } return ret > 0 ? true : false; }
public User login(User user) { user.setPassword(MD5.md5(user.getPassword())); User retUser = userDao.login(user); return retUser; }
public List<User> getUsersByGroup(int groupId) { return userDao.getUsersByGroup(groupId); }
public User get(User user) { return userDao.get(user); }