From a69aafe60ce001834b981778f12fd74d4af77e23 Mon Sep 17 00:00:00 2001 From: zqy <2522236926@qq.com> Date: 星期日, 23 六月 2024 22:04:42 +0800 Subject: [PATCH] 小医生修改&下载分享数据 --- zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorServiceImpl.java | 26 +++++++++----------------- 1 files changed, 9 insertions(+), 17 deletions(-) diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorServiceImpl.java index 6512ca9..9868b9b 100644 --- a/zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorServiceImpl.java +++ b/zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorServiceImpl.java @@ -6,9 +6,7 @@ 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.*; @@ -20,7 +18,6 @@ import org.elasticsearch.action.update.UpdateRequest; import org.elasticsearch.client.RequestOptions; import org.elasticsearch.client.RestHighLevelClient; -import org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; @@ -89,11 +86,7 @@ //鍔犱笂鑷繁瀹跺涵鐨刬d idList.add(familyId); // String familyIds = listFamilyIds(); -// String secondFamilyAuthority = listSecondFamilyIds(); - - //鏌ョ湅鍒汉鍒嗕韩 - List<ZfDoctor> bs = zfDoctorShareService.listUserId(myself.getUserId()); - +// String secondFamilyAuthority = listSecondFamilyIds() LambdaQueryWrapper<ZfDoctor> lqw = buildCondition(zfDoctor, idList); Page<ZfDoctor> zfDoctorPage = new Page<>(pageNum, pageSize); @@ -102,7 +95,6 @@ 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); } @@ -124,12 +116,9 @@ //鍔犱笂鑷繁瀹跺涵鐨刬d 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); } @@ -169,10 +158,13 @@ for (ZfDoctor zfDoctor : dataList) { - if (zfDoctor.getSymptom().length() == 0 || zfDoctor.getSymptom() == null) { - throw new RuntimeException("鐥囩姸涓虹┖锛屽鍏ユ暟鎹け璐�"); - } else { - zfDoctorService.addData(zfDoctor); + if (zfDoctor.getSuitable().length() != 0 || zfDoctor.getType().length() != 0 || zfDoctor.getEffect().length() != 0 ) { + if(zfDoctor.getSymptom().length() == 0 || zfDoctor.getSymptom() == null){ + throw new RuntimeException("鐥囩姸涓虹┖锛屽鍏ユ暟鎹け璐�"); + } + else { + zfDoctorService.addData(zfDoctor); + } } } return AjaxResult.success("瀵煎叆鏁版嵁鎴愬姛"); @@ -194,7 +186,7 @@ // 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); +// zfDoctorService.addData(zfDoctor); if (zfDoctor.getFamilyId() != null && !familyIdList.contains(zfDoctor.getFamilyId())) { throw new RuntimeException("浣犳病鏈夋潈闄愭搷浣滄瀹跺涵鐨勬暟鎹�"); -- Gitblit v1.9.1