|
|
@@ -162,6 +162,7 @@ public class TsfDisplayController extends TsfBaseController {
|
|
|
String contentsLoc = mainLayout.getContentsLoc();
|
|
|
Contents contents = new Contents();
|
|
|
log.info("mallMain contentsLoc:::{}", contentsLoc);
|
|
|
+ contents.setContentsCnt(mainLayout.getContentsCnt());
|
|
|
contents.setContentsLoc(contentsLoc);
|
|
|
contents.setPreview(paramMap.get("preview"));
|
|
|
contents.setViewDt(paramMap.get("viewDt"));
|
|
|
@@ -221,7 +222,11 @@ public class TsfDisplayController extends TsfBaseController {
|
|
|
}
|
|
|
|
|
|
if (contentsLoc.equals("SMM003") || contentsLoc.equals("SBM007")) {
|
|
|
- mainLayout.setNewItemList(displayService.getContentsForGoods(contents));
|
|
|
+ if(Integer.parseInt(mainLayout.getContentsCnt()) > 0){
|
|
|
+ mainLayout.setNewItemList(displayService.getContentsForGoods(contents));
|
|
|
+ }else{
|
|
|
+ mainLayout.setNewItemList(displayService.getMainNewGoodsList(contents));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
mainLayoutList.add(mainLayout);
|
|
|
@@ -471,11 +476,24 @@ public class TsfDisplayController extends TsfBaseController {
|
|
|
contents.setMaxRow(1);
|
|
|
Collection<Contents> conList = displayService.getContentsList(contents);
|
|
|
mav.addObject("newGoodsList", null);
|
|
|
-
|
|
|
- for (Contents contentsData : conList) {
|
|
|
- cate.setContentsLoc("SCM002");
|
|
|
- cate.setMaxRow(20);
|
|
|
- mav.addObject("newGoodsList", goodsService.getContentsCategoryGoodsList(cate));
|
|
|
+ if(Integer.parseInt(cateMain.getContentsCnt()) > 0){
|
|
|
+ for (Contents contentsData : conList) {
|
|
|
+ cate.setContentsLoc("SCM002");
|
|
|
+ cate.setMaxRow(20);
|
|
|
+ mav.addObject("newGoodsList", goodsService.getContentsCategoryGoodsList(cate));
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ Collection<Contents> contentsList = displayService.getBestItemCategoryList(contents);
|
|
|
+ Cate4Srch tempCate = new Cate4Srch();
|
|
|
+ for (Contents data : contentsList) {
|
|
|
+ tempCate.setContentsLoc(data.getContentsLoc());
|
|
|
+ tempCate.setMaxRow(20);
|
|
|
+ tempCate.setCustNo(TsfSession.isLogin() ? TsfSession.getInfo().getCustNo() : 0);
|
|
|
+ tempCate.setSiteCd(data.getSiteCd());
|
|
|
+ tempCate.setCateGb(data.getCateGb());
|
|
|
+ tempCate.setCate1No(data.getCateNo());
|
|
|
+ }
|
|
|
+ mav.addObject("newGoodsList", displayService.getContentsCategoryNewGoodsList(tempCate));
|
|
|
}
|
|
|
} else if ("SCM003".equals(cateMain.getContentsLoc())) {
|
|
|
// 베스트품
|