invoiceList;
+
+
+ public String toJson() {
+ return WxMaGsonBuilder.create().toJson(this);
+ }
+
+}
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/urllink/CloudBase.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/urllink/CloudBase.java
new file mode 100644
index 000000000..7e0d645b5
--- /dev/null
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/urllink/CloudBase.java
@@ -0,0 +1,60 @@
+package cn.binarywang.wx.miniapp.bean.urllink;
+
+import com.google.gson.annotations.SerializedName;
+import lombok.Builder;
+import lombok.Data;
+
+/**
+ *
+ * 云开发静态网站自定义 H5 配置参数
+ *
+ * @author xiaoyu
+ * @since 2021-06-11
+ */
+@Data
+@Builder
+public class CloudBase {
+
+ /**
+ * 云开发环境
+ *
+ * 是否必填: 是
+ *
+ */
+ private String env;
+
+ /**
+ * 静态网站自定义域名,不填则使用默认域名
+ *
+ * 是否必填: 否
+ *
+ */
+ private String domain;
+
+ /**
+ * 云开发静态网站 H5 页面路径,不可携带 query
+ *
+ * 默认值:/
+ * 是否必填: 否
+ *
+ */
+ private String path;
+
+ /**
+ * 云开发静态网站 H5 页面 query 参数,最大 1024 个字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~
+ *
+ * 是否必填: 否
+ *
+ */
+ private String query;
+
+ /**
+ * 第三方批量代云开发时必填,表示创建该 env 的 appid (小程序/第三方平台)
+ *
+ * 是否必填: 否
+ *
+ */
+ @SerializedName("resource_appid")
+ private String resourceAppid;
+
+}
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/urllink/GenerateUrlLinkRequest.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/urllink/GenerateUrlLinkRequest.java
new file mode 100644
index 000000000..207aa3dee
--- /dev/null
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/bean/urllink/GenerateUrlLinkRequest.java
@@ -0,0 +1,85 @@
+package cn.binarywang.wx.miniapp.bean.urllink;
+
+import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
+import com.google.gson.annotations.SerializedName;
+import lombok.Builder;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ *
+ * 获取小程序 URL Link参数对象
+ *
+ * @author xiaoyu
+ * @since 2021-06-11
+ */
+@Data
+@Builder
+public class GenerateUrlLinkRequest implements Serializable {
+
+ private static final long serialVersionUID = -2183685760797791910L;
+
+ /**
+ * 通过 URL Link 进入的小程序页面路径,必须是已经发布的小程序存在的页面,不可携带 query 。path 为空时会跳转小程序主页
+ *
+ * 是否必填: 是
+ *
+ */
+ private String path;
+
+ /**
+ * 通过 URL Link 进入小程序时的query,最大1024个字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~
+ *
+ * 是否必填: 是
+ *
+ */
+ private String query;
+
+ /**
+ * 生成的 URL Link 类型,到期失效:true,永久有效:false
+ *
+ * 默认值:false
+ * 是否必填: 否
+ *
+ */
+ @SerializedName("is_expire")
+ private Boolean isExpire;
+
+ /**
+ * 小程序 URL Link 失效类型,失效时间:0,失效间隔天数:1
+ *
+ * 是否必填: 是
+ *
+ */
+ @SerializedName("expire_type")
+ private Integer expireType;
+
+ /**
+ * 到期失效的 URL Link 的失效时间,为 Unix 时间戳。生成的到期失效 URL Link 在该时间前有效。最长有效期为1年。expire_type 为 0 必填
+ *
+ * 是否必填: 是
+ *
+ */
+ @SerializedName("expire_time")
+ private Integer expireTime;
+
+ /**
+ * 到期失效的URL Link的失效间隔天数。生成的到期失效URL Link在该间隔时间到达前有效。最长间隔天数为365天。expire_type 为 1 必填
+ *
+ * 是否必填: 是
+ *
+ */
+ @SerializedName("expire_interval")
+ private Integer expireInterval;
+
+ /**
+ * 云开发静态网站自定义 H5 配置参数,可配置中转的云开发 H5 页面。不填默认用官方 H5 页面
+ *
+ * 是否必填: 否
+ *
+ */
+ @SerializedName("cloud_base")
+ private CloudBase cloudBase;
+
+}
diff --git a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java
index 71ee8500e..d2d15b8f5 100644
--- a/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java
+++ b/weixin-java-miniapp/src/main/java/cn/binarywang/wx/miniapp/constant/WxMaApiUrlConstants.java
@@ -222,6 +222,10 @@ public class WxMaApiUrlConstants {
String GENERATE_SCHEME_URL = "https://api.weixin.qq.com/wxa/generatescheme";
}
+ public interface Link {
+ String GENERATE_URLLINK_URL = "https://api.weixin.qq.com/wxa/generate_urllink";
+ }
+
public interface SecCheck {
String IMG_SEC_CHECK_URL = "https://api.weixin.qq.com/wxa/img_sec_check";
String MSG_SEC_CHECK_URL = "https://api.weixin.qq.com/wxa/msg_sec_check";
@@ -316,4 +320,30 @@ public class WxMaApiUrlConstants {
String ORDER_GET = "https://api.weixin.qq.com/shop/order/get";
}
}
+
+ /**
+ * 电子发票报销方
+ */
+ public interface Invoice{
+
+ /**
+ * 报销方查询报销发票信息
+ */
+ String GET_INVOICE_INFO = "https://api.weixin.qq.com/card/invoice/reimburse/getinvoiceinfo";
+
+ /**
+ * 报销方批量查询报销发票信息
+ */
+ String GET_INVOICE_BATCH = "https://api.weixin.qq.com/card/invoice/reimburse/getinvoicebatch";
+
+ /**
+ * 报销方更新发票状态
+ */
+ String UPDATE_INVOICE_STATUS = "https://api.weixin.qq.com/card/invoice/reimburse/updateinvoicestatus";
+
+ /**
+ * 报销方批量更新发票状态
+ */
+ String UPDATE_STATUS_BATCH = "https://api.weixin.qq.com/card/invoice/reimburse/updatestatusbatch";
+ }
}
diff --git a/weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaLinkServiceImplTest.java b/weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaLinkServiceImplTest.java
new file mode 100644
index 000000000..68ca9b621
--- /dev/null
+++ b/weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaLinkServiceImplTest.java
@@ -0,0 +1,31 @@
+package cn.binarywang.wx.miniapp.api.impl;
+
+import cn.binarywang.wx.miniapp.api.WxMaService;
+import cn.binarywang.wx.miniapp.bean.urllink.GenerateUrlLinkRequest;
+import cn.binarywang.wx.miniapp.test.ApiTestModule;
+import com.google.inject.Inject;
+import me.chanjar.weixin.common.error.WxErrorException;
+import org.testng.annotations.Guice;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.*;
+
+@Test
+@Guice(modules = ApiTestModule.class)
+public class WxMaLinkServiceImplTest {
+
+ @Inject
+ private WxMaService wxMaService;
+
+ @Test
+ public void testGenerate() throws WxErrorException {
+
+ GenerateUrlLinkRequest request = GenerateUrlLinkRequest.builder()
+ .path("pages/tabBar/home/home")
+ .build();
+
+ String url = this.wxMaService.getLinkService().generate(request);
+
+ System.out.println(url);
+ }
+}
diff --git a/weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaReimburseInvoiceServiceImplTest.java b/weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaReimburseInvoiceServiceImplTest.java
new file mode 100644
index 000000000..a7263bdf5
--- /dev/null
+++ b/weixin-java-miniapp/src/test/java/cn/binarywang/wx/miniapp/api/impl/WxMaReimburseInvoiceServiceImplTest.java
@@ -0,0 +1,89 @@
+package cn.binarywang.wx.miniapp.api.impl;
+
+import cn.binarywang.wx.miniapp.api.WxMaService;
+import cn.binarywang.wx.miniapp.bean.invoice.reimburse.*;
+import cn.binarywang.wx.miniapp.test.ApiTestModule;
+import com.google.gson.GsonBuilder;
+import com.google.inject.Inject;
+import lombok.extern.slf4j.Slf4j;
+import me.chanjar.weixin.common.error.WxErrorException;
+import org.testng.annotations.Guice;
+import org.testng.annotations.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.testng.Assert.*;
+
+@Slf4j
+@Test
+@Guice(modules = ApiTestModule.class)
+public class WxMaReimburseInvoiceServiceImplTest {
+
+ @Inject
+ private WxMaService wxMaService;
+
+ @Test
+ public void testGetInvoiceInfo() throws WxErrorException {
+
+ InvoiceInfoRequest request = InvoiceInfoRequest.builder()
+ .cardId("**********************")
+ .encryptCode("**********************")
+ .build();
+
+ InvoiceInfoResponse response = this.wxMaService.getReimburseInvoiceService().getInvoiceInfo(request);
+
+ log.info("response: {}", new GsonBuilder().create().toJson(response));
+ }
+
+ @Test
+ public void testGetInvoiceBatch() throws WxErrorException {
+
+ List invoices = new ArrayList<>();
+ InvoiceInfoRequest r = InvoiceInfoRequest.builder()
+ .cardId("**********************")
+ .encryptCode("********************************************")
+ .build();
+ invoices.add(r);
+ r = InvoiceInfoRequest.builder()
+ .cardId("**********************")
+ .encryptCode("********************************************")
+ .build();
+ invoices.add(r);
+
+ InvoiceBatchRequest request = InvoiceBatchRequest.builder().itemList(invoices).build();
+
+ List responses = this.wxMaService.getReimburseInvoiceService().getInvoiceBatch(request);
+ log.info("responses: {}",new GsonBuilder().create().toJson(responses));
+ }
+
+ @Test
+ public void testUpdateInvoiceStatus() throws WxErrorException {
+ UpdateInvoiceStatusRequest request = UpdateInvoiceStatusRequest.builder()
+ .cardId("**********************")
+ .encryptCode("********************************************")
+ .reimburseStatus("INVOICE_REIMBURSE_INIT")
+ .build();
+
+ this.wxMaService.getReimburseInvoiceService().updateInvoiceStatus(request);
+ }
+
+ @Test
+ public void testUpdateStatusBatch() throws WxErrorException {
+
+ List invoices = new ArrayList<>();
+ InvoiceInfoRequest r = InvoiceInfoRequest.builder()
+ .cardId("**************")
+ .encryptCode("**************")
+ .build();
+ invoices.add(r);
+
+ UpdateStatusBatchRequest request = UpdateStatusBatchRequest.builder()
+ .invoiceList(invoices)
+ .openid("**************")
+ .reimburseStatus("INVOICE_REIMBURSE_LOCK")
+ .build();
+
+ this.wxMaService.getReimburseInvoiceService().updateStatusBatch(request);
+ }
+}