feat: 초기자료 편집 > 차량번호 조회시 차적조회 dummy 연결

main
Jonguk. Lim 2 years ago
parent bba5d5d79a
commit 9a4535db71

@ -93,6 +93,8 @@ public class FimsCrackdownDTO {
private FimsCrackdownDTO.Info infoDTO; private FimsCrackdownDTO.Info infoDTO;
//private FimsCrackdownDTO.Info infoDTO; //private FimsCrackdownDTO.Info infoDTO;
//private FimsCrackdownDTO.Info infoDTO; //private FimsCrackdownDTO.Info infoDTO;
private String extnlVhcleUrl;
} }
@Data @Data

@ -0,0 +1,251 @@
package kr.xit.fims.biz.cmm.dto;
import java.io.Serializable;
import javax.validation.constraints.Size;
import org.springmodules.validation.bean.conf.loader.annotation.handler.NotEmpty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
public class NtriDTO {
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class Request implements Serializable {
private static final long serialVersionUID = 1L;
private NtriCmmHeader header;
private NtriRequestBody<?> body;
}
/**
*
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
public static class NtriCmmHeader implements Serializable {
private static final long serialVersionUID = 1L;
//--------------------------------------------------
// 전문헤더
//--------------------------------------------------
/**
* - varchar 14
*
* ( ) [ :YYYYMMDDHH24MISS ]
*/
@NotEmpty
@Size(min = 14, max = 14, message = "전송일자(14자)")
private String ifDate;
/**
* <pre>
* - varchar 49
*
*
* ( )
* [ : + (yyMMddHHmmssSSS)+-+ UUID (- )]
* [ : (T), (W), (N), (A), (L), (E ), (Z)
* [ : T211103155123435-e7def4c1652a478e9c77525ab5b3ebda ]
* </pre>
*/
@NotEmpty
@Size(min = 49, max = 49, message = "연계메세지키(49자)")
private String ifMsgKey;
//--------------------------------------------------
// 거래정보
//--------------------------------------------------
/**
* ID - varchar 30
*
* -
* ) EBD_1613000001_1741000TAX_0020
*/
@NotEmpty
@Size(min = 30, max = 30, message = "인터페이스ID(30자)")
private String ifId;
/**
* - varchar 10
*
* ( 7 ) + (3 )
*/
@NotEmpty
@Size(min = 10, max = 10, message = "출발지 시스템 코드(10자)")
private String source;
/**
* - varchar 10
* /
* ( 7 ) + (3 )
*/
@NotEmpty
@Size(min = 10, max = 10, message = "도착지 시스템 코드(10자)")
private String target;
/**
* - varchar 1
* /
* / (S: / , R: / )
*/
@NotEmpty
@Size(min = 1, max = 1, message = "데이타 구분(S:요청/송신, R:응답/수신)")
private String ifType;
//--------------------------------------------------
// 데이터 정보
//--------------------------------------------------
/**
* - varchar 1
*
*
* (D : (| ), F : Fixed-Length, X : XML, J : JSON)
*/
@NotEmpty
@Size(min = 1, max = 1, message = "데이타 형식(D:delimiter / F:fixed-length / J:json)")
private String ifFormat;
//--------------------------------------------------
// 처리결과(출력부)
//--------------------------------------------------
/**
* - varchar 150
* - Success : , :
*/
@Size(max = 150, message = "연계처리결과명(~150자)")
private String retName;
/**
* - varchar 10
* ,
* ( / , ) => 200 : , 500 :
*/
@Size(max = 10, message = "연계결과처리코드(~10자)")
private String retCode;
}
/**
*
*/
/**
* Body
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class NtriRequestBody<T> implements Serializable {
private static final long serialVersionUID = 1L;
private T reqVo;
}
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class NtriResponseBody<T> implements Serializable {
private static final long serialVersionUID = 1L;
private T resVo;
}
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class Imposition implements Serializable {
private static final long serialVersionUID = 1L;
/**
* :
*/
@NotEmpty
@Size(min = 7, max = 7, message = "자치단체코드(7자)")
private String sgbCd;
/**
* : ( )
*/
@NotEmpty
@Size(min = 15, max = 15, message = "연계대상코드(15자)")
private String linkTrgtCd;
/**
* :
*/
@NotEmpty
@Size(min = 50, max = 50, message = "연계관리키(50자)")
private String linkMngKey;
/**
* :
*/
@NotEmpty
@Size(min = 7, max = 7, message = "부서코드(7자)")
private String dptCd;
/**
* :
* '51','61'
* "차세대 세외수입시스템과 자치단체 개별 및 특화시스템간 연계 테스트 안내"
*/
@NotEmpty
@Size(min = 4, max = 4, message = "특별회계사업코드(4자)")
@Builder.Default
private String spclFisBizCd = "0000";
}
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class ImpositionRes implements Serializable {
private static final long serialVersionUID = 1L;
/**
* - varchar 7
*/
@Size(min = 7, max = 7, message = "자치단체코드(7자)")
private String sgbCd;
/**
* - varchar 15
*/
@Size(min = 15, max = 15, message = "연계대상코드(15자)")
private String linkTrgtCd;
/**
* - varchar 50
*/
@Size(min = 50, max = 50, message = "연계관리키(50자)")
private String linkMngKey;
/**
* - varchar 30
*/
@Size(max = 30, message = "연계결과코드(~30자)")
private String linkRstCd;
/**
* - varchar 200
*/
@Size(max = 200, message = "연계결과메세지(~200자)")
private String linkRstMsg;
}
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public static class ReqVO1 implements Serializable {
private static final long serialVersionUID = 1L;
private String sgbCd;
private String bldgAcbKey;
private String ownrAcbKey;
private String rowNo;
}
}

