package cn.superdesk.uniorder.service.invoice.customer.state.impl;

import cn.hutool.core.codec.Base64;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.NumberUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.superdesk.uniorder.common.enums.common.CommonFormStateEnum;
import cn.superdesk.uniorder.common.enums.common.CommonSoftDeleteEnum;
import cn.superdesk.uniorder.common.enums.invoice.common.InvoiceTypeEnum;
import cn.superdesk.uniorder.common.enums.invoice.customer.InvoiceApplyCustomerInvoiceProgressingStatusEnum;
import cn.superdesk.uniorder.common.enums.invoice.customer.InvoiceApplyCustomerMakeInvoiceStatusEnum;
import cn.superdesk.uniorder.common.enums.order.UnifiedOrderCreditInvoiceMakeStatusEnum;
import cn.superdesk.uniorder.common.enums.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxxBillSentSignEnum;
import cn.superdesk.uniorder.common.enums.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxxInvoiceTypeEnum;
import cn.superdesk.uniorder.common.json.AnJsonUtils;
import cn.superdesk.uniorder.common.numerical.AnStringUtils;
import cn.superdesk.uniorder.common.security.dto.LoginSysUser;
import cn.superdesk.uniorder.dao.entity.invoice.common.InvoiceType;
import cn.superdesk.uniorder.dao.entity.invoice.customer.InvoiceApply;
import cn.superdesk.uniorder.dao.entity.sys.notify.SysNotify;
import cn.superdesk.uniorder.dao.entity.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxx;
import cn.superdesk.uniorder.dto._constant.ResourceConstant;
import cn.superdesk.uniorder.dto.param.thirdpart.szhtxx.common.singleBilling.SzhtxxInvoiceFptxxOpSingleBillingForm;
import cn.superdesk.uniorder.dto.param.thirdpart.szhtxx.common.singleSelect.SzhtxxInvoiceFptxxOpSingleSelectForm;
import cn.superdesk.uniorder.dto.vo.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxxListItemVo;
import cn.superdesk.uniorder.executor.scheduler.kafka._thirdpart.qchjc.QchjcStatementKafkaEventPublisher;
import cn.superdesk.uniorder.executor.scheduler.kafka._thirdpart.qchjc.dto.accounting.customer.QchjcCustomerStatementEvent;
import cn.superdesk.uniorder.executor.scheduler.kafka._thirdpart.qchjc.dto.accounting.customer.QchjcCustomerStatementEventSingleStructVo;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.electronicInvoice.dto.request.SingleBillingRequestBodyKpContent;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.electronicInvoice.dto.request.SingleBillingRequestBodyKpContentFptxxVo;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.electronicInvoice.dto.request.SingleBillingRequestBodyKpContentXmxxItemVo;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.paperInvoice.dto.request.SID17SingleSelect.SID17SingleSelectRequestBody;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.paperInvoice.dto.request.SID17SingleSelect.SID17SingleSelectRequestBodyStructVo;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.paperInvoice.dto.request.SID1SingleBilling.SID1SingleBillingRequestBody;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.paperInvoice.dto.request.SID1SingleBilling.SID1SingleBillingRequestBodyKpContentFptxxVo;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.paperInvoice.dto.request.SID1SingleBilling.SID1SingleBillingRequestBodyKpContentXmxxItemVo;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.paperInvoice.dto.response.SID17SingleSelect.SID17SingleSelectResponseBody;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.paperInvoice.dto.response.SID17SingleSelect.SID17SingleSelectResponseBodyEncmsgVo;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.paperInvoice.dto.response.SID1SingleBilling.SID1SingleBillingResponseBody;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.paperInvoice.dto.response.SID1SingleBilling.SID1SingleBillingResponseBodyEncmsgVo;
import cn.superdesk.uniorder.service.invoice.common.InvoiceTypeService;
import cn.superdesk.uniorder.service.invoice.customer.InvoiceApplyCustomerService;
import cn.superdesk.uniorder.service.invoice.customer.InvoiceApplyXGoodsService;
import cn.superdesk.uniorder.service.invoice.customer.state.InvoiceApplyCustomerFieldMakeInvoiceStatusOpOngoingSzhtxxElectronicInvoiceService;
import cn.superdesk.uniorder.service.invoice.customer.state.InvoiceApplyCustomerFieldMakeInvoiceStatusOpOngoingSzhtxxPaperInvoiceService;
import cn.superdesk.uniorder.service.order.base.UnifiedOrderCreditService;
import cn.superdesk.uniorder.service.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxxService;
import cn.superdesk.uniorder.service.thirdpart.szhtxx.paperInvoice.SzhtxxPaperInvoiceFptxxLogService;
import cn.superdesk.uniorder.service.thirdpart.szhtxx.paperInvoice.SzhtxxPaperInvoiceFptxxSID1SingleBillingProcessService;
import cn.superdesk.uniorder.service.thirdpart.szhtxx.paperInvoice.SzhtxxPaperInvoiceFptxxService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @Description: Java类作用描述
 * @Author: linjinyu
 * @CreateDate: 2022/4/26 10:13 上午
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022/4/26 10:13 上午
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Slf4j
@Service
public class InvoiceApplyCustomerFieldMakeInvoiceStatusOpOngoingSzhtxxPaperInvoiceServiceImpl implements InvoiceApplyCustomerFieldMakeInvoiceStatusOpOngoingSzhtxxPaperInvoiceService {

    @Resource
    private Snowflake snowflake;

    @Autowired
    private InvoiceApplyCustomerService invoiceApplyCustomerService;
    @Autowired
    private InvoiceApplyCustomerFieldMakeInvoiceStatusOpOngoingSzhtxxElectronicInvoiceService invoiceApplyCustomerFieldMakeInvoiceStatusOpOngoingSzhtxxElectronicInvoiceService;

    @Autowired
    private SzhtxxPaperInvoiceFptxxService szhtxxPaperInvoiceFptxxService;
    @Autowired
    private SzhtxxPaperInvoiceFptxxSID1SingleBillingProcessService szhtxxPaperInvoiceFptxxSID1SingleBillingProcessService;
    @Autowired
    private SzhtxxPaperInvoiceFptxxLogService szhtxxPaperInvoiceFptxxLogService;

