|
@@ -7,7 +7,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
+import com.gagaframework.excel.GagaExcelUtil;
|
|
|
|
|
+import com.gagaframework.excel.env.GagaExcelConstants;
|
|
|
|
|
+import com.gagaframework.web.util.GagaDateUtil;
|
|
|
import com.style24.admin.biz.dao.TsaCustomerDao;
|
|
import com.style24.admin.biz.dao.TsaCustomerDao;
|
|
|
|
|
+import com.style24.admin.support.env.TsaConstants;
|
|
|
import com.style24.admin.support.security.session.TsaSession;
|
|
import com.style24.admin.support.security.session.TsaSession;
|
|
|
import com.style24.core.biz.service.TscCustomerService;
|
|
import com.style24.core.biz.service.TscCustomerService;
|
|
|
import com.style24.core.biz.service.TscKakaotalkService;
|
|
import com.style24.core.biz.service.TscKakaotalkService;
|
|
@@ -510,4 +514,166 @@ public class TsaCustomerService {
|
|
|
customerDao.deleteCellPhnno(customer);
|
|
customerDao.deleteCellPhnno(customer);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 활동회원 목록 엑셀
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param customerSearch
|
|
|
|
|
+ * @param excelFilenameWithPath - 경로를 포함한 엑셀파일명
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @author jmh
|
|
|
|
|
+ * @since 2021. 12. 08
|
|
|
|
|
+ */
|
|
|
|
|
+ public void getCustomerActiveExcelList(CustomerSearch customerSearch, String excelFilenameWithPath) {
|
|
|
|
|
+
|
|
|
|
|
+ // 헤더 title 설정
|
|
|
|
|
+ String[] listTitles = {"사이트", "회원ID", "회원NO", "회원명", "회원구분", "등급", "관리대상", "생년월일", "가입일자", "로그인일자", "핸드폰", "이메일", "성별", "수신동의(SMS)", "수신동의(Email)"};
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // DB 처리 시 사용되는 파라미터명(셀명) 설정
|
|
|
|
|
+ String[] cellNames = {"siteCd", "custId", "custNo", "custNm", "custGb", "custGrade", "managedRsn", "birthYmd", "joinDt"
|
|
|
|
|
+ , "loginLdt", "cellPhnno", "email", "sexGb", "smsAgreeYn", "emailAgreeYn"};
|
|
|
|
|
+
|
|
|
|
|
+ String[] cellTypes = {
|
|
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name()};
|
|
|
|
|
+
|
|
|
|
|
+ Collection<Customer> custList = customerDao.getCustomerActiveExcelList(customerSearch);
|
|
|
|
|
+ for( Customer cust : custList ) {
|
|
|
|
|
+ cust.setCustId(cust.getMaskingCustId());
|
|
|
|
|
+ cust.setCustNm(cust.getMaskingCustNm());
|
|
|
|
|
+ cust.setCellPhnno(cust.getMaskingCellPhnno());
|
|
|
|
|
+ cust.setEmail(cust.getMaskingEmail());
|
|
|
|
|
+ cust.setBirthYmd(GagaDateUtil.getDate(GagaDateUtil.getDate(cust.getBirthYmd(), "yyyyMMdd"), "yyyy-MM-dd"));
|
|
|
|
|
+
|
|
|
|
|
+ if(cust.getSexGb().equals(TscConstants.Gender.FEMALE.value())) {
|
|
|
|
|
+ cust.setSexGb("여성");
|
|
|
|
|
+ }else if(cust.getSexGb().equals(TscConstants.Gender.MALE.value())) {
|
|
|
|
|
+ cust.setSexGb("남성");
|
|
|
|
|
+ }else if(cust.getSexGb().equals(TscConstants.Gender.COMMON.value())) {
|
|
|
|
|
+ cust.setSexGb("공통");
|
|
|
|
|
+ }else {
|
|
|
|
|
+ cust.setSexGb("알수없음");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+
|
|
|
|
|
+ GagaExcelUtil.createExcel(excelFilenameWithPath, custList, "활동회원", listTitles, cellNames, cellTypes, TsaConstants.EXCEL_FOOTER_TITLE);
|
|
|
|
|
+
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ throw new IllegalStateException(e);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 탈퇴회원 목록 엑셀
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param customerSearch
|
|
|
|
|
+ * @param excelFilenameWithPath - 경로를 포함한 엑셀파일명
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @author jmh
|
|
|
|
|
+ * @since 2021. 12. 08
|
|
|
|
|
+ */
|
|
|
|
|
+ public void getCustomerSecedeExcelList(CustomerSearch customerSearch, String excelFilenameWithPath) {
|
|
|
|
|
+
|
|
|
|
|
+ // 헤더 title 설정
|
|
|
|
|
+ String[] listTitles = {"사이트", "회원ID", "회원NO", "회원명", "핸드폰", "이메일", "성별", "생년월일", "탈퇴일자"};
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // DB 처리 시 사용되는 파라미터명(셀명) 설정
|
|
|
|
|
+ String[] cellNames = {"siteCd", "custId", "custNo", "custNm", "cellPhnno", "email", "sexGb", "birthYmd", "secedeDt"};
|
|
|
|
|
+
|
|
|
|
|
+ String[] cellTypes = {
|
|
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name()};
|
|
|
|
|
+
|
|
|
|
|
+ Collection<Customer> custList = customerDao.getCustomerSecedeExcelList(customerSearch);
|
|
|
|
|
+ for( Customer cust : custList ) {
|
|
|
|
|
+ cust.setCustId(cust.getMaskingCustId());
|
|
|
|
|
+ cust.setCustNm(cust.getMaskingCustNm());
|
|
|
|
|
+ cust.setCellPhnno(cust.getMaskingCellPhnno());
|
|
|
|
|
+ cust.setEmail(cust.getMaskingEmail());
|
|
|
|
|
+ cust.setBirthYmd(GagaDateUtil.getDate(GagaDateUtil.getDate(cust.getBirthYmd(), "yyyyMMdd"), "yyyy-MM-dd"));
|
|
|
|
|
+
|
|
|
|
|
+ if(cust.getSexGb().equals(TscConstants.Gender.FEMALE.value())) {
|
|
|
|
|
+ cust.setSexGb("여성");
|
|
|
|
|
+ }else if(cust.getSexGb().equals(TscConstants.Gender.MALE.value())) {
|
|
|
|
|
+ cust.setSexGb("남성");
|
|
|
|
|
+ }else if(cust.getSexGb().equals(TscConstants.Gender.COMMON.value())) {
|
|
|
|
|
+ cust.setSexGb("공통");
|
|
|
|
|
+ }else {
|
|
|
|
|
+ cust.setSexGb("알수없음");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+
|
|
|
|
|
+ GagaExcelUtil.createExcel(excelFilenameWithPath, custList, "탈퇴회원", listTitles, cellNames, cellTypes, TsaConstants.EXCEL_FOOTER_TITLE);
|
|
|
|
|
+
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ throw new IllegalStateException(e);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 휴면회원 목록 엑셀
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param customerSearch
|
|
|
|
|
+ * @param excelFilenameWithPath - 경로를 포함한 엑셀파일명
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @author jmh
|
|
|
|
|
+ * @since 2021. 12. 08
|
|
|
|
|
+ */
|
|
|
|
|
+ public void getCustomerDormantExcelList(CustomerSearch customerSearch, String excelFilenameWithPath) {
|
|
|
|
|
+
|
|
|
|
|
+ // 헤더 title 설정
|
|
|
|
|
+ String[] listTitles = {"사이트", "회원ID", "회원NO", "회원명", "핸드폰", "이메일", "성별", "생년월일", "휴면일자"};
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // DB 처리 시 사용되는 파라미터명(셀명) 설정
|
|
|
|
|
+ String[] cellNames = {"siteCd", "custId", "custNo", "custNm", "cellPhnno", "email", "sexGb", "birthYmd", "dormantDt"};
|
|
|
|
|
+
|
|
|
|
|
+ String[] cellTypes = {
|
|
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name(), GagaExcelConstants.CellType.CHAR_CENTER.name(),
|
|
|
|
|
+ GagaExcelConstants.CellType.CHAR_CENTER.name()};
|
|
|
|
|
+
|
|
|
|
|
+ Collection<Customer> custList = customerDao.getCustomerDormantExcelList(customerSearch);
|
|
|
|
|
+ for( Customer cust : custList ) {
|
|
|
|
|
+ cust.setCustId(cust.getMaskingCustId());
|
|
|
|
|
+ cust.setCustNm(cust.getMaskingCustNm());
|
|
|
|
|
+ cust.setCellPhnno(cust.getMaskingCellPhnno());
|
|
|
|
|
+ cust.setEmail(cust.getMaskingEmail());
|
|
|
|
|
+ cust.setBirthYmd(GagaDateUtil.getDate(GagaDateUtil.getDate(cust.getBirthYmd(), "yyyyMMdd"), "yyyy-MM-dd"));
|
|
|
|
|
+
|
|
|
|
|
+ if(cust.getSexGb().equals(TscConstants.Gender.FEMALE.value())) {
|
|
|
|
|
+ cust.setSexGb("여성");
|
|
|
|
|
+ }else if(cust.getSexGb().equals(TscConstants.Gender.MALE.value())) {
|
|
|
|
|
+ cust.setSexGb("남성");
|
|
|
|
|
+ }else if(cust.getSexGb().equals(TscConstants.Gender.COMMON.value())) {
|
|
|
|
|
+ cust.setSexGb("공통");
|
|
|
|
|
+ }else {
|
|
|
|
|
+ cust.setSexGb("알수없음");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+
|
|
|
|
|
+ GagaExcelUtil.createExcel(excelFilenameWithPath, custList, "휴면회원", listTitles, cellNames, cellTypes, TsaConstants.EXCEL_FOOTER_TITLE);
|
|
|
|
|
+
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ throw new IllegalStateException(e);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|