|
|
@@ -20,8 +20,11 @@ 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.TscCustomerService;
|
|
|
import com.style24.core.biz.service.TscKakaotalkService;
|
|
|
+import com.style24.core.biz.service.TscKcpService;
|
|
|
import com.style24.core.biz.service.TscMailService;
|
|
|
+import com.style24.core.biz.service.TscOrderChangeService;
|
|
|
import com.style24.core.support.env.TscConstants;
|
|
|
import com.style24.core.support.message.TscMessageByLocale;
|
|
|
import com.style24.core.support.session.TscSession;
|
|
|
@@ -30,6 +33,7 @@ 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.CustAccount;
|
|
|
import com.style24.persistence.domain.CustContactHst;
|
|
|
import com.style24.persistence.domain.CustDeliveryAddr;
|
|
|
import com.style24.persistence.domain.CustGrade;
|
|
|
@@ -78,6 +82,15 @@ public class TsaCustomerController extends TsaBaseController {
|
|
|
@Autowired
|
|
|
private TscMailService mailService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TscCustomerService coreCustomerService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TscOrderChangeService coreOrderChangeService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TscKcpService coreKcpService;
|
|
|
+
|
|
|
/**
|
|
|
* 1:1문의관리 화면
|
|
|
* @return
|
|
|
@@ -204,6 +217,12 @@ public class TsaCustomerController extends TsaBaseController {
|
|
|
@PostMapping("/onetoone/qna/assign")
|
|
|
@ResponseBody
|
|
|
public GagaResponse assignOneToOneQna(@RequestBody Counsel counsel) {
|
|
|
+ // 삭제여부 체크
|
|
|
+ String delYn = counselService.getOneToOneQnaDelYn(counsel.getCounselSq());
|
|
|
+ if ("Y".equals(delYn)) {
|
|
|
+ throw new IllegalStateException("이미 삭제된 건입니다. 다시 확인해 주세요.");
|
|
|
+ }
|
|
|
+
|
|
|
counselService.updateOneToOneQnaCounselor(counsel);
|
|
|
return super.ok(message.getMessage("SUCC_0004"));
|
|
|
}
|
|
|
@@ -218,10 +237,19 @@ public class TsaCustomerController extends TsaBaseController {
|
|
|
@PostMapping("/qna/answer/temp/save")
|
|
|
@ResponseBody
|
|
|
public GagaResponse saveQnaAnswerTemp(@RequestBody Counsel counsel) {
|
|
|
+ // 삭제여부 체크
|
|
|
+ String delYn = counselService.getOneToOneQnaDelYn(counsel.getCounselSq());
|
|
|
+ if ("Y".equals(delYn)) {
|
|
|
+ throw new IllegalStateException("이미 삭제된 건입니다. 다시 확인해 주세요.");
|
|
|
+ }
|
|
|
+
|
|
|
counsel.setAnsNo(TsaSession.getInfo().getUserNo());
|
|
|
counsel.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
|
|
|
- counselService.updateQnaAnswerTemp(counsel);
|
|
|
+ int result = counselService.updateQnaAnswerTemp(counsel);
|
|
|
+ if (result == 0) {
|
|
|
+ throw new IllegalStateException("이미 답변저장 처리를 하셨습니다. 다시 확인해 주세요.");
|
|
|
+ }
|
|
|
|
|
|
return super.ok(message.getMessage("SUCC_0001"));
|
|
|
}
|
|
|
@@ -236,10 +264,19 @@ public class TsaCustomerController extends TsaBaseController {
|
|
|
@PostMapping("/qna/answer/save")
|
|
|
@ResponseBody
|
|
|
public GagaResponse saveQnaAnswer(@RequestBody Counsel counsel) {
|
|
|
+ // 삭제여부 체크
|
|
|
+ String delYn = counselService.getOneToOneQnaDelYn(counsel.getCounselSq());
|
|
|
+ if ("Y".equals(delYn)) {
|
|
|
+ throw new IllegalStateException("이미 삭제된 건입니다. 다시 확인해 주세요.");
|
|
|
+ }
|
|
|
+
|
|
|
counsel.setAnsNo(TsaSession.getInfo().getUserNo());
|
|
|
counsel.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
|
|
|
- counselService.updateQnaAnswer(counsel);
|
|
|
+ int result = counselService.updateQnaAnswer(counsel);
|
|
|
+ if (result == 0) {
|
|
|
+ throw new IllegalStateException("이미 답변저장 처리를 하셨습니다. 다시 확인해 주세요.");
|
|
|
+ }
|
|
|
|
|
|
// 고객이 알림톡답변수신을 요청했을 때
|
|
|
if (counsel.getSmsReqYn().equals("Y")) {
|
|
|
@@ -260,6 +297,7 @@ public class TsaCustomerController extends TsaBaseController {
|
|
|
// Do nothing
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
return super.ok(message.getMessage("SUCC_0001"));
|
|
|
}
|
|
|
|
|
|
@@ -521,6 +559,9 @@ public class TsaCustomerController extends TsaBaseController {
|
|
|
// 상품권유형
|
|
|
mav.addObject("giftCardOccurGbList", rendererService.getCommonCodeList("G074"));
|
|
|
|
|
|
+ // 은행
|
|
|
+ mav.addObject("bankList", rendererService.getCommonCodeList("G940"));
|
|
|
+
|
|
|
mav.addObject("custNo", custNo);
|
|
|
|
|
|
mav.setViewName("customer/CustomerDetailForm");
|
|
|
@@ -910,13 +951,13 @@ public class TsaCustomerController extends TsaBaseController {
|
|
|
customerSearch.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
customerSearch.setPageable(new TscPageRequest(customerSearch.getPageNo() - 1, customerSearch.getPageSize()));
|
|
|
customerSearch.getPageable().setTotalCount(customerService.getCustomerOrderListCount(customerSearch));
|
|
|
-
|
|
|
+
|
|
|
result.set("pageing", customerSearch);
|
|
|
-
|
|
|
+
|
|
|
Collection<Order> customerOrderList = customerService.getCustomerOrderList(customerSearch);
|
|
|
-
|
|
|
+
|
|
|
result.set("custOrderList", customerOrderList);
|
|
|
-
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@@ -1328,4 +1369,103 @@ public class TsaCustomerController extends TsaBaseController {
|
|
|
return mav;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 계좌정보 조회
|
|
|
+ * @return custNo - 고객번호
|
|
|
+ * @author gagamel
|
|
|
+ * @since 2021. 11. 22
|
|
|
+ */
|
|
|
+ @GetMapping("/account/info/{custNo}")
|
|
|
+ @ResponseBody
|
|
|
+ public CustAccount getCustomerAccuontInfo(@PathVariable Integer custNo) {
|
|
|
+ return coreCustomerService.getCustomerAccuontInfo(custNo);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 계좌정보 삭제
|
|
|
+ * @return custNo - 고객번호
|
|
|
+ * @author gagamel
|
|
|
+ * @since 2021. 11. 22
|
|
|
+ */
|
|
|
+ @PostMapping("/account/delete/{custNo}")
|
|
|
+ @ResponseBody
|
|
|
+ public GagaResponse deleteCustomerAccuont(@PathVariable Integer custNo) {
|
|
|
+ // 환불계좌 삭제
|
|
|
+ coreOrderChangeService.deleteRefundAccount(custNo);
|
|
|
+
|
|
|
+ // 고객이력 생성
|
|
|
+ Customer customer = new Customer();
|
|
|
+ customer.setCustNo(custNo);
|
|
|
+ customer.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
+ coreCustomerService.createCustomerHistory(customer);
|
|
|
+
|
|
|
+ return super.ok(message.getMessage("SUCC_0003"));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 계좌인증
|
|
|
+ * @return GagaMap - 결과
|
|
|
+ * @author gagamel
|
|
|
+ * @since 2021. 11. 22
|
|
|
+ */
|
|
|
+ @PostMapping("/account/check")
|
|
|
+ @ResponseBody
|
|
|
+ public GagaMap getAccountCheck(@RequestBody CustAccount custAccount) {
|
|
|
+ boolean isValid = false;
|
|
|
+ GagaMap result = coreKcpService.checkAccount(custAccount);
|
|
|
+ if ("0000".equals(result.get("resCd"))) {
|
|
|
+ isValid = true;
|
|
|
+ }
|
|
|
+ result.setBoolean("isValid", isValid);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 계좌등록
|
|
|
+ * @return
|
|
|
+ * @author gagamel
|
|
|
+ * @since 2021. 11. 22
|
|
|
+ */
|
|
|
+ @PostMapping("/account/create")
|
|
|
+ @ResponseBody
|
|
|
+ public GagaResponse createAccount(@RequestBody CustAccount custAccount) {
|
|
|
+ // 계좌등록
|
|
|
+ Order refundAccount = new Order();
|
|
|
+ refundAccount.setCustNo(custAccount.getCustNo());
|
|
|
+ refundAccount.setBankCd(custAccount.getBankCd());
|
|
|
+ refundAccount.setAccountNo(custAccount.getAccountNo());
|
|
|
+ refundAccount.setAccountNm(custAccount.getAccountNm());
|
|
|
+ refundAccount.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
+ refundAccount.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
+ refundAccount.encryptData();
|
|
|
+ coreOrderChangeService.saveRefundAccount(refundAccount);
|
|
|
+
|
|
|
+ // 고객이력 생성
|
|
|
+ Customer customer = new Customer();
|
|
|
+ customer.setCustNo(custAccount.getCustNo());
|
|
|
+ customer.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
+ coreCustomerService.createCustomerHistory(customer);
|
|
|
+
|
|
|
+ return super.ok("계좌가 등록되었습니다.");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 휴대전화번호와 CI 삭제
|
|
|
+ * @return GagaMap - 결과
|
|
|
+ * @author gagamel
|
|
|
+ * @since 2021. 11. 22
|
|
|
+ */
|
|
|
+ @PostMapping("/cellphnno/delete")
|
|
|
+ @ResponseBody
|
|
|
+ public GagaResponse deleteCellPhnno(@RequestBody Customer customer) {
|
|
|
+ customer.setUpdNo(TsaSession.getInfo().getUserNo());
|
|
|
+ customerService.deleteCellPhnno(customer);
|
|
|
+
|
|
|
+ // 고객이력 생성
|
|
|
+ customer.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
+ coreCustomerService.createCustomerHistory(customer);
|
|
|
+
|
|
|
+ return super.ok(message.getMessage("SUCC_0003"));
|
|
|
+ }
|
|
|
+
|
|
|
}
|