修改签约列表数据权限。

This commit is contained in:
haown 2024-06-05 15:32:39 +08:00
parent 1b0f62e23b
commit 763fcead28
14 changed files with 26 additions and 15 deletions

View File

@ -14,7 +14,7 @@ public @interface DataScope {
/** /**
* 机构表别名 * 机构表别名
*/ */
public String anencyAlias() default ""; public String agencyAlias() default "";
/** /**
* 部门表的别名 * 部门表的别名
*/ */

View File

@ -68,7 +68,7 @@ public class DataScopeAspect {
SysUser currentUser = loginUser.getUser(); SysUser currentUser = loginUser.getUser();
// 如果是超级管理员则不过滤数据 // 如果是超级管理员则不过滤数据
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin()) { if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin()) {
dataScopeFilter(joinPoint, currentUser, controllerDataScope.anencyAlias(), controllerDataScope.deptAlias(), dataScopeFilter(joinPoint, currentUser, controllerDataScope.agencyAlias(), controllerDataScope.deptAlias(),
controllerDataScope.userAlias()); controllerDataScope.userAlias());
} }
} }
@ -81,7 +81,7 @@ public class DataScopeAspect {
* @param user 用户 * @param user 用户
* @param userAlias 别名 * @param userAlias 别名
*/ */
public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String anencyAlias, String deptAlias, String userAlias) { public static void dataScopeFilter(JoinPoint joinPoint, SysUser user, String agencyAlias, String deptAlias, String userAlias) {
StringBuilder sqlString = new StringBuilder(); StringBuilder sqlString = new StringBuilder();
for (SysRole role : user.getRoles()) { for (SysRole role : user.getRoles()) {
@ -94,7 +94,7 @@ public class DataScopeAspect {
" OR {}.department_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())); role.getRoleId()));
} else if(DATA_SCOPE_AGENCY.equals(dataScope)){ // 机构数据权限 } else if(DATA_SCOPE_AGENCY.equals(dataScope)){ // 机构数据权限
sqlString.append(StringUtils.format(" OR {}.hospital_agency_id = {} ", anencyAlias, user.getHospitalAgencyId())); sqlString.append(StringUtils.format(" OR {}.hospital_agency_id = {} ", agencyAlias, user.getHospitalAgencyId()));
} else if (DATA_SCOPE_DEPT.equals(dataScope)) { // 部门数据权限 } else if (DATA_SCOPE_DEPT.equals(dataScope)) { // 部门数据权限
sqlString.append(StringUtils.format(" OR {}.department_id = {} ", deptAlias, user.getDepartmentId())); sqlString.append(StringUtils.format(" OR {}.department_id = {} ", deptAlias, user.getDepartmentId()));
} }

View File

@ -53,7 +53,6 @@ public class PatientBlacklistAbnormalCauseController extends BaseController {
* 查询患者黑名单异常原因列表 * 查询患者黑名单异常原因列表
*/ */
@ApiOperation("查询患者黑名单异常原因列表") @ApiOperation("查询患者黑名单异常原因列表")
@PreAuthorize("@ss.hasPermi('manage:cause:list')")
@GetMapping("/getList") @GetMapping("/getList")
public R<List<PatientBlacklistAbnormalCause>> getList(PatientBlacklistAbnormalCause patientBlacklistAbnormalCause) { public R<List<PatientBlacklistAbnormalCause>> getList(PatientBlacklistAbnormalCause patientBlacklistAbnormalCause) {
List<PatientBlacklistAbnormalCause> list = patientBlacklistAbnormalCauseService.selectPatientBlacklistAbnormalCauseList(patientBlacklistAbnormalCause); List<PatientBlacklistAbnormalCause> list = patientBlacklistAbnormalCauseService.selectPatientBlacklistAbnormalCauseList(patientBlacklistAbnormalCause);

View File

@ -1,5 +1,6 @@
package com.xinelu.manage.dto.signpatientmanageroutenode; package com.xinelu.manage.dto.signpatientmanageroutenode;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -14,7 +15,7 @@ import java.time.LocalDate;
**/ **/
@ApiModel("患者任务查询传输对象") @ApiModel("患者任务查询传输对象")
@Data @Data
public class PatientTaskDto { public class PatientTaskDto extends BaseEntity {
/** /**
* 患者主键 * 患者主键

View File

@ -1,5 +1,6 @@
package com.xinelu.manage.dto.signpatientrecord; package com.xinelu.manage.dto.signpatientrecord;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDate; import java.time.LocalDate;
@ -13,7 +14,7 @@ import org.springframework.format.annotation.DateTimeFormat;
**/ **/
@ApiModel("签约患者查询传输对象") @ApiModel("签约患者查询传输对象")
@Data @Data
public class SignPatientListDto { public class SignPatientListDto extends BaseEntity {
/** /**
* 患者姓名 * 患者姓名
*/ */

View File

@ -50,7 +50,7 @@ public class PatientBlacklistServiceImpl implements IPatientBlacklistService {
* @return 患者-黑明单关系 * @return 患者-黑明单关系
*/ */
@Override @Override
@DataScope(anencyAlias = "b") @DataScope(agencyAlias = "b")
public List<PatientBlacklistVo> selectPatientBlacklistList(PatientBlacklistDto patientBlacklist) { public List<PatientBlacklistVo> selectPatientBlacklistList(PatientBlacklistDto patientBlacklist) {
return patientBlacklistMapper.selectPatientBlacklistList(patientBlacklist); return patientBlacklistMapper.selectPatientBlacklistList(patientBlacklist);
} }

View File

@ -65,7 +65,7 @@ public class PatientInfoServiceImpl implements IPatientInfoService {
* @return 患者信息 * @return 患者信息
*/ */
@Override @Override
@DataScope(anencyAlias = "p") @DataScope(agencyAlias = "p")
public List<PatientInfo> selectPatientInfoList(PatientInfoDto patientInfo) { public List<PatientInfo> selectPatientInfoList(PatientInfoDto patientInfo) {
return patientInfoMapper.selectPatientInfoList(patientInfo); return patientInfoMapper.selectPatientInfoList(patientInfo);
} }

View File

@ -111,7 +111,7 @@ public class PatientPreHospitalizationServiceImpl implements IPatientPreHospital
} }
@Override @Override
@DataScope(anencyAlias = "p") @DataScope(agencyAlias = "p")
public List<PatientPreHospitalization> selectList(PatientInfoDto patientInfo) { public List<PatientPreHospitalization> selectList(PatientInfoDto patientInfo) {
return preHospitalizationMapper.selectList(patientInfo); return preHospitalizationMapper.selectList(patientInfo);
} }

View File

@ -80,7 +80,7 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService {
* @return 宣教库管理 * @return 宣教库管理
*/ */
@Override @Override
@DataScope(anencyAlias = "p") @DataScope(agencyAlias = "p")
public List<PropagandaInfo> selectPropagandaInfoList(PropagandaInfoDto propagandaInfo) { public List<PropagandaInfo> selectPropagandaInfoList(PropagandaInfoDto propagandaInfo) {
return propagandaInfoMapper.selectPropagandaInfoList(propagandaInfo); return propagandaInfoMapper.selectPropagandaInfoList(propagandaInfo);
} }
@ -217,7 +217,7 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService {
} }
@Override @Override
@DataScope(anencyAlias = "d") @DataScope(agencyAlias = "d")
public List<DepartmentVO> selectNumByDept(PropagandaInfoDto propagandaInfoDto) { public List<DepartmentVO> selectNumByDept(PropagandaInfoDto propagandaInfoDto) {
return propagandaInfoMapper.selectNumByDept(propagandaInfoDto); return propagandaInfoMapper.selectNumByDept(propagandaInfoDto);
} }

View File

@ -1,6 +1,7 @@
package com.xinelu.manage.service.signpatientmanageroutenode.impl; package com.xinelu.manage.service.signpatientmanageroutenode.impl;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.xinelu.common.annotation.DataScope;
import com.xinelu.common.constant.RouteNodeNameConstants; import com.xinelu.common.constant.RouteNodeNameConstants;
import com.xinelu.common.constant.TaskContentConstants; import com.xinelu.common.constant.TaskContentConstants;
import com.xinelu.common.constant.TaskCreateTypeConstant; import com.xinelu.common.constant.TaskCreateTypeConstant;
@ -311,7 +312,9 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
return signPatientManageRouteNodeMapper.deleteSignPatientManageRouteNodeById(id); return signPatientManageRouteNodeMapper.deleteSignPatientManageRouteNodeById(id);
} }
@Override public List<PatientTaskVo> selectPatientTaskList(PatientTaskDto patientTaskDto) { @Override
@DataScope(agencyAlias = "patient")
public List<PatientTaskVo> selectPatientTaskList(PatientTaskDto patientTaskDto) {
return signPatientManageRouteNodeMapper.selectPatientTaskList(patientTaskDto); return signPatientManageRouteNodeMapper.selectPatientTaskList(patientTaskDto);
} }

View File

@ -1,5 +1,6 @@
package com.xinelu.manage.service.signpatientrecord.impl; package com.xinelu.manage.service.signpatientrecord.impl;
import com.xinelu.common.annotation.DataScope;
import com.xinelu.common.constant.SignRecordServiceStatusConstants; import com.xinelu.common.constant.SignRecordServiceStatusConstants;
import com.xinelu.common.constant.TaskCreateTypeConstant; import com.xinelu.common.constant.TaskCreateTypeConstant;
import com.xinelu.common.constant.TemplateTypeConstants; import com.xinelu.common.constant.TemplateTypeConstants;
@ -90,7 +91,9 @@ public class SignPatientRecordServiceImpl implements ISignPatientRecordService {
@Resource @Resource
private PatientNodeParamsLogMapper patientNodeParamsLogMapper; private PatientNodeParamsLogMapper patientNodeParamsLogMapper;
@Override public List<SignPatientListVo> selectList(SignPatientListDto signPatientRecord) { @Override
@DataScope(agencyAlias = "sign")
public List<SignPatientListVo> selectList(SignPatientListDto signPatientRecord) {
return signPatientRecordMapper.selectList(signPatientRecord); return signPatientRecordMapper.selectList(signPatientRecord);
} }

View File

@ -740,6 +740,8 @@
<if test="patientSource != null "> <if test="patientSource != null ">
and patient.patient_source like concat('%', #{patientSource}, '%') and patient.patient_source like concat('%', #{patientSource}, '%')
</if> </if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where> </where>
group by patient.hospital_agency_id, patient.id group by patient.hospital_agency_id, patient.id
</select> </select>

View File

@ -399,6 +399,8 @@
<if test="serviceEndTimeEnd != null"> <if test="serviceEndTimeEnd != null">
and date_format(p.service_end_time, '%y%m%d') &lt;= date_format(#{serviceEndTimeEnd}, '%y%m%d') and date_format(p.service_end_time, '%y%m%d') &lt;= date_format(#{serviceEndTimeEnd}, '%y%m%d')
</if> </if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where> </where>
</select> </select>
<select id="getByRecordId" parameterType="java.lang.Long" resultType="com.xinelu.manage.vo.signpatientrecord.SignPatientInfoVo"> <select id="getByRecordId" parameterType="java.lang.Long" resultType="com.xinelu.manage.vo.signpatientrecord.SignPatientInfoVo">

View File

@ -71,7 +71,7 @@ public class SysUserServiceImpl implements ISysUserService {
* @return 用户信息集合信息 * @return 用户信息集合信息
*/ */
@Override @Override
@DataScope(deptAlias = "d", userAlias = "u", anencyAlias = "u") @DataScope(deptAlias = "d", userAlias = "u", agencyAlias = "u")
public List<SysUser> selectUserList(SysUser user) { public List<SysUser> selectUserList(SysUser user) {
return userMapper.selectUserList(user); return userMapper.selectUserList(user);
} }