Explorar el Código

상품상세 안전인증 수정

eskim hace 5 años
padre
commit
9b7cd743b6

+ 3 - 1
src/main/java/com/style24/persistence/domain/Goods.java

@@ -121,8 +121,10 @@ public class Goods extends TscBaseDomain {
 	private String niClsfNm;
 	private String niClsfNm;
 	private String goodsTypeNm;
 	private String goodsTypeNm;
 	private String goodTnmInit;
 	private String goodTnmInit;
+	private String certTargetGb;
+	private String certFormGb;
+	private String certType;
 	private String certNum;
 	private String certNum;
-	private String certDt;
 	private String custGrade;
 	private String custGrade;
 	private String custGradeName;
 	private String custGradeName;
 
 

+ 14 - 2
src/main/java/com/style24/scm/biz/service/TssGoodsService.java

@@ -1990,7 +1990,13 @@ public class TssGoodsService {
 		goodsDao.createCategoryGoods(goods);
 		goodsDao.createCategoryGoods(goods);
 
 
 		// 안전안증작업
 		// 안전안증작업
-		// saveGoodsDetailCertNum(goods);  eskim 20210510
+		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);
 
 
 		this.setGoodsRegResult(goods, goodsMass, procJob);
 		this.setGoodsRegResult(goods, goodsMass, procJob);
 
 
@@ -3636,7 +3642,13 @@ public class TssGoodsService {
 		goodsDao.createCategoryGoods(goods);
 		goodsDao.createCategoryGoods(goods);
 
 
 		// 안전안증작업
 		// 안전안증작업
-		//saveGoodsDetailCertNum(goods); eskim 20210510
+		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); 
 	}
 	}
 
 
 	/**
 	/**

+ 11 - 5
src/main/java/com/style24/scm/biz/web/TssGoodsController.java

@@ -159,7 +159,7 @@ public class TssGoodsController extends TssBaseController {
 		// 입점업체담당자는 업체코드 설정
 		// 입점업체담당자는 업체코드 설정
 		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
 		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
 			goodsSearch.setSupplyCompCd(TssSession.getInfo().getSupplyCompCd());
 			goodsSearch.setSupplyCompCd(TssSession.getInfo().getSupplyCompCd());
-			goodsSearch.setMdNo(TssSession.getInfo().getUserNo().toString());
+//			goodsSearch.setMdNo(TssSession.getInfo().getUserNo().toString());
 		}
 		}
 
 
 		// multi row 검색관련 처리
 		// multi row 검색관련 처리
@@ -199,7 +199,7 @@ public class TssGoodsController extends TssBaseController {
 		// 입점업체담당자는 업체코드 설정
 		// 입점업체담당자는 업체코드 설정
 		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
 		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
 			goodsSearch.setSupplyCompCd(TssSession.getInfo().getSupplyCompCd());
 			goodsSearch.setSupplyCompCd(TssSession.getInfo().getSupplyCompCd());
-			goodsSearch.setMdNo(TssSession.getInfo().getUserNo().toString());
+//			goodsSearch.setMdNo(TssSession.getInfo().getUserNo().toString());
 		}
 		}
 		goodsSearch.setRegNo(TssSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
 		goodsSearch.setRegNo(TssSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
 
 
@@ -374,7 +374,7 @@ public class TssGoodsController extends TssBaseController {
 		// 입점업체담당자는 업체코드 설정
 		// 입점업체담당자는 업체코드 설정
 		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
 		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
 			goodsSearch.setSupplyCompCd(TssSession.getInfo().getSupplyCompCd());
 			goodsSearch.setSupplyCompCd(TssSession.getInfo().getSupplyCompCd());
-			goodsSearch.setMdNo(TssSession.getInfo().getUserNo().toString());
+//			goodsSearch.setMdNo(TssSession.getInfo().getUserNo().toString());
 		}
 		}
 		goodsSearch.setRegNo(TssSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
 		goodsSearch.setRegNo(TssSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
 		result.set("goodsExcelList", goodsService.getGoodsList(goodsSearch));
 		result.set("goodsExcelList", goodsService.getGoodsList(goodsSearch));
@@ -1050,7 +1050,7 @@ public class TssGoodsController extends TssBaseController {
 		// 입점업체담당자는 업체코드 설정
 		// 입점업체담당자는 업체코드 설정
 		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
 		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
 			goodsSearch.setSupplyCompCd(TssSession.getInfo().getSupplyCompCd());
 			goodsSearch.setSupplyCompCd(TssSession.getInfo().getSupplyCompCd());
-			goodsSearch.setMdNo(TssSession.getInfo().getUserNo().toString());
+//			goodsSearch.setMdNo(TssSession.getInfo().getUserNo().toString());
 		}
 		}
 
 
 		// multi row 검색관련 처리
 		// multi row 검색관련 처리
@@ -1173,7 +1173,7 @@ public class TssGoodsController extends TssBaseController {
 		// 입점업체담당자는 업체코드 설정
 		// 입점업체담당자는 업체코드 설정
 		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
 		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {
 			goodsSearch.setSupplyCompCd(TssSession.getInfo().getSupplyCompCd());
 			goodsSearch.setSupplyCompCd(TssSession.getInfo().getSupplyCompCd());
-			goodsSearch.setMdNo(TssSession.getInfo().getUserNo().toString());
+//			goodsSearch.setMdNo(TssSession.getInfo().getUserNo().toString());
 		}
 		}
 
 
 		// multi row 검색관련 처리
 		// multi row 검색관련 처리
@@ -1378,6 +1378,12 @@ public class TssGoodsController extends TssBaseController {
 		mav.addObject("ageGrpCdList", rendererService.getAvailCommonCodeList("G023"));
 		mav.addObject("ageGrpCdList", rendererService.getAvailCommonCodeList("G023"));
 		// 원산지
 		// 원산지
 		mav.addObject("originCdList", rendererService.getAvailCommonCodeList("G076"));
 		mav.addObject("originCdList", rendererService.getAvailCommonCodeList("G076"));
+		// kc인증타입
+		mav.addObject("certTypeList", rendererService.getAvailCommonCodeList("G081"));
+		// kc인증대상구분
+		mav.addObject("certTargetGbList", rendererService.getAvailCommonCodeList("G083"));
+		// kc인증형태구분
+		mav.addObject("certFormGbList", rendererService.getAvailCommonCodeList("G084"));
 		// 년도
 		// 년도
 		int toYear = Integer.parseInt(GagaDateUtil.getToday("yyyy")) - 4;
 		int toYear = Integer.parseInt(GagaDateUtil.getToday("yyyy")) - 4;
 		mav.addObject("styleYearList", rendererService.getYearList(toYear, 0, 5));
 		mav.addObject("styleYearList", rendererService.getYearList(toYear, 0, 5));

+ 5 - 3
src/main/webapp/WEB-INF/views/goods/GoodsDetailForm.html

@@ -967,11 +967,13 @@
 			if ("G056_S" == result.goodsType){
 			if ("G056_S" == result.goodsType){
 				if (result.selfGoodsYn == "Y") $('#goodsDetailForm #goodsComposeTab').css('display','block');
 				if (result.selfGoodsYn == "Y") $('#goodsDetailForm #goodsComposeTab').css('display','block');
 				$('#goodsDetailForm #goodsNotiTab').css('display','none');
 				$('#goodsDetailForm #goodsNotiTab').css('display','none');
+				$('#goodsDetailForm #goodsSafeTab').css('display','none');
 				$('#goodsDetailForm input[name=sellFeeRate]').attr('readonly', true);
 				$('#goodsDetailForm input[name=sellFeeRate]').attr('readonly', true);
 				$('#goodsDetailForm input[name=currPrice]').attr('readonly', true);
 				$('#goodsDetailForm input[name=currPrice]').attr('readonly', true);
 			}else if ("G056_D" == result.goodsType){
 			}else if ("G056_D" == result.goodsType){
 				if (result.selfGoodsYn == "Y") $('#goodsDetailForm #goodsComposeTab').css('display','block');
 				if (result.selfGoodsYn == "Y") $('#goodsDetailForm #goodsComposeTab').css('display','block');
 				$('#goodsDetailForm #goodsNotiTab').css('display','none');
 				$('#goodsDetailForm #goodsNotiTab').css('display','none');
+				$('#goodsDetailForm #goodsSafeTab').css('display','none');
 				$('#goodsDetailForm input[name=sellFeeRate]').attr('readonly', true);
 				$('#goodsDetailForm input[name=sellFeeRate]').attr('readonly', true);
 			}
 			}
 			
 			
@@ -991,7 +993,7 @@
 			//정보고시
 			//정보고시
 			fnGoodsDetailNotiInfoSearch(params);
 			fnGoodsDetailNotiInfoSearch(params);
 			//구매등급
 			//구매등급
-			fnGoodsDetailOrderGradeSearch(params);
+			// fnGoodsDetailOrderGradeSearch(params);
 			//안전인증
 			//안전인증
 			fnGoodsDetailSafeNoSearch();
 			fnGoodsDetailSafeNoSearch();
 			//구성상품
 			//구성상품
@@ -1067,7 +1069,7 @@
 			$("#goodsDetailForm input:radio[name=certTargetGb]:input[value='G083_3']").trigger('click');
 			$("#goodsDetailForm input:radio[name=certTargetGb]:input[value='G083_3']").trigger('click');
 		}
 		}
 		$("#goodsDetailForm input[name=orgCertTargetGb]").val(result.certTargetGb);
 		$("#goodsDetailForm input[name=orgCertTargetGb]").val(result.certTargetGb);
-		$("#goodsDetailForm select[name=certFormGb]").val(result.certFormGb);
+		$("#goodsDetailForm select[name=certFormGb]").val(result.certFormGb); 
 		$("#goodsDetailForm input[name=orgCertFormGb]").val(result.certFormGb);
 		$("#goodsDetailForm input[name=orgCertFormGb]").val(result.certFormGb);
 		$("#goodsDetailForm select[name=certType]").val(result.certType);
 		$("#goodsDetailForm select[name=certType]").val(result.certType);
 		$("#goodsDetailForm input[name=orgCertType]").val(result.certType);
 		$("#goodsDetailForm input[name=orgCertType]").val(result.certType);
@@ -2060,7 +2062,7 @@
 		}
 		}
 		
 		
 		// 인증대상이 아니면 스킵
 		// 인증대상이 아니면 스킵
-		if ("G083_1" != $("#goodsDetailForm  input[name=certTargetGb]").val()){
+		if ("G083_1" != $("#goodsDetailForm input[name=selCertTargetGb]:checked").val()){
 			return true;
 			return true;
 		}
 		}
 		
 		

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

@@ -84,6 +84,7 @@
 							<li><a href="#goodstab2">옵션/재고정보</a></li>
 							<li><a href="#goodstab2">옵션/재고정보</a></li>
 							<li><a href="#goodstab3">상품상세정보</a></li>
 							<li><a href="#goodstab3">상품상세정보</a></li>
 							<li><a href="#goodstab4">고시정보</a></li>
 							<li><a href="#goodstab4">고시정보</a></li>
+							<li><a href="#goodstab5">안전인증</a></li>
 						</ul>
 						</ul>
 					</div>
 					</div>
 					<!-- //TABS NAVI -->
 					<!-- //TABS NAVI -->
@@ -295,12 +296,8 @@
 										</td>
 										</td>
 									</tr>
 									</tr>
 									<tr>
 									<tr>
-										<th>안전인증번호</th>
-										<td>
-											<input type="text" class="w150" id="certNum" name="certNum"  maxlength="20"/>
-										</td>
 										<th>판매기간<em class="required" title="필수"></em></th>
 										<th>판매기간<em class="required" title="필수"></em></th>
-										<td colspan="3">
+										<td colspan="5">
 											<input name="sellStYMD" id="sellStYMD" type="text" class="w80 schDate" maxlength="10" required="required" data-valid-name="판매시작일" />
 											<input name="sellStYMD" id="sellStYMD" type="text" class="w80 schDate" maxlength="10" required="required" data-valid-name="판매시작일" />
 											<select name="sellStHH" id="sellStHH" required="required" data-valid-name="판매 시작시간">
 											<select name="sellStHH" id="sellStHH" required="required" data-valid-name="판매 시작시간">
 												<th:block th:each="num, index  : ${#numbers.sequence(0,23)}">
 												<th:block th:each="num, index  : ${#numbers.sequence(0,23)}">
@@ -494,6 +491,67 @@
 							<!-- //TAB4 CONTENTS AREA -->
 							<!-- //TAB4 CONTENTS AREA -->
 						</li>
 						</li>
 						<!-- //TAB4 : 고시정보 -->
 						<!-- //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>
 					</ul>
 					<!-- //TABS CONTENTS -->
 					<!-- //TABS CONTENTS -->
 					
 					
@@ -751,6 +809,63 @@
 		$('#optionList').append(addOptionHtml);
 		$('#optionList').append(addOptionHtml);
 	});
 	});
 	
 	
+	//안전인증관련 체크
+	var fnGoodsSafetyCertNumCheck = function(){
+		
+		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()){
+			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_3" != $("#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;
+			}
+		}
+		
+		$("#goodsDetailForm input[name=certTargetGb]").val($("#goodsDetailForm input[name=selCertTargetGb]:checked").val());
+		
+		return true;
+	}
+	
 	//상품저장 버튼 클릭 시
 	//상품저장 버튼 클릭 시
 	$('#btnGoodsDetailSave').click(function() {
 	$('#btnGoodsDetailSave').click(function() {
 
 
@@ -1023,6 +1138,8 @@
 			return false;
 			return false;
 		}
 		}
 		
 		
+		if (!fnGoodsSafetyCertNumCheck()) return false;
+		
 		var dcRate = 0;
 		var dcRate = 0;
 		var listPrice = $("#goodsDetailForm input[name=listPrice]").val().removeComma();
 		var listPrice = $("#goodsDetailForm input[name=listPrice]").val().removeComma();
 		var currPrice = $("#goodsDetailForm input[name=currPrice]").val().removeComma();
 		var currPrice = $("#goodsDetailForm input[name=currPrice]").val().removeComma();
@@ -1081,6 +1198,7 @@
 		$("#goodsDetailForm input[name=notiList]").val(JSON.stringify(goodsInfoList));
 		$("#goodsDetailForm input[name=notiList]").val(JSON.stringify(goodsInfoList));
 	}
 	}
 
 
+	
 	//저장처리
 	//저장처리
 	var fnGoodsSave = function(){
 	var fnGoodsSave = function(){
 		mcxDialog.confirm('저장하시겠습니까?', {
 		mcxDialog.confirm('저장하시겠습니까?', {