| | |
| | | import java.util.Set; |
| | | |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.core.utils.MapperUtil; |
| | | import com.consum.base.core.utils.PageUtil; |
| | | import com.consum.base.pojo.FinSysTenantUserSearchParam; |
| | | import com.consum.base.pojo.FinSysTenantUserUpdParam; |
| | | import com.consum.base.pojo.ImportUserParam; |
| | |
| | | import com.iplatform.model.po.S_dept; |
| | | import com.iplatform.model.po.S_role; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.NumberGenerator; |
| | |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.web.ResponseValue; |
| | | |
| | | import cn.hutool.core.util.ReflectUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | param.setTenantCode(Long.valueOf(finSysTenant.getCode())); |
| | | } |
| | | } |
| | | GenericPager<FinSysTenantUser> pager = this.finSysTenantUserService.queryAllPageUser(param); |
| | | |
| | | List<FinSysTenantUserVO> resultList = new ArrayList<>(); |
| | | for (FinSysTenantUser finSysTenantUser : pager.getDatas()) { |
| | | FinSysTenantUserVO userVO = new FinSysTenantUserVO(); |
| | | PageUtil<FinSysTenantUserVO> pager = this.finSysTenantUserService.queryAllPageUser(param); |
| | | for (FinSysTenantUserVO finSysTenantUser : pager.getDatas()) { |
| | | String tel = finSysTenantUser.getUserPhone() != null |
| | | ? AESUtils.decryptStrAES(finSysTenantUser.getUserPhone(), PlatformRSAUtils.AES_KEY) : null; |
| | | finSysTenantUser.setUserPhone(StringUtils.isNotEmpty(tel) ? PhoneNumberUtils.maskMobile(tel) : ""); |
| | | |
| | | List<S_role> list = finSysTenantUserService.getByUserId(finSysTenantUser.getSysUserId()); |
| | | // 列表不需要查询角色,只显示列表所需要的信息 |
| | | /*List<S_role> list = finSysTenantUserService.getByUserId(finSysTenantUser.getSysUserId()); |
| | | StringBuilder roleStr = new StringBuilder(); |
| | | list.forEach(s_role -> roleStr.append(s_role.getRole_name()).append(" ")); |
| | | finSysTenantUser.setRoleStr(roleStr.toString()); |
| | | finSysTenantUser.setIsSupplier(finSysTenantUser.getSupplierId() != null ? "是" : "否");*/ |
| | | |
| | | finSysTenantUser.setIsSupplier(finSysTenantUser.getSupplierId() != null ? "是" : "否"); |
| | | |
| | | BeanUtils.copyProperties(finSysTenantUser, userVO); |
| | | FinSysTenantDepartment department = finSysTenantDepartmentService.getById(finSysTenantUser.getSysDeptId()); |
| | | if (Objects.nonNull(department)) { |
| | | userVO.setSysDeptName(department.getName()); |
| | | } |
| | | resultList.add(userVO); |
| | | } |
| | | |
| | | ReflectUtil.setFieldValue(pager, "datas", resultList); |
| | | |
| | | return ResponseValue.success(pager); |
| | | } |
| | | |
| | |
| | | // 1. 根据 user.getSysUserId() 查询 |
| | | // 已有的权限 |
| | | Long sysUserId = user.getSysUserId(); |
| | | List<S_role> list = finSysTenantUserService.getByUserId(sysUserId); |
| | | List<S_role> list = finSysTenantUserService.getRoleBySysUserId(sysUserId); |
| | | // 选择的权限 |
| | | List<Long> roleList = user.getRoleList(); |
| | | // 先删除再添加 |
| | | if (list != null && list.size() > 0) { |
| | | if (!CollectionUtils.isEmpty(list)) { |
| | | finSysTenantUserService.execDelRoleUserList(sysUserId); |
| | | } |
| | | if (roleList != null && roleList.size() > 0) { |
| | | if (!CollectionUtils.isEmpty(roleList)) { |
| | | finSysTenantUserService.execInsertRoleUserList(roleList, sysUserId); |
| | | } |
| | | this.getFinSysTenantUserCache().remove(sysUserId.toString()); |
| | |
| | | if (finSysTenantUser == null) { |
| | | return ResponseValue.error("用户信息不存在"); |
| | | } |
| | | String s = AESUtils.decryptStrAES(finSysTenantUser.getUserPhone(), PlatformRSAUtils.AES_KEY); |
| | | |
| | | finSysTenantUser.setUserPhone(s); |
| | | String phone = AESUtils.decryptStrAES(finSysTenantUser.getUserPhone(), PlatformRSAUtils.AES_KEY); |
| | | finSysTenantUser.setUserPhone(phone); |
| | | Long sysUserId = finSysTenantUser.getSysUserId(); |
| | | List<S_role> list = finSysTenantUserService.getByUserId(sysUserId); |
| | | List<S_role> roleList = finSysTenantUserService.getRoleBySysUserId(sysUserId); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("list", list); |
| | | map.put("list", roleList); |
| | | map.put("data", finSysTenantUser); |
| | | return ResponseValue.success(map); |
| | | } |
| | |
| | | sysInfo.setUserPhone(AESUtils.decryptStrAES(userPhone, key)); |
| | | } |
| | | |
| | | // 查询 用户角色 TODO 临时解决 将来放配置文件中 |
| | | // 查询 用户角色 |
| | | // 已有的权限 |
| | | List<S_role> list = finSysTenantUserService.getByUserId(sysInfo.getSysUserId()); |
| | | List<S_role> list = finSysTenantUserService.getRoleBySysUserId(sysInfo.getSysUserId()); |
| | | for (S_role s_role : list) { |
| | | // TODO 临时解决 将来放配置文件中 |
| | | if (s_role.getRole_id() != null && s_role.getRole_id().equals(1690961420053L)) { |
| | | sysInfo.setKfStatus(1); |
| | | } |
| | |
| | | } |
| | | // 1. 根据 user.getSysUserId() 查询 |
| | | // 已有的权限 |
| | | List<S_role> list = finSysTenantUserService.getByUserId(user.getSysUserId()); |
| | | List<S_role> list = finSysTenantUserService.getRoleBySysUserId(user.getSysUserId()); |
| | | // 选择的权限 |
| | | List<Long> roleList = user.getRoleList(); |
| | | // 先删除再添加 |