    @Autowired
    private SzhtxxElectronicInvoiceFptxxService szhtxxElectronicInvoiceFptxxService;

    @Autowired
    private InvoiceApplyXGoodsService invoiceApplyXGoodsService;
    @Autowired
    private UnifiedOrderCreditService unifiedOrderCreditService;

    @Autowired
    private ResourceConstant resourceConstant;

    @Autowired
    private InvoiceTypeService invoiceTypeService;


    /**************************************** superdesk-uniorder-executor start ****************************************/

    @Autowired
    private QchjcStatementKafkaEventPublisher qchjcStatementEventPublisher;

    /**************************************** superdesk-uniorder-executor   end ****************************************/

    /**
     * op确认发起(纸质专用发票)(深圳航信纸质票)-蓝票
     * op确认开票(纸质专用发票)(深圳航信纸质票)-蓝票
     *
     * @return
     * @link opOngoingByStateMachine 分发
     */
    @Override
    public SysNotify submitAndRecord(
            SzhtxxInvoiceFptxxOpSingleBillingForm form,
            InvoiceApply invoiceApplyCustomerEntity,
            LoginSysUser loginSysUser) {

        log.info("\n{}\n{}\n{}", "op确认发起(纸质专用发票)(深圳航信纸质票)",
                JSONUtil.toJsonStr(form),
                JSONUtil.toJsonStr(invoiceApplyCustomerEntity),
                JSONUtil.toJsonStr(loginSysUser)
        );

        DateTime nowDate = DateUtil.date();

        Map<Long, InvoiceType> invoiceTypeMap = invoiceTypeService.convertToMapFieldId2Entity();

        switch (InvoiceTypeEnum.get(invoiceApplyCustomerEntity.getInvoiceType())) {
            case 电子普通发票:

                return SysNotify.builder()
                        .title("0001")
                        .content("该发票种类[电子普通发票]无此开票方式")
                        .build();
            case 纸质专用发票:

                SID1SingleBillingResponseBody sid1SingleBillingResponseBody = SID1SingleBillingResponseBody
                        .builder()
                        .batchId(form.getBatchId())
//                      .fpqqlsh(form.getFpqqlsh()) // 这里是错的 fpqqlsh是发票红冲时用  invoiceApplySn是发起开票时用
                        .fpqqlsh(form.getInvoiceApplySn())
                        .ENCMSG(form.getENCMSG())
                        .build();

                sid1SingleBillingResponseBody.unPacking();

                log.info("\n表单\n{}\n密文\n{}\n解密\n{}\n总体\n{}",
                        JSONUtil.toJsonPrettyStr(form),
                        sid1SingleBillingResponseBody.getENCMSG(),
                        JSONUtil.toJsonStr(sid1SingleBillingResponseBody.getEncmsgVo()),
                        JSONUtil.toJsonPrettyStr(sid1SingleBillingResponseBody)
                );

                SID1SingleBillingResponseBodyEncmsgVo response = sid1SingleBillingResponseBody.getEncmsgVo();

//                SzhtxxElectronicInvoiceResponseCodeEnum.SUCCESS.getReturnCode()

                // 正常情况
                if (ObjectUtil.isNotNull(response)
                        && "4011".equals(response.getReturnCode())) {

                    // 记录
                    szhtxxPaperInvoiceFptxxSID1SingleBillingProcessService.recordSID1SingleBillingResponse(
                            form,
                            sid1SingleBillingResponseBody,
                            loginSysUser
                    );

                    InvoiceApply forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice = new InvoiceApply();

                    forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setId(invoiceApplyCustomerEntity.getId());

                    // TODO 更新状态逻辑...
                    // mark by linjinyu at 20220426
//【2. 积分结算-2.2 发票申请管理-2.2.4 【操作项】-已整理-20220406】
//https://www.tapd.cn/33003868/prong/stories/view/1133003868001004185
//注：目前“深圳航信纸质发票，只接入了“纸质专用发票”的发票种类开票”，暂未接入“纸质普通发票”开票，未来接入后再另行需求安排。
//（1）若提交深圳航信纸质发票（SOAP）开票，返回开票成功：
//·第三方返回开票数据除“上一张发票代码/发票号码/发票种类”字段无需存储，其他需存储，ofd的下载地址和预览地址技术自定是否存储；
//·该开票申请的申请状态变更为“待领票”，开票状态变更为“已开票”；
//·该开票申请下所有流水的开票状态变更为“已开票”；
//·该开票申请的开票人和时间记录为当前操作人姓名和时间；


                    /**************************************** 逻辑 start ****************************************/

                    forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setInvoiceStatus(InvoiceApplyCustomerInvoiceProgressingStatusEnum.待领票.getKey());
                    forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setInvoiceProgressingUserId(loginSysUser.getSysUserId());
                    forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setInvoiceProgressingTime(nowDate);

                    forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setMakeInvoiceStatus(InvoiceApplyCustomerMakeInvoiceStatusEnum.已开票.getKey());
                    forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setMakeInvoiceUserId(loginSysUser.getSysUserId());
                    forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setMakeInvoiceTime(nowDate);

                    /**************************************** 逻辑    end ****************************************/


//                    forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setReceiveInvoiceStatus(InvoiceApplyCustomerReceiveInvoiceStatusEnum.未领票.getKey());
//                    forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setReceiveInvoiceUserId(loginSysUser.getSysUserId());
//                    forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setReceiveInvoiceTime(nowDate);
                    forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setInvoiceNumber(response.getInfoNumber());// ---- 开具的发票号码

//                    forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setMailTickStatus(InvoiceApplyCustomerMailTickStatusEnum.未寄票.getKey());
//                    forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setMailTickUserId(loginSysUser.getSysUserId());
//                    forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setMailTickTime(nowDate);

                    forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setUpdateUserId(loginSysUser.getSysUserId());
                    forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setUpdateTime(nowDate);

                    invoiceApplyCustomerService.updateInvoiceApplyByPrimaryKeySelective(forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice);


                    /**************************************** 要不要在这做部分 start ****************************************/

                    // 更新 流水's 开票状态
                    // TODO InvoiceTypeMoudelXModeEnum invoiceModeEnum


                    // 从 op发起开票 -> 深圳航息电子票 returnCode = 0000 -> ... -> 待回款
                    List<Long> processUnifiedOrderCreditIds = invoiceApplyXGoodsService.findCreditSetByInvoicApplyId(invoiceApplyCustomerEntity.getId());
                    unifiedOrderCreditService.updateFieldInvoiceMakeStatusByUnifiedOrderCreditIds(processUnifiedOrderCreditIds, UnifiedOrderCreditInvoiceMakeStatusEnum.已开票);


                    /**************************************** 触发事件点 start ****************************************/

                    // 触发事件点;集采账单状态推送 #此处只是触点，触点背后会有逻辑判定要不要调用~集采的接口 特此说明# at 20220616
                    // 1.来源于“企业商城”的开票申请在**发起开票成功时**：若该对账单的申请状态为“全部申请”**&**所有有效的开票申请的申请状态均为“待回款”时
                    // 2.来源于“企业商城”的对账单在**“积分结算-发票管理-【运营寄票】”成功时**：若该对账单的申请状态为“全部申请”**&**所有有效的开票申请的申请状态均为“待回款”时；
                    qchjcStatementEventPublisher.customerStatementEventMakeInvoiceStatusSync(
                            QchjcCustomerStatementEvent
                                    .builder()
                                    .msg("积分结算v2.3-发票申请管理-op发起开票-op确认发起(发票种类::纸质专用发票)(开票方式::深圳航信纸质票)")

                                    .singleStructVo(
                                            QchjcCustomerStatementEventSingleStructVo
                                                    .builder()
                                                    .accountingOrderId(0L)
                                                    .accountingOrderSn("")

                                                    .invoiceApplyId(invoiceApplyCustomerEntity.getId())
                                                    .invoiceApplySn(invoiceApplyCustomerEntity.getInvoiceApplySn())
                                                    .build()
                                    )


                                    .loginSysUser(JSONUtil.toJsonStr(loginSysUser))
                                    .touchTime(nowDate)

                                    .build()
                    );

                    /**************************************** 触发事件点 start ****************************************/


                    /**************************************** 要不要在这做部分   end ****************************************/


                    return SysNotify.builder()
                            .title(response.getReturnCode())
                            .content(response.getReturnMsg())
//									.messageBody(response.getReturnMsg())
                            .build();
                }
                // 异常情况
                else {
                    return SysNotify.builder()
                            .title(response.getReturnCode())
                            .content(response.getReturnMsg())
//									.messageBody(response.getReturnMsg())
                            .build();
                }


            case 纸质普通发票:
                return SysNotify.builder()
                        .title("0001")
                        .content("该发票种类[纸质普通发票]无此开票方式")
                        .build();
            case 电子专用发票:
                return SysNotify.builder()
                        .title("0001")
                        .content("该发票种类[电子专用发票]无此开票方式")
                        .build();
            default:
                return SysNotify.builder()
                        .title("0001")
                        .content("该发票种类[]无此开票方式")
                        .build();
        }

    }


