修改查询任务执行记录、查询机构列表数据权限。
This commit is contained in:
parent
763fcead28
commit
2ff9acbd2f
@ -44,7 +44,7 @@ public class SysRole extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限)
|
* 数据范围(1:所有数据权限;2:自定义数据权限;3:本部门数据权限;4:本部门及以下数据权限;5:仅本人数据权限)
|
||||||
*/
|
*/
|
||||||
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限")
|
@Excel(name = "数据范围", readConverterExp = "1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限,5=仅本人数据权限,6=本机构数据权限")
|
||||||
private String dataScope;
|
private String dataScope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -49,7 +49,6 @@ public class AgencyController extends BaseController {
|
|||||||
*/
|
*/
|
||||||
@GetMapping("/selectAgencyList")
|
@GetMapping("/selectAgencyList")
|
||||||
public AjaxResult selectAgencyByIdList(Agency agency) {
|
public AjaxResult selectAgencyByIdList(Agency agency) {
|
||||||
// TODO 根据用户角色确定查询范围
|
|
||||||
return agencyService.selectAgencyByIdList(agency);
|
return agencyService.selectAgencyByIdList(agency);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.xinelu.manage.service.agency.impl;
|
|||||||
|
|
||||||
import com.xinelu.common.constant.Constants;
|
import com.xinelu.common.constant.Constants;
|
||||||
import com.xinelu.common.core.domain.AjaxResult;
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
|
import com.xinelu.common.core.domain.entity.SysRole;
|
||||||
import com.xinelu.common.enums.NodeTypeEnum;
|
import com.xinelu.common.enums.NodeTypeEnum;
|
||||||
import com.xinelu.common.exception.ServiceException;
|
import com.xinelu.common.exception.ServiceException;
|
||||||
import com.xinelu.common.utils.SecurityUtils;
|
import com.xinelu.common.utils.SecurityUtils;
|
||||||
@ -21,19 +22,18 @@ import com.xinelu.manage.vo.agency.AgencyTreeVO;
|
|||||||
import com.xinelu.manage.vo.agency.AgencyVO;
|
import com.xinelu.manage.vo.agency.AgencyVO;
|
||||||
import com.xinelu.manage.vo.agency.HospitalVO;
|
import com.xinelu.manage.vo.agency.HospitalVO;
|
||||||
import com.xinelu.manage.vo.sysarea.SysAreaVO;
|
import com.xinelu.manage.vo.sysarea.SysAreaVO;
|
||||||
import org.apache.commons.collections4.CollectionUtils;
|
|
||||||
import org.apache.commons.lang3.BooleanUtils;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import org.apache.commons.collections4.CollectionUtils;
|
||||||
|
import org.apache.commons.lang3.BooleanUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -102,6 +102,14 @@ public class AgencyServiceImpl implements IAgencyService {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult selectAgencyByIdList(Agency agency) {
|
public AjaxResult selectAgencyByIdList(Agency agency) {
|
||||||
|
// 查询用户角色
|
||||||
|
List<SysRole> roleList = SecurityUtils.getLoginUser().getUser().getRoles();
|
||||||
|
if (CollectionUtils.isNotEmpty(roleList)) {
|
||||||
|
List<String> dataScopeList = roleList.stream().map(SysRole::getDataScope).collect(Collectors.toList());
|
||||||
|
if (!dataScopeList.contains("1")) { // 不是全部数据权限,就只查询本机构
|
||||||
|
agency.setId(SecurityUtils.getLoginUser().getUser().getHospitalAgencyId());
|
||||||
|
}
|
||||||
|
}
|
||||||
return AjaxResult.success(agencyMapper.selectAgencyList(agency));
|
return AjaxResult.success(agencyMapper.selectAgencyList(agency));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.xinelu.manage.service.patienttaskexecuterecord.impl;
|
package com.xinelu.manage.service.patienttaskexecuterecord.impl;
|
||||||
|
|
||||||
|
import com.xinelu.common.annotation.DataScope;
|
||||||
import com.xinelu.common.core.domain.AjaxResult;
|
import com.xinelu.common.core.domain.AjaxResult;
|
||||||
import com.xinelu.common.utils.AgeUtil;
|
import com.xinelu.common.utils.AgeUtil;
|
||||||
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
|
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
|
||||||
@ -44,6 +45,7 @@ public class PatientTaskExecuteRecordServiceImpl implements IPatientTaskExecuteR
|
|||||||
* @return 患者管理任务执行记录
|
* @return 患者管理任务执行记录
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@DataScope(agencyAlias = "pi", deptAlias = "pi")
|
||||||
public List<PatientTaskExecuteRecordVO> selectPatientTaskExecuteRecordList(PatientTaskExecuteRecordVO patientTaskExecuteRecord) {
|
public List<PatientTaskExecuteRecordVO> selectPatientTaskExecuteRecordList(PatientTaskExecuteRecordVO patientTaskExecuteRecord) {
|
||||||
return patientTaskExecuteRecordMapper.selectPatientAndExecuteRecordList(patientTaskExecuteRecord);
|
return patientTaskExecuteRecordMapper.selectPatientAndExecuteRecordList(patientTaskExecuteRecord);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,6 +58,9 @@
|
|||||||
<select id="selectAgencyList" parameterType="Agency" resultMap="AgencyResult">
|
<select id="selectAgencyList" parameterType="Agency" resultMap="AgencyResult">
|
||||||
<include refid="selectAgencyVo"/>
|
<include refid="selectAgencyVo"/>
|
||||||
<where>
|
<where>
|
||||||
|
<if test="id != null ">
|
||||||
|
and id = #{id}
|
||||||
|
</if>
|
||||||
<if test="parentId != null ">
|
<if test="parentId != null ">
|
||||||
and parent_id = #{parentId}
|
and parent_id = #{parentId}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@ -149,6 +149,8 @@
|
|||||||
<if test="manageRouteName != null and manageRouteName != ''">
|
<if test="manageRouteName != null and manageRouteName != ''">
|
||||||
and pter.manage_route_name like concat('%', #{manageRouteName}, '%')
|
and pter.manage_route_name like concat('%', #{manageRouteName}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<!-- 数据范围过滤 -->
|
||||||
|
${params.dataScope}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectPatientTaskExecuteRecordById" parameterType="Long"
|
<select id="selectPatientTaskExecuteRecordById" parameterType="Long"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user