From 0b8568689c299e8b01d38f2dac35817f2a1caf1b Mon Sep 17 00:00:00 2001 From: lxd <1004405501@qq.com> Date: Tue, 27 Aug 2024 18:39:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96=E8=AF=8A?= =?UTF-8?q?=E6=96=AD=E6=A8=A1=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/ultrasonic/ultrasonicController.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/ultrasonic/ultrasonicController.java b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/ultrasonic/ultrasonicController.java index e5a3ece32..6c48686bd 100644 --- a/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/ultrasonic/ultrasonicController.java +++ b/yudao-module-ultrasoniccom/yudao-module-ultrasoniccom-biz/src/main/java/cn/iocoder/yudao/module/ultrasoniccom/controller/admin/ultrasonic/ultrasonicController.java @@ -4,8 +4,10 @@ import cn.iocoder.yudao.module.system.dal.dataobject.dicomworklist.DicomImagesDO import cn.iocoder.yudao.module.system.dal.dataobject.dicomworklist.DicomSeriesDO; import cn.iocoder.yudao.module.system.dal.dataobject.dicomworklist.DicompatientDO; import cn.iocoder.yudao.module.system.dal.dataobject.org.OrgUnitDO; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.service.dicomworklist.DicomworklistService; import cn.iocoder.yudao.module.system.service.org.OrgUnitService; +import cn.iocoder.yudao.module.system.service.user.AdminUserService; import com.fasterxml.jackson.databind.SerializationFeature; import okhttp3.OkHttpClient; import okhttp3.Request; @@ -51,6 +53,7 @@ import java.util.*; import java.util.stream.Collectors; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; @Tag(name = "管理后台 - 超声科组件") @RestController @@ -68,7 +71,8 @@ public class ultrasonicController { @Resource private OrgUnitService Service; - + @Resource + private AdminUserService userService; @GetMapping("/reporttemplatetlist") @Operation(summary = "获取模版表数据") @@ -77,7 +81,8 @@ public class ultrasonicController { public CommonResult> getreporttemplatelist(@RequestParam("orgID") String orgID, @RequestParam("type") String type, @RequestParam("isprivate") String isprivate) throws Exception { List devicelist = ultrasonicService.getreporttemplate(); List filteredList = new ArrayList<>(); - + //当前登陆用户 + AdminUserDO user = userService.getUser(getLoginUserId()); // 按照 updateTime 字段降序排列,空值放在最后 List sortedList = devicelist.stream() .sorted(Comparator.comparing(ultrasonicDO::getUpdateTime, Comparator.nullsLast(Comparator.reverseOrder()))) @@ -102,7 +107,7 @@ public class ultrasonicController { if (isprivate.equals("1")) { // 筛选条件: filteredList = filteredList.stream() - .filter(ultrasonicDO -> (ultrasonicDO.getPrivateDoctorId() != null)) + .filter(ultrasonicDO -> Objects.equals(ultrasonicDO.getPrivateDoctorId(), user.getId().toString())) .collect(Collectors.toList()); }