TsfCommonService.java 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. package com.style24.front.biz.service;
  2. import org.apache.commons.lang3.StringUtils;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.core.env.Environment;
  5. import org.springframework.stereotype.Service;
  6. import org.springframework.transaction.annotation.Transactional;
  7. import com.style24.core.support.env.TscConstants;
  8. import com.style24.front.biz.dao.TsfCommonDao;
  9. import com.style24.front.support.security.session.TsfSession;
  10. import com.style24.persistence.domain.InflowHst;
  11. import com.style24.persistence.domain.Order;
  12. import lombok.extern.slf4j.Slf4j;
  13. /**
  14. * 공통 Service
  15. *
  16. * @author eskim
  17. * @since 2021. 02. 09
  18. */
  19. @Service
  20. @Slf4j
  21. public class TsfCommonService {
  22. @Autowired
  23. private TsfCommonDao commonDao;
  24. @Autowired
  25. private Environment env;
  26. // /**
  27. // * 사이트명 조회
  28. // *
  29. // * @param siteCd - 사이트코드
  30. // * @return
  31. // * @author gagamel
  32. // * @since 2020. 5. 26
  33. // */
  34. // public String getSiteName(String siteCd) {
  35. // return commonDao.getSiteName(siteCd);
  36. // }
  37. /**
  38. * 유입경로이력(웹제휴채널) 생성
  39. * @param afLinkCd - 제휴링크코드
  40. * @author eskim
  41. * @date 2021. 02. 09
  42. */
  43. @Transactional("shopTxnManager")
  44. public void createInflowHistory(InflowHst inflow) {
  45. inflow.setSiteCd(TscConstants.Site.STYLE24.value());
  46. inflow.setInflowRefer(TsfSession.getHttpServletRequest().getHeader("referer"));
  47. inflow.setIpAddr(TsfSession.getIpAddress());
  48. inflow.setJsessionId(TsfSession.getSessionId());
  49. inflow.setFrontGb(TsfSession.getFrontGb());
  50. inflow.setAppYn("true".equals(TsfSession.getAttribute("isApp")) ? "Y" : "N");
  51. inflow.setOsType(TsfSession.getAttribute("osType"));
  52. if (!StringUtils.isEmpty(inflow.getInflowRefer())) {
  53. byte[] referBytes = inflow.getInflowRefer().getBytes();
  54. if (referBytes.length > 500) {
  55. inflow.setInflowRefer(new String(referBytes, 0, 500));
  56. }
  57. }
  58. if (!StringUtils.isEmpty(inflow.getPageUrl())) {
  59. byte[] referBytes = inflow.getPageUrl().getBytes();
  60. if (referBytes.length > 1000) {
  61. inflow.setPageUrl(new String(referBytes, 0, 1000));
  62. }
  63. }
  64. commonDao.createInflowHistory(inflow);
  65. }
  66. // /**
  67. // * 앱 기기 등록
  68. // *
  69. // * @param
  70. // * @return
  71. // * @author sasa004
  72. // * @since 2020. 08. 10
  73. // */
  74. // public void saveMobileDevice(TsfMobileDevice mobileDevice) {
  75. // commonDao.saveMobileDevice(mobileDevice);
  76. // }
  77. /**
  78. * 주문배송지정보수정
  79. *
  80. * @param
  81. * @return
  82. * @author jsh77b
  83. * @since 2021. 04. 02
  84. */
  85. @Transactional("shopTxnManager")
  86. public int updateDeliverAddr(Order order) {
  87. return commonDao.updateDeliverAddr(order);
  88. }
  89. /**
  90. * 주문배송지정보수정
  91. *
  92. * @param
  93. * @return
  94. * @author jsh77b
  95. * @since 2021. 04. 02
  96. */
  97. @Transactional("shopTxnManager")
  98. public int updateDeliverAddrDelvMemo(Order order) {
  99. return commonDao.updateDeliverAddrDelvMemo(order);
  100. }
  101. }