고지서 ocr밴드 출력 추가

main
이범준 11 months ago
parent d0023e5f36
commit 5354a34aa6

@ -21,6 +21,8 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import cokr.xit.fims.sndb.service.bean.SndngBean;
public class CmmnUtil { public class CmmnUtil {
/** /**
@ -273,4 +275,87 @@ public class CmmnUtil {
return convert; return convert;
} }
public static String getOcrband1(String deptCode, String fyr, String acntgSeCd, String txitmCd, String levyNo, String inspySn) {
if(deptCode.equals("")) {
deptCode = "0000000";
}
if(fyr.equals("")) {
fyr = "0000";
}
if(acntgSeCd.equals("")) {
acntgSeCd = "00";
}
if(txitmCd.equals("")) {
txitmCd = "000000";
}
if(levyNo.equals("")) {
levyNo = "000000";
}
if(inspySn.equals("")) {
inspySn = "00";
}
String band1 = deptCode + "0000" + fyr + acntgSeCd + txitmCd + levyNo + inspySn;
String ocrVrfcCode = SndngBean.getOcrVrfcCode("12357", band1, 31);
band1 = band1+ocrVrfcCode;
return band1;
}
public static String getOcrband2(String band1, String levySeCd, int sumAmt, String dudtYmd) {
if(dudtYmd.endsWith("")) {
dudtYmd = "00000000";
}
String levySeCd1 = "";
if (levySeCd.equals("01")) {
levySeCd1 = "1" ;
} else if (levySeCd.equals("02")) {
levySeCd1 = "2" ;
} else {
levySeCd1 = "2" ;
}
String band2 = levySeCd1
+ String.format("%011d", sumAmt)
+ dudtYmd
+ "0";
String ocrVrfcCode = SndngBean.getOcrVrfcCode("23571", band1 + band2, 53);
band2 = band2 + ocrVrfcCode;
band2 = band1 + band2;
return band2;
}
public static String getOcrband3(String band2, int sumAmt, String dudtYmd, int afterSumAmt) {
if(dudtYmd.endsWith("")) {
dudtYmd = "00000000";
}
// OCR 2번째줄 54
// band3 = 국세 + 국세요율(납기후에 추가되는 가산금의 비율) + 시도세 + 시도세요율 + 시군구세 + 시군구세요율
String band3 = "0000000000"
+ "00"
+ "0000000000"
+ "00"
+ String.format("%011d", sumAmt)
+ "00";
String ocrVrfcCode = SndngBean.getOcrVrfcCode("35712", band3, 36);
// band4 = 부과월 + 납기후처리 + 납기후금액(12자리)
// 0=납기후 수납가능, 1=납기후 수납불가, 2=납기 무관, 7~9=납기후 수납가능
String band4 = dudtYmd.substring(4, 6)
+ "1"
+ String.format("%012d", afterSumAmt);
ocrVrfcCode = SndngBean.getOcrVrfcCode("57123", band3 + band4, 52);
band4 = band4 + ocrVrfcCode;
// band5 = 전체 합산해서 검코드 구하기용, 사용하지는 않음
String band5 = band2 + band3 + band4;
ocrVrfcCode = SndngBean.getOcrVrfcCode("71235", band5, 107);
// band6
String band6 = band3 + band4 + ocrVrfcCode;
return band6;
}
} }

@ -83,18 +83,22 @@ public abstract class PDFFormat {
*/ */
public void appendOtptAttribute(List<DataObject> otptArtclStngList) { public void appendOtptAttribute(List<DataObject> otptArtclStngList) {
List<DefaultOtptArtclStng> prototypeStngs = this.getPrototypeStngs(); if(otptArtclStngList!=null && !otptArtclStngList.isEmpty()) {
List<DefaultOtptArtclStng> prototypeStngs = this.getPrototypeStngs();
for(DataObject otptArtclStng : otptArtclStngList) {
String otptArtclNm = (String) otptArtclStng.get("OTPT_ARTCL_NM");
DefaultOtptArtclStng prototypeStng = prototypeStngs.stream()
.filter(item -> item.getOtptArtclNm().equals(otptArtclNm)).toList().get(0);
otptArtclStng.set("UNIQUE_YN", prototypeStng.isUnique() ? "Y" : "N");
otptArtclStng.set("DSCRP", prototypeStng.getDscrp());
otptArtclStng.set("COMPONENT_TYPE", prototypeStng.getComponentType());
otptArtclStng.set("POST_YN", prototypeStng.isForPost() ? "Y" : "N");
}
}
for(DataObject otptArtclStng : otptArtclStngList) {
String otptArtclNm = (String) otptArtclStng.get("OTPT_ARTCL_NM");
DefaultOtptArtclStng prototypeStng = prototypeStngs.stream()
.filter(item -> item.getOtptArtclNm().equals(otptArtclNm)).toList().get(0);
otptArtclStng.set("UNIQUE_YN", prototypeStng.isUnique() ? "Y" : "N");
otptArtclStng.set("DSCRP", prototypeStng.getDscrp());
otptArtclStng.set("COMPONENT_TYPE", prototypeStng.getComponentType());
otptArtclStng.set("POST_YN", prototypeStng.isForPost() ? "Y" : "N");
}
} }
/** /**

@ -332,6 +332,8 @@ public class Advntce extends PDFFormat {
dataObject.put("VR_ACTNO10", "101010-00-000000"); dataObject.put("VR_ACTNO10", "101010-00-000000");
dataObject.put("EPAY_NO", "00000-0-00-00-000000000"); dataObject.put("EPAY_NO", "00000-0-00-00-000000000");
dataObject.put("FFNLG_CRDN_AMT", "100000"); dataObject.put("FFNLG_CRDN_AMT", "100000");
dataObject.put("ADVNTCE_AMT", "80000");
dataObject.put("ADVNTCE_DUDT_YMD", "20231231");
dataObject.put("CRDN_PHOTO1", "samplefiles/crdn1.png"); dataObject.put("CRDN_PHOTO1", "samplefiles/crdn1.png");
dataObject.put("CRDN_PHOTO2", "samplefiles/crdn2.png"); dataObject.put("CRDN_PHOTO2", "samplefiles/crdn2.png");

@ -36,6 +36,10 @@ public class Nht extends PDFFormat {
images("crdnPhoto","단속사진","").a4(110, 100).letter(116, 95).size(90, 80), images("crdnPhoto","단속사진","").a4(110, 100).letter(116, 95).size(90, 80),
image("rprsCrdnPhoto","대표단속사진","").a4(10, 200).letter(10, 186).size(80, 80), image("rprsCrdnPhoto","대표단속사진","").a4(10, 200).letter(10, 186).size(80, 80),
text("ocr1","OCR32자리",""),
text("ocr2","OCR54자리1",""),
text("ocr3","OCR54자리2",""),
text("rtpyrNm","수신자명",""), text("rtpyrNm","수신자명",""),
text("rtpyrNo","수신자번호",""), text("rtpyrNo","수신자번호",""),
text("rtpyrAddr","수신자주소",""), text("rtpyrAddr","수신자주소",""),
@ -193,6 +197,48 @@ public class Nht extends PDFFormat {
result = dataObject.string("EPAY_NO"); result = dataObject.string("EPAY_NO");
} }
case "ocr1" -> {
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 inspySn = dataObject.string("INSPY_SN");
result = CmmnUtil.getOcrband1(deptCode,fyr, acntgSeCd, txitmCd, levyNo, inspySn);
}
case "ocr2" -> {
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 inspySn = dataObject.string("INSPY_SN");
String ocrBand1 = CmmnUtil.getOcrband1(deptCode, fyr, acntgSeCd, txitmCd, levyNo, inspySn);
String levySeCd = dataObject.string("LEVY_SE_CD");
int sumAmt = dataObject.number("SUM_AMT").intValue(); // 합계 금액
String dudtYmd = dataObject.string("DUDT_YMD");
result = CmmnUtil.getOcrband2(ocrBand1, levySeCd, sumAmt, dudtYmd);
}
case "ocr3" -> {
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 inspySn = dataObject.string("INSPY_SN");
String ocrBand1 = CmmnUtil.getOcrband1(deptCode, fyr, acntgSeCd, txitmCd, levyNo, inspySn);
String levySeCd = dataObject.string("LEVY_SE_CD");
int sumAmt = dataObject.number("SUM_AMT").intValue(); // 합계 금액
String dudtYmd = dataObject.string("DUDT_YMD");
String ocrBand2 = CmmnUtil.getOcrband2(ocrBand1, levySeCd, sumAmt, dudtYmd);
int afterSumAmt = dataObject.number("DUDT_AFTR_AMT").intValue(); // 납기후 금액
result = CmmnUtil.getOcrband3(ocrBand2, sumAmt, dudtYmd, afterSumAmt);
}
case "otptYmd" -> { case "otptYmd" -> {
result = DataFormat.yyyy_mm_dd(pdfPrintUtil.getPrintRequestDt().substring(0,8)); result = DataFormat.yyyy_mm_dd(pdfPrintUtil.getPrintRequestDt().substring(0,8));
} }
@ -327,6 +373,19 @@ public class Nht extends PDFFormat {
dataObject.put("VR_ACTNO10", "101010-00-000000"); dataObject.put("VR_ACTNO10", "101010-00-000000");
dataObject.put("EPAY_NO", "00000-0-00-00-000000000"); dataObject.put("EPAY_NO", "00000-0-00-00-000000000");
dataObject.put("FFNLG_CRDN_AMT", "100000"); dataObject.put("FFNLG_CRDN_AMT", "100000");
dataObject.put("ADVNTCE_AMT", "80000");
dataObject.put("ADVNTCE_DUDT_YMD", "20231231");
dataObject.put("DEPT_CD", "4060411");
dataObject.put("FYR", "2023");
dataObject.put("ACNTG_SE_CD", "61");
dataObject.put("TXITM_CD", "234006");
dataObject.put("LEVY_NO", "123456");
dataObject.put("INSPY_SN", "00");
dataObject.put("LEVY_SE_CD", "01");
dataObject.put("SUM_AMT", "80000");
dataObject.put("DUDT_YMD", "20231215");
dataObject.put("DUDT_AFTR_AMT", "20231231");
dataObject.put("CRDN_PHOTO1", "samplefiles/crdn1.png"); dataObject.put("CRDN_PHOTO1", "samplefiles/crdn1.png");
dataObject.put("CRDN_PHOTO2", "samplefiles/crdn2.png"); dataObject.put("CRDN_PHOTO2", "samplefiles/crdn2.png");

@ -6,8 +6,6 @@ import javax.annotation.Resource;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import cokr.xit.foundation.AbstractComponent;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.base.file.service.FileQuery; import cokr.xit.base.file.service.FileQuery;
import cokr.xit.base.file.service.bean.FileBean; import cokr.xit.base.file.service.bean.FileBean;
import cokr.xit.base.user.service.bean.UserBean; import cokr.xit.base.user.service.bean.UserBean;
@ -22,12 +20,14 @@ import cokr.xit.fims.epst.service.bean.EpostRcptRegBean;
import cokr.xit.fims.levy.Levy; import cokr.xit.fims.levy.Levy;
import cokr.xit.fims.levy.service.bean.LevyBean; import cokr.xit.fims.levy.service.bean.LevyBean;
import cokr.xit.fims.nxrp.dao.NxrpMtchgMapper; import cokr.xit.fims.nxrp.dao.NxrpMtchgMapper;
import cokr.xit.fims.sndb.dao.SndngMapper; import cokr.xit.fims.sndb.SndbQuery;
import cokr.xit.fims.sndb.dao.SvbtcMapper;
import cokr.xit.fims.sndb.Sndng; import cokr.xit.fims.sndb.Sndng;
import cokr.xit.fims.sndb.SndngDtl; import cokr.xit.fims.sndb.SndngDtl;
import cokr.xit.fims.sndb.Svbtc; import cokr.xit.fims.sndb.Svbtc;
import cokr.xit.fims.sndb.SndbQuery; import cokr.xit.fims.sndb.dao.SndngMapper;
import cokr.xit.fims.sndb.dao.SvbtcMapper;
import cokr.xit.foundation.AbstractComponent;
import cokr.xit.foundation.data.DataObject;
/** Bean /** Bean
* *
@ -1188,7 +1188,7 @@ public class SndngBean extends AbstractComponent {
* <li> false</li> * <li> false</li>
* </ul> * </ul>
*/ */
public String getOcrVrfcCode(String vrfcCode, String strData, int totalLength) { public static String getOcrVrfcCode(String vrfcCode, String strData, int totalLength) {
int temp = 0; int temp = 0;
int cdTemp = 0; int cdTemp = 0;
String retCode = ""; String retCode = "";

@ -12,6 +12,7 @@ import org.springframework.stereotype.Component;
import cokr.xit.fims.cmmn.pdf.DefaultOtptArtclStng; import cokr.xit.fims.cmmn.pdf.DefaultOtptArtclStng;
import cokr.xit.fims.cmmn.pdf.PDFFormat; import cokr.xit.fims.cmmn.pdf.PDFFormat;
import cokr.xit.fims.cmmn.pdf.format.Advntce; import cokr.xit.fims.cmmn.pdf.format.Advntce;
import cokr.xit.fims.cmmn.pdf.format.Nht;
import cokr.xit.fims.sprt.OtptArtclStng; import cokr.xit.fims.sprt.OtptArtclStng;
import cokr.xit.fims.sprt.OtptForm; import cokr.xit.fims.sprt.OtptForm;
import cokr.xit.fims.sprt.OtptStngQuery; import cokr.xit.fims.sprt.OtptStngQuery;
@ -45,8 +46,13 @@ public class OtptStngBean extends AbstractComponent {
case "02" : case "02" :
pdfFormat = new Advntce(); pdfFormat = new Advntce();
break; break;
case "03" :
pdfFormat = new Nht();
break;
} }
List<DataObject> otptArtclStngList = otptStngMapper.selectOtptArtclStngList(query); List<DataObject> otptArtclStngList = otptStngMapper.selectOtptArtclStngList(query);
if(otptArtclStngList == null) { if(otptArtclStngList == null) {
otptArtclStngList = new ArrayList<DataObject>(); otptArtclStngList = new ArrayList<DataObject>();

@ -82,6 +82,7 @@
, L.LEVY_NO /* 부과 번호 */ , L.LEVY_NO /* 부과 번호 */
, L.INSPY_SN /* 분납 순번 */ , L.INSPY_SN /* 분납 순번 */
, (CONCAT(L.FYR, '-', L.LEVY_NO)) AS GOJI_NO /* 고지번호 */ , (CONCAT(L.FYR, '-', L.LEVY_NO)) AS GOJI_NO /* 고지번호 */
, L.LEVY_SE_CD /* 부과 구분 코드 */
, (SELECT GET_CODE_NM('FIM040', L.LEVY_SE_CD) FROM DUAL) AS LEVY_SE_NM /* 부과 구분 명 */ , (SELECT GET_CODE_NM('FIM040', L.LEVY_SE_CD) FROM DUAL) AS LEVY_SE_NM /* 부과 구분 명 */
, L.LEVY_PCPTAX /* 부과 본세 */ , L.LEVY_PCPTAX /* 부과 본세 */
, L.LEVY_ADAMT /* 부과 가산금 */ , L.LEVY_ADAMT /* 부과 가산금 */

@ -187,6 +187,7 @@ $(document).ready(function(){
taskSeSelectbox.attr("disabled","disabled"); taskSeSelectbox.attr("disabled","disabled");
} }
$("#"+dialogId).find("form[name='frmSearch']").find("[name='sndngSeCd']").val("02");
} }
, onClose : () => { } , onClose : () => { }
}); });

