浏览代码

病区获取科室列表接口暂注释

chengyao 3 年之前
父节点
当前提交
fc6530246b

+ 3 - 0
common/src/main/java/com/lantone/common/vo/GetDeptListVO.java

@@ -15,6 +15,9 @@ public class GetDeptListVO {
     @ApiModelProperty(value = "医院ID",hidden = true)
     private Long hospitalId;
 
+    @ApiModelProperty(value = "用户ID",hidden = true)
+    private Long userId;
+
     @ApiModelProperty(value = "科室名称")
     private String deptName;
 }

+ 9 - 0
security-center/src/main/java/com/lantone/security/facade/RegionManagementFacade.java

@@ -280,10 +280,19 @@ public class RegionManagementFacade {
      */
     public  List<DeptListDTO> getDept(GetDeptListVO getDeptListVO){
         getDeptListVO.setHospitalId(SysUserUtils.getCurrentHospitalId());
+        getDeptListVO.setUserId(SysUserUtils.getCurrentPrincipleId());
         List<DeptListDTO> deptListDTOS = new ArrayList<>();
+        List<Long> depts = regionDeptService.lambdaQuery()
+                .eq(RegionDept::getHospitalId, getDeptListVO.getHospitalId())
+                .eq(RegionDept::getIsDeleted,IsDeleteEnum.N.getKey())
+                .eq(RegionDept::getCreator, getDeptListVO.getUserId())
+                .list().stream().map(RegionDept::getDeptId).collect(Collectors.toList());
         LambdaQueryChainWrapper<Dept> lambdaQueryChainWrapper = deptFacade.lambdaQuery();
         lambdaQueryChainWrapper.eq(Dept::getHospitalId,getDeptListVO.getHospitalId());
         lambdaQueryChainWrapper.eq(Dept::getIsDeleted,IsDeleteEnum.N.getKey());
+        if(ListUtil.isNotEmpty(depts)){
+            lambdaQueryChainWrapper.in(Dept::getId,depts);
+        }
         if(StringUtil.isNotEmpty(getDeptListVO.getDeptName())){
             lambdaQueryChainWrapper.like(Dept::getName,getDeptListVO.getDeptName());
         }

+ 2 - 2
security-center/src/main/java/com/lantone/security/web/RegionManagementController.java

@@ -71,9 +71,9 @@ public class RegionManagementController {
         return CommonResult.success(sysRegionFacade.deleteRegion(id));
     }
 
-    @ApiOperation(value = "获取科室列表[by:cy]")
+  /*  @ApiOperation(value = "获取科室列表[by:cy]")
     @PostMapping("/getDeptList")
     public CommonResult<List<DeptListDTO>> getDeptList(@RequestBody GetDeptListVO getDeptListVO) {
         return CommonResult.success(sysRegionFacade.getDept(getDeptListVO));
-    }
+    }*/
 }