Преглед изворни кода

Merge branch 'develop' into eskim

eskim пре 5 година
родитељ
комит
4554d22488

+ 30 - 0
style24.admin/src/main/java/com/style24/admin/biz/service/TsaRendererService.java

@@ -1,5 +1,6 @@
 package com.style24.admin.biz.service;
 
+import java.util.ArrayList;
 import java.util.Collection;
 
 import org.springframework.beans.factory.annotation.Autowired;
@@ -27,6 +28,33 @@ public class TsaRendererService {
 	@Autowired
 	private TsaRendererDao rendererDao;
 
+	/**
+	 * 연도 목록
+	 * @param startYear - 시작연도
+	 * @param startOffset - Start offset. 시작연도
+	 * @param endOffset - End offset. 종료연도
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 10. 22.
+	 */
+	public Collection<CommonCode> getYearList(int startYear, int startOffset, int endOffset) {
+		Collection<CommonCode> yearList = new ArrayList<>();
+
+		int start = startYear + startOffset;
+		int end = startYear + endOffset;
+
+		for (int year = start; year <= end; year++) {
+			CommonCode commonCode = new CommonCode();
+
+			commonCode.setCd(String.valueOf(year));
+			commonCode.setCdNm(String.valueOf(year));
+
+			yearList.add(commonCode);
+		}
+
+		return yearList;
+	}
+
 	/**
 	 * 공급업체 목록
 	 * @param supplyCompany - 공급업체 정보
@@ -242,6 +270,7 @@ public class TsaRendererService {
 		brand.setSupplyCompCd(supplyCompCd);
 		return rendererDao.getBrandList(brand);
 	}
+
 //
 //	/**
 //	 * 브랜드그룹별 브랜드 목록
@@ -368,6 +397,7 @@ public class TsaRendererService {
 	public Collection<CommonCode> getColorList(Color color) {
 		return rendererDao.getColorList(color);
 	}
+
 //
 //	/**
 //	 * 사용중 대카테고리 목록