mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-04 19:54:00 +09:00
#update
stock/list.jsp WarehouseController.java WarehouseMapper.xml WarehouseService.java WarehouseMapper.java
This commit is contained in:
@@ -22,14 +22,15 @@ public class WarehouseController {
|
|||||||
@RequestParam(name = "p", defaultValue = "1") int page, Model m) {
|
@RequestParam(name = "p", defaultValue = "1") int page, Model m) {
|
||||||
int count = service.count(searchn, search);
|
int count = service.count(searchn, search);
|
||||||
|
|
||||||
int perPage = 10; // 한 페이지에 보일 글의 갯수
|
int perPage = 5; // 한 페이지에 보일 글의 갯수
|
||||||
int startRow = (page - 1) * perPage;
|
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("wlist", dto);
|
||||||
|
m.addAttribute("start", startRow + 1);
|
||||||
|
|
||||||
int pageNum = 4;//보여질 페이지 번호 수
|
int pageNum = 5;//보여질 페이지 번호 수
|
||||||
int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수
|
int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수
|
||||||
|
|
||||||
int begin = (page - 1) / pageNum * pageNum + 1;
|
int begin = (page - 1) / pageNum * pageNum + 1;
|
||||||
@@ -41,6 +42,7 @@ public class WarehouseController {
|
|||||||
m.addAttribute("end", end);
|
m.addAttribute("end", end);
|
||||||
m.addAttribute("pageNum", pageNum);
|
m.addAttribute("pageNum", pageNum);
|
||||||
m.addAttribute("totalPages", totalPages);
|
m.addAttribute("totalPages", totalPages);
|
||||||
|
m.addAttribute("p" , page);
|
||||||
|
|
||||||
return "warehouse/list";
|
return "warehouse/list";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ public interface WarehouseMapper {
|
|||||||
|
|
||||||
int count(Map<String, Object> m);//검색 글 갯수
|
int count(Map<String, Object> m);//검색 글 갯수
|
||||||
|
|
||||||
List<Object> list(Map<String, Object> m);
|
List<WarehouseDto> list(Map<String, Object> m);
|
||||||
|
|
||||||
int updateWarehouse(WarehouseDto dto);
|
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);
|
System.out.println(searchn+search);
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ public class WarehouseService {
|
|||||||
m.put("searchn",searchn);
|
m.put("searchn",searchn);
|
||||||
m.put("search", search);
|
m.put("search", search);
|
||||||
m.put("start", start);
|
m.put("start", start);
|
||||||
m.put("perPage", 10);
|
m.put("perPage", perPage);
|
||||||
|
|
||||||
return mapper.list(m);
|
return mapper.list(m);
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="list" parameterType="map" resultType="Object">
|
<select id="list" parameterType="map" resultType="com.no1.wms.warehouse.WarehouseDto">
|
||||||
select * from warehouse
|
select * from warehouse
|
||||||
<where>
|
<where>
|
||||||
<choose>
|
<choose>
|
||||||
|
|||||||
@@ -19,18 +19,18 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="col-12">
|
<div class="col-12" id="search">
|
||||||
<form action="warehouseSearch">
|
<form action="list">
|
||||||
<div class="input-group mb-3 w-30 col-centered">
|
<div class="input-group mb-3 w-30 col-centered">
|
||||||
<div class="w-25">
|
<div class="w-25">
|
||||||
<select class="form-select">
|
<select class="form-select" name="searchn">
|
||||||
<option selected="selected" value="0">창고명</option>
|
<option value="0">창고명</option>
|
||||||
<option value="1">용량</option>
|
<option value="1">용량</option>
|
||||||
<option value="2">적재량</option>
|
<option value="2">적재량</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" name="warehouseSearch" class="form-control" aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
<input type="text" name="search" class="form-control" aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
||||||
<button class="btn btn-info" type="button" id="button-addon2 searchBtn">검색</button>
|
<input class="btn btn-info" type="submit" id="button-addon2 searchBtn" value="검색"/>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -49,6 +49,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
${count}
|
||||||
<c:forEach items="${wlist }" var="dto">
|
<c:forEach items="${wlist }" var="dto">
|
||||||
<tr class="detailTr" data-w_id="${dto.id}" >
|
<tr class="detailTr" data-w_id="${dto.id}" >
|
||||||
<td>${start} <c:set var="start" value="${start +1 }"/></td>
|
<td>${start} <c:set var="start" value="${start +1 }"/></td>
|
||||||
@@ -66,18 +67,29 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="row row-buttons">
|
<div class="row row-buttons">
|
||||||
|
<div class="col-3">
|
||||||
|
|
||||||
|
</div>
|
||||||
<div class="col-6 d-flex justify-content-center">
|
<div class="col-6 d-flex justify-content-center">
|
||||||
<div>
|
<nev>
|
||||||
|
<ul class="pagination">
|
||||||
<c:if test="${begin > pageNum }">
|
<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:if>
|
||||||
<c:forEach begin="${begin }" end="${end }" var="i">
|
<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:forEach>
|
||||||
<c:if test="${end < totalPages }">
|
<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>
|
</c:if>
|
||||||
</div>
|
</ul>
|
||||||
|
</nev>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3 text-end">
|
<div class="col-3 text-end">
|
||||||
<button type="button" class="btn btn-primary" id="createButton">생성</button>
|
<button type="button" class="btn btn-primary" id="createButton">생성</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user