修改患者管理列表数据范围查询。

This commit is contained in:
haown 2024-04-29 15:18:07 +08:00
parent b2d8cd0e02
commit ba5dbf1302
9 changed files with 25 additions and 27 deletions

View File

@ -91,23 +91,12 @@ public class DataScopeAspect {
break;
} else if (DATA_SCOPE_CUSTOM.equals(dataScope)) { // 自定数据权限
sqlString.append(StringUtils.format(
" OR {}.dept_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias,
" OR {}.department_id IN ( SELECT dept_id FROM sys_role_dept WHERE role_id = {} ) ", deptAlias,
role.getRoleId()));
} else if(DATA_SCOPE_AGENCY.equals(dataScope)){ // 机构数据权限
sqlString.append(StringUtils.format(" OR {}.hospital_agency_id = {} ", anencyAlias, user.getHospitalAgencyId()));
} else if (DATA_SCOPE_DEPT.equals(dataScope)) { // 部门数据权限
sqlString.append(StringUtils.format(" OR {}.dept_id = {} ", deptAlias, user.getDeptId()));
} else if (DATA_SCOPE_DEPT_AND_CHILD.equals(dataScope)) { // 部门及以下数据权限
sqlString.append(StringUtils.format(
" OR {}.dept_id IN ( SELECT dept_id FROM sys_dept WHERE dept_id = {} or find_in_set( {} , ancestors ) )",
deptAlias, user.getDeptId(), user.getDeptId()));
} else if (DATA_SCOPE_SELF.equals(dataScope)) { // 仅本人数据权限
if (StringUtils.isNotBlank(userAlias)) {
sqlString.append(StringUtils.format(" OR {}.user_id = {} ", userAlias, user.getUserId()));
} else {
// 数据权限为仅本人且没有userAlias别名不查询任何数据
sqlString.append(StringUtils.format(" OR {}.dept_id = 0 ", deptAlias));
}
sqlString.append(StringUtils.format(" OR {}.department_id = {} ", deptAlias, user.getDepartmentId()));
}
}

View File

@ -1,5 +1,6 @@
package com.xinelu.manage.dto.patientblacklist;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -9,7 +10,7 @@ import lombok.Data;
* @create: 2024-02-28 13:15
**/
@Data
public class PatientBlacklistDto {
public class PatientBlacklistDto extends BaseEntity {
/** 患者id */
private Long patientId;

View File

@ -18,7 +18,7 @@ public interface PatientBlacklistMapper {
* @param id 患者-黑明单关系主键
* @return 患者-黑明单关系
*/
public PatientBlacklistVo selectPatientBlacklistById(Long id);
PatientBlacklistVo selectPatientBlacklistById(Long id);
/**
* 查询患者-黑明单关系列表
@ -26,7 +26,7 @@ public interface PatientBlacklistMapper {
* @param patientBlacklist 患者-黑明单关系
* @return 患者-黑明单关系集合
*/
public List<PatientBlacklistVo> selectPatientBlacklistList(PatientBlacklistDto patientBlacklist);
List<PatientBlacklistVo> selectPatientBlacklistList(PatientBlacklistDto patientBlacklist);
/**
* 新增患者-黑明单关系
@ -34,7 +34,7 @@ public interface PatientBlacklistMapper {
* @param patientBlacklist 患者-黑明单关系
* @return 结果
*/
public int insertPatientBlacklist(PatientBlacklist patientBlacklist);
int insertPatientBlacklist(PatientBlacklist patientBlacklist);
/**
* 修改患者-黑明单关系
@ -42,7 +42,7 @@ public interface PatientBlacklistMapper {
* @param patientBlacklist 患者-黑明单关系
* @return 结果
*/
public int updatePatientBlacklist(PatientBlacklist patientBlacklist);
int updatePatientBlacklist(PatientBlacklist patientBlacklist);
/**
* 删除患者-黑明单关系
@ -50,7 +50,7 @@ public interface PatientBlacklistMapper {
* @param id 患者-黑明单关系主键
* @return 结果
*/
public int deletePatientBlacklistById(Long id);
int deletePatientBlacklistById(Long id);
/**
* 批量删除患者-黑明单关系
@ -58,5 +58,5 @@ public interface PatientBlacklistMapper {
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deletePatientBlacklistByIds(Long[] ids);
int deletePatientBlacklistByIds(Long[] ids);
}

View File

@ -1,5 +1,6 @@
package com.xinelu.manage.service.patientblacklist.impl;
import com.xinelu.common.annotation.DataScope;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.manage.domain.patientblacklist.PatientBlacklist;
@ -49,6 +50,7 @@ public class PatientBlacklistServiceImpl implements IPatientBlacklistService {
* @return 患者-黑明单关系
*/
@Override
@DataScope(anencyAlias = "b")
public List<PatientBlacklistVo> selectPatientBlacklistList(PatientBlacklistDto patientBlacklist) {
return patientBlacklistMapper.selectPatientBlacklistList(patientBlacklist);
}

View File

@ -1,5 +1,6 @@
package com.xinelu.manage.service.patientprehospitalization.impl;
import com.xinelu.common.annotation.DataScope;
import com.xinelu.common.constant.NodeTypeConstants;
import com.xinelu.common.constant.PatientTypeConstants;
import com.xinelu.common.core.domain.AjaxResult;
@ -110,6 +111,7 @@ public class PatientPreHospitalizationServiceImpl implements IPatientPreHospital
}
@Override
@DataScope(anencyAlias = "p")
public List<PatientPreHospitalization> selectList(PatientInfoDto patientInfo) {
return preHospitalizationMapper.selectList(patientInfo);
}

View File

@ -62,6 +62,8 @@
<if test="blacklistSource != null and blacklistSource != ''">
and b.blacklist_source = #{blacklistSource}
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
</select>

View File

@ -338,6 +338,8 @@
<if test="registrationNo != null and registrationNo != ''">
and p.registration_no = #{registrationNo}
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
order by p.appointment_date
</select>

View File

@ -14,7 +14,7 @@ public class AgencyNameVO {
/**
* 主键id
*/
private Long agencyId;
private Long hospitalAgencyId;
/**
* 机构名称

View File

@ -146,28 +146,28 @@ public interface SysUserMapper {
* 剩余机构信息
*
* @param agencyName 机构搜索信息
* @param agencyId 机构id
* @param hospitalAgencyId 机构id
* @return AgencyNameVO
*/
List<AgencyNameVO> selectAgencyList(@Param("agencyName") String agencyName, @Param("agencyId") Long agencyId);
List<AgencyNameVO> selectAgencyList(@Param("agencyName") String agencyName, @Param("hospitalAgencyId") Long hospitalAgencyId);
/**
* 机构查询
*
* @param agencyId 机构id
* @param hospitalAgencyId 机构id
* @return
*/
List<AgencyNameVO> selectBelongAgencyList(Long agencyId);
List<AgencyNameVO> selectBelongAgencyList(Long hospitalAgencyId);
/**
* 剩余科室信息
*
* @param departmentName 科室搜索条件
* @param departmentId 科室id
* @param agencyId 机构id
* @param hospitalAgencyId 机构id
* @return AgencyNameVO
*/
List<AgencyNameVO> selectDepartmentList(@Param("departmentName") String departmentName, @Param("departmentId") Long departmentId, @Param("agencyId") Long agencyId);
List<AgencyNameVO> selectDepartmentList(@Param("departmentName") String departmentName, @Param("departmentId") Long departmentId, @Param("hospitalAgencyId") Long hospitalAgencyId);
/**
* 科室信息