|
|
@@ -32,6 +32,7 @@ import com.style24.persistence.TscPageRequest;
|
|
|
import com.style24.persistence.domain.CardPromotion;
|
|
|
import com.style24.persistence.domain.CommonCode;
|
|
|
import com.style24.persistence.domain.Counsel;
|
|
|
+import com.style24.persistence.domain.Coupon;
|
|
|
import com.style24.persistence.domain.Goods;
|
|
|
import com.style24.persistence.domain.GoodsStock;
|
|
|
import com.style24.persistence.domain.Lookbook;
|
|
|
@@ -162,8 +163,28 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
|
|
|
int goodsReviewCnt = 0;
|
|
|
if (TscConstants.GoodsType.DEAL.value().equals(goods.getGoodsType())) { // 딜상품
|
|
|
+
|
|
|
+ Collection<Goods> goodsDealComposeList = goodsService.getGoodsDealComposeList(paramsGoods);
|
|
|
// 딜 구성상품 정보
|
|
|
- mav.addObject("goodsDealComposeList", goodsService.getGoodsDealComposeList(paramsGoods));
|
|
|
+ mav.addObject("goodsDealComposeList", goodsDealComposeList);
|
|
|
+
|
|
|
+ Collection<Coupon> goodsCouponList = new ArrayList<Coupon>();
|
|
|
+ // 상품쿠폰
|
|
|
+ if (goodsDealComposeList != null && !goodsDealComposeList.isEmpty()) {
|
|
|
+
|
|
|
+ ArrayList<String> arrGoodsList = new ArrayList<>();
|
|
|
+ for (Goods goodsCompose : goodsDealComposeList) {
|
|
|
+
|
|
|
+ arrGoodsList.add(goodsCompose.getCompsGoodsCd());
|
|
|
+ }
|
|
|
+
|
|
|
+ String[] arrGoodsCd = arrGoodsList.stream().toArray(String[]::new);
|
|
|
+
|
|
|
+ paramsGoods.setArrGoodsCd(arrGoodsCd);
|
|
|
+ paramsGoods.setMaxRownum(1);
|
|
|
+ goodsCouponList = couponService.getGoodsCouponList(paramsGoods);
|
|
|
+ }
|
|
|
+ mav.addObject("goodsCouponList", goodsCouponList);
|
|
|
|
|
|
// 딜용 상품평건수
|
|
|
Review review = new Review();
|
|
|
@@ -173,14 +194,14 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
|
|
|
// 딜용상품평건수
|
|
|
mav.addObject("goodsReviewCnt", goodsReviewCnt);
|
|
|
-
|
|
|
+
|
|
|
} else {
|
|
|
if (TscConstants.GoodsType.NORMAL.value().equals(goods.getGoodsType())) { // 일반상품
|
|
|
//if ("Y".equals(goods.getSelfGoodsYn())) { // 자사상품
|
|
|
- // 상품 옵션1(색상) 정보
|
|
|
- mav.addObject("goodsOption1List", goodsService.getGoodsOption1List(paramsGoods));
|
|
|
- // 상품 옵션2(사이즈) 정보
|
|
|
- mav.addObject("goodsOption2List", goodsService.getGoodsOption2List(paramsGoods));
|
|
|
+ // 상품 옵션1(색상) 정보
|
|
|
+ mav.addObject("goodsOption1List", goodsService.getGoodsOption1List(paramsGoods));
|
|
|
+ // 상품 옵션2(사이즈) 정보
|
|
|
+ mav.addObject("goodsOption2List", goodsService.getGoodsOption2List(paramsGoods));
|
|
|
// } else {
|
|
|
// mav.addObject("goodsOptionList", goodsService.getGoodsOptionList(paramsGoods));
|
|
|
// }
|
|
|
@@ -200,6 +221,14 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
// 상품쿠폰
|
|
|
paramsGoods.setMaxRownum(1);
|
|
|
mav.addObject("goodsCouponList", couponService.getGoodsCouponList(paramsGoods));
|
|
|
+
|
|
|
+ // 베스트 상품평
|
|
|
+ Review review = new Review();
|
|
|
+ review.setGoodsCd(goods.getGoodsCd());
|
|
|
+ review.setBestYn("Y");
|
|
|
+ review.setRownum(1);
|
|
|
+ review.setGoodsType(goods.getGoodsType());
|
|
|
+ mav.addObject("bestReviewList", reviewService.getReviewList(review));
|
|
|
}
|
|
|
|
|
|
// 상품 문의건수
|
|
|
@@ -209,23 +238,13 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
counsel.setGoodsType(goods.getGoodsType()); // 딜상품(G056_D)일 경우 구성상품의 상품평수
|
|
|
int goodsQnaCnt = counselService.getGoodsQnaTotalCount(counsel);
|
|
|
mav.addObject("goodsQnaCnt", goodsQnaCnt);
|
|
|
-
|
|
|
-
|
|
|
-//
|
|
|
+
|
|
|
// // 상품포인트사용방법
|
|
|
// mav.addObject("goodsPointMothod", envsetService.getPointMothod(TscConstants.Site.STYLE24.value())); // A:정액, R:정율
|
|
|
// 상품평노출여부
|
|
|
//mav.addObject("reviewDisplayYn", envsetService.getGoodsReviewDisplayYn(TscConstants.Site.STYLE24.value()));
|
|
|
mav.addObject("reviewDisplayYn", "Y");
|
|
|
|
|
|
- // 베스트 상품평
|
|
|
- Review review = new Review();
|
|
|
- review.setGoodsCd(goods.getGoodsCd());
|
|
|
- review.setBestYn("Y");
|
|
|
- review.setRownum(1);
|
|
|
- review.setGoodsType(goods.getGoodsType());
|
|
|
- mav.addObject("bestReviewList", reviewService.getReviewList(review));
|
|
|
-
|
|
|
// 카드 혜택안내
|
|
|
CardPromotion cardPromotion = new CardPromotion();
|
|
|
cardPromotion.setRownum(1); // 혜택유형별로 1건씩
|
|
|
@@ -240,8 +259,6 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
// SSL Server
|
|
|
boolean isSslServer = Boolean.parseBoolean(hasSsl);
|
|
|
//log.info("isSslServer: [{}]", isSslServer);
|
|
|
-
|
|
|
- //기존쿠키 가져오기
|
|
|
setTodayGoodsCd(paramsGoods);
|
|
|
|
|
|
mav.addObject("params", paramsGoods);
|
|
|
@@ -385,7 +402,7 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
log.info("[getAjaxGoodsSetStockQty] stockQty = {}", stockQty);
|
|
|
return String.valueOf(stockQty);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품상세 - 상품 QNA LIST 레이어
|
|
|
* @return
|
|
|
@@ -479,21 +496,30 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
* @author eskim
|
|
|
* @since 2021. 3. 8
|
|
|
*/
|
|
|
- @PostMapping("/coupon/layer/{goodsCd}")
|
|
|
- public ModelAndView goodsCouponForm(@PathVariable String goodsCd) {
|
|
|
+ @PostMapping("/coupon/layer")
|
|
|
+ public ModelAndView goodsCouponForm(Goods goods) {
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
// 상품관련 기본값 설정(회원 등급, 앱, PC/모바일 등)
|
|
|
- Goods paramsGoods = new Goods();
|
|
|
- paramsGoods.setGoodsCd(goodsCd);
|
|
|
- setGoods(paramsGoods);
|
|
|
- // Goods goods = goodsService.getGoodsInfo(paramsGoods);
|
|
|
+ setGoods(goods);
|
|
|
+
|
|
|
+ if (!StringUtils.isBlank(goods.getGoodsType()) && TscConstants.GoodsType.DEAL.value().equals(goods.getGoodsType())) {
|
|
|
+ Collection<Goods> goodsDealComposeList = goodsService.getGoodsDealComposeList(goods);
|
|
|
+ // 상품쿠폰
|
|
|
+ if (goodsDealComposeList != null && !goodsDealComposeList.isEmpty()) {
|
|
|
|
|
|
+ ArrayList<String> arrGoodsList = new ArrayList<>();
|
|
|
+ for (Goods goodsCompose : goodsDealComposeList) {
|
|
|
+ arrGoodsList.add(goodsCompose.getCompsGoodsCd());
|
|
|
+ }
|
|
|
+
|
|
|
+ String[] arrGoodsCd = arrGoodsList.stream().toArray(String[]::new);
|
|
|
+ goods.setArrGoodsCd(arrGoodsCd);
|
|
|
+ }
|
|
|
+ }
|
|
|
// 상품쿠폰정보
|
|
|
- mav.addObject("goodsCouponList", couponService.getGoodsCouponList(paramsGoods));
|
|
|
+ mav.addObject("goodsCouponList", couponService.getGoodsCouponList(goods));
|
|
|
// 상품 기본정보
|
|
|
- mav.addObject("params", paramsGoods);
|
|
|
-
|
|
|
- //mav.addObject("goodsInfo", goods);
|
|
|
+ mav.addObject("params", goods);
|
|
|
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsCouponForm"));
|
|
|
return mav;
|
|
|
@@ -946,11 +972,11 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
public GagaMap getGoodsOption1List(@RequestBody Goods goods) {
|
|
|
|
|
|
GagaMap result = new GagaMap();
|
|
|
- result.set("dataList", goodsService.getGoodsOption1List(goods));
|
|
|
+ result.set("dataList", goodsService.getGoodsOption1List(goods));
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품 옵션2 목록
|
|
|
* @param goods
|
|
|
@@ -963,7 +989,7 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
public GagaMap getGoodsOption2List(@RequestBody Goods goods) {
|
|
|
|
|
|
GagaMap result = new GagaMap();
|
|
|
- result.set("dataList", goodsService.getGoodsOption2List(goods));
|
|
|
+ result.set("dataList", goodsService.getGoodsOption2List(goods));
|
|
|
|
|
|
return result;
|
|
|
}
|
|
|
@@ -1000,7 +1026,7 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
}
|
|
|
return recentlyGoodsList;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 딜상품상세 - 구성상품 상세정보 레이어
|
|
|
* @return
|
|
|
@@ -1016,23 +1042,25 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
setGoods(paramsGoods);
|
|
|
// 1. 딜상품코드 적용
|
|
|
mav.addObject("goodsDealComposeList", goodsService.getGoodsDealComposeList(paramsGoods));
|
|
|
-
|
|
|
+
|
|
|
// 2.구상상품코드 적용
|
|
|
paramsGoods.setGoodsCd(compsGoodsCd);
|
|
|
+ paramsGoods.setAdminYn("Y"); // 딜상세 레이어는 상품상태가 승인완료가 아니더라도 보이게 처리
|
|
|
Goods goods = goodsService.getGoodsInfo(paramsGoods);
|
|
|
// 상품 기본정보
|
|
|
mav.addObject("goodsInfo", goods);
|
|
|
-
|
|
|
+
|
|
|
GagaMap params = new GagaMap();
|
|
|
params.set("goodsCd", goodsCd);
|
|
|
params.set("compsGoodsCd", compsGoodsCd);
|
|
|
-
|
|
|
+ params.set("adminYn", "Y");
|
|
|
+
|
|
|
mav.addObject("params", params);
|
|
|
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsDealListForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 딜상품상세 - ajax 구성상품 상세정보
|
|
|
* @return
|
|
|
@@ -1044,7 +1072,7 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
// 상품관련 기본값 설정(회원 등급, 앱, PC/모바일 등)
|
|
|
setGoods(paramsGoods);
|
|
|
-
|
|
|
+
|
|
|
Goods goods = goodsService.getGoodsInfo(paramsGoods);
|
|
|
// 상품 상세
|
|
|
goods = goodsService.getGoodsDesc(goods);
|
|
|
@@ -1076,7 +1104,7 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsDealDescForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품상세 - ajax 구성상품 배송정보
|
|
|
* @return
|
|
|
@@ -1088,7 +1116,7 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
// 상품관련 기본값 설정(회원 등급, 앱, PC/모바일 등)
|
|
|
setGoods(paramsGoods);
|
|
|
-
|
|
|
+
|
|
|
Goods goods = goodsService.getGoodsInfo(paramsGoods);
|
|
|
|
|
|
// 배송업체명, 반품비, 교환비, 주소
|
|
|
@@ -1097,11 +1125,10 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
// 상품 기본정보
|
|
|
mav.addObject("goodsInfo", goods);
|
|
|
|
|
|
-
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsDetailDeliveryForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품상세 - ajax 구성상품 문의정보
|
|
|
* @return
|
|
|
@@ -1113,19 +1140,19 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
// 상품관련 기본값 설정(회원 등급, 앱, PC/모바일 등)
|
|
|
setGoods(paramsGoods);
|
|
|
-
|
|
|
+
|
|
|
// Goods goods = goodsService.getGoodsInfo(paramsGoods);
|
|
|
//
|
|
|
// // 상품 기본정보
|
|
|
// mav.addObject("goodsInfo", goods);
|
|
|
-
|
|
|
+
|
|
|
// 상품 기본정보
|
|
|
mav.addObject("goodsInfo", paramsGoods);
|
|
|
-
|
|
|
+
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsDetailQnaForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품상세 - ajax 구성상품 상품평정보
|
|
|
* @return
|
|
|
@@ -1194,7 +1221,7 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
|
|
|
// 상품평 몸무게
|
|
|
mav.addObject("reviewWeightList", reviewWeightList);
|
|
|
-
|
|
|
+
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsDetailReviewForm"));
|
|
|
return mav;
|
|
|
}
|