public UserGroupInfo getUserGroupInfoJNA2Model(UserGroupInfoSouth userGroupInfoSouth) {
    UserGroupInfo userGroupInfo = new UserGroupInfo();

    userGroupInfo.setDomainCode(BytesUtils.bytesToStringForIVS(userGroupInfoSouth.domainCode));
    userGroupInfo.setGroupDesc(BytesUtils.bytesToStringForIVS(userGroupInfoSouth.groupDesc));
    userGroupInfo.setGroupID(userGroupInfoSouth.id);
    userGroupInfo.setGroupName(BytesUtils.bytesToStringForIVS(userGroupInfoSouth.name));
    userGroupInfo.setLevel(userGroupInfoSouth.level);
    userGroupInfo.setParentGroupID(userGroupInfoSouth.parentId);
    userGroupInfo.setReserve(BytesUtils.bytesToStringForIVS(userGroupInfoSouth.reserve));

    return userGroupInfo;
  }
  public RoleInfos getRoleListSoap2Modal(RoleInfoListSouth roleInfoList) {

    RoleInfos roleInfos = new RoleInfos();
    if (null != roleInfoList.indexRange) {
      IndexRange indexRange = new IndexRange();
      indexRange.setFromIndex(roleInfoList.indexRange.fromIndex);
      indexRange.setToIndex(roleInfoList.indexRange.toIndex);
      roleInfos.setIndexRange(indexRange);
    }

    roleInfos.setTotal(roleInfoList.total);
    roleInfos.setReserve(BytesUtils.bytesToStringForIVS(roleInfoList.reserve));

    if (null != roleInfoList.roleInfos) {
      List<RoleInfo> roleInfoListModal = new ArrayList<RoleInfo>();
      int count = 0;
      for (RoleInfoSouth roleInfoSouth : roleInfoList.roleInfos) {
        if (count < roleInfoList.total) {
          roleInfoListModal.add(getRoleInfoSoap2Modal(roleInfoSouth));
        } else {
          break;
        }
        count++;
      }
      roleInfos.setRoleInfoList(roleInfoListModal);
    }

    return roleInfos;
  }
  public UserGroup getUserGroupListJNA2Model(UserGroupInfoListSouth userGroupList) {
    UserGroup userGroup = new UserGroup();

    userGroup.setTotal(userGroupList.total);
    userGroup.setReserve(BytesUtils.bytesToStringForIVS(userGroupList.reserve));

    IndexRange indexRange = new IndexRange();
    indexRange.setFromIndex(userGroupList.index.fromIndex);
    indexRange.setToIndex(userGroupList.index.toIndex);
    userGroup.setIndexRange(indexRange);

    UserGroupInfoSouth[] userGroupListSouth = userGroupList.userGroupInfos;

    List<UserGroupInfo> userGroupModelList = new ArrayList<UserGroupInfo>();

    if (null != userGroupListSouth && userGroupListSouth.length > 0) {
      int length =
          getLength(
              userGroupList.total,
              userGroupListSouth.length,
              indexRange.getFromIndex(),
              indexRange.getToIndex());

      for (int i = 0; i < length; i++) {
        UserGroupInfo userGroupInfo = getUserGroupInfoJNA2Model(userGroupListSouth[i]);
        userGroupModelList.add(userGroupInfo);
      }
    }

    userGroup.setUserGroupList(userGroupModelList);
    return userGroup;
  }
  public RoleInfo getRoleInfoSoap2Modal(RoleInfoSouth roleInfoSouth) {
    RoleInfo roleInfo = new RoleInfo();
    if (null != roleInfoSouth.accountRule) {
      AccountRule accountRule = new AccountRule();
      accountRule.setAccountBackNotFit(roleInfoSouth.accountRule.accountBackNotFit);
      accountRule.setAccountLockElapse(roleInfoSouth.accountRule.accountLockElapse);
      accountRule.setAccountLockInterval(roleInfoSouth.accountRule.accountLockInterval);
      accountRule.setAccountLockNum(roleInfoSouth.accountRule.accountLockNum);
      accountRule.setAccountNotFit(roleInfoSouth.accountRule.accountNotFit);
      accountRule.setCheckOldPwd(roleInfoSouth.accountRule.checkOldPwd);
      accountRule.setDomainAccCheckPwd(roleInfoSouth.accountRule.domainAccCheckPwd);
      accountRule.setEnable(roleInfoSouth.accountRule.enable);
      accountRule.setFirstModify(roleInfoSouth.accountRule.firstModify);

      PwdConsistSouth pwdConsistSouth = roleInfoSouth.accountRule.pwdConsist;
      if (null != pwdConsistSouth) {
        PwdConsist pwdConsistModal = new PwdConsist();
        pwdConsistModal.setCapital(pwdConsistSouth.bCapital);
        pwdConsistModal.setFigure(pwdConsistSouth.bFigure);
        pwdConsistModal.setLowercase(pwdConsistSouth.bLowercase);
        pwdConsistModal.setReserve(BytesUtils.bytesToStringForIVS(pwdConsistSouth.reserve));
        pwdConsistModal.setSpecialChar(pwdConsistSouth.bSpecialChar);
        accountRule.setPwdConsist(pwdConsistModal);
      }

      accountRule.setPwdDifferentNum(roleInfoSouth.accountRule.pwdDifferentNum);
      accountRule.setPwdExpireForceNotify(roleInfoSouth.accountRule.pwdExpireForceNotify);
      accountRule.setPwdExpireNotifyTime(roleInfoSouth.accountRule.pwdExpireNotifyTime);
      accountRule.setPwdExpireTime(roleInfoSouth.accountRule.pwdExpireTime);
      accountRule.setPwdMinLen(roleInfoSouth.accountRule.pwdMinLen);
      accountRule.setReserve(BytesUtils.bytesToStringForIVS(roleInfoSouth.accountRule.reserve));
      roleInfo.setAccountRule(accountRule);
    }

    roleInfo.setDomainCode(BytesUtils.bytesToStringForIVS(roleInfoSouth.domainCode));
    roleInfo.setReserve(BytesUtils.bytesToStringForIVS(roleInfoSouth.reserve));
    roleInfo.setRight(BytesUtils.bytesToStringForIVS(roleInfoSouth.right));
    roleInfo.setRoleDescribe(BytesUtils.bytesToStringForIVS(roleInfoSouth.roleDescribe));
    roleInfo.setRoleID(String.valueOf(roleInfoSouth.roleId));
    roleInfo.setRoleName(BytesUtils.bytesToStringForIVS(roleInfoSouth.roleName));
    roleInfo.setRoleType(String.valueOf(roleInfoSouth.roleType));

    return roleInfo;
  }
  /**
   * 南向的UserInfoListSouth转换为领域层的对象
   *
   * @param UserInfoListSouth 南向的用户列表信息
   * @return User 领域层的用户对象
   * @since eSDK IVS V100R003C00
   */
  public User getUserListSoap2Modal(UserInfoListSouth pUserList) {

    User userModal = new User();

    userModal.setTotal(pUserList.total);

    userModal.setReserve(BytesUtils.bytesToStringForIVS(pUserList.reserve));

    IndexRange indexRange = new IndexRange();
    indexRange.setFromIndex(pUserList.index.fromIndex);
    indexRange.setToIndex(pUserList.index.toIndex);
    userModal.setIndexRange(indexRange);

    UserInfoSouth[] userListSouth = pUserList.userInfos;

    List<UserInfo> userList = new ArrayList<UserInfo>();

    if (null != userListSouth && userListSouth.length > 0) {

      int length =
          getLength(
              pUserList.total,
              userListSouth.length,
              indexRange.getFromIndex(),
              indexRange.getToIndex());

      for (int i = 0; i < length; i++) {
        UserInfo user = getUserInfoSoap2Modal(userListSouth[i]);
        userList.add(user);
      }
    }

    userModal.setUserList(userList);

    return userModal;
  }
  /**
   * 南向的UserInfoSouth转换为领域层的对象
   *
   * @param UserInfoSouth 南向的用户信息
   * @return UserInfo 领域层的用户对象
   * @since eSDK IVS V100R003C00
   */
  public UserInfo getUserInfoSoap2Modal(UserInfoSouth userInfoSouth) {
    UserInfo usermodal = new UserInfo();

    usermodal.setDomainCode(BytesUtils.bytesToStringForIVS(userInfoSouth.domainCode));
    usermodal.setEmail(BytesUtils.bytesToStringForIVS(userInfoSouth.email));
    usermodal.setGroupId(userInfoSouth.groupId);
    usermodal.setIsFirstLogin(0 == userInfoSouth.isFirstLogin ? false : true);
    usermodal.setLockTime(BytesUtils.bytesToStringForIVS(userInfoSouth.lockTime));
    usermodal.setLoginName(BytesUtils.bytesToStringForIVS(userInfoSouth.loginName));
    usermodal.setMaxSessionCount(userInfoSouth.maxSessionCount);
    usermodal.setMaxVideoCount(userInfoSouth.maxVideoCount);
    usermodal.setPassword(BytesUtils.bytesToStringForIVS(userInfoSouth.password));
    usermodal.setPhone(BytesUtils.bytesToStringForIVS(userInfoSouth.phone));
    usermodal.setPtzLevel(userInfoSouth.ptzLevel);
    usermodal.setPwdModifyDate(BytesUtils.bytesToStringForIVS(userInfoSouth.pwdModifyDate));
    usermodal.setRegisterDate(BytesUtils.bytesToStringForIVS(userInfoSouth.registerDate));
    usermodal.setReserve(BytesUtils.bytesToStringForIVS(userInfoSouth.reserve));
    usermodal.setRoleId(userInfoSouth.roleId);
    usermodal.setSex(userInfoSouth.sex);

    usermodal.setValidDateFlag(userInfoSouth.validDateFlag);
    usermodal.setValidDateStart(BytesUtils.bytesToStringForIVS(userInfoSouth.validDateStart));
    usermodal.setValidDateEnd(BytesUtils.bytesToStringForIVS(userInfoSouth.validDateEnd));

    usermodal.setStatus(userInfoSouth.status);
    usermodal.setUserDesc(BytesUtils.bytesToStringForIVS(userInfoSouth.userDesc));
    usermodal.setUserDomain(BytesUtils.bytesToStringForIVS(userInfoSouth.userDomain));
    usermodal.setId(userInfoSouth.userId);
    usermodal.setUserName(BytesUtils.bytesToStringForIVS(userInfoSouth.userName));
    usermodal.setUserType(userInfoSouth.userType);

    return usermodal;
  }