|
@@ -2,8 +2,14 @@ package com.miaxis.test;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.miaxis.ZzjsApplication;
|
|
import com.miaxis.ZzjsApplication;
|
|
|
|
+import com.miaxis.common.enums.OrderStatusEnum;
|
|
|
|
+import com.miaxis.common.exception.CustomException;
|
|
|
|
+import com.miaxis.feign.dto.FilmDTO;
|
|
|
|
+import com.miaxis.feign.dto.FilmMcpData;
|
|
|
|
+import com.miaxis.feign.dto.FilmXdResult;
|
|
import com.miaxis.wx.domain.WxOrder;
|
|
import com.miaxis.wx.domain.WxOrder;
|
|
import com.miaxis.wx.dto.WxNotifyReturnDTO;
|
|
import com.miaxis.wx.dto.WxNotifyReturnDTO;
|
|
|
|
+import com.miaxis.wx.dto.WxOrderCreateDTO;
|
|
import com.miaxis.wx.service.IWxOrderService;
|
|
import com.miaxis.wx.service.IWxOrderService;
|
|
import com.miaxis.wx.service.IRefundRecordService;
|
|
import com.miaxis.wx.service.IRefundRecordService;
|
|
import com.wechat.pay.contrib.apache.httpclient.auth.AutoUpdateCertificatesVerifier;
|
|
import com.wechat.pay.contrib.apache.httpclient.auth.AutoUpdateCertificatesVerifier;
|
|
@@ -11,11 +17,15 @@ import org.junit.Test;
|
|
import org.junit.runner.RunWith;
|
|
import org.junit.runner.RunWith;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
|
+import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
|
import org.springframework.test.context.ActiveProfiles;
|
|
import org.springframework.test.context.ActiveProfiles;
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
|
import java.math.BigInteger;
|
|
import java.math.BigInteger;
|
|
import java.security.cert.X509Certificate;
|
|
import java.security.cert.X509Certificate;
|
|
|
|
+
|
|
|
|
+import static com.miaxis.common.utils.OrderCodeFactory.getOrderCode;
|
|
|
|
+
|
|
//@ActiveProfiles("prod")
|
|
//@ActiveProfiles("prod")
|
|
@SpringBootTest(classes = ZzjsApplication.class)
|
|
@SpringBootTest(classes = ZzjsApplication.class)
|
|
@RunWith(SpringRunner.class)
|
|
@RunWith(SpringRunner.class)
|
|
@@ -28,6 +38,10 @@ public class NormalTest {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private AutoUpdateCertificatesVerifier verifier;
|
|
private AutoUpdateCertificatesVerifier verifier;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private ThreadPoolTaskExecutor threadPoolTaskExecutor;
|
|
|
|
+
|
|
@Test
|
|
@Test
|
|
public void test1() throws Exception {
|
|
public void test1() throws Exception {
|
|
WxOrder wxOrder = wxOrderService.getByOutTradeNo("12021060816391765454799220937462");
|
|
WxOrder wxOrder = wxOrderService.getByOutTradeNo("12021060816391765454799220937462");
|
|
@@ -39,32 +53,32 @@ public class NormalTest {
|
|
|
|
|
|
@Test
|
|
@Test
|
|
public void test11() throws Exception {
|
|
public void test11() throws Exception {
|
|
- WxOrder wxOrder = wxOrderService.getByOutTradeNo("12021052417182038148110033053335");
|
|
|
|
- System.out.println(wxOrder.getGoodsType()=="1");
|
|
|
|
- System.out.println(wxOrder.getGoodsType().equals("1"));
|
|
|
|
-// WxOrder wxOrder1 = wxOrderService.getByOutTradeNo("12021052415260767148145493655617");
|
|
|
|
-// refundRecordService.refund(wxOrder1,"12021051815333778448136985596489");
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- @Test
|
|
|
|
- public void test2() throws Exception {
|
|
|
|
- X509Certificate validCertificate = verifier.getValidCertificate();
|
|
|
|
- BigInteger serialNumber = validCertificate.getSerialNumber();
|
|
|
|
- System.out.println(serialNumber);
|
|
|
|
-
|
|
|
|
|
|
+ threadPoolTaskExecutor.execute(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ System.out.println(Thread.currentThread()+"aaa");
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ if (true){
|
|
|
|
+ System.out.println("低分段");
|
|
|
|
+ threadPoolTaskExecutor.execute(new Runnable() {
|
|
|
|
+ @Override
|
|
|
|
+ public void run() {
|
|
|
|
+ try {
|
|
|
|
+ System.out.println(Thread.currentThread()+"bbb");
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ throw new CustomException("订单:推送消息失败");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- public static void main(String[] args) {
|
|
|
|
- Integer a =1;
|
|
|
|
- do1(a);
|
|
|
|
- System.out.println(a);
|
|
|
|
- }
|
|
|
|
- public static void do1(Integer a){
|
|
|
|
- a =2 ;
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|