| | |
| | | @Override |
| | | public LoginAppUser findByUsername(String username) { |
| | | SysUser sysUser = this.selectByUsername(username); |
| | | if(sysUser==null){ |
| | | if (sysUser == null) { |
| | | return null; |
| | | } |
| | | else { |
| | | } else { |
| | | return getLoginAppUser(sysUser); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 获取登录用户的一系列信息 hrj 06-04修改 |
| | | * |
| | | * @param sysUser |
| | | * @param sysUserNew |
| | | * @return |
| | | */ |
| | | @Override |
| | | public LoginAppUser getLoginAppUser(SysUser sysUser) { |
| | | public LoginAppUser getLoginAppUser(SysUser sysUserNew) { |
| | | LoginAppUser loginAppUser = new LoginAppUser(); |
| | | SysUser sysUserNew = this.baseMapper.selectById(sysUser); |
| | | SysUser sysUser = this.baseMapper.selectById(sysUserNew); |
| | | if (sysUser != null) { |
| | | //返回的数据为什么要把密码也返回?清空!! |
| | | loginAppUser.setPassword(""); |
| | | loginAppUser.setNewPassword(""); |
| | | loginAppUser.setOldPassword(""); |
| | | |
| | | BeanUtils.copyProperties(sysUser, loginAppUser); |
| | | //获取用户所属组织机构列表 |
| | | loginAppUser.setDefaultAuth(sysUserNew.getDefaultAuth()); |
| | | loginAppUser.setDefaultAuth(sysUser.getDefaultAuth()); |
| | | List<SysOrganization> sysOrganizations = organizationService.findListByUserId(sysUser.getId()); |
| | | //设置组织机构集合 |
| | | loginAppUser.setOrganizations(sysOrganizations); |
| | | if (sysOrganizations != null) { |
| | | loginAppUser.setOrganizations(sysOrganizations); |
| | | } |
| | | List<SysRole> sysRoles = roleUserService.findRolesByUserId(sysUser.getId()); |
| | | // 设置角色 |
| | | loginAppUser.setRoles(sysRoles); |
| | |
| | | loginAppUser.setPermissions(permissions); |
| | | } |
| | | } |
| | | //是否医院管理员 |
| | | com.kidgrow.usercenter.model.SysDoctor sysDoctor = findDoctorByUserId(sysUser.getId()); |
| | | if (sysDoctor.getIsAdminUser() != null) { |
| | | loginAppUser.setHAdminUser(sysDoctor.getIsAdminUser()); |
| | | } |
| | | //医院信息 只有H端要返回的信息 |
| | | if (sysUser.getTenantId().toLowerCase().equals(CommonConstant.H_TENANT.toLowerCase())) { |
| | | DoctorUserAll doctorUserAllVo = baseMapper.findDoctorUserAllData(sysUser.getId()); |
| | | |
| | | //医院信息 |
| | | DoctorUserAll doctorUserAllVo = baseMapper.findDoctorUserAllData(sysUser.getId()); |
| | | if (doctorUserAllVo != null) { |
| | | loginAppUser.setDoctorUserAllVO(doctorUserAllVo); |
| | | //是否医院管理员 |
| | | loginAppUser.setHAdminUser(doctorUserAllVo.getIsAdminUser()); |
| | | } |
| | | } |
| | | return loginAppUser; |
| | |
| | | |
| | | @Override |
| | | public ResultBody findCountByMap(Map<String, Object> map) { |
| | | map.put("enable",1); |
| | | map.put("is_del",0); |
| | | map.put("enable", 1); |
| | | map.put("is_del", 0); |
| | | Integer integer = baseMapper.selectCountByMap(map); |
| | | return ResultBody.ok().data(integer); |
| | | } |
| | |
| | | if (d) { |
| | | userRegVo.setDepartmentId(sysDepartment.getId()); |
| | | //自动充入系统指定的试用套餐 |
| | | if(!saveProductDetail(sysHospital.getId(),sysDepartment.getId(),sysHospital.getHospitalName(),sysDepartment.getDepartmentName())) |
| | | { |
| | | if (!saveProductDetail(sysHospital.getId(), sysDepartment.getId(), sysHospital.getHospitalName(), sysDepartment.getDepartmentName())) { |
| | | isSuccess = false; |
| | | expMsg = "套餐充值失败"; |
| | | } |
| | |
| | | |
| | | //业务执行中途出错 |
| | | if (isReg && !isSuccess) { |
| | | //注册过程失败 |
| | | return ResultBody.failed(expMsg); |
| | | } |
| | | if (!isReg && departmetAccountsCount(userRegVo.getDepartmentId()) < 1) { |
| | |
| | | |
| | | /** |
| | | * feign客户端调用写入试用套餐 |
| | | * |
| | | * @param hospitalId |
| | | * @param departmentId |
| | | * @param hospitalName |
| | | * @param departmentName |
| | | * @return |
| | | */ |
| | | private boolean saveProductDetail(Long hospitalId,Long departmentId,String hospitalName,String departmentName) |
| | | { |
| | | Map<String,Object> params=new HashMap<String,Object>(); |
| | | params.put("hospitalId",hospitalId); |
| | | params.put("departmentId",departmentId); |
| | | params.put("hospitalName",hospitalName); |
| | | params.put("departmentName",departmentName); |
| | | ResultBody resultBody= productOrderService.saveProductDetail(params); |
| | | return (boolean)resultBody.getData(); |
| | | private boolean saveProductDetail(Long hospitalId, Long departmentId, String hospitalName, String departmentName) { |
| | | Map<String, Object> params = new HashMap<String, Object>(); |
| | | params.put("hospitalId", hospitalId); |
| | | params.put("departmentId", departmentId); |
| | | params.put("hospitalName", hospitalName); |
| | | params.put("departmentName", departmentName); |
| | | ResultBody resultBody = productOrderService.saveProductDetail(params); |
| | | return (boolean) resultBody.getData(); |
| | | } |
| | | |
| | | /** |
| | | * 获取医院科室下的所有H端有效的医生 |
| | | * |
| | |
| | | if (sysDepartment == null) { |
| | | return 0; |
| | | } else { |
| | | Long sysHospitalId=HospitalIdByDepartmentId(depatmentId); |
| | | if (sysHospitalId>0) { |
| | | Long sysHospitalId = HospitalIdByDepartmentId(depatmentId); |
| | | if (sysHospitalId > 0) { |
| | | List<HospitalDoctorListVo> hospitalDoctorListVos = baseMapper.hospitalDoctorList(sysHospitalId, depatmentId, CommonConstant.HOSPITAL_DOCTOR_ID, CommonConstant.HOSPITAL_ADMIN_ID); |
| | | if (hospitalDoctorListVos != null) { |
| | | int doctorCount = hospitalDoctorListVos.size(); |
| | | int accountCount = sysDepartment.getAccountsCount().intValue(); |
| | | int liveCount=accountCount - doctorCount; |
| | | int liveCount = accountCount - doctorCount; |
| | | return liveCount; |
| | | } else { |
| | | return 0; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | } else { |
| | | return 0; |
| | | } |
| | | } |
| | |
| | | QueryWrapper<SysDoctor> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("user_id", id); |
| | | List<SysDoctor> sysDoctors = sysDoctorMapper.selectList(queryWrapper); |
| | | if(!sysDoctors.isEmpty()){ |
| | | sysDoctors.forEach(e->{ |
| | | if (!sysDoctors.isEmpty()) { |
| | | sysDoctors.forEach(e -> { |
| | | e.setIsDel(true); |
| | | sysDoctorMapper.updateById(e); |
| | | }); |