Selaa lähdekoodia

Merge branch 'develop' into bin2107

bin2107 4 vuotta sitten
vanhempi
commit
5614d11806

+ 3 - 0
src/main/java/com/style24/admin/biz/service/TsaSocialService.java

@@ -97,6 +97,9 @@ public class TsaSocialService {
 	@Transactional("shopTxnManager")
 	public void saveSocialGoods(Collection<Social> paramList) {
 		Integer userNo = TsaSession.getInfo().getUserNo();
+		Integer socialSq = paramList.iterator().next().getSocialSq();
+
+		
 
 		for (Social social : paramList) {
 			social.setRegNo(userNo);

+ 10 - 7
src/main/java/com/style24/persistence/mybatis/shop/TsaSocial.xml

@@ -203,6 +203,12 @@
 		FROM TB_SOCIAL A
 		WHERE 1=1
 		AND A.USE_YN = 'Y'
+		<if test='applyGb == "A"'>
+		    AND A.APPLY_GB = 'A'
+		</if>
+		<if test='applyGb == "P"'>
+		    AND A.APPLY_GB IN ('A','P')
+		</if>
 		<if test='frontGb == "P"'> <!-- PC웹 -->
 		    AND A.FRONT_GB IN ('A','P')
 		</if>
@@ -211,11 +217,8 @@
 		</if> 
 		<if test='frontGb == "A"'> <!-- 전체 -->
 		    AND A.FRONT_GB IN ('A','M','P')
-		</if> 
-		AND A.APPLY_GB IN ('A', #{applyGb})
-		<if test="socialSq != null and socialSq != ''">
-		AND A.SOCIAL_SQ != #{socialSq}
 		</if>
+		AND A.SOCIAL_SQ != #{socialSq}
 		AND A.SOCIAL_EDDT <![CDATA[ >= ]]> DATE_FORMAT(#{socialStdt} , '%Y-%m-%d %H:%i:%S')
 		AND A.SOCIAL_STDT <![CDATA[ <= ]]> DATE_FORMAT(#{socialEddt} , '%Y-%m-%d %H:%i:%S')
 	</select>
@@ -239,11 +242,11 @@
 			AND (FRONT_GB = 'A' OR FRONT_GB = #{frontGb} )
 		</if>
 		<if test="stDate != null and stDate != '' and edDate != null and edDate != ''">
-        AND    SOCIAL_STDT <![CDATA[ <= ]]> DATE_FORMAT(#{stDate},'%Y-%m-%d %H:%i:%S')
-        AND    SOCIAL_EDDT <![CDATA[ >= ]]> DATE_FORMAT(#{edDate},'%Y-%m-%d %H:%i:%S')
+        AND    SOCIAL_STDT <![CDATA[ >= ]]> DATE_FORMAT(#{stDate},'%Y-%m-%d %H:%i:%S')
+        AND    SOCIAL_EDDT <![CDATA[ <= ]]> DATE_FORMAT(#{stDate},'%Y-%m-%d %H:%i:%S')
 		</if>
 	</sql>
-	
+
 	<sql id="getListPagingCondition_sql">
 		<choose>
 			<when test="pageable != null">

+ 15 - 8
src/main/webapp/WEB-INF/views/marketing/SocialShoppingListForm.html

@@ -383,6 +383,11 @@
 		$(formId + ' input[name=edDate]').val(edDate);
 		$('#edTimeHour').val(edTime.substring(0,2));
 	}
+
+	// 초기화 클릭 시
+	var fnReset = function (){
+		$('#searchForm')[0].reset();
+	}
 	
 	// 신규버튼  클릭 시 
 	var afreshBtn = function() {
@@ -514,6 +519,9 @@
 		{headerName: '상품타입'	         , field:'goodsType'		, width:100 , cellClass: 'text-center', hide: true},
 		{headerName: '삭제여부'				, field:'delYn'		, width:100 , cellClass: 'text-center', hide: true},
 		{headerName: '변경전 할인율'				, field:'dcBrate'		, width:100 , cellClass: 'text-center', hide: true},
+		{headerName: '노출순서'				, field:'dispOrd'		, width:100 , cellClass: 'text-center', editable: true
+			, valueGetter: function(params) { return params.node.rowIndex + 1 }
+		}
 	];
 
 	var gridOptionsGoods = gagaAgGrid.getGridOptions(columnDefsSocialGoods);
@@ -642,22 +650,22 @@
 				mcxDialog.alert('소셜을 선택 해주세요.');
 				return;
 			} */
-			
+
 			for (var disp = 0; disp < result.length; disp++) {
 				var goods = { socialSq : Number(socialSq) ,
 							  scgoodsSq : Number(0) ,
-							  goodsCd : result[disp].goodsCd, 
+							  goodsCd : result[disp].goodsCd,
 							  goodsNm : result[disp].goodsNm,
 							  currBprice: result[disp].currPrice,
 							  dcBrate: result[disp].dcRate,
 							  listPrice : result[disp].listPrice,
 							  sysImgNm : result[disp].sysImgNm,
 							  goodsType : result[disp].goodsType,
-							  dispOrd : disp+1
+							  dispOrd : oldGoodsList.length+(disp+1)
 							  };
-				
+
 				oldGoodsList.unshift(goods);
-				
+
 			}
 		}
 		mcxDialog.alert('상품이 적용되었습니다.');
@@ -741,11 +749,10 @@
 				msg = '상품코드 : ' + goods.goodsCd + '<br/>판매가와 할인율 모두 값이 존재하지않습니다.';
 				return false;
 			}
-		/* 	if (gagajf.isNull(goods.dispOrd)) {
+		 	if (gagajf.isNull(goods.dispOrd)) {
 				msg = '상품코드 : ' + goods.goodsCd + '<br/>전시순서를  입력해주세요.';
 				return false;
-			} */
-			
+			}
 			if(!gagajf.isNull(goods.currAprice)){
 				dcRate =  100 - Math.floor(Number(goods.currAprice) / Number(goods.listPrice) * 100);	//절사
 				goods.dcArate = dcRate;