🆕 #2135 【小程序】实现获取 URL Link接口 以及微信电子发票报销方相关接口

This commit is contained in:
mrxiao
2021-06-11 11:51:43 +08:00
committed by GitHub
parent 61303c2226
commit 8e0a6a3d40
18 changed files with 924 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
package cn.binarywang.wx.miniapp.bean.invoice.reimburse;
import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* <pre>
* 批量查询报销发票信息参数对象
* </pre>
* @author <a href="https://github.com/mr-xiaoyu">xiaoyu</a>
* @since 2021-03-23
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class InvoiceBatchRequest implements Serializable {
private static final long serialVersionUID = -9121443117105107231L;
/**
* 发票卡券的card_id
* <pre>
* 是否必填: 是
* </pre>
*/
@SerializedName("item_list")
private List<InvoiceInfoRequest> itemList;
public String toJson() {
return WxMaGsonBuilder.create().toJson(this);
}
}

View File

@@ -0,0 +1,34 @@
package cn.binarywang.wx.miniapp.bean.invoice.reimburse;
import lombok.Data;
/**
* <pre>
* 发票商品信息
* </pre>
* @author <a href="https://github.com/mr-xiaoyu">xiaoyu</a>
* @since 2021-03-23
*/
@Data
public class InvoiceCommodityInfo {
/**
* 项目(商品)名称
*/
private String name;
/**
* 项目数量
*/
private Integer num;
/**
* 项目单位
*/
private String unit;
/**
* 单价,以分为单位
*/
private Integer price;
}

View File

@@ -0,0 +1,53 @@
package cn.binarywang.wx.miniapp.bean.invoice.reimburse;
import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* <pre>
* 查询报销发票信息参数对象
* </pre>
* @author <a href="https://github.com/mr-xiaoyu">xiaoyu</a>
* @since 2021-03-23
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class InvoiceInfoRequest implements Serializable {
private static final long serialVersionUID = 7854633127026139444L;
/**
* 发票卡券的card_id
* <pre>
* 是否必填: 是
* </pre>
*/
@SerializedName("card_id")
private String cardId;
/**
* 发票卡券的加密code,和card_id共同构成一张发票卡券的唯一标识
* <pre>
* 是否必填: 是
* </pre>
*/
@SerializedName("encrypt_code")
private String encryptCode;
public String toJson() {
return WxMaGsonBuilder.create().toJson(this);
}
}

View File

@@ -0,0 +1,79 @@
package cn.binarywang.wx.miniapp.bean.invoice.reimburse;
import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
import com.google.gson.JsonObject;
import com.google.gson.annotations.SerializedName;
import com.google.gson.reflect.TypeToken;
import lombok.Data;
import me.chanjar.weixin.common.util.json.GsonParser;
import java.util.List;
/**
* <pre>
* 查询报销发票信息响应对象
* </pre>
* @author <a href="https://github.com/mr-xiaoyu">xiaoyu</a>
* @since 2021-03-23
*/
@Data
public class InvoiceInfoResponse {
/**
* 发票ID
*/
@SerializedName("card_id")
private String cardId;
/**
* 发票的有效期起始时间
*/
@SerializedName("begin_time")
private Integer beginTime;
/**
* 发票的有效期截止时间
*/
@SerializedName("end_time")
private Integer endTime;
/**
* 用户标识
*/
private String openid;
/**
* 发票的类型
*/
private String type;
/**
* 发票的收款方
*/
private String payee;
/**
* 发票详情
*/
private String detail;
/**
* 用户可在发票票面看到的主要信息
*/
@SerializedName("user_info")
private InvoiceUserInfo userInfo;
public static InvoiceInfoResponse fromJson(String json) {
return WxMaGsonBuilder.create().fromJson(json, InvoiceInfoResponse.class);
}
public static List<InvoiceInfoResponse> toList(String json) {
JsonObject jsonObject = GsonParser.parse(json);
return WxMaGsonBuilder.create().fromJson(jsonObject.get("item_list").toString(),
new TypeToken<List<InvoiceInfoResponse>>() {
}.getType());
}
}

