견문보고 >견문통계>견문통계 엑셀 가능

master
Hyung Geun 2022-04-29 15:01:04 +09:00
parent 4f17dbdb80
commit 140357e136
1 changed files with 25 additions and 10 deletions

View File

@ -1,12 +1,7 @@
package kcg.faics.report.web; package kcg.faics.report.web;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -202,29 +197,49 @@ public class ReportStatsController {
searchVO = ReportCommon.setSearchUserInfo(searchVO); searchVO = ReportCommon.setSearchUserInfo(searchVO);
// 분야별 통계 // 분야별 통계
if ("C".equals(searchVO.getStatsType())) { if ("C".equals(searchVO.getStatsType())) {
header.put("placename", messageSource.getMessage("report.view.division", null, locale)); header.put("placename", messageSource.getMessage("report.view.division", null, locale));
header.put("total", messageSource.getMessage("report.stats.total", null, locale)); header.put("total", messageSource.getMessage("report.stats.total", null, locale));
if(reportSearchVO.getCategory1()!=null){ if(reportSearchVO.getCategory1() != null) {
for (String category : reportSearchVO.getCategory1()) { for (String category : reportSearchVO.getCategory1()) {
header.put(category + "_1", messageSource.getMessage("report.category." + category + "_1", null, locale)); header.put(category + "_1", messageSource.getMessage("report.category." + category + "_1", null, locale));
} }
} }
else {
HashMap<String, String> category = cateService.getCategory1();
searchVO.setCategory1(category.keySet().toArray(new String[category.size()]));
}
if(reportSearchVO.getCategory2()!=null) { if(reportSearchVO.getCategory2()!=null) {
for (String category : reportSearchVO.getCategory2()) { for (String category : reportSearchVO.getCategory2()) {
header.put(category + "_2", messageSource.getMessage("report.category." + category + "_2", null, locale)); header.put(category + "_2", messageSource.getMessage("report.category." + category + "_2", null, locale));
} }
} }
else {
HashMap<String, String> category = cateService.getCategory2();
searchVO.setCategory2(category.keySet().toArray(new String[category.size()]));
}
if(reportSearchVO.getCategory3()!=null) { if(reportSearchVO.getCategory3()!=null) {
for (String category : reportSearchVO.getCategory3()) { for (String category : reportSearchVO.getCategory3()) {
header.put(category + "_3", messageSource.getMessage("report.category." + category + "_3", null, locale)); header.put(category + "_3", messageSource.getMessage("report.category." + category + "_3", null, locale));
} }
} }
else {
HashMap<String, String> category = cateService.getCategory3();
searchVO.setCategory3(category.keySet().toArray(new String[category.size()]));
}
if(reportSearchVO.getCategory4()!=null) { if(reportSearchVO.getCategory4()!=null) {
for (String category : reportSearchVO.getCategory4()) { for (String category : reportSearchVO.getCategory4()) {
header.put(category + "_4", messageSource.getMessage("report.category." + category + "_4", null, locale)); header.put(category + "_4", messageSource.getMessage("report.category." + category + "_4", null, locale));
} }
} }
else {
HashMap<String, String> category = cateService.getCategory4();
searchVO.setCategory4(category.keySet().toArray(new String[category.size()]));
}
try { try {
Date d = new Date(); Date d = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
@ -239,7 +254,7 @@ public class ReportStatsController {
searchVO.setPlaces(placeList.toArray(new String[placeList.size()])); searchVO.setPlaces(placeList.toArray(new String[placeList.size()]));
} }
// 분류 아무것도 선택하지 않은 경우 모두 세팅 /* // 분류 아무것도 선택하지 않은 경우 모두 세팅
if (searchVO.isSearchCate1() && searchVO.getCategory1().length == 0) { if (searchVO.isSearchCate1() && searchVO.getCategory1().length == 0) {
HashMap<String, String> category = cateService.getCategory1(); HashMap<String, String> category = cateService.getCategory1();
searchVO.setCategory1(category.keySet().toArray(new String[category.size()])); searchVO.setCategory1(category.keySet().toArray(new String[category.size()]));
@ -255,7 +270,7 @@ public class ReportStatsController {
if (searchVO.isSearchCate1() && searchVO.getCategory4().length == 0) { if (searchVO.isSearchCate1() && searchVO.getCategory4().length == 0) {
HashMap<String, String> category = cateService.getCategory4(); HashMap<String, String> category = cateService.getCategory4();
searchVO.setCategory4(category.keySet().toArray(new String[category.size()])); searchVO.setCategory4(category.keySet().toArray(new String[category.size()]));
} }*/
List<HashMap<String, String>> list = judgeService.statsCategory(searchVO); List<HashMap<String, String>> list = judgeService.statsCategory(searchVO);