Selaa lähdekoodia

Merge branch 'style' into ST24PRJ-132

jmh 4 vuotta sitten
vanhempi
commit
cf457ce404

+ 9 - 0
src/main/java/com/style24/persistence/mybatis/shop/TssLogin.xml

@@ -82,6 +82,15 @@
 		        OR ROLE_CD LIKE 'G001_D%'
 		        OR ROLE_CD LIKE 'G001_F%') /*입점업체벤더담당자, 촬영업체담당자, 제휴채널담당자, 직송매장담당자*/
 		AND    USE_YN = 'Y'
+		AND    (
+		        ROLE_CD LIKE 'G001_B%'
+		        AND
+		        EXISTS (SELECT 1
+		                FROM   TB_SUPPLY_VENDOR
+		                WHERE  SUPPLY_VENDOR_CD = A.ROLE_REF_VAL
+		                AND    USE_YN = 'Y'
+		               )
+		       )
 	</select>
 	
 	<!-- 로그인실패 남기기 -->

+ 11 - 0
src/main/java/com/style24/persistence/mybatis/shop/TssPlan.xml

@@ -554,6 +554,17 @@
 		</if>
 	</update>
 	
+	<!-- 기획전 코너 상품 순서변경 -->
+	<update id="updatePlanCornerGoods" parameterType="Plan">
+		/* TsaPlan.updatePlanCornerGoods */
+		UPDATE TB_PLAN_GOODS
+		SET  UPD_DT = now()
+			 , UPD_NO  = #{updNo}
+		     , DISP_ORD = #{dispOrd}
+		WHERE  PLAN_DTL_SQ = #{planDtlSq}
+		AND    GOODS_CD = #{goodsCd}
+	</update>
+	
 	<select id="getPlanContentsCount" parameterType="Plan" resultType="int">
 		/* TssPlan.getPlanContentsCount */
 		SELECT COUNT(*) AS CNT

+ 9 - 0
src/main/java/com/style24/scm/biz/dao/TssPlanDao.java

