hyeonga_code

reProject_29_관리자 주문 관리 페이지 본문

Project_WEATHERWEAR

reProject_29_관리자 주문 관리 페이지

hyeonga 2024. 1. 24. 05:59
반응형

 

reProject_28_상품 등록 페이지/상품 상세 페이지/삭제/수정

2024.01.18 상품 관리페이지에서 td에 onclick="location.href"로 처리해서 체크박스를 제외한 어디를 클릭해도 상품으로 이동하도록 작업했다. tr에 작업했었으나 checkbox를 클릭하는 경우에도 처리되므로

hyeonga493.tistory.com

2024.01.19

주문은 상세 페이지를 따로 작성하지 않고 주문 목록에서 간단한 수정을 할 수 있게 구현하려고 한다.

기존의 테이블은 orders에 orderStatus가 있어 주문번호가 동일한 여러 상품을 일괄로 처리하게 되어있었으나, 상품별로 개별 발송/주문 상태를 변경할 수 있도록 하기위해 orders의 orderStatus를 orders_info 테이블로 옮겨 같은 주문번호라도 상품별로 작업할 수 있도록 변경하였다.

송장번호를 저장하는 deliver_info 테이블의 송장번호를 저장하는 컬럼은 다음 회의때 논의하려고 한다.

현재는 샘플 데이터만 취급해서 문제가 되지는 않지만 여러 방법으로 컬럼 생성의 시기를 지정할 수 있다.

1. 고객이 주문시 생성하는 경우

    1) 주문하는 상품별로 컬럼을 저장할 수 있지만 단점은 여러 상품을 한 번에 발송하는 경우 테이블 데이터가 비효율적일 수 있다.

    2) 주문 번호별로 하나씩 생성할 수 있으나 개별로 발송하는 경우 테이블을 훑어 같은 주문번호에 다른 상품이 남아있는지 비교해야 하는 번거로움이 생긴다.

2. 주문 상태를 '상품 준비중'에서 '배송 준비중'으로 변경시에 컬럼을 생성하는 경우

   - 상품별로 적용이 가능하다. 뒷단으로 넘어갈 때에 list에 같은 주문 번호가 있는 경우 하나로 묶어 처리할 수 있도록 할 수 있다.

3. 송장번호를 입력하고 저장할 때 생성하는 경우

 

 

주문관리페이지 작업

-- JAVA
> com.w2.admin.controller
	- OrderController.java

> com.w2.order
	- OrderVO.java
    - OrderInfoVO.java
    - OrderDAO.java

> com.w2.order.service
	- OrderService.java (interface)
    - OrderServiceImpl.java

-- Resources
> src/main/resources
	- mybatis-config.xml
> src/main/resources/mappings.xml
	- order-mapping.xml
    
-- VIEW
> WEB-INF/views/admin/order/orderList.jsp

 

 

1. OrderController.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package com.w2.admin.controller;
 
import java.io.IOException;
import java.util.List;
import java.util.Map;
 
import javax.servlet.http.HttpServletResponse;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
 
import com.w2.order.service.OrderService;
import com.w2.util.Search;
 
@Controller
public class OrderController {
    @Autowired
    private OrderService orderService;
    
