|
|
@@ -67,9 +67,9 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private TscLookbookService coreLookbookService;
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
- private TsfCouponService couponService;
|
|
|
+ private TsfCouponService couponService;
|
|
|
|
|
|
@Value("${has-ssl}")
|
|
|
private String hasSsl;
|
|
|
@@ -225,7 +225,7 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsDetailForm"));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return mav;
|
|
|
}
|
|
|
|
|
|
@@ -242,9 +242,10 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
goods.setIsApp(TsfSession.getAttribute("isApp")); //앱여부 true
|
|
|
goods.setSiteCd(TscConstants.Site.STYLE24.value());
|
|
|
goods.setAfLinkCd(TsfSession.getAttribute("afLinkCd"));
|
|
|
-// goods.setSoldoutGoodsDisplayYn(envsetService.getSoldoutGoodsDisplayYn(TscConstants.Site.STYLE24.value())); // 품절상품노출여부
|
|
|
+ goods.setSoldoutGoodsDisplayYn(envsetService.getSoldoutGoodsDisplayYn(TscConstants.Site.STYLE24.value())); // 품절상품노출여부
|
|
|
goods.setPointUnit(envsetService.getPayUnit(TscConstants.Site.STYLE24.value())); // 10:원단위절사(int)
|
|
|
goods.setFloorUnit(envsetService.getPayUnit(TscConstants.Site.STYLE24.value()));
|
|
|
+
|
|
|
// 회원 구분
|
|
|
if (TsfSession.getInfo() != null) {
|
|
|
goods.setCustGb(TsfSession.getInfo().getCustGb());
|
|
|
@@ -413,17 +414,17 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
paramsGoods.setGoodsCd(goodsCd);
|
|
|
setGoods(paramsGoods);
|
|
|
Goods goods = goodsService.getGoodsInfo(paramsGoods);
|
|
|
-
|
|
|
+
|
|
|
// 배송업체명, 반품비, 교환비, 주소
|
|
|
mav.addObject("deliveryInfo", goodsService.getGoodsDeliveryInfo(goodsCd));
|
|
|
-
|
|
|
+
|
|
|
// 상품 기본정보
|
|
|
mav.addObject("goodsInfo", goods);
|
|
|
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsDeliveryForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품상세 - 쿠폰 레이어
|
|
|
* @return
|
|
|
@@ -443,7 +444,7 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
mav.addObject("goodsCouponList", couponService.getGoodsCouponList(paramsGoods));
|
|
|
// 상품 기본정보
|
|
|
mav.addObject("params", paramsGoods);
|
|
|
-
|
|
|
+
|
|
|
//mav.addObject("goodsInfo", goods);
|
|
|
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsCouponForm"));
|
|
|
@@ -464,14 +465,14 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
paramsGoods.setGoodsCd(goodsCd);
|
|
|
setGoods(paramsGoods);
|
|
|
Goods goods = goodsService.getGoodsInfo(paramsGoods);
|
|
|
-
|
|
|
+
|
|
|
// 상품 기본정보
|
|
|
mav.addObject("goodsInfo", goods);
|
|
|
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsShopBenefitForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품상세 - 사이즈 레이어
|
|
|
* @return
|
|
|
@@ -487,43 +488,43 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
paramsGoods.setColorCd(colorCd);
|
|
|
setGoods(paramsGoods);
|
|
|
Goods goods = goodsService.getGoodsInfo(paramsGoods);
|
|
|
-
|
|
|
+
|
|
|
// 상품 기본정보
|
|
|
mav.addObject("goodsInfo", goods);
|
|
|
-
|
|
|
+
|
|
|
// 실측 사이즈 정보 - 자사상품만
|
|
|
String typeCd = "";
|
|
|
String typeWith = "";
|
|
|
- Collection<Measurement> measurementList= new ArrayList<Measurement>();
|
|
|
+ Collection<Measurement> measurementList = new ArrayList<Measurement>();
|
|
|
if ("Y".equals(goods.getSelfGoodsYn())) {
|
|
|
paramsGoods.setOptCd1(colorCd);
|
|
|
measurementList = goodsService.getMeasurementList(paramsGoods);
|
|
|
if (measurementList != null && !measurementList.isEmpty()) {
|
|
|
- typeCd = measurementList.iterator().next().getTypecd();
|
|
|
+ typeCd = measurementList.iterator().next().getTypecd();
|
|
|
if ("하의".equals(typeCd)) {
|
|
|
- typeWith = Integer.toString(((int)Math.floor(100 / 6)));
|
|
|
+ typeWith = Integer.toString(((int)Math.floor(100 / 6)));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 표준사이즈 - 공통
|
|
|
SizeInfo sizeInfo = new SizeInfo();
|
|
|
sizeInfo.setSizeGb("1"); // 사이즈구분정보 1:표준사이즈. 2:측정사이즈
|
|
|
sizeInfo.setSizeCate1Cd("00"); // 사이즈카테고리1 표준사이즈일경우 공통(00),자사브랜드코드)
|
|
|
Collection<SizeInfo> commonSizeInfoList = goodsService.getSizeInfoList(sizeInfo);
|
|
|
-
|
|
|
+
|
|
|
// 표준사이즈 - 자사브랜드
|
|
|
- Collection<SizeInfo> brandSizeInfoList = new ArrayList<SizeInfo>();
|
|
|
+ Collection<SizeInfo> brandSizeInfoList = new ArrayList<SizeInfo>();
|
|
|
if ("Y".equals(goods.getSelfGoodsYn())) {
|
|
|
sizeInfo.setSizeCate1Cd(goods.getBrandCd()); // 자사브랜드코드(브랜드그룹코드아님)
|
|
|
brandSizeInfoList = goodsService.getSizeInfoList(sizeInfo);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 측정사이즈
|
|
|
sizeInfo.setSizeGb("2");
|
|
|
sizeInfo.setSizeCate1Cd("");
|
|
|
- Collection<SizeInfo> measurementSizeInfoList = goodsService.getSizeInfoList(sizeInfo);
|
|
|
-
|
|
|
+ Collection<SizeInfo> measurementSizeInfoList = goodsService.getSizeInfoList(sizeInfo);
|
|
|
+
|
|
|
mav.addObject("measurementList", measurementList);
|
|
|
mav.addObject("typeCd", typeCd);
|
|
|
mav.addObject("typeWith", typeWith);
|
|
|
@@ -534,7 +535,7 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsSizeInfoForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품상세 - 재입고 레이어
|
|
|
* @return
|
|
|
@@ -550,17 +551,17 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
paramsGoods.setColorCd(colorCd);
|
|
|
setGoods(paramsGoods);
|
|
|
Goods goods = goodsService.getGoodsInfo(paramsGoods);
|
|
|
-
|
|
|
+
|
|
|
// 상품 기본정보
|
|
|
mav.addObject("goodsInfo", goods);
|
|
|
-
|
|
|
+
|
|
|
// 자사 일반상품- 옵션2(사이즈) 정보
|
|
|
mav.addObject("goodsOption2List", goodsService.getGoodsOption2List(paramsGoods));
|
|
|
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsInstockAlarmForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품상세 - 재입고 등록
|
|
|
* @return
|
|
|
@@ -574,7 +575,7 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
goodsService.saveGoodsInstockAlarmForm(reinboundInform);
|
|
|
return super.ok("재입고 알림 신청이 완료되었습니다. 재입고 시 알림톡이 발송됩니다.");
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품상세 - 상품평 레이어
|
|
|
* @return
|
|
|
@@ -589,14 +590,14 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
paramsGoods.setGoodsCd(goodsCd);
|
|
|
setGoods(paramsGoods);
|
|
|
Goods goods = goodsService.getGoodsInfo(paramsGoods);
|
|
|
-
|
|
|
+
|
|
|
// 상품 기본정보
|
|
|
mav.addObject("goodsInfo", goods);
|
|
|
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsReviewForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품상세 - 상품평 - 베스트 레이어
|
|
|
* @return
|
|
|
@@ -611,14 +612,14 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
paramsGoods.setGoodsCd(goodsCd);
|
|
|
setGoods(paramsGoods);
|
|
|
Goods goods = goodsService.getGoodsInfo(paramsGoods);
|
|
|
-
|
|
|
+
|
|
|
// 상품 기본정보
|
|
|
mav.addObject("goodsInfo", goods);
|
|
|
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsReviewBestForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품상세 - 상품평 - 포토/영상 리스트 레이어
|
|
|
* @return
|
|
|
@@ -633,14 +634,14 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
paramsGoods.setGoodsCd(goodsCd);
|
|
|
setGoods(paramsGoods);
|
|
|
Goods goods = goodsService.getGoodsInfo(paramsGoods);
|
|
|
-
|
|
|
+
|
|
|
// 상품 기본정보
|
|
|
mav.addObject("goodsInfo", goods);
|
|
|
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsReviewPhotoForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품상세 - 상품평 - 포토/영상 상세 레이어
|
|
|
* @return
|
|
|
@@ -655,14 +656,14 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
paramsGoods.setGoodsCd(goodsCd);
|
|
|
setGoods(paramsGoods);
|
|
|
Goods goods = goodsService.getGoodsInfo(paramsGoods);
|
|
|
-
|
|
|
+
|
|
|
// 상품 기본정보
|
|
|
mav.addObject("goodsInfo", goods);
|
|
|
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsReviewPhotoDetailForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품상세 - 다다익선 상품
|
|
|
*
|
|
|
@@ -684,7 +685,7 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsOtherForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품상세 - 함께본 상품
|
|
|
*
|
|
|
@@ -693,7 +694,7 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
* @since 2021. 3. 8
|
|
|
*/
|
|
|
@PostMapping("/detail/together/frame")
|
|
|
- public ModelAndView goodsTogetherForm(Goods goods) {
|
|
|
+ public ModelAndView goodsTogetherForm(Goods goods) {
|
|
|
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
// 상품관련 기본값 설정(회원 등급, 앱, PC/모바일 등)
|
|
|
@@ -706,7 +707,7 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsOtherForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품상세 - 추천 상품
|
|
|
*
|
|
|
@@ -715,7 +716,7 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
* @since 2021. 3. 8
|
|
|
*/
|
|
|
@PostMapping("/detail/recommend/frame")
|
|
|
- public ModelAndView goodsRecommendForm(Goods goods) {
|
|
|
+ public ModelAndView goodsRecommendForm(Goods goods) {
|
|
|
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
// 상품관련 기본값 설정(회원 등급, 앱, PC/모바일 등)
|
|
|
@@ -728,7 +729,7 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsOtherForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 상품상세 - 비슷한 상품
|
|
|
*
|
|
|
@@ -737,7 +738,7 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
* @since 2021. 3. 8
|
|
|
*/
|
|
|
@PostMapping("/detail/like/frame")
|
|
|
- public ModelAndView goodsLikeForm(Goods goods) {
|
|
|
+ public ModelAndView goodsLikeForm(Goods goods) {
|
|
|
|
|
|
ModelAndView mav = new ModelAndView();
|
|
|
// 상품관련 기본값 설정(회원 등급, 앱, PC/모바일 등)
|
|
|
@@ -750,7 +751,7 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
mav.setViewName(super.getDeviceViewName("goods/GoodsOtherForm"));
|
|
|
return mav;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 고객의 상품쿠폰 발급. 고객이 상품쿠폰 다운로드 시 발급됨.
|
|
|
*
|
|
|
@@ -765,24 +766,36 @@ public class TsfGoodsController extends TsfBaseController {
|
|
|
public GagaMap createGoodsCoupon(@RequestBody Goods goods) throws Exception {
|
|
|
|
|
|
GagaMap result = new GagaMap();
|
|
|
-
|
|
|
+
|
|
|
// 상품관련 기본값 설정(회원 등급, 앱, PC/모바일 등)
|
|
|
setGoods(goods);
|
|
|
log.info("createGoodsCoupon goods {}", goods);
|
|
|
-
|
|
|
- int couponResult = goodsService.createGoodsCoupon(goods);
|
|
|
-
|
|
|
- //result.set("goodsCouponList", couponService.getGoodsCouponList(paramsGoods));
|
|
|
-
|
|
|
+
|
|
|
+ // 쿠폰발급
|
|
|
+ // ERROR_10: 발급가능 쿠폰없음, 20: 발급완료 쿠폰, 30: 발급받은 쿠폰
|
|
|
+ //죄송합니다. 쿠폰이 모두 소진되었습니다
|
|
|
+ //죄송합니다. 해당 쿠폰은 다운로드가 불가합니다.
|
|
|
+ String couponResult = goodsService.createGoodsCoupon(goods);
|
|
|
+
|
|
|
result.set("status", GagaResponseStatus.SUCCESS.getCode());
|
|
|
-
|
|
|
- if (couponResult == 0) {
|
|
|
- //result.set("message", message.getMessage("COUPON_0002"));
|
|
|
+
|
|
|
+ if ("ERROR_10".equals(couponResult)) {
|
|
|
+ result.set("message", "발급가능 쿠폰이 없습니다.");
|
|
|
+ } else if ("ERROR_20".equals(couponResult)) {
|
|
|
+ result.set("message", "죄송합니다. 해당 쿠폰은 다운로드가 불가합니다.");
|
|
|
+ } else if ("ERROR_30".equals(couponResult)) {
|
|
|
+ result.set("message", "죄송합니다. 쿠폰이 모두 소진되었습니다.");
|
|
|
} else {
|
|
|
- //result.set("message", message.getMessage("COUPON_0001", new Object[] {couponResult}));
|
|
|
+ if (goods.getArrCpnId() != null || goods.getArrCpnId().length > 0) {
|
|
|
+ result.set("message", couponResult + "개 쿠폰이 발급되었습니다.");
|
|
|
+ } else {
|
|
|
+ result.set("message", "쿠폰이 발급되었습니다.");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
result.set("status", "200");
|
|
|
-
|
|
|
+ result.set("params", goods);
|
|
|
+ result.set("goodsCouponList", couponService.getGoodsCouponList(goods));
|
|
|
return result;
|
|
|
}
|
|
|
}
|