diff --git a/src/main/java/com/no1/wms/category/CategoryController.java b/src/main/java/com/no1/wms/category/CategoryController.java index 9e7e4f3..d427557 100644 --- a/src/main/java/com/no1/wms/category/CategoryController.java +++ b/src/main/java/com/no1/wms/category/CategoryController.java @@ -202,6 +202,8 @@ public class CategoryController { return "modal/categorysearch"; }; + + //서식 다운로드 @GetMapping("/category/downlodeCategoryForm") public void downlodeCategoryForm (HttpServletResponse response) throws IOException{ String categoryFormName = "카테고리 데이터 입력 서식.xlsx"; diff --git a/src/main/java/com/no1/wms/price/PriceController.java b/src/main/java/com/no1/wms/price/PriceController.java index e389aea..84d6467 100644 --- a/src/main/java/com/no1/wms/price/PriceController.java +++ b/src/main/java/com/no1/wms/price/PriceController.java @@ -166,4 +166,6 @@ public class PriceController { } + + } diff --git a/src/main/java/com/no1/wms/product/ProductController.java b/src/main/java/com/no1/wms/product/ProductController.java index d4476ce..b5a9240 100644 --- a/src/main/java/com/no1/wms/product/ProductController.java +++ b/src/main/java/com/no1/wms/product/ProductController.java @@ -17,6 +17,8 @@ import org.springframework.web.servlet.ModelAndView; import com.no1.wms.category.CategoryDto; import com.no1.wms.category.CategoryService; import com.no1.wms.price.PriceDto; +import com.no1.wms.vendor.VendorDto; +import com.no1.wms.vendor.VendorService; @Controller @RequestMapping("/product") @@ -26,6 +28,8 @@ public class ProductController { ProductService productService; @Autowired CategoryService categoryService; + @Autowired + VendorService service; /* @GetMapping("list") @@ -141,7 +145,7 @@ public class ProductController { @RequestParam(name = "p", defaultValue = "1") int page, ModelAndView m, String name) { int count = categoryService.count(searchn, search); - int perPage = 10; // 한 페이지에 보일 글의 개수 + int perPage =9; // 한 페이지에 보일 글의 개수 int startRow = (page - 1) * perPage; List dto = categoryService.categoryList2(searchn, search, startRow ,perPage); @@ -171,6 +175,44 @@ public class ProductController { + + @PostMapping("/show_modal2") + public ModelAndView vendorShowModal(@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 = service.count(searchn, search); + + int perPage = 9; // 한 페이지에 보일 글의 갯수 + int startRow = (page - 1) * perPage; + + //스톡서비스로 재고 리스트 출력 메서트 작성 + List dto = service.list(searchn, search, startRow ,perPage); + + + m.addObject("vlist", 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; + } + diff --git a/src/main/webapp/WEB-INF/views/category/read.jsp b/src/main/webapp/WEB-INF/views/category/read.jsp index 8bd5901..7e9a3ee 100644 --- a/src/main/webapp/WEB-INF/views/category/read.jsp +++ b/src/main/webapp/WEB-INF/views/category/read.jsp @@ -12,7 +12,7 @@

제품 카테고리 상세페이지

- +
@@ -91,8 +91,6 @@ form.submit(); })//modifyBtn click - - yesNoModal.yesFunction = deleteCategoryFunction; });//ready @@ -123,6 +121,15 @@ }//deleteCategoryFunction + function goDelete(){ + yesNoModalTextDefine("카테고리 삭제", "해당 카테고리를 삭제하시겠습니까?"); + $("#yesNoModalLabel").text(yesNoModal.title); + $("#yesNoModalBodyTextDiv").text(yesNoModal.body); + yesNoModal.yesFunction = deleteCategoryFunction; + yesNoModalBootStrap.show(); + + + } diff --git a/src/main/webapp/WEB-INF/views/modal/category.jsp b/src/main/webapp/WEB-INF/views/modal/category.jsp index 859198e..044403d 100644 --- a/src/main/webapp/WEB-INF/views/modal/category.jsp +++ b/src/main/webapp/WEB-INF/views/modal/category.jsp @@ -1,12 +1,9 @@ <%@ page contentType="text/html; charset=UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +
@@ -59,11 +119,32 @@ ${dto.cls_nm_3 } ${dto.cls_nm_4 } ${dto.kan_code } - +
+ +
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/modal/price.jsp b/src/main/webapp/WEB-INF/views/modal/price.jsp new file mode 100644 index 0000000..6afa5e7 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/modal/price.jsp @@ -0,0 +1,71 @@ +<%@ 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"%> + +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
번호제품명가격등록날짜담당자선택
${status.count }${dto.productDto.name }${dto.price }${dto.accountDto.name }
+
+
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/modal/product.jsp b/src/main/webapp/WEB-INF/views/modal/product.jsp index 3092221..7ae22a1 100644 --- a/src/main/webapp/WEB-INF/views/modal/product.jsp +++ b/src/main/webapp/WEB-INF/views/modal/product.jsp @@ -1,13 +1,10 @@ <%@ 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"%> +
@@ -62,11 +119,32 @@ ${dto.accountDto.name } - +
+ +
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/modal/vendor.jsp b/src/main/webapp/WEB-INF/views/modal/vendor.jsp new file mode 100644 index 0000000..2fa73e5 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/modal/vendor.jsp @@ -0,0 +1,147 @@ +<%@ 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"%> + + +
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + +
번호업체명대표번호거래처 담당자거래처 담당자 전화번호선택
${start} ${dto.name }${dto.president_telephone }${dto.vendor_manager }${dto.vendor_manager_telephone }
+
+
+
+
+ +
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/price/read.jsp b/src/main/webapp/WEB-INF/views/price/read.jsp index 9071a73..2418ee8 100644 --- a/src/main/webapp/WEB-INF/views/price/read.jsp +++ b/src/main/webapp/WEB-INF/views/price/read.jsp @@ -11,7 +11,7 @@