    /**
     * 주문 목록 가져오기
     * @param model
     * @return
     */
    @RequestMapping("orderList.mdo")
    public String orderList(Model model, @RequestParam(required = false, defaultValue = "1"int page,
            @RequestParam(required = false, defaultValue = "1"int range, @RequestParam(required = false, defaultValue = "orderName"String searchType,
            @RequestParam(required = falseString keyword, @ModelAttribute("search") Search search) {
        
        // 검색
        model.addAttribute("search", search);
        search.setSearchType(searchType);
        search.setKeyword(keyword);
        
        // 전체 게시글 개수
        int listCnt = orderService.getOrderListCnt(search);
        
        // 검색 페이지 정보
        search.pageInfo(page, range, listCnt);
        // 페이징
        model.addAttribute("pagination", search);
        // 화면 출력
        model.addAttribute("orderList", orderService.getOrderList(search));
        
        return "order/orderList";
    }
 
    /**
     * 주문 수정
     * @param model
     * @return
     */
    @PostMapping("modifyOrder.mdo")
    public void modifyOrder(Model model, HttpServletResponse response, 
                    @RequestBody List<Map<StringString>> checkList, @RequestParam("modifyType")String modifyType) throws IOException {
        
        Integer statusCode = HttpStatus.OK.value();
        int code = -1;
        String resultCode = "fail";
        String message = "오류가 발생했습니다. 다시 시도해주세요";
        
        if(modifyType.equals("orderStatus")) {
            orderService.modifyOrderStatus(checkList);
        } else if(modifyType.equals("deliverNum")) {
            orderService.modifyDeliverNum(checkList);
        }
        
        if(code == 1) {
            resultCode = "success";
            message = "변경되었습니다.";
        }
 
        response.setContentType("application/json");
        response.getWriter().write(String.valueOf(code));
    }
}
 

 

 

2. OrderVO.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.w2.order;
 
import java.util.Date;
import java.util.List;
 
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
 
@Getter
@Setter
@ToString
public class OrderVO {
    private String orderId;            // 주문번호
    private String clientId;        // 회원번호
    private String addressId;        // 배송지번호
    private String optionIdList;    // 주문상품리스트
    private String deliverId;        // 배송번호
    private Date orderDate;            // 주문일자
    private int orderPrice;            // 주문금액
    private String orderStatus;        // 주문상태
    private int usedPoint;            // 적용포인트
    private String couponId;        // 적용쿠폰
    private String cookieId;        // 쿠키번호
    private String cookiePwd;        // 비회원비밀번호
    
    // join용
    private List<OrderInfoVO> orderInfoList;
}
 

 

 

3. OrderInfoVO.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package com.w2.order;
 
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
 
@Getter
@Setter
@ToString
public class OrderInfoVO {
    private String orderId;        // 주문번호
    private String optionId;    // 옵션번호
    private int orderProCnt;    // 수량
    private int orderTotal;        // 총금액
}
 

 

 

4. OrderService.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package com.w2.order.service;
 
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import com.w2.util.Search;
 
public interface OrderService {
 
    List<HashMap<String, Object>> getOrderList(Search search);    // 주문 목록 가져오기
    int getOrderListCnt(Search search);                            // 주문 목록 개수 가져오기
    int modifyOrderStatus(List<Map<StringString>> checkList); // 주문 상태 수정
    int modifyDeliverNum(List<Map<StringString>> checkList);    // 송장번호 수정
}
 

 

 

5. OrderServiceImpl.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.w2.order.service;
 
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import com.w2.order.OrderDAO;
import com.w2.util.Search;
 
@Service("OrderService")
public class OrderServiceImpl implements OrderService {
 
    @Autowired
    private OrderDAO orderDAO;
    
    @Override
    public List<HashMap<String, Object>> getOrderList(Search search) {
        return orderDAO.getOrderList(search);
    }
 
    @Override
    public int getOrderListCnt(Search search) {
        return orderDAO.getOrderListCnt(search);
    }
 
    @Override
    public int modifyOrderStatus(List<Map<StringString>> checkList) {
        return orderDAO.modifyOrderStatus(checkList);
    }
 
    @Override
    public int modifyDeliverNum(List<Map<StringString>> checkList) {
        return orderDAO.modifyDeliverNum(checkList);
    }
 
}
 

 

 

6. OrderDAO.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.w2.order;
 
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
 
import com.w2.util.Search;
 
@Repository
public class OrderDAO {
    @Autowired
    private SqlSessionTemplate sqlSessionTemplate;
 
    public List<HashMap<String, Object>> getOrderList(Search search) {
        return sqlSessionTemplate.selectList("OrderDAO.getOrderList", search);
    }
 
    public int getOrderListCnt(Search search) {
        return sqlSessionTemplate.selectOne("OrderDAO.getOrderListCnt", search);
    }
 
    public int modifyOrderStatus(List<Map<StringString>> checkList) {
        System.err.println("DAO modifyOrderStatus");
        int result = -1;
        for(Map<StringString> order : checkList) {
            result = sqlSessionTemplate.update("OrderDAO.modifyOrderStatus", order);
        }
        return result;
    }
 
    public int modifyDeliverNum(List<Map<StringString>> checkList) {
        System.err.println("DAO modifyDeliverNum");
        int result = -1;
        for(Map<StringString> order : checkList) {
            result = sqlSessionTemplate.update("OrderDAO.modifyDeliverNum", order);
        }
        return result;
    }
 
}
 

 

 

7. mybatis-config.xml 파일 수정

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?xml version="1.0" encoding="UTF-8"?>
 
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" 
                "http://mybatis.org/dtd/mybatis-3-config.dtd">
 
<configuration>
    
    <typeAliases>
        <!-- typeAlias
                - 매핑파일에서 사용하는 type을 지정
                - 애플리케이션에서 SQL 문으로 값을 전달합니다
                - SQL 문 실행 시 반환되는 레코드를 저장하는 용도로 사용하기 위한 빈을 생성합니다.-->
                
        <typeAlias type="com.w2.admin.AdminVO" alias="admin"/>
        <typeAlias type="com.w2.client.ClientVO" alias="client"/>
        <typeAlias type="com.w2.board.NoticeVO" alias="notice"/>
        <typeAlias type="com.w2.product.ProductVO" alias="product"/>
        <typeAlias type="com.w2.product.ProductPriceVO" alias="productPrice"/>
        <typeAlias type="com.w2.product.OptionVO" alias="option"/>
        <typeAlias type="com.w2.image.ImageVO" alias="image"/>
        <typeAlias type="com.w2.order.OrderVO" alias="order"/>
    </typeAliases>
 
    <!-- SQL 작성문을 지정하여 mapper 파일 경로 알려주는 역할입니다. -->
    <mappers>
        <mapper resource="mappings/admin-mapping.xml"/>
        <mapper resource="mappings/notice-mapping.xml"/>
        <mapper resource="mappings/client-mapping.xml"/>
        <mapper resource="mappings/product-mapping.xml"/>
        <mapper resource="mappings/order-mapping.xml"/>
    </mappers>
</configuration>

 

 

8. order-mapping.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
                 
<mapper namespace="OrderDAO">
    <select id="getOrderList" resultType="hashMap">
        SELECT od.orderId, od.orderDate, od.clientId, 
            cl.clientName, cl.clientNum, di.deliverNum,
            ad.addressName, ad.addressNum, ad.addressPostNum, ad.address1, ad.address2, ad.addressMemo, SUBSTRING(oi.optionId, 1,9) as '옵션값',
            pr.productName, pr.productId, SUBSTRING(oi.optionId, 10, LENGTH(oi.optionId)) as optionName, oi.orderProCnt, oi.orderTotal, oi.orderStatus, 
            od.orderPrice, od.usedPoint, ci.couponPrice, pi.paymentMethod, pi.paymentDate, pi.paymentStatus
        FROM orders od
        LEFT JOIN orders_info oi ON (od.orderId=oi.orderId)
        LEFT JOIN client cl ON (od.clientId=cl.clientId)
        LEFT JOIN client_address ad ON (od.clientId=ad.clientId AND od.addressId=ad.addressId)
        LEFT JOIN payment_info pi ON (od.orderId=pi.orderId)
        LEFT JOIN deliver_info di ON (od.orderId=di.orderId)
        LEFT JOIN coupon_info ci ON (od.couponId=ci.couponId)
        LEFT JOIN product pr ON (SUBSTRING(oi.optionId, 1, 9)=pr.productId)
        <trim prefix="WHERE" prefixOverrides="AND|OR">
            <if test="keyword != null and keyword != ''">
                <if test="searchType == 'orderId'">
                    AND od.orderId like CONCAT('%', #{keyword}, '%')
                </if>
                <if test="searchType == 'clientId'">
                    AND od.clientId like CONCAT('%', #{keyword}, '%')
                </if>
            </if>
        </trim>
        ORDER BY od.orderDate, od.orderId DESC
        LIMIT #{startList}, #{listSize};
    </select>
    
    <select id="getOrderListCnt" resultType="int">
        SELECT count(*)
        FROM orders_info oi
        LEFT JOIN orders od ON (oi.orderId=od.orderId)
        <trim prefix="WHERE" prefixOverrides="AND|OR">
            <if test="keyword != null and keyword != ''">
                <if test="searchType == 'orderId'">
                    AND od.orderId like CONCAT('%', #{keyword}, '%')
                </if>
                <if test="searchType == 'clientId'">
                    AND od.clientId like CONCAT('%', #{keyword}, '%')
                </if>
            </if>
        </trim>
    </select>
    
    <update id="modifyOrderStatus" parameterType="map">
        UPDATE orders_info SET orderStatus=#{ changeValue }
        WHERE orderId=#{ orderId } AND optionId LIKE CONCAT(#{ productId }, '%')
    </update>
    
    <update id="modifyDeliverNum" parameterType="map">
        UPDATE deliver_info SET deliverNum=#{ changeValue }
        WHERE orderId=#{ orderId }
    </update>
</mapper>

 

 

9. orderList.jsp 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
<%@ 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="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>WeatherWear 관리자</title>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<!-- Font Awesome -->
<link href="resources/admin/AdminLTE/plugins/fontawesome-free/css/all.min.css" rel="stylesheet">
<!-- Theme style -->
<link href="resources/admin/AdminLTE/dist/css/adminlte.min.css" rel="stylesheet">
<style>
.orderStatus_select {width: 130px !important;}
.option_select {width: 100px !important;}
.deliveryNum_select {display: none;}
</style>
</head>
<body class="hold-transition sidebar-collapse layout-top-nav">
    <div class="wrapper">
        <%@ include file="../header.jsp" %>
    
        <div class="content-header">
            <section class="content-header">
                <div class="container">
                    <div class="row mb-2">
                        <div class="col-sm-6">
                            <h1>주문 목록</h1>
                        </div>
                        <div class="col-sm-6">
                            <ol class="breadcrumb float-sm-right">
                                <li class="breadcrumb-item"><a href="main.mdo">메인</a></li>
                                <li class="breadcrumb-item active">주문 목록</li>
                            </ol>
                        </div>
                    </div>
                </div>
            </section>
            <section class="content">
                <div class="container">
                    <div class="row">
                        <div class="col-12">
                            <div class="card">
                                <div class="card-header">
                                    <div class="card-title">
                                        <div class="orderby_btn">
                            <!-- c:if 값 변경하기(정렬 타입에 따라 체크되도록) -->
                                            <button type="button" class="btn btn-sm btn-outline-light <c:if test='${pagination.getListSize() == 5}'>active</c:if>">최신순</button>
                                            <button type="button" class="btn btn-sm btn-outline-light <c:if test='${pagination.getListSize() == 10}'>active</c:if>">아이디순</button>
                                            <button type="button" class="btn btn-sm btn-outline-light <c:if test='${pagination.getListSize() == 30}'>active</c:if>">주문상태순</button>
                                            <button class="btn btn-sm btn-secondary buttons-pdf buttons-html5" tabindex="0" aria-controls="example1" type="button">
                                                <span>PDF로 저장</span>
                                            </button>
                                        </div>
                                    </div>
                                    <div class="card-tools">
                                        <!-- Search -->
                                        <div class="input-group input-group-sm">
                                            <select id="orderType" class="form-control">
                                                <option value="orderId">주문번호</option>
                                                <option value="clientId">아이디</option>
                                            </select>
                                            <input type="text" id="keyword" class="form-control float-right" placeholder="Search">
                                            <div class="input-group-append">
                                                <button type="button" class="btn btn-default" id="btnSearch">
                                                    <i class="fas fa-search"></i>
                                                </button>
                                            </div>
                                        </div>
                                        <!-- End Search -->
                                    </div>
                                </div>
                                <div class="card-header">
                                    <div class="card-title">
                                        <div class="orderby_btn">
                                            <div class="input-group input-group-sm">
                                                <select class="form-control option_select" onchange="change(this)" id="modifyType">
                                                    <option value="orderStatus">주문상태</option>
                                                    <option value="deliverNum">송장번호</option>
                                                </select>&nbsp;&nbsp;&nbsp;
                                                <div class="input-group-sm orderStatus_select">
                                                    <select class="form-control orderStatus_select" id="orderStatus_value">
                                                        <option value="상품준비중">상품준비중</option>
                                                        <option value="배송준비중">배송준비중</option>
                                                        <option value="배송보류">배송보류</option>
                                                        <option value="배송대기">배송대기</option>
                                                        <option value="배송중">배송중</option>
                                                        <option value="배송완료">배송완료</option>
                                                        <option value="교환중">교환중</option>
                                                        <option value="환불중">환불중</option>
                                                        <option value="교환완료">교환완료</option>
                                                        <option value="환불완료">환불완료</option>
                                                    </select>
                                                </div>
                                                <div class="input-group-sm deliveryNum_select">
                                                    <input type="text" name="deliverNum_value" class="form-control float-right" placeholder="송장번호">
                                                </div>
                                                <div class="input-group-append">
                                                    <button id="add-new-event" type="button" class="btn btn-sm btn-outline-primary" onclick="modify()">수정하기</button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="card-body table-responsive p-0">
                                    <form id="listForm" name="clientForm" method="post">
                                        <table class="table table-hover text-nowrap" style="table-layout: fixed;">
                                            <colgroup>
                                                <col width="80px"/><!-- # -->
                                                <col width="280px"/><!-- 주문번호 -->
                                                <col width="150px"/><!-- 주문상태 -->
                                                <col width="200px"/><!-- 주문일자 -->
                                                <col width="100px"/><!-- 회원번호 -->
                                                <col width="100px"/><!-- 구매자이름 -->
                                                <col width="150px"/><!-- 구매자연락처 -->
                                                <col width="150px"/><!-- 주문상품 -->
                                                <col width="150px"/><!-- 주문옵션 -->
                                                <col width="80px"/><!-- 주문수량 -->
                                                <col width="100px"/><!-- 상품금액 -->
                                                <col width="150px"/><!-- 수신인 이름 -->
                                                <col width="150px"/><!-- 수신인 연락처 -->
                                                <col width="250px"/><!-- 송장번호 -->
                                                <col width="100px"/><!-- 우편번호 -->
                                                <col width="150px"/><!-- 기본주소 -->
                                                <col width="150px"/><!-- 상세주소 -->
                                                <col width="250px"/><!-- 배송메모 -->
                                                <col width="100px"/><!-- 결제금액 -->
                                                <col width="100px"/><!-- 결제수단 -->
                                                <col width="100px"/><!-- 결제상태 -->
                                                <col width="200px"/><!-- 결제일자 -->
                                            </colgroup>
                                            <thead>
                                                <tr>
                                                    <th><button type="button" class="btn btn-sm btn-outline-primary checkAll" id="checkAll">전체선택</button></th>
                                                    <th>주문번호</th>
                                                    <th>주문상태</th>
                                                    <th>주문일자</th>
                                                    <th>회원번호</th>
                                                    <th>구매자 이름</th>
                                                    <th>구매자 연락처</th>
                                                    <th>주문상품</th>
                                                    <th>주문옵션</th>
                                                    <th>주문수량</th>
                                                    <th>상품금액</th>
                                                    <th>수신인 이름</th>
                                                    <th>수신인 연락처</th>
                                                    <th>송장번호</th>
                                                    <th>우편번호</th>
                                                    <th>기본주소</th>
                                                    <th>상세주소</th>
                                                    <th>배송메모</th>
                                                    <th>결제금액</th>
                                                    <th>결제수단</th>
                                                    <th>결제상태</th>
                                                    <th>결제일자</th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                                <c:forEach var="item" items="${orderList}" varStatus="status">
                                                    <tr>
                                                        <td class="checklist"><input type="checkbox" value="${item.orderId}_${item.productId}" class="check"></td>
                                                        <td>${item.orderId}</td>
                                                        <td>${item.orderStatus}</td>
                                                        <td>${item.orderDate}</td>
                                                        <td>${item.clientId}</td>
                                                        <td>${item.clientName}</td>
                                                        <td>${item.clientNum}</td>
                                                        <td>${item.productName}</td>
                                                        <td>${item.optionName}</td>
                                                        <td>${item.orderProCnt}</td>
                                                        <td><fmt:formatNumber value="${item.orderTotal}" pattern="###,###"/></td>
                                                        <td>${item.addressName}</td>
                                                        <td>${item.addressNum}</td>
                                                        <td><input type="text" value="${item.deliverNum}"></td>
                                                        <td>${item.addressPostNum}</td>
                                                        <td>${item.address1}</td>
                                                        <td>${item.address2}</td>
                                                        <td>${item.addressMemo}</td>
                                                        <td><fmt:formatNumber value="${item.orderPrice - item.usedPoint - ci.couponPrice}" pattern="###,###"/></td>
                                                        <td>${item.paymentMethod}</td>
                                                        <td>${item.paymentStatus}</td>
                                                        <td>${item.paymentDate}</td>
                                                    </tr>
                                                </c:forEach>
                                            </tbody>
                                        </table>
                                    </form>
                                </div>
                                <!-- pagination -->
                                <div class="card-footer">        
                                    <div class="card-title input-group-sm">
                                        <select name="searchType" class="form-control" id="listSize" onchange="page(1)">
                                            <option value="5" <c:if test="${pagination.getListSize() == 5}">selected="selected"</c:if>>5개</option>
                                            <option value="10" <c:if test="${pagination.getListSize() == 10}">selected="selected"</c:if>>10개</option>
                                            <option value="15" <c:if test="${pagination.getListSize() == 15}">selected="selected"</c:if>>15개</option>
                                            <option value="30" <c:if test="${pagination.getListSize() == 30}">selected="selected"</c:if>>30개</option>
                                        </select>
                                    </div>
                                    <ul class="pagination pagination-sm m-0 float-right">
                                        <c:if test="${pagination.prev}">
                                            <li class="page-item">
                                                <a class="page-link" href="#" onclick="fn_prev('${pagination.page}', '${pagination.range}', '${pagination.rangeSize}', '${pagination.listSize}', '${search.searchType}', '${search.keyword}')">&laquo;</a>
                                            </li>
                                        </c:if>
                                        <c:forEach begin="${pagination.startPage}" end="${pagination.endPage}" var="pageId">
                                            <li class="page-item <c:out value="${pagination.page == pageId ? 'active':''}"/>">
                                                <a class="page-link" href="#" onclick="fn_pagination('${pageId}', '${pagination.range}', '${pagination.rangeSize}', '${pagination.listSize}', '${search.searchType}', '${search.keyword}')">${pageId}</a>
                                            </li>
                                        </c:forEach>                                        
                                        <c:if test="${pagination.next}">
                                            <li class="page-item">
                                                <a class="page-link" href="#" onclick="fn_next('${pagination.page}', '${pagination.range}', '${pagination.rangeSize}', '${pagination.listSize}', '${search.searchType}', '${search.keyword}')">&raquo;</a>
                                            </li>
                                        </c:if>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </section>
        </div>        
        <%@ include file="../footer.jsp" %>
    </div>
<!-- jQuery -->
<script src="resources/admin/AdminLTE/plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="resources/admin/AdminLTE/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
 
<script src="resources/util/js/paging.js"></script>
<script src="resources/util/js/checkbox.js"></script>
<script src="resources/admin/js/modify_orderList.js"></script>
</body>
</html>

 

 

>> 실행

 

>> 기본 값은 주문 상태로 주문상태/송장번호를 입력할 수 있다.

 

>>> 값이 입력되지 않은 상태로 수정하기 버튼 클릭시

 

 

 

>>> 주문 관리페이지도 마찬가지로 추후 orderby를 적용할 예정이며 ADMINLTE3 에서 pdf 로 저장하는 기능이 있어 사용해보려고 한다. 엑셀파일로 저장하는 기능도 적용시켜볼 예정이다.

 

reProject_30_정렬기능 추가

reProject_29_관리자 주문 관리 페이지 2024.01.19 주문은 상세 페이지를 따로 작성하지 않고 주문 목록에서 간단한 수정을 할 수 있게 구현하려고 한다. 기존의 테이블은 orders에 orderStatus가 있어 주문

hyeonga493.tistory.com

 

반응형