View File

@@ -0,0 +1,137 @@
package cn.binarywang.wx.miniapp.bean.invoice.reimburse;
import com.google.gson.annotations.SerializedName;
import lombok.Data;
import java.util.List;
/**
* <pre>
* 用户可在发票票面看到的主要信息
* </pre>
* @author <a href="https://github.com/mr-xiaoyu">xiaoyu</a>
* @since 2021-03-23
*/
@Data
public class InvoiceUserInfo {
/**
* 发票加税合计金额,以分为单位
*/
private Integer fee;
/**
* 发票的抬头
*/
private String title;
/**
* 开票时间
*/
@SerializedName("billing_time")
private Integer billingTime;
/**
* 发票代码
*/
@SerializedName("billing_no")
private String billingNo;
/**
* 发票号码
*/
@SerializedName("billing_code")
private String billingCode;
/**
* 不含税金额,以分为单位
*/
@SerializedName("fee_without_tax")
private Integer feeWithoutTax;
/**
* 税额,以分为单位
*/
private Integer tax;
/**
* 发票对应的PDF_URL
*/
@SerializedName("pdf_url")
private String pdfUrl;
/**
* 其它消费凭证附件对应的URL
*/
@SerializedName("trip_pdf_url")
private String tripPdfUrl;
/**
* 发票报销状态
*/
@SerializedName("reimburse_status")
private String reimburseStatus;
/**
* 校验码
*/
@SerializedName("check_code")
private String checkCode;
/**
* 购买方纳税人识别号
*/
@SerializedName("buyer_number")
private String buyerNumber;
/**
* 购买方地址、电话
*/
@SerializedName("buyer_address_and_phone")
private String buyerAddressAndPhone;
/**
* 购买方开户行及账号
*/
@SerializedName("buyer_bank_account")
private String buyerBankAccount;
/**
* 销售方纳税人识别号
*/
@SerializedName("seller_number")
private String sellerNumber;
/**
* 销售方地址、电话
*/
@SerializedName("seller_address_and_phone")
private String sellerAddressAndPhone;
/**
* 销售方开户行及账号
*/
@SerializedName("seller_bank_account")
private String sellerBankAccount;
/**
* 备注
*/
private String remarks;
/**
* 收款人
*/
private String cashier;
/**
* 开票人
*/
private String maker;
/**
* 商品信息结构
*/
private List<InvoiceCommodityInfo> info;
}

View File

@@ -0,0 +1,60 @@
package cn.binarywang.wx.miniapp.bean.invoice.reimburse;
import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* <pre>
* 更新发票状态参数对象
* </pre>
* @author <a href="https://github.com/mr-xiaoyu">xiaoyu</a>
* @since 2021-03-23
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class UpdateInvoiceStatusRequest implements Serializable {
private static final long serialVersionUID = -4122242332481909977L;
/**
* 发票卡券的card_id
* <pre>
* 是否必填: 是
* </pre>
*/
@SerializedName("card_id")
private String cardId;
/**
* 发票卡券的加密code,和card_id共同构成一张发票卡券的唯一标识
* <pre>
* 是否必填: 是
* </pre>
*/
@SerializedName("encrypt_code")
private String encryptCode;
/**
* 发票报销状态
* <pre>
* 是否必填: 是
* </pre>
*/
@SerializedName("reimburse_status")
private String reimburseStatus;
public String toJson() {
return WxMaGsonBuilder.create().toJson(this);
}
}

View File

