From 74b0b2db70db8d2a237f5ad9622607cf6d06d83b Mon Sep 17 00:00:00 2001 From: freehyeon Date: Tue, 17 Dec 2024 11:08:26 +0900 Subject: [PATCH 1/5] =?UTF-8?q?order=20=EB=A7=88=EB=AC=B4=EB=A6=AC=20?= =?UTF-8?q?=EB=B0=91=20admin=20=EC=9E=91=EC=97=85=ED=95=A0=EB=A0=A4?= =?UTF-8?q?=EB=8B=A4=EA=B0=80=20=EC=A4=91=EB=8B=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/stockm8/config/WebConfig.java | 2 +- .../stockm8/controller/AdminController.java | 80 ++++ .../stockm8/controller/OrderController.java | 90 ++-- .../com/stockm8/domain/vo/OrderItemVO.java | 8 +- .../java/com/stockm8/domain/vo/PageVO.java | 2 +- .../java/com/stockm8/domain/vo/StockVO.java | 4 +- .../interceptor/AuthorizationInterceptor.java | 1 + .../com/stockm8/persistence/OrderDAO.java | 19 +- .../com/stockm8/persistence/OrderDAOImpl.java | 34 +- .../com/stockm8/service/OrderService.java | 18 +- .../com/stockm8/service/OrderServiceImpl.java | 65 ++- .../main/resources/mappers/OrderMapper.xml | 161 ++++--- .../webapp/WEB-INF/views/admin/adminList.jsp | 16 + .../webapp/WEB-INF/views/admin/adminMain.jsp | 15 + .../main/webapp/WEB-INF/views/dashboard.jsp | 2 +- .../WEB-INF/views/order/orderDetail.jsp | 79 ++++ .../webapp/WEB-INF/views/order/orderList.jsp | 73 ++- .../webapp/WEB-INF/views/order/register.jsp | 10 +- .../webapp/WEB-INF/views/user/dashboard.jsp | 2 +- .../main/webapp/resources/css/OrderStyle.css | 427 ++++++++++++------ 20 files changed, 772 insertions(+), 336 deletions(-) create mode 100644 stockMate/src/main/java/com/stockm8/controller/AdminController.java create mode 100644 stockMate/src/main/webapp/WEB-INF/views/admin/adminList.jsp create mode 100644 stockMate/src/main/webapp/WEB-INF/views/admin/adminMain.jsp create mode 100644 stockMate/src/main/webapp/WEB-INF/views/order/orderDetail.jsp diff --git a/stockMate/src/main/java/com/stockm8/config/WebConfig.java b/stockMate/src/main/java/com/stockm8/config/WebConfig.java index 35eeea9..38226fb 100644 --- a/stockMate/src/main/java/com/stockm8/config/WebConfig.java +++ b/stockMate/src/main/java/com/stockm8/config/WebConfig.java @@ -69,7 +69,7 @@ public class WebConfig implements WebMvcConfigurer { public void addInterceptors(InterceptorRegistry registry) { // Intercepter 적용 registry.addInterceptor(authorizationInterceptor) - .addPathPatterns("/dashboard", "/business", "/category/**", "/product/**", "/warehouse/**", "/stock/**", "/order/**" ) // 인터셉터를 적용할 경로 + .addPathPatterns("/dashboard", "/business", "/category/**", "/product/**", "/warehouse/**", "/stock/**", "/order/**","/admin/**" ) // 인터셉터를 적용할 경로 .excludePathPatterns( // 인터셉터를 제외할 경로 "/", // HomeController 경로 "/favicon.ico", // 브라우저 기본 요청 diff --git a/stockMate/src/main/java/com/stockm8/controller/AdminController.java b/stockMate/src/main/java/com/stockm8/controller/AdminController.java new file mode 100644 index 0000000..b8f4361 --- /dev/null +++ b/stockMate/src/main/java/com/stockm8/controller/AdminController.java @@ -0,0 +1,80 @@ +package com.stockm8.controller; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.inject.Inject; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import com.stockm8.domain.vo.Criteria; +import com.stockm8.domain.vo.OrderItemVO; +import com.stockm8.domain.vo.OrderVO; +import com.stockm8.domain.vo.PageVO; +import com.stockm8.domain.vo.OrderVO.OrderType; +import com.stockm8.domain.vo.StockVO; +import com.stockm8.domain.vo.UserVO; +import com.stockm8.service.OrderService; +import com.stockm8.service.UserService; + +@Controller +@RequestMapping(value = "/admin/*") +public class AdminController { + + // 현재 로그인한 사용자 정보 가져오기(인터셉터에서 정의됨) + private UserVO getCurrentUser(HttpServletRequest request) { + return (UserVO) request.getAttribute("currentUser"); + } + + private static final Logger logger = LoggerFactory.getLogger(AdminController.class); + + @Inject + private OrderService orderService; + @Inject + private UserService userService; + + /** + * 어드민 메인 페이지 표시(GET) + * http://localhost:8088/admin/adminMain + * + */ + @RequestMapping(value = "/adminMain", method = RequestMethod.GET) + public String adminMainGET(Model model, HttpServletRequest request, HttpServletResponse response) throws Exception { + logger.info("adminMainGET() 호출"); + + UserVO currentUser = getCurrentUser(request); + int businessId = currentUser.getBusinessId(); + + return "admin/adminMain"; + } + /** + * 어드민 회원목록표시(GET) + * http://localhost:8088/admin/adminList + * + */ + @RequestMapping(value = "/adminList", method = RequestMethod.GET) + public String adminListGET(Model model, HttpServletRequest request, HttpServletResponse response) throws Exception { + logger.info("adminListGET() 호출"); + + UserVO currentUser = getCurrentUser(request); + int businessId = currentUser.getBusinessId(); + + return "admin/adminList"; + } + + + +} //AdminController \ No newline at end of file diff --git a/stockMate/src/main/java/com/stockm8/controller/OrderController.java b/stockMate/src/main/java/com/stockm8/controller/OrderController.java index 4ebd212..479ecae 100644 --- a/stockMate/src/main/java/com/stockm8/controller/OrderController.java +++ b/stockMate/src/main/java/com/stockm8/controller/OrderController.java @@ -17,10 +17,13 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import com.stockm8.domain.vo.Criteria; import com.stockm8.domain.vo.OrderItemVO; import com.stockm8.domain.vo.OrderVO; +import com.stockm8.domain.vo.PageVO; import com.stockm8.domain.vo.OrderVO.OrderType; import com.stockm8.domain.vo.StockVO; import com.stockm8.domain.vo.UserVO; @@ -30,6 +33,11 @@ @Controller @RequestMapping(value = "/order/*") public class OrderController { + + // 현재 로그인한 사용자 정보 가져오기(인터셉터에서 정의됨) + private UserVO getCurrentUser(HttpServletRequest request) { + return (UserVO) request.getAttribute("currentUser"); + } private static final Logger logger = LoggerFactory.getLogger(OrderController.class); @@ -49,29 +57,8 @@ public class OrderController { public String orderRegisterGET(Model model, HttpServletRequest request, HttpServletResponse response) throws Exception { logger.info("orderRegisterGET() 호출"); - - // 세션에서 userId 가져오기 - HttpSession session = request.getSession(false); - Long userId = (session != null) ? (Long)session.getAttribute("userId") : null; - - // userId로 사용자 정보 조회 - UserVO user = userService.getUserById(userId); - int businessId = user.getBusinessId(); - -// HttpSession session = request.getSession(false); -// if (session != null) { -// Long userId = (Long) session.getAttribute("userId"); -// if (userId != null) { -// UserVO user = userService.getUserById(userId); -// if (user != null) { -// model.addAttribute("businessId", user.getBusinessId()); -// // 추가적인 권한 체크나 비즈니스 로직 -// return "order/register"; -// } -// } -// } -// // 인증 실패 처리 => 음 메세지 ??? 어떻게 ?? -// return "user/main"; + UserVO currentUser = getCurrentUser(request); + int businessId = currentUser.getBusinessId(); return "order/register"; } @@ -81,14 +68,13 @@ public String orderRegisterGET(Model model, HttpServletRequest request, HttpServ * http://localhost:8088/order/register * @param order 클라이언트에서 전송된 주문 정보 * @return 처리 결과를 담은 Map 객체 - * @throws Exception 주문 처리 중 발생하는 예외 * */ @RequestMapping(value = "/register", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @ResponseBody - public Map orderRegisterPOST(@RequestBody OrderVO order) throws Exception { + public Map orderRegisterPOST(@RequestBody OrderVO order, HttpServletRequest request) throws Exception { logger.info("orderRegisterPOST() 호출"); logger.info("주문 정보: " + order); @@ -97,7 +83,6 @@ public Map orderRegisterPOST(@RequestBody OrderVO order) throws throw new IllegalArgumentException("주문 유형이 누락되었습니다."); } - // 주문에 orderItems가 있는지 확인(유효성 검사) if (order.getOrderItems() == null || order.getOrderItems().isEmpty()) { throw new IllegalArgumentException("주문 항목이 누락되었습니다."); @@ -146,13 +131,8 @@ public Map orderRegisterPOST(@RequestBody OrderVO order) throws public List findAvailableStocks(HttpServletRequest request) throws Exception { logger.info("findAvailableStocks() 호출"); - // 세션에서 userId 가져오기 - HttpSession session = request.getSession(false); - Long userId = (session != null) ? (Long)session.getAttribute("userId") : null; - - // userId로 사용자 정보 조회 - UserVO user = userService.getUserById(userId); - int businessId = user.getBusinessId(); + UserVO currentUser = getCurrentUser(request); + int businessId = currentUser.getBusinessId(); return orderService.findAvailableStocks(businessId); } @@ -175,19 +155,55 @@ public String generateOrderNumber() throws Exception { * http://localhost:8088/order/orderList */ @RequestMapping(value = "/orderList" , method = RequestMethod.GET) - public String orderListGET(Model model) { + public String orderListGET(Model model, Criteria cri, HttpServletRequest request) throws Exception { logger.info("orderListGET() 호출"); - // main에서 넘어올떄 정달정보 ?? 로그인???세션 ?? + // Criteria가 null인 경우 새로 생성 + if (cri == null) { + cri = new Criteria(); + } + UserVO currentUser = getCurrentUser(request); + int businessId = currentUser.getBusinessId(); + //서비스 -> DAO(주문 목록) - List orderList = orderService.getOrderList(); + List orderList = orderService.getOrderList(cri, businessId); - //뷰 페이지 정보 전달(model) + // 전체 데이터 개수 조회 + int totalCount = orderService.getTotalOrderCount(businessId); + // 페이징 정보 계산 + PageVO pageVO = new PageVO(); + pageVO.setCri(cri); + pageVO.setTotalCount(totalCount); + + //뷰 페이지 정보 전달(model) model.addAttribute("orderList",orderList); + model.addAttribute("pageVO", pageVO); return "/order/orderList"; } + /** + * 주문 상세 정보 조회 + * http://localhost:8088/order/detail?orderId=1 + */ + @RequestMapping(value = "/detail", method = RequestMethod.GET) + public String orderDetailGET(@RequestParam("orderId") int orderId, Model model, HttpServletRequest request) throws Exception { + logger.info("orderDetailGET() 호출 - orderId: " + orderId); + + UserVO currentUser = getCurrentUser(request); + + // 주문 기본 정보 조회 + OrderVO order = orderService.getOrderById(orderId); + // 주문 상세 항목 목록 조회 + List orderItems = orderService.getOrderItemsByOrderId(orderId); + + // 모델에 데이터 추가 + model.addAttribute("order", order); + model.addAttribute("orderItems", orderItems); + + return "order/orderDetail"; + } + } //OrderController \ No newline at end of file diff --git a/stockMate/src/main/java/com/stockm8/domain/vo/OrderItemVO.java b/stockMate/src/main/java/com/stockm8/domain/vo/OrderItemVO.java index 39ea44b..4f790f0 100644 --- a/stockMate/src/main/java/com/stockm8/domain/vo/OrderItemVO.java +++ b/stockMate/src/main/java/com/stockm8/domain/vo/OrderItemVO.java @@ -17,8 +17,14 @@ public class OrderItemVO { private Timestamp createdAt; // 생성 시간 private Timestamp updatedAt; // 수정 시간 - + //JOIN을 통해 가져올 연관 정보 private int stockId; // 가용 재고 구분위해 필요 + private ProductVO product; // 상품 정보 + private String productName; // 상품명 + private String productBarcode; // 상품 바코드 + private String warehouseName; // 창고명 + private String baseUnit; // 기본 단위 + } //OrderItemVO diff --git a/stockMate/src/main/java/com/stockm8/domain/vo/PageVO.java b/stockMate/src/main/java/com/stockm8/domain/vo/PageVO.java index 1bd7c67..bf55371 100644 --- a/stockMate/src/main/java/com/stockm8/domain/vo/PageVO.java +++ b/stockMate/src/main/java/com/stockm8/domain/vo/PageVO.java @@ -109,4 +109,4 @@ public String toString() { -} \ No newline at end of file +} // PageVO \ No newline at end of file diff --git a/stockMate/src/main/java/com/stockm8/domain/vo/StockVO.java b/stockMate/src/main/java/com/stockm8/domain/vo/StockVO.java index 9b9e531..e4518ec 100644 --- a/stockMate/src/main/java/com/stockm8/domain/vo/StockVO.java +++ b/stockMate/src/main/java/com/stockm8/domain/vo/StockVO.java @@ -19,9 +19,9 @@ public class StockVO { private Boolean isDeleted; // 논리 삭제 여부 (true: 삭제됨, false: 활성) // 연관 VO 필드 - private ProductVO product; // 상품 정보 + private ProductVO product; // 상품 정보(JOIN) private CategoryVO category; // 카테고리 정보 private WarehouseVO warehouse; // 창고 정보 - private String warehouseName; + private String warehouseName; // (JOIN) } diff --git a/stockMate/src/main/java/com/stockm8/interceptor/AuthorizationInterceptor.java b/stockMate/src/main/java/com/stockm8/interceptor/AuthorizationInterceptor.java index 22b82a7..28a2a5f 100644 --- a/stockMate/src/main/java/com/stockm8/interceptor/AuthorizationInterceptor.java +++ b/stockMate/src/main/java/com/stockm8/interceptor/AuthorizationInterceptor.java @@ -63,6 +63,7 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons // 2. DB에서 사용자 정보 조회 UserVO user = userService.getUserById(userId); + request.setAttribute("currentUser", user); //검증 된 사용자 정보를 저장 if (user == null) { logger.warn("해당 유저({}) 정보를 찾을 수 없습니다. 회원가입 페이지로 이동합니다.", userId); diff --git a/stockMate/src/main/java/com/stockm8/persistence/OrderDAO.java b/stockMate/src/main/java/com/stockm8/persistence/OrderDAO.java index 6643ed0..4354601 100644 --- a/stockMate/src/main/java/com/stockm8/persistence/OrderDAO.java +++ b/stockMate/src/main/java/com/stockm8/persistence/OrderDAO.java @@ -3,6 +3,7 @@ import java.util.List; import java.util.Map; +import com.stockm8.domain.vo.Criteria; import com.stockm8.domain.vo.OrderItemVO; import com.stockm8.domain.vo.OrderVO; import com.stockm8.domain.vo.ProductVO; @@ -25,16 +26,20 @@ public interface OrderDAO { // 재고 수량 업데이트 public int updateStockQuantity(Map params) throws Exception; - // 주문 목록 - public List getOrderList(); + // 주문 목록( 페이징 추가로 수정) + public List getOrderList(Criteria cri, int businessId); - // 재고 정보 조회 @@@@@@@@@@@@@@@@@@@@@@@@@@@@ 미사용 - public StockVO getStockById(int stockId) throws Exception; - - // 재고 이력 등록 @@@@@@@@@@@@@@@@@@@@@@@@@@@@ 미사용 - public void insertStockHistory(Map params) throws Exception; + // 주문 단건 조회 + public OrderVO getOrderById(int orderId) throws Exception; + // 주문 상세 항목 목록 조회 + public List getOrderItemsByOrderId(int orderId) throws Exception; + + // 가용재고 정보 조회 + public StockVO getStockById(int stockId) throws Exception; + // 전체 주문 개수 조회 (페이징 계산) + public int getTotalOrderCount(int businessId); diff --git a/stockMate/src/main/java/com/stockm8/persistence/OrderDAOImpl.java b/stockMate/src/main/java/com/stockm8/persistence/OrderDAOImpl.java index 19d6a5f..d2d1270 100644 --- a/stockMate/src/main/java/com/stockm8/persistence/OrderDAOImpl.java +++ b/stockMate/src/main/java/com/stockm8/persistence/OrderDAOImpl.java @@ -13,6 +13,7 @@ import org.slf4j.LoggerFactory; import org.springframework.stereotype.Repository; +import com.stockm8.domain.vo.Criteria; import com.stockm8.domain.vo.OrderItemVO; import com.stockm8.domain.vo.OrderVO; import com.stockm8.domain.vo.ProductVO; @@ -109,27 +110,36 @@ public int updateStockQuantity(Map params) throws Exception { } - // 재고 정보 조회 ==== > 미사용 + // 가용재고 정보 조회 @Override public StockVO getStockById(int stockId) throws Exception { return sqlSession.selectOne(NAMESPACE + "getStockById", stockId); } - - // 재고 이력 등록 =====> 미사용 + //오더 목록 @Override - public void insertStockHistory(Map params) throws Exception { - sqlSession.insert(NAMESPACE + "insertStockHistory", params); - + public List getOrderList(Criteria cri, int businessId) { + Map paramMap = new HashMap<>(); + paramMap.put("cri", cri); + paramMap.put("businessId", businessId); + return sqlSession.selectList(NAMESPACE+ "orderList", paramMap); } - - //오더 목록 + // 주문 단건 조회 @Override - public List getOrderList() { - return sqlSession.selectList(NAMESPACE+ "orderList"); + public OrderVO getOrderById(int orderId) throws Exception { + return sqlSession.selectOne(NAMESPACE + "getOrderById", orderId); } - - + // 주문 상세항목 조회 + @Override + public List getOrderItemsByOrderId(int orderId) throws Exception { + return sqlSession.selectList(NAMESPACE + "getOrderItemsByOrderId", orderId); + } + // 전체 주문 개수 조회 (페이징 계산) + @Override + public int getTotalOrderCount(int businessId) { + return sqlSession.selectOne(NAMESPACE + "getTotalOrderCount", businessId); } + + } // OrderImpl \ No newline at end of file diff --git a/stockMate/src/main/java/com/stockm8/service/OrderService.java b/stockMate/src/main/java/com/stockm8/service/OrderService.java index 37ac9d2..882d0d9 100644 --- a/stockMate/src/main/java/com/stockm8/service/OrderService.java +++ b/stockMate/src/main/java/com/stockm8/service/OrderService.java @@ -2,6 +2,7 @@ import java.util.List; +import com.stockm8.domain.vo.Criteria; import com.stockm8.domain.vo.OrderItemVO; import com.stockm8.domain.vo.OrderVO; import com.stockm8.domain.vo.ProductVO; @@ -21,15 +22,20 @@ public interface OrderService { // 재고 수량 업데이트 public void updateStockQuantity(int stockId, int quantity) throws Exception; - // 주문목록 - public List getOrderList(); - + // 주문목록(페이징 추가) + public List getOrderList(Criteria cri, int businessId); + + // 주문 단건 조회 + public OrderVO getOrderById(int orderId) throws Exception; + + // 주문 상세 항목 목록 조회 + public List getOrderItemsByOrderId(int orderId) throws Exception; + // 가용 재고 체크 미사용 public boolean checkAvailableStock(OrderItemVO item) throws Exception; - // 재고 이력 등록 미사용 - public void insertStockHistory(StockVO stock, OrderVO order, int quantityChanged) throws Exception; + // 전체 주문 개수 조회 (페이징 계산) + public int getTotalOrderCount(int businessId); - } //OrderService diff --git a/stockMate/src/main/java/com/stockm8/service/OrderServiceImpl.java b/stockMate/src/main/java/com/stockm8/service/OrderServiceImpl.java index 428d95d..dc14ea5 100644 --- a/stockMate/src/main/java/com/stockm8/service/OrderServiceImpl.java +++ b/stockMate/src/main/java/com/stockm8/service/OrderServiceImpl.java @@ -16,6 +16,7 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport; import org.springframework.transaction.support.DefaultTransactionDefinition; +import com.stockm8.domain.vo.Criteria; import com.stockm8.domain.vo.OrderItemVO; import com.stockm8.domain.vo.OrderVO; // OrderItemVO import 제거 import com.stockm8.domain.vo.OrderVO.OrderType; @@ -57,17 +58,6 @@ private void processOrderByType(OrderVO order) throws Exception { // 재고 감소 updateStockQuantity(item.getStockId(), item.getQuantity()); // 수주(출고)일 때는 예약수량을 양수로 처리해야 함 (+) - // 재고 이력 기록 -// StockVO stock = odao.getStockById(item.getStockId()); -// insertStockHistory(stock, order, -item.getQuantity()); - - // TODO: 기존 TODO 항목들 유지 - // - 출고 지시서 생성 - // - 거래명세서 생성 - // - 출고 작업 지시서 생성 - // - 픽킹 리스트 생성 - // - 고객사 알림 발송 - // - 매출 전표 생성 } } else if (order.getOrderType() == OrderType.OUTBOUND) { // 발주(입고) 처리 @@ -75,17 +65,6 @@ private void processOrderByType(OrderVO order) throws Exception { // 재고 증가 updateStockQuantity(item.getStockId(), -item.getQuantity()); // 발주(입)일 때는 예약수량을 음수로 처리해야 함 (-) - // 재고 이력 기록 -// StockVO stock = odao.getStockById(item.getStockId()); -// insertStockHistory(stock, order, item.getQuantity()); - - // TODO: 기존 TODO 항목들 유지 - // - 발주서 생성 - // - 입고 예정 등록 - // - 구매 오더 생성 - // - 구매처 발주 확인 - // - 지출 전표 생성 - // - 입고 검수 체크리스트 생성 } } } @@ -119,30 +98,40 @@ public String generateOrderNumber() throws Exception { // 주문목록 @Override - public List getOrderList() { - return odao.getOrderList(); + public List getOrderList(Criteria cri, int businessId) { + // cri가 null인 경우 새로 생성 + if (cri == null) { + cri = new Criteria(); + } + + return odao.getOrderList(cri, businessId); } - // 가용 재고 체크 ================> 미사용 + + // 주문 단건 조회 + @Override + public OrderVO getOrderById(int orderId) throws Exception { + return odao.getOrderById(orderId); + } + + + // 주문상세항목 조회 + @Override + public List getOrderItemsByOrderId(int orderId) throws Exception { + return odao.getOrderItemsByOrderId(orderId); + } + + // 가용재고 체크 @Override public boolean checkAvailableStock(OrderItemVO item) throws Exception { StockVO stock = odao.getStockById(item.getStockId()); return stock != null && stock.getAvailableStock() >= item.getQuantity(); } - - // 재고 이력 등록 =================> 미사용 + + // 전체 주문 개수 조회 (페이징 계산) @Override - public void insertStockHistory(StockVO stock, OrderVO order, int quantityChanged) throws Exception { - Map params = new HashMap<>(); - params.put("stockId", stock.getStockId()); - params.put("orderId", order.getOrderId()); - params.put("quantityChanged", quantityChanged); - params.put("actionType", order.getOrderType().toString()); - params.put("createdBy", order.getCreatedBy()); - params.put("remarks", "주문에 의한 재고 변동"); - - odao.insertStockHistory(params); - + public int getTotalOrderCount(int businessId) { + return odao.getTotalOrderCount(businessId); } diff --git a/stockMate/src/main/resources/mappers/OrderMapper.xml b/stockMate/src/main/resources/mappers/OrderMapper.xml index 4f713a7..ea9ece5 100644 --- a/stockMate/src/main/resources/mappers/OrderMapper.xml +++ b/stockMate/src/main/resources/mappers/OrderMapper.xml @@ -4,6 +4,51 @@ "https://mybatis.org/dtd/mybatis-3-mapper.dtd"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - @@ -88,8 +112,6 @@ unit_price, remarks, created_at - - ) VALUES ( #{orderId}, #{productId}, @@ -98,8 +120,6 @@ #{unitPrice}, #{remarks}, NOW() - - ) @@ -120,15 +140,51 @@ LIMIT 1 - - - + + - - + + + + + + - - - - INSERT INTO test_stock_history ( - stock_id, - order_id, - quantity_changed, - action_type, - created_by, - created_at, - remarks - ) VALUES ( - #{stockId}, - #{orderId}, - #{quantityChanged}, - #{actionType}, - #{createdBy}, - NOW(), - #{remarks} - ) - - - - - - + + \ No newline at end of file diff --git a/stockMate/src/main/webapp/WEB-INF/views/admin/adminList.jsp b/stockMate/src/main/webapp/WEB-INF/views/admin/adminList.jsp new file mode 100644 index 0000000..427e655 --- /dev/null +++ b/stockMate/src/main/webapp/WEB-INF/views/admin/adminList.jsp @@ -0,0 +1,16 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> + + + + +Insert title here + + +

/views/AdminPage/AdminList.jsp

+ + + + + \ No newline at end of file diff --git a/stockMate/src/main/webapp/WEB-INF/views/admin/adminMain.jsp b/stockMate/src/main/webapp/WEB-INF/views/admin/adminMain.jsp new file mode 100644 index 0000000..02b9da8 --- /dev/null +++ b/stockMate/src/main/webapp/WEB-INF/views/admin/adminMain.jsp @@ -0,0 +1,15 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +관리자 메인 + + + + +

관리자 메인

+ + + diff --git a/stockMate/src/main/webapp/WEB-INF/views/dashboard.jsp b/stockMate/src/main/webapp/WEB-INF/views/dashboard.jsp index b7c59d7..b16fdef 100644 --- a/stockMate/src/main/webapp/WEB-INF/views/dashboard.jsp +++ b/stockMate/src/main/webapp/WEB-INF/views/dashboard.jsp @@ -181,7 +181,7 @@ 입고 출고 재고 - 관리자 페이지 + 관리자 페이지 diff --git a/stockMate/src/main/webapp/WEB-INF/views/order/orderDetail.jsp b/stockMate/src/main/webapp/WEB-INF/views/order/orderDetail.jsp new file mode 100644 index 0000000..d199966 --- /dev/null +++ b/stockMate/src/main/webapp/WEB-INF/views/order/orderDetail.jsp @@ -0,0 +1,79 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> + + + + +주문 상세 정보 + + + +
+
+

주문 상세 정보

+ 목록으로 +
+ +
+

디버깅 정보:

+

주문 정보 존재 여부: ${not empty order}

+

주문 번호: ${order.orderNumber}

+

주문 항목 수: ${not empty orderItems ? orderItems.size() : 0}

+
+ + +
+

주문 기본 정보

+ + + + + + + + + + + + + +
주문번호주문일자주문유형총 주문금액
${order.orderNumber}${order.orderType}
+
+ +
+
주문 상세 항목
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
No.제품명제품바코드창고수량단위단가(원)소계(원)비고
${status.count}${item.productName}${item.productBarcode}${item.warehouseName}${item.baseUnit}${item.remarks}
주문 상세 내역이 없습니다.
+
+ + \ No newline at end of file diff --git a/stockMate/src/main/webapp/WEB-INF/views/order/orderList.jsp b/stockMate/src/main/webapp/WEB-INF/views/order/orderList.jsp index 1e42a03..218d5fb 100644 --- a/stockMate/src/main/webapp/WEB-INF/views/order/orderList.jsp +++ b/stockMate/src/main/webapp/WEB-INF/views/order/orderList.jsp @@ -1,26 +1,23 @@ <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> + +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> - -주문 목록 - + + 주문 목록 +

주문 목록

- + 주문 - - + + - @@ -33,13 +30,19 @@ @@ -49,17 +52,47 @@ 값이 없습니다 -<%-- --%>
주문번호발주일자주문번호오더생성 일자 총액 주문유형 상세보기
- ${order.createdAt} + + + + 값이 없습니다 - ${order.totalPrice} + + + 원 + 값이 없습니다 - - ${order.status} - 값이 없습니다 - - 상세
+ + + + +
+ +
+ + + - + \ No newline at end of file diff --git a/stockMate/src/main/webapp/WEB-INF/views/order/register.jsp b/stockMate/src/main/webapp/WEB-INF/views/order/register.jsp index 44723ac..dd54c4a 100644 --- a/stockMate/src/main/webapp/WEB-INF/views/order/register.jsp +++ b/stockMate/src/main/webapp/WEB-INF/views/order/register.jsp @@ -14,6 +14,7 @@
@@ -512,7 +513,8 @@ const subtotal = quantity * unitPrice; // 소계 계산 (수량 * 단가) // 계산된 소계를 소수점 둘째 자리까지 표시하여 필드에 설정 - card.find('.subtotal-price').val(subtotal.toFixed(2)); + card.find('.subtotal-price').val(new Intl.NumberFormat('ko-KR').format(subtotal) + '원'); + updateGrandTotal(); // 전체 주문 금액 업데이트 (다른 함수에서 구현) updateGrandTotal(); @@ -522,9 +524,10 @@ function updateGrandTotal() { let total = 0; $('.subtotal-price:visible').each(function() { - total += parseFloat($(this).val()) || 0; + const value = $(this).val().replace(/[₩,원]/g, ''); + total += parseFloat(value) || 0; }); - $('#grandTotal').val(total.toFixed(2)); + $('#grandTotal').val(new Intl.NumberFormat('ko-KR').format(total) + '원'); } // 삭제 버튼 상태 업데이트 @@ -544,7 +547,6 @@ return false; } - $('.stock-info-card:visible').each(function() { const card = $(this); if (!card.find('.stock-id').val()) { diff --git a/stockMate/src/main/webapp/WEB-INF/views/user/dashboard.jsp b/stockMate/src/main/webapp/WEB-INF/views/user/dashboard.jsp index 77395ca..fa48231 100644 --- a/stockMate/src/main/webapp/WEB-INF/views/user/dashboard.jsp +++ b/stockMate/src/main/webapp/WEB-INF/views/user/dashboard.jsp @@ -159,7 +159,7 @@ 입고 출고 재고 - 관리자 페이지 + 관리자 페이지
diff --git a/stockMate/src/main/webapp/resources/css/OrderStyle.css b/stockMate/src/main/webapp/resources/css/OrderStyle.css index 969278b..6765a3d 100644 --- a/stockMate/src/main/webapp/resources/css/OrderStyle.css +++ b/stockMate/src/main/webapp/resources/css/OrderStyle.css @@ -7,134 +7,134 @@ } body { - font-family: Arial, sans-serif; + font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif; line-height: 1.6; - padding: 20px; + color: #1A202C; + background-color: #ffffff; + height: 100vh; } /* Layout */ .container { - max-width: 1200px; + max-width: 1000px; margin: 0 auto; - padding: 20px; + padding: 1.5rem; + height: 100%; + display: flex; + flex-direction: column; } -/* Card Styles */ -.card { - border: 1px solid #ddd; - border-radius: 4px; - margin-bottom: 20px; - background: white; /* 추가: 배경색 명시 */ - box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* 추가: 그림자 효과 */ +/* Typography */ +h1, h2, h3, h4 { + margin-bottom: 1.25rem; + font-weight: 600; + line-height: 1.2; + color: #1A202C; } -.card-header { - background: #f8f9fa; - padding: 10px 15px; - border-bottom: 1px solid #ddd; - font-weight: bold; /* 추가: 헤더 텍스트 강조 */ +h1 { font-size: 1.875rem; } +h2 { font-size: 1.5rem; } +h3 { font-size: 1.25rem; } +h4 { font-size: 1.125rem; } + +/* Card Styles */ +.card { + border: none; + border-radius: 8px; + margin-bottom: 1rem; + background: white; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); } -.card-body { - padding: 15px; +.card:hover { + box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); } -/* Grid System */ -.row { +.card-header { + background: #F8FAFC; + padding: 1rem 1.25rem; + border-bottom: 2px solid #E2E8F0; + font-weight: 600; display: flex; - flex-wrap: wrap; - margin: -10px; + justify-content: space-between; + align-items: center; + border-radius: 8px 8px 0 0; } -.col-md-3, .col-md-4, .col-md-6, .col-12 { - padding: 10px; +.card-body { + padding: 1.25rem; } -.col-md-3 { width: 25%; } -.col-md-4 { width: 33.333%; } -.col-md-6 { width: 50%; } -.col-12 { width: 100%; } - /* Form Elements */ .form-group { - margin-bottom: 15px; + margin-bottom: 1rem; } .form-label { display: block; - margin-bottom: 5px; - font-weight: bold; - color: #333; /* 추가: 라벨 색상 */ + margin-bottom: 0.5rem; + font-weight: 600; + color: #2D3748; } .required-label::after { content: " *"; - color: red; + color: #E53E3E; } .form-control { width: 100%; - padding: 8px; - border: 1px solid #ddd; - border-radius: 4px; - font-size: 14px; - transition: border-color 0.3s; /* 추가: 부드러운 전환 효과 */ + padding: 0.625rem 1rem; + border: 2px solid #CBD5E0; + border-radius: 6px; + font-size: 0.9375rem; + transition: all 0.2s ease; } .form-control:focus { - border-color: #0d6efd; - outline: none; - box-shadow: 0 0 0 2px rgba(13,110,253,0.25); + border-color: #3182CE; + box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2); } -/* Buttons */ +/* Button Styles */ .btn { - display: inline-block; - padding: 8px 16px; + display: inline-flex; + align-items: center; + justify-content: center; + padding: 0.625rem 1.25rem; border: none; - border-radius: 4px; + border-radius: 6px; cursor: pointer; - font-size: 14px; - transition: all 0.3s; /* 추가: 버튼 호버 효과 */ -} - -.btn:hover { - opacity: 0.9; - transform: translateY(-1px); + font-size: 0.9375rem; + font-weight: 500; + text-decoration: none; + transition: all 0.2s ease; + margin-right: 0.75rem; + min-width: 80px; + height: 36px; } .btn-primary { - background: #0d6efd; + background: #3182CE; color: white; } .btn-success { - background: #198754; + background: #38A169; color: white; } .btn-secondary { - background: #6c757d; + background: #4A5568; color: white; } -.btn-danger { - background: #dc3545; - color: white; -} - -.btn-danger:disabled { - background: #e9acb3; - cursor: not-allowed; - opacity: 0.7; -} - -/* Utility Classes */ -.text-center { - text-align: center; +.btn-danger { + background: #E53E3E; + color: white; } -/* Modal Styles */ +/* Enhanced Modal Styles */ .modal { display: none; position: fixed; @@ -144,125 +144,266 @@ body { height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 1050; - opacity: 0; - transition: opacity 0.3s; /* 추가: 모달 페이드 효과 */ + backdrop-filter: blur(4px); } .modal.show { - display: block !important; - opacity: 1; + display: flex; + align-items: center; + justify-content: center; } .modal-dialog { position: relative; - width: 100%; - max-width: 2000px; - margin: 50px auto; - top: 50%; - transform: translateY(-50%); - display: block; -} - -.modal-content { + width: 95%; + max-width: 1400px; + min-width: 1000px; + min-height: 600px; background: white; - border-radius: 4px; - box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* 추가: 모달 그림자 */ + border-radius: 8px; + box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), + 0 10px 10px -5px rgba(0, 0, 0, 0.1); } .modal-header { - padding: 15px; - border-bottom: 1px solid #ddd; + padding: 1.25rem 1.75rem; + border-bottom: 2px solid #E2E8F0; display: flex; justify-content: space-between; align-items: center; - background: #f8f9fa; /* 추가: 헤더 배경색 */ + background: #F8FAFC; + border-radius: 8px 8px 0 0; +} + +.modal-close { + width: 32px; + height: 32px; + border-radius: 50%; + border: none; + background: #EDF2F7; + color: #4A5568; + font-size: 20px; + display: flex; + align-items: center; + justify-content: center; + cursor: pointer; + transition: all 0.2s ease; + position: relative; +} + +.modal-close:hover { + background: #E2E8F0; + color: #2D3748; +} + +.modal-close::before { + content: "×"; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + font-weight: bold; } .modal-body { - padding: 15px; - max-height: 70vh; + padding: 2rem; + max-height: 80vh; overflow-y: auto; } -.btn-close { - background: none; - border: none; - font-size: 20px; - cursor: pointer; - padding: 5px; - transition: transform 0.2s; /* 추가: 닫기 버튼 호버 효과 */ +/* 모달 내부 테이블 스타일 */ +.modal .table-container { + margin: 1.5rem 0; } -.btn-close:hover { - transform: scale(1.1); +.modal table { + width: 100%; + border-collapse: collapse; /* separate에서 collapse로 변경 */ +} + +.modal th { + padding: 1rem 1.5rem; + font-size: 1rem; + background: #F8FAFC; + font-weight: 600; + color: #2D3748; + border: 1px solid #E2E8F0; + text-align: left; +} + +.modal td { + padding: 1rem 1.5rem; + font-size: 1rem; + border: 1px solid #E2E8F0; + line-height: 1.6; /* 줄간격 추가 */ + word-break: break-word; /* 긴 텍스트 줄바꿈 */ + white-space: pre-wrap; /* 공백과 줄바꿈 유지 */ + vertical-align: top; /* 셀 내용 상단 정렬 */ +} + +/* 모달 내부 버튼 그룹 스타일 */ +.modal-footer { + padding: 1.5rem 2rem; + border-top: 1px solid #E2E8F0; + display: flex; + justify-content: flex-end; + gap: 1rem; +} + +/* 모달 내부 버튼 스타일 */ +.modal .btn { + min-width: 100px; + height: 40px; + font-size: 1rem; +} + +/* 스크롤바 스타일 */ +.modal-body::-webkit-scrollbar { + width: 8px; +} + +.modal-body::-webkit-scrollbar-track { + background: #F7FAFC; + border-radius: 4px; +} + +.modal-body::-webkit-scrollbar-thumb { + background: #CBD5E0; + border-radius: 4px; +} + +.modal-body::-webkit-scrollbar-thumb:hover { + background: #A0AEC0; +} + +/* 기본 테이블 스타일 */ +.table-container { + overflow-x: auto; + margin: 1rem 0; + border-radius: 6px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); } -/* Table Styles */ table { width: 100%; border-collapse: collapse; } th, td { - padding: 8px; - border: 1px solid #ddd; - text-align: left; + padding: 0.75rem 1rem; + border: 1px solid #E2E8F0; + font-size: 0.9375rem; } th { - background: #f8f9fa; /* 추가: 테이블 헤더 배경색 */ - font-weight: bold; + background: #F8FAFC; + font-weight: 600; + color: #2D3748; } -.stock-table { - margin-top: 10px; - width: 100%; - overflow-x: auto; - white-space: nowrap; +tr:hover { + background-color: #F7FAFC; } -.stock-table tr:hover { - background-color: #f5f5f5; /* 추가: 행 호버 효과 */ +/* Grid System */ +.row { + display: flex; + flex-wrap: wrap; + margin: -0.5rem; } -.product-table { - font-size: 0.9rem; +.col-md-3, .col-md-4, .col-md-6, .col-12 { + padding: 0.5rem; } -/* Custom Components */ -.stock-info-card { - margin-bottom: 20px; - position: relative; /* 추가: 상대 위치 지정 */ +.col-md-3 { width: 25%; } +.col-md-4 { width: 33.333%; } +.col-md-6 { width: 50%; } +.col-12 { width: 100%; } + +/* 페이징 관련 스타일 */ + + +/* Pagination Styles */ +.pagination { + display: flex; + align-items: center; + justify-content: center; + margin: 1.5rem 0; + gap: 0.5rem; } - (max-width: 768px) { - .col-md-3, .col-md-4, .col-md-6 { - width: 100%; - } - - - .btn { - width: 100%; - margin-bottom: 10px; - } +.pagination a { + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 36px; + height: 36px; + padding: 0.5rem; + border: 2px solid #E2E8F0; + border-radius: 6px; + font-size: 0.9375rem; + font-weight: 500; + color: #4A5568; + text-decoration: none; + transition: all 0.2s ease; +} + +.pagination a:hover:not(.active) { + background-color: #F7FAFC; + border-color: #CBD5E0; + color: #2D3748; +} + +.pagination a.active { + background-color: #3182CE; + border-color: #3182CE; + color: white; } -/* 추가: 로딩 인디케이터 스타일 */ -.loading { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: rgba(255, 255, 255, 0.8); +.pagination a:disabled, +.pagination a.disabled { + opacity: 0.5; + cursor: not-allowed; + pointer-events: none; +} + +/* Page Size Selector Styles */ +.page-size-selector { display: flex; - justify-content: center; align-items: center; - z-index: 2000; + justify-content: flex-end; + margin: 1rem 0; + gap: 0.5rem; +} + +.page-size-selector label { + font-size: 0.9375rem; + font-weight: 500; + color: #4A5568; +} + +.page-size-selector select { + padding: 0.5rem 2rem 0.5rem 1rem; + border: 2px solid #CBD5E0; + border-radius: 6px; + font-size: 0.9375rem; + color: #2D3748; + background-color: white; + cursor: pointer; + appearance: none; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 4.5L6 8L9.5 4.5' stroke='%234A5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); + background-repeat: no-repeat; + background-position: right 0.75rem center; + transition: all 0.2s ease; +} + +.page-size-selector select:focus { + border-color: #3182CE; + box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.2); + outline: none; } -.loading::after { - content: "로딩중..."; - font-size: 1.2rem; - color: #0d6efd; +.page-size-selector select:hover { + border-color: #A0AEC0; } \ No newline at end of file From 8ccfb8891d3af9c83ac7ce92570abc30a99dfe2f Mon Sep 17 00:00:00 2001 From: freehyeon Date: Tue, 17 Dec 2024 12:37:14 +0900 Subject: [PATCH 2/5] =?UTF-8?q?productVo=20=EB=B3=80=EA=B2=BD=EC=97=90=20?= =?UTF-8?q?=EB=94=B0=EB=A5=B8=20order=20mapper=20=EB=B0=8F=20jsp=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mappers/OrderMapper.xml | 8 +- .../webapp/WEB-INF/views/order/register.jsp | 215 +++++++++--------- 2 files changed, 116 insertions(+), 107 deletions(-) diff --git a/stockMate/src/main/resources/mappers/OrderMapper.xml b/stockMate/src/main/resources/mappers/OrderMapper.xml index ea9ece5..53ca3cc 100644 --- a/stockMate/src/main/resources/mappers/OrderMapper.xml +++ b/stockMate/src/main/resources/mappers/OrderMapper.xml @@ -195,12 +195,12 @@ s.reserved_quantity, s.available_stock, s.description as stock_description, - p.name, - p.barcode, + p.product_name, + p.product_barcode, p.base_unit, p.set_size, - p.price, - p.description as product_description, + p.product_price, + p.product_description, w.warehouse_name FROM stocks s diff --git a/stockMate/src/main/webapp/WEB-INF/views/order/register.jsp b/stockMate/src/main/webapp/WEB-INF/views/order/register.jsp index dd54c4a..fb86f42 100644 --- a/stockMate/src/main/webapp/WEB-INF/views/order/register.jsp +++ b/stockMate/src/main/webapp/WEB-INF/views/order/register.jsp @@ -67,104 +67,103 @@
-
-
- 재고 정보 - -
-
-
-
-
- -
-
- - - -
-
-
- - -
-
-
-
- - -
-
-
- -
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
- -
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
- -
-
-
- - -
-
-
-
-
+
+
+ 재고 정보 + +
+
+
+
+
+ +
+
+ + + + + + + + +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+
+
@@ -513,7 +512,12 @@ const subtotal = quantity * unitPrice; // 소계 계산 (수량 * 단가) // 계산된 소계를 소수점 둘째 자리까지 표시하여 필드에 설정 - card.find('.subtotal-price').val(new Intl.NumberFormat('ko-KR').format(subtotal) + '원'); + card.find('.subtotal-price') + .val(subtotal) // 실제 계산을 위한 숫자값 저장 + .prop('type', 'text') // 추가: input type을 text로 변경 + .val(new Intl.NumberFormat('ko-KR').format(subtotal) + '원'); // 표시용 포맷팅 + + updateGrandTotal(); // 전체 주문 금액 업데이트 (다른 함수에서 구현) @@ -523,11 +527,16 @@ // 총계 업데이트 function updateGrandTotal() { let total = 0; - $('.subtotal-price:visible').each(function() { - const value = $(this).val().replace(/[₩,원]/g, ''); - total += parseFloat(value) || 0; + $('.stock-info-card:visible').each(function() { + const card = $(this); + const quantity = parseInt(card.find('.order-quantity').val()) || 0; + const unitPrice = parseFloat(card.find('.unit-price').val()) || 0; + total += quantity * unitPrice; }); - $('#grandTotal').val(new Intl.NumberFormat('ko-KR').format(total) + '원'); + + $('#grandTotal') + .prop('type', 'text') // 추가: input type을 text로 변경 + .val(new Intl.NumberFormat('ko-KR').format(total) + '원'); } // 삭제 버튼 상태 업데이트 From 68a40e9e63adb77c61aebbdc6bde0c95eeaf54f7 Mon Sep 17 00:00:00 2001 From: BowWowBow Date: Tue, 17 Dec 2024 17:52:06 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=EB=A9=94=EC=9D=B8=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stockm8/controller/HomeController.java | 14 + .../stockm8/controller/UserController.java | 80 +++--- .../java/com/stockm8/persistence/UserDAO.java | 4 + .../com/stockm8/persistence/UserDAOImpl.java | 14 +- .../java/com/stockm8/service/UserService.java | 3 + .../com/stockm8/service/UserServiceImpl.java | 8 + .../src/main/resources/mappers/userMapper.xml | 8 + .../main/webapp/WEB-INF/views/howtouse.jsp | 17 +- .../src/main/webapp/WEB-INF/views/intro.jsp | 168 ++++++------ .../src/main/webapp/WEB-INF/views/main.jsp | 239 ++++++++++++------ .../WEB-INF/views/user/findPassword.jsp | 44 +--- 11 files changed, 361 insertions(+), 238 deletions(-) diff --git a/stockMate/src/main/java/com/stockm8/controller/HomeController.java b/stockMate/src/main/java/com/stockm8/controller/HomeController.java index ab38e42..bdd2290 100644 --- a/stockMate/src/main/java/com/stockm8/controller/HomeController.java +++ b/stockMate/src/main/java/com/stockm8/controller/HomeController.java @@ -78,6 +78,20 @@ public String howtouseGET(Model model, HttpSession session) throws Exception { return "howtouse"; } + // 창고위치 - /location (GET) + @RequestMapping(value = "/location", method = RequestMethod.GET) + public String locationGET(Model model, HttpSession session) throws Exception { + Long userId = (Long) session.getAttribute("userId"); +// if (id == null) { +// // 세션에 id가 없으면 에러 처리 +// return "redirect:/user/main"; +// } +// UserVO resultVO = userService.getUser(userId); +// model.addAttribute("resultVO", resultVO); + return "location"; + } + + // 상담하기 - /user/consultation (GET) @RequestMapping(value = "/consultation", method = RequestMethod.GET) public String consultationGET(Model model, HttpSession session) throws Exception { diff --git a/stockMate/src/main/java/com/stockm8/controller/UserController.java b/stockMate/src/main/java/com/stockm8/controller/UserController.java index 9fbfb87..7b7680d 100644 --- a/stockMate/src/main/java/com/stockm8/controller/UserController.java +++ b/stockMate/src/main/java/com/stockm8/controller/UserController.java @@ -142,22 +142,6 @@ public String userLoginPOST(UserVO user, RedirectAttributes rttr, HttpSession se return "redirect:/user/signin"; // 로그인 페이지 이동 } - // 메인페이지 - GET - @RequestMapping(value = "/main", method = RequestMethod.GET) - public void mainGET(HttpServletRequest request, Model model) throws Exception { - logger.info(" mainGET() 호출 "); - - // FlashMap에서 에러 메시지 확인 - Map flashMap = RequestContextUtils.getInputFlashMap(request); - if (flashMap != null) { - String errorMessage = (String) flashMap.get("errorMessage"); - if (errorMessage != null) { - model.addAttribute("errorMessage", errorMessage); - } - } - - logger.info(" /user/main -> /user/main.jsp 연결 "); - } // 대시보드 페이지 - GET @RequestMapping(value = "/dashboard", method = RequestMethod.GET) @@ -269,31 +253,6 @@ public void userUpdatePOST(@ModelAttribute UserVO user, HttpSession session, Htt } - // 비밀번호 찾기 - get - @RequestMapping(value = "/findPassword", method = RequestMethod.GET) - public String findPasswordGet() { - - return "/user/findPassword"; - } - -// // 회원정보 수정 - GET -// // (기존정보를 가져와서 보여주고, 수정할 정보를 입력) -// @RequestMapping(value = "/editinfo1", method = RequestMethod.GET) -// public void userUpdateGET(@SessionAttribute("userId") Long userId, Model model) throws Exception { -// logger.info(" userUpdateGET() 호출 "); -// -// // 사용자의 ID정보를 가져오기(세션) -// logger.info("userId : " + userId); -// -// // 서비스 -> DAO 회원정보 가져오는 동작 호출 -// UserVO resultVO = userService.getUser(userId); -// -// // 연결된 뷰페이지에 출력 -// // => model 객체에 정보 저장 -// model.addAttribute("resultVO", resultVO); -// // /user/update.jsp 뷰페이지 연결 -// } -// // 회원정보 수정 @RequestMapping(value = "/changepassword1", method = RequestMethod.GET) @@ -392,7 +351,7 @@ public void changePasswordPOST( } } - + // 상담하기 email - GET @RequestMapping(value = "/sendConsultation", method = RequestMethod.POST) public String sendConsultation( @RequestParam("company") String company, @@ -474,6 +433,43 @@ protected PasswordAuthentication getPasswordAuthentication() { } + // 비밀번호 찾기 - GET + @RequestMapping(value = "/findPassword", method = RequestMethod.GET) + public String findPasswordGet() { + return "/user/findPassword"; // 비밀번호 찾기 페이지로 이동 + } + + // 비밀번호 찾기 - POST + @RequestMapping(value = "/findPassword", method = RequestMethod.POST) + public String findPasswordPost(@RequestParam("email") String email, + @RequestParam("name") String name, + Model model) { + try { + // 이메일과 이름으로 비밀번호 찾기 + String password = userService.findPassword(email, name); // 비밀번호를 String으로 받음 + + if (password != null) { + // 비밀번호가 일치하면 얼럿창을 통해 비밀번호를 사용자에게 전달 + model.addAttribute("password", password); // 비밀번호를 model에 추가 + model.addAttribute("alertMessage", "입력한 정보에 해당하는 비밀번호는: " + password); + return "/user/showpassword"; // 비밀번호를 보여주는 페이지로 이동 + } else { + // 비밀번호가 일치하지 않으면 오류 메시지 추가 + logger.info("비밀번호 찾기 실패: 이메일 또는 이름이 일치하지 않음"); // 실패 로그 + model.addAttribute("errorMessage", "이메일 또는 이름이 일치하지 않습니다."); + return "/user/findPassword"; // 비밀번호 찾기 페이지로 다시 이동 + } + } catch (Exception e) { + e.printStackTrace(); + logger.error("비밀번호 찾기 처리 중 오류 발생", e); // 예외 로그 추가 + model.addAttribute("errorMessage", "비밀번호 찾기 처리 중 오류가 발생했습니다."); + return "/user/findPassword"; // 오류 발생 시 비밀번호 찾기 페이지로 돌아감 + } + } + + + + // 대시보드사용법 - /howtouse2 (GET) @RequestMapping(value = "/howtouse2", method = RequestMethod.GET) public String howtouseGET2(Model model, HttpSession session) throws Exception { diff --git a/stockMate/src/main/java/com/stockm8/persistence/UserDAO.java b/stockMate/src/main/java/com/stockm8/persistence/UserDAO.java index 469609d..85d296d 100644 --- a/stockMate/src/main/java/com/stockm8/persistence/UserDAO.java +++ b/stockMate/src/main/java/com/stockm8/persistence/UserDAO.java @@ -31,6 +31,10 @@ public interface UserDAO { int updateUserBusinessId(@Param("userId") Long userId, @Param("businessId") int businessId); + // 비밀번호 찾기 동작 + public String findPassword(String email,String name) throws Exception; + + // 회원정보 삭제동작 public int deleteUser (UserVO user); diff --git a/stockMate/src/main/java/com/stockm8/persistence/UserDAOImpl.java b/stockMate/src/main/java/com/stockm8/persistence/UserDAOImpl.java index 8017d22..c81d567 100644 --- a/stockMate/src/main/java/com/stockm8/persistence/UserDAOImpl.java +++ b/stockMate/src/main/java/com/stockm8/persistence/UserDAOImpl.java @@ -89,7 +89,19 @@ public int updateUserBusinessId(Long userId, int businessId) { return sqlSession.update(NAMESPACE + "updateUserBusinessId", params); } - + @Override + public String findPassword(String email, String name) throws Exception { + logger.info("findPassword 실행: 이메일 = " + email + ", 이름 = " + name); + + // 이메일과 이름을 조건으로 사용자 조회 + Map params = new HashMap<>(); + params.put("email", email); + params.put("name", name); + + // DB에서 사용자를 조회 + return sqlSession.selectOne(NAMESPACE + "findPassword", Map.of("email", email, "name", name)); + } + diff --git a/stockMate/src/main/java/com/stockm8/service/UserService.java b/stockMate/src/main/java/com/stockm8/service/UserService.java index 1ecc36f..f41df29 100644 --- a/stockMate/src/main/java/com/stockm8/service/UserService.java +++ b/stockMate/src/main/java/com/stockm8/service/UserService.java @@ -29,6 +29,9 @@ public interface UserService { // 회원정보에서 비밀번호 수정 public void updateUserBusinessId(Long userId, int businessId) throws Exception; + // 비밀번호 찾기 + public String findPassword (String email, String name) throws Exception; + // 회원정보 삭제 public int deleteUser(UserVO user) throws Exception; diff --git a/stockMate/src/main/java/com/stockm8/service/UserServiceImpl.java b/stockMate/src/main/java/com/stockm8/service/UserServiceImpl.java index 321c80b..bf9b4f9 100644 --- a/stockMate/src/main/java/com/stockm8/service/UserServiceImpl.java +++ b/stockMate/src/main/java/com/stockm8/service/UserServiceImpl.java @@ -75,6 +75,14 @@ public void updateUserBusinessId(Long userId, int businessId) throws Exception { userDAO.updateUserBusinessId(userId, businessId); } + @Override + public String findPassword(String email, String name) throws Exception { + logger.info("findPassword 실행: 이메일 = " + email + ", 이름 = " + name); + // userDAO에서 비밀번호를 찾아 반환 + return userDAO.findPassword(email, name); + } + + @Override public int deleteUser(UserVO user) throws Exception { logger.info(" deleteuser(UserVO dvo) 실행 "); diff --git a/stockMate/src/main/resources/mappers/userMapper.xml b/stockMate/src/main/resources/mappers/userMapper.xml index 8e015f2..5d01627 100644 --- a/stockMate/src/main/resources/mappers/userMapper.xml +++ b/stockMate/src/main/resources/mappers/userMapper.xml @@ -107,6 +107,14 @@ AND business_id IS NULL + + + + DELETE FROM users diff --git a/stockMate/src/main/webapp/WEB-INF/views/howtouse.jsp b/stockMate/src/main/webapp/WEB-INF/views/howtouse.jsp index 1c0a7c7..8a26b5a 100644 --- a/stockMate/src/main/webapp/WEB-INF/views/howtouse.jsp +++ b/stockMate/src/main/webapp/WEB-INF/views/howtouse.jsp @@ -22,12 +22,17 @@ box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); text-align: center; } - .header { - background-color: #007BFF; - color: #fff; - padding: 20px; - border-radius: 15px 15px 0 0; - margin-bottom: 20px; + + .header { + position: relative; + height: 400px; + background: url(resources/css/9950253.jpg) no-repeat center center / cover; + display: flex +; + justify-content: center; + align-items: center; + text-align: center; + color: white; } .header h1 { font-size: 36px; diff --git a/stockMate/src/main/webapp/WEB-INF/views/intro.jsp b/stockMate/src/main/webapp/WEB-INF/views/intro.jsp index 70ac269..d6a0e56 100644 --- a/stockMate/src/main/webapp/WEB-INF/views/intro.jsp +++ b/stockMate/src/main/webapp/WEB-INF/views/intro.jsp @@ -6,112 +6,130 @@ 회사 소개 - -
-
-

회사 소개

-
-
-

회사 정보

-

회사명: ㈜stockmate

-

대표이사: 黃仁成

-

설립일: 1999년 8월

-

주사업: 웹 기반 ERP, 그룹웨어, 웹메일 개발 및 서비스

-

사업장: 부산 부산진구 동천로 109 삼한골든게이트 ㈜stockmate

-
-
-

고객 지원팀

-

고객님과의 최접점 고객지원팀이 있습니다.

-

고객지원팀은 고객사와의 상담업무를 주된 업무로 하며 다양한 문의를 처리합니다.

-

전화 상담 요청 및 지정된 전문 상담사를 통해 고객님의 궁금증을 해결합니다.

-

고객의 "고맙습니다"라는 말이 가장 큰 보람입니다.

-
-
-

DB팀

-

DB팀은 프로그램의 기본 뼈대를 튼튼히 잡아주는 중요한 팀입니다.

-

데이터를 설계하고 보안을 유지하며 고객사 자료를 안전하게 관리합니다.

-

DA(Data Architect)와 DBA(DataBase Admin)로 나누어져 있으며, 새로운 기능 기획안을 기반으로 DB 설계와 도면을 작성합니다.

-
-
-

개발팀

-

개발팀은 이카운트 ERP의 모든 기능을 구현합니다.

-

고객사 제안과 전략적 개발 기능을 기반으로 개발 스케줄을 잡고 기능을 개발합니다.

-

완성된 기능이 무사히 업그레이드되었을 때의 뿌듯함을 느끼며, 고객 만족도를 위해 지속적으로 노력하고 있습니다.

-
- + +
+

회사 소개

+
+ + +
+

회사 정보

+

회사명: ㈜stockmate

+

대표이사: 黃仁成

+

설립일: 1999년 8월

+

주사업: 웹 기반 ERP, 그룹웨어, 웹메일 개발 및 서비스

+

사업장: 부산 부산진구 동천로 109 삼한골든게이트 ㈜stockmate

+
+ + +
+

고객 지원팀

+

고객님과의 최접점 고객지원팀이 있습니다.

+

고객지원팀은 고객사와의 상담업무를 주된 업무로 하며 다양한 문의를 처리합니다.

+

전화 상담 요청 및 지정된 전문 상담사를 통해 고객님의 궁금증을 해결합니다.

+

고객의 "고맙습니다"라는 말이 가장 큰 보람입니다.

+
+ + +
+

DB팀

+

DB팀은 프로그램의 기본 뼈대를 튼튼히 잡아주는 중요한 팀입니다.

+

데이터를 설계하고 보안을 유지하며 고객사 자료를 안전하게 관리합니다.

+

DA(Data Architect)와 DBA(DataBase Admin)로 나누어져 있으며, 새로운 기능 기획안을 기반으로 DB 설계와 도면을 작성합니다.

+
+ + +
+

개발팀

+

개발팀은 이카운트 ERP의 모든 기능을 구현합니다.

+

고객사 제안과 전략적 개발 기능을 기반으로 개발 스케줄을 잡고 기능을 개발합니다.

+

완성된 기능이 무사히 업그레이드되었을 때의 뿌듯함을 느끼며, 고객 만족도를 위해 지속적으로 노력하고 있습니다.

+
+ + + diff --git a/stockMate/src/main/webapp/WEB-INF/views/main.jsp b/stockMate/src/main/webapp/WEB-INF/views/main.jsp index cafcfb2..fcd8658 100644 --- a/stockMate/src/main/webapp/WEB-INF/views/main.jsp +++ b/stockMate/src/main/webapp/WEB-INF/views/main.jsp @@ -1,5 +1,4 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> @@ -9,112 +8,173 @@ 메인 페이지 - +
- About Us Logo -

최초 메인 페이지 - 데모

+

Warehouse Management Solutions

+

스마트한 재고 관리와 최적화된 물류 시스템을 제공합니다.

- - - -
${errorMessage}
-
- +
-

고퀄리티 교회 현수막을 제작합니다.

-

현수막은 다양한 곳에 홍보물로 많이 사용되고 있습니다.
- 홀리라이프 현수막을 통해 고퀄리티 디자인을 경험해보세요.

+

20년 노하우의 지산그룹이 만든 안성창고

+

긍정 마인드를 통해 끊임없이 새로운 변화를 추구하고 있습니다

+ + +

걸림돌을 디딤돌로 긍정의 끝은 무한한 가능성!

+

지산그룹은 지난 1999년 창립 이후 오늘에 이르기까지 물류센터 개발, 운영 등 물류분야와 국내 PC업계 최초의 스마트 팩토리 구현 등 +축적된 기술력과 차별화된 경영전략 및 인적구성으로 최고의 서비스를 제공해 왔습니다. +특히 건설전문가 집단의 역량을 살려 폭 넓은 지식과 경험을 바탕으로 분야별 전문 인력으로 구성되어 설계, 생산, 조립, 건설사업관리, +프로젝트관리 등 부동산 개발의 전 분양에 걸쳐 자부심을 가지며 국내 최고의 물류센터와 PC개발 전문기업으로 앞서 나아가고 있습니다. +어떠한 난관도 불가능한 것이 없다는 긍정 마인드를 통해 끊임없이 새로운 변화를 추구하는 지산그룹은 고객 여러분과 함께 하겠습니다.

+ + + +
- Example Banner + Warehouse Exterior
- World Map + Warehouse Interior
+
-
-

대시보드 사용법

-
    -
  • gif 영상
  • -
  • jpg 이미지
  • -
-
+ +
+

회사 약도

+ 회사 약도 +
+ + + + + + - \ No newline at end of file + diff --git a/stockMate/src/main/webapp/WEB-INF/views/user/findPassword.jsp b/stockMate/src/main/webapp/WEB-INF/views/user/findPassword.jsp index 17bc389..1eabd8c 100644 --- a/stockMate/src/main/webapp/WEB-INF/views/user/findPassword.jsp +++ b/stockMate/src/main/webapp/WEB-INF/views/user/findPassword.jsp @@ -111,48 +111,24 @@ ← 뒤로 가기

비밀번호 찾기

- + - - + +
- - -
-

비밀번호 확인
1234

- -
- - -
-

이메일 또는 이름이 존재하지 않습니다.
다시 한 번 확인해주세요.

- -
- + + + + + - From d6c6c6884c6aa10dc541f6236ecc39999db466a4 Mon Sep 17 00:00:00 2001 From: freehyeon Date: Tue, 17 Dec 2024 18:09:15 +0900 Subject: [PATCH 4/5] =?UTF-8?q?admin=20=ED=8C=8C=ED=8A=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=EC=9C=BC=EB=A1=9C=20=EC=9D=B8=ED=95=9C=20=EC=BB=A4?= =?UTF-8?q?=EB=B0=8B=20->=20Receiving=20=EC=A7=80=EC=9B=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/stockm8/service/OrderServiceImpl.java | 2 + .../webapp/WEB-INF/views/admin/adminMain.jsp | 52 +++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/stockMate/src/main/java/com/stockm8/service/OrderServiceImpl.java b/stockMate/src/main/java/com/stockm8/service/OrderServiceImpl.java index dc14ea5..863628e 100644 --- a/stockMate/src/main/java/com/stockm8/service/OrderServiceImpl.java +++ b/stockMate/src/main/java/com/stockm8/service/OrderServiceImpl.java @@ -46,6 +46,8 @@ public void insertOrderWithItems(OrderVO order, List orderItems) th } odao.insertOrderItem(orderItems); processOrderByType(order); + + rdao.insertReceiving(businessId); } diff --git a/stockMate/src/main/webapp/WEB-INF/views/admin/adminMain.jsp b/stockMate/src/main/webapp/WEB-INF/views/admin/adminMain.jsp index 02b9da8..eed9545 100644 --- a/stockMate/src/main/webapp/WEB-INF/views/admin/adminMain.jsp +++ b/stockMate/src/main/webapp/WEB-INF/views/admin/adminMain.jsp @@ -5,11 +5,63 @@ 관리자 메인 +