    /**************************************** 纸质专用发票-深圳航信纸质发票 start ****************************************/

    /**
     * op发起开票(纸质专用发票)(深圳航信纸质票)
     * 时机 - 预览与给前端提供调用 深圳航信纸质票 接口
     *
     * @param form
     * @param entity
     * @param loginSysUser
     * @return
     */
    @Override
    public SID1SingleBillingRequestBody opOngoingInvoiceTypeEq2InvoiceModeEqSzhtxxPaperInvoiceRequest(
            SzhtxxInvoiceFptxxOpSingleBillingForm form,
            InvoiceApply entity,
            LoginSysUser loginSysUser) {

        String batchId = snowflake.nextIdStr();

        SingleBillingRequestBodyKpContent singleBillingRequestBodyKpContent = invoiceApplyCustomerFieldMakeInvoiceStatusOpOngoingSzhtxxElectronicInvoiceService
                .opOngoingInvoiceTypeEq1InvoiceModeEqSzhtxxElectronicInvoice(
                        SzhtxxInvoiceFptxxOpSingleBillingForm
                                .builder()
                                .formState(form.getFormState())
                                .build(),
                        entity,
                        loginSysUser
                );

        /**************************************** 转换 start ****************************************/

        List<SingleBillingRequestBodyKpContentXmxxItemVo> xmxx = singleBillingRequestBodyKpContent.getXmxx();

        List<SID1SingleBillingRequestBodyKpContentXmxxItemVo> invoiceItems = new ArrayList<>();

        xmxx.forEach(item -> {

            invoiceItems.add(
                    SID1SingleBillingRequestBodyKpContentXmxxItemVo
                            .builder()

                            .xmmc(item.getXmmc())
                            .xmdw(item.getXmdw())
                            .ggxh(item.getGgxh())
                            .hsbz(item.getHsbz())
                            .yhzcbs(item.getYhzcbs())
                            .fphxz(item.getFphxz())
                            .lslbs(item.getLslbs())
//                            .zzstsgl: 增值税特殊管理;--深圳航信电子票-产物-深圳航信纸质票-没有
                            .xmsl(item.getXmsl())
                            .xmdj(item.getXmdj())
                            .kce(item.getKce())
                            .xmje(item.getXmje())
                            .se(item.getSe())
                            .spbm(item.getSpbm())
                            .sl(item.getSl())

                            .build()
            );
        });

        SingleBillingRequestBodyKpContentFptxxVo fptxxE = singleBillingRequestBodyKpContent.getFptxx();

        SID1SingleBillingRequestBodyKpContentFptxxVo fptxxP = SID1SingleBillingRequestBodyKpContentFptxxVo
                .builder()
                .fpqqlsh(fptxxE.getFpqqlsh())
                .dkbz(fptxxE.getDkbz())

                .fjh(fptxxE.getFjh()) // : 分机号--深圳航信电子票-产物-深圳航信纸质票-没有
                .xhfmc(fptxxE.getXhfmc()) // : 销货方名称--深圳航信电子票-产物-深圳航信纸质票-没有

                .xhfNsrsbh(fptxxE.getXhfNsrsbh())
                .xhfYhzh(fptxxE.getXhfYhzh())
                .xhfDzdh(fptxxE.getXhfDzdh())

                .ghfmc(fptxxE.getGhfmc())
                .ghfNsrsbh(fptxxE.getGhfNsrsbh())
                .ghfYhzh(fptxxE.getGhfYhzh())
                .ghfDzdh(fptxxE.getGhfDzdh())

                .ghfqylx(fptxxE.getGhfqylx()) // : 购货方企业类型;--深圳航信电子票-产物-深圳航信纸质票-没有

                .kpy(fptxxE.getKpy())
                .sky(fptxxE.getSky())
                .fhr(fptxxE.getFhr())

//                .billSentSign(fptxxE.getBillSentSign()) // : 交付标志--深圳航信电子票-产物-深圳航信纸质票-没有 SzhtxxElectronicInvoiceFptxxBillSentSignEnum
                .billSentSign(AnStringUtils.getString(SzhtxxElectronicInvoiceFptxxBillSentSignEnum.不交付.getKey())) // : 交付标志--深圳航信电子票-产物-深圳航信纸质票-没有 SzhtxxElectronicInvoiceFptxxBillSentSignEnum

                .qdBz(fptxxE.getQdBz())

                .qdxmmc(fptxxE.getQdxmmc()) // : 清单项目名称--深圳航信电子票-产物-深圳航信纸质票-没有
                .kplx(fptxxE.getKplx()) // : 开票类型--深圳航信电子票-产物-深圳航信纸质票-没有
                .yfpDm(fptxxE.getYfpDm()) // : 原发票代码--深圳航信电子票-产物-深圳航信纸质票-没有
                .yfpHm(fptxxE.getYfpHm()) // : 原发票号码--深圳航信电子票-产物-深圳航信纸质票-没有

                .kphjje(fptxxE.getKphjje()) // : 价税合计--深圳航信电子票-产物-深圳航信纸质票-没有
                .hjbhsje(fptxxE.getHjbhsje()) // : 合计不含税金额--深圳航信电子票-产物-深圳航信纸质票-没有
                .hjse(fptxxE.getHjse()) // : 合计税额--深圳航信电子票-产物-深圳航信纸质票-没有

                .bz(fptxxE.getBz())

//                .invoiceType(fptxxE.getInvoiceType())
                .invoiceType(SzhtxxElectronicInvoiceFptxxInvoiceTypeEnum.专票.getKey())

                .invoiceItems(invoiceItems)

                .build();


        /**************************************** 转换   end ****************************************/

        SID1SingleBillingRequestBody sid1SingleBillingRequestBody = SID1SingleBillingRequestBody
                .builder()

                .SID("1")
//                .SIDParam() ---- packing() 装填
                .batchId(batchId)
                .fpqqlsh(fptxxE.getFpqqlsh())

                .fptxx(fptxxP)
                .build();

        int ret = szhtxxPaperInvoiceFptxxSID1SingleBillingProcessService.recordSID1SingleBillingRequest(form, sid1SingleBillingRequestBody, loginSysUser);

        return sid1SingleBillingRequestBody;
    }

