mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-04 12:13:24 +09:00
#update
stock/list.jps WarehouseController.java WarehouseMapper.xml #insert warehouse/read.jsp
This commit is contained in:
@@ -49,8 +49,8 @@ public class WarehouseController {
|
||||
|
||||
|
||||
// 재고 상세페이지
|
||||
@PostMapping("warehouse/read/{id}")
|
||||
public String read(@PathVariable String id, Model m) {
|
||||
@PostMapping("warehouse/read")
|
||||
public String read(String id, Model m) {
|
||||
//스톡서비스로 재고 상세페이지 출력 메서드 작성
|
||||
WarehouseDto dto = service.warehouseOne(id);
|
||||
m.addAttribute("dto", dto);
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</select>
|
||||
|
||||
<select id="warehouseOne" parameterType="String" resultType="com.no1.wms.warehouse.WarehouseDto">
|
||||
selct * from warehouse where id = #{id}
|
||||
select * from warehouse where id = #{id}
|
||||
</select>
|
||||
<!-- select -->
|
||||
|
||||
|
||||
@@ -49,19 +49,16 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
${count}
|
||||
<c:forEach items="${wlist }" var="dto">
|
||||
<tr class="detailTr" data-w_id="${dto.id}" >
|
||||
<tr class="detailTr" data-id="${dto.id}" >
|
||||
<td>${start} <c:set var="start" value="${start +1 }"/></td>
|
||||
<td><a href="read/${dto.id }">
|
||||
${dto.name }</a></td>
|
||||
<td>${dto.name }</td>
|
||||
<td>${dto.capacity }</td>
|
||||
<td>${dto.current_capacity }</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -104,8 +101,30 @@
|
||||
</body>
|
||||
|
||||
<script>
|
||||
$("#createButton").on("click", function() {
|
||||
window.location.href = "/warehouse/create";
|
||||
});
|
||||
$(document).ready(function(){
|
||||
$("#createButton").on("click", function() {
|
||||
window.location.href = "/warehouse/create";
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
$("body").on("click", ".detailTr", function(){
|
||||
var id = $(this).data("id");
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/warehouse/read";
|
||||
form.method = "POST";
|
||||
document.body.appendChild(form);
|
||||
|
||||
var input = document.createElement("input");
|
||||
input.type = "hidden";
|
||||
input.name = "id";
|
||||
input.value = id;
|
||||
form.appendChild(input);
|
||||
|
||||
form.submit();
|
||||
});
|
||||
});//ready
|
||||
</script>
|
||||
</html>
|
||||
|
||||
52
src/main/webapp/WEB-INF/views/warehouse/read.jsp
Normal file
52
src/main/webapp/WEB-INF/views/warehouse/read.jsp
Normal file
@@ -0,0 +1,52 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>창고 상세페이지</title>
|
||||
<style type="text/css">
|
||||
.header {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="col-12">
|
||||
<div class="col-3">
|
||||
</div>
|
||||
<div class="mt-5 mb-5 col-6 text-center">
|
||||
<h1>제품 카테고리 상세페이지</h1>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<button type="button" class="btn btn-danger" id="deleteButton">삭제</button>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#deleteButton").on("click", function() {
|
||||
|
||||
var id = $(this).data("id");
|
||||
|
||||
var form = document.createElement("form");
|
||||
form.action = "/warehouse/list";
|
||||
form.method = "POST";
|
||||
document.body.appendChild(form);
|
||||
|
||||
var input = document.createElement("input");
|
||||
input.type = "hidden";
|
||||
input.name = "id";
|
||||
input.value = id;
|
||||
form.appendChild(input);
|
||||
|
||||
form.submit();
|
||||
});
|
||||
});//ready
|
||||
|
||||
|
||||
</script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user