V2025120101 #99
@@ -21,6 +21,32 @@ body, html {
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
// 가공업체 목록 (OBJID -> 업체명 변환용)
|
||||
var vendorMap = {};
|
||||
|
||||
// 가공업체 목록 로드
|
||||
function loadVendorList() {
|
||||
$.ajax({
|
||||
url: '/common/getClientMngList.do',
|
||||
method: 'POST',
|
||||
async: false,
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
if(data && data.length > 0) {
|
||||
data.forEach(function(item) {
|
||||
vendorMap[item.CODE_ID] = item.NAME;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// OBJID를 업체명으로 변환
|
||||
function getVendorName(objid) {
|
||||
if(!objid) return '';
|
||||
return vendorMap[objid] || objid;
|
||||
}
|
||||
|
||||
// confirm/alert 헬퍼 함수
|
||||
function showConfirm(options) {
|
||||
if(typeof options === 'string') {
|
||||
@@ -50,6 +76,9 @@ $(function(){
|
||||
|
||||
$('.select2').select2();
|
||||
|
||||
// 가공업체 목록 로드
|
||||
loadVendorList();
|
||||
|
||||
// 페이지 로드 시 프로젝트 정보로 검색 필드 자동 입력
|
||||
<c:if test="${not empty info}">
|
||||
$("#search_part_no").val("${info.PART_NO}");
|
||||
@@ -610,9 +639,18 @@ function generateUpdateHistoryTable(beforeData, afterData) {
|
||||
for(var j = 0; j < fieldChanges.length; j++) {
|
||||
var fc = fieldChanges[j];
|
||||
var fieldNameKr = getFieldNameKorean(fc.field);
|
||||
|
||||
// 가공업체 필드는 OBJID를 업체명으로 변환
|
||||
var beforeVal = fc.before;
|
||||
var afterVal = fc.after;
|
||||
if(fc.field === 'PROCESSING_VENDOR' || fc.field === 'processingVendor') {
|
||||
beforeVal = beforeVal ? getVendorName(beforeVal) : null;
|
||||
afterVal = afterVal ? getVendorName(afterVal) : null;
|
||||
}
|
||||
|
||||
html += "<strong>" + fieldNameKr + ":</strong> ";
|
||||
html += "<span class='before-value'>" + (fc.before || "(없음)") + "</span> → ";
|
||||
html += "<span class='after-value'>" + (fc.after || "(없음)") + "</span>";
|
||||
html += "<span class='before-value'>" + (beforeVal || "(없음)") + "</span> → ";
|
||||
html += "<span class='after-value'>" + (afterVal || "(없음)") + "</span>";
|
||||
if(j < fieldChanges.length - 1) html += "<br>";
|
||||
}
|
||||
|
||||
@@ -706,7 +744,7 @@ function oldGenerateUpdateHistoryTable(beforeData, afterData) {
|
||||
html += "<td>" + (item.rawMaterialSize || "") + "</td>";
|
||||
html += "<td>" + (item.rawMaterialPartNo || "") + "</td>";
|
||||
html += "<td>" + (item.requiredQty || "") + "</td>";
|
||||
html += "<td>" + (item.processingVendor || "") + "</td>";
|
||||
html += "<td>" + (item.processingVendorName || item.processingVendor || "") + "</td>";
|
||||
html += "<td>" + (item.processingDeadline || "") + "</td>";
|
||||
html += "<td>" + (item.grindingDeadline || "") + "</td>";
|
||||
html += "<td>" + (item.orderQty || "") + "</td>";
|
||||
@@ -728,7 +766,7 @@ function oldGenerateUpdateHistoryTable(beforeData, afterData) {
|
||||
html += "<td>" + (item.rawMaterialSize || "") + "</td>";
|
||||
html += "<td>" + (item.rawMaterialPartNo || "") + "</td>";
|
||||
html += "<td>" + (item.requiredQty || "") + "</td>";
|
||||
html += "<td>" + (item.processingVendor || "") + "</td>";
|
||||
html += "<td>" + (item.processingVendorName || item.processingVendor || "") + "</td>";
|
||||
html += "<td>" + (item.processingDeadline || "") + "</td>";
|
||||
html += "<td>" + (item.grindingDeadline || "") + "</td>";
|
||||
html += "<td>" + (item.orderQty || "") + "</td>";
|
||||
@@ -755,7 +793,7 @@ function oldGenerateUpdateHistoryTable(beforeData, afterData) {
|
||||
html += "<td" + (changedFields['rawMaterialSize'] ? " class='field-changed'" : "") + ">" + (mod.after.rawMaterialSize || "") + "</td>";
|
||||
html += "<td" + (changedFields['rawMaterialPartNo'] ? " class='field-changed'" : "") + ">" + (mod.after.rawMaterialPartNo || "") + "</td>";
|
||||
html += "<td" + (changedFields['requiredQty'] ? " class='field-changed'" : "") + ">" + (mod.after.requiredQty || "") + "</td>";
|
||||
html += "<td" + (changedFields['processingVendor'] ? " class='field-changed'" : "") + ">" + (mod.after.processingVendor || "") + "</td>";
|
||||
html += "<td" + (changedFields['processingVendor'] ? " class='field-changed'" : "") + ">" + (mod.after.processingVendorName || mod.after.processingVendor || "") + "</td>";
|
||||
html += "<td" + (changedFields['processingDeadline'] ? " class='field-changed'" : "") + ">" + (mod.after.processingDeadline || "") + "</td>";
|
||||
html += "<td" + (changedFields['grindingDeadline'] ? " class='field-changed'" : "") + ">" + (mod.after.grindingDeadline || "") + "</td>";
|
||||
html += "<td" + (changedFields['orderQty'] ? " class='field-changed'" : "") + ">" + (mod.after.orderQty || "") + "</td>";
|
||||
|
||||
@@ -137,11 +137,11 @@ function fn_loadSupplyVendorList() {
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
if(data && data.length > 0) {
|
||||
// {id: CODE_NAME, text: CODE_NAME} 형태로 변환 (Select2용)
|
||||
// {id: CODE_ID(OBJID), text: NAME(CLIENT_NM)} 형태로 변환
|
||||
supplyVendorList = data.map(function(item) {
|
||||
return {
|
||||
id: item.CODE_NAME,
|
||||
text: item.CODE_NAME
|
||||
id: item.CODE_ID,
|
||||
text: item.NAME
|
||||
};
|
||||
});
|
||||
console.log("가공업체 목록 로드 완료:", supplyVendorList.length + "개");
|
||||
@@ -172,13 +172,13 @@ function createSelect2Editor(options) {
|
||||
options.forEach(function(opt) {
|
||||
var option = document.createElement("option");
|
||||
if(typeof opt === 'object') {
|
||||
option.value = opt.id || opt.value || opt;
|
||||
option.text = opt.text || opt.label || opt;
|
||||
option.value = opt.id || opt.value || '';
|
||||
option.text = opt.text || opt.label || '';
|
||||
} else {
|
||||
option.value = opt;
|
||||
option.text = opt;
|
||||
}
|
||||
if(option.value === cellValue) {
|
||||
if(option.value == cellValue) {
|
||||
option.selected = true;
|
||||
}
|
||||
select.appendChild(option);
|
||||
@@ -192,7 +192,13 @@ function createSelect2Editor(options) {
|
||||
dropdownAutoWidth: true,
|
||||
placeholder: '선택',
|
||||
allowClear: true,
|
||||
dropdownParent: $('body') // 드롭다운이 셀 밖으로 나오도록
|
||||
dropdownParent: $('body'), // 드롭다운이 셀 밖으로 나오도록
|
||||
templateResult: function(data) {
|
||||
return data.text;
|
||||
},
|
||||
templateSelection: function(data) {
|
||||
return data.text;
|
||||
}
|
||||
});
|
||||
|
||||
$(select).on('select2:select select2:clear', function(e) {
|
||||
@@ -647,6 +653,23 @@ function fn_initGrid() {
|
||||
editor: function(cell, onRendered, success, cancel, editorParams) {
|
||||
// 가공업체 목록 Select2 에디터
|
||||
return createSelect2Editor(supplyVendorList)(cell, onRendered, success, cancel, editorParams);
|
||||
},
|
||||
formatter: function(cell) {
|
||||
var value = cell.getValue();
|
||||
|
||||
// 저장된 값이 없으면 기본값 '5001'(RPS) 설정
|
||||
if(value === undefined || value === null || value === '') {
|
||||
value = '5001';
|
||||
cell.getRow().update({PROCESSING_VENDOR: value}, false);
|
||||
}
|
||||
|
||||
// OBJID로 업체명 조회하여 표시
|
||||
for(var i = 0; i < supplyVendorList.length; i++) {
|
||||
if(supplyVendorList[i].id == value) {
|
||||
return supplyVendorList[i].text;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
},
|
||||
/* 주석처리: 가공납기, 연삭납기 컬럼
|
||||
|
||||
377
WebContent/WEB-INF/view/productionplanning/prodPlanFormPopup.jsp
Normal file
377
WebContent/WEB-INF/view/productionplanning/prodPlanFormPopup.jsp
Normal file
@@ -0,0 +1,377 @@
|
||||
<%@ 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"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ page import="java.util.*" %>
|
||||
<%@include file= "/init_new.jsp" %>
|
||||
<%
|
||||
Map info = (HashMap)(request.getAttribute("resultMap"));
|
||||
String actionType = (String)request.getAttribute("actionType");
|
||||
boolean isNew = "regist".equals(actionType);
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title><%=Constants.SYSTEM_NAME%></title>
|
||||
<style>
|
||||
.input_title {border-left:1px solid #ccc; background-color:#f5f5f5;}
|
||||
.input_sub_title {border-left:1px solid #ccc;}
|
||||
.pmsPopupForm tr:last-child td{border-bottom:1px solid #ccc;}
|
||||
.required-mark { color: red; font-weight: bold; margin-left: 2px; }
|
||||
.pmsPopupForm td { padding: 5px 8px; }
|
||||
.pmsPopupForm input[type="text"],
|
||||
.pmsPopupForm input[type="number"] {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.readonly-field {
|
||||
background-color: #eee !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<script>
|
||||
$(function(){
|
||||
fnc_datepick();
|
||||
$(".select2").select2();
|
||||
|
||||
// 저장 버튼
|
||||
$("#btnSave").click(function(){
|
||||
fn_save();
|
||||
});
|
||||
|
||||
// 프로젝트번호 변경 시 관련 정보 자동 로드 (Select2 이벤트)
|
||||
$("#PROJECT_NO").on("change select2:select", function(){
|
||||
var projectObjid = $(this).val();
|
||||
console.log("프로젝트번호 변경됨:", projectObjid);
|
||||
if(fnc_checkNull(projectObjid) != ""){
|
||||
fn_loadProjectInfo(projectObjid);
|
||||
} else {
|
||||
fn_clearProjectInfo();
|
||||
}
|
||||
});
|
||||
|
||||
// 수주수량, 추가생산수량 변경 시 총생산수량 자동 계산
|
||||
$("#ORDER_QTY, #EXTRA_PROD_QTY").on("input change", function(){
|
||||
fn_calcTotalQty();
|
||||
});
|
||||
|
||||
// 초기 데이터 로드
|
||||
<% if(!isNew && info != null) { %>
|
||||
// 수정 모드: 기존 데이터 표시
|
||||
fn_loadExistingData();
|
||||
<% } else { %>
|
||||
// 신규 등록: 프로젝트가 선택된 경우 정보 자동 로드
|
||||
var projectObjid = "${projectObjid}";
|
||||
if(fnc_checkNull(projectObjid) != ""){
|
||||
// Select2 초기화 후 값 설정 및 change 이벤트 발생
|
||||
setTimeout(function(){
|
||||
$("#PROJECT_NO").val(projectObjid).trigger("change");
|
||||
}, 100);
|
||||
}
|
||||
<% } %>
|
||||
});
|
||||
|
||||
// 날짜 선택기 초기화
|
||||
function fnc_datepick(){
|
||||
var $dateinput = $("input.date_icon");
|
||||
for(var i=0; i<$dateinput.length; i++){
|
||||
$dateinput.eq(i).attr("size","10");
|
||||
$dateinput.eq(i).datepicker({
|
||||
changeMonth:true,
|
||||
changeYear:true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 프로젝트 정보 로드
|
||||
function fn_loadProjectInfo(projectObjid){
|
||||
console.log("fn_loadProjectInfo 호출, projectObjid:", projectObjid);
|
||||
|
||||
$.ajax({
|
||||
url: "/productionplanning/getProdPlanProjectInfo.do",
|
||||
type: "POST",
|
||||
data: { "projectObjid": projectObjid },
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(data){
|
||||
console.log("프로젝트 정보 응답:", data);
|
||||
|
||||
if(data && data.result == "success" && data.info){
|
||||
var info = data.info;
|
||||
console.log("프로젝트 정보:", info);
|
||||
|
||||
// 제품구분 (소문자 키)
|
||||
if(fnc_checkNull(info.product_code) != ""){
|
||||
console.log("제품구분 설정:", info.product_code);
|
||||
$("#PRODUCT_CODE").val(info.product_code).trigger("change.select2");
|
||||
}
|
||||
|
||||
// 주문유형
|
||||
if(fnc_checkNull(info.category_code) != ""){
|
||||
console.log("주문유형 설정:", info.category_code);
|
||||
$("#CATEGORY_CODE").val(info.category_code).trigger("change.select2");
|
||||
}
|
||||
|
||||
// 고객사 (C_ 접두어 제거)
|
||||
if(fnc_checkNull(info.customer_objid) != ""){
|
||||
var customerObjid = info.customer_objid.replace("C_", "");
|
||||
console.log("고객사 설정:", customerObjid);
|
||||
$("#CUSTOMER_OBJID").val(customerObjid).trigger("change.select2");
|
||||
}
|
||||
|
||||
// 품번
|
||||
$("#PART_NO").val(fnc_checkNull(info.part_no));
|
||||
|
||||
// 품명
|
||||
$("#PART_NAME").val(fnc_checkNull(info.part_name));
|
||||
|
||||
// 요청납기
|
||||
$("#REQ_DEL_DATE").val(fnc_checkNull(info.req_del_date));
|
||||
|
||||
// S/N
|
||||
$("#SERIAL_NO").val(fnc_checkNull(info.serial_no));
|
||||
|
||||
// 수주수량
|
||||
$("#ORDER_QTY").val(fnc_checkNull(info.order_qty) || 0);
|
||||
|
||||
// 고객사 요청사항
|
||||
$("#CUSTOMER_REQUEST").val(fnc_checkNull(info.customer_request));
|
||||
|
||||
// 총생산수량 계산
|
||||
fn_calcTotalQty();
|
||||
} else {
|
||||
console.log("프로젝트 정보가 없음 또는 조회 실패");
|
||||
}
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
console.error("프로젝트 정보 로드 실패:", error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 프로젝트 정보 초기화
|
||||
function fn_clearProjectInfo(){
|
||||
$("#PRODUCT_CODE").val("").trigger("change");
|
||||
$("#CATEGORY_CODE").val("").trigger("change");
|
||||
$("#CUSTOMER_OBJID").val("").trigger("change");
|
||||
$("#PART_NO").val("");
|
||||
$("#PART_NAME").val("");
|
||||
$("#REQ_DEL_DATE").val("");
|
||||
$("#SERIAL_NO").val("");
|
||||
$("#ORDER_QTY").val("");
|
||||
$("#CUSTOMER_REQUEST").val("");
|
||||
$("#TOTAL_PROD_QTY").val("");
|
||||
}
|
||||
|
||||
// 기존 데이터 로드 (수정 모드)
|
||||
function fn_loadExistingData(){
|
||||
// JSP EL로 기존 데이터 설정
|
||||
<% if(info != null) { %>
|
||||
$("#PRODUCT_CODE").val("${resultMap.PRODUCT_CODE}").trigger("change");
|
||||
$("#CATEGORY_CODE").val("${resultMap.CATEGORY_CODE}").trigger("change");
|
||||
$("#CUSTOMER_OBJID").val("${resultMap.CUSTOMER_OBJID}").trigger("change");
|
||||
fn_calcTotalQty();
|
||||
<% } %>
|
||||
}
|
||||
|
||||
// 총생산수량 계산
|
||||
function fn_calcTotalQty(){
|
||||
var orderQty = parseInt($("#ORDER_QTY").val()) || 0;
|
||||
var extraQty = parseInt($("#EXTRA_PROD_QTY").val()) || 0;
|
||||
$("#TOTAL_PROD_QTY").val(orderQty + extraQty);
|
||||
}
|
||||
|
||||
// 저장
|
||||
function fn_save(){
|
||||
// 필수값 검증
|
||||
if(fnc_checkNull($("#PRODUCT_CODE").val()) == ""){
|
||||
Swal.fire("제품구분을 선택해주세요.");
|
||||
$("#PRODUCT_CODE").focus();
|
||||
return;
|
||||
}
|
||||
if(fnc_checkNull($("#CATEGORY_CODE").val()) == ""){
|
||||
Swal.fire("주문유형을 선택해주세요.");
|
||||
$("#CATEGORY_CODE").focus();
|
||||
return;
|
||||
}
|
||||
if(fnc_checkNull($("#PRODUCTION_TYPE").val()) == ""){
|
||||
Swal.fire("생산유형을 선택해주세요.");
|
||||
$("#PRODUCTION_TYPE").focus();
|
||||
return;
|
||||
}
|
||||
if(fnc_checkNull($("#CUSTOMER_OBJID").val()) == ""){
|
||||
Swal.fire("고객사를 선택해주세요.");
|
||||
$("#CUSTOMER_OBJID").focus();
|
||||
return;
|
||||
}
|
||||
if(fnc_checkNull($("#REQ_DEL_DATE").val()) == ""){
|
||||
Swal.fire("요청납기를 입력해주세요.");
|
||||
$("#REQ_DEL_DATE").focus();
|
||||
return;
|
||||
}
|
||||
if(fnc_checkNull($("#PART_NO").val()) == ""){
|
||||
Swal.fire("품번을 입력해주세요.");
|
||||
$("#PART_NO").focus();
|
||||
return;
|
||||
}
|
||||
if(fnc_checkNull($("#PART_NAME").val()) == ""){
|
||||
Swal.fire("품명을 입력해주세요.");
|
||||
$("#PART_NAME").focus();
|
||||
return;
|
||||
}
|
||||
var orderQty = parseInt($("#ORDER_QTY").val()) || 0;
|
||||
if(orderQty <= 0){
|
||||
Swal.fire("수주수량을 입력해주세요.");
|
||||
$("#ORDER_QTY").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if(confirm("저장하시겠습니까?")){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/productionplanning/saveProdPlan.do",
|
||||
data: $("#form1").serialize(),
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
if(data.result == "success"){
|
||||
alert(data.msg || "저장되었습니다.");
|
||||
if(typeof opener.fn_search == "function"){
|
||||
opener.fn_search();
|
||||
}
|
||||
self.close();
|
||||
} else {
|
||||
Swal.fire(data.msg || "저장에 실패했습니다.");
|
||||
}
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
Swal.fire("저장 중 오류가 발생했습니다.");
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<body>
|
||||
<form name="form1" id="form1" method="post">
|
||||
<input type="hidden" name="OBJID" id="OBJID" value="${resultMap.OBJID}">
|
||||
<input type="hidden" name="PROJECT_OBJID" id="PROJECT_OBJID" value="${resultMap.PROJECT_OBJID}">
|
||||
<input type="hidden" name="actionType" id="actionType" value="${actionType}">
|
||||
|
||||
<section>
|
||||
<div class="plm_menu_name" style="display:flex;">
|
||||
<h2 style="width:100%;height:60px;text-align:center;margin-top:10px;">
|
||||
<span style="font-size:24px;">생산계획 생성</span>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div id="businessPopupFormWrap" style="z-index:99; padding:10px;">
|
||||
<table class="pmsPopupForm" style="z-index:99; width:100%;">
|
||||
<colgroup>
|
||||
<col width="12%">
|
||||
<col width="21%">
|
||||
<col width="12%">
|
||||
<col width="21%">
|
||||
<col width="12%">
|
||||
<col width="22%">
|
||||
</colgroup>
|
||||
|
||||
<!-- 1행: 프로젝트번호, 제품구분, 주문유형 -->
|
||||
<tr>
|
||||
<td class="input_title"><label>프로젝트번호</label></td>
|
||||
<td>
|
||||
<select name="PROJECT_NO" id="PROJECT_NO" class="select2" style="width:100%;">
|
||||
<option value="">선택</option>
|
||||
${code_map.project_no}
|
||||
</select>
|
||||
</td>
|
||||
<td class="input_title"><label>제품구분<span class="required-mark">*</span></label></td>
|
||||
<td>
|
||||
<select name="PRODUCT_CODE" id="PRODUCT_CODE" class="select2" style="width:100%;">
|
||||
<option value="">선택</option>
|
||||
${code_map.product_cd}
|
||||
</select>
|
||||
</td>
|
||||
<td class="input_title"><label>주문유형<span class="required-mark">*</span></label></td>
|
||||
<td>
|
||||
<select name="CATEGORY_CODE" id="CATEGORY_CODE" class="select2" style="width:100%;">
|
||||
<option value="">선택</option>
|
||||
${code_map.category_cd}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 2행: 생산유형, 고객사, 요청납기 -->
|
||||
<tr>
|
||||
<td class="input_title"><label>생산유형<span class="required-mark">*</span></label></td>
|
||||
<td>
|
||||
<select name="PRODUCTION_TYPE" id="PRODUCTION_TYPE" class="select2" style="width:100%;">
|
||||
<option value="">선택</option>
|
||||
${code_map.production_type_cd}
|
||||
</select>
|
||||
</td>
|
||||
<td class="input_title"><label>고객사<span class="required-mark">*</span></label></td>
|
||||
<td>
|
||||
<select name="CUSTOMER_OBJID" id="CUSTOMER_OBJID" class="select2" style="width:100%;">
|
||||
<option value="">선택</option>
|
||||
${code_map.customer_cd}
|
||||
</select>
|
||||
</td>
|
||||
<td class="input_title"><label>요청납기<span class="required-mark">*</span></label></td>
|
||||
<td>
|
||||
<input type="text" name="REQ_DEL_DATE" id="REQ_DEL_DATE" class="date_icon" value="${resultMap.REQ_DEL_DATE}">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 3행: 품번, 품명, S/N -->
|
||||
<tr>
|
||||
<td class="input_title"><label>품번<span class="required-mark">*</span></label></td>
|
||||
<td>
|
||||
<input type="text" name="PART_NO" id="PART_NO" value="${resultMap.PART_NO}">
|
||||
</td>
|
||||
<td class="input_title"><label>품명<span class="required-mark">*</span></label></td>
|
||||
<td>
|
||||
<input type="text" name="PART_NAME" id="PART_NAME" value="${resultMap.PART_NAME}">
|
||||
</td>
|
||||
<td class="input_title"><label>S/N</label></td>
|
||||
<td>
|
||||
<input type="text" name="SERIAL_NO" id="SERIAL_NO" value="${resultMap.SERIAL_NO}">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 4행: 수주수량, 추가생산수량, 총생산수량 -->
|
||||
<tr>
|
||||
<td class="input_title"><label>수주수량<span class="required-mark">*</span></label></td>
|
||||
<td>
|
||||
<input type="number" name="ORDER_QTY" id="ORDER_QTY" min="0" value="${resultMap.ORDER_QTY}">
|
||||
</td>
|
||||
<td class="input_title"><label>추가생산수량</label></td>
|
||||
<td>
|
||||
<input type="number" name="EXTRA_PROD_QTY" id="EXTRA_PROD_QTY" min="0" value="${resultMap.EXTRA_PROD_QTY}" placeholder="0">
|
||||
</td>
|
||||
<td class="input_title"><label>총생산수량</label></td>
|
||||
<td>
|
||||
<input type="text" name="TOTAL_PROD_QTY" id="TOTAL_PROD_QTY" class="readonly-field" readonly value="${resultMap.TOTAL_PROD_QTY}">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 5행: 고객사 요청사항 -->
|
||||
<tr>
|
||||
<td class="input_title"><label>고객사 요청사항</label></td>
|
||||
<td colspan="5">
|
||||
<input type="text" name="CUSTOMER_REQUEST" id="CUSTOMER_REQUEST" value="${resultMap.CUSTOMER_REQUEST}" style="width:100%;">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn_wrap">
|
||||
<div class="plm_btn_wrap" style="padding:10px; text-align:center;">
|
||||
<input type="button" value="저장" class="plm_btns" id="btnSave">
|
||||
<input type="button" value="닫기" class="plm_btns" onclick="window.close();">
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,510 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ page import="com.pms.common.utils.*"%>
|
||||
<%@ page import="java.util.*" %>
|
||||
<%@include file= "/init.jsp" %>
|
||||
<c:set var="now" value="<%=new java.util.Date() %>"/>
|
||||
<c:set var="sysYear"><fmt:formatDate value="${now}" pattern="yyyy" /></c:set>
|
||||
<%
|
||||
// DB에서 메뉴명 조회 (공통 유틸 사용)
|
||||
String menuObjId = request.getParameter("menuObjId");
|
||||
String menuName = CommonUtils.getMenuName(menuObjId, "생산계획&실적 관리");
|
||||
%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title><%=Constants.SYSTEM_NAME%></title>
|
||||
<style>
|
||||
body, html {
|
||||
overflow-x: hidden;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
.select2-selection__choice {
|
||||
font-size: 11px;
|
||||
background-color: #fff !important;
|
||||
border: none !important;
|
||||
margin-right: 0px !important;
|
||||
}
|
||||
.select2-selection__choice__remove {
|
||||
display: contents !important;
|
||||
}
|
||||
.select2-container .select2-selection--multiple {
|
||||
min-height: 20px !important;
|
||||
}
|
||||
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
||||
margin-top: 3.5px !important;
|
||||
}
|
||||
.select2-selection__rendered {
|
||||
height: 18px !important;
|
||||
}
|
||||
.select2-container .select2-selection--multiple .select2-selection__rendered {
|
||||
overflow: auto !important;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script type="text/javascript">
|
||||
// Tabulator 그리드 전역 변수
|
||||
var _tabulGrid;
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
_fnc_datepick(); // 날짜 선택기 초기화
|
||||
$('.select2').select2(); // select2 초기화
|
||||
|
||||
// 품번/품명 Select2 AJAX 초기화
|
||||
initPartSelect2Ajax("#search_part_no", "#search_part_name", "#search_part_objid");
|
||||
|
||||
// Enter 키로 검색
|
||||
$("#plmSearchZon input").keyup(function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
fn_search();
|
||||
}
|
||||
});
|
||||
|
||||
// 조회 버튼
|
||||
$("#btnSearch").click(function(){
|
||||
fn_search();
|
||||
});
|
||||
|
||||
// 생산계획 생성 버튼
|
||||
$("#btnCreateProdPlan").click(function(){
|
||||
fn_createProdPlan();
|
||||
});
|
||||
|
||||
// 작업지시 생성 버튼
|
||||
$("#btnCreateWorkOrder").click(function(){
|
||||
fn_createWorkOrder();
|
||||
});
|
||||
|
||||
// 생산실적 등록 버튼
|
||||
$("#btnRegistProdResult").click(function(){
|
||||
fn_registProdResult();
|
||||
});
|
||||
|
||||
// 초기 조회
|
||||
fn_search();
|
||||
});
|
||||
|
||||
// 날짜 선택기 초기화 함수
|
||||
function _fnc_datepick(){
|
||||
var $dateinput = $("input.date_icon");
|
||||
for(var i=0; i<$dateinput.length; i++){
|
||||
$dateinput.eq(i).attr("size","10");
|
||||
$dateinput.eq(i).datepicker({
|
||||
changeMonth:true,
|
||||
changeYear:true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 그리드 컬럼 정의
|
||||
var columns = [
|
||||
{title:'OBJID', field:'OBJID', visible: false, frozen: true},
|
||||
{title:'PROD_PLAN_OBJID', field:'PROD_PLAN_OBJID', visible: false, frozen: true},
|
||||
|
||||
// 2. 프로젝트번호
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'left',
|
||||
width: 130,
|
||||
title: '프로젝트번호',
|
||||
field: 'PROJECT_NO',
|
||||
frozen: true,
|
||||
formatter: fnc_createGridAnchorTag,
|
||||
cellClick: function(e, cell){
|
||||
var orderNo = cell.getData().PROJECT_NO;
|
||||
// 프로젝트 번호 클릭 시: 결재 정보 조회 모드 (saleNo에 "detail" 전달)
|
||||
fn_openSaleRegPopup(orderNo, "detail");
|
||||
}
|
||||
},
|
||||
|
||||
// 3. 제품구분
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'center',
|
||||
width: 80,
|
||||
title: '제품구분',
|
||||
field: 'PRODUCT_NAME'
|
||||
},
|
||||
|
||||
// 4. 주문유형
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'center',
|
||||
width: 80,
|
||||
title: '주문유형',
|
||||
field: 'CATEGORY_CODE'
|
||||
},
|
||||
|
||||
// 5. 생산유형
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'center',
|
||||
width: 80,
|
||||
title: '생산유형',
|
||||
field: 'PRODUCTION_TYPE_NAME'
|
||||
},
|
||||
|
||||
// 6. 고객사
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'left',
|
||||
width: 150,
|
||||
title: '고객사',
|
||||
field: 'CUSTOMER_NAME'
|
||||
},
|
||||
|
||||
// 7. 요청납기
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'center',
|
||||
width: 90,
|
||||
title: '요청납기',
|
||||
field: 'REQ_DEL_DATE'
|
||||
},
|
||||
|
||||
// 8. 고객사요청사항
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'left',
|
||||
width: 180,
|
||||
title: '고객사요청사항',
|
||||
field: 'CUSTOMER_REQUEST'
|
||||
},
|
||||
|
||||
// 9. 품번
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'left',
|
||||
width: 150,
|
||||
title: '품번',
|
||||
field: 'PART_NO'
|
||||
},
|
||||
|
||||
// 10. 품명
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'left',
|
||||
width: 180,
|
||||
title: '품명',
|
||||
field: 'PART_NAME'
|
||||
},
|
||||
|
||||
// 11. S/N
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'center',
|
||||
width: 80,
|
||||
title: 'S/N',
|
||||
field: 'SERIAL_NO'
|
||||
},
|
||||
|
||||
// 12. 수주수량
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'right',
|
||||
width: 80,
|
||||
title: '수주수량',
|
||||
field: 'QUANTITY',
|
||||
formatter: "money",
|
||||
formatterParams: {thousand: ",", precision: false}
|
||||
},
|
||||
|
||||
// 13. 추가생산수량
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'right',
|
||||
width: 100,
|
||||
title: '추가생산수량',
|
||||
field: 'EXTRA_PROD_QTY',
|
||||
formatter: "money",
|
||||
formatterParams: {thousand: ",", precision: false}
|
||||
},
|
||||
|
||||
// 14. 총생산수량 (수주수량 + 추가생산수량)
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'right',
|
||||
width: 100,
|
||||
title: '총생산수량',
|
||||
field: 'TOTAL_PROD_QTY',
|
||||
formatter: "money",
|
||||
formatterParams: {thousand: ",", precision: false}
|
||||
},
|
||||
|
||||
// 15. 완조립
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'right',
|
||||
width: 80,
|
||||
title: '완조립',
|
||||
field: 'ASSEMBLY_QTY',
|
||||
formatter:fnc_createGridAnchorTag,
|
||||
cellClick: function(e, cell) {
|
||||
if(cell.getValue() > 0) {
|
||||
fn_openQtyDetailPopup(cell.getData().OBJID, 'ASSEMBLY');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 16. 검사
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'right',
|
||||
width: 70,
|
||||
title: '검사',
|
||||
field: 'INSPECTION_QTY',
|
||||
formatter:fnc_createGridAnchorTag,
|
||||
cellClick: function(e, cell) {
|
||||
if(cell.getValue() > 0) {
|
||||
fn_openQtyDetailPopup(cell.getData().OBJID, 'INSPECTION');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 17. 출하대기
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'right',
|
||||
width: 90,
|
||||
title: '출하대기',
|
||||
field: 'SHIP_WAIT_QTY',
|
||||
formatter:fnc_createGridAnchorTag,
|
||||
cellClick: function(e, cell) {
|
||||
if(cell.getValue() > 0) {
|
||||
fn_openQtyDetailPopup(cell.getData().OBJID, 'SHIP_WAIT');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// 18. 장비조립WBS
|
||||
{
|
||||
headerHozAlign: 'center',
|
||||
hozAlign: 'center',
|
||||
minWidth: 110,
|
||||
title: '장비조립WBS',
|
||||
field: 'EQUIPMENT_WBS',
|
||||
formatter:fnc_subInfoValueFormatter,
|
||||
cellClick:function(e, cell){
|
||||
var objid = fnc_checkNull(cell.getData().OBJID);
|
||||
fn_WBSRegist(objid);
|
||||
}
|
||||
}
|
||||
];
|
||||
|
||||
// 검색 함수
|
||||
function fn_search(){
|
||||
_tabulGrid = fnc_tabul_search(_tabul_layout_fitColumns, _tabulGrid, "/productionplanning/prodPlanResultMgmtGridList.do", columns, true);
|
||||
}
|
||||
|
||||
// 프로젝트 상세 팝업
|
||||
function fn_openProjectDetailPopup(objid) {
|
||||
var popup_width = 1000;
|
||||
var popup_height = 550;
|
||||
var url = "/salesMgmt/salesRegForm.do?orderNo=&saleNo=detail&objid=" + objid;
|
||||
fn_centerPopup(popup_width, popup_height, url);
|
||||
}
|
||||
|
||||
// 생산계획 생성 버튼 클릭 - 팝업 열기
|
||||
function fn_createProdPlan() {
|
||||
var checkedRows = getCheckedRows();
|
||||
|
||||
var popup_width = 900;
|
||||
var popup_height = 500;
|
||||
var url = "/productionplanning/prodPlanFormPopup.do";
|
||||
|
||||
if(checkedRows.length === 1) {
|
||||
// 선택된 행이 있으면 프로젝트 정보 전달
|
||||
var rowData = checkedRows[0];
|
||||
url += "?projectObjid=" + rowData.OBJID;
|
||||
if(rowData.PROD_PLAN_OBJID) {
|
||||
url += "&prodPlanObjid=" + rowData.PROD_PLAN_OBJID;
|
||||
}
|
||||
} else if(checkedRows.length > 1) {
|
||||
Swal.fire({
|
||||
title: '알림',
|
||||
text: '한 번에 하나의 프로젝트만 선택해주세요.',
|
||||
icon: 'info'
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 선택 없으면 빈 폼으로 팝업 (프로젝트 없이 생성)
|
||||
|
||||
fn_centerPopup(popup_width, popup_height, url, 'prodPlanPopup');
|
||||
}
|
||||
|
||||
// 작업지시 생성
|
||||
function fn_createWorkOrder() {
|
||||
var checkedRows = getCheckedRows();
|
||||
|
||||
if(checkedRows.length === 0) {
|
||||
Swal.fire({
|
||||
title: '선택 필요',
|
||||
text: '작업지시를 생성할 프로젝트를 선택해주세요.',
|
||||
icon: 'warning'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: 작업지시 생성 팝업
|
||||
Swal.fire({
|
||||
title: '알림',
|
||||
text: '작업지시 생성 기능은 준비 중입니다.',
|
||||
icon: 'info'
|
||||
});
|
||||
}
|
||||
|
||||
// 생산실적 등록
|
||||
function fn_registProdResult() {
|
||||
var checkedRows = getCheckedRows();
|
||||
|
||||
if(checkedRows.length === 0) {
|
||||
Swal.fire({
|
||||
title: '선택 필요',
|
||||
text: '생산실적을 등록할 프로젝트를 선택해주세요.',
|
||||
icon: 'warning'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if(checkedRows.length > 1) {
|
||||
Swal.fire({
|
||||
title: '알림',
|
||||
text: '한 번에 하나의 프로젝트만 선택해주세요.',
|
||||
icon: 'info'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
var rowData = checkedRows[0];
|
||||
var popup_width = 1000;
|
||||
var popup_height = 700;
|
||||
var url = "/productionplanning/prodResultFormPopup.do?projectObjid=" + rowData.OBJID;
|
||||
fn_centerPopup(popup_width, popup_height, url, 'prodResultPopup');
|
||||
}
|
||||
|
||||
// 수량 상세 팝업 (완조립, 검사, 출하대기 클릭 시)
|
||||
function fn_openQtyDetailPopup(projectObjid, qtyType) {
|
||||
var popup_width = 800;
|
||||
var popup_height = 500;
|
||||
var url = "/productionplanning/prodQtyDetailPopup.do?projectObjid=" + projectObjid + "&qtyType=" + qtyType;
|
||||
fn_centerPopup(popup_width, popup_height, url, 'qtyDetailPopup');
|
||||
}
|
||||
|
||||
// 선택된 행 가져오기 (Tabulator 선택 기능 사용)
|
||||
function getCheckedRows() {
|
||||
if(_tabulGrid) {
|
||||
return _tabulGrid.getSelectedData();
|
||||
}
|
||||
return [];
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- hiddenForm: POST 방식 팝업 전송용 -->
|
||||
<form name="hiddenForm" id="hiddenForm" method="post">
|
||||
<input type="hidden" name="OBJID" id="OBJID">
|
||||
<input type="hidden" name="actionType" id="actionType">
|
||||
</form>
|
||||
|
||||
<form name="form1" id="form1" method="post">
|
||||
<input type="hidden" name="actionType" id="actionType">
|
||||
<div class="content-box">
|
||||
<div class="content-box-s">
|
||||
<div class="plm_menu_name_gdnsi">
|
||||
<h2>
|
||||
<span><%=menuName%></span>
|
||||
</h2>
|
||||
<div class="btnArea">
|
||||
<input type="button" class="plm_btns" value="조회" id="btnSearch">
|
||||
<input type="button" class="plm_btns" value="생산계획 생성" id="btnCreateProdPlan">
|
||||
<input type="button" class="plm_btns" value="작업지시 생성" id="btnCreateWorkOrder">
|
||||
<input type="button" class="plm_btns" value="생산실적 등록" id="btnRegistProdResult">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 검색 영역 -->
|
||||
<div id="plmSearchZon">
|
||||
<table>
|
||||
<tr>
|
||||
<td><label>프로젝트번호</label></td>
|
||||
<td>
|
||||
<select name="search_project_no" id="search_project_no" class="select2" style="width:235px;" multiple="multiple">
|
||||
<option value="">선택</option>
|
||||
${code_map.project_no}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label>제품구분</label></td>
|
||||
<td>
|
||||
<select name="search_product_code" id="search_product_code" class="select2" style="">
|
||||
<option value="">전체</option>
|
||||
${code_map.product_cd}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label>주문유형</label></td>
|
||||
<td>
|
||||
<select name="search_category_code" id="search_category_code" class="select2" style="">
|
||||
<option value="">전체</option>
|
||||
${code_map.category_cd}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label>생산유형</label></td>
|
||||
<td>
|
||||
<select name="search_production_type" id="search_production_type" class="select2" style="">
|
||||
<option value="">전체</option>
|
||||
${code_map.production_type_cd}
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label>고객사</label></td>
|
||||
<td>
|
||||
<select name="search_customer_objid" id="search_customer_objid" class="select2" style="width:250px;">
|
||||
<option value="">전체</option>
|
||||
${code_map.customer_cd}
|
||||
</select>
|
||||
</td>
|
||||
<td><label>요청납기</label></td>
|
||||
<td>
|
||||
<input type="text" name="search_req_del_date_from" id="search_req_del_date_from" class="date_icon" style="width:110px;" autocomplete="off">~
|
||||
<input type="text" name="search_req_del_date_to" id="search_req_del_date_to" class="date_icon" style="width:110px;" autocomplete="off">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label>품번</label></td>
|
||||
<td>
|
||||
<select name="search_part_no" id="search_part_no" class="select2-part" style="width:130px;">
|
||||
<option value="">품번 선택</option>
|
||||
</select>
|
||||
<input type="hidden" name="search_part_objid" id="search_part_objid" value="">
|
||||
</td>
|
||||
|
||||
<td><label>품명</label></td>
|
||||
<td>
|
||||
<select name="search_part_name" id="search_part_name" class="select2-part" style="width:130px;">
|
||||
<option value="">품명 선택</option>
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label>S/N</label></td>
|
||||
<td><input type="text" name="search_serial_no" id="search_serial_no" style="" autocomplete="off"></td>
|
||||
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 그리드 영역 -->
|
||||
<%@include file= "/WEB-INF/view/common/common_gridArea.jsp" %>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,6 +6,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@@ -15,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.pms.common.bean.PersonBean;
|
||||
import com.pms.common.service.BaseService;
|
||||
import com.pms.common.utils.CommonUtils;
|
||||
import com.pms.common.utils.Constants;
|
||||
@@ -1630,4 +1632,149 @@ public class ProductionPlanningController extends BaseService {
|
||||
}
|
||||
return "/productionplanning/mBomHistoryPopup";
|
||||
}
|
||||
|
||||
/**
|
||||
* 생산관리 -> 생산계획&실적관리 목록
|
||||
* @param request
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/productionplanning/prodPlanResultMgmtList.do")
|
||||
public String prodPlanResultMgmtList(HttpServletRequest request, @RequestParam Map paramMap){
|
||||
Map code_map = new HashMap();
|
||||
try{
|
||||
// 프로젝트번호
|
||||
code_map.put("project_no", commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)paramMap.get("project_no")), "common.getCusProjectNoList"));
|
||||
|
||||
// 제품구분
|
||||
code_map.put("product_cd", commonService.bizMakeOptionList("0000001", CommonUtils.nullToEmpty((String)paramMap.get("product_code")), "common.getCodeselect"));
|
||||
|
||||
// 주문유형
|
||||
code_map.put("category_cd", commonService.bizMakeOptionList("0000167", CommonUtils.nullToEmpty((String)paramMap.get("category_code")), "common.getCodeselect"));
|
||||
|
||||
// 생산유형
|
||||
code_map.put("production_type_cd", commonService.bizMakeOptionList("0001832", CommonUtils.nullToEmpty((String)paramMap.get("production_type")), "common.getCodeselect"));
|
||||
|
||||
// 고객사
|
||||
code_map.put("customer_cd", commonService.bizMakeOptionList("", CommonUtils.nullToEmpty((String)paramMap.get("customer_objid")), "common.getClientMngSupplySelect"));
|
||||
|
||||
request.setAttribute("code_map", code_map);
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "/productionplanning/prodPlanResultMgmtList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 생산관리 -> 생산계획&실적관리 그리드 목록
|
||||
* @param request
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("/productionplanning/prodPlanResultMgmtGridList.do")
|
||||
public Map prodPlanResultMgmtGridList(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
||||
commonService.selectListPagingNew("productionplanning.prodPlanResultMgmtGridList", request, paramMap);
|
||||
return paramMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 생산계획 생성 팝업
|
||||
* @param request
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/productionplanning/prodPlanFormPopup.do")
|
||||
public String prodPlanFormPopup(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
||||
Map code_map = new HashMap();
|
||||
try {
|
||||
String projectObjid = CommonUtils.nullToEmpty((String)paramMap.get("projectObjid"));
|
||||
String prodPlanObjid = CommonUtils.nullToEmpty((String)paramMap.get("prodPlanObjid"));
|
||||
|
||||
// 프로젝트번호
|
||||
code_map.put("project_no", commonService.bizMakeOptionList("", projectObjid, "common.getCusProjectNoList"));
|
||||
|
||||
// 제품구분
|
||||
code_map.put("product_cd", commonService.bizMakeOptionList("0000001", "", "common.getCodeselect"));
|
||||
|
||||
// 주문유형
|
||||
code_map.put("category_cd", commonService.bizMakeOptionList("0000167", "", "common.getCodeselect"));
|
||||
|
||||
// 생산유형
|
||||
code_map.put("production_type_cd", commonService.bizMakeOptionList("0001832", "", "common.getCodeselect"));
|
||||
|
||||
// 고객사
|
||||
code_map.put("customer_cd", commonService.bizMakeOptionList("", "", "common.getClientMngSupplySelect"));
|
||||
|
||||
request.setAttribute("code_map", code_map);
|
||||
request.setAttribute("projectObjid", projectObjid);
|
||||
|
||||
// 수정 모드일 경우 기존 데이터 조회
|
||||
if(!"".equals(prodPlanObjid)) {
|
||||
Map resultMap = productionPlanningService.getProdPlanInfo(prodPlanObjid);
|
||||
request.setAttribute("resultMap", resultMap);
|
||||
request.setAttribute("actionType", "modify");
|
||||
} else {
|
||||
request.setAttribute("actionType", "regist");
|
||||
}
|
||||
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "/productionplanning/prodPlanFormPopup";
|
||||
}
|
||||
|
||||
/**
|
||||
* 프로젝트 정보 조회 (생산계획 폼용)
|
||||
* @param request
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("/productionplanning/getProdPlanProjectInfo.do")
|
||||
public Map getProdPlanProjectInfo(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
try {
|
||||
Map info = productionPlanningService.getProdPlanProjectInfo(paramMap);
|
||||
resultMap.put("result", "success");
|
||||
resultMap.put("info", info);
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
resultMap.put("result", "fail");
|
||||
resultMap.put("msg", "프로젝트 정보 조회 실패");
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 생산계획 저장
|
||||
* @param request
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("/productionplanning/saveProdPlan.do")
|
||||
public Map saveProdPlan(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
||||
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||
try {
|
||||
HttpSession session = request.getSession();
|
||||
PersonBean person = (PersonBean) session.getAttribute(Constants.PERSON_BEAN);
|
||||
paramMap.put("userId", person.getUserId());
|
||||
|
||||
boolean success = productionPlanningService.saveProdPlan(paramMap);
|
||||
if(success) {
|
||||
resultMap.put("result", "success");
|
||||
resultMap.put("msg", "저장되었습니다.");
|
||||
} else {
|
||||
resultMap.put("result", "fail");
|
||||
resultMap.put("msg", "저장에 실패했습니다.");
|
||||
}
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
resultMap.put("result", "fail");
|
||||
resultMap.put("msg", "저장 중 오류가 발생했습니다.");
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2925,7 +2925,7 @@
|
||||
-- 수량: PROJECT_MGMT 우선
|
||||
COALESCE(PM.QUANTITY::numeric, CI.ORDER_QUANTITY::numeric, 0) AS QUANTITY,
|
||||
-- 요청납기: CONTRACT_ITEM 우선
|
||||
COALESCE(CI.DUE_DATE, PM.DUE_DATE, CM.req_del_date) AS REQ_DEL_DATE,
|
||||
COALESCE(CI.DUE_DATE, PM.DUE_DATE, CM.REQ_DEL_DATE) AS REQ_DEL_DATE,
|
||||
-- 고객요청사항: CONTRACT_ITEM에서 가져옴
|
||||
COALESCE(CI.CUSTOMER_REQUEST, '') AS CUSTOMER_REQUEST,
|
||||
-- E-BOM 정보: CI.PART_OBJID가 E-BOM OBJID를 가리킴
|
||||
@@ -3960,48 +3960,50 @@
|
||||
<!-- M-BOM 상세 리스트 조회 (이력용) -->
|
||||
<select id="getMbomDetailList" parameterType="map" resultType="com.pms.common.UpperKeyMap">
|
||||
SELECT
|
||||
OBJID,
|
||||
MBOM_HEADER_OBJID,
|
||||
PARENT_OBJID,
|
||||
CHILD_OBJID,
|
||||
SEQ,
|
||||
LEVEL,
|
||||
PART_OBJID,
|
||||
PART_NO,
|
||||
PART_NAME,
|
||||
QTY,
|
||||
UNIT,
|
||||
SUPPLY_TYPE,
|
||||
MAKE_OR_BUY,
|
||||
RAW_MATERIAL_PART_NO,
|
||||
RAW_MATERIAL_SPEC,
|
||||
RAW_MATERIAL,
|
||||
RAW_MATERIAL_SIZE,
|
||||
PROCESSING_VENDOR,
|
||||
PROCESSING_DEADLINE,
|
||||
GRINDING_DEADLINE,
|
||||
REQUIRED_QTY,
|
||||
ORDER_QTY,
|
||||
PRODUCTION_QTY,
|
||||
STOCK_QTY,
|
||||
SHORTAGE_QTY,
|
||||
NET_QTY,
|
||||
PO_QTY,
|
||||
VENDOR,
|
||||
UNIT_PRICE,
|
||||
TOTAL_PRICE,
|
||||
CURRENCY,
|
||||
LEAD_TIME,
|
||||
MIN_ORDER_QTY,
|
||||
PROPOSAL_DATE,
|
||||
STATUS,
|
||||
REMARK
|
||||
MD.OBJID,
|
||||
MD.MBOM_HEADER_OBJID,
|
||||
MD.PARENT_OBJID,
|
||||
MD.CHILD_OBJID,
|
||||
MD.SEQ,
|
||||
MD.LEVEL,
|
||||
MD.PART_OBJID,
|
||||
MD.PART_NO,
|
||||
MD.PART_NAME,
|
||||
MD.QTY,
|
||||
MD.UNIT,
|
||||
MD.SUPPLY_TYPE,
|
||||
MD.MAKE_OR_BUY,
|
||||
MD.RAW_MATERIAL_PART_NO,
|
||||
MD.RAW_MATERIAL_SPEC,
|
||||
MD.RAW_MATERIAL,
|
||||
MD.RAW_MATERIAL_SIZE,
|
||||
MD.PROCESSING_VENDOR,
|
||||
COALESCE(CM.CLIENT_NM, MD.PROCESSING_VENDOR) AS PROCESSING_VENDOR_NAME,
|
||||
MD.PROCESSING_DEADLINE,
|
||||
MD.GRINDING_DEADLINE,
|
||||
MD.REQUIRED_QTY,
|
||||
MD.ORDER_QTY,
|
||||
MD.PRODUCTION_QTY,
|
||||
MD.STOCK_QTY,
|
||||
MD.SHORTAGE_QTY,
|
||||
MD.NET_QTY,
|
||||
MD.PO_QTY,
|
||||
MD.VENDOR,
|
||||
MD.UNIT_PRICE,
|
||||
MD.TOTAL_PRICE,
|
||||
MD.CURRENCY,
|
||||
MD.LEAD_TIME,
|
||||
MD.MIN_ORDER_QTY,
|
||||
MD.PROPOSAL_DATE,
|
||||
MD.STATUS,
|
||||
MD.REMARK
|
||||
FROM
|
||||
MBOM_DETAIL
|
||||
MBOM_DETAIL MD
|
||||
LEFT JOIN CLIENT_MNG CM ON MD.PROCESSING_VENDOR = CM.OBJID::VARCHAR
|
||||
WHERE
|
||||
MBOM_HEADER_OBJID = #{mbomHeaderObjid}
|
||||
AND STATUS = 'ACTIVE'
|
||||
ORDER BY SEQ
|
||||
MD.MBOM_HEADER_OBJID = #{mbomHeaderObjid}
|
||||
AND MD.STATUS = 'ACTIVE'
|
||||
ORDER BY MD.SEQ
|
||||
</select>
|
||||
|
||||
<!-- 저장된 M-BOM 트리 조회 (MBOM_DETAIL 테이블) -->
|
||||
@@ -4402,4 +4404,239 @@
|
||||
AND STATUS = 'Y'
|
||||
</select>
|
||||
|
||||
<!-- 생산계획&실적관리 그리드 목록 조회 -->
|
||||
<select id="prodPlanResultMgmtGridList" parameterType="map" resultType="com.pms.common.UpperKeyMap">
|
||||
|
||||
SELECT
|
||||
PM.OBJID,
|
||||
PM.PROJECT_NO,
|
||||
CM.PRODUCT,
|
||||
COALESCE(
|
||||
(SELECT CODE_NAME FROM COMM_CODE WHERE CODE_ID = CM.PRODUCT LIMIT 1),
|
||||
''
|
||||
) AS PRODUCT_NAME,
|
||||
CM.CATEGORY_CD AS CATEGORY_CODE,
|
||||
-- 생산유형 (TODO: 실제 컬럼명 확인 필요)
|
||||
'' AS PRODUCTION_TYPE,
|
||||
'' AS PRODUCTION_TYPE_NAME,
|
||||
CM.CUSTOMER_OBJID,
|
||||
COALESCE(
|
||||
CASE
|
||||
WHEN CM.CUSTOMER_OBJID LIKE 'C_%' THEN
|
||||
(SELECT CLIENT_NM FROM CLIENT_MNG AS C WHERE 'C_' || C.OBJID::VARCHAR = CM.CUSTOMER_OBJID LIMIT 1)
|
||||
ELSE
|
||||
(SELECT SUPPLY_NAME FROM SUPPLY_MNG WHERE OBJID::VARCHAR = CM.CUSTOMER_OBJID::VARCHAR LIMIT 1)
|
||||
END,
|
||||
''
|
||||
) AS CUSTOMER_NAME,
|
||||
-- 요청납기
|
||||
COALESCE(CI.DUE_DATE, PM.DUE_DATE, CM.REQ_DEL_DATE) AS REQ_DEL_DATE,
|
||||
-- 고객사요청사항
|
||||
COALESCE(CI.CUSTOMER_REQUEST, '') AS CUSTOMER_REQUEST,
|
||||
-- 품번/품명
|
||||
COALESCE(CI.PART_NO, PM.PART_NO, '') AS PART_NO,
|
||||
COALESCE(CI.PART_NAME, PM.PART_NAME, '') AS PART_NAME,
|
||||
-- S/N
|
||||
(SELECT
|
||||
CASE
|
||||
WHEN COUNT(*) = 0 THEN ''
|
||||
WHEN COUNT(*) = 1 THEN MIN(CIS.SERIAL_NO)
|
||||
ELSE MIN(CIS.SERIAL_NO) || ' 외 ' || (COUNT(*) - 1)::TEXT || '건'
|
||||
END
|
||||
FROM CONTRACT_ITEM_SERIAL CIS
|
||||
WHERE CIS.ITEM_OBJID = CI.OBJID
|
||||
AND UPPER(CIS.STATUS) = 'ACTIVE'
|
||||
AND CIS.SERIAL_NO IS NOT NULL) AS SERIAL_NO,
|
||||
-- 수주수량
|
||||
COALESCE(PM.QUANTITY::numeric, CI.ORDER_QUANTITY::numeric, 0) AS QUANTITY,
|
||||
-- 추가생산수량 (TODO: 실제 테이블/컬럼 확인 필요)
|
||||
0 AS EXTRA_PROD_QTY,
|
||||
-- 총생산수량 (수주수량 + 추가생산수량)
|
||||
COALESCE(PM.QUANTITY::numeric, CI.ORDER_QUANTITY::numeric, 0) AS TOTAL_PROD_QTY,
|
||||
-- 완조립 수량 (TODO: 실제 테이블/컬럼 확인 필요)
|
||||
0 AS ASSEMBLY_QTY,
|
||||
-- 검사 수량 (TODO: 실제 테이블/컬럼 확인 필요)
|
||||
0 AS INSPECTION_QTY,
|
||||
-- 출하대기 수량 (TODO: 실제 테이블/컬럼 확인 필요)
|
||||
0 AS SHIP_WAIT_QTY,
|
||||
-- 장비조립WBS (TODO: 실제 테이블/컬럼 확인 필요)
|
||||
'' AS EQUIPMENT_WBS,
|
||||
-- 생산계획 OBJID (있으면 수정, 없으면 신규)
|
||||
NULL AS PROD_PLAN_OBJID
|
||||
FROM
|
||||
PROJECT_MGMT PM
|
||||
LEFT JOIN CONTRACT_MGMT CM ON PM.CONTRACT_OBJID = CM.OBJID
|
||||
LEFT OUTER JOIN CONTRACT_ITEM CI ON PM.CONTRACT_OBJID = CI.CONTRACT_OBJID
|
||||
AND PM.PART_OBJID = CI.PART_OBJID
|
||||
AND CI.STATUS = 'ACTIVE'
|
||||
WHERE 1=1
|
||||
AND PM.PROJECT_NO IS NOT NULL
|
||||
AND PM.PROJECT_NO != ''
|
||||
<!-- 프로젝트번호 검색 -->
|
||||
<if test="search_project_no != null and search_project_no != ''">
|
||||
AND UPPER(PM.PROJECT_NO) LIKE '%' || UPPER(#{search_project_no}) || '%'
|
||||
</if>
|
||||
<!-- 제품구분 검색 -->
|
||||
<if test="search_product_code != null and search_product_code != ''">
|
||||
AND CM.PRODUCT = #{search_product_code}
|
||||
</if>
|
||||
<!-- 주문유형 검색 -->
|
||||
<if test="search_category_code != null and search_category_code != ''">
|
||||
AND CM.CATEGORY_CD = #{search_category_code}
|
||||
</if>
|
||||
<!-- 생산유형 검색 -->
|
||||
<if test="search_production_type != null and search_production_type != ''">
|
||||
AND 1=1 <!-- TODO: 생산유형 컬럼 확인 후 조건 추가 -->
|
||||
</if>
|
||||
<!-- 고객사 검색 -->
|
||||
<if test="search_customer_objid != null and search_customer_objid != ''">
|
||||
AND CM.CUSTOMER_OBJID = #{search_customer_objid}
|
||||
</if>
|
||||
<!-- 요청납기 검색 -->
|
||||
<if test="search_req_del_date_from != null and search_req_del_date_from != ''">
|
||||
AND COALESCE(CI.DUE_DATE, PM.DUE_DATE, CM.REQ_DEL_DATE) >= #{search_req_del_date_from}
|
||||
</if>
|
||||
<if test="search_req_del_date_to != null and search_req_del_date_to != ''">
|
||||
AND COALESCE(CI.DUE_DATE, PM.DUE_DATE, CM.REQ_DEL_DATE) <= #{search_req_del_date_to}
|
||||
</if>
|
||||
<!-- 품번 검색 -->
|
||||
<if test="search_part_no != null and search_part_no != ''">
|
||||
AND (
|
||||
UPPER(PM.PART_NO) LIKE '%' || UPPER(#{search_part_no}) || '%'
|
||||
OR UPPER(CI.PART_NO) LIKE '%' || UPPER(#{search_part_no}) || '%'
|
||||
)
|
||||
</if>
|
||||
<!-- 품명 검색 -->
|
||||
<if test="search_part_name != null and search_part_name != ''">
|
||||
AND (
|
||||
UPPER(PM.PART_NAME) LIKE '%' || UPPER(#{search_part_name}) || '%'
|
||||
OR UPPER(CI.PART_NAME) LIKE '%' || UPPER(#{search_part_name}) || '%'
|
||||
)
|
||||
</if>
|
||||
<!-- S/N 검색 -->
|
||||
<if test="search_serial_no != null and search_serial_no != ''">
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM CONTRACT_ITEM_SERIAL CIS
|
||||
WHERE CIS.ITEM_OBJID = CI.OBJID
|
||||
AND UPPER(CIS.STATUS) = 'ACTIVE'
|
||||
AND UPPER(CIS.SERIAL_NO) LIKE '%' || UPPER(#{search_serial_no}) || '%'
|
||||
)
|
||||
</if>
|
||||
ORDER BY PM.REGDATE DESC, PM.PROJECT_NO DESC
|
||||
</select>
|
||||
|
||||
<!-- 프로젝트 정보 조회 (생산계획 폼용) -->
|
||||
<select id="getProdPlanProjectInfo" parameterType="map" resultType="map">
|
||||
SELECT
|
||||
PM.OBJID,
|
||||
PM.PROJECT_NO,
|
||||
COALESCE(CI.PART_NO, PM.PART_NO) AS PART_NO,
|
||||
COALESCE(CI.PART_NAME, PM.PART_NAME) AS PART_NAME,
|
||||
COALESCE(CM.PRODUCT, PM.PRODUCT) AS PRODUCT_CODE,
|
||||
COALESCE(CM.CATEGORY_CD, '') AS CATEGORY_CODE,
|
||||
COALESCE(CM.CUSTOMER_OBJID, PM.CUSTOMER_OBJID) AS CUSTOMER_OBJID,
|
||||
COALESCE(CI.DUE_DATE, PM.DUE_DATE, CM.REQ_DEL_DATE) AS REQ_DEL_DATE,
|
||||
PM.QUANTITY AS ORDER_QTY,
|
||||
CM.CUSTOMER_REQUEST,
|
||||
(
|
||||
SELECT STRING_AGG(CIS.SERIAL_NO, ', ' ORDER BY CIS.SERIAL_NO)
|
||||
FROM CONTRACT_ITEM_SERIAL CIS
|
||||
WHERE CIS.ITEM_OBJID = CI.OBJID
|
||||
AND UPPER(CIS.STATUS) = 'ACTIVE'
|
||||
) AS SERIAL_NO
|
||||
FROM PROJECT_MGMT PM
|
||||
LEFT JOIN CONTRACT_MGMT CM ON PM.CONTRACT_OBJID = CM.OBJID
|
||||
LEFT JOIN CONTRACT_ITEM CI ON CI.CONTRACT_OBJID = PM.CONTRACT_OBJID
|
||||
AND CI.PART_OBJID = PM.PART_OBJID
|
||||
AND CI.STATUS = 'ACTIVE'
|
||||
WHERE PM.OBJID = #{projectObjid}
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<!-- 생산계획 정보 조회 -->
|
||||
<select id="getProdPlanInfo" parameterType="map" resultType="map">
|
||||
SELECT
|
||||
PP.OBJID,
|
||||
PP.PROJECT_OBJID,
|
||||
PP.PRODUCT_CODE,
|
||||
PP.CATEGORY_CODE,
|
||||
PP.PRODUCTION_TYPE,
|
||||
PP.CUSTOMER_OBJID,
|
||||
PP.REQ_DEL_DATE,
|
||||
PP.PART_NO,
|
||||
PP.PART_NAME,
|
||||
PP.SERIAL_NO,
|
||||
PP.ORDER_QTY,
|
||||
PP.EXTRA_PROD_QTY,
|
||||
PP.TOTAL_PROD_QTY,
|
||||
PP.CUSTOMER_REQUEST,
|
||||
PP.STATUS,
|
||||
PP.REGDATE,
|
||||
PP.WRITER
|
||||
FROM PRODUCTION_PLAN PP
|
||||
WHERE PP.OBJID = #{objid}
|
||||
</select>
|
||||
|
||||
<!-- 생산계획 등록 -->
|
||||
<insert id="insertProdPlan" parameterType="map">
|
||||
INSERT INTO PRODUCTION_PLAN (
|
||||
OBJID,
|
||||
PROJECT_OBJID,
|
||||
PRODUCT_CODE,
|
||||
CATEGORY_CODE,
|
||||
PRODUCTION_TYPE,
|
||||
CUSTOMER_OBJID,
|
||||
REQ_DEL_DATE,
|
||||
PART_NO,
|
||||
PART_NAME,
|
||||
SERIAL_NO,
|
||||
ORDER_QTY,
|
||||
EXTRA_PROD_QTY,
|
||||
TOTAL_PROD_QTY,
|
||||
CUSTOMER_REQUEST,
|
||||
STATUS,
|
||||
REGDATE,
|
||||
WRITER
|
||||
) VALUES (
|
||||
#{OBJID},
|
||||
#{PROJECT_NO},
|
||||
#{PRODUCT_CODE},
|
||||
#{CATEGORY_CODE},
|
||||
#{PRODUCTION_TYPE},
|
||||
#{CUSTOMER_OBJID},
|
||||
#{REQ_DEL_DATE},
|
||||
#{PART_NO},
|
||||
#{PART_NAME},
|
||||
#{SERIAL_NO},
|
||||
#{ORDER_QTY},
|
||||
#{EXTRA_PROD_QTY},
|
||||
#{TOTAL_PROD_QTY},
|
||||
#{CUSTOMER_REQUEST},
|
||||
'active',
|
||||
NOW(),
|
||||
#{userId}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 생산계획 수정 -->
|
||||
<update id="updateProdPlan" parameterType="map">
|
||||
UPDATE PRODUCTION_PLAN SET
|
||||
PROJECT_OBJID = #{PROJECT_NO},
|
||||
PRODUCT_CODE = #{PRODUCT_CODE},
|
||||
CATEGORY_CODE = #{CATEGORY_CODE},
|
||||
PRODUCTION_TYPE = #{PRODUCTION_TYPE},
|
||||
CUSTOMER_OBJID = #{CUSTOMER_OBJID},
|
||||
REQ_DEL_DATE = #{REQ_DEL_DATE},
|
||||
PART_NO = #{PART_NO},
|
||||
PART_NAME = #{PART_NAME},
|
||||
SERIAL_NO = #{SERIAL_NO},
|
||||
ORDER_QTY = #{ORDER_QTY},
|
||||
EXTRA_PROD_QTY = #{EXTRA_PROD_QTY},
|
||||
TOTAL_PROD_QTY = #{TOTAL_PROD_QTY},
|
||||
CUSTOMER_REQUEST = #{CUSTOMER_REQUEST},
|
||||
MODDATE = NOW(),
|
||||
MODIFIER = #{userId}
|
||||
WHERE OBJID = #{OBJID}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -1670,4 +1670,92 @@ public class ProductionPlanningService {
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 생산계획 정보 조회
|
||||
* @param prodPlanObjid
|
||||
* @return
|
||||
*/
|
||||
public Map getProdPlanInfo(String prodPlanObjid) {
|
||||
Map resultMap = new HashMap();
|
||||
SqlSession sqlSession = null;
|
||||
|
||||
try {
|
||||
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||||
Map paramMap = new HashMap();
|
||||
paramMap.put("objid", prodPlanObjid);
|
||||
resultMap = sqlSession.selectOne("productionplanning.getProdPlanInfo", paramMap);
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if(sqlSession != null) {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 프로젝트 정보 조회 (생산계획 폼용)
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
public Map getProdPlanProjectInfo(Map<String, Object> paramMap) {
|
||||
Map resultMap = new HashMap();
|
||||
SqlSession sqlSession = null;
|
||||
|
||||
try {
|
||||
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||||
resultMap = sqlSession.selectOne("productionplanning.getProdPlanProjectInfo", paramMap);
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if(sqlSession != null) {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 생산계획 저장
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
public boolean saveProdPlan(Map<String, Object> paramMap) {
|
||||
boolean result = false;
|
||||
SqlSession sqlSession = null;
|
||||
|
||||
try {
|
||||
sqlSession = SqlMapConfig.getInstance().getSqlSession();
|
||||
|
||||
String objid = CommonUtils.nullToEmpty((String)paramMap.get("OBJID"));
|
||||
String actionType = CommonUtils.nullToEmpty((String)paramMap.get("actionType"));
|
||||
|
||||
if("regist".equals(actionType) || "".equals(objid)) {
|
||||
// 신규 등록
|
||||
paramMap.put("OBJID", CommonUtils.createObjId());
|
||||
sqlSession.insert("productionplanning.insertProdPlan", paramMap);
|
||||
} else {
|
||||
// 수정
|
||||
sqlSession.update("productionplanning.updateProdPlan", paramMap);
|
||||
}
|
||||
|
||||
sqlSession.commit();
|
||||
result = true;
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
if(sqlSession != null) {
|
||||
sqlSession.rollback();
|
||||
}
|
||||
} finally {
|
||||
if(sqlSession != null) {
|
||||
sqlSession.close();
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user