package com.jojubanking.boot.module.system.convert.user;

import com.jojubanking.boot.module.system.api.user.dto.AdminUserRespDTO;
import com.jojubanking.boot.module.system.controller.admin.user.vo.profile.UserProfileRespVO;
import com.jojubanking.boot.module.system.controller.admin.user.vo.profile.UserProfileRespVO.Post;
import com.jojubanking.boot.module.system.controller.admin.user.vo.profile.UserProfileRespVO.Role;
import com.jojubanking.boot.module.system.controller.admin.user.vo.profile.UserProfileRespVO.SocialUser;
import com.jojubanking.boot.module.system.controller.admin.user.vo.profile.UserProfileUpdatePasswordReqVO;
import com.jojubanking.boot.module.system.controller.admin.user.vo.profile.UserProfileUpdateReqVO;
import com.jojubanking.boot.module.system.controller.admin.user.vo.user.UserCreateReqVO;
import com.jojubanking.boot.module.system.controller.admin.user.vo.user.UserExcelVO;
import com.jojubanking.boot.module.system.controller.admin.user.vo.user.UserImportExcelVO;
import com.jojubanking.boot.module.system.controller.admin.user.vo.user.UserPageItemRespVO;
import com.jojubanking.boot.module.system.controller.admin.user.vo.user.UserPageItemRespVO.Dept;
import com.jojubanking.boot.module.system.controller.admin.user.vo.user.UserSimpleRespVO;
import com.jojubanking.boot.module.system.controller.admin.user.vo.user.UserUpdateReqVO;
import com.jojubanking.boot.module.system.dal.dataobject.dept.DeptDO;
import com.jojubanking.boot.module.system.dal.dataobject.dept.PostDO;
import com.jojubanking.boot.module.system.dal.dataobject.permission.RoleDO;
import com.jojubanking.boot.module.system.dal.dataobject.social.SocialUserDO;
import com.jojubanking.boot.module.system.dal.dataobject.user.AdminUserDO;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.annotation.Generated;

@Generated(
    value = "org.mapstruct.ap.MappingProcessor",
    date = "2025-12-05T11:32:08+0800",
    comments = "version: 1.4.1.Final, compiler: javac, environment: Java 1.8.0_201 (Oracle Corporation)"
)
public class UserConvertImpl implements UserConvert {

    @Override
    public UserPageItemRespVO convert(AdminUserDO bean) {
        if ( bean == null ) {
            return null;
        }

        UserPageItemRespVO userPageItemRespVO = new UserPageItemRespVO();

        userPageItemRespVO.setUsername( bean.getUsername() );
        userPageItemRespVO.setNickname( bean.getNickname() );
        userPageItemRespVO.setRemark( bean.getRemark() );
        userPageItemRespVO.setDeptId( bean.getDeptId() );
        Set<Long> set = bean.getPostIds();
        if ( set != null ) {
            userPageItemRespVO.setPostIds( new HashSet<Long>( set ) );
        }
        userPageItemRespVO.setEmail( bean.getEmail() );
        userPageItemRespVO.setMobile( bean.getMobile() );
        userPageItemRespVO.setSex( bean.getSex() );
        userPageItemRespVO.setAvatar( bean.getAvatar() );
        userPageItemRespVO.setId( bean.getId() );
        userPageItemRespVO.setStatus( bean.getStatus() );
        userPageItemRespVO.setLoginIp( bean.getLoginIp() );
        userPageItemRespVO.setLoginDate( bean.getLoginDate() );
        userPageItemRespVO.setCreateTime( bean.getCreateTime() );

        return userPageItemRespVO;
    }

    @Override
    public Dept convert(DeptDO bean) {
        if ( bean == null ) {
            return null;
        }

        Dept dept = new Dept();

        dept.setId( bean.getId() );
        dept.setName( bean.getName() );

        return dept;
    }

    @Override
    public AdminUserDO convert(UserCreateReqVO bean) {
        if ( bean == null ) {
            return null;
        }

        AdminUserDO adminUserDO = new AdminUserDO();

        adminUserDO.setUsername( bean.getUsername() );
        adminUserDO.setPassword( bean.getPassword() );
        adminUserDO.setNickname( bean.getNickname() );
        adminUserDO.setRemark( bean.getRemark() );
        adminUserDO.setDeptId( bean.getDeptId() );
        Set<Long> set = bean.getPostIds();
        if ( set != null ) {
            adminUserDO.setPostIds( new HashSet<Long>( set ) );
        }
        adminUserDO.setEmail( bean.getEmail() );
        adminUserDO.setMobile( bean.getMobile() );
        adminUserDO.setSex( bean.getSex() );
        adminUserDO.setAvatar( bean.getAvatar() );

        return adminUserDO;
    }