@ -41,6 +41,8 @@ public class FimsCrackDownMgtController {
private String rcvBusonlyCctvPath; private String rcvBusonlyCctvPath;
@Value("#{prop['file.rcv.natl-newspaper.path']}") @Value("#{prop['file.rcv.natl-newspaper.path']}")
private String rcvNatlNewspaperPath; private String rcvNatlNewspaperPath;
@Value("#{prop['app.extnl.vhcle.url']}")
private String extnlVhcleUrl;
private final IFimsCrackdownMgtService service; private final IFimsCrackdownMgtService service;
private final IRtCrackdownMgtService rtService; private final IRtCrackdownMgtService rtService;
@ -50,7 +52,9 @@ public class FimsCrackDownMgtController {
public ModelAndView cmmFimsCrackdownEditPopup(final FimsCrackdownDTO.Request dto){ public ModelAndView cmmFimsCrackdownEditPopup(final FimsCrackdownDTO.Request dto){
ModelAndView mav = new ModelAndView(); ModelAndView mav = new ModelAndView();
dto.setExtnlVhcleUrl(extnlVhcleUrl);
mav.addObject("param", dto); mav.addObject("param", dto);
if(Objects.equals(FimsConst.RegltProcessSttusCode.CRACKDOWN_INIT.getCode(), dto.getRegltProcessSttusCode())) { if(Objects.equals(FimsConst.RegltProcessSttusCode.CRACKDOWN_INIT.getCode(), dto.getRegltProcessSttusCode())) {
mav.addObject("pageTitle", "초기자료 편집"); mav.addObject("pageTitle", "초기자료 편집");
}else if(Objects.equals(FimsConst.RegltProcessSttusCode.CRACKDOWN.getCode(), dto.getRegltProcessSttusCode())) { }else if(Objects.equals(FimsConst.RegltProcessSttusCode.CRACKDOWN.getCode(), dto.getRegltProcessSttusCode())) {

@ -0,0 +1,188 @@
package kr.xit.framework.support.util;
import org.springframework.http.*;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.util.Assert;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Iterator;
public class HttpUtil {
// 헤더
private HttpHeaders headers;
// 요청 바디 : <Key, Value> 쌍
private MultiValueMap<String, String> body;
// 타임아웃
private HttpComponentsClientHttpRequestFactory factory;
// 요청 URL
private StringBuilder urlBuilder;
private boolean queryStringToken;
private String url;
// 요청 방식
private String method;
public HttpUtil(){
this.headers = new HttpHeaders();
this.factory = new HttpComponentsClientHttpRequestFactory();
this.factory.setConnectTimeout(5000);
this.factory.setReadTimeout(5000);
this.body = new LinkedMultiValueMap<String, String>();
this.queryStringToken = true;
}
/**
* content-type : new MediaType
*
* @param type
* @param subType
* @param charSet
* @return
*/
public HttpUtil contentType(String type, String subType, String charSet){
this.headers.setContentType(new MediaType(type, subType, Charset.forName(charSet)));
return this;
}
/**
* connect-timeout <br>
* default : 5
*
* @param time
* @return
*/
public HttpUtil connectTimeout(int time){
this.factory.setConnectTimeout(time);
return this;
}
/**
* read-timeout <br>
* default : 5
*
* @param time
* @return
*/
public HttpUtil readTimeout(int time){
this.factory.setReadTimeout(time);
return this;
}
/**
* URL
*
* @param url
* @return
*/
public HttpUtil url(String url) {
this.urlBuilder = new StringBuilder();
urlBuilder.append(url);
return this;
}
/**
*
*
* @param name
* @param value
* @return
*/
public HttpUtil queryString(String name, String value) {
Assert.notNull(urlBuilder, "url 미입력");
if(queryStringToken) {
urlBuilder.append("?")
.append(name)
.append("=")
.append(value);
queryStringToken = false;
} else {
urlBuilder.append("&")
.append(name)
.append("=")
.append(value);
}
return this;
}
/**
* (get, post)
*
* @param method
* @return
*/
public HttpUtil method(String method) {
this.method = method.toUpperCase();
return this;
}
/**
*
*
* @param name
* @param value
* @return
*/
public HttpUtil header(String name, String value){
headers.set(name, value);
return this;
}
/**
* body : key, value
*
* @param key
* @param value
* @return
*/
public HttpUtil body(String key, String value){
this.body.add(key, value);
return this;
}
/**
* body : map
*
* @param params
* @return
*/
public HttpUtil body(HashMap<String, Object> params){
Iterator<String> itr = params.keySet().iterator();
while(itr.hasNext()){
String key = itr.next();
body.add(key, (String)params.get(key));
}
return this;
}
/**
* HTTP (status, header, body)
*
* @return
*/
public HashMap<String, Object> build(){
HashMap<String, Object> result = new HashMap<>();
RestTemplate restTemplate = new RestTemplate(factory);
HttpEntity<MultiValueMap<String, String>> entity = new HttpEntity<>(body, headers);
url = urlBuilder.toString();
ResponseEntity<String> response = null;
if ("GET".equals(method)){
response = restTemplate.exchange(url, HttpMethod.GET, entity, String.class);
} else if("POST".equals(method)) {
response = restTemplate.exchange(url, HttpMethod.POST, entity, String.class);
}
result.put("status", response.getStatusCode());
result.put("header", response.getHeaders());
result.put("body", response.getBody());
return result;
}
}

@ -148,3 +148,5 @@ file.res.root=/Users/minuk/data/fims/extnl/res
#file.res.root=D:/data/fims/extnl/res #file.res.root=D:/data/fims/extnl/res
file.rcv.natl-newspaper.path=/natl-newspaper file.rcv.natl-newspaper.path=/natl-newspaper
file.rcv.busonly-cctv.path=/busonly file.rcv.busonly-cctv.path=/busonly
app.extnl.vhcle.url=http://localhost:18090

@ -292,6 +292,7 @@ Date Author Description
let regltSeCode = ''; let regltSeCode = '';
let schParam = null; let schParam = null;
let extnlVhcleUrl = '';
/* ******************************* /* *******************************
* Biz function * Biz function
@ -420,22 +421,51 @@ Date Author Description
return false; return false;
} }
// FIXME :: callback 형태로 단속 건수 조회
///////////////////////////////////////////////////
// FIXME :: 차적조회 연계 완료후 적용
///////////////////////////////////////////////////
/*
const data = {
vhcleNo: $('input[name=vhcleNo]').val(),
date: "20220111"
}
let url = extnlVhcleUrl + '/api/v1/vhcle/findVhcle';
cmmAjax({ cmmAjax({
showSuccessMsg: false showSuccessMsg: false
, url: fimsApiUrl.FIND_CRACKDOWN_VHCLE_NO_CNT , contentType: "application/json"
, data: {vhcleNo: $('input[name=vhcleNo]').val()} , url
, data: JSON.stringify(data)
, success: (res) => { , success: (res) => {
fnPopupBiz.showCrackdownVhcleNoCnt(res.data?.contents); alert('차적조회 결과 : \n' + JSON.stringify(res));
alert('call 차적조회 인터페이스후 해당 차량번호의 단속건수 조회'); //$('input[name=vhcleNm]').val(res.vhcleNm);
//$('input[name=vhcleColor]').val(res.vhcleColor);
$('input[name=vhcleNm]').val('차량명칭'); $('input[name=vhcleNm]').val('차량명칭');
$('input[name=vhcleColor]').val('차량색상'); $('input[name=vhcleColor]').val('차량색상');
}
})
*/
///////////////////////////////////////////////////
// FIXME :: 차적조회 연계 완료후 적용
///////////////////////////////////////////////////
alert('차적조회 연계 call')
$('input[name=vhcleNm]').val('차량명칭');
$('input[name=vhcleColor]').val('차량색상');
cmmAjax({
showSuccessMsg: false
, url: fimsApiUrl.FIND_CRACKDOWN_VHCLE_NO_CNT
, data: {vhcleNo: $('input[name=vhcleNo]').val()}
, success: (res) => {
fnPopupBiz.showCrackdownVhcleNoCnt(res.data?.contents);
}
})
// }
//})
///////////////////////////////////////////////////
// FIXME :: 차적조회 연계 완료후 적용
///////////////////////////////////////////////////
} }
,callbackEnlightErpp: (data) => { ,callbackEnlightErpp: (data) => {
@ -702,6 +732,7 @@ Date Author Description
**************************************************************************/ **************************************************************************/
$(document).ready(function(){ $(document).ready(function(){
extnlVhcleUrl = 'http://localhost:18090'
fnPopupBiz.search({ fnPopupBiz.search({
regltId: '${param.regltId}' regltId: '${param.regltId}'
,regltSeCode: '${param.regltSeCode}' ,regltSeCode: '${param.regltSeCode}'

Loading…
Cancel
Save