Browse Source

자사상품등록

eskim 5 years ago
parent
commit
bbb0ccd5a8

+ 11 - 3
src/main/java/com/style24/persistence/mybatis/shop/TssGoods.xml

@@ -620,11 +620,19 @@
 		     , C.DISP_ORD
 		FROM TB_GOODS_NOTI_INFO C
 		INNER JOIN TB_GOODS B ON C.GOODS_CD = B.GOODS_CD
+		INNER JOIN TB_NOTI_INFO A ON C.NI_CLSF_CD = A.NI_CLSF_CD
+		                          AND C.NI_ITEM_CD = A.NI_ITEM_CD
+		                          AND A.SUPPLY_COMP_CD = CASE B.SUPPLY_COMP_CD
+		                                                      WHEN '1' THEN '1'
+		                                                      WHEN '2' THEN '2'
+		                                                      WHEN '3' THEN '3'
+		                                                      WHEN '4' THEN '4'
+		                                                      WHEN '5' THEN '5'
+		                                                      ELSE 'E' 
+		                                                 END
 		WHERE C.GOODS_CD = #{goodsCd}
-		<if test="niClsfCd != null and niClsfCd != '' ">
-		AND C.NI_CLSF_CD = #{niClsfCd}
-		</if>
 		ORDER BY C.DISP_ORD
+		
 	</select>
 	
 	<!-- 상품의 정보고시 항목 목록 -->

+ 20 - 16
src/main/java/com/style24/scm/biz/service/TssGoodsService.java

