Jelajahi Sumber

답변문구유형 상품문의 추가에 따른 수정

gagamel 4 tahun lalu
induk
melakukan
bff6bc90da

+ 62 - 77
src/main/java/com/style24/admin/biz/web/TsaCustomerController.java

@@ -2,24 +2,6 @@ package com.style24.admin.biz.web;
 
 import java.util.Collection;
 
-import com.gagaframework.web.parameter.GagaMap;
-import com.gagaframework.web.util.GagaStringUtil;
-import com.style24.admin.biz.service.TsaCustomerService;
-import com.style24.admin.support.util.TsitUtil;
-import com.style24.core.biz.service.TscKakaotalkService;
-import com.style24.core.biz.service.TscMailService;
-import com.style24.core.support.env.TscConstants;
-import com.style24.core.support.session.TscSession;
-import com.style24.core.support.util.CryptoUtils;
-import com.style24.persistence.TscPageRequest;
-import com.style24.persistence.domain.Coupon;
-import com.style24.persistence.domain.CustContactHst;
-import com.style24.persistence.domain.CustDeliveryAddr;
-import com.style24.persistence.domain.CustGrade;
-import com.style24.persistence.domain.Customer;
-import com.style24.persistence.domain.CustomerSearch;
-import com.style24.persistence.domain.GiftCard;
-
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -33,21 +15,35 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
 import com.style24.admin.biz.service.TsaCounselService;
+import com.style24.admin.biz.service.TsaCustomerService;
 import com.style24.admin.biz.service.TsaRendererService;
 import com.style24.admin.support.controller.TsaBaseController;
 import com.style24.admin.support.security.session.TsaSession;
 import com.style24.core.biz.service.TscAnswerPhaseService;
+import com.style24.core.biz.service.TscKakaotalkService;
+import com.style24.core.biz.service.TscMailService;
+import com.style24.core.support.env.TscConstants;
 import com.style24.core.support.message.TscMessageByLocale;
+import com.style24.core.support.session.TscSession;
+import com.style24.core.support.util.CryptoUtils;
+import com.style24.persistence.TscPageRequest;
 import com.style24.persistence.domain.AnswerPhase;
 import com.style24.persistence.domain.Counsel;
+import com.style24.persistence.domain.Coupon;
+import com.style24.persistence.domain.CustContactHst;
+import com.style24.persistence.domain.CustDeliveryAddr;
+import com.style24.persistence.domain.CustGrade;
+import com.style24.persistence.domain.Customer;
+import com.style24.persistence.domain.CustomerSearch;
+import com.style24.persistence.domain.GiftCard;
+import com.style24.persistence.domain.Point;
+import com.style24.persistence.domain.Review;
 
 import lombok.extern.slf4j.Slf4j;
 
+import com.gagaframework.web.parameter.GagaMap;
 import com.gagaframework.web.rest.server.GagaResponse;
