Files
wace_plm/WebContent/WEB-INF/view/salesMng/salesBomExcelImportPopUp.jsp
chpark da06c4684c Initial commit: WACE PLM with database initialization features
- 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
2025-08-29 15:46:08 +09:00

426 lines
16 KiB
Plaintext

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ page import="com.pms.common.utils.*"%>
<%@ page import="java.util.*"%>
<%@include file="/init_jqGrid.jsp"%>
<!DOCTYPE html>
<html>
<head>
<c:set var="isFirstYN" value="${empty OBJID_SUB_TASK ? 'Y' : 'N'}" />
<script type="text/javascript">
var supplyList;
$(document).ready(function(){
supplyList = fn_getAdminSupCdList();
console.log("supplyList:"+supplyList);
fnc_setFileDropZone("excelImportDropZone", "${EXCEL_IMPORT_OBJID}", "BOM_EXCEL_IMPORT_FILE", "BOM Excel Import File", "setExcelFileArea",true,"fileDelete","/part/excelImportFileProc.do");
//Excel File Upload된 파일 목록 부분을 초기화 한다.
$("#excelImportList").hide();
});
function fn_getAdminSupCdList(){
var resultList;
$.ajax({
url:"/common/getAdminSupCdList.do",
type:"POST",
data:{},
dataType:"json",
async:false,
success:function(data){
resultList = data;
},
error: function(jqxhr, status, error){
}
});
return resultList;
}
function fn_getAdminSupCdListAppend(selectboxId,selectedVal){
$("#"+selectboxId).empty();
$("#"+selectboxId).append("<option value=''>선택</option>");
if(0 < supplyList.length){
for (var i = 0; i < supplyList.length; i++) {
var commonCodeId = supplyList[i].CODE_ID;
var commonCodeName = supplyList[i].CODE_NAME;
$("#"+selectboxId).append("<option value='"+commonCodeId+"'>"+commonCodeName+"</option>");
}
$("#"+selectboxId).val(selectedVal);
}
}
function fn_templateDownload(){
document.form1.action = "/salesMng/salesBomReportFormPopup.do";
document.form1.actionType.value = "excel";
document.form1.submit();
}
function parsingExcelFile(){
$("#structureTable").empty();
$.ajax({
url:"/salesMng/parsingSalesBomExcelImport.do",
type:"POST",
data:{"targetObjId":"${EXCEL_IMPORT_OBJID}","docType":"BOM_EXCEL_IMPORT_FILE","parent_objId":"${param.PARENT_OBJID}"},
dataType:"json",
async:false,
success:function(data){
var resultList = data;
console.log("resultList:"+resultList);
if(0 < resultList.length){
for(var i=0;i<resultList.length;i++){
var SALES_OBJID = fnc_checkNull(resultList[i].OBJID);
var PARENT_OBJID = fnc_checkNull(resultList[i].PARENT_OBJID);
var PART_OBJID = fnc_checkNull(resultList[i].PART_OBJID);
var CHILD_OBJID = fnc_checkNull(resultList[i].CHILD_OBJID);
var PART_NO = fnc_checkNull(resultList[i].PART_NO);
var PART_NAME = fnc_checkNull(resultList[i].PART_NAME);
var QTY = fnc_checkNull(resultList[i].QTY);
var SPEC = fnc_checkNull(resultList[i].SPEC);
var POST_PROCESSING = fnc_checkNull(resultList[i].POST_PROCESSING);
var MAKER = fnc_checkNull(resultList[i].MAKER);
var PART_TYPE_NAME = fnc_checkNull(resultList[i].PART_TYPE_NAME);
var SUPPLY_OBJID = fnc_checkNull(resultList[i].SUPPLY_OBJID);
var PRICE = fnc_checkNull(resultList[i].PRICE);
var SUPPLY_OBJID1 = fnc_checkNull(resultList[i].SUPPLY_OBJID1);
var PRICE1 = fnc_checkNull(resultList[i].PRICE1);
var SUPPLY_OBJID2 = fnc_checkNull(resultList[i].SUPPLY_OBJID2);
var PRICE2 = fnc_checkNull(resultList[i].PRICE2);
var SUPPLY_OBJID3 = fnc_checkNull(resultList[i].SUPPLY_OBJID3);
var PRICE3 = fnc_checkNull(resultList[i].PRICE3);
var SUPPLY_OBJID4 = fnc_checkNull(resultList[i].SUPPLY_OBJID4);
var PRICE4 = fnc_checkNull(resultList[i].PRICE4);
var REMARK = fnc_checkNull(resultList[i].REMARK);
var appendText = " <tr>";
appendText += " <input type='hidden' name='SALES_OBJID' value='"+SALES_OBJID+"'>";
appendText += " <input type='hidden' name='PARENT_OBJID_"+SALES_OBJID+"' value='"+PARENT_OBJID+"'>";
appendText += " <input type='hidden' name='PART_OBJID_"+SALES_OBJID+"' value='"+PART_OBJID+"'>";
appendText += " <input type='hidden' name='CHILD_OBJID_"+SALES_OBJID+"' value='"+CHILD_OBJID+"'>";
appendText += " <input type='hidden' name='QTY_"+SALES_OBJID+"' value='"+QTY+"'>";
appendText += " <input type='hidden' name='PART_NO_"+SALES_OBJID+"' value='"+PART_NO+"'>";
appendText += " <input type='hidden' name='PART_NAME_"+SALES_OBJID+"' value='"+PART_NAME+"'>";
appendText += " <td class='align_l'><a href='#' onclick=\"fn_openPartMngPopup('"+PART_OBJID+"');\">"+PART_NO+"</a></td>";
appendText += " <td class='align_l'><a href='#' onclick=\"fn_openPartMngPopup('"+PART_OBJID+"');\">"+PART_NAME+"</a></td>";
appendText += " <td class='align_l'>"+QTY+"</td>";
appendText += " <td class='align_l'>"+SPEC+"</td>";
appendText += " <td class='align_l'>"+POST_PROCESSING+"</td>";
appendText += " <td class='align_l'>"+MAKER+"</td>";
appendText += " <td class='align_l'>"+PART_TYPE_NAME+"</td>";
appendText += " <td class='align_l'>";
appendText += " <select name='SUPPLY_OBJID_"+SALES_OBJID+"' id='SUPPLY_OBJID_"+SALES_OBJID+"'></select>";
appendText += " </td>";
appendText += " <td class='align_l'>";
appendText += " <input type='number' name='PRICE_"+SALES_OBJID+"' id='PRICE_"+SALES_OBJID+"' value='"+PRICE+"'>";
appendText += " </td>";
appendText += " <td class='align_l'>";
appendText += " <select name='SUPPLY_OBJID1_"+SALES_OBJID+"' id='SUPPLY_OBJID1_"+SALES_OBJID+"'></select>";
appendText += " </td>";
appendText += " <td class='align_l'>";
appendText += " <input type='number' name='PRICE1_"+SALES_OBJID+"' id='PRICE1_"+SALES_OBJID+"' value='"+PRICE1+"'>";
appendText += " </td>";
appendText += " <td class='align_l'>";
appendText += " <select name='SUPPLY_OBJID2_"+SALES_OBJID+"' id='SUPPLY_OBJID2_"+SALES_OBJID+"'></select>";
appendText += " </td>";
appendText += " <td class='align_l'>";
appendText += " <input type='number' name='PRICE2_"+SALES_OBJID+"' id='PRICE2_"+SALES_OBJID+"' value='"+PRICE2+"'>";
appendText += " </td>";
appendText += " <td class='align_l'>";
appendText += " <select name='SUPPLY_OBJID3_"+SALES_OBJID+"' id='SUPPLY_OBJID3_"+SALES_OBJID+"'></select>";
appendText += " </td>";
appendText += " <td class='align_l'>";
appendText += " <input type='number' name='PRICE3_"+SALES_OBJID+"' id='PRICE3_"+SALES_OBJID+"' value='"+PRICE3+"'>";
appendText += " </td>";
appendText += " <td class='align_l'>";
appendText += " <select name='SUPPLY_OBJID4_"+SALES_OBJID+"' id='SUPPLY_OBJID4_"+SALES_OBJID+"'></select>";
appendText += " </td>";
appendText += " <td class='align_l'>";
appendText += " <input type='number' name='PRICE4_"+SALES_OBJID+"' id='PRICE4_"+SALES_OBJID+"' value='"+PRICE4+"'>";
appendText += " </td>";
appendText += " <td class='align_l'>"+REMARK+"</td>";
//appendText += " <td class='align_l'>";
//appendText += " <input type='text' name='REMARK_"+SALES_OBJID+"' id='REMARK_"+SALES_OBJID+"' value='"+REMARK+"'>";
//appendText += " </td>";
appendText += " </tr>";
$("#structureTable").append(appendText);
fn_getAdminSupCdListAppend("SUPPLY_OBJID_"+SALES_OBJID, SUPPLY_OBJID);
fn_getAdminSupCdListAppend("SUPPLY_OBJID1_"+SALES_OBJID, SUPPLY_OBJID1);
fn_getAdminSupCdListAppend("SUPPLY_OBJID2_"+SALES_OBJID, SUPPLY_OBJID2);
fn_getAdminSupCdListAppend("SUPPLY_OBJID3_"+SALES_OBJID, SUPPLY_OBJID3);
fn_getAdminSupCdListAppend("SUPPLY_OBJID4_"+SALES_OBJID, SUPPLY_OBJID4);
}
}
},
error: function(jqxhr, status, error){
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
Swal.fire(jqxhr.status);
Swal.fire(jqxhr.responseText);
}
});
}
function fn_openPartMngPopup(objId){
var url = "/partMng/partMngDetailPopUp.do?OBJID="+objId;
var target = "partMngPopUp";
window.open(url,target,"width=1100, height=700, menubars=no, scrollbars=yes, resizable=yes");
}
function fn_save(){
if(0 < $("input[name='SALES_OBJID']").length){
if(confirm("저장하시겠습니까?")){
$.ajax({
type : "POST",
url : "/salesMng/saveSalesBomExcelImport.do",
data: $("#form1").serialize(),
dataType:"json",
async:false,
error: function(jqxhr, status, error){
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
Swal.fire(jqxhr.status);
Swal.fire(jqxhr.responseText);
},
success: function(data){
alert(data.msg);
if(data.result){
opener.location.reload();
self.close();
}
}
});
}
}else{
Swal.fire("저장할 대상이 없습니다.");
}
}
//Excel 파일 업로드 후 처리함수
function setExcelFileArea(){
setUploadTemplateFile("excelImport");
}
//파트 관련 첨부파일 업로드 후 처리함수
function setPartFileArea(){
setUploadTemplateFile("partAttachFile");
}
//템플릿 업로드 후 처리
function setUploadTemplateFile(type){
var docType = "";
var deleteCallBackFN = "";
if(type == "excelImport"){
docType = "BOM_EXCEL_IMPORT_FILE";
deleteCallBackFN = "excelFileDelete";
}else{
$("#partAttachFileArea").empty();
docType = "PART_IMPORT_ATTACH";
deleteCallBackFN = "setPartFileArea";
}
$.ajax({
url:"/common/getFileList.do",
type:"POST",
data:{"targetObjId":"${EXCEL_IMPORT_OBJID}", "docType":docType},
dataType:"json",
async:false,
success:function(data){
if(null != data && 0 < data.length){
if("PART_IMPORT_ATTACH" == docType){
$("#defaultPartAttachFileRow").hide();
}
$("#"+type+"List").show();
}
$.each(data, function(i){
var s = "<tr>";
if("PART_IMPORT_ATTACH" == docType){
s += "<td>"+(i+1)+"</td>";
}
s += "<td colspan='2'><a href='javascript:fnc_downloadFile(\""+data[i].OBJID+"\")'>"+data[i].REAL_FILE_NAME+"</a></td>";
/* s += "<td>"+data[i].FILE_SIZE+"</td>"; */
s += "<td><div class='delete_btn' onclick='javascript:fnc_deleteFile(\""+data[i].OBJID+"\", \""+deleteCallBackFN+"\")'></div></td>";
s += "</tr>";
$("#"+type+"Area").append(s);
});
if(type == "excelImport"){
parsingExcelFile();
}
},
error: function(jqxhr, status, error){
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
Swal.fire(jqxhr.status);
Swal.fire(jqxhr.responseText);
}
});
}
function excelFileDelete(){
$("#excelImportArea").empty();
$("#excelImportList").hide();
$("#parsingPartList").empty();
$("#defaultExcelTemplateRow").show();
}
//파일을 삭제한다.
//Excel 파일 삭제 시 파트 첨부파일도 모두 삭제한다.
function fileDelete(){
if(confirm("Excel 파일을 변경하시겠습니까? 이미 Part 첨부파일이 첨부된 경우 파일은 삭제됩니다.")){
$.ajax({
url:"/common/deleteFileInfo.do",
type:"POST",
data:{"targetObjId":"${EXCEL_IMPORT_OBJID}"},
dataType:"json",
async:true,
success:function(data){
excelFileDelete();
},
error: function(jqxhr, status, error){
Swal.fire(jqxhr.statusText + ", " + status + ", " + error);
Swal.fire(jqxhr.status);
Swal.fire(jqxhr.responseText);
}
});
}
}
</script>
</head>
<body>
<form name="form1" id="form1" action="" method="post">
<input type="hidden" name="EXCEL_IMPORT_OBJID" id="EXCEL_IMPORT_OBJID" value="${EXCEL_IMPORT_OBJID}">
<input type="hidden" name="OBJID" id="OBJID" value="${param.OBJID }">
<input type="hidden" name="PARENT_OBJID" id="PARENT_OBJID" value="${param.PARENT_OBJID}">
<input type="hidden" name="objId" id="objId" value="${param.OBJID }">
<input type="hidden" name="parent_objId" id="parent_objId" value="${param.PARENT_OBJID}">
<input type="hidden" name="actionType" id="actionType" value="">
<section>
<div class="plm_menu_name">
<h2><span>구매 BOM 추가정보 Excel upload</span></h2>
</div>
</section>
<div style=" margin: 0 8px;">
<div id="partExcelPopupFormWrap">
<div class="form_popup_title" style="position:relative;">
<span style="position:absolute; top:0px; right:10px; cursor:pointer;">
</span>
</div>
<div id="excelUploadPopupForm">
<div class="fileDnDWrap">
<div id="excelImportDropZone" class="dropzone" style="height:50px;">Drag & Drop 엑셀 템플릿</div>
<div class="btn_wrap">
<div class="plm_btn_wrap" style="padding:0 8 0 8; text-align: right;">
<input type="button" class="plm_btns" value="저장" id="btnRegist" onclick="fn_save();">
<input type="button" class="plm_btns" value="닫기" onclick="window.close();" >
<input type="button" class="plm_btns" value="Template Download" id="templateDownload" onclick="fn_templateDownload();">
</div>
</div>
<div class="in_table_scroll_wrap _table1" style="height:31px;width:99.4%;">
<table id="structurePopupTableHead" class="plm_table">
<colgroup>
<col width="120px" /> <!-- 표면처리 -->
<col width="120px" /> <!-- 중량 -->
<col width="50px" /> <!-- 단위 -->
<col width="80px" /> <!-- 단위 -->
<col width="80px" /> <!-- 단위 -->
<col width="80px" /> <!-- 단위 -->
<col width="60px" /> <!-- 단위 -->
<col width="80px" /> <!-- 단위 -->
<col width="60px" /> <!-- 단위 -->
<col width="80px" /> <!-- 단위 -->
<col width="60px" /> <!-- 단위 -->
<col width="80px" /> <!-- 단위 -->
<col width="60px" /> <!-- 단위 -->
<col width="80px" /> <!-- 단위 -->
<col width="60px" /> <!-- 단위 -->
<col width="80px" /> <!-- 단위 -->
<col width="60px" /> <!-- 단위 -->
<col width="60px" /> <!-- 단위 -->
</colgroup>
<tr class="plm_thead">
<td>품번</td>
<td>품명</td>
<td>수량</td>
<td>사양(규격)</td>
<td>후처리</td>
<td>MAKER</td>
<td>PART 구분</td>
<td>공급업체</td>
<td>단가</td>
<td>레이져업체</td>
<td>단가</td>
<td>용접업체</td>
<td>단가</td>
<td>가공업체</td>
<td>단가</td>
<td>후처리</td>
<td>단가</td>
<td>REMARK</td>
</tr>
</table>
</div>
<div class="in_table_scroll_wrap _table2" style="height:630px; width:100%;">
<table class="plm_table" style="margin-top:0px;">
<colgroup>
<col width="120px" /> <!-- 표면처리 -->
<col width="120px" /> <!-- 중량 -->
<col width="50px" /> <!-- 단위 -->
<col width="80px" /> <!-- 단위 -->
<col width="80px" /> <!-- 단위 -->
<col width="80px" /> <!-- 단위 -->
<col width="60px" /> <!-- 단위 -->
<col width="80px" /> <!-- 단위 -->
<col width="60px" /> <!-- 단위 -->
<col width="80px" /> <!-- 단위 -->
<col width="60px" /> <!-- 단위 -->
<col width="80px" /> <!-- 단위 -->
<col width="60px" /> <!-- 단위 -->
<col width="80px" /> <!-- 단위 -->
<col width="60px" /> <!-- 단위 -->
<col width="80px" /> <!-- 단위 -->
<col width="60px" /> <!-- 단위 -->
<col width="60px" /> <!-- 단위 -->
</colgroup>
<tbody id="structureTable"></tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</form>
</body>
</html>