|
|
@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
|
+import com.style24.core.support.env.TscConstants;
|
|
|
import com.style24.front.biz.dao.TsfOrderDao;
|
|
|
import com.style24.persistence.domain.Order;
|
|
|
|
|
|
@@ -61,8 +62,8 @@ public class TsfOrderService {
|
|
|
*/
|
|
|
public Collection<GagaMap> getOrderListForMypage(Order order) {
|
|
|
Collection<GagaMap> mapList = new ArrayList<>();
|
|
|
- Collection<GagaMap> ordDtlStatList = new ArrayList<>();
|
|
|
- List<Order> orderList = new ArrayList<>();
|
|
|
+ Collection<GagaMap> orderList = new ArrayList<>();
|
|
|
+ List<Order> ordDtlList = new ArrayList<>();
|
|
|
int ordNo = 0;
|
|
|
String ordDt = "";
|
|
|
String delvFeeCd = "";
|
|
|
@@ -72,48 +73,42 @@ public class TsfOrderService {
|
|
|
String shipCompNm = "";
|
|
|
String invoiceNo = "";
|
|
|
String giftPackYn = "";
|
|
|
+ String reviewYn = "";
|
|
|
int reviewSq = 0;
|
|
|
int index = 0;
|
|
|
- int ordDtlStatCnt = 0;
|
|
|
- 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())
|
|
|
- || !giftPackYn.equals(tmpOrder.getGiftPackYn())) {
|
|
|
+ if (ordNo != tmpOrder.getOrdNo() // 주문번호 변경
|
|
|
+ || !selfGoodsYn.equals(tmpOrder.getSelfGoodsYn()) // 자사여부 변경
|
|
|
+ || ("N".equals(tmpOrder.getSelfGoodsYn())
|
|
|
+ && !delvFeeCd.equals(tmpOrder.getDelvFeeCd())) // 입점업체 배송정책코드 변경
|
|
|
+ || !shotDelvYn.equals(tmpOrder.getShotDelvYn())) { // 총알배송여부 변경
|
|
|
+
|
|
|
// 데이터 설정
|
|
|
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 ordDtlMap = new GagaMap();
|
|
|
+ ordDtlMap.set("ordDtlList", ordDtlList);
|
|
|
+ ordDtlMap.set("ordDtlStat", ordDtlList.iterator().next().getOrdDtlStat());
|
|
|
+ ordDtlMap.set("shipCompNm", shipCompNm);
|
|
|
+ ordDtlMap.set("invoiceNo", invoiceNo);
|
|
|
+ ordDtlMap.set("reviewSq", reviewSq);
|
|
|
+ ordDtlMap.set("recipBaseAddr", ordDtlList.iterator().next().getRecipBaseAddr());
|
|
|
+ ordDtlMap.set("giftLimitDay", ordDtlList.iterator().next().getGiftLimitDay());
|
|
|
+ ordDtlMap.set("recipNm", ordDtlList.iterator().next().getRecipNm());
|
|
|
+ ordDtlMap.set("giftLimitDt", ordDtlList.iterator().next().getGiftLimitDt());
|
|
|
+ ordDtlMap.set("purchaseConfirmDay", ordDtlList.iterator().next().getPurchaseConfirmDay());
|
|
|
+ ordDtlMap.set("ordDtlStatBanner", "Y");
|
|
|
+ orderList.add(ordDtlMap);
|
|
|
|
|
|
+ // 주문내역 목록 설정
|
|
|
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("giftPackYn", giftPackYn); // 선물하기여부
|
|
|
- // map.set("reviewSq", reviewSq); // 리뷰일련번호
|
|
|
- map.set("ordDtlStatList", ordDtlStatList); // 주문내역
|
|
|
- // map.set("orderList", setOrderListParameter(orderList, rowspan, ordDtlStatCnt, "Y")); // 주문내역
|
|
|
+ map.set("orderList", orderList); // 주문내역
|
|
|
mapList.add(map);
|
|
|
}
|
|
|
|
|
|
@@ -125,114 +120,78 @@ public class TsfOrderService {
|
|
|
shotDelvYn = tmpOrder.getShotDelvYn();
|
|
|
selfGoodsYn = tmpOrder.getSelfGoodsYn();
|
|
|
shipCompNm = tmpOrder.getShipCompNm();
|
|
|
- invoiceNo = tmpOrder.getInvoiceNo();
|
|
|
- reviewSq = tmpOrder.getReviewSq();
|
|
|
giftPackYn = tmpOrder.getGiftPackYn();
|
|
|
+ ordDtlList = new ArrayList<>();
|
|
|
orderList = new ArrayList<>();
|
|
|
- ordDtlStatList = new ArrayList<>();
|
|
|
- ordDtlStatCnt = 0;
|
|
|
- rowspan = 0;
|
|
|
- } else if (index > 0 && !ordDtlStat.equals(tmpOrder.getOrdDtlStat())) {
|
|
|
- // 주문내역 데이터 추가
|
|
|
- orderList = setOrderListParameter(orderList, rowspan, ordDtlStatCnt, "N");
|
|
|
+ } else if (index > 0
|
|
|
+ && (!ordDtlStat.equals(tmpOrder.getOrdDtlStat()) // 주문상세상태값 변경
|
|
|
+ || ("G013_70".equals(tmpOrder.getOrdDtlStat())
|
|
|
+ && !reviewYn.equals(tmpOrder.getReviewSq() > 0 ? "Y" : "N")) // 리뷰작성 변경
|
|
|
+ || (!invoiceNo.equals(tmpOrder.getInvoiceNo())))) { // 송장번호 변경
|
|
|
|
|
|
// 주문내역 목록 설정
|
|
|
- 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);
|
|
|
+ GagaMap ordDtlMap = new GagaMap();
|
|
|
+ ordDtlMap.set("ordDtlList", ordDtlList);
|
|
|
+ ordDtlMap.set("ordDtlStat", ordDtlList.iterator().next().getOrdDtlStat());
|
|
|
+ ordDtlMap.set("shipCompNm", shipCompNm);
|
|
|
+ ordDtlMap.set("invoiceNo", invoiceNo);
|
|
|
+ ordDtlMap.set("reviewSq", reviewSq);
|
|
|
+ ordDtlMap.set("purchaseConfirmDay", ordDtlList.iterator().next().getPurchaseConfirmDay());
|
|
|
+ ordDtlMap.set("recipBaseAddr", ordDtlList.iterator().next().getRecipBaseAddr());
|
|
|
+ ordDtlMap.set("giftLimitDay", ordDtlList.iterator().next().getGiftLimitDay());
|
|
|
+ ordDtlMap.set("recipNm", ordDtlList.iterator().next().getRecipNm());
|
|
|
+ ordDtlMap.set("giftLimitDt", ordDtlList.iterator().next().getGiftLimitDt());
|
|
|
+ ordDtlMap.set("ordDtlStatBanner", "Y");
|
|
|
+ orderList.add(ordDtlMap);
|
|
|
|
|
|
// 상태 별 배너 설정 후 초기화 진행
|
|
|
- orderList = new ArrayList<>();
|
|
|
+ ordDtlList = new ArrayList<>();
|
|
|
ordDtlStat = tmpOrder.getOrdDtlStat();
|
|
|
- rowspan = 0;
|
|
|
}
|
|
|
|
|
|
// 주문내역 설정
|
|
|
- orderList.add(tmpOrder);
|
|
|
+ ordDtlList.add(tmpOrder);
|
|
|
|
|
|
// 인덱스 처리
|
|
|
index++;
|
|
|
- ordDtlStatCnt++;
|
|
|
- rowspan++;
|
|
|
+
|
|
|
+ // 초기화 진행
|
|
|
+ invoiceNo = tmpOrder.getInvoiceNo();
|
|
|
+ reviewSq = tmpOrder.getReviewSq();
|
|
|
+ reviewYn = tmpOrder.getReviewSq() > 0 ? "Y" : "N";
|
|
|
}
|
|
|
|
|
|
// 마지막 데이터 설정
|
|
|
if (ordNo > 0) {
|
|
|
+ // 주문상세내역 목록 설정
|
|
|
+ GagaMap ordDtlMap = new GagaMap();
|
|
|
+ ordDtlMap.set("ordDtlList", ordDtlList);
|
|
|
+ ordDtlMap.set("ordDtlStat", ordDtlList.iterator().next().getOrdDtlStat());
|
|
|
+ ordDtlMap.set("shipCompNm", shipCompNm);
|
|
|
+ ordDtlMap.set("invoiceNo", invoiceNo);
|
|
|
+ ordDtlMap.set("reviewSq", reviewSq);
|
|
|
+ ordDtlMap.set("purchaseConfirmDay", ordDtlList.iterator().next().getPurchaseConfirmDay());
|
|
|
+ ordDtlMap.set("recipBaseAddr", ordDtlList.iterator().next().getRecipBaseAddr());
|
|
|
+ ordDtlMap.set("giftLimitDay", ordDtlList.iterator().next().getGiftLimitDay());
|
|
|
+ ordDtlMap.set("recipNm", ordDtlList.iterator().next().getRecipNm());
|
|
|
+ ordDtlMap.set("giftLimitDt", ordDtlList.iterator().next().getGiftLimitDt());
|
|
|
+ ordDtlMap.set("ordDtlStatBanner", "Y");
|
|
|
+ orderList.add(ordDtlMap);
|
|
|
+
|
|
|
// 주문내역 목록 설정
|
|
|
- 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("giftPackYn", giftPackYn);
|
|
|
- // map.set("reviewSq", reviewSq);
|
|
|
- map.set("ordDtlStatList", ordDtlStatList); // 주문내역
|
|
|
- // map.set("orderList", setOrderListParameter(orderList, rowspan, ordDtlStatCnt, "Y"));
|
|
|
+ map.set("orderList", orderList);
|
|
|
mapList.add(map);
|
|
|
}
|
|
|
|
|
|
return mapList;
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 마이페이지 주문내역 데이터 추가
|
|
|
- *
|
|
|
- * @param List<Order>
|
|
|
- * @return List<Order>
|
|
|
- * @author card007
|
|
|
- * @since 2021. 02. 08
|
|
|
- */
|
|
|
- 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);
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // 주문상세상태값 별 배너 설정
|
|
|
- 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");
|
|
|
- }
|
|
|
-
|
|
|
- return orderList;
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 주문 상태 별 수량 조회
|
|
|
*
|
|
|
@@ -271,7 +230,10 @@ public class TsfOrderService {
|
|
|
* @author card007
|
|
|
* @since 2021. 02. 16
|
|
|
*/
|
|
|
- public Order getPaymentInfoForMypage(Order order) { return orderDao.getPaymentInfoForMypage(order); }
|
|
|
+ public Order getPaymentInfoForMypage(Order order) {
|
|
|
+ order.setPayStat(TscConstants.PaymentStat.PAYMENT_COMPLETE.value());
|
|
|
+ return orderDao.getPaymentInfoForMypage(order);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 마이페이지 주문상세 배송지 정보 조회
|