@@ -732,15 +732,17 @@ public class TssGoodsService {
 		this.saveGoodsNotiInfo(goods);
 		
 		// 안전인증정보
-		GoodsSafeNo goodsSafeNo = new GoodsSafeNo();
-		goodsSafeNo.setGoodsCd(goods.getGoodsCd());
-		goodsSafeNo.setCertFormGb(goods.getCertFormGb());
-		goodsSafeNo.setCertTargetGb(goods.getCertTargetGb());
-		goodsSafeNo.setCertType(goods.getCertType());
-		goodsSafeNo.setCertNum(goods.getCertNum());
-		log.info("goodsSafeNo ==>{}", goodsSafeNo);
-		this.saveGoodsDetailCertNum(goodsSafeNo);
-
+		// 안전안증작업
+		if (!StringUtils.isEmpty(goods.getCertTargetGb())) {
+			GoodsSafeNo goodsSafeNo = new GoodsSafeNo();
+			goodsSafeNo.setGoodsCd(goods.getGoodsCd());
+			goodsSafeNo.setCertTargetGb(goods.getCertTargetGb());
+			goodsSafeNo.setCertFormGb(goods.getCertFormGb());
+			goodsSafeNo.setCertType(goods.getCertType());
+			goodsSafeNo.setCertNum(goods.getCertNum());
+			this.saveGoodsDetailCertNum(goodsSafeNo);
+		}
+		
 		// 상품 구매등급 적용 - SCM 미적용
 		//		if (goods.getGoodsOrderGrade() != null && goods.getGoodsOrderGrade().length > 0) {
 		//			Goods goodsOrderGrade = new Goods();
@@ -3931,13 +3933,15 @@ public class TssGoodsService {
 		goodsDao.createCategoryGoods(goods);
 
 		// 안전안증작업
-		GoodsSafeNo goodsSafeNo = new GoodsSafeNo();
-		goodsSafeNo.setGoodsCd(goods.getGoodsCd());
-		goodsSafeNo.setCertTargetGb(goods.getCertTargetGb());
-		goodsSafeNo.setCertFormGb(goods.getCertFormGb());
-		goodsSafeNo.setCertType(goods.getCertType());
-		goodsSafeNo.setCertNum(goods.getCertNum());
-		saveGoodsDetailCertNum(goodsSafeNo);
+		if (!StringUtils.isEmpty(goods.getCertTargetGb())) {
+			GoodsSafeNo goodsSafeNo = new GoodsSafeNo();
+			goodsSafeNo.setGoodsCd(goods.getGoodsCd());
+			goodsSafeNo.setCertTargetGb(goods.getCertTargetGb());
+			goodsSafeNo.setCertFormGb(goods.getCertFormGb());
+			goodsSafeNo.setCertType(goods.getCertType());
+			goodsSafeNo.setCertNum(goods.getCertNum());
+			saveGoodsDetailCertNum(goodsSafeNo);
+		}
 	}
 
 	/**

+ 42 - 34
src/main/webapp/WEB-INF/views/goods/GoodsDetailForm.html

@@ -430,45 +430,16 @@
 								<div class="tabsJr">
 									<!-- TABS NAVI -->
 									<ul class="tabsJrNav">
-										<li class="on"><a href="#goodstab11">타이틀/내용/특징</a></li>
-										<li><a href="#goodstab12">상세html</a></li>
+										<li class="on"><a href="#goodstab12">상세html</a></li>
+										<li><a href="#goodstab11">타이틀/내용/특징</a></li>
 									</ul>
 									<!-- //TABS NAVI -->
 									<!-- TABS CONTENT -->
 									<ul class="tabsJrCont">
 										<!-- TAB11 CONTENTS AREA -->
 										<!-- TAB -->
-										<li class="tabJr on" id="goodstab11">
-											<div class="panelStyle">
-											<!-- TAB11 CONTENTS AREA -->
-											<table class="frmStyle">
-											<colgroup>
-												<col width="12%"/>
-												<col/>
-											</colgroup>
-											<tr>
-												<th>타이틀</th>
-												<td><input type="text" class= "w100p" id="goodsTitlesDesc" name="goodsTitlesDesc" maxlength="100" />
-												</td>
-											</tr>
-											<tr>
-												<th>내용</th>
-												<td><div class="tabJrContArea">
-													<textarea class="textareaR3 summernote" name="goodsContentsDesc" id="goodsContentsDesc"></textarea>
-													</div>
-												</td>
-											</tr>
-											<tr>
-												<th>상품 특징</th>
-												<td><div class="tabJrContArea">
-													<textarea class="textareaR3 summernote" name="goodsCharacterDesc" id="goodsCharacterDesc"></textarea>
-													</div>
-												</td>
-											</tr>
-											</table>
-											</div>
-										</li>
-										<li class="tabJr" id="goodstab12">
+										
+										<li class="tabJr on" id="goodstab12">
 											<div class="panelStyle">
 												<!-- TAB11 CONTENTS AREA -->
 												<table class="frmStyle">
@@ -514,6 +485,36 @@
 											</table>
 											</div>
 										</li>
+										<li class="tabJr" id="goodstab11">
+											<div class="panelStyle">
+											<!-- TAB11 CONTENTS AREA -->
+											<table class="frmStyle">
+											<colgroup>
+												<col width="12%"/>
+												<col/>
+											</colgroup>
+											<tr>
+												<th>타이틀</th>
+												<td><input type="text" class= "w100p" id="goodsTitlesDesc" name="goodsTitlesDesc" maxlength="100" />
+												</td>
+											</tr>
+											<tr>
+												<th>내용</th>
+												<td><div class="tabJrContArea">
+													<textarea class="textareaR3 summernote" name="goodsContentsDesc" id="goodsContentsDesc"></textarea>
+													</div>
+												</td>
+											</tr>
+											<tr>
+												<th>상품 특징</th>
+												<td><div class="tabJrContArea">
+													<textarea class="textareaR3 summernote" name="goodsCharacterDesc" id="goodsCharacterDesc"></textarea>
+													</div>
+												</td>
+											</tr>
+											</table>
+											</div>
+										</li>
 										<!-- //TAB -->
 									</ul>
 									<!-- //TAB CONTENT -->
@@ -897,7 +898,7 @@
 
 			$("#goodsDetailForm input[name=goodsImageYn]").val(result.goodsImageYn);
 			$("#goodsDetailForm input[name=niClsfCd]").val(result.niClsfCd);
-			$("#goodsDetailForm select[name=selNiClsfCd]").val(result.niClsfCd);
+			//$("#goodsDetailForm select[name=selNiClsfCd]").val(result.niClsfCd);
 			$("#goodsDetailForm input[name=selfGoodsYn]").val(result.selfGoodsYn);
 			$('#goodsDetailForm').find('#goodsNumTxt').html(result.goodsNum);
 			$('#goodsDetailForm input[name=goodsNum]').val(result.goodsNum);
@@ -1234,6 +1235,13 @@
 			notiHtml += '<tr><th>'+ gagajf.convNull(info.niItemNm, '') +'<input type="hidden" name="niItemCd" value="'+ gagajf.convNull(info.niItemCd, '') +'" />\n<input type="hidden" name="dispOrd" value="'+ gagajf.convNull(info.dispOrd, '') +'" /></th>';
 			notiHtml += '<td><input type="text" name="niContent" value="'+ gagajf.convNull(info.niContent, '') +'"/></td>\n';
 			notiHtml += '</tr>\n';
+			
+			if (idx == 0){
+				$("#goodsDetailForm select[name=selNiClsfCd]").val(info.niClsfCd);
+			}
+			
+			idx ++;
+			
 		});
 		notiHtml += '</tbody></table>';
 

+ 5 - 7
src/main/webapp/WEB-INF/views/goods/GoodsRegisterForm.html

@@ -542,7 +542,7 @@
 				<!-- //TABS SPACE -->
 			</div>	<!--  class=panelContent -->	
 		</div>	<!--  class=panelStyle -->	
-			</form>
+	</form>
 		
 	</div>
 <script type="text/javascript" src="/ux/plugins/summernote/summernote.js?v=2020103001"></script>
@@ -808,7 +808,7 @@
 	
 	//안전인증관련 체크
 	var fnGoodsSafetyCertNumCheck = function(){
-		
+		$("#goodsDetailForm input[name=certTargetGb]").val($("#goodsDetailForm input[name=selCertTargetGb]:checked").val());
 		// 유아용품 확인  
 		if ("G004_23" == $("#goodsDetailForm input[name=safeNiClsfCd]").val()){
 			if (gagajf.isNull($("#goodsDetailForm input[name=selCertTargetGb]:checked").val())){
@@ -816,10 +816,10 @@
 				return false;	
 			}
 		}else{
-			if ((!gagajf.isNull($("#goodsDetailForm input[name=certTargetGb]:checked").val()) && "G083_1" != $("#goodsDetailForm input[name=certTargetGb]:checked").val())){
+			if ((!gagajf.isNull($("#goodsDetailForm input[name=selCertTargetGb]:checked").val()) && "G083_1" != $("#goodsDetailForm input[name=selCertTargetGb]:checked").val())){
 				
 			}else{
-				if ((!gagajf.isNull($("#goodsDetailForm input[name=certTargetGb]:checked").val()) && "G083_1" == $("#goodsDetailForm input[name=certTargetGb]:checked").val())||
+				if ((!gagajf.isNull($("#goodsDetailForm input[name=selCertTargetGb]:checked").val()) && "G083_1" == $("#goodsDetailForm input[name=selCertTargetGb]:checked").val())||
 					!gagajf.isNull($("#goodsDetailForm select[name=certFormGb]").val()) ||
 					!gagajf.isNull($("#goodsDetailForm select[name=certType]").val()) ||
 					!gagajf.isNull($("#goodsDetailForm input[name=certNum]").val())){
@@ -831,8 +831,6 @@
 			}
 		}
 			
-		
-		
 		if(gagajf.isNull($("#goodsDetailForm input[name=selCertTargetGb]:checked").val())){
 			
 			if (!gagajf.isNull($("#goodsDetailForm select[name=certFormGb]").val()) ||
@@ -890,7 +888,7 @@
 			}
 		}
 		
-		$("#goodsDetailForm input[name=certTargetGb]").val($("#goodsDetailForm input[name=selCertTargetGb]:checked").val());
+		
 		
 		return true;
 	}