Files
eapim-admin/WebContent/jsp/bap/admin/work/interfaceManBatchFepDetail.jsp
T
2026-02-10 13:27:10 +09:00

698 lines
29 KiB
Plaintext

<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ page import="java.io.*"%>
<%@ page import="com.eactive.eai.rms.common.login.SessionManager"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="/jsp/common/include/localemessage.jsp" %>
<%
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setHeader("Expires", "0");
String userId = SessionManager.getUserId(request);
String userNm = SessionManager.getUserName(request);
String rollId = SessionManager.getRoleIdString(request);
String arr[] = rollId.split(",");
for(int i=0;i<arr.length;i++){
rollId = arr[i];
if("admin".equals(arr[i]) || "dept_admin".equals(arr[i])){
rollId = "admin";
break;
}
}
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<jsp:include page="/jsp/common/include/css.jsp"/>
<jsp:include page="/jsp/common/include/script.jsp"/>
<script language="javascript" >
var isDetail = false;
var isTemp = false; //임시저장 여부
var url = '<c:url value="/bap/admin/work/interfaceManBatchFep.json" />';
var url_view = '<c:url value="/bap/admin/work/interfaceManBatchFep.view" />';
var dat = {};
var delFlag = "";
var ex1 = /^[0-9]{1,2}:[0-9]{1,2}$/;
$(function(){
$(document).tooltip({
content:function(){
return $(this).prop('title');
}
})
});
$(document).ready(function() {
var returnUrl = getReturnUrlForReturn();
//debugger;
var key ="${param.infId}";
delFlag = "${param.delFlag}";
if (key != "" && key !="null"){
isDetail = true;
}
init(url,key,detail);
$.ajax({
type : "POST",
url:url,
dataType:"json",
data:{cmd: 'LIST_COMBO' //화면의 셀렉트박스 리스트 조회
, gubun: 'BATCH_FEP'
},
success:function(json){
new makeOptions("PRPTYNAME","CODENAME").setObj($("select[name=outBizCd]")).setData(json.BzSystem_BAP.rows).rendering(); //업무시스템(FEP), 대외일괄업무코드
new makeOptions("PRPTYNAME","CODENAME").setObj($("select[name=srcBzSystemCd]")).setData(json.BzSystem.rows).rendering(); //내부정보.시스템코드
new makeOptions("BZWKDSTCD","CODENAME").setObj($("select[name=appCd]")).setData(json.authList.rows).rendering(); //APP코드
$("#srcBzSystemCd").prepend("<option value=''>선택</option>");
$("#srcBzSystemCd").val(dat.SYSCD); //소스업무시스템구분
$("#srcBzSystemCd").change();
$("#outBizCd").prepend("<option value=''>선택</option>");
$("#outBizCd").val(dat.OUTBIZCD); //대외일괄업무코드
$("#outBizCd").change();
$("#appCd").val(dat.UAPPLCD); //APP코드
$("#appCd").change();
},
error:function(e){
alert(e.responseText);
}
});
$("#btn_modify").on('click', function(){
var vCmd = "";
if (isDetail){
vCmd = "UPDATE_BATCH";
}else{
vCmd = "INSERT_BATCH";
}
if(isTemp){
vCmd = "INSERT_BATCH";
}
if (!isValid()){
return;
}
var postData = $('#ajaxForm').serializeArray();
postData.push({ name: "cmd" , value: vCmd});
$.ajax({
type : "POST",
url:url,
data:postData,
success:function(args){
if(args.result == "0"){
editDisp(args);
alert("인터페이스ID [" + args.BJOBMSGDSTCD + "]가 저장 되었습니다.");
}else{
alert("저장처리가 실패하였습니다.\nEIMS관리자에게 문의해주세요");
}
goNav(returnUrl);//LIST로 이동
},
error:function(e){
alert(e.responseJSON.errorMsg);
}
});
});
$("#btn_delete").on('click', function(){
if(!confirm($("#infId").val() + "를 삭제하시겠습니까?")){
return;
}
var postData = $('#ajaxForm').serializeArray();
postData.push({ name: "cmd" , value:"DELETE_BATCH"}
,{ name: "userId" , value:"<%= userId %>"}
);
$.ajax({
type : "POST",
url:url,
dataType:"json",
data:postData,
success:function(args){
alert("삭제 되었습니다.");
goNav(returnUrl);//LIST로 이동
},
error:function(e){
alert(e.responseJSON.errorMsg);
//alert(e.responseText);
}
});
});
$("#btn_previous").on('click', function(){
goNav(returnUrl);//LIST로 이동
});
// Excel upload
$("#multiform").submit(fileupload);
//대외일괄업무코드 선택 이벤트
$("#outBizCd").on('change', function(){
var idx = $("#outBizCd option").index($("#outBizCd option:selected"));
$("#outBizNm").html($("#outBizCd option:selected").text().substring($("#outBizCd option:selected").text().indexOf("[")+1, $("#outBizCd option:selected").text().indexOf("]")));
});
//내부시스템코드 선택 이벤트
$("#srcBzSystemCd").on('change', function(){
if(isDetail){
if(!isTemp){
if((dat.SYSCD) != $("#srcBzSystemCd").val()) { //내부시스템코드
$("#srcBzSystemCd").val(dat.SYSCD);
return;
}
}
}
var idx = $("#srcBzSystemCd option").index($("#srcBzSystemCd option:selected"));
$("#srcBzSystemNm").html($("#srcBzSystemCd option:selected").text().substring($("#srcBzSystemCd option:selected").text().indexOf("[")+1, $("#srcBzSystemCd option:selected").text().indexOf("]")));
});
//대외기관코드 선택 이벤트
$("#osidInstiCd").on('change', function(){
var idx = $("#osidInstiCd option").index($("#osidInstiCd option:selected"));
$("#osidInstiNm").html($("#osidInstiCd option:selected").text().substring($("#osidInstiCd option:selected").text().indexOf("[")+1, $("#osidInstiCd option:selected").text().indexOf("]")));
});
//APP코드 선택 이벤트
$("#appCd").on('change', function(){
var idx = $("#appCd option").index($("#appCd option:selected"));
$("#appNm").text($("#appCd option:selected").text().substring($("#appCd option:selected").text().indexOf("[")+1, $("#appCd option:selected").text().indexOf("]")));
});
buttonControl(isDetail);
titleControl(isDetail);
// $("#runType").trigger('change');
});
function isValid(){
if(isDetail){
if(!isTemp){
if($("#hiddenSrcBzSystemCd").val() != $("#srcBzSystemCd").val()) { //소스정보.시스템코드
alert("소스정보 또는 타겟정보의 시스템코드는 수정할 수 없습니다.");
$("#srcBzSystemCd").val($("#hiddenSrcBzSystemCd").val());
$("#srcBzSystemCd").change();
return;
}
}
}
if($("#appCd").val() == ""){
alert("APP코드를 선택해주세요.");
return;
}
if($("#outBizCd").val() == ""){
alert("대외일괄업무코드를 선택해주세요.");
return false;
}
if($('#infDesc').val().trim() == ""){
alert("인터페이스 설명을 입력하여 주십시오.");
return false;
}
if($("#authorId").val() == ""){
alert("담당자ID를 입력해주세요.");
return;
}
if($("#srcBzSystemCd").val() == ""){
alert("시스템코드를 입력해주세요.");
return false;
}
if($("#fileCode").val().trim() == ""){
alert("파일코드를 입력해주세요.");
return false;
}
if($("#srcFilePath").val().trim() == ""){
alert("파일경로를 입력해주세요.");
return false;
}
return true;
}
function init(url,key,callback){
if(typeof callback === 'function') {
callback(url,key);
}
}
function detail(url,key){
//if (!isDetail)return;
if (!isDetail){
return;
}
$.ajax({
type : "POST",
url:url,
dataType:"json",
data:{cmd: 'DETAIL', infId : key, delFlag : delFlag},
success:function(json){
var data = json;
$("#ajaxForm input[type!=radio],#ajaxForm select,#ajaxForm textarea").each(function(){
var name = $(this).attr("name");
var tag = $(this).prop("tagName").toLowerCase();
$(tag+"[name="+name+"]").val(data[name.toUpperCase()]);
});
dat = data;
editDisp(dat); //화면편집
},
error:function(e){
alert(e.responseText);
}
});
}
//Excel Upload 실행함수.
function fileupload(e,successcallback,errorcallback){
var formObj = $(this);
var formURL = formObj.attr("action");
if(window.FormData !== undefined) // for HTML5 browsers
{
var formData = new FormData(this);
dat = {};
$.ajax({
url: formURL,
type: 'POST',
data: formData,
mimeType:"multipart/form-data",
contentType: false,
cache: false,
processData:false,
success: function(json, textStatus, jqXHR)
{
dat = JSON.parse(json);
if ((dat.message != null && dat.message != "null") || dat.rows.length==0){
alert(dat.message);
return ;
}
dat = dat.rows[0];
editDisp(dat); //화면 편집
alert("Excel Upload가 완료되었습니다.");
if (typeof callback === 'function') {
successcallback(data, textStatus, jqXHR);
}
},
error: function(jqXHR, textStatus, errorThrown)
{
if (typeof callback === 'function') {
errorcallback(jqXHR, textStatus, errorThrown);
}
}
});
e.preventDefault();
if (e.unbind)
e.unbind();
}
else //for olden browsers
{
formObj.append($("<input type='hidden' name='serviceType' value='"+sessionStorage["serviceType"]+"' />"));
//generate a random id
var iframeId = 'unique' + (new Date().getTime());
//create an empty iframe
var iframe = $('<iframe src="javascript:false;" name="'+iframeId+'" />');
//hide it
iframe.hide();
//set form target to iframe
formObj.attr('target',iframeId);
formObj.attr('action','<c:url value="/iim/interface/interfaceMan2.file" />');
//Add iframe to body
iframe.appendTo('body');
iframe.load(function(e)
{
var doc = getDoc(iframe[0]);
var docRoot = doc.body ? doc.body : doc.documentElement;
var data = docRoot.innerHTML;
var k = JSON.parse(data);
$("input[name=file]").val("");
if (k.rows.length==0){
alert(k.message);
return ;
}
dat = data.rows[0];
editDisp(dat); //화면 편집
alert("Excel Upload가 완료되었습니다.");
//data is returned from server.
if (typeof callback === 'function') {
//successcallback(data);
}
});
}
}
function editDisp(dat){
$("#tdUpdateBy").text(dat.THISMSGCHRGIDS); //작성자
$("#tdUpdateYmd").text(dat.THISMSGAMNDHMS); //최종작성일시
$("#updateBy").val(dat.THISMSGCHRGIDS); //작성자
$("#updateYmd").val(dat.THISMSGAMNDHMS); //최종작성일시
$("#infId").val(dat.BJOBMSGDSTCD); //인터페이스 ID(물리)
$("#infDesc").val(dat.BJOBMSGDSTICNAME); //인터페이스 설명
$("#appCd").val(dat.UAPPLCD); //APP코드
$("#appNm").text(dat.APP_NM==null?"":dat.APP_NM); //APP명
$("#outBizCd").val(dat.OUTBIZCD); //대외일괄업무코드
$("#outBizNm").text(dat.OUT_BIZ_CD_NM==null?"":dat.OUT_BIZ_CD_NM); //대외일괄업무코드명
$("#hiddenSnDst").val(dat.SNDDST);
if(isDetail){
if(isTemp){
$("#snDst").val(dat.SN_DST); //송수신구분
}else{
if(dat.SNDDST=="T"){
$("#tdSnDst").text("송/수신");
}else if(dat.SNDDST=="R"){
$("#tdSnDst").text("수신");
}else{
$("#tdSnDst").text("송신");
}
}
}else{
$("#snDst").val(dat.SNDDST); //송수신구분
}
$("#authorId").val(dat.THISMSGCHRGIDS); //담당자ID
$("#srcBzSystemCd").val(dat.SYSCD); //내부정보.시스템코드
$("#hiddenSrcBzSystemCd").val(dat.SYSCD); //소스정보.시스템코드(hidden)
$("#srcBzSystemNm").html(dat.SRC_BZ_SYSTEM_NM); //내부정보.시스템코드명
$("#osidInstiCd").val(dat.OUTBIZCD); //외부정보.대외기관코드
$("#osidInstiNm").html(dat.OSID_INSTI_NM); //외부정보.대외기관코드명
$("#srcFileNm").val(dat.SRC_FILE_NM); //내부정보.파일명/패턴
$("#tgtFileNm").val(dat.TGT_FILE_NM); //외부정보.기관파일명/패턴
$("#srcFilePath").val(dat.SRCFILEPATH); //내부정보.파일경로
$("#fileCode").val(dat.BJOBTRANDSTCDNAME); //파일코드
$("#recSize").val(dat.BJOBTELGMRECSIZE); //레코드크기
isDetail = true;
$("#srcBzSystemCd").prop("disabled", true);
setButton();
}
function setButton(){
$("img[id^='btn']").hide();
if(isTemp){
$("#btn_temp").show();
$("#btn_modify").show();
$("#btn_delete").show();
$("#btn_excel_export").show();
$("#btn_previous").show();
// $("img[id^='btn_sync_log']").hide();
// $("img[id^='btn_sync']").hide();
}else{
$("#btn_modify").show();
$("#btn_delete").show();
if(dat.STATUS == "W" || dat.STATUS == "R") $("#btn_sync").show();
$("#btn_sync_log").show();
$("#btn_excel_export").show();
$("#btn_previous").show();
// $("img[id^='btn_temp']").hide();
}
if("<%= rollId %>" != "admin"){
if("<%= userId %>" != $("#authorId").val() && "<%= userId %>" != $("#updateBy").val()){
$("#btn_modify").hide();
$("#btn_delete").hide();
$("#btn_sync").hide();
}
}
if(dat.DEL_FLAG == "Y"){
$("img[delFlg]").hide();
$("#btn_restore").show();
}else{
$("#btn_restore").hide();
}
}
function getAuthorNm(key, userId, callback){
if(userId == ""){
return;
}
var url2='<c:url value="/common/acl/user/userMan.json"/>';
var postData = $('#ajaxForm').serializeArray();
postData.push({ name: "cmd" , value:"DETAIL"}
,{ name: "userId" , value:userId }
);
$.ajax({
type : "POST",
url:url2,
data:postData,
success:function(json){
var dat = json;
if(dat.USERID == undefined || dat.USERID == null){
alert("존재 하지 않는 사용자 입니다.");
dat.USERNAME = "";
}
if(typeof callback === 'function') {
callback(dat.USERNAME);
}
},
error:function(e){
alert(e.responseText);
}
});
}
function authorIdCallback(userNm){
$("#authorNm").text(userNm);userNm
}
function userList(){
var args = new Object();
var url2='<c:url value="/common/acl/user/userMan.view"/>';
url2 = url2 + "?cmd=LIST_POPUP";
var result = showModal(url2,args, 500, 650, function(arg){
var args = null;
if(arg == null || arg == undefined ) {//chrome
args = this.dialogArguments;
args.returnValue = this.returnValue;
} else {//ie
args = arg;
}
if( !args || !args.returnValue ) return;
});
return result;
}
</script>
</head>
<body>
<div class="right_box">
<!-- path -->
<div class="content_top">
<ul class="path">
<li><a href="#">${rmsMenuPath}</a></li>
</ul>
</div><!-- end content_top -->
<div class="content_middle" id="content_middle">
<!-- 엑셀Upload -->
<form id="multiform" method="POST" enctype="multipart/form-data" action="<c:url value="/iim/interface/interfaceMan.file" />">
<input type="file" name="file" id="file" accept=".xlsx" style="display:none"/>
<input type="text" name="cmd" style="display:none" value="UPLOAD"/>
<input type="text" name="section" style="display:none" value="FEPB"/>
<div class="search_wrap">
<% if ("admin".equals(rollId)) {%>
<img id="btn_restore" src="<c:url value="/images/bt/bt_restore.gif"/>" level="W" status="DETAIL" /> <!-- 복원 -->
<% } %>
<img id="btn_modify" src="<c:url value="/img/btn_modify.png"/>" level="W" status="DETAIL,NEW" delFlg="true"/>
<img id="btn_delete" src="<c:url value="/img/btn_delete.png"/>" level="R" status="DETAIL" delFlg="true"/>
<img id="btn_previous" src="<c:url value="/img/btn_previous.png"/>" level="R" status="DETAIL,NEW"/>
</div>
</form>
<!-- 엑셀Upload -->
<!-- title -->
<div class="title"><%= localeMessage.getString("interfaceBatchFep.title") %></div>
<!-- detail -->
<form id="ajaxForm" onsubmit="return false;">
<input type="hidden" name="ver" id="ver" />
<input type="hidden" name="infDstCd" id="infDstCd" value="OUT"/>
<input type="hidden" name="status" id="status" />
<input type="hidden" name="hiddenSnDst" id="hiddenSnDst" />
<input type="hidden" name="updateBy" id="updateBy" value=""/>
<input type="hidden" name="updateYmd" id="updateYmd" value=""/>
<input type="hidden" name="hiddenSrcBzSystemCd" id="hiddenSrcBzSystemCd" value="" />
<input type="hidden" name="runType" id="runType" value="E" />
<table>
<tr>
<%-- <td style="width:50%"></td>
<th style="width:5%"><%= localeMessage.getString("common.status") %> :</th> --%>
<td style="width:10%" id="statusNm"></td>
<th style="width:5%"><%= localeMessage.getString("layout.editorId") %> :</th>
<td style="width:10%" id="tdUpdateBy"></td>
<th style="width:10%"><%= localeMessage.getString("common.lastUpdateDate") %> :</th>
<td style="width:10%" id="tdUpdateYmd"></td>
</tr>
</table>
<table class="search_condition" cellspacing=0;>
<tbody>
<tr>
<th style="width:10%; min-width: 130px;"><%= localeMessage.getString("interface.titleInterfaceId") %>(<%= localeMessage.getString("common.physical") %>)</th>
<td colspan="3" style="width:35%;"><input type="text" name="infId" id="infId" style="width:100%"
readonly="readonly" placeholder="(자동생성) 출발지(3) + 목적지(3) + 일련번호(5)"/> </td>
<%-- <th style="width:10%; min-width: 130px;"><%= localeMessage.getString("interface.titleInterfaceId") %>(<%= localeMessage.getString("common.logical") %>)</th>
<td style="width:35%;"><input type="text" name="logicalInfId" id="logicalInfId" style="width:100%"/> </td> --%>
</tr>
<%-- <tr>
<th><%= localeMessage.getString("interface.asisInterfaceId") %></th>
<td><input type="text" name="asisInfId" id="asisInfId" style="width:100%" /> </td>
<td colspan="2"></td>
</tr> --%>
<tr>
<th><%= localeMessage.getString("common.appCode") %></th>
<td>
<select name="appCd" id="appCd" required style="width: 50%;">
</select>&nbsp;&nbsp;
<div id="appNm" style="display: inline-block;">
</div>
</td>
<th><%= localeMessage.getString("interface.externalBatchBizCode") %></th>
<td>
<select name="outBizCd" id="outBizCd" required style="width: 50%;">
</select>&nbsp;&nbsp;
<div id="outBizNm" style="display: inline-block;">
</div>
</td>
</tr>
<%-- <tr>
<th><%= localeMessage.getString("interface.interfaceName") %></th>
<td colspan="3">
<input type="text" name="infNm" id="infNm" style="width:100%" required />
</td>
</tr> --%>
<tr>
<th><%= localeMessage.getString("interface.interfaceDesc") %></th>
<td colspan="3">
<input type="text" name="infDesc" id="infDesc" style="width:100%" required />
</td>
</tr>
<tr>
<th><%= localeMessage.getString("interface.runningType") %></th>
<td><%= localeMessage.getString("interface.batchRunTypeEvent") %>
<!-- <select name="runType" id="runType" required >
<option value="E">이벤트(배치)</option>
<option value="S">스케줄(디퍼드)</option>
</select> -->
</td>
<th><%= localeMessage.getString("common.systemCode") %></th>
<td>
<select name="srcBzSystemCd" id="srcBzSystemCd" required style="width: 50%;">
</select>&nbsp;&nbsp;
<div id="srcBzSystemNm" style="display: inline-block;">
</div>
</td>
<%-- <th><%= localeMessage.getString("interface.batchSendCycle") %></th>
<td>
<input type="text" name="trnsmsnCycle" id="trnsmsnCycle" style="width:100%" />
</td> --%>
</tr>
<tr>
<th><%= localeMessage.getString("interface.sendRecvType") %></th>
<td style="width: 35%" id="tdSnDst">
<div class="select-style" >
<select name="snDst" id="snDst">
<option value="S"><%= localeMessage.getString("interface.transTypeOfSend") %></option>
<option value="R"><%= localeMessage.getString("interface.transTypeOfRecv") %></option>
<option value="T"><%= localeMessage.getString("interface.transTypeOfBoth") %></option>
</select>
</div>
</td>
<th><%= localeMessage.getString("common.ownerId") %></th>
<td>
<span style="width:50%; display: inline-block;">
<input type="text" name="authorId" id="authorId" style="width:100%" value="<%=userId %>" required >
</span>
<%-- <img id="btn_user_list" src="<c:url value="/img/btn_pop_search.png"/>" level="R" status="DETAIL,NEW"/>&nbsp;
<div id="authorNm" style="display: inline-block;"><%=userNm %></div> --%>
</td>
<%-- <th>담당자명</th>
<td id="authorNm" style="width:100%"><%=userNm %>
<!-- <input type="text" name="authorNm" id="authorNm" style="width:100%"/> -->
</td> --%>
</tr>
<!-- <tr height="30px">
<th style="border-right:1px solid #a3a9b1;" colspan="2">내부정보</th>
<th style="border-right:1px solid #a3a9b1;" colspan="2">외부정보</th>
</tr> -->
<%-- <tr>
<th><%= localeMessage.getString("interface.externalOrgCode") %></th>
<td>
<select name="osidInstiCd" id="osidInstiCd" required style="width: 50%;">
</select>&nbsp;&nbsp;
<div id="osidInstiNm" style="display: inline-block;">
</div>
</td>
</tr> --%>
<tr>
<th style="width:10%; min-width: 130px;"><%= localeMessage.getString("interfaceBatch.fileCode") %></th>
<td style="width:35%;"><input type="text" name="fileCode" id="fileCode" style="width:100%" /></td>
<th style="width:10%; min-width: 130px;"><%= localeMessage.getString("interfaceBatch.recordSize") %></th>
<td style="width:35%;"><input type="text" name="recSize" id="recSize" onkeyup="$(this).val($(this).val().replace(/\D/g,''));" title="숫자만 입력해주세요" placeholder="숫자만 입력해주세요" style="width:100%"/></td>
</td>
</tr>
<tr>
<%-- <th style="width:10%; min-width: 130px;"><%= localeMessage.getString("interfaceBatch.fileName") %></th>
<td style="width:35%;"><input type="text" name="srcFileNm" id="srcFileNm" style="width:100%" /></td> --%>
<!-- <th style="width:10%; min-width: 130px;">수신파일명</th>
<td style="width:35%;"><input type="text" name="tgtFileNm" id="tgtFileNm" style="width:100%"/></td>
</td>
</tr>
<tr> -->
<th><%= localeMessage.getString("interfaceBatch.filePath") %></th>
<td colspan="3">
<input type="text" name="srcFilePath" id="srcFilePath" style="width:100%"/>
</td>
<!-- <th></th>
<td>
<input type="text" name="fileCode" id="fileCode" style="width:100%"/>
</td> -->
</tr>
<%-- <tr>
<th style="height:40px"><%= localeMessage.getString("common.etc") %></th>
<td colspan="3">
<textarea name="etcDesc" id="etcDesc" style="width:100%" rows="2" maxlength="500" ></textarea>
</td>
</tr> --%>
</tbody>
</table>
</form>
</div><!-- end content_middle -->
</div><!-- end right_box -->
</body>
</html>