mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-04 19:54:00 +09:00
Merge branch 'master' of https://github.com/suhf/No1WMS
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package com.no1.wms.base;
|
package com.no1.wms.base;
|
||||||
|
|
||||||
|
import com.no1.wms.in.InDto;
|
||||||
|
import com.no1.wms.in.InService;
|
||||||
import com.no1.wms.stock.StockService;
|
import com.no1.wms.stock.StockService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
@@ -7,6 +9,8 @@ import org.springframework.ui.Model;
|
|||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -16,6 +20,9 @@ public class MainPageController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
StockService service;
|
StockService service;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
InService inService;
|
||||||
|
|
||||||
@GetMapping("/main")
|
@GetMapping("/main")
|
||||||
public String mainPage(@RequestParam(name = "searchn2", defaultValue = "0") int searchn2,
|
public String mainPage(@RequestParam(name = "searchn2", defaultValue = "0") int searchn2,
|
||||||
@RequestParam(name = "search2", defaultValue = "") String search2,
|
@RequestParam(name = "search2", defaultValue = "") String search2,
|
||||||
@@ -27,6 +34,15 @@ public class MainPageController {
|
|||||||
List<Map<String, Object>> dto2 = service.list2(searchn2, search2, startRow2 ,perPage2);
|
List<Map<String, Object>> dto2 = service.list2(searchn2, search2, startRow2 ,perPage2);
|
||||||
m.addAttribute("slist2", dto2);
|
m.addAttribute("slist2", dto2);
|
||||||
System.out.println("리스트 확인 : : " + dto2);
|
System.out.println("리스트 확인 : : " + dto2);
|
||||||
|
|
||||||
|
|
||||||
|
Date today = new Date();
|
||||||
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
String formattedDate = dateFormat.format(today);
|
||||||
|
|
||||||
|
List<InDto> dto = inService.inListMain(formattedDate);
|
||||||
|
m.addAttribute("inDto", dto);
|
||||||
|
|
||||||
return "base/main";
|
return "base/main";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Mapper;
|
|||||||
@Mapper
|
@Mapper
|
||||||
public interface InMapper {
|
public interface InMapper {
|
||||||
List<InDto> inList(Map<String, Object> m);
|
List<InDto> inList(Map<String, Object> m);
|
||||||
|
List<InDto> inListMain(Map<String, Object> m);
|
||||||
int count(Map<String, Object> m);
|
int count(Map<String, Object> m);
|
||||||
int createProcess(InDto dto);
|
int createProcess(InDto dto);
|
||||||
int createProcess2(InDto dto);
|
int createProcess2(InDto dto);
|
||||||
@@ -22,4 +23,6 @@ public interface InMapper {
|
|||||||
int deactivateById(String id);
|
int deactivateById(String id);
|
||||||
String selectWarehouseQuantity(String warehouseId);
|
String selectWarehouseQuantity(String warehouseId);
|
||||||
int updateWarehouseQuantity(Map<String, Object> m);
|
int updateWarehouseQuantity(Map<String, Object> m);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.no1.wms.in;
|
package com.no1.wms.in;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -23,6 +24,12 @@ public class InService {
|
|||||||
return mapper.inList(m);
|
return mapper.inList(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<InDto> inListMain(String today){//메인페이지에서 활용
|
||||||
|
Map<String, Object> m = new HashMap<String, Object>();
|
||||||
|
m.put("today",today);
|
||||||
|
return mapper.inListMain(m);
|
||||||
|
}
|
||||||
|
|
||||||
public int count(int searchn, String search) {
|
public int count(int searchn, String search) {
|
||||||
Map<String,Object> m = new HashMap<String, Object>();
|
Map<String,Object> m = new HashMap<String, Object>();
|
||||||
m.put("searchn",searchn);
|
m.put("searchn",searchn);
|
||||||
|
|||||||
@@ -33,10 +33,9 @@ public class PlanInController {
|
|||||||
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public ModelAndView list(ModelAndView mav,@RequestParam(defaultValue = "0") int searchn, @RequestParam(defaultValue = "") String search, @RequestParam(defaultValue = "1") int page){
|
public ModelAndView list(ModelAndView mav,@RequestParam(defaultValue = "0") int searchn, @RequestParam(defaultValue = "") String search, @RequestParam(defaultValue = "1") int page){
|
||||||
int perPage = 15;
|
int perPage = 10;
|
||||||
int startRow = (page - 1) * perPage;
|
int startRow = (page - 1) * perPage;
|
||||||
int count = planinservice.count(searchn, search);
|
int count = planinservice.count(searchn, search, startRow, perPage);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int pageNum = 4;//보여질 페이지 번호 수
|
int pageNum = 4;//보여질 페이지 번호 수
|
||||||
|
|||||||
@@ -20,11 +20,13 @@ public class PlanInService {
|
|||||||
return mapper.selectAll(map);
|
return mapper.selectAll(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int count(int searchn, String search, int start, int perPage){
|
||||||
int count(int searchn, String search){
|
System.out.printf("searchn : %d, search : %s, start : %d, perpage : %d", searchn, search, start, perPage);
|
||||||
HashMap<String, Object> m = new HashMap<>();
|
HashMap<String, Object> m = new HashMap<>();
|
||||||
m.put("searchn", searchn);
|
m.put("searchn", searchn);
|
||||||
m.put("search", search);
|
m.put("search", search);
|
||||||
|
m.put("start", start);
|
||||||
|
m.put("perPage", perPage);
|
||||||
return mapper.count(m);
|
return mapper.count(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,7 +49,4 @@ public class PlanInService {
|
|||||||
|
|
||||||
return mapper.selectByQRHash(qrHash);
|
return mapper.selectByQRHash(qrHash);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -139,6 +139,26 @@
|
|||||||
</where>
|
</where>
|
||||||
ORDER BY proin.in_date desc LIMIT #{start} , #{perPage}
|
ORDER BY proin.in_date desc LIMIT #{start} , #{perPage}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="inListMain" parameterType="map" resultMap="inResultMap">
|
||||||
|
SELECT
|
||||||
|
proin.id, proin.group_number, proin.product_id, proin.in_date, proin.quantity, proin.warehouse_id, proin.manager_id, proin.note, proin.activation,
|
||||||
|
planin.view_group_number,
|
||||||
|
pro.name as product_name,
|
||||||
|
w.name as warehouse_name,
|
||||||
|
a.name as account_name,
|
||||||
|
(SELECT price FROM prices WHERE product_id = proin.product_id ORDER BY registration_date DESC LIMIT 1) as latest_price
|
||||||
|
FROM
|
||||||
|
product_in as proin
|
||||||
|
LEFT JOIN plan_In as planin on proin.group_number = planin.group_number and proin.product_id = planin.product_id
|
||||||
|
LEFT JOIN product as pro on proin.product_id = pro.id
|
||||||
|
LEFT JOIN warehouse as w on proin.warehouse_id = w.id
|
||||||
|
LEFT JOIN account as a on proin.manager_id = a.id
|
||||||
|
WHERE proin.in_date = #{today} and proin.activation = 1
|
||||||
|
ORDER BY proin.in_date desc LIMIT 5
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="selectById" parameterType="String" resultMap="inResultMap">
|
<select id="selectById" parameterType="String" resultMap="inResultMap">
|
||||||
SELECT
|
SELECT
|
||||||
proin.id, proin.group_number, proin.product_id, proin.in_date, proin.quantity, proin.warehouse_id, proin.manager_id, proin.note, proin.activation,
|
proin.id, proin.group_number, proin.product_id, proin.in_date, proin.quantity, proin.warehouse_id, proin.manager_id, proin.note, proin.activation,
|
||||||
|
|||||||
@@ -128,8 +128,9 @@
|
|||||||
select count(*) from ( SELECT 1 from plan_In i join product p
|
select count(*) from ( SELECT 1 from plan_In i join product p
|
||||||
<where>
|
<where>
|
||||||
<choose>
|
<choose>
|
||||||
|
<when test="searchn == 0"> i.product_id = p.id and i.activation = 1 and i.view_group_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 == 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>
|
<when test="searchn == 2"> i.product_id = p.id and i.activation = 1 and i.quantity like concat(#{search})</when>
|
||||||
</choose>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
) t
|
) t
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<%@ page contentType="text/html; charset=UTF-8" %>3
|
<%@ page contentType="text/html; charset=UTF-8" %>
|
||||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
@@ -55,8 +56,41 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<!-- 네 번째 공간 -->
|
|
||||||
<div>네 번째 공간</div>
|
<!--네 번째 공간 -->
|
||||||
|
<div>
|
||||||
|
<div class=" text-center">
|
||||||
|
<h5>오늘의 입고</h5>
|
||||||
|
</div>
|
||||||
|
<table class="table">
|
||||||
|
<thead class="table-dark">
|
||||||
|
<tr>
|
||||||
|
<th>번호</th>
|
||||||
|
<th>제품명</th>
|
||||||
|
<th>입고예정그룹번호</th>
|
||||||
|
<th>수량</th>
|
||||||
|
<th>창고</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<c:forEach items="${inDto }" var="dto" varStatus="status">
|
||||||
|
<tr class="detailTr2 col-5" data-id="${dto.id}" style="font-size: small;" >
|
||||||
|
<td class="col-1">${status.count }</td>
|
||||||
|
<td class="col-1">${dto.productDto.name }</td>
|
||||||
|
<c:if test="${not empty dto.planInDto.viewGroupNumber}">
|
||||||
|
<td class="col-1">${dto.planInDto.viewGroupNumber}</td>
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${empty dto.planInDto.viewGroupNumber}">
|
||||||
|
<td class="col-1"></td>
|
||||||
|
</c:if>
|
||||||
|
<td class="col-1">${dto.quantity }</td>
|
||||||
|
<td class="col-1">${dto.warehouseDto.name}</td>
|
||||||
|
</tr>
|
||||||
|
</c:forEach>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -78,9 +112,9 @@
|
|||||||
center: 'title',
|
center: 'title',
|
||||||
right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth'
|
right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth'
|
||||||
},
|
},
|
||||||
googleCalendarApiKey: 'AIzaSyBKWDNnFEMpuNCPubU3pkkmB1F6XLX_bSo',
|
googleCalendarApiKey: '',
|
||||||
events: {
|
events: {
|
||||||
googleCalendarId: '7a3e7ae86281b8e995e4db0402865fb947ceb73c7d633f3a629a0068ac0ca66c@group.calendar.google.com',
|
googleCalendarId: '@group.calendar.google.com',
|
||||||
className: 'gcal-event' // an option!
|
className: 'gcal-event' // an option!
|
||||||
},
|
},
|
||||||
eventClick: function (info) {
|
eventClick: function (info) {
|
||||||
@@ -145,6 +179,23 @@
|
|||||||
form.submit();
|
form.submit();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
$("body").on("click", ".detailTr2", function () {
|
||||||
|
var id = $(this).data("id");
|
||||||
|
|
||||||
|
var form = document.createElement("form");
|
||||||
|
form.action = "/in/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();
|
||||||
|
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -32,6 +32,14 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onPaging(target){
|
||||||
|
const p = $(target).data("p");
|
||||||
|
$("#pPage").val(p);
|
||||||
|
const $form = $("#search_form");
|
||||||
|
$form.attr("action", "/plan_in/list");
|
||||||
|
$form.trigger("submit");
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -77,6 +85,23 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</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">
|
<form id="form" action='/plan_in/read' method="post">
|
||||||
<input name="groupNumber" id="groupId" hidden>
|
<input name="groupNumber" id="groupId" hidden>
|
||||||
|
|||||||
Reference in New Issue
Block a user