swkim 4 роки тому
батько
коміт
e592b024a0

+ 1 - 0
src/main/java/com/style24/persistence/domain/Statistics.java

@@ -265,6 +265,7 @@ public class Statistics extends TscBaseDomain {
 	private String[] multiGradeGb;
 
 	private String custId;
+	private int custNo;
 	private int custPoint;
 
 	private String distributionGbS;

+ 18 - 15
src/main/java/com/style24/persistence/mybatis/shop/TsaStatistics.xml

@@ -1339,21 +1339,23 @@
 		      ]]>
 		      AND B.ORD_DTL_STAT NOT IN ('G013_00', 'G013_10', 'G013_98')               -- 주문접수,입금대기,입금전취소 제외
 		      AND B.ORD_QTY > B.CNCL_RTN_QTY
-              <if test="applyGbArr == null">
-	              /* 프로모션유형값없을시 */
-			      AND (B.TMTB1_DC_AMT + B.TMTB2_DC_AMT) > 0
-              </if>
-	          <if test="applyGbArr != null">
-	              /* 프로모션유형 */
-	              <foreach collection="applyGbArr" item="item" index="index">
-	                  <if test='item == "G810_10"'>
-	                      AND TMTB1_DC_AMT > 0 -- 수량
-	                  </if>
-	                  <if test='item == "G810_11"'>
-	                      AND TMTB2_DC_AMT > 0 -- 금액
-	                  </if>
-	              </foreach>
-	          </if>
+              <choose>
+				  <when test="applyGbArr != null and applyGbArr != ''">
+					  /* 프로모션유형 */
+					  <foreach collection="applyGbArr" item="item" index="index">
+						  <if test='item == "G810_10"'>
+							  AND TMTB1_DC_AMT > 0 -- 수량
+						  </if>
+						  <if test='item == "G810_11"'>
+							  AND TMTB2_DC_AMT > 0 -- 금액
+						  </if>
+					  </foreach>
+				  </when>
+		    	<otherwise>
+					/* 프로모션유형값없을시 */
+					AND (B.TMTB1_DC_AMT + B.TMTB2_DC_AMT) > 0
+				</otherwise>
+			  </choose>
 		)
 		-- 수량할인
 		, TMTB1 AS (
@@ -2345,6 +2347,7 @@
 				WHEN (DATE_FORMAT(NOW(), '%Y') - DATE_FORMAT(CONCAT(SUBSTRING(FN_DEC_AES(BIRTH_YMD), 1, 4), '0101'), '%Y') + 1) BETWEEN 30 AND 39 THEN '30'
 				WHEN (DATE_FORMAT(NOW(), '%Y') - DATE_FORMAT(CONCAT(SUBSTRING(FN_DEC_AES(BIRTH_YMD), 1, 4), '0101'), '%Y') + 1) BETWEEN 40 AND 49 THEN '40'
 			ELSE 'X' END AS AGE
+		    , X.CUST_NO
 			, FN_GET_CODE_NM('G007', FN_DEC_AES(SEX_GB)) AS SEX_GB
 			, FN_GET_CODE_NM('G110', CUST_GRADE) AS CUST_GRADE -- 등급
 			, SUM(ORD_AMT - CNCL_AMT - RTN_AMT) AS TOT_ORD_AMT -- 매출액

+ 3 - 3
src/main/webapp/WEB-INF/views/statistics/CouponTradingForm.html

@@ -156,7 +156,7 @@
 		},
 		{ headerName: "구매율", field: "ordRate", width: 150, cellClass: 'text-right',
 			cellRenderer: function(params) {
-				return !gagajf.isNull(params.value) ? params.value.addComma() : '0';
+				return params.value + '%';
 			}
 		},
 	];
