|
|
@@ -61,6 +61,7 @@ public class TsfOrderService {
|
|
|
*/
|
|
|
public Collection<GagaMap> getOrderListForMypage(Order order) {
|
|
|
Collection<GagaMap> mapList = new ArrayList<>();
|
|
|
+ Collection<GagaMap> ordDtlStatList = new ArrayList<>();
|
|
|
List<Order> orderList = new ArrayList<>();
|
|
|
int ordNo = 0;
|
|
|
String ordDt = "";
|
|
|
@@ -77,21 +78,42 @@ public class TsfOrderService {
|
|
|
int rowspan = 0;
|
|
|
|
|
|
for (Order tmpOrder : orderDao.getOrderListForMypage(order)) {
|
|
|
- // 주문번호, 배송구분(총알배송, 일반배송, 업체직배송), 배송정책 변경
|
|
|
- if (ordNo != tmpOrder.getOrdNo() || !selfGoodsYn.equals(tmpOrder.getSelfGoodsYn()) || ("N".equals(tmpOrder.getSelfGoodsYn()) && !delvFeeCd.equals(tmpOrder.getDelvFeeCd())) || !shotDelvYn.equals(tmpOrder.getShotDelvYn())) {
|
|
|
+ // 주문번호, 배송구분(총알배송, 일반배송, 업체직배송), 배송정책, 선물하기 변경
|
|
|
+ if (ordNo != tmpOrder.getOrdNo()
|
|
|
+ || !selfGoodsYn.equals(tmpOrder.getSelfGoodsYn())
|
|
|
+ || ("N".equals(tmpOrder.getSelfGoodsYn()) && !delvFeeCd.equals(tmpOrder.getDelvFeeCd()))
|
|
|
+ || !shotDelvYn.equals(tmpOrder.getShotDelvYn())
|
|
|
+ || !giftPackYn.equals(tmpOrder.getGiftPackYn())) {
|
|
|
// 데이터 설정
|
|
|
if (index > 0) {
|
|
|
+ // 주문내역 목록 설정
|
|
|
+ GagaMap ordDtlStatMap = new GagaMap();
|
|
|
+ ordDtlStatMap.set("orderList", orderList);
|
|
|
+ ordDtlStatMap.set("ordDtlStat", orderList.iterator().next().getOrdDtlStat());
|
|
|
+ ordDtlStatMap.set("shipCompNm", shipCompNm);
|
|
|
+ ordDtlStatMap.set("invoiceNo", invoiceNo);
|
|
|
+ ordDtlStatMap.set("reviewSq", reviewSq);
|
|
|
+ ordDtlStatMap.set("recipBaseAddr", orderList.iterator().next().getRecipBaseAddr());
|
|
|
+ ordDtlStatMap.set("giftLimitDay", orderList.iterator().next().getGiftLimitDay());
|
|
|
+ ordDtlStatMap.set("recipNm", orderList.iterator().next().getRecipNm());
|
|
|
+ ordDtlStatMap.set("giftLimitDt", orderList.iterator().next().getGiftLimitDt());
|
|
|
+ ordDtlStatMap.set("purchaseConfirmDay", orderList.iterator().next().getPurchaseConfirmDay());
|
|
|
+ ordDtlStatMap.set("ordDtlStatLastBanner", "Y");
|
|
|
+ ordDtlStatMap.set("ordDtlStatBanner", "Y");
|
|
|
+ ordDtlStatList.add(ordDtlStatMap);
|
|
|
+
|
|
|
GagaMap map = new GagaMap();
|
|
|
map.set("ordNo", ordNo); // 주문번호
|
|
|
map.set("ordDt", ordDt); // 주문일시
|
|
|
map.set("shotDelvYn", shotDelvYn); // 총알배송여부
|
|
|
map.set("selfGoodsYn", selfGoodsYn); // 자사여부
|
|
|
- map.set("ordDtlStat", ordDtlStat); // 주문상태코드
|
|
|
- map.set("shipCompNm", shipCompNm); // 배송업체명
|
|
|
- map.set("invoiceNo", invoiceNo); // 송장번호
|
|
|
+ // map.set("ordDtlStat", ordDtlStat); // 주문상태코드
|
|
|
+ // map.set("shipCompNm", shipCompNm); // 배송업체명
|
|
|
+ // map.set("invoiceNo", invoiceNo); // 송장번호
|
|
|
map.set("giftPackYn", giftPackYn); // 선물하기여부
|
|
|
- map.set("reviewSq", reviewSq); // 리뷰일련번호
|
|
|
- map.set("orderList", setOrderListParameter(orderList, rowspan, ordDtlStatCnt, "Y")); // 주문내역
|
|
|
+ // map.set("reviewSq", reviewSq); // 리뷰일련번호
|
|
|
+ map.set("ordDtlStatList", ordDtlStatList); // 주문내역
|
|
|
+ // map.set("orderList", setOrderListParameter(orderList, rowspan, ordDtlStatCnt, "Y")); // 주문내역
|
|
|
mapList.add(map);
|
|
|
}
|
|
|
|
|
|
@@ -107,13 +129,30 @@ public class TsfOrderService {
|
|
|
reviewSq = tmpOrder.getReviewSq();
|
|
|
giftPackYn = tmpOrder.getGiftPackYn();
|
|
|
orderList = new ArrayList<>();
|
|
|
+ ordDtlStatList = new ArrayList<>();
|
|
|
ordDtlStatCnt = 0;
|
|
|
rowspan = 0;
|
|
|
} else if (index > 0 && !ordDtlStat.equals(tmpOrder.getOrdDtlStat())) {
|
|
|
// 주문내역 데이터 추가
|
|
|
orderList = setOrderListParameter(orderList, rowspan, ordDtlStatCnt, "N");
|
|
|
|
|
|
+ // 주문내역 목록 설정
|
|
|
+ GagaMap ordDtlStatMap = new GagaMap();
|
|
|
+ ordDtlStatMap.set("orderList", orderList);
|
|
|
+ ordDtlStatMap.set("ordDtlStat", orderList.iterator().next().getOrdDtlStat());
|
|
|
+ ordDtlStatMap.set("shipCompNm", shipCompNm);
|
|
|
+ ordDtlStatMap.set("invoiceNo", invoiceNo);
|
|
|
+ ordDtlStatMap.set("reviewSq", reviewSq);
|
|
|
+ ordDtlStatMap.set("purchaseConfirmDay", orderList.iterator().next().getPurchaseConfirmDay());
|
|
|
+ ordDtlStatMap.set("recipBaseAddr", orderList.iterator().next().getRecipBaseAddr());
|
|
|
+ ordDtlStatMap.set("giftLimitDay", orderList.iterator().next().getGiftLimitDay());
|
|
|
+ ordDtlStatMap.set("recipNm", orderList.iterator().next().getRecipNm());
|
|
|
+ ordDtlStatMap.set("giftLimitDt", orderList.iterator().next().getGiftLimitDt());
|
|
|
+ ordDtlStatMap.set("ordDtlStatBanner", "Y");
|
|
|
+ ordDtlStatList.add(ordDtlStatMap);
|
|
|
+
|
|
|
// 상태 별 배너 설정 후 초기화 진행
|
|
|
+ orderList = new ArrayList<>();
|
|
|
ordDtlStat = tmpOrder.getOrdDtlStat();
|
|
|
rowspan = 0;
|
|
|
}
|
|
|
@@ -129,17 +168,34 @@ public class TsfOrderService {
|
|
|
|
|
|
// 마지막 데이터 설정
|
|
|
if (ordNo > 0) {
|
|
|
+ // 주문내역 목록 설정
|
|
|
+ GagaMap ordDtlStatMap = new GagaMap();
|
|
|
+ ordDtlStatMap.set("orderList", orderList);
|
|
|
+ ordDtlStatMap.set("ordDtlStat", orderList.iterator().next().getOrdDtlStat());
|
|
|
+ ordDtlStatMap.set("shipCompNm", shipCompNm);
|
|
|
+ ordDtlStatMap.set("invoiceNo", invoiceNo);
|
|
|
+ ordDtlStatMap.set("reviewSq", reviewSq);
|
|
|
+ ordDtlStatMap.set("purchaseConfirmDay", orderList.iterator().next().getPurchaseConfirmDay());
|
|
|
+ ordDtlStatMap.set("recipBaseAddr", orderList.iterator().next().getRecipBaseAddr());
|
|
|
+ ordDtlStatMap.set("giftLimitDay", orderList.iterator().next().getGiftLimitDay());
|
|
|
+ ordDtlStatMap.set("recipNm", orderList.iterator().next().getRecipNm());
|
|
|
+ ordDtlStatMap.set("giftLimitDt", orderList.iterator().next().getGiftLimitDt());
|
|
|
+ ordDtlStatMap.set("ordDtlStatLastBanner", "Y");
|
|
|
+ ordDtlStatMap.set("ordDtlStatBanner", "Y");
|
|
|
+ ordDtlStatList.add(ordDtlStatMap);
|
|
|
+
|
|
|
GagaMap map = new GagaMap();
|
|
|
map.set("ordNo", ordNo);
|
|
|
map.set("ordDt", ordDt);
|
|
|
map.set("shotDelvYn", shotDelvYn);
|
|
|
map.set("selfGoodsYn", selfGoodsYn);
|
|
|
- map.set("ordDtlStat", ordDtlStat);
|
|
|
- map.set("shipCompNm", shipCompNm);
|
|
|
- map.set("invoiceNo", invoiceNo);
|
|
|
+ // map.set("ordDtlStat", ordDtlStat);
|
|
|
+ // map.set("shipCompNm", shipCompNm);
|
|
|
+ // map.set("invoiceNo", invoiceNo);
|
|
|
map.set("giftPackYn", giftPackYn);
|
|
|
- map.set("reviewSq", reviewSq);
|
|
|
- map.set("orderList", setOrderListParameter(orderList, rowspan, ordDtlStatCnt, "Y"));
|
|
|
+ // map.set("reviewSq", reviewSq);
|
|
|
+ map.set("ordDtlStatList", ordDtlStatList); // 주문내역
|
|
|
+ // map.set("orderList", setOrderListParameter(orderList, rowspan, ordDtlStatCnt, "Y"));
|
|
|
mapList.add(map);
|
|
|
}
|
|
|
|
|
|
@@ -156,18 +212,19 @@ public class TsfOrderService {
|
|
|
*/
|
|
|
private List<Order> setOrderListParameter(List<Order> orderList, int rowspan, int ordDtlStatCnt, String setLastBanner) {
|
|
|
// rowspan 설정
|
|
|
- for (int i = 0;i <= rowspan;i++) {
|
|
|
- if (i == rowspan) {
|
|
|
- orderList.get(ordDtlStatCnt - rowspan).setRowspan(rowspan);
|
|
|
- } else if (rowspan == 1){
|
|
|
- orderList.get(ordDtlStatCnt - rowspan).setRowspan(1);
|
|
|
- } else {
|
|
|
- orderList.get(ordDtlStatCnt - rowspan).setRowspan(0);
|
|
|
- }
|
|
|
- }
|
|
|
+ // for (int i = 0;i <= rowspan;i++) {
|
|
|
+ // if (i == rowspan) {
|
|
|
+ // orderList.get(ordDtlStatCnt - rowspan).setRowspan(rowspan);
|
|
|
+ // } else if (rowspan == 1){
|
|
|
+ // orderList.get(ordDtlStatCnt - rowspan).setRowspan(1);
|
|
|
+ // } else {
|
|
|
+ // orderList.get(ordDtlStatCnt - rowspan).setRowspan(0);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
// 주문상세상태값 별 배너 설정
|
|
|
if ("Y".equals(setLastBanner)) {
|
|
|
+ orderList.get(orderList.size() - 1).setOrdDtlStatLastBanner("Y");
|
|
|
orderList.get(orderList.size() - 1).setOrdDtlStatBanner("Y");
|
|
|
} else {
|
|
|
orderList.get(ordDtlStatCnt - 1).setOrdDtlStatBanner("Y");
|
|
|
@@ -177,24 +234,24 @@ public class TsfOrderService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 마이페이지 주문상태 별 주문수량 조회
|
|
|
+ * 주문 상태 별 수량 조회
|
|
|
*
|
|
|
* @param Order
|
|
|
- * @return int
|
|
|
+ * @return Order
|
|
|
* @author card007
|
|
|
* @since 2021. 02. 08
|
|
|
*/
|
|
|
- public int getOrderStatCount(Order order) { return orderDao.getOrderStatCount(order); }
|
|
|
+ public Order getOrderStatCount(Order order) { return orderDao.getOrderStatCount(order); }
|
|
|
|
|
|
/**
|
|
|
- * 마이페이지 주문변경상태 별 주문수량 조회
|
|
|
+ * 마이페이지 주문목록 페이징 처리 주문번호 조회
|
|
|
*
|
|
|
* @param Order
|
|
|
- * @return int
|
|
|
+ * @return Collection<Order>
|
|
|
* @author card007
|
|
|
- * @since 2021. 02. 08
|
|
|
+ * @since 2021. 02. 18
|
|
|
*/
|
|
|
- public int getOrderChangeStatCount(Order order) { return orderDao.getOrderChangeStatCount(order); }
|
|
|
+ public Collection<Order> getPagingOrdNoList(Order order) { return orderDao.getPagingOrdNoList(order); }
|
|
|
|
|
|
/**
|
|
|
* 마이페이지 주문상세 금액정보 조회
|