소스 검색

포인트 임시커밋

ChoiSooHwan 5 년 전
부모
커밋
144a08de69

+ 8 - 1
src/main/java/com/style24/front/biz/dao/TsfPointDao.java

@@ -25,9 +25,16 @@ public interface TsfPointDao {
 	Point getExpectedPointInfo(Point point);
 	Point getExtinctPointInfo(Point point);
 	
-	
+	/**
+	 * 포인트정보 내역조회
+	 *
+	 * @param Point
+	 * @author csh9191
+	 * @since 2021. 03. 03
+	 */	
 	Collection<Point> getAccumulatePointList(Point point);
 	Collection<Point> getUsePointList(Point point);
+	Collection<Point> getAllPointList(Point point);
 	
 	
 

+ 10 - 1
src/main/java/com/style24/front/biz/service/TsfPointService.java

@@ -42,7 +42,13 @@ public class TsfPointService {
 		return pointDao.getExtinctPointInfo(point);
 	}
 	
-	
+	/**
+	 * 포인트정보 내역조회
+	 *
+	 * @param Point
+	 * @author csh9191
+	 * @since 2021. 03. 03
+	 */	
 	public Collection<Point> getAccumulatePointList(Point point) {
 		return pointDao.getAccumulatePointList(point);
 	}
@@ -50,5 +56,8 @@ public class TsfPointService {
 	public Collection<Point> getUsePointList(Point point) {
 		return pointDao.getUsePointList(point);
 	}
+	public Collection<Point> getAllPointList(Point point) {
+		return pointDao.getAllPointList(point);
+	}
 
 }

+ 23 - 0
src/main/java/com/style24/front/biz/web/TsfMypageController.java

@@ -545,5 +545,28 @@ public class TsfMypageController extends TsfBaseController {
 		
 		return result;
 	}
+	
+	/**
+	 * 마이페이지 STYLE24 전체내역
+	 *
+	 * @param param
+	 * @return GagaMap
+	 * @author csh9191
+	 * @since 2021. 03. 02
+	 */
+	@PostMapping("/allpoint/list")
+	@ResponseBody
+	public GagaMap getAllPointList(@RequestBody Point point) {
+		GagaMap result = new GagaMap();
+		
+		int custNo = TsfSession.getInfo().getCustNo();
+		point.setCustNo(custNo);
+		
+		result.set("allPointList",pointService.getAllPointList(point));
+		
+		log.info("result {}", result);
+		
+		return result;
+	}
 
 }

+ 38 - 0
src/main/java/com/style24/persistence/mybatis/shop/TsfPoint.xml

@@ -105,4 +105,42 @@
 		GROUP BY CD_NM, PNT_AMT, GOODS_NM, CD,OCCUR_DTL_DESC, TCHP.UPD_DT
 		ORDER BY TCHP.UPD_DT DESC;
 	</select>
+	
+	<!-- 전체내역 조회-->
+	<select id="getAllPointList" parameterType="Point" resultType="Point">
+		/* TsfPoint.getAllPointList */
+		SELECT
+		CASE   TCC.CD_NM
+		WHEN   '포인트사용' THEN '구매 사용'
+		WHEN   '상품평승인취소' THEN '구매 취소'
+		WHEN   '기타' THEN '관리자'
+		WHEN   '포인트소멸' THEN '소멸'
+		WHEN   '예정포인트적립' THEN '상품 구매'
+		WHEN   '상품평승인' THEN '리뷰'
+		WHEN   '온라인이벤트' THEN '이벤트'
+		WHEN   '기타' THEN '관리자'
+		END AS OCCUR_GB ,	
+		CASE   TCC.CD  	
+		WHEN   'G069_10' THEN TG.GOODS_NM
+		WHEN   'G069_12' THEN TG.GOODS_NM 
+		WHEN   'G069_20' THEN TG.GOODS_NM 
+		WHEN   'G069_21' THEN TG.GOODS_NM
+		WHEN   'G069_30' THEN TCHP.OCCUR_DTL_DESC
+		WHEN   'G069_90' THEN TCHP.OCCUR_DTL_DESC
+		WHEN   'G069_99' THEN TCHP.OCCUR_DTL_DESC
+		END AS OCCUR_DTL_DESC
+			 , TCHP.PNT_AMT AS pntAmt
+			 , TCHP.UPD_DT  AS pntUploadDt
+		FROM TB_CUST_POINT_HST TCHP
+		INNER JOIN TB_COMMON_CODE TCC
+		ON TCC.CD = TCHP.OCCUR_GB
+		INNER JOIN TB_ORDER_DETAIL TOD
+		ON TOD.ORD_NO = TCHP.ORD_NO
+		INNER JOIN TB_GOODS TG 
+		ON TG.GOODS_CD = TOD.GOODS_CD 
+		WHERE TCHP.CUST_NO =  #{custNo}
+		AND TCHP.OCCUR_GB IN ('G069_10','G069_12','G069_20','G069_21','G069_30','G069_90','G069_99')
+		GROUP BY CD_NM, PNT_AMT, GOODS_NM, CD,OCCUR_DTL_DESC, TCHP.UPD_DT
+		ORDER BY TCHP.UPD_DT DESC;
+	</select>
 </mapper>

