From 6c437e90346275add0bd072adcef62899bc2efaa Mon Sep 17 00:00:00 2001 From: leebeomjun Date: Tue, 12 Mar 2024 14:06:55 +0900 Subject: [PATCH] =?UTF-8?q?DataObject=EB=82=B4=20OCR=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20=EB=A9=94=EC=86=8C=EB=93=9C=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/file/etc/OutsourcingFileWriter.java | 4 +++ .../java/cokr/xit/fims/cmmn/CmmnUtil.java | 27 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/main/java/cokr/xit/base/file/etc/OutsourcingFileWriter.java b/src/main/java/cokr/xit/base/file/etc/OutsourcingFileWriter.java index 7a327f6c..2be3d883 100644 --- a/src/main/java/cokr/xit/base/file/etc/OutsourcingFileWriter.java +++ b/src/main/java/cokr/xit/base/file/etc/OutsourcingFileWriter.java @@ -64,6 +64,9 @@ public class OutsourcingFileWriter { for(int i=0; i < dataObjectList.size(); i++) { DataObject dataObject = dataObjectList.get(i); + + CmmnUtil.setOcrInfo(dataObject); + int crdnPhotoCnt = dataObject.number("CRDN_PHOTO_CNT").intValue(); for(int j=0; j < crdnPhotoCnt; j++){ @@ -138,6 +141,7 @@ public class OutsourcingFileWriter { } } else { + artclValue = dataObject.string(artclNm); } line += hangul.rpadByte(artclValue, byteCnt, " "); diff --git a/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java b/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java index e4c2d97c..c245eb86 100644 --- a/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java +++ b/src/main/java/cokr/xit/fims/cmmn/CmmnUtil.java @@ -483,6 +483,31 @@ public class CmmnUtil { return band6; } + public static void setOcrInfo(DataObject dataObject) { + + String deptCode = dataObject.string("DEPT_CD"); + String fyr = dataObject.string("FYR"); + String acntgSeCd = dataObject.string("ACNTG_SE_CD"); + String txitmCd = dataObject.string("TXITM_CD"); + String levyNo = dataObject.string("LEVY_NO"); + String inspyNo = dataObject.string("INSPY_NO"); + String ocr0 = CmmnUtil.getOcrband1(deptCode,fyr, acntgSeCd, txitmCd, levyNo, inspyNo); + dataObject.set("OCR0", ocr0); + dataObject.set("OCR0_1", ocr0.substring(0, 17)); + dataObject.set("OCR0_2", ocr0.substring(17)); + + String levySeCd = dataObject.string("LEVY_SE_CD"); + int sumAmt = dataObject.number("SUM_AMT").intValue(); // 합계 금액 + String dudtYmd = dataObject.string("DUDT_YMD"); + String ocr1 = CmmnUtil.getOcrband2(ocr0, levySeCd, sumAmt, dudtYmd); + dataObject.set("OCR1", ocr1); + + int afterSumAmt = dataObject.number("DUDT_AFTR_AMT").intValue(); // 납기후 금액 + String ocr2 = CmmnUtil.getOcrband3(ocr1, sumAmt, dudtYmd, afterSumAmt); + dataObject.set("OCR2", ocr2); + + } + /** 엑셀파일 공통 헤더 스타일 생성 * @param xlsx * @return XLSWriter.Styler @@ -555,4 +580,6 @@ public class CmmnUtil { CellDecorator decorator = new CellDecorator(valueDeco, memoDeco); return decorator; } + + } \ No newline at end of file