stock/create.jsp
stock/list.jsp
stock/read.jsp
stock/update.jsp
WarehouseController.java
WarehouseMapper.xml
This commit is contained in:
sungsu
2024-01-19 16:29:47 +09:00
parent 9178ad0cb2
commit c09b676be6
4 changed files with 51 additions and 20 deletions

View File

@@ -6,7 +6,7 @@
<!-- select -->
<select id="selectAll" parameterType="Map" resultType="Map">
select s.id as id, s.warehouse_id as warehouseId, s.product_id as productId, s.quantity, p.name as productName, p.kan_code, c.cls_nm_4, w.name as warehouseName
select s.quantity as quantity, p.name as productName, c.cls_nm_4 as cls_nm_4, w.name as warehouseName
from stock s
left join warehouse w on s.warehouse_id = w.id
@@ -102,9 +102,9 @@
left join product_category c on p.kan_code = c.kan_code
<where>
<choose>
<when test="searchn == 0"> s.id IS NULL and p.activation = 1 and name like concat('%',#{search},'%')</when>
<when test="searchn == 1"> s.id IS NULL and p.activation = 1 and cls_Nm_4 like concat('%',#{search},'%')</when>
<when test="searchn == 2"> s.id IS NULL and p.activation = 1 and company_name like concat('%',#{search},'%')</when>
<when test="searchn == 0"> p.activation = 1 and name like concat('%',#{search},'%')</when>
<when test="searchn == 1"> p.activation = 1 and cls_Nm_4 like concat('%',#{search},'%')</when>
<when test="searchn == 2"> p.activation = 1 and company_name like concat('%',#{search},'%')</when>
</choose>
</where>
order by name desc limit #{start}, #{perPage}
@@ -117,9 +117,9 @@
left join product_category c on p.kan_code = c.kan_code
<where>
<choose>
<when test="searchn == 0"> s.id IS NULL and p.activation = 1 and name like concat('%',#{search},'%')</when>
<when test="searchn == 1"> s.id IS NULL and p.activation = 1 and cls_Nm_4 like concat('%',#{search},'%')</when>
<when test="searchn == 2"> s.id IS NULL and p.activation = 1 and company_name like concat('%',#{search},'%')</when>
<when test="searchn == 0"> p.activation = 1 and name like concat('%',#{search},'%')</when>
<when test="searchn == 1"> p.activation = 1 and cls_Nm_4 like concat('%',#{search},'%')</when>
<when test="searchn == 2"> p.activation = 1 and company_name like concat('%',#{search},'%')</when>
</choose>
</where>
</select>
@@ -131,9 +131,9 @@
<where>
<choose>
<when test="searchn == 0"> s.id IS NULL and w.activation = 1 and w.name like concat('%',#{search},'%')</when>
<when test="searchn == 1"> s.id IS NULL and w.activation = 1 and address like concat('%',#{search},'%')</when>
<when test="searchn == 2"> s.id IS NULL and w.activation = 1 and capacity like concat('%',#{search},'%')</when>
<when test="searchn == 0"> (s.product_id is null or s.product_id &lt;&gt; #{product_id}) and w.activation = 1 and w.name like concat('%',#{search},'%')</when>
<when test="searchn == 1"> (s.product_id is null or s.product_id &lt;&gt; #{product_id}) and w.activation = 1 and address like concat('%',#{search},'%')</when>
<when test="searchn == 2"> (s.product_id is null or s.product_id &lt;&gt; #{product_id}) and w.activation = 1 and capacity like concat('%',#{search},'%')</when>
</choose>
</where>
order by w.name desc limit #{start}, #{perPage}
@@ -146,9 +146,9 @@
<where>
<choose>
<when test="searchn == 0"> s.id IS NULL and w.activation = 1 and w.name like concat('%',#{search},'%')</when>
<when test="searchn == 1"> s.id IS NULL and w.activation = 1 and address like concat('%',#{search},'%')</when>
<when test="searchn == 2"> s.id IS NULL and w.activation = 1 and capacity like concat('%',#{search},'%')</when>
<when test="searchn == 0"> (s.product_id is null or s.product_id &lt;&gt; #{product_id}) and w.activation = 1 and w.name like concat('%',#{search},'%')</when>
<when test="searchn == 1"> (s.product_id is null or s.product_id &lt;&gt; #{product_id}) and w.activation = 1 and address like concat('%',#{search},'%')</when>
<when test="searchn == 2"> (s.product_id is null or s.product_id &lt;&gt; #{product_id}) and w.activation = 1 and capacity like concat('%',#{search},'%')</when>
</choose>
</where>
</select>

View File

@@ -39,7 +39,7 @@
<span id='Warehouse_label' class="input-group-text">창고</span>
<input readonly id="warehouse_name" type="text" class="form-control" placeholder="창고 검색">
<input hidden name="product_id" id="warehouse_id" value="${dto.warehouse_id}">
<button id="Warehouse_search_button" class="btn-primary btn" onclick="showSearchModals('창고 검색','warehouse_capacity_currentCapacity')">검색</button>
<button id="Warehouse_search_button" class="btn-primary btn" onclick="showSearchModals2('창고 검색','warehouse_capacity_currentCapacity')">검색</button>
</div>
<div class="input-group mb-3 w-40 col-centered">
@@ -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 () {

View File

@@ -76,6 +76,7 @@
<th>제품명</th>
<th>카테고리</th>
<th>재고수</th>
<th>창고</th>
</tr>
</thead>
<tbody>
@@ -85,6 +86,7 @@
<td class="col-1">${dto.productName }</td>
<td class="col-1">${dto.cls_nm_4 }</td>
<td class="col-1">${dto.quantity}</td>
<td class="col-1">${dto.warehouseName}</td>
</tr>
</c:forEach>
</tbody>
@@ -96,6 +98,7 @@
<div class="row row-buttons">
<div class="col-3 text-start">
<img width="50" height="50" src="https://img.icons8.com/color/48/ms-excel.png" alt="ms-excel"/>
<button type="button" class="btn btn-success" id="downlodeStockForm">서식 다운로드</button>
<button type="button" class="btn btn-success" id="downlodeExcelList">리스트 다운로드</button>
</div>
<div class="col-6 d-flex justify-content-center">
@@ -192,6 +195,7 @@
<div class="row row-buttons">
<div class="col-3 text-start">
<img width="50" height="50" src="https://img.icons8.com/color/48/ms-excel.png" alt="ms-excel"/>
<button type="button" class="btn btn-success" id="downlodeStockForm2">서식 다운로드</button>
<button type="button" class="btn btn-success" id="downlodeExcelList2">리스트 다운로드</button>
</div>
<div class="col-6 d-flex justify-content-center">
@@ -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");

View File

@@ -142,9 +142,9 @@
return false;
}
if (quantity > remainingcapacity) {
if (quantityAdjustment > remainingcapacity) {
alert("적재 할 재고량이 재고량 한도를 넘을 수 없습니다.");
$("#quantity").focus();
$("#quantityAdjustment").focus();
return false;
}