宣教来源
This commit is contained in:
parent
2aeef5a79b
commit
daf40d5b71
@ -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;
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -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') <= date_format(#{createTimeEnd}, '%y%m%d')
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</where>
|
||||
order by p.update_time desc
|
||||
</select>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user