修改签约列表数据权限。

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();
// 如果是超级管理员则不过滤数据
if (StringUtils.isNotNull(currentUser) && !currentUser.isAdmin()) {
dataScopeFilter(joinPoint, currentUser, controllerDataScope.anencyAlias(), controllerDataScope.deptAlias(),
dataScopeFilter(joinPoint, currentUser, controllerDataScope.agencyAlias(), controllerDataScope.deptAlias(),
controllerDataScope.userAlias());
}
}
@ -81,7 +81,7 @@ public class DataScopeAspect {
* @param user 用户
* @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();
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,
role.getRoleId()));
} 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)) { // 部门数据权限
sqlString.append(StringUtils.format(" OR {}.department_id = {} ", deptAlias, user.getDepartmentId()));
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,7 @@
package com.xinelu.manage.service.signpatientmanageroutenode.impl;
import com.alibaba.fastjson2.JSONObject;
import com.xinelu.common.annotation.DataScope;
import com.xinelu.common.constant.RouteNodeNameConstants;
import com.xinelu.common.constant.TaskContentConstants;
import com.xinelu.common.constant.TaskCreateTypeConstant;
@ -311,7 +312,9 @@ public class SignPatientManageRouteNodeServiceImpl implements ISignPatientManage
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);
}

View File

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

View File

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

View File

@ -399,6 +399,8 @@
<if test="serviceEndTimeEnd != null">
and date_format(p.service_end_time, '%y%m%d') &lt;= date_format(#{serviceEndTimeEnd}, '%y%m%d')
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
</select>
<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 用户信息集合信息
*/
@Override
@DataScope(deptAlias = "d", userAlias = "u", anencyAlias = "u")
@DataScope(deptAlias = "d", userAlias = "u", agencyAlias = "u")
public List<SysUser> selectUserList(SysUser user) {
return userMapper.selectUserList(user);
}