차세대세외수입 주정차,전용차로 과태료 대장 등록 메소드 위치 이동

main
이범준 7 months ago
parent a2cf829df9
commit c842639b19

@ -97,10 +97,5 @@ public interface CrdnService {
*/ */
int countCrdn(CrdnQuery crdnQuery); int countCrdn(CrdnQuery crdnQuery);
/** .
* @param crdnIds ID
* @return
*/
String sendCrdn(String[] crdnIds);
} }

@ -1,9 +1,6 @@
package cokr.xit.fims.crdn.service.bean; package cokr.xit.fims.crdn.service.bean;
import java.io.File;
import java.io.FilenameFilter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -12,13 +9,10 @@ import javax.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.code.service.bean.CodeBean; import cokr.xit.base.code.service.bean.CodeBean;
import cokr.xit.base.file.FileInfo; import cokr.xit.base.file.FileInfo;
import cokr.xit.base.file.ZIP;
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.fims.cmmn.CmmnQuery;
import cokr.xit.fims.cmmn.CmmnUtil; import cokr.xit.fims.cmmn.CmmnUtil;
import cokr.xit.fims.cmmn.service.bean.CrdnPayerHstryBean; import cokr.xit.fims.cmmn.service.bean.CrdnPayerHstryBean;
import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean; import cokr.xit.fims.cmmn.service.bean.CrdnSttsHstryBean;
@ -36,14 +30,10 @@ import cokr.xit.fims.cvlc.dao.CrdnCvlcptMapper;
import cokr.xit.fims.cvlc.service.bean.CrdnCvlcptMainBean; import cokr.xit.fims.cvlc.service.bean.CrdnCvlcptMainBean;
import cokr.xit.fims.excl.service.bean.LevyExclBean; import cokr.xit.fims.excl.service.bean.LevyExclBean;
import cokr.xit.fims.mngt.dao.TaskMapper; import cokr.xit.fims.mngt.dao.TaskMapper;
import cokr.xit.fims.nxrp.support.AttachedTxtMaker;
import cokr.xit.fims.nxrp.support.LinkFileMaker;
import cokr.xit.fims.nxrp.support.OnlyImageMaker;
import cokr.xit.fims.sprt.dao.TotalInfoMapper; import cokr.xit.fims.sprt.dao.TotalInfoMapper;
import cokr.xit.fims.sprt.service.bean.MediaBean; import cokr.xit.fims.sprt.service.bean.MediaBean;
import cokr.xit.foundation.component.AbstractServiceBean; import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
import cokr.xit.interfaces.filejob.JobConf;
@Service("crdnService") @Service("crdnService")
public class CrdnServiceBean extends AbstractServiceBean implements CrdnService { public class CrdnServiceBean extends AbstractServiceBean implements CrdnService {
@ -380,189 +370,5 @@ public class CrdnServiceBean extends AbstractServiceBean implements CrdnService
return crdnListMapper.countCrdn(crdnQuery); return crdnListMapper.countCrdn(crdnQuery);
} }
@Override
public String sendCrdn(String[] crdnIds) {
String rtnMsg = "[F]";
List<CommonCode> fimsVltnCodes = codeBean.getCodes("FIM004");
List<CommonCode> nxrpVltnCodes = codeBean.getCodes("NTR055");
DataObject deptStng = stngBean.getStng("dept");
String gujesi = deptStng.string("NXRP_RGN_SE_CD");
for(String crdnID : crdnIds) {
DataObject crdnInfo = crdnInfoMapper.selectCrdnInfo(crdnID);
if(crdnInfo.string("NXRP_CRDN_LINK_YN").equals("Y")) {
rtnMsg += "이미 세외수입 단속 연계 처리된 자료입니다.";
throw new RuntimeException(rtnMsg);
}
String firstTaskSeCd = "";
String taskSeCd = crdnInfo.string("TASK_SE_CD");
if(firstTaskSeCd.equals("")) {
firstTaskSeCd = taskSeCd;
}
if(!taskSeCd.equals("PVS") && !taskSeCd.equals("BPV")) {
rtnMsg += "주정차위반 또는 전용차로위반 자료만 처리 가능합니다.";
throw new RuntimeException(rtnMsg);
}
if(!firstTaskSeCd.equals(taskSeCd)) {
rtnMsg += "과태료 구분이 동일한 자료만 처리가능합니다.";
throw new RuntimeException(rtnMsg);
}
if(crdnInfo.number("ATCH_FILE_CNT").intValue() < 1) {
rtnMsg += "단속사진이 없습니다.";
throw new RuntimeException(rtnMsg);
}
CmmnQuery cmmnQuery = new CmmnQuery();
cmmnQuery.setUseYN("Y");
cmmnQuery.setSggCd(crdnInfo.string("SGG_CD"));
cmmnQuery.setTaskSeCd(taskSeCd);
DataObject nxrpLinkInfo = taskMapper.selectTaskInfo(cmmnQuery);
if(nxrpLinkInfo == null) {
rtnMsg += "과태료 설정 정보가 없습니다.";
throw new RuntimeException(rtnMsg);
}
String nxrpLinkSeCd = nxrpLinkInfo.string("NXRP_LINK_SE_CD");
String nxrpLinkSeDtlSn = nxrpLinkInfo.string("NXRP_LINK_SE_DTL_SN");
if(!nxrpLinkSeCd.equals("B01") && !nxrpLinkSeCd.equals("C01")) {
rtnMsg += "세외수입 연계 구분 코드 설정 오류입니다.";
throw new RuntimeException(rtnMsg);
}
if(!nxrpLinkSeDtlSn.equals("01") && !nxrpLinkSeDtlSn.equals("02")) {
rtnMsg += "세외수입 연계 구분 상세 순번 설정 오류입니다.";
throw new RuntimeException(rtnMsg);
}
String instDigit7 = currentUser().getInstitute();
//법정동코드 구하기
if(!crdnInfo.string("CRDN_STDG_NM").equals("")) {
Map<String, Object> stdgQuery = new HashMap<>();
stdgQuery.put("sggCd", crdnInfo.string("SGG_CD"));
stdgQuery.put("emdNm", crdnInfo.string("CRDN_STDG_NM"));
List<String> stdgCds = crdnStngMapper.selectStdgCdListByStdgNm(stdgQuery);
if(stdgCds != null && stdgCds.size() == 1 && stdgCds.get(0) != null && !stdgCds.get(0).equals("")) {
crdnInfo.put("STDG_CD", stdgCds.get(0));
}
}
LinkFileMaker linkFileMaker = null;
if(nxrpLinkSeDtlSn.equals("01")) {
linkFileMaker = new AttachedTxtMaker(nxrpLinkSeCd, instDigit7);
if(nxrpLinkSeCd.equals("B01")) {
((AttachedTxtMaker)linkFileMaker).appendVltnCodeInfo(fimsVltnCodes, nxrpVltnCodes);
}
} else {
linkFileMaker = new OnlyImageMaker(nxrpLinkSeCd, instDigit7);
}
if(!gujesi.equals("")) {
linkFileMaker.setGujesiStng(gujesi);
}
String workPath = "files/temp/sendCrdn/"+crdnInfo.string("SGG_CD")+"/"+crdnInfo.string("CRDN_ID");
File workFolder = new File(workPath);
if(workFolder.exists()) {
boolean del = false;
File[] lf = workFolder.listFiles();
if(lf != null && lf.length > 0) {
for(File f : lf) {
del = f.delete();
if(!del) {
throw new RuntimeException("[F]파일삭제오류");
}
}
}
del = workFolder.delete();
if(!del) {
throw new RuntimeException("[F]파일삭제오류");
}
}
workFolder.mkdirs();
try {
String[] items = null;
boolean includeTxt = nxrpLinkSeDtlSn.equals("01");
if(taskSeCd.equals("PVS")) {
items = linkFileMaker.extractForPVS(crdnInfo,includeTxt).get();
} else if(taskSeCd.equals("BPV")) {
items = linkFileMaker.extractForBPV(crdnInfo,includeTxt).get();
}
if(nxrpLinkSeDtlSn.equals("01")) {
((AttachedTxtMaker)linkFileMaker).writeTextFileContents(workPath, items);
}
FileQuery fileQuery = new FileQuery();
fileQuery.setInfoType(Crdn.INF_TYPE);
fileQuery.setInfoKeys(crdnID);
fileQuery.setOrderBy("SRT_ORD");
List<DataObject> crdnFileList = fileBean.getFileList(fileQuery);
for(int j=0; (j<crdnFileList.size()) && (j < linkFileMaker.getMaxImageFileCnt()); j++) {
linkFileMaker.copyFile(workPath, crdnFileList.get(j).string("FILE_PATH"), j, items);
}
String zipFilePath = workPath + "/" + linkFileMaker.getZipFileName();
File[] fileList = workFolder.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return !(name.toUpperCase().endsWith(".ZIP"));
}
});
String[] fileNameList = new String[fileList.length];
for(int i=0; i<fileList.length; i++) {
fileNameList[i] = fileList[i].getPath();
}
ZIP zip = new ZIP();
zip.compress(zipFilePath, fileNameList);
for(File file : fileList) {
if(!file.delete()) {
throw new RuntimeException("[F]파일 삭제 중 오류가 발생하였습니다.");
}
}
String ESB_Folder_Path = JobConf.get().getDir("send")+"/"+JobConf.get().getDirCode("lntris");
if(!new File(ESB_Folder_Path).exists()) {
new File(ESB_Folder_Path).mkdirs();
}
File src = new File(zipFilePath);
File dst = new File(ESB_Folder_Path+"/"+linkFileMaker.getZipFileName());
src.renameTo(dst);
Crdn crdn = new Crdn();
crdn.setCrdnId(crdnID);
crdn.setModifiedBy(currentUser().getId());
int effected = crdnUpdtMapper.updateNxrpCrdnLinkYn(crdn);
if(effected != 1) {
rtnMsg += "세외수입 연계 여부 변경 중 오류가 발생하였습니다.";
throw new RuntimeException(rtnMsg);
}
} catch (Exception e) {
throw new RuntimeException("[F]"+e);
}
}
rtnMsg = "[S]처리되었습니다.";
return rtnMsg;
}
} }

