Explorar o código

입점 딜상품 생성 관련 수정

eskim %!s(int64=5) %!d(string=hai) anos
pai
achega
5a032d01e0

+ 7 - 18
src/main/java/com/style24/admin/biz/service/TsaGoodsService.java

@@ -844,14 +844,6 @@ public class TsaGoodsService {
 		String goodsNumFlag = "";
 		for (Goods goods : goodsList) {
 
-			if (!StringUtils.isBlank(goodsCdFlag) && !StringUtils.isBlank(goodsNumFlag)) {
-				throw new IllegalStateException("상품코드와 원코드 중 한 개의 셀에만 값을 입력해서 조회하세요.");
-			}
-
-			if (!StringUtils.isBlank(goods.getSupplyCompCd())) {
-				goods.setGoodsCd(goods.getSupplyCompCd());
-			}
-
 			SearchData searchData = new SearchData();
 			searchData.setRegNo(goods.getRegNo());
 			searchData.setSearchCd(goods.getGoodsCd());
@@ -1376,14 +1368,10 @@ public class TsaGoodsService {
 		regGoods.setGoodsStat("G008_20"); // 정보부족
 		regGoods.setFormalGb("G009_10"); // 정상 기본값 처리
 		regGoods.setGoodsGb("G073_11"); // 자사상품은 신규
-		regGoods.setDistributionGb("G065_12"); // 유통구분
+		//regGoods.setDistributionGb("G065_12"); // 유통구분
 		regGoods.setTaxGb("10"); // 과세구분
 		regGoods.setGoodsNum(goodsCd);
 
-		regGoods.setListPrice(goods.getCurrPrice());
-		regGoods.setCurrPrice(goods.getCurrPrice());
-		regGoods.setDcRate((int)(this.getDcRate(goods.getCurrPrice(), goods.getCurrPrice())));
-
 		Collection<GoodsCompose> goodsComposeList = null;
 		try {
 			goodsComposeList = mapper.readValue(goods.getGoodsComposeList(), new TypeReference<Collection<GoodsCompose>>() {
@@ -1417,6 +1405,7 @@ public class TsaGoodsService {
 			if ("Y".equals(goodsCompose.getRepYn())) {
 				regGoods.setListPrice(extendGoods.getCurrPrice());
 				regGoods.setCurrPrice(extendGoods.getCurrPrice());
+				regGoods.setDcRate((int)(this.getDcRate(goods.getCurrPrice(), goods.getCurrPrice())));
 			}
 		}
 
@@ -1458,7 +1447,7 @@ public class TsaGoodsService {
 		regGoods.setGoodsStat("G008_20"); // 정보부족
 		regGoods.setFormalGb("G009_10"); // 정상 기본값 처리
 		regGoods.setGoodsGb("G073_11"); // 자사상품은 신규
-		regGoods.setDistributionGb("G065_12"); // 유통구분
+		//regGoods.setDistributionGb("G065_12"); // 유통구분
 		regGoods.setTaxGb("10"); // 과세구분
 		regGoods.setGoodsNum(goodsCd);
 
@@ -1525,6 +1514,7 @@ public class TsaGoodsService {
 
 		float pntPrate = 0f;
 		float pntMrate = 0f;
+		String distributionGb = "";
 		for (Brand tmpBrand : brandList) {
 
 			if ("G009_10".equals(regGoods.getFormalGb())) {
@@ -1534,11 +1524,12 @@ public class TsaGoodsService {
 				pntPrate = tmpBrand.getPntPrate20();
 				pntMrate = tmpBrand.getPntMrate20();
 			}
+			distributionGb = tmpBrand.getDistributionGb() ; // 유통구분
 		}
 
 		regGoods.setPntPrate(pntPrate); // 포인트적립율(PC)
 		regGoods.setPntMrate(pntMrate); // 포인트적립율(MOBILE)
-
+		regGoods.setDistributionGb(distributionGb); // 유통구분
 		//regGoods.setSelfGoodsYn("Y");
 
 		SupplyCompany supplyCompany = new SupplyCompany();
@@ -1582,9 +1573,7 @@ public class TsaGoodsService {
 		regGoods.setGoodsSnm(goodsSnm);
 		goodsDao.updateGoodsSnm(regGoods);
 
-		// 카테고리 전시
-		// 추후 작업 해야함 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-		//goodsDao.createCategoryGoods(regGoods);
+		goodsDao.createCategoryGoods(regGoods);
 
 	}
 

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

@@ -728,7 +728,7 @@ public class TsaGoodsController extends TsaBaseController {
 		String targetPath = GagaFileUtil.getConcatenationPath(env.getProperty("upload.excel.target.path"), "excel");
 
 		// DB 처리 시 사용되는 파라미터명(셀명) 설정
-		String[] cellName = {"goodsCd", "supplyGoodsCd"};
+		String[] cellName = {"goodsCd"};
 
 		Collection<GagaMap> ecxelGoodsList = GagaExcelUtil.getList(GagaFileUtil.getConcatenationPath(targetPath, goods.getExcelFileNm()), 0, cellName, 0);
 

+ 1 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsaGoods.xml

@@ -1849,6 +1849,7 @@
 		         , COMPS_GOODS_OPT_NM = #{compsGoodsOptNm}
 		         , COMPS_CURR_PRICE = (CASE WHEN #{goodsType} = 'G056_S' THEN #{compsCurrPrice}
 		                                    ELSE 0 END)
+		         , REP_YN = #{repYn}
 		         , USE_YN = #{useYn}
 		         , UPD_NO = #{updNo}
 		         , UPD_DT = NOW()

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

@@ -1131,7 +1131,7 @@
 				$('#goodsDetailForm input[name=listPrice]').attr('readonly', true);
 				$('#goodsDetailForm input[name=currPrice]').attr('readonly', true);
 			}else if ("G056_D" == result.goodsType){
-				if (result.selfGoodsYn == "Y") $('#goodsDetailForm #goodsComposeTab').css('display','block');
+				$('#goodsDetailForm #goodsComposeTab').css('display','block');
 				$('#goodsDetailForm #goodsNotiTab').css('display','none');
 				$('#goodsDetailForm #goodsSafeTab').css('display','none');
 				$('#goodsDetailForm input[name=sellFeeRate]').attr('readonly', true);
@@ -1206,9 +1206,21 @@
 			gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'compsCurrPrice', false);
 			gagaAgGrid.showOrHideColumn(gridGoodsComposeOptions, 'compsCurrPriceOrg', false);
 		}
-		gagaAgGrid.fetch("/goods/detail/compose/list?goodsCd=" + params.goodsCd , gridGoodsComposeOptions);
+		gagaAgGrid.fetch("/goods/detail/compose/list?goodsCd=" + params.goodsCd , gridGoodsComposeOptions , null, fnGoodsComposeListSearchCallBack);
 	}
 	
+	var fnGoodsComposeListSearchCallBack = function(){
+		var allData = gagaAgGrid.getAllRowData(gridGoodsComposeOptions);
+		$.each(allData, function(index, item) { 
+			if (item.repYn == "Y"){
+				$("#goodsDetailForm input[name=repGoodsCd]").val(item.repGoodsCd);	// 대표상품
+				return false;
+			}
+		});	
+			
+	}
+	
+	
 	//이력
 	var fnGoodsDetailHstSearch = function() {
 		gagaAgGrid.fetch("/goods/detail/hst/list?goodsCd=" + $('#goodsDetailForm input[name=goodsCd]').val() , gridGoodsHstoryOptions);
@@ -2007,7 +2019,7 @@
 				checkRepYn = true;
 			}
 			
-			if (comSelfGoodsYn != item.selfGoodsYn){
+			if (comSelfGoodsYn != item.selfGoodsYn && "G056_S" == $("#goodsDetailForm input[name=goodsType]").val()){
 				optCheck = true;
 				mcxDialog.alertC("구성상품중 자사/입점상품 구분값이 다릅니다.<br/>확인해 주세요", {
 					sureBtnText: "확인",