Просмотр исходного кода

1:1문의, 상품문의 수정

gagamel 5 лет назад
Родитель
Сommit
733da0f8e2

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

@@ -49,11 +49,11 @@ public class TsaCustomerController extends TsaBaseController {
 	private TscAnswerPhaseService ansPhaseService;
 
 	/**
-	* 1:1문의관리 화면
-	* @return
-	* @author gagamel
-	* @since 2020. 12. 24
-	*/
+	 * 1:1문의관리 화면
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 24
+	 */
 	@GetMapping("/onetoone/qna/form")
 	public ModelAndView oneToOneQnaForm() {
 		ModelAndView mav = new ModelAndView();
@@ -156,11 +156,11 @@ public class TsaCustomerController extends TsaBaseController {
 	}
 
 	/**
-	* 상품문의관리 화면
-	* @return
-	* @author gagamel
-	* @since 2020. 12. 24
-	*/
+	 * 상품문의관리 화면
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 24
+	 */
 	@GetMapping("/goods/qna/form")
 	public ModelAndView goodsQnaForm() {
 		ModelAndView mav = new ModelAndView();

+ 1 - 1
style24.admin/src/main/java/com/style24/persistence/domain/Counsel.java

@@ -8,7 +8,7 @@ import lombok.Data;
  * 상담(1:1문의) Domain
  *
  * @author gagamel
- * @since 2020. 11. 3
+ * @since 2020. 12. 24
  */
 @SuppressWarnings("serial")
 @Data

+ 132 - 0
style24.front/src/main/java/com/style24/front/biz/dao/TsfCounselDao.java

@@ -0,0 +1,132 @@
+package com.style24.front.biz.dao;
+
+import java.util.Collection;
+
+import com.style24.core.support.annotation.ShopDs;
+import com.style24.persistence.domain.Counsel;
+
+/**
+ * 상담(1:1문의) Dao
+ * 
+ * @author gagamel
+ * @since 2020. 12. 28
+ */
+@ShopDs
+public interface TsfCounselDao {
+
+	/**
+	 * 1:1문의 생성
+	 * @param counsel - 상담정보
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	void createOneToOneQna(Counsel counsel);
+
+	/**
+	 * 1:1문의(총,답변완료,처리중) 건수
+	 * @param counsel - 상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	Counsel getOneToOneQnaCountInfo(Counsel counsel);
+
+	/**
+	 * 1:1문의 총건수
+	 * @param counsel - 상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	int getOneToOneQnaTotalCount(Counsel counsel);
+
+	/**
+	 * 1:1문의 목록
+	 * @param counsel -상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	Collection<Counsel> getOneToOneQnaList(Counsel counsel);
+
+	/**
+	 * 1:1문의 삭제
+	 * @param counsel - 상담정보
+	 * @return 처리건수
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	int deleteOneToOneQna(Counsel counsel);
+
+	/**
+	 * 1:1문의 상세
+	 * @param counsel - 상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 24
+	 */
+	Counsel getOneToOneQna(Counsel counsel);
+
+	/**
+	 * 1:1문의 수정
+	 * @param counsel - 상담정보
+	 * @return 처리건수
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	int updateOneToOneQna(Counsel counsel);
+
+	/**
+	 * 1:1문의 이미지 삭제
+	 * @param counsel - 상담정보
+	 * @return 처리건수
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	int deleteOneToOneQnaImage(Counsel counsel);
+
+	/**
+	 * 상품문의 생성
+	 * @param counsel - 상담정보
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	void createGoodsQna(Counsel counsel);
+
+	/**
+	 * 상품문의(총,답변완료,처리중) 건수
+	 * @param counsel - 상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	Counsel getGoodsQnaCountInfo(Counsel counsel);
+
+	/**
+	 * 상품문의 총건수
+	 * @param counsel - 상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	int getGoodsQnaTotalCount(Counsel counsel);
+
+	/**
+	 * 상품문의 목록
+	 * @param counsel -상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	Collection<Counsel> getGoodsQnaList(Counsel counsel);
+
+	/**
+	 * 상품문의 삭제
+	 * @param counsel - 상담정보
+	 * @return 처리건수
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	int deleteGoodsQna(Counsel counsel);
+
+}

+ 212 - 0
style24.front/src/main/java/com/style24/front/biz/service/TsfCounselService.java

@@ -0,0 +1,212 @@
+package com.style24.front.biz.service;
+
+import java.util.Collection;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import com.style24.core.support.env.TscConstants;
+import com.style24.front.biz.dao.TsfCounselDao;
+import com.style24.front.support.security.session.TsfSession;
+import com.style24.persistence.domain.Counsel;
+
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * 상담(1:1문의) Service
+ *
+ * @author gagamel
+ * @since 2020. 12. 28
+ */
+@Service
+@Slf4j
+public class TsfCounselService {
+
+	@Autowired
+	private TsfCounselDao counselDao;
+
+	/**
+	 * 1:1문의 생성
+	 * @param counsel -상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	@Transactional("shopTxnManager")
+	public void createOneToOneQna(Counsel counsel) {
+		counsel.setSiteCd(TscConstants.Site.STYLE24.value());
+		counsel.setCustNo(TsfSession.getInfo().getCustNo());
+		counsel.setEmail(TsfSession.getInfo().getEmail());
+		counsel.setRegNo(TsfSession.getInfo().getCustNo());
+		counsel.setUpdNo(TsfSession.getInfo().getCustNo());
+		counselDao.createOneToOneQna(counsel);
+	}
+
+	/**
+	 * 1:1문의(총,답변완료,처리중) 건수
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	public Counsel getOneToOneQnaCountInfo() {
+		Counsel counsel = new Counsel();
+		counsel.setCustNo(TsfSession.getInfo().getCustNo());
+		counsel.setSiteCd(TscConstants.Site.STYLE24.value());
+		return counselDao.getOneToOneQnaCountInfo(counsel);
+	}
+
+	/**
+	 * 1:1문의 총건수
+	 * @param counsel - 상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	public int getOneToOneQnaTotalCount(Counsel counsel) {
+		return counselDao.getOneToOneQnaTotalCount(counsel);
+	}
+
+	/**
+	 * 1:1문의 목록
+	 * @param counsel -상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	public Collection<Counsel> getOneToOneQnaList(Counsel counsel) {
+		return counselDao.getOneToOneQnaList(counsel);
+	}
+
+	/**
+	 * 1:1문의 삭제
+	 * @param counsel - 상담정보
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	@Transactional("shopTxnManager")
+	public void deleteOneToOneQna(Counsel counsel) {
+		counsel.setCustNo(TsfSession.getInfo().getCustNo());
+		counsel.setUpdNo(TsfSession.getInfo().getCustNo());
+		int result = counselDao.deleteOneToOneQna(counsel);
+		if (result == 0) {
+			throw new IllegalStateException("답변이 완료되어 삭제할 수 없습니다.");
+		}
+	}
+
+	/**
+	 * 1:1문의 상세
+	 * @param counselSq - 상담일련번호
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 24
+	 */
+	public Counsel getOneToOneQna(Integer counselSq) {
+		Counsel counsel = new Counsel();
+		counsel.setCounselSq(counselSq);
+		counsel.setCustNo(TsfSession.getInfo().getCustNo());
+		counsel.setSiteCd(TscConstants.Site.STYLE24.value());
+		return counselDao.getOneToOneQna(counsel);
+	}
+
+	/**
+	 * 1:1문의 수정
+	 * @param counsel - 상담정보
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	@Transactional("shopTxnManager")
+	public void updateOneToOneQna(Counsel counsel) {
+		counsel.setCustNo(TsfSession.getInfo().getCustNo());
+		counsel.setUpdNo(TsfSession.getInfo().getCustNo());
+		int result = counselDao.updateOneToOneQna(counsel);
+		if (result == 0) {
+			throw new IllegalStateException("답변이 완료되어 수정할 수 없습니다.");
+		}
+	}
+
+	/**
+	 * 1:1문의 이미지 삭제
+	 * @param counsel - 상담정보
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	@Transactional("shopTxnManager")
+	public void deleteOneToOneQnaImage(Counsel counsel) {
+		counsel.setCustNo(TsfSession.getInfo().getCustNo());
+		counsel.setUpdNo(TsfSession.getInfo().getCustNo());
+		int result = counselDao.deleteOneToOneQnaImage(counsel);
+		if (result == 0) {
+			throw new IllegalStateException("답변이 완료되어 삭제할 수 없습니다.");
+		}
+	}
+
+	/**
+	 * 상품문의 생성
+	 * @param counsel -상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	@Transactional("shopTxnManager")
+	public void createGoodsQna(Counsel counsel) {
+		counsel.setSiteCd(TscConstants.Site.STYLE24.value());
+		counsel.setCustNo(TsfSession.getInfo().getCustNo());
+		counsel.setEmail(TsfSession.getInfo().getEmail());
+		counsel.setRegNo(TsfSession.getInfo().getCustNo());
+		counsel.setUpdNo(TsfSession.getInfo().getCustNo());
+		counselDao.createGoodsQna(counsel);
+	}
+
+	/**
+	 * 상품문의(총,답변완료,처리중) 건수
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	public Counsel getGoodsQnaCountInfo() {
+		Counsel counsel = new Counsel();
+		counsel.setCustNo(TsfSession.getInfo().getCustNo());
+		counsel.setSiteCd(TscConstants.Site.STYLE24.value());
+		return counselDao.getGoodsQnaCountInfo(counsel);
+	}
+
+	/**
+	 * 상품문의 총건수
+	 * @param counsel - 상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	public int getGoodsQnaTotalCount(Counsel counsel) {
+		return counselDao.getGoodsQnaTotalCount(counsel);
+	}
+
+	/**
+	 * 상품문의 목록
+	 * @param counsel -상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 24
+	 */
+	public Collection<Counsel> getGoodsQnaList(Counsel counsel) {
+		return counselDao.getGoodsQnaList(counsel);
+	}
+
+	/**
+	 * 상품문의 삭제
+	 * @param counsel - 상담정보
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	@Transactional("shopTxnManager")
+	public void deleteGoodsQna(Counsel counsel) {
+		counsel.setCustNo(TsfSession.getInfo().getCustNo());
+		counsel.setUpdNo(TsfSession.getInfo().getCustNo());
+		int result = counselDao.deleteGoodsQna(counsel);
+		if (result == 0) {
+			throw new IllegalStateException("답변이 완료되어 삭제할 수 없습니다.");
+		}
+	}
+
+}

+ 201 - 0
style24.front/src/main/java/com/style24/front/biz/web/TsfCallcenterController.java

@@ -11,10 +11,14 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 
 import com.style24.core.support.env.TscConstants;
+import com.style24.core.support.message.TscMessageByLocale;
+import com.style24.front.biz.service.TsfCounselService;
 import com.style24.front.biz.service.TsfFaqService;
 import com.style24.front.biz.service.TsfNoticeService;
 import com.style24.front.support.controller.TsfBaseController;
+import com.style24.front.support.security.session.TsfSession;
 import com.style24.persistence.TsfPageRequest;
+import com.style24.persistence.domain.Counsel;
 import com.style24.persistence.domain.Faq;
 import com.style24.persistence.domain.Notice;
 
@@ -34,12 +38,18 @@ import com.gagaframework.web.rest.server.GagaResponse;
 @Slf4j
 public class TsfCallcenterController extends TsfBaseController {
 
+	@Autowired
+	private TscMessageByLocale message;
+
 	@Autowired
 	private TsfFaqService faqService;
 
 	@Autowired
 	private TsfNoticeService noticeService;
 
+	@Autowired
+	private TsfCounselService counselService;
+
 	/**
 	 * FAQ
 	 * @return
@@ -152,4 +162,195 @@ public class TsfCallcenterController extends TsfBaseController {
 		return super.ok();
 	}
 
+	/**
+	 * 1:1문의 화면
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 24
+	 */
+	@GetMapping("/onetoone/qna/form")
+	public ModelAndView oneToOneQnaForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 1:1문의 건수 정보
+		mav.addObject("qnaCountInfo", counselService.getOneToOneQnaCountInfo());
+
+		mav.setViewName("customer/OneToOneQnaForm");
+
+		return mav;
+	}
+
+	/**
+	 * 1:1문의 등록 처리
+	 * @param counsel -상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	@PostMapping("/onetoone/qna/create")
+	@ResponseBody
+	public GagaResponse createOneToOneQna(@RequestBody Counsel counsel) {
+		counselService.createOneToOneQna(counsel);
+		return super.ok(message.getMessage("SUCC_0001"));
+	}
+
+	/**
+	 * 1:1문의 목록
+	 * @param counsel - 상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	@PostMapping("/onetoone/qna/list")
+	@ResponseBody
+	public GagaMap getOneToOneQnaList(@RequestBody Counsel counsel) {
+		counsel.setCustNo(TsfSession.getInfo().getCustNo());
+		counsel.setSiteCd(TscConstants.Site.STYLE24.value());
+
+		GagaMap result = new GagaMap();
+
+		TsfPageRequest pageable = new TsfPageRequest((counsel.getPageNo() > 0 ? counsel.getPageNo() - 1 : 0), counsel.getPageSize(), counsel.getPageUnit());
+		pageable.setTotalCount(counselService.getOneToOneQnaTotalCount(counsel));
+		counsel.setPageable(pageable);
+		log.debug("pageable: {}", pageable);
+
+		result.set("paging", counsel);
+		result.set("dataList", counselService.getOneToOneQnaList(counsel));
+
+		return result;
+	}
+
+	/**
+	 * 1:1문의 삭제 처리
+	 * @param counsel -상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	@PostMapping("/onetoone/qna/delete")
+	@ResponseBody
+	public GagaResponse deleteOneToOneQna(@RequestBody Counsel counsel) {
+		counselService.deleteOneToOneQna(counsel);
+		return super.ok(message.getMessage("SUCC_0003"));
+	}
+
+	/**
+	 * 1:1문의 상세 화면
+	 * @param counselSq - 상담일련번호
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	@GetMapping("/onetoone/qna/detail/form/{counselSq}")
+	public ModelAndView oneToOneQnaDetailForm(@PathVariable Integer counselSq) {
+		ModelAndView mav = new ModelAndView();
+
+		// 1:1문의 상세
+		mav.addObject("qnaDetailInfo", counselService.getOneToOneQna(counselSq));
+
+		mav.setViewName("customer/OneToOneQnaDetailForm");
+
+		return mav;
+	}
+
+	/**
+	 * 1:1문의 수정 처리
+	 * @param counsel -상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	@PostMapping("/onetoone/qna/update")
+	@ResponseBody
+	public GagaResponse updateOneToOneQna(@RequestBody Counsel counsel) {
+		counselService.updateOneToOneQna(counsel);
+		return super.ok(message.getMessage("SUCC_0001"));
+	}
+
+	/**
+	 * 1:1문의 이미지 삭제 처리
+	 * @param counsel -상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	@PostMapping("/onetoone/qna/image/delete")
+	@ResponseBody
+	public GagaResponse deleteOneToOneQnaImage(@RequestBody Counsel counsel) {
+		counselService.deleteOneToOneQnaImage(counsel);
+		return super.ok(message.getMessage("SUCC_0003"));
+	}
+
+	/**
+	 * 상품문의 등록 처리
+	 * @param counsel -상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	@PostMapping("/goods/qna/create")
+	@ResponseBody
+	public GagaResponse createGoodsQna(@RequestBody Counsel counsel) {
+		counselService.createGoodsQna(counsel);
+		return super.ok(message.getMessage("SUCC_0001"));
+	}
+
+	/**
+	 * 상품문의 화면
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	@GetMapping("/goods/qna/form")
+	public ModelAndView goodsQnaForm() {
+		ModelAndView mav = new ModelAndView();
+
+		// 상품문의 건수 정보
+		mav.addObject("qnaCountInfo", counselService.getGoodsQnaCountInfo());
+
+		mav.setViewName("customer/GoodsQnaForm");
+
+		return mav;
+	}
+
+	/**
+	 * 상품문의 목록
+	 * @param counsel - 상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	@PostMapping("/goods/qna/list")
+	@ResponseBody
+	public GagaMap getGoodsQnaList(@RequestBody Counsel counsel) {
+		counsel.setCustNo(TsfSession.getInfo().getCustNo());
+		counsel.setSiteCd(TscConstants.Site.STYLE24.value());
+
+		GagaMap result = new GagaMap();
+
+		TsfPageRequest pageable = new TsfPageRequest((counsel.getPageNo() > 0 ? counsel.getPageNo() - 1 : 0), counsel.getPageSize(), counsel.getPageUnit());
+		pageable.setTotalCount(counselService.getGoodsQnaTotalCount(counsel));
+		counsel.setPageable(pageable);
+		log.debug("pageable: {}", pageable);
+
+		result.set("paging", counsel);
+		result.set("dataList", counselService.getGoodsQnaList(counsel));
+
+		return result;
+	}
+
+	/**
+	 * 상품문의 삭제 처리
+	 * @param counsel -상담정보
+	 * @return
+	 * @author gagamel
+	 * @since 2020. 12. 28
+	 */
+	@PostMapping("/goods/qna/delete")
+	@ResponseBody
+	public GagaResponse deleteGoodsQna(@RequestBody Counsel counsel) {
+		counselService.deleteGoodsQna(counsel);
+		return super.ok(message.getMessage("SUCC_0003"));
+	}
+
 }

+ 1 - 1
style24.front/src/main/java/com/style24/front/biz/web/TsfCustomerController.java

@@ -11,7 +11,7 @@ import lombok.extern.slf4j.Slf4j;
  * 고객 Controller
  * 
  * @author gagamel
- * @since 2020. 9. 11
+ * @since 2020. 12. 28
  */
 @Controller
 @RequestMapping("/customer")

+ 3 - 1
style24.front/src/main/java/com/style24/front/support/config/TsfWebMvcConfig.java

@@ -94,7 +94,9 @@ public class TsfWebMvcConfig implements WebMvcConfigurer {
 
 		// 로그인 체크
 		registry.addInterceptor(loginCheckInterceptor)
-			.addPathPatterns(new String[] {"/mypage/**", "/order/**", "/planning/reply/create", "/planning/vote/create", "/customer/wish/list/put"})
+			.addPathPatterns(new String[] {"/mypage/**", "/order/**",
+				"/callcenter/onetoone/**", "/callcenter/goods/**"
+			})
 			.order(20);
 
 		// 상품뷰 이력 생성

+ 64 - 0
style24.front/src/main/java/com/style24/persistence/domain/Counsel.java

@@ -0,0 +1,64 @@
+package com.style24.persistence.domain;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.style24.persistence.TscBaseDomain;
+import com.style24.persistence.TsfPageRequest;
+
+import lombok.Data;
+
+/**
+ * 상담(1:1문의) Domain
+ *
+ * @author gagamel
+ * @since 2020. 12. 28
+ */
+@SuppressWarnings("serial")
+@Data
+public class Counsel extends TscBaseDomain {
+
+	private Integer counselSq;		// 상담일련번호
+	private String counselType;		// 상담유형(C-1:1문의, G-상품문의)
+	private String siteCd;			// 사이트코드(공통코드G000)
+	private String siteNm;			// 사이트명
+	private String counselClsf;		// 상담분류(공통코드G059)
+	private String counselClsfNm;	// 상담분류명
+	private String counselDclsf;	// 상담분류상세(공통코드G591~G599)
+	private String counselDclsfNm;	// 상담분류상세명
+	private Integer custNo;			// 고객번호
+	private String custId;			// 고객ID
+	private String custNm;			// 고객명
+	private String cellPhnno;		// 휴대전화번호
+	private String smsReqYn;		// SMS(알림톡)요청여부
+	private String smsSendYn;		// SMS(알림톡)발송여부
+	private String email;			// 이메일
+	private String relGoodsCd;		// 관련상품코드(상품문의에서만 사용)
+	private String goodsNm;			// 상품명(상품문의에서만 사용)
+	private String questTitle;		// 문의제목
+	private String questContent;	// 문의내용
+	private String questDt;			// 문의일자
+	private String orgFileNm1;		// 원본파일명1
+	private String sysFileNm1;		// 시스템파일명1
+	private String orgFileNm2;		// 원본파일명2
+	private String sysFileNm2;		// 시스템파일명2
+	private String ansStat;			// 답변상태(공통코드G060)
+	private String ansStatNm;		// 답변상태명
+	private String ansTitle;		// 답변제목
+	private String ansContent;		// 답변내용
+	private String ansDt;			// 답변일자
+	private String secretYn;		// 비밀글여부(상품문의에서만 사용)
+	private String delYn;			// 삭제여부
+
+	// 1:1문의(총, 답변완료, 처리중) 건수
+	private int totCnt;		// 총건수
+	private int ansCnt;		// 답변완료건수
+	private int ingCnt;		// 처리중건수
+
+	// Pagination
+	@JsonInclude(JsonInclude.Include.NON_EMPTY)
+	private TsfPageRequest pageable;
+
+	private int pageNo = 1;
+	private int pageSize = 10;
+	private int pageUnit = 10;
+
+}

+ 311 - 0
style24.front/src/main/java/com/style24/persistence/mybatis/TsfCounsel.xml

@@ -0,0 +1,311 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.style24.front.biz.dao.TsfCounselDao">
+
+	<!-- Paging -->
+	<sql id="pageSql">
+		LIMIT #{pageable.startRow}, #{pageable.pageSize}
+	</sql>
+	<!--// Paging -->
+	
+	<!-- 1:1문의 생성 -->
+	<insert id="createOneToOneQna" parameterType="Counsel">
+		/* TsfCounsel.createOneToOneQna */
+		INSERT INTO TB_COUNSEL (
+		       COUNSEL_SQ
+		     , SITE_CD
+		     , COUNSEL_CLSF
+		     , COUNSEL_DCLSF
+		     , CUST_NO
+		     , CELL_PHNNO
+		     , SMS_REQ_YN
+		     , SMS_SEND_YN
+		     , EMAIL
+		     , EMAIL_REQ_YN
+		     , EMAIL_SEND_YN
+		     , COUNSEL_TYPE
+		     , QUEST_TITLE
+		     , QUEST_CONTENT
+		     , QUEST_DT
+		     , ORG_FILE_NM1
+		     , SYS_FILE_NM1
+		     , ORG_FILE_NM2
+		     , SYS_FILE_NM2
+		     , ANS_STAT
+		     , DEL_YN
+		     , REG_NO
+		     , REG_DT
+		     , UPD_NO
+		     , UPD_DT
+		)
+		VALUES (
+		       NULL
+		     , #{siteCd}
+		     , #{counselClsf}
+		     , #{counselDclsf}
+		     , #{custNo}
+		     , #{cellPhnno}
+		     , #{smsReqYn} /*SMS(알림톡)답변수신여부*/
+		     , 'N'
+		     , #{email}
+		     , 'N'
+		     , 'N'
+		     , 'C' /*상담유형(1:1문의)*/
+		     , #{questTitle}
+		     , #{questContent}
+		     , NOW()
+		     , #{orgFileNm1}
+		     , #{sysFileNm1}
+		     , #{orgFileNm2}
+		     , #{sysFileNm2}
+		     , 'G060_10' /*답변상태:처리중*/
+		     , 'N'
+		     , #{regNo}
+		     , NOW()
+		     , #{updNo}
+		     , NOW()
+		)
+	</insert>
+	
+	<!-- 1:1문의(총,답변완료,처리중) 건수 -->
+	<select id="getOneToOneQnaCountInfo" parameterType="Counsel" resultType="Counsel">
+		/* TsfCounsel.getOneToOneQnaCountInfo */
+		SELECT COUNT(*)                                              AS TOT_CNT /*총건수*/
+		     , SUM(CASE WHEN ANS_STAT = 'G060_20' THEN 1 ELSE 0 END) AS ANS_CNT /*답변완료건수*/
+		     , SUM(CASE WHEN ANS_STAT = 'G060_10' THEN 1 ELSE 0 END) AS ING_CNT /*처리중건수*/
+		FROM   TB_COUNSEL
+		WHERE  CUST_NO = #{custNo}
+		AND    SITE_CD = #{siteCd}
+		AND    COUNSEL_TYPE = 'C' /*상담유형(1:1문의)*/
+		AND    DEL_YN = 'N' /*삭제안된넘*/
+	</select>
+	
+	<!-- 1:1문의 총건수 -->
+	<select id="getOneToOneQnaTotalCount" parameterType="Counsel" resultType="int">
+		/* TsfCounsel.getOneToOneQnaTotalCount */
+		SELECT COUNT(*) AS CNT
+		FROM   TB_COUNSEL
+		WHERE  CUST_NO = #{custNo}
+		AND    SITE_CD = #{siteCd}
+		AND    COUNSEL_TYPE = 'C' /*상담유형(1:1문의)*/
+		AND    DEL_YN = 'N' /*삭제안된넘*/
+	</select>
+	
+	<!-- 1:1문의 목록 -->
+	<select id="getOneToOneQnaList" parameterType="Counsel" resultType="Counsel">
+		/* TsfCounsel.getOneToOneQnaList */
+		SELECT COUNSEL_SQ                                                     /*상담일련번호*/
+		     , SITE_CD                                                        /*사이트코드*/
+		     , FN_GET_CODE_NM('G059',COUNSEL_CLSF)        AS COUNSEL_CLSF_NM  /*상담분류명*/
+		     , FN_GET_CODE_NM(COUNSEL_CLSF,COUNSEL_DCLSF) AS COUNSEL_DCLSF_NM /*상담상세분류명*/
+		     , COUNSEL_DCLSF                                                  /*상담상세분류*/
+		     , DATE_FORMAT(QUEST_DT,'%Y.%m.%d')           AS QUEST_DT         /*문의일자*/
+		     , QUEST_TITLE                                                    /*문의제목*/
+		     , QUEST_CONTENT                                                  /*질문내용*/
+		     , ORG_FILE_NM1                                                   /*원본파일명1*/
+		     , SYS_FILE_NM1                                                   /*시스템파일명1*/
+		     , ORG_FILE_NM2                                                   /*원본파일명2*/
+		     , SYS_FILE_NM2                                                   /*시스템파일명2*/
+		     , ANS_TITLE                                                      /*답변제목*/
+		     , ANS_CONTENT                                                    /*답변내용*/
+		     , ANS_STAT                                                       /*답변상태코드*/
+		     , FN_GET_CODE_NM('G060',ANS_STAT)            AS ANS_STAT_NM      /*답변상태명*/
+		     , DATE_FORMAT(ANS_DT,'%Y.%m.%d')             AS ANS_DT           /*답변일자*/
+		FROM   TB_COUNSEL
+		WHERE  CUST_NO = #{custNo}
+		AND    SITE_CD = #{siteCd}
+		AND    COUNSEL_TYPE = 'C' /*상담유형(1:1문의)*/
+		AND    DEL_YN = 'N' /*삭제안된넘*/
+		ORDER  BY QUEST_DT DESC
+		<include refid="pageSql"></include>
+	</select>
+	
+	<!-- 1:1문의 삭제 -->
+	<update id="deleteOneToOneQna" parameterType="Counsel">
+		/* TsfCounsel.deleteOneToOneQna */
+		UPDATE TB_COUNSEL
+		SET    DEL_YN = 'Y'
+		     , UPD_NO = #{updNo}
+		     , UPD_DT = NOW()
+		WHERE  COUNSEL_SQ = #{counselSq}
+		AND    CUST_NO = #{custNo}
+		AND    ANS_STAT = 'G060_10' /*답변상태:처리중*/
+	</update>
+
+	<!-- 1:1문의 상세 -->
+	<select id="getOneToOneQna" parameterType="Counsel" resultType="Counsel">
+		/* TsfCounsel.getOneToOneQna */
+		SELECT COUNSEL_SQ    /*상담일련번호*/
+		     , SITE_CD       /*사이트코드*/
+		     , COUNSEL_CLSF  /*상담분류*/
+		     , COUNSEL_DCLSF /*상담상세분류*/
+		     , QUEST_TITLE   /*문의제목*/
+		     , QUEST_CONTENT /*질문내용*/
+		     , ORG_FILE_NM1  /*원본파일명1*/
+		     , SYS_FILE_NM1  /*시스템파일명1*/
+		     , ORG_FILE_NM2  /*원본파일명2*/
+		     , SYS_FILE_NM2  /*시스템파일명2*/
+		     , CELL_PHNNO    /*휴대전화번호*/
+		     , SMS_REQ_YN    /*SMS(알림톡)답변수신여부*/
+		     , ANS_STAT      /*답변상태코드*/
+		FROM   TB_COUNSEL
+		WHERE  COUNSEL_SQ = #{counselSq}
+		AND    CUST_NO = #{custNo}
+		AND    SITE_CD = #{siteCd}
+		AND    COUNSEL_TYPE = 'C' /*상담유형(1:1문의)*/
+		AND    DEL_YN = 'N' /*삭제안된넘*/
+	</select>
+	
+	<!-- 1:1문의 수정 -->
+	<insert id="updateOneToOneQna" parameterType="Counsel">
+		/* TsfCounsel.updateOneToOneQna */
+		UPDATE TB_COUNSEL
+		SET    COUNSEL_CLSF = #{counselClsf}
+		     , COUNSEL_DCLSF = #{counselDclsf}
+		     , CELL_PHNNO = #{cellPhnno}
+		     , SMS_REQ_YN = #{smsReqYn}
+		     , QUEST_TITLE = #{questTitle}
+		     , QUEST_CONTENT = #{questContent}
+		     , ORG_FILE_NM1 = #{orgFileNm1}
+		     , SYS_FILE_NM1 = #{sysFileNm1}
+		     , ORG_FILE_NM2 = #{orgFileNm2}
+		     , SYS_FILE_NM2 = #{sysFileNm2}
+		     , UPD_NO = #{updNo}
+		     , UPD_DT = NOW()
+		WHERE  COUNSEL_SQ = #{counselSq}
+		AND    CUST_NO = #{custNo}
+		AND    ANS_STAT = 'G060_10' /*답변상태:처리중*/
+	</insert>
+	
+	<!-- 1:1문의 이미지 삭제 -->
+	<update id="deleteOneToOneQnaImage" parameterType="Counsel">
+		/* TsfCounsel.deleteOneToOneQnaImage */
+		UPDATE TB_COUNSEL
+		SET    ORG_FILE_NM1 = #{orgFileNm1}
+		     , SYS_FILE_NM1 = #{sysFileNm1}
+		     , ORG_FILE_NM2 = #{orgFileNm2}
+		     , SYS_FILE_NM2 = #{sysFileNm2}
+		     , UPD_NO = #{updNo}
+		     , UPD_DT = NOW()
+		WHERE  COUNSEL_SQ = #{counselSq}
+		AND    CUST_NO = #{custNo}
+		AND    ANS_STAT = 'G060_10' /*답변상태:처리중*/
+	</update>
+	
+	<!-- 상품문의 생성 -->
+	<insert id="createGoodsQna" parameterType="Counsel">
+		/* TsfCounsel.createGoodsQna */
+		INSERT INTO TB_COUNSEL (
+		       COUNSEL_SQ
+		     , SITE_CD
+		     , COUNSEL_CLSF
+		     , CUST_NO
+		     , CELL_PHNNO
+		     , SMS_REQ_YN
+		     , SMS_SEND_YN
+		     , EMAIL
+		     , EMAIL_REQ_YN
+		     , EMAIL_SEND_YN
+		     , REL_GOODS_CD
+		     , COUNSEL_TYPE
+		     , QUEST_TITLE
+		     , QUEST_CONTENT
+		     , QUEST_DT
+		     , SECRET_YN
+		     , ANS_STAT
+		     , DEL_YN
+		     , REG_NO
+		     , REG_DT
+		     , UPD_NO
+		     , UPD_DT
+		)
+		VALUES (
+		       NULL
+		     , #{siteCd}
+		     , 'G596' /*문의종류:상품문의*/
+		     , #{custNo}
+		     , #{cellPhnno}
+		     , #{smsReqYn} /*SMS(알림톡)답변수신여부*/
+		     , 'N'
+		     , #{email}
+		     , 'N'
+		     , 'N'
+		     , #{relGoodsCd}
+		     , 'G' /*상담유형(상품문의)*/
+		     , CONCAT('[',#{relGoodsCd},'] 상품문의')
+		     , #{questContent}
+		     , NOW()
+		     , #{secretYn}
+		     , 'G060_10' /*답변상태:처리중*/
+		     , 'N'
+		     , #{regNo}
+		     , NOW()
+		     , #{updNo}
+		     , NOW()
+		)
+	</insert>
+	
+	<!-- 상품문의(총,답변완료,처리중) 건수 -->
+	<select id="getGoodsQnaCountInfo" parameterType="Counsel" resultType="Counsel">
+		/* TsfCounsel.getGoodsQnaCountInfo */
+		SELECT COUNT(*)                                              AS TOT_CNT /*총건수*/
+		     , SUM(CASE WHEN ANS_STAT = 'G060_20' THEN 1 ELSE 0 END) AS ANS_CNT /*답변완료건수*/
+		     , SUM(CASE WHEN ANS_STAT = 'G060_10' THEN 1 ELSE 0 END) AS ING_CNT /*처리중건수*/
+		FROM   TB_COUNSEL
+		WHERE  CUST_NO = #{custNo}
+		AND    SITE_CD = #{siteCd}
+		AND    COUNSEL_TYPE = 'G' /*상담유형(상품문의)*/
+		AND    DEL_YN = 'N' /*삭제안된넘*/
+	</select>
+	
+	<!-- 상품문의 총건수 -->
+	<select id="getGoodsQnaTotalCount" parameterType="Counsel" resultType="int">
+		/* TsfCounsel.getGoodsQnaTotalCount */
+		SELECT COUNT(*) AS CNT
+		FROM   TB_COUNSEL A
+		     , TB_GOODS G
+		WHERE  A.REL_GOODS_CD = G.GOODS_CD
+		AND    A.CUST_NO = #{custNo}
+		AND    A.SITE_CD = #{siteCd}
+		AND    A.COUNSEL_TYPE = 'G' /*상담유형(상품문의)*/
+		AND    A.DEL_YN = 'N' /*삭제안된넘*/
+	</select>
+	
+	<!-- 상품문의 목록 -->
+	<select id="getGoodsQnaList" parameterType="Counsel" resultType="Counsel">
+		/* TsfCounsel.getGoodsQnaList */
+		SELECT A.COUNSEL_SQ                                      /*상담일련번호*/
+		     , A.SITE_CD                                         /*사이트코드*/
+		     , DATE_FORMAT(A.QUEST_DT,'%Y.%m.%d') AS QUEST_DT    /*문의일자*/
+		     , A.SECRET_YN                                       /*비밀글여부*/
+		     , A.CELL_PHNNO                                      /*휴대전화번호*/
+		     , A.SMS_REQ_YN                                      /*SMS(알림톡)답변수신여부*/
+		     , A.REL_GOODS_CD                                    /*관련상품코드*/
+		     , G.GOODS_NM                                        /*상품명*/
+		     , A.ANS_STAT                                        /*답변상태*/
+		     , FN_GET_CODE_NM('G060',ANS_STAT)    AS ANS_STAT_NM /*답변상태명*/
+		     , DATE_FORMAT(A.ANS_DT,'%Y.%m.%d')   AS ANS_DT      /*답변일자*/
+		FROM   TB_COUNSEL A
+		     , TB_GOODS G
+		WHERE  A.REL_GOODS_CD = G.GOODS_CD
+		AND    A.CUST_NO = #{custNo}
+		AND    A.SITE_CD = #{siteCd}
+		AND    A.COUNSEL_TYPE = 'G' /*상담유형(상품문의)*/
+		AND    A.DEL_YN = 'N' /*삭제안된넘*/
+		ORDER  BY A.QUEST_DT DESC
+		<include refid="pageSql"></include>
+	</select>
+	
+	<!-- 상품문의 삭제 -->
+	<update id="deleteGoodsQna" parameterType="Counsel">
+		/* TsfCounsel.deleteGoodsQna */
+		UPDATE TB_COUNSEL
+		SET    DEL_YN = 'Y'
+		     , UPD_NO = #{updNo}
+		     , UPD_DT = NOW()
+		WHERE  COUNSEL_SQ = #{counselSq}
+		AND    CUST_NO = #{custNo}
+		AND    ANS_STAT = 'G060_10' /*답변상태:처리중*/
+	</update>
+
+</mapper>

+ 2 - 2
style24.scm/src/main/java/com/style24/persistence/mybatis/shop/TssCounsel.xml

@@ -4,7 +4,7 @@
 
 	<!-- 상품문의 목록 -->
 	<select id="getGoodsQnaList" parameterType="Counsel" resultType="Counsel">
-		/* TsaCounsel.getGoodsQnaList */
+		/* TssCounsel.getGoodsQnaList */
 		SELECT A.COUNSEL_SQ                                                        /*상담일련번호*/
 		     , A.SITE_CD                                                           /*사이트코드*/
 		     , DATE_FORMAT(A.QUEST_DT,'%Y-%m-%d %H:%i:%S')     AS QUEST_DT         /*문의일시*/
@@ -77,7 +77,7 @@
 	
 	<!-- 상품문의 상세 -->
 	<select id="getGoodsQna" parameterType="Counsel" resultType="Counsel">
-		/* TsaCounsel.getGoodsQna */
+		/* TssCounsel.getGoodsQna */
 		SELECT A.COUNSEL_SQ                                                        /*상담일련번호*/
 		     , FN_GET_CODE_NM('G000',A.SITE_CD)                AS SITE_NM          /*사이트명*/
 		     , A.CUST_NO                                                           /*고객번호*/