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:
@@ -158,7 +158,8 @@ public class CategoryController {
|
|||||||
return checkkan;
|
return checkkan;
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/category/categorysearch")
|
//카테고리 검색 모달
|
||||||
|
@GetMapping("/category/categorysearch")
|
||||||
public String categorySearch(@RequestParam(name = "searchn", defaultValue = "4") int searchn,
|
public String categorySearch(@RequestParam(name = "searchn", defaultValue = "4") int searchn,
|
||||||
@RequestParam(name = "search", defaultValue = "") String search,
|
@RequestParam(name = "search", defaultValue = "") String search,
|
||||||
@RequestParam(name = "p", defaultValue = "1") int page, Model m) {
|
@RequestParam(name = "p", defaultValue = "1") int page, Model m) {
|
||||||
@@ -181,6 +182,8 @@ public class CategoryController {
|
|||||||
if (end > totalPages) {
|
if (end > totalPages) {
|
||||||
end = totalPages;
|
end = totalPages;
|
||||||
}
|
}
|
||||||
|
m.addAttribute("searchn",searchn);
|
||||||
|
m.addAttribute("search",search);
|
||||||
m.addAttribute("begin", begin);
|
m.addAttribute("begin", begin);
|
||||||
m.addAttribute("end", end);
|
m.addAttribute("end", end);
|
||||||
m.addAttribute("pageNum", pageNum);
|
m.addAttribute("pageNum", pageNum);
|
||||||
|
|||||||
91
src/main/java/com/no1/wms/price/PriceController.java
Normal file
91
src/main/java/com/no1/wms/price/PriceController.java
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
package com.no1.wms.price;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
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.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import com.no1.wms.category.CategoryDto;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/price")
|
||||||
|
public class PriceController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
PriceService priceService;
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
public String list(@RequestParam(name = "searchn", defaultValue = "0") int searchn,
|
||||||
|
@RequestParam(name = "search", defaultValue = "") String search,
|
||||||
|
@RequestParam(name = "p", defaultValue = "1") int page, Model m) {
|
||||||
|
|
||||||
|
int count = priceService.count(searchn, search);
|
||||||
|
|
||||||
|
int perPage = 15; // 한 페이지에 보일 글의 개수
|
||||||
|
int startRow = (page - 1) * perPage;
|
||||||
|
|
||||||
|
List<PriceDto> dto = priceService.priceList2(searchn, search, startRow ,perPage);
|
||||||
|
|
||||||
|
m.addAttribute("list", dto);
|
||||||
|
m.addAttribute("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.addAttribute("searchn",searchn);
|
||||||
|
m.addAttribute("search",search);
|
||||||
|
m.addAttribute("begin", begin);
|
||||||
|
m.addAttribute("end", end);
|
||||||
|
m.addAttribute("pageNum", pageNum);
|
||||||
|
m.addAttribute("totalPages", totalPages);
|
||||||
|
m.addAttribute("p" , page);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return "/price/list";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 생성 - 폼
|
||||||
|
@PostMapping("/create")
|
||||||
|
public String create() {
|
||||||
|
return "price/create";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 생성 - Ajax
|
||||||
|
@PostMapping("/price/create_process")
|
||||||
|
@ResponseBody
|
||||||
|
public boolean createProcess(PriceDto dto) {
|
||||||
|
int i = priceService.createProcess(dto);
|
||||||
|
if (i == 1) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
32
src/main/java/com/no1/wms/price/PriceDto.java
Normal file
32
src/main/java/com/no1/wms/price/PriceDto.java
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
package com.no1.wms.price;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import org.apache.ibatis.type.Alias;
|
||||||
|
|
||||||
|
import com.no1.wms.account.AccountDto;
|
||||||
|
import com.no1.wms.product.ProductDto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Alias("PriceDto")
|
||||||
|
public class PriceDto {
|
||||||
|
|
||||||
|
private String id;//id
|
||||||
|
private String price;//가격
|
||||||
|
private Date registration_date;//등록날짜
|
||||||
|
private String manager_id;//담당자
|
||||||
|
private String product_id; //제품 아이디
|
||||||
|
private boolean activation;//활성화
|
||||||
|
|
||||||
|
private ProductDto productDto;
|
||||||
|
private AccountDto accountDto;
|
||||||
|
|
||||||
|
}
|
||||||
17
src/main/java/com/no1/wms/price/PriceMapper.java
Normal file
17
src/main/java/com/no1/wms/price/PriceMapper.java
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package com.no1.wms.price;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
import com.no1.wms.category.CategoryDto;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface PriceMapper {
|
||||||
|
|
||||||
|
List<PriceDto> priceList(Map<String, Object> m);
|
||||||
|
int count(Map<String, Object> m);//카운터
|
||||||
|
List<PriceDto> priceList2(Map<String, Object> m);//검색기능까지 포함
|
||||||
|
int createProcess(PriceDto dto);
|
||||||
|
}
|
||||||
56
src/main/java/com/no1/wms/price/PriceService.java
Normal file
56
src/main/java/com/no1/wms/price/PriceService.java
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
package com.no1.wms.price;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.no1.wms.category.CategoryDto;
|
||||||
|
import com.no1.wms.product.ProductDto;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class PriceService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
PriceMapper mapper;
|
||||||
|
|
||||||
|
public List<PriceDto> priceList(int p){
|
||||||
|
|
||||||
|
int start = 0;
|
||||||
|
int count = 10;
|
||||||
|
|
||||||
|
Map m = new HashMap<String, Object>();
|
||||||
|
m.put("start", start);
|
||||||
|
m.put("count", count);
|
||||||
|
|
||||||
|
return mapper.priceList(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
//페이징 카운터
|
||||||
|
public int count(int searchn, String search) {
|
||||||
|
|
||||||
|
Map<String,Object> m = new HashMap<String, Object>();
|
||||||
|
m.put("searchn",searchn);
|
||||||
|
m.put("search", search);
|
||||||
|
return mapper.count(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PriceDto> priceList2(int searchn, String search, int start, int perPage){
|
||||||
|
|
||||||
|
Map<String, Object> m = new HashMap<String, Object>();
|
||||||
|
m.put("searchn",searchn);
|
||||||
|
m.put("search", search);
|
||||||
|
m.put("start", start);
|
||||||
|
m.put("perPage", perPage);
|
||||||
|
|
||||||
|
return mapper.priceList2(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int createProcess(PriceDto dto) {
|
||||||
|
return mapper.createProcess(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import java.util.List;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
@@ -12,18 +13,22 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
|
||||||
|
import com.no1.wms.category.CategoryDto;
|
||||||
|
import com.no1.wms.category.CategoryService;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/product")
|
@RequestMapping("/product")
|
||||||
public class ProductController {
|
public class ProductController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
ProductService productservice;
|
ProductService productService;
|
||||||
|
|
||||||
|
|
||||||
@GetMapping("list")
|
@GetMapping("list")
|
||||||
public String list(@RequestParam(name = "p", defaultValue = "1") int p, Model m) {
|
public String list(@RequestParam(name = "p", defaultValue = "1") int p, Model m) {
|
||||||
|
|
||||||
// 서비스로 카테고리 목록 불러오는 메서드 작성
|
// 서비스로 카테고리 목록 불러오는 메서드 작성
|
||||||
List<ProductDto> dto = productservice.productList(p);
|
List<ProductDto> dto = productService.productList(p);
|
||||||
m.addAttribute("list", dto);
|
m.addAttribute("list", dto);
|
||||||
return "/product/list";
|
return "/product/list";
|
||||||
}
|
}
|
||||||
@@ -38,7 +43,7 @@ public class ProductController {
|
|||||||
@PostMapping("/create_process")
|
@PostMapping("/create_process")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public boolean createProcess(ProductDto dto) {
|
public boolean createProcess(ProductDto dto) {
|
||||||
int i = productservice.createProcess(dto);
|
int i = productService.createProcess(dto);
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@@ -49,25 +54,23 @@ public class ProductController {
|
|||||||
// 상세페이지
|
// 상세페이지
|
||||||
@PostMapping("/read")
|
@PostMapping("/read")
|
||||||
public String read(String id, Model m) {
|
public String read(String id, Model m) {
|
||||||
ProductDto dto = productservice.selectById(id);
|
ProductDto dto = productService.selectById(id);
|
||||||
m.addAttribute("dto", dto);
|
m.addAttribute("dto", dto);
|
||||||
return "product/read";
|
return "product/read";
|
||||||
}
|
}
|
||||||
|
// 수정 폼
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public String update(String id, Model m) {
|
public String update(String id, Model m) {
|
||||||
ProductDto dto = productservice.selectById(id);
|
ProductDto dto = productService.selectById(id);
|
||||||
m.addAttribute("dto", dto);
|
m.addAttribute("dto", dto);
|
||||||
return "product/update";
|
return "product/update";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 수정 - Ajax
|
// 수정 - Ajax
|
||||||
@PutMapping("update_process")
|
@PutMapping("/update_process")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public boolean update_process(ProductDto dto) {
|
public boolean update_process(ProductDto dto) {
|
||||||
System.out.println(dto.getId());
|
int i = productService.updateById(dto);
|
||||||
|
|
||||||
int i = productservice.updateById(dto);
|
|
||||||
if (i == 1) {
|
if (i == 1) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
@@ -76,5 +79,33 @@ public class ProductController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 삭제
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@ResponseBody
|
||||||
|
public boolean delete(String id) {
|
||||||
|
int i = productService.deactivateById(id);
|
||||||
|
if(i == 1) {
|
||||||
|
return true;
|
||||||
|
}else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,4 +12,6 @@ public interface ProductMapper {
|
|||||||
int createProcess(ProductDto dto);
|
int createProcess(ProductDto dto);
|
||||||
ProductDto selectById(String id);
|
ProductDto selectById(String id);
|
||||||
int updateById(ProductDto dto);
|
int updateById(ProductDto dto);
|
||||||
|
int deactivateById(String id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,4 +38,8 @@ public class ProductService {
|
|||||||
return mapper.updateById(dto);
|
return mapper.updateById(dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int deactivateById(String id) {
|
||||||
|
return mapper.deactivateById(id);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class WarehouseController {
|
|||||||
|
|
||||||
int count = service.count(searchn, search);
|
int count = service.count(searchn, search);
|
||||||
|
|
||||||
int perPage = 5; // 한 페이지에 보일 글의 갯수
|
int perPage = 10; // 한 페이지에 보일 글의 갯수
|
||||||
int startRow = (page - 1) * perPage;
|
int startRow = (page - 1) * perPage;
|
||||||
|
|
||||||
//스톡서비스로 재고 리스트 출력 메서트 작성
|
//스톡서비스로 재고 리스트 출력 메서트 작성
|
||||||
@@ -97,10 +97,10 @@ public class WarehouseController {
|
|||||||
|
|
||||||
|
|
||||||
// 수정 - 폼
|
// 수정 - 폼
|
||||||
@GetMapping("/warehouse/update/{id}")
|
@PostMapping("/warehouse/update")
|
||||||
public String update(@PathVariable String id, Model m) {
|
public String update(String id, Model m) {
|
||||||
WarehouseDto dto = service.One(id);
|
WarehouseDto dto = service.One(id);
|
||||||
m.addAttribute("One", dto);
|
m.addAttribute("dto", dto);
|
||||||
return "warehouse/update";
|
return "warehouse/update";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,9 +108,14 @@ public class WarehouseController {
|
|||||||
// 수정 프로세스
|
// 수정 프로세스
|
||||||
@PutMapping("/warehouse/update_process")
|
@PutMapping("/warehouse/update_process")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public String updateProcess(WarehouseDto dto) {
|
public boolean updateProcess(WarehouseDto dto) {
|
||||||
service.updateWarehouse(dto);
|
|
||||||
return "redirect:list";
|
int i = service.updateWarehouse(dto);
|
||||||
|
if (i == 1) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
95
src/main/resources/mappers/PriceMapper.xml
Normal file
95
src/main/resources/mappers/PriceMapper.xml
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTO Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="com.no1.wms.price.PriceMapper">
|
||||||
|
<resultMap id="priceResultMap" type="PriceDto">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<result column="price" property="price" />
|
||||||
|
<result column="registration_date" property="registration_date" />
|
||||||
|
<result column="manager_id" property="manager_id" />
|
||||||
|
<result column="product_id" property="product_id" />
|
||||||
|
<result column="activation" property="activation" />
|
||||||
|
<association property="productDto" javaType="ProductDto">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<result column="product_name" property="name" />
|
||||||
|
</association>
|
||||||
|
<association property="accountDto" javaType="AccountDto">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<result column="account_name" property="name" />
|
||||||
|
</association>
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- insert -->
|
||||||
|
<insert id="createProcess" parameterType="priceDto">
|
||||||
|
INSERT INTO prices (id, price, registration_date, manager_id, product_id, activation)
|
||||||
|
VALUES (UUID(), #{price}, curdate(), #{manager_id}, #{product_id}, 1)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- update -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- delete -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- select -->
|
||||||
|
<select id="priceList" resultMap="priceResultMap" parameterType="map" >
|
||||||
|
SELECT
|
||||||
|
p.id, p.price, p.registration_date, p.manager_id, p.product_id, p.activation,
|
||||||
|
p.manager_id, p.activation,
|
||||||
|
pro.name as product_name,
|
||||||
|
a.name as account_name
|
||||||
|
FROM prices as p
|
||||||
|
left join product as pro on p.product_id = pro.id
|
||||||
|
left join account as a on p.manager_id = a.id
|
||||||
|
WHERE p.activation != 0
|
||||||
|
ORDER BY p.registration_date limit #{start} , #{count};
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 네비게이션바 전용 카운터 -->
|
||||||
|
<select id="count" parameterType="map" resultType="int">
|
||||||
|
select count(*)
|
||||||
|
|
||||||
|
FROM prices as p
|
||||||
|
left join product as pro on p.product_id = pro.id
|
||||||
|
left join account as a on p.manager_id = a.id
|
||||||
|
|
||||||
|
<where>
|
||||||
|
<choose>
|
||||||
|
<when test="searchn == 0"> p.activation = 1 and pro.name like concat('%',#{search},'%')</when>
|
||||||
|
<when test="searchn == 1"> p.activation = 1 and p.price like concat('%',#{search},'%')</when>
|
||||||
|
<when test="searchn == 2"> p.activation = 1 and p.registration_date like concat('%',#{search},'%')</when>
|
||||||
|
</choose>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 검색 -->
|
||||||
|
<select id="priceList2" parameterType="map" resultMap="priceResultMap">
|
||||||
|
SELECT
|
||||||
|
p.id, p.price, p.registration_date, p.manager_id, p.product_id, p.activation,
|
||||||
|
p.manager_id, p.activation,
|
||||||
|
pro.name as product_name,
|
||||||
|
a.name as account_name
|
||||||
|
|
||||||
|
FROM prices as p
|
||||||
|
left join product as pro on p.product_id = pro.id
|
||||||
|
left join account as a on p.manager_id = a.id
|
||||||
|
|
||||||
|
<where>
|
||||||
|
<choose>
|
||||||
|
<when test="searchn == 0"> p.activation = 1 and pro.name like concat('%',#{search},'%')</when>
|
||||||
|
<when test="searchn == 1"> p.activation = 1 and p.price like concat('%',#{search},'%')</when>
|
||||||
|
<when test="searchn == 2"> p.activation = 1 and p.registration_date like concat('%',#{search},'%')</when>
|
||||||
|
</choose>
|
||||||
|
</where>
|
||||||
|
order by p.registration_date limit #{start} , #{perPage}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -48,6 +48,12 @@
|
|||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="deactivateById" parameterType="String">
|
||||||
|
UPDATE product
|
||||||
|
SET activation = 0
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
<!-- delete -->
|
<!-- delete -->
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="list" parameterType="map" resultType="com.no1.wms.warehouse.WarehouseDto">
|
<select id="list" parameterType="map" resultType="com.no1.wms.warehouse.WarehouseDto">
|
||||||
select *
|
select w.id, w.name, w.capacity, w.current_capacity as currentCapacity
|
||||||
|
|
||||||
from warehouse w
|
from warehouse w
|
||||||
|
|
||||||
@@ -36,18 +36,19 @@
|
|||||||
|
|
||||||
<select id="warehouseOne" parameterType="Map" resultType="Map">
|
<select id="warehouseOne" parameterType="Map" resultType="Map">
|
||||||
select p.name, s.quantity, w.id
|
select p.name, s.quantity, w.id
|
||||||
|
|
||||||
from warehouse w
|
from warehouse w
|
||||||
LEFT JOIN stock s ON w.id = s.warehouse_id
|
LEFT JOIN stock s ON w.id = s.warehouse_id
|
||||||
LEFT JOIN product p ON s.product_id = p.id
|
LEFT JOIN product p ON s.product_id = p.id
|
||||||
|
|
||||||
<where>
|
<where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="searchn == 0"> w.id = #{id} and w.activation = 1 and p.name like concat('%',#{search},'%')</when>
|
<when test="searchn == 0"> w.activation = 1 and p.name like concat('%',#{search},'%')</when>
|
||||||
<when test="searchn == 1"> w.id = #{id} and w.activation = 1 and s.quantity like concat('%',#{search},'%') </when>
|
<when test="searchn == 1"> w.activation = 1 and s.quantity like concat('%',#{search},'%') </when>
|
||||||
</choose>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
|
|
||||||
<!-- order by p.id desc limit #{start}, #{perPage}-->
|
<!-- order by p.name desc limit #{start}, #{perPage}-->
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -60,14 +61,14 @@
|
|||||||
|
|
||||||
<where>
|
<where>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="searchn == 0"> w.id = #{id} and w.activation = 1 and p.name like concat('%',#{search},'%')</when>
|
<when test="searchn == 0"> w.activation = 1 and p.name like concat('%',#{search},'%')</when>
|
||||||
<when test="searchn == 1"> w.id = #{id} and w.activation = 1 and s.quantity like concat('%',#{search},'%') </when>
|
<when test="searchn == 1"> w.activation = 1 and s.quantity like concat('%',#{search},'%') </when>
|
||||||
</choose>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="One" parameterType="String" resultType="com.no1.wms.warehouse.WarehouseDto">
|
<select id="One" parameterType="String" resultType="com.no1.wms.warehouse.WarehouseDto">
|
||||||
select *
|
select w.id, w.name, w.capacity, w.current_capacity as currentCapacity, w.address
|
||||||
|
|
||||||
from warehouse w
|
from warehouse w
|
||||||
|
|
||||||
@@ -80,16 +81,16 @@
|
|||||||
<!-- update -->
|
<!-- update -->
|
||||||
<update id="updateWarehouse" parameterType="com.no1.wms.warehouse.WarehouseDto">
|
<update id="updateWarehouse" parameterType="com.no1.wms.warehouse.WarehouseDto">
|
||||||
update warehouse
|
update warehouse
|
||||||
set capacity = #{dto.capacity}, name = #{dto.name}
|
set capacity = #{capacity}, name = #{name}, address = #{address}
|
||||||
where id = #{dto.id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
<!-- update -->
|
<!-- update -->
|
||||||
|
|
||||||
|
|
||||||
<!-- insert -->
|
<!-- insert -->
|
||||||
<insert id="createWarehouse" parameterType="com.no1.wms.warehouse.WarehouseDto">
|
<insert id="createWarehouse" parameterType="com.no1.wms.warehouse.WarehouseDto">
|
||||||
insert into warehouse (id, name, capacity, current_capacity, address, activation)
|
insert into warehouse (id, name, capacity, current_capacity as currentCapacity, manager_id as managerId, address, activation)
|
||||||
values (UUID(), #{dto.name}, #{dto.capacity}, 0, #{dto.address}, 1)
|
values (UUID(), #{dto.name}, #{dto.capacity}, 0, #{dto.managerId}, #{dto.address}, 1)
|
||||||
</insert>
|
</insert>
|
||||||
<!-- insert -->
|
<!-- insert -->
|
||||||
|
|
||||||
|
|||||||
@@ -77,17 +77,17 @@
|
|||||||
|
|
||||||
<c:if test="${begin > pageNum }">
|
<c:if test="${begin > pageNum }">
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a href="javascript:void(0);" class="page-link" onclick="pageingFunction(this.id)" id="${begin - 1 }"><</a>
|
<a href="javascript:void(0);" class="page-link" onclick="pagingFunction(this.id)" id="${begin - 1 }"><</a>
|
||||||
</li>
|
</li>
|
||||||
</c:if>
|
</c:if>
|
||||||
<c:forEach begin="${begin }" end="${end }" var="i">
|
<c:forEach begin="${begin }" end="${end }" var="i">
|
||||||
<li class="page-item <c:if test="${p == i}"> active </c:if>">
|
<li class="page-item <c:if test="${p == i}"> active </c:if>">
|
||||||
<a href="javascript:void(0);" class="page-link " onclick="pageingFunction(this.id); return false;" id="${i }">${i }</a>
|
<a href="javascript:void(0);" class="page-link " onclick="pagingFunction(this.id); return false;" id="${i }">${i }</a>
|
||||||
</li>
|
</li>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
<c:if test="${end < totalPages }">
|
<c:if test="${end < totalPages }">
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a href="javascript:void(0);" class="page-link" onclick="pageingFunction(this.id)" id="${end + 1 }">></a>
|
<a href="javascript:void(0);" class="page-link" onclick="pagingFunction(this.id)" id="${end + 1 }">></a>
|
||||||
</li>
|
</li>
|
||||||
</c:if>
|
</c:if>
|
||||||
</ul>
|
</ul>
|
||||||
@@ -168,7 +168,7 @@
|
|||||||
|
|
||||||
|
|
||||||
});//ready
|
});//ready
|
||||||
function pageingFunction(clickedId){
|
function pagingFunction(clickedId){
|
||||||
var searchn1 = $("#searchn1").val();
|
var searchn1 = $("#searchn1").val();
|
||||||
var search1 = $("#search1").val();
|
var search1 = $("#search1").val();
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,10 @@
|
|||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body" id="search_modal_body">
|
<div class="modal-body" id="search_modal_body">
|
||||||
<form action="list">
|
<form>
|
||||||
<div class="input-group mb-3 w-30 col-centered">
|
<div class="input-group mb-3 w-30 col-centered">
|
||||||
<div class="w-25">
|
<div class="w-25">
|
||||||
<select class="form-select" name="searchn">
|
<select class="form-select" name="searchn" id="searchn">
|
||||||
<option selected="selected" value="4">세분류</option>
|
<option selected="selected" value="4">세분류</option>
|
||||||
<option value="1">대분류</option>
|
<option value="1">대분류</option>
|
||||||
<option value="2">중분류</option>
|
<option value="2">중분류</option>
|
||||||
@@ -32,8 +32,14 @@
|
|||||||
<option value="0">KAN코드</option>
|
<option value="0">KAN코드</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" name="search" class="form-control" aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
<input type="text" id="search" name="search" class="form-control" aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
||||||
<button class="btn btn-info" type="submit" id="button-addon2 searchBtn">검색</button>
|
<button class="btn btn-info" type="button" id="searchBtn">검색</button>
|
||||||
|
|
||||||
|
<!-- 페이징작업용 -->
|
||||||
|
<input type="hidden" id="searchn1" value="${searchn}">
|
||||||
|
<input type="hidden" id="search1" value="${search}">
|
||||||
|
<!-- 페이징작업용 -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -73,22 +79,23 @@
|
|||||||
<div class="col-6 d-flex justify-content-center">
|
<div class="col-6 d-flex justify-content-center">
|
||||||
<nav>
|
<nav>
|
||||||
<ul class="pagination">
|
<ul class="pagination">
|
||||||
<c:if test="${begin > pageNum }">
|
|
||||||
<li class="page-item">
|
<c:if test="${begin > pageNum }">
|
||||||
<a class="page-link" href="list?p=${begin - 1 }"><</a>
|
<li class="page-item">
|
||||||
</li>
|
<a href="javascript:void(0);" class="page-link" onclick="pagingFunction(this.id)" id="${begin - 1 }"><</a>
|
||||||
</c:if>
|
</li>
|
||||||
<c:forEach begin="${begin }" end="${end }" var="i">
|
</c:if>
|
||||||
<li class="page-item <c:if test="${p == i}"> active </c:if>">
|
<c:forEach begin="${begin }" end="${end }" var="i">
|
||||||
<a class="page-link " href="list?p=${i }">${i }</a>
|
<li class="page-item <c:if test="${p == i}"> active </c:if>">
|
||||||
</li>
|
<a href="javascript:void(0);" class="page-link " onclick="pagingFunction(this.id); return false;" id="${i }">${i }</a>
|
||||||
</c:forEach>
|
</li>
|
||||||
<c:if test="${end < totalPages }">
|
</c:forEach>
|
||||||
<li class="page-item">
|
<c:if test="${end < totalPages }">
|
||||||
<a class="page-link" href="list?p=${end + 1 }">></a>
|
<li class="page-item">
|
||||||
</li>
|
<a href="javascript:void(0);" class="page-link" onclick="pagingFunction(this.id)" id="${end + 1 }">></a>
|
||||||
</c:if>
|
</li>
|
||||||
</ul>
|
</c:if>
|
||||||
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- row row-buttons -->
|
</div><!-- row row-buttons -->
|
||||||
@@ -102,13 +109,96 @@
|
|||||||
</div>
|
</div>
|
||||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
//검색기능
|
||||||
|
$("#searchBtn").on("click",function(){
|
||||||
|
|
||||||
|
var searchn = $("#searchn").val();
|
||||||
|
var search = $("#search").val();
|
||||||
|
var existingModal = $("#searchKanModal");
|
||||||
|
|
||||||
|
if (existingModal.length === 0) {
|
||||||
|
$.ajax({
|
||||||
|
url:"/category/categorysearch",
|
||||||
|
type:"get",
|
||||||
|
data: {
|
||||||
|
"searchn": searchn,
|
||||||
|
"search": search,
|
||||||
|
"p": 1,
|
||||||
|
},
|
||||||
|
datatype:"html"
|
||||||
|
}).done(function(data){
|
||||||
|
$("body").append(data);
|
||||||
|
$("#searchKanModal").modal("show");
|
||||||
|
}).fail(function() {
|
||||||
|
alert("오류가 발생했습니다.");
|
||||||
|
}).always(function() {
|
||||||
|
//alert("항상뜨는 창입니다.");
|
||||||
|
}); } else {
|
||||||
|
// 이미 생성된 모달이 있을 경우 기존 모달을 열기
|
||||||
|
existingModal.modal("show");
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
var input1 = document.createElement("input");
|
||||||
|
input1.type = "hidden";
|
||||||
|
input1.name = "searchn";
|
||||||
|
input1.value = searchn;
|
||||||
|
form.appendChild(input1);
|
||||||
|
|
||||||
|
var input2 = document.createElement("input");
|
||||||
|
input2.type = "hidden";
|
||||||
|
input2.name = "search";
|
||||||
|
input2.value = search;
|
||||||
|
form.appendChild(input2);
|
||||||
|
|
||||||
|
var input3 = document.createElement("input");
|
||||||
|
input3.type = "hidden";
|
||||||
|
input3.name = "p";
|
||||||
|
input3.value = 1;
|
||||||
|
form.appendChild(input3);
|
||||||
|
|
||||||
|
document.body.appendChild(form);
|
||||||
|
form.submit();
|
||||||
|
*/
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});//ready
|
||||||
|
function pagingFunction(clickedId){
|
||||||
|
var searchn1 = $("#searchn1").val();
|
||||||
|
var search1 = $("#search1").val();
|
||||||
|
|
||||||
|
var form = document.createElement("form");
|
||||||
|
form.action = "/category/categorysearch";
|
||||||
|
form.method = "get";
|
||||||
|
|
||||||
|
var input1 = document.createElement("input");
|
||||||
|
input1.type = "hidden";
|
||||||
|
input1.name = "searchn";
|
||||||
|
input1.value = searchn1;
|
||||||
|
form.appendChild(input1);
|
||||||
|
|
||||||
|
var input2 = document.createElement("input");
|
||||||
|
input2.type = "hidden";
|
||||||
|
input2.name = "search";
|
||||||
|
input2.value = search1;
|
||||||
|
form.appendChild(input2);
|
||||||
|
|
||||||
|
var input3 = document.createElement("input");
|
||||||
|
input3.type = "hidden";
|
||||||
|
input3.name = "p";
|
||||||
|
input3.value = clickedId;
|
||||||
|
form.appendChild(input3);
|
||||||
|
|
||||||
|
document.body.appendChild(form);
|
||||||
|
form.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
90
src/main/webapp/WEB-INF/views/price/create.jsp
Normal file
90
src/main/webapp/WEB-INF/views/price/create.jsp
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
<%@ page contentType="text/html; charset=UTF-8"%>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>제품 가격 생성</title>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.col-centered{
|
||||||
|
margin: 0 auto;
|
||||||
|
float: none;
|
||||||
|
}
|
||||||
|
.col-margin-left-32{
|
||||||
|
margin-left: 32%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="mt-5 mb-5 text-center">
|
||||||
|
<h1>제품 가격 생성</h1>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<div style="text-align: center">
|
||||||
|
<form id="createForm">
|
||||||
|
<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="productDto.name" id="productDto.name" class="form-control"
|
||||||
|
placeholder="제품명을 검색하세요" aria-label="제품명" value="${dto.productDto.name }"
|
||||||
|
aria-describedby="basic-addon1">
|
||||||
|
<button class="btn btn-outline-secondary rounded-end" id="searchProductName"
|
||||||
|
style="background-color:#FF5E5E;" type="button" >검색</button>
|
||||||
|
<input type='hidden' id='searchProductName' value='0'>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<!-- 설명만 있는 입력 -->
|
||||||
|
<div class="input-group mb-3 w-40 col-centered">
|
||||||
|
<span class="input-group-text" id="basic-addon2">중분류</span>
|
||||||
|
<input type="text" name="cls_nm_2" id="cls_nm_2" class="form-control"
|
||||||
|
placeholder="중분류를 입력하세요" aria-label="중분류" value="${dto.cls_nm_2 }"
|
||||||
|
aria-describedby="basic-addon1">
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-3 w-40 col-centered">
|
||||||
|
<span class="input-group-text" id="basic-addon3">소분류</span>
|
||||||
|
<input type="text" name="cls_nm_3" id="cls_nm_3" class="form-control"
|
||||||
|
placeholder="소분류를 입력하세요" aria-label="소분류" value="${dto.cls_nm_3 }"
|
||||||
|
aria-describedby="basic-addon1">
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-3 w-40 col-centered">
|
||||||
|
<span class="input-group-text" id="basic-addon4">세분류</span>
|
||||||
|
<input type="text" name="cls_nm_4" id="cls_nm_4" class="form-control"
|
||||||
|
placeholder="세분류를 입력하세요" aria-label="세분류" value="${dto.cls_nm_4 }"
|
||||||
|
aria-describedby="basic-addon1">
|
||||||
|
</div>
|
||||||
|
<div class="input-group mb-3 w-40 col-centered">
|
||||||
|
<span class="input-group-text" id="basic-addon5">KAN 분류코드</span>
|
||||||
|
<input type="number" min="1" name="kan_code" id="kan_code" class="form-control"
|
||||||
|
placeholder="KAN 분류코드를 입력하세요" aria-label="KAN 분류코드" value="${dto.kan_code }"
|
||||||
|
aria-describedby="button-addon2">
|
||||||
|
<button class="btn btn-outline-secondary rounded-end" id="checkKan"
|
||||||
|
style="background-color:#FF5E5E;" type="button" >중복확인</button>
|
||||||
|
<input type='hidden' id='kan_chack' value='0'>
|
||||||
|
</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-success" id="submitBtn">생성</button>
|
||||||
|
<button type="button" class="btn btn-secondary" id="cancelBtn">취소</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
116
src/main/webapp/WEB-INF/views/price/list.jsp
Normal file
116
src/main/webapp/WEB-INF/views/price/list.jsp
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
<%@ 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>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>제품 가격</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="mt-5 mb-5 text-center">
|
||||||
|
<h1>제품 가격 관리</h1>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<div class="body">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="col-12">
|
||||||
|
<form>
|
||||||
|
<div class="input-group mb-3 w-30 col-centered">
|
||||||
|
<div class="w-25">
|
||||||
|
<select class="form-select" name="searchn" id="searchn">
|
||||||
|
<option selected="selected" value="0">제품명</option>
|
||||||
|
<option value="1">가격</option>
|
||||||
|
<option value="2">등록날짜</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<input type="text" id="search" name="search" class="form-control" aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
||||||
|
<button class="btn btn-info" type="button" id="searchBtn">검색</button>
|
||||||
|
|
||||||
|
<!-- 페이징작업용 -->
|
||||||
|
<input type="hidden" id="searchn1" value="${searchn}">
|
||||||
|
<input type="hidden" id="search1" value="${search}">
|
||||||
|
<!-- 페이징작업용 -->
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row row-table">
|
||||||
|
<div class="col-12">
|
||||||
|
<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="detailTr" data-id="${dto.id }" >
|
||||||
|
<td>${status.count }</td>
|
||||||
|
<td>${dto.productDto.name }</td>
|
||||||
|
<td>${dto.price }</td>
|
||||||
|
<td><fmt:formatDate value="${dto.registration_date }"
|
||||||
|
dateStyle="short" /></td>
|
||||||
|
<td>${dto.accountDto.name }</td>
|
||||||
|
</tr>
|
||||||
|
</c:forEach>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container-fluid">
|
||||||
|
<div class="row row-buttons">
|
||||||
|
<div class="col-3 text-start">
|
||||||
|
</div>
|
||||||
|
<div class="col-6 d-flex justify-content-center">
|
||||||
|
<nav>
|
||||||
|
<ul class="pagination">
|
||||||
|
|
||||||
|
<c:if test="${begin > pageNum }">
|
||||||
|
<li class="page-item">
|
||||||
|
<a href="javascript:void(0);" class="page-link" onclick="pagingFunction(this.id)" id="${begin - 1 }"><</a>
|
||||||
|
</li>
|
||||||
|
</c:if>
|
||||||
|
<c:forEach begin="${begin }" end="${end }" var="i">
|
||||||
|
<li class="page-item <c:if test="${p == i}"> active </c:if>">
|
||||||
|
<a href="javascript:void(0);" class="page-link " onclick="pagingFunction(this.id); return false;" id="${i }">${i }</a>
|
||||||
|
</li>
|
||||||
|
</c:forEach>
|
||||||
|
<c:if test="${end < totalPages }">
|
||||||
|
<li class="page-item">
|
||||||
|
<a href="javascript:void(0);" class="page-link" onclick="pagingFunction(this.id)" id="${end + 1 }">></a>
|
||||||
|
</li>
|
||||||
|
</c:if>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
<div class="col-3 text-end">
|
||||||
|
<button type="button" class="btn btn-primary" id="createButton">생성</button>
|
||||||
|
</div>
|
||||||
|
</div><!-- row row-buttons -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
//POST방식으로 create폼화면 출력
|
||||||
|
$("#createButton").on("click",function(){
|
||||||
|
var form = document.createElement("form");
|
||||||
|
form.action = "/price/create";
|
||||||
|
form.method = "POST";
|
||||||
|
document.body.appendChild(form);
|
||||||
|
form.submit();
|
||||||
|
});//createButton
|
||||||
|
});//ready
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -84,86 +84,11 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 모달화면 -->
|
|
||||||
<div class="modal fade" id="searchKanModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
|
||||||
<div class="modal-dialog modal-dialog-centered modal-xl" >
|
|
||||||
<div class="modal-content" id="search_modal_content">
|
|
||||||
|
|
||||||
<div class="modal-header">
|
|
||||||
<h1 class="modal-title fs-5" id="searchModalLabel">KAN 분류코드 검색</h1>
|
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
||||||
</div>
|
|
||||||
<div class="modal-body" id="search_modal_body">
|
|
||||||
<form action="categorySearch">
|
|
||||||
<div class="input-group mb-3 w-50 col-centered">
|
|
||||||
<div class="w-25">
|
|
||||||
<select class="form-select">
|
|
||||||
<option selected="selected" value="cls_nm_4">세분류</option>
|
|
||||||
<option value="cls_nm_1">대분류</option>
|
|
||||||
<option value="cls_nm_2">중분류</option>
|
|
||||||
<option value="cls_nm_3">세분류</option>
|
|
||||||
<option value="kan_code">KAN코드</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<input type="text" name="categorySearch" class="form-control" aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
|
||||||
<button class="btn btn-info" type="button" id="button-addon2 searchBtn">검색</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div class="container-fluid">
|
|
||||||
<div class="row row-table">
|
|
||||||
<div class="col-12">
|
|
||||||
<table class="table">
|
|
||||||
<thead class="table-dark">
|
|
||||||
<tr>
|
|
||||||
<th>대분류</th>
|
|
||||||
<th>중분류</th>
|
|
||||||
<th>소분류</th>
|
|
||||||
<th>세분류</th>
|
|
||||||
<th>KAN코드</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<c:forEach items="${list }" var="dto">
|
|
||||||
<tr class="detailTr" data-kan_code="${dto.kan_code}" >
|
|
||||||
<td>${dto.cls_nm_1 }</td>
|
|
||||||
<td>${dto.cls_nm_2 }</td>
|
|
||||||
<td>${dto.cls_nm_3 }</td>
|
|
||||||
<td>${dto.cls_nm_4 }</td>
|
|
||||||
<td>${dto.kan_code }</td>
|
|
||||||
</tr>
|
|
||||||
</c:forEach>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button id="modal_yes_button" type="button" class="modal_yes btn btn-primary">확인</button>
|
|
||||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 스크립트 -->
|
<!-- 스크립트 -->
|
||||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
const searchKanModalBootStrap = new bootstrap.Modal("#searchKanModal");
|
|
||||||
$("#searchKan").on("click", function(){
|
|
||||||
searchKanModalBootStrap.show();
|
|
||||||
});//searchKan
|
|
||||||
|
|
||||||
$("#searchVendor").on("click", function(){
|
|
||||||
searchModalBootStrap.show();
|
|
||||||
});//searcVendor
|
|
||||||
|
|
||||||
$("#submitBtn").on("click", function(){
|
$("#submitBtn").on("click", function(){
|
||||||
var name = $("#name").val();
|
var name = $("#name").val();
|
||||||
var company_name = $("#company_name").val();
|
var company_name = $("#company_name").val();
|
||||||
@@ -240,19 +165,34 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
$("#searchKan").on("click", function(){
|
||||||
|
searchKanCode();
|
||||||
|
});//searchKan
|
||||||
|
|
||||||
|
$("#searchVendor").on("click", function(){
|
||||||
|
searchModalBootStrap.show();
|
||||||
|
});//searcVendor
|
||||||
|
|
||||||
|
|
||||||
|
function searchKanCode(){
|
||||||
|
$.ajax({
|
||||||
});//ready
|
url:"/category/categorysearch",
|
||||||
function searchKanCode(){
|
type:"get",
|
||||||
|
datatype:"html"
|
||||||
}
|
}).done(function(data){
|
||||||
|
$("body").append(data);
|
||||||
|
$("#searchKanModal").modal("show");
|
||||||
|
}).fail(function() {
|
||||||
|
alert("오류가 발생했습니다.");
|
||||||
|
}).always(function() {
|
||||||
|
//alert("항상뜨는 창입니다.");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function searchVendor(){
|
function searchVendor(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
});//ready
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -101,9 +101,34 @@
|
|||||||
|
|
||||||
})//modifyBtn click
|
})//modifyBtn click
|
||||||
|
|
||||||
|
yesNoModal.yesFunction = deleteProductFunction;
|
||||||
});//ready
|
});//ready
|
||||||
|
|
||||||
|
|
||||||
|
function deleteProductFunction(){
|
||||||
|
var id = $("#id").val();
|
||||||
|
$.ajax({
|
||||||
|
url: "/product/delete",
|
||||||
|
type: "delete",
|
||||||
|
data: {
|
||||||
|
"id": id
|
||||||
|
},
|
||||||
|
datatype:"json"
|
||||||
|
}).done(function(data) {
|
||||||
|
if (data == true) {
|
||||||
|
alert("삭제되었습니다.");
|
||||||
|
$(location).attr("href", "/product/list");
|
||||||
|
} else {
|
||||||
|
alert("정상적으로 삭제되지 않았습니다..");
|
||||||
|
}
|
||||||
|
}).fail(function() {
|
||||||
|
alert("오류가 발생했습니다.");
|
||||||
|
}).always(function() {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
|
||||||
|
}//deleteCategoryFunction
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -32,6 +32,13 @@
|
|||||||
<div class="ulTag">
|
<div class="ulTag">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12" style="text-align: center;">
|
<div class="col-12" style="text-align: center;">
|
||||||
|
|
||||||
|
|
||||||
|
<-- 세션 만들어지고 value 수정-->
|
||||||
|
<input type='hidden' id="managerId" value="e9882095-aeb2-11ee-935d-0242ac110006">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="input-group mb-3 w-40 col-centered">
|
<div class="input-group mb-3 w-40 col-centered">
|
||||||
<span class="input-group-text" id="basic-addon1">창고명</span>
|
<span class="input-group-text" id="basic-addon1">창고명</span>
|
||||||
<input type="text" name="name" id="name" class="form-control"
|
<input type="text" name="name" id="name" class="form-control"
|
||||||
@@ -73,6 +80,7 @@
|
|||||||
|
|
||||||
|
|
||||||
$("#submitBtn").on("click", function(){
|
$("#submitBtn").on("click", function(){
|
||||||
|
var managerId = $("#managerId").val();
|
||||||
var name = $("#name").val();
|
var name = $("#name").val();
|
||||||
var capacity = $("#capacity").val();
|
var capacity = $("#capacity").val();
|
||||||
var address = $("#address").val();
|
var address = $("#address").val();
|
||||||
@@ -99,10 +107,11 @@
|
|||||||
url: "/warehouse/create_process",
|
url: "/warehouse/create_process",
|
||||||
type: "post",
|
type: "post",
|
||||||
data: {
|
data: {
|
||||||
|
"managerId" : managerId,
|
||||||
"name": name,
|
"name": name,
|
||||||
"capacity": capacity,
|
"capacity": capacity,
|
||||||
"address": address,
|
"address": address
|
||||||
"activation": true
|
|
||||||
},
|
},
|
||||||
datatype:"json"
|
datatype:"json"
|
||||||
}).done(function(data) {
|
}).done(function(data) {
|
||||||
|
|||||||
@@ -25,19 +25,24 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="col-12" id="search">
|
<div class="col-12">
|
||||||
<form action="list">
|
<form action="list">
|
||||||
<div class="input-group mb-3 w-30 col-centered">
|
<div class="input-group mb-3 w-30 col-centered">
|
||||||
<div class="w-25">
|
<div class="w-25">
|
||||||
<select class="form-select" name="searchn">
|
<select class="form-select" name="searchn" id="searchn">
|
||||||
<option value="0">창고명</option>
|
<option value="0">창고명</option>
|
||||||
<option value="1">용량</option>
|
<option value="1">용량</option>
|
||||||
<option value="2">적재량</option>
|
<option value="2">적재량</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" name="search" class="form-control"
|
<input type="text" name="search" id="search" class="form-control"
|
||||||
aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
||||||
<input class="btn btn-info" type="submit" id="button-addon2 searchBtn" value="검색"/>
|
<input class="btn btn-info" type="submit" id="searchBtn" value="검색"/>
|
||||||
|
|
||||||
|
<!-- 페이징작업용 -->
|
||||||
|
<input type="hidden" id="searchn1" value="${searchn}">
|
||||||
|
<input type="hidden" id="search1" value="${search}">
|
||||||
|
<!-- 페이징작업용 -->
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -57,7 +62,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<c:forEach items="${wlist }" var="dto">
|
<c:forEach items="${wlist }" var="dto">
|
||||||
<tr class="detailTr" data-id="${dto.id}" )>
|
<tr class="detailTr" data-id="${dto.id}">
|
||||||
<td>${start} <c:set var="start" value="${start +1 }"/></td>
|
<td>${start} <c:set var="start" value="${start +1 }"/></td>
|
||||||
<td>${dto.name }</td>
|
<td>${dto.name }</td>
|
||||||
<td>${dto.capacity }</td>
|
<td>${dto.capacity }</td>
|
||||||
@@ -75,28 +80,29 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6 d-flex justify-content-center">
|
<div class="col-6 d-flex justify-content-center">
|
||||||
<nev>
|
<nav>
|
||||||
<ul class="pagination">
|
<ul class="pagination">
|
||||||
|
|
||||||
<c:if test="${begin > pageNum }">
|
<c:if test="${begin > pageNum }">
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a class="page-link" href="list?p=${begin - 1 }"><</a>
|
<a href="javascript:void(0);" class="page-link" onclick="pageingFunction(this.id)" id="${begin - 1 }"><</a>
|
||||||
</li>
|
</li>
|
||||||
</c:if>
|
</c:if>
|
||||||
<c:forEach begin="${begin }" end="${end }" var="i">
|
<c:forEach begin="${begin }" end="${end }" var="i">
|
||||||
<li class="page-item <c:if test="${p == i}"> active </c:if>">
|
<li class="page-item <c:if test="${p == i}"> active </c:if>">
|
||||||
<a class="page-link " href="list?p=${i }">${i }</a>
|
<a href="javascript:void(0);" class="page-link " onclick="pageingFunction(this.id); return false;" id="${i }">${i }</a>
|
||||||
</li>
|
</li>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
<c:if test="${end < totalPages }">
|
<c:if test="${end < totalPages }">
|
||||||
<li class="page-item">
|
<li class="page-item">
|
||||||
<a class="page-link" href="list?p=${end + 1 }">></a>
|
<a href="javascript:void(0);" class="page-link" onclick="pageingFunction(this.id)" id="${end + 1 }">></a>
|
||||||
</li>
|
</li>
|
||||||
</c:if>
|
</c:if>
|
||||||
</ul>
|
</ul>
|
||||||
</nev>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3 text-end">
|
<div class="col-3 text-end">
|
||||||
<button type="button" class="btn btn-primary" id="createButton">생성</button>
|
<button type="button" class="btn btn-primary" onclick="window.location.href='/warehouse/create'">생성</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -109,14 +115,7 @@
|
|||||||
|
|
||||||
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
//POST방식으로 create폼화면 출력
|
|
||||||
$("#createButton").on("click", function () {
|
|
||||||
var form = document.createElement("form");
|
|
||||||
form.action = "/warehouse/create";
|
|
||||||
form.method = "POST";
|
|
||||||
document.body.appendChild(form);
|
|
||||||
form.submit();
|
|
||||||
});
|
|
||||||
|
|
||||||
$("body").on("click", ".detailTr", function () {
|
$("body").on("click", ".detailTr", function () {
|
||||||
var id = $(this).data("id");
|
var id = $(this).data("id");
|
||||||
@@ -135,7 +134,70 @@
|
|||||||
form.submit();
|
form.submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//검색기능
|
||||||
|
$("#searchBtn").on("click",function(){
|
||||||
|
|
||||||
|
var searchn = $("#searchn").val();
|
||||||
|
var search = $("#search").val();
|
||||||
|
|
||||||
|
var form = document.createElement("form");
|
||||||
|
form.action = "/warehouse/list";
|
||||||
|
form.method = "get";
|
||||||
|
|
||||||
|
var input1 = document.createElement("input");
|
||||||
|
input1.type = "hidden";
|
||||||
|
input1.name = "searchn";
|
||||||
|
input1.value = searchn;
|
||||||
|
form.appendChild(input1);
|
||||||
|
|
||||||
|
var input2 = document.createElement("input");
|
||||||
|
input2.type = "hidden";
|
||||||
|
input2.name = "search";
|
||||||
|
input2.value = search;
|
||||||
|
form.appendChild(input2);
|
||||||
|
|
||||||
|
var input3 = document.createElement("input");
|
||||||
|
input3.type = "hidden";
|
||||||
|
input3.name = "p";
|
||||||
|
input3.value = 1;
|
||||||
|
form.appendChild(input3);
|
||||||
|
|
||||||
|
document.body.appendChild(form);
|
||||||
|
form.submit();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
});//ready
|
});//ready
|
||||||
|
|
||||||
|
function pageingFunction(clickedId){
|
||||||
|
var searchn1 = $("#searchn1").val();
|
||||||
|
var search1 = $("#search1").val();
|
||||||
|
|
||||||
|
var form = document.createElement("form");
|
||||||
|
form.action = "/warehouse/list";
|
||||||
|
form.method = "get";
|
||||||
|
|
||||||
|
var input1 = document.createElement("input");
|
||||||
|
input1.type = "hidden";
|
||||||
|
input1.name = "searchn";
|
||||||
|
input1.value = searchn1;
|
||||||
|
form.appendChild(input1);
|
||||||
|
|
||||||
|
var input2 = document.createElement("input");
|
||||||
|
input2.type = "hidden";
|
||||||
|
input2.name = "search";
|
||||||
|
input2.value = search1;
|
||||||
|
form.appendChild(input2);
|
||||||
|
|
||||||
|
var input3 = document.createElement("input");
|
||||||
|
input3.type = "hidden";
|
||||||
|
input3.name = "p";
|
||||||
|
input3.value = clickedId;
|
||||||
|
form.appendChild(input3);
|
||||||
|
|
||||||
|
document.body.appendChild(form);
|
||||||
|
form.submit();
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -18,56 +18,57 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<h1>창고 상세페이지</h1>
|
<h1>창고 상세페이지</h1>
|
||||||
<div class="col-10" style="text-align: right;">
|
<div class="col-10" style="text-align: right;">
|
||||||
<button type="button" class="btn btn-danger" id="yes_no_modal_show_button">삭제</button>
|
<button type="button" class="btn btn-danger" id="yes_no_modal_show">삭제</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div style="text-align: center">
|
<div style="text-align: center">
|
||||||
<form>
|
<div class="container">
|
||||||
<div class="container">
|
<div class="row">
|
||||||
<div class="row">
|
<div class="input-group mb-3 w-40 col-4">
|
||||||
<div class="input-group mb-3 w-40 col-4">
|
<span class="input-group-text" id="basic-addon1">창고명</span>
|
||||||
<span class="input-group-text" id="basic-addon1">창고명</span>
|
<input type="text" class="form-control" aria-label="창고명" value="${One.name }" readonly>
|
||||||
<input type="text" class="form-control" aria-label="창고명" value="${One.name }" readonly>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="input-group mb-3 w-40 col-4">
|
|
||||||
<span class="input-group-text" id="basic-addon2">용적</span>
|
|
||||||
<input type="text" class="form-control" aria-label="용적" value="${One.capacity }" readonly>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="input-group mb-3 w-40 col-4">
|
|
||||||
<span class="input-group-text" id="basic-addon3">적재량</span>
|
|
||||||
<input type="text" class="form-control" aria-label="적재량" value="${One.currentCapacity }" readonly>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="input-group mb-3 w-40 col-4">
|
||||||
|
<span class="input-group-text" id="basic-addon2">용적</span>
|
||||||
|
<input type="text" class="form-control" aria-label="용적" value="${One.capacity }" readonly>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="input-group mb-3 w-40 col-4">
|
||||||
|
<span class="input-group-text" id="basic-addon3">적재량</span>
|
||||||
|
<input type="text" class="form-control" aria-label="적재량" value="${One.currentCapacity }" readonly>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
</div>
|
||||||
<hr>
|
<div>
|
||||||
</div>
|
<hr>
|
||||||
|
</div>
|
||||||
|
<div id="productSearch">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="col-12" id="search">
|
<div class="col-12">
|
||||||
<form action="list">
|
|
||||||
<div class="input-group mb-3 w-30 col-centered">
|
<div class="input-group mb-3 w-30 col-centered">
|
||||||
<div class="w-25">
|
<div class="w-25">
|
||||||
<select class="form-select" name="searchn">
|
<select class="form-select" id="searchn">
|
||||||
<option value="0">제품명</option>
|
<option value="0">제품명</option>
|
||||||
<option value="1">재고수</option>
|
<option value="1">재고수</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
|
||||||
<input type="text" name="search" class="form-control"
|
|
||||||
aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
|
||||||
<input class="btn btn-info" type="submit" id="button-addon2 searchBtn" value="검색"/>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
<input type=hidden id="id" value="${One.id}">
|
||||||
|
<input type="text" name="search" class="form-control" id="search"
|
||||||
|
aria-label="Text input with dropdown button" placeholder="검색어를 입력하세요">
|
||||||
|
<input class="btn btn-info" type="submit" id="searchBtn" value="검색"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
|
|
||||||
<div class="row row-table">
|
<div class="row row-table">
|
||||||
<div class="col-12">
|
<div id="searchResults" class="col-12">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead class="table-dark">
|
<thead class="table-dark">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -115,29 +116,46 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</nev>
|
</nev>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3 ">
|
|
||||||
<div class="w-40 col-centered" style="text-align: right">
|
|
||||||
<button type="button" class="btn btn-primary" id="checkBtn">확인</button>
|
|
||||||
<button type="button" class="btn btn-warning" id="modifyBtn">수정</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</div>
|
||||||
|
<div class="align: center">
|
||||||
|
<div class="w-40 col-centered" style="text-align: right">
|
||||||
|
<button type="button" class="btn btn-primary" id="checkBtn">확인</button>
|
||||||
|
<button type="button" class="btn btn-warning" id="modifyBtn">
|
||||||
|
수정
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="modal fade" id="yes_no_modal_delete" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-dialog-centered">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h1 class="modal-title fs-5" id="yesNoModalLabel">삭제 하시겠습니까?</h1>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">닫기</button>
|
||||||
|
<button id="modal_yes_button_warehouse_delete" type="button" class="modal_yes btn btn-primary">삭제</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function () {
|
||||||
$("#checkBtn").on("click", function() {
|
$("#checkBtn").on("click", function () {
|
||||||
$(location).attr("href", "/warehouse/list");
|
$(location).attr("href", "/warehouse/list");
|
||||||
})//checkBtn click
|
})//checkBtn click
|
||||||
|
|
||||||
|
|
||||||
$("#modifyBtn").on("click", function() {
|
$("#modifyBtn").on("click", function() {
|
||||||
var id = $("#id").val();
|
var id = $("#id").val();
|
||||||
|
|
||||||
var form = document.createElement("form");
|
var form = document.createElement("form");
|
||||||
form.action = "/warehouse/update";
|
form.action = "/warehouse/update";
|
||||||
form.method = "GET";
|
form.method = "POST";
|
||||||
document.body.appendChild(form);
|
document.body.appendChild(form);
|
||||||
|
|
||||||
var input = document.createElement("input");
|
var input = document.createElement("input");
|
||||||
@@ -150,25 +168,82 @@
|
|||||||
|
|
||||||
})//modifyBtn click
|
})//modifyBtn click
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
yesNoModal.yesFunction = deleteCategoryFunction;
|
||||||
|
|
||||||
|
|
||||||
|
function deleteCategoryFunction(){
|
||||||
|
var id = $("#id").val();
|
||||||
|
$.ajax({
|
||||||
|
url: "/warehouse/delete",
|
||||||
|
type: "delete",
|
||||||
|
data: {
|
||||||
|
"id": id
|
||||||
|
},
|
||||||
|
datatype:"json"
|
||||||
|
}).done(function(data) {
|
||||||
|
if (data == true) {
|
||||||
|
alert("삭제되었습니다.");
|
||||||
|
$(location).attr("href", "/warehouse/list");
|
||||||
|
} else {
|
||||||
|
alert("정상적으로 삭제되지 않았습니다..");
|
||||||
|
}
|
||||||
|
}).fail(function() {
|
||||||
|
alert("오류가 발생했습니다.");
|
||||||
|
}).always(function() {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
|
||||||
|
}//deleteCategoryFunction
|
||||||
|
|
||||||
|
const yesNoModalBootStrap = new bootstrap.Modal("#yes_no_modal_delete");
|
||||||
|
$("#yes_no_modal_show").on("click", function(){
|
||||||
|
yesNoModalBootStrap.show();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#modal_yes_button_warehouse_delete").on("click", function(){
|
||||||
|
yesNoModal.yesFunction();
|
||||||
|
yesNoModalBootStrap.hide();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 검색 버튼 클릭 시 Ajax로 검색 결과를 갱신
|
||||||
|
$("#searchBtn").click(function () {
|
||||||
|
var search = $("#search").val();
|
||||||
|
var searchn = $("#searchn").val();
|
||||||
|
var id = $("#id").val();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "read.jsp",
|
||||||
|
method: "POST",
|
||||||
|
data: {
|
||||||
|
search: search,
|
||||||
|
searchn: searchn,
|
||||||
|
id: id
|
||||||
|
|
||||||
|
},
|
||||||
|
success: function (result) {
|
||||||
|
// 검색 결과를 받아와서 결과를 보여주는 영역 업데이트
|
||||||
|
$("#searchResults").html(result);
|
||||||
|
},
|
||||||
|
error: function () {
|
||||||
|
alert("검색 중 오류가 발생했습니다.");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
});//ready
|
});//ready
|
||||||
|
|
||||||
|
|
||||||
$(function () {
|
|
||||||
$("a[id]").click(function () {
|
|
||||||
let no = $(this).attr("id");// 글번호
|
|
||||||
$.ajax({
|
|
||||||
url: "/deleteWarehouse/delete",
|
|
||||||
data: "id=" + id,
|
|
||||||
method: "delete"
|
|
||||||
}
|
|
||||||
).done(function () {
|
|
||||||
alert("삭제되었습니다.");
|
|
||||||
location.href = "/warehouse/list";
|
|
||||||
})
|
|
||||||
return false;//하이퍼링크 이동 X
|
|
||||||
})//click
|
|
||||||
})
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,154 +1,164 @@
|
|||||||
<%@ page contentType="text/html; charset=UTF-8"%>
|
<%@ 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"%>
|
||||||
|
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<title>제품 카테고리 수정페이지</title>
|
<title>창고 정보 수정페이지</title>
|
||||||
|
<style>
|
||||||
|
.body{
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.col-centered{
|
||||||
|
margin: 0 auto;
|
||||||
|
float: none;
|
||||||
|
}
|
||||||
|
.col-margin-left-32{
|
||||||
|
margin-left: 32%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="mt-5 mb-5 text-center">
|
<div class="mt-5 mb-5 text-center">
|
||||||
<h1>제품 카테고리 수정페이지</h1>
|
<h1>창고 정보 수정페이지</h1>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div style="text-align: center">
|
<div style="text-align: center">
|
||||||
<form>
|
<form id="createForm">
|
||||||
<%-- <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" class="form-control" placeholder="대분류" id="cls_nm_1"--%>
|
|
||||||
<%-- aria-label="대분류" value="${dto.cls_nm_1 }">--%>
|
|
||||||
<%-- </div>--%>
|
|
||||||
|
|
||||||
<%-- <div class="input-group mb-3 w-40 col-centered">--%>
|
<div class="ulTag">
|
||||||
<%-- <span class="input-group-text" id="basic-addon2">중분류</span> <input--%>
|
<div class="row">
|
||||||
<%-- type="text" class="form-control" placeholder="중분류" id="cls_nm_2"--%>
|
<div class="col-12" style="text-align: center;">
|
||||||
<%-- aria-label="중분류" value="${dto.cls_nm_2 }">--%>
|
|
||||||
<%-- </div>--%>
|
|
||||||
|
|
||||||
<%-- <div class="input-group mb-3 w-40 col-centered">--%>
|
|
||||||
<%-- <span class="input-group-text" id="basic-addon3">소분류</span> <input--%>
|
|
||||||
<%-- type="text" class="form-control" placeholder="소분류" id="cls_nm_3"--%>
|
|
||||||
<%-- aria-label="소분류" value="${dto.cls_nm_3 }">--%>
|
|
||||||
<%-- </div>--%>
|
|
||||||
|
|
||||||
<%-- <div class="input-group mb-3 w-40 col-centered">--%>
|
<div class="input-group mb-3 w-40 col-centered">
|
||||||
<%-- <span class="input-group-text" id="basic-addon4">세분류</span> <input--%>
|
<span class="input-group-text" id="basic-addon1">창고명</span>
|
||||||
<%-- type="text" class="form-control" placeholder="세분류" id="cls_nm_4"--%>
|
<input type="text" name="name" id="name" class="form-control"
|
||||||
<%-- aria-label="세분류" value="${dto.cls_nm_4 }">--%>
|
placeholder="창고명을 입력하세요" aria-label="창고명" value="${dto.name }"
|
||||||
<%-- </div>--%>
|
aria-describedby="basic-addon1">
|
||||||
|
</div>
|
||||||
|
<!-- 설명만 있는 입력 -->
|
||||||
|
<div class="input-group mb-3 w-40 col-centered">
|
||||||
|
<span class="input-group-text" id="basic-addon2">용적</span>
|
||||||
|
<input type="text" name="capacity" id="capacity" class="form-control"
|
||||||
|
placeholder="용적을 입력하세요" aria-label="용적" value="${dto.capacity }"
|
||||||
|
aria-describedby="basic-addon1">
|
||||||
|
</div>
|
||||||
|
|
||||||
<%-- <div class="input-group mb-3 w-40 col-centered">--%>
|
<div class="input-group mb-3 w-40 col-centered">
|
||||||
<%-- <span class="input-group-text" id="basic-addon5">KAN 코드</span> <input--%>
|
<span class="input-group-text" id="basic-addon3">주소</span>
|
||||||
<%-- type="text" class="form-control" placeholder="KAN 코드"--%>
|
<input type="text" name="address" id="address" class="form-control"
|
||||||
<%-- aria-label="KAN 코드" value="${dto.kan_code }" id="kan_code" readonly>--%>
|
placeholder="주소를 입력하세요" aria-label="주소" value="${dto.address }"
|
||||||
<%-- </div>--%>
|
aria-describedby="basic-addon1">
|
||||||
<%-- </div>--%>
|
</div>
|
||||||
<%-- </div>--%>
|
|
||||||
<%-- </div>--%>
|
|
||||||
|
|
||||||
<%-- <div class="row">--%>
|
|
||||||
<%-- <div class="col-12 ">--%>
|
|
||||||
<%-- <div class="w-40 col-centered" style="text-align: right">--%>
|
<input type="hidden" name="name" id="id" class="form-control"
|
||||||
<%-- <button type="button" class="btn btn-primary" id="updateBtn">수정 완료</button>--%>
|
placeholder="창고명을 입력하세요" aria-label="창고명" value="${dto.id }"
|
||||||
<%-- <button type="button" class="btn btn-secondary" id="cancelBtn">취소</button>--%>
|
aria-describedby="basic-addon1">
|
||||||
<%-- </div>--%>
|
</div>
|
||||||
<%-- </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">수정 완료</button>
|
||||||
|
<button type="button" class="btn btn-secondary" id="cancelBtn">취소</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
// $(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// $("#updateBtn").on("click", function() {
|
$("#updateBtn").on("click", function() {
|
||||||
//
|
|
||||||
// var clsnm1 = $("#cls_nm_1").val();
|
var name = $("#name").val();
|
||||||
// var clsnm2 = $("#cls_nm_2").val();
|
var capacity = $("#capacity").val();
|
||||||
// var clsnm3 = $("#cls_nm_3").val();
|
var address = $("#address").val();
|
||||||
// var clsnm4 = $("#cls_nm_4").val();
|
var id = $("#id").val();
|
||||||
// var kan_code = $("#kan_code").val();
|
|
||||||
// if(!clsnm1){
|
if(!name){
|
||||||
// alert("대분류를 입력해야 합니다.");
|
alert("창고명을 입력해야 합니다.");
|
||||||
// $("#cls_nm_1").focus();
|
$("#name").focus();
|
||||||
// return false;
|
return false;
|
||||||
// }
|
}
|
||||||
// if(!clsnm2){
|
if(!capacity){
|
||||||
// alert("중분류를 입력해야 합니다.");
|
alert("용적크기를 입력해야 합니다.");
|
||||||
// $("#cls_nm_2").focus();
|
$("#capacity").focus();
|
||||||
// return false;
|
return false;
|
||||||
// }
|
}
|
||||||
// if(!clsnm3){
|
if(!address){
|
||||||
// alert("소분류를 입력해야 합니다.");
|
alert("주소를 입력해야 합니다.");
|
||||||
// $("#cls_nm_3").focus();
|
$("#address").focus();
|
||||||
// return false;
|
return false;
|
||||||
// }
|
}
|
||||||
// if(!clsnm4){
|
|
||||||
// alert("세분류를 입력해야 합니다.");
|
|
||||||
// $("#cls_nm_4").focus();
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// $.ajax({
|
|
||||||
// url: "/category/update_process",
|
|
||||||
// type: "put",
|
|
||||||
// data: {
|
|
||||||
// "cls_nm_1": clsnm1,
|
|
||||||
// "cls_nm_2": clsnm2,
|
|
||||||
// "cls_nm_3": clsnm3,
|
|
||||||
// "cls_nm_4": clsnm4,
|
|
||||||
// "kan_code": kan_code,
|
|
||||||
// "activation": true
|
|
||||||
// },
|
|
||||||
// datatype:"json"
|
|
||||||
// }).done(function(data) {
|
|
||||||
// if (data == true) {
|
|
||||||
// alert("카테고리를 수정하였습니다.");
|
|
||||||
//
|
|
||||||
// var form = document.createElement("form");
|
|
||||||
// form.action = "/category/read";
|
|
||||||
// form.method = "POST";
|
|
||||||
// document.body.appendChild(form);
|
|
||||||
//
|
|
||||||
// var input = document.createElement("input");
|
|
||||||
// input.type = "hidden";
|
|
||||||
// input.name = "kan_code";
|
|
||||||
// input.value = kan_code;
|
|
||||||
// form.appendChild(input);
|
|
||||||
//
|
|
||||||
// form.submit();
|
|
||||||
// } else {
|
|
||||||
// alert("카테고리 수정에 실패하였습니다.");
|
|
||||||
// }
|
|
||||||
// }).fail(function() {
|
|
||||||
// alert("오류가 발생했습니다.");
|
|
||||||
// }).always(function() {
|
|
||||||
// //
|
|
||||||
// });
|
|
||||||
//
|
|
||||||
// });//updateBtn
|
|
||||||
//
|
|
||||||
// $("#cancelBtn").on("click", function(){
|
|
||||||
// var kan_code = $("#kan_code").val();
|
|
||||||
//
|
|
||||||
// var form = document.createElement("form");
|
|
||||||
// form.action = "/category/read";
|
|
||||||
// form.method = "POST";
|
|
||||||
// document.body.appendChild(form);
|
|
||||||
//
|
|
||||||
// var input = document.createElement("input");
|
|
||||||
// input.type = "hidden";
|
|
||||||
// input.name = "kan_code";
|
|
||||||
// input.value = kan_code;
|
|
||||||
// form.appendChild(input);
|
|
||||||
//
|
|
||||||
// form.submit();
|
|
||||||
//
|
|
||||||
// })
|
|
||||||
|
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "/warehouse/update_process",
|
||||||
|
type: "put",
|
||||||
|
data: {
|
||||||
|
"name": name,
|
||||||
|
"capacity": capacity,
|
||||||
|
"address": address,
|
||||||
|
"id": id
|
||||||
|
|
||||||
|
},
|
||||||
|
datatype:"json"
|
||||||
|
}).done(function(data) {
|
||||||
|
if (data == true) {
|
||||||
|
alert("창고를 수정하였습니다.");
|
||||||
|
|
||||||
|
var form = document.createElement("form");
|
||||||
|
form.action = "/warehouse/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();
|
||||||
|
} else {
|
||||||
|
alert("카테고리 수정에 실패하였습니다.");
|
||||||
|
}
|
||||||
|
}).fail(function() {
|
||||||
|
alert("오류가 발생했습니다.");
|
||||||
|
}).always(function() {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
|
||||||
|
});//updateBtn
|
||||||
|
|
||||||
|
$("#cancelBtn").on("click", function(){
|
||||||
|
var id = $("#id").val();
|
||||||
|
|
||||||
|
var form = document.createElement("form");
|
||||||
|
form.action = "/warehouse/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();
|
||||||
|
|
||||||
|
})
|
||||||
});//ready
|
});//ready
|
||||||
</script>
|
</script>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user