User user = userDao.findByLoginName(userName);
if(user == null) throw new UsernameNotFoundException(userName + " is not existed.");
LoxiaUserDetails result = new LoxiaUserDetails();
User u = new User();
OperatingUnit ou = new OperatingUnit();
OperatingUnitType ouType = new OperatingUnitType();
try {
PropertyUtils.copyProperties(user.getOu().getType(), ouType);
ou.setId(user.getOu().getId());
ou.setCode(user.getOu().getCode());
ou.setName(user.getOu().getName());