ソースを参照

샵링커-송장전송

jmh 4 年 前
コミット
13607dafcc

+ 1 - 1
src/main/java/com/style24/core/biz/dao/TscShoplinkerDao.java

@@ -257,7 +257,7 @@ public interface TscShoplinkerDao {
 	 * @author jmh
 	 * @since 2021. 5. 20
 	 */
-	Collection<ShoplinkerInvoice> getShoplinkerInvoiceOrdDtlList(ShoplinkerInvoice shoplinkerInvoice);
+	Collection<ShoplinkerInvoice> getShoplinkerInvoiceOrdDtlList();
 
 	/**
 	 * 재고-단품 등록

+ 15 - 4
src/main/java/com/style24/core/biz/service/TscShoplinkerService.java

@@ -1401,6 +1401,19 @@ public class TscShoplinkerService {
 		return shoplinkerDao.getExtmallOrderInfo(extmallOrder);
 	}
 
+
+	/**
+	 * 송장전송-전송예정목록
+	 *
+	 * @param shoplinkerGoods
+	 * @return
+	 * @author jmh
+	 * @since 2021. 5. 20
+	 */
+	public Collection<ShoplinkerInvoice> getShoplinkerInvoiceOrdDtlList() {
+		return shoplinkerDao.getShoplinkerInvoiceOrdDtlList();
+	}
+
 	/**
 	 * 송장전송-전송
 	 *
@@ -1409,7 +1422,7 @@ public class TscShoplinkerService {
 	 * @author jmh
 	 * @since 2021. 5. 20
 	 */
-	public void createShoplinkerInvoiceXml(ShoplinkerInvoice shoplinkerInvoice) throws IOException {
+	public void createShoplinkerInvoiceXml(ShoplinkerInvoice shoplinkerInvoice, Collection<ShoplinkerInvoice> sendList) throws IOException {
 		// 파일명 뒤에 붙일 시간
 		fileAddNm = GagaDateUtil.getTodayDateTime();
 
@@ -1425,8 +1438,6 @@ public class TscShoplinkerService {
 		StringBuilder sbRequest;
 		com.gagaframework.shoplinker.domain.invoice.ResultMessage resultMsg;
 
-		Collection<ShoplinkerInvoice> sendList = shoplinkerDao.getShoplinkerInvoiceOrdDtlList(shoplinkerInvoice);
-
 		if( null != sendList && !sendList.isEmpty()) {
 			for(ShoplinkerInvoice info : sendList) {
 				apiHstMap = new ShoplinkerGoods();
@@ -1474,7 +1485,7 @@ public class TscShoplinkerService {
 					apiHstMap.setApiMessage(resultMsg.getMessage());
 
 					// 생성 파일삭제
-					GagaFileUtil.deleteFile(GagaFileUtil.getConcatenationPath(shoplinkerInvoice.getXmlPath(), xmlFileName.toString()));
+					// GagaFileUtil.deleteFile(GagaFileUtil.getConcatenationPath(shoplinkerInvoice.getXmlPath(), xmlFileName.toString()));
 
 				} catch (Exception e) {
 					log.error("error", e);

+ 7 - 8
src/main/java/com/style24/persistence/mybatis/shop/TscShoplinker.xml

@@ -739,7 +739,7 @@
 				, SL.API_RESULT
 				, SL.API_MESSAGE
 				, SL.XML_TXT
-				, FN_GET_USER_NM(SL.REG_NO) AS REG_NM
+				, SL.REG_DT
 			FROM
 				TB_ORDER_DETAIL OD
 				LEFT OUTER JOIN SHOPLINKER_SYNC_HST SL ON OD.ORD_DTL_NO = SL.ORD_DTL_NO AND SL.API_TYPE = 'INVOICE'
@@ -753,7 +753,7 @@
 	</select>
 
 	<!-- 송장전송-상세목록 -->
-	<select id="getShoplinkerInvoiceOrdDtlList" parameterType="ShoplinkerInvoice" resultType="ShoplinkerInvoice">
+	<select id="getShoplinkerInvoiceOrdDtlList" resultType="ShoplinkerInvoice">
 		/* TscShoplinkerDao.getShoplinkerInvoiceOrdDtlList */
 		SELECT
 			B.ORD_NO
@@ -778,14 +778,13 @@
 		  	inner join TB_SHIP_COMPANY C on B.SHIP_COMP_CD = C.SHIP_COMP_CD
 
 		WHERE A.MALL_GB = 'G011_20'
-		and VENDOR_ID = 'G003_V001'
+		and B.VENDOR_ID = 'G003_V001'
 	 	and B.INVOICE_NO is not null
 	 	and B.ORD_DTL_STAT = 'G013_50' -- 배송중
-		and DATE_FORMAT(B.DELV_STDT, '%Y-%m-%d' ) between DATE_FORMAT(#{stDate}, '%Y-%m-%d') and DATE_FORMAT(#{edDate}, '%Y-%m-%d')
-		and DATE_SUB(NOW(), INTERVAL 14 DAY) <![CDATA[ < ]]> DELV_STDT
-		and NOT EXISTS(SELECT 1 FROM SHOPLINKER_SYNC_HST s
-			where s.API_TYPE = 'INVOICE' and s.ord_dtl_no = B.ord_dtl_no
-			and api_result = 'true'
+		and B.DELV_STDT IS NOT NULL
+		AND NOT EXISTS(SELECT 1 FROM SHOPLINKER_SYNC_HST S
+			WHERE S.API_TYPE = 'INVOICE' AND S.ORD_DTL_NO = B.ORD_DTL_NO
+			AND API_RESULT = 'true'
 			)
 		ORDER BY ORD_NO, ORD_DTL_NO
 	</select>