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

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: 13. 单张发票查询 SID=17
 * @Author: linjinyu
 * @CreateDate: 2022/5/5 3:18 下午
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022/5/5 3:18 下午
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@SuperBuilder(toBuilder = true)
@AllArgsConstructor
@NoArgsConstructor
@Data
public class SID17SingleSelectRequestBody extends _SzhtxxPaperInvoiceBaseRequest {

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

    public SID17SingleSelectRequestBody packing() {

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

        return this;

    }
}
