mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-04 19:54:00 +09:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -8,6 +8,7 @@ import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@@ -186,10 +187,68 @@ public class ExcelDownlodeUtils {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public void downloadStockExcelFile(String excelFileName, HttpServletResponse response,
|
||||
String sheetName, String[] columnName, List<Map<String, Object>> dto) {
|
||||
String fileName = "";
|
||||
try {
|
||||
fileName = new String((excelFileName + ".xlsx").getBytes("utf-8"), "iso-8859-1");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
response.setContentType("ms-vnd/excel");
|
||||
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\";");
|
||||
|
||||
Workbook workbook = new XSSFWorkbook();
|
||||
Sheet sheet = workbook.createSheet(sheetName);
|
||||
|
||||
Row row = null;
|
||||
Cell cell = null;
|
||||
int rowNum = 0;
|
||||
|
||||
row = sheet.createRow(rowNum);
|
||||
for( int i = 0; i <= columnName.length -1; i++ ) {
|
||||
cell = row.createCell(i);
|
||||
cell.setCellValue(columnName[i]);
|
||||
}
|
||||
rowNum += 1;
|
||||
|
||||
//수정부분
|
||||
makeStockBody(dto,row,sheet,cell,rowNum);
|
||||
|
||||
try {
|
||||
workbook.write(response.getOutputStream());
|
||||
workbook.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void makeStockBody(List<Map<String, Object>> listdto, Row row, Sheet sheet,
|
||||
Cell cell, int rowNum) {
|
||||
//
|
||||
for (int i = 0; i < listdto.size(); i++) {
|
||||
row = sheet.createRow(rowNum++);
|
||||
Map<String, Object> dto = listdto.get(i);
|
||||
cell = row.createCell(0);
|
||||
cell.setCellValue((String) dto.get("productName"));
|
||||
cell = row.createCell(1);
|
||||
cell.setCellValue((String) dto.get("cls_nm_4"));
|
||||
cell = row.createCell(2);
|
||||
cell.setCellValue((String) dto.get("warehouseName"));
|
||||
cell = row.createCell(3);
|
||||
cell.setCellValue((String) dto.get("quantity"));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.no1.wms.in;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@@ -10,6 +11,12 @@ 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.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.no1.wms.price.PriceDto;
|
||||
import com.no1.wms.product.ProductDto;
|
||||
import com.no1.wms.product.ProductService;
|
||||
import com.no1.wms.stock.StockService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/in")
|
||||
@@ -17,6 +24,10 @@ public class InController {
|
||||
|
||||
@Autowired
|
||||
InService inService;
|
||||
@Autowired
|
||||
ProductService productService;
|
||||
@Autowired
|
||||
StockService stockservice;
|
||||
|
||||
@GetMapping("/list")
|
||||
//@ResponseBody
|
||||
@@ -59,6 +70,112 @@ public class InController {
|
||||
return "in/create";
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
@PostMapping("/create_process")
|
||||
@ResponseBody
|
||||
public boolean createProcess(PriceDto dto) {
|
||||
int i = inService.createProcess(dto);
|
||||
if (i == 1) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//모달화면
|
||||
@PostMapping("/show_modal_product")
|
||||
public ModelAndView productShowModal(@RequestParam(name = "searchn", defaultValue = "0") int searchn,
|
||||
@RequestParam(name = "search", defaultValue = "") String search,
|
||||
@RequestParam(name = "p", defaultValue = "1") int page, ModelAndView m, String name) {
|
||||
int count = productService.count(searchn, search);
|
||||
|
||||
int perPage = 10; // 한 페이지에 보일 글의 개수
|
||||
int startRow = (page - 1) * perPage;
|
||||
|
||||
List<ProductDto> dto = productService.productList(searchn, search, startRow ,perPage);
|
||||
|
||||
m.addObject("list", dto);
|
||||
m.addObject("start", startRow + 1);
|
||||
|
||||
int pageNum = 5;//보여질 페이지 번호 수
|
||||
int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수
|
||||
|
||||
int begin = (page - 1) / pageNum * pageNum + 1;
|
||||
int end = begin + pageNum - 1;
|
||||
if (end > totalPages) {
|
||||
end = totalPages;
|
||||
}
|
||||
|
||||
m.addObject("searchn",searchn);
|
||||
m.addObject("search",search);
|
||||
m.addObject("begin", begin);
|
||||
m.addObject("end", end);
|
||||
m.addObject("pageNum", pageNum);
|
||||
m.addObject("totalPages", totalPages);
|
||||
m.addObject("p" , page);
|
||||
m.setViewName(name);
|
||||
return m;
|
||||
}
|
||||
|
||||
@PostMapping("/show_modal_warehouse")
|
||||
public ModelAndView warehouseShowModal(@RequestParam(name = "searchn", defaultValue = "0") int searchn,
|
||||
@RequestParam(name = "search", defaultValue = "") String search,
|
||||
@RequestParam(name = "p", defaultValue = "1") int page,
|
||||
@RequestParam String name, ModelAndView mav){
|
||||
|
||||
int perPage = 9; // 한 페이지에 보일 글의 갯수
|
||||
int startRow = (page - 1) * perPage;
|
||||
|
||||
List<Map<String, Object>> list = null;
|
||||
int count = 0;
|
||||
|
||||
list = stockservice.warehousesSelect(searchn, search, startRow, perPage);
|
||||
count = stockservice.warehouseCount(searchn, search);
|
||||
|
||||
|
||||
mav.addObject("list", list);
|
||||
|
||||
mav.addObject("start", startRow + 1);
|
||||
|
||||
int pageNum = 5;//보여질 페이지 번호 수
|
||||
int totalPages = count / perPage + (count % perPage > 0 ? 1 : 0); // 전체 페이지 수
|
||||
|
||||
int begin = (page - 1) / pageNum * pageNum + 1;
|
||||
int end = begin + pageNum - 1;
|
||||
if (end > totalPages) {
|
||||
end = totalPages;
|
||||
}
|
||||
mav.addObject("searchn", searchn);
|
||||
mav.addObject("search", search);
|
||||
mav.addObject("begin", begin);
|
||||
mav.addObject("end", end);
|
||||
mav.addObject("pageNum", pageNum);
|
||||
mav.addObject("totalPages", totalPages);
|
||||
mav.addObject("p" , page);
|
||||
|
||||
mav.setViewName(name);
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class PriceController {
|
||||
PriceService priceService;
|
||||
@Autowired
|
||||
ProductService productService;
|
||||
|
||||
|
||||
@GetMapping("/list")
|
||||
public String list(@RequestParam(name = "searchn", defaultValue = "0") int searchn,
|
||||
@RequestParam(name = "search", defaultValue = "") String search,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.no1.wms.stock;
|
||||
|
||||
|
||||
import com.no1.wms.excel.ExcelDownlodeUtils;
|
||||
import com.no1.wms.vendor.VendorDto;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -9,6 +10,8 @@ import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -19,6 +22,9 @@ public class StockController {
|
||||
|
||||
@Autowired
|
||||
StockService service;
|
||||
|
||||
@Autowired
|
||||
ExcelDownlodeUtils excelDownlodeUtils;
|
||||
|
||||
// 탭 1 재고 리스트 출력
|
||||
@GetMapping("/list")
|
||||
@@ -166,7 +172,7 @@ public class StockController {
|
||||
@PostMapping("/show_modal")
|
||||
public ModelAndView showModal(@RequestParam(name = "searchn", defaultValue = "0") int searchn,
|
||||
@RequestParam(name = "search", defaultValue = "") String search,
|
||||
@RequestParam(name = "p", defaultValue = "1") int page,
|
||||
@RequestParam(name = "p", defaultValue = "1") int page, String product_id,
|
||||
@RequestParam String name, ModelAndView mav){
|
||||
|
||||
int perPage = 5; // 한 페이지에 보일 글의 갯수
|
||||
@@ -187,8 +193,8 @@ public class StockController {
|
||||
list = service.productSelect(searchn, search, startRow, perPage);
|
||||
count = service.productCount(searchn, search);
|
||||
}else if(name.equals("warehouse_capacity_currentCapacity")) {
|
||||
list = service.warehousesSelect(searchn, search, startRow, perPage);
|
||||
count = service.warehouseCount(searchn, search);
|
||||
list = service.warehousesSelect(searchn, search, startRow, perPage ,product_id);
|
||||
count = service.warehouseCount(searchn, search ,product_id);
|
||||
}
|
||||
|
||||
mav.addObject("list", list);
|
||||
@@ -221,4 +227,26 @@ public class StockController {
|
||||
//테스트
|
||||
return mav;
|
||||
}
|
||||
|
||||
|
||||
// 리스트 다운로드
|
||||
@GetMapping("/stock/downloadExcelList")
|
||||
public void downlodeExcelList(HttpServletResponse response) {
|
||||
List<Map<String, Object>> dto = service.selectAll();
|
||||
String excelFileName = "재고 파일";
|
||||
String sheetName = "재고";
|
||||
String[] columnName = {"제품명","카테고리","창고","재고수"};
|
||||
excelDownlodeUtils.downloadStockExcelFile(excelFileName, response, sheetName, columnName, dto);
|
||||
|
||||
};
|
||||
|
||||
//서식 다운로드
|
||||
@GetMapping("/stock/downloadStockForm")
|
||||
public void downlodeStockForm (HttpServletResponse response) throws IOException {
|
||||
String stockFormName = "재고 데이터 입력 서식.xlsx";
|
||||
excelDownlodeUtils.downlodeExcelForm(response, stockFormName);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import java.util.Map;
|
||||
|
||||
@Mapper
|
||||
public interface StockMapper {
|
||||
List<Map<String, Object>> selectAll();
|
||||
|
||||
int count(Map<String, Object> m);//검색 글 갯수
|
||||
|
||||
|
||||
@@ -121,27 +121,33 @@ public class StockService {
|
||||
return mapper.productCount(m);
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> warehousesSelect(int searchn, String search, int start, int perPage){
|
||||
public List<Map<String, Object>> warehousesSelect(int searchn, String search, int start, int perPage, String product_id){
|
||||
Map<String, Object> m = new HashMap<String, Object>();
|
||||
m.put("searchn", searchn);
|
||||
m.put("search", search);
|
||||
m.put("start", start);
|
||||
m.put("perPage", perPage);
|
||||
m.put("product_id", product_id);
|
||||
|
||||
List<Map<String, Object>> warehouseresult = mapper.warehouseSelect(m);
|
||||
|
||||
return warehouseresult;
|
||||
}
|
||||
|
||||
public int warehouseCount(int searchn, String search) {
|
||||
public int warehouseCount(int searchn, String search, String product_id) {
|
||||
|
||||
|
||||
Map<String,Object> m = new HashMap<String, Object>();
|
||||
m.put("searchn",searchn);
|
||||
m.put("search", search);
|
||||
m.put("product_id", product_id);
|
||||
return mapper.warehouseCount(m);
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> selectAll() {
|
||||
return mapper.selectAll();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -130,8 +130,8 @@ public class VendorController {
|
||||
}
|
||||
|
||||
// 엑셀다운로드테스트
|
||||
@GetMapping("/vendor/downloadTest")
|
||||
public void downloadExcelTest(HttpServletResponse response) {
|
||||
@GetMapping("/vendor/downlodeExcelList")
|
||||
public void downlodeExcelList(HttpServletResponse response) {
|
||||
List<VendorDto> dto = service.selectAll();
|
||||
String excelFileName = "거래처 파일";
|
||||
String sheetName = "거래처";
|
||||
|
||||
@@ -69,40 +69,7 @@
|
||||
</choose>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="inList2" 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,
|
||||
pro.name as product_name,
|
||||
w.name as warehouse_name,
|
||||
a.name as account_name
|
||||
|
||||
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>
|
||||
<choose>
|
||||
<when test="searchn == 0">
|
||||
proin.activation = 1 and proin.product_id IN (SELECT id FROM product WHERE name LIKE CONCAT('%',#{search},'%'))
|
||||
</when>
|
||||
<when test="searchn == 1">
|
||||
proin.activation = 1 AND proin.in_date LIKE CONCAT('%',#{search},'%')
|
||||
</when>
|
||||
<when test="searchn == 2">
|
||||
proin.activation = 1 AND proin.manager_id IN (SELECT id FROM account WHERE name LIKE CONCAT('%',#{search},'%'))
|
||||
</when>
|
||||
<when test="searchn == 3">
|
||||
proin.activation = 1 AND proin.group_number LIKE CONCAT('%',#{search},'%')
|
||||
</when>
|
||||
|
||||
</choose>
|
||||
</where>
|
||||
ORDER BY proin.in_date LIMIT #{start} , #{perPage}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="inList" 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,
|
||||
@@ -133,7 +100,7 @@
|
||||
</when>
|
||||
</choose>
|
||||
</where>
|
||||
ORDER BY proin.in_date LIMIT #{start} , #{perPage}
|
||||
ORDER BY proin.in_date desc LIMIT #{start} , #{perPage}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
@@ -5,6 +5,15 @@
|
||||
<mapper namespace="com.no1.wms.stock.StockMapper">
|
||||
|
||||
<!-- select -->
|
||||
<select id="selectAll" parameterType="Map" resultType="Map">
|
||||
select s.quantity as quantity, p.name as productName, c.cls_nm_4 as cls_nm_4, w.name as warehouseName
|
||||
|
||||
from stock s
|
||||
left join warehouse w on s.warehouse_id = w.id
|
||||
left join product p on s.product_id = p.id
|
||||
left join product_category c on p.kan_code = c.kan_code;
|
||||
</select>
|
||||
|
||||
<select id="count" parameterType="Map" resultType="java.lang.Integer">
|
||||
select count(s.id)
|
||||
|
||||
@@ -93,9 +102,9 @@
|
||||
left join product_category c on p.kan_code = c.kan_code
|
||||
<where>
|
||||
<choose>
|
||||
<when test="searchn == 0"> s.id IS NULL and p.activation = 1 and name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> s.id IS NULL and p.activation = 1 and cls_Nm_4 like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 2"> s.id IS NULL and p.activation = 1 and company_name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 0"> p.activation = 1 and name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> p.activation = 1 and cls_Nm_4 like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 2"> p.activation = 1 and company_name like concat('%',#{search},'%')</when>
|
||||
</choose>
|
||||
</where>
|
||||
order by name desc limit #{start}, #{perPage}
|
||||
@@ -108,9 +117,9 @@
|
||||
left join product_category c on p.kan_code = c.kan_code
|
||||
<where>
|
||||
<choose>
|
||||
<when test="searchn == 0"> s.id IS NULL and p.activation = 1 and name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> s.id IS NULL and p.activation = 1 and cls_Nm_4 like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 2"> s.id IS NULL and p.activation = 1 and company_name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 0"> p.activation = 1 and name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> p.activation = 1 and cls_Nm_4 like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 2"> p.activation = 1 and company_name like concat('%',#{search},'%')</when>
|
||||
</choose>
|
||||
</where>
|
||||
</select>
|
||||
@@ -122,9 +131,9 @@
|
||||
|
||||
<where>
|
||||
<choose>
|
||||
<when test="searchn == 0"> s.id IS NULL and w.activation = 1 and w.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> s.id IS NULL and w.activation = 1 and address like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 2"> s.id IS NULL and w.activation = 1 and capacity like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 0"> (s.product_id is null or s.product_id <> #{product_id}) and w.activation = 1 and w.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> (s.product_id is null or s.product_id <> #{product_id}) and w.activation = 1 and address like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 2"> (s.product_id is null or s.product_id <> #{product_id}) and w.activation = 1 and capacity like concat('%',#{search},'%')</when>
|
||||
</choose>
|
||||
</where>
|
||||
order by w.name desc limit #{start}, #{perPage}
|
||||
@@ -137,9 +146,9 @@
|
||||
|
||||
<where>
|
||||
<choose>
|
||||
<when test="searchn == 0"> s.id IS NULL and w.activation = 1 and w.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> s.id IS NULL and w.activation = 1 and address like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 2"> s.id IS NULL and w.activation = 1 and capacity like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 0"> (s.product_id is null or s.product_id <> #{product_id}) and w.activation = 1 and w.name like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 1"> (s.product_id is null or s.product_id <> #{product_id}) and w.activation = 1 and address like concat('%',#{search},'%')</when>
|
||||
<when test="searchn == 2"> (s.product_id is null or s.product_id <> #{product_id}) and w.activation = 1 and capacity like concat('%',#{search},'%')</when>
|
||||
</choose>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<%@ 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"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
@@ -22,25 +23,84 @@
|
||||
<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 type="text" name="productName" id="productName" class="form-control"
|
||||
placeholder="제품명을 검색하세요" aria-label="제품명" value="${dto.productDto.name }"
|
||||
aria-describedby="basic-addon1" readonly>
|
||||
<button class="btn btn-outline-secondary rounded-end" id="searchProductName"
|
||||
style="background-color:#FF5E5E;" type="button" onclick="showSearchModal('제품 검색','product')" >검색</button>
|
||||
style="background-color:#FF5E5E;" type="button" onclick="showSearchModal_product('제품 검색','product')" >검색</button>
|
||||
<input type='hidden' id="product_id" value="">
|
||||
|
||||
</div>
|
||||
<!-- 설명만 있는 입력 -->
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon2">가격</span>
|
||||
<input type="number" name="price" id="price" class="form-control"
|
||||
placeholder="가격을 입력하세요" aria-label="가격" value="${dto.price }"
|
||||
aria-describedby="basic-addon1" disable><!-- 여기서부터 작업 -->
|
||||
<span id='company_name_span' class="input-group-text">회사명</span>
|
||||
<input readonly id="company_name" type="text" class="form-control" placeholder="">
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span id='cls_Nm_4_span' class="input-group-text">분류</span>
|
||||
<input readonly id="cls_Nm_4" type="text" class="form-control" placeholder="">
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span id='vendor_name_span' class="input-group-text">거래처</span>
|
||||
<input readonly id="vendor_name" type="text" placeholder="" value="" class="form-control">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 수량 -->
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon2">수량</span>
|
||||
<input type="number" name="quantity" id="quantity" class="form-control"
|
||||
placeholder="수량을 입력하세요" aria-label="수량" value="${dto.quantity }"
|
||||
aria-describedby="basic-addon1">
|
||||
</div>
|
||||
<!-- 창고명 -->
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon1">창고명</span>
|
||||
<input type="text" name="warehouse_name" id="warehouse_name" class="form-control"
|
||||
placeholder="창고를 검색하세요" aria-label="창고명" value="${dto.warehouseDto.name }"
|
||||
aria-describedby="basic-addon1" readonly>
|
||||
<button class="btn btn-outline-secondary rounded-end" id="searchWarehouseName"
|
||||
style="background-color:#FF5E5E;" type="button" onclick="showSearchModal_warehouse('창고 검색','warehouse_capacity_currentCapacity')" >검색</button>
|
||||
<input type='hidden' id="warehouse_id" value="">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span id='address_span' class="input-group-text">주소</span>
|
||||
<input readonly id="Address_name" type="text" class="form-control" placeholder="">
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span id='capacity_span' class="input-group-text">용적</span>
|
||||
<input readonly id="Capacity_name" type="text" class="form-control" placeholder="">
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span id='remainingCapacity_span' class="input-group-text">잔여 용량</span>
|
||||
<input readonly id="remainingcapacity" type="text" placeholder="" value="" class="form-control">
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon3">입고날짜</span>
|
||||
<fmt:formatDate value="${dto.in_date}" pattern="yyyy-MM-dd HH:mm:ss" type="date" var="formattedDate" />
|
||||
<input type="datetime-local" id="in_date" name="in_date" class="form-control"
|
||||
placeholder="날짜을 입력하세요" aria-label="입고날짜" value="${formattedDate}"
|
||||
aria-describedby="basic-addon1">
|
||||
</div>
|
||||
|
||||
|
||||
<c:set var="userData" value="${sessionScope.userData}" />
|
||||
<input type='hidden' id="manager_id" value="${userData.id }">
|
||||
</div>
|
||||
@@ -49,7 +109,7 @@
|
||||
<div class="row">
|
||||
<div class="col-12 ">
|
||||
<div class="w-40 col-centered" style="text-align: right">
|
||||
<button type="button" class="btn btn-success" id="submitBtn">생성</button>
|
||||
<button type="button" class="btn btn-success" id="submitBtn">추가</button>
|
||||
<button type="button" class="btn btn-secondary" id="cancelBtn">취소</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -58,8 +118,107 @@
|
||||
</div>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$("#cancelBtn").on("click", function(){
|
||||
$(location).attr("href", "/in/list");
|
||||
|
||||
})//cancelBtn
|
||||
|
||||
$("#submitBtn").on("click",function(){
|
||||
var product_id = $("#product_id").val();
|
||||
var quantity = $("#quantity").val();
|
||||
var warehouse_id = $("#warehouse_id").val();
|
||||
var in_date = $("#in_date").val();
|
||||
var manager_id = $("#manager_id").val();
|
||||
|
||||
|
||||
if(!product_id){
|
||||
alert("제품을 선택해야합니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!quantity){
|
||||
alert("수량을 입력해야 합니다.");
|
||||
$("#quantity").focus();
|
||||
return false;
|
||||
}
|
||||
if(!warehouse_id){
|
||||
alert("창고을 선택해야합니다.");
|
||||
return false;
|
||||
}
|
||||
if(!in_date){
|
||||
in_date = new Date();
|
||||
}
|
||||
|
||||
const data = {
|
||||
product_id : product_id,
|
||||
quantity : quantity,
|
||||
in_date : in_date,
|
||||
manager_id : manager_id,
|
||||
warehouse_id : warehouse_id
|
||||
}
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: "/in/create_process",
|
||||
type: "post",
|
||||
data: data,
|
||||
datatype:"json"
|
||||
}).done(function(data) {
|
||||
if (data == true) {
|
||||
alert("입고을 추가했습니다.");
|
||||
$(location).attr("href", "/price/list");
|
||||
} else {
|
||||
alert("입고 추가에 실패하였습니다.");
|
||||
}
|
||||
}).fail(function() {
|
||||
alert("오류가 발생했습니다.");
|
||||
}).always(function() {
|
||||
//
|
||||
});
|
||||
|
||||
});//submitBtn
|
||||
});//ready
|
||||
|
||||
|
||||
function showSearchModal_product(title, val){
|
||||
$("#searchModalLabel").text(title);
|
||||
const data = { name : val};
|
||||
$.ajax({
|
||||
type : 'post', // 타입 (get, post, put 등등)
|
||||
url : '/in/show_modal_product', // 요청할 서버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)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function showSearchModal_warehouse(title, val){
|
||||
$("#searchModalLabel").text(title);
|
||||
const data = { name : val};
|
||||
$.ajax({
|
||||
type : 'post', // 타입 (get, post, put 등등)
|
||||
url : '/in/show_modal_warehouse', // 요청할 서버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>
|
||||
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
<th>가격</th>
|
||||
<th>수량</th>
|
||||
<th>입고예정그룹번호</th>
|
||||
<th>창고이름</th>
|
||||
<th>입고날짜</th>
|
||||
<th>담당자</th>
|
||||
</tr>
|
||||
@@ -59,7 +60,13 @@
|
||||
<td>${dto.productDto.name }</td>
|
||||
<td>${dto.latest_price }</td>
|
||||
<td>${dto.quantity }</td>
|
||||
<td>${dto.planInDto.viewGroupNumber }</td>
|
||||
<c:if test="${not empty dto.planInDto.viewGroupNumber}">
|
||||
<td>${dto.planInDto.viewGroupNumber}</td>
|
||||
</c:if>
|
||||
<c:if test="${empty dto.planInDto.viewGroupNumber}">
|
||||
<td></td>
|
||||
</c:if>
|
||||
<td>${dto.warehouseDto.name }</td>
|
||||
<td><fmt:formatDate value="${dto.in_date}" pattern="yyyy-MM-dd" type="date"/></td>
|
||||
<td>${dto.accountDto.name }</td>
|
||||
</tr>
|
||||
|
||||
@@ -8,9 +8,16 @@
|
||||
const $tag = $(tag);
|
||||
const tid = $tag.data('tid');
|
||||
const name = $tag.data('tname');
|
||||
const company_name = $tag.data('tcompany_name');
|
||||
const cls_nm_4 = $tag.data('tcls_nm_4');
|
||||
const vendor_name = $tag.data('tvendor_name');
|
||||
|
||||
|
||||
$("#productName").val(name);
|
||||
$("#product_id").val(tid);
|
||||
$("#company_name").val(company_name);
|
||||
$("#cls_Nm_4").val(cls_nm_4);
|
||||
$("#vendor_name").val(vendor_name);
|
||||
hideSearchModal();
|
||||
}//onSelect
|
||||
|
||||
@@ -119,7 +126,7 @@
|
||||
<td><fmt:formatDate value="${dto.registration_date }"
|
||||
dateStyle="short" /></td>
|
||||
<td>${dto.accountDto.name }</td>
|
||||
<td><button data-tid="${dto.id}" data-tname="${dto.name}" class="btn btn-primary" onclick="onSelect(this)">선택</button></td>
|
||||
<td><button data-tid="${dto.id}" data-tname="${dto.name}" data-tcompany_name="${dto.company_name }" data-tcls_nm_4="${dto.categoryDto.cls_nm_4 }" data-tvendor_name="${dto.vendorDto.name }"class="btn btn-primary" onclick="onSelect(this)">선택</button></td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
|
||||
@@ -38,7 +38,23 @@
|
||||
<input type='hidden' id="product_id" value="">
|
||||
|
||||
</div>
|
||||
<!-- 설명만 있는 입력 -->
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span id='company_name_span' class="input-group-text">회사명</span>
|
||||
<input readonly id="company_name" type="text" class="form-control" placeholder="">
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span id='cls_Nm_4_span' class="input-group-text">분류</span>
|
||||
<input readonly id="cls_Nm_4" type="text" class="form-control" placeholder="">
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span id='vendor_name_span' class="input-group-text">거래처</span>
|
||||
<input readonly id="vendor_name" type="text" placeholder="" value="" class="form-control">
|
||||
</div>
|
||||
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
<span class="input-group-text" id="basic-addon2">가격</span>
|
||||
<input type="number" name="price" id="price" class="form-control"
|
||||
@@ -72,8 +88,8 @@ $(document).ready(function() {
|
||||
$("#submitBtn").on("click", function(){
|
||||
|
||||
var price = $("#price").val();
|
||||
var manager_id = $("#manager_id").val();// 수정해야함.
|
||||
var product_id = $("#product_id").val();// 수정해야함.
|
||||
var manager_id = $("#manager_id").val();
|
||||
var product_id = $("#product_id").val();
|
||||
|
||||
if(!price){
|
||||
alert("가격을 입력해야 합니다.");
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<div class="mt-5 mb-5 text-center">
|
||||
|
||||
<div class="row">
|
||||
<h1>제품 상세페이지</h1>
|
||||
<h1>제품 가격 상세페이지</h1>
|
||||
<div class="col-10" style="text-align: right;">
|
||||
<button type="button" class="btn btn-danger" onclick="goDelete()">삭제</button>
|
||||
</div>
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
<span id='Warehouse_label' class="input-group-text">창고</span>
|
||||
<input readonly id="warehouse_name" type="text" class="form-control" placeholder="창고 검색">
|
||||
<input hidden name="product_id" id="warehouse_id" value="${dto.warehouse_id}">
|
||||
<button id="Warehouse_search_button" class="btn-primary btn" onclick="showSearchModals('창고 검색','warehouse_capacity_currentCapacity')">검색</button>
|
||||
<button id="Warehouse_search_button" class="btn-primary btn" onclick="showSearchModals2('창고 검색','warehouse_capacity_currentCapacity')">검색</button>
|
||||
</div>
|
||||
|
||||
<div class="input-group mb-3 w-40 col-centered">
|
||||
@@ -102,6 +102,26 @@
|
||||
});
|
||||
}
|
||||
|
||||
function showSearchModals2(title, val){
|
||||
$("#searchModalLabel").text(title);
|
||||
const data = { name : val};
|
||||
var product_id = $("#product_id").val();
|
||||
|
||||
$.ajax({
|
||||
type : 'post', // 타입 (get, post, put 등등)
|
||||
url : '/stock/show_modal', // 요청할 서버url
|
||||
dataType : 'html', // 데이터 타입 (html, xml, json, text 등등)
|
||||
data : product_id,data,
|
||||
success : function(result) { // 결과 성공 콜백함수
|
||||
$("#search_modal_body").html(result);
|
||||
searchModalBootStrap.show();
|
||||
},
|
||||
error : function(request, status, error) {
|
||||
alert(error)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
|
||||
@@ -76,6 +76,7 @@
|
||||
<th>제품명</th>
|
||||
<th>카테고리</th>
|
||||
<th>재고수</th>
|
||||
<th>창고</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -85,6 +86,7 @@
|
||||
<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>
|
||||
@@ -96,7 +98,8 @@
|
||||
<div class="row row-buttons">
|
||||
<div class="col-3 text-start">
|
||||
<img width="50" height="50" src="https://img.icons8.com/color/48/ms-excel.png" alt="ms-excel"/>
|
||||
<button type="button" class="btn btn-success" id="download">다운로드</button>
|
||||
<button type="button" class="btn btn-success" id="downlodeStockForm">서식 다운로드</button>
|
||||
<button type="button" class="btn btn-success" id="downlodeExcelList">리스트 다운로드</button>
|
||||
</div>
|
||||
<div class="col-6 d-flex justify-content-center">
|
||||
<nav>
|
||||
@@ -192,7 +195,8 @@
|
||||
<div class="row row-buttons">
|
||||
<div class="col-3 text-start">
|
||||
<img width="50" height="50" src="https://img.icons8.com/color/48/ms-excel.png" alt="ms-excel"/>
|
||||
<button type="button" class="btn btn-success" id="download2">다운로드</button>
|
||||
<button type="button" class="btn btn-success" id="downlodeStockForm2">서식 다운로드</button>
|
||||
<button type="button" class="btn btn-success" id="downlodeExcelList2">리스트 다운로드</button>
|
||||
</div>
|
||||
<div class="col-6 d-flex justify-content-center">
|
||||
<nav>
|
||||
@@ -241,8 +245,23 @@
|
||||
|
||||
|
||||
$(document).ready(function () {
|
||||
//POST방식으로 create폼화면 출력
|
||||
$("#downlodeStockForm,downlodeStockForm2").on("click",function(){
|
||||
var form = document.createElement("form");
|
||||
form.action = "/stock/downloadStockForm";
|
||||
form.method = "GET";
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
});
|
||||
|
||||
$("#downlodeExcelList,downlodeExcelList2").on("click",function(){
|
||||
var form = document.createElement("form");
|
||||
form.action = "/stock/downloadExcelList";
|
||||
form.method = "GET";
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
});
|
||||
|
||||
//POST방식으로 create폼화면 출력
|
||||
//탭 1 생성 버튼
|
||||
$("#createButton").on("click", function () {
|
||||
var form = document.createElement("form");
|
||||
|
||||
@@ -142,9 +142,9 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
if (quantity > remainingcapacity) {
|
||||
if (quantityAdjustment > remainingcapacity) {
|
||||
alert("적재 할 재고량이 재고량 한도를 넘을 수 없습니다.");
|
||||
$("#quantity").focus();
|
||||
$("#quantityAdjustment").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -115,6 +115,14 @@
|
||||
form.submit();
|
||||
});
|
||||
|
||||
$("#downlodeExcelList").on("click",function(){
|
||||
var form = document.createElement("form");
|
||||
form.action = "/vendor/downlodeExcelList";
|
||||
form.method = "GET";
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
});
|
||||
|
||||
//POST방식으로 create폼화면 출력
|
||||
$("#createButton").on("click",function(){
|
||||
var form = document.createElement("form");
|
||||
|
||||
BIN
src/main/webapp/excelfiles/excelform/재고 데이터 입력 서식.xlsx
Normal file
BIN
src/main/webapp/excelfiles/excelform/재고 데이터 입력 서식.xlsx
Normal file
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user