|
|
@@ -2,9 +2,7 @@ package com.style24.admin.biz.service;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
import java.net.URLEncoder;
|
|
|
-import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
-import java.util.Calendar;
|
|
|
import java.util.Collection;
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -17,6 +15,7 @@ import com.gagaframework.shoplinker.GagaShoplinkertUtil;
|
|
|
import com.gagaframework.shoplinker.domain.orderlist.Order;
|
|
|
import com.gagaframework.shoplinker.env.GagaShoplinkerConstants;
|
|
|
import com.gagaframework.web.parameter.GagaMap;
|
|
|
+import com.gagaframework.web.util.GagaDateUtil;
|
|
|
import com.gagaframework.web.util.GagaFileUtil;
|
|
|
import com.style24.admin.biz.dao.TsaOcmDao;
|
|
|
import com.style24.admin.biz.dao.TsaShoplinkerDao;
|
|
|
@@ -57,7 +56,7 @@ public class TsaShoplinkerService {
|
|
|
@Autowired
|
|
|
private TsaOcmDao ocmDao;
|
|
|
|
|
|
- private String dateStr; // yymmddhh24mi
|
|
|
+ private String fileAddNm; // 유저번호_년월일시분초
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -112,10 +111,8 @@ public class TsaShoplinkerService {
|
|
|
* @since 2021. 5. 20
|
|
|
*/
|
|
|
public GagaMap createShoplinkerXml(Collection<GagaMap> ecxelGoodsList, ShoplinkerGoods shoplinkerGoods)throws IOException {
|
|
|
- // 파일명 뒤에 붙일 시간
|
|
|
- Calendar cal = Calendar.getInstance();
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss");
|
|
|
- dateStr = sdf.format(cal.getTime());
|
|
|
+ // 파일명 추가 네이밍 규칙
|
|
|
+ fileAddNm = TsaSession.getInfo().getUserNo() +"_"+ GagaDateUtil.getTodayDateTime();
|
|
|
|
|
|
GagaMap rtnMap = new GagaMap();
|
|
|
int optionAll=0, optionSucc=0;
|
|
|
@@ -864,7 +861,7 @@ public class TsaShoplinkerService {
|
|
|
|
|
|
// XML 파일 생성
|
|
|
StringBuilder xmlFileName = new StringBuilder();
|
|
|
- xmlFileName.append(fileNm+"_"+dateStr).append(".xml");
|
|
|
+ xmlFileName.append(fileNm+"_"+fileAddNm).append(".xml");
|
|
|
String xmlPath = GagaFileUtil.getConcatenationPath(map.getXmlPath(), xmlFileName.toString());
|
|
|
shoplinkerUtil.makeRequestXmlFile(sbRequest.toString(), xmlPath);
|
|
|
String xmlUrl = GagaFileUtil.getConcatenationPath(map.getDomainUrl(), xmlFileName.toString());
|
|
|
@@ -981,9 +978,7 @@ public class TsaShoplinkerService {
|
|
|
slkSearch.setRunStat("RUN");
|
|
|
|
|
|
// 파일명 뒤에 붙일 시간
|
|
|
- Calendar cal = Calendar.getInstance();
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss");
|
|
|
- dateStr = sdf.format(cal.getTime());
|
|
|
+ fileAddNm = GagaDateUtil.getTodayDateTime();
|
|
|
|
|
|
int totalPage = 0;
|
|
|
int totalCount = 0;
|
|
|
@@ -1077,7 +1072,7 @@ public class TsaShoplinkerService {
|
|
|
|
|
|
// XML 파일 생성
|
|
|
StringBuilder xmlFileName = new StringBuilder();
|
|
|
- xmlFileName.append("order"+"_"+dateStr).append(".xml");
|
|
|
+ xmlFileName.append("order"+"_"+fileAddNm).append(".xml");
|
|
|
String xmlPath = GagaFileUtil.getConcatenationPath(shoplinkerOrder.getXmlPath(), xmlFileName.toString());
|
|
|
shoplinkerUtil.makeRequestXmlFile(sbRequest.toString(), xmlPath);
|
|
|
String xmlUrl = GagaFileUtil.getConcatenationPath(shoplinkerOrder.getDomainUrl(), xmlFileName.toString());
|
|
|
@@ -1264,14 +1259,16 @@ public class TsaShoplinkerService {
|
|
|
for(ShoplinkerOrder slOrder : slkOrdList) {
|
|
|
|
|
|
extmallOrder = new ExtmallOrder();
|
|
|
- extmallOrder.setAllParams(slOrder);
|
|
|
- extmallOrder.setVendorId(TsaConstants.VendorId.SHOPLINKER.value()); // 샵링커
|
|
|
+ extmallOrder.setVendorId(TsaConstants.VendorId.SHOPLINKER.value()); // 샵링커
|
|
|
extmallOrder.setUploadStat(TsaConstants.ExtmallUploadStat.WAIT.value()); // 대기
|
|
|
+ extmallOrder.setUploadGb("S"); // 업로드구분(샵링커:S, 엑셀:E)
|
|
|
extmallOrder.setRegNo(TsaSession.getInfo().getUserNo());
|
|
|
- extmallOrder.setUploadGb("S"); // 업로드구분(샵링커:S, 엑셀:E)
|
|
|
+ extmallOrder.setBasicParams(slOrder); // 기본세팅파람
|
|
|
|
|
|
try {
|
|
|
|
|
|
+ extmallOrder.setDetailParams(slOrder); // 상세파람
|
|
|
+
|
|
|
if( null != slOrder.getDisPriceCoupon() && !slOrder.getDisPriceCoupon().isEmpty()) {
|
|
|
extmallOrder.setCpnDcAmt(Integer.parseInt(slOrder.getDisPriceCoupon()));
|
|
|
}else {
|
|
|
@@ -1366,9 +1363,7 @@ public class TsaShoplinkerService {
|
|
|
*/
|
|
|
public void createShoplinkerInvoiceXml(ShoplinkerInvoice shoplinkerInvoice) throws IOException {
|
|
|
// 파일명 뒤에 붙일 시간
|
|
|
- Calendar cal = Calendar.getInstance();
|
|
|
- SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss");
|
|
|
- dateStr = sdf.format(cal.getTime());
|
|
|
+ fileAddNm = GagaDateUtil.getTodayDateTime();
|
|
|
|
|
|
ShoplinkerGoods apiHstMap = new ShoplinkerGoods();
|
|
|
|
|
|
@@ -1409,7 +1404,7 @@ public class TsaShoplinkerService {
|
|
|
|
|
|
// XML 파일 생성
|
|
|
StringBuilder xmlFileName = new StringBuilder();
|
|
|
- xmlFileName.append("invoice_"+info.getOrdDtlNo()+"_"+dateStr).append(".xml");
|
|
|
+ xmlFileName.append("invoice_"+info.getOrdDtlNo()+"_"+fileAddNm).append(".xml");
|
|
|
String xmlPath = GagaFileUtil.getConcatenationPath(shoplinkerInvoice.getXmlPath(), xmlFileName.toString());
|
|
|
shoplinkerUtil.makeRequestXmlFile(sbRequest.toString(), xmlPath);
|
|
|
String xmlUrl = GagaFileUtil.getConcatenationPath(shoplinkerInvoice.getDomainUrl(), xmlFileName.toString());
|
|
|
@@ -1461,7 +1456,7 @@ public class TsaShoplinkerService {
|
|
|
// 파일명 뒤에 붙일 시간
|
|
|
Calendar cal = Calendar.getInstance();
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmmss");
|
|
|
- dateStr = sdf.format(cal.getTime());
|
|
|
+ fileAddNm = sdf.format(cal.getTime());
|
|
|
|
|
|
ShoplinkerGoods apiHstMap = new ShoplinkerGoods();
|
|
|
|
|
|
@@ -1505,7 +1500,7 @@ public class TsaShoplinkerService {
|
|
|
|
|
|
// XML 파일 생성
|
|
|
StringBuilder xmlFileName = new StringBuilder();
|
|
|
- xmlFileName.append("invoice_"+info.getOrdDtlNo()+"_"+dateStr).append(".xml");
|
|
|
+ xmlFileName.append("invoice_"+info.getOrdDtlNo()+"_"+fileAddNm).append(".xml");
|
|
|
String xmlPath = GagaFileUtil.getConcatenationPath(shoplinkerInvoice.getXmlPath(), xmlFileName.toString());
|
|
|
shoplinkerUtil.makeRequestXmlFile(sbRequest.toString(), xmlPath);
|
|
|
String xmlUrl = GagaFileUtil.getConcatenationPath(shoplinkerInvoice.getDomainUrl(), xmlFileName.toString());
|
|
|
@@ -1680,8 +1675,8 @@ public class TsaShoplinkerService {
|
|
|
+ "</header>\r\n"
|
|
|
|
|
|
+ "<order>\r\n"
|
|
|
- + "<shoplinker_order_id>1234</shoplinker_order_id>\r\n"
|
|
|
- + "<mall_order_id><![CDATA[1234]]></mall_order_id>\r\n"
|
|
|
+ + "<shoplinker_order_id>1234-6</shoplinker_order_id>\r\n"
|
|
|
+ + "<mall_order_id><![CDATA[1234-6]]></mall_order_id>\r\n"
|
|
|
+ "<mall_name><![CDATA[(주)현대홈쇼핑]]></mall_name>\r\n"
|
|
|
+ "<baesong_status><![CDATA[송장전송완료]]></baesong_status>\r\n"
|
|
|
+ "<order_name><![CDATA[조민혜]]></order_name>\r\n"
|
|
|
@@ -1705,8 +1700,8 @@ public class TsaShoplinkerService {
|
|
|
+ "<sale_price>47600</sale_price>\r\n"
|
|
|
+ "<supply_price>36176</supply_price>\r\n"
|
|
|
+ "<sku><![CDATA[NA/160]]></sku>\r\n"
|
|
|
- + "<orderdate>20210618132721</orderdate>\r\n"
|
|
|
- + "<order_reg_date>20210618132721</order_reg_date>\r\n"
|
|
|
+ + "<orderdate>20210622132721</orderdate>\r\n"
|
|
|
+ + "<order_reg_date>20210622132721</order_reg_date>\r\n"
|
|
|
+ "<delivery_invoice>339382561300</delivery_invoice>\r\n"
|
|
|
+ "<order_flag>004</order_flag>\r\n"
|
|
|
+ "<seller_id>hs009583</seller_id>\r\n"
|