From 104330bd75f6cf3909f16d5395b658f01e0e087f Mon Sep 17 00:00:00 2001 From: leebj Date: Thu, 5 Sep 2024 16:49:35 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=91=EC=85=80=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?=EA=B8=B0=EB=8A=A5=20=EC=86=8C=EC=8A=A4=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cokr/xit/fims/cmmn/xls/FormatMaker.java | 68 ------------------- .../cokr/xit/fims/cmmn/xls/StyleMaker.java | 24 ------- 2 files changed, 92 deletions(-) delete mode 100644 src/main/java/cokr/xit/fims/cmmn/xls/FormatMaker.java delete mode 100644 src/main/java/cokr/xit/fims/cmmn/xls/StyleMaker.java diff --git a/src/main/java/cokr/xit/fims/cmmn/xls/FormatMaker.java b/src/main/java/cokr/xit/fims/cmmn/xls/FormatMaker.java deleted file mode 100644 index 4e272d98..00000000 --- a/src/main/java/cokr/xit/fims/cmmn/xls/FormatMaker.java +++ /dev/null @@ -1,68 +0,0 @@ -package cokr.xit.fims.cmmn.xls; - -import java.io.File; -import java.util.Map; - -import org.apache.poi.hssf.util.HSSFColor; - -import cokr.xit.base.docs.xls.Comment; -import cokr.xit.base.docs.xls.Format; -import cokr.xit.base.docs.xls.Style; -import cokr.xit.foundation.data.DataFormat; - -public class FormatMaker { - - @SuppressWarnings("rawtypes") - public static Format photoCellForApproval(Format format, Comment comment, String key) { - return format.of(key) - .value(obj -> { - if(((Map)obj).get(key) == null) { - return "없음"; - } - String value = (String)((Map)obj).get(key); - if(value.equals("")) { - return "없음"; - } - if(!(new File(value)).exists()) { - return "이미지 경로 존재하지 않음"; - } - if((new File(value)).length() == 0) { - return "이미지 크기 오류"; - } - if((new File(value)).length() > (1024 * 1024 * 3)){ - return "사진크기(3MB)초과"; - } - return " "; - }) - .onCell(obj -> { - if(((Map)obj).get(key) == null) { return; } - String value = (String)((Map)obj).get(key); - if(value.equals("")) { return; } - if(!(new File(value)).exists()) { return; } - if((new File(value)).length() == 0) { return; } - if((new File(value)).length() > (1024 * 1024 * 3)){ return; } - - comment.setImageComment((String)((Map)obj).get(key)); - }) - .style(new Style().foregroundColor(HSSFColor.HSSFColorPredefined.YELLOW.getIndex())); - } - - - @SuppressWarnings("rawtypes") - public static Format yyyy_mm_dd_hh_mm_ss(Format format, String key) { - return format.of(key).value(o -> { - return DataFormat.yyyy_mm_dd_hh_mm_ss(((Map) o).get(key)); - }); - } - - - @SuppressWarnings("rawtypes") - public static Format yyyy_mm_dd(Format format, String key) { - return format.of(key).value(o -> { - return DataFormat.yyyy_mm_dd(((Map) o).get(key)); - }); - } - - - -} diff --git a/src/main/java/cokr/xit/fims/cmmn/xls/StyleMaker.java b/src/main/java/cokr/xit/fims/cmmn/xls/StyleMaker.java deleted file mode 100644 index ad7bd1d4..00000000 --- a/src/main/java/cokr/xit/fims/cmmn/xls/StyleMaker.java +++ /dev/null @@ -1,24 +0,0 @@ -package cokr.xit.fims.cmmn.xls; - -import org.apache.poi.hssf.util.HSSFColor; -import org.apache.poi.ss.usermodel.Font; -import org.apache.poi.ss.usermodel.HorizontalAlignment; - -import cokr.xit.base.docs.xls.Style; -import cokr.xit.base.docs.xls.XLSWriter; - - -public class StyleMaker { - - public static Style headerStyle(XLSWriter xlsx) { - return new Style() - .foregroundColor(HSSFColor.HSSFColorPredefined.GREY_25_PERCENT.getIndex()) - .configure(styl -> { - Font font = xlsx.workbook().createFont(); - font.setColor(HSSFColor.HSSFColorPredefined.BLACK.getIndex()); - styl.font(font); - styl.alignment(HorizontalAlignment.CENTER); - }); - } - -}