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()); }