- 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
578 lines
17 KiB
Plaintext
578 lines
17 KiB
Plaintext
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
|
<%@ page import="com.pms.common.utils.*"%>
|
|
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
|
<%@ page import="java.util.*" %>
|
|
<%@include file= "/init.jsp" %>
|
|
<%
|
|
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
|
String userId = CommonUtils.checkNull(person.getUserId());
|
|
%>
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title><%=Constants.SYSTEM_NAME%></title>
|
|
</head>
|
|
<script>
|
|
$(document).ready(function(){
|
|
$("#btnClose").click(function(){
|
|
self.close(0);
|
|
});
|
|
|
|
$("#btnSave").click(function(){
|
|
fn_save();
|
|
});
|
|
|
|
$("#btnAddPrice").click(function(){
|
|
fn_addResourcePrice();
|
|
});
|
|
|
|
//품목 변경시
|
|
$("#part_objid").change(function(){
|
|
$("#part_name").val("");
|
|
$("#spec").val("");
|
|
$("#material").val("");
|
|
$("#unit").val("");
|
|
$("#weight").val("");
|
|
|
|
$("#THICKNESS").val("");
|
|
$("#WIDTH").val("");
|
|
$("#HEIGHT").val("");
|
|
$("#OUT_DIAMETER").val("");
|
|
$("#IN_DIAMETER").val("");
|
|
$("#LENGTH").val("");
|
|
|
|
if("" != this.value){
|
|
fnc_getPartInfo(this.value);
|
|
}
|
|
});
|
|
fnc_setFileDropZone("resourceMasterMngDropZone", "${resultMap.OBJID}", "RESOURCE_MASTER_MNG_FILE", "자재마스터 첨부파일", "fileAreaDraw",false,null,null);
|
|
fileAreaDraw();
|
|
_fnc_datepick();
|
|
//원단가 목록을 가져온다.
|
|
fn_getResourcePriceList();
|
|
$('.select2').select2();
|
|
});
|
|
|
|
</script>
|
|
<script>
|
|
|
|
|
|
function fnc_getPartInfo(OBJID){
|
|
if(OBJID!=""){
|
|
$.ajax({
|
|
url:"/common/getPartInfo.do",
|
|
type:"POST",
|
|
data:{"isJson":true,"OBJID":OBJID},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
resultList = data
|
|
if(0 < resultList.length){
|
|
var PART_NAME = resultList[0].PART_NAME;
|
|
var SPEC = resultList[0].SPEC;
|
|
var MATERIAL = resultList[0].MATERIAL;
|
|
var UNIT = resultList[0].UNIT;
|
|
var WEIGHT = resultList[0].WEIGHT;
|
|
$("#part_name").val(PART_NAME);
|
|
$("#spec").val(SPEC);
|
|
$("#material").val(MATERIAL);
|
|
$("#unit").val(UNIT);
|
|
$("#weight").val(WEIGHT);
|
|
$("#THICKNESS" ).val(resultList[0].THICKNESS );
|
|
$("#WIDTH" ).val(resultList[0].WIDTH );
|
|
$("#HEIGHT" ).val(resultList[0].HEIGHT );
|
|
$("#OUT_DIAMETER").val(resultList[0].OUT_DIAMETER);
|
|
$("#IN_DIAMETER" ).val(resultList[0].IN_DIAMETER );
|
|
$("#LENGTH" ).val(resultList[0].LENGTH );
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
}
|
|
|
|
function _fnc_datepick(){
|
|
var $dateinput = $("input");
|
|
|
|
for(var i=0; i<$dateinput.length; i++){
|
|
var id = $dateinput.eq(i).attr("id");
|
|
|
|
if(id != null){
|
|
if(id.indexOf("Date")>-1 || id.indexOf("date")>-1 || id.indexOf("DATE")>-1){
|
|
$dateinput.eq(i).attr("size","10");
|
|
$dateinput.eq(i).datepicker({
|
|
changeMonth:true,
|
|
changeYear:true
|
|
});
|
|
}else{
|
|
$dateinput.eq(i).attr("size","10");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function fileAreaDraw(){
|
|
fn_fileCallback2("resourceMasterMng","RESOURCE_MASTER_MNG_FILE");
|
|
}
|
|
|
|
function fn_fileCallback2(areaId,fileType){
|
|
$.ajax({
|
|
url:"/common/getFileList.do",
|
|
type:"POST",
|
|
data:{"targetObjId":"${resultMap.OBJID}", "docType":fileType},
|
|
dataType:"json",
|
|
async:false,
|
|
success:function(data){
|
|
|
|
if(0 < data.length){
|
|
|
|
//첨부파일 목록 영역 show
|
|
$("#"+areaId+"FileArea").empty();
|
|
|
|
if(0 < $("#"+areaId+"DefaultRow").length){
|
|
$("#"+areaId+"DefaultRow").hide();
|
|
}
|
|
|
|
$.each(data, function(i){
|
|
|
|
var appendText = "";
|
|
var path = data[i].FILE_PATH;
|
|
var fileName = data[i].SAVED_FILE_NAME;
|
|
var fileExt = data[i].UPPER_FILE_EXT;
|
|
appendText += "<colgroup>";
|
|
appendText +=" <col width='10%''>";
|
|
appendText +=" <col width='*'>";
|
|
appendText +=" <col width='20%'>";
|
|
appendText +=" </colgroup>";
|
|
appendText+= "<tr>";
|
|
appendText+= " <td>"+[i+1]+"</td>";
|
|
appendText+= " <td class='align_l'><a href='javascript:fnc_downloadFile(\""+data[i].OBJID+"\")'> "+data[i].REAL_FILE_NAME+"</a>";
|
|
<c:if test="${param.actionType eq 'regist' or info.WRITER eq connectUserId or 'plm_admin' eq connectUserId}">
|
|
appendText+= "<a href='javascript:fileDelete(\""+data[i].OBJID+"\",\""+areaId+"\")'><div class='delete_btn'></div></a>";
|
|
</c:if>
|
|
appendText+= "</td>";
|
|
appendText+= " <td>"+data[i].REGDATE+"</td>";
|
|
appendText+= "</tr>";
|
|
$("#"+areaId+"FileArea").append(appendText);
|
|
});
|
|
}else{
|
|
$("#"+areaId+"DropZone").show();
|
|
$("#"+areaId+"AttachFileList").hide();
|
|
$("#"+areaId+"FileArea").empty();
|
|
var appendText = "";
|
|
appendText += "<tr>";
|
|
appendText += "<td>첨부 파일이 없습니다.</td>";
|
|
appendText +="</tr>";
|
|
$("#"+areaId+"FileArea").append(appendText);
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}//파일 첨부 END
|
|
|
|
/*첨부 파일 삭제 */
|
|
function fileDelete(fileObjId,areaId){
|
|
var type =areaId;
|
|
if(confirm("파일을 삭제하시겠습니까?")){
|
|
$.ajax({
|
|
url:"/common/deleteFileInfo.do",
|
|
type:"POST",
|
|
data:{"objId":fileObjId},
|
|
dataType:"json",
|
|
async:true,
|
|
success:function(data){
|
|
fileAreaDraw();
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function fn_save(){
|
|
if(fnc_validate('form1')){
|
|
if(confirm("저장하시겠습니까?")){
|
|
$.ajax({
|
|
url:"/resourceMasterMng/saveResourceMasterMng.do",
|
|
type:"POST",
|
|
data:$("#form1").serialize(),
|
|
dataType:"json",
|
|
success:function(data){
|
|
Swal.fire(data.message);
|
|
opener.fn_search();
|
|
self.close();
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
/* if(fnc_validate('form1')){
|
|
if(0 == $("input[name=resourPriceObjId]").length){
|
|
Swal.fire("입력된 단가가 없습니다.");
|
|
return false;
|
|
}else{
|
|
if(confirm("저장하시겠습니까?")){
|
|
$.ajax({
|
|
url:"/resourceMasterMng/saveResourceMasterMng.do",
|
|
type:"POST",
|
|
data:$("#form1").serialize(),
|
|
dataType:"json",
|
|
success:function(data){
|
|
Swal.fire(data.message);
|
|
opener.fn_search();
|
|
self.close();
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
}
|
|
} */
|
|
}
|
|
|
|
function fn_getResourcePriceList(){
|
|
$.ajax({
|
|
url:"/resourceMasterMng/resourcePriceList.do",
|
|
type:"POST",
|
|
data:{"OBJID":"${resultMap.OBJID}"},
|
|
dataType:"json",
|
|
success:function(data){
|
|
var resultList = data;
|
|
|
|
if(0 < resultList.length){
|
|
$("#resourcePriceAera").empty();
|
|
|
|
var appendHtml = "";
|
|
appendHtml += "<colgroup>";
|
|
appendHtml += " <col width='6%'>";
|
|
appendHtml += " <col width='20%'>";
|
|
appendHtml += " <col width='20%'>";
|
|
appendHtml += " <col width='20%'>";
|
|
appendHtml += " <col width='15%'>";
|
|
appendHtml += " <col width='*'>";
|
|
appendHtml += "</colgroup>";
|
|
|
|
for (var i = 0; i < resultList.length; i++) {
|
|
var resourPriceObjId = resultList[i].OBJID;
|
|
var no = resultList[i].RNUM;
|
|
var unitPrice = resultList[i].UNIT_PRICE;
|
|
var personPrice = resultList[i].PERSON_PRICE;
|
|
var agencyPrice = resultList[i].AGENCY_PRICE;
|
|
var remark = resultList[i].REMARK;
|
|
var regdateTitle = resultList[i].APPLY_DATE_TITLE;
|
|
|
|
appendHtml += "<tr>";
|
|
appendHtml += " <input type='hidden' name='resourPriceObjId' value='"+resourPriceObjId+"'>";
|
|
appendHtml += " <td>"+no+"</td>";
|
|
appendHtml += " <td>"+fnc_addComma(unitPrice);+"</td>";
|
|
if(personPrice==undefined){
|
|
appendHtml += " <td>0</td>";
|
|
}else{
|
|
appendHtml += " <td>"+fnc_addComma(personPrice);+"</td>";
|
|
}
|
|
if(agencyPrice==undefined){
|
|
appendHtml += " <td>0</td>";
|
|
}else{
|
|
appendHtml += " <td>"+fnc_addComma(agencyPrice);+"</td>";
|
|
}
|
|
|
|
appendHtml += " <td>"+regdateTitle+"</td>";
|
|
appendHtml += " <td class='align_l'>"+remark+"</td>";
|
|
appendHtml += "</tr>";
|
|
|
|
}
|
|
$("#resourcePriceAera").append(appendHtml);
|
|
}else{
|
|
var appendHtml = "";
|
|
appendHtml += "<tr id='emptyRow'>";
|
|
appendHtml += " <td colspan='6'>등록된 내용이 없습니다.</td>";
|
|
appendHtml += "</tr>";
|
|
|
|
$("#resourcePriceAera").append(appendHtml);
|
|
}
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
function fn_addResourcePrice(){
|
|
|
|
var newObjectId = "";
|
|
|
|
$.ajax({
|
|
url:"/common/createObjectId.do",
|
|
type:"POST",
|
|
data:{},
|
|
dataType:"json",
|
|
success:function(data){
|
|
var resultMap = data;
|
|
|
|
if(null != resultMap){
|
|
|
|
$("#emptyRow").hide();
|
|
|
|
var no = $("input[name=resourPriceObjId]").length+1;
|
|
|
|
var appendHtml = "";
|
|
appendHtml += "<tr>";
|
|
appendHtml += " <input type='hidden' name='resourPriceObjId' value='"+resultMap.OBJID+"'>";
|
|
appendHtml += " <td>"+no+"</td>";
|
|
appendHtml += " <td><input type='number' name='UNIT_PRICE_"+resultMap.OBJID+"'></td>";
|
|
appendHtml += " <td><input type='number' name='PERSON_PRICE_"+resultMap.OBJID+"'></td>";
|
|
appendHtml += " <td><input type='number' name='AGENCY_PRICE_"+resultMap.OBJID+"'></td>";
|
|
appendHtml += " <td><input type='text' name='APPLY_DATE_"+resultMap.OBJID+"' id='applyDate_"+resultMap.OBJID+"' ></td>";
|
|
appendHtml += " <td><input type='text' name='REMARK_"+resultMap.OBJID+"'></td>";
|
|
appendHtml += "</tr>";
|
|
|
|
if(0 < $("#resourcePriceAera tr:first").length){
|
|
$("#resourcePriceAera tr:first").before(appendHtml);
|
|
}else{
|
|
$("#resourcePriceAera").append(appendHtml);
|
|
}
|
|
|
|
}
|
|
|
|
_fnc_datepick();
|
|
|
|
},
|
|
error: function(jqxhr, status, error){
|
|
}
|
|
});
|
|
}
|
|
|
|
</script>
|
|
<style>
|
|
.input_title {border-left:1px solid #ccc;}
|
|
.input_sub_title {border-left:1px solid #ccc;}
|
|
.pmsPopupForm tr:last-child td{border-bottom:1px solid #ccc;}
|
|
</style>
|
|
<body>
|
|
<form name="form1" id="form1" action="" method="post">
|
|
<input type="hidden" name="OBJID" id="OBJID" value="${resultMap.OBJID}">
|
|
<section>
|
|
<div class="plm_menu_name" style="display:flex;">
|
|
<h2>
|
|
<span>자재등록</span>
|
|
</h2>
|
|
</div>
|
|
<div id="businessPopupFormWrap">
|
|
<!-- <div class="form_popup_title"> 영업활동 등록</div> -->
|
|
<table class="pmsPopupForm">
|
|
<colgroup>
|
|
<col width="10%">
|
|
<col width="*">
|
|
<col width="10%">
|
|
<col width="*">
|
|
<col width="10%">
|
|
<col width="*">
|
|
</colgroup>
|
|
<tr>
|
|
<td class="input_title">
|
|
<!-- <label for="">명칭</label> -->
|
|
<label for="">품번</label>
|
|
</td>
|
|
<td class="input_sub_title" >
|
|
<select name="part_objid" id="part_objid" type="select" class="select2">
|
|
<option value="">선택</option>
|
|
${codeMap.PART_NO}
|
|
</select>
|
|
</td>
|
|
<td class="input_title">
|
|
<!-- <label for="">품명</label> -->
|
|
<label for="">품명</label>
|
|
</td>
|
|
<td class="input_sub_title">
|
|
<input type="text" name="part_name" id="part_name" value="${resultMap.PART_NAME}" required reqTitle="품명" >
|
|
</td>
|
|
<td class="input_title">
|
|
<label for="">규격</label>
|
|
</td>
|
|
<td class="input_sub_title" >
|
|
<input type="text" name="spec" id="spec" value="${resultMap.SPEC}" >
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title">
|
|
<!-- <label for="">중량</label> -->
|
|
<label for="">재질</label>
|
|
</td>
|
|
<td class="input_sub_title">
|
|
<input type="text" name="material" id="material" value="${resultMap.MATERIAL}" >
|
|
</td>
|
|
<td class="input_title">
|
|
<label for="">단위</label>
|
|
</td>
|
|
<td class="input_sub_title" >
|
|
<input type="text" name="unit" id="unit" value="${resultMap.UNIT}" >
|
|
</td>
|
|
<td class="input_title">
|
|
<!-- <label for="">Unit</label> -->
|
|
<label for="">중량</label>
|
|
</td>
|
|
<td class="input_sub_title">
|
|
<input type="text" name="weight" id="weight" value="${resultMap.WEIGHT}" >
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">두께</label>
|
|
</td>
|
|
<td class="input_sub_title">
|
|
<input type="text" name="THICKNESS" id="THICKNESS" value="${resultMap.THICKNESS}" >
|
|
</td>
|
|
<td class="input_title">
|
|
<label for="">가로</label>
|
|
</td>
|
|
<td class="input_sub_title" >
|
|
<input type="text" name="WIDTH" id="WIDTH" value="${resultMap.WIDTH}" >
|
|
</td>
|
|
<td class="input_title">
|
|
<label for="">세로</label>
|
|
</td>
|
|
<td class="input_sub_title">
|
|
<input type="text" name="HEIGHT" id="HEIGHT" value="${resultMap.HEIGHT}" >
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="input_title">
|
|
<label for="">외경</label>
|
|
</td>
|
|
<td class="input_sub_title">
|
|
<input type="text" name="OUT_DIAMETER" id="OUT_DIAMETER" value="${resultMap.OUT_DIAMETER}" >
|
|
</td>
|
|
<td class="input_title">
|
|
<label for="">내경</label>
|
|
</td>
|
|
<td class="input_sub_title" >
|
|
<input type="text" name="IN_DIAMETER" id="IN_DIAMETER" value="${resultMap.IN_DIAMETER}" >
|
|
</td>
|
|
<td class="input_title">
|
|
<label for="">길이</label>
|
|
</td>
|
|
<td class="input_sub_title">
|
|
<input type="text" name="LENGTH" id="LENGTH" value="${resultMap.LENGTH}" >
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div id="businessPopupFormWrap" style="margin-top:10px;">
|
|
<table class="pmsPopupForm">
|
|
<tr>
|
|
<td>
|
|
<div class="project_form_in_table"style="width:100%" id="customerMngFileAreaTable" >
|
|
<div style="overflow-y:scroll;">
|
|
<table class="" style="width:100%;">
|
|
<colgroup>
|
|
<col width="6%">
|
|
<col width="20%">
|
|
<col width="20%">
|
|
<col width="20%">
|
|
<col width="15%">
|
|
<col width="*">
|
|
</colgroup>
|
|
<thead>
|
|
<tr class="plm_thead">
|
|
<td>No</td>
|
|
<td>원단가</td>
|
|
<td>판가(개인)</td>
|
|
<td>판가(대리점)</td>
|
|
<td>등록일</td>
|
|
<td>비고</td>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
<div class="plm_scroll_table" style="height:190px;">
|
|
<table id="resourcePriceAera" class="fileListscrollTbody">
|
|
<colgroup>
|
|
<col width="6%">
|
|
<col width="20%">
|
|
<col width="20%">
|
|
<col width="20%">
|
|
<col width="15%">
|
|
<col width="*">
|
|
</colgroup>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="btn_wrap">
|
|
<div class="plm_btn_wrap" style="padding-right:9px;">
|
|
<input type="button" value="단가추가" class="plm_btns" id="btnAddPrice">
|
|
</div>
|
|
</div>
|
|
|
|
<div id="businessPopupFormWrap" style="margin-top:43px;">
|
|
<table class="pmsPopupForm">
|
|
<colgroup>
|
|
<col width="*">
|
|
</colgroup>
|
|
<tr>
|
|
<td>
|
|
<div id="resourceMasterMngDropZone" class="dropzone"style="width:99% !important;">Drag & Drop Files Here</div>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<div class="project_form_in_table"style="width:100%" id="resourceMasterMngFileAreaTable" >
|
|
<div style="overflow-y:scroll;">
|
|
<table class="" style="width:100%;">
|
|
<colgroup>
|
|
<col width="10%">
|
|
<col width="*">
|
|
<col width="20%">
|
|
</colgroup>
|
|
<thead>
|
|
<tr class="plm_thead">
|
|
<td>No</td>
|
|
<td>첨부파일명</td>
|
|
<td>등록일</td>
|
|
</tr>
|
|
</thead>
|
|
</table>
|
|
</div>
|
|
<div class="plm_scroll_table" style="height:75px;">
|
|
<table class="plm_table">
|
|
<colgroup>
|
|
<col width="10%">
|
|
<col width="*">
|
|
<col width="20%">
|
|
</colgroup>
|
|
</table>
|
|
<table id="resourceMasterMngFileArea" class="fileListscrollTbody">
|
|
<tr>
|
|
<td colspan="3">첨부 파일이 없습니다.</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="btn_wrap">
|
|
<div class="plm_btn_wrap_center">
|
|
<c:choose>
|
|
<c:when test="${resultMap.WRITER eq connectUserId or param.actionType eq 'regist' or 'plm_admin' eq connectUserId}">
|
|
<input type="button" value="저장" id="btnSave" class="plm_btns create">
|
|
</c:when>
|
|
<c:otherwise></c:otherwise>
|
|
</c:choose>
|
|
<input type="button" value="닫기" id="btnClose" class="plm_btns">
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</form>
|
|
</body>
|
|
</html> |