mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-04 12:13:24 +09:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -98,16 +98,14 @@ public class CategoryController {
|
||||
}
|
||||
|
||||
// 삭제
|
||||
@DeleteMapping("/category/delete/{kan_code}")
|
||||
@DeleteMapping("/category/delete")
|
||||
@ResponseBody
|
||||
public int delete(@PathVariable String kan_code) {
|
||||
public boolean delete(String kan_code) {
|
||||
int i = categoryService.deactivateByKanCode(kan_code);
|
||||
if (i == 1) {
|
||||
return i;
|
||||
return true;
|
||||
} else {
|
||||
// ajax테스트후 결정
|
||||
// m.addAttribute("dto", dto);
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
28
src/main/java/com/no1/wms/product/ProductController.java
Normal file
28
src/main/java/com/no1/wms/product/ProductController.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.no1.wms.product;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@Controller
|
||||
public class ProductController {
|
||||
|
||||
@Autowired
|
||||
ProductService productservice;
|
||||
|
||||
@GetMapping("/product/list")
|
||||
public String list(@RequestParam(name = "p", defaultValue = "1") int p, Model m) {
|
||||
|
||||
// 서비스로 카테고리 목록 불러오는 메서드 작성
|
||||
List<ProductDto> dto = productservice.productList(p);
|
||||
m.addAttribute("list", dto);
|
||||
return "product/list";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
33
src/main/java/com/no1/wms/product/ProductDto.java
Normal file
33
src/main/java/com/no1/wms/product/ProductDto.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package com.no1.wms.product;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
import com.no1.wms.account.AccountDto;
|
||||
import com.no1.wms.category.CategoryDto;
|
||||
import com.no1.wms.vendor.VendorDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@Alias("ProductDto")
|
||||
public class ProductDto {
|
||||
|
||||
private String id;//id
|
||||
private String name;//제품명
|
||||
private String company_name;//회사명
|
||||
private String kan_code;//분류코드
|
||||
private String vendor_id;//거래처 id
|
||||
private Date registration_date;//등록날짜
|
||||
private String manager_id;//담당자
|
||||
private boolean activation;//활성화
|
||||
|
||||
private VendorDto vendorDto;
|
||||
private AccountDto accountDto;
|
||||
private CategoryDto categoryDto;
|
||||
|
||||
|
||||
}
|
||||
15
src/main/java/com/no1/wms/product/ProductMapper.java
Normal file
15
src/main/java/com/no1/wms/product/ProductMapper.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.no1.wms.product;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface ProductMapper {
|
||||
|
||||
List<ProductDto> productList(Map<String, Object> m);
|
||||
|
||||
|
||||
|
||||
}
|
||||
29
src/main/java/com/no1/wms/product/ProductService.java
Normal file
29
src/main/java/com/no1/wms/product/ProductService.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package com.no1.wms.product;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ProductService {
|
||||
|
||||
@Autowired
|
||||
ProductMapper mapper;
|
||||
|
||||
public List<ProductDto> productList(int p){
|
||||
//페이징 완료되면 수정해야함.
|
||||
|
||||
int start = 0;
|
||||
int count = 10;
|
||||
|
||||
Map m = new HashMap<String, Object>();
|
||||
m.put("start", start);
|
||||
m.put("count", count);
|
||||
|
||||
return mapper.productList(m);
|
||||
}
|
||||
|
||||
}
|
||||
25
src/main/java/com/no1/wms/vendor/VendorDto.java
vendored
Normal file
25
src/main/java/com/no1/wms/vendor/VendorDto.java
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.no1.wms.vendor;
|
||||
|
||||
import org.apache.ibatis.type.Alias;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@Alias("VendorDto")
|
||||
public class VendorDto {
|
||||
|
||||
private String id;
|
||||
private String name;
|
||||
private String president_name;
|
||||
private String address;
|
||||
private String registration_number;
|
||||
private String email;
|
||||
private String president_telephone;
|
||||
private String vendor_manager;
|
||||
private String vendor_manager_telephone;
|
||||
private String main_product;
|
||||
private String manager_id;
|
||||
private boolean activation;
|
||||
}
|
||||
@@ -22,14 +22,15 @@ public class WarehouseController {
|
||||
@RequestParam(name = "p", defaultValue = "1") int page, Model m) {
|
||||
int count = service.count(searchn, search);
|
||||
|
||||
int perPage = 10; // 한 페이지에 보일 글의 갯수
|
||||
int perPage = 5; // 한 페이지에 보일 글의 갯수
|
||||
int startRow = (page - 1) * perPage;
|
||||
|
||||
//스톡서비스로 재고 리스트 출력 메서트 작성
|
||||
List<Object> dto = service.list(searchn, search, perPage);
|
||||
List<WarehouseDto> dto = service.list(searchn, search, startRow ,perPage);
|
||||
m.addAttribute("wlist", dto);
|
||||
m.addAttribute("start", startRow + 1);
|
||||
|
||||
int pageNum = 4;//보여질 페이지 번호 수
|
||||
int pageNum = 5;//보여질 페이지 번호 수
|
||||
int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수
|
||||
|
||||
int begin = (page - 1) / pageNum * pageNum + 1;
|
||||
@@ -41,14 +42,15 @@ public class WarehouseController {
|
||||
m.addAttribute("end", end);
|
||||
m.addAttribute("pageNum", pageNum);
|
||||
m.addAttribute("totalPages", totalPages);
|
||||
m.addAttribute("p" , page);
|
||||
|
||||
return "warehouse/list";
|
||||
}
|
||||
|
||||
|
||||
// 재고 상세페이지
|
||||
@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);
|
||||
|
||||
@@ -11,7 +11,7 @@ public interface WarehouseMapper {
|
||||
|
||||
int count(Map<String, Object> m);//검색 글 갯수
|
||||
|
||||
List<Object> list(Map<String, Object> m);
|
||||
List<WarehouseDto> list(Map<String, Object> m);
|
||||
|
||||
int updateWarehouse(WarehouseDto dto);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ public class WarehouseService {
|
||||
}
|
||||
|
||||
|
||||
public List<Object> list(int searchn, String search, int start){
|
||||
public List<WarehouseDto> list(int searchn, String search, int start, int perPage){
|
||||
|
||||
System.out.println(searchn+search);
|
||||
|
||||
@@ -30,7 +30,7 @@ public class WarehouseService {
|
||||
m.put("searchn",searchn);
|
||||
m.put("search", search);
|
||||
m.put("start", start);
|
||||
m.put("perPage", 10);
|
||||
m.put("perPage", perPage);
|
||||
|
||||
return mapper.list(m);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
|
||||
<select id="categoryList" parameterType="map" resultType="CategoryDto">
|
||||
select * from product_category
|
||||
select * from product_category where activation != 0
|
||||
order by kan_code limit #{start} , #{count}
|
||||
</select>
|
||||
|
||||
|
||||
57
src/main/resources/mappers/ProductMapper.xml
Normal file
57
src/main/resources/mappers/ProductMapper.xml
Normal file
@@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTO Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.no1.wms.product.ProductMapper">
|
||||
<resultMap id="authorityResultMap" type="AuthorityDto">
|
||||
<id column="id" property="id" />
|
||||
<result column="name" property="name" />
|
||||
<result column="company_name" property="company_name" />
|
||||
<result column="kan_code" property="kan_code" />
|
||||
<result column="vendor_id" property="vendor_id" />
|
||||
<result column="registration_date" property="registration_date" />
|
||||
<result column="manager_id" property="manager_id" />
|
||||
<result column="activation" property="activation" />
|
||||
<association property="vendorDto" javaType="VendorDto">
|
||||
<id column="vendor_name" property="name" />
|
||||
<result column="president_name" property="president_name" />
|
||||
</association>
|
||||
<association property="accountDto" javaType="AccountDto">
|
||||
<id column="account_name" property="name" />
|
||||
</association>
|
||||
<association property="categoryDto" javaType="CategoryDto">
|
||||
<id column="personal_authority_id" property="personalAuthorityId" />
|
||||
<result column="cls_nm_1" property="cls_nm_1" />
|
||||
<result column="cls_nm_2" property="cls_nm_2" />
|
||||
<result column="cls_nm_3" property="cls_nm_3" />
|
||||
<result column="cls_nm_4" property="cls_nm_4" />
|
||||
</association>
|
||||
</resultMap>
|
||||
|
||||
<!-- insert -->
|
||||
|
||||
|
||||
<!-- update -->
|
||||
|
||||
|
||||
<!-- delete -->
|
||||
|
||||
|
||||
<!-- select -->
|
||||
<select id="productList" parameterType="map" resultType="productDto">
|
||||
SELECT
|
||||
p.id, p.name, p.company_name, p.kan_code, p.vendor_id, p.registration_date,
|
||||
p.manager_id, p.activation,
|
||||
v.name as vendor_name, v.president_name,
|
||||
a.name as account_name,
|
||||
pc.cls_nm_1, pc.cls_nm_2, pc.cls_nm_3, pc.cls_nm_4
|
||||
FROM product as p
|
||||
left join vendor as v on p.vendor_id = v.id
|
||||
left join account as a on p.manager_id = a.id
|
||||
left join product_category as pc on p.kan_code = pc.kan_code
|
||||
WHERE p.activation != 0
|
||||
ORDER BY p.registration_date limit #{start} , #{count}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -16,7 +16,7 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="list" parameterType="map" resultType="Object">
|
||||
<select id="list" parameterType="map" resultType="com.no1.wms.warehouse.WarehouseDto">
|
||||
select * from warehouse
|
||||
<where>
|
||||
<choose>
|
||||
@@ -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 -->
|
||||
|
||||
|
||||
@@ -56,12 +56,11 @@
|
||||
aria-describedby="basic-addon1">
|
||||
</div>
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<input type="number" name="kan_code" id="kan_code" class="form-control"
|
||||
<input type="number" min="1" name="kan_code" id="kan_code" class="form-control"
|
||||
placeholder="KAN 분류코드" aria-label="KAN 분류코드" value="${dto.kan_code }"
|
||||
aria-describedby="button-addon2">
|
||||
<button class="btn btn-outline-secondary" id="checkKan"
|
||||
style="background-color:#FF5E5E;" type="button"
|
||||
id="button-addon2">중복확인</button>
|
||||
<button class="btn btn-outline-secondary rounded-end" id="checkKan"
|
||||
style="background-color:#FF5E5E;" type="button" >중복확인</button>
|
||||
<input type='hidden' id='kan_chack' value='0'>
|
||||
</div>
|
||||
</div>
|
||||
@@ -94,6 +93,14 @@
|
||||
$("#checkKan").prop("disabled", false);
|
||||
return false;
|
||||
}
|
||||
|
||||
//1이상의 정수만 입력받는다.
|
||||
if (kanCode <= 0){
|
||||
alert("KAN 분류코드는 1 이상의 정수를 입력해주세요");
|
||||
$("#kan_code").focus();
|
||||
$("#checkKan").prop("disabled", false);
|
||||
return false;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: "/category/checkKancode",
|
||||
|
||||
@@ -8,7 +8,13 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="mt-5 mb-5 text-center">
|
||||
|
||||
<div class="row">
|
||||
<h1>제품 카테고리 상세페이지</h1>
|
||||
<div class="col-10" style="text-align: right;">
|
||||
<button type="button" class="btn btn-danger" id="yes_no_modal_show_button">삭제</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
@@ -86,10 +92,41 @@
|
||||
|
||||
})//modifyBtn click
|
||||
|
||||
|
||||
|
||||
yesNoModal.yesFunction = deleteCategoryFunction;
|
||||
});//ready
|
||||
|
||||
|
||||
|
||||
|
||||
function deleteCategoryFunction(){
|
||||
var kan_code = $("#kan_code").val();
|
||||
$.ajax({
|
||||
url: "/category/delete",
|
||||
type: "delete",
|
||||
data: {
|
||||
"kan_code": kan_code
|
||||
},
|
||||
datatype:"json"
|
||||
}).done(function(data) {
|
||||
if (data == true) {
|
||||
alert("삭제되었습니다.");
|
||||
$(location).attr("href", "/category/list");
|
||||
} else {
|
||||
alert("정상적으로 삭제되지 않았습니다..");
|
||||
}
|
||||
}).fail(function() {
|
||||
alert("오류가 발생했습니다.");
|
||||
}).always(function() {
|
||||
//
|
||||
});
|
||||
|
||||
}//deleteCategoryFunction
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
115
src/main/webapp/WEB-INF/views/product/list.jsp
Normal file
115
src/main/webapp/WEB-INF/views/product/list.jsp
Normal file
@@ -0,0 +1,115 @@
|
||||
<%@ page contentType="text/html; charset=UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>제품 목록</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="mt-5 mb-5 text-center">
|
||||
<h1>제품 관리</h1>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="body">
|
||||
<div class="container-fluid">
|
||||
<div class="col-12">
|
||||
<form action="productSearch">
|
||||
<div class="input-group mb-3 w-30 col-centered">
|
||||
<div class="w-25">
|
||||
<select class="form-select">
|
||||
<option selected="selected" value="name">제품명</option>
|
||||
<option value="cls_nm_1">회사명</option>
|
||||
<option value="cls_nm_2">등록날짜</option>
|
||||
<option value="cls_nm_3">담당자명</option>
|
||||
<option value="kan_code">KAN코드</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="text" name="productSearch" class="form-control" aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
||||
<button class="btn btn-info" type="button" id="button-addon2 searchBtn">검색</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row row-table">
|
||||
<div class="col-12">
|
||||
<table class="table">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th>제품명</th>
|
||||
<th>회사명</th>
|
||||
<th>소분류</th>
|
||||
<th>거래처</th>
|
||||
<th>등록날짜</th>
|
||||
<th>담당자</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${list }" var="dto">
|
||||
<tr class="detailTr" data-productId="${dto.id}" >
|
||||
<td>${dto.name }</td>
|
||||
<td>${dto.company_name }</td>
|
||||
<!-- <td>${dto.categoryDto.cls_nm_4 }</td>
|
||||
<td>${dto.vendorDto.name }</td>
|
||||
<td>${dto.registration_date }</td>
|
||||
<td>${dto.accountDto.name }</td>-->
|
||||
<td>1</td>
|
||||
<td>2</td>
|
||||
<td>3</td>
|
||||
<td>4</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row row-buttons">
|
||||
<div class="col-3 text-start">
|
||||
<img alt="엑셀이미지" src="엑셀이미지">
|
||||
<button type="button" class="btn btn-success" id="uploadExcel">업로드</button>
|
||||
</div>
|
||||
<div class="col-6 d-flex justify-content-center">
|
||||
<nav>
|
||||
<ul class="pagination">
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#"><</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#">1</a>
|
||||
</li>
|
||||
<li class="page-item active">
|
||||
<a class="page-link" href="#">2</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#">3</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#">4</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#">5</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#">6</a>
|
||||
</li>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="#">></a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="col-3 text-end">
|
||||
<button type="button" class="btn btn-primary" id="createButton">생성</button>
|
||||
</div>
|
||||
</div><!-- row row-buttons -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -19,18 +19,18 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="container-fluid">
|
||||
<div class="col-12">
|
||||
<form action="warehouseSearch">
|
||||
<div class="col-12" id="search">
|
||||
<form action="list">
|
||||
<div class="input-group mb-3 w-30 col-centered">
|
||||
<div class="w-25">
|
||||
<select class="form-select">
|
||||
<option selected="selected" value="0">창고명</option>
|
||||
<select class="form-select" name="searchn">
|
||||
<option value="0">창고명</option>
|
||||
<option value="1">용량</option>
|
||||
<option value="2">적재량</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="text" name="warehouseSearch" class="form-control" aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
||||
<button class="btn btn-info" type="button" id="button-addon2 searchBtn">검색</button>
|
||||
<input type="text" name="search" class="form-control" aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
||||
<input class="btn btn-info" type="submit" id="button-addon2 searchBtn" value="검색"/>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -50,34 +50,43 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<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>
|
||||
<div class="container-fluid">
|
||||
<div class="row row-buttons">
|
||||
<div class="col-3">
|
||||
|
||||
</div>
|
||||
<div class="col-6 d-flex justify-content-center">
|
||||
<div>
|
||||
<nev>
|
||||
<ul class="pagination">
|
||||
<c:if test="${begin > pageNum }">
|
||||
<a href="list.jsp?p=${begin - 1 }">이전</a>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="list?p=${begin - 1 }"><</a>
|
||||
</li>
|
||||
</c:if>
|
||||
<c:forEach begin="${begin }" end="${end }" var="i">
|
||||
<a href="list.jsp?p=${i }">${i }</a>
|
||||
<li class="page-item <c:if test="${p == i}"> active </c:if>">
|
||||
<a class="page-link " href="list?p=${i }">${i }</a>
|
||||
</li>
|
||||
</c:forEach>
|
||||
<c:if test="${end < totalPages }">
|
||||
<a href="list.jsp?p=${end + 1 }">다음</a>
|
||||
<li class="page-item">
|
||||
<a class="page-link" href="list?p=${end + 1 }">></a>
|
||||
</li>
|
||||
</c:if>
|
||||
</div>
|
||||
</ul>
|
||||
</nev>
|
||||
</div>
|
||||
<div class="col-3 text-end">
|
||||
<button type="button" class="btn btn-primary" id="createButton">생성</button>
|
||||
@@ -92,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