Browse Source

【英唐电子发票】

DINGYL 2 years ago
parent
commit
fa831cb00e

+ 24 - 0
src/main/java/com/uas/eis/config/DonlimConfig.java

@@ -0,0 +1,24 @@
+package com.uas.eis.config;
+
+import lombok.Data;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.stereotype.Component;
+
+@Component
+@ConfigurationProperties(prefix = "extral.donlim")
+@Data
+public class DonlimConfig {
+    /**
+     * 请求路径
+     */
+   private String route ;
+
+   private String appKey;
+
+   private String appSecret;
+
+    private String token;
+
+    private String taxnum;
+
+}

+ 3 - 1
src/main/java/com/uas/eis/dao/BaseDao.java

@@ -891,5 +891,7 @@ public class BaseDao{
 		updateByCondition(tableName, statusCodeField + "='AUDITED'," + statusField + "='已审核',"
 		updateByCondition(tableName, statusCodeField + "='AUDITED'," + statusField + "='已审核',"
 				+ auditdateField + "=" + DateUtil.parseDateToOracleString(Constant.YMD_HMS, new Date()) + "," + auditorField + "='"+employee.getEm_name()+"'", condition);
 				+ auditdateField + "=" + DateUtil.parseDateToOracleString(Constant.YMD_HMS, new Date()) + "," + auditorField + "='"+employee.getEm_name()+"'", condition);
 	}
 	}
-
+	public boolean isProd(String url){
+		return url.equals("https://sandbox.nuonuocs.cn/open/v1/services")? false : true;
+	}
 }
 }

+ 0 - 3
src/main/java/com/uas/eis/service/ERPService.java

@@ -9,8 +9,5 @@ import com.uas.eis.sdk.entity.ApiResult;
  * @date 2021-12-06 18:25
  * @date 2021-12-06 18:25
  */
  */
 public interface ERPService {
 public interface ERPService {
-
-    ApiResult<String> syncProduct(String data);
-
     ApiResult<String> pushInvoiceOrder(String master,int id);
     ApiResult<String> pushInvoiceOrder(String master,int id);
 }
 }

File diff suppressed because it is too large
+ 18 - 10
src/main/java/com/uas/eis/service/Impl/ERPServiceImpl.java


+ 6 - 2
src/main/resources/application-dev.yml

@@ -30,5 +30,9 @@ action:
     public_actions: /EIS/logout,/EIS/hello1
     public_actions: /EIS/logout,/EIS/hello1
 
 
 extral:
 extral:
-    panasonic:
-        route: https://sandbox.nuonuocs.cn/open/v1/services
+    donlim:
+        route: https://sandbox.nuonuocs.cn/open/v1/services
+        appKey : SD47646161
+        appSecret : SD681C05C3EA4408
+        token  : 3792fb46bc927024c7f6a50pwp3e6evs
+        taxnum : 339901999999142

+ 6 - 2
src/main/resources/application-prod.yml

@@ -30,5 +30,9 @@ action:
     public_actions: /EIS/logout,/EIS/hello1
     public_actions: /EIS/logout,/EIS/hello1
 
 
 extral:
 extral:
-    panasonic:
-        route: https://sdk.nuonuo.com/open/v1/services
+    donlim:
+        route: https://sdk.nuonuo.com/open/v1/services
+        appKey : 47646161
+        appSecret : B6681C05C3EA4408
+        token : 3792fb46bc927024c7f6a50hjkhwrkss
+        taxnum : 91440300319521190W

+ 35 - 1
src/test/java/com/uas/eis/UasEisApplicationTests.java

@@ -1,6 +1,7 @@
 package com.uas.eis;
 package com.uas.eis;
 
 
 
 
+import com.uas.eis.config.DonlimConfig;
 import com.uas.eis.core.config.SpObserver;
 import com.uas.eis.core.config.SpObserver;
 import com.uas.eis.dao.BaseDao;
 import com.uas.eis.dao.BaseDao;
 import com.uas.eis.service.ERPService;
 import com.uas.eis.service.ERPService;
@@ -22,9 +23,19 @@ public class UasEisApplicationTests {
 	private BaseDao baseDao;
 	private BaseDao baseDao;
 	@Autowired
 	@Autowired
 	private ERPService erpService;
 	private ERPService erpService;
+	@Autowired
+	private DonlimConfig donlimConfig;
 	@Test
 	@Test
 	public void Test() {
 	public void Test() {
 		System.out.println("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()));
 		System.out.println(new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date()));
 		Object ob=baseDao.getFieldDataByCondition("enterprise","EN_WHICHSYSTEM","1=1");
 		Object ob=baseDao.getFieldDataByCondition("enterprise","EN_WHICHSYSTEM","1=1");
 		System.out.println(ob.toString());
 		System.out.println(ob.toString());
@@ -32,8 +43,12 @@ public class UasEisApplicationTests {
 	}
 	}
 	@Test
 	@Test
 	public void Test1() {
 	public void Test1() {
+		/*//测试
 		String appKey = "SD47646161";
 		String appKey = "SD47646161";
-		String appSecret = "SD681C05C3EA4408";
+		String appSecret = "SD681C05C3EA4408";*/
+		//正式
+		String appKey = "47646161";
+		String appSecret = "B6681C05C3EA4408";
 		// 接口调用
 		// 接口调用
 		NNOpenSDK sdk = NNOpenSDK.getIntance();
 		NNOpenSDK sdk = NNOpenSDK.getIntance();
 		String json = sdk.getMerchantToken(appKey, appSecret);
 		String json = sdk.getMerchantToken(appKey, appSecret);
@@ -42,4 +57,23 @@ public class UasEisApplicationTests {
 		System.out.println("\n\n\n【商户获取Token】");
 		System.out.println("\n\n\n【商户获取Token】");
 		System.out.println(json);
 		System.out.println(json);
 	}
 	}
+
+	@Test
+	public void Test2(){
+		NNOpenSDK sdk = NNOpenSDK.getIntance();
+		String taxnum ="339901999999824";//测试
+		String appKey = "SD47646161";
+		String appSecret = "SD681C05C3EA4408";
+		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\" }";
+		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);
+	}
 }
 }

Some files were not shown because too many files changed in this diff