package cn.superdesk.uniorder.dubbo.consumer.thirdpart.szhtxx.paperInvoice;

import cn.superdesk.uniorder.common.security.JwtUtil;
import cn.superdesk.uniorder.common.security.dto.LoginSysUser;
import cn.superdesk.uniorder.dao.entity.invoice.customer.InvoiceApply;
import cn.superdesk.uniorder.dao.entity.sys.notify.SysNotify;
import cn.superdesk.uniorder.dto.param.thirdpart.szhtxx.common.becomeInvalid.SzhtxxInvoiceFptxxOpBecomeInvalidForm;
import cn.superdesk.uniorder.dto.param.thirdpart.szhtxx.common.redBitchLlq.SzhtxxInvoiceFptxxOpRedLowerWorkLlqForm;
import cn.superdesk.uniorder.dto.param.thirdpart.szhtxx.common.singleBilling.SzhtxxInvoiceFptxxOpSingleBillingForm;
import cn.superdesk.uniorder.dto.param.thirdpart.szhtxx.common.taxDeviceInfo.SzhtxxPaperInvoiceOpTaxDeviceInfoForm;
import cn.superdesk.uniorder.dto.param.thirdpart.szhtxx.common.taxInfo.SzhtxxPaperInvoiceOpTaxInfoForm;
import cn.superdesk.uniorder.dto.vo.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxxListItemVo;
import cn.superdesk.uniorder.dubbo.facade.thirdpart.szhtxx.electronicInvoice.DubboSzhtxxElectronicInvoiceFptxxService;
import cn.superdesk.uniorder.dubbo.facade.thirdpart.szhtxx.paperInvoice.DubboSzhtxxPaperInvoiceFptxxService;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.paperInvoice.dto.request.SID121TaxInfo.SID121TaxInfoRequestBody;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.paperInvoice.dto.request.SID1SingleBilling.SID1SingleBillingRequestBody;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.paperInvoice.dto.request.SID20BitchLlq.SID20BitchLlqRequestBody;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.paperInvoice.dto.request.SID25TaxDeviceInfo.SID25TaxDeviceInfoRequestBody;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.paperInvoice.dto.request.SID4ToInvalid.SID4ToInvalidRequestBody;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.paperInvoice.dto.request.SID5SelectBillInfo.SID5SelectBillInfoRequestBody;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.paperInvoice.dto.response.SID25TaxDeviceInfo.SID25TaxDeviceInfoResponseBody;
import com.alibaba.dubbo.config.annotation.Reference;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @Description: Java类作用描述
 * @Author: linjinyu
 * @CreateDate: 2022/4/27 2:11 下午
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022/4/27 2:11 下午
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Slf4j
@Component
public class SzhtxxPaperInvoiceFptxxDubboConsumerService {


    @Reference(version = "1.0.0", timeout = 60000, retries = -1)
    private DubboSzhtxxElectronicInvoiceFptxxService dubboSzhtxxElectronicInvoiceFptxxService;

    @Reference(version = "1.0.0", timeout = 60000, retries = -1)
    private DubboSzhtxxPaperInvoiceFptxxService dubboSzhtxxPaperInvoiceFptxxService;

    /**************************************** op红冲发票 start ****************************************/

    public SID1SingleBillingRequestBody opRedWriteRequest(
            SzhtxxInvoiceFptxxOpSingleBillingForm form,
            SzhtxxElectronicInvoiceFptxxListItemVo fptxxListItemVo,
            InvoiceApply entity,
            String token) {

        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxPaperInvoiceFptxxService.opRedWriteRequest(form, fptxxListItemVo, entity, loginSysUser);

    }

    public SysNotify opRedWriteResponse(
            SzhtxxInvoiceFptxxOpSingleBillingForm form,
            SzhtxxElectronicInvoiceFptxxListItemVo fptxxListItemVo,
            InvoiceApply entity,
            String token) {

        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxPaperInvoiceFptxxService.opRedWriteResponse(form, fptxxListItemVo, entity, loginSysUser);

    }

    /**************************************** op红冲发票   end ****************************************/

    /**************************************** op申请红字信息表编号-op确认申请(纸质专用发票)(深圳航信纸质票) start ****************************************/

    public SID20BitchLlqRequestBody opRedBitchLlqRequest(
            SzhtxxInvoiceFptxxOpSingleBillingForm form,
            SzhtxxElectronicInvoiceFptxxListItemVo fptxxListItemVo,
            InvoiceApply entity,
            String token) {

        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxPaperInvoiceFptxxService.opRedBitchLlqRequest(form, fptxxListItemVo, entity, loginSysUser);

    }

