DataObject내 OCR정보 생성 메소드 추가

main
이범준 8 months ago
parent c41c401efc
commit 6c437e9034

@ -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, " ");

@ -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;
}
}
Loading…
Cancel
Save