@@ -0,0 +1,58 @@
package cn.binarywang.wx.miniapp.bean.invoice.reimburse;
import cn.binarywang.wx.miniapp.json.WxMaGsonBuilder;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* <pre>
* 批量更新发票状态参数对象
* </pre>
* @author <a href="https://github.com/mr-xiaoyu">xiaoyu</a>
* @since 2021-03-23
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class UpdateStatusBatchRequest implements Serializable {
private static final long serialVersionUID = 7016357689566912199L;
/**
* 用户openid
* <pre>
* 是否必填: 是
* </pre>
*/
private String openid;
/**
* 发票报销状态
* <pre>
* 是否必填: 是
* </pre>
*/
@SerializedName("reimburse_status")
private String reimburseStatus;
/**
* 发票列表
* <pre>
* 是否必填: 是
* </pre>
*/
@SerializedName("invoice_list")
private List<InvoiceInfoRequest> invoiceList;
public String toJson() {
return WxMaGsonBuilder.create().toJson(this);
}
}

View File

@@ -0,0 +1,60 @@
package cn.binarywang.wx.miniapp.bean.urllink;
import com.google.gson.annotations.SerializedName;
import lombok.Builder;
import lombok.Data;
/**
* <pre>
* 云开发静态网站自定义 H5 配置参数
* </pre>
* @author <a href="https://github.com/mr-xiaoyu">xiaoyu</a>
* @since 2021-06-11
*/
@Data
@Builder
public class CloudBase {
/**
* 云开发环境
* <pre>
* 是否必填: 是
* </pre>
*/
private String env;
/**
* 静态网站自定义域名,不填则使用默认域名
* <pre>
* 是否必填: 否
* </pre>
*/
private String domain;
/**
* 云开发静态网站 H5 页面路径,不可携带 query
* <pre>
* 默认值:/
* 是否必填: 否
* </pre>
*/
private String path;
/**
* 云开发静态网站 H5 页面 query 参数,最大 1024 个字符,只支持数字,大小写英文以及部分特殊字符:!#$&'()*+,/:;=?@-._~
* <pre>
* 是否必填: 否
* </pre>
*/
private String query;
/**
* 第三方批量代云开发时必填,表示创建该 env 的 appid (小程序/第三方平台)
* <pre>
* 是否必填: 否
* </pre>
*/
@SerializedName("resource_appid")
private String resourceAppid;
}

View File

@@ -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;
/**
* <pre>
* 获取小程序 URL Link参数对象
* </pre>
* @author <a href="https://github.com/mr-xiaoyu">xiaoyu</a>
* @since 2021-06-11
*/
@Data
@Builder
public class GenerateUrlLinkRequest implements Serializable {
private static final long serialVersionUID = -2183685760797791910L;
/**
* 通过 URL Link 进入的小程序页面路径,必须是已经发布的小程序存在的页面,不可携带 query 。path 为空时会跳转小程序主页
* <pre>
* 是否必填: 是
* </pre>
*/
private String path;
/**
* 通过 URL Link 进入小程序时的query最大1024个字符只支持数字大小写英文以及部分特殊字符!#$&'()*+,/:;=?@-._~
* <pre>
* 是否必填: 是
* </pre>
*/
private String query;
/**
* 生成的 URL Link 类型到期失效true永久有效false
* <pre>
* 默认值false
* 是否必填: 否
* </pre>
*/
@SerializedName("is_expire")
private Boolean isExpire;
/**
* 小程序 URL Link 失效类型失效时间0失效间隔天数1
* <pre>
* 是否必填: 是
* </pre>
*/
@SerializedName("expire_type")
private Integer expireType;
/**
* 到期失效的 URL Link 的失效时间,为 Unix 时间戳。生成的到期失效 URL Link 在该时间前有效。最长有效期为1年。expire_type 为 0 必填
* <pre>
* 是否必填: 是
* </pre>
*/
@SerializedName("expire_time")
private Integer expireTime;
/**
* 到期失效的URL Link的失效间隔天数。生成的到期失效URL Link在该间隔时间到达前有效。最长间隔天数为365天。expire_type 为 1 必填
* <pre>
* 是否必填: 是
* </pre>
*/
@SerializedName("expire_interval")
private Integer expireInterval;
/**
* 云开发静态网站自定义 H5 配置参数,可配置中转的云开发 H5 页面。不填默认用官方 H5 页面
* <pre>
* 是否必填: 否
* </pre>
*/
@SerializedName("cloud_base")
private CloudBase cloudBase;
}