@@ -186,10 +186,10 @@
 	detailGridOptions.onCellClicked = function(event) {
 		var params = event.data;
 		if (event.colDef.field == "goodsCd"){
-			cfnOpenGoodsDetailPopup('U',goodsCd);
+			cfnOpenGoodsDetailPopup('U',params.goodsCd);
 		}
 		else if (event.colDef.field == "goodsNm"){
-			cfnOpenGoodsDetailPopup('U',goodsCd);
+			cfnOpenGoodsDetailPopup('U',params.goodsCd);
 		}
 	}
 

+ 12 - 1
src/main/webapp/WEB-INF/views/statistics/CustomerRankingForm.html

@@ -117,10 +117,13 @@
 				else return '';
 			}
 		},
+		{headerName: "회원NO", field: "custNo", width: 120, cellClass: 'text-center', hide: true},
 		{
 			headerName: "회원정보", field: "", width: 450, cellClass: 'text-center',
 			children: [
-				{headerName: "아이디(이름)", field: "custId", width: 200, cellClass: 'text-center'},
+				{headerName: "아이디(이름)", field: "custId", width: 200, cellClass: 'text-center',
+					cellRenderer: function(params) { return '<a href="javascript:void(0);">' + params.value + '</a>'; }
+				},
 				{headerName: "연령/성별", field: "age", width: 150, cellClass: 'text-center',
 					cellRenderer: function(params) {
 						let str1 = params.value;
@@ -175,6 +178,14 @@
 
 	let gridOptions = gagaAgGrid.getGridOptions(columnDefs);
 
+	// 셀 클릭 이벤트
+	gridOptions.onCellClicked = function(event) {
+		if (event.colDef.field === 'custId') {
+			// 고객 상세
+			cfnOpenCustDetailPopup(event.data.custNo);
+		}
+	}
+
     gridOptions.excelStyles = [
         {
             id: 'text-center',

+ 2 - 1
src/main/webapp/WEB-INF/views/statistics/PlanTradingForm.html

@@ -285,7 +285,8 @@
 			}
 		});
 
-		totInfo.ordRate = Math.floor(totInfo.ordRate / len);
+		if (len == 0) totInfo.ordRate = 0;
+		else totInfo.ordRate = Math.floor(totInfo.ordRate / len);
 
 		gagaAgGrid.setPinnedRowData(detailGridOptions, totInfo, 'top');
 	}

+ 4 - 2
src/main/webapp/WEB-INF/views/statistics/TmtbTradingForm.html

@@ -75,6 +75,7 @@
 			<ul class="panelBar">
 				<li>
 					<button type="button" class="btn btn-default btn-lg" onclick="fnDetailExcelDownLoad();">엑셀다운로드</button>
+					<span id="tmtbNmTxt" style="text-align: left"></span>
 				</li>
 			</ul>
 			<div id="detailGridList" style="width: 100%; height: 470px" class="ag-theme-balham"></div>
@@ -165,6 +166,7 @@
 			$("#detailSearchForm input[name=startDt]").val($("#searchForm input[name=startDt]").val());
 			$("#detailSearchForm input[name=endDt]").val($("#searchForm input[name=endDt]").val());
 			$("#detailSearchForm input[name=tmtbSq]").val(params.tmtbSq);
+			$("#tmtbNmTxt").text(params.tmtbNm);
 			gagaAgGrid.fetch($('#detailSearchForm').prop('action'), detailGridOptions, '#detailSearchForm', fnDetailCreateTotal);
 		}
 	}
@@ -173,10 +175,10 @@
 	detailGridOptions.onCellClicked = function(event) {
 		var params = event.data;
 		if (event.colDef.field == "goodsCd"){
-			cfnOpenGoodsDetailPopup('U',goodsCd);
+			cfnOpenGoodsDetailPopup('U',params.goodsCd);
 		}
 		else if (event.colDef.field == "goodsNm"){
-			cfnOpenGoodsDetailPopup('U',goodsCd);
+			cfnOpenGoodsDetailPopup('U',params.goodsCd);
 		}
 	}