    @Override
    public AdminUserDO convert(UserUpdateReqVO bean) {
        if ( bean == null ) {
            return null;
        }

        AdminUserDO adminUserDO = new AdminUserDO();

        adminUserDO.setId( bean.getId() );
        adminUserDO.setUsername( bean.getUsername() );
        adminUserDO.setNickname( bean.getNickname() );
        adminUserDO.setRemark( bean.getRemark() );
        adminUserDO.setDeptId( bean.getDeptId() );
        Set<Long> set = bean.getPostIds();
        if ( set != null ) {
            adminUserDO.setPostIds( new HashSet<Long>( set ) );
        }
        adminUserDO.setEmail( bean.getEmail() );
        adminUserDO.setMobile( bean.getMobile() );
        adminUserDO.setSex( bean.getSex() );
        adminUserDO.setAvatar( bean.getAvatar() );

        return adminUserDO;
    }

    @Override
    public UserExcelVO convert02(AdminUserDO bean) {
        if ( bean == null ) {
            return null;
        }

        UserExcelVO userExcelVO = new UserExcelVO();

        userExcelVO.setId( bean.getId() );
        userExcelVO.setUsername( bean.getUsername() );
        userExcelVO.setNickname( bean.getNickname() );
        userExcelVO.setEmail( bean.getEmail() );
        userExcelVO.setMobile( bean.getMobile() );
        userExcelVO.setSex( bean.getSex() );
        userExcelVO.setStatus( bean.getStatus() );
        userExcelVO.setLoginIp( bean.getLoginIp() );
        userExcelVO.setLoginDate( bean.getLoginDate() );

        return userExcelVO;
    }

    @Override
    public AdminUserDO convert(UserImportExcelVO bean) {
        if ( bean == null ) {
            return null;
        }

        AdminUserDO adminUserDO = new AdminUserDO();

        adminUserDO.setUsername( bean.getUsername() );
        adminUserDO.setNickname( bean.getNickname() );
        adminUserDO.setDeptId( bean.getDeptId() );
        adminUserDO.setEmail( bean.getEmail() );
        adminUserDO.setMobile( bean.getMobile() );
        adminUserDO.setSex( bean.getSex() );
        adminUserDO.setStatus( bean.getStatus() );

        return adminUserDO;
    }

    @Override
    public UserProfileRespVO convert03(AdminUserDO bean) {
        if ( bean == null ) {
            return null;
        }

        UserProfileRespVO userProfileRespVO = new UserProfileRespVO();

        userProfileRespVO.setUsername( bean.getUsername() );
        userProfileRespVO.setNickname( bean.getNickname() );
        userProfileRespVO.setRemark( bean.getRemark() );
        userProfileRespVO.setDeptId( bean.getDeptId() );
        Set<Long> set = bean.getPostIds();
        if ( set != null ) {
            userProfileRespVO.setPostIds( new HashSet<Long>( set ) );
        }
        userProfileRespVO.setEmail( bean.getEmail() );
        userProfileRespVO.setMobile( bean.getMobile() );
        userProfileRespVO.setSex( bean.getSex() );
        userProfileRespVO.setAvatar( bean.getAvatar() );
        userProfileRespVO.setId( bean.getId() );
        userProfileRespVO.setStatus( bean.getStatus() );
        userProfileRespVO.setLoginIp( bean.getLoginIp() );
        userProfileRespVO.setLoginDate( bean.getLoginDate() );
        userProfileRespVO.setCreateTime( bean.getCreateTime() );

        return userProfileRespVO;
    }

    @Override
    public List<Role> convertList(List<RoleDO> list) {
        if ( list == null ) {
            return null;
        }

        List<Role> list1 = new ArrayList<Role>( list.size() );
        for ( RoleDO roleDO : list ) {
            list1.add( roleDOToRole( roleDO ) );
        }

        return list1;
    }

    @Override
    public com.jojubanking.boot.module.system.controller.admin.user.vo.profile.UserProfileRespVO.Dept convert02(DeptDO bean) {
        if ( bean == null ) {
            return null;
        }

        com.jojubanking.boot.module.system.controller.admin.user.vo.profile.UserProfileRespVO.Dept dept = new com.jojubanking.boot.module.system.controller.admin.user.vo.profile.UserProfileRespVO.Dept();

        dept.setId( bean.getId() );
        dept.setName( bean.getName() );

        return dept;
    }

