测试类

This commit is contained in:
xiang2lin 2025-04-24 13:38:25 +08:00
parent b2d2a06086
commit 1eb12c3527
2 changed files with 26 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package com.hzya.frame; package com.hzya.frame;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.plugin.cinvoice.plugin.CInvoiceImportPluginInitializer;
import com.hzya.frame.plugin.contract.plugin.ContractAuditPluginInitializer; import com.hzya.frame.plugin.contract.plugin.ContractAuditPluginInitializer;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
@ -21,6 +22,8 @@ public class Test1 {
@Resource @Resource
private ContractAuditPluginInitializer contractPlugin; private ContractAuditPluginInitializer contractPlugin;
@Resource
private CInvoiceImportPluginInitializer cInvoiceImportPluginInitializer;
@Test @Test
public void contractAuditPluginTest(){ public void contractAuditPluginTest(){
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
@ -31,4 +34,16 @@ public class Test1 {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
} }
//发票批量导入
@Test
public void cinvoicePluginTest(){
JSONObject jsonObject = new JSONObject();
jsonObject.put("sourceCode","HT-OA");
try {
cInvoiceImportPluginInitializer.executeBusiness(jsonObject);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
} }

View File

@ -163,6 +163,17 @@ public class temButtom {
} }
@Test
public void youduTest(){
long timestamp = System.currentTimeMillis();
System.out.println("时间戳:"+timestamp);
Map<String, Object> parametersMap = new HashMap<>();
parametersMap.put("accessKey","6X3B526P5HqE6ums");
parametersMap.put("timestamp",timestamp);
String a = YzfSignUtil.signRequest(parametersMap,"34e5fc32ac894a2ba2ade8c3852c7a0a");
System.out.println("sign"+a);
}
private String getdata(String accessToken) { private String getdata(String accessToken) {
String url = "http://oapi.nanofintax.com/api/invoice_receive/fp/v1/query?accessToken="+accessToken; String url = "http://oapi.nanofintax.com/api/invoice_receive/fp/v1/query?accessToken="+accessToken;
JSONObject dayabody = new JSONObject(); JSONObject dayabody = new JSONObject();