diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/apiconfig/ApiconfigController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/apiconfig/ApiconfigController.java index 586463ac7..7708579de 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/apiconfig/ApiconfigController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/apiconfig/ApiconfigController.java @@ -1,5 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.apiconfig; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; +import cn.iocoder.yudao.module.system.service.user.AdminUserService; import com.mzt.logapi.starter.annotation.LogRecord; import org.springframework.web.bind.annotation.*; import org.springframework.validation.annotation.Validated; @@ -22,6 +24,7 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; import cn.iocoder.yudao.module.system.controller.admin.apiconfig.vo.*; import cn.iocoder.yudao.module.system.dal.dataobject.apiconfig.ApiconfigDO; @@ -39,7 +42,8 @@ public class ApiconfigController { @Resource private ApiconfigService apiconfigService; - + @Resource + private AdminUserService userService; @PostMapping("/create") @Operation(summary = "创建接口配置") @PreAuthorize("@ss.hasPermission('system:apiconfig:create')") @@ -118,6 +122,13 @@ public class ApiconfigController { @Operation(summary = "获得接口配置分页") @PreAuthorize("@ss.hasPermission('system:apiconfig:query')") public CommonResult> getApiconfigPage(@Valid ApiconfigPageReqVO pageReqVO) { + //获取当前登陆用户 + AdminUserDO user = userService.getUser(getLoginUserId()); + String creator=user.getCreator(); + if(!creator.equals("admin")) + { + pageReqVO.setOrgId(user.getOrgId()); + } PageResult pageResult = apiconfigService.getApiconfigPage(pageReqVO); return success(BeanUtils.toBean(pageResult, ApiconfigRespVO.class)); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/department/DepartmentController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/department/DepartmentController.java index 45850b446..382100d2b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/department/DepartmentController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/department/DepartmentController.java @@ -114,6 +114,13 @@ public class DepartmentController { @Operation(summary = "获得科室管理分页") @PreAuthorize("@ss.hasPermission('system:department:query')") public CommonResult> getDepartmentPage(@Valid DepartmentPageReqVO pageReqVO) { + //获取当前登陆用户 + AdminUserDO user = userService.getUser(getLoginUserId()); + String creator=user.getCreator(); + if(!creator.equals("admin")) + { + pageReqVO.setOrgId(user.getOrgId()); + } PageResult pageResult = departmentService.getDepartmentPage(pageReqVO); return success(BeanUtils.toBean(pageResult, DepartmentRespVO.class)); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/DoctorController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/DoctorController.java index dce0f8b23..c8033e8bb 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/DoctorController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/DoctorController.java @@ -100,6 +100,13 @@ public class DoctorController { @Operation(summary = "获得医生管理分页") @PreAuthorize("@ss.hasPermission('doctor::query')") public CommonResult> getPage(@Valid DoctorPageReqVO pageReqVO) { + //获取当前登陆用户 + AdminUserDO user = userService.getUser(getLoginUserId()); + String creator=user.getCreator(); + if(!creator.equals("admin")) + { + pageReqVO.setOrgId(user.getOrgId()); + } PageResult pageResult = Service.getPage(pageReqVO); return success(BeanUtils.toBean(pageResult, DoctorRespVO.class)); } @@ -131,6 +138,7 @@ public class DoctorController { @Operation(summary = "获得医生全部list") @PreAuthorize("@ss.hasPermission('doctor::query')") public CommonResult> getAlllist() { + List doctorDOs= Service.getDoctorList(null); return success(doctorDOs); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/vo/DoctorPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/vo/DoctorPageReqVO.java index 34dd57331..c7de34b6b 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/vo/DoctorPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/doctor/vo/DoctorPageReqVO.java @@ -21,4 +21,6 @@ public class DoctorPageReqVO extends PageParam { @Schema(description = "科室名称", example = "王五") private String departmentName; + private String orgId; + } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/exampart/ExampartController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/exampart/ExampartController.java index c11ed097a..98562441c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/exampart/ExampartController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/exampart/ExampartController.java @@ -1,5 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.exampart; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; +import cn.iocoder.yudao.module.system.service.user.AdminUserService; import org.springframework.web.bind.annotation.*; import org.springframework.validation.annotation.Validated; import org.springframework.security.access.prepost.PreAuthorize; @@ -12,6 +14,7 @@ import javax.validation.*; import javax.servlet.http.*; import java.util.*; import java.io.IOException; +import java.util.stream.Collectors; import cn.iocoder.yudao.module.system.controller.admin.exampart.vo.*; import cn.iocoder.yudao.module.system.dal.dataobject.exampart.*; @@ -24,6 +27,7 @@ import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; @Tag(name = "管理后台 - 检查部位") @RestController @@ -33,6 +37,8 @@ public class ExampartController { @Resource private ExampartService exampartService; + @Resource + private AdminUserService userService; @PostMapping("/create") @Operation(summary = "创建检查部位") @@ -71,8 +77,17 @@ public class ExampartController { @Operation(summary = "获得检查部位") @PreAuthorize("@ss.hasPermission('test:exampart:query')") public CommonResult> getExampartlist() { + //获取当前登陆用户 + AdminUserDO user = userService.getUser(getLoginUserId()); + String creator=user.getCreator(); + List examparts = exampartService.getExampartlist(); - return success(examparts); + // 筛选 + List filteredList = examparts.stream() + .filter(ep -> user.getOrgId().equals(ep.getOrgId())) + .collect(Collectors.toList()); + + return success(filteredList); } @GetMapping("/page") diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/OrgUnitController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/OrgUnitController.java index 542ee1914..4a4bcb25e 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/OrgUnitController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/OrgUnitController.java @@ -1,6 +1,8 @@ package cn.iocoder.yudao.module.system.controller.admin.org; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; +import cn.iocoder.yudao.module.system.service.user.AdminUserService; import com.mzt.logapi.context.LogRecordContext; import com.mzt.logapi.starter.annotation.LogRecord; import org.springframework.web.bind.annotation.*; @@ -25,6 +27,7 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; import static cn.iocoder.yudao.module.system.enums.LogRecordConstants.*; import cn.iocoder.yudao.module.system.controller.admin.org.vo.*; @@ -43,7 +46,8 @@ public class OrgUnitController { @Resource private OrgUnitService Service; - + @Resource + private AdminUserService userService; @PostMapping("/create") @Operation(summary = "创建机构管理") @PreAuthorize("@ss.hasPermission('org::create')") @@ -111,6 +115,13 @@ public class OrgUnitController { @Operation(summary = "获得机构管理分页") @PreAuthorize("@ss.hasPermission('org::query')") public CommonResult> getPage(@Valid OrgUnitPageReqVO pageReqVO) { + //获取当前登陆用户 + AdminUserDO user = userService.getUser(getLoginUserId()); + String creator=user.getCreator(); + if(!creator.equals("admin")) + { + pageReqVO.setOrgID(user.getOrgId()); + } PageResult pageResult = Service.getPage(pageReqVO); return success(BeanUtils.toBean(pageResult, OrgUnitRespVO.class)); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/vo/OrgUnitPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/vo/OrgUnitPageReqVO.java index d25a75ed9..0245508aa 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/vo/OrgUnitPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/org/vo/OrgUnitPageReqVO.java @@ -14,6 +14,9 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @ToString(callSuper = true) public class OrgUnitPageReqVO extends PageParam { + @Schema(description = "机构ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "7824") + private String orgID; + @Schema(description = "机构名称", example = "王五") private String orgName; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/WxController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/WxController.java index 819b68109..9f43d1519 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/WxController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/WxController.java @@ -1,5 +1,7 @@ package cn.iocoder.yudao.module.system.controller.admin.wx; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; +import cn.iocoder.yudao.module.system.service.user.AdminUserService; import org.springframework.web.bind.annotation.*; import org.springframework.validation.annotation.Validated; @@ -22,6 +24,7 @@ import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog; import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; import cn.iocoder.yudao.module.system.controller.admin.wx.vo.*; import cn.iocoder.yudao.module.system.dal.dataobject.wx.WxDO; @@ -39,6 +42,8 @@ public class WxController { @Resource private WxService wxService; + @Resource + private AdminUserService userService; @PostMapping("/create") @Operation(summary = "创建微信通知管理") @@ -83,6 +88,13 @@ public class WxController { @Operation(summary = "获得微信通知管理分页") @PreAuthorize("@ss.hasPermission('system:wx:query')") public CommonResult> getWxPage(@Valid WxPageReqVO pageReqVO) { + //获取当前登陆用户 + AdminUserDO user = userService.getUser(getLoginUserId()); + String creator=user.getCreator(); + if(!creator.equals("admin")) + { + pageReqVO.setOrgId(user.getOrgId()); + } PageResult pageResult = wxService.getWxPage(pageReqVO); return success(BeanUtils.toBean(pageResult, WxRespVO.class)); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/vo/WxPageReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/vo/WxPageReqVO.java index 87f7e6cfd..5357392d6 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/vo/WxPageReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/wx/vo/WxPageReqVO.java @@ -26,4 +26,6 @@ public class WxPageReqVO extends PageParam { @Schema(description = "是否删除") private String isdelete; + @Schema(description = "机构ID") + private String orgId; } \ No newline at end of file diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/apiconfig/ApiconfigMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/apiconfig/ApiconfigMapper.java index 00b798743..80ba431c4 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/apiconfig/ApiconfigMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/apiconfig/ApiconfigMapper.java @@ -23,18 +23,9 @@ public interface ApiconfigMapper extends BaseMapperX { default PageResult selectPage(ApiconfigPageReqVO reqVO) { return selectPage(reqVO, new LambdaQueryWrapperX() - //.eqIfPresent(ApiconfigDO::getOrgId, reqVO.getOrgId()) + .eqIfPresent(ApiconfigDO::getOrgId, reqVO.getOrgId()) .eqIfPresent(ApiconfigDO::getApiType, reqVO.getApiType()) .likeIfPresent(ApiconfigDO::getApiName, reqVO.getApiName()) - // .eqIfPresent(ApiconfigDO::getApiUrl, reqVO.getApiUrl()) - // .eqIfPresent(ApiconfigDO::getDatabaseType, reqVO.getDatabaseType()) - // .eqIfPresent(ApiconfigDO::getDatabaseIP, reqVO.getDatabaseIP()) - // .eqIfPresent(ApiconfigDO::getDatabasePort, reqVO.getDatabasePort()) - // .likeIfPresent(ApiconfigDO::getDatabaseUserName, reqVO.getDatabaseUserName()) - // .eqIfPresent(ApiconfigDO::getDatabasePwd, reqVO.getDatabasePwd()) - // .eqIfPresent(ApiconfigDO::getSoftwareManufacturer, reqVO.getSoftwareManufacturer()) - // .eqIfPresent(ApiconfigDO::getIsdelete, reqVO.getIsdelete()) - // .eqIfPresent(ApiconfigDO::getRemark, reqVO.getRemark()) .likeIfPresent(ApiconfigDO::getApiCode, reqVO.getApiCode()) .eq(ApiconfigDO::getIsdelete, '0') .orderByDesc(ApiconfigDO::getId)); diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/doctor/DoctorMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/doctor/DoctorMapper.java index fce825ec2..c133774ff 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/doctor/DoctorMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/doctor/DoctorMapper.java @@ -33,6 +33,7 @@ public interface DoctorMapper extends BaseMapperX { return selectPage(reqVO, new LambdaQueryWrapperX() .likeIfPresent(DoctorDO::getDoctorName, reqVO.getDoctorName()) .likeIfPresent(DoctorDO::getDepartmentName, reqVO.getDepartmentName()) + .eqIfPresent(DoctorDO::getOrgId,reqVO.getOrgId()) .eq(DoctorDO::getIsdelete, '0') .orderByAsc(DoctorDO::getDoctorName)); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/org/OrgUnitMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/org/OrgUnitMapper.java index 2a4979ab4..adc8b4ed0 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/org/OrgUnitMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/org/OrgUnitMapper.java @@ -31,11 +31,9 @@ public interface OrgUnitMapper extends BaseMapperX { .eqIfPresent(OrgUnitDO::getContactPerson, reqVO.getContactPerson()) .likeIfPresent(OrgUnitDO::getReportName, reqVO.getReportName()) .eqIfPresent(OrgUnitDO::getHighLevelOrgID, reqVO.getHighLevelOrgID()) - .eqIfPresent(OrgUnitDO::getWxOpenidlist, reqVO.getWxOpenidlist()) .eqIfPresent(OrgUnitDO::getOrgSN, reqVO.getOrgSN()) - .betweenIfPresent(OrgUnitDO::getCreateDate, reqVO.getCreateDate()) .likeIfPresent(OrgUnitDO::getHighLevelOrgName, reqVO.getHighLevelOrgName()) - .eqIfPresent(OrgUnitDO::getOrgLogoUrl, reqVO.getOrgLogoUrl()) + .eqIfPresent(OrgUnitDO::getOrgID, reqVO.getOrgID()) .eq(OrgUnitDO::getIsdelete, '0') .orderByDesc(OrgUnitDO::getOrgID)); } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/wx/WxMapper.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/wx/WxMapper.java index 7b25a08c5..e5940bbde 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/wx/WxMapper.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/wx/WxMapper.java @@ -25,6 +25,7 @@ public interface WxMapper extends BaseMapperX { .likeIfPresent(WxDO::getWxUserid, reqVO.getWxUserid()) .likeIfPresent(WxDO::getBindTel, reqVO.getBindTel()) .likeIfPresent(WxDO::getPersonName, reqVO.getPersonName()) + .eqIfPresent(WxDO::getOrgId,reqVO.getOrgId()) .eq(WxDO::getIsdelete, '0') .orderByDesc(WxDO::getId)); }