diff --git a/README.md b/README.md index 88f72737..42dbb2e8 100644 --- a/README.md +++ b/README.md @@ -305,7 +305,7 @@ let gridInfo = ${gridInfo}; } ``` -### 외부연계 참조 +### 외부연계 참조 : 서버로그 경로 - /data/fims/logs Rest API-dev: Rest API-prod: diff --git a/src/main/java/kr/xit/fims/biz/cmm/dto/FimsCrackdownDTO.java b/src/main/java/kr/xit/fims/biz/cmm/dto/FimsCrackdownDTO.java index c8c31d3f..df8ae213 100644 --- a/src/main/java/kr/xit/fims/biz/cmm/dto/FimsCrackdownDTO.java +++ b/src/main/java/kr/xit/fims/biz/cmm/dto/FimsCrackdownDTO.java @@ -93,8 +93,6 @@ public class FimsCrackdownDTO { private FimsCrackdownDTO.Info infoDTO; //private FimsCrackdownDTO.Info infoDTO; //private FimsCrackdownDTO.Info infoDTO; - - private String extnlVhcleUrl; } @Data diff --git a/src/main/java/kr/xit/fims/biz/cmm/web/FimsCrackDownMgtController.java b/src/main/java/kr/xit/fims/biz/cmm/web/FimsCrackDownMgtController.java index e767864e..c2856f60 100644 --- a/src/main/java/kr/xit/fims/biz/cmm/web/FimsCrackDownMgtController.java +++ b/src/main/java/kr/xit/fims/biz/cmm/web/FimsCrackDownMgtController.java @@ -41,8 +41,8 @@ public class FimsCrackDownMgtController { private String rcvBusonlyCctvPath; @Value("#{prop['file.rcv.natl-newspaper.path']}") private String rcvNatlNewspaperPath; - @Value("#{prop['app.extnl.vhcle.url']}") - private String extnlVhcleUrl; + @Value("#{prop['app.extnl.car.url']}") + private String extnlCarUrl; private final IFimsCrackdownMgtService service; private final IRtCrackdownMgtService rtService; @@ -52,7 +52,7 @@ public class FimsCrackDownMgtController { public ModelAndView cmmFimsCrackdownEditPopup(final FimsCrackdownDTO.Request dto){ ModelAndView mav = new ModelAndView(); - dto.setExtnlVhcleUrl(extnlVhcleUrl); + mav.addObject("extnlCarUrl", extnlCarUrl); mav.addObject("param", dto); if(Objects.equals(FimsConst.RegltProcessSttusCode.CRACKDOWN_INIT.getCode(), dto.getRegltProcessSttusCode())) { diff --git a/src/main/java/kr/xit/fims/biz/rt/web/RtCrackdownMgtController.java b/src/main/java/kr/xit/fims/biz/rt/web/RtCrackdownMgtController.java index c26e8796..6ac5015a 100644 --- a/src/main/java/kr/xit/fims/biz/rt/web/RtCrackdownMgtController.java +++ b/src/main/java/kr/xit/fims/biz/rt/web/RtCrackdownMgtController.java @@ -2,6 +2,7 @@ package kr.xit.fims.biz.rt.web; import java.util.Map; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -43,12 +44,19 @@ public class RtCrackdownMgtController { private final ICmmFileService fileService; + @Value("#{prop['app.extnl.car.url']}") + private String extnlCarUrl; + + @RequestMapping(value = "/rtRegltMgtForm") public void rtRegltMgtForm(){ } @RequestMapping(value = "/rtCrackdownMgtMainForm") - public void rtCrackdownMgtMainForm(final RtDTO.Request dto){ + public ModelAndView rtCrackdownMgtMainForm(final RtDTO.Request dto){ + ModelAndView mav = new ModelAndView(); + mav.addObject("extnlCarUrl", extnlCarUrl); + return mav; } /** diff --git a/src/main/java/kr/xit/framework/support/exception/BizRuntimeException.java b/src/main/java/kr/xit/framework/support/exception/BizRuntimeException.java index 88c6966b..f4cd9d8e 100644 --- a/src/main/java/kr/xit/framework/support/exception/BizRuntimeException.java +++ b/src/main/java/kr/xit/framework/support/exception/BizRuntimeException.java @@ -42,8 +42,8 @@ public class BizRuntimeException extends RuntimeException { return ex; } - public static BizRuntimeException create(String errorCode) { - return create(errorCode, new Object[]{}); + public static BizRuntimeException create(String message) { + return new BizRuntimeException(message); } public static BizRuntimeException create(String errorCode, Object[] arguments) { diff --git a/src/main/resources/props/dev/globals.properties b/src/main/resources/props/dev/globals.properties index f0a3b3bb..39cd32ec 100644 --- a/src/main/resources/props/dev/globals.properties +++ b/src/main/resources/props/dev/globals.properties @@ -135,3 +135,6 @@ file.rcv.natl-newspaper.path=/natl-newspaper file.rcv.busonly-cctv.path=/busonly file.res.root=/data/fims/extnl/res + +# \uC678\uBD80\uC5F0\uACC4 URL +app.extnl.car.url=http://211.119.124.9:18090 diff --git a/src/main/resources/props/local/globals.properties b/src/main/resources/props/local/globals.properties index a08f59ea..cfe16d83 100644 --- a/src/main/resources/props/local/globals.properties +++ b/src/main/resources/props/local/globals.properties @@ -131,8 +131,8 @@ exception.log.trace=true file.upload.allow.max-size: 2048 file.upload.allow.ext= -file.upload.root=/Users/minuk/data/fims/upload -#file.upload.root=D:/data/fims/upload +#file.upload.root=/Users/minuk/data/fims/upload +file.upload.root=D:/data/fims/upload file.upload.temp.path=/temp file.upload.natl-newspaper.path=/natl-newspaper file.upload.busonly-cctv.path=/busonly @@ -140,13 +140,14 @@ file.upload.cctv-fix.path=/cctv-fix file.upload.cctv-drv.path=/cctv-drv file.upload.cmm-board.path=/cmm-board -file.rcv.root=/Users/minuk/data/fims/extnl/rcv -file.rcv.backup.root=/Users/minuk/data/fims/extnl/backup -file.res.root=/Users/minuk/data/fims/extnl/res -#file.rcv.root=D:/data/fims/extnl/rcv -#file.rcv.backup.root=D:/data/fims/extnl/backup -#file.res.root=D:/data/fims/extnl/res +#file.rcv.root=/Users/minuk/data/fims/extnl/rcv +#file.rcv.backup.root=/Users/minuk/data/fims/extnl/backup +#file.res.root=/Users/minuk/data/fims/extnl/res +file.rcv.root=D:/data/fims/extnl/rcv +file.rcv.backup.root=D:/data/fims/extnl/backup +file.res.root=D:/data/fims/extnl/res file.rcv.natl-newspaper.path=/natl-newspaper file.rcv.busonly-cctv.path=/busonly -app.extnl.vhcle.url=http://localhost:18090 +# \uC678\uBD80\uC5F0\uACC4 URL +app.extnl.car.url=http://211.119.124.9:18090 diff --git a/src/main/webapp/WEB-INF/jsp/fims/biz/cmm/cmmFimsCrackdownEditPopup.jsp b/src/main/webapp/WEB-INF/jsp/fims/biz/cmm/cmmFimsCrackdownEditPopup.jsp index 14b6e9ad..43d16581 100644 --- a/src/main/webapp/WEB-INF/jsp/fims/biz/cmm/cmmFimsCrackdownEditPopup.jsp +++ b/src/main/webapp/WEB-INF/jsp/fims/biz/cmm/cmmFimsCrackdownEditPopup.jsp @@ -292,7 +292,7 @@ Date Author Description let regltSeCode = ''; let schParam = null; - let extnlVhcleUrl = ''; + let extnlCarUrl = '${extnlCarUrl}'; /* ******************************* * Biz function @@ -415,7 +415,7 @@ Date Author Description /////////////////////////////////////////////////// - // FIXME :: 차적조회 연계 완료후 적용 + // FIXME :: 차적조회 연계 /////////////////////////////////////////////////// /* @@ -429,34 +429,18 @@ Date Author Description levy_stdde: '20220122' } - let url = extnlVhcleUrl + '/api/v1/car/findCar'; - cmmAjax({ - showSuccessMsg: false - , contentType: "application/json" - , url + let url = extnlCarUrl + '/api/v1/car/findCar'; + cmmApiCall({ + url , data: JSON.stringify(param) , success: (res) => { alert('차적조회 결과 : \n' + JSON.stringify(res)); - if(res.success){ - const data = res.data; - $('input[name=vhcleNm]').val(data.cnm); - $('input[name=vhcleColor]').val(data.color_nm); - //$('input[name=vhcleNm]').val('차량명칭'); - //$('input[name=vhcleColor]').val('차량색상'); - - }else{ - alert(res.message?.message) - } + /////////////////////////////////////////////////// + // FIXME :: 차적조회 연계 완료후 binding 필요 + /////////////////////////////////////////////////// + $('input[name=vhcleNm]').val(res.cnm); + $('input[name=vhcleColor]').val(res.color_nm); - - - - /////////////////////////////////////////////////// - // FIXME :: 차적조회 연계 완료후 적용 - /////////////////////////////////////////////////// - // alert('차적조회 연계 call') - // $('input[name=vhcleNm]').val('차량명칭'); - // $('input[name=vhcleColor]').val('차량색상'); cmmAjax({ showSuccessMsg: false , url: fimsApiUrl.FIND_CRACKDOWN_VHCLE_NO_CNT @@ -469,9 +453,6 @@ Date Author Description } }) - /////////////////////////////////////////////////// - // FIXME :: 차적조회 연계 완료후 적용 - /////////////////////////////////////////////////// } ,callbackEnlightErpp: (data) => { @@ -735,8 +716,6 @@ Date Author Description **************************************************************************/ $(document).ready(function(){ - extnlVhcleUrl = 'http://211.119.124.9:18090' - //extnlVhcleUrl = 'http://localhost:18090' fnPopupBiz.search({ regltId: '${param.regltId}' ,regltSeCode: '${param.regltSeCode}' diff --git a/src/main/webapp/resources/framework/js/cmm/XitCmmnUtil.js b/src/main/webapp/resources/framework/js/cmm/XitCmmnUtil.js index 58a09444..0aa787b4 100644 --- a/src/main/webapp/resources/framework/js/cmm/XitCmmnUtil.js +++ b/src/main/webapp/resources/framework/js/cmm/XitCmmnUtil.js @@ -339,6 +339,52 @@ const cmmBizAjax = (workType, param, isPopup = true) => { } }; +const cmmApiCall = (param) => { + $.ajax({ + url: param.url + ,type: nvl(param.type, "post") + ,data: param.data + ,async: nvl(param.async, true) + ,dataType: nvl(param.dataType, "json") + ,processData: nvl(param.processData, true) + ,contentType: nvl(param.contentType, 'application/json;charset=UTF-8') + ,cache : false + ,beforeSend: (jqXhr, settings) => { + jqXhr.setRequestHeader('AJAX',true); + } + ,success: function (res) { + if (param.showSuccessMsg === undefined || param.showSuccessMsg === true) { + if(res.message) alert(res.message); + } + if ($.type(param.success) === 'function') { + param.success(res.data) + } + } + ,error: function(jqXHR, error, errThrown ){ + console.error('=============================================================='); + console.error('>>>>>>>>>ajax call error<<<<<<<<<<<'); + //console.error('BizIncludeBase::ajaxError >>>>> ', event, status, error) + console.error(`status=${jqXHR.status}, responseText=${jqXHR.responseText}, errorThrow=${errThrown}`); + console.error('=============================================================='); + + const resText = jqXHR.responseText; + if(typeof resText === 'string'){ + alert(JSON.parse(resText).message); + return false; + } + + if(typeof resText === 'object'){ + alert(resText.message); + return false; + } + + return document.write(jqXHR.responseText); + } + }); +}; + + + const cmmDownloadAjax = (param) => { $.ajax({ url: param.url