package com.ruoyi.trade.vo;

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

import lombok.Data;

@Data
public class TrademarkYearQo {
	
	private String year;
	private String beginDate;
	private String endDate;
	
	
	
	public static List<TrademarkYearQo> newTrademarkYearQos(String endDay) {
		int maxLen = 6;
		
		List<TrademarkYearQo>list=new ArrayList<TrademarkYearQo>();
		
		int endYear = Integer.parseInt(endDay.substring(0, 4));
		String endMonth = endDay.substring(4, 6);
		for (int i = 0; i < maxLen; i++) {
			String year = (endYear - (maxLen + i - 1)) + "";
			if (maxLen + i > 1) {
				endMonth = "1216";
			}
			list.add(newTrademarkYearQo(year,endMonth));
		}
		
		return list;
	}
	
	private static TrademarkYearQo newTrademarkYearQo(String year,String month) {
		TrademarkYearQo qo=new TrademarkYearQo();
		qo.setYear(year);
		
		int yearInt=Integer.parseInt(year);
		
		String beginDate=(yearInt-1)+"1216";
		String endDate=yearInt+"1215";
		
		qo.setBeginDate(beginDate);
		qo.setEndDate(endDate);
		
		return qo;
		
	}
	
	

}
