فهرست منبع

이태영 - 20210512 장바구니 브랜드명 수정

xodud lee 5 سال پیش
والد
کامیت
d82704f54d

+ 51 - 0
src/main/java/com/style24/core/biz/service/TscOrderService.java

@@ -1,5 +1,6 @@
 package com.style24.core.biz.service;
 
+import java.nio.charset.StandardCharsets;
 import java.text.NumberFormat;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -29,6 +30,11 @@ import com.usafe.guarantee.InsuranceInfo;
 import com.usafe.guarantee.InsuranceManager;
 
 import lombok.extern.slf4j.Slf4j;
+import sun.misc.BASE64Decoder;
+import sun.misc.BASE64Encoder;
+
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
 
 /**
  * 주문관리 Service
@@ -2312,6 +2318,51 @@ public class TscOrderService {
 
 		return "SUCCESS";
 	}
+
+	public String encodeStr(String str) throws Exception {
+		byte[] SECRET_KEY = { 115, 51, 117, 70, 49, 65, 107, 125, 43, 118, 48, 65, 38, 57, 77, 67, 74, 120, 90, 87, 78, 80, 101, 102 };
+		SecretKeySpec KEYSPEC = new SecretKeySpec(SECRET_KEY, "DESede");
+
+		String result = null;
+		Cipher cipher = Cipher.getInstance("DESede/ECB/PKCS5Padding");
+		cipher.init(1, KEYSPEC);
+		byte[] plainText = str.getBytes(StandardCharsets.UTF_8);
+		byte[] cipherText = cipher.doFinal(plainText);
+		result = (new BASE64Encoder()).encode(cipherText);
+		return result;
+	}
+
+	public String decodeStr(String str) throws Exception {
+		byte[] SECRET_KEY = { 115, 51, 117, 70, 49, 65, 107, 125, 43, 118, 48, 65, 38, 57, 77, 67, 74, 120, 90, 87, 78, 80, 101, 102 };
+		SecretKeySpec KEYSPEC = new SecretKeySpec(SECRET_KEY, "DESede");
+
+		String result = null;
+		Cipher cipher = Cipher.getInstance("DESede/ECB/PKCS5Padding");
+		cipher.init(2, KEYSPEC);
+		byte[] base64bytes = (new BASE64Decoder()).decodeBuffer(str);
+		byte[] decryptedText = cipher.doFinal(base64bytes);
+		result = new String(decryptedText, StandardCharsets.UTF_8);
+		result = result.trim();
+		return result;
+	}
+
+	public String simpleEncode(String strVal) {
+		String result = strVal;
+		result = result.replaceAll("=", "%3D");
+		result = result.replaceAll("&", "%26");
+		result = result.replaceAll("%", "%25");
+		result = result.replaceAll(" ", "%20");
+		return result;
+	}
+
+	public String simpleDecode(String strVal) {
+		String result = strVal;
+		result = result.replaceAll("%3D", "=");
+		result = result.replaceAll("%26", "&");
+		result = result.replaceAll("%25", "%");
+		result = result.replaceAll("%20", " ");
+		return result;
+	}
 }
 
 

+ 1 - 0
src/main/java/com/style24/persistence/domain/Order.java

@@ -550,6 +550,7 @@ public class Order extends TscBaseDomain {
 	private Integer reviewSq;
 	private String selfGoodsYn;
 	private String brandNm;
+	private String brandGroupNm;
 	private String expiredSoon;
 	private int purchaseConfirmDay;
 	private String giftLimitDt;