From bfb2e8fa14b37f68bcdfbf8199c1557c23e5af33 Mon Sep 17 00:00:00 2001 From: sungsuhub <145002081+sungsuhub@users.noreply.github.com> Date: Wed, 24 Jan 2024 11:16:45 +0900 Subject: [PATCH 1/3] Update MainPageController.java --- .../com/no1/wms/base/MainPageController.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/no1/wms/base/MainPageController.java b/src/main/java/com/no1/wms/base/MainPageController.java index de62206..2120bcd 100644 --- a/src/main/java/com/no1/wms/base/MainPageController.java +++ b/src/main/java/com/no1/wms/base/MainPageController.java @@ -1,13 +1,32 @@ package com.no1.wms.base; +import com.no1.wms.stock.StockService; +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; + +import java.util.List; +import java.util.Map; @Controller public class MainPageController { + @Autowired + StockService service; + @GetMapping("/main") - public String mainPage() { + public String mainPage(@RequestParam(name = "searchn2", defaultValue = "0") int searchn2, + @RequestParam(name = "search2", defaultValue = "") String search2, + @RequestParam(name = "p2", defaultValue = "1") int p2, Model m) { + + int perPage2 = 5; // 한 페이지에 보일 글의 갯수 + int startRow2 = (p2 - 1) * perPage2; + + List> dto2 = service.list2(searchn2, search2, startRow2 ,perPage2); + m.addAttribute("slist2", dto2); + System.out.println("리스트 확인 : : " + dto2); return "base/main"; } } From c84ebae56c7cfec824bfefbb603885a0c12fb0f5 Mon Sep 17 00:00:00 2001 From: sungsuhub <145002081+sungsuhub@users.noreply.github.com> Date: Wed, 24 Jan 2024 11:17:30 +0900 Subject: [PATCH 2/3] Update main.jsp --- src/main/webapp/WEB-INF/views/base/main.jsp | 225 ++++++++++++-------- 1 file changed, 135 insertions(+), 90 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/base/main.jsp b/src/main/webapp/WEB-INF/views/base/main.jsp index b155236..d1ef02c 100644 --- a/src/main/webapp/WEB-INF/views/base/main.jsp +++ b/src/main/webapp/WEB-INF/views/base/main.jsp @@ -1,106 +1,151 @@ -<%@ page contentType="text/html; charset=UTF-8"%> +<%@ page contentType="text/html; charset=UTF-8" %>3 +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> - -Insert title here + + Insert title here -
- -
-
-
첫 번째 공간
-
+
-
-

No.1 WMS 달력

-
- -
-
+
+
+
Default Image
+
-
-
- -
세 번째 공간
-
+
+

No.1 WMS 달력

+
+ +
+
-
- -
네 번째 공간
-
-
-
+
+
+ +
+
+
부족한 재고
+
+ + + + + + + + + + + + + + + + + + + + + +
번호제품명카테고리재고수창고
${start2} ${dto.productName }${dto.cls_nm_4 }${dto.quantity }${dto.warehouseName}
+
+
+ +
+ +
네 번째 공간
+
+
+
+ + + + + + - - - - - + var form = document.createElement("form"); + form.action = "/stock/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(); + + }); + }); + - \ No newline at end of file + From 8e38a3f5205f1923a802d4818e2664c8f0b288c2 Mon Sep 17 00:00:00 2001 From: sungsuhub <145002081+sungsuhub@users.noreply.github.com> Date: Wed, 24 Jan 2024 11:18:21 +0900 Subject: [PATCH 3/3] Update StockMapper.xml --- src/main/resources/mappers/StockMapper.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/mappers/StockMapper.xml b/src/main/resources/mappers/StockMapper.xml index de75fa7..b78de68 100644 --- a/src/main/resources/mappers/StockMapper.xml +++ b/src/main/resources/mappers/StockMapper.xml @@ -64,7 +64,7 @@ quantity <= 200 and s.activation = 1 and p.name like concat('%',#{search},'%') quantity <= 200 and s.activation = 1 and c.cls_Nm_4 like concat('%',#{search},'%') quantity <= 200 and s.activation = 1 and s.quantity like concat('%',#{search},'%') - s.activation = 1 and w.name like concat('%',#{search},'%') + quantity <= 200 and s.activation = 1 and w.name like concat('%',#{search},'%') @@ -82,7 +82,7 @@ quantity <= 200 and s.activation = 1 and p.name like concat('%',#{search},'%') quantity <= 200 and s.activation = 1 and c.cls_Nm_4 like concat('%',#{search},'%') quantity <= 200 and s.activation = 1 and s.quantity like concat('%',#{search},'%') - s.activation = 1 and w.name like concat('%',#{search},'%') + quantity <= 200 and s.activation = 1 and w.name like concat('%',#{search},'%') order by s.id desc limit #{start}, #{perPage} @@ -230,4 +230,4 @@ INSERT INTO stock (id, warehouse_id, product_id, quantity, activation) VALUES (UUID(), #{warehouseId}, #{productId}, #{quantity}, 1) - \ No newline at end of file +