| | |
| | | |
| | | // 处理用户与部门的关系 |
| | | List businessDepts = (List<?>) dataItem.get("businessDepts"); |
| | | if (CollectionUtils.isEmpty(businessDepts)) { |
| | | continue; |
| | | } |
| | | |
| | | if (CollectionUtils.isNotEmpty(businessDepts)) { |
| | | List<List<String>> deptInfoList = new ArrayList<>(); |
| | | List<List<String>> hospInfoList = new ArrayList<>(); |
| | | log.info("------businessDepts是否有值:{}", businessDepts.size()); |
| | |
| | | if (businessDept instanceof Map) { |
| | | Map<String, Object> businessDeptMap = (Map<String, Object>) businessDept; |
| | | log.info("------businessDeptMap是否有值:{}", businessDeptMap); |
| | | // Long hisDeptId = (Long) personnelDeptMap.get("deptId"); |
| | | String hisDeptId = getStringValue(businessDeptMap, "deptId"); |
| | | log.info("------hisDeptId是否有值:{}, reqVO.getOrgId()的值为:{}", hisDeptId, reqVO.getCampusId()); |
| | | //在这里,hisDeptId就是deptCode |
| | |
| | | sysUser.setHospInfo(gson.toJson(hospInfoList)); |
| | | sysUser.setDeptInfo(gson.toJson(deptInfoList)); |
| | | sysUser2Mapper.updateUser(sysUser); |
| | | } |
| | | |
| | | //设置一个默认角色(医生角色) |
| | | List<SysUserRole> userRoleList = new ArrayList(); |
| | | SysUserRole sur = new SysUserRole(); |
| | | sur.setUserId(sysUser.getUserId()); |
| | | sur.setRoleId(3L); |
| | | sur.setRoleId(4L); |
| | | sur.setOrgid(sysUser.getOrgid()); |
| | | |
| | | //先查询一下,是否存在 |
| | | SysUserRole sysUserRole = sysUserRoleMapper.selectUserRoleByRoleIdAndUserId(3L, sysUser.getUserId()); |
| | | SysUserRole sysUserRole = sysUserRoleMapper.selectUserRoleByRoleIdAndUserId(4L, sysUser.getUserId()); |
| | | if (ObjectUtils.isNotEmpty(sysUserRole)) continue; |
| | | |
| | | userRoleList.add(sur); |