    /**
     * op红冲开票(纸质专用发票)(深圳航信纸质票)
     * 时机 - 预览与给前端提供调用 深圳航信纸质票 接口
     *
     * @param form
     * @param entity
     * @param loginSysUser
     * @return
     */
    @Override
    public SID1SingleBillingRequestBody opOngoingInvoiceTypeEq2InvoiceModeEqSzhtxxPaperInvoiceRedWriteRequest(
            SzhtxxInvoiceFptxxOpSingleBillingForm form,
            SzhtxxElectronicInvoiceFptxxListItemVo fptxxListItemVo,
            InvoiceApply entity,
            LoginSysUser loginSysUser) {

        String batchId = snowflake.nextIdStr();
        String fpqqlshBlue = form.getFpqqlsh();

        SingleBillingRequestBodyKpContent singleBillingRequestBodyKpContent =
                invoiceApplyCustomerFieldMakeInvoiceStatusOpOngoingSzhtxxElectronicInvoiceService.opOngoingInvoiceTypeEq1InvoiceModeEqSzhtxxElectronicInvoiceRedWrite(
//                        SzhtxxInvoiceFptxxOpSingleBillingForm
//                                .builder()
//                                .formState(form.getFormState())
//                                .build(),
                        form,
                        fptxxListItemVo,
                        entity,
                        loginSysUser
                );

        /**************************************** 转换 start ****************************************/

        List<SingleBillingRequestBodyKpContentXmxxItemVo> xmxx = singleBillingRequestBodyKpContent.getXmxx();

        // 含税的项目明细
        List<SID1SingleBillingRequestBodyKpContentXmxxItemVo> invoiceItems = new ArrayList<>();
        //新增 不含税的项目明细
        List<SID1SingleBillingRequestBodyKpContentXmxxItemVo> invoiceItems2 = new ArrayList<>();
        if(8>=xmxx.size()){
            xmxx.forEach(item -> {
                BigDecimal je = NumberUtil.sub(item.getXmje(),item.getSe());
                String xmje  = je.toString();
                invoiceItems.add(
                        SID1SingleBillingRequestBodyKpContentXmxxItemVo
                                .builder()
                                // 优化20220927 纸质发票红冲时 商品单价、数量、规格、单位都为空
                                .xmmc(item.getXmmc())
                                .xmdw(item.getXmdw())
                                .ggxh(item.getGgxh())
                                .hsbz("false")
                                //.hsbz(item.getHsbz())
                                .yhzcbs(item.getYhzcbs())
                                .fphxz(item.getFphxz())
                                .lslbs(item.getLslbs())
//                            .zzstsgl: 增值税特殊管理;--深圳航信电子票-产物-深圳航信纸质票-没有
                                .xmsl(item.getXmsl())
                                .xmdj(item.getXmdj())
                                .kce(item.getKce())
                                .xmje(item.getXmje())
                                .se(item.getSe())
                                .spbm(item.getSpbm())
                                .GoodsNoVer("33.0")
                                .sl(item.getSl())
                                .build()
                );
                invoiceItems2.add(
                        SID1SingleBillingRequestBodyKpContentXmxxItemVo
                                .builder()
                                // 优化20220927 纸质发票红冲时 商品单价、数量、规格、单位都为空
                                .xmmc(item.getXmmc())
                                .hsbz("false")
                                .yhzcbs("0")
                                .fphxz("0")
                                .lslbs("")
                                .kce("")
                                .xmje(xmje)
                                .se(item.getSe())
                                .spbm("")
                                .GoodsNoVer("33.0")
                                .sl(xmxx.get(0).getSl())
                                .build()
                );
            });
        }else{

            BigDecimal xmje =   xmxx.stream().map(e->new BigDecimal(e.getXmje())).reduce(BigDecimal.ZERO,BigDecimal::add);
            BigDecimal se  =   xmxx.stream().map(e->new BigDecimal(e.getSe())).reduce(BigDecimal.ZERO,BigDecimal::add);
            BigDecimal je = NumberUtil.sub(xmje,se);
            String bhsje  = je.toString();
            invoiceItems2.add(SID1SingleBillingRequestBodyKpContentXmxxItemVo.
                    builder()
                    .xmmc("详见正数发票及清单")
                    //.hsbz(xmxx.get(0).getHsbz())
                    .hsbz("false")
                    .yhzcbs("0")
                    .fphxz("0")
                    .lslbs("")
                    .kce("")
                    .xmje(bhsje)
                    .se(se.toString())
                    .spbm("")
                    .GoodsNoVer("33.0")
                    .sl(xmxx.get(0).getSl())
                    .build());

            xmxx.forEach(item -> {
                invoiceItems.add(
                        SID1SingleBillingRequestBodyKpContentXmxxItemVo
                                .builder()
                                // 优化20220927 纸质发票红冲时 商品单价、数量、规格、单位都为空
                                .xmmc(item.getXmmc())
                                .xmdw(item.getXmdw())
                                .ggxh(item.getGgxh())
                                .hsbz("false")
                                //.hsbz(item.getHsbz())
                                .yhzcbs(item.getYhzcbs())
                                .fphxz(item.getFphxz())
                                .lslbs(item.getLslbs())
//                            .zzstsgl: 增值税特殊管理;--深圳航信电子票-产物-深圳航信纸质票-没有
                                .xmsl(item.getXmsl())
                                .xmdj(item.getXmdj())
                                .kce(item.getKce())
                                .xmje(item.getXmje())
                                .se(item.getSe())
                                .spbm(item.getSpbm())
                                .GoodsNoVer("33.0")
                                .sl(item.getSl())
                                .build()
                );
            });

        }
         // 优化20220927 对商品明细做判断如果条数大于8需要汇总明细，否则显示所有明细信息
//        if(8<xmxx.size()){
//            BigDecimal xmje =   xmxx.stream().map(e->new BigDecimal(e.getXmje())).reduce(BigDecimal.ZERO,BigDecimal::add);
//            BigDecimal se  =   xmxx.stream().map(e->new BigDecimal(e.getSe())).reduce(BigDecimal.ZERO,BigDecimal::add);
//            invoiceItems2.add(SID1SingleBillingRequestBodyKpContentXmxxItemVo.
//                    builder()
//                    .xmmc("详见正数发票及清单")
//                    //.hsbz(xmxx.get(0).getHsbz())
//                    .hsbz("false")
//                    .yhzcbs("0")
//                    .fphxz("0")
//                    .lslbs("")
//                    .kce("")
//                    .xmje(xmje.toString())
//                    .se(se.toString())
//                    .spbm("")
//                    .GoodsNoVer("33.0")
//                    .sl(xmxx.get(0).getSl())
//                    .build());
//
//            xmxx.forEach(item -> {
//                invoiceItems.add(
//                        SID1SingleBillingRequestBodyKpContentXmxxItemVo
//                                .builder()
//                                // 优化20220927 纸质发票红冲时 商品单价、数量、规格、单位都为空
//                                .xmmc(item.getXmmc())
//                                .xmdw(item.getXmdw())
//                                .ggxh(item.getGgxh())
//                                .hsbz("false")
//                                //.hsbz(item.getHsbz())
//                                .yhzcbs(item.getYhzcbs())
//                                .fphxz(item.getFphxz())
//                                .lslbs(item.getLslbs())
////                            .zzstsgl: 增值税特殊管理;--深圳航信电子票-产物-深圳航信纸质票-没有
//                                .xmsl(item.getXmsl())
//                                .xmdj(item.getXmdj())
//                                .kce(item.getKce())
//                                .xmje(item.getXmje())
//                                .se(item.getSe())
//                                .spbm(item.getSpbm())
//                                .GoodsNoVer("33.0")
//                                .sl(item.getSl())
//                                .build()
//                );
//            });
//        }
        SingleBillingRequestBodyKpContentFptxxVo fptxxE = singleBillingRequestBodyKpContent.getFptxx();

        // 优化20220927
        String memo = StrUtil.format("开具红字增值税专用发票信息表编号{}", fptxxListItemVo.getRedTaxInfoSn());
        memo = form.getReason() == null?memo:form.getReason();


        SID1SingleBillingRequestBodyKpContentFptxxVo fptxxP = SID1SingleBillingRequestBodyKpContentFptxxVo
                .builder()
                .fpqqlsh(fptxxE.getFpqqlsh())
                .dkbz(fptxxE.getDkbz())

                .fjh(fptxxE.getFjh()) // : 分机号--深圳航信电子票-产物-深圳航信纸质票-没有
                .xhfmc(fptxxE.getXhfmc()) // : 销货方名称--深圳航信电子票-产物-深圳航信纸质票-没有

                .xhfNsrsbh(fptxxE.getXhfNsrsbh())
                .xhfYhzh(fptxxE.getXhfYhzh())
                .xhfDzdh(fptxxE.getXhfDzdh())

                .ghfmc(fptxxE.getGhfmc())
                .ghfNsrsbh(fptxxE.getGhfNsrsbh())
                .ghfYhzh(fptxxE.getGhfYhzh())
                .ghfDzdh(fptxxE.getGhfDzdh())

                .ghfqylx(fptxxE.getGhfqylx()) // : 购货方企业类型;--深圳航信电子票-产物-深圳航信纸质票-没有

                .kpy(fptxxE.getKpy())
                .sky(fptxxE.getSky())
                .fhr(fptxxE.getFhr())

//                .billSentSign(fptxxE.getBillSentSign()) // : 交付标志--深圳航信电子票-产物-深圳航信纸质票-没有 SzhtxxElectronicInvoiceFptxxBillSentSignEnum
                .billSentSign(AnStringUtils.getString(SzhtxxElectronicInvoiceFptxxBillSentSignEnum.不交付.getKey())) // : 交付标志--深圳航信电子票-产物-深圳航信纸质票-没有 SzhtxxElectronicInvoiceFptxxBillSentSignEnum

                .qdBz(fptxxE.getQdBz())

                .qdxmmc(fptxxE.getQdxmmc()) // : 清单项目名称--深圳航信电子票-产物-深圳航信纸质票-没有
                .kplx(fptxxE.getKplx()) // : 开票类型--深圳航信电子票-产物-深圳航信纸质票-没有
                .yfpDm(fptxxE.getYfpDm()) // : 原发票代码--深圳航信电子票-产物-深圳航信纸质票-没有
                .yfpHm(fptxxE.getYfpHm()) // : 原发票号码--深圳航信电子票-产物-深圳航信纸质票-没有

                .kphjje(fptxxE.getKphjje()) // : 价税合计--深圳航信电子票-产物-深圳航信纸质票-没有
                .hjbhsje(fptxxE.getHjbhsje()) // : 合计不含税金额--深圳航信电子票-产物-深圳航信纸质票-没有
                .hjse(fptxxE.getHjse()) // : 合计税额--深圳航信电子票-产物-深圳航信纸质票-没有

//                .bz(fptxxE.getBz())
                // 优化20220927 取该红冲发票的备注内容，红冲时必传，同时前端会检查内容，默认内容为“开具红字增值税专用发票信息表编号xxxxxxxxx”,x取该纸质专用发票的红字信息表编号。
                //.bz(StrUtil.format("开具红字增值税专用发票信息表编号{}", fptxxListItemVo.getRedTaxInfoSn()))
                .bz(memo)

//                .invoiceType(fptxxE.getInvoiceType())
                .invoiceType(SzhtxxElectronicInvoiceFptxxInvoiceTypeEnum.专票.getKey())

                .invoiceItems(invoiceItems)
                .invoiceItems2(invoiceItems2)

                .build();


        /**************************************** 转换   end ****************************************/

        SID1SingleBillingRequestBody sid1SingleBillingRequestBody = SID1SingleBillingRequestBody
                .builder()

                .SID("1")
//                .SIDParam() ---- packing() 装填
                .batchId(batchId)
                .fpqqlsh(fptxxE.getFpqqlsh())

                .fptxx(fptxxP)
                .build();

        int ret = szhtxxPaperInvoiceFptxxSID1SingleBillingProcessService.recordSID1SingleBillingRequest(form, sid1SingleBillingRequestBody, loginSysUser);

        return sid1SingleBillingRequestBody;
    }