@ -185,6 +185,7 @@ $(document).ready(function(){
taskSeSelectbox.attr("disabled","disabled"); taskSeSelectbox.attr("disabled","disabled");
} }
$("#"+dialogId).find("form[name='frmSearch']").find("[name='sndngSeCd']").val("03");
} }
, onClose : () => { } , onClose : () => { }
}); });

@ -751,6 +751,8 @@ $(document).ready(function(){
var url = ""; var url = "";
if(submitParam.sndngSeCd == "02"){ if(submitParam.sndngSeCd == "02"){
url = wctx.url("/sprt/sprt01/140/makeAdvntcePdf.do"); url = wctx.url("/sprt/sprt01/140/makeAdvntcePdf.do");
} else if(submitParam.sndngSeCd == "03"){
url = wctx.url("/sprt/sprt01/150/makeNhtPdf.do");
} }
if(url == ""){ if(url == ""){
@ -844,7 +846,7 @@ $(document).ready(function(){
fnMakeRowNumberingTable(document.getElementById('tbodyUnique--${pageName}'), markerFinder, markerSetter); fnMakeRowNumberingTable(document.getElementById('tbodyUnique--${pageName}'), markerFinder, markerSetter);
fnMakeRowNumberingTable(document.getElementById('tbodyMultiple--${pageName}'), markerFinder, markerSetter); fnMakeRowNumberingTable(document.getElementById('tbodyMultiple--${pageName}'), markerFinder, markerSetter);
}); });
</script> </script>
Loading…
Cancel
Save