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
This commit is contained in:
70
WebContent/WEB-INF/view/admin/factory/factoryDetailPopup.jsp
Normal file
70
WebContent/WEB-INF/view/admin/factory/factoryDetailPopup.jsp
Normal file
@@ -0,0 +1,70 @@
|
||||
<%@ 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">
|
||||
<link rel="stylesheet" href="css/basic.css">
|
||||
<title><%=Constants.SYSTEM_NAME%></title>
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
$(document).ready(function(){
|
||||
$("#btnModify").click(function(){
|
||||
//if(confirm("Edit Mode로 이동하시겠습니까?")){
|
||||
document.form1.action = "/admin/factoryFormPopup.do";
|
||||
document.form1.submit();
|
||||
//}
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<section id="commonSection">
|
||||
<div class=admin_title>
|
||||
<h2>생산공장명 관리</h2>
|
||||
</div>
|
||||
<div id="adminPopupFormWrap">
|
||||
<form id="form1" name="form1" method="post">
|
||||
<input type="hidden" id="objId" name="objId" value="${info.OBJID}">
|
||||
<table id="adminPopupForm">
|
||||
<colgroup>
|
||||
<col width="37%" />
|
||||
<col width="63%" />
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><label>생산공장명</label></td>
|
||||
<td style="font-size:13px;" class="admin_tr_data_border_bottom">${info.FACTORY_NAME}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>활성화 여부</label></td>
|
||||
<td style="font-size:13px;" class="admin_tr_data_border_bottom">
|
||||
<c:if test="${info.STATUS eq 'active'}">
|
||||
활성화
|
||||
</c:if>
|
||||
<c:if test="${info.STATUS eq 'inActive'}">
|
||||
비활성화
|
||||
</c:if>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="adminPopupBtnWrap">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="btnCenterWrap">
|
||||
<center class="center_btns_wrap">
|
||||
<input type="button" value="Edit" class="btns" id="btnModify">
|
||||
<input type="button" value="닫기" name="" id="btn_close" class="btns" onclick="javascript:self.close();">
|
||||
</center>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
150
WebContent/WEB-INF/view/admin/factory/factoryFormPopup.jsp
Normal file
150
WebContent/WEB-INF/view/admin/factory/factoryFormPopup.jsp
Normal file
@@ -0,0 +1,150 @@
|
||||
<%@ 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(){
|
||||
$("#factoryName").focus();
|
||||
});
|
||||
|
||||
//엔터키로 조회
|
||||
$("input").keyup(function(e){
|
||||
if(e.keyCode == 13){
|
||||
fn_save();
|
||||
}
|
||||
});
|
||||
|
||||
//save
|
||||
$("#btnSave").click(function(){
|
||||
fn_save();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
//정합성체크
|
||||
function fn_validate(){
|
||||
if($("#factoryName").val() == null || $("#factoryName").val() == ""){
|
||||
Swal.fire("검사명을 입력해 주시기 바랍니다.");
|
||||
$("#factoryName").focus();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//생산공장명 저장
|
||||
function fn_save(){
|
||||
if(fn_validate()){
|
||||
if(confirm("저장하시겠습니까?")){
|
||||
if(fn_duplicateNameCheck()){
|
||||
$.ajax({
|
||||
url:"/admin/saveFactoryInfo.do",
|
||||
type:"POST",
|
||||
data:$("#form1").serialize(),
|
||||
dataType:"json",
|
||||
async:false,
|
||||
success:function(data){
|
||||
Swal.fire(data.msg);
|
||||
if(data.result == "true" || data.result == true || data.result){
|
||||
opener.fn_search();
|
||||
self.close(0);
|
||||
}
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//생산공장명 중복체크
|
||||
function fn_duplicateNameCheck(){
|
||||
var result = false;
|
||||
var factoryName = $("#factoryName").val();
|
||||
|
||||
$.ajax({
|
||||
url:"/admin/checkDuplicateFactoryName.do",
|
||||
type:"POST",
|
||||
data:{"factoryName":factoryName},
|
||||
dataType:"json",
|
||||
async:false,
|
||||
success:function(data){
|
||||
if(data.result == "false" || data.result == false || !data.result){
|
||||
Swal.fire(data.msg);
|
||||
}else{
|
||||
result = true;
|
||||
}
|
||||
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//정합성체크
|
||||
function fn_validate(){
|
||||
if($("#factoryName").val() == null || $("#factoryName").val() == ""){
|
||||
Swal.fire("생산공장을 입력해 주시기 바랍니다.");
|
||||
$("#factoryName").focus();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<section id="commonSection">
|
||||
<div class=admin_title>
|
||||
<h2>생산공장명 관리</h2>
|
||||
</div>
|
||||
<div id="adminPopupFormWrap">
|
||||
<form id="form1" name="form1" method="post">
|
||||
<input type="hidden" id="objId" name="objId" value="${info.OBJID}">
|
||||
<table id="adminPopupForm">
|
||||
<colgroup>
|
||||
<col width="37%" />
|
||||
<col width="63%" />
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><label>생산공장명</label></td>
|
||||
<td>
|
||||
<input type="text" title="생산공장명" name="factoryName" id="factoryName" value="${info.FACTORY_NAME}" maxlength="20" required>
|
||||
<input type="text" name="donottouch" id="donottouch" value="" style="display:none;"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>활성화 여부</label></td>
|
||||
<td>
|
||||
<select name="status" id="status">
|
||||
<option value="active" ${info.STATUS eq 'active'?'selected':''}>활성화</option>
|
||||
<option value="inActive" ${info.STATUS eq 'inActive'?'selected':''}>비활성화</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="adminPopupBtnWrap">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="btnCenterWrap">
|
||||
<div class="center_btns_wrap">
|
||||
<input type="button" value="저장" class="btns" id="btnSave">
|
||||
<input type="button" value="닫기" name="" id="btn_close" class="btns" onclick="javascript:self.close();">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</body>
|
||||
</html>
|
||||
224
WebContent/WEB-INF/view/admin/factory/factoryList.jsp
Normal file
224
WebContent/WEB-INF/view/admin/factory/factoryList.jsp
Normal file
@@ -0,0 +1,224 @@
|
||||
<%@ 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>
|
||||
|
||||
<!-- //JSTL 변수선언 -->
|
||||
<c:set var="totalCount" value="${empty TOTAL_COUNT?0:TOTAL_COUNT}" />
|
||||
<c:set var="maxPage" value="${empty MAX_PAGE_SIZE?1:MAX_PAGE_SIZE}" />
|
||||
<c:set var="nPage" value="${empty param.page?1:param.page}" />
|
||||
<c:set var="pageIndex" value="${(nPage-1)/10}" />
|
||||
<c:set var="nextPage" value="${empty NEXT_PAGE?1:NEXT_PAGE}" />
|
||||
<c:set var="prevPage" value="${empty PREV_PAGE?1:PREV_PAGE}" />
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function(){
|
||||
|
||||
$(document).ready(function(){
|
||||
fnc_datepick();
|
||||
});
|
||||
|
||||
// 생산공장 수정
|
||||
$(".btnModify").click(function(){
|
||||
var objId = $(this).attr("data-OBJID");
|
||||
var actionType = $(this).attr("data-actionType");
|
||||
|
||||
fnc_registFormPopup(objId, actionType);
|
||||
});
|
||||
|
||||
//엔터키로 조회
|
||||
$("input").keyup(function(e){
|
||||
if(e.keyCode == 13){
|
||||
document.form1.page.value = "1";
|
||||
fn_search();
|
||||
}
|
||||
});
|
||||
|
||||
//Form Popup
|
||||
$("#btnRegist").click(function(){
|
||||
fn_registFormPopup();
|
||||
});
|
||||
|
||||
//Detail Popup
|
||||
$(".btnDetail").click(function(){
|
||||
var objId = $(this).attr("data-OBJID");
|
||||
fn_registDetailPopup(objId);
|
||||
});
|
||||
|
||||
//change status
|
||||
$(".comboStatus").change(function(){
|
||||
var objId = $(this).attr("data-OBJID");
|
||||
var status = $(this).val();
|
||||
|
||||
fn_changeStatus(objId, status);
|
||||
});
|
||||
|
||||
//search
|
||||
$("#btnSearch").click(function(){
|
||||
document.form1.page.value = "1";
|
||||
fn_search();
|
||||
});
|
||||
});
|
||||
//조회 기능
|
||||
function fn_search(){
|
||||
document.form1.action = "/admin/factoryList.do";
|
||||
document.form1.submit();
|
||||
}
|
||||
//엑셀 기능
|
||||
function excelExport(){
|
||||
document.form1.action = "/admin/factoryList.do?actionType=excel";
|
||||
document.form1.submit();
|
||||
}
|
||||
|
||||
//생산공장명 등록 Form Popup
|
||||
function fn_registFormPopup(){
|
||||
var params = "";
|
||||
window.open("/admin/factoryFormPopup.do"+params,"factoryFormPopup","width=500,height=204");
|
||||
}
|
||||
|
||||
//생산공장명 상세 Detail Popup
|
||||
function fn_registDetailPopup(objId){
|
||||
var params = "?objId="+objId;
|
||||
window.open("/admin/factoryDetailPopup.do"+params,"factoryDetailPopup","width=500,height=204");
|
||||
}
|
||||
|
||||
//생산공장명에 대한 상태값 수정
|
||||
function fn_changeStatus(objId, status){
|
||||
$.ajax({
|
||||
url:"/admin/changeFactoryStatus.do",
|
||||
type:"POST",
|
||||
data:{"objId":objId, "status":status},
|
||||
dataType:"text",
|
||||
success:function(data){
|
||||
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<form name="form1" method="POST">
|
||||
<input type="hidden" name="actionType" id="actionType" value="" />
|
||||
<section id="commonSection" class="admin1">
|
||||
<div class="admin_title">
|
||||
<h2>생산공장 관리</h2>
|
||||
</div>
|
||||
<div id="adminFormWrap">
|
||||
<table id="adminForm">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="label"><label>생산공장명</label></td>
|
||||
<td><input type="text" id="search_factoryName" name="search_factoryName" value="${param.search_factoryName}" maxlength="16"></td>
|
||||
<td class="label"><label>상태</label></td>
|
||||
<td>
|
||||
<select id="search_status" name="search_status">
|
||||
<option value="">선택</option>
|
||||
<option value="active" ${param.search_status eq 'active'?'selected':''}>활성화</option>
|
||||
<option value="inActive" ${param.search_status eq 'inActive'?'selected':''}>비활성화</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="adminBtnWrap">
|
||||
<input type="button" value="조회" class="btns" id="btnSearch">
|
||||
<input type="button" value="생산공장명등록" class="btns" id="btnRegist">
|
||||
<input type="button" value="Excel Export" class="btns" onclick="excelExport()">
|
||||
</div>
|
||||
<div id="adminTableWrap">
|
||||
<div id="tableWrap">
|
||||
<table id="adminTable">
|
||||
<colgroup>
|
||||
<col width="4%" />
|
||||
<col width="*%" />
|
||||
<col width="20%" />
|
||||
<col width="20%" />
|
||||
<col width="20%" />
|
||||
</colgroup>
|
||||
<tr id="thead">
|
||||
<td>No</td>
|
||||
<td>생산공장명</td>
|
||||
<td>등록자</td>
|
||||
<td>등록일</td>
|
||||
<td>상태</td>
|
||||
</tr>
|
||||
<c:choose>
|
||||
<c:when test="${!empty LIST}">
|
||||
<c:forEach var="info" items="${LIST}" varStatus="status">
|
||||
<tr>
|
||||
<td>${info.RNUM}</td>
|
||||
<td><a href="#" class="btnDetail" data-OBJID="${info.OBJID}">${info.FACTORY_NAME}</a></td>
|
||||
<td>${info.WRITER_DEPT_NAME} ${info.WRITER_USER_NAME}</td>
|
||||
<td>${info.REGDATE}</td>
|
||||
<td>
|
||||
<select name="status" id="status" data-OBJID="${info.OBJID}" class="comboStatus">
|
||||
<option value="active" ${info.STATUS eq 'active'?'selected':''}>활성화</option>
|
||||
<option value="inActive" ${info.STATUS eq 'inActive'?'selected':''}>비활성화</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<td align="center" colspan="5">조회된 정보가 없습니다.</td>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pdm_page">
|
||||
<input type="hidden" name="page" id="page" value="${nPage}">
|
||||
<c:if test="${!empty LIST}">
|
||||
<div class="page_pro">
|
||||
<table>
|
||||
<tr>
|
||||
<c:choose>
|
||||
<c:when test="${nPage > 1}">
|
||||
<td><a href="javascript:fnc_goPrev('${prevPage}');">prev</a></td>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<td class="no_more_page">prev</td>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<c:forEach var="v" begin="${nPage>5?nPage-5:1}" end="${nPage>5?nPage+4:10}" step="1" varStatus="status">
|
||||
<c:if test="${status.index -1 < maxPage}">
|
||||
<c:choose>
|
||||
<c:when test="${status.index eq nPage}">
|
||||
<td><a href="#" class="now_page">${nPage}</a></td>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<td><a href="javascript:fnc_goPage('${status.index}');">${status.index}</a></td>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<c:choose>
|
||||
<c:when test="${nPage < maxPage}">
|
||||
<td><a href="javascript:fnc_goNext('${nextPage}');">next</a></td>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<td class="no_more_page">next</td>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</tr>
|
||||
</table>
|
||||
<p id="adminPageCount">총 ${totalCount}건</p>
|
||||
</div>
|
||||
</c:if>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
78
WebContent/WEB-INF/view/admin/factory/factoryListExcel.jsp
Normal file
78
WebContent/WEB-INF/view/admin/factory/factoryListExcel.jsp
Normal file
@@ -0,0 +1,78 @@
|
||||
<%@ page import="com.pms.common.utils.*"%>
|
||||
<%@ page import="java.util.*" %>
|
||||
|
||||
<%@ page isThreadSafe = "true" %>
|
||||
<%@ page buffer="256kb" %>
|
||||
<%@ page autoFlush = "true" %>
|
||||
<%@ page contentType="application/vnd.ms-excel;charset=UTF-8" %>
|
||||
|
||||
<%
|
||||
java.text.SimpleDateFormat frm= new java.text.SimpleDateFormat ("yyyy_MM_dd_HH_mm");
|
||||
Calendar cal = Calendar.getInstance();
|
||||
String todayKor = frm.format(cal.getTime());
|
||||
|
||||
String excelName = "생산공장목록";
|
||||
String encodeName = excelName+todayKor+".xls";
|
||||
String fileName = java.net.URLEncoder.encode(encodeName,"UTF-8");
|
||||
|
||||
response.setHeader("Content-Disposition", "attachment;filename="+fileName+"");
|
||||
response.setHeader("Content-Description", "JSP Generated Data");
|
||||
|
||||
ArrayList factoryList = (ArrayList)request.getAttribute("LIST");
|
||||
|
||||
%>
|
||||
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
|
||||
<head>
|
||||
<meta http-equiv=Content-Type content="text/html; charset=UTF-8">
|
||||
<meta name=ProgId content=Excel.Sheet>
|
||||
<meta name=Generator content="Microsoft Excel 11">
|
||||
<style type="text/css">
|
||||
.plm_menu_name {width:100%; background: #e7eaee; border-bottom: 1px solid #d4d4d4;}
|
||||
.plm_menu_name h2 {width:97.5%; margin: 0 auto; height:35px; color:000; font-size: 13px; line-height: 35px;}
|
||||
.plm_menu_name h2 span {height: 35px; padding-left: 23px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form name="factoryListForm" method="POST">
|
||||
<h2>생산공장관리</h2><br>
|
||||
<table border="1">
|
||||
<tr align="center" bgColor="yellow" style="font-weight:bold;">
|
||||
<td>No</td>
|
||||
<td>생산공장명</td>
|
||||
<td>등록자</td>
|
||||
<td>등록일</td>
|
||||
<td>상태</td>
|
||||
</tr>
|
||||
<%
|
||||
if(factoryList != null && factoryList.size() > 0){
|
||||
for(int i = 0 ; i < factoryList.size() ; i++){
|
||||
HashMap map = (HashMap)factoryList.get(i);
|
||||
|
||||
String factoryName = CommonUtils.checkNull(map.get("FACTORY_NAME"));
|
||||
String regDate = CommonUtils.checkNull(map.get("REGDATE"));
|
||||
String deptName = CommonUtils.checkNull(map.get("WRITER_DEPT_NAME"));
|
||||
String userName = CommonUtils.checkNull(map.get("WRITER_USER_NAME"));
|
||||
String status = CommonUtils.checkNull(map.get("STATUS_STR"));
|
||||
%>
|
||||
<tr align="center">
|
||||
<td><%=i+1%></td>
|
||||
<td><%=factoryName%></td>
|
||||
<td><%=deptName%> <%=userName%></td>
|
||||
<td><%=regDate%></td>
|
||||
<td><%=status%></td>
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
}else{
|
||||
%>
|
||||
<tr>
|
||||
<td align="center" colspan="5">조회된 정보가 없습니다.</td>
|
||||
</tr>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user