修改宣教库数据权限。

This commit is contained in:
haown 2024-06-05 14:03:12 +08:00
parent 81c25fcbfd
commit 1b0f62e23b
4 changed files with 36 additions and 27 deletions

View File

@ -1,6 +1,7 @@
package com.xinelu.manage.dto.propagandainfo;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.time.LocalDate;
@ -14,7 +15,7 @@ import org.springframework.format.annotation.DateTimeFormat;
**/
@ApiModel("宣教库查询传输对象")
@Data
public class PropagandaInfoDto {
public class PropagandaInfoDto extends BaseEntity {
/** 所属医院id */
@ApiModelProperty(value = "所属医院id")

View File

@ -15,17 +15,16 @@ import com.xinelu.manage.service.department.IDepartmentService;
import com.xinelu.manage.vo.department.DepartmentListVO;
import com.xinelu.manage.vo.department.DepartmentVO;
import com.xinelu.system.mapper.SysUserMapper;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**

View File

@ -1,5 +1,6 @@
package com.xinelu.manage.service.propagandainfo.impl;
import com.xinelu.common.annotation.DataScope;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.bean.BeanUtils;
@ -79,6 +80,7 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService {
* @return 宣教库管理
*/
@Override
@DataScope(anencyAlias = "p")
public List<PropagandaInfo> selectPropagandaInfoList(PropagandaInfoDto propagandaInfo) {
return propagandaInfoMapper.selectPropagandaInfoList(propagandaInfo);
}
@ -215,6 +217,7 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService {
}
@Override
@DataScope(anencyAlias = "d")
public List<DepartmentVO> selectNumByDept(PropagandaInfoDto propagandaInfoDto) {
return propagandaInfoMapper.selectNumByDept(propagandaInfoDto);
}

View File

@ -34,38 +34,42 @@
</sql>
<select id="selectPropagandaInfoList" parameterType="com.xinelu.manage.dto.propagandainfo.PropagandaInfoDto" resultMap="PropagandaInfoResult">
<include refid="selectPropagandaInfoVo"/>
select p.id, p.hospital_agency_id, p.hospital_agency_name, p.department_id, p.department_name, p.propaganda_title, p.propaganda_type, p.propaganda_code, p.propaganda_status,
p.propaganda_content, p.propaganda_cover_path, p.article_summary, p.voicebroadcast, p.disease_type_id, p.disease_type_name,
p.propaganda_link, p.propaganda_barcode_path,p.del_flag, p.create_by, p.create_time, p.update_by, p.update_time from propaganda_info p
<where>
del_flag = 0
p.del_flag = 0
<if test="hospitalAgencyId != null ">
and hospital_agency_id = #{hospitalAgencyId}
and p.hospital_agency_id = #{hospitalAgencyId}
</if>
<if test="departmentId != null ">
and department_id = #{departmentId}
and p.department_id = #{departmentId}
</if>
<if test="propagandaTitle != null and propagandaTitle != ''">
and propaganda_title like concat('%', #{propagandaTitle}, '%')
and p.propaganda_title like concat('%', #{propagandaTitle}, '%')
</if>
<if test="propagandaType != null and propagandaType != ''">
and propaganda_type = #{propagandaType}
and p.propaganda_type = #{propagandaType}
</if>
<if test="propagandaCode != null and propagandaCode != ''">
and propaganda_code = #{propagandaCode}
and p.propaganda_code = #{propagandaCode}
</if>
<if test="propagandaStatus != null and propagandaStatus != ''">
and propaganda_status = #{propagandaStatus}
and p.propaganda_status = #{propagandaStatus}
</if>
<if test="createBy != null and propagandaStatus != ''">
and create_by = #{createBy}
and p.create_by = #{createBy}
</if>
<if test="createTimeStart != null">
and date_format(create_time, '%y%m%d') >= date_format(#{createTimeStart}, '%y%m%d')
and date_format(p.create_time, '%y%m%d') >= date_format(#{createTimeStart}, '%y%m%d')
</if>
<if test="createTimeEnd != null">
and date_format(create_time, '%y%m%d') &lt;= date_format(#{createTimeEnd}, '%y%m%d')
and date_format(p.create_time, '%y%m%d') &lt;= date_format(#{createTimeEnd}, '%y%m%d')
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
order by create_time desc
order by p.create_time desc
</select>
<select id="selectPropagandaInfoById" parameterType="Long"
@ -248,18 +252,20 @@
d.department_name,
count(p.id) AS countNum
from department d left join
(select id, department_id, propaganda_status from propaganda_info
<where>
del_flag = 0
<if test="propagandaStatus != null and propagandaStatus != ''">
and propaganda_status = #{propagandaStatus}
</if>
</where>
) as p on d.id = p.department_id
(select id, department_id, propaganda_status from propaganda_info
<where>
del_flag = 0
<if test="propagandaStatus != null and propagandaStatus != ''">
and propaganda_status = #{propagandaStatus}
</if>
</where>
) as p on d.id = p.department_id
<where>
<if test="departmentName != null and departmentName != ''">
and d.department_name like concat('%', #{departmentName}, '%')
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
GROUP BY d.id,
d.department_name,