diff --git a/src/main/java/cokr/xit/fims/crdn/web/Crdn02Controller.java b/src/main/java/cokr/xit/fims/crdn/web/Crdn02Controller.java index 166e3098..a7a664ec 100644 --- a/src/main/java/cokr/xit/fims/crdn/web/Crdn02Controller.java +++ b/src/main/java/cokr/xit/fims/crdn/web/Crdn02Controller.java @@ -1,6 +1,5 @@ package cokr.xit.fims.crdn.web; -import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -8,13 +7,10 @@ import java.util.Map; import javax.annotation.Resource; import org.apache.poi.ss.usermodel.CellStyle; -import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; -import com.fasterxml.jackson.core.type.TypeReference; - import cokr.xit.base.code.CommonCode; import cokr.xit.base.docs.xls.CellDef; import cokr.xit.base.docs.xls.Format; @@ -108,11 +104,11 @@ public class Crdn02Controller extends ApplicationController { if("xls".equals(query.getDownload())) { - ArrayList cellDefs = fromJson(query.getCellDefs(), new TypeReference>() {}); + List cellDefs = fromJson(query.getCellDefs(), CellDef.listType()); XLSWriter xlsx = new XLSWriter().worksheet(0); Format format = new Format(xlsx); - CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); + CellStyle center = format.cellStyle(Style.CENTER); CellStyle numeric = format.n_nn0(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); @@ -142,10 +138,7 @@ public class Crdn02Controller extends ApplicationController { xlsx.cell(0, 0).value("검사자료 목록").value(center).merge(0, cellDefs.size()-1) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i cellDefs = fromJson(query.getCellDefs(), new TypeReference>() {}); + List cellDefs = fromJson(query.getCellDefs(), CellDef.listType()); XLSWriter xlsx = new XLSWriter().worksheet(0); Format format = new Format(xlsx); - CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); + CellStyle center = format.cellStyle(Style.CENTER); CellStyle numeric = format.n_nn0(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); @@ -113,10 +109,7 @@ public class Crdn03Controller extends ApplicationController { xlsx.cell(0, 0).value("표지정보미확인자료 목록").value(center).merge(0, cellDefs.size()-1) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))); xlsx.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i cellDefs = fromJson(query.getCellDefs(), new TypeReference>() {}); + List cellDefs = fromJson(query.getCellDefs(), CellDef.listType()); XLSWriter xlsx = new XLSWriter().worksheet(0); Format format = new Format(xlsx); - CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); - CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT)); + CellStyle center = format.cellStyle(Style.CENTER); + CellStyle left = format.cellStyle(Style.LEFT); CellStyle numeric = format.n_nn0(); CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); @@ -118,10 +114,7 @@ public class Crdn08Controller extends ApplicationController { xlsx.cell(0, 0).value("면제차량 목록").value(center).merge(0, cellDefs.size()-1) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i cellDefs = fromJson(query.getCellDefs(), new TypeReference>() {}); + List cellDefs = fromJson(query.getCellDefs(), CellDef.listType()); XLSWriter xlsx = new XLSWriter().worksheet(0); Format format = new Format(xlsx); - CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); - CellStyle left = format.cellStyle(new Style().alignment(HorizontalAlignment.LEFT)); + CellStyle center = format.cellStyle(Style.CENTER); + CellStyle left = format.cellStyle(Style.LEFT); CellStyle numeric = format.n_nn0(); CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); @@ -159,10 +156,7 @@ public class Cvlc01Controller extends ApplicationController { xlsx.cell(0, 0).value("민원접수자료 목록").value(center).merge(0, cellDefs.size()-1); xlsx.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))); xlsx.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))); xlsx.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i cellDefs = fromJson(query.getCellDefs(), new TypeReference>() {}); + List cellDefs = fromJson(query.getCellDefs(), CellDef.listType()); XLSWriter xlsx = new XLSWriter().worksheet(0); Format format = new Format(xlsx); - CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); + CellStyle center = format.cellStyle(Style.CENTER); CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); @@ -122,10 +118,7 @@ public class Cvlc03Controller extends ApplicationController { xlsx.cell(0, 0).value("민원자료 목록").value(center).merge(0, cellDefs.size()-1); xlsx.cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))); xlsx.cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i list = epostGdccService.getEpostGdccList(req.setFetchSize(0)); @@ -161,10 +160,7 @@ public class Epst02Controller extends ApplicationController { xlsx.cell(0, 0).value("우편통합 안내문").value(center).merge(0, cellDefs.size() - 1) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i list = epostRcptRegService.getEpostRcptRegDtlList(req.setFetchSize(0)); @@ -431,10 +424,7 @@ public class Epst02Controller extends ApplicationController { xlsx.cell(0, 0).value("우편통합 발송상세").value(center).merge(0, cellDefs.size() - 1) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i downList = list.stream().filter(item -> item.string("RCVMT_ETC_YN").equals("Y")).toList(); if("xls".equals(query.getDownload())) { - ArrayList cellDefs = fromJson(query.getCellDefs(), new TypeReference>() {}); + List cellDefs = fromJson(query.getCellDefs(), CellDef.listType()); String fileName = "통합조회자료 목록"; List listForExcel; @@ -227,7 +224,7 @@ public class Sprt01Controller extends ApplicationController { XLSWriter xlsx = new XLSWriter().worksheet(0); Format format = new Format(xlsx); - CellStyle center = format.cellStyle(new Style().alignment(HorizontalAlignment.CENTER)); + CellStyle center = format.cellStyle(Style.CENTER); CellStyle numeric = format.n_nn0(); CellStyle dateYMD = format.yyyy_mm_dd(); CellStyle dateDT = format.yyyy_mm_dd_hh_mm_ss(); @@ -286,10 +283,7 @@ public class Sprt01Controller extends ApplicationController { xlsx.cell(0, 0).value(fileName).value(center).merge(0, cellDefs.size()-1) .cell(3, 0).rowValues(CellDef.header(cellDefs, () -> StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(listForExcel, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i StyleMaker.headerStyle(xlsx))) .cell(4, 0).values(list, CellDef.values(cellDefs.stream().map(i -> {if(i.getValue() instanceof Format) {i.setField(null);}; return i;}).toList())); - List cellWidthInfo = cellDefs.stream().map(CellDef::getWidth).toList(); - for(int i=0; i