package org.springblade.audit.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springblade.audit.dto.IntFzzDisconutDTO;
import org.springblade.customer.dto.FctCsRecordsDTO;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Slf4j
@Component
public class IntFzzDiscountListener extends AnalysisEventListener<IntFzzDisconutDTO> {

	public List<IntFzzDisconutDTO> list = new ArrayList<IntFzzDisconutDTO>();

	public boolean sysHead = true;

	public IntFzzDiscountListener() {
	}

	@Override
	public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
		if(headMap.size() != 17){
			sysHead = false;
		}
	}

	@Override
	public void invoke(IntFzzDisconutDTO t, AnalysisContext analysisContext) {
		Integer rowIndex = analysisContext.readRowHolder().getRowIndex();
		if(!StringUtils.isBlank(t.getAcceptTime())){
			list.add(t);
		}
	}

	@Override
	public void doAfterAllAnalysed(AnalysisContext analysisContext) {
	}


}
