package cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.paperInvoice.dto.request.SID5SelectBillInfo;

import cn.superdesk.uniorder.common.json.AnJsonUtils;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.paperInvoice.dto.request._SzhtxxPaperInvoiceBaseRequest;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.io.UnsupportedEncodingException;

/**
 * @Description: 4.2.1.3.4 查询发票信息 SID=5_深圳航信纸质发票（SOAP）
 * @Author: linjinyu
 * @CreateDate: 2022/7/15 11:00 上午
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022/7/15 11:00 上午
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@SuperBuilder(toBuilder = true)
@AllArgsConstructor
@NoArgsConstructor
@Data
public class SID5SelectBillInfoRequestBody extends _SzhtxxPaperInvoiceBaseRequest {

    @ApiModelProperty("明文")
    private SID5SelectBillInfoRequestBodyStructVo structVo;

    public SID5SelectBillInfoRequestBody packing() {

        try {
            this.SIDParam = this.base64EncodeAndReplace(AnJsonUtils.toJson(structVo));
        } catch (UnsupportedEncodingException unsupportedEncodingException) {
            unsupportedEncodingException.printStackTrace();
            this.SIDParam = "ERROR";
        }

        return this;
    }
}