    @Override
    public AdminUserDO convert(UserProfileUpdateReqVO bean) {
        if ( bean == null ) {
            return null;
        }

        AdminUserDO adminUserDO = new AdminUserDO();

        adminUserDO.setNickname( bean.getNickname() );
        adminUserDO.setEmail( bean.getEmail() );
        adminUserDO.setMobile( bean.getMobile() );
        adminUserDO.setSex( bean.getSex() );

        return adminUserDO;
    }

    @Override
    public AdminUserDO convert(UserProfileUpdatePasswordReqVO bean) {
        if ( bean == null ) {
            return null;
        }

        AdminUserDO adminUserDO = new AdminUserDO();

        return adminUserDO;
    }

    @Override
    public List<Post> convertList02(List<PostDO> list) {
        if ( list == null ) {
            return null;
        }

        List<Post> list1 = new ArrayList<Post>( list.size() );
        for ( PostDO postDO : list ) {
            list1.add( postDOToPost( postDO ) );
        }

        return list1;
    }

    @Override
    public List<SocialUser> convertList03(List<SocialUserDO> list) {
        if ( list == null ) {
            return null;
        }

        List<SocialUser> list1 = new ArrayList<SocialUser>( list.size() );
        for ( SocialUserDO socialUserDO : list ) {
            list1.add( socialUserDOToSocialUser( socialUserDO ) );
        }

        return list1;
    }

    @Override
    public List<UserSimpleRespVO> convertList04(List<AdminUserDO> list) {
        if ( list == null ) {
            return null;
        }

        List<UserSimpleRespVO> list1 = new ArrayList<UserSimpleRespVO>( list.size() );
        for ( AdminUserDO adminUserDO : list ) {
            list1.add( adminUserDOToUserSimpleRespVO( adminUserDO ) );
        }

        return list1;
    }

    @Override
    public AdminUserRespDTO convert4(AdminUserDO bean) {
        if ( bean == null ) {
            return null;
        }

        AdminUserRespDTO adminUserRespDTO = new AdminUserRespDTO();

        adminUserRespDTO.setId( bean.getId() );
        adminUserRespDTO.setNickname( bean.getNickname() );
        adminUserRespDTO.setStatus( bean.getStatus() );
        adminUserRespDTO.setDeptId( bean.getDeptId() );
        Set<Long> set = bean.getPostIds();
        if ( set != null ) {
            adminUserRespDTO.setPostIds( new HashSet<Long>( set ) );
        }
        adminUserRespDTO.setMobile( bean.getMobile() );

        return adminUserRespDTO;
    }

    @Override
    public List<AdminUserRespDTO> convertList4(List<AdminUserDO> users) {
        if ( users == null ) {
            return null;
        }

        List<AdminUserRespDTO> list = new ArrayList<AdminUserRespDTO>( users.size() );
        for ( AdminUserDO adminUserDO : users ) {
            list.add( convert4( adminUserDO ) );
        }

        return list;
    }

    protected Role roleDOToRole(RoleDO roleDO) {
        if ( roleDO == null ) {
            return null;
        }

        Role role = new Role();

        role.setId( roleDO.getId() );
        role.setName( roleDO.getName() );

        return role;
    }

    protected Post postDOToPost(PostDO postDO) {
        if ( postDO == null ) {
            return null;
        }

        Post post = new Post();

        post.setId( postDO.getId() );
        post.setName( postDO.getName() );

        return post;
    }

    protected SocialUser socialUserDOToSocialUser(SocialUserDO socialUserDO) {
        if ( socialUserDO == null ) {
            return null;
        }

        SocialUser socialUser = new SocialUser();

        socialUser.setType( socialUserDO.getType() );
        socialUser.setOpenid( socialUserDO.getOpenid() );

        return socialUser;
    }

    protected UserSimpleRespVO adminUserDOToUserSimpleRespVO(AdminUserDO adminUserDO) {
        if ( adminUserDO == null ) {
            return null;
        }

        UserSimpleRespVO userSimpleRespVO = new UserSimpleRespVO();

        userSimpleRespVO.setId( adminUserDO.getId() );
        userSimpleRespVO.setNickname( adminUserDO.getNickname() );

        return userSimpleRespVO;
    }
}
