|
|
@@ -1,10 +1,15 @@
|
|
|
package com.uas.eis;
|
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.alibaba.fastjson.TypeReference;
|
|
|
import com.uas.eis.config.DonlimConfig;
|
|
|
import com.uas.eis.core.config.SpObserver;
|
|
|
-import com.uas.eis.dao.BaseDao;
|
|
|
+import com.uas.eis.dao.*;
|
|
|
import com.uas.eis.service.ERPService;
|
|
|
+import com.uas.eis.utils.JSONUtil;
|
|
|
import nuonuo.open.sdk.NNOpenSDK;
|
|
|
import org.junit.Test;
|
|
|
import org.junit.runner.RunWith;
|
|
|
@@ -13,8 +18,7 @@ import org.springframework.boot.test.context.SpringBootTest;
|
|
|
import org.springframework.test.context.junit4.SpringRunner;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.UUID;
|
|
|
+import java.util.*;
|
|
|
|
|
|
@RunWith(SpringRunner.class)
|
|
|
@SpringBootTest(classes = {UasEisApplication.class})
|
|
|
@@ -25,22 +29,21 @@ public class UasEisApplicationTests {
|
|
|
private ERPService erpService;
|
|
|
@Autowired
|
|
|
private DonlimConfig donlimConfig;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 开票订单对接
|
|
|
+ */
|
|
|
@Test
|
|
|
public void Test() {
|
|
|
System.out.println("test");
|
|
|
- /* String taxnum = "339901999999516";//""91440300319521190W";//正式 授权企业税号
|
|
|
- String appKey = "47646161";
|
|
|
- String appSecret = "B6681C05C3EA4408";
|
|
|
- String method = "nuonuo.OpeMplatform.queryInvoiceList"; // API方法名
|
|
|
- String token = "3792fb46bc927024c7f6a50hjkhwrkss"; // 访问令牌
|
|
|
- String url = "https://sdk.nuonuo.com/open/v1/services"; // SDK请求地址
|
|
|
- String content = "{ \"requestType\": \"1\", \"pageNo\": \"2\", \"pageSize\": \"20\", \"taxnum\": \"339901999999516\", \"startTime\": \"2023-07-10 00:00:00\", \"endTime\": \"2023-07-20 00:00:00\" }";
|
|
|
-*/
|
|
|
System.out.println(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()));
|
|
|
Object ob=baseDao.getFieldDataByCondition("enterprise","EN_WHICHSYSTEM","1=1");
|
|
|
System.out.println(ob.toString());
|
|
|
- erpService.pushInvoiceOrder("N_HUASL_SZ",0);
|
|
|
+ erpService.pushInvoiceOrder("N_HUASL_SZ",5);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 获取token
|
|
|
+ */
|
|
|
@Test
|
|
|
public void Test1() {
|
|
|
/*//测试
|
|
|
@@ -61,19 +64,26 @@ public class UasEisApplicationTests {
|
|
|
@Test
|
|
|
public void Test2(){
|
|
|
NNOpenSDK sdk = NNOpenSDK.getIntance();
|
|
|
- String taxnum ="339901999999824";//测试
|
|
|
- String appKey = "SD47646161";
|
|
|
- String appSecret = "SD681C05C3EA4408";
|
|
|
+ String taxnum ="339901999999199";////测试
|
|
|
+ String appKey = "78607195";
|
|
|
+ String appSecret = "26A860C451744A21";
|
|
|
String method = "nuonuo.OpeMplatform.queryInvoiceList"; // API方法名
|
|
|
- String url = "https://sandbox.nuonuocs.cn/open/v1/services";//SDK请求地址
|
|
|
- String token = "3792fb46bc927024c7f6a50pwp3e6evs";
|
|
|
- String content = "{ \"requestType\": \"1\", \"pageNo\": \"2\", \"pageSize\": \"20\", \"taxnum\": \"339901999999142\", " +
|
|
|
- " \"startTime\": \"2023-07-10 00:00:00\", " +
|
|
|
- "\"endTime\": \"2023-07-20 00:00:00\" }";
|
|
|
+ String url = "https://sdk.nuonuo.com/open/v1/services";//SDK请求地址
|
|
|
+ String token = "77f21f617f87135fcd97ef1ueud3dxdi";
|
|
|
+ String content = "{ \"requestType\": \"1\", \"pageNo\": \"2\", \"pageSize\": \"20\", \"taxnum\": \"339901999999199\", " +
|
|
|
+ " \"startTime\": \"2023-07-20 00:00:00\", " +
|
|
|
+ "\"endTime\": \"2023-07-21 00:00:00\" }";
|
|
|
content=sdk.convertToUtf8(content);
|
|
|
String senid = UUID.randomUUID().toString().replace("-", ""); // 唯一标识,32位随机码,无需修改,保持默认即可
|
|
|
String result = sdk.sendPostSyncRequest(url, senid, appKey, appSecret, token, taxnum, method, content);
|
|
|
System.out.println("result:");
|
|
|
System.out.println(result);
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 请求开具发票
|
|
|
+ */
|
|
|
+ @Test
|
|
|
+ public void Test3() {
|
|
|
+ erpService.invoiceOrderSubmitKp("N_HUASL_SZ",5);
|
|
|
+ }
|
|
|
}
|