Browse Source

Merge branch 'develop' of http://112.172.147.34:4936/style24/style24.admin.git into develop

tsit14 4 years ago
parent
commit
f90f0d65ff

+ 10 - 8
src/main/java/com/style24/admin/biz/service/TsaGoodsService.java

@@ -1105,14 +1105,16 @@ public class TsaGoodsService {
 		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.setCertFormGb(goods.getCertFormGb());
+			goodsSafeNo.setCertTargetGb(goods.getCertTargetGb());
+			goodsSafeNo.setCertType(goods.getCertType());
+			goodsSafeNo.setCertNum(goods.getCertNum());
+			log.info("goodsSafeNo ==>{}", goodsSafeNo);
+			this.saveGoodsDetailCertNum(goodsSafeNo);	
+		}
 
 		// 상품 구매등급 적용
 		if (goods.getGoodsOrderGrade() != null && goods.getGoodsOrderGrade().length > 0) {

+ 13 - 6
src/main/java/com/style24/persistence/mybatis/shop/TsaDsiplay.xml

@@ -1564,13 +1564,20 @@
 			,#{contentsType}
 			,DATE_FORMAT(#{dispStdt}, '%Y-%m-%d %H:%i:%S')
 			,DATE_FORMAT(#{dispEddt}, '%Y-%m-%d %H:%i:%S')
+			<choose>
+				<when test="dispOrd != null and dispOrd != ''">
+			,#{dispOrd}
+				</when>
+				<otherwise>
 			,(SELECT DISP_ORD FROM (SELECT IFNULL((MAX(DISP_ORD) + 1), 1) AS DISP_ORD FROM	TB_CONTENTS_PREVIEW	WHERE CATE_NO = #{cateNo} AND CONTENTS_LOC = #{contentsLoc}
-			        <if test="contentsLoc != null and contentsLoc != '' and contentsLoc != 'SMM007'">
-			            <if test="brandGroupNo != null and brandGroupNo !=''">
-			                AND BRAND_GROUP_NO = #{brandGroupNo}
-			            </if>
-			        </if>
-			    ) TMP)
+			<if test="contentsLoc != null and contentsLoc != '' and contentsLoc != 'SMM007'">
+				<if test="brandGroupNo != null and brandGroupNo !=''">
+					AND BRAND_GROUP_NO = #{brandGroupNo}
+				</if>
+			</if>
+			) TMP)
+				</otherwise>
+			</choose>
 			,#{imgPath1}
 			,#{imgPath2}
 			,#{imgPath3}

+ 16 - 11
src/main/java/com/style24/persistence/mybatis/shop/TsaGoods.xml

@@ -4895,17 +4895,22 @@
 		<!-- wms 상품정보 조회 -->
 	<select  id="getWmsGoodsInfo" parameterType="Goods" resultType="WmsGoods" >
 		/* TssGoods.getWmsGoodsInfo */
-		SELECT PRODUCT_NO
-		     , PRODUCT_CODE
-		     , PRODUCT_NAME
-		     , MODEL_NO
-		     , PROVIDER_NO
-		     , PROVIDER_NAME
-		     , BRAND_NO
-		     , BRAND_NAME
-		     , GOODS_REG_DT
-		     , GOODS_REG_GB
-		FROM TB_WMS_GOODS
+		SELECT A.PRODUCT_NO
+		     , A.PRODUCT_CODE
+		     , A.PRODUCT_NAME
+		     , A.MODEL_NO
+		     , A.PROVIDER_NO
+		     , A.PROVIDER_NAME
+		     , A.BRAND_NO
+		     , A.BRAND_NAME
+		     , A.GOODS_REG_DT
+		     , A.GOODS_REG_GB
+		FROM TB_WMS_GOODS A
+		INNER JOIN TB_BRAND B ON A.BRAND_NO = B.BRAND_NO 
+		                      AND B.SELF_YN  = 'Y'
+		                      AND B.USE_YN  = 'Y'
+		                      AND B.BRAND_CD = #{brandCd}
+		INNER JOIN TB_BRAND_SUPPLY S ON B.BRAND_CD = S.BRAND_CD
 		WHERE MODEL_NO = #{goodsCd}
 		LIMIT 1
 	</select>

+ 62 - 49
src/main/webapp/WEB-INF/views/goods/GoodsDetailForm.html

@@ -1099,7 +1099,7 @@
 			cfnCreateCombo('/renderer/delvFee/list/' + result.supplyCompCd, $('#goodsDetailForm select[name=delvFeeCd]'), "[선택]", result.delvFeeCd);
 			$('#goodsDetailForm input[name=delvFeeCdOrg]').val(result.delvFeeCd);
 			cfnCreateCombo('/renderer/delvloc/list/' + result.supplyCompCd, $('#goodsDetailForm select[name=delvLocCd]'), "[선택]", result.delvLocCd);
-			$('#goodsDetailForm input[name=delvLocdOrg]').val(result.delvLocCd);
+			$('#goodsDetailForm input[name=delvLocCdOrg]').val(result.delvLocCd);
 			
 		//	$('#goodsDetailForm input[name=certNum]').val(result.certNum);
 		//	$('#goodsDetailForm input[name=certNumOrg]').val(result.certNum);
@@ -1325,9 +1325,54 @@
 		$('#goodsDetailForm').find('#certOrganNameTxt').html(result.certOrganName);
 		$('#goodsDetailForm').find('#certDivTxt').html(result.certDiv);
 		$('#goodsDetailForm').find('#certDtTxt').html(!gagajf.isNull(result.certDt) ? result.certDt.toDate("YYYYMMDD").format("YYYY-MM-DD") : '');
-
+		
+		if (!gagajf.isNull($("#goodsDetailForm select[name=selCertTargetGb]").val()) ){
+			if ("G081_1" != $("#goodsDetailForm select[name=certType]").val() &&  "G081_2" != $("#goodsDetailForm select[name=certType]").val()){
+				$("#goodsDetailForm input[name=certNum]").attr('readonly', true);
+			}
+		}
 	}
 	
