Просмотр исходного кода

샵링서 상품전송 기술서관련수정 등

jmh 4 лет назад
Родитель
Сommit
5a6792259d

+ 84 - 55
src/main/java/com/style24/admin/biz/service/TsaShoplinkerService.java

@@ -281,20 +281,28 @@ public class TsaShoplinkerService {
 
 		String htmlDesc = "";
 
-		// 상세폼신규사용여부 N: 기존 정보 / Y : html 형식
-		if( "N".equals(goodsMap.getTobeFormYn())){
-			String descStr = goodsMap.getDetailDesc();
-			if( null != descStr) {
-				htmlDesc = descStr;
+		// 1. 기존 상세내용
+		String descStr = goodsMap.getDetailDesc();
+		if( null != descStr) {
+			descStr = descStr.replace("http://www.istyle24.com/Upload/", "http://image.istyle24.com/Local/")
+					.replace("http://www.istyle24.com/Images", "http://image.istyle24.com/Statics/design/Images");
+
+			// src 처음시작이 /Upload인 경우만체크, 중간인경우는 제외
+			if( -1 < descStr.indexOf("\"/Upload")) {
+				descStr = descStr.replace("/Upload", "http://image.istyle24.com/Local");
 			}
 
-		}else {
+			htmlDesc = descStr;
+		}
+
+		// 2. 신규 상세내용 (상세폼신규사용여부 N: 기존 정보 / Y : html 형식)
+		if( "Y".equals(goodsMap.getTobeFormYn())){
+			htmlDesc = ""; // 초기화
 
 			String imgPath = env.getProperty("upload.goods.view");
-			imgPath = imgPath.replace("http://www.istyle24.com/Upload/", "http://image.istyle24.com/Local/")
-					.replace("http://www.istyle24.com/Images", "http://image.istyle24.com/Statics/design/Images")
-					.replace("/Upload", "/Local");
 
+			// 메인컬러에 매칭되는 이미지만 가져옴.(상세,페브릭,라벨등..)
+			shoplinkerGoods.setExtmallDescImgYn("Y");
 			Collection<ShoplinkerGoods> imgList = admShoplinkerDao.getGoodsImageList(shoplinkerGoods);
 
 			String dColor = goodsMap.getMainColorEnm(); //대표컬러
@@ -334,10 +342,7 @@ public class TsaShoplinkerService {
 
 			// 제대로된 정보 없을 경우, 기존 상세내용으로 보냄
 			if( "".equals(dImgFront)) {
-				String descStr = goodsMap.getDetailDesc();
-				if( null != descStr) {
-					htmlDesc = descStr;
-				}
+				htmlDesc = descStr;
 
 			}else {
 
@@ -345,37 +350,43 @@ public class TsaShoplinkerService {
 				htmlDesc = "<div class=\"st_descrp_box\" style=\"max-height:1100px; overflow:hidden;\">";
 				htmlDesc += "<div class=\"st_desc_simple\" style=\"position:relative; margin-top:0px; margin-left:auto; margin-right:auto;\">";
 				htmlDesc += "<span class=\"st_tit_desc\" style=\"display:block; margin-bottom:10px; font-size:18px; font-weight:500; letter-spacing:-0.025em;\">"+goodsMap.getDetailDescNew10()+"</span>";
-				htmlDesc += "<p class=\"st_ptxt01\" style=\"font-size:16px;font-weight:200;line-height:1.5;word-break:keep-all;color:#666666;\">";
+				htmlDesc += "<span class=\"st_ptxt01\" style=\"font-size:16px;font-weight:200;line-height:1.5;word-break:keep-all;color:#666666;\">";
 				htmlDesc += goodsMap.getDetailDescNew20();
-				htmlDesc += "</p>";
+				htmlDesc += "</span>";
 				htmlDesc += "</div>";
 				htmlDesc += "<div class=\"st_desc_character\" style=\"position:relative; margin-top:40px; margin-left:auto; margin-right:auto;\">";
 				htmlDesc += "<span class=\"st_tit_desc\" style=\"display:block; margin-bottom:10px; font-size:18px; font-weight:500; letter-spacing:-0.025em;\">상품특징</span>";
-				htmlDesc += "<p class=\"st_ptxt01\" style=\"font-size:16px;font-weight:200;line-height:1.5;word-break:keep-all;color:#666666;\">";
+				htmlDesc += "<span class=\"st_ptxt01\" style=\"font-size:16px;font-weight:200;line-height:1.5;word-break:keep-all;color:#666666;\">";
 				htmlDesc += goodsMap.getDetailDescNew30();
-		        htmlDesc += "</p>";
+		        htmlDesc += "</span>";
         		htmlDesc += "</div>";
 				htmlDesc += "</div>";
 
 				// 2) 상세내용 - 상품옵션별 색상
 				String colorDesc = "";
-				shoplinkerGoods.setColorListYn("Y"); // 상품이미지정보 색상별
+				shoplinkerGoods.setExtmallDescImgYn("N");
+				shoplinkerGoods.setColorListYn("Y"); // 색상별 이미지 정보만 가져옴
 				Collection<ShoplinkerGoods> imgColorList = admShoplinkerDao.getGoodsImageList(shoplinkerGoods);
 				colorDesc = "<div class=\"st_view_option_box\" style=\"margin-top: 100px;text-align: center;\">";
 				String tmpColor = "";
 				for(ShoplinkerGoods ic : imgColorList ) {
 
 					if( !tmpColor.equals(ic.getColorCd())) {
+						tmpColor = ic.getColorCd();
+
 						colorDesc += "<span class=\"st_tit_desc\" style=\"display:block; margin-bottom:10px; font-size:18px; font-weight:500; letter-spacing:-0.025em;\">컬러 : ";
 						colorDesc += "<span>"+ ic.getColorKnm() +"</span></span>";
-					}
-					colorDesc += "<div class=\"st_view\" style=\"margin-top: 40px;\">";
-					colorDesc += "<img src=\""+ imgPath+"/"+ic.getSysImgNm()+"\" alt=\"\" style=\"max-width:100%;margin: 10px auto 0;margin-top: 0;display: block;\">";
-					colorDesc += "<img src=\""+ imgPath+"/"+ic.getSysImgNm()+"\" alt=\"\" style=\"max-width:100%;display: block;margin: 10px auto 0;\">";
-	                colorDesc += "</div>";
-		            if( !tmpColor.equals(ic.getColorCd())) {
+						colorDesc += "<div class=\"st_view\" style=\"margin-top: 40px;\">";
+
+						// 동일색상끼리 이미지 세팅
+						for(ShoplinkerGoods ic2 : imgColorList ) {
+							if( tmpColor.equals(ic2.getColorCd())) {
+								colorDesc += "<img src=\""+ imgPath+"/"+ic2.getSysImgNm()+"\" alt=\"\" style=\"max-width:100%;margin: 10px auto 0;display: block;\">";
+							}
+						}
+
+						colorDesc += "</div>";
 		            	colorDesc += "<div style=\"height:100px;\"></div>";
-		            	tmpColor = ic.getColorCd();
 					}
 				}
 				colorDesc += "</div>";
@@ -383,47 +394,65 @@ public class TsaShoplinkerService {
 
 				// 3) 상세내용 - 모델 착용컷
 				String dtlDesc = "";
-				dtlDesc += "<div class=\"st_view_outfit_box\" style=\"margin-top: 100px;text-align: center;\">";
-				dtlDesc += "<span class=\"st_tit_view\" style=\"display: block;color: #222;font-size: 32px;font-weight: 300;text-align: center;\">OUTFIT VIEW</span>";
-				dtlDesc += "<span class=\"st_model_info\" style=\"display: block;margin-top: 20px;color: #666;font-size: 16px;font-weight: 200;text-align: center;\">"+goodsMap.getModelInfo()+"</span>";
-				dtlDesc += "<div class=\"st_view\" style=\"margin-top: 40px;\">";
-				for(String img : dImgModelList) {
-					dtlDesc += "<img src=\""+ img +"\" alt=\"\" style=\"display: block;margin: 10px auto 0;\">";
+				if( 0 < dImgModelList.size()) {
+					dtlDesc += "<div class=\"st_view_outfit_box\" style=\"margin-top: 100px;text-align: center;\">";
+					dtlDesc += "<span class=\"st_tit_view\" style=\"display: block;color: #222;font-size: 32px;font-weight: 300;text-align: center;\">OUTFIT VIEW</span>";
+					dtlDesc += "<span class=\"st_model_info\" style=\"display: block;margin-top: 20px;color: #666;font-size: 16px;font-weight: 200;text-align: center;\">"+goodsMap.getModelInfo()+"</span>";
+					dtlDesc += "<div class=\"st_view\" style=\"margin-top: 40px;\">";
+					for(String img : dImgModelList) {
+						dtlDesc += "<img src=\""+ img +"\" alt=\"\" style=\"display: block;margin: 10px auto 0;\">";
+					}
+					dtlDesc += "</div>";
+					dtlDesc += "</div>";
 				}
-				dtlDesc += "</div>";
-				dtlDesc += "</div>";
 
 				// 4) 상세내용 - 상품컷
-				dtlDesc += "<div class=\"st_view_detail_box\" style=\"margin-top: 100px;text-align: center;\">";
-				dtlDesc += "<span class=\"st_tit_view\" style=\"display: block;color: #222;font-size: 32px;font-weight: 300;text-align: center;\">PRODUCT VIEW</span>";
-				dtlDesc += "<div class=\"st_view\" style=\"margin-top: 40px;\">";
-				for(String img : dImgDetailList) {
-					dtlDesc += "<img src=\""+ img +"\" alt=\"\" style=\"display: block;margin: 10px auto 0;\">";
+				if( 0 < dImgDetailList.size()) {
+					dtlDesc += "<div class=\"st_view_detail_box\" style=\"margin-top: 100px;text-align: center;\">";
+					dtlDesc += "<span class=\"st_tit_view\" style=\"display: block;color: #222;font-size: 32px;font-weight: 300;text-align: center;\">PRODUCT VIEW</span>";
+					dtlDesc += "<div class=\"st_view\" style=\"margin-top: 40px;\">";
+					for(String img : dImgDetailList) {
+						dtlDesc += "<img src=\""+ img +"\" alt=\"\" style=\"display: block;margin: 10px auto 0;\">";
+					}
+	                dtlDesc += "</div>";
+	        		dtlDesc += " </div>";
 				}
-                dtlDesc += "</div>";
-        		dtlDesc += " </div>";
 
         		// 5) 상세내용 - 원단
-        		dtlDesc += "<div class=\"st_view_fabric_box\" style=\"margin-top: 100px;text-align: center;\">";
-        		dtlDesc += "<span class=\"st_tit_view\" style=\"display: block;color: #222;font-size: 32px;font-weight: 300;text-align: center;\">FABRIC</span>";
-        		dtlDesc += "<div class=\"st_view\" style=\"margin-top: 40px;\">";
-        		dtlDesc += "<img src=\""+dMaterial +"\" alt=\"\" style=\"display: block;margin: 10px auto 0;margin-top: 0;\">";
-                dtlDesc += "</div>";
-                dtlDesc += "</div>";
+				if( !"".equals(dMaterial)){
+	        		dtlDesc += "<div class=\"st_view_fabric_box\" style=\"margin-top: 100px;text-align: center;\">";
+	        		dtlDesc += "<span class=\"st_tit_view\" style=\"display: block;color: #222;font-size: 32px;font-weight: 300;text-align: center;\">FABRIC</span>";
+	        		dtlDesc += "<div class=\"st_view\" style=\"margin-top: 40px;\">";
+	        		dtlDesc += "<img src=\""+dMaterial +"\" alt=\"\" style=\"display: block;margin: 10px auto 0;margin-top: 0;\">";
+	                dtlDesc += "</div>";
+	                dtlDesc += "</div>";
+				}
 
                 // 6) 상세내용 - 라벨
-                dtlDesc += "<div class=\"st_view_label_box\" style=\"margin-top: 100px;text-align: center;\">";
-                dtlDesc += "<span class=\"st_tit_view\" style=\"display: block;color: #222;font-size: 32px;font-weight: 300;text-align: center;\">LABEL INFO</span>";
-                dtlDesc += "<div class=\"st_view\" style=\"margin-top: 40px;\">";
-                dtlDesc += "<span style=\"display:inline-block;\">";
-                for(String img : dLabelList) {
-					dtlDesc += "<img src=\""+ img +"\" alt=\"\" style=\"float:left; margin-top:0; margin-left:20px;\">";
+				if( 0 < dLabelList.size()) {
+	                dtlDesc += "<div class=\"st_view_label_box\" style=\"margin-top: 100px;text-align: center;\">";
+	                dtlDesc += "<span class=\"st_tit_view\" style=\"display: block;color: #222;font-size: 32px;font-weight: 300;text-align: center;\">LABEL INFO</span>";
+	                dtlDesc += "<div class=\"st_view\" style=\"margin-top: 40px;\">";
+	                dtlDesc += "<span style=\"display:inline-block;\">";
+	                for(String img : dLabelList) {
+						dtlDesc += "<img src=\""+ img +"\" alt=\"\" style=\"float:left; margin-top:0; margin-left:20px;\">";
+					}
+	                dtlDesc += "</span>";
+	                dtlDesc += "</div>";
+	                dtlDesc += "</div>";
 				}
-                dtlDesc += "</span>";
-                dtlDesc += "</div>";
-                dtlDesc += "</div>";
+
                 htmlDesc += dtlDesc;
 
+                // 이미지 경로 수정
+                htmlDesc = htmlDesc.replace("http://www.istyle24.com/Upload/", "http://image.istyle24.com/Local/")
+    					.replace("http://www.istyle24.com/Images", "http://image.istyle24.com/Statics/design/Images");
+
+    			if( -1 < htmlDesc.indexOf("\"/Upload")) {
+    				htmlDesc = htmlDesc.replace("/Upload", "http://image.istyle24.com/Local");
+    			}
+    			// 이미지 경로 수정
+
                 // 7) 상세내용 - 사이즈
                 Collection<ShoplinkerGoods> sizeList = admShoplinkerDao.getGoodsSizeList(shoplinkerGoods);
                 if (sizeList == null || sizeList.isEmpty()) {

+ 12 - 9
src/main/java/com/style24/persistence/mybatis/shop/TsaShoplinker.xml

@@ -117,6 +117,9 @@
 			AND A.MAIN_COLOR_CD = B.COLOR_CD
         	AND (B.DEFAULT_IMG_YN = 'Y' OR B.EXTMALL_IMG_YN = 'Y')
         </if>
+        <if test='extmallDescImgYn != null and extmallDescImgYn == "Y"'>
+        	AND A.MAIN_COLOR_CD = B.COLOR_CD
+        </if>
         <if test='colorListYn != null and colorListYn == "Y"'>
 			AND (B.SYS_IMG_NM LIKE '%_01.jpg' or B.SYS_IMG_NM LIKE '%_02.jpg' )
         </if>
@@ -368,17 +371,17 @@
 	<sql id="getListCondition_sql">
 
 		        <if test="goodsCd != null and goodsCd != ''">
-		        AND UPPER(A.GOODS_CD) LIKE CONCAT('%',UPPER(#{goodsCd}),'%')
+		        AND A.GOODS_CD LIKE CONCAT('%',UPPER(#{goodsCd}),'%')
 		        </if>
 		    	<if test="conditionList != null and conditionList.length>0">
-		        AND UPPER(A.GOODS_CD) IN
+		        AND A.GOODS_CD IN
 		            <foreach collection="conditionList" item="item" index="index"  open="(" close=")" separator=",">
 		       		UPPER(#{item})
 		            </foreach>
 		        </if>
 
 		        <if test="goodsNm != null and goodsNm != ''">
-		        AND UPPER(B.GOODS_NM) LIKE CONCAT('%',UPPER(#{goodsNm}),'%')
+		        AND B.GOODS_NM LIKE CONCAT('%',UPPER(#{goodsNm}),'%')
 		        </if>
 		        <if test="brandCd != null and brandCd != ''">
 		        AND BRAND_CD = #{brandCd}
@@ -624,9 +627,9 @@
 	              </when>
 
 	              <when test='search != null and search == "ordNo"'>
-	              	AND UPPER(B.ORD_NO) IN
+	              	AND B.ORD_NO IN
 			            <foreach collection="conditionList" item="item" index="index"  open="(" close=")" separator=",">
-			       		UPPER(#{item})
+			       		#{item}
 			            </foreach>
 	              </when>
 	            </choose>
@@ -761,16 +764,16 @@
 	              </when>
 
 	              <when test='search != null and search == "ordNo"'>
-	              	AND UPPER(OD.ORD_NO) IN
+	              	AND OD.ORD_NO IN
 			            <foreach collection="conditionList" item="item" index="index"  open="(" close=")" separator=",">
-			       		UPPER(#{item})
+			       		#{item}
 			            </foreach>
 	              </when>
 
 	              <when test='search != null and search == "deliveryInvoice"'>
-	              	AND UPPER(OD.INVOICE_NO) IN
+	              	AND OD.INVOICE_NO IN
 			            <foreach collection="conditionList" item="item" index="index"  open="(" close=")" separator=",">
-			       		UPPER(#{item})
+			       		#{item}
 			            </foreach>
 	              </when>