Sfoglia il codice sorgente

자사상품 등록

eskim 4 anni fa
parent
commit
e3f431f6f3

+ 22 - 0
src/main/java/com/style24/admin/biz/dao/TsaGoodsDao.java

@@ -1270,4 +1270,26 @@ public interface TsaGoodsDao {
 	 * @since 2021. 07. 04
 	 */
 	int getBrandSupplyCount(Brand brand);
+	
+	/**
+	 * 상품 색상, 사이즈 정보 조회
+	 *
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @since 2021. 07. 05
+	 */
+	Goods getGoodsColorSize(Goods goods);
+	
+	/**
+	 * 상품 대표색상 설정
+	 *
+	 * @param goods
+	 * @return
+	 * @author eskim
+	 * @since 2021. 07. 05
+	 */
+	void updateGoodsMainColorCd(Goods goods);
+
+
 }

+ 21 - 1
src/main/java/com/style24/admin/biz/service/TsaGoodsService.java

@@ -3960,6 +3960,13 @@ public class TsaGoodsService {
 				index++;
 			}
 		}
+		
+		// 상품 색상 , 사이즈 옵션 정보 조회
+		Goods goodsColorSize = goodsDao.getGoodsColorSize(goods);
+		if (goodsColorSize != null && !StringUtils.isBlank(goodsColorSize.getMainColorCd())) {
+			goodsColorSize.setUpdNo(TsaSession.getInfo().getUserNo());
+			goodsDao.updateGoodsMainColorCd(goodsColorSize); // 대표색상 설정
+		}
 
 		// 상품상세정보 저장
 		this.saveGoodsDetailDesc(goods);
@@ -3969,7 +3976,20 @@ public class TsaGoodsService {
 
 		// 전시카테고리 작업
 		goodsDao.createCategoryGoods(goods);
-
+		
+		log.info("goods = {}", goods);
+		// 안전안증작업
+		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);
+	
+		}
+		
 	}
 
 }

+ 1 - 1
src/main/java/com/style24/admin/biz/service/TsaWmsGoodsService.java

