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