mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-05 04:03:45 +09:00
Planinn list
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
package com.no1.wms.planin;
|
||||
|
||||
import com.no1.wms.account.AccountDto;
|
||||
import com.no1.wms.planin.PlanInService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -15,7 +12,7 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
|
||||
@Controller
|
||||
@RequestMapping("planin")
|
||||
@RequestMapping("plan_in")
|
||||
public class PlanInController {
|
||||
@Autowired
|
||||
PlanInService planinservice;
|
||||
@@ -35,7 +32,7 @@ public class PlanInController {
|
||||
|
||||
|
||||
//스톡서비스로 재고 리스트 출력 메서트 작성
|
||||
List<AccountDto> list = planinservice.selectAll(searchn, search, startRow, perPage);
|
||||
List<PlanInDto> list = planinservice.selectAll(searchn, search, startRow, perPage);
|
||||
|
||||
int begin = (page - 1) / pageNum * pageNum + 1;
|
||||
int end = begin + pageNum - 1;
|
||||
@@ -49,7 +46,7 @@ public class PlanInController {
|
||||
mav.addObject("pageNum", pageNum);
|
||||
mav.addObject("begin", begin);
|
||||
mav.addObject("page", page);
|
||||
mav.setViewName("account/list");
|
||||
mav.setViewName("planin/list");
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,46 @@
|
||||
package com.no1.wms.planin;
|
||||
|
||||
public class PlanInDto {
|
||||
import java.util.Date;
|
||||
|
||||
import org.apache.ibatis.type.Alias;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import com.no1.wms.account.AccountDto;
|
||||
import com.no1.wms.product.ProductDto;
|
||||
import com.no1.wms.vendor.VendorDto;
|
||||
import com.no1.wms.warehouse.WarehouseDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Alias("PlanInDto")
|
||||
public class PlanInDto {
|
||||
private String groupNumber;
|
||||
private String productId;
|
||||
private Integer quantity;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date date;
|
||||
private String vendorId;
|
||||
private String managerId;
|
||||
private String warehouseId;
|
||||
private String qrHash;
|
||||
private String url;
|
||||
private Boolean clear;
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private Date vendorDate;
|
||||
private String other;
|
||||
private Boolean activation;
|
||||
private Integer viewGroupNumber;
|
||||
private String oldProductId;
|
||||
|
||||
private ProductDto productDto;
|
||||
private VendorDto vendorDto;
|
||||
private AccountDto accountDto;
|
||||
private WarehouseDto warehouseDto;
|
||||
}
|
||||
|
||||
@@ -6,13 +6,11 @@ import java.util.Map;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.no1.wms.account.AccountDto;
|
||||
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface PlanInMapper {
|
||||
|
||||
List<AccountDto> selectAll(Map<String, Object> m);
|
||||
List<PlanInDto> selectAll(Map<String, Object> m);
|
||||
|
||||
int count(Map<String, Object> m);
|
||||
}
|
||||
|
||||
@@ -6,14 +6,12 @@ import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.no1.wms.account.AccountDto;
|
||||
|
||||
@Service
|
||||
public class PlanInService {
|
||||
@Autowired
|
||||
PlanInMapper mapper;
|
||||
|
||||
public List<AccountDto> selectAll(int searchn, String search, int start, int perPage){
|
||||
public List<PlanInDto> selectAll(int searchn, String search, int start, int perPage){
|
||||
HashMap<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("search", search);
|
||||
map.put("start", start);
|
||||
|
||||
@@ -54,11 +54,11 @@
|
||||
and plan.warehouse_id = warehouse.id
|
||||
<where>
|
||||
<choose>
|
||||
<when test="searchn == 1"> acc.activation = 1 and acc.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 0"> acc.activation = 1 and acc.employee_number like concat('%',#{search},'%') </when>
|
||||
<when test="searchn == 1"> plan.activation = 1 and product.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 0"> plan.activation = 1 and plan.group_number like concat('%',#{search},'%') </when>
|
||||
</choose>
|
||||
</where>
|
||||
order by acc.id desc limit #{start}, #{perPage}
|
||||
order by plan.group_number desc limit #{start}, #{perPage}
|
||||
|
||||
</select>
|
||||
<insert id="insert" parameterType="planInDto">
|
||||
@@ -104,11 +104,11 @@
|
||||
update plan_In SET activation = false WHERE group_number = #{groupNumber} and product_id = #{productId}
|
||||
</update>
|
||||
<select id="count" parameterType="map" resultType="java.lang.Integer">
|
||||
select count(*) from ( SELECT 1 from plan_In
|
||||
select count(*) from ( SELECT 1 from plan_In i join product p
|
||||
<where>
|
||||
<choose>
|
||||
<when test="searchn == 1"> activation = 1 and name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 0"> activation = 1 and employee_number like concat('%',#{search},'%') </when>
|
||||
<when test="searchn == 1"> i.product_id = p.id and i.activation = 1 and p.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 0"> i.product_id = p.id and i.activation = 1 and i.group_number like concat('%',#{search},'%') </when>
|
||||
</choose>
|
||||
</where>
|
||||
) t
|
||||
|
||||
74
src/main/webapp/WEB-INF/views/planin/list.jsp
Normal file
74
src/main/webapp/WEB-INF/views/planin/list.jsp
Normal file
@@ -0,0 +1,74 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<!-- 이 안에 내용 복사해서 jsp에 붙여넣기 -->
|
||||
<link rel="stylesheet" href="/resources/static/css/account.css">
|
||||
<script>
|
||||
|
||||
</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">
|
||||
<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">
|
||||
<tr><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-mingu = "111" data-tid="${dto.groupNumber}">
|
||||
<td>${dto.viewGroupNumber}</td>
|
||||
<td>${dto.productDto.name}</td>
|
||||
<td>${dto.quantity}</td>
|
||||
<td><fmt:formatDate value="${dto.date}" pattern="yyyy-MM-dd" type="date"/></td>
|
||||
<td>${dto.other}</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>
|
||||
</div>
|
||||
</div>
|
||||
<form id="form" method="post">
|
||||
<input name="id" id="formInput" hidden>
|
||||
</form>
|
||||
Reference in New Issue
Block a user