    public SysNotify opRedBitchLlqResponse(
            SzhtxxInvoiceFptxxOpSingleBillingForm form,
            SzhtxxElectronicInvoiceFptxxListItemVo fptxxListItemVo,
            InvoiceApply entity,
            String token) {

        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxPaperInvoiceFptxxService.opRedBitchLlqResponse(form, fptxxListItemVo, entity, loginSysUser);

    }

    /**************************************** op申请红字信息表编号-op确认申请(纸质专用发票)(深圳航信纸质票)   end ****************************************/

    /**************************************** op下载红字信息表编号-op确认下载(纸质专用发票)(深圳航信纸质票) start ****************************************/

    public SID20BitchLlqRequestBody opRedLowerWorkLlqRequest(
            SzhtxxInvoiceFptxxOpRedLowerWorkLlqForm form,
            String token) {

        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxPaperInvoiceFptxxService.opRedLowerWorkLlqRequest(form, loginSysUser);

    }

    public SysNotify opRedLowerWorkLlqResponse(
            SzhtxxInvoiceFptxxOpRedLowerWorkLlqForm form,
            String token) {

        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxPaperInvoiceFptxxService.opRedLowerWorkLlqResponse(form, loginSysUser);

    }

    /**************************************** op下载红字信息表编号-op确认下载(纸质专用发票)(深圳航信纸质票)   end ****************************************/



    /**************************************** op作废发票 start ****************************************/

    public SID4ToInvalidRequestBody opBecomeInvalidRequest(
            SzhtxxInvoiceFptxxOpBecomeInvalidForm form,
            SzhtxxElectronicInvoiceFptxxListItemVo fptxxListItemVo,
            InvoiceApply entity,
            String token) {

        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxPaperInvoiceFptxxService.opBecomeInvalidRequest(form, fptxxListItemVo, entity, loginSysUser);

    }

    public SysNotify opBecomeInvalidResponse(
            SzhtxxInvoiceFptxxOpBecomeInvalidForm form,
            SzhtxxElectronicInvoiceFptxxListItemVo fptxxListItemVo,
            InvoiceApply entity,
            String token) {

        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxPaperInvoiceFptxxService.opBecomeInvalidResponse(form, fptxxListItemVo, entity, loginSysUser);

    }

    /**************************************** op作废发票   end ****************************************/



    /**************************************** 金税盘页面-发起-op发票作废状态修复(纸质专用发票)(深圳航信纸质票) start ****************************************/

    public SID5SelectBillInfoRequestBody opBecomeInvalidFakeRequest(
            SzhtxxInvoiceFptxxOpBecomeInvalidForm form,
            SzhtxxElectronicInvoiceFptxxListItemVo fptxxListItemVo,
            InvoiceApply invoiceApplyEntity,
            String token) {

        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxPaperInvoiceFptxxService.opBecomeInvalidFakeRequest(form, fptxxListItemVo, invoiceApplyEntity, loginSysUser);

    }

    public SysNotify opBecomeInvalidFakeResponse(
            SzhtxxInvoiceFptxxOpBecomeInvalidForm form,
            SzhtxxElectronicInvoiceFptxxListItemVo fptxxListItemVo,
            InvoiceApply invoiceApplyEntity,
            String token) {

        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxPaperInvoiceFptxxService.opBecomeInvalidFakeResponse(form, fptxxListItemVo, invoiceApplyEntity, loginSysUser);

    }

    /**************************************** 金税盘页面-发起-op发票作废状态修复(纸质专用发票)(深圳航信纸质票)   end ****************************************/







    /**************************************** 10. 获取金税盘状态接口 SID=121 start ****************************************/

    public SID121TaxInfoRequestBody opCallTaxInfoApiRequest(SzhtxxPaperInvoiceOpTaxInfoForm form, String token) {
        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxPaperInvoiceFptxxService.opCallTaxInfoApiRequest(form, loginSysUser);
    }

    public SysNotify opCallTaxInfoApiResponse(SzhtxxPaperInvoiceOpTaxInfoForm form, String token) {
        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxPaperInvoiceFptxxService.opCallTaxInfoApiResponse(form, loginSysUser);
    }

    /**************************************** 10. 获取金税盘状态接口 SID=121   end ****************************************/

    /**************************************** 17. 金税设备查询 SID=25 start ****************************************/

    public SID25TaxDeviceInfoRequestBody opCallTaxDeviceInfoApiRequest(SzhtxxPaperInvoiceOpTaxDeviceInfoForm form, String token) {
        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxPaperInvoiceFptxxService.opCallTaxDeviceInfoApiRequest(form, loginSysUser);
    }

    public SID25TaxDeviceInfoResponseBody opCallTaxDeviceInfoApiResponse(SzhtxxPaperInvoiceOpTaxDeviceInfoForm form, String token) {
        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxPaperInvoiceFptxxService.opCallTaxDeviceInfoApiResponse(form, loginSysUser);
    }

    /**************************************** 17. 金税设备查询 SID=25   end ****************************************/


}
