|
|
@@ -6,14 +6,17 @@ import java.io.InputStreamReader;
|
|
|
import java.io.OutputStreamWriter;
|
|
|
import java.io.Writer;
|
|
|
import java.net.URL;
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.Collection;
|
|
|
+import java.util.HashSet;
|
|
|
+import java.util.List;
|
|
|
|
|
|
import javax.net.ssl.HttpsURLConnection;
|
|
|
import javax.servlet.http.Cookie;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
-import com.style24.persistence.domain.*;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.core.env.Environment;
|
|
|
@@ -35,6 +38,16 @@ import com.style24.front.biz.dao.TsfGoodsDao;
|
|
|
import com.style24.front.biz.dao.TsfOrderDao;
|
|
|
import com.style24.front.biz.dao.TsfRendererDao;
|
|
|
import com.style24.front.support.security.session.TsfSession;
|
|
|
+import com.style24.persistence.domain.Cart;
|
|
|
+import com.style24.persistence.domain.Coupon;
|
|
|
+import com.style24.persistence.domain.Delivery;
|
|
|
+import com.style24.persistence.domain.GiftCard;
|
|
|
+import com.style24.persistence.domain.Goods;
|
|
|
+import com.style24.persistence.domain.GoodsStock;
|
|
|
+import com.style24.persistence.domain.KakaoPay;
|
|
|
+import com.style24.persistence.domain.NaverPay;
|
|
|
+import com.style24.persistence.domain.Order;
|
|
|
+import com.style24.persistence.domain.Payment;
|
|
|
import com.usafe.guarantee.InsuranceInfo;
|
|
|
import com.usafe.guarantee.InsuranceManager;
|
|
|
|
|
|
@@ -1139,7 +1152,7 @@ public class TsfOrderService {
|
|
|
int totPrice = 0; // 전체 주문 금액
|
|
|
|
|
|
// 네이버페이 송부용 xml 작성
|
|
|
- StringBuffer sb = new StringBuffer();
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
sb.append("<order>\n");
|
|
|
sb.append("\t<merchantId>").append(shopId).append("</merchantId>\n"); //<!-- 상점ID -->
|
|
|
sb.append("\t<certiKey>").append(certificationKey).append("</certiKey>\n"); //<!-- 인증키 -->
|
|
|
@@ -1284,6 +1297,7 @@ public class TsfOrderService {
|
|
|
|
|
|
sb.append("</order>");
|
|
|
|
|
|
+ log.info("CHECK NAVER PAY SB_LENGTH ::::: \n{}", sb.length());
|
|
|
log.info("CHECK NAVER PAY SB ::::: \n{}", sb.toString());
|
|
|
|
|
|
result = sendOrderInfoToNC(sb);
|
|
|
@@ -1319,6 +1333,8 @@ public class TsfOrderService {
|
|
|
sb.append("\t\t\t\t<stockQuantity>").append(stockQty).append("</stockQuantity>\n");
|
|
|
sb.append("\t\t\t\t<status>true</status>\n");
|
|
|
|
|
|
+ log.info("CHECK size / optCd.length / optCd ::::: {} / {} / {}", size, optCd.length, Arrays.toString(optCd));
|
|
|
+
|
|
|
// 옵션 옵션조합정보 색상
|
|
|
for(int i = 0 ; i < size ; i++) {
|
|
|
sb.append("\t\t\t\t<options>\n");
|
|
|
@@ -1338,7 +1354,7 @@ public class TsfOrderService {
|
|
|
* @author xodud1202
|
|
|
* @since 2021. 05. 12
|
|
|
*/
|
|
|
- private GagaMap sendOrderInfoToNC(StringBuffer sb) throws IOException {
|
|
|
+ private GagaMap sendOrderInfoToNC(StringBuilder sb) throws IOException {
|
|
|
GagaMap resultMap = new GagaMap();
|
|
|
|
|
|
// 1.0, 2.0 일때 구분값 처리
|
|
|
@@ -1414,7 +1430,7 @@ public class TsfOrderService {
|
|
|
* @since 2021. 05. 12
|
|
|
*/
|
|
|
public void createNpayGoodsXml50(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
|
|
- StringBuffer sb = new StringBuffer();
|
|
|
+ StringBuilder sb = new StringBuilder();
|
|
|
// http://ldfront.style24.com/pg/create/npay/goodsxml?product%5B0%5D%5Bid%5D=A83F-DP568S&product%5B0%5D%5BoptionManageCodes%5D=14019445-2&supplementSearch=true&optionSearch=true
|
|
|
// product%5B0%5D%5Bid%5D=A83F-DP568S&product%5B0%5D%5BoptionManageCodes%5D=14019445-2&supplementSearch=true&optionSearch=true
|
|
|
// 이스케이프코드 : %5B = [ , %5D = ]
|
|
|
@@ -1550,7 +1566,7 @@ public class TsfOrderService {
|
|
|
String[] colorNms = comps.getColorNm().split(",");
|
|
|
combCnt *= optCds.length;
|
|
|
|
|
|
- for(int j = 0 ; j < optCds.length ; i++) {
|
|
|
+ for(int j = 0 ; j < optCds.length ; j++) {
|
|
|
if(comps.getGoodsNm().length() > 24) {comps.setGoodsNm(comps.getGoodsNm().substring(0, 21) + "..");}
|
|
|
if(optCd2s[j].length() > 12) {optCd2s[j] = optCd2s[j].substring(0, 9) + "..";}
|
|
|
if(colorNms[j].length() > 12) {colorNms[j] = colorNms[j].substring(0, 9) + "..";}
|
|
|
@@ -1578,8 +1594,9 @@ public class TsfOrderService {
|
|
|
StringBuilder manageCode = new StringBuilder(goods1optCds[g1]); // 옵션코드 조합
|
|
|
int addPrice = Integer.parseInt(goods1addPrices[g1]); // 추가금액 합계
|
|
|
int stockQty = Integer.parseInt(goods1stockQty[g1]); // 상품 주문 최소 재고(구성상품 최소)
|
|
|
-
|
|
|
- if(compsInfoList.size() == 2) { // 조합 상품 최대치 계산 (세트상품은 최대 5개까지 등록 가능)
|
|
|
+ log.info("MAKE new StringBuilder(goods1optCds[g1]) :::: {}", goods1optCds[g1]);
|
|
|
+ log.info("MAKE MANAGECODE :::: {}", manageCode);
|
|
|
+ if(compsInfoList.size() > 1) { // 조합 상품 최대치 계산 (세트상품은 최대 5개까지 등록 가능)
|
|
|
for (Goods comps2 : compsInfoList) {
|
|
|
if(comps2.getRnum() == 2) {
|
|
|
// 구성상품별 옵션 정보
|
|
|
@@ -1588,7 +1605,7 @@ public class TsfOrderService {
|
|
|
String[] goods2stockQty = comps2.getItemStockQty().split(",");
|
|
|
|
|
|
// 기존 정보 저장 (다시 돌아올 경우 이전 번호까지의 정보로 리셋하기 위함)
|
|
|
- String manageCodeSave2 = goods1optCds[g1];
|
|
|
+ String manageCodeSave2 = manageCode.toString();
|
|
|
int addPriceSave2 = Integer.parseInt(goods1addPrices[g1]);
|
|
|
int stockQtySave2 = Integer.parseInt(goods1stockQty[g1]);
|
|
|
|
|
|
@@ -1597,8 +1614,10 @@ public class TsfOrderService {
|
|
|
manageCode.append("/").append(goods2optCds[g2]);
|
|
|
addPrice = addPriceSave2 + Integer.parseInt(goods2addPrices[g2]);
|
|
|
if(stockQtySave2 < Integer.parseInt(goods2stockQty[g2])) stockQty = Integer.parseInt(goods2stockQty[g2]);
|
|
|
+ log.info("MAKE new StringBuilder(manageCodeSave2); :::: {}", manageCodeSave2);
|
|
|
+ log.info("MAKE MANAGECODE :::: {}", manageCode);
|
|
|
|
|
|
- if(compsInfoList.size() == 3) { // 조합 상품 최대치 계산 (세트상품은 최대 5개까지 등록 가능)
|
|
|
+ if(compsInfoList.size() > 2) { // 조합 상품 최대치 계산 (세트상품은 최대 5개까지 등록 가능)
|
|
|
for (Goods comps3 : compsInfoList) {
|
|
|
if (comps3.getRnum() == 3) {
|
|
|
// 구성상품별 옵션 정보
|
|
|
@@ -1607,7 +1626,7 @@ public class TsfOrderService {
|
|
|
String[] goods3stockQty = comps3.getItemStockQty().split(",");
|
|
|
|
|
|
// 기존 정보 저장 (다시 돌아올 경우 이전 번호까지의 정보로 리셋하기 위함)
|
|
|
- String manageCodeSave3 = manageCodeSave2;
|
|
|
+ String manageCodeSave3 = manageCode.toString();
|
|
|
int addPriceSave3 = addPriceSave2;
|
|
|
int stockQtySave3 = stockQtySave2;
|
|
|
|
|
|
@@ -1616,8 +1635,10 @@ public class TsfOrderService {
|
|
|
manageCode.append("/").append(goods3optCds[g3]);
|
|
|
addPrice = addPriceSave3 + Integer.parseInt(goods3addPrices[g3]);
|
|
|
if(stockQtySave3 < Integer.parseInt(goods3stockQty[g3])) stockQty = Integer.parseInt(goods3stockQty[g3]);
|
|
|
+ log.info("MAKE new StringBuilder(manageCodeSave3); :::: {}", manageCodeSave3);
|
|
|
+ log.info("MAKE MANAGECODE :::: {}", manageCode);
|
|
|
|
|
|
- if(compsInfoList.size() == 4) { // 조합 상품 최대치 계산 (세트상품은 최대 5개까지 등록 가능)
|
|
|
+ if(compsInfoList.size() > 3) { // 조합 상품 최대치 계산 (세트상품은 최대 5개까지 등록 가능)
|
|
|
for (Goods comps4 : compsInfoList) {
|
|
|
if (comps4.getRnum() == 4) {
|
|
|
// 구성상품별 옵션 정보
|
|
|
@@ -1626,7 +1647,7 @@ public class TsfOrderService {
|
|
|
String[] goods4stockQty = comps4.getItemStockQty().split(",");
|
|
|
|
|
|
// 기존 정보 저장 (다시 돌아올 경우 이전 번호까지의 정보로 리셋하기 위함)
|
|
|
- String manageCodeSave4 = manageCodeSave3;
|
|
|
+ String manageCodeSave4 = manageCode.toString();
|
|
|
int addPriceSave4 = addPriceSave3;
|
|
|
int stockQtySave4 = stockQtySave3;
|
|
|
|
|
|
@@ -1636,7 +1657,7 @@ public class TsfOrderService {
|
|
|
addPrice = addPriceSave4 + Integer.parseInt(goods4addPrices[g4]);
|
|
|
if(stockQtySave4 < Integer.parseInt(goods4stockQty[g4])) stockQty = Integer.parseInt(goods4stockQty[g4]);
|
|
|
|
|
|
- if(compsInfoList.size() == 5) { // 조합 상품 최대치 계산 (세트상품은 최대 5개까지 등록 가능)
|
|
|
+ if(compsInfoList.size() > 4) { // 조합 상품 최대치 계산 (세트상품은 최대 5개까지 등록 가능)
|
|
|
for (Goods comps5 : compsInfoList) {
|
|
|
if (comps5.getRnum() == 5) {
|
|
|
// 구성상품별 옵션 정보
|
|
|
@@ -1645,7 +1666,7 @@ public class TsfOrderService {
|
|
|
String[] goods5stockQty = comps5.getItemStockQty().split(",");
|
|
|
|
|
|
// 기존 정보 저장 (다시 돌아올 경우 이전 번호까지의 정보로 리셋하기 위함)
|
|
|
- String manageCodeSave5 = manageCodeSave4;
|
|
|
+ String manageCodeSave5 = manageCode.toString();
|
|
|
int addPriceSave5 = addPriceSave4;
|
|
|
int stockQtySave5 = stockQtySave4;
|
|
|
|
|
|
@@ -1925,7 +1946,8 @@ public class TsfOrderService {
|
|
|
e.printStackTrace();
|
|
|
} finally {
|
|
|
log.info("CHECK CREATE NAVERPAY GOODS XML ::::: \n{}", sb.toString());
|
|
|
- write(response, sb.toString());
|
|
|
+ // log.info("CHECK NAVERPAY XML LENGTH ::::: {}", sb.length());
|
|
|
+ write(response, sb);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1936,7 +1958,7 @@ public class TsfOrderService {
|
|
|
* @author xodud1202
|
|
|
* @since 2021. 05. 13
|
|
|
*/
|
|
|
- public void write(HttpServletResponse response, String result) throws Exception {
|
|
|
+ public void write(HttpServletResponse response, StringBuilder result) throws Exception {
|
|
|
Writer writer = null;
|
|
|
|
|
|
try {
|
|
|
@@ -1944,7 +1966,7 @@ public class TsfOrderService {
|
|
|
response.setHeader("Cache-Control", "no-cache");
|
|
|
|
|
|
writer = response.getWriter();
|
|
|
- writer.write(result);
|
|
|
+ writer.write(result.toString());
|
|
|
writer.flush();
|
|
|
} catch(Exception e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -2062,4 +2084,16 @@ public class TsfOrderService {
|
|
|
|
|
|
return "SUCCESS";
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 비회원 주문 여부 정보 조회
|
|
|
+ *
|
|
|
+ * @param Order
|
|
|
+ * @return int
|
|
|
+ * @author card007
|
|
|
+ * @since 2021. 05. 26
|
|
|
+ */
|
|
|
+ public int getNoMemberOrderInfo(Order order) {
|
|
|
+ return orderDao.getNoMemberOrderInfo(order);
|
|
|
+ }
|
|
|
}
|