Sfoglia il codice sorgente

[ST24PRJ-132][MD개선][상품] SCM 동영상 관리메뉴 생성

jmh 4 anni fa
parent
commit
3b0f55fc8d

+ 17 - 15
src/main/java/com/style24/persistence/mybatis/shop/TssGoods.xml

@@ -3027,7 +3027,7 @@
 
   <!-- 구상 상품등록/저장 -->
   <insert id="saveGoodsCompose" parameterType="GoodsCompose">
-    /* TsaGoods.saveGoodsCompose */
+    /* TssGoods.saveGoodsCompose */
     INSERT INTO TB_GOODS_COMPOSE (
                GOODS_CD
              , COMPS_GOODS_CD
@@ -3074,7 +3074,7 @@
 
   <!-- 구성상품 목록 -->
   <select id="getGoodsDetailComposeList" parameterType="Goods" resultType="GoodsCompose">
-    /* TsaGoods.getGoodsDetailComposeList */
+    /* TssGoods.getGoodsDetailComposeList */
     SELECT A.GOODS_CD
          , A.GOODS_TYPE
          , FN_GET_CODE_NM('G056', A.GOODS_TYPE) AS GOODS_TYPE_NM
@@ -3108,7 +3108,7 @@
 
   <!-- 자사브랜드, 업체 연관정보 확인  -->
   <select id="getBrandSupplyCount" parameterType="Brand" resultType="int">
-    /* TsaGoods.getBrandSupplyCount */
+    /* TssGoods.getBrandSupplyCount */
     SELECT  COUNT(*)
     FROM TB_BRAND B
     INNER JOIN TB_BRAND_SUPPLY BS ON B.BRAND_CD  = BS.BRAND_CD
@@ -3120,7 +3120,7 @@
 
 	<!-- WMS입고상품 목록 건수 -->
 	<select id="getGoodsWmsIncomelotListCount" parameterType="WmsGoods" resultType="int">
-		/* TsaGoods.getGoodsWmsIncomelotListCount */
+		/* TssGoods.getGoodsWmsIncomelotListCount */
 		SELECT COUNT(*)
 		  FROM TB_WMS_GOODS A
 		 INNER JOIN TB_BRAND B ON A.BRAND_NO = B.BRAND_NO
@@ -3150,7 +3150,7 @@
 
 	<!-- WMS입고상품 목록 -->
 	<select id="getGoodsWmsIncomelotList" parameterType="WmsGoods" resultType="WmsGoods">
-		/* TsaGoods.getGoodsWmsIncomelotList */
+		/* TssGoods.getGoodsWmsIncomelotList */
 		SELECT Q.* FROM (
 		    SELECT Z.* FROM (
 		        SELECT A.* FROM (
@@ -3231,7 +3231,7 @@
 
 	<!-- WMS입고단품목록 건수 -->
 	<select id="getGoodsWmsIncomelotSkuListCount" parameterType="IfIncomelot" resultType="int">
-		/* TsaGoods.getGoodsWmsIncomelotSkuListCount */
+		/* TssGoods.getGoodsWmsIncomelotSkuListCount */
 		SELECT COUNT(*)
 		FROM (
 		    SELECT A.LOTNO
@@ -3298,7 +3298,7 @@
 
 	<!-- WMS입고단품목록 -->
 	<select id="getGoodsWmsIncomelotSkuList" parameterType="IfIncomelot" resultType="IfIncomelot">
-		/* TsaGoods.getGoodsWmsIncomelotSkuList */
+		/* TssGoods.getGoodsWmsIncomelotSkuList */
 		SELECT Q.*
 		  FROM (
 		        SELECT Z.*
@@ -3370,7 +3370,7 @@
 	
 	<!-- 상품 동영상 조회 -->
 	<select id="getGoodsVideoList" parameterType="GoodsVideo" resultType="GoodsVideo">
-		/* TsaGoods.getGoodsVideoList */
+		/* TssGoods.getGoodsVideoList */
 		SELECT A.VIDEO_SQ
 		     , A.GOODS_CD
 		     , D.BRAND_ENM
@@ -3432,21 +3432,21 @@
 		      <when test='search != null and search == "searchGoodsNm"'>
 		AND (
 		      <foreach collection="conditionList" item="item" index="index" separator="or">
-		       UPPER(C.GOODS_NM) LIKE CONCAT(UPPER(#{item}),'%')
+		       UPPER(C.GOODS_NM) LIKE CONCAT('%', UPPER(#{item}),'%')
 		      </foreach>
 		     )
 		      </when>
 		       <when test='search != null and search == "searchGoodsNum"'>
 		AND (
 		      <foreach collection="conditionList" item="item" index="index" separator="or">
-		       UPPER(C.GOODS_NUM) LIKE CONCAT(UPPER(#{item}),'%')
+		       UPPER(C.GOODS_NUM) LIKE CONCAT('%', UPPER(#{item}),'%')
 		      </foreach>
 		     )
 		      </when>
 		      <when test='search != null and search == "searchSupplyGoodsCd"'>
 		AND (
 		      <foreach collection="conditionList" item="item" index="index" separator="or">
-		       UPPER(C.SUPPLY_GOODS_CD) LIKE CONCAT(UPPER(#{item}),'%')
+		       UPPER(C.SUPPLY_GOODS_CD) LIKE CONCAT('%', UPPER(#{item}),'%')
 		      </foreach>
 		     )
 		      </when>
@@ -3468,9 +3468,11 @@
 		    </foreach>
 		</if>
 		
+		<if test="supplyCompCd != null and supplyCompCd != ''">
+        AND C.SUPPLY_COMP_CD = #{supplyCompCd}
+        </if>
 		<if test='roleCd != null and roleCd == "G001_B000" '>
         AND C.SELF_GOODS_YN = 'N'    -- 입점상품
-        AND C.SUPPLY_COMP_CD = #{supplyCompCd} -- 입점상품
         </if>
         <if test='roleCd != null and roleCd == "G001_E000" '>
         AND C.SELF_GOODS_YN = 'Y'     -- 자사상품
@@ -3481,7 +3483,7 @@
 
 	<!-- 상품 동영상 노출안함으로 변경 -->
 	<update id="updateNotUseGoodsVideo" parameterType="GoodsVideo">
-		/* TsaGoods.updateNotUseGoodsVideo */
+		/* TssGoods.updateNotUseGoodsVideo */
 		UPDATE TB_GOODS_VIDEO
 		SET DISP_YN = 'N'
 		  , UPD_NO = #{updNo}
@@ -3491,7 +3493,7 @@
 
 	<!-- 동영상  등록 -->
 	<insert id="createGoodsVideo" parameterType="GoodsVideo">
-		/* TsaGoods.createGoodsVideo */
+		/* TssGoods.createGoodsVideo */
 		INSERT INTO TB_GOODS_VIDEO
 		    (
 		           VIDEO_SQ
@@ -3525,7 +3527,7 @@
 
 	<!-- 동영상  수정 -->
 	<update id="updateGoodsVideo" parameterType="GoodsVideo">
-		/* TsaGoods.saveGoodsVideo */
+		/* TssGoods.saveGoodsVideo */
 		UPDATE TB_GOODS_VIDEO SET
 		           DISP_YN = #{dispYn}
 		         , VIDEO_GB = #{videoGb}

+ 7 - 1
src/main/java/com/style24/scm/biz/service/TssGoodsService.java

@@ -4861,6 +4861,9 @@ public class TssGoodsService {
 	public void saveGoodsVideo(GoodsVideo goodsVideo) {
 		GoodsSearch goodsSearch = new GoodsSearch();
 		goodsSearch.setGoodsCd(goodsVideo.getGoodsCd());
+		goodsSearch.setRoleCd(goodsVideo.getRoleCd());
+		goodsSearch.setSupplyCompCd(goodsVideo.getSupplyCompCd());
+		
 		int goodsCnt = goodsDao.getGoodsListCount(goodsSearch);
 		if (goodsCnt <= 0) {
 			throw new IllegalStateException(goodsVideo.getGoodsCd() + "의 상품코드를 확인해 주세요.");
@@ -4893,7 +4896,7 @@ public class TssGoodsService {
 	 * @since 2020. 11. 16
 	 */
 	@Transactional("shopTxnManager")
-	public int saveExcelGoodsVideo(Collection<GagaMap> dataList) {
+	public int saveExcelGoodsVideo(Collection<GagaMap> dataList, GoodsVideo gVideo) {
 
 		int cnt = 0;
 
@@ -4902,6 +4905,9 @@ public class TssGoodsService {
 
 			GoodsSearch goodsSearch = new GoodsSearch();
 			goodsSearch.setGoodsCd(goodsVideo.getGoodsCd());
+			goodsSearch.setRoleCd(gVideo.getRoleCd());
+			goodsSearch.setSupplyCompCd(gVideo.getSupplyCompCd());
+			
 			int goodsCnt = goodsDao.getGoodsListCount(goodsSearch);
 			if (goodsCnt <= 0) {
 				throw new IllegalStateException(goodsVideo.getGoodsCd() + "의 상품코드를 확인해 주세요.");

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

@@ -2230,6 +2230,18 @@ public class TssGoodsController extends TssBaseController {
 	public ModelAndView videoForm() {
 		ModelAndView mav = new ModelAndView();
 
+		// 공급업체
+		String supplyCompCd = "";
+		String selfYn = "Y";
+		if ("G001_B000".equals(TssSession.getInfo().getRoleCd())) {	//입점업체담당자
+			supplyCompCd = TssSession.getInfo().getSupplyCompCd();
+			selfYn = "N";
+		} else if ("G001_E000".equals(TssSession.getInfo().getRoleCd())) {	// 촬영업체
+			supplyCompCd = TssSession.getInfo().getSupplyCompCd();
+			selfYn = "Y";
+		}
+		mav.addObject("supplyCompList", rendererService.getSupplyCompanyList(supplyCompCd, selfYn));
+		
 		mav.setViewName("goods/GoodsVideoForm");
 
 		return mav;
@@ -2251,15 +2263,13 @@ public class TssGoodsController extends TssBaseController {
 			goodsVideo.setSupplyCompCd(TssSession.getInfo().getSupplyCompCd());
 		}
 		
+		goodsVideo.setRoleCd(TssSession.getInfo().getRoleCd());
+		
 		// multi row 검색관련 처리
 		if (!StringUtils.isBlank(goodsVideo.getCondition())) {
 			goodsVideo.setConditionList(goodsVideo.getCondition().replaceAll("\r", "").trim().split("\n"));
 
 		}
-		
-		System.out.println("HMJ1 : "+TssSession.getInfo().getRoleCd());
-		System.out.println("HMJ2 :: "+TssSession.getInfo().getSupplyCompCd());
-		
 
 		if (!StringUtils.isBlank(goodsVideo.getBrandList())) {
 			try {
@@ -2298,6 +2308,10 @@ public class TssGoodsController extends TssBaseController {
 	@PostMapping("/video/save")
 	@ResponseBody
 	public GagaResponse saveGoodsVideo(@RequestBody GoodsVideo goodsVideo) {
+				
+		goodsVideo.setRoleCd(TssSession.getInfo().getRoleCd());
+		goodsVideo.setSupplyCompCd(TssSession.getInfo().getSupplyCompCd());
+		
 		goodsService.saveGoodsVideo(goodsVideo);
 		return super.ok(message.getMessage("SUCC_0001"));
 	}
@@ -2314,6 +2328,10 @@ public class TssGoodsController extends TssBaseController {
 	@PostMapping("/video/excel/save")
 	@ResponseBody
 	public GagaResponse saveExcelGoodsVideo(@RequestBody GoodsVideo goodsVideo) throws Exception {
+
+		goodsVideo.setRoleCd(TssSession.getInfo().getRoleCd());
+		goodsVideo.setSupplyCompCd(TssSession.getInfo().getSupplyCompCd());
+		
 		String[] cellName = null;
 		// DB 처리 시 사용되는 파라미터명(셀명) 설정
 		cellName = new String[2];
@@ -2322,7 +2340,7 @@ public class TssGoodsController extends TssBaseController {
 		String targetPath = GagaFileUtil.getConcatenationPath(env.getProperty("upload.excel.target.path"), "excel");
 		Collection<GagaMap> dataList = GagaExcelUtil.getList(GagaFileUtil.getConcatenationPath(targetPath, goodsVideo.getExcelFileNm()), 0, cellName);
 
-		int cnt = goodsService.saveExcelGoodsVideo(dataList);
+		int cnt = goodsService.saveExcelGoodsVideo(dataList, goodsVideo);
 
 		GagaFileUtil.deleteFile(GagaFileUtil.getConcatenationPath(targetPath, goodsVideo.getExcelFileNm()));
 

+ 23 - 45
src/main/webapp/WEB-INF/views/goods/GoodsVideoForm.html

@@ -41,15 +41,15 @@
 						<col/>
 					</colgroup>
 					<tr>
-						<th>브랜드명</th>
-						<td>
-							<input type="hidden" name="xxxx" value="xxxx"/> <!-- submit 방지 -->
-							<input type="text" class="w100" name="searchTxt" id="searchTxt" maxlength="20" />
-							<button type="button" class="btn icn" id="btnSearchBrand"><i class="fa fa-search"></i></button>
-							<span id="brandText"></span>
-							<input type="hidden" name="brandList"/>
-							
+						<th>업체/브랜드<em class="required" title="필수"></em></th>
+						<td colspan="5">
+							<select name="supplyCompCd" id="supplyCompCd">
+								<option value="" >[전체]</option>
+								<option th:if="${supplyCompList}" th:each="oneData, status : ${supplyCompList}" th:value="${oneData.cd}" th:text="${'[' + oneData.cd + '] ' + oneData.cdNm}"></option>
+							</select>
+							<span id="multiBrand"></span>
 						</td>
+						
 						<th rowspan="2">키워드</th>
 						<td rowspan="2">
 							<select name="search" id="search">
@@ -165,6 +165,7 @@
 <script type="text/javascript" src="/ux/plugins/gaga/gaga.kollus.js"></script>
 <script th:inline="javascript">
 /*<![CDATA[*/
+	var sessRoleCd = [[${sessionInfo.roleCd}]];
 	var videoGbList = {'Y':'유투브', 'M':'MP4'};
 	// specify the columns
 	var columnDefs = [
@@ -315,8 +316,7 @@
 	// 검색조건 초기화
 	$('#btnInit').on('click', function() {
 		$("#searchForm")[0].reset();
-		$('#searchForm input[name=brandList]').val('');
-		$('#searchForm').find('#brandText').html('');
+		$("#multiBrand").empty();
 	});
 	
 	// 선택상품 사용안함
@@ -336,41 +336,6 @@
 		}
 	});
 	
-
-	// 브랜드 조회 선택시
-	$('#btnSearchBrand').on('click', function() {
-		/* if (gagajf.isNull($("#searchForm input[name=searchTxt]").val())){
-			mcxDialog.alert('브랜드 검색어를 입력하세요.');
-			return false;
-		} */
-		cfnOpenBrandListPopup('fnSetBrandInfo', 'M');
-	});
-	
-	// 브랜드 조회 팝업에서 호출
-	var fnSetBrandInfo = function(result) {
-		var arrbrandCd = [];
-		var brandText = "";
-		var bIndex = 0;
-		var brandNm = "";
-		$('#searchForm').find('#brandText').html('');
-		$('#searchForm input[name=searchTxt]').val('');
-		result.forEach(function(brand){
-			bIndex++; 
-			arrbrandCd.push(brand.brandCd);
-			brandNm = brand.brandKnm;
-		});
-
-		// 조회값이 하나일 경우 화면에 코드 노출 그외는 갯수 처리 
-		if (bIndex == 1) {
-			$('#searchForm input[name=searchTxt]').val(brandNm);
-		}else{
-			brandText = bIndex + " 개";
-			$('#searchForm').find('#brandText').html(brandText);	
-		}
-		var jsonData = JSON.stringify(arrbrandCd);
-		$("#searchForm input[name=brandList]").val(jsonData);
-	}
-	
 	// 동영상 저장
 	$("#btnSave").on('click', function() {
 		
@@ -427,6 +392,19 @@
 		gagaKollus.upload('Goods', file, $('input[name=kufKey]'));
 	});
 	
+	//업체변경시
+	$('#searchForm select[name=supplyCompCd]').on('change', function() {
+		var actionUrl = '/renderer/supplyCompany/brand/list/' + $(this).val();
+
+		if(sessRoleCd == "G001_B000"){
+			actionUrl = '/renderer/brand/AuthBrandlist';
+		}
+
+		//$("#searchForm select[name=brandCd] option:gt(0)").remove();
+		//cfnCreateCombo(actionUrl, $('#searchForm select[name=brandCd]'), "[전체]", brandCd);
+		cfnCreateMultiCombo(actionUrl,"multiBrand",  "[전체]",null, 'Y');
+	});
+	
 	$(document).ready(function() {
 		
 		cfnCreateCalendar('#sellTerms', 'stDate', 'edDate', true, '등록일', true);