| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- package com.style24.front.biz.service;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.core.env.Environment;
- import org.springframework.stereotype.Service;
- import org.springframework.transaction.annotation.Transactional;
- import com.style24.core.support.env.TscConstants;
- import com.style24.front.biz.dao.TsfCommonDao;
- import com.style24.front.support.security.session.TsfSession;
- import com.style24.persistence.domain.InflowHst;
- import com.style24.persistence.domain.Order;
- import lombok.extern.slf4j.Slf4j;
- /**
- * 공통 Service
- *
- * @author eskim
- * @since 2021. 02. 09
- */
- @Service
- @Slf4j
- public class TsfCommonService {
- @Autowired
- private TsfCommonDao commonDao;
- @Autowired
- private Environment env;
- // /**
- // * 사이트명 조회
- // *
- // * @param siteCd - 사이트코드
- // * @return
- // * @author gagamel
- // * @since 2020. 5. 26
- // */
- // public String getSiteName(String siteCd) {
- // return commonDao.getSiteName(siteCd);
- // }
- /**
- * 유입경로이력(웹제휴채널) 생성
- * @param afLinkCd - 제휴링크코드
- * @author eskim
- * @date 2021. 02. 09
- */
- @Transactional("shopTxnManager")
- public void createInflowHistory(InflowHst inflow) {
- inflow.setSiteCd(TscConstants.Site.STYLE24.value());
- inflow.setInflowRefer(TsfSession.getHttpServletRequest().getHeader("referer"));
- inflow.setIpAddr(TsfSession.getIpAddress());
- inflow.setJsessionId(TsfSession.getSessionId());
- inflow.setFrontGb(TsfSession.getFrontGb());
- inflow.setAppYn("true".equals(TsfSession.getAttribute("isApp")) ? "Y" : "N");
- inflow.setOsType(TsfSession.getAttribute("osType"));
- if (!StringUtils.isEmpty(inflow.getInflowRefer())) {
- byte[] referBytes = inflow.getInflowRefer().getBytes();
- if (referBytes.length > 500) {
- inflow.setInflowRefer(new String(referBytes, 0, 500));
- }
- }
- if (!StringUtils.isEmpty(inflow.getPageUrl())) {
- byte[] referBytes = inflow.getPageUrl().getBytes();
- if (referBytes.length > 1000) {
- inflow.setPageUrl(new String(referBytes, 0, 1000));
- }
- }
- commonDao.createInflowHistory(inflow);
- }
- // /**
- // * 앱 기기 등록
- // *
- // * @param
- // * @return
- // * @author sasa004
- // * @since 2020. 08. 10
- // */
- // public void saveMobileDevice(TsfMobileDevice mobileDevice) {
- // commonDao.saveMobileDevice(mobileDevice);
- // }
-
- /**
- * 주문배송지정보수정
- *
- * @param
- * @return
- * @author jsh77b
- * @since 2021. 04. 02
- */
- @Transactional("shopTxnManager")
- public int updateDeliverAddr(Order order) {
- return commonDao.updateDeliverAddr(order);
- }
-
- /**
- * 주문배송지정보수정
- *
- * @param
- * @return
- * @author jsh77b
- * @since 2021. 04. 02
- */
- @Transactional("shopTxnManager")
- public int updateDeliverAddrDelvMemo(Order order) {
- return commonDao.updateDeliverAddrDelvMemo(order);
- }
-
-
-
- }
|