From b9c11e7de25ab5e22b2646d631e9de22d9ab4f76 Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Fri, 10 May 2024 11:24:47 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=91=EC=85=80=EC=A0=80=EC=9E=A5=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xit/fims/crdn/web/Crdn02Controller.java | 13 +--- .../xit/fims/crdn/web/Crdn03Controller.java | 13 +--- .../xit/fims/crdn/web/Crdn06Controller.java | 9 +-- .../xit/fims/crdn/web/Crdn08Controller.java | 15 +--- .../xit/fims/cvlc/web/Cvlc01Controller.java | 14 +--- .../xit/fims/cvlc/web/Cvlc02Controller.java | 10 +-- .../xit/fims/cvlc/web/Cvlc03Controller.java | 13 +--- .../xit/fims/epst/web/Epst02Controller.java | 29 ++----- .../xit/fims/excl/web/Excl01Controller.java | 10 +-- .../xit/fims/excl/web/Excl02Controller.java | 8 +- .../xit/fims/excl/web/Excl03Controller.java | 8 +- .../xit/fims/levy/web/Levy01Controller.java | 15 +--- .../xit/fims/levy/web/Levy02Controller.java | 8 +- .../xit/fims/rcvm/web/Rcvm01Controller.java | 8 +- .../xit/fims/rdca/web/Rdca01Controller.java | 8 +- .../xit/fims/sndb/web/Sndb01Controller.java | 78 ++++++------------- .../xit/fims/sprt/web/Sprt01Controller.java | 12 +-- .../xit/fims/sprt/web/Sprt04Controller.java | 8 +- 18 files changed, 73 insertions(+), 206 deletions(-) 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