package com.ruoyi.project.service.impl;
|
|
import java.util.List;
|
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
import com.ruoyi.common.utils.DateUtils;
|
import com.ruoyi.common.utils.SecurityUtils;
|
import com.ruoyi.project.domain.vo.DonateFollowupVO;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import java.util.ArrayList;
|
import java.util.Map;
|
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.project.mapper.ServiceDonatefollowupMapper;
|
import com.ruoyi.project.domain.ServiceDonatefollowup;
|
import com.ruoyi.project.service.IServiceDonatefollowupService;
|
|
/**
|
* 捐献随访Service业务层处理
|
*
|
* @author ruoyi
|
* @date 2021-12-10
|
*/
|
@Service
|
public class ServiceDonatefollowupServiceImpl extends ServiceImpl<ServiceDonatefollowupMapper, ServiceDonatefollowup> implements IServiceDonatefollowupService
|
{
|
|
@Autowired
|
ServiceDonatefollowupMapper serviceDonatefollowupMapper;
|
|
|
/**
|
* 查询捐献随访列表
|
*
|
* @param serviceDonatefollowup 捐献随访
|
* @return 捐献随访
|
*/
|
@Override
|
public List<ServiceDonatefollowup> queryList(ServiceDonatefollowup serviceDonatefollowup) {
|
LambdaQueryWrapper<ServiceDonatefollowup> wrappers = Wrappers.lambdaQuery();
|
if (serviceDonatefollowup.getSeqno() != null){
|
wrappers.eq(ServiceDonatefollowup::getSeqno ,serviceDonatefollowup.getSeqno());
|
}
|
if (StringUtils.isNotBlank(serviceDonatefollowup.getRecipientname())){
|
wrappers.like(ServiceDonatefollowup::getRecipientname ,serviceDonatefollowup.getRecipientname());
|
}
|
if (StringUtils.isNotBlank(serviceDonatefollowup.getHospitalname())){
|
wrappers.like(ServiceDonatefollowup::getHospitalname ,serviceDonatefollowup.getHospitalname());
|
}
|
if (StringUtils.isNotBlank(serviceDonatefollowup.getDonateresult())){
|
wrappers.eq(ServiceDonatefollowup::getDonateresult ,serviceDonatefollowup.getDonateresult());
|
}
|
return this.list(wrappers);
|
}
|
|
@Override
|
public List<ServiceDonatefollowup> selectAll(ServiceDonatefollowup serviceDonatefollowup) {
|
return serviceDonatefollowupMapper.selectAll(serviceDonatefollowup);
|
}
|
|
@Override
|
public ServiceDonatefollowup selectFollowUpById(Long id) {
|
return serviceDonatefollowupMapper.selectFollowUpById(id);
|
}
|
|
@Override
|
public List<DonateFollowupVO> selectVOList(DonateFollowupVO donateFollowupVO) {
|
SysUser user = SecurityUtils.getLoginUser().getUser();
|
List <SysRole> l = user.getRoles();
|
Boolean b = false;
|
for(SysRole r : l){
|
if(r.getRoleId().longValue() == 3){
|
b = true;
|
}
|
}
|
if(b){
|
donateFollowupVO.setBasecreateby(user.getUserName());
|
}
|
|
return serviceDonatefollowupMapper.selectVOList(donateFollowupVO);
|
}
|
|
|
}
|