초기소스
This commit is contained in:
@@ -0,0 +1,153 @@
|
||||
package com.wb.domainserver.domain.mngr.stats.adtrace.controller;
|
||||
|
||||
|
||||
import com.wb.domainserver.domain.mngr.stats.adtrace.vo.AdTraceVO;
|
||||
import com.wb.domainserver.response.WnbtResponse;
|
||||
import com.wb.domainserver.response.WnbtWebClientResponseHandler;
|
||||
import com.wb.domainserver.security.authorization.annotation.AuthPolicy;
|
||||
import com.wb.domainserver.security.authorization.annotation.Policy;
|
||||
import com.wb.domainserver.util.communicate.RESRC;
|
||||
import com.wb.domainserver.util.communicate.ReplyFromResrc;
|
||||
import com.wb.domainserver.util.communicate.SendToResrc;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.CookieValue;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/mngr/stats/adtrace")
|
||||
public class AdTraceController {
|
||||
|
||||
/** WebClient 호출을 위한 wrapper */
|
||||
@Autowired
|
||||
private SendToResrc sendToResrc;
|
||||
|
||||
@Autowired
|
||||
private WnbtWebClientResponseHandler responseHandler;
|
||||
|
||||
/**
|
||||
* 광고추적 목록 조회 폼
|
||||
* @param vo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value = "/selectAdTraceListForm")
|
||||
public String selectAdTraceListForm(AdTraceVO vo,
|
||||
ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/adtrace/selectBOAdTraceListForm", vo),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
return "mngr/stats/adtrace/AdTraceListRForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 광고추적 목록 조회 리스트
|
||||
* @param vo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value = "/selectAdTraceList")
|
||||
public String selectAdTraceList(AdTraceVO vo,
|
||||
ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/adtrace/selectBOAdTraceList", vo),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
return "mngr/stats/adtrace/AdTraceListR";
|
||||
}
|
||||
|
||||
/**
|
||||
* 광고추적 등록 폼
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/insertAdTraceForm")
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
public String insertAdTraceForm(AdTraceVO vo,
|
||||
ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/adtrace/insertBOAdTraceForm", vo),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
return "mngr/stats/adtrace/AdTraceC";
|
||||
}
|
||||
|
||||
/**
|
||||
* 광고추적 등록
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value = "/insertAdTrace", method = RequestMethod.POST)
|
||||
public ResponseEntity<WnbtResponse> insertAdTrace(AdTraceVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/adtrace/insertBOAdTrace", vo),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 광고추적 상세 폼
|
||||
* @param vo
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value = "/selectAdTraceDtlForm")
|
||||
public String selectAdTraceDtlForm( AdTraceVO vo,
|
||||
ModelMap model, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/adtrace/selectBOAdTraceDtlForm", vo),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
return "mngr/stats/adtrace/AdTraceDtlU";
|
||||
}
|
||||
|
||||
/**
|
||||
* 광고추적 수정
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value = "/updateAdTraceDtl", method = RequestMethod.POST)
|
||||
public ResponseEntity<WnbtResponse> updateAdTraceDtl(AdTraceVO vo, @CookieValue(value = "authSopmalCd") String authSopmalCd) {
|
||||
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/adtrace/updateBOAdTraceDtl", vo),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.wb.domainserver.domain.mngr.stats.adtrace.vo;
|
||||
|
||||
import com.wb.domainserver.domain.comm.vo.AbstractVO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class AdTraceVO extends AbstractVO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/*광고추적코드고유번호*/
|
||||
private String adTraceInnb;
|
||||
|
||||
/*쇼핑몰코드*/
|
||||
private String sopmalCd;
|
||||
|
||||
/*광고매체구분코드*/
|
||||
private String adMediaDvCd;
|
||||
|
||||
/*광고매체명*/
|
||||
private String adMediaNm;
|
||||
|
||||
/*캠페인유형*/
|
||||
private String cmpgnTy;
|
||||
|
||||
/*캠페인명*/
|
||||
private String cmpgnNm;
|
||||
|
||||
/*광고그룹명*/
|
||||
private String adGroupNm;
|
||||
|
||||
/*소재명*/
|
||||
private String matrNm;
|
||||
|
||||
/*랜딩URL*/
|
||||
private String landingUrl;
|
||||
|
||||
/*비고*/
|
||||
private String rm;
|
||||
|
||||
//검색어
|
||||
private String srchStr;
|
||||
|
||||
//검색구분
|
||||
private String srchTy;
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
package com.wb.domainserver.domain.mngr.stats.adtraceAnals.controller;
|
||||
|
||||
import com.wb.domainserver.domain.mngr.stats.adtraceAnals.vo.AdTraceAnalsGoodsVO;
|
||||
import com.wb.domainserver.domain.mngr.stats.adtraceAnals.vo.AdTraceAnalsVO;
|
||||
import com.wb.domainserver.response.WnbtWebClientResponseHandler;
|
||||
import com.wb.domainserver.security.authorization.annotation.AuthPolicy;
|
||||
import com.wb.domainserver.security.authorization.annotation.Policy;
|
||||
import com.wb.domainserver.util.communicate.RESRC;
|
||||
import com.wb.domainserver.util.communicate.SendToResrc;
|
||||
import com.wb.domainserver.util.excel.ExcelDownloadUtil;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.CookieValue;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "/mngr/stats/adTraceAnals")
|
||||
public class AdTraceAnalsController {
|
||||
|
||||
/** WebClient 호출을 위한 wrapper */
|
||||
@Autowired
|
||||
private WnbtWebClientResponseHandler responseHandler;
|
||||
|
||||
@Autowired
|
||||
private SendToResrc sendToResrc;
|
||||
|
||||
/**
|
||||
* 관리자 추적코드 통계 화면
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrAdTraceStats")
|
||||
public String selectBOMngrAdTraceStats(@CookieValue(value = "authSopmalCd") String authSopmalCd,ModelMap model) {
|
||||
AdTraceAnalsVO vo = new AdTraceAnalsVO();
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/adTraceAnals/selectBOMngrAdTraceStats", vo),
|
||||
model,
|
||||
"cond"
|
||||
);
|
||||
model.put("resultMap", vo);
|
||||
|
||||
return "mngr/stats/adTraceAnals/adTraceStats";
|
||||
}
|
||||
|
||||
/**
|
||||
* 관리자 추적코드 통계 화면
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrAdTraceGoodsStats")
|
||||
public String selectBOMngrAdTraceGoodsStats(@CookieValue(value = "authSopmalCd") String authSopmalCd,ModelMap model) {
|
||||
AdTraceAnalsGoodsVO vo = new AdTraceAnalsGoodsVO();
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/adTraceAnals/selectBOMngrAdTraceGoodsStats", vo),
|
||||
model,
|
||||
"cond"
|
||||
);
|
||||
model.put("resultMap", vo);
|
||||
|
||||
return "mngr/stats/adTraceAnals/adTraceGoodsStats";
|
||||
}
|
||||
|
||||
/**
|
||||
* 관리자 추적코드통계 표 조회
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrAdTraceStatsTableInqire")
|
||||
public String selectMngrAdTraceStatsTableInqire(@CookieValue(value = "authSopmalCd") String authSopmalCd, AdTraceAnalsVO vo, ModelMap model) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/adTraceAnals/selectMngrAdTraceStatsTableInqire", vo),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
return "mngr/stats/adTraceAnals/adTraceStatsTable";
|
||||
}
|
||||
|
||||
/**
|
||||
* 관리자 추적코드통계 표 조회
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrAdTraceStatsGoodsTableInqire")
|
||||
public String selectMngrAdTraceStatsGoodsTableInqire(@CookieValue(value = "authSopmalCd") String authSopmalCd, AdTraceAnalsVO vo, ModelMap model) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/adTraceAnals/selectMngrAdTraceStatsGoodsTableInqire", vo),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
return "mngr/stats/adTraceAnals/adTraceStatsGoodsTable";
|
||||
}
|
||||
|
||||
/**
|
||||
* 관리자 추적코드통계 엑셀 다운로드
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectMngrAdTraceStatsExcelFileDownload", method = RequestMethod.POST)
|
||||
public void selectMngrAdTraceStatsExcelFileDownload(HttpServletResponse response, @CookieValue(value = "authSopmalCd") String authSopmalCd, AdTraceAnalsVO vo){
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/adTraceAnals/selectBOMngrAdTraceStatsExcelFileDownload",vo)
|
||||
);
|
||||
|
||||
List<Map<String, Object>> excelList = new ArrayList<>();
|
||||
if(resultMap.get("excelList") != null) {
|
||||
excelList = (List<Map<String, Object>>) resultMap.get("excelList");
|
||||
}
|
||||
|
||||
//엑셀 항목별 제목에 출력될 내용 설정
|
||||
LinkedHashMap<String, String> headerMap = new LinkedHashMap<String, String>();
|
||||
|
||||
//엑셀 항목에 출력될 내용 설정
|
||||
List<Map<String, Object>> dataList = new ArrayList<>();
|
||||
|
||||
// 엑셀 다운로드 파일명
|
||||
String excelFileName = "";
|
||||
|
||||
int accessUserCnt = 0; // 유입수
|
||||
int ordrCnt = 0; // 결제건수
|
||||
int rlSetleAmt = 0; // 결제금액
|
||||
int accessUserRlSetleAmt = 0; // 유입당 결제금액
|
||||
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map = (HashMap<String, Object>) excelList.get(i);
|
||||
|
||||
if ("tableDate".equals(vo.getUnitFlag())) {
|
||||
accessUserCnt = (int) Double.parseDouble(map.get("accessUserCnt").toString());
|
||||
accessUserRlSetleAmt = (int) Double.parseDouble(map.get("accessUserRlSetleAmt").toString());
|
||||
dataMap.put("itme07", map.get("rlSetleAmtRt").toString() ); // 유입당결제율
|
||||
}
|
||||
|
||||
ordrCnt = (int) Double.parseDouble(map.get("ordrCnt").toString());
|
||||
rlSetleAmt = (int) Double.parseDouble(map.get("rlSetleAmt").toString());
|
||||
|
||||
|
||||
dataMap.put("itme01", map.get("rnum") ); // 순번
|
||||
dataMap.put("itme02", map.get("adTraceCd") ); // 추적코드
|
||||
dataMap.put("itme03", map.get("dt") ); // 일자
|
||||
dataMap.put("itme04", accessUserCnt ); // 유입수
|
||||
dataMap.put("itme05", ordrCnt ); // 결제건수
|
||||
dataMap.put("itme06", rlSetleAmt ); // 결제금액
|
||||
dataMap.put("itme08", accessUserRlSetleAmt ); // 유입당결제금액
|
||||
|
||||
if ("tableGoodsDate".equals(vo.getUnitFlag())) {
|
||||
dataMap.put("itme04", map.get("goodsInnb") ); // 상품번호
|
||||
dataMap.put("itme05", map.get("goodsNm") ); // 상품명
|
||||
dataMap.put("itme06", ordrCnt ); // 결제건수
|
||||
dataMap.put("itme07", rlSetleAmt ); // 결제금액
|
||||
dataMap.put("itme08", "" );
|
||||
}
|
||||
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
headerMap.put("itme01", "순번");
|
||||
headerMap.put("itme02", "추적코드");
|
||||
headerMap.put("itme03", "일자");
|
||||
headerMap.put("itme04", "유입수");
|
||||
headerMap.put("itme05", "결제건수");
|
||||
headerMap.put("itme06", "결제금액");
|
||||
headerMap.put("itme07", "유입당결제율");
|
||||
headerMap.put("itme08", "유입당결제금액");
|
||||
|
||||
if ("tableGoodsDate".equals(vo.getUnitFlag())) {
|
||||
headerMap.put("itme04", "상품번호");
|
||||
headerMap.put("itme05", "상품명");
|
||||
headerMap.put("itme06", "결제건수");
|
||||
headerMap.put("itme07", "결제금액");
|
||||
headerMap.put("itme08", "");
|
||||
}
|
||||
|
||||
excelFileName = "추적코드통계_";
|
||||
|
||||
if("tableDate".equals(vo.getUnitFlag()) ) { // 간단
|
||||
excelFileName += "일별_추적코드_";
|
||||
}else if("tableGoodsDate".equals(vo.getUnitFlag()) ) { // 상세
|
||||
excelFileName += "일별_추적코드(상품)_";
|
||||
}
|
||||
excelFileName += String.format("%s~%s", vo.getSrchStrtSndngDt(), vo.getSrchEndSndngDt());
|
||||
|
||||
// LocalDateTime now = LocalDateTime.now();
|
||||
//
|
||||
// if(now != null) {
|
||||
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmm"); // 포맷 지정
|
||||
// String formattedNow = now.format(formatter); // 포맷에 맞춰 현재 날짜와 시간 출력
|
||||
// excelFileName += formattedNow; // 엑셀 다운로드 파일명
|
||||
// }
|
||||
|
||||
try {
|
||||
//엑셀생성 및 다운로드
|
||||
String encodedFileName = URLEncoder.encode(excelFileName, StandardCharsets.UTF_8.toString()).replaceAll("\\+", "%20");
|
||||
ExcelDownloadUtil.createExcel(encodedFileName, headerMap, dataList, response, true);
|
||||
|
||||
} catch(Exception e) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.wb.domainserver.domain.mngr.stats.adtraceAnals.vo;
|
||||
|
||||
import com.wb.domainserver.domain.comm.vo.AbstractVO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* 해당 클래스에 대한 설명을 입력하세요.
|
||||
* @author 개발자 성명을 입력해주세요.
|
||||
* @since 2024-11-29
|
||||
* @version 1.0
|
||||
* @see
|
||||
*
|
||||
* <pre>
|
||||
* == (Modification Information) == 개정이력
|
||||
*
|
||||
* 수정일 수정자 수정내용
|
||||
* ------- -------- ---------------------------
|
||||
* 2024-11-29 개발자명을 입력하세요. 최초 생성
|
||||
*
|
||||
* </pre>
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class AdTraceAnalsGoodsVO extends AbstractVO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 쇼핑몰코드 */
|
||||
private String sopmalCd;
|
||||
|
||||
/** 추적코드 */
|
||||
private String srchAdTraceCd;
|
||||
|
||||
/** 테이블 구분 기준 (제품 미포함) */
|
||||
private String unitFlag;
|
||||
/** 테이블 구분 기준 (제품 포함) */
|
||||
private String unitGoodsFlag;
|
||||
/** 검색조건 시작일 */
|
||||
private String srchStrtSndngDt;
|
||||
/** 검색조건 종료일 */
|
||||
private String srchEndSndngDt;
|
||||
/** 검색조건2 시작일 */
|
||||
private String srchStrtSndngDt2;
|
||||
/** 검색조건2 종료일 */
|
||||
private String srchEndSndngDt2;
|
||||
/** 검색조건 기간의 기준 */
|
||||
private String srchDate;
|
||||
/** 검색조건 주문환경 코드 */
|
||||
private List<String> srchOrdrEnvrnCds;
|
||||
|
||||
/** 정렬기준 */
|
||||
private String ordrStand;
|
||||
/** 정렬방식 */
|
||||
private String ordrType;
|
||||
/** 정렬조건 */
|
||||
private String ordrFinal;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.wb.domainserver.domain.mngr.stats.adtraceAnals.vo;
|
||||
|
||||
import com.wb.domainserver.domain.comm.vo.AbstractVO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class AdTraceAnalsVO extends AbstractVO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 쇼핑몰코드 */
|
||||
private String sopmalCd;
|
||||
/** 추적코드 */
|
||||
private String srchAdTraceCd;
|
||||
|
||||
/** 테이블 구분 기준 (제품 미포함) */
|
||||
private String unitFlag;
|
||||
/** 테이블 구분 기준 (제품 포함) */
|
||||
private String unitGoodsFlag;
|
||||
/** 검색조건 시작일 */
|
||||
private String srchStrtSndngDt;
|
||||
/** 검색조건 종료일 */
|
||||
private String srchEndSndngDt;
|
||||
/** 검색조건2 시작일 */
|
||||
private String srchStrtSndngDt2;
|
||||
/** 검색조건2 종료일 */
|
||||
private String srchEndSndngDt2;
|
||||
/** 검색조건 기간의 기준 */
|
||||
private String srchDate;
|
||||
|
||||
/** 정렬기준 */
|
||||
private String ordrStand;
|
||||
/** 정렬방식 */
|
||||
private String ordrType;
|
||||
/** 정렬조건 */
|
||||
private String ordrFinal;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,466 @@
|
||||
package com.wb.domainserver.domain.mngr.stats.marktAnals.controller;
|
||||
|
||||
import com.wb.domainserver.domain.mngr.stats.marktAnals.vo.MarktAnalsVO;
|
||||
import com.wb.domainserver.exception.WnbtRestException;
|
||||
import com.wb.domainserver.response.WnbtResponse;
|
||||
import com.wb.domainserver.response.WnbtWebClientResponseHandler;
|
||||
import com.wb.domainserver.security.authorization.annotation.AuthPolicy;
|
||||
import com.wb.domainserver.security.authorization.annotation.Policy;
|
||||
import com.wb.domainserver.util.communicate.RESRC;
|
||||
import com.wb.domainserver.util.communicate.ReplyFromResrc;
|
||||
import com.wb.domainserver.util.communicate.SendToResrc;
|
||||
import com.wb.domainserver.util.excel.ExcelDownloadUtil;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.CookieValue;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "/mngr/stats/marktAnals")
|
||||
@Slf4j
|
||||
public class MarktAnalsController {
|
||||
|
||||
/** WebClient 호출을 위한 wrapper */
|
||||
@Autowired
|
||||
private WnbtWebClientResponseHandler responseHandler;
|
||||
|
||||
@Autowired
|
||||
private SendToResrc sendToResrc;
|
||||
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* 유입통계
|
||||
*************************************************************************/
|
||||
|
||||
/**
|
||||
* 관리자 유입통계 화면
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrInflowStats")
|
||||
public String selectMngrInflowStats(ModelMap model) {
|
||||
MarktAnalsVO vo = new MarktAnalsVO();
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/marktAnals/selectBOMngrInflowStats", vo),
|
||||
model,
|
||||
"cond"
|
||||
);
|
||||
model.put("resultMap", vo);
|
||||
|
||||
return "mngr/stats/marktAnals/inflowStats";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 관리자 유입통계 차트1 조회
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrInflowStatsChart1Inqire")
|
||||
public ResponseEntity<WnbtResponse> selectMngrInflowStatsChart1Inqire(@CookieValue(value = "authSopmalCd") String authSopmalCd, MarktAnalsVO vo) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/marktAnals/selectBOMngrInflowStatsChart1Inqire", vo),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 관리자 유입통계 차트2 조회
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrInflowStatsChart2Inqire")
|
||||
public ResponseEntity<WnbtResponse> selectMngrInflowStatsChart2Inqire(@CookieValue(value = "authSopmalCd") String authSopmalCd, MarktAnalsVO vo) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/marktAnals/selectBOMngrInflowStatsChart2Inqire", vo),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 관리자 유입통계 표 조회
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrInflowStatsTableInqire")
|
||||
public String selectMngrInflowStatsTableInqire(@CookieValue(value = "authSopmalCd") String authSopmalCd, MarktAnalsVO vo, ModelMap model) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/marktAnals/selectBOMngrInflowStatsTableInqire", vo),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
return "mngr/stats/marktAnals/inflowStatsTable";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 관리자 유입통계 엑셀 다운로드
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectMngrInflowStatsExcelFileDownload", method = RequestMethod.POST)
|
||||
public void selectMngrInflowStatsExcelFileDownload(HttpServletResponse response, @CookieValue(value = "authSopmalCd") String authSopmalCd, MarktAnalsVO vo){
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/marktAnals/selectBOMngrInflowStatsExcelFileDownload",vo)
|
||||
);
|
||||
|
||||
List<Map<String, Object>> excelList = new ArrayList<>();
|
||||
if(resultMap.get("excelList") != null) {
|
||||
excelList = (List<Map<String, Object>>) resultMap.get("excelList");
|
||||
}
|
||||
|
||||
//엑셀 항목별 제목에 출력될 내용 설정
|
||||
LinkedHashMap<String, String> headerMap = new LinkedHashMap<String, String>();
|
||||
|
||||
//엑셀 항목에 출력될 내용 설정
|
||||
List<Map<String, Object>> dataList = new ArrayList<>();
|
||||
|
||||
// 엑셀 다운로드 파일명
|
||||
String excelFileName = "";
|
||||
|
||||
int accessUserCnt = 0; // 유입수
|
||||
int ordrCnt = 0; // 결제건수
|
||||
int rlSetleAmt = 0; // 결제금액
|
||||
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map = (HashMap<String, Object>) excelList.get(i);
|
||||
|
||||
accessUserCnt = (int) Double.parseDouble(map.get("accessUserCnt").toString());
|
||||
ordrCnt = (int) Double.parseDouble(map.get("ordrCnt").toString());
|
||||
rlSetleAmt = (int) Double.parseDouble(map.get("rlSetleAmt").toString());
|
||||
|
||||
dataMap.put("itme01", map.get("rnum") ); // 순번
|
||||
dataMap.put("itme02", map.get("dt") ); // 일자
|
||||
if("detail".equals(vo.getUnitFlag() ) ) // 상세
|
||||
dataMap.put("itme03", map.get("hr") ); // 시간대
|
||||
dataMap.put("itme04", accessUserCnt ); // 유입수
|
||||
dataMap.put("itme05", ordrCnt ); // 결제건수
|
||||
dataMap.put("itme06", rlSetleAmt ); // 결제금액
|
||||
dataMap.put("itme07", map.get("rlSetleAmtRt").toString() ); // 유입당결제율
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
headerMap.put("itme01", "순번");
|
||||
headerMap.put("itme02", "일자");
|
||||
if("detail".equals(vo.getUnitFlag() ) ) // 상세
|
||||
headerMap.put("itme03", "시간대");
|
||||
headerMap.put("itme04", "유입수");
|
||||
headerMap.put("itme05", "결제건수");
|
||||
headerMap.put("itme06", "결제금액");
|
||||
headerMap.put("itme07", "유입당결제율");
|
||||
|
||||
excelFileName = "유입통계_";
|
||||
|
||||
if("tableSimple".equals(vo.getUnitFlag()) ) { // 간단
|
||||
excelFileName += "간단_";
|
||||
}else if("tableDetail".equals(vo.getUnitFlag()) ) { // 상세
|
||||
excelFileName += "상세_";
|
||||
}
|
||||
excelFileName += String.format("%s~%s", vo.getSrchStrtSndngDt(), vo.getSrchEndSndngDt());
|
||||
|
||||
// LocalDateTime now = LocalDateTime.now();
|
||||
//
|
||||
// if(now != null) {
|
||||
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmm"); // 포맷 지정
|
||||
// String formattedNow = now.format(formatter); // 포맷에 맞춰 현재 날짜와 시간 출력
|
||||
// excelFileName += formattedNow; // 엑셀 다운로드 파일명
|
||||
// }
|
||||
|
||||
try {
|
||||
//엑셀생성 및 다운로드
|
||||
String encodedFileName = URLEncoder.encode(excelFileName, StandardCharsets.UTF_8.toString()).replaceAll("\\+", "%20");
|
||||
ExcelDownloadUtil.createExcel(encodedFileName, headerMap, dataList, response, true);
|
||||
|
||||
} catch(IOException ioe) {
|
||||
log.error("엑셀다운로드 중 오류가 발생하였습니다.", ioe);
|
||||
throw new WnbtRestException("엑셀다운로드 중 오류가 발생하였습니다.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* 쿠폰통계
|
||||
*************************************************************************/
|
||||
|
||||
/**
|
||||
* 관리자 쿠폰통계 화면
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrCouponStats")
|
||||
public String selectMngrCouponStats(ModelMap model) {
|
||||
MarktAnalsVO vo = new MarktAnalsVO();
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/marktAnals/selectBOMngrCouponStats", vo),
|
||||
model,
|
||||
"cond"
|
||||
);
|
||||
model.put("resultMap", vo);
|
||||
|
||||
return "mngr/stats/marktAnals/couponStats";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 관리자 쿠폰통계 표 조회
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrCouponStatsTableInqire")
|
||||
public String selectMngrCouponStatsTableInqire(@CookieValue(value = "authSopmalCd") String authSopmalCd, MarktAnalsVO vo, ModelMap model) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/marktAnals/selectBOMngrCouponStatsTableInqire", vo),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
return "mngr/stats/marktAnals/couponStatsTable";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 관리자 쿠폰통계 엑셀 다운로드
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectMngrCouponStatsExcelFileDownload", method = RequestMethod.POST)
|
||||
public void selectMngrCouponStatsExcelFileDownload(HttpServletResponse response, @CookieValue(value = "authSopmalCd") String authSopmalCd, MarktAnalsVO vo){
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/marktAnals/selectBOMngrCouponStatsExcelFileDownload",vo)
|
||||
);
|
||||
|
||||
List<Map<String, Object>> excelList = new ArrayList<>();
|
||||
if(resultMap.get("excelList") != null) {
|
||||
excelList = (List<Map<String, Object>>) resultMap.get("excelList");
|
||||
}
|
||||
|
||||
//엑셀 항목별 제목에 출력될 내용 설정
|
||||
LinkedHashMap<String, String> headerMap = new LinkedHashMap<String, String>();
|
||||
|
||||
//엑셀 항목에 출력될 내용 설정
|
||||
List<Map<String, Object>> dataList = new ArrayList<>();
|
||||
|
||||
// 엑셀 다운로드 파일명
|
||||
String excelFileName = "";
|
||||
|
||||
int discountAmt = 0; // 유입수
|
||||
int couponDwldCnt = 0; // 발급건수
|
||||
int couponUseDcnt = 0; // 사용건수
|
||||
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map = (HashMap<String, Object>) excelList.get(i);
|
||||
|
||||
discountAmt = (int) Double.parseDouble(map.get("discountAmt").toString());
|
||||
couponDwldCnt = (int) Double.parseDouble(map.get("couponDwldCnt").toString());
|
||||
couponUseDcnt = (int) Double.parseDouble(map.get("couponUseDcnt").toString());
|
||||
|
||||
dataMap.put("itme01", map.get("rnum") ); // 순번
|
||||
dataMap.put("itme02", map.get("coupNm") ); // 쿠폰명
|
||||
dataMap.put("itme03", map.get("gubun") ); // 쿠폰구분
|
||||
dataMap.put("itme04", discountAmt ); // 쿠폰할인금액
|
||||
dataMap.put("itme05", couponDwldCnt ); // 발급건수
|
||||
dataMap.put("itme06", couponUseDcnt ); // 사용건수
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
headerMap.put("itme01", "순번");
|
||||
headerMap.put("itme02", "쿠폰명");
|
||||
headerMap.put("itme03", "쿠폰구분");
|
||||
headerMap.put("itme04", "쿠폰할인금액");
|
||||
headerMap.put("itme05", "발급건수");
|
||||
headerMap.put("itme06", "사용건수");
|
||||
|
||||
excelFileName = "쿠폰통계_";
|
||||
|
||||
if("".equals(vo.getUnitFlag()) ) {
|
||||
excelFileName += "";
|
||||
}
|
||||
excelFileName += String.format("%s~%s", vo.getSrchStrtSndngDt(), vo.getSrchEndSndngDt());
|
||||
// excelFileName += String.format("&%s~%s", vo.getSrchStrtSndngDt2(), vo.getSrchEndSndngDt2());
|
||||
|
||||
// LocalDateTime now = LocalDateTime.now();
|
||||
//
|
||||
// if(now != null) {
|
||||
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmm"); // 포맷 지정
|
||||
// String formattedNow = now.format(formatter); // 포맷에 맞춰 현재 날짜와 시간 출력
|
||||
// excelFileName += formattedNow; // 엑셀 다운로드 파일명
|
||||
// }
|
||||
|
||||
try {
|
||||
//엑셀생성 및 다운로드
|
||||
String encodedFileName = URLEncoder.encode(excelFileName, StandardCharsets.UTF_8.toString()).replaceAll("\\+", "%20");
|
||||
ExcelDownloadUtil.createExcel(encodedFileName, headerMap, dataList, response, true);
|
||||
|
||||
} catch(IOException ioe) {
|
||||
log.error("엑셀다운로드 중 오류가 발생하였습니다.", ioe);
|
||||
throw new WnbtRestException("엑셀다운로드 중 오류가 발생하였습니다.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* 회원 및 마일리지 통계
|
||||
*************************************************************************/
|
||||
|
||||
/**
|
||||
* 관리자 회원 및 마일리지 통계 화면
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrMbrNdMlgStats")
|
||||
public String selectMngrMbrNdMlgStats(ModelMap model) {
|
||||
MarktAnalsVO vo = new MarktAnalsVO();
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/marktAnals/selectBOMngrMbrNdMlgStats", vo),
|
||||
model,
|
||||
"cond"
|
||||
);
|
||||
model.put("resultMap", vo);
|
||||
|
||||
return "mngr/stats/marktAnals/mbrNdMlgStats";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 관리자 회원 및 마일리지 통계 표 조회
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrMbrNdMlgTableInqire")
|
||||
public String selectMngrMbrNdMlgTableInqire(@CookieValue(value = "authSopmalCd") String authSopmalCd, MarktAnalsVO vo, ModelMap model) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/marktAnals/selectBOMngrMbrNdMlgTableInqire", vo),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
return "mngr/stats/marktAnals/mbrNdMlgStatsTable";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 관리자 회원 및 마일리지 통계 엑셀 다운로드
|
||||
* @param vo
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectMngrMbrNdMlgExcelFileDownload", method = RequestMethod.POST)
|
||||
public void selectMngrMbrNdMlgExcelFileDownload(HttpServletResponse response, @CookieValue(value = "authSopmalCd") String authSopmalCd, MarktAnalsVO vo){
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/marktAnals/selectBOMngrMbrNdMlgExcelFileDownload",vo)
|
||||
);
|
||||
|
||||
List<Map<String, Object>> excelList = new ArrayList<>();
|
||||
if(resultMap.get("excelList") != null) {
|
||||
excelList = (List<Map<String, Object>>) resultMap.get("excelList");
|
||||
}
|
||||
|
||||
//엑셀 항목별 제목에 출력될 내용 설정
|
||||
LinkedHashMap<String, String> headerMap = new LinkedHashMap<String, String>();
|
||||
|
||||
//엑셀 항목에 출력될 내용 설정
|
||||
List<Map<String, Object>> dataList = new ArrayList<>();
|
||||
|
||||
// 엑셀 다운로드 파일명
|
||||
String excelFileName = "";
|
||||
|
||||
int discountAmt = 0; // 유입수
|
||||
int couponDwldCnt = 0; // 결제건수
|
||||
int couponUseCnt = 0; // 결제금액
|
||||
int couponUseDcnt = 0; // 결제금액
|
||||
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map = (HashMap<String, Object>) excelList.get(i);
|
||||
|
||||
discountAmt = (int) Double.parseDouble(map.get("discountAmt").toString());
|
||||
couponDwldCnt = (int) Double.parseDouble(map.get("couponDwldCnt").toString());
|
||||
couponUseCnt = (int) Double.parseDouble(map.get("couponUseCnt").toString());
|
||||
couponUseDcnt = (int) Double.parseDouble(map.get("couponUseDcnt").toString());
|
||||
|
||||
dataMap.put("itme01", map.get("rnum") ); // 순번
|
||||
dataMap.put("itme02", map.get("couponNm") ); // 쿠폰명
|
||||
dataMap.put("itme03", map.get("couponDv") ); // 쿠폰구분
|
||||
dataMap.put("itme04", discountAmt ); // 쿠폰할인금액
|
||||
dataMap.put("itme05", couponDwldCnt ); // 발급건수
|
||||
dataMap.put("itme06", couponUseCnt ); // 사용건수(중복)
|
||||
dataMap.put("itme07", couponUseDcnt ); // 사용건수
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
headerMap.put("itme01", "순번");
|
||||
headerMap.put("itme02", "쿠폰명");
|
||||
headerMap.put("itme03", "쿠폰구분");
|
||||
headerMap.put("itme04", "쿠폰할인금액");
|
||||
headerMap.put("itme05", "발급건수");
|
||||
headerMap.put("itme06", "사용건수(중복)");
|
||||
headerMap.put("itme07", "사용건수");
|
||||
|
||||
excelFileName = "회원&마일리지통계_";
|
||||
|
||||
if("".equals(vo.getUnitFlag()) ) {
|
||||
excelFileName += "";
|
||||
}
|
||||
excelFileName += String.format("%s~%s", vo.getSrchStrtSndngDt(), vo.getSrchEndSndngDt());
|
||||
|
||||
// LocalDateTime now = LocalDateTime.now();
|
||||
//
|
||||
// if(now != null) {
|
||||
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmm"); // 포맷 지정
|
||||
// String formattedNow = now.format(formatter); // 포맷에 맞춰 현재 날짜와 시간 출력
|
||||
// excelFileName += formattedNow; // 엑셀 다운로드 파일명
|
||||
// }
|
||||
|
||||
try {
|
||||
//엑셀생성 및 다운로드
|
||||
String encodedFileName = URLEncoder.encode(excelFileName, StandardCharsets.UTF_8.toString()).replaceAll("\\+", "%20");
|
||||
ExcelDownloadUtil.createExcel(encodedFileName, headerMap, dataList, response, true);
|
||||
|
||||
} catch(IOException ioe) {
|
||||
log.error("엑셀다운로드 중 오류가 발생하였습니다.", ioe);
|
||||
throw new WnbtRestException("엑셀다운로드 중 오류가 발생하였습니다.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.wb.domainserver.domain.mngr.stats.marktAnals.vo;
|
||||
|
||||
import com.wb.domainserver.domain.comm.vo.AbstractVO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class MarktAnalsVO extends AbstractVO{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 쇼핑몰코드 */
|
||||
private String sopmalCd;
|
||||
|
||||
/** 검색조건 일, 주, 월 */
|
||||
private String unitFlag;
|
||||
/** 검색조건 시작일 */
|
||||
private String srchStrtSndngDt;
|
||||
/** 검색조건 종료일 */
|
||||
private String srchEndSndngDt;
|
||||
/** 검색조건2 시작일 */
|
||||
private String srchStrtSndngDt2;
|
||||
/** 검색조건2 종료일 */
|
||||
private String srchEndSndngDt2;
|
||||
/** 검색조건 기간의 기준 */
|
||||
private String srchDate;
|
||||
/** 검색조건 주문환경 코드 */
|
||||
private List<String> srchOrdrEnvrnCds;
|
||||
|
||||
/** 정렬기준 */
|
||||
private String ordrStand;
|
||||
/** 정렬방식 */
|
||||
private String ordrType;
|
||||
/** 정렬조건 */
|
||||
private String ordrFinal;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.wb.domainserver.domain.mngr.stats.member.controller;
|
||||
|
||||
import com.wb.domainserver.domain.mngr.stats.member.vo.MemberStatVO;
|
||||
import com.wb.domainserver.response.WnbtWebClientResponseHandler;
|
||||
import com.wb.domainserver.security.authorization.annotation.AuthPolicy;
|
||||
import com.wb.domainserver.security.authorization.annotation.Policy;
|
||||
import com.wb.domainserver.util.communicate.RESRC;
|
||||
import com.wb.domainserver.util.communicate.SendToResrc;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.CookieValue;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/mngr/stats/memberStat")
|
||||
public class MemberStatController {
|
||||
|
||||
|
||||
/** WebClient 호출을 위한 wrapper */
|
||||
@Autowired
|
||||
private WnbtWebClientResponseHandler responseHandler;
|
||||
|
||||
@Autowired
|
||||
private SendToResrc sendToResrc;
|
||||
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping("/selectMemberStat")
|
||||
public String selectMngrMemberStat (@CookieValue(value = "authSopmalCd") String authSopmalCd, ModelMap model) {
|
||||
|
||||
MemberStatVO vo = new MemberStatVO();
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
responseHandler.handleResponse(sendToResrc.ofPost(RESRC.GCONEBO,"/gcone/stats/memberStat/selectBOMemberStat", vo),
|
||||
model,
|
||||
"cond"
|
||||
);
|
||||
|
||||
model.put("resultMap", vo);
|
||||
return "mngr/stats/memberStat/memberStat";
|
||||
}
|
||||
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrMemberStatTableInqire")
|
||||
public String selectMngrMemberStatTableInqire(@CookieValue(value = "authSopmalCd") String authSopmalCd, MemberStatVO vo, ModelMap model) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/memberStat/selectBOMngrMemberStatTableInqire", vo),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
return "mngr/stats/memberStat/memberStatsTable";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.wb.domainserver.domain.mngr.stats.member.vo;
|
||||
|
||||
import com.wb.domainserver.domain.comm.vo.AbstractVO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper=false)
|
||||
public class MemberStatVO extends AbstractVO {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String sopmalCd;
|
||||
}
|
||||
@@ -0,0 +1,896 @@
|
||||
package com.wb.domainserver.domain.mngr.stats.sleAnals.controller;
|
||||
|
||||
import com.wb.domainserver.domain.mngr.stats.sleAnals.vo.SleAnalsVO;
|
||||
import com.wb.domainserver.exception.WnbtRestException;
|
||||
import com.wb.domainserver.response.WnbtResponse;
|
||||
import com.wb.domainserver.response.WnbtWebClientResponseHandler;
|
||||
import com.wb.domainserver.security.authorization.annotation.AuthPolicy;
|
||||
import com.wb.domainserver.security.authorization.annotation.Policy;
|
||||
import com.wb.domainserver.util.communicate.RESRC;
|
||||
import com.wb.domainserver.util.communicate.ReplyFromResrc;
|
||||
import com.wb.domainserver.util.communicate.SendToResrc;
|
||||
import com.wb.domainserver.util.excel.ExcelDownloadUtil;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.CookieValue;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "/mngr/stats/sleAnals")
|
||||
@Slf4j
|
||||
public class SleAnalsController {
|
||||
|
||||
/** WebClient 호출을 위한 wrapper */
|
||||
@Autowired
|
||||
private WnbtWebClientResponseHandler responseHandler;
|
||||
|
||||
@Autowired
|
||||
private SendToResrc sendToResrc;
|
||||
|
||||
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* 판매성과
|
||||
*************************************************************************/
|
||||
|
||||
/**
|
||||
* 관리자 판매성과 화면
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrSleRslt")
|
||||
public String selectMngrSleRslt(ModelMap model, SleAnalsVO vo) {
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/sleAnals/selectBOMngrSleRslt", vo),
|
||||
model,
|
||||
"cond"
|
||||
);
|
||||
model.put("resultMap", vo);
|
||||
|
||||
return "mngr/stats/sleAnals/sleRslt";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 관리자 판매성과 차트1 조회
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrSleRsltChart1Inqire")
|
||||
public ResponseEntity<WnbtResponse> selectMngrSleRsltChart1Inqire(@CookieValue(value = "authSopmalCd") String authSopmalCd, SleAnalsVO vo) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/sleAnals/selectBOMngrSleRsltChart1Inqire", vo),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 관리자 판매성과 차트2 조회
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrSleRsltChart2Inqire")
|
||||
public ResponseEntity<WnbtResponse> selectMngrSleRsltChart2Inqire(@CookieValue(value = "authSopmalCd") String authSopmalCd, SleAnalsVO vo) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/sleAnals/selectBOMngrSleRsltChart2Inqire", vo),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 관리자 판매성과 표 조회
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrSleRsltTableInqire")
|
||||
public String selectMngrSleRsltTableInqire(@CookieValue(value = "authSopmalCd") String authSopmalCd, SleAnalsVO vo, ModelMap model) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/sleAnals/selectBOMngrSleRsltTableInqire", vo),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
return "mngr/stats/sleAnals/sleRsltTable";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 관리자 판매성과 엑셀 다운로드
|
||||
* @param SelngPrufVO
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectMngrSleRsltExcelFileDownload", method = RequestMethod.POST)
|
||||
public void selectMngrSleRsltExcelFileDownload(HttpServletResponse response, @CookieValue(value = "authSopmalCd") String authSopmalCd, SleAnalsVO vo){
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/sleAnals/selectBOMngrSleRsltExcelFileDownload",vo)
|
||||
);
|
||||
|
||||
List<Map<String, Object>> excelList = new ArrayList<>();
|
||||
if(resultMap.get("excelList") != null) {
|
||||
excelList = (List<Map<String, Object>>) resultMap.get("excelList");
|
||||
}
|
||||
|
||||
//엑셀 항목별 제목에 출력될 내용 설정
|
||||
LinkedHashMap<String, String> headerMap = new LinkedHashMap<String, String>();
|
||||
|
||||
//엑셀 항목에 출력될 내용 설정
|
||||
List<Map<String, Object>> dataList = new ArrayList<>();
|
||||
|
||||
// 엑셀 다운로드 파일명
|
||||
String excelFileName = "";
|
||||
|
||||
int ordrCnt = 0; // 결제건수
|
||||
int slepricSum = 0; // 상품금액
|
||||
int goodsCouponDscntSum = 0; // 쿠폰사용금액
|
||||
int mlgDscntSum = 0; // 마일리지사용금액
|
||||
int cartCouponDscntSum = 0; // 장바구니 할인금액
|
||||
int purchsDscntSum = 0; // 복수구매 할인금액
|
||||
int evtDscntSum = 0; // 이벤트 할인금액
|
||||
int enuriDscntSum = 0; // 에누리 할인금액
|
||||
int rlDlvyAmt = 0; // 배송비
|
||||
int rlSetleAmt = 0; // 결제금액
|
||||
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map = (HashMap<String, Object>) excelList.get(i);
|
||||
|
||||
ordrCnt = (int) Double.parseDouble(map.get("ordrCnt").toString());
|
||||
slepricSum = (int) Double.parseDouble(map.get("slepricSum").toString());
|
||||
goodsCouponDscntSum = (int) Double.parseDouble(map.get("goodsCouponDscntSum").toString());
|
||||
mlgDscntSum = (int) Double.parseDouble(map.get("mlgDscntSum").toString());
|
||||
cartCouponDscntSum = (int) Double.parseDouble(map.get("cartCouponDscntSum").toString());
|
||||
purchsDscntSum = (int) Double.parseDouble(map.get("purchsDscntSum").toString());
|
||||
evtDscntSum = (int) Double.parseDouble(map.get("evtDscntSum").toString());
|
||||
enuriDscntSum = (int) Double.parseDouble(map.get("enuriDscntSum").toString());
|
||||
rlDlvyAmt = (int) Double.parseDouble(map.get("rlDlvyAmt").toString());
|
||||
rlSetleAmt = (int) Double.parseDouble(map.get("rlSetleAmt").toString());
|
||||
|
||||
dataMap.put("itme01", map.get("rnum") ); // 순번
|
||||
dataMap.put("itme02", map.get("dt") ); // 일자
|
||||
if("detail".equals(vo.getUnitFlag() ) ) // 상세
|
||||
dataMap.put("itme03", map.get("hr") ); // 시간대
|
||||
dataMap.put("itme04", ordrCnt ); // 결제건수
|
||||
dataMap.put("itme05", slepricSum ); // 상품금액
|
||||
dataMap.put("itme06", goodsCouponDscntSum ); // 쿠폰사용금액
|
||||
dataMap.put("itme07", mlgDscntSum ); // 마일리지사용금액
|
||||
dataMap.put("itme08", cartCouponDscntSum ); // 장바구니 할인금액
|
||||
dataMap.put("itme09", purchsDscntSum ); // 복수구매 할인금액
|
||||
dataMap.put("itme10", evtDscntSum ); // 이벤트 할인금액
|
||||
dataMap.put("itme11", enuriDscntSum ); // 에누리 할인금액
|
||||
dataMap.put("itme12", rlDlvyAmt ); // 배송비
|
||||
dataMap.put("itme13", rlSetleAmt ); // 결제금액
|
||||
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
headerMap.put("itme01", "순번");
|
||||
headerMap.put("itme02", "일자");
|
||||
if("detail".equals(vo.getUnitFlag() ) ) // 상세
|
||||
headerMap.put("itme03", "시간대");
|
||||
headerMap.put("itme04", "결제건수");
|
||||
headerMap.put("itme05", "상품금액");
|
||||
headerMap.put("itme06", "쿠폰사용금액");
|
||||
headerMap.put("itme07", "마일리지사용금액");
|
||||
headerMap.put("itme08", "장바구니 할인금액");
|
||||
headerMap.put("itme09", "복수구매 할인금액");
|
||||
headerMap.put("itme10", "이벤트 할인금액");
|
||||
headerMap.put("itme11", "에누리 할인금액");
|
||||
headerMap.put("itme12", "배송비");
|
||||
headerMap.put("itme13", "결제금액");
|
||||
|
||||
excelFileName = "판매성과_";
|
||||
|
||||
if("simple".equals(vo.getUnitFlag()) ) { // 간단
|
||||
excelFileName += "간단_";
|
||||
}else if("detail".equals(vo.getUnitFlag() ) ) { // 상세
|
||||
excelFileName += "상세_";
|
||||
}
|
||||
excelFileName += String.format("%s~%s", vo.getSrchStrtSndngDt(), vo.getSrchEndSndngDt());
|
||||
|
||||
// LocalDateTime now = LocalDateTime.now();
|
||||
//
|
||||
// if(now != null) {
|
||||
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmm"); // 포맷 지정
|
||||
// String formattedNow = now.format(formatter); // 포맷에 맞춰 현재 날짜와 시간 출력
|
||||
// excelFileName = "stats_"+formattedNow; // 엑셀 다운로드 파일명
|
||||
// }
|
||||
|
||||
try {
|
||||
//엑셀생성 및 다운로드
|
||||
String encodedFileName = URLEncoder.encode(excelFileName, StandardCharsets.UTF_8.toString()).replaceAll("\\+", "%20");
|
||||
ExcelDownloadUtil.createExcel(encodedFileName, headerMap, dataList, response, true);
|
||||
|
||||
} catch(IOException ioe) {
|
||||
log.error("엑셀다운로드 중 오류가 발생하였습니다.", ioe);
|
||||
throw new WnbtRestException("엑셀다운로드 중 오류가 발생하였습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* 상품성과
|
||||
*************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* 관리자 상품성과 화면
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrGoodsRslt")
|
||||
public String selectMngrGoodsRslt(ModelMap model) {
|
||||
SleAnalsVO vo = new SleAnalsVO();
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/sleAnals/selectBOMngrGoodsRslt", vo),
|
||||
model,
|
||||
"cond"
|
||||
);
|
||||
model.put("resultMap", vo);
|
||||
|
||||
return "mngr/stats/sleAnals/goodsRslt";
|
||||
}
|
||||
|
||||
/**
|
||||
* 관리자 상품성과 차트 조회
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrGoodsRsltChartInqire")
|
||||
public ResponseEntity<WnbtResponse> selectMngrGoodsRsltChartInqire(@CookieValue(value = "authSopmalCd") String authSopmalCd, SleAnalsVO vo) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/sleAnals/selectBOMngrGoodsRsltChartInqire", vo),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 관리자 상품성과 표 조회
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrGoodsRsltTableInqire")
|
||||
public String selectMngrGoodsRsltTableInqire(@CookieValue(value = "authSopmalCd") String authSopmalCd, SleAnalsVO vo, ModelMap model) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/sleAnals/selectBOMngrGoodsRsltTableInqire", vo),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
return "mngr/stats/sleAnals/goodsRsltTable";
|
||||
}
|
||||
|
||||
/**
|
||||
* 관리자 상품성과 엑셀 다운로드
|
||||
* @param SelngPrufVO
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectMngrGoodsRsltExcelFileDownload", method = RequestMethod.POST)
|
||||
public void selectMngrGoodsRsltExcelFileDownload(HttpServletResponse response, @CookieValue(value = "authSopmalCd") String authSopmalCd, SleAnalsVO vo){
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/sleAnals/selectBOMngrGoodsRsltExcelFileDownload",vo)
|
||||
);
|
||||
|
||||
List<Map<String, Object>> excelList = new ArrayList<>();
|
||||
if(resultMap.get("excelList") != null) {
|
||||
excelList = (List<Map<String, Object>>) resultMap.get("excelList");
|
||||
}
|
||||
|
||||
//엑셀 항목별 제목에 출력될 내용 설정
|
||||
LinkedHashMap<String, String> headerMap = new LinkedHashMap<String, String>();
|
||||
|
||||
//엑셀 항목에 출력될 내용 설정
|
||||
List<Map<String, Object>> dataList = new ArrayList<>();
|
||||
|
||||
// 엑셀 다운로드 파일명
|
||||
String excelFileName = "상품성과_";
|
||||
|
||||
int ordrCnt = 0; // 결제건수
|
||||
int ordrQy = 0; // 결제건수
|
||||
int rlSetleAmt = 0; // 결제금액
|
||||
int refundCnt = 0; // 환불건수
|
||||
int refundQy = 0; // 환불건수
|
||||
int refundAmt = 0; // 환불금액
|
||||
int rlDlvyAmt = 0; // 배송비
|
||||
|
||||
if("tableCategory".equals(vo.getUnitFlag()) ) { // 카테고리
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map = (HashMap<String, Object>) excelList.get(i);
|
||||
|
||||
ordrCnt = (int) Double.parseDouble(map.get("ordrCnt").toString());
|
||||
rlSetleAmt = (int) Double.parseDouble(map.get("rlSetleAmt").toString());
|
||||
refundCnt = (int) Double.parseDouble(map.get("refundCnt").toString());
|
||||
refundAmt = (int) Double.parseDouble(map.get("refundAmt").toString());
|
||||
|
||||
dataMap.put("itme01", map.get("rnum") ); // 순번
|
||||
dataMap.put("itme02", map.get("ctgryNm") ); // 카테고리
|
||||
dataMap.put("itme03", ordrCnt ); // 결제건수
|
||||
dataMap.put("itme04", rlSetleAmt ); // 결제금액
|
||||
dataMap.put("itme05", refundCnt ); // 환불건수
|
||||
dataMap.put("itme06", refundAmt ); // 환불금액
|
||||
dataMap.put("itme07", map.get("refundRt").toString() ); // 환불비율
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
headerMap.put("itme01", "순번");
|
||||
headerMap.put("itme02", "카테고리");
|
||||
headerMap.put("itme03", "결제건수");
|
||||
headerMap.put("itme04", "결제금액");
|
||||
headerMap.put("itme05", "환불건수");
|
||||
headerMap.put("itme06", "환불금액");
|
||||
headerMap.put("itme07", "환불비율");
|
||||
|
||||
excelFileName += "카테고리_";
|
||||
|
||||
}else if("tableGoodsNm".equals(vo.getUnitFlag() ) ) { // 상품명
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map = (HashMap<String, Object>) excelList.get(i);
|
||||
|
||||
ordrCnt = (int) Double.parseDouble(map.get("ordrCnt").toString());
|
||||
rlSetleAmt = (int) Double.parseDouble(map.get("rlSetleAmt").toString());
|
||||
refundCnt = (int) Double.parseDouble(map.get("refundCnt").toString());
|
||||
refundAmt = (int) Double.parseDouble(map.get("refundAmt").toString());
|
||||
|
||||
dataMap.put("itme01", map.get("rnum") ); // 순번
|
||||
dataMap.put("itme02", map.get("ctgryNm") ); // 카테고리
|
||||
dataMap.put("itme03", map.get("goodsNm") ); // 상품명
|
||||
dataMap.put("itme04", map.get("goodsInnb") ); // 상품번호
|
||||
dataMap.put("itme05", ordrCnt ); // 결제건수
|
||||
dataMap.put("itme06", rlSetleAmt ); // 결제금액
|
||||
dataMap.put("itme07", refundCnt ); // 환불건수
|
||||
dataMap.put("itme08", refundAmt ); // 환불금액
|
||||
dataMap.put("itme09", map.get("refundRt").toString() ); // 환불비율
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
headerMap.put("itme01", "순번");
|
||||
headerMap.put("itme02", "카테고리");
|
||||
headerMap.put("itme03", "상품명");
|
||||
headerMap.put("itme04", "상품번호");
|
||||
headerMap.put("itme05", "결제건수");
|
||||
headerMap.put("itme06", "결제금액");
|
||||
headerMap.put("itme07", "환불건수");
|
||||
headerMap.put("itme08", "환불금액");
|
||||
headerMap.put("itme09", "환불비율");
|
||||
|
||||
excelFileName += "상품명_";
|
||||
|
||||
}else if("tableOptionNm".equals(vo.getUnitFlag() ) ) { // 옵션명
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map = (HashMap<String, Object>) excelList.get(i);
|
||||
|
||||
ordrCnt = (int) Double.parseDouble(map.get("ordrCnt").toString());
|
||||
ordrQy = (int) Double.parseDouble(map.get("ordrQy").toString());
|
||||
rlSetleAmt = (int) Double.parseDouble(map.get("rlSetleAmt").toString());
|
||||
refundCnt = (int) Double.parseDouble(map.get("refundCnt").toString());
|
||||
refundQy = (int) Double.parseDouble(map.get("refundQy").toString());
|
||||
refundAmt = (int) Double.parseDouble(map.get("refundAmt").toString());
|
||||
|
||||
dataMap.put("itme01", map.get("rnum") ); // 순번
|
||||
dataMap.put("itme02", map.get("ctgryNm") ); // 카테고리
|
||||
dataMap.put("itme03", map.get("goodsNm") ); // 상품명
|
||||
dataMap.put("itme04", map.get("optnVal1") ); // 옵션명
|
||||
dataMap.put("itme05", map.get("goodsInnb") ); // 상품번호
|
||||
dataMap.put("itme06", map.get("optnCd1") ); // 옵션코드
|
||||
dataMap.put("itme07", ordrCnt ); // 결제건수
|
||||
dataMap.put("itme08", ordrQy ); // 옵션주문수량
|
||||
dataMap.put("itme09", rlSetleAmt ); // 결제금액
|
||||
dataMap.put("itme10", refundCnt ); // 환불건수
|
||||
dataMap.put("itme11", refundQy ); // 환불옵션수량
|
||||
dataMap.put("itme12", refundAmt ); // 환불금액
|
||||
dataMap.put("itme13", map.get("refundRt").toString() ); // 환불비율
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
headerMap.put("itme01", "순번");
|
||||
headerMap.put("itme02", "카테고리");
|
||||
headerMap.put("itme03", "상품명");
|
||||
headerMap.put("itme04", "옵션명");
|
||||
headerMap.put("itme05", "상품번호");
|
||||
headerMap.put("itme06", "옵션코드");
|
||||
headerMap.put("itme07", "결제건수");
|
||||
headerMap.put("itme08", "옵션주문수량");
|
||||
headerMap.put("itme09", "결제금액");
|
||||
headerMap.put("itme10", "환불건수");
|
||||
headerMap.put("itme11", "환불옵션수량");
|
||||
headerMap.put("itme12", "환불금액");
|
||||
headerMap.put("itme13", "환불비율");
|
||||
|
||||
excelFileName += "옵션명_";
|
||||
|
||||
}else if("tableWeeklyRslt".equals(vo.getUnitFlag() ) ) { // 주차별 실적
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map = (HashMap<String, Object>) excelList.get(i);
|
||||
|
||||
ordrCnt = (int) Double.parseDouble(map.get("ordrCnt").toString());
|
||||
ordrQy = (int) Double.parseDouble(map.get("ordrQy").toString());
|
||||
rlSetleAmt = (int) Double.parseDouble(map.get("rlSetleAmt").toString());
|
||||
refundCnt = (int) Double.parseDouble(map.get("refundCnt").toString());
|
||||
refundQy = (int) Double.parseDouble(map.get("refundQy").toString());
|
||||
refundAmt = (int) Double.parseDouble(map.get("refundAmt").toString());
|
||||
rlDlvyAmt = (int) Double.parseDouble(map.get("rlDlvyAmt").toString());
|
||||
|
||||
dataMap.put("itme01", map.get("rnum") ); // 순번
|
||||
dataMap.put("itme02", map.get("yrWk") ); // 주
|
||||
dataMap.put("itme03", map.get("dt") ); // 일자
|
||||
dataMap.put("itme04", map.get("ctgryNm") ); // 카테고리
|
||||
dataMap.put("itme05", map.get("goodsNm") ); // 상품명
|
||||
dataMap.put("itme06", map.get("optnVal1") ); // 옵션명
|
||||
dataMap.put("itme07", map.get("goodsInnb") ); // 상품번호
|
||||
dataMap.put("itme08", map.get("optnCd1") ); // 옵션코드
|
||||
dataMap.put("itme09", ordrCnt ); // 결제건수
|
||||
dataMap.put("itme10", ordrQy ); // 옵션주문수량
|
||||
dataMap.put("itme11", rlSetleAmt ); // 결제금액
|
||||
dataMap.put("itme12", refundCnt ); // 환불건수
|
||||
dataMap.put("itme13", refundQy ); // 환불옵션수량
|
||||
dataMap.put("itme14", refundAmt ); // 환불금액
|
||||
dataMap.put("itme15", rlDlvyAmt ); // 배송비
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
headerMap.put("itme01", "순번");
|
||||
headerMap.put("itme02", "주");
|
||||
headerMap.put("itme03", "일자");
|
||||
headerMap.put("itme04", "카테고리");
|
||||
headerMap.put("itme05", "상품명");
|
||||
headerMap.put("itme06", "옵션명");
|
||||
headerMap.put("itme07", "상품번호");
|
||||
headerMap.put("itme08", "옵션코드");
|
||||
headerMap.put("itme09", "결제건수");
|
||||
headerMap.put("itme10", "옵션주문수량");
|
||||
headerMap.put("itme11", "결제금액");
|
||||
headerMap.put("itme12", "환불건수");
|
||||
headerMap.put("itme13", "환불옵션수량");
|
||||
headerMap.put("itme14", "환불금액");
|
||||
headerMap.put("itme15", "배송비");
|
||||
|
||||
excelFileName += "일자&옵션별_";
|
||||
|
||||
}else if("tableDailyRslt".equals(vo.getUnitFlag() ) ) { // 일별 실적
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map = (HashMap<String, Object>) excelList.get(i);
|
||||
|
||||
ordrCnt = (int) Double.parseDouble(map.get("ordrCnt").toString());
|
||||
rlSetleAmt = (int) Double.parseDouble(map.get("rlSetleAmt").toString());
|
||||
refundCnt = (int) Double.parseDouble(map.get("refundCnt").toString());
|
||||
refundAmt = (int) Double.parseDouble(map.get("refundAmt").toString());
|
||||
rlDlvyAmt = (int) Double.parseDouble(map.get("rlDlvyAmt").toString());
|
||||
|
||||
dataMap.put("itme01", map.get("rnum") ); // 순번
|
||||
dataMap.put("itme02", map.get("dt") ); // 일자
|
||||
dataMap.put("itme03", ordrCnt ); // 결제건수
|
||||
dataMap.put("itme04", rlSetleAmt ); // 결제금액
|
||||
dataMap.put("itme05", refundCnt ); // 환불건수
|
||||
dataMap.put("itme06", refundAmt ); // 환불금액
|
||||
dataMap.put("itme07", rlDlvyAmt ); // 배송비
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
headerMap.put("itme01", "순번");
|
||||
headerMap.put("itme02", "일자");
|
||||
headerMap.put("itme03", "결제건수");
|
||||
headerMap.put("itme04", "결제금액");
|
||||
headerMap.put("itme05", "환불건수");
|
||||
headerMap.put("itme06", "환불금액");
|
||||
headerMap.put("itme07", "배송비");
|
||||
|
||||
excelFileName += "일자별_";
|
||||
|
||||
}else if("tableSleEnvRslt".equals(vo.getUnitFlag() ) ) { // 판매환경별 실적
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map = (HashMap<String, Object>) excelList.get(i);
|
||||
|
||||
ordrCnt = (int) Double.parseDouble(map.get("ordrCnt").toString());
|
||||
ordrQy = (int) Double.parseDouble(map.get("ordrQy").toString());
|
||||
rlSetleAmt = (int) Double.parseDouble(map.get("rlSetleAmt").toString());
|
||||
refundCnt = (int) Double.parseDouble(map.get("refundCnt").toString());
|
||||
refundQy = (int) Double.parseDouble(map.get("refundQy").toString());
|
||||
refundAmt = (int) Double.parseDouble(map.get("refundAmt").toString());
|
||||
rlDlvyAmt = (int) Double.parseDouble(map.get("rlDlvyAmt").toString());
|
||||
|
||||
dataMap.put("itme01", map.get("rnum") ); // 순번
|
||||
dataMap.put("itme02", map.get("dt") ); // 일자
|
||||
dataMap.put("itme03", map.get("sleEnvrnCd") ); // 판매환경코드
|
||||
dataMap.put("itme04", map.get("ctgryNm") ); // 카테고리
|
||||
dataMap.put("itme05", map.get("goodsNm") ); // 상품명
|
||||
dataMap.put("itme06", map.get("optnVal1") ); // 옵션명
|
||||
dataMap.put("itme07", map.get("goodsInnb") ); // 상품번호
|
||||
dataMap.put("itme08", map.get("optnCd1") ); // 옵션코드
|
||||
dataMap.put("itme09", ordrCnt ); // 결제건수
|
||||
dataMap.put("itme10", ordrQy ); // 옵션주문수량
|
||||
dataMap.put("itme11", rlSetleAmt ); // 결제금액
|
||||
dataMap.put("itme12", refundCnt ); // 환불건수
|
||||
dataMap.put("itme13", refundQy ); // 환불옵션수량
|
||||
dataMap.put("itme14", refundAmt ); // 환불금액
|
||||
dataMap.put("itme15", rlDlvyAmt ); // 배송비
|
||||
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
headerMap.put("itme01", "순번");
|
||||
headerMap.put("itme02", "일자");
|
||||
headerMap.put("itme03", "판매환경코드");
|
||||
headerMap.put("itme04", "카테고리");
|
||||
headerMap.put("itme05", "상품명");
|
||||
headerMap.put("itme06", "옵션명");
|
||||
headerMap.put("itme07", "상품번호");
|
||||
headerMap.put("itme08", "옵션코드");
|
||||
headerMap.put("itme09", "결제건수");
|
||||
headerMap.put("itme10", "옵션주문수량");
|
||||
headerMap.put("itme11", "결제금액");
|
||||
headerMap.put("itme12", "환불건수");
|
||||
headerMap.put("itme13", "환불옵션수량");
|
||||
headerMap.put("itme14", "환불금액");
|
||||
headerMap.put("itme15", "배송비");
|
||||
|
||||
excelFileName += "일자별&판매환경별_";
|
||||
|
||||
}
|
||||
excelFileName += String.format("%s~%s", vo.getSrchStrtSndngDt(), vo.getSrchEndSndngDt());
|
||||
|
||||
// LocalDateTime now = LocalDateTime.now();
|
||||
//
|
||||
// if(now != null) {
|
||||
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmm"); // 포맷 지정
|
||||
// String formattedNow = now.format(formatter); // 포맷에 맞춰 현재 날짜와 시간 출력
|
||||
// excelFileName += formattedNow; // 엑셀 다운로드 파일명
|
||||
// }
|
||||
|
||||
try {
|
||||
//엑셀생성 및 다운로드
|
||||
String encodedFileName = URLEncoder.encode(excelFileName, StandardCharsets.UTF_8.toString()).replaceAll("\\+", "%20");
|
||||
ExcelDownloadUtil.createExcel(encodedFileName, headerMap, dataList, response, true);
|
||||
|
||||
} catch(IOException ioe) {
|
||||
log.error("엑셀다운로드 중 오류가 발생하였습니다.", ioe);
|
||||
throw new WnbtRestException("엑셀다운로드 중 오류가 발생하였습니다.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* 상품/인구통계
|
||||
*************************************************************************/
|
||||
|
||||
/**
|
||||
* 관리자 상품/인구통계 화면
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrGoodsPopulationStats")
|
||||
public String selectMngrGoodsPopulationStats(ModelMap model) {
|
||||
SleAnalsVO vo = new SleAnalsVO();
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/sleAnals/selectBOMngrGoodsPopulationStats", vo),
|
||||
model,
|
||||
"cond"
|
||||
);
|
||||
model.put("resultMap", vo);
|
||||
|
||||
return "mngr/stats/sleAnals/goodsPopulationStats";
|
||||
}
|
||||
|
||||
/**
|
||||
* 관리자 상품/인구통계 화면 차트 조회
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrGoodsPopulationStatsChartInqire")
|
||||
public ResponseEntity<WnbtResponse> selectMngrGoodsPopulationStatsChartInqire(@CookieValue(value = "authSopmalCd") String authSopmalCd, SleAnalsVO vo) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
return responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/sleAnals/selectBOMngrGoodsPopulationStatsChartInqire", vo),
|
||||
ReplyFromResrc::getReply
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 관리자 상품/인구통계 표 조회
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrGoodsPopulationStatsTableInqire")
|
||||
public String selectMngrGoodsPopulationStatsTableInqire(@CookieValue(value = "authSopmalCd") String authSopmalCd, SleAnalsVO vo, ModelMap model) {
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
|
||||
responseHandler.handleResponse(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/sleAnals/selectBOMngrGoodsPopulationStatsTableInqire", vo),
|
||||
model,
|
||||
"resultMap"
|
||||
);
|
||||
|
||||
return "mngr/stats/sleAnals/goodsPopulationStatsTable";
|
||||
}
|
||||
|
||||
/**
|
||||
* 관리자 상품/인구통계 엑셀 다운로드
|
||||
* @param SelngPrufVO
|
||||
* @return
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
@Policy(AuthPolicy.PUBLIC)
|
||||
@RequestMapping(value="/selectMngrGoodsPopulationStatsExcelFileDownload", method = RequestMethod.POST)
|
||||
public void selectMngrGoodsPopulationStatsExcelFileDownload(HttpServletResponse response, @CookieValue(value = "authSopmalCd") String authSopmalCd, SleAnalsVO vo){
|
||||
vo.setSopmalCd(authSopmalCd);
|
||||
Map<String,Object> resultMap = responseHandler.handleResponseAsMap(
|
||||
sendToResrc.ofPost(RESRC.GCONEBO, "/gcone/stats/sleAnals/selectBOMngrGoodsPopulationStatsExcelFileDownload",vo)
|
||||
);
|
||||
|
||||
|
||||
List<Map<String, Object>> excelList = new ArrayList<>();
|
||||
if(resultMap.get("excelList") != null) {
|
||||
excelList = (List<Map<String, Object>>) resultMap.get("excelList");
|
||||
}
|
||||
|
||||
//엑셀 항목별 제목에 출력될 내용 설정
|
||||
LinkedHashMap<String, String> headerMap = new LinkedHashMap<String, String>();
|
||||
|
||||
//엑셀 항목에 출력될 내용 설정
|
||||
List<Map<String, Object>> dataList = new ArrayList<>();
|
||||
|
||||
// 엑셀 다운로드 파일명
|
||||
String excelFileName = "상품&인구통계_";
|
||||
|
||||
int ordrCnt = 0; // 결제건수
|
||||
int rlSetleAmt = 0; // 결제금액
|
||||
|
||||
if("goodsSex".equals(vo.getUnitFlag()) ) { // 상품-성별
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map = (HashMap<String, Object>) excelList.get(i);
|
||||
|
||||
ordrCnt = (int) Double.parseDouble(map.get("ordrCnt").toString());
|
||||
rlSetleAmt = (int) Double.parseDouble(map.get("rlSetleAmt").toString());
|
||||
|
||||
dataMap.put("itme01", map.get("rnum") ); // 순번
|
||||
dataMap.put("itme02", map.get("goodsNm") ); // 상품명
|
||||
dataMap.put("itme03", map.get("goodsInnb") ); // 상품번호
|
||||
dataMap.put("itme04", map.get("sex") ); // 성별
|
||||
dataMap.put("itme05", ordrCnt ); // 결제건수
|
||||
dataMap.put("itme06", rlSetleAmt ); // 결제금액
|
||||
dataMap.put("itme07", map.get("rlSetleAmtRt").toString() ); // 결제금액비율
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
headerMap.put("itme01", "순번");
|
||||
headerMap.put("itme02", "상품명");
|
||||
headerMap.put("itme03", "상품번호");
|
||||
headerMap.put("itme04", "성별");
|
||||
headerMap.put("itme05", "결제건수");
|
||||
headerMap.put("itme06", "결제금액");
|
||||
headerMap.put("itme07", "결제금액비율");
|
||||
|
||||
excelFileName += "상품-성별_";
|
||||
|
||||
}else if("goodsAge".equals(vo.getUnitFlag() ) ) { // 상품-나이
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map = (HashMap<String, Object>) excelList.get(i);
|
||||
|
||||
ordrCnt = (int) Double.parseDouble(map.get("ordrCnt").toString());
|
||||
rlSetleAmt = (int) Double.parseDouble(map.get("rlSetleAmt").toString());
|
||||
|
||||
dataMap.put("itme01", map.get("rnum") ); // 순번
|
||||
dataMap.put("itme02", map.get("goodsNm") ); // 상품명
|
||||
dataMap.put("itme03", map.get("goodsInnb") ); // 상품번호
|
||||
dataMap.put("itme04", map.get("ageDvCd") ); // 나이별
|
||||
dataMap.put("itme05", ordrCnt ); // 결제건수
|
||||
dataMap.put("itme06", rlSetleAmt ); // 결제금액
|
||||
dataMap.put("itme07", map.get("rlSetleAmtRt").toString() ); // 결제금액비율
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
headerMap.put("itme01", "순번");
|
||||
headerMap.put("itme02", "상품명");
|
||||
headerMap.put("itme03", "상품번호");
|
||||
headerMap.put("itme04", "나이별");
|
||||
headerMap.put("itme05", "결제건수");
|
||||
headerMap.put("itme06", "결제금액");
|
||||
headerMap.put("itme07", "결제금액비율");
|
||||
|
||||
excelFileName += "상품-나이_";
|
||||
|
||||
}else if("goodsSexAge".equals(vo.getUnitFlag() ) ) { // 상품-성별/나이
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map = (HashMap<String, Object>) excelList.get(i);
|
||||
|
||||
ordrCnt = (int) Double.parseDouble(map.get("ordrCnt").toString());
|
||||
rlSetleAmt = (int) Double.parseDouble(map.get("rlSetleAmt").toString());
|
||||
|
||||
dataMap.put("itme01", map.get("rnum") ); // 순번
|
||||
dataMap.put("itme02", map.get("goodsNm") ); // 상품명
|
||||
dataMap.put("itme03", map.get("goodsInnb") ); // 상품번호
|
||||
dataMap.put("itme04", map.get("sex") ); // 성별
|
||||
dataMap.put("itme05", map.get("ageDvCd") ); // 나이별
|
||||
dataMap.put("itme06", ordrCnt ); // 결제건수
|
||||
dataMap.put("itme07", rlSetleAmt ); // 결제금액
|
||||
dataMap.put("itme08", map.get("rlSetleAmtRt").toString() ); // 결제금액비율
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
headerMap.put("itme01", "순번");
|
||||
headerMap.put("itme02", "상품명");
|
||||
headerMap.put("itme03", "상품번호");
|
||||
headerMap.put("itme04", "성별");
|
||||
headerMap.put("itme05", "나이별");
|
||||
headerMap.put("itme06", "결제건수");
|
||||
headerMap.put("itme07", "결제금액");
|
||||
headerMap.put("itme08", "결제금액비율");
|
||||
|
||||
excelFileName += "상품-성별&나이_";
|
||||
|
||||
}else if("categorySex".equals(vo.getUnitFlag() ) ) { // 카테고리-성별
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map = (HashMap<String, Object>) excelList.get(i);
|
||||
|
||||
ordrCnt = (int) Double.parseDouble(map.get("ordrCnt").toString());
|
||||
rlSetleAmt = (int) Double.parseDouble(map.get("rlSetleAmt").toString());
|
||||
|
||||
dataMap.put("itme01", map.get("rnum") ); // 순번
|
||||
dataMap.put("itme02", map.get("ctgryNm") ); // 카테고리명
|
||||
dataMap.put("itme03", map.get("sex") ); // 성별
|
||||
dataMap.put("itme04", ordrCnt ); // 결제건수
|
||||
dataMap.put("itme05", rlSetleAmt ); // 결제금액
|
||||
dataMap.put("itme06", map.get("rlSetleAmtRt").toString() ); // 결제금액비율
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
headerMap.put("itme01", "순번");
|
||||
headerMap.put("itme02", "카테고리명");
|
||||
headerMap.put("itme03", "성별");
|
||||
headerMap.put("itme04", "결제건수");
|
||||
headerMap.put("itme05", "결제금액");
|
||||
headerMap.put("itme06", "결제금액비율");
|
||||
|
||||
excelFileName += "카테고리-성별_";
|
||||
|
||||
}else if("categoryAge".equals(vo.getUnitFlag() ) ) { // 카테고리-나이
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map = (HashMap<String, Object>) excelList.get(i);
|
||||
|
||||
ordrCnt = (int) Double.parseDouble(map.get("ordrCnt").toString());
|
||||
rlSetleAmt = (int) Double.parseDouble(map.get("rlSetleAmt").toString());
|
||||
|
||||
dataMap.put("itme01", map.get("rnum") ); // 순번
|
||||
dataMap.put("itme02", map.get("ctgryNm") ); // 카테고리명
|
||||
dataMap.put("itme03", map.get("ageDvCd") ); // 나이별
|
||||
dataMap.put("itme04", ordrCnt ); // 결제건수
|
||||
dataMap.put("itme05", rlSetleAmt ); // 결제금액
|
||||
dataMap.put("itme06", map.get("rlSetleAmtRt").toString() ); // 결제금액비율
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
headerMap.put("itme01", "순번");
|
||||
headerMap.put("itme02", "카테고리명");
|
||||
headerMap.put("itme03", "나이별");
|
||||
headerMap.put("itme04", "결제건수");
|
||||
headerMap.put("itme05", "결제금액");
|
||||
headerMap.put("itme06", "결제금액비율");
|
||||
|
||||
excelFileName += "카테고리-나이_";
|
||||
|
||||
}else if("categorySexAge".equals(vo.getUnitFlag() ) ) { // 카테고리-성별/나이
|
||||
for (int i = 0; i < excelList.size(); i++) {
|
||||
HashMap<String, Object> dataMap = new HashMap<>();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map = (HashMap<String, Object>) excelList.get(i);
|
||||
|
||||
ordrCnt = (int) Double.parseDouble(map.get("ordrCnt").toString());
|
||||
rlSetleAmt = (int) Double.parseDouble(map.get("rlSetleAmt").toString());
|
||||
|
||||
dataMap.put("itme01", map.get("rnum") ); // 순번
|
||||
dataMap.put("itme02", map.get("ctgryNm") ); // 카테고리명
|
||||
dataMap.put("itme03", map.get("sex") ); // 성별
|
||||
dataMap.put("itme04", map.get("ageDvCd") ); // 나이별
|
||||
dataMap.put("itme05", ordrCnt ); // 결제건수
|
||||
dataMap.put("itme06", rlSetleAmt ); // 결제금액
|
||||
dataMap.put("itme07", map.get("rlSetleAmtRt").toString() ); // 결제금액비율
|
||||
dataList.add(dataMap);
|
||||
}
|
||||
headerMap.put("itme01", "순번");
|
||||
headerMap.put("itme02", "카테고리명");
|
||||
headerMap.put("itme03", "성별");
|
||||
headerMap.put("itme04", "나이별");
|
||||
headerMap.put("itme05", "결제건수");
|
||||
headerMap.put("itme06", "결제금액");
|
||||
headerMap.put("itme07", "결제금액비율");
|
||||
|
||||
excelFileName += "카테고리-성별&나이_";
|
||||
|
||||
}
|
||||
excelFileName += String.format("%s~%s", vo.getSrchStrtSndngDt(), vo.getSrchEndSndngDt());
|
||||
|
||||
// LocalDateTime now = LocalDateTime.now();
|
||||
//
|
||||
// if(now != null) {
|
||||
// DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddHHmm"); // 포맷 지정
|
||||
// String formattedNow = now.format(formatter); // 포맷에 맞춰 현재 날짜와 시간 출력
|
||||
// excelFileName += formattedNow; // 엑셀 다운로드 파일명
|
||||
// }
|
||||
|
||||
try {
|
||||
//엑셀생성 및 다운로드
|
||||
String encodedFileName = URLEncoder.encode(excelFileName, StandardCharsets.UTF_8.toString()).replaceAll("\\+", "%20");
|
||||
ExcelDownloadUtil.createExcel(encodedFileName, headerMap, dataList, response, true);
|
||||
|
||||
} catch(IOException ioe) {
|
||||
log.error("엑셀다운로드 중 오류가 발생하였습니다.", ioe);
|
||||
throw new WnbtRestException("엑셀다운로드 중 오류가 발생하였습니다.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
* 결제방식통계
|
||||
*************************************************************************/
|
||||
|
||||
/**
|
||||
* 관리자 결제방식통계 화면
|
||||
* @return
|
||||
*/
|
||||
@Policy(AuthPolicy.RESTRICTED)
|
||||
@RequestMapping(value="/selectMngrSetleMthStats")
|
||||
public String selectMngrSetleMthStats() {
|
||||
return "mngr/stats/sleAnals/setleMthStats";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.wb.domainserver.domain.mngr.stats.sleAnals.vo;
|
||||
|
||||
import com.wb.domainserver.domain.comm.vo.AbstractVO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class SleAnalsVO extends AbstractVO{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 쇼핑몰코드 */
|
||||
private String sopmalCd;
|
||||
|
||||
/** 검색조건 일, 주, 월 */
|
||||
private String unitFlag;
|
||||
/** 검색조건 시작일 */
|
||||
private String srchStrtSndngDt;
|
||||
/** 검색조건 종료일 */
|
||||
private String srchEndSndngDt;
|
||||
/** 검색조건 기간의 기준 */
|
||||
private String srchDate;
|
||||
/** 검색조건 주문환경 코드 */
|
||||
private List<String> srchOrdrEnvrnCds;
|
||||
|
||||
/** 정렬기준 */
|
||||
private String ordrStand;
|
||||
/** 정렬방식 */
|
||||
private String ordrType;
|
||||
/** 정렬조건 */
|
||||
private String ordrFinal;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user