| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.*; |
| | |
| | | @Resource |
| | | private RestHighLevelClient restHighLevelClient; |
| | | |
| | | @Resource |
| | | ZfDoctorShareService zfDoctorShareService; |
| | | |
| | | |
| | | @Override |
| | | public AjaxResult selectDoctorList(ZfDoctor zfDoctor, Integer pageNum, Integer pageSize) { |
| | | // LambdaQueryWrapper<ZfDoctor> lqw = buildCondition(zfDoctor); |
| | |
| | | // return AjaxResult.success(data); |
| | | //要查自己家庭的 |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | if (myself == null) { |
| | | // System.out.println("ssssss"); |
| | | return AjaxResult.success("您没加入到对应的家庭,请联系管理员"); |
| | | } |
| | | Long familyId = myself.getFamilyId(); |
| | | //也要查别人授权的 |
| | | List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | |
| | | idList.add(familyId); |
| | | // String familyIds = listFamilyIds(); |
| | | // String secondFamilyAuthority = listSecondFamilyIds(); |
| | | LambdaQueryWrapper<ZfDoctor> lqw = buildCondition(zfDoctor, idList); |
| | | |
| | | //查看别人分享 |
| | | List<ZfDoctor> bs = zfDoctorShareService.listUserId(myself.getUserId()); |
| | | |
| | | LambdaQueryWrapper<ZfDoctor> lqw = buildCondition(zfDoctor, idList); |
| | | |
| | | Page<ZfDoctor> zfDoctorPage = new Page<>(pageNum, pageSize); |
| | | Page<ZfDoctor> pageResult = page(zfDoctorPage, lqw); |
| | |
| | | List<ZfDoctor> beanRecords = pageResult.getRecords();//得到查询出来的数据 |
| | | |
| | | List<ZfDoctor> dtoResult = markOwnData(familyId, beanRecords); |
| | | |
| | | dtoResult.addAll(bs); |
| | | HashMap<String, Object> data = MapUtils.getResult(pageResult, dtoResult); |
| | | return AjaxResult.success(data); |
| | | } |
| | |
| | | //加上自己家庭的id |
| | | idList.add(familyId); |
| | | |
| | | //查看别人分享 |
| | | List<ZfDoctor> bs = zfDoctorShareService.listUserId(myself.getUserId()); |
| | | |
| | | LambdaQueryWrapper<ZfDoctor> lambdaQueryWrapper = buildCondition(zfDoctor, idList); |
| | | List<ZfDoctor> beanRecords = list(lambdaQueryWrapper); |
| | | beanRecords.addAll(bs); |
| | | log.info("从数据库中查到的为:{}", beanRecords); |
| | | return markOwnData(familyId, beanRecords); |
| | | } |
| | |
| | | } |
| | | log.info("数据列表为:{}", dataList); |
| | | |
| | | |
| | | for (ZfDoctor zfDoctor : dataList) { |
| | | if (zfDoctor.getSymptom().length() == 0 || zfDoctor.getSymptom() == null) { |
| | | throw new RuntimeException("症状为空,导入数据失败"); |
| | | } else { |
| | | zfDoctorService.addData(zfDoctor); |
| | | } |
| | | |
| | | } |
| | | return AjaxResult.success("导入数据成功"); |
| | | |
| | | } |
| | |
| | | List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | | List<Long> familyIdList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(DOCTOR_LIST_ADD)).map(ZAuthority::getFid).collect(Collectors.toList()); |
| | | familyIdList.add(familyId); |
| | | |
| | | // List<ZfDoctorShare> authority1 = zfDoctorShareService.getAuthority(); |
| | | // List<Long> idList1 = authority1.stream().filter(auth -> auth.getShareContent().toString().equals(DOCTOR_LIST)).map(ZfDoctorShare::getShareId).collect(Collectors.toList()); |
| | | zfDoctorService.addData(zfDoctor); |
| | | |
| | | if (zfDoctor.getFamilyId()!=null && !familyIdList.contains(zfDoctor.getFamilyId())) { |
| | | throw new RuntimeException("你没有权限操作此家庭的数据"); |
| | |
| | | esModel.setBy5("/family/zfDoctor"); |
| | | esModel.setBy6(zfDoctor.getCmedical()); |
| | | esModel.setBy7(zfDoctor.getWmedical()); |
| | | // esModel.setBy7(); |
| | | esModel.setRemark(zfDoctor.getRemark()); |
| | | esModel.setFid(familyId); |
| | | |
| | | |
| | | //这里存储查询详情的路径 |
| | | esService.insertTable(esModel); |
| | | return AjaxResult.success(); |
| | |
| | | return AjaxResult.error(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | ZfLogService zfLogService; |
| | |
| | | } |
| | | return lqw; |
| | | } |
| | | |
| | | // private List<Long> buildCondition1(){ |
| | | // List<ZfDoctorShare> authority1 = zfDoctorShareService.getAuthority(); |
| | | // List<Long> idList1 = authority1.stream().filter(auth -> auth.getShareContent().toString().equals(DOCTOR_LIST)).map(ZfDoctorShare::getShareId).collect(Collectors.toList()); |
| | | // return idList1; |
| | | // } |
| | | // private LambdaQueryWrapper<ZfDoctor> buildCondition2(ZfDoctor zfDoctor, List<Long> IdList) { |
| | | // LambdaQueryWrapper<ZfDoctorShare> lqw = new LambdaQueryWrapper<>(); |
| | | // lqw.in(ZfDoctorShare::getShareId, IdList); |
| | | // List<ZfDoctorShare> beanRecords = list(lqw); |
| | | // for (ZfDoctorShare shareContent : beanRecords){ |
| | | // zfDoctorService.getById(shareContent); |
| | | // } |
| | | // |
| | | // } |
| | | |
| | | |
| | | } |