- Add Docker Compose configurations for dev, prod, and standalone environments - Add database initialization scripts (init-db.sh, init-db-docker.sh) - Add enhanced start-docker-linux.sh with DB init support - Add comprehensive database initialization guide - Support for automatic dbexport.pgsql import on first run - Include safety checks for production environment
428 lines
15 KiB
Plaintext
428 lines
15 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
|
<%@ page import="com.pms.common.utils.*"%>
|
|
<%@ page import="java.util.*" %>
|
|
<%@include file= "/init.jsp" %>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title><%=Constants.SYSTEM_NAME%></title>
|
|
<script>
|
|
$(function(){
|
|
$(document).ready(function(){
|
|
$("#search_productGroupObjId").change(function(){
|
|
|
|
$.ajax({
|
|
url:"/common/getProductList_combo.do",
|
|
type:"POST",
|
|
data:{"search_productGroupObjId":$(this).val(),"isJson":true},
|
|
dataType:"json",
|
|
async:true,
|
|
success:function(data){
|
|
//Swal.fire(data.length);
|
|
$(".dataOptions").remove();
|
|
$.each(data, function(i){
|
|
$("#search_productObjId").append("<option value=\""+data[i].OBJID+"\" class=\"dataOptions\">"+data[i].PRODUCT_NAME+"</option>");
|
|
});
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
|
|
Swal.fire(jqxhr.status);
|
|
Swal.fire(jqxhr.responseText);
|
|
}
|
|
});
|
|
});
|
|
|
|
$("#btnConfirm").click(function(){
|
|
if(fn_check()){
|
|
if(confirm("저장시 기존에 등록된 정보가 있다면, \n해당 정보는 삭제되고 현재 입력한 Data기준으로 등록됩니다. \n저장하시겠습니까?")){
|
|
var carObjId = $("#search_carObjId").val();
|
|
var productObjId = $("#search_productObjId").val();
|
|
var regionObjId = $("#search_regionObjId").val();
|
|
|
|
$.ajax({
|
|
url:"/part/saveStructureExcelImportData.do",
|
|
type:"POST",
|
|
data:{"search_carObjId":carObjId, "search_productObjId":productObjId, "search_regionObjId":regionObjId, "targetObjId":$("#targetObjId").val()},
|
|
dataType:"json",
|
|
async:true,
|
|
success:function(data){
|
|
Swal.fire(data.msg);
|
|
opener.location.reload();
|
|
self.close();
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
|
|
Swal.fire(jqxhr.status);
|
|
Swal.fire(jqxhr.responseText);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
|
|
$("#btnClose").click(function(){
|
|
self.close(0);
|
|
});
|
|
|
|
//file drag and drop
|
|
fnc_setFileDropZone("dropzone", "${targetObjId}", "${FILE_DOC_TYPE_STRUCTURE_EXCEL_IMPORT_CODE}", "${FILE_DOC_TYPE_STRUCTURE_EXCEL_IMPORT_NAME}", "setUploadTemplateFile", true, "fn_preProcessor");
|
|
|
|
$("#templateDownload").click(function(){
|
|
location.href="/template/STRUCTURE_EXCEL_IMPORT_TEMPLATE.xlsx";
|
|
});
|
|
|
|
//초기 저장버튼 비활성황
|
|
$("#btnConfirm").hide();
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
//템플릿 업로드 전 처리
|
|
function fn_preProcessor(){
|
|
|
|
//파일 정보 삭제.
|
|
$.ajax({
|
|
url:"/common/deleteFileInfo.do",
|
|
type:"POST",
|
|
data:{"targetObjId":"${targetObjId}", "docType":"${FILE_DOC_TYPE_STRUCTURE_EXCEL_IMPORT_CODE}"},
|
|
dataType:"json",
|
|
async:true,
|
|
success:function(data){
|
|
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
|
|
Swal.fire(jqxhr.status);
|
|
Swal.fire(jqxhr.responseText);
|
|
}
|
|
});
|
|
|
|
//임시 테이블 (TABLE NAME : STRUCTURE_TEMP_XLS_IMPORT_DATA)에 등록된 정보 삭제.
|
|
$.ajax({
|
|
url:"/part/initializeStructureTempXlsImportData.do",
|
|
type:"POST",
|
|
data:{"targetObjId":"${targetObjId}"},
|
|
dataType:"json",
|
|
async:true,
|
|
success:function(data){
|
|
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
|
|
Swal.fire(jqxhr.status);
|
|
Swal.fire(jqxhr.responseText);
|
|
}
|
|
});
|
|
}
|
|
|
|
//템플릿 업로드 후 처리
|
|
function setUploadTemplateFile(){
|
|
$.ajax({
|
|
url:"/common/getFileList.do",
|
|
type:"POST",
|
|
data:{"targetObjId":"${targetObjId}", "docType":"${FILE_DOC_TYPE_STRUCTURE_EXCEL_IMPORT_CODE}"},
|
|
dataType:"json",
|
|
async:true,
|
|
success:function(data){
|
|
$("#uploadedFileArea").html("");
|
|
$.each(data, function(i){
|
|
var s = "<tr class='dataTr'>";
|
|
s += "<td><a href='javascript:fnc_downloadFile(\""+data[i].OBJID+"\")'>"+data[i].REAL_FILE_NAME+"</a></td>";
|
|
s += "</tr>";
|
|
//$("#uploadedFileArea").append(s);
|
|
});
|
|
|
|
//저장버튼 활성화
|
|
$("#btnConfirm").show();
|
|
|
|
//excel file parsing
|
|
parsingExcelFile();
|
|
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
|
|
Swal.fire(jqxhr.status);
|
|
Swal.fire(jqxhr.responseText);
|
|
}
|
|
});
|
|
}
|
|
|
|
//EXCEL PARSING
|
|
function parsingExcelFile(){
|
|
$.ajax({
|
|
url:"/part/structureExcelParsingProc.do",
|
|
type:"POST",
|
|
data:{"targetObjId":"${targetObjId}", "docType":"${FILE_DOC_TYPE_STRUCTURE_EXCEL_IMPORT_CODE}"},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
var appendText = "";
|
|
$("#structureExcelImportTable").html("");
|
|
if(data != null && data.length > 0){
|
|
for(var i=0;i<data.length;i++){
|
|
var no = fnc_checkNull(data[i].NO);
|
|
var parentPartNo = fnc_checkNull(data[i].PARENT_PART_NO);
|
|
var partNo = fnc_checkNull(data[i].PART_NO);
|
|
var qty = fnc_checkNullDefaultValue(data[i].QTY, 1);
|
|
|
|
//확정 파트 카운트(여부)
|
|
var parentPartCompleteCnt = fnc_checkNull(data[i].PARENT_PART_COMPLETE_CNT);
|
|
var partCompleteCnt = fnc_checkNull(data[i].PART_COMPLETE_CNT);
|
|
|
|
//1레벨 part list (, 콤마로 구분)
|
|
var topLevelPartCnt = fnc_checkNull(data[i].TOP_LEVEL_PART_CNT);
|
|
|
|
var isNumeric = $.isNumeric(qty);
|
|
|
|
var trOption = "";
|
|
var textBoxStyle = "text-align:center; width:100%;";
|
|
var msg = "";
|
|
|
|
if(!isNumeric){
|
|
if(fnc_checkNull(msg) != "") msg += "\n\n";
|
|
msg += "수량이 잘못 입력되었습니다. \n입력된 문자열 : ["+qty+"] \n1로 자동 변경됩니다.";
|
|
trOption = "bgColor='red' style='cursor:help;' title='"+msg+"'";
|
|
textBoxStyle += "background-color:red;cursor:help;";
|
|
qty = 1;
|
|
}
|
|
|
|
if(fnc_checkNull(parentPartNo) == fnc_checkNull(partNo)){
|
|
if(fnc_checkNull(msg) != "") msg += "\n\n";
|
|
msg += "연결정보가 잘못되었습니다. 부모Part와 자식Part의 번호가 같습니다.";
|
|
trOption = "bgColor='red' style='cursor:help;' title='"+msg+"'";
|
|
textBoxStyle += "background-color:red;cursor:help;";
|
|
$("#btnConfirm").hide();
|
|
}
|
|
|
|
if(fnc_checkNull(parentPartNo) != "" && fnc_checkNull(parentPartCompleteCnt) == 0){
|
|
if(fnc_checkNull(msg) != "") msg += "\n-------------------------------------------------------------------------\n";
|
|
msg += "확정 Part 가 아닙니다 : 부모 Part No";
|
|
trOption = "bgColor='red' style='cursor:help;' title='"+msg+"'";
|
|
textBoxStyle += "background-color:red;cursor:help;";
|
|
$("#btnConfirm").hide();
|
|
}
|
|
|
|
if(fnc_checkNull(partCompleteCnt) == 0){
|
|
if(fnc_checkNull(msg) != "") msg += "\n---------------------------------------\n";
|
|
msg += "확정 Part 가 아닙니다 : 자식 Part No";
|
|
trOption = "bgColor='red' style='cursor:help;' title='"+msg+"'";
|
|
textBoxStyle += "background-color:red;cursor:help;";
|
|
$("#btnConfirm").hide();
|
|
}
|
|
|
|
if(fnc_checkNull(parentPartNo) == "" && topLevelPartCnt > 1){
|
|
if(fnc_checkNull(msg) != "") msg += "\n---------------------------------------\n";
|
|
msg += "1레벨로 같은 Part No가 중복 등록되었습니다.";
|
|
trOption = "bgColor='red' style='cursor:help;' title='"+msg+"'";
|
|
textBoxStyle += "background-color:red;cursor:help;";
|
|
$("#btnConfirm").hide();
|
|
}
|
|
|
|
/*
|
|
if(i > 0 && !fn_isPartComplete(parentPartNo)){
|
|
if(fnc_checkNull(msg) != "") msg += "\n\n";
|
|
msg += "확정 Part 가 아닙니다 : 부모 Part No";
|
|
trOption = "bgColor='red' style='cursor:help;' title='"+msg+"'";
|
|
textBoxStyle += "background-color:red;cursor:help;";
|
|
$("#btnConfirm").hide();
|
|
}
|
|
|
|
if(!fn_isPartComplete(partNo)){
|
|
if(fnc_checkNull(msg) != "") msg += "\n\n";
|
|
msg += "확정 Part 가 아닙니다 : 자식 Part No";
|
|
trOption = "bgColor='red' style='cursor:help;' title='"+msg+"'";
|
|
textBoxStyle += "background-color:red;cursor:help;";
|
|
$("#btnConfirm").hide();
|
|
}
|
|
*/
|
|
|
|
appendText += "<tr "+trOption+">";
|
|
appendText += "<td align=\"center\">"+no+"</td>";
|
|
appendText += "<td align=\"center\"><input type=\"text\" name=\"parentPartNo\" value=\""+$.trim(parentPartNo)+"\" style=\""+textBoxStyle+"\" readonly></td>";
|
|
appendText += "<td align=\"center\"><input type=\"text\" name=\"partNo\" value=\""+$.trim(partNo)+"\" style=\""+textBoxStyle+"\" readonly></td>";
|
|
appendText += "<td align=\"center\"><input type=\"text\" name=\"qty\" value=\""+fnc_checkNullDefaultValue(qty, 1)+"\" style=\""+textBoxStyle+"\"></td>";
|
|
appendText += "</tr>";
|
|
|
|
}
|
|
}else{
|
|
appendText += "<tr>";
|
|
appendText += "<td colspan=\"4\" align=\"center\">입력된 정보가 없습니다.</td>";
|
|
appendText += "<tr>";
|
|
$("#btnConfirm").hide();
|
|
}
|
|
$("#structureExcelImportTable").append(appendText);
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
|
|
Swal.fire(jqxhr.status);
|
|
Swal.fire(jqxhr.responseText);
|
|
}
|
|
});
|
|
}
|
|
|
|
//확정 파트인지 확인.
|
|
function fn_isPartComplete(partNo){
|
|
var result = false;
|
|
$.ajax({
|
|
url:"/part/isPartComplete.do",
|
|
type:"POST",
|
|
data:{"partNo":partNo},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
var result2 = data.result;
|
|
if(result2 == "true"){
|
|
result = true;
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
|
|
Swal.fire(jqxhr.status);
|
|
Swal.fire(jqxhr.responseText);
|
|
}
|
|
});
|
|
|
|
return result;
|
|
}
|
|
|
|
function fn_check(){
|
|
var carType = $("#search_carObjId option:checked").val();
|
|
var productGroup = $("#search_productGroupObjId option:checked").val();
|
|
var product = $("#search_productObjId option:checked").val();
|
|
var region = $("#search_regionObjId option:checked").val();
|
|
|
|
if(carType == null || carType == ""){
|
|
Swal.fire("차종을 선택해 주시기 바랍니다.");
|
|
$("#search_carObjId").focus();
|
|
return false;
|
|
}
|
|
if(productGroup == null || productGroup == ""){
|
|
Swal.fire("제품군을 선택해 주시기 바랍니다.");
|
|
$("#search_productGroupObjId").focus();
|
|
return false;
|
|
}
|
|
if(product == null || product == ""){
|
|
Swal.fire("제품을 선택해 주시기 바랍니다.");
|
|
$("#search_productObjId").focus();
|
|
return false;
|
|
}
|
|
if(region == null || region == ""){
|
|
Swal.fire("사양을 선택해 주시기 바랍니다.");
|
|
$("#search_regionObjId").focus();
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
<body class="backcolor">
|
|
<form name="form1" action="" method="post">
|
|
<input type="hidden" name="targetObjId" id="targetObjId" value="${targetObjId}" />
|
|
<!-- 팝업창 크기 400x290 -->
|
|
<div class="plm_menu_name">
|
|
<h2>
|
|
<span>구조등록</span>
|
|
</h2>
|
|
</div>
|
|
<div id="businessPopupFormWrap">
|
|
<div class="form_popup_title" style="position:relative;"> Excel upload<img src="/images/btnExcel.png" style="position:absolute; top:9px; right:135px;"/><span style="position:absolute; top:0px; right:10px; cursor:pointer;" id="templateDownload">Template Download</span></div>
|
|
<table class="pmsPopupForm">
|
|
<colgroup>
|
|
<col width="*">
|
|
<col width="10%">
|
|
<col width="*">
|
|
<col width="22%">
|
|
<col width="*">
|
|
<col width="22%">
|
|
<col width="*">
|
|
<col width="10%">
|
|
</colgroup>
|
|
<tr>
|
|
<td class="input_title"><label for="">차종</label></td>
|
|
<td>
|
|
<select name="search_carObjId" id="search_carObjId">
|
|
<option value="">선택</option>
|
|
<c:forEach var="item" items="${carTypeList}" varStatus="status">
|
|
<option value="${item.OBJID}">${item.CAR_NAME}(${item.CAR_CODE})</option>
|
|
</c:forEach>
|
|
</select>
|
|
</td>
|
|
<td class="input_title"><label for="">제품군</label></td>
|
|
<td>
|
|
<select name="search_productGroupObjId" id="search_productGroupObjId">
|
|
<option value="">선택</option>
|
|
<c:forEach var="item" items="${productGroupList}" varStatus="status">
|
|
<option value="${item.OBJID}">${item.PRODUCT_GROUP_NAME}</option>
|
|
</c:forEach>
|
|
</select>
|
|
</td>
|
|
<td class="input_title"><label for="">제품</label></td>
|
|
<td>
|
|
<select name="search_productObjId" id="search_productObjId">
|
|
<option value="">선택</option>
|
|
</select>
|
|
</td>
|
|
<td class="input_title"><label for="">사양</label></td>
|
|
<td>
|
|
<select name="search_regionObjId" id="search_regionObjId">
|
|
<option value="">선택</option>
|
|
<c:forEach var="item" items="${regionList}" varStatus="status">
|
|
<option value="${item.OBJID}">${item.REGION_NAME}</option>
|
|
</c:forEach>
|
|
</select>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="8">
|
|
<div id="fileDnDWrap">
|
|
<div id="dropzone" style="width:99%; height:50px;">Drag & Drop Files Here</div>
|
|
<div id="templateFileList">
|
|
<table id="uploadedFileAreaTable">
|
|
<tbody id="uploadedFileArea">
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td colspan="8">
|
|
<table class="project_form_in_table" style="width:100%;">
|
|
<colgroup>
|
|
<col width="10%">
|
|
<col width="40%">
|
|
<col width="40%">
|
|
<col width="10%">
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<td>No</td>
|
|
<td>Parent Part No</td>
|
|
<td>Part No</td>
|
|
<td>Qty</td>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="structureExcelImportTable">
|
|
<tr>
|
|
<td colspan="4" align="center">입력된 정보가 없습니다.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div class="btn_wrap">
|
|
<div class="plm_btn_wrap_center">
|
|
<input type="button" value="저장" class="plm_btns" id="btnConfirm">
|
|
<input type="button" value="닫기" class="plm_btns" id="btnClose">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</body>
|
|
</html> |