Browse Source

세트상품 구성

eskim 5 years ago
parent
commit
a47499eaf3

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

@@ -1396,6 +1396,7 @@ public class TsaGoodsService {
 		regGoods.setFormalGb("G009_10"); // 정상 기본값 처리
 		regGoods.setGoodsGb("G073_11"); // 자사상품은 신규
 		regGoods.setDistributionGb("G065_12"); // 유통구분
+		regGoods.setTaxGb("10"); // 과세구분
 		regGoods.setGoodsNum(goodsCd);
 
 		Collection<GoodsCompose> goodsComposeList = null;
@@ -1420,7 +1421,7 @@ public class TsaGoodsService {
 			if (StringUtils.isEmpty(extendGoods.getBrandCd())) {
 				throw new IllegalStateException(message.getMessage("구성상품 중 " + goodsCompose.getCompsGoodsCd() + " 상품 정보를 확인해 주세요."));
 			}
-			listPriceSum += extendGoods.getListPrice();
+			listPriceSum += extendGoods.getListPrice() * goodsCompose.getQty() ;
 			currPriceSum += goodsCompose.getCompsCurrPrice(); // 입력값
 
 			if ("Y".equals(goodsCompose.getBaseYn())) {
@@ -1434,6 +1435,7 @@ public class TsaGoodsService {
 
 		regGoods.setListPrice(listPriceSum);
 		regGoods.setCurrPrice(currPriceSum);
+		regGoods.setCostPrice(0);	// 원가 0원처리
 		regGoods.setDcRate((int)(this.getDcRate(listPriceSum, currPriceSum)));
 
 		this.createGoodsExtend(regGoods, goodsComposeList); // 세트상품 관련 정보 저장

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

@@ -481,7 +481,7 @@ public class TsaGoodsController extends TsaBaseController {
 	@ResponseBody
 	public GagaMap getGoodsList(@RequestBody GoodsSearch goodsSearch) {
 
-		log.info("[getGoodsList] goodsSearch=>{}", goodsSearch);
+
 		GagaMap result = new GagaMap();
 
 		// 입점업체담당자는 업체코드 설정
@@ -500,7 +500,7 @@ public class TsaGoodsController extends TsaBaseController {
 				goodsSearch.setSearchGb("MASTER");
 			}
 		}
-
+		log.info("[getGoodsList] goodsSearch=>{}", goodsSearch);
 		goodsSearch.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
 		goodsSearch.setPageable(new TsaPageRequest(goodsSearch.getPageNo() - 1, goodsSearch.getPageSize()));
 		goodsSearch.getPageable().setTotalCount(goodsService.getGoodsListCount(goodsSearch));
@@ -988,8 +988,6 @@ public class TsaGoodsController extends TsaBaseController {
 
 		// 사용여부
 		mav.addObject("useYnList", rendererService.getAvailCommonCodeList("G002"));
-		// 정상이월
-		mav.addObject("formalGbList", rendererService.getAvailCommonCodeList("G009"));
 		// 성별
 		mav.addObject("sexGbList", rendererService.getAvailCommonCodeList("G007"));
 		// 시즌
@@ -997,16 +995,11 @@ public class TsaGoodsController extends TsaBaseController {
 		// 스타일년도
 		int toYear = Integer.parseInt(GagaDateUtil.getToday("yyyy")) - 4;
 		mav.addObject("styleYearList", rendererService.getYearList(toYear, 0, 5));
-		// 매입유형
-		mav.addObject("buyingTypeList", rendererService.getAvailCommonCodeList("G035"));
-		// 색상
-//		Color color = new Color();
-//		mav.addObject("colorCdList", rendererService.getColorList(color));
 		// 상품상태
 		String[] exceptCds = {"G008_00"};
 		mav.addObject("goodsStatList", rendererService.getCommonCodeList("G008", "Y", exceptCds));
 		// 원산지
-		mav.addObject("makOriginList", rendererService.getAvailCommonCodeList("G076"));
+		mav.addObject("originCdList", rendererService.getAvailCommonCodeList("G076"));
 
 		mav.addObject("params", goods);
 		mav.setViewName("goods/GoodsSetForm");
@@ -1924,7 +1917,7 @@ public class TsaGoodsController extends TsaBaseController {
 				goodsSearch.setSearchGb("MASTER");
 			}
 		}
-
+		log.info("[getPopupGoodsList] goodsSearch=>{}", goodsSearch);
 		goodsSearch.setRegNo(TsaSession.getInfo().getUserNo()); // 엑셀조회시 로그인 사용자의 엑셀 상품조회시 사용
 		goodsSearch.setPageable(new TsaPageRequest(goodsSearch.getPageNo() - 1, goodsSearch.getPageSize()));
 		goodsSearch.getPageable().setTotalCount(goodsService.getGoodsListCount(goodsSearch));

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

@@ -69,7 +69,7 @@ public class Goods extends TscBaseDomain {
 	private String erpPriceLinkYn;		//ERP가격연계여부(자사상품만 사용. Y:연계)
 	private String erpStockLinkYn;		//ERP재고연계여부(자사상품만 사용. Y:연계)
 	private String newCustOrdYn;		//신규고객 구매가능여부(Y:신규고객만 구매가능)
-	private String costPrice;		//원가
+	private int costPrice;		//원가
 	private String adultYn;		//성인용품여부
 
 	private String brandEnm;		//브랜드영문명

+ 3 - 5
style24.admin/src/main/java/com/style24/persistence/mybatis/shop/TsaGoods.xml

@@ -1527,8 +1527,7 @@
 		  , SUPPLY_COMP_CD
 		  , SUPPLY_GOODS_CD
 		  , AGE_GRP_CD
-		  , DELV_FEE
-		  , MIN_ORD_AMT
+		  , DELV_FEE_CD
 		  , PNT_PRATE
 		  , PNT_MRATE
 		  , SELL_FEE_RATE
@@ -1571,14 +1570,13 @@
 		  , #{supplyCompCd}
 		  , #{supplyGoodsCd}
 		  , #{ageGrpCd}
-		  , #{delvFee}
-		  , #{minOrdAmt}
+		  , #{delvFeeCd}
 		  , #{pntPrate}
 		  , #{pntMrate}
 		  , #{sellFeeRate}
 		  , #{formalGb}
 		  , NVL(#{giftPackYn},'N')
-		  , #{mriginCd}
+		  , #{originCd}
 		  , #{makeYmd}
 		  , #{taxGb}
 		  , NVL(#{erpStockLinkYn},'N')

+ 1 - 0
style24.admin/src/main/webapp/WEB-INF/views/goods/GoodsDealForm.html

@@ -169,6 +169,7 @@
 	var gridGoodsDealOptions = gagaAgGrid.getGridOptions(columnGoodsDealDefs);
 	gridGoodsDealOptions.rowSelection = 'multiple';
 	gridGoodsDealOptions.suppressRowClickSelection = true;
+	gridGoodsSetOptions.stopEditingWhenGridLosesFocus = true;
 	
 	// 드래그
 	gridGoodsDealOptions.rowDragManaged = true;

+ 7 - 0
style24.admin/src/main/webapp/WEB-INF/views/goods/GoodsPopupListForm.html

@@ -367,6 +367,13 @@
 	var fnPopupGoodsSearch = function() {
 
 		var formId = '#goodsPopupForm';
+		
+		if (typeof(gbn) != 'undefined' &&  gbn == 'EXCEL'){
+			$("#goodsPopupForm input[name=searchGb]").val("EXCEL");
+		}else{
+			$("#goodsPopupForm input[name=searchGb]").val("BASIC");
+		}
+		
 		// Fetch data
 		//gagaAgGrid.fetch($(formId).prop('action'), popupGoodsGridOptions, formId, fnPopupGoodsSearchCallBack);
 

+ 27 - 33
style24.admin/src/main/webapp/WEB-INF/views/goods/GoodsSetForm.html

@@ -31,14 +31,12 @@
 							<span class="left" style="width:400px; text-align:left;">
 							<!-- class="left" 또는 class="right" -->
 								- 상품상태 : 정보부족<br/>
-								- TAG가 : 구성상품의 TAG가 합<br/>
 								- 정상가 : 구성상품의 정상가 합<br/>
 								- 판매가 : 구성상품 판매가 입력값의 합<br/>
 								- 브랜드코드 : 구성상품의 기준여부 'Y'상품의 브랜드코드<br/>
 								- 품목코드 : 구성상품의 기준여부 'Y'상품의 품목코드<br/>
 								- 포인트 : 구성상품의 기준여부 'Y'상품의 브랜드 포인트<br/>
-								- 기본배송비 : 구성상품의 기준여부 'Y'상품의 브랜드 기본배송비<br/>
-								- 무료배송비기준 : 구성상품의 기준여부 'Y'상품의 브랜드 무료배송비기준<br/>
+								- 배송비정책 : 구성상품의 기준여부 'Y'상품의 브랜드 배송비정책<br/>
 							</span>
 						</div>
 						<!-- //아이콘 툴팁 --> 
@@ -47,25 +45,25 @@
 				<table class="frmStyle">
 					<colgroup>
 						<col width="10%"/>
-						<col/>
+						<col width="15%"/>
+						<col width="10%"/>
+						<col width="15%"/>
 						<col width="10%"/>
-						<col width="23%"/>
+						<col width="15%"/>
 						<col width="10%"/>
-						<col width="23%"/>
+						<col/>
 					</colgroup>
 					<tr>
 						<th>상품명<em class="required" title="필수"></em></th>
-						<td><input type="text" id="goodsNm" name="goodsNm" maxlength="60"/></td>
-						<th>자사노출여부<em class="required" title="필수"></em></th>
-						<td><label class="rdoBtn"><input type="radio" name="selfMallYn" id="selfMallYnY" value="Y" checked/>Y</label>
-							<label class="rdoBtn"><input type="radio" name="selfMallYn" id="selfMallYnN" value="N"/>N</label>
-						</td>
+						<td colspan="3"><input class="w50p" type="text" id="goodsNm" name="goodsNm" maxlength="60"/></td>
 						<th>성별<em class="required" title="필수"></em></th>
 						<td><select  name="sexGb" id="sexGb">
 								<option value="">[전체]</option>
 								<option th:if="${sexGbList}" th:each="oneData, status : ${sexGbList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
 							</select>
 						</td>
+						<th>제조년월일<em class="required" title="필수"></em></th>
+						<td><input type="text" class="w100" id="makeYmd" name="makeYmd" maxlength="8" data-valid-type="date"/></td>
 					</tr>
 					<tr>
 						<th>년도/시즌<em class="required" title="필수"></em></th>
@@ -79,15 +77,11 @@
 								<option th:if="${seasonList}" th:each="oneData, status : ${seasonList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
 							</select>
 						</td>
-						<th>제조년월일<em class="required" title="필수"></em></th>
-						<td><input type="text" class="w100" id="makeYmd" name="makeYmd" maxlength="8" data-valid-type="date"/></td>
-					</tr>
-					<tr>
 						<th>원산지<em class="required" title="필수"></em></th>
-						<td colspan="5">
-							<select name="makeOriginCd" id="makeOriginCd">
+						<td colspan="3">
+							<select name="originCd" id="originCd">
 								<option value="">[전체]</option>
-								<option th:if="${makOriginList}" th:each="oneData, status : ${makOriginList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+								<option th:if="${originCdList}" th:each="oneData, status : ${originCdList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
 							</select>
 							<input type="hidden" id="makeNm" name="makeNm" />
 						</td>
@@ -158,13 +152,16 @@
 			cellEditorParams: { values: gagaAgGrid.extractValues(goodsStatList) },
 			valueFormatter: function (params) { return gagaAgGrid.lookupValue(goodsStatList, params.value); },
 			valueParser: function (params) { return gagaAgGrid.lookupKey(goodsStatList, params.newValue); }
-		}
+		},
+		{headerName: "업체", field: "supplyCompCd" , width: 80, cellClass: 'text-right',hide: true}
+		
 	];
 
 	// Get GridOptions
 	var gridGoodsSetOptions = gagaAgGrid.getGridOptions(columnGoodsSetDefs);
 	gridGoodsSetOptions.rowSelection = 'multiple';
 	gridGoodsSetOptions.suppressRowClickSelection = true;
+	gridGoodsSetOptions.stopEditingWhenGridLosesFocus = true;
 	
 	// 드래그
 	gridGoodsSetOptions.rowDragManaged = true;
@@ -228,9 +225,15 @@
 		var isExist = false;
 		goodsData.forEach(function(goods){
 			isExist = false;
-
+			
 			gridGoodsSetOptions.api.forEachNode(function(rowNode, index) {
-				if (goods.goodsCd == rowNode.data.extendGoodsCd){
+				//중복상품 여부 확인
+				if (goods.goodsCd == rowNode.data.compsGoodsCd){
+					isExist = true;
+				}
+				debugger;
+				//같은 업체만 가능
+				if (goods.supplyCompCd != rowNode.data.supplyCompCd){
 					isExist = true;
 				}
 			});
@@ -252,6 +255,7 @@
 						, useYn: 'Y'
 						, goodsNm : goods.goodsNm
 						, selfGoodsYn : goods.selfGoodsYn
+						, supplyCompCd : goods.supplyCompCd
 						, imgType : goods.imgType
 						, imgPath1 : goods.imgPath1
 						, imgPath6 : goods.imgPath6
@@ -295,16 +299,6 @@
 			return false;
 		}
 		
-		if (gagajf.isNull($("#goodsSetForm input[name=selfMallYn]").val())){
-			mcxDialog.alertC('자사노출여부를 선택해 주세요.', {
-				sureBtnText: "확인",
-				sureBtnClick: function() {
-					$("#goodsSetForm input[name=selfMallYn]").focus();
-				}
-			});	
-			return false;
-		}
-		
 		if(gagajf.isNull($("#goodsSetForm select[name=styleYear]").val())){
 			mcxDialog.alertC('년도을 선택해 주세요.', {
 				sureBtnText: "확인",
@@ -335,11 +329,11 @@
 			return false;
 		}
 		
-		if(gagajf.isNull($("#goodsSetForm select[name=makeOriginCd]").val())){
+		if(gagajf.isNull($("#goodsSetForm select[name=originCd]").val())){
 			mcxDialog.alertC('원산지를 입력해 주세요.', {
 				sureBtnText: "확인",
 				sureBtnClick: function() {
-					$("#goodsSetForm select[name=makeOriginCd]").focus();
+					$("#goodsSetForm select[name=originCd]").focus();
 				}
 			});	
 			return false;

+ 1 - 1
style24.scm/src/main/java/com/style24/persistence/mybatis/shop/TssGoods.xml

@@ -1180,7 +1180,7 @@
 		  , #{sellFeeRate}
 		  , #{formalGb}
 		  , NVL(#{giftPackYn},'N')
-		  , #{mriginCd}
+		  , #{originCd}
 		  , #{makeYmd}
 		  , #{taxGb}
 		  , NVL(#{erpStockLinkYn},'N')