제품 상세페이지

- +
@@ -118,6 +118,16 @@ }); }//deletePriceFunction + function goDelete(){ + yesNoModalTextDefine("제품가격 삭제", "해당 제품가격을 삭제하시겠습니까?"); + $("#yesNoModalLabel").text(yesNoModal.title); + $("#yesNoModalBodyTextDiv").text(yesNoModal.body); + yesNoModal.yesFunction = deletePriceFunction; + yesNoModalBootStrap.show(); + + + } + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/product/create.jsp b/src/main/webapp/WEB-INF/views/product/create.jsp index 9e78404..a2f0686 100644 --- a/src/main/webapp/WEB-INF/views/product/create.jsp +++ b/src/main/webapp/WEB-INF/views/product/create.jsp @@ -57,17 +57,15 @@ 거래처 + aria-describedby="button-addon2" readonly> - + - - - + @@ -190,7 +188,7 @@ const data = { name : val}; $.ajax({ type : 'post', // 타입 (get, post, put 등등) - url : '/category/show_modal', // 요청할 서버url + url : '/product/show_modal2', // 요청할 서버url dataType : 'html', // 데이터 타입 (html, xml, json, text 등등) data : data, success : function(result) { // 결과 성공 콜백함수 diff --git a/src/main/webapp/WEB-INF/views/product/read.jsp b/src/main/webapp/WEB-INF/views/product/read.jsp index 46d6994..2cda58f 100644 --- a/src/main/webapp/WEB-INF/views/product/read.jsp +++ b/src/main/webapp/WEB-INF/views/product/read.jsp @@ -11,7 +11,7 @@

제품 상세페이지

- +
@@ -128,7 +128,15 @@ }); }//deleteProductFunction - + function goDelete(){ + yesNoModalTextDefine("제품 삭제", "해당 제품을 삭제하시겠습니까?"); + $("#yesNoModalLabel").text(yesNoModal.title); + $("#yesNoModalBodyTextDiv").text(yesNoModal.body); + yesNoModal.yesFunction = deleteProductFunction; + yesNoModalBootStrap.show(); + + + } \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/product/update.jsp b/src/main/webapp/WEB-INF/views/product/update.jsp index 8f03a25..4e43aa0 100644 --- a/src/main/webapp/WEB-INF/views/product/update.jsp +++ b/src/main/webapp/WEB-INF/views/product/update.jsp @@ -42,15 +42,15 @@ -
- 거래처 - - - - -
+
+ 거래처 + + + +
등록날짜 @@ -61,9 +61,7 @@ - - - +
@@ -188,7 +186,24 @@ alert(error) } }); - } + }//showSearchModal + function showSearchModal2(title, val){ + $("#searchModalLabel").text(title); + const data = { name : val}; + $.ajax({ + type : 'post', // 타입 (get, post, put 등등) + url : '/product/show_modal2', // 요청할 서버url + dataType : 'html', // 데이터 타입 (html, xml, json, text 등등) + data : data, + success : function(result) { // 결과 성공 콜백함수 + $("#search_modal_body").html(result); + searchModalBootStrap.show(); + }, + error : function(request, status, error) { + alert(error) + } + }); + }//showSearchModal2