From c09b676be64ade5e70e0524a1f607400c81c0c9e Mon Sep 17 00:00:00 2001 From: sungsu Date: Fri, 19 Jan 2024 16:29:47 +0900 Subject: [PATCH] =?UTF-8?q?#=EC=88=98=EC=A0=95=20stock/create.jsp=20stock/?= =?UTF-8?q?list.jsp=20stock/read.jsp=20stock/update.jsp=20WarehouseControl?= =?UTF-8?q?ler.java=20WarehouseMapper.xml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mappers/StockMapper.xml | 26 +++++++++---------- .../webapp/WEB-INF/views/stock/create.jsp | 22 +++++++++++++++- src/main/webapp/WEB-INF/views/stock/list.jsp | 19 +++++++++++--- .../webapp/WEB-INF/views/stock/update.jsp | 4 +-- 4 files changed, 51 insertions(+), 20 deletions(-) diff --git a/src/main/resources/mappers/StockMapper.xml b/src/main/resources/mappers/StockMapper.xml index c30f1a4..fc5c071 100644 --- a/src/main/resources/mappers/StockMapper.xml +++ b/src/main/resources/mappers/StockMapper.xml @@ -6,7 +6,7 @@ @@ -131,9 +131,9 @@ - s.id IS NULL and w.activation = 1 and w.name like concat('%',#{search},'%') - s.id IS NULL and w.activation = 1 and address like concat('%',#{search},'%') - s.id IS NULL and w.activation = 1 and capacity like concat('%',#{search},'%') + (s.product_id is null or s.product_id <> #{product_id}) and w.activation = 1 and w.name like concat('%',#{search},'%') + (s.product_id is null or s.product_id <> #{product_id}) and w.activation = 1 and address like concat('%',#{search},'%') + (s.product_id is null or s.product_id <> #{product_id}) and w.activation = 1 and capacity like concat('%',#{search},'%') order by w.name desc limit #{start}, #{perPage} @@ -146,9 +146,9 @@ - s.id IS NULL and w.activation = 1 and w.name like concat('%',#{search},'%') - s.id IS NULL and w.activation = 1 and address like concat('%',#{search},'%') - s.id IS NULL and w.activation = 1 and capacity like concat('%',#{search},'%') + (s.product_id is null or s.product_id <> #{product_id}) and w.activation = 1 and w.name like concat('%',#{search},'%') + (s.product_id is null or s.product_id <> #{product_id}) and w.activation = 1 and address like concat('%',#{search},'%') + (s.product_id is null or s.product_id <> #{product_id}) and w.activation = 1 and capacity like concat('%',#{search},'%') diff --git a/src/main/webapp/WEB-INF/views/stock/create.jsp b/src/main/webapp/WEB-INF/views/stock/create.jsp index 84baacf..dda9e15 100644 --- a/src/main/webapp/WEB-INF/views/stock/create.jsp +++ b/src/main/webapp/WEB-INF/views/stock/create.jsp @@ -39,7 +39,7 @@ 창고 - +
@@ -102,6 +102,26 @@ }); } + function showSearchModals2(title, val){ + $("#searchModalLabel").text(title); + const data = { name : val}; + var product_id = $("#product_id").val(); + + $.ajax({ + type : 'post', // 타입 (get, post, put 등등) + url : '/stock/show_modal', // 요청할 서버url + dataType : 'html', // 데이터 타입 (html, xml, json, text 등등) + data : product_id,data, + success : function(result) { // 결과 성공 콜백함수 + $("#search_modal_body").html(result); + searchModalBootStrap.show(); + }, + error : function(request, status, error) { + alert(error) + } + }); + } + $(document).ready(function () { diff --git a/src/main/webapp/WEB-INF/views/stock/list.jsp b/src/main/webapp/WEB-INF/views/stock/list.jsp index 6b0c1dc..cd8c958 100644 --- a/src/main/webapp/WEB-INF/views/stock/list.jsp +++ b/src/main/webapp/WEB-INF/views/stock/list.jsp @@ -76,6 +76,7 @@ 제품명 카테고리 재고수 + 창고 @@ -85,6 +86,7 @@ ${dto.productName } ${dto.cls_nm_4 } ${dto.quantity} + ${dto.warehouseName} @@ -96,6 +98,7 @@
ms-excel +
@@ -192,6 +195,7 @@
ms-excel +
@@ -241,16 +245,23 @@ $(document).ready(function () { - - $("#downlodeExcelList,downlodeExcelList2").on("click",function(){ + $("#downlodeStockForm,downlodeStockForm2").on("click",function(){ var form = document.createElement("form"); - form.action = "/vendor/downlodeExcelList"; + form.action = "/stock/downloadStockForm"; form.method = "GET"; document.body.appendChild(form); form.submit(); }); - //POST방식으로 create폼화면 출력 + $("#downlodeExcelList,downlodeExcelList2").on("click",function(){ + var form = document.createElement("form"); + form.action = "/stock/downloadExcelList"; + form.method = "GET"; + document.body.appendChild(form); + form.submit(); + }); + + //POST방식으로 create폼화면 출력 //탭 1 생성 버튼 $("#createButton").on("click", function () { var form = document.createElement("form"); diff --git a/src/main/webapp/WEB-INF/views/stock/update.jsp b/src/main/webapp/WEB-INF/views/stock/update.jsp index a9982ff..321b97e 100644 --- a/src/main/webapp/WEB-INF/views/stock/update.jsp +++ b/src/main/webapp/WEB-INF/views/stock/update.jsp @@ -142,9 +142,9 @@ return false; } - if (quantity > remainingcapacity) { + if (quantityAdjustment > remainingcapacity) { alert("적재 할 재고량이 재고량 한도를 넘을 수 없습니다."); - $("#quantity").focus(); + $("#quantityAdjustment").focus(); return false; }