관리자 메인

+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+

회사 정보 - 사업자 번호, 연락처 등등 푸터 내용

+
+ From 0be35ad21738fa852266b4d53170dff2a3a1cec6 Mon Sep 17 00:00:00 2001 From: shoqying Date: Tue, 17 Dec 2024 18:23:37 +0900 Subject: [PATCH 5/5] 123 --- .../controller/ShipmentController.java | 271 +++++++++++++- .../com/stockm8/persistence/ShipmentDAO.java | 48 ++- .../stockm8/persistence/ShipmentDAOImpl.java | 160 +++++++- .../com/stockm8/service/ShipmentService.java | 49 ++- .../stockm8/service/ShipmentServiceImpl.java | 122 +++++- .../main/resources/mappers/shipmentMapper.xml | 266 ++++++++++++- .../WEB-INF/views/receiving/allScan.jsp | 1 - .../WEB-INF/views/receiving/history.jsp | 2 +- .../webapp/WEB-INF/views/receiving/list.jsp | 8 +- .../webapp/WEB-INF/views/receiving/main.jsp | 2 +- .../webapp/WEB-INF/views/receiving/scan.jsp | 2 +- .../webapp/WEB-INF/views/receiving/search.jsp | 2 +- .../webapp/WEB-INF/views/shipment/allScan.jsp | 341 +++++++++++++++++ .../webapp/WEB-INF/views/shipment/history.jsp | 349 ++++++++++++++++++ .../webapp/WEB-INF/views/shipment/list.jsp | 41 ++ .../webapp/WEB-INF/views/shipment/main.jsp | 258 +++++++++++++ .../webapp/WEB-INF/views/shipment/scan.jsp | 341 +++++++++++++++++ .../webapp/WEB-INF/views/shipment/search.jsp | 348 +++++++++++++++++ 18 files changed, 2581 insertions(+), 30 deletions(-) create mode 100644 stockMate/src/main/webapp/WEB-INF/views/shipment/allScan.jsp create mode 100644 stockMate/src/main/webapp/WEB-INF/views/shipment/history.jsp create mode 100644 stockMate/src/main/webapp/WEB-INF/views/shipment/list.jsp create mode 100644 stockMate/src/main/webapp/WEB-INF/views/shipment/main.jsp create mode 100644 stockMate/src/main/webapp/WEB-INF/views/shipment/scan.jsp create mode 100644 stockMate/src/main/webapp/WEB-INF/views/shipment/search.jsp diff --git a/stockMate/src/main/java/com/stockm8/controller/ShipmentController.java b/stockMate/src/main/java/com/stockm8/controller/ShipmentController.java index 9232f4f..abc98ba 100644 --- a/stockMate/src/main/java/com/stockm8/controller/ShipmentController.java +++ b/stockMate/src/main/java/com/stockm8/controller/ShipmentController.java @@ -1,34 +1,291 @@ package com.stockm8.controller; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import javax.inject.Inject; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; +import com.stockm8.domain.vo.Criteria; +import com.stockm8.domain.vo.PageVO; +import com.stockm8.domain.vo.ProductVO; +import com.stockm8.domain.vo.ReceivingShipmentVO; +import com.stockm8.domain.vo.StockVO; +import com.stockm8.domain.vo.UserVO; import com.stockm8.service.ReceivingService; +import com.stockm8.service.ShipmentService; +import com.stockm8.service.UserService; @Controller @RequestMapping(value = "/shipment/*") - public class ShipmentController { private static final Logger logger = LoggerFactory.getLogger(ShipmentController.class); -// @Inject -// private ReceivingService rService; + @Inject + private ShipmentService sService; + + @Inject + private UserService uService; - // http://localhost:8088/receiving/main + // http://localhost:8088/shipment/main @RequestMapping(value = "/main", method = RequestMethod.GET) - public void mainGET() throws Exception { + public void mainGET(Model model, HttpServletRequest request) throws Exception { logger.info("mainGET() 호출"); - logger.info(""); + // 세션에서 userId 가져오기 + HttpSession session = request.getSession(false); + Long userId = (session != null) ? (Long)session.getAttribute("userId") : null; + + // userId로 사용자 정보 조회 + UserVO user = uService.getUserById(userId); + int businessId = user.getBusinessId(); + + List ShipmentList = sService.getShipmentList(businessId); + logger.info(ShipmentList.size() + "개"); + + List YesterdayShipmentList = sService.getYesterdayShipmentList(businessId); + logger.info(YesterdayShipmentList.size() + "개"); + + List TDBYShipmentList = sService.getTDBYShipmentList(businessId); + logger.info(TDBYShipmentList.size() + "개"); + + model.addAttribute("ShipmentList", ShipmentList); + model.addAttribute("YesterdayShipmentList", YesterdayShipmentList); + model.addAttribute("TDBYShipmentList", TDBYShipmentList); + } + + // http://localhost:8088/shipment/history + @RequestMapping(value = "/history", method = RequestMethod.GET) + public void historyGET(@RequestParam(value = "startDate", required = false) String startDate, + @RequestParam(value = "endDate", required = false) String endDate, + @RequestParam(value = "keyword", required = false) String keyword, + Criteria cri, HttpServletRequest request, + Model model) throws Exception { + logger.info("historyGET() 호출"); + + // 세션에서 userId 가져오기 + HttpSession session = request.getSession(false); + Long userId = (session != null) ? (Long)session.getAttribute("userId") : null; + + // userId로 사용자 정보 조회 + UserVO user = uService.getUserById(userId); + int businessId = user.getBusinessId(); + + List ShipmentList; + + int totalCount = 0; + + ShipmentList = sService.getShipmentHistoryList(cri, businessId); + totalCount = sService.getTotalCount(businessId); // 전체 개수 + + PageVO pageVO = new PageVO(); + pageVO.setCri(cri); + pageVO.setTotalCount(totalCount); + model.addAttribute("pageVO", pageVO); + + logger.info(ShipmentList.size() + "개"); + model.addAttribute("ShipmentList", ShipmentList); + } + + // http://localhost:8088/shipment/search + @RequestMapping(value = "/search", method = RequestMethod.GET) + public void searchGET(@RequestParam(value = "startDate", required = false) String startDate, + @RequestParam(value = "endDate", required = false) String endDate, + @RequestParam(value = "keyword", required = false) String keyword, + Criteria cri, HttpServletRequest request, + Model model) throws Exception { + logger.info("searchGET() 호출"); + + List ShipmentList; + + // 세션에서 userId 가져오기 + HttpSession session = request.getSession(false); + Long userId = (session != null) ? (Long)session.getAttribute("userId") : null; + + // userId로 사용자 정보 조회 + UserVO user = uService.getUserById(userId); + int businessId = user.getBusinessId(); + + int totalCount = 0; + + // 날짜와 키워드가 모두 있는 경우 + if (startDate != null && endDate != null && keyword != null) { + ShipmentList = sService.getHistoryByDateRange(startDate, endDate, keyword, cri, businessId); + totalCount = sService.getTotalCountBySearch(startDate, endDate, keyword, businessId); + + } else if (keyword != null) { + ShipmentList = sService.getHistoryByDateRange(null, null, keyword, cri, businessId); + totalCount = sService.getTotalCountBySearch(null, null, keyword, businessId); + + } else if (startDate != null && endDate != null) { + ShipmentList = sService.getHistoryByDateRange(startDate, endDate, null, cri, businessId); + totalCount = sService.getTotalCountBySearch(startDate, endDate, null, businessId); + + } else { + ShipmentList = sService.getShipmentHistoryList(cri, businessId); + totalCount = sService.getTotalCount(businessId); // 전체 개수 + + } + + PageVO pageVO = new PageVO(); + pageVO.setCri(cri); + pageVO.setTotalCount(totalCount); + model.addAttribute("pageVO", pageVO); + + logger.info(ShipmentList.size() + "개"); + model.addAttribute("ShipmentList", ShipmentList); + } + + // 새로고침 + @RequestMapping(value = "/insert1", method = RequestMethod.POST) + public String insert1POST(HttpServletRequest request) throws Exception { + logger.info("insertPOST() 호출"); + + // 세션에서 userId 가져오기 + HttpSession session = request.getSession(false); + Long userId = (session != null) ? (Long)session.getAttribute("userId") : null; + + // userId로 사용자 정보 조회 + UserVO user = uService.getUserById(userId); + int businessId = user.getBusinessId(); + + sService.insertShipment(businessId); + return "redirect:/shipment/main"; } + // 새로고침 + @RequestMapping(value = "/insert2", method = RequestMethod.POST) + public String insert2POST(HttpServletRequest request) throws Exception { + logger.info("insertPOST() 호출"); + + // 세션에서 userId 가져오기 + HttpSession session = request.getSession(false); + Long userId = (session != null) ? (Long)session.getAttribute("userId") : null; + + // userId로 사용자 정보 조회 + UserVO user = uService.getUserById(userId); + int businessId = user.getBusinessId(); + + sService.insertShipment(businessId); + + return "redirect:/shipment/history"; + } + + // 새로고침 + @RequestMapping(value = "/insert3", method = RequestMethod.POST) + public String insert3POST(HttpServletRequest request) throws Exception { + logger.info("insertPOST() 호출"); + + // 세션에서 userId 가져오기 + HttpSession session = request.getSession(false); + Long userId = (session != null) ? (Long)session.getAttribute("userId") : null; + + // userId로 사용자 정보 조회 + UserVO user = uService.getUserById(userId); + int businessId = user.getBusinessId(); + + sService.insertShipment(businessId); + + return "redirect:/shipment/search"; + } + + // http://localhost:8088/shipment/scan + @RequestMapping(value = "/scan", method = RequestMethod.GET) + public String scanGET(HttpServletRequest request) throws Exception { + logger.info("scanGET() 호출"); + + // 세션에서 userId 가져오기 + HttpSession session = request.getSession(false); + Long userId = (session != null) ? (Long)session.getAttribute("userId") : null; + + // userId로 사용자 정보 조회 + UserVO user = uService.getUserById(userId); + int businessId = user.getBusinessId(); + + return "/shipment/scan"; + } + + // http://localhost:8088/shipment/scan + @RequestMapping(value = "/scan", method = RequestMethod.POST) + @ResponseBody + public Map scanPOST(@RequestBody Map bar, Model model, + HttpServletRequest request) throws Exception { + logger.info("scanPOST() 호출"); + + // 세션에서 userId 가져오기 + HttpSession session = request.getSession(false); + Long userId = (session != null) ? (Long)session.getAttribute("userId") : null; + + // userId로 사용자 정보 조회 + UserVO user = uService.getUserById(userId); + int businessId = user.getBusinessId(); + + // QR 코드 데이터 처리 로직 (예: 데이터 저장, 검증 등) + String barcode = bar.get("barcode"); + Map response = new HashMap(); + + if (userId == null) { + response.put("success", false); + response.put("message", "로그인 정보가 없습니다."); + return response; + } + + try { + sService.ShipmentStatusToComplete(businessId, barcode); + int remainingStock = sService.increseStockByBarcode(businessId, barcode); + int reservedQuantity = sService.decreaseReservedQuantity(businessId, barcode); + ProductVO product = sService.productNameBarcode(businessId, barcode); + if (remainingStock >= 0) { + response.put("success", true); + response.put("remainingStock", remainingStock); + response.put("reservedQuantity", reservedQuantity); + response.put("productName", product.getProductName()); + response.put("productPrice", product.getProductPrice()); + } else { + response.put("success", false); + response.put("message", "유효하지 않은 바코드입니다."); + } + } catch (Exception e) { + response.put("success", false); + response.put("message", e.getMessage()); + } + return response; + } + + // http://localhost:8088/shipment/allScan + @RequestMapping(value = "/allScan", method = RequestMethod.GET) + public String allScanGET(HttpServletRequest request) throws Exception { + logger.info("allScanGET() 호출"); + + // 세션에서 userId 가져오기 + HttpSession session = request.getSession(false); + Long userId = (session != null) ? (Long)session.getAttribute("userId") : null; + + // userId로 사용자 정보 조회 + UserVO user = uService.getUserById(userId); + int businessId = user.getBusinessId(); + + + + return "/shipment/allScan"; + } + + + -} // ReceivingController end +} // ShipmentController end \ No newline at end of file diff --git a/stockMate/src/main/java/com/stockm8/persistence/ShipmentDAO.java b/stockMate/src/main/java/com/stockm8/persistence/ShipmentDAO.java index 8c41a41..957fbf5 100644 --- a/stockMate/src/main/java/com/stockm8/persistence/ShipmentDAO.java +++ b/stockMate/src/main/java/com/stockm8/persistence/ShipmentDAO.java @@ -2,11 +2,53 @@ import java.util.List; +import com.stockm8.domain.vo.Criteria; +import com.stockm8.domain.vo.ProductVO; import com.stockm8.domain.vo.ReceivingShipmentVO; +import com.stockm8.domain.vo.StockVO; public interface ShipmentDAO { - // 출고 메인 오늘 들어올 리스트 - public List todayReceivingList() throws Exception; + // 입고 메인 오늘 들어올 리스트 + public List selectShipmentList(int businessId) throws Exception; + + // 입고 메인 오늘 들어올 리스트 + public List selectYesterdayShipmentList(int businessId) throws Exception; + + // 입고 메인 오늘 들어올 리스트 + public List selectTDBYShipmentList(int businessId) throws Exception; + + // 입고 내역 히스토리 + public List selectShipmentHistoryList(Criteria cri, int businessId) throws Exception; + + // 입고 내역 검색 + public List selectHistoryByDateRange(String startDate, String endDate, String keyword, Criteria cri, int businessId) throws Exception; -} // ReceivingDAO end + // 검색시 모든 리스트 개수 + public int selectTotalCountBySearch(String startDate, String endDate, String keyword, int businessId) throws Exception; + + // 리스트 모든 개수 + public int selectTotalCount(int businessId) throws Exception; + + // recevingShipment 테이블 insert + public void insertShipment(int businessId) throws Exception; + + // 바코드로 재고 조회 + public List selectQuantityCheckByBarcode(int businessId, String barcode) throws Exception; + + // 바코드로 재고 감소 + public int updateIncreseStock(int businessId, String barcode) throws Exception; + + // 바코드로 재고 감소 실시간 조회 + public int selectStockByBarcode(int businessId, String barcode) throws Exception; + + // 바코드 찍은 후 발주 수량 감소 + public int selectReservedQuantity(int businessId, String barcode) throws Exception; + + // 바코드 찍은 후 제품 이름 추출 + public ProductVO selectProductNameBarcode(int businessId, String barcode) throws Exception; + + // 수량 없을시 완료상태로 변경 + public void updateShipmentStatusToComplete(int businessId, String barcode) throws Exception; + +} // ShipmentDAO end \ No newline at end of file diff --git a/stockMate/src/main/java/com/stockm8/persistence/ShipmentDAOImpl.java b/stockMate/src/main/java/com/stockm8/persistence/ShipmentDAOImpl.java index 8500d49..ffdde3a 100644 --- a/stockMate/src/main/java/com/stockm8/persistence/ShipmentDAOImpl.java +++ b/stockMate/src/main/java/com/stockm8/persistence/ShipmentDAOImpl.java @@ -1,21 +1,171 @@ package com.stockm8.persistence; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import javax.inject.Inject; + +import org.apache.ibatis.session.SqlSession; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Repository; +import com.stockm8.domain.vo.Criteria; +import com.stockm8.domain.vo.ProductVO; import com.stockm8.domain.vo.ReceivingShipmentVO; +import com.stockm8.domain.vo.StockVO; +@Repository public class ShipmentDAOImpl implements ShipmentDAO { private static final Logger logger = LoggerFactory.getLogger(ShipmentDAOImpl.class); - // 출고 메인 오늘 들어올 리스트 - public List todayReceivingList() throws Exception { - logger.info("todayReceivingList() 실행"); + private static final String NAMESPACE = "com.stockm8.mappers.shipmentMapper."; + + // 디비 연결 객체 주입 + @Inject + private SqlSession sqlSession; + + // 입고 메인 오늘 들어올 리스트 + @Override + public List selectShipmentList(int businessId) throws Exception { + logger.info("selectShipmentList() 호출"); + + return sqlSession.selectList(NAMESPACE + "getShipmentList", businessId); + } + + // 입고 메인 오늘 들어올 리스트 + @Override + public List selectYesterdayShipmentList(int businessId) throws Exception { + logger.info("selectYesterdayShipmentList() 호출"); - return null; + return sqlSession.selectList(NAMESPACE + "getYesterdayShipmentList", businessId); + } + + // 입고 메인 오늘 들어올 리스트 + @Override + public List selectTDBYShipmentList(int businessId) throws Exception { + logger.info("selectTDBYShipmentList() 호출"); + + return sqlSession.selectList(NAMESPACE + "getTDBYShipmentList", businessId); + } + + // 입고 내역 히스토리 리스트 + @Override + public List selectShipmentHistoryList(Criteria cri, int businessId) throws Exception { + logger.info("selectShipmentHistoryList() 호출"); + + Map paramMap = new HashMap(); + paramMap.put("cri", cri); + paramMap.put("businessId", businessId); + + return sqlSession.selectList(NAMESPACE + "getShipmentHistoryList", paramMap); + } + + // 입고 내역 검색 + @Override + public List selectHistoryByDateRange(String startDate, String endDate, String keyword, Criteria cri, int businessId) throws Exception { + logger.info("selectHistoryByDateRange() 호출"); + + Map paramMap = new HashMap(); + paramMap.put("startDate", startDate); + paramMap.put("endDate", endDate); + paramMap.put("keyword", keyword); + paramMap.put("cri", cri); + paramMap.put("businessId", businessId); + + return sqlSession.selectList(NAMESPACE + "getHistoryByDateRange", paramMap); } -} // ReceivingDAOImpl end + @Override + public int selectTotalCountBySearch(String startDate, String endDate, String keyword, int businessId) throws Exception { + + Map paramMap = new HashMap<>(); + paramMap.put("startDate", startDate); + paramMap.put("endDate", endDate); + paramMap.put("keyword", keyword); + paramMap.put("businessId", businessId); + return sqlSession.selectOne(NAMESPACE + "getTotalCountBySearch", paramMap); + } + + @Override + public int selectTotalCount(int businessId) throws Exception { + logger.info("selectTotalCount() 호출"); + + return sqlSession.selectOne(NAMESPACE + "getTotalCount", businessId); + } + + @Override + public void insertShipment(int businessId) throws Exception { + logger.info("insertShipment() 호출"); + sqlSession.insert(NAMESPACE + "insertShipment", businessId); + } + + @Override + public List selectQuantityCheckByBarcode(int businessId, String barcode) throws Exception { + logger.info("selectShipment() 호출"); + Map paramMap = new HashMap(); + paramMap.put("businessId", businessId); + paramMap.put("barcode", barcode); + + return sqlSession.selectList(NAMESPACE + "selectQuantityCheckByBarcode", paramMap); + } + + @Override + public int updateIncreseStock(int businessId, String barcode) throws Exception { + logger.info("updateDecreaseStock() 호출"); + // 매개변수 묶기 + Map params = new HashMap<>(); + params.put("businessId", businessId); + params.put("barcode", barcode); + + // SQL 실행 + return sqlSession.update(NAMESPACE + "updateIncreseStock", params); + } + + @Override + public int selectStockByBarcode(int businessId, String barcode) throws Exception { + logger.info("selectStockByBarcode() 호출"); + Map params = new HashMap<>(); + params.put("businessId", businessId); + params.put("barcode", barcode); + return sqlSession.selectOne(NAMESPACE + "selectStockByBarcode", params); + } + + @Override + public int selectReservedQuantity(int businessId, String barcode) throws Exception { + logger.info("selectReservedQuantity() 호출"); + Map params = new HashMap<>(); + params.put("businessId", businessId); + params.put("barcode", barcode); + return sqlSession.selectOne(NAMESPACE + "selectReservedQuantity", params); + } + + @Override + public ProductVO selectProductNameBarcode(int businessId, String barcode) throws Exception { + logger.info("selectProductNameBarcode() 호출"); + Map params = new HashMap<>(); + params.put("businessId", businessId); + params.put("barcode", barcode); + return sqlSession.selectOne(NAMESPACE + "selectProductNameBarcode", params); + } + + @Override + public void updateShipmentStatusToComplete(int businessId, String barcode) throws Exception { + logger.info("updateShipmentStatusToComplete() 호출"); + Map params = new HashMap<>(); + params.put("businessId", businessId); + params.put("barcode", barcode); + sqlSession.update(NAMESPACE + "updateShipmentStatusToComplete", params); + + } + + + + + + + + +} // ShipmentDAOImpl end diff --git a/stockMate/src/main/java/com/stockm8/service/ShipmentService.java b/stockMate/src/main/java/com/stockm8/service/ShipmentService.java index ee35b11..52005c0 100644 --- a/stockMate/src/main/java/com/stockm8/service/ShipmentService.java +++ b/stockMate/src/main/java/com/stockm8/service/ShipmentService.java @@ -1,5 +1,52 @@ package com.stockm8.service; +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; + +import com.stockm8.domain.vo.Criteria; +import com.stockm8.domain.vo.ProductVO; +import com.stockm8.domain.vo.ReceivingShipmentVO; +import com.stockm8.domain.vo.StockVO; + +@Mapper public interface ShipmentService { + + // 메인 입고 리스트 + public List getShipmentList(int businessId) throws Exception; + + // 메인 어제 입고 리스트 + public List getYesterdayShipmentList(int businessId) throws Exception; + + // 메인 그제 입고 리스트 + public List getTDBYShipmentList(int businessId) throws Exception; + + // 입고 내역 리스트 + public List getShipmentHistoryList(Criteria cri, int businessId) throws Exception; + + // 입고 내역 검색 + public List getHistoryByDateRange(String startDate, String endDate, String keyword, Criteria cri, int businessId) throws Exception; + + // 입고 내역 검색 + public int getTotalCountBySearch(String startDate, String endDate, String keyword, int businessId) throws Exception; + + // 글 모든 개수 + public int getTotalCount(int businessId) throws Exception; + + // rs 테이블 insert + public void insertShipment(int businessId) throws Exception; + + // 바코드 찍은 후 재고수량 증가 + public int increseStockByBarcode(int businessId, String barcode) throws Exception; + + // 바코드 찍은 후 발주 수량 감소 + public int decreaseReservedQuantity(int businessId, String barcode) throws Exception; + + // 바코드 찍은 후 제품 이름 추출 + public ProductVO productNameBarcode(int businessId, String barcode) throws Exception; + + // 수량 없을시 완료상태로 변경 + public void ShipmentStatusToComplete(int businessId, String barcode) throws Exception; + -} // ReceivingService end +} // ShipmentService end \ No newline at end of file diff --git a/stockMate/src/main/java/com/stockm8/service/ShipmentServiceImpl.java b/stockMate/src/main/java/com/stockm8/service/ShipmentServiceImpl.java index 9d7d85f..3ffb4bb 100644 --- a/stockMate/src/main/java/com/stockm8/service/ShipmentServiceImpl.java +++ b/stockMate/src/main/java/com/stockm8/service/ShipmentServiceImpl.java @@ -1,5 +1,125 @@ package com.stockm8.service; +import java.util.List; + +import javax.inject.Inject; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import com.stockm8.domain.vo.Criteria; +import com.stockm8.domain.vo.ProductVO; +import com.stockm8.domain.vo.ReceivingShipmentVO; +import com.stockm8.domain.vo.StockVO; +import com.stockm8.persistence.ShipmentDAO; + +@Service public class ShipmentServiceImpl implements ShipmentService { + + private static final Logger logger = LoggerFactory.getLogger(ShipmentServiceImpl.class); + + @Inject + private ShipmentDAO sdao; + + + // 메인 입고 리스트 + @Override + public List getShipmentList(int businessId) throws Exception { + logger.info("getTodayShipmentList() 호출"); + return sdao.selectShipmentList(businessId); + } + + @Override + public List getYesterdayShipmentList(int businessId) throws Exception { + logger.info("getYesterdayShipmentList() 호출"); + return sdao.selectYesterdayShipmentList(businessId); + } + + @Override + public List getTDBYShipmentList(int businessId) throws Exception { + logger.info("getTDBYShipmentList() 호출"); + return sdao.selectTDBYShipmentList(businessId); + } + + @Override + public List getShipmentHistoryList(Criteria cri, int businessId) throws Exception { + logger.info("getShipmentHistoryList() 호출"); + return sdao.selectShipmentHistoryList(cri, businessId); + } + + @Override + public List getHistoryByDateRange(String startDate, String endDate, String keyword, Criteria cri, int businessId) throws Exception{ + logger.info("getHistoryByDateRange() 호출"); + return sdao.selectHistoryByDateRange(startDate, endDate, keyword, cri, businessId); + } + + @Override + public int getTotalCountBySearch(String startDate, String endDate, String keyword, int businessId) throws Exception { + logger.info("getTotalCountBySearch() 호출"); + return sdao.selectTotalCountBySearch(startDate, endDate, keyword, businessId); + } + + @Override + public int getTotalCount(int businessId) throws Exception { + logger.info("getTotalCount() 호출"); + return sdao.selectTotalCount(businessId); + } + + @Override + public void insertShipment(int businessId) throws Exception { + logger.info("insertShipment() 호출"); + sdao.insertShipment(businessId); + } + + + @Transactional + @Override + public int increseStockByBarcode(int businessId, String barcode) throws Exception { + logger.info("increseStockByBarcode() 호출"); + List stock = sdao.selectQuantityCheckByBarcode(businessId, barcode); + if (stock == null) { + return -1; // 유효하지 않은 바코드 + } + + int updatedRows = sdao.updateIncreseStock(businessId, barcode); + if (updatedRows > 0) { + return sdao.selectStockByBarcode(businessId, barcode); // 증가 후 남은 재고 반환 + } else { + throw new RuntimeException("재고 업데이트 실패"); + } + } + + @Override + public int decreaseReservedQuantity(int businessId, String barcode) throws Exception { + logger.info("decreaseReservedQuantity() 호출"); + + return sdao.selectReservedQuantity(businessId, barcode); + } + + @Override + public ProductVO productNameBarcode(int businessId, String barcode) throws Exception { + logger.info("productNameBarcode() 호출"); + + return sdao.selectProductNameBarcode(businessId, barcode); + } + + @Override + public void ShipmentStatusToComplete(int businessId, String barcode) { + try { + // MyBatis 매퍼 호출 + sdao.updateShipmentStatusToComplete(businessId, barcode); + } catch (Exception e) { + // 예외 처리 + logger.error("입고 상태 업데이트 오류: " + e.getMessage()); + } + } + + + + + + -} // ReceivingServiceImpl end +} // ShipmentServiceImpl end \ No newline at end of file diff --git a/stockMate/src/main/resources/mappers/shipmentMapper.xml b/stockMate/src/main/resources/mappers/shipmentMapper.xml index 6c32878..0717cdb 100644 --- a/stockMate/src/main/resources/mappers/shipmentMapper.xml +++ b/stockMate/src/main/resources/mappers/shipmentMapper.xml @@ -3,9 +3,267 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "https://mybatis.org/dtd/mybatis-3-mapper.dtd"> + + + + + + + + + + + + + + + + + + + + + + + - + select + r.receiving_shipment_no, + r.transaction_type, + r.created_at, + r.status, + r.product_id, + p.product_name, + p.product_description, + r.change_quantity, + r.memo + from receiving_shipment r + join products p on r.product_id = p.product_id + join warehouses w on w.warehouse_id = r.warehouse_id + JOIN users u on u.created_by = r.created_by + where Date(r.created_at) = CURRENT_DATE and r.status = 'PENDING' and r.transaction_type = 'OUTBOUND' + AND u.business_id = #{businessId} + order by r.receiving_shipment_no desc + limit 0, 20 - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + UPDATE stocks s + JOIN products p on p.product_id = s.product_id + SET s.total_quantity = s.total_quantity - 1, + s.reserved_quantity = s.reserved_quantity +1 + WHERE p.product_barcode = #{barcode} AND s.business_id = #{businessId} + AND s.reserved_quantity > 0 + + + + + + + + + + + + + UPDATE receiving_shipment r + JOIN products p ON r.product_id = p.product_id + JOIN stocks s ON s.product_id = p.product_id + SET r.status = 'COMPLETED' + WHERE p.product_barcode = #{barcode} + AND s.reserved_quantity = 1 + AND r.status = 'PENDING' + AND s.business_id = #{businessId}; + + + + diff --git a/stockMate/src/main/webapp/WEB-INF/views/receiving/allScan.jsp b/stockMate/src/main/webapp/WEB-INF/views/receiving/allScan.jsp index 023b0b6..6cf55b8 100644 --- a/stockMate/src/main/webapp/WEB-INF/views/receiving/allScan.jsp +++ b/stockMate/src/main/webapp/WEB-INF/views/receiving/allScan.jsp @@ -206,7 +206,6 @@ td { 입고 메인 입고 내역 대쉬보드 - 다중 스캔
diff --git a/stockMate/src/main/webapp/WEB-INF/views/receiving/history.jsp b/stockMate/src/main/webapp/WEB-INF/views/receiving/history.jsp index 31ea01a..d3207f4 100644 --- a/stockMate/src/main/webapp/WEB-INF/views/receiving/history.jsp +++ b/stockMate/src/main/webapp/WEB-INF/views/receiving/history.jsp @@ -239,7 +239,7 @@ tr:hover {

입고 내역

입고 메인 - 실시간 입고 + 입고 검수
diff --git a/stockMate/src/main/webapp/WEB-INF/views/receiving/list.jsp b/stockMate/src/main/webapp/WEB-INF/views/receiving/list.jsp index 929fbff..629ff75 100644 --- a/stockMate/src/main/webapp/WEB-INF/views/receiving/list.jsp +++ b/stockMate/src/main/webapp/WEB-INF/views/receiving/list.jsp @@ -7,7 +7,7 @@

스캔된 입출고 리스트

- +
@@ -23,8 +23,8 @@ \ No newline at end of file diff --git a/stockMate/src/main/webapp/WEB-INF/views/receiving/main.jsp b/stockMate/src/main/webapp/WEB-INF/views/receiving/main.jsp index edf7fc6..e8a3435 100644 --- a/stockMate/src/main/webapp/WEB-INF/views/receiving/main.jsp +++ b/stockMate/src/main/webapp/WEB-INF/views/receiving/main.jsp @@ -137,7 +137,7 @@

입고 메인

입고 내역 -실시간 입고 +입고 검수대쉬보드 diff --git a/stockMate/src/main/webapp/WEB-INF/views/receiving/scan.jsp b/stockMate/src/main/webapp/WEB-INF/views/receiving/scan.jsp index 023b0b6..9495587 100644 --- a/stockMate/src/main/webapp/WEB-INF/views/receiving/scan.jsp +++ b/stockMate/src/main/webapp/WEB-INF/views/receiving/scan.jsp @@ -206,7 +206,7 @@ td { 입고 메인입고 내역대쉬보드 - 다중 스캔 + 스캔 다중 입력
diff --git a/stockMate/src/main/webapp/WEB-INF/views/receiving/search.jsp b/stockMate/src/main/webapp/WEB-INF/views/receiving/search.jsp index b283067..4786088 100644 --- a/stockMate/src/main/webapp/WEB-INF/views/receiving/search.jsp +++ b/stockMate/src/main/webapp/WEB-INF/views/receiving/search.jsp @@ -239,7 +239,7 @@ tr:hover {

입고 내역

입고 메인 - 실시간 입고 + 입고 검수 diff --git a/stockMate/src/main/webapp/WEB-INF/views/shipment/allScan.jsp b/stockMate/src/main/webapp/WEB-INF/views/shipment/allScan.jsp new file mode 100644 index 0000000..a4623d7 --- /dev/null +++ b/stockMate/src/main/webapp/WEB-INF/views/shipment/allScan.jsp @@ -0,0 +1,341 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + +QR 코드 스캔 및 상품 정보 + + + + + + +
+

실시간 출고 관리 시스템

+ 출고 메인 + 출고 내역 + 대쉬보드 + 다중 스캔 +
+
+
+ + +
+
+

재고 정보가 여기에 표시됩니다.

+
+
+ + +
+ + +
+
+ +
상품 ID
+ + + + + + + + + +
상품명바코드단가수량
+ + + + diff --git a/stockMate/src/main/webapp/WEB-INF/views/shipment/history.jsp b/stockMate/src/main/webapp/WEB-INF/views/shipment/history.jsp new file mode 100644 index 0000000..a15e2d2 --- /dev/null +++ b/stockMate/src/main/webapp/WEB-INF/views/shipment/history.jsp @@ -0,0 +1,349 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> + + + + +출고 내역 + + + + +

출고 내역

+ 출고 메인 + 실시간 출고 +
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
출고 번호입고 출고출고 일자출고 상태제품 번호제품명옵션명출고 수량수량 단위제품 단가창고 위치작업 메모
${vo.shipmentShipmentNo }${vo.transactionType } + + + 대기중 + + + 완료됨 + + + ${vo.status} + + + ${vo.productId }${vo.productName }${vo.productDescription }${vo.changeQuantity }${vo.transactionUnit }${vo.productPrice }${vo.warehouseId }${vo.memo }
+ +
+ + + + 검색 결과가 없습니다. + + + +
+ +
+ + + \ No newline at end of file diff --git a/stockMate/src/main/webapp/WEB-INF/views/shipment/list.jsp b/stockMate/src/main/webapp/WEB-INF/views/shipment/list.jsp new file mode 100644 index 0000000..e0f1f6a --- /dev/null +++ b/stockMate/src/main/webapp/WEB-INF/views/shipment/list.jsp @@ -0,0 +1,41 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + 입출고 리스트 + + +

스캔된 입출고 리스트

+ + + + + + + + + + + + +
상품 ID창고 ID수량거래 유형
+ + + + \ No newline at end of file diff --git a/stockMate/src/main/webapp/WEB-INF/views/shipment/main.jsp b/stockMate/src/main/webapp/WEB-INF/views/shipment/main.jsp new file mode 100644 index 0000000..581450e --- /dev/null +++ b/stockMate/src/main/webapp/WEB-INF/views/shipment/main.jsp @@ -0,0 +1,258 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> + + + + +출고 메인 + + + + + +

출고 메인

+ +출고 내역 +실시간 출고 +대쉬보드 +
+ +
+ + +

오늘 출고 리스트

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
출고 번호입고 출고출고 일자출고 상태제품 번호제품명옵션명출고 수량수량 단위작업 메모
${vo.shipmentShipmentNo}${vo.transactionType} + + 대기중 + 완료됨 + ${vo.status} + + ${vo.productId}${vo.productName}${vo.productDescription}${vo.changeQuantity}${vo.transactionUnit}${vo.memo}
+ + +

어제 출고 리스트

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
출고 번호입고 출고출고 일자출고 상태제품 번호제품명옵션명출고 수량수량 단위작업 메모
${vo.shipmentShipmentNo}${vo.transactionType} + + 대기중 + 완료됨 + ${vo.status} + + ${vo.productId}${vo.productName}${vo.productDescription}${vo.changeQuantity}${vo.transactionUnit}${vo.memo}
+ + +

그저께 출고 리스트

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
출고 번호입고 출고출고 일자출고 상태제품 번호제품명옵션명출고 수량수량 단위작업 메모
${vo.shipmentShipmentNo}${vo.transactionType} + + 대기중 + 완료됨 + ${vo.status} + + ${vo.productId}${vo.productName}${vo.productDescription}${vo.changeQuantity}${vo.transactionUnit}${vo.memo}
+ + + diff --git a/stockMate/src/main/webapp/WEB-INF/views/shipment/scan.jsp b/stockMate/src/main/webapp/WEB-INF/views/shipment/scan.jsp new file mode 100644 index 0000000..88c2ea9 --- /dev/null +++ b/stockMate/src/main/webapp/WEB-INF/views/shipment/scan.jsp @@ -0,0 +1,341 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + +QR 코드 스캔 및 상품 정보 + + + + + + +
+

실시간 출고 관리 시스템

+ 출고 메인 + 출고 내역 + 대쉬보드 + 스캔 다중 입력 +
+
+
+ + +
+
+

재고 정보가 여기에 표시됩니다.

+
+
+ + +
+ + +
+
+ + + + + + + + + + + +
상품명바코드단가수량
+ + + + diff --git a/stockMate/src/main/webapp/WEB-INF/views/shipment/search.jsp b/stockMate/src/main/webapp/WEB-INF/views/shipment/search.jsp new file mode 100644 index 0000000..e1b9c72 --- /dev/null +++ b/stockMate/src/main/webapp/WEB-INF/views/shipment/search.jsp @@ -0,0 +1,348 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> + + + + +출고 내역 + + + + +

출고 내역

+ 출고 메인 + 출고 검수 +
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
출고 번호입고 출고출고 일자출고 상태제품 번호제품명옵션명출고 수량수량 단위제품 단가창고 위치작업 메모
${vo.shipmentShipmentNo }${vo.transactionType } + + + 대기중 + + + 완료됨 + + + ${vo.status} + + + ${vo.productId }${vo.productName }${vo.productDescription }${vo.changeQuantity }${vo.transactionUnit }${vo.productPrice }${vo.warehouseId }${vo.memo }
+ +
+ + + + 검색 결과가 없습니다. + + + +
+ +
+ + + \ No newline at end of file