| | |
| | | import java.util.Set; |
| | | |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | finSysTenantUser.setUserPhone(phone); |
| | | Long sysUserId = finSysTenantUser.getSysUserId(); |
| | | List<S_role> roleList = finSysTenantUserService.getRoleBySysUserId(sysUserId); |
| | | // 过滤仓库管理员的显示 |
| | | roleList.removeIf(role -> role.getRole_name().equals("仓库管理员")); |
| | | |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("list", roleList); |
| | | map.put("data", finSysTenantUser); |
| | |
| | | // 查询父类的orgcode 需要将自己的org先查出来 再根据parentid 查父类 |
| | | String tenantId = sysInfo.getTenantId(); |
| | | if (StringUtils.isNotEmpty(tenantId)) { |
| | | List<FinSysTenant> select = finSysTenantService.select(new FinSysTenant(Long.valueOf(tenantId))); |
| | | if (select != null && select.size() > 0) { |
| | | FinSysTenant finSysTenant = select.get(0); |
| | | if (finSysTenant != null && finSysTenant.getParentId() != null) { |
| | | List<FinSysTenant> parents = |
| | | finSysTenantService.select(new FinSysTenant(finSysTenant.getParentId())); |
| | | if (parents != null && parents.size() > 0) { |
| | | sysInfo.setParentCode(parents.get(0).getCode()); |
| | | } |
| | | FinSysTenant finSysTenant = finSysTenantService.get(new FinSysTenant(Long.valueOf(tenantId))); |
| | | if (finSysTenant != null && finSysTenant.getParentId() != null) { |
| | | FinSysTenant parentTenant = finSysTenantService.get(new FinSysTenant(finSysTenant.getParentId())); |
| | | if (ObjectUtils.isNotEmpty(parentTenant)) { |
| | | sysInfo.setParentCode(parentTenant.getCode()); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |
| | | return ResponseValue.success(sysInfo); |
| | |
| | | // 选择的权限 |
| | | List<Long> roleList = user.getRoleList(); |
| | | // 先删除再添加 |
| | | if (list != null && list.size() > 0) { |
| | | if (!CollectionUtils.isEmpty(list)) { |
| | | Long sysUserId = user.getSysUserId(); |
| | | finSysTenantUserService.execDelRoleUserList(sysUserId); |
| | | // 删除库管员信息记录 |
| | | list.stream().filter(item -> "仓库管理员".equals(item.getRole_name())).findFirst() |
| | | .ifPresent(item -> baseWarehouseManagerService.deleteMangerBySysUserId(sysUserId)); |
| | | } |
| | | if (roleList != null && roleList.size() > 0) { |
| | | if (!CollectionUtils.isEmpty(roleList)) { |
| | | finSysTenantUserService.execInsertRoleUserList(roleList, user.getSysUserId()); |
| | | } |
| | | return ResponseValue.success(1); |
| | |
| | | } |
| | | // 获取运维管理 |
| | | List<S_dept> depts = this.finSysTenantUserService.selectDept(roleName); |
| | | if (depts == null || depts.size() == 0) { |
| | | if (CollectionUtils.isEmpty(depts)) { |
| | | return ResponseValue.error(roleName + "的角色不存在"); |
| | | } |
| | | // 根据员工编号查询,如果存在则提示 |