+ 51 - 10
src/main/webapp/WEB-INF/views/web/mypage/MypagePointFormWeb.html

@@ -64,7 +64,7 @@
 												<tr>
 													<th>사유</th>
 													<th>내용</th>
-													<th>차감</th>
+													<th id="plusMinus"></th>
 													<th>일자</th>
 												</tr>
 											</thead>
@@ -77,17 +77,55 @@
 						</div>
 					</div>
 <script th:inline="javascript">
+
 	// 전체내역 조회
 	$("#fnSetSearchFullHistory").click(function(){
 		// Class제거 추가
 		$("#fnSetSearchCollectHistory").removeClass("on");
 		$("#fnSetSearchUsedHistory").removeClass("on");
 		$("#fnSetSearchFullHistory").addClass("on");
+		$("#plusMinus").text("증감/차감");
+		
+		let data = {};
+		
+		data.searchDt = $('select[name=searchDt]').val();
 		
-		// 적립내역 + 사용내역(sum)으로 표시
+		var jsonData = JSON.stringify(data);
 		
+		$.ajax(
+				{
+					type 	 : "POST",
+					data	 : jsonData,
+					url 	 : '/mypage/allpoint/list',
+					contentType: 'application/json',
+  					dataType : 'json',
+					success  : function(result){
+						fnPointAllListInfo(result);
+					}
+				}
+		)
 	});
 	
+	function fnPointAllListInfo(result) {
+		
+		let allPointList = result.allPointList;
+		
+		let tmtbHtml = "";
+		for(let i=0; i<allPointList.length; i++){
+			let point = allPointList[i];
+			tmtbHtml +='<tr>';
+			tmtbHtml +='<td>'+ point.occurGb + '</td>';
+			tmtbHtml += '<td class="t_l pl40">'+ point.occurDtlDesc + '</td>';
+			if(point.pntAmt > 0){
+				tmtbHtml += '<td class="c_blue">'+ point.pntAmt + '</td>';
+			}else{
+				tmtbHtml += '<td class="c_primary">'+ point.pntAmt + '</td>';
+			}
+			tmtbHtml += '<td>'+ point.pntUploadDt + '</td>';
+			tmtbHtml += '</tr>';
+		}
+		$("#pointAjaxList").html(tmtbHtml);
+	}
 	
 	// 적립내역 조회
 	$("#fnSetSearchCollectHistory").click(function(){
@@ -99,6 +137,7 @@
 		// 적립내역 포인트 블루
 		$("#pntAmt").removeClass("c_primary");
 		$("#pntAmt").addClass("c_blue");
+		$("#plusMinus").text("증감");
 		
 		let data = {};
 		
@@ -137,7 +176,6 @@
 		$("#pointAjaxList").html(tmtbHtml);
 	}
 	
-	
 	// 사용내역 조회
 	$("#fnSetSearchUsedHistory").click(function(){
 		// Class제거 추가
@@ -148,6 +186,7 @@
 		// 사용내역 포인트 블루
 		$("#pntAmt").removeClass("c_blue");
 		$("#pntAmt").addClass("c_primary");
+		$("#plusMinus").text("차감");
 		
 		let data = {};
 		
@@ -172,27 +211,29 @@
 	function fnUsePointListInfo(result) {
 		
 		let usePointList = result.usePointList;
-		
+		console.log(usePointList);
 		let tmtbHtml = "";
 		for(let i=0; i<usePointList.length; i++){
-			let point = usePointList[i];
+			let usePoint = usePointList[i];
 			tmtbHtml +='<tr>';
-			tmtbHtml +='<td>'+ usePointList.occurGb + '</td>';
-			tmtbHtml += '<td class="t_l pl40">'+ usePointList.occurDtlDesc + '</td>';
-			tmtbHtml += '<td class="c_primary">'+  usePointList.pntAmt + '</td>';
-			tmtbHtml += '<td>'+ usePointList.pntUploadDt + '</td>';
+			tmtbHtml +='<td>'+ usePoint.occurGb + '</td>';
+			tmtbHtml += '<td class="t_l pl40">'+ usePoint.occurDtlDesc + '</td>';
+			tmtbHtml += '<td class="c_primary">'+  usePoint.pntAmt + '</td>';
+			tmtbHtml += '<td>'+ usePoint.pntUploadDt + '</td>';
 			tmtbHtml += '</tr>';
 		}
 		$("#pointAjaxList").html(tmtbHtml);
 	}
 
-	
 	$(document).ready(function() {
 		// 마이페이지 LNB 설정
 		fnSetMypageLnbList(5);
 		
 		// 마이페이지 location 설정
 		fnSetMypageLocation('STYLE24 포인트', '_PAGE_MYPAGE_POINT');
+		
+		// 전체내역
+		$("#fnSetSearchFullHistory").trigger('click');
 
 	});