+	// 인증대상 변경시
+	$("#goodsDetailForm input[name=selCertTargetGb]").bind('click', function () {
+		var certTargetGb = $(this).val();
+		if (certTargetGb == "G083_1"){ 
+			$("#goodsDetailForm select[name=certFormGb]").attr('readonly', false);
+			$("#goodsDetailForm select[name=certType]").attr('readonly', false);
+			$("#goodsDetailForm input[name=certNum]").attr('readonly', false);
+		}else{
+			$("#goodsDetailForm select[name=certFormGb]").val('');
+			$("#goodsDetailForm select[name=certType]").val('');
+			$("#goodsDetailForm input[name=certNum]").val('');
+			$("#goodsDetailForm select[name=certFormGb]").attr('readonly', true);
+			$("#goodsDetailForm select[name=certType]").attr('readonly', true);
+			$("#goodsDetailForm input[name=certNum]").attr('readonly', true);
+			
+			$("#goodsDetailForm").find("#certStateTxt").html('');
+			$("#goodsDetailForm").find("#certOrganNameTxt").html('');
+			$("#goodsDetailForm").find("#certDtTxt").html('');
+			$("#goodsDetailForm").find("#certDivTxt").html('');
+			
+		}
+	});
+	
+	// 인증타입 변경시
+	$("#goodsDetailForm select[name=certType]").bind('click change', function () {
+		var certType = $(this).val();
+		if (certType == "G081_1" || certType == "G081_2"){ 
+			$("#goodsDetailForm input[name=certNum]").attr('readonly', false);
+		}else{
+			$("#goodsDetailForm input[name=certNum]").val('');
+			$("#goodsDetailForm input[name=certNum]").attr('readonly', true);
+			
+			$("#goodsDetailForm").find("#certStateTxt").html('');
+			$("#goodsDetailForm").find("#certOrganNameTxt").html('');
+			$("#goodsDetailForm").find("#certDtTxt").html('');
+			$("#goodsDetailForm").find("#certDivTxt").html('');
+			
+		}
+	});
+	
 	//상품명 길이표시
 	$("#goodsDetailForm input[name=goodsNm]").bind('focus focusout input keyup keydown paste change', function () {
 		fnDataLengthCheck('goodsNm',200);
@@ -2044,7 +2089,7 @@
 		if (!fnGoodsSafetyCertNumCheck()) return false;
 		
 		//인증번호 있는데 인증작업 했는지 여부 확인
-		if (!gagajf.isNull($("#goodsDetailForm input[name=certNum]").val())){
+	/* 	if (!gagajf.isNull($("#goodsDetailForm input[name=certNum]").val())){
 			
 			if ("G084_4" == $("#goodsDetailForm select[name=certFormGb]").val() || 
 				"G084_5" == $("#goodsDetailForm select[name=certFormGb]").val() || 
@@ -2056,12 +2101,12 @@
 					return false;
 				}
 			}
-		}
+		} */
 		
-		if (!gagajf.isNull($("#goodsDetailForm input[name=certNum]").val()) && ($("#goodsDetailForm input[name=certNum]").val() != $("#goodsDetailForm input[name=certNumOrg]").val())){
+		/* if (!gagajf.isNull($("#goodsDetailForm input[name=certNum]").val()) && ($("#goodsDetailForm input[name=certNum]").val() != $("#goodsDetailForm input[name=certNumOrg]").val())){
 			mcxDialog.alert("안전인증작업을 하거나 인증번호를 확인해주세요.");
 			return false;
-		}
+		} */
 		
 		var basicColor = $("#goodsDetailForm input[name=basicColor]:checked").val();
 		var dcRate = 0;
@@ -2526,6 +2571,11 @@
 	// 안전인증
 	$("#btnGoodsSafetyCertNum").on("click", function(){
 		
+		if (gagajf.isNull($("#goodsDetailForm input[name=selCertTargetGb]:checked").val())){
+			mcxDialog.alert("안전인증대상를 선택해 주세요.");
+			return false;
+		}
+		
 		if (!fnGoodsSafetyCertNumCheck()) return false;
 
 		mcxDialog.confirm('안전인증정보(API)를 변경 하시겠습니까?', {
@@ -2546,52 +2596,15 @@
 	
 	var fnGoodsSafetyCertNumCheck = function(){
 		
-		// 유아용품 확인  
-		if ("G004_23" == $("#goodsDetailForm input[name=niClsfCd]").val()){
-			if (gagajf.isNull($("#goodsDetailForm input[name=selCertTargetGb]:checked").val())){
-				mcxDialog.alert("안전인증대상을 선택해 주세요.");
-				return false;	
-			}
-		}else{
-			if ((!gagajf.isNull($("#goodsDetailForm input[name=selCertTargetGb]:checked").val()) && "G083_1" != $("#goodsDetailForm input[name=selCertTargetGb]:checked").val())){
-				
-			}else{
-				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())){
-					mcxDialog.alert("인즌대상이 아닌 상품은 인증대상아님을 선택해주세요");
-					return false;	
-				}else{
-					return true;
-				}	
-			}
-			
-		}
-			
-		if(gagajf.isNull($("#goodsDetailForm input[name=selCertTargetGb]:checked").val())){
-			
-			if (!gagajf.isNull($("#goodsDetailForm select[name=certFormGb]").val()) ||
-				!gagajf.isNull($("#goodsDetailForm select[name=certType]").val()) ||
-				!gagajf.isNull($("#goodsDetailForm input[name=certNum]").val())){
-				mcxDialog.alert("안전인증대상을 선택해 주세요.");
-				return false;	
-			}
-			
+		if (gagajf.isNull($("#goodsDetailForm input[name=selCertTargetGb]:checked").val())){
+			return true;	
 		}
 		
-		// 인증대상이 아니면 스킵
-		if ("G083_1" != $("#goodsDetailForm input[name=selCertTargetGb]:checked").val()){
+		$("#goodsDetailForm input[name=certTargetGb]").val($("#goodsDetailForm input[name=selCertTargetGb]:checked").val());
+		
+		if ((!gagajf.isNull($("#goodsDetailForm input[name=selCertTargetGb]:checked").val()) && "G083_1" != $("#goodsDetailForm input[name=selCertTargetGb]:checked").val())){
 			
-			if (!gagajf.isNull($("#goodsDetailForm select[name=certFormGb]").val()) ||
-				!gagajf.isNull($("#goodsDetailForm select[name=certType]").val()) ||
-				!gagajf.isNull($("#goodsDetailForm input[name=certNum]").val())){
-				mcxDialog.alert("인즌대상이 아닐경우 정보를 입력하지 마세요.");
-				return false;	
-			}else{
-				$("#goodsDetailForm input[name=certTargetGb]").val($("#goodsDetailForm input[name=selCertTargetGb]:checked").val());
-				return true;	
-			}
+			return true;	
 		}
 		
 		if(gagajf.isNull($("#goodsDetailForm select[name=certFormGb]").val())){

+ 51 - 49
src/main/webapp/WEB-INF/views/goods/GoodsSalfRegisterForm.html

@@ -515,6 +515,46 @@
 <script th:inline="javascript">
 /*<![CDATA[*/
 	
+	// 인증대상 변경시
+	$("#goodsDetailForm input[name=selCertTargetGb]").bind('click', function () {
+		var certTargetGb = $(this).val();
+		if (certTargetGb == "G083_1"){ 
+			$("#goodsDetailForm select[name=certFormGb]").attr('readonly', false);
+			$("#goodsDetailForm select[name=certType]").attr('readonly', false);
+			$("#goodsDetailForm input[name=certNum]").attr('readonly', false);
+		}else{
+			$("#goodsDetailForm select[name=certFormGb]").val('');
+			$("#goodsDetailForm select[name=certType]").val('');
+			$("#goodsDetailForm input[name=certNum]").val('');
+			$("#goodsDetailForm select[name=certFormGb]").attr('readonly', true);
+			$("#goodsDetailForm select[name=certType]").attr('readonly', true);
+			$("#goodsDetailForm input[name=certNum]").attr('readonly', true);
+			
+			$("#goodsDetailForm").find("#certStateTxt").html('');
+			$("#goodsDetailForm").find("#certOrganNameTxt").html('');
+			$("#goodsDetailForm").find("#certDtTxt").html('');
+			$("#goodsDetailForm").find("#certDivTxt").html('');
+			
+		}
+	});
+	
+	// 인증타입 변경시
+	$("#goodsDetailForm select[name=certType]").bind('click change', function () {
+		var certType = $(this).val();
+		if (certType == "G081_1" || certType == "G081_2"){ 
+			$("#goodsDetailForm input[name=certNum]").attr('readonly', false);
+		}else{
+			$("#goodsDetailForm input[name=certNum]").val('');
+			$("#goodsDetailForm input[name=certNum]").attr('readonly', true);
+			
+			$("#goodsDetailForm").find("#certStateTxt").html('');
+			$("#goodsDetailForm").find("#certOrganNameTxt").html('');
+			$("#goodsDetailForm").find("#certDtTxt").html('');
+			$("#goodsDetailForm").find("#certDivTxt").html('');
+			
+		}
+	});
+	
 	//상품명 길이표시
 	$("#goodsDetailForm input[name=goodsNm]").bind('focus focusout input keyup keydown paste change', function () {
 		fnDataLengthCheck('goodsNm',200);
@@ -734,52 +774,14 @@
 	//안전인증관련 체크
 	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())){
-				mcxDialog.alert("안전인증대상을 선택해 주세요.");
-				return false;	
-			}
-		}else{
-			if ((!gagajf.isNull($("#goodsDetailForm input[name=selCertTargetGb]:checked").val()) && "G083_1" != $("#goodsDetailForm input[name=selCertTargetGb]:checked").val())){
-				
-			}else{
-				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())){
-					mcxDialog.alert("인즌대상이 아닌 상품은 인증대상아님을 선택해주세요");
-					return false;	
-				}else{
-					return true;
-				}	
-			}
-		}
-			
-		if(gagajf.isNull($("#goodsDetailForm input[name=selCertTargetGb]:checked").val())){
-			
-			if (!gagajf.isNull($("#goodsDetailForm select[name=certFormGb]").val()) ||
-				!gagajf.isNull($("#goodsDetailForm select[name=certType]").val()) ||
-				!gagajf.isNull($("#goodsDetailForm input[name=certNum]").val())){
-				mcxDialog.alert("안전인증대상을 선택해 주세요.");
-				return false;	
-			}
-			
+		if (gagajf.isNull($("#goodsDetailForm input[name=selCertTargetGb]:checked").val())){
+			return true;	
 		}
 		
-		// 인증대상이 아니면 스킵
-		if ("G083_1" != $("#goodsDetailForm input[name=selCertTargetGb]:checked").val()){
-			
-			if (!gagajf.isNull($("#goodsDetailForm select[name=certFormGb]").val()) ||
-				!gagajf.isNull($("#goodsDetailForm select[name=certType]").val()) ||
-				!gagajf.isNull($("#goodsDetailForm input[name=certNum]").val())){
-				mcxDialog.alert("인즌대상이 아닐경우 정보를 입력하지 마세요.");
-				return false;	
-			}else{
-				return true;	
-			}
+		$("#goodsDetailForm input[name=certTargetGb]").val($("#goodsDetailForm input[name=selCertTargetGb]:checked").val());
+
+		if ((!gagajf.isNull($("#goodsDetailForm input[name=selCertTargetGb]:checked").val()) && "G083_1" != $("#goodsDetailForm input[name=selCertTargetGb]:checked").val())){
+			return true;	
 		}
 		
 		if(gagajf.isNull($("#goodsDetailForm select[name=certFormGb]").val())){
@@ -817,7 +819,7 @@
 		
 		return true;
 	}
-
+	
 	//상품저장 버튼 클릭 시
 	$('#btnGoodsDetailSave').click(function() {
 
@@ -1017,15 +1019,15 @@
 		$('#goodsDetailForm  input[name=sellEdYMD]').val("2030-12-31");
 		
 		// Create a summernote
-//		var snOptions1 = gagaSn.getToolbarOptions('media');
-//		var snOptions2 = gagaSn.getToolbarOptions('media');
+		var snOptions1 = gagaSn.getToolbarOptions('media');
+		var snOptions2 = gagaSn.getToolbarOptions('media');
 		var snOptions3 = gagaSn.getToolbarOptions('media');
 		var snOptions4 = gagaSn.getToolbarOptions('media');
 		var snOptions5 = gagaSn.getToolbarOptions('media');
 		var snOptions6 = gagaSn.getToolbarOptions('media');
 		var snOptions7 = gagaSn.getToolbarOptions('media');
-//		gagaSn.createSummernote(snOptions1, '#goodsContentsDesc');
-//		gagaSn.createSummernote(snOptions2, '#goodsCharacterDesc');
+		gagaSn.createSummernote(snOptions1, '#goodsContentsDesc');
+		gagaSn.createSummernote(snOptions2, '#goodsCharacterDesc');
 		gagaSn.createSummernote(snOptions3, '#goodsDesc');
 		gagaSn.createSummernote(snOptions4, '#goodsPcTopDesc');
 		gagaSn.createSummernote(snOptions5, '#goodsMobileTopDesc');