-import com.style24.persistence.domain.Order;
-import com.style24.persistence.domain.Plan;
-import com.style24.persistence.domain.Point;
-import com.style24.persistence.domain.Review;
+import com.gagaframework.web.util.GagaStringUtil;
 
 /**
  * 고객 Controller
@@ -116,15 +112,15 @@ public class TsaCustomerController extends TsaBaseController {
 	@ResponseBody
 	public GagaMap getOneToOneQnaList(@RequestBody Counsel counsel) {
 		GagaMap result = new GagaMap();
-		
+
 		counsel.setPageable(new TscPageRequest(counsel.getPageNo() - 1, counsel.getPageSize()));
 		counsel.getPageable().setTotalCount(counselService.getOneToOneQnaListCount(counsel));
-		
+
 		Collection<Counsel> counselList = counselService.getOneToOneQnaList(counsel);
-		
+
 		result.set("pageing", counsel);
 		result.set("counselList", counselList);
-		
+
 		return result;
 	}
 
@@ -182,21 +178,21 @@ public class TsaCustomerController extends TsaBaseController {
 
 		counselService.updateQnaAnswer(counsel);
 
-		// TODO. 고객이 SMS답변수신을 요청했을 때
+		// 고객이 알림톡답변수신을 요청했을 때
 		if (counsel.getSmsReqYn().equals("Y")) {
 			try {
 				if (counsel.getCounselType().equals("C")) {
 					// 일대일문의상세 조회
 					Counsel tCounsel = counselService.getOneToOneQna(counsel.getCounselSq());
 					// 1:1문의답변완료안내 카카오알림톡 발송
-					kakaotalkService.sendOneToOneAnswerNotify(tCounsel,tCounsel.getCustNo());
-				}else if (counsel.getCounselType().equals("G")) {
+					kakaotalkService.sendOneToOneAnswerNotify(tCounsel, tCounsel.getCustNo());
+				} else if (counsel.getCounselType().equals("G")) {
 					// 상품문의상세 조회
 					Counsel tCounsel = counselService.getGoodsQna(counsel.getCounselSq());
 					// 상품문의답변완료안내 카카오알림톡 발송
-					kakaotalkService.sendGoodsAskNotify(tCounsel,tCounsel.getCustNo());					
+					kakaotalkService.sendGoodsAskNotify(tCounsel, tCounsel.getCustNo());
 				}
-				
+
 			} catch (Exception e) {
 				// Do nothing
 			}
@@ -238,18 +234,17 @@ public class TsaCustomerController extends TsaBaseController {
 	@PostMapping("/goods/qna/list")
 	@ResponseBody
 	public GagaMap getGoodsQnaList(@RequestBody Counsel counsel) {
-		
+
 		GagaMap result = new GagaMap();
-		
+
 		counsel.setPageable(new TscPageRequest(counsel.getPageNo() - 1, counsel.getPageSize()));
 		counsel.getPageable().setTotalCount(counselService.getGoodsQnaListCount(counsel));
-		
+
 		Collection<Counsel> counselList = counselService.getGoodsQnaList(counsel);
-		
+
 		result.set("pageing", counsel);
 		result.set("counselList", counselList);
-		
-		
+
 		return result;
 	}
 
@@ -271,7 +266,7 @@ public class TsaCustomerController extends TsaBaseController {
 		mav.addObject("counselInfo", counselService.getGoodsQna(counselSq));
 
 		// 문의용 답변문구
-		mav.addObject("ansPhaseList", rendererService.getQnaAnswerPhaseList("G061_20"));
+		mav.addObject("ansPhaseList", rendererService.getQnaAnswerPhaseList("G061_21"));
 
 		mav.setViewName("customer/GoodsQnaDetailForm");
 
@@ -322,7 +317,7 @@ public class TsaCustomerController extends TsaBaseController {
 		mav.addObject("managedRsnList", rendererService.getCommonCodeList("G103", "Y"));
 
 		// 간편가입유형
-		mav.addObject("snsTypeList", rendererService.getCommonCodeList("G105","Y"));
+		mav.addObject("snsTypeList", rendererService.getCommonCodeList("G105", "Y"));
 
 		mav.setViewName("customer/CustomerActiveListForm");
 
@@ -342,14 +337,14 @@ public class TsaCustomerController extends TsaBaseController {
 		GagaMap result = new GagaMap();
 		// multi row 검색관련 처리
 		if (!StringUtils.isBlank(customerSearch.getCondition())) {
-			if(customerSearch.getSearch().equals("custNm") || customerSearch.getSearch().equals("email")){
+			if (customerSearch.getSearch().equals("custNm") || customerSearch.getSearch().equals("email")) {
 				String[] multiParams = customerSearch.getCondition().replaceAll("\r", "").split("\n");
 				for (int i = 0; i < multiParams.length; i++) {
 					multiParams[i] = CryptoUtils.encryptAES(multiParams[i]);
 				}
 
 				customerSearch.setConditions(multiParams);
-			}else{
+			} else {
 				customerSearch.setConditions(customerSearch.getCondition().replaceAll("\r", "").split("\n"));
 			}
 		}
@@ -358,12 +353,12 @@ public class TsaCustomerController extends TsaBaseController {
 		if ("custNm".equals(customerSearch.getSearchGb()) || "email".equals(customerSearch.getSearchGb())) {
 			customerSearch.setSearchTxt(CryptoUtils.encryptAES(customerSearch.getSearchTxt()));
 		}
-		if(!"Y".equals(customerSearch.getCpnPubPopYn())){
+		if (!"Y".equals(customerSearch.getCpnPubPopYn())) {
 			customerSearch.setCpnPubPopYn("N");
 		}
 		customerSearch.encryptData();	//데이터 암호화 필요
 		customerSearch.setRegNo(TsaSession.getInfo().getUserNo());
-		customerSearch.setPageable(new TscPageRequest(customerSearch.getPageNo()-1, customerSearch.getPageSize()));
+		customerSearch.setPageable(new TscPageRequest(customerSearch.getPageNo() - 1, customerSearch.getPageSize()));
 		customerSearch.getPageable().setTotalCount(customerService.getCustomerActiveListCount(customerSearch));
 		TscSession.setAttribute("maskingYn", TsaSession.getInfo().getMaskingYn());
 
@@ -393,7 +388,7 @@ public class TsaCustomerController extends TsaBaseController {
 		mav.addObject("genderGbList", rendererService.getCommonCodeList("G007"));
 
 		// 회원 구분
-		mav.addObject("custGbList", rendererService.getCommonCodeList("G100","Y"));
+		mav.addObject("custGbList", rendererService.getCommonCodeList("G100", "Y"));
 
 		// 회원 등급
 		mav.addObject("custGradeList", rendererService.getCommonCodeList("G110"));
@@ -439,7 +434,7 @@ public class TsaCustomerController extends TsaBaseController {
 
 		// 포인트반영상태
 		mav.addObject("pntUploadStatList", rendererService.getCommonCodeList("G070"));
-		
+
 		// 상품평포인트반영상태
 		mav.addObject("reviewPntStatList", rendererService.getCommonCodeList("G043"));
 
@@ -513,17 +508,13 @@ public class TsaCustomerController extends TsaBaseController {
 	 * @since 2021. 01. 21
 	 */
 	@GetMapping("/lms/popup/form")