@@ -33,7 +33,7 @@ public class TsaWmsGoodsService {
 	 * @param goodsCd
 	 * @return
 	 * @author eskim
-	 * @since 2021. 05. 29
+	 * @since 2021. 07. 04
 	 */
 	public Collection<IfProductSku> getGoodsWmsSizeList(String goodsCd) {
 		return wmsGoodsDao.getGoodsWmsSizeList(goodsCd);

+ 2 - 2
src/main/java/com/style24/admin/biz/web/TsaGoodsController.java

@@ -313,7 +313,7 @@ public class TsaGoodsController extends TsaBaseController {
 	 */
 	@PostMapping("/notiInfo/list")
 	@ResponseBody
-	public Collection<NotiInfo> getNotiInfoList(@RequestBody NotiInfo notiInfo) {
+	public Collection<NotiInfo> getNotiInfoList(NotiInfo notiInfo) {
 		return goodsService.getNotiInfoList(notiInfo);
 	}
 
@@ -3252,7 +3252,7 @@ public class TsaGoodsController extends TsaBaseController {
 		} catch (Exception e) {
 			e.printStackTrace();
 		}
-
+		log.info("goods11111 = {}", goods);
 		goods.setNotiListNew(notiList);
 
 		goodsService.createSalfGoodsDetail(goods);

+ 32 - 7
src/main/java/com/style24/persistence/mybatis/shop/TsaGoods.xml

@@ -134,12 +134,13 @@
 	<!-- 정보고시분류 목록 -->
 	<select id="getNotiInfoList" parameterType="NotiInfo" resultType="NotiInfo">
 		/* TsaGoods.getNotiInfoList */
-		SELECT DISTINCT B.SUPPLY_COMP_CD
+		SELECT B.SUPPLY_COMP_CD
 		     , B.NI_CLSF_CD
-		     , C.CD_NM AS NI_CLSF_NM
-		     , C.DISP_ORD
+		     , B.NI_ITEM_CD
+		     , FN_GET_CODE_NM('G005', B.NI_ITEM_CD) AS NI_ITEM_NM
+		     , B.NI_CONTENT
+		     , B.DISP_ORD
 		FROM TB_NOTI_INFO B
-		INNER JOIN TB_COMMON_CODE C ON B.NI_CLSF_CD = C.CD 
 		WHERE B.SUPPLY_COMP_CD = CASE #{supplyCompCd} 
 		                         WHEN '1' THEN '1'
 		                         WHEN '2' THEN '2'
@@ -147,8 +148,10 @@
 		                         WHEN '4' THEN '4'
 		                         WHEN '5' THEN '5'
 		                         ELSE 'E' END 
-		AND C.CD_GB = 'G004'   /*고시정보*/
-		ORDER BY C.DISP_ORD
+		<if test="niClsfCd != null and niClsfCd != ''">
+		AND B.NI_CLSF_CD = #{niClsfCd}
+		</if>
+		ORDER BY B.NI_CLSF_CD, B.DISP_ORD
 	</select>
 	
 	<!-- 정보고시 상세 목록 -->
@@ -1019,7 +1022,6 @@
 		                                                      ELSE 'E' 
 		                                                 END
 		WHERE C.GOODS_CD = #{goodsCd}
-		AND C.NI_CLSF_CD = #{niClsfCd}
 		ORDER BY C.DISP_ORD
 	</select>
 	
@@ -4848,4 +4850,27 @@
 		AND B.SELF_YN  = 'Y'
 	</select>
 	
+	<!-- 상품 색상, 사이즈 정보 조회 -->
+	<select id="getGoodsColorSize"  parameterType="Goods" resultType="Goods">
+		/* TsaGoods.getGoodsColorSize */
+		SELECT GOODS_CD
+		     , GROUP_CONCAT(DISTINCT OPT_CD1) AS OPT1_STR
+		     , GROUP_CONCAT(DISTINCT OPT_CD2) AS OPT2_STR
+		     , MIN(OPT_CD1) AS MAIN_COLOR_CD
+		FROM TB_OPTION
+		WHERE GOODS_CD = #{goodsCd}
+		GROUP BY GOODS_CD
+	</select>
+	
+	<!-- 상품 대표색상 설정 -->
+	<update id="updateGoodsMainColorCd" parameterType="Goods">
+		/* TsaGoods.updateGoodsMainColorCd */
+		UPDATE TB_GOODS 
+		SET MAIN_COLOR_CD = #{mainColorCd}
+		  , UPD_NO = #{updNo}
+		  , UPD_DT = NOW() 
+		WHERE GOODS_CD = #{goodsCd}
+	</update>
+	
+	
 </mapper>

+ 2 - 2
src/main/java/com/style24/persistence/mybatis/wms/TsaWmsGoods.xml

@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.style24.scm.biz.dao.TssWmsGoodsDao">
+<mapper namespace="com.style24.admin.biz.dao.TsaWmsGoodsDao">
 
 	<!-- wms 상품 색상 , 사이즈별 재고 정보 조회 -->
 	<select id="getGoodsWmsSizeList" parameterType="String"  resultType = "IfProductSku">
-		/* TssWmsGoods.getGoodsWmsSizeList */
+		/* TsaWmsGoods.getGoodsWmsSizeList */
 		SELECT GOODS_CD
 		     , SKUCODE
 		     , SKUMODELNO

+ 17 - 21
src/main/webapp/WEB-INF/views/goods/GoodsDetailForm.html

@@ -907,8 +907,8 @@
 			$('#goodsDetailForm').find('#supplyGoodsCdTxt').html(result.supplyGoodsCd);
 
 			$("#goodsDetailForm input[name=goodsImageYn]").val(result.goodsImageYn);
-			$("#goodsDetailForm input[name=niClsfCd]").val(result.niClsfCd);
-			$("#goodsDetailForm select[name=selNiClsfCd]").val(result.niClsfCd);
+			$("#goodsDetailForm input[name=niClsfCd]").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);
@@ -1120,13 +1120,13 @@
 
 			if (!gagajf.isNull(result.niClsfNm)){
 				$('#goodsDetailForm').find('#itemkindNoti').html('품목기준 고시분류 : ' + result.niClsfNm);
-				$('#goodsDetailForm input[name=niClsfNm]').val(result.niClsfNm);
-				var objNotiInfo = $("#goodsDetailForm select[name=selNiClsfCd] option");
-				for(var i=0;i<objNotiInfo.length; i++ ){
-					if (objNotiInfo.eq(i).text() == result.niClsfNm){
-						objNotiInfo.eq(i).prop("selected","true");
-					}
-				}
+			//	$('#goodsDetailForm input[name=niClsfNm]').val(result.niClsfNm);
+			//	var objNotiInfo = $("#goodsDetailForm select[name=selNiClsfCd] option");
+			//	for(var i=0;i<objNotiInfo.length; i++ ){
+			//		if (objNotiInfo.eq(i).text() == result.niClsfNm){
+			//			objNotiInfo.eq(i).prop("selected","true");
+			//		}
+			//	}
 			}
 
 			$('#goodsDetailForm').find('#goodsImgUrl').attr('src',  _goodsUrl + '/'+ result.sysImgNm +'?RS=130');
@@ -1172,7 +1172,7 @@
 			params.goodsCd = result.goodsCd;
 			params.brandCd = result.brandCd;
 			params.supplyCompCd = result.supplyCompCd;
-			params.niClsfCd = result.niClsfCd;
+			//params.niClsfCd = result.niClsfCd;
 			params.goodsType = result.goodsType;
 			params.erpPriceLinkYn = result.erpPriceLinkYn;
 			
@@ -1266,9 +1266,16 @@
 		notiHtml += '<tbody id="infoContents">\n';
 		notiHtml += '<tr><th>고시항목</th><th>고시내용</th></tr>';
 		result.forEach(function(info){
+			
 			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>';
 
@@ -2461,17 +2468,6 @@
 			return false;
 		}
 
-		// 고시정보 수정은 맘대로 할수 있음 20200821 신현장 부장 확인
-		/* if ($("#goodsDetailForm input[name=niClsfCd]").val() != $("#goodsDetailForm select[name=selNiClsfCd]").val()){
-			mcxDialog.alertC("상품의 고시분류는 [" + $("#goodsDetailForm input[name=niClsfNm]").val() +"] 입니다."  , {
-				sureBtnText: "확인",
-				sureBtnClick: function() {
-					$("#goodsDetailForm select[name=selNiClsfCd]").focus();
-				}
-			});
-			return false;
-		} */
-
 		var params = new Object();
 		params.supplyCompCd = $("#goodsDetailForm input[name=supplyCompCd]").val();
 		params.niClsfCd = $("#goodsDetailForm select[name=selNiClsfCd]").val();

+ 233 - 15
src/main/webapp/WEB-INF/views/goods/GoodsSalfRegisterForm.html

@@ -57,7 +57,7 @@
 												<i class="fa fa-info-circle" aria-hidden="true"></i>옵션정보는 자동 등록 됩니다.</h3>
 					</li>	
 					<li class="right">
-						<th:block th:if="${sessionInfo.roleCd == 'G001_E000'}">
+						<th:block th:if="${sessionInfo.roleCd == 'G001_0000' OR sessionInfo.roleCd == 'G001_A000' OR sessionInfo.roleCd == 'G001_A101' OR sessionInfo.roleCd == 'G001_A100' OR sessionInfo.roleCd == 'G001_A001'}">
 						<button type="button" class="btn btnRight btn-success btn-lg" id="btnGoodsDetailSave">저장</button>
 						</th:block>
 					</li>
@@ -71,6 +71,7 @@
 							<li class="on"><a href="#goodstab1">기본정보</a></li>
 							<li><a href="#goodstab3">상품상세정보</a></li>
 							<li><a href="#goodstab4">고시정보</a></li>
+							<li id="goodsSafeTab"><a href="#goodstab5">안전인증</a></li>
 						</ul>
 					</div>
 					<!-- //TABS NAVI -->
@@ -195,10 +196,24 @@
 											</select>
 										</td>
 										<th>선물 주문가능여부<em class="required" title="필수"></em></th>
-										<td colspan="3">
+										<td>
 											<label class="rdoBtn"><input type="radio" name="giftPackYn" id="giftPackYnY" value="Y" />Y</label>
 											<label class="rdoBtn"><input type="radio" name="giftPackYn" id="giftPackYnN" value="N" checked="checked"/>N</label>
 										</td>
+										<th>원가</th>
+										<td><input type="text" class="w100 aR" id="costPrice" name="costPrice" value="0"  maxlength="10" data-valid-type="numeric" required="required" data-valid-name="원가"/> 원
+										</td>
+									</tr>
+									<tr>
+										<th>정상가<em class="required" title="필수"></em></th>
+										<td>
+											<input type="text" class="w100 aR" id="listPrice" name="listPrice" maxlength="10" data-valid-type="numeric" required="required" data-valid-name="정상가"/> 원
+										</td>
+										<th>판매가<em class="required" title="필수"></em></th>
+										<td><input type="text" class="w100 aR" id="currPrice" name="currPrice" maxlength="10" data-valid-type="numeric" required="required" data-valid-name="판매가"/> 원
+										</td>
+										<th>할인율</th>
+										<td class="aR" ><span id="dcRateTxt"></span> %</td>
 									</tr>
 									<tr id="selfGoodsNSellFeeRate">
 										<th>판매수수료율<em class="required" title="필수"></em></th>
@@ -422,6 +437,69 @@
 							<!-- //TAB4 CONTENTS AREA -->
 						</li>
 						<!-- //TAB4 : 고시정보 -->
+						<!-- TAB6 : 안전인증 -->
+						<li class="tab" id="goodstab5">
+							<div class="panelStyle">
+								<table class="frmStyle">
+									<colgroup>
+										<col width="11%"/>
+										<col width="22%"/>
+										<col width="11%"/>
+										<col width="22%"/>
+										<col width="11%"/>
+										<col/>
+									</colgroup>
+									<tr>
+										<th>인증대상</th>
+										<td colspan="5">
+											<label class="rdoBtn" th:if="${certTargetGbList}" th:each="oneData, status : ${certTargetGbList}">
+												<input type="radio" name="selCertTargetGb" th:value="${oneData.cd}" th:text="${oneData.cdNm}"/>
+											</label>
+											<input type="hidden" name="certTargetGb"/>
+										</td>
+									</tr>
+									<tr>	
+										<th>인증형태</th>
+										<td>
+											<select  name="certFormGb" id="certFormGb" >
+												<option value="">[선택]</option>
+												<option th:if="${certFormGbList}" th:each="oneData, status : ${certFormGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+											</select>
+										</td>
+										<th>인증타입</th>
+										<td>
+											<select  name="certType" id="certType" >
+												<option value="">[선택]</option>
+												<option th:if="${certTypeList}" th:each="oneData, status : ${certTypeList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+											</select>
+										</td>
+										<th>인증번호</th>
+										<td>
+											<input type="text" class="w200" id="certNum" name="certNum"  maxlength="20"/>
+										</td>
+									</tr>
+									<!-- <tr>	
+										<th>인증상태</th>
+										<td><span id="certStateTxt"></span></td>
+										<th>인증기관</th>
+										<td><span id="certOrganNameTxt"></span></td>
+										<th>인증일</th>
+										<td><span id="certDtTxt"></span></td>
+									</tr>
+									<tr>
+										<th>인증구분</th>
+										<td colspan="5"><span id="certDivTxt"></span></td>
+									</tr> -->
+								</table>
+								<!-- <ul class="panelBar marT10">
+								<li class="right">
+								<button type="button" class="btn  btn-success btn-lg" id="btnGoodsSafetyCertNum">안전인증</button>
+								</li>
+								</ul> -->
+							</div>
+						</li>
+					</ul>
+					<!-- //TABS CONTENTS -->
 					</ul>
 					<!-- //TABS CONTENTS -->
 					
@@ -452,6 +530,29 @@
 		fnDataLengthCheck('goodsSnm1',200);
 	});
 
+	//판매가 변경시 할인율 계산
+	$("#goodsDetailForm input[name=currPrice]").bind('focusout paste', function () {
+		fnCurrPriceCheck();
+	});
+	
+	//정상가 변경시 할인율 계산
+	$("#goodsDetailForm input[name=listPrice]").bind('focusout paste', function () {
+		fnCurrPriceCheck();
+	});
+
+	//판매가의 할인율 확인
+	var fnCurrPriceCheck = function(){
+		var dcRate = 0;
+
+		var listPrice = $("#goodsDetailForm input[name=listPrice]").val().removeComma();
+		var currPrice = $("#goodsDetailForm input[name=currPrice]").val().removeComma();
+		dcRate =  100 - Math.floor(Number(currPrice) / Number(listPrice) * 100);	//절사
+
+		$("#goodsDetailForm").find("#dcRateTxt").html(dcRate);
+		$("#goodsDetailForm input[name=dcRate]").val(dcRate);
+
+	}
+	
 	//데이터 길이 확인
 	var fnDataLengthCheck = function(id , maxByte){
 		var maximumByte = maxByte;
@@ -524,7 +625,7 @@
 		
 		//출고처
 		$("#goodsDetailForm select[name=delvLocCd] option:gt(0)").remove();
-		cfnCreateCombo("/renderer/delvLoc/list/" + supplyCompCd, $('#goodsDetailForm select[name=delvLocCd]'), "[선택]", '');
+		cfnCreateCombo("/renderer/delvloc/list/" + supplyCompCd, $('#goodsDetailForm select[name=delvLocCd]'), "[선택]", '');
 		
 	});
 	
@@ -532,20 +633,16 @@
 	$('#goodsDetailForm select[name=brandCd]').on('change', function() {
 		var brandCd = $(this).val();
 		//판매수수료율
-		//포인트 적용
-		var params = new Object();
-		params.brandCd = brandCd;
-		cfnAjaxSubmit("/business/brand/list", "json", fnBrandCallback, params);
+		var data = {brandCd : brandCd};
+		var jsonData = JSON.stringify(data);
+		gagajf.ajaxJsonSubmit('/business/brand/list', jsonData, function(result) {
+			if (result != null){
+				$("#goodsDetailForm select[name=distributionGb]").val(result[0].distributionGb); 
+			}
+		});
 			
 	});	
 	
-	// 브랜드
-	var fnBrandCallback = function(result){
-		if (result != null){
-			$("#goodsDetailForm select[name=distributionGb]").val(result[0].distributionGb); 
-		}
-	}
-	
 	//배송비정책변경시
 	$('#goodsDetailForm select[name=delvFeeCd]').on('change', function() {
 		var delvFeeCd = $("#goodsDetailForm select[name=delvFeeCd]").val();
@@ -615,6 +712,93 @@
 
 		$('#goodsDetailForm').find('#notiArea').append(notiHtml);
 	}
+	
+	//안전인증관련 체크
+	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 ("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;	
+			}
+		}
+		
+		if(gagajf.isNull($("#goodsDetailForm select[name=certFormGb]").val())){
+			mcxDialog.alertC("안전인증형태를 선택해 주세요.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$("#goodsDetailForm select[name=certFormGb]").focus();
+				}
+			});
+			return false;
+		}
+		
+		if(gagajf.isNull($("#goodsDetailForm select[name=certType]").val())){
+			mcxDialog.alertC("안전인증타입를 선택해 주세요.", {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$("#goodsDetailForm select[name=certType]").focus();
+				}
+			});
+			return false;
+		}
+		
+		//인증타입이 공급자적합성일 경우 인증번호 미입력
+		if( "G081_1" == $("#goodsDetailForm select[name=certType]").val() || "G081_2" == $("#goodsDetailForm select[name=certType]").val()){
+			if(gagajf.isNull($("#goodsDetailForm input[name=certNum]").val())){
+				mcxDialog.alertC("안전인증번호를 입력해 주세요.", {
+					sureBtnText: "확인",
+					sureBtnClick: function() {
+						$("#goodsDetailForm input[name=certNum]").focus();
+					}
+				});
+				return false;
+			}
+		}
+		
+		return true;
+	}
 
 	//상품저장 버튼 클릭 시
 	$('#btnGoodsDetailSave').click(function() {
@@ -720,7 +904,41 @@
 			return false;
 		}
 		
-		fnGoodsSave();
+		if (!fnGoodsSafetyCertNumCheck()) return false;
+		
+		var dcRate = 0;
+		var listPrice = $("#goodsDetailForm input[name=listPrice]").val().removeComma();
+		var currPrice = $("#goodsDetailForm input[name=currPrice]").val().removeComma();
+		dcRate =  100 - Math.floor(Number(currPrice) / Number(listPrice) * 100);	//절사
+			
+		if (dcRate < 0){
+			mcxDialog.alertC('할인율이 0보다 작습니다.\n판매가를 확인해주세요.', {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$("#goodsDetailForm input[name=currPrice]").focus();
+				}
+			});
+			return false;
+		/* }else if (dcRate >= 90){
+			mcxDialog.confirmC("할인율이 90%이상입니다. 계속하시겠습니까?", {
+				btn: ["아니요","예"],
+				btnClick: function(index){
+					if (index == 1){
+						optCheck = true;
+					} else {
+						fnGoodsSave();
+					}
+				}
+			});
+ */
+		}else{
+			$("#goodsDetailForm").find("#dcRateTxt").html(dcRate);
+			$("#goodsDetailForm input[name=dcRate]").val(dcRate);
+			fnGoodsSave();
+		}
+		
+		if (optCheck) return false;
+		
 		
 	});