liusheng
2026-01-21 29f287cf6e4869d7bbc283991458e09a03b59c52
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
package com.ruoyi.project.service.impl;
 
import java.util.List;
 
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.domain.ServiceDonateorgan;
import com.ruoyi.project.domain.dto.DonateorganBaseInfoDTO;
import com.ruoyi.project.domain.vo.DonateorganBaseInfoVO;
import com.ruoyi.project.mapper.ServiceDonateorganMapper;
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.ServiceDonateorganBaseMapper;
import com.ruoyi.project.domain.ServiceDonateorganBase;
import com.ruoyi.project.service.IServiceDonateorganBaseService;
 
/**
 * 捐献器官分配基础Service业务层处理
 *
 * @author ls
 * @date 2026-01-17
 */
@Service
public class ServiceDonateorganBaseServiceImpl extends ServiceImpl<ServiceDonateorganBaseMapper, ServiceDonateorganBase> implements IServiceDonateorganBaseService {
 
    @Autowired
    private ServiceDonateorganBaseMapper serviceDonateorganBaseMapper;
 
    @Autowired
    private ServiceDonateorganMapper serviceDonateorganMapper;
 
    /**
     * 查询捐献器官分配基础列表
     *
     * @param serviceDonateorganBase 捐献器官分配基础
     * @return 捐献器官分配基础
     */
    @Override
    public Page<ServiceDonateorganBase> queryList(ServiceDonateorganBase serviceDonateorganBase) {
        LambdaQueryWrapper<ServiceDonateorganBase> wrappers = Wrappers.lambdaQuery();
        if (serviceDonateorganBase.getInfoid() != null) {
            wrappers.eq(ServiceDonateorganBase::getInfoid, serviceDonateorganBase.getInfoid());
        }
        if (serviceDonateorganBase.getAllocationStatus() != null) {
            wrappers.eq(ServiceDonateorganBase::getAllocationStatus, serviceDonateorganBase.getAllocationStatus());
        }
        if (serviceDonateorganBase.getAllocationTime() != null) {
            wrappers.eq(ServiceDonateorganBase::getAllocationTime, serviceDonateorganBase.getAllocationTime());
        }
        if (StringUtils.isNotBlank(serviceDonateorganBase.getRegistrationCode())) {
            wrappers.eq(ServiceDonateorganBase::getRegistrationCode, serviceDonateorganBase.getRegistrationCode());
        }
        if (StringUtils.isNotBlank(serviceDonateorganBase.getRegistrationName())) {
            wrappers.like(ServiceDonateorganBase::getRegistrationName, serviceDonateorganBase.getRegistrationName());
        }
        if (serviceDonateorganBase.getRegistrationTime() != null) {
            wrappers.eq(ServiceDonateorganBase::getRegistrationTime, serviceDonateorganBase.getRegistrationTime());
        }
        if (serviceDonateorganBase.getEstimatedtime() != null) {
            wrappers.eq(ServiceDonateorganBase::getEstimatedtime, serviceDonateorganBase.getEstimatedtime());
        }
 
        int currentPage = (serviceDonateorganBase.getPageNum() == null || serviceDonateorganBase.getPageNum() < 1) ? 1 : serviceDonateorganBase.getPageNum();
        int size = (serviceDonateorganBase.getPageSize() == null || serviceDonateorganBase.getPageSize() < 1) ? 10 : serviceDonateorganBase.getPageSize();
        Page<ServiceDonateorganBase> page = new Page<>(currentPage, size);
        List<ServiceDonateorganBase> serviceDonateorganBaseList = serviceDonateorganBaseMapper.selectPage(page, wrappers).getRecords();
 
        return page.setRecords(serviceDonateorganBaseList);
    }
 
    @Override
    public List<DonateorganBaseInfoDTO> getDonateorganBaseInfoList(DonateorganBaseInfoVO donateorganBaseInfoVO) {
        List<DonateorganBaseInfoDTO> donateorganBaseInfoList = serviceDonateorganBaseMapper.getDonateorganBaseInfoList(donateorganBaseInfoVO);
        if (!donateorganBaseInfoList.isEmpty() && donateorganBaseInfoVO.getPageNum() != null) {
            for (DonateorganBaseInfoDTO donateorganBaseInfoDTO : donateorganBaseInfoList) {
                ServiceDonateorgan serviceDonateorgan = new ServiceDonateorgan();
                serviceDonateorgan.setInfoid(donateorganBaseInfoDTO.getInfoid());
                serviceDonateorgan.setBaseId(donateorganBaseInfoDTO.getId());
 
                //获取捐献多个器官详情管理列表
                List<ServiceDonateorgan> serviceDonateorgans = serviceDonateorganMapper.selectServiceDonateorganList(serviceDonateorgan);
                donateorganBaseInfoDTO.setServiceDonateorganList(serviceDonateorgans);
            }
        }
        return donateorganBaseInfoList;
    }
 
 
    /**
     * 查询捐献器官分配基础列表
     *
     * @param serviceDonateorganBase 捐献器官分配基础
     * @return 捐献器官分配基础
     */
    @Override
    public List<ServiceDonateorganBase> exportQueryList(ServiceDonateorganBase serviceDonateorganBase) {
        LambdaQueryWrapper<ServiceDonateorganBase> wrappers = Wrappers.lambdaQuery();
        if (serviceDonateorganBase.getInfoid() != null) {
            wrappers.eq(ServiceDonateorganBase::getInfoid, serviceDonateorganBase.getInfoid());
        }
        if (serviceDonateorganBase.getAllocationStatus() != null) {
            wrappers.eq(ServiceDonateorganBase::getAllocationStatus, serviceDonateorganBase.getAllocationStatus());
        }
        if (serviceDonateorganBase.getAllocationTime() != null) {
            wrappers.eq(ServiceDonateorganBase::getAllocationTime, serviceDonateorganBase.getAllocationTime());
        }
        if (StringUtils.isNotBlank(serviceDonateorganBase.getRegistrationCode())) {
            wrappers.eq(ServiceDonateorganBase::getRegistrationCode, serviceDonateorganBase.getRegistrationCode());
        }
        if (StringUtils.isNotBlank(serviceDonateorganBase.getRegistrationName())) {
            wrappers.like(ServiceDonateorganBase::getRegistrationName, serviceDonateorganBase.getRegistrationName());
        }
        if (serviceDonateorganBase.getRegistrationTime() != null) {
            wrappers.eq(ServiceDonateorganBase::getRegistrationTime, serviceDonateorganBase.getRegistrationTime());
        }
        if (serviceDonateorganBase.getEstimatedtime() != null) {
            wrappers.eq(ServiceDonateorganBase::getEstimatedtime, serviceDonateorganBase.getEstimatedtime());
        }
        return this.list(wrappers);
    }
 
}