|
|
@ -31,7 +31,6 @@ import javax.imageio.ImageIO;
|
|
|
|
import org.apache.commons.io.FilenameUtils;
|
|
|
|
import org.apache.commons.io.FilenameUtils;
|
|
|
|
import org.springframework.core.io.ClassPathResource;
|
|
|
|
import org.springframework.core.io.ClassPathResource;
|
|
|
|
|
|
|
|
|
|
|
|
import cokr.xit.fims.sndb.service.bean.SndngBean;
|
|
|
|
|
|
|
|
import cokr.xit.foundation.data.DataObject;
|
|
|
|
import cokr.xit.foundation.data.DataObject;
|
|
|
|
import cokr.xit.foundation.util.DateFormats;
|
|
|
|
import cokr.xit.foundation.util.DateFormats;
|
|
|
|
|
|
|
|
|
|
|
@ -439,10 +438,38 @@ public class CmmnUtil {
|
|
|
|
return convert;
|
|
|
|
return convert;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static String getOcrband1(String deptCode, String fyr, String acntgSeCd, String txitmCd, String levyNo, String inspyNo) {
|
|
|
|
/**OCR 밴드의 검을 반환한다.
|
|
|
|
|
|
|
|
* @param vrfcCode 검증에 사용할 코드
|
|
|
|
|
|
|
|
* ocrData OCR 데이터
|
|
|
|
|
|
|
|
* bgngPstn 시작 위치
|
|
|
|
|
|
|
|
* totalLength OCR 데이터의 총길이
|
|
|
|
|
|
|
|
* @return 검증 코드
|
|
|
|
|
|
|
|
* <ul><li>저장됐으면 true</li>
|
|
|
|
|
|
|
|
* <li>그렇지 않으면 false</li>
|
|
|
|
|
|
|
|
* </ul>
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public static String getOcrVrfcCode(String vrfcCode, String strData, int totalLength) {
|
|
|
|
|
|
|
|
int temp = 0;
|
|
|
|
|
|
|
|
int cdTemp = 0;
|
|
|
|
|
|
|
|
String retCode = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int iLoop = 0; iLoop < totalLength; iLoop++) {
|
|
|
|
|
|
|
|
temp = (iLoop + vrfcCode.length()) % vrfcCode.length();
|
|
|
|
|
|
|
|
cdTemp = cdTemp + (Integer.valueOf(strData.substring(iLoop, iLoop + 1)) * Integer.valueOf(vrfcCode.substring(temp, temp + 1)));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
retCode = String.valueOf(cdTemp % 10);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return retCode;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static String getOcrband1(String deptCode, String spclBizCd, String fyr, String acntgSeCd, String txitmCd, String levyNo, String inspyNo) {
|
|
|
|
if(deptCode.equals("")) {
|
|
|
|
if(deptCode.equals("")) {
|
|
|
|
deptCode = "0000000";
|
|
|
|
deptCode = "0000000";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(spclBizCd.equals("")) {
|
|
|
|
|
|
|
|
spclBizCd = "0000";
|
|
|
|
|
|
|
|
}
|
|
|
|
if(fyr.equals("")) {
|
|
|
|
if(fyr.equals("")) {
|
|
|
|
fyr = "0000";
|
|
|
|
fyr = "0000";
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -458,15 +485,16 @@ public class CmmnUtil {
|
|
|
|
if(inspyNo.equals("")) {
|
|
|
|
if(inspyNo.equals("")) {
|
|
|
|
inspyNo = "00";
|
|
|
|
inspyNo = "00";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
String band1 = deptCode + "0000" + fyr + acntgSeCd + txitmCd + levyNo + inspyNo;
|
|
|
|
String band1 = deptCode + spclBizCd + fyr + acntgSeCd + txitmCd + levyNo + inspyNo;
|
|
|
|
|
|
|
|
|
|
|
|
String ocrVrfcCode = SndngBean.getOcrVrfcCode("12357", band1, 31);
|
|
|
|
String ocrVrfcCode = getOcrVrfcCode("12357", band1, 31);
|
|
|
|
band1 = band1 + ocrVrfcCode;
|
|
|
|
band1 = band1 + ocrVrfcCode;
|
|
|
|
|
|
|
|
|
|
|
|
return band1;
|
|
|
|
return band1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static String getOcrband2(String band1, String levySeCd, int sumAmt, String dudtYmd) {
|
|
|
|
public static String getOcrband2(String band1, String levySeCd, int sumAmt, String dudtYmd) {
|
|
|
|
if(dudtYmd.endsWith("")) {
|
|
|
|
if(dudtYmd.equals("")) {
|
|
|
|
dudtYmd = "00000000";
|
|
|
|
dudtYmd = "00000000";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -483,15 +511,16 @@ public class CmmnUtil {
|
|
|
|
+ String.format("%011d", sumAmt)
|
|
|
|
+ String.format("%011d", sumAmt)
|
|
|
|
+ dudtYmd
|
|
|
|
+ dudtYmd
|
|
|
|
+ "0";
|
|
|
|
+ "0";
|
|
|
|
String ocrVrfcCode = SndngBean.getOcrVrfcCode("23571", band1 + band2, 53);
|
|
|
|
String ocrVrfcCode = getOcrVrfcCode("23571", band1 + band2, 53);
|
|
|
|
|
|
|
|
|
|
|
|
band2 = band2 + ocrVrfcCode;
|
|
|
|
band2 = band2 + ocrVrfcCode;
|
|
|
|
band2 = band1 + band2;
|
|
|
|
band2 = band1 + band2;
|
|
|
|
|
|
|
|
|
|
|
|
return band2;
|
|
|
|
return band2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static String getOcrband3(String band2, int sumAmt, String dudtYmd, int afterSumAmt) {
|
|
|
|
public static String getOcrband3(String ocr1, int sumAmt, String dudtYmd, int afterSumAmt) {
|
|
|
|
if(dudtYmd.endsWith("")) {
|
|
|
|
if(dudtYmd.equals("")) {
|
|
|
|
dudtYmd = "00000000";
|
|
|
|
dudtYmd = "00000000";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -503,34 +532,37 @@ public class CmmnUtil {
|
|
|
|
+ "00"
|
|
|
|
+ "00"
|
|
|
|
+ String.format("%011d", sumAmt)
|
|
|
|
+ String.format("%011d", sumAmt)
|
|
|
|
+ "00";
|
|
|
|
+ "00";
|
|
|
|
String ocrVrfcCode = SndngBean.getOcrVrfcCode("35712", band3, 36);
|
|
|
|
String ocrVrfcCode = getOcrVrfcCode("35712", band3, 36);
|
|
|
|
|
|
|
|
|
|
|
|
// band4 = 부과월 + 납기후처리 + 납기후금액(12자리)
|
|
|
|
// band4 = 부과월 + 납기후처리 + 납기후금액(12자리)
|
|
|
|
// 0=납기후 수납가능, 1=납기후 수납불가, 2=납기 무관, 7~9=납기후 수납가능
|
|
|
|
// 0=납기후 수납가능, 1=납기후 수납불가, 2=납기 무관, 7~9=납기후 수납가능
|
|
|
|
String band4 = dudtYmd.substring(4, 6)
|
|
|
|
String band4 = dudtYmd.substring(4, 6)
|
|
|
|
+ "1"
|
|
|
|
+ "1"
|
|
|
|
+ String.format("%012d", afterSumAmt);
|
|
|
|
+ String.format("%012d", afterSumAmt);
|
|
|
|
ocrVrfcCode = SndngBean.getOcrVrfcCode("57123", band3 + band4, 52);
|
|
|
|
ocrVrfcCode = getOcrVrfcCode("57123", band3 + band4, 52);
|
|
|
|
band4 = band4 + ocrVrfcCode;
|
|
|
|
band4 = band4 + ocrVrfcCode;
|
|
|
|
|
|
|
|
|
|
|
|
// band5 = 전체 합산해서 검코드 구하기용, 사용하지는 않음
|
|
|
|
// band5 = 전체 합산해서 검코드 구하기용, 사용하지는 않음
|
|
|
|
String band5 = band2 + band3 + band4;
|
|
|
|
String band5 = ocr1 + band3 + band4;
|
|
|
|
ocrVrfcCode = SndngBean.getOcrVrfcCode("71235", band5, 107);
|
|
|
|
ocrVrfcCode = getOcrVrfcCode("71235", band5, 107);
|
|
|
|
|
|
|
|
|
|
|
|
// band6
|
|
|
|
// band6
|
|
|
|
String band6 = band3 + band4 + ocrVrfcCode;
|
|
|
|
String band6 = band3 + band4 + ocrVrfcCode;
|
|
|
|
|
|
|
|
|
|
|
|
return band6;
|
|
|
|
return band6;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static void setOcrInfo(DataObject dataObject) {
|
|
|
|
public static void setOcrInfo(DataObject dataObject) {
|
|
|
|
|
|
|
|
|
|
|
|
String deptCode = dataObject.string("DEPT_CD");
|
|
|
|
String deptCode = dataObject.string("DEPT_CD");
|
|
|
|
|
|
|
|
String spclBizCd = dataObject.string("SPCL_BIZ_CD");
|
|
|
|
String fyr = dataObject.string("FYR");
|
|
|
|
String fyr = dataObject.string("FYR");
|
|
|
|
String acntgSeCd = dataObject.string("ACNTG_SE_CD");
|
|
|
|
String acntgSeCd = dataObject.string("ACNTG_SE_CD");
|
|
|
|
String txitmCd = dataObject.string("TXITM_CD");
|
|
|
|
String txitmCd = dataObject.string("TXITM_CD");
|
|
|
|
String levyNo = dataObject.string("LEVY_NO");
|
|
|
|
String levyNo = dataObject.string("LEVY_NO");
|
|
|
|
String inspyNo = dataObject.string("INSPY_NO");
|
|
|
|
String inspyNo = dataObject.string("INSPY_NO");
|
|
|
|
String ocr0 = CmmnUtil.getOcrband1(deptCode,fyr, acntgSeCd, txitmCd, levyNo, inspyNo);
|
|
|
|
String ocr0 = CmmnUtil.getOcrband1(deptCode, spclBizCd, fyr, acntgSeCd, txitmCd, levyNo, inspyNo);
|
|
|
|
|
|
|
|
|
|
|
|
dataObject.set("OCR0", ocr0);
|
|
|
|
dataObject.set("OCR0", ocr0);
|
|
|
|
dataObject.set("OCR0_1", ocr0.substring(0, 17));
|
|
|
|
dataObject.set("OCR0_1", ocr0.substring(0, 17));
|
|
|
|
dataObject.set("OCR0_2", ocr0.substring(17));
|
|
|
|
dataObject.set("OCR0_2", ocr0.substring(17));
|
|
|
@ -544,7 +576,6 @@ public class CmmnUtil {
|
|
|
|
int afterSumAmt = dataObject.number("DUDT_AFTR_AMT").intValue(); // 납기후 금액
|
|
|
|
int afterSumAmt = dataObject.number("DUDT_AFTR_AMT").intValue(); // 납기후 금액
|
|
|
|
String ocr2 = CmmnUtil.getOcrband3(ocr1, sumAmt, dudtYmd, afterSumAmt);
|
|
|
|
String ocr2 = CmmnUtil.getOcrband3(ocr1, sumAmt, dudtYmd, afterSumAmt);
|
|
|
|
dataObject.set("OCR2", ocr2);
|
|
|
|
dataObject.set("OCR2", ocr2);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static String getBarcode(String rgSe, String sggCd, String sndngDtlId) {
|
|
|
|
public static String getBarcode(String rgSe, String sggCd, String sndngDtlId) {
|
|
|
|