-	public ModelAndView lmsPopupForm(@RequestParam(value = "elementCellPhnno", required = false) String elementCellPhnno
-									, @RequestParam(value = "elementCustNo") String elementCustNo
-									, @RequestParam(value = "elementMaskingCellPhnno", required = false) String maskingCellPhnno
-									, @RequestParam(value = "pageGb", required = false) String pageGb) {
+	public ModelAndView lmsPopupForm(@RequestParam(value = "elementCellPhnno", required = false) String elementCellPhnno, @RequestParam(value = "elementCustNo") String elementCustNo, @RequestParam(value = "elementMaskingCellPhnno", required = false) String maskingCellPhnno, @RequestParam(value = "pageGb", required = false) String pageGb) {
 		ModelAndView mav = new ModelAndView();
 		// 휴대폰 번호
 		mav.addObject("elementCellPhnno", elementCellPhnno);
 
-
 		// 휴대폰 번호
-		mav.addObject("maskingCellPhnno", StringUtils.defaultString(maskingCellPhnno,""));
+		mav.addObject("maskingCellPhnno", StringUtils.defaultString(maskingCellPhnno, ""));
 
 		// 고객 아이디
 		mav.addObject("elementCustNo", elementCustNo);
@@ -570,8 +561,7 @@ public class TsaCustomerController extends TsaBaseController {
 	 * @since 2021. 01. 25
 	 */
 	@GetMapping("/cellphone/change/popup/form")
-	public ModelAndView cellphoneChangePopupForm(@RequestParam(value = "elementCellPhnno", required = false) String elementCellPhnno
-			, @RequestParam(value = "elementCustNo") String elementCustNo) {
+	public ModelAndView cellphoneChangePopupForm(@RequestParam(value = "elementCellPhnno", required = false) String elementCellPhnno, @RequestParam(value = "elementCustNo") String elementCustNo) {
 		ModelAndView mav = new ModelAndView();
 		// 휴대폰 번호
 		mav.addObject("elementCellPhnno", elementCellPhnno);
@@ -609,7 +599,6 @@ public class TsaCustomerController extends TsaBaseController {
 		TsaSession.setAttribute("certNo", certNo);
 		TsaSession.setAttribute("cellPhnno", customer.getCellPhnno());
 
-
 		Customer custInfo = customerService.getCustomerInfo(customer.getCustNo());
 		customer.setCustNm(custInfo.getCustNm());
 		customer.setCertNo(certNo);
@@ -664,9 +653,7 @@ public class TsaCustomerController extends TsaBaseController {
 	 * @since 2021. 01. 21
 	 */
 	@GetMapping("/email/popup/form")
-	public ModelAndView emailPopupForm(@RequestParam(value = "elementEmail") String elementEmail
-									, @RequestParam(value = "elementCustNo") String elementCustNo
-									, @RequestParam(value = "elementMaskingEmail", required = false) String elementMaskingEmail) {
+	public ModelAndView emailPopupForm(@RequestParam(value = "elementEmail") String elementEmail, @RequestParam(value = "elementCustNo") String elementCustNo, @RequestParam(value = "elementMaskingEmail", required = false) String elementMaskingEmail) {
 
 		ModelAndView mav = new ModelAndView();
 
@@ -674,7 +661,7 @@ public class TsaCustomerController extends TsaBaseController {
 		mav.addObject("elementEmail", elementEmail);
 
 		// 마스킹된 이메일
-		mav.addObject("elementMaskingEmail", StringUtils.defaultString(elementMaskingEmail,""));
+		mav.addObject("elementMaskingEmail", StringUtils.defaultString(elementMaskingEmail, ""));
 
 		// 고객 번호
 		mav.addObject("elementCustNo", elementCustNo);
@@ -718,7 +705,7 @@ public class TsaCustomerController extends TsaBaseController {
 	 * @since 2021. 01. 21
 	 */
 	@GetMapping("/secede/popup/form")
-	public ModelAndView emailPopupForm( @RequestParam(value = "elementCustNo") String elementCustNo) {
+	public ModelAndView emailPopupForm(@RequestParam(value = "elementCustNo") String elementCustNo) {
 
 		ModelAndView mav = new ModelAndView();
 
@@ -763,7 +750,7 @@ public class TsaCustomerController extends TsaBaseController {
 	public GagaMap getCustomerOrderList(@RequestBody CustomerSearch customerSearch) {
 		GagaMap result = new GagaMap();
 		customerSearch.setRegNo(TsaSession.getInfo().getUserNo());
-		customerSearch.setPageable(new TscPageRequest(customerSearch.getPageNo()-1, customerSearch.getPageSize()));
+		customerSearch.setPageable(new TscPageRequest(customerSearch.getPageNo() - 1, customerSearch.getPageSize()));
 		customerSearch.getPageable().setTotalCount(customerService.getCustomerOrderListCount(customerSearch));
 		result.set("pageing", customerSearch);
 		result.set("custOrderList", customerService.getCustomerOrderList(customerSearch));
@@ -891,11 +878,11 @@ public class TsaCustomerController extends TsaBaseController {
 	 * @author jsshin
 	 * @since 2021. 01. 21
 	 */
-		@GetMapping("/review/list/{custNo}")
-		@ResponseBody
-		public Collection<Review> getCustomerReviewList(@PathVariable Integer custNo) {
-			return customerService.getCustomerReviewList(custNo);
-		}
+	@GetMapping("/review/list/{custNo}")
+	@ResponseBody
+	public Collection<Review> getCustomerReviewList(@PathVariable Integer custNo) {
+		return customerService.getCustomerReviewList(custNo);
+	}
 
 	/**
 	 * 회원상세-회원등급변경이력
@@ -905,11 +892,11 @@ public class TsaCustomerController extends TsaBaseController {
 	 * @author jsshin
 	 * @since 2021. 01. 21
 	 */
-		@GetMapping("/change/grade/list/{custNo}")
-		@ResponseBody
-		public Collection<CustGrade> getCustomerChageGradeList(@PathVariable Integer custNo) {
-			return customerService.getCustomerChangeGradeList(custNo);
-		}
+	@GetMapping("/change/grade/list/{custNo}")
+	@ResponseBody
+	public Collection<CustGrade> getCustomerChageGradeList(@PathVariable Integer custNo) {
+		return customerService.getCustomerChangeGradeList(custNo);
+	}
 
 	/**
 	 * 회원상세-회원접촉이력
@@ -940,7 +927,6 @@ public class TsaCustomerController extends TsaBaseController {
 		return super.ok(message.getMessage("SUCC_0001"));
 	}
 
-
 	/**
 	 * 탈퇴회원
 	 * @return ModelAndView
@@ -1051,13 +1037,13 @@ public class TsaCustomerController extends TsaBaseController {
 			try {
 				boolean isRelase = customerService.releaseDormantCustomer(customer);
 				if (isRelase) {
-					succCnt ++;
+					succCnt++;
 				} else {
-					failCnt ++;
+					failCnt++;
 				}
 			} catch (Exception e) {
 				log.error(e.getMessage());
-				failCnt ++;
+				failCnt++;
 			}
 		}
 		result.setInt("totalCnt", totalCnt);
@@ -1085,10 +1071,10 @@ public class TsaCustomerController extends TsaBaseController {
 		for (Customer customer : customerCollection) {
 			try {
 				customerService.deleteSecedeCustomer(customer.getCustNo());
-				succCnt ++;
+				succCnt++;
 			} catch (Exception e) {
 				log.error(e.getMessage());
-				failCnt ++;
+				failCnt++;
 			}
 		}
 		result.setInt("totalCnt", totalCnt);
@@ -1098,5 +1084,4 @@ public class TsaCustomerController extends TsaBaseController {
 		return result;
 	}
 
-
 }