diff --git a/src/main/java/com/no1/wms/planin/PlanInController.java b/src/main/java/com/no1/wms/planin/PlanInController.java index c413a06..8bfb345 100644 --- a/src/main/java/com/no1/wms/planin/PlanInController.java +++ b/src/main/java/com/no1/wms/planin/PlanInController.java @@ -5,6 +5,7 @@ import java.util.List; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; +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.servlet.ModelAndView; @@ -49,5 +50,18 @@ public class PlanInController { mav.setViewName("planin/list"); return mav; } + + @PostMapping("/read") + public ModelAndView read(ModelAndView mav, PlanInDto dto){ + + System.out.println(dto); + List list = planinservice.selectById(dto); + System.out.println(list.get(0).toString()); + mav.addObject("list", list); + + mav.setViewName("planin/read"); + + return mav; + } } \ No newline at end of file diff --git a/src/main/java/com/no1/wms/planin/PlanInMapper.java b/src/main/java/com/no1/wms/planin/PlanInMapper.java index fb395e1..524f285 100644 --- a/src/main/java/com/no1/wms/planin/PlanInMapper.java +++ b/src/main/java/com/no1/wms/planin/PlanInMapper.java @@ -13,4 +13,6 @@ public interface PlanInMapper { List selectAll(Map m); int count(Map m); + + List selectById(PlanInDto dto); } diff --git a/src/main/java/com/no1/wms/planin/PlanInService.java b/src/main/java/com/no1/wms/planin/PlanInService.java index 534d995..b711061 100644 --- a/src/main/java/com/no1/wms/planin/PlanInService.java +++ b/src/main/java/com/no1/wms/planin/PlanInService.java @@ -32,4 +32,8 @@ public class PlanInService { m.put("perPage", perPage); return mapper.count(m); } + + List selectById(PlanInDto dto){ + return mapper.selectById(dto); + } } diff --git a/src/main/resources/mappers/PlainInMapper.xml b/src/main/resources/mappers/PlainInMapper.xml index 4a76d55..f55563d 100644 --- a/src/main/resources/mappers/PlainInMapper.xml +++ b/src/main/resources/mappers/PlainInMapper.xml @@ -42,7 +42,7 @@ from plan_In plan join account acc join vendor join warehouse join product on plan.product_id = product.id and plan.vendor_id = vendor.id and plan.manager_id = acc.id and plan.warehouse_id = warehouse.id - where plan.group_number = #{groupNumber} and plan.product_id = #{productId} + where plan.group_number = #{groupNumber} -
@@ -38,7 +57,7 @@ - + ${dto.viewGroupNumber} ${dto.productDto.name} ${dto.quantity} @@ -69,6 +88,7 @@
-
- + + +
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/planin/read.jsp b/src/main/webapp/WEB-INF/views/planin/read.jsp new file mode 100644 index 0000000..62d4963 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/planin/read.jsp @@ -0,0 +1,5 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> + + ${dto.productDto.name}
+