@@ -205,6 +205,15 @@ public interface TssPlanDao {
 	 */
 	void deletePlanCornerGoods(Plan param);
 	
+	/**
+	 * 기획전 코너 상품 수정
+	 *
+	 * @param 
+	 * @author jmh
+	 * @since 2021. 12. 03
+	 */
+	void updatePlanCornerGoods(Plan param);
+	
 	/**
 	 * 기획전 템플릿 리스트 카운트 조회
 	 * @param  param

+ 17 - 0
src/main/java/com/style24/scm/biz/service/TssGoodsService.java

@@ -2874,6 +2874,23 @@ public class TssGoodsService {
 					goods.setGoodsStat("10");
 					break;
 				}
+
+				if (StringUtils.length(arrOptCd[0]) > 66) {
+					goods.setGoodsRegMsg("옵션(SKU) " + (i + 1) + "번째 옵션1명 길이 오류");
+					goods.setGoodsStat("10");
+				}
+
+				// 옵션2 - 필수
+				if (StringUtils.isBlank(arrOptCd[1])) {
+					goods.setGoodsRegMsg("옵션(SKU) " + (i + 1) + "번째 옵션2 정보없음");
+					goods.setGoodsStat("10");
+					break;
+				}
+				if (StringUtils.length(arrOptCd[0]) > 66) {
+					goods.setGoodsRegMsg("옵션(SKU) " + (i + 1) + "번째 옵션2명 길이 오류");
+					goods.setGoodsStat("10");
+				}
+
 				// 추가금액 - 필수
 				if (StringUtils.isBlank(arrOptCd[2])) {
 					goods.setGoodsRegMsg("옵션(SKU) " + (i + 1) + "번째 추가금액 정보없음");

+ 16 - 0
src/main/java/com/style24/scm/biz/service/TssPlanService.java

@@ -582,6 +582,22 @@ public class TssPlanService {
 		}
 	}
 	
+	/**
+	 * 기획전 코너 상품 수정
+	 *
+	 * @param
+	 * @return
+	 * @author jmh
+	 * @since 2021. 12. 03
+	 */
+	@Transactional("shopTxnManager")
+	public void updatePlanCornerGoods(Collection<Plan> paramList) {
+		for (Plan cornerInfo : paramList) {
+			cornerInfo.setUpdNo(TssSession.getInfo().getUserNo());
+			planDao.updatePlanCornerGoods(cornerInfo);
+		}
+	}
+	
 	/**
 	 * 기획전 템플릿 목록 카운트 조회
 	 * @param  param

+ 14 - 0
src/main/java/com/style24/scm/biz/web/TssMarketingController.java

@@ -369,6 +369,20 @@ public class TssMarketingController extends TssBaseController {
 		return super.ok(message.getMessage("SUCC_0003"));
 	}
 	
+	/**
+	 * 기획전 코너 상품 정렬순서변경
+	 *
+	 * @return
+	 * @author jmh
+	 * @since 2021. 12. 03
+	 */
+	@PostMapping("/planning/corner/goods/modify")
+	@ResponseBody
+	public GagaResponse modifyPlanCornerGoods(@RequestBody Collection<Plan> paramList) {
+		planService.updatePlanCornerGoods(paramList);
+		return super.ok(message.getMessage("SUCC_0002"));
+	}
+	
 	 /**
 	 * 기획전 템플릿 팝업
 	 *

+ 40 - 15
src/main/webapp/WEB-INF/views/marketing/PlanCornerListForm.html

@@ -83,6 +83,7 @@
 					<button type="button" class="btn btn-default btn-lg" onclick="cfnDownloadSampleFile('SF012');">엑셀상품추가 양식 다운로드</button>
 					<button type="button" class="btn btn-default btn-lg" onclick="fnOpenGoodsPopup();">상품추가</button>
 					<!-- <button type="button" class="btn btn-default btn-lg"onclick="fnDispOrdChange();">순서변경</button> -->
+					<button type="button" class="btn btn-info btn-lg" onclick="fnModifyGoods();">정렬수정</button>
 					<button type="button" class="btn btn-danger btn-lg"	onclick="fnDeleteGoods();">선택삭제</button>
 				</div>
 			</div>
@@ -356,14 +357,15 @@
 	var uploadGoodsUrl = [[${@environment.getProperty('upload.goods.view')}]];
 	var columnDefsGoods = [
 		{width: 40, minWidth: 40, cellClass: 'text-center', headerCheckboxSelection: true, checkboxSelection: true, filter: false},
-		{headerName: "정렬"		, field:'dispOrd'		, width:50, cellClass: 'text-center'
-			, valueFormatter: function(params) { return params.value.addComma(); }
+		{headerName: "정렬"		, field:'dispOrd'				, width:50, cellClass: 'text-right',
+			cellEditor: 'textCellEditor',
+			cellEditorParams: { maxlength: 3, required: true }
 		},
-		{headerName: "상품코드"	, field:'goodsCd'		, width:150, cellClass: 'text-left'
+		{headerName: "상품코드"	, field:'goodsCd'		, width:150, cellClass: 'text-left', editable: false
 			, cellRenderer: function(params) {return '<a href="javascript:void(0);">' + params.value + '</a>'; }
 		},
-		{headerName: "상품명"		, field:'goodsNm'		, width:300, cellClass: 'text-left'},
-		{headerName: "이미지"		, field:'imgPath6'		, width:100 , height:60, cellClass: 'text-right'
+		{headerName: "상품명"		, field:'goodsNm'		, width:300, cellClass: 'text-left', editable: false},
+		{headerName: "이미지"		, field:'imgPath6'		, width:100 , height:60, cellClass: 'text-right', editable: false
 			, cellRenderer: function(params) {
 				var imgPath = '';
 				if (params.data.imgType == "A"){
@@ -381,11 +383,11 @@
 			, editable : true, cellEditor: 'numericCellEditor'
 			, valueFormatter: function(params) { return params.value.addComma(); }
 		}, */
-		{headerName: "재고"		, field:'stockQtySum'			, width:80 , cellClass: 'text-center'
+		{headerName: "재고"		, field:'stockQtySum'			, width:80 , cellClass: 'text-center', editable: false
 			, cellRenderer: function(params) {return !gagajf.isNull(params.value) ? params.value : '0'; }
 		},
-		{headerName: "할인율(%)"		, field:'dcRate'		, width:80 , cellClass: 'text-center'},
-		{headerName: "TAG가"		, field:'tagPrice'		, width:100, cellClass: 'text-right'
+		{headerName: "할인율(%)"		, field:'dcRate'		, width:80 , cellClass: 'text-center', editable: false},
+		{headerName: "TAG가"		, field:'tagPrice'		, width:100, cellClass: 'text-right', editable: false
 			,valueFormatter: function(params) {
 				if(params.value && params.value > 0) {
 					return params.value.addComma();
@@ -394,19 +396,19 @@
 				}
 			}
 		},
-		{headerName: "정상가"		, field:'listPrice'		, width:100, cellClass: 'text-right' , hide : true
+		{headerName: "정상가"		, field:'listPrice'		, width:100, cellClass: 'text-right' , hide : true, editable: false
 			, valueFormatter: function(params) { return params.value.addComma(); }
 		},
-		{headerName: "판매가"		, field:'currPrice'		, width:100, cellClass: 'text-right'
+		{headerName: "판매가"		, field:'currPrice'		, width:100, cellClass: 'text-right', editable: false
 			, valueFormatter: function(params) { return params.value.addComma(); }
 		},
-		{headerName: "정상/이월여부", field:'formalGb'		, width:120, cellClass: 'text-center'},
-		{headerName: "상품상태"	, field:'goodsStat'		, width:100, cellClass: 'text-center'
+		{headerName: "정상/이월여부", field:'formalGb'		, width:120, cellClass: 'text-center', editable: false},
+		{headerName: "상품상태"	, field:'goodsStat'		, width:100, cellClass: 'text-center', editable: false
 			, valueFormatter: function(params) { return gagaAgGrid.lookupValue(goodsStatList, params.value); }
 		},
-		{headerName: "업체"		, field:'supplyCompNm'	, width:150, cellClass: 'text-left'},
-		{headerName: "기획전상세"	, field:'planDtlSq'		, width:200, cellClass: 'text-left', hide: true},
-		{headerName: "등록일"		, field:'regDt'			, width:100,  cellClass: 'text-left'
+		{headerName: "업체"		, field:'supplyCompNm'	, width:150, cellClass: 'text-left', editable: false},
+		{headerName: "기획전상세"	, field:'planDtlSq'		, width:200, cellClass: 'text-left', hide: true, editable: false},
+		{headerName: "등록일"		, field:'regDt'			, width:100,  cellClass: 'text-left', editable: false
 			, cellRenderer: function(params) { return !gagajf.isNull(params.value) ? params.value.toDate("YYYY-MM-DD HH:MM:SS").format("YYYY-MM-DD") : ''; }
 		},
 	];
@@ -415,6 +417,8 @@
 	gridOptionsGoods.rowSelection = 'multiple';
 	gridOptionsGoods.rowHeight = 60; //이미지가 있을경우 높이 지정해야함.
 	gridOptionsGoods.suppressRowClickSelection = true;
+	gridOptionsGoods.stopEditingWhenGridLosesFocus = true;
+	gridOptionsGoods.defaultColDef.editable = true;
 
 	gridOptionsGoods.onCellClicked = function(event) {
 		if (event.colDef.field == 'goodsCd') {
@@ -449,6 +453,27 @@
 			}
 		});
 	}
+	
+	// 상품 정렬(순서) 전체 변경
+	var fnModifyGoods = function() {
+		var changeData = gagaAgGrid.getChangedData(gridOptionsGoods);
+		
+		if( changeData.length < 1 ){
+			mcxDialog.alert('변경할 데이터가 없습니다.');
+		}else{
+			mcxDialog.confirm('정렬된 순서를 변경하시겠습니까?', {
+				cancelBtnText: "취소",
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					var jsonData = JSON.stringify(changeData);
+	
+					gagajf.ajaxJsonSubmit('/marketing/planning/corner/goods/modify', jsonData, function() {
+						fnConnerGoodsSearch();
+					});
+				}
+			});
+		}
+	}
 
 	// 기획전 상세일련번호 전역 변수
 	var _planDtlSq = '';