@ -51,7 +51,6 @@ public class Crdn06Controller extends ApplicationController {
, removeCrackdown = "/010/remove.do" , removeCrackdown = "/010/remove.do"
, removeCrackdownPayer = "/010/removeCrdnPayer.do" , removeCrackdownPayer = "/010/removeCrdnPayer.do"
, countCrdn = "/010/nocs.do" , countCrdn = "/010/nocs.do"
, sendCrdn = "/010/sendCrdn.do"
, getCrackdownInfo = "/020/info.do" , getCrackdownInfo = "/020/info.do"
, updateCrackdown = "/020/update.do" , updateCrackdown = "/020/update.do"
, getCrackdownStatusInfo = "/030/info.do" , getCrackdownStatusInfo = "/030/info.do"
@ -251,28 +250,6 @@ public class Crdn06Controller extends ApplicationController {
return mav; return mav;
} }
/** .
* @param crdnIds ID
* @return jsonView
* <pre><code> {
* "affected":
* "saved": true, false
* }</code></pre>
*/
@Task
@RequestMapping(name="단속자료압축파일 세외수입 전송", value=METHOD_URL.sendCrdn)
public ModelAndView sendCrdn(String... crdnIds) {
ModelAndView mav = new ModelAndView("jsonView");
boolean saved = false;
String rtnMsg = crdnService.sendCrdn(crdnIds);
if(rtnMsg.contains("[S]")) {
saved = true;
}
mav.addObject("saved", saved);
mav.addObject("rtnMsg", rtnMsg);
return mav;
}
/** ID (info) . /** ID (info) .
* @param query * @param query
* @return fims/crdn/crdn06020-info jsonView * @return fims/crdn/crdn06020-info jsonView

@ -2,9 +2,8 @@ package cokr.xit.fims.nxrp.service;
import java.util.List; import java.util.List;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.fims.nxrp.NisIndivQuery; import cokr.xit.fims.nxrp.NisIndivQuery;
import cokr.xit.foundation.data.DataObject;
/** . /** .
* *
@ -81,4 +80,21 @@ public interface NisIndivService {
*/ */
String updateNisIndivA03(NisIndivQuery req); String updateNisIndivA03(NisIndivQuery req);
/** .
* @param req
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
String createNisIndivB01(NisIndivQuery req);
/** .
* @param req
* @return
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
String createNisIndivC01(NisIndivQuery req);
} }

@ -2,6 +2,8 @@ package cokr.xit.fims.nxrp.service.bean;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.BufferedWriter; import java.io.BufferedWriter;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.OutputStreamWriter; import java.io.OutputStreamWriter;
@ -11,7 +13,9 @@ import java.security.cert.CertificateException;
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.net.ssl.HostnameVerifier; import javax.net.ssl.HostnameVerifier;
@ -23,27 +27,39 @@ import javax.net.ssl.X509TrustManager;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import cokr.xit.base.code.CommonCode;
import cokr.xit.base.code.service.bean.CodeBean;
import cokr.xit.base.file.ZIP;
import cokr.xit.base.file.service.FileQuery;
import cokr.xit.base.file.service.bean.FileBean;
import cokr.xit.base.user.service.bean.UserBean; import cokr.xit.base.user.service.bean.UserBean;
import cokr.xit.fims.cmmn.CmmnQuery; import cokr.xit.fims.cmmn.CmmnQuery;
import cokr.xit.fims.cmmn.service.bean.StngBean;
import cokr.xit.fims.crdn.Crdn;
import cokr.xit.fims.crdn.dao.CrdnInfoMapper;
import cokr.xit.fims.crdn.dao.CrdnStngMapper;
import cokr.xit.fims.crdn.dao.CrdnUpdtMapper; import cokr.xit.fims.crdn.dao.CrdnUpdtMapper;
import cokr.xit.fims.mngt.dao.TaskMapper;
import cokr.xit.fims.mngt.service.bean.FactionBean; import cokr.xit.fims.mngt.service.bean.FactionBean;
import cokr.xit.fims.nxrp.A01; import cokr.xit.fims.nxrp.A01;
import cokr.xit.fims.nxrp.A02; import cokr.xit.fims.nxrp.A02;
import cokr.xit.fims.nxrp.A03;
import cokr.xit.fims.nxrp.A03Rqst; import cokr.xit.fims.nxrp.A03Rqst;
import cokr.xit.fims.nxrp.NisIndivQuery; import cokr.xit.fims.nxrp.NisIndivQuery;
import cokr.xit.fims.nxrp.dao.NisA01Mapper; import cokr.xit.fims.nxrp.dao.NisA01Mapper;
import cokr.xit.fims.nxrp.dao.NisA02Mapper; import cokr.xit.fims.nxrp.dao.NisA02Mapper;
import cokr.xit.fims.nxrp.dao.NisA03Mapper; import cokr.xit.fims.nxrp.dao.NisA03Mapper;
import cokr.xit.fims.nxrp.support.AttachedTxtMaker;
import cokr.xit.fims.nxrp.support.LinkFileMaker;
import cokr.xit.fims.nxrp.support.OnlyImageMaker;
import cokr.xit.fims.sndb.SndbQuery; import cokr.xit.fims.sndb.SndbQuery;
import cokr.xit.fims.sndb.SndngDtl; import cokr.xit.fims.sndb.SndngDtl;
import cokr.xit.fims.sndb.dao.SndngDtlMapper; import cokr.xit.fims.sndb.dao.SndngDtlMapper;
import cokr.xit.foundation.AbstractComponent; import cokr.xit.foundation.AbstractComponent;
import cokr.xit.foundation.data.DataObject; import cokr.xit.foundation.data.DataObject;
import cokr.xit.interfaces.filejob.JobConf;
/** Bean /** Bean
* *
@ -78,10 +94,30 @@ public class NisIndivBean extends AbstractComponent {
@Resource(name = "crdnUpdtMapper") @Resource(name = "crdnUpdtMapper")
private CrdnUpdtMapper crdnUpdtMapper; private CrdnUpdtMapper crdnUpdtMapper;
@Resource(name="crdnInfoMapper")
private CrdnInfoMapper crdnInfoMapper;
@Resource(name="crdnStngMapper")
private CrdnStngMapper crdnStngMapper;
@Resource(name="taskMapper")
private TaskMapper taskMapper;
@Resource(name="fileBean")
private FileBean fileBean;
/** 사용자 정보 DAO */ /** 사용자 정보 DAO */
@Resource(name="userBean") @Resource(name="userBean")
protected UserBean userBean; protected UserBean userBean;
/** 코드 정보 DAO */
@Resource(name="codeBean")
protected CodeBean codeBean;
/** 설정 정보 DAO */
@Resource(name="stngBean")
protected StngBean stngBean;
/** 부서 정보 DAO */ /** 부서 정보 DAO */
@Resource(name = "factionBean") @Resource(name = "factionBean")
private FactionBean factionBean; private FactionBean factionBean;
@ -818,4 +854,192 @@ public class NisIndivBean extends AbstractComponent {
} }
// SSL 무시 ///////////////////////////////////////////////////////////////// // SSL 무시 /////////////////////////////////////////////////////////////////
public String createNisIndivB01C01(NisIndivQuery req) {
String[] crdnIds = req.getCrdnIds();
String rtnMsg = "[F]";
List<CommonCode> fimsVltnCodes = codeBean.getCodes("FIM004");
List<CommonCode> nxrpVltnCodes = codeBean.getCodes("NTR055");
DataObject deptStng = stngBean.getStng("dept");
String gujesi = deptStng.string("NXRP_RGN_SE_CD");
for(String crdnID : crdnIds) {
DataObject crdnInfo = crdnInfoMapper.selectCrdnInfo(crdnID);
if(crdnInfo.string("NXRP_CRDN_LINK_YN").equals("Y")) {
rtnMsg += "이미 세외수입 단속 연계 처리된 자료입니다.";
throw new RuntimeException(rtnMsg);
}
String firstTaskSeCd = "";
String taskSeCd = crdnInfo.string("TASK_SE_CD");
if(firstTaskSeCd.equals("")) {
firstTaskSeCd = taskSeCd;
}
if(!taskSeCd.equals("PVS") && !taskSeCd.equals("BPV")) {
rtnMsg += "주정차위반 또는 전용차로위반 자료만 처리 가능합니다.";
throw new RuntimeException(rtnMsg);
}
if(!firstTaskSeCd.equals(taskSeCd)) {
rtnMsg += "과태료 구분이 동일한 자료만 처리가능합니다.";
throw new RuntimeException(rtnMsg);
}
if(crdnInfo.number("ATCH_FILE_CNT").intValue() < 1) {
rtnMsg += "단속사진이 없습니다.";
throw new RuntimeException(rtnMsg);
}
CmmnQuery cmmnQuery = new CmmnQuery();
cmmnQuery.setUseYN("Y");
cmmnQuery.setSggCd(crdnInfo.string("SGG_CD"));
cmmnQuery.setTaskSeCd(taskSeCd);
DataObject nxrpLinkInfo = taskMapper.selectTaskInfo(cmmnQuery);
if(nxrpLinkInfo == null) {
rtnMsg += "과태료 설정 정보가 없습니다.";
throw new RuntimeException(rtnMsg);
}
String nxrpLinkSeCd = nxrpLinkInfo.string("NXRP_LINK_SE_CD");
String nxrpLinkSeDtlSn = nxrpLinkInfo.string("NXRP_LINK_SE_DTL_SN");
if(!nxrpLinkSeCd.equals("B01") && !nxrpLinkSeCd.equals("C01")) {
rtnMsg += "세외수입 연계 구분 코드 설정 오류입니다.";
throw new RuntimeException(rtnMsg);
}
if(!nxrpLinkSeDtlSn.equals("01") && !nxrpLinkSeDtlSn.equals("02")) {
rtnMsg += "세외수입 연계 구분 상세 순번 설정 오류입니다.";
throw new RuntimeException(rtnMsg);
}
String instDigit7 = currentUser().getInstitute();
//법정동코드 구하기
if(!crdnInfo.string("CRDN_STDG_NM").equals("")) {
Map<String, Object> stdgQuery = new HashMap<>();
stdgQuery.put("sggCd", crdnInfo.string("SGG_CD"));
stdgQuery.put("emdNm", crdnInfo.string("CRDN_STDG_NM"));
List<String> stdgCds = crdnStngMapper.selectStdgCdListByStdgNm(stdgQuery);
if(stdgCds != null && stdgCds.size() == 1 && stdgCds.get(0) != null && !stdgCds.get(0).equals("")) {
crdnInfo.put("STDG_CD", stdgCds.get(0));
}
}
LinkFileMaker linkFileMaker = null;
if(nxrpLinkSeDtlSn.equals("01")) {
linkFileMaker = new AttachedTxtMaker(nxrpLinkSeCd, instDigit7);
if(nxrpLinkSeCd.equals("B01")) {
((AttachedTxtMaker)linkFileMaker).appendVltnCodeInfo(fimsVltnCodes, nxrpVltnCodes);
}
} else {
linkFileMaker = new OnlyImageMaker(nxrpLinkSeCd, instDigit7);
}
if(!gujesi.equals("")) {
linkFileMaker.setGujesiStng(gujesi);
}
String workPath = "files/temp/sendCrdn/"+crdnInfo.string("SGG_CD")+"/"+crdnInfo.string("CRDN_ID");
File workFolder = new File(workPath);
if(workFolder.exists()) {
boolean del = false;
File[] lf = workFolder.listFiles();
if(lf != null && lf.length > 0) {
for(File f : lf) {
del = f.delete();
if(!del) {
throw new RuntimeException("[F]파일삭제오류");
}
}
}
del = workFolder.delete();
if(!del) {
throw new RuntimeException("[F]파일삭제오류");
}
}
workFolder.mkdirs();
try {
String[] items = null;
boolean includeTxt = nxrpLinkSeDtlSn.equals("01");
if(taskSeCd.equals("PVS")) {
items = linkFileMaker.extractForPVS(crdnInfo,includeTxt).get();
} else if(taskSeCd.equals("BPV")) {
items = linkFileMaker.extractForBPV(crdnInfo,includeTxt).get();
}
if(nxrpLinkSeDtlSn.equals("01")) {
((AttachedTxtMaker)linkFileMaker).writeTextFileContents(workPath, items);
}
FileQuery fileQuery = new FileQuery();
fileQuery.setInfoType(Crdn.INF_TYPE);
fileQuery.setInfoKeys(crdnID);
fileQuery.setOrderBy("SRT_ORD");
List<DataObject> crdnFileList = fileBean.getFileList(fileQuery);
for(int j=0; (j<crdnFileList.size()) && (j < linkFileMaker.getMaxImageFileCnt()); j++) {
linkFileMaker.copyFile(workPath, crdnFileList.get(j).string("FILE_PATH"), j, items);
}
String zipFilePath = workPath + "/" + linkFileMaker.getZipFileName();
File[] fileList = workFolder.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
return !(name.toUpperCase().endsWith(".ZIP"));
}
});
String[] fileNameList = new String[fileList.length];
for(int i=0; i<fileList.length; i++) {
fileNameList[i] = fileList[i].getPath();
}
ZIP zip = new ZIP();
zip.compress(zipFilePath, fileNameList);
for(File file : fileList) {
if(!file.delete()) {
throw new RuntimeException("[F]파일 삭제 중 오류가 발생하였습니다.");
}
}
String ESB_Folder_Path = JobConf.get().getDir("send")+"/"+JobConf.get().getDirCode("lntris");
if(!new File(ESB_Folder_Path).exists()) {
new File(ESB_Folder_Path).mkdirs();
}
File src = new File(zipFilePath);
File dst = new File(ESB_Folder_Path+"/"+linkFileMaker.getZipFileName());
src.renameTo(dst);
Crdn crdn = new Crdn();
crdn.setCrdnId(crdnID);
crdn.setModifiedBy(currentUser().getId());
int effected = crdnUpdtMapper.updateNxrpCrdnLinkYn(crdn);
if(effected != 1) {
rtnMsg += "세외수입 연계 여부 변경 중 오류가 발생하였습니다.";
throw new RuntimeException(rtnMsg);
}
} catch (Exception e) {
throw new RuntimeException("[F]"+e);
}
}
rtnMsg = "[S]처리되었습니다.";
return rtnMsg;
}
} }

