|
@@ -10,12 +10,18 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
import com.style24.batch.biz.dao.TsbGoodsDao;
|
|
import com.style24.batch.biz.dao.TsbGoodsDao;
|
|
|
import com.style24.batch.support.env.TsbConstants;
|
|
import com.style24.batch.support.env.TsbConstants;
|
|
|
import com.style24.core.biz.service.TscEnvsetService;
|
|
import com.style24.core.biz.service.TscEnvsetService;
|
|
|
|
|
+import com.style24.core.biz.thirdparty.SafetyKoreaApi;
|
|
|
import com.style24.persistence.domain.Coupon;
|
|
import com.style24.persistence.domain.Coupon;
|
|
|
import com.style24.persistence.domain.Goods;
|
|
import com.style24.persistence.domain.Goods;
|
|
|
|
|
+import com.style24.persistence.domain.GoodsSafeNo;
|
|
|
import com.style24.persistence.domain.GoodsSummary;
|
|
import com.style24.persistence.domain.GoodsSummary;
|
|
|
|
|
|
|
|
|
|
+import io.netty.util.internal.StringUtil;
|
|
|
|
|
+
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
|
|
+import com.gagaframework.web.parameter.GagaMap;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 상품 Service
|
|
* 상품 Service
|
|
|
*
|
|
*
|
|
@@ -32,6 +38,10 @@ public class TsbGoodsService {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TscEnvsetService envsetService;
|
|
private TscEnvsetService envsetService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private SafetyKoreaApi safetyKoreaApi;
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 상품 타이틀예약 작업
|
|
* 상품 타이틀예약 작업
|
|
|
*
|
|
*
|
|
@@ -272,4 +282,33 @@ public class TsbGoodsService {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 영유아상품 인증번호 수신
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return
|
|
|
|
|
+ * @author eskim
|
|
|
|
|
+ * @since 2020. 12. 04
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional("shopTxnManager")
|
|
|
|
|
+ public void saveGoodsSafeNo() {
|
|
|
|
|
+
|
|
|
|
|
+ // 1. 대상 상품 조회
|
|
|
|
|
+ Collection<GoodsSafeNo> goodsSafeNoList = goodsDao.getGoodsSafeNoList();
|
|
|
|
|
+ // 2. 인증테이블 적용
|
|
|
|
|
+ for(GoodsSafeNo goodsSafeNo: goodsSafeNoList) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ GagaMap result = safetyKoreaApi.getKoreaCertifyNo(goodsSafeNo.getGoodsNum()); // 품번으로 처리
|
|
|
|
|
+ if (result != null || !StringUtil.isNullOrEmpty(result.get("certNum").toString())) {
|
|
|
|
|
+ goodsSafeNo.setCertDt(result.get("certDt").toString());
|
|
|
|
|
+ goodsSafeNo.setCertNum(result.get("certNum").toString());
|
|
|
|
|
+ goodsSafeNo.setRegNo(TsbConstants.REG_NO);
|
|
|
|
|
+ goodsSafeNo.setUpdNo(TsbConstants.REG_NO);
|
|
|
|
|
+ goodsDao.saveGoodsSafeNo();
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ // do nothing
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|