宣教来源

This commit is contained in:
zhangheng 2024-12-31 09:44:06 +08:00
parent 2aeef5a79b
commit daf40d5b71
4 changed files with 40 additions and 4 deletions

View File

@ -0,0 +1,18 @@
package com.xinelu.common.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
/**
* @Description 新医路院后数据库账号id参数配置类
* @Author zh
* @Date 2024-07-31
*/
@Data
@Component
@ConfigurationProperties(prefix = "xinyilu-database")
public class XinYiLuDatabase {
private Long id;
}

View File

@ -71,4 +71,14 @@ public class PropagandaInfoDto extends BaseEntity {
@ApiModelProperty(value = "创建时间结束")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate createTimeEnd;
/**
* 机构来源 PRIVATE私有的PUBLIC公共的
*/
private String source;
/**
* 机构id根据机构来源写入机构id
*/
private Long publicId;
}

View File

@ -1,6 +1,7 @@
package com.xinelu.manage.service.propagandainfo.impl;
import com.xinelu.common.annotation.DataScope;
import com.xinelu.common.config.XinYiLuDatabase;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.SecurityUtils;
@ -27,6 +28,7 @@ import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -48,6 +50,8 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService {
private AgencyMapper agencyMapper;
@Resource
private GenerateSystemCodeUtil generateSystemCodeUtil;
@Resource
private XinYiLuDatabase xinYiLuDatabase;
/**
* 查询宣教库管理
@ -89,8 +93,11 @@ public class PropagandaInfoServiceImpl implements IPropagandaInfoService {
* @return 宣教库管理
*/
@Override
@DataScope(agencyAlias = "p")
//@DataScope(agencyAlias = "p") 除admin其他账号的机构id必传
public List<PropagandaInfo> selectPropagandaInfoList(PropagandaInfoDto propagandaInfo) {
if (StringUtils.isNotBlank(propagandaInfo.getSource()) && propagandaInfo.getSource().equals("PUBLIC")){
propagandaInfo.setPublicId(xinYiLuDatabase.getId());
}
return propagandaInfoMapper.selectPropagandaInfoList(propagandaInfo);
}

View File

@ -40,9 +40,12 @@
p.propaganda_link, p.propaganda_barcode_path,p.del_flag,p.source_template_id, p.create_by, p.create_time, p.update_by, p.update_time from propaganda_info p
<where>
p.del_flag = 0
<if test="hospitalAgencyId != null ">
<if test="hospitalAgencyId != null and publicId == null">
and p.hospital_agency_id = #{hospitalAgencyId}
</if>
<if test="hospitalAgencyId != null and publicId != null">
and (p.hospital_agency_id = #{hospitalAgencyId} or p.hospital_agency_id = #{publicId})
</if>
<if test="departmentId != null ">
and p.department_id = #{departmentId}
</if>
@ -67,8 +70,6 @@
<if test="createTimeEnd != null">
and date_format(p.create_time, '%y%m%d') &lt;= date_format(#{createTimeEnd}, '%y%m%d')
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
</where>
order by p.update_time desc
</select>