    /**
     * op确认开票(纸质专用发票)(深圳航信纸质票)
     *
     * @param form
     * @param entity
     * @param loginSysUser
     * @return
     */
    @Override
    public SID17SingleSelectRequestBody opCompleteInvoiceTypeEq2InvoiceModeEqSzhtxxPaperInvoiceRequest(
            SzhtxxInvoiceFptxxOpSingleSelectForm form,
            InvoiceApply entity,
            LoginSysUser loginSysUser) {

        String nowStr = DateUtil.now();
        DateTime nowDate = DateUtil.date();
        String batchId = snowflake.nextIdStr();
        String fpqqlshBlue = form.getXsdbh();

        SID17SingleSelectRequestBodyStructVo structVo = SID17SingleSelectRequestBodyStructVo
                .builder()

                /**************************************** 互斥条件 start ****************************************/

                .xsdbh(form.getXsdbh())

                /**************************************** 互斥条件 start ****************************************/

                .fpzl(form.getFpzl())
                .fpdm(form.getFpdm())
                .fphm(form.getFphm())

                /**************************************** 互斥条件 start ****************************************/

                .build();


        SID17SingleSelectRequestBody sid17SingleSelectRequestBody = SID17SingleSelectRequestBody
                .builder()

                .SID("17")
//                .SIDParam() ---- packing() 装填
                .batchId(batchId)

                .structVo(structVo)

                .build();

        szhtxxPaperInvoiceFptxxLogService.tmpLog("recordRequestForm", "SID17SingleSelect", fpqqlshBlue, batchId, JSONUtil.toJsonPrettyStr(form), nowStr);
        szhtxxPaperInvoiceFptxxLogService.tmpLog("recordRequestBody", "SID17SingleSelect", fpqqlshBlue, batchId, JSONUtil.toJsonPrettyStr(sid17SingleSelectRequestBody.packing()), nowStr);
        szhtxxPaperInvoiceFptxxLogService.tmpLog("recordRequestUser", "SID17SingleSelect", fpqqlshBlue, batchId, JSONUtil.toJsonPrettyStr(loginSysUser), nowStr);

        return sid17SingleSelectRequestBody;

    }


