mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-04 12:13:24 +09:00
입고 예정 추가 구현중
This commit is contained in:
@@ -5,11 +5,15 @@ 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.PathVariable;
|
||||
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;
|
||||
|
||||
import com.no1.wms.product.ProductDto;
|
||||
import com.no1.wms.product.ProductService;
|
||||
|
||||
|
||||
|
||||
@Controller
|
||||
@@ -17,6 +21,8 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
public class PlanInController {
|
||||
@Autowired
|
||||
PlanInService planinservice;
|
||||
@Autowired
|
||||
ProductService productservice;
|
||||
|
||||
@GetMapping("/list")
|
||||
public ModelAndView list(ModelAndView mav,@RequestParam(defaultValue = "0") int searchn, @RequestParam(defaultValue = "") String search, @RequestParam(defaultValue = "1") int page){
|
||||
@@ -58,8 +64,44 @@ public class PlanInController {
|
||||
List<PlanInDto> list = planinservice.selectById(dto);
|
||||
System.out.println(list.get(0).toString());
|
||||
mav.addObject("list", list);
|
||||
mav.addObject("groupNum", dto.getGroupNumber());
|
||||
|
||||
mav.setViewName("planin/read");
|
||||
|
||||
return mav;
|
||||
}
|
||||
|
||||
@PostMapping("/update")
|
||||
public ModelAndView update(PlanInDto dto, ModelAndView mav){
|
||||
List<PlanInDto> list = planinservice.selectById(dto);
|
||||
mav.addObject("list", list);
|
||||
|
||||
mav.setViewName("/planin/update");
|
||||
|
||||
return mav;
|
||||
}
|
||||
|
||||
// 엑셀 다운로드
|
||||
@GetMapping("/qr/{id}")
|
||||
public String qr(@PathVariable("id")String id)
|
||||
{
|
||||
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
// 입고예정추가
|
||||
@PostMapping("/planin_add")
|
||||
public ModelAndView insert(ModelAndView mav, ProductDto dto)
|
||||
{
|
||||
List<ProductDto> list = productservice.productList(0, "", 0, 10000);
|
||||
//list
|
||||
//ProductDto (0)
|
||||
//ProductDto (1)
|
||||
//ProductDto (2)
|
||||
mav.addObject("list", list);
|
||||
|
||||
mav.setViewName("planin_add");
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class PlanInDto {
|
||||
private Boolean activation;
|
||||
private Integer viewGroupNumber;
|
||||
private String oldProductId;
|
||||
private String cName;
|
||||
private String caName;
|
||||
|
||||
private ProductDto productDto;
|
||||
private VendorDto vendorDto;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<result column="other" property="other" />
|
||||
<result column="activation" property="activation" />
|
||||
<result column="view_group_number" property="viewGroupNumber" />
|
||||
<result column="c_name" property="cName" />
|
||||
<result column="ca_name" property="caName" />
|
||||
<association property="productDto" javaType="productDto">
|
||||
<id column="p_id" property="id" />
|
||||
<result column="p_name" property="name" />
|
||||
@@ -40,7 +40,7 @@
|
||||
plan.group_number, plan.product_id, plan.quantity, plan.date, plan.vendor_id, plan.manager_id,
|
||||
plan.warehouse_id, plan.qr_hash, plan.url, plan.clear, plan.vendor_date, plan.other, plan.activation, plan.view_group_number,
|
||||
product.id p_id, product.name p_name, acc.id acc_id, acc.name acc_name, vendor.id v_id, vendor.name v_name,
|
||||
warehouse.id w_id, warehouse.name w_name, product_category.kan_code p_kan, product_category.cls_Nm_4 c_name
|
||||
warehouse.id w_id, warehouse.name w_name, product_category.kan_code p_kan, product_category.cls_Nm_4 ca_name
|
||||
from plan_In plan join account acc join vendor join warehouse join product join product_category
|
||||
on plan.product_id = product.id and plan.vendor_id = vendor.id and plan.manager_id = acc.id
|
||||
and plan.warehouse_id = warehouse.id and product.kan_code = product_category.kan_code
|
||||
@@ -51,7 +51,7 @@
|
||||
plan.group_number, plan.product_id, plan.quantity, plan.date, plan.vendor_id, plan.manager_id,
|
||||
plan.warehouse_id, plan.qr_hash, plan.url, plan.clear, plan.vendor_date, plan.other, plan.activation, plan.view_group_number,
|
||||
product.id p_id, product.name p_name, acc.id acc_id, acc.name acc_name, vendor.id v_id, vendor.name v_name,
|
||||
warehouse.id w_id, warehouse.name w_name, product_category.kan_code p_kan, product_category.cls_Nm_4 c_name
|
||||
warehouse.id w_id, warehouse.name w_name, product_category.kan_code p_kan, product_category.cls_Nm_4 ca_name
|
||||
from plan_In plan join account acc join vendor join warehouse join product join product_category
|
||||
on plan.product_id = product.id and plan.vendor_id = vendor.id and plan.manager_id = acc.id
|
||||
and plan.warehouse_id = warehouse.id and product.kan_code = product_category.kan_code
|
||||
|
||||
120
src/main/webapp/WEB-INF/views/modal/planin_add.jsp
Normal file
120
src/main/webapp/WEB-INF/views/modal/planin_add.jsp
Normal file
@@ -0,0 +1,120 @@
|
||||
<%@ 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" %>
|
||||
|
||||
<script>
|
||||
function goDown(target){
|
||||
console.log(target);
|
||||
const $target = $(this);
|
||||
const name= $target.data("name");
|
||||
const catname = $target.data("catname");
|
||||
const vendor = $target.data("vendor");
|
||||
const id = $target.data("id");
|
||||
|
||||
$("#input_category").val(catname);
|
||||
$("#input_vendor").val(vendor);
|
||||
$("#input_id").val(id);
|
||||
$("#input_name").val(name);
|
||||
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<table class="table">
|
||||
<thead class="table-dark">
|
||||
<tr>
|
||||
<th>제품명</th>
|
||||
<th>회사명</th>
|
||||
<th>분류</th>
|
||||
<th>거래처</th>
|
||||
<th>등록날짜</th>
|
||||
<th>선택</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${list }" var="dto">
|
||||
<tr class="detailTr" data-product_id="${dto.id}" >
|
||||
<td>${dto.name }</td>
|
||||
<td>${dto.company_name }</td>
|
||||
<td>${dto.categoryDto.cls_nm_4 }</td>
|
||||
<td>${dto.vendorDto.name }</td>
|
||||
<td><fmt:formatDate value="${dto.registration_date }"
|
||||
dateStyle="short" /></td>
|
||||
<td><button type="button" class="btn btn-warning" data-id = "${dto.id}"
|
||||
data-name = "${dto.name}" data-catname = "${dto.categoryDto.cls_nm_4 }"
|
||||
data-vendor = "${dto.vendorDto.name}" onclick= "goDown(this)"
|
||||
>확인</button></td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<hr>
|
||||
<div style="text-align: center">
|
||||
<form>
|
||||
<div class="ulTag">
|
||||
<div class="row">
|
||||
<div class="col-12" style="text-align: center;">
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon1">제품카테고리</span>
|
||||
<input
|
||||
id='input_category' type="text" class="form-control" placeholder="제품카테고리"
|
||||
aria-label="제품카테고리" value="" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon2">제품명</span>
|
||||
<input
|
||||
id='input_name' type="text" class="form-control" placeholder="제품명""
|
||||
aria-label="제품명" value="" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon3">수량</span>
|
||||
<input
|
||||
id='input_num' type="number" min="0" class="form-control" placeholder="수량"
|
||||
aria-label="수량" value="">
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon4">공급업체</span>
|
||||
<input
|
||||
id='input_vendor' type="text" class="form-control" placeholder="공급업체"
|
||||
aria-label="공급업체" value="" readonly>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon5">날짜</span>
|
||||
<input
|
||||
id='input_date' type="date" class="form-control" placeholder="날짜"
|
||||
aria-label="날짜" value="">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 ">
|
||||
<div class="w-40 col-centered" style="text-align: right">
|
||||
<button type="button" class="btn btn-primary" id="updateBtn" onclick='goTable()'>수정 완료</button>
|
||||
<button type="button" class="btn btn-secondary" id="cancelBtn">취소</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form id="form" action='/plan_in/read' method="post">
|
||||
<input name="groupNumber" id="groupId" hidden>
|
||||
<input name="productId" id="productId" hidden>
|
||||
</form>
|
||||
@@ -39,18 +39,8 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 att">
|
||||
<form class="d-inline" id="search_form">
|
||||
<select name="searchn">
|
||||
<option <c:if test="${searchn == 0}">selected="selected"</c:if> value="0">사번</option>
|
||||
<option <c:if test="${searchn == 1}">selected="selected"</c:if> value="1">사원명</option>
|
||||
</select>
|
||||
<input type="text" name="search" maxlength="50" value="${search}"/>
|
||||
<button type="submit" class="btn btn-primary" >검색</button>
|
||||
<input id="pPage" hidden type="text" name="page">
|
||||
</form>
|
||||
<button style="float: right;" class="btn btn-primary" type="submit" id="btn_create" onclick="goCreate() ">생성</button>
|
||||
</div>
|
||||
<div class="row p-0 m-0">
|
||||
<div class="col-12 m-0">
|
||||
<table class="table" >
|
||||
<thead class="table-dark">
|
||||
@@ -70,24 +60,6 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div id="page">
|
||||
<ul class="pagination justify-content-center">
|
||||
<c:if test="${begin > pageNum }">
|
||||
<li class="page-item"><a class="page-link" data-p='${begin-1 }' href="#" onclick="onPaging(this)">[<]</a></li>
|
||||
</c:if>
|
||||
<c:forEach begin="${begin }" end="${end}" var="i" varStatus="status">
|
||||
<li class="page-item <c:if test="${page eq status.count}">active</c:if> "><a class="page-link" data-p='${i}' href="#" onclick="onPaging(this)" >${i}</a></li>
|
||||
</c:forEach>
|
||||
<c:if test="${end < totalPages }">
|
||||
<li class="page-item"><a class="page-link" data-p='${end+1}' href="#" onclick="onPaging(this)">[>]</a></li>
|
||||
</c:if>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form id="form" action='/plan_in/read' method="post">
|
||||
<input name="groupNumber" id="groupId" hidden>
|
||||
|
||||
@@ -6,6 +6,24 @@
|
||||
<c:forEach items="${list }" var="dto" varStatus="status">
|
||||
${dto.productDto.name}<br>
|
||||
</c:forEach>
|
||||
|
||||
function showSearchModal(title, val){
|
||||
$("#searchModalLabel").text(title);
|
||||
const data = { name : val};
|
||||
$.ajax({
|
||||
type : 'post', // 타입 (get, post, put 등등)
|
||||
url : '/plan_in/show_modal', // 요청할 서버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)
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="container">
|
||||
@@ -21,18 +39,9 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 att">
|
||||
<form class="d-inline" id="search_form">
|
||||
<select name="searchn">
|
||||
<option <c:if test="${searchn == 0}">selected="selected"</c:if> value="0">사번</option>
|
||||
<option <c:if test="${searchn == 1}">selected="selected"</c:if> value="1">사원명</option>
|
||||
</select>
|
||||
<input type="text" name="search" maxlength="50" value="${search}"/>
|
||||
<button type="submit" class="btn btn-primary" >검색</button>
|
||||
<input id="pPage" hidden type="text" name="page">
|
||||
</form>
|
||||
<button style="float: right;" class="btn btn-primary" type="submit" id="btn_create" onclick="goCreate() ">생성</button>
|
||||
qr : <a href = "/plan_in/qr/${groupNum}"> link </a>
|
||||
<button style="float: right;" class="btn btn-primary" type="submit" id="btn_create" onclick="goCreate() ">삭제 </button>
|
||||
</div>
|
||||
<div class="row p-0 m-0">
|
||||
<div class="col-12 m-0">
|
||||
<table class="table" >
|
||||
<thead class="table-dark">
|
||||
@@ -41,34 +50,24 @@
|
||||
<tbody>
|
||||
<c:forEach items="${list }" var="dto" varStatus="status">
|
||||
<tr class="group_tr" data-groupn="${dto.groupNumber}" data-productid="${dto.productId}">
|
||||
<td>${dto.cName}</td>
|
||||
<td>${dto.caName}</td>
|
||||
<td>${dto.productDto.name}</td>
|
||||
<td>${dto.quantity}</td>
|
||||
<td>${dto.vendorDto.name}</td>
|
||||
<td><fmt:formatDate value="${dto.date}" pattern="yyyy-MM-dd" type="date"/></td>
|
||||
<td><button type="submit" class="btn btn-update" >수정</button><button type="submit" class="btn btn-delete" >삭제</button><td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div id="page">
|
||||
<ul class="pagination justify-content-center">
|
||||
<c:if test="${begin > pageNum }">
|
||||
<li class="page-item"><a class="page-link" data-p='${begin-1 }' href="#" onclick="onPaging(this)">[<]</a></li>
|
||||
</c:if>
|
||||
<c:forEach begin="${begin }" end="${end}" var="i" varStatus="status">
|
||||
<li class="page-item <c:if test="${page eq status.count}">active</c:if> "><a class="page-link" data-p='${i}' href="#" onclick="onPaging(this)" >${i}</a></li>
|
||||
</c:forEach>
|
||||
<c:if test="${end < totalPages }">
|
||||
<li class="page-item"><a class="page-link" data-p='${end+1}' href="#" onclick="onPaging(this)">[>]</a></li>
|
||||
</c:if>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12 text-end">
|
||||
<form class="d-inline" method="get" action="/plan_in/list">
|
||||
<button type="submit" class="btn btn-primary" >확인</button>
|
||||
</form>
|
||||
<form class="d-inline" method="post" action="/plan_in/update">
|
||||
<button type="submit" class="btn btn-warning" >수정</button>
|
||||
<input name="groupNumber" value="${groupNum}" hidden>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
73
src/main/webapp/WEB-INF/views/planin/update.jsp
Normal file
73
src/main/webapp/WEB-INF/views/planin/update.jsp
Normal file
@@ -0,0 +1,73 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
|
||||
|
||||
<script>
|
||||
|
||||
function showSearchModal(title){
|
||||
$("#searchModalLabel").text(title);
|
||||
const data = { };
|
||||
$.ajax({
|
||||
type : 'post', // 타입 (get, post, put 등등)
|
||||
url : '/plan_in/planin_add', // 요청할 서버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)
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="mt-5 mb-5 text-center">
|
||||
<h1>입고 예정 관리 생성</h1>
|
||||
</div>
|
||||
<div>
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12 att">
|
||||
<button style="float: right;" class="btn btn-primary" type="submit" id="btn_create" onclick="goCreate() ">삭제 </button>
|
||||
</div>
|
||||
<div class="col-12 m-0">
|
||||
<table class="table" >
|
||||
<thead class="table-dark">
|
||||
<tr><th>제품 카테고리</th><th>제품명</th><th>수량</th><th>공급업체</th><th>날짜</th><th>수정/삭제</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${list }" var="dto" varStatus="status">
|
||||
<tr class="group_tr" data-groupn="${dto.groupNumber}" data-productid="${dto.productId}">
|
||||
<td>${dto.caName}</td>
|
||||
<td>${dto.productDto.name}</td>
|
||||
<td>${dto.quantity}</td>
|
||||
<td>${dto.vendorDto.name}</td>
|
||||
<td><fmt:formatDate value="${dto.date}" pattern="yyyy-MM-dd" type="date"/></td>
|
||||
<td><button type="submit" class="btn btn-warning" >수정</button><button type="submit" class="btn btn-danger" >삭제</button><td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><button type="button" class="btn btn-warning" onclick="showSearchModal('입고 예정 추가')">추가</button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form id="form" action='/plan_in/read' method="post">
|
||||
<input name="groupNumber" id="groupId" hidden>
|
||||
<input name="productId" id="productId" hidden>
|
||||
</form>
|
||||
Reference in New Issue
Block a user