package org.jeecg.modules.database.dto;

import cn.hutool.core.collection.CollUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @Description: 试验管理
 * @Author: jeecg-boot
 * @Date: 2024-08-30
 * @Version: V1.0
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
public class RadiationMapDTO implements Serializable {
    private static final long                     serialVersionUID = 1L;
    /**
     * 小钴源
     */
    private              List<RadiationDetailDTO> xgy;
    /**
     * 大钴源
     */
    private              List<RadiationDetailDTO> dgy;
    /**
     * X光机
     */
    private              List<RadiationDetailDTO> x;
    /**
     * 电子加速器
     */
    private              List<RadiationDetailDTO> electronics;
    /**
     * 质子加速器
     */
    private              List<RadiationDetailDTO> proton;

    public List<RadiationDetailDTO> assembleDetails() {
        List<RadiationDetailDTO> allList = new ArrayList<>();
        if (CollUtil.isNotEmpty(getXgy())) {
            allList.addAll(getXgy());
        }
        if (CollUtil.isNotEmpty(getDgy())) {
            allList.addAll(getDgy());
        }
        if (CollUtil.isNotEmpty(getX())) {
            allList.addAll(getX());
        }
        if (CollUtil.isNotEmpty(getElectronics())) {
            allList.addAll(getElectronics());
        }
        if (CollUtil.isNotEmpty(getProton())) {
            allList.addAll(getProton());
        }
        return allList;
    }

}