@ -6,11 +6,10 @@ import javax.annotation.Resource;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.DataObject;
import cokr.xit.fims.nxrp.NisIndivQuery; import cokr.xit.fims.nxrp.NisIndivQuery;
import cokr.xit.fims.nxrp.service.NisIndivService; import cokr.xit.fims.nxrp.service.NisIndivService;
import cokr.xit.foundation.component.AbstractServiceBean;
import cokr.xit.foundation.data.DataObject;
/** . /** .
* *
@ -74,4 +73,14 @@ public class NisIndivServiceBean extends AbstractServiceBean implements NisIndiv
return nisIndivBean.updateNisIndivA03(req); return nisIndivBean.updateNisIndivA03(req);
} }
@Override
public String createNisIndivB01(NisIndivQuery req) {
return nisIndivBean.createNisIndivB01C01(req);
}
@Override
public String createNisIndivC01(NisIndivQuery req) {
return nisIndivBean.createNisIndivB01C01(req);
}
} }

@ -32,6 +32,8 @@ public class Nxrp01Controller extends AbstractController {
createIndividualA01 = "/010/createIndivA01.do" // 과태료 대장 단속 정보 등록(실시간) createIndividualA01 = "/010/createIndivA01.do" // 과태료 대장 단속 정보 등록(실시간)
, updateIndividualA02 = "/010/updateIndivA02.do" // 과태료 대장 등록 자료 일괄 조회(전일자 변동자료) , updateIndividualA02 = "/010/updateIndivA02.do" // 과태료 대장 등록 자료 일괄 조회(전일자 변동자료)
, updateIndividualA03 = "/010/updateIndivA03.do" // 과태료 대장 등록 자료 상세 조회(실시간) , updateIndividualA03 = "/010/updateIndivA03.do" // 과태료 대장 등록 자료 상세 조회(실시간)
, createIndividualB01 = "/010/createIndivB01.do" // 주정차과태료 대장 단속 정보 등록
, createIndividualC01 = "/010/createIndivC01.do" // 전용차로과태료 대장 단속 정보 등록
; ;
} }
@ -111,4 +113,51 @@ public class Nxrp01Controller extends AbstractController {
.addObject("rtnMsg", rtnMsg); .addObject("rtnMsg", rtnMsg);
} }
/** .
* @param nisIndivB01
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@Task("PVS")
@RequestMapping(name="차세대 세외수입 주정차 과태료 대장 단속 정보 등록", value=METHOD_URL.createIndividualB01)
public ModelAndView createIndividualB01(NisIndivQuery req) {
boolean saved = false;
String rtnMsg = nisIndivService.createNisIndivB01(req);
if (rtnMsg.contains("[S]")) {
saved = true;
} else {
saved = false;
}
return new ModelAndView("jsonView")
.addObject("saved", saved)
.addObject("rtnMsg", rtnMsg);
}
/** .
* @param nisIndivC01
* @return jsonView
* <pre><code> {
* "saved": true, false
* }</code></pre>
*/
@Task("BPV")
@RequestMapping(name="차세대 세외수입 전용차로 과태료 대장 단속 정보 등록", value=METHOD_URL.createIndividualC01)
public ModelAndView createIndividualC01(NisIndivQuery req) {
boolean saved = false;
String rtnMsg = nisIndivService.createNisIndivC01(req);
if (rtnMsg.contains("[S]")) {
saved = true;
} else {
saved = false;
}
return new ModelAndView("jsonView")
.addObject("saved", saved)
.addObject("rtnMsg", rtnMsg);
}
} }

@ -514,9 +514,17 @@ $(document).ready(function(){
var taskSeCd = datas[0].TASK_SE_CD; var taskSeCd = datas[0].TASK_SE_CD;
var keys = $P.crdnControl.dataset.getKeys("selected"); var keys = $P.crdnControl.dataset.getKeys("selected");
var url = "";
if(taskSeCd == "PVS"){
url = "/"+taskSeCd+"/nxrp/nxrp01/010/createIndivB01.do";
} else if(taskSeCd == "BPV"){
url = "/"+taskSeCd+"/nxrp/nxrp01/010/createIndivC01.do";
} else {
return;
}
ajax.post({ ajax.post({
url : wctx.url("/"+taskSeCd+"/crdn/crdn06/010/sendCrdn.do"), url : wctx.url(url),
data : { "crdnIds" : keys.join(",") }, data : { "crdnIds" : keys.join(",") },
success : (resp) => { success : (resp) => {
if(resp.saved){ if(resp.saved){

Loading…
Cancel
Save