yxh
yxh
2024-03-08 25fb6d7ba484738ebe9c577eba4f3596520caf60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
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);
    }
 
 
}