mirror of
https://github.com/suhf/No1WMS.git
synced 2026-02-04 19:54:00 +09:00
change list Date value and add In Controller,Dto, mapper, mapper.xml,
service, views and change minor details
This commit is contained in:
@@ -1,5 +1,64 @@
|
|||||||
package com.no1.wms.in;
|
package com.no1.wms.in;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("/in")
|
||||||
public class InController {
|
public class InController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
InService inService;
|
||||||
|
|
||||||
|
@GetMapping("/list")
|
||||||
|
//@ResponseBody
|
||||||
|
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 = inService.count(searchn, search);
|
||||||
|
|
||||||
|
int perPage = 15;
|
||||||
|
int startRow = (page - 1) * perPage;
|
||||||
|
|
||||||
|
List<InDto> dto = inService.inList(searchn, search, startRow, perPage);
|
||||||
|
|
||||||
|
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("list", dto);
|
||||||
|
m.addAttribute("start", startRow + 1);
|
||||||
|
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 "/in/list";
|
||||||
|
|
||||||
|
}
|
||||||
|
@PostMapping("/create")
|
||||||
|
public String create() {
|
||||||
|
return "in/create";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,46 @@
|
|||||||
package com.no1.wms.in;
|
package com.no1.wms.in;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
import org.apache.ibatis.type.Alias;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import com.no1.wms.account.AccountDto;
|
||||||
|
import com.no1.wms.planin.PlanInDto;
|
||||||
|
import com.no1.wms.product.ProductDto;
|
||||||
|
import com.no1.wms.warehouse.WarehouseDto;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Alias("InDto")
|
||||||
public class InDto {
|
public class InDto {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private String group_number;
|
||||||
|
private String product_id;
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
|
private Date in_date;
|
||||||
|
private String quantity;
|
||||||
|
private String warehouse_id;
|
||||||
|
private String manager_id;
|
||||||
|
private String note;
|
||||||
|
private boolean activation;//활성화
|
||||||
|
private int latest_price;
|
||||||
|
|
||||||
|
private PlanInDto planInDto;
|
||||||
|
private ProductDto productDto;
|
||||||
|
private WarehouseDto warehouseDto;
|
||||||
|
private AccountDto accountDto;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
package com.no1.wms.in;
|
package com.no1.wms.in;
|
||||||
|
|
||||||
public class InMapper {
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface InMapper {
|
||||||
|
List<InDto> inList(Map<String, Object> m);
|
||||||
|
int count(Map<String, Object> m);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,37 @@
|
|||||||
package com.no1.wms.in;
|
package com.no1.wms.in;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
public class InService {
|
public class InService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
InMapper mapper;
|
||||||
|
|
||||||
|
public List<InDto> inList(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.inList(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);
|
||||||
|
};//카운터
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,10 +12,12 @@ import org.springframework.stereotype.Controller;
|
|||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
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;
|
||||||
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 org.springframework.web.bind.annotation.SessionAttributes;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import com.no1.wms.account.AccountDto;
|
import com.no1.wms.account.AccountDto;
|
||||||
@@ -30,12 +32,15 @@ public class MypageController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
ImgService imgService;
|
ImgService imgService;
|
||||||
|
|
||||||
@GetMapping("/mypage")
|
|
||||||
public String mypage(Model m, HttpServletRequest request) {
|
|
||||||
|
|
||||||
HttpSession session = request.getSession();
|
@GetMapping("/mypage")
|
||||||
|
public String mypage(Model m, HttpSession session) {
|
||||||
|
|
||||||
|
//HttpSession session = request.getSession();
|
||||||
AccountDto dto = (AccountDto) session.getAttribute("userData");
|
AccountDto dto = (AccountDto) session.getAttribute("userData");
|
||||||
|
|
||||||
|
//System.out.println(dto.getId());
|
||||||
|
|
||||||
AccountDto list = accountService.selectById(dto);
|
AccountDto list = accountService.selectById(dto);
|
||||||
m.addAttribute("list", list);
|
m.addAttribute("list", list);
|
||||||
|
|
||||||
@@ -88,9 +93,9 @@ public class MypageController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/mypage/uplodeImg")
|
@PostMapping("/mypage/uplodeImg")
|
||||||
public String imgFileUplode(HttpServletRequest request, MultipartFile file) {
|
public String imgFileUplode(HttpServletRequest request,HttpSession session , MultipartFile file) {
|
||||||
//System.out.println(file);
|
//System.out.println(file);
|
||||||
HttpSession session = request.getSession();
|
//HttpSession session = request.getSession();
|
||||||
AccountDto dto = (AccountDto) session.getAttribute("userData");
|
AccountDto dto = (AccountDto) session.getAttribute("userData");
|
||||||
String fileName = dto.getId();
|
String fileName = dto.getId();
|
||||||
//System.out.println(fileName);
|
//System.out.println(fileName);
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.no1.wms.price;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import org.apache.ibatis.type.Alias;
|
import org.apache.ibatis.type.Alias;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import com.no1.wms.account.AccountDto;
|
import com.no1.wms.account.AccountDto;
|
||||||
import com.no1.wms.product.ProductDto;
|
import com.no1.wms.product.ProductDto;
|
||||||
@@ -21,6 +22,7 @@ public class PriceDto {
|
|||||||
|
|
||||||
private String id;//id
|
private String id;//id
|
||||||
private String price;//가격
|
private String price;//가격
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date registration_date;//등록날짜
|
private Date registration_date;//등록날짜
|
||||||
private String manager_id;//담당자
|
private String manager_id;//담당자
|
||||||
private String product_id; //제품 아이디
|
private String product_id; //제품 아이디
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package com.no1.wms.product;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
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;
|
||||||
@@ -14,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import com.no1.wms.account.AccountDto;
|
||||||
|
import com.no1.wms.account.AccountService;
|
||||||
import com.no1.wms.category.CategoryDto;
|
import com.no1.wms.category.CategoryDto;
|
||||||
import com.no1.wms.category.CategoryService;
|
import com.no1.wms.category.CategoryService;
|
||||||
import com.no1.wms.price.PriceDto;
|
import com.no1.wms.price.PriceDto;
|
||||||
@@ -30,6 +35,9 @@ public class ProductController {
|
|||||||
CategoryService categoryService;
|
CategoryService categoryService;
|
||||||
@Autowired
|
@Autowired
|
||||||
VendorService service;
|
VendorService service;
|
||||||
|
@Autowired
|
||||||
|
AccountService accountService;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@GetMapping("list")
|
@GetMapping("list")
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.no1.wms.product;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import org.apache.ibatis.type.Alias;
|
import org.apache.ibatis.type.Alias;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import com.no1.wms.account.AccountDto;
|
import com.no1.wms.account.AccountDto;
|
||||||
import com.no1.wms.authority.AuthorityDto;
|
import com.no1.wms.authority.AuthorityDto;
|
||||||
@@ -27,6 +28,7 @@ public class ProductDto {
|
|||||||
private String company_name = "미지정";//회사명
|
private String company_name = "미지정";//회사명
|
||||||
private String kan_code;//분류코드
|
private String kan_code;//분류코드
|
||||||
private String vendor_id;//거래처 id
|
private String vendor_id;//거래처 id
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||||
private Date registration_date;//등록날짜
|
private Date registration_date;//등록날짜
|
||||||
private String manager_id;//담당자
|
private String manager_id;//담당자
|
||||||
private boolean activation;//활성화
|
private boolean activation;//활성화
|
||||||
|
|||||||
140
src/main/resources/mappers/InMapper.xml
Normal file
140
src/main/resources/mappers/InMapper.xml
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
<?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.in.InMapper">
|
||||||
|
<resultMap id="inResultMap" type="InDto">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<result column="group_number" property="group_number" />
|
||||||
|
<result column="product_id" property="product_id" />
|
||||||
|
<result column="in_date" property="in_date" />
|
||||||
|
<result column="quantity" property="quantity" />
|
||||||
|
<result column="warehouse_id" property="warehouse_id" />
|
||||||
|
<result column="manager_id" property="manager_id" />
|
||||||
|
<result column="note" property="note" />
|
||||||
|
<result column="activation" property="activation" />
|
||||||
|
<result column="latest_price" property="latest_price" />
|
||||||
|
<!-- join -->
|
||||||
|
<association property="planInDto" javaType="PlanInDto">
|
||||||
|
<id column="groupNumber" property="groupNumber" />
|
||||||
|
<id column="productId" property="productId" />
|
||||||
|
<result column="view_group_number" property="viewGroupNumber" />
|
||||||
|
</association>
|
||||||
|
<association property="productDto" javaType="ProductDto">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<result column="product_name" property="name" />
|
||||||
|
</association>
|
||||||
|
<association property="warehouseDto" javaType="WarehouseDto">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<result column="warehouse_name" property="name" />
|
||||||
|
</association>
|
||||||
|
<association property="accountDto" javaType="AccountDto">
|
||||||
|
<id column="id" property="id" />
|
||||||
|
<result column="account_name" property="name" />
|
||||||
|
</association>
|
||||||
|
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- insert -->
|
||||||
|
|
||||||
|
<!-- update -->
|
||||||
|
|
||||||
|
<!-- delete -->
|
||||||
|
|
||||||
|
<!-- select -->
|
||||||
|
<select id="count" parameterType="map" resultType="int">
|
||||||
|
SELECT COUNT(*)
|
||||||
|
|
||||||
|
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>
|
||||||
|
</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,
|
||||||
|
planin.view_group_number,
|
||||||
|
pro.name as product_name,
|
||||||
|
w.name as warehouse_name,
|
||||||
|
a.name as account_name,
|
||||||
|
(SELECT price FROM prices WHERE product_id = proin.product_id ORDER BY registration_date DESC LIMIT 1) as latest_price
|
||||||
|
FROM
|
||||||
|
product_in as proin
|
||||||
|
LEFT JOIN plan_In as planin on proin.group_number = planin.group_number and proin.product_id = planin.product_id
|
||||||
|
LEFT JOIN product as pro on proin.product_id = pro.id
|
||||||
|
LEFT JOIN warehouse as w on proin.warehouse_id = w.id
|
||||||
|
LEFT JOIN account as a on proin.manager_id = a.id
|
||||||
|
<where>
|
||||||
|
<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>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<!-- update -->
|
<!-- update -->
|
||||||
<update id="updateById" parameterType="PriceDto">
|
<update id="updateById" parameterType="PriceDto">
|
||||||
UPDATE prices
|
UPDATE prices
|
||||||
SET price = #{price}, registration_date = CURDATE()
|
SET price = #{price}, manager_id = #{manager_id}, registration_date = CURDATE()
|
||||||
WHERE id = #{id}
|
WHERE id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
</when>
|
</when>
|
||||||
</choose>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
ORDER BY p.registration_date LIMIT #{start} , #{perPage}
|
ORDER BY p.registration_date desc LIMIT #{start} , #{perPage}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="count2" parameterType="map" resultType="int">
|
<select id="count2" parameterType="map" resultType="int">
|
||||||
|
|||||||
@@ -146,7 +146,7 @@
|
|||||||
|
|
||||||
</choose>
|
</choose>
|
||||||
</where>
|
</where>
|
||||||
ORDER BY p.registration_date LIMIT #{start} , #{perPage}
|
ORDER BY p.registration_date desc LIMIT #{start} , #{perPage}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
73
src/main/webapp/WEB-INF/views/in/create.jsp
Normal file
73
src/main/webapp/WEB-INF/views/in/create.jsp
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
<%@ page contentType="text/html; charset=UTF-8"%>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>새로운 입고 추가</title>
|
||||||
|
<style>
|
||||||
|
.col-centered{
|
||||||
|
margin: 0 auto;
|
||||||
|
float: none;
|
||||||
|
}
|
||||||
|
</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="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>
|
||||||
|
<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><!-- 여기서부터 작업 -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<c:set var="userData" value="${sessionScope.userData}" />
|
||||||
|
<input type='hidden' id="manager_id" value="${userData.id }">
|
||||||
|
</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>
|
||||||
|
</div>
|
||||||
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
136
src/main/webapp/WEB-INF/views/in/list.jsp
Normal file
136
src/main/webapp/WEB-INF/views/in/list.jsp
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
<%@ 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>Insert title here</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>
|
||||||
|
<option value="3">입고예정그룹번호</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>
|
||||||
|
<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.latest_price }</td>
|
||||||
|
<td>${dto.quantity }</td>
|
||||||
|
<td>${dto.planInDto.viewGroupNumber }</td>
|
||||||
|
<td><fmt:formatDate value="${dto.in_date}" pattern="yyyy-MM-dd" type="date"/></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 = "/in/create";
|
||||||
|
form.method = "POST";
|
||||||
|
document.body.appendChild(form);
|
||||||
|
form.submit();
|
||||||
|
});//createButton
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
});//ready
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -120,6 +120,7 @@
|
|||||||
<input type="text" class="form-control" id="position" name="position" value="${list.positionDto.name }" readonly>
|
<input type="text" class="form-control" id="position" name="position" value="${list.positionDto.name }" readonly>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<hr style="width: 700px;">
|
<hr style="width: 700px;">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col-md-2"></div>
|
<div class="col-md-2"></div>
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
</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() {
|
||||||
|
|||||||
@@ -55,8 +55,7 @@
|
|||||||
<td>${status.count }</td>
|
<td>${status.count }</td>
|
||||||
<td>${dto.productDto.name }</td>
|
<td>${dto.productDto.name }</td>
|
||||||
<td>${dto.price }</td>
|
<td>${dto.price }</td>
|
||||||
<td><fmt:formatDate value="${dto.registration_date }"
|
<td><fmt:formatDate value="${dto.registration_date}" pattern="yyyy-MM-dd" type="date"/></td>
|
||||||
dateStyle="short" /></td>
|
|
||||||
<td>${dto.accountDto.name }</td>
|
<td>${dto.accountDto.name }</td>
|
||||||
</tr>
|
</tr>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
|
|||||||
@@ -58,8 +58,7 @@
|
|||||||
<td>${dto.company_name }</td>
|
<td>${dto.company_name }</td>
|
||||||
<td>${dto.categoryDto.cls_nm_4 }</td>
|
<td>${dto.categoryDto.cls_nm_4 }</td>
|
||||||
<td>${dto.vendorDto.name }</td>
|
<td>${dto.vendorDto.name }</td>
|
||||||
<td><fmt:formatDate value="${dto.registration_date }"
|
<td><fmt:formatDate value="${dto.registration_date}" pattern="yyyy-MM-dd" type="date"/></td>
|
||||||
dateStyle="short" /></td>
|
|
||||||
<td>${dto.accountDto.name }</td>
|
<td>${dto.accountDto.name }</td>
|
||||||
</tr>
|
</tr>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
|
|||||||
Reference in New Issue
Block a user