mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-04 12:13:24 +09:00
#수정
This commit is contained in:
@@ -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<Map<String, Object>> dto2 = service.list2(searchn2, search2, startRow2 ,perPage2);
|
||||
m.addAttribute("slist2", dto2);
|
||||
System.out.println("리스트 확인 : : " + dto2);
|
||||
return "base/main";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<when test="searchn == 0"> quantity <= 200 and s.activation = 1 and p.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> quantity <= 200 and s.activation = 1 and c.cls_Nm_4 like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 2"> quantity <= 200 and s.activation = 1 and s.quantity like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 3">s.activation = 1 and w.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 3"> quantity <= 200 and s.activation = 1 and w.name like concat('%',#{search},'%')</when>
|
||||
</choose>
|
||||
</where>
|
||||
</select>
|
||||
@@ -82,7 +82,7 @@
|
||||
<when test="searchn == 0"> quantity <= 200 and s.activation = 1 and p.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> quantity <= 200 and s.activation = 1 and c.cls_Nm_4 like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 2"> quantity <= 200 and s.activation = 1 and s.quantity like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 3">s.activation = 1 and w.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 3"> quantity <= 200 and s.activation = 1 and w.name like concat('%',#{search},'%')</when>
|
||||
</choose>
|
||||
</where>
|
||||
order by s.id desc limit #{start}, #{perPage}
|
||||
|
||||
@@ -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" %>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Insert title here</title>
|
||||
<meta charset="UTF-8">
|
||||
<title>Insert title here</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container-fluid">
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 ">
|
||||
<div>첫 번째 공간</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 ">
|
||||
<div><img alt="Default Image" src="/resources/static/img/mainpage/2.png" width="500px" /></div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-5">
|
||||
<div class="text-center"><h2><b>No.1 WMS 달력</b></h2></div>
|
||||
<div id='calendar'></div>
|
||||
<div id='popup' style="width: 500px; height: 600px; display: none; background-color: white; padding: 20px; border-radius: 14px; border: 2px solid #eeeeee"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5">
|
||||
<div class="text-center"><h2><b>No.1 WMS 달력</b></h2></div>
|
||||
<div id='calendar'></div>
|
||||
<div id='popup'
|
||||
style="width: 500px; height: 600px; display: none; background-color: white; padding: 20px; border-radius: 14px; border: 2px solid #eeeeee"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-6">
|
||||
<!-- 세 번째 공간 -->
|
||||
<div>세 번째 공간</div>
|
||||
</div>
|
||||
<div class="row mt-4">
|
||||
<div class="col-md-6">
|
||||
<!-- 세 번째 공간 -->
|
||||
<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="${slist2 }" var="dto">
|
||||
<tr class="detailTr col-5" data-id="${dto.id}" style="font-size: small;">
|
||||
<td class="col-1">${start2} <c:set var="start2" value="${start2 +1 }"/></td>
|
||||
<td class="col-1">${dto.productName }</td>
|
||||
<td class="col-1">${dto.cls_nm_4 }</td>
|
||||
<td class="col-1">${dto.quantity }</td>
|
||||
<td class="col-1">${dto.warehouseName}</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<!-- 네 번째 공간 -->
|
||||
<div>네 번째 공간</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<!-- 네 번째 공간 -->
|
||||
<div>네 번째 공간</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<link href='/resources/static/css/fullcalendar.main.min.css' rel='stylesheet'/>
|
||||
<script src='/resources/static/js/ko.js'></script>
|
||||
<script src='/resources/static/js/fullcalendar.main.min.js'></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bPopup/0.11.0/jquery.bpopup.min.js"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
var calendarEl = document.getElementById('calendar');
|
||||
var calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
locale: "ko",
|
||||
initialView: 'dayGridMonth',
|
||||
headerToolbar: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth'
|
||||
},
|
||||
googleCalendarApiKey: 'AIzaSyBKWDNnFEMpuNCPubU3pkkmB1F6XLX_bSo',
|
||||
events: {
|
||||
googleCalendarId: '7a3e7ae86281b8e995e4db0402865fb947ceb73c7d633f3a629a0068ac0ca66c@group.calendar.google.com',
|
||||
className: 'gcal-event' // an option!
|
||||
},
|
||||
eventClick: function (info) {
|
||||
let start_year = info.event.start.getUTCFullYear();
|
||||
let start_month = info.event.start.getMonth() + 1;
|
||||
let start_date = info.event.start.getUTCDate();
|
||||
let start_hour = info.event.start.getHours();
|
||||
let start_minute = info.event.start.getMinutes();
|
||||
let start_second = info.event.start.getSeconds();
|
||||
let end_hour = info.event.end.getHours();
|
||||
|
||||
let start = start_year + "-" + start_month + "-" + start_date + " " + start_hour + "시 ~ " + end_hour + "시";
|
||||
console.log(start);
|
||||
let attends = "";
|
||||
info.event.extendedProps.attachments.forEach(function (item) {
|
||||
attends += "<div><a href='" + item.fileUrl + "' target='_blank'>[첨부파일]</a></div>"
|
||||
});
|
||||
|
||||
if (!info.event.extendedProps.description) {
|
||||
info.event.extendedProps.description = "";
|
||||
}
|
||||
let contents = "<div style='font-weight:bold; font-size:20px; margin-bottom:30px; text-align:center'>" +
|
||||
start +
|
||||
"</div>" +
|
||||
"<div style='font-size:18px; margin-bottom:20px'>" +
|
||||
"제목: " + info.event.title +
|
||||
"</div>" +
|
||||
"<div style='width:500px'>" +
|
||||
info.event.extendedProps.description +
|
||||
attends +
|
||||
"</div>";
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<link href='/resources/static/css/fullcalendar.main.min.css' rel='stylesheet' />
|
||||
<script src='/resources/static/js/ko.js'></script>
|
||||
<script src='/resources/static/js/fullcalendar.main.min.js'></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bPopup/0.11.0/jquery.bpopup.min.js"></script>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var calendarEl = document.getElementById('calendar');
|
||||
var calendar = new FullCalendar.Calendar(calendarEl, {
|
||||
locale: "ko",
|
||||
initialView: 'dayGridMonth',
|
||||
headerToolbar: {
|
||||
left: 'prev,next today',
|
||||
center: 'title',
|
||||
right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth'
|
||||
},
|
||||
googleCalendarApiKey: 'AIzaSyBKWDNnFEMpuNCPubU3pkkmB1F6XLX_bSo',
|
||||
events: {
|
||||
googleCalendarId: '7a3e7ae86281b8e995e4db0402865fb947ceb73c7d633f3a629a0068ac0ca66c@group.calendar.google.com',
|
||||
className: 'gcal-event' // an option!
|
||||
},
|
||||
eventClick: function(info) {
|
||||
let start_year = info.event.start.getUTCFullYear();
|
||||
let start_month = info.event.start.getMonth() + 1;
|
||||
let start_date = info.event.start.getUTCDate();
|
||||
let start_hour = info.event.start.getHours();
|
||||
let start_minute = info.event.start.getMinutes();
|
||||
let start_second = info.event.start.getSeconds();
|
||||
let end_hour = info.event.end.getHours();
|
||||
$("#popup").html(contents);
|
||||
$("#popup").bPopup({
|
||||
speed: 500,
|
||||
transition: 'slideIn',
|
||||
transitionClose: 'slideBack',
|
||||
position: [($(document).width() - 500) / 2, 30] //x, y
|
||||
});
|
||||
info.jsEvent.stopPropagation();
|
||||
info.jsEvent.preventDefault();
|
||||
}
|
||||
});
|
||||
calendar.render();
|
||||
});
|
||||
|
||||
let start = start_year + "-" + start_month + "-" + start_date + " " + start_hour + "시 ~ " + end_hour + "시";
|
||||
console.log(start);
|
||||
let attends = "";
|
||||
info.event.extendedProps.attachments.forEach(function(item) {
|
||||
attends += "<div><a href='"+item.fileUrl+"' target='_blank'>[첨부파일]</a></div>"
|
||||
});
|
||||
$(document).ready(function () {
|
||||
$("body").on("click", ".detailTr", function () {
|
||||
var id = $(this).data("id");
|
||||
|
||||
if(!info.event.extendedProps.description) {
|
||||
info.event.extendedProps.description = "";
|
||||
}
|
||||
let contents = "<div style='font-weight:bold; font-size:20px; margin-bottom:30px; text-align:center'>" +
|
||||
start +
|
||||
"</div>" +
|
||||
"<div style='font-size:18px; margin-bottom:20px'>" +
|
||||
"제목: " + info.event.title +
|
||||
"</div>" +
|
||||
"<div style='width:500px'>" +
|
||||
info.event.extendedProps.description +
|
||||
attends +
|
||||
"</div>";
|
||||
var form = document.createElement("form");
|
||||
form.action = "/stock/read";
|
||||
form.method = "POST";
|
||||
document.body.appendChild(form);
|
||||
|
||||
$("#popup").html(contents);
|
||||
$("#popup").bPopup({
|
||||
speed: 500,
|
||||
transition: 'slideIn',
|
||||
transitionClose: 'slideBack',
|
||||
position: [($(document).width()-500)/2, 30] //x, y
|
||||
});
|
||||
info.jsEvent.stopPropagation();
|
||||
info.jsEvent.preventDefault();
|
||||
}
|
||||
});
|
||||
calendar.render();
|
||||
});
|
||||
</script>
|
||||
var input = document.createElement("input");
|
||||
input.type = "hidden";
|
||||
input.name = "id";
|
||||
input.value = id;
|
||||
form.appendChild(input);
|
||||
|
||||
form.submit();
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user