package com.qianwen.smartman.modules.system.wrapper; import java.util.List; import java.util.Objects; import com.qianwen.smartman.common.cache.DictCache; import com.qianwen.smartman.common.cache.SysCache; import com.qianwen.smartman.common.enums.DictEnum; import com.qianwen.core.mp.support.BaseEntityWrapper; import com.qianwen.core.tool.utils.BeanUtil; import com.qianwen.core.tool.utils.Func; import com.qianwen.smartman.modules.system.entity.Tenant; import com.qianwen.smartman.modules.system.entity.User; import com.qianwen.smartman.modules.system.vo.UserVO; /* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/system/wrapper/UserWrapper.class */ public class UserWrapper extends BaseEntityWrapper { public static UserWrapper build() { return new UserWrapper(); } public UserVO entityVO(User user) { UserVO userVO = (UserVO) Objects.requireNonNull(BeanUtil.copy(user, UserVO.class)); Tenant tenant = SysCache.getTenant(user.getTenantId()); List roleName = SysCache.getRoleNames(user.getRoleId()); List deptName = SysCache.getDeptNames(user.getDeptId()); List postName = SysCache.getPostNames(user.getPostId()); userVO.setTenantName(tenant.getTenantName()); userVO.setRoleName(Func.join(roleName)); userVO.setDeptName(Func.join(deptName)); userVO.setPostName(Func.join(postName)); userVO.setSexName(DictCache.getValue(DictEnum.SEX, user.getSex())); userVO.setUserTypeName(DictCache.getValue(DictEnum.USER_TYPE, user.getUserType())); return userVO; } }