Merge branch 'main' of https://g.wace.me/chpark/wace_plm into V2025112501
This commit is contained in:
168
WebContent/WEB-INF/view/admin/material/materialMngList.jsp
Normal file
168
WebContent/WEB-INF/view/admin/material/materialMngList.jsp
Normal file
@@ -0,0 +1,168 @@
|
||||
<%@ 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" %>
|
||||
<%
|
||||
String material_name = CommonUtils.checkNull(request.getParameter("material_name"));
|
||||
String material_code = CommonUtils.checkNull(request.getParameter("material_code"));
|
||||
%>
|
||||
<!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>
|
||||
$(document).ready(function(){
|
||||
fnc_datepick();
|
||||
|
||||
// 엔터키로 조회
|
||||
$("input").keyup(function(e){
|
||||
if(e.keyCode == 13){
|
||||
$("#page").val("1");
|
||||
fn_search();
|
||||
}
|
||||
});
|
||||
|
||||
$("#btnSearch").click(function(){
|
||||
$("#page").val("1");
|
||||
fn_search();
|
||||
});
|
||||
|
||||
// 삭제
|
||||
$("#btnDelete").click(function(){
|
||||
fn_delete();
|
||||
});
|
||||
|
||||
fn_search();
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
var columns = [
|
||||
{title:'OBJID', field:'OBJID', visible:false},
|
||||
{headerHozAlign:'center', hozAlign:'center', width:'80', title:'NO', field:'RNUM'},
|
||||
{headerHozAlign:'center', hozAlign:'left', width:'150', title:'소재', field:'MATERIAL_CODE',
|
||||
formatter: fnc_createGridAnchorTag,
|
||||
cellClick: function(e, cell) {
|
||||
var objid = fnc_checkNull(cell.getData().OBJID);
|
||||
openMaterialPopUp(objid);
|
||||
}
|
||||
},
|
||||
{headerHozAlign:'center', hozAlign:'left', width:'200', title:'소재명', field:'MATERIAL_NAME'},
|
||||
{headerHozAlign:'center', hozAlign:'left', width:'200', title:'사이즈', field:'SIZE_SPEC'},
|
||||
{headerHozAlign:'center', hozAlign:'left', width:'200', title:'소재품번', field:'MATERIAL_PART_NO'},
|
||||
{headerHozAlign:'center', hozAlign:'left', title:'비고', field:'REMARK'},
|
||||
{headerHozAlign:'center', hozAlign:'center', width:'100', title:'상태', field:'STATUS_NAME'},
|
||||
{headerHozAlign:'center', hozAlign:'center', width:'110', title:'등록일', field:'REGDATE'}
|
||||
];
|
||||
|
||||
// 조회
|
||||
function fn_search(){
|
||||
_tabulGrid = fnc_tabul_search(_tabul_layout_fitColumns, _tabulGrid, "/admin/materialMngGridList.do", columns, true);
|
||||
}
|
||||
|
||||
// 삭제
|
||||
function fn_delete(){
|
||||
var checkedObj = _tabulGrid.getSelectedData();
|
||||
|
||||
if(0 < checkedObj.length){
|
||||
var objId = fnc_checkNull(checkedObj[0].OBJID);
|
||||
Swal.fire({
|
||||
title: '선택한 소재를 삭제하시겠습니까?',
|
||||
text: '',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: '확인',
|
||||
cancelButtonText: '취소',
|
||||
reverseButtons: false
|
||||
}).then(result => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/admin/deleteMaterialMngInfo.do",
|
||||
data: {"objId": objId},
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
if(data.result == 'true'){
|
||||
Swal.fire("삭제되었습니다.");
|
||||
fn_search();
|
||||
} else {
|
||||
Swal.fire("삭제에 실패했습니다.");
|
||||
}
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
Swal.fire("오류가 발생했습니다.");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
Swal.fire("선택한 항목이 없습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
// 소재 등록/수정 팝업
|
||||
function openMaterialPopUp(objid){
|
||||
var popup_width = 700;
|
||||
var popup_height = 450;
|
||||
var target = "openMaterialPopUp";
|
||||
var url = "/admin/materialRegistPopUp.do";
|
||||
|
||||
fn_centerPopup(popup_width, popup_height, url, target);
|
||||
|
||||
var hiddenForm = document.hiddenForm;
|
||||
hiddenForm.objid.value = objid;
|
||||
hiddenForm.target = "openMaterialPopUp";
|
||||
hiddenForm.action = "/admin/materialRegistPopUp.do";
|
||||
hiddenForm.submit();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body style="overflow-y: hidden;">
|
||||
<form name="hiddenForm" id="hiddenForm">
|
||||
<input type="hidden" name="objid">
|
||||
</form>
|
||||
<form name="form1" id="form1" method="post">
|
||||
<input type="hidden" name="status" id="status">
|
||||
<div class="content-box">
|
||||
<div class="content-box-s">
|
||||
<div class="plm_menu_name_gdnsi">
|
||||
<h2>
|
||||
<span>소재관리</span>
|
||||
</h2>
|
||||
<div class="btnArea">
|
||||
<input type="button" value="조회" class="plm_btns" id="btnSearch">
|
||||
<input type="button" value="소재 등록" class="plm_btns" onclick="javascript:openMaterialPopUp('');">
|
||||
<input type="button" value="삭제" class="plm_btns" id="btnDelete">
|
||||
</div>
|
||||
</div>
|
||||
<div id="plmSearchZon">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="label"><label for="">소재명</label></td>
|
||||
<td><input type="text" name="material_name" id="material_name" value="<%=material_name%>"></td>
|
||||
<td class="label"><label for="">소재코드</label></td>
|
||||
<td><input type="text" name="material_code" id="material_code" value="<%=material_code%>"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<%@include file= "/WEB-INF/view/common/common_gridArea.jsp" %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
186
WebContent/WEB-INF/view/admin/material/materialRegistPopUp.jsp
Normal file
186
WebContent/WEB-INF/view/admin/material/materialRegistPopUp.jsp
Normal file
@@ -0,0 +1,186 @@
|
||||
<%@ 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>
|
||||
$(document).ready(function(){
|
||||
// 닫기 버튼
|
||||
$("#btn_close").click(function(){
|
||||
self.close();
|
||||
});
|
||||
|
||||
// 저장 버튼
|
||||
$("#btn_save").click(function(){
|
||||
fn_save();
|
||||
});
|
||||
});
|
||||
|
||||
// 저장
|
||||
function fn_save(){
|
||||
// 필수값 체크
|
||||
var materialName = $("#material_name").val();
|
||||
if(materialName == null || materialName == ''){
|
||||
Swal.fire({
|
||||
title: '알림',
|
||||
text: '소재명을 입력해주세요.',
|
||||
icon: 'warning'
|
||||
});
|
||||
$("#material_name").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
Swal.fire({
|
||||
title: '확인',
|
||||
text: '저장하시겠습니까?',
|
||||
icon: 'question',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: '확인',
|
||||
cancelButtonText: '취소'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: "/admin/saveMaterialMngInfo.do",
|
||||
type: "POST",
|
||||
data: $("#materialForm").serialize(),
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
if(data.result == 'true'){
|
||||
Swal.fire({
|
||||
title: '성공',
|
||||
text: data.message,
|
||||
icon: 'success'
|
||||
}).then(() => {
|
||||
if(opener && opener.fn_search){
|
||||
opener.fn_search();
|
||||
}
|
||||
self.close();
|
||||
});
|
||||
} else {
|
||||
Swal.fire({
|
||||
title: '실패',
|
||||
text: data.message || '저장에 실패했습니다.',
|
||||
icon: 'error'
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function(jqxhr, status, error){
|
||||
Swal.fire({
|
||||
title: '오류',
|
||||
text: '저장 중 오류가 발생했습니다.',
|
||||
icon: 'error'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.form-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
.form-table th, .form-table td {
|
||||
border: 1px solid #ddd;
|
||||
padding: 8px 10px;
|
||||
text-align: left;
|
||||
}
|
||||
.form-table th {
|
||||
background-color: #f5f5f5;
|
||||
width: 120px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.form-table input[type="text"], .form-table textarea, .form-table select {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
padding: 5px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
.form-table textarea {
|
||||
height: 80px;
|
||||
resize: vertical;
|
||||
}
|
||||
.btn-area {
|
||||
text-align: center;
|
||||
padding: 15px;
|
||||
}
|
||||
.required:after {
|
||||
content: " *";
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form name="materialForm" id="materialForm" method="post">
|
||||
<input type="hidden" name="objid" id="objid" value="${resultMap.OBJID}">
|
||||
|
||||
<div class="plm_menu_name_myungjin">
|
||||
<h2>
|
||||
<span>소재 등록/수정</span>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<div style="padding: 15px;">
|
||||
<table class="form-table">
|
||||
<colgroup>
|
||||
<col width="120px">
|
||||
<col width="*">
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><label for="material_code" class="required">소재코드</label></th>
|
||||
<td>
|
||||
<input type="text" name="material_code" id="material_code" value="${resultMap.MATERIAL_CODE}" maxlength="50" placeholder="예: MAT-001">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label for="material_name">소재명</label></th>
|
||||
<td>
|
||||
<input type="text" name="material_name" id="material_name" value="${resultMap.MATERIAL_NAME}" maxlength="256" placeholder="소재명을 입력하세요">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label for="size_spec" class="required">사이즈</label></th>
|
||||
<td>
|
||||
<input type="text" name="size_spec" id="size_spec" value="${resultMap.SIZE_SPEC}" maxlength="100" placeholder="예: 100x50x10mm">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label for="material_part_no" class="required">소재품번</label></th>
|
||||
<td>
|
||||
<input type="text" name="material_part_no" id="material_part_no" value="${resultMap.MATERIAL_PART_NO}" maxlength="100" placeholder="소재품번을 입력하세요">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label for="status">상태</label></th>
|
||||
<td>
|
||||
<select name="status" id="status">
|
||||
<option value="ACTIVE" ${resultMap.STATUS == 'ACTIVE' || empty resultMap.STATUS ? 'selected' : ''}>활성</option>
|
||||
<option value="INACTIVE" ${resultMap.STATUS == 'INACTIVE' ? 'selected' : ''}>비활성</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><label for="remark">비고</label></th>
|
||||
<td>
|
||||
<textarea name="remark" id="remark" placeholder="비고를 입력하세요">${resultMap.REMARK}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="btn-area">
|
||||
<input type="button" value="저장" class="plm_btns" id="btn_save">
|
||||
<input type="button" value="닫기" class="plm_btns" id="btn_close">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1075,7 +1075,7 @@ function fn_location_save(){
|
||||
<td title="${item.SPEC}" style="text-align:left;">${item.SPEC}</td>
|
||||
<td title="${item.MAKER}" style="text-align:left;">${item.MAKER}</td>
|
||||
<td title="${item.UNIT_TITLE}">${item.UNIT_TITLE}</td>
|
||||
<td title="${item.REAL_ORDER_QTY}"><input type="hidden" name="ORDER_QTY" class="ORDER_QTY_${item.ORDER_PART_OBJID}" value="${item.REAL_ORDER_QTY}" onchange="fn_calc('${item.ORDER_PART_OBJID}');"/><fmt:formatNumber value="${item.REAL_ORDER_QTY}" pattern="#,###" /></td>
|
||||
<td title="${item.ORDER_QTY}"><input type="hidden" name="ORDER_QTY" class="ORDER_QTY_${item.ORDER_PART_OBJID}" value="${item.ORDER_QTY}" onchange="fn_calc('${item.ORDER_PART_OBJID}');"/><fmt:formatNumber value="${item.ORDER_QTY}" pattern="#,###" /></td>
|
||||
<td title="${item.POM_DELIVERY_DATE}">${item.POM_DELIVERY_DATE}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
|
||||
@@ -334,14 +334,14 @@ function fn_formPopUp(objId){
|
||||
</select>
|
||||
</td>
|
||||
|
||||
<td><label for="unit_code">유닛명</label></td>
|
||||
<!-- <td><label for="unit_code">유닛명</label></td>
|
||||
<td>
|
||||
<select name="unit_code" id="unit_code" style="width:190px;" class="select2" autocomplete="off" type="select" reqTitle="유닛명">
|
||||
</select>
|
||||
</td>
|
||||
</td> -->
|
||||
|
||||
<td><label for="">발주No.</label></td>
|
||||
<td><input type="text" name="purchase_order_no" id="purchase_order_no" autocomplete="off" value="${param.purchase_order_no}" style="width:110px;"/></td>
|
||||
<td><input type="text" name="purchase_order_no" id="purchase_order_no" autocomplete="off" value="${param.purchase_order_no}" style="width:185px;"/></td>
|
||||
|
||||
<td><label for="">부품구분</label></td>
|
||||
<td><select name="type" id="type" class="select2" autocomplete="off" style="width:130px;"><option value="">선택</option>${code_map.type}</select></td>
|
||||
@@ -369,7 +369,7 @@ function fn_formPopUp(objId){
|
||||
|
||||
<td><label for="">입고결과</label></td>
|
||||
<td>
|
||||
<select name="delivery_status" id="delivery_status" class="select2" autocomplete="off" style="width:110px;">
|
||||
<select name="delivery_status" id="delivery_status" class="select2" autocomplete="off" style="width:130px;">
|
||||
<option value="">선택</option>
|
||||
<option value="입고중">입고중</option>
|
||||
<option value="입고완료">입고완료</option>
|
||||
|
||||
@@ -346,7 +346,7 @@ var columns = [
|
||||
}
|
||||
}
|
||||
},
|
||||
{headerHozAlign:'center', hozAlign:'center', widthGrow:1, title:'발주일', field:'REGDATE'}
|
||||
{headerHozAlign:'center', hozAlign:'center', widthGrow:1, title:'발주일', field:'MAIL_SEND_DATE'}
|
||||
];
|
||||
|
||||
function editCheck (cell) {
|
||||
@@ -879,7 +879,7 @@ function fn_openMailFormPopup(purchaseOrderObjId){
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<!-- <tr>
|
||||
<td><label for="">상태</label></td>
|
||||
<td>
|
||||
<select name="appr_status" id="appr_status" class="select2" autocomplete="off" style="">
|
||||
@@ -895,7 +895,7 @@ function fn_openMailFormPopup(purchaseOrderObjId){
|
||||
|
||||
<td><label for="">규격</label></td>
|
||||
<td><input type="text" name="SEARCH_PART_SPEC" id="SEARCH_PART_SPEC" autocomplete="off" value="${param.SEARCH_PART_SPEC }" style="width:;"/></td>
|
||||
</tr>
|
||||
</tr> -->
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -107,10 +107,10 @@ body {
|
||||
}
|
||||
|
||||
.header-left {
|
||||
flex: 0 0 auto;
|
||||
width: 35%;
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
min-width: 200px;
|
||||
border-right: 1px solid #000;
|
||||
/* border-right: 1px solid #000; */ /* 결재란 주석 처리로 인해 비활성화 */
|
||||
}
|
||||
|
||||
.header-right {
|
||||
@@ -539,7 +539,8 @@ function fn_save(){
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- 오른쪽: 결재란 -->
|
||||
<!-- 오른쪽: 결재란 (TODO: 결재 기능 구현 후 주석 해제) -->
|
||||
<%--
|
||||
<div class="header-right">
|
||||
<table class="approval-table">
|
||||
<!-- 결재 헤더 -->
|
||||
@@ -689,6 +690,7 @@ function fn_save(){
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
--%>
|
||||
</div>
|
||||
|
||||
<!-- 하단 기본정보 (수신및참조, 시행자, 시행일자, 제목) - 입력 가능 -->
|
||||
|
||||
@@ -24,9 +24,12 @@ import com.pms.common.bean.PersonBean;
|
||||
import com.pms.common.service.BaseService;
|
||||
import com.pms.common.utils.CommonUtils;
|
||||
import com.pms.common.utils.Constants;
|
||||
import com.pms.common.SqlMapConfig;
|
||||
import com.pms.service.AdminService;
|
||||
import com.pms.service.CommonService;
|
||||
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
|
||||
@Controller
|
||||
public class AdminController extends BaseService {
|
||||
|
||||
@@ -5062,4 +5065,135 @@ public String clientImportFileProc(HttpServletRequest request, HttpSession sessi
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 소재 목록을 가져온다.
|
||||
* @param request
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/admin/materialMngPagingList.do")
|
||||
public String getMaterialMngPaging(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
||||
return "/admin/material/materialMngList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 소재 목록 관리 - 소재 목록 그리드
|
||||
* @param request
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("/admin/materialMngGridList.do")
|
||||
public Map materialMngGridList(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
||||
commonService.selectListPagingNew("admin.getMaterialMngGridList", request, paramMap);
|
||||
return paramMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 소재 등록/수정 팝업
|
||||
* @param request
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/admin/materialRegistPopUp.do")
|
||||
public String materialRegistPopUp(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
||||
Map resultMap = new HashMap();
|
||||
try {
|
||||
String objid = CommonUtils.checkNull(paramMap.get("objid"));
|
||||
if(!"".equals(objid)) {
|
||||
// 기존 소재 정보 조회
|
||||
resultMap = commonService.selectOne("admin.getMaterialMngInfo", request, paramMap);
|
||||
}
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
request.setAttribute("resultMap", resultMap);
|
||||
return "/admin/material/materialRegistPopUp";
|
||||
}
|
||||
|
||||
/**
|
||||
* 소재 저장 (등록/수정)
|
||||
* @param request
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("/admin/saveMaterialMngInfo.do")
|
||||
public Map saveMaterialMngInfo(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
||||
Map resultMap = new HashMap();
|
||||
SqlSession sqlSession = null;
|
||||
|
||||
try {
|
||||
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||||
|
||||
HttpSession session = request.getSession();
|
||||
PersonBean person = (PersonBean)session.getAttribute(Constants.PERSON_BEAN);
|
||||
String userId = CommonUtils.checkNull(person.getUserId());
|
||||
|
||||
String objid = CommonUtils.checkNull(paramMap.get("objid"));
|
||||
paramMap.put("userId", userId);
|
||||
|
||||
if("".equals(objid)) {
|
||||
// 신규 등록
|
||||
paramMap.put("objid", CommonUtils.createObjId());
|
||||
sqlSession.insert("admin.insertMaterialMng", paramMap);
|
||||
} else {
|
||||
// 수정
|
||||
sqlSession.update("admin.updateMaterialMng", paramMap);
|
||||
}
|
||||
|
||||
sqlSession.commit();
|
||||
resultMap.put("result", "true");
|
||||
resultMap.put("message", "저장되었습니다.");
|
||||
|
||||
} catch(Exception e) {
|
||||
if(sqlSession != null) sqlSession.rollback();
|
||||
e.printStackTrace();
|
||||
resultMap.put("result", "false");
|
||||
resultMap.put("message", "저장 중 오류가 발생했습니다: " + e.getMessage());
|
||||
} finally {
|
||||
if(sqlSession != null) sqlSession.close();
|
||||
}
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 소재 삭제
|
||||
* @param request
|
||||
* @param paramMap
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping("/admin/deleteMaterialMngInfo.do")
|
||||
public Map deleteMaterialMngInfo(HttpServletRequest request, @RequestParam Map<String, Object> paramMap){
|
||||
Map resultMap = new HashMap();
|
||||
SqlSession sqlSession = null;
|
||||
|
||||
try {
|
||||
sqlSession = SqlMapConfig.getInstance().getSqlSession(false);
|
||||
|
||||
String objId = CommonUtils.checkNull(paramMap.get("objId"));
|
||||
if(!"".equals(objId)) {
|
||||
Map deleteParam = new HashMap();
|
||||
deleteParam.put("objid", objId);
|
||||
sqlSession.delete("admin.deleteMaterialMng", deleteParam);
|
||||
sqlSession.commit();
|
||||
resultMap.put("result", "true");
|
||||
} else {
|
||||
resultMap.put("result", "false");
|
||||
resultMap.put("message", "삭제할 대상이 없습니다.");
|
||||
}
|
||||
|
||||
} catch(Exception e) {
|
||||
if(sqlSession != null) sqlSession.rollback();
|
||||
e.printStackTrace();
|
||||
resultMap.put("result", "false");
|
||||
resultMap.put("message", "삭제 중 오류가 발생했습니다: " + e.getMessage());
|
||||
} finally {
|
||||
if(sqlSession != null) sqlSession.close();
|
||||
}
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9434,4 +9434,97 @@ SELECT
|
||||
ORDER BY SCM.REGDATE DESC
|
||||
</select>
|
||||
|
||||
<!-- ==================== 소재 관리 (MATERIAL_MNG) ==================== -->
|
||||
|
||||
<!-- 소재 목록 조회 (그리드용) -->
|
||||
<select id="getMaterialMngGridList" parameterType="map" resultType="map">
|
||||
SELECT
|
||||
OBJID,
|
||||
MATERIAL_CODE,
|
||||
MATERIAL_NAME,
|
||||
MATERIAL_PART_NO,
|
||||
SIZE_SPEC,
|
||||
REMARK,
|
||||
STATUS,
|
||||
CASE UPPER(STATUS)
|
||||
WHEN 'ACTIVE' THEN '활성'
|
||||
WHEN 'INACTIVE' THEN '비활성'
|
||||
ELSE STATUS
|
||||
END AS STATUS_NAME,
|
||||
WRITER,
|
||||
TO_CHAR(REGDATE, 'YYYY-MM-DD') AS REGDATE
|
||||
FROM MATERIAL_MNG
|
||||
WHERE 1=1
|
||||
<if test="material_name != null and material_name != ''">
|
||||
AND UPPER(MATERIAL_NAME) LIKE UPPER('%' || #{material_name} || '%')
|
||||
</if>
|
||||
<if test="material_code != null and material_code != ''">
|
||||
AND UPPER(MATERIAL_CODE) LIKE UPPER('%' || #{material_code} || '%')
|
||||
</if>
|
||||
ORDER BY REGDATE DESC
|
||||
</select>
|
||||
|
||||
<!-- 소재 상세 조회 -->
|
||||
<select id="getMaterialMngInfo" parameterType="map" resultType="map">
|
||||
SELECT
|
||||
OBJID,
|
||||
MATERIAL_CODE,
|
||||
MATERIAL_NAME,
|
||||
MATERIAL_PART_NO,
|
||||
SIZE_SPEC,
|
||||
REMARK,
|
||||
STATUS,
|
||||
WRITER,
|
||||
TO_CHAR(REGDATE, 'YYYY-MM-DD') AS REGDATE,
|
||||
EDITER,
|
||||
TO_CHAR(EDIT_DATE, 'YYYY-MM-DD') AS EDIT_DATE
|
||||
FROM MATERIAL_MNG
|
||||
WHERE OBJID = #{objid}
|
||||
</select>
|
||||
|
||||
<!-- 소재 등록 -->
|
||||
<insert id="insertMaterialMng" parameterType="map">
|
||||
INSERT INTO MATERIAL_MNG (
|
||||
OBJID,
|
||||
MATERIAL_CODE,
|
||||
MATERIAL_NAME,
|
||||
MATERIAL_PART_NO,
|
||||
SIZE_SPEC,
|
||||
REMARK,
|
||||
STATUS,
|
||||
WRITER,
|
||||
REGDATE
|
||||
) VALUES (
|
||||
#{objid},
|
||||
#{material_code},
|
||||
#{material_name},
|
||||
#{material_part_no},
|
||||
#{size_spec},
|
||||
#{remark},
|
||||
COALESCE(#{status}, 'ACTIVE'),
|
||||
#{userId},
|
||||
NOW()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<!-- 소재 수정 -->
|
||||
<update id="updateMaterialMng" parameterType="map">
|
||||
UPDATE MATERIAL_MNG SET
|
||||
MATERIAL_CODE = #{material_code},
|
||||
MATERIAL_NAME = #{material_name},
|
||||
MATERIAL_PART_NO = #{material_part_no},
|
||||
SIZE_SPEC = #{size_spec},
|
||||
REMARK = #{remark},
|
||||
STATUS = #{status},
|
||||
EDITER = #{userId},
|
||||
EDIT_DATE = NOW()
|
||||
WHERE OBJID = #{objid}
|
||||
</update>
|
||||
|
||||
<!-- 소재 삭제 -->
|
||||
<delete id="deleteMaterialMng" parameterType="map">
|
||||
DELETE FROM MATERIAL_MNG
|
||||
WHERE OBJID = #{objid}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -4292,6 +4292,7 @@ SELECT POM.OBJID
|
||||
<!-- AND POM.STATUS = 'approvalComplete' --> <!-- A.APPR_STATUS = 'complete' -->/*결재완료*/
|
||||
<!-- AND POM.SALES_STATUS = 'OK' -->
|
||||
<!-- AND (POM.SALES_STATUS = 'OK' OR POM.TYPE = '0001538' ) -->
|
||||
AND POM.MAIL_SEND_DATE IS NOT NULL
|
||||
AND (MULTI_MASTER_YN = 'Y' OR NVL(MULTI_MASTER_YN, '') != 'Y' AND NVL(MULTI_YN, '') != 'Y')
|
||||
|
||||
<if test="Year !=null and Year != '' ">
|
||||
|
||||
Reference in New Issue
Block a user