package com.ruoyi.ibs.draw.domain.dto.grid;

import lombok.Data;

import java.util.List;

/**
 * @Author 吴凯程
 * @Date 2024/12/23
 **/
@Data
public class CustCountDTO {
    private Long retailCount;

    private Long businessCount;

    private Long merchantCount;

    public CustCountDTO() {
        this.setRetailCount(0L);
        this.setMerchantCount(0L);
        this.setBusinessCount(0L);
    }

    public void accumulate(List<CustCountDTO> countDTOList) {
        countDTOList.forEach(item -> {
            this.setRetailCount(this.getRetailCount() + item.getRetailCount());
            this.setBusinessCount(this.getBusinessCount() + item.getBusinessCount());
            this.setMerchantCount(this.getMerchantCount() + item.getMerchantCount());
        });
    }
}
