diff --git a/src/main/java/com/no1/wms/in/InController.java b/src/main/java/com/no1/wms/in/InController.java index 80e3f58..21976aa 100644 --- a/src/main/java/com/no1/wms/in/InController.java +++ b/src/main/java/com/no1/wms/in/InController.java @@ -1,6 +1,7 @@ package com.no1.wms.in; import java.util.List; +import java.util.Map; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -10,6 +11,12 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.ModelAndView; + +import com.no1.wms.price.PriceDto; +import com.no1.wms.product.ProductDto; +import com.no1.wms.product.ProductService; +import com.no1.wms.stock.StockService; @Controller @RequestMapping("/in") @@ -17,6 +24,10 @@ public class InController { @Autowired InService inService; + @Autowired + ProductService productService; + @Autowired + StockService stockservice; @GetMapping("/list") //@ResponseBody @@ -59,6 +70,112 @@ public class InController { return "in/create"; } + /* + * + @PostMapping("/create_process") + @ResponseBody + public boolean createProcess(PriceDto dto) { + int i = inService.createProcess(dto); + if (i == 1) { + return true; + } else { + return false; + } + } + + */ + + + + + + + + + + + + + //모달화면 + @PostMapping("/show_modal_product") + public ModelAndView productShowModal(@RequestParam(name = "searchn", defaultValue = "0") int searchn, + @RequestParam(name = "search", defaultValue = "") String search, + @RequestParam(name = "p", defaultValue = "1") int page, ModelAndView m, String name) { + int count = productService.count(searchn, search); + + int perPage = 10; // 한 페이지에 보일 글의 개수 + int startRow = (page - 1) * perPage; + + List dto = productService.productList(searchn, search, startRow ,perPage); + + m.addObject("list", dto); + m.addObject("start", startRow + 1); + + int pageNum = 5;//보여질 페이지 번호 수 + int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수 + + int begin = (page - 1) / pageNum * pageNum + 1; + int end = begin + pageNum - 1; + if (end > totalPages) { + end = totalPages; + } + + m.addObject("searchn",searchn); + m.addObject("search",search); + m.addObject("begin", begin); + m.addObject("end", end); + m.addObject("pageNum", pageNum); + m.addObject("totalPages", totalPages); + m.addObject("p" , page); + m.setViewName(name); + return m; + } + + @PostMapping("/show_modal_warehouse") + public ModelAndView warehouseShowModal(@RequestParam(name = "searchn", defaultValue = "0") int searchn, + @RequestParam(name = "search", defaultValue = "") String search, + @RequestParam(name = "p", defaultValue = "1") int page, + @RequestParam String name, ModelAndView mav){ + + int perPage = 9; // 한 페이지에 보일 글의 갯수 + int startRow = (page - 1) * perPage; + + List> list = null; + int count = 0; + + list = stockservice.warehousesSelect(searchn, search, startRow, perPage); + count = stockservice.warehouseCount(searchn, search); + + + mav.addObject("list", list); + + mav.addObject("start", startRow + 1); + + int pageNum = 5;//보여질 페이지 번호 수 + int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수 + + int begin = (page - 1) / pageNum * pageNum + 1; + int end = begin + pageNum - 1; + if (end > totalPages) { + end = totalPages; + } + mav.addObject("searchn", searchn); + mav.addObject("search", search); + mav.addObject("begin", begin); + mav.addObject("end", end); + mav.addObject("pageNum", pageNum); + mav.addObject("totalPages", totalPages); + mav.addObject("p" , page); + + mav.setViewName(name); + return mav; + } + + + + + + } diff --git a/src/main/resources/mappers/InMapper.xml b/src/main/resources/mappers/InMapper.xml index 6453cc8..fbc9a7d 100644 --- a/src/main/resources/mappers/InMapper.xml +++ b/src/main/resources/mappers/InMapper.xml @@ -69,40 +69,7 @@ - - - + diff --git a/src/main/webapp/WEB-INF/views/in/create.jsp b/src/main/webapp/WEB-INF/views/in/create.jsp index 31b7e19..f5339d9 100644 --- a/src/main/webapp/WEB-INF/views/in/create.jsp +++ b/src/main/webapp/WEB-INF/views/in/create.jsp @@ -1,5 +1,6 @@ <%@ page contentType="text/html; charset=UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> @@ -22,25 +23,84 @@
- +
제품명 + style="background-color:#FF5E5E;" type="button" onclick="showSearchModal_product('제품 검색','product')" >검색
- +
- 가격 - + 회사명 + +
+ +
+ 분류 + +
+ +
+ 거래처 + +
+ + + + + + +
+ 수량 + +
+ +
+ 창고명 + + + +
+
+ 주소 + +
+ +
+ 용적 + +
+ +
+ 잔여 용량 + +
+ + + + + +
+ 입고날짜 + + +
+ +
@@ -49,7 +109,7 @@
- +
@@ -58,8 +118,107 @@
diff --git a/src/main/webapp/WEB-INF/views/in/list.jsp b/src/main/webapp/WEB-INF/views/in/list.jsp index e33654e..b692e47 100644 --- a/src/main/webapp/WEB-INF/views/in/list.jsp +++ b/src/main/webapp/WEB-INF/views/in/list.jsp @@ -48,6 +48,7 @@ 가격 수량 입고예정그룹번호 + 창고이름 입고날짜 담당자 @@ -59,7 +60,13 @@ ${dto.productDto.name } ${dto.latest_price } ${dto.quantity } - ${dto.planInDto.viewGroupNumber } + + ${dto.planInDto.viewGroupNumber} + + + + + ${dto.warehouseDto.name } ${dto.accountDto.name } diff --git a/src/main/webapp/WEB-INF/views/modal/product.jsp b/src/main/webapp/WEB-INF/views/modal/product.jsp index 7ae22a1..23146c3 100644 --- a/src/main/webapp/WEB-INF/views/modal/product.jsp +++ b/src/main/webapp/WEB-INF/views/modal/product.jsp @@ -8,9 +8,16 @@ const $tag = $(tag); const tid = $tag.data('tid'); const name = $tag.data('tname'); + const company_name = $tag.data('tcompany_name'); + const cls_nm_4 = $tag.data('tcls_nm_4'); + const vendor_name = $tag.data('tvendor_name'); + $("#productName").val(name); $("#product_id").val(tid); + $("#company_name").val(company_name); + $("#cls_Nm_4").val(cls_nm_4); + $("#vendor_name").val(vendor_name); hideSearchModal(); }//onSelect @@ -119,7 +126,7 @@ ${dto.accountDto.name } - + diff --git a/src/main/webapp/WEB-INF/views/price/create.jsp b/src/main/webapp/WEB-INF/views/price/create.jsp index c39690d..7f34cfd 100644 --- a/src/main/webapp/WEB-INF/views/price/create.jsp +++ b/src/main/webapp/WEB-INF/views/price/create.jsp @@ -38,7 +38,23 @@
- + +
+ 회사명 + +
+ +
+ 분류 + +
+ +
+ 거래처 + +
+ +
가격
-

제품 상세페이지

+

제품 가격 상세페이지