    /**
     * op确认开票(纸质专用发票)(深圳航信纸质票)
     * <p>
     * 时机1 -> 积分结算 > 金税盘发票 > 发票详情(纸质专用发票-深圳航信纸质发票)
     *
     * @param form
     * @param entity
     * @param loginSysUser
     * @return
     */
    @Override
    public SysNotify opCompleteInvoiceTypeEq2InvoiceModeEqSzhtxxPaperInvoiceResponse(
            SzhtxxInvoiceFptxxOpSingleSelectForm form,
            InvoiceApply entity,
            LoginSysUser loginSysUser) {

        String nowStr = DateUtil.now();
        DateTime nowDate = DateUtil.date();
        String batchId = form.getBatchId();
        String fpqqlshBlue = form.getXsdbh();


        SID17SingleSelectResponseBody sid17SingleSelectResponseBody = SID17SingleSelectResponseBody
                .builder()
                .batchId(form.getBatchId())

                .ENCMSG(form.getENCMSG())
                .build();

        szhtxxPaperInvoiceFptxxLogService.tmpLog("recordResponseForm", "SID17SingleSelect", fpqqlshBlue, batchId, JSONUtil.toJsonPrettyStr(form), nowStr);
        szhtxxPaperInvoiceFptxxLogService.tmpLog("recordResponseBody", "SID17SingleSelect", fpqqlshBlue, batchId, JSONUtil.toJsonPrettyStr(sid17SingleSelectResponseBody.unPacking()), nowStr);
        szhtxxPaperInvoiceFptxxLogService.tmpLog("recordResponseUser", "SID17SingleSelect", fpqqlshBlue, batchId, JSONUtil.toJsonPrettyStr(loginSysUser), nowStr);

        sid17SingleSelectResponseBody.unPacking();

        log.info("\n表单\n{}\n密文\n{}\n解密\n{}\n总体\n{}",
                JSONUtil.toJsonPrettyStr(form),
                sid17SingleSelectResponseBody.getENCMSG(),
                JSONUtil.toJsonStr(sid17SingleSelectResponseBody.getEncmsgVo()),
                JSONUtil.toJsonPrettyStr(sid17SingleSelectResponseBody)
        );

        SID17SingleSelectResponseBodyEncmsgVo response = sid17SingleSelectResponseBody.getEncmsgVo();

        // 正常情况
        if (ObjectUtil.isNotNull(response)
                && "0".equals(response.getReturnCode())) {

            /**
             * mark by linjinyu at 2022-07-26 16:27:23 -
             * 【2. 积分结算-2.2 发票申请管理-2.2.4 【操作项】-已整理-20220505-确认开票】
             * https://www.tapd.cn/33003868/prong/stories/view/1133003868001004185
             * ①若查询结果，第三方返回成功：
             * ·即执行“2.2.4.3.4【确认发起】”开票成功的处理逻辑；
             * ·弹窗关闭，1.5s提示“开票成功”，列表数据更新；
             */

            /**************************************** 注释 - 20220728 start ****************************************/

//            InvoiceApply forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice = new InvoiceApply();
//            forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setId(entity.getId());
//
//
//
//            /**************************************** 更新状态逻辑 start ****************************************/
//
//            // 申请状态 待开票 -> 待领票
//            forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setInvoiceStatus(InvoiceApplyCustomerInvoiceProgressingStatusEnum.待领票.getKey());
//            forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setInvoiceProgressingUserId(loginSysUser.getSysUserId());
//            forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setInvoiceProgressingTime(nowDate);
//
//            // 开票状态 开票中 -> 已开票
//            forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setMakeInvoiceStatus(InvoiceApplyCustomerMakeInvoiceStatusEnum.已开票.getKey());
//            forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setMakeInvoiceUserId(loginSysUser.getSysUserId());
//            forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setMakeInvoiceTime(nowDate);
//
//            forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setUpdateUserId(loginSysUser.getSysUserId());
//            forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setUpdateTime(nowDate);
//
//            /**************************************** 更新状态逻辑   end ****************************************/
//
//            invoiceApplyCustomerService.updateInvoiceApplyByPrimaryKeySelective(forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice);
//
////            /**************************************** 要不要在这做部分 start ****************************************/
////            // 更新 流水's 开票状态
////            // TODO InvoiceTypeMoudelXModeEnum invoiceModeEnum
////            // 从 op发起开票 -> 深圳航息电子票 returnCode = 0000 -> ... -> 待回款
////            List<Long> processUnifiedOrderCreditIds = invoiceApplyXGoodsService.findCreditSetByInvoicApplyId(entity.getId());
////            unifiedOrderCreditService.updateFieldInvoiceMakeStatusByUnifiedOrderCreditIds(processUnifiedOrderCreditIds, UnifiedOrderCreditInvoiceMakeStatusEnum.已开票);
////            /**************************************** 要不要在这做部分   end ****************************************/
//
//            return SysNotify.builder()
//                    .title(response.getReturnCode())
//                    .content("开票成功") // response.getReturnMsg()
//                    .build();
            /**************************************** 注释 - 20220728   end ****************************************/


            SzhtxxElectronicInvoiceFptxx fptxxSemi = szhtxxElectronicInvoiceFptxxService
                    .findByFpqqlshAndDeleted(entity.getInvoiceApplySn(), CommonSoftDeleteEnum.临时);

//            CIA20220727921530990592
            SID1SingleBillingResponseBodyEncmsgVo encmsgVo = SID1SingleBillingResponseBodyEncmsgVo
                    .builder()

                    .returnCode("4011")
                    .returnMsg("开票成功")

                    .sid("1")

                    .infoAmount(response.getHjbhsje())
                    .infoTaxAmount(response.getHjse())

                    .infoTypeCode(response.getFpdm())
                    .infoNumber(response.getFphm())
                    .infoDate(response.getKprq())

                    .cipher(response.getCipher())
//                    .sign() // ---- 没有
                    .checkCode(response.getCheckCode())

                    .hisInfoKind("0")
                    .hisInfoNumber("")
                    .hisInfoTypeCode("")

                    .listFlag(0)
                    .cancelFlag("0")

                    .nsrsbh(fptxxSemi.getXhfNsrsbh()) // 销售方税号
                    .kpfwqh("0")
                    .kpdh("0")

                    .deviceNo(response.getDeviceNO())

                    .ofdpreviewurl("")
                    .ofddownloadurl("")
                    .ofdstream("")

                    .build();


            String ENCMSG = "";
            try {
                String input = AnJsonUtils.toJson(encmsgVo);
                byte[] buf = input.getBytes("GBK");
                ENCMSG = StrUtil.replaceChars(Base64.encode(buf), "+", "_");
            } catch (UnsupportedEncodingException unsupportedEncodingException) {
                unsupportedEncodingException.printStackTrace();

            }


            return submitAndRecord(
                    SzhtxxInvoiceFptxxOpSingleBillingForm
                            .builder()

                            .formState(CommonFormStateEnum.提交)
                            .invoiceApplyId(entity.getId())
                            .invoiceApplySn(entity.getInvoiceApplySn())

                            .batchId(fptxxSemi.getBatchId())
                            .ENCMSG(ENCMSG)

                            .bz("")

                            .build(),
                    entity,
                    loginSysUser

            );
        } else {


            InvoiceApply forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice = new InvoiceApply();
            forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setId(entity.getId());

            /**
             * mark by linjinyu at 2022-07-26 16:27:23 -
             * 【2. 积分结算-2.2 发票申请管理-2.2.4 【操作项】-已整理-20220505-确认开票】
             * https://www.tapd.cn/33003868/prong/stories/view/1133003868001004185
             * ②若查询结果，第三方返回失败：
             * ·返回失败：1.5s提示“该开票申请未开票，请重新发起开票（第三方返回msg)”;
             * ·该开票申请的开票状态变更为“待开票”，其开票时间&开票人数据可保留；
             * ·弹窗关闭，列表数据更新；
             */

            /**************************************** 更新状态逻辑 start ****************************************/

            // 申请状态 待开票 -> 待开票
            forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setInvoiceStatus(InvoiceApplyCustomerInvoiceProgressingStatusEnum.待开票.getKey());
            forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setInvoiceProgressingUserId(loginSysUser.getSysUserId());
            forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setInvoiceProgressingTime(nowDate);

            // 开票状态 开票中 -> 待开票
            forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setMakeInvoiceStatus(InvoiceApplyCustomerMakeInvoiceStatusEnum.待开票.getKey());
            forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setMakeInvoiceUserId(loginSysUser.getSysUserId());
            forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setMakeInvoiceTime(nowDate);

            forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setUpdateUserId(loginSysUser.getSysUserId());
            forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice.setUpdateTime(nowDate);

            /**************************************** 更新状态逻辑   end ****************************************/

            invoiceApplyCustomerService.updateInvoiceApplyByPrimaryKeySelective(forUpdateInvoiceTypeEq2InvoiceModeSzhtxxPaperInvoice);

            return SysNotify.builder()
                    .title(response.getReturnCode())
                    .content(StrUtil.format("该开票申请未开票，请重新发起开票（{})", response.getReturnMsg()))
                    .build();
        }


//        "encmsgVo": {
//            "dybz": 0,
//            "fpdm": "1100192130",
//            "hjse": 0.17,
//            "deviceNO": "661101965942",
//            "fpzl": 0,
//            "xsdjbh": "CIA2022050618971904",
//            "sid": "17",
//            "returnCode": "0",
//            "returnMsg": "7011-发票查询成功 [,]",
//            "fpbszt": 0,
//            "kprq": "2022-05-06 18:42:35",
//            "hjbhsje": 2.83,
//            "CheckCode": "",
//            "Cipher": "",
//            "infoxml": "<?xml version=\"1.0\" encoding=\"GBK\"?><Info><GFMC><![CDATA[测试企业开票使用]]></GFMC><GFSH><![CDATA[65435135453224424]]></GFSH><GFDZDH><![CDATA[测试企业地址1234567890123456]]></GFDZDH><GFYHZH><![CDATA[测试企业开票使发用1234567890123456]]></GFYHZH><YYSBZ><![CDATA[0000000000]]></YYSBZ><NCPBZ><![CDATA[0]]></NCPBZ><XFMC><![CDATA[航信培训企业]]></XFMC><XFSH><![CDATA[440301999999122]]></XFSH><XFDZDH><![CDATA[深圳航信纸质票开户银行0755-861234562]]></XFDZDH><XFYHZH><![CDATA[深圳航信纸质票开户银行612031129120111]]></XFYHZH><KPR><![CDATA[金泰妍]]></KPR><FHR><![CDATA[Lalisa]]></FHR><SKR><![CDATA[张睿恩]]></SKR><KPSXH><![CDATA[28]]></KPSXH><DZSYH><![CDATA[265147]]></DZSYH><BMBBBH><![CDATA[38.0]]></BMBBBH><BZ></BZ><QDBZ><![CDATA[0]]></QDBZ><QDS></QDS><MXS><MX><SPMC><![CDATA[*物流辅助服务*运费]]></SPMC><GGXH></GGXH><SLV><![CDATA[0.06]]></SLV><JLDW><![CDATA[项]]></JLDW><SL><![CDATA[1]]></SL><DJ><![CDATA[1.00]]></DJ><HSJBZ><![CDATA[1]]></HSJBZ><FPHXZ><![CDATA[0]]></FPHXZ><JE><![CDATA[0.95]]></JE><SE><![CDATA[0.05]]></SE><FLBM><![CDATA[3040409030000000000]]></FLBM><XSYH><![CDATA[0]]></XSYH><YHSM></YHSM><LSLVBS></LSLVBS></MX><MX><SPMC><![CDATA[*物流辅助服务*运费]]></SPMC><GGXH></GGXH><SLV><![CDATA[0.06]]></SLV><JLDW><![CDATA[项]]></JLDW><SL><![CDATA[1]]></SL><DJ><![CDATA[1.00]]></DJ><HSJBZ><![CDATA[1]]></HSJBZ><FPHXZ><![CDATA[0]]></FPHXZ><JE><![CDATA[0.94]]></JE><SE><![CDATA[0.06]]></SE><FLBM><![CDATA[3040409030000000000]]></FLBM><XSYH><![CDATA[0]]></XSYH><YHSM></YHSM><LSLVBS></LSLVBS></MX><MX><SPMC><![CDATA[*物流辅助服务*运费]]></SPMC><GGXH></GGXH><SLV><![CDATA[0.06]]></SLV><JLDW><![CDATA[项]]></JLDW><SL><![CDATA[1]]></SL><DJ><![CDATA[1.00]]></DJ><HSJBZ><![CDATA[1]]></HSJBZ><FPHXZ><![CDATA[0]]></FPHXZ><JE><![CDATA[0.94]]></JE><SE><![CDATA[0.06]]></SE><FLBM><![CDATA[3040409030000000000]]></FLBM><XSYH><![CDATA[0]]></XSYH><YHSM></YHSM><LSLVBS></LSLVBS></MX></MXS></Info>",
//            "zfbz": 0,
//            "fphm": "06560189"
//        },


//        return SysNotify
//                .builder()
//                .title("7011")
//                .content("操作成功")
//                .build();

    }

    /**************************************** 纸质专用发票-深圳航信纸质发票   end ****************************************/
}
