package cn.superdesk.uniorder.service.thirdpart.szhtxx.electronicInvoice;

import cn.superdesk.uniorder.common.enums.common.CommonSoftDeleteEnum;
import cn.superdesk.uniorder.common.rest.response.R;
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.dao.entity.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxx;
import cn.superdesk.uniorder.dto.param.thirdpart.szhtxx.common.singleBilling.SzhtxxInvoiceFptxxOpSingleBillingForm;
import cn.superdesk.uniorder.dto.param.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxxOpSendEmailPdfAttachmentForm;
import cn.superdesk.uniorder.dto.param.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxxQueryCriteria;
import cn.superdesk.uniorder.dto.vo.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxxDetailVo;
import cn.superdesk.uniorder.dto.vo.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxxHeadDataVo;
import cn.superdesk.uniorder.dto.vo.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxxListItemVo;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.electronicInvoice.dto.request.SingleBillingRequestBodyKpContent;
import cn.superdesk.uniorder.openapicall.thirdpart.szhtxx.electronicInvoice.dto.response.SingleBillingResponse;
import cn.superdesk.uniorder.service.base.BaseService;
import com.github.pagehelper.PageInfo;

import java.util.List;
import java.util.Map;


/**
 * @Description:
 * @Author: linjinyu
 * @Email linjinyu@avic-s.com
 * @CreateDate: 2022-01-24 11:50:43
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022-01-24 11:50:43
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public interface SzhtxxElectronicInvoiceFptxxService extends BaseService<SzhtxxElectronicInvoiceFptxx> {


    /****************************************** extends BaseService 部分 start ******************************************/

    int insertSelective(SzhtxxElectronicInvoiceFptxx entity);

    int updateByPrimaryKeySelective(SzhtxxElectronicInvoiceFptxx entity);

    @Deprecated
    void deleteObj(Long id);

    @Deprecated
    SzhtxxElectronicInvoiceFptxx findById(Long id);

    @Deprecated
    PageInfo<SzhtxxElectronicInvoiceFptxx> findByPaging(Map<String, Object> conditions, Integer pageNun, Integer pageSize);

    @Deprecated
    List<SzhtxxElectronicInvoiceFptxx> findAll(Map<String, Object> queryMap);

    /****************************************** extends BaseService 部分   end ******************************************/


    int addSzhtxxElectronicInvoiceFptxx(SzhtxxElectronicInvoiceFptxx entity);

    int updateSzhtxxElectronicInvoiceFptxx(SzhtxxElectronicInvoiceFptxx entity);

    int updateSzhtxxElectronicInvoiceFptxxByPrimaryKeySelective(SzhtxxElectronicInvoiceFptxx entity);

    int opUpdateLogicalTemp2Normal(String batchId, String fpqqlsh, LoginSysUser loginSysUser);

    int deleteSzhtxxElectronicInvoiceFptxx(Long id);

    SzhtxxElectronicInvoiceFptxx findSzhtxxElectronicInvoiceFptxxById(Long id);

    SzhtxxElectronicInvoiceFptxx findByFpqqlsh(String fpqqlsh);

    SzhtxxElectronicInvoiceFptxx findByFpqqlshAndDeleted(String fpqqlsh, CommonSoftDeleteEnum commonSoftDeleteEnum);

    SzhtxxElectronicInvoiceFptxx findByFpqqlshAndBatchId(String fpqqlsh, String batchId);

    R<List<SzhtxxElectronicInvoiceFptxx>> pageQuery(Map<String, Object> conditions, int pageNun, int pageSize);

    R<List<SzhtxxElectronicInvoiceFptxxListItemVo>> pageQueryGenericParam(SzhtxxElectronicInvoiceFptxxQueryCriteria criteria, LoginSysUser loginSysUser);

    List<SzhtxxElectronicInvoiceFptxxListItemVo> queryGenericParam(SzhtxxElectronicInvoiceFptxxQueryCriteria queryCriteria, LoginSysUser loginSysUser);

    SzhtxxElectronicInvoiceFptxxListItemVo queryOneByFpqqlsh(String fpqqlsh, LoginSysUser loginSysUser);

    SzhtxxElectronicInvoiceFptxxHeadDataVo headDataGenericParam(SzhtxxElectronicInvoiceFptxxQueryCriteria queryCriteria, LoginSysUser loginSysUser);

    SzhtxxElectronicInvoiceFptxxDetailVo detailGenericParam(SzhtxxElectronicInvoiceFptxxQueryCriteria queryCriteria, LoginSysUser loginSysUser);

    /****************************************** 记录 start ******************************************/

    void record(SzhtxxInvoiceFptxxOpSingleBillingForm form, SingleBillingRequestBodyKpContent kpContent, SingleBillingResponse response, LoginSysUser loginSysUser);

    /****************************************** 记录 start ******************************************/

    /**************************************** 发票申请管理-发起-op发起开票(电子普通发票)(深圳航信电子票) start ****************************************/

    // @link InvoiceApplyCustomerFieldMakeInvoiceStatusOpOngoingSzhtxxElectronicInvoiceServiceImpl

    /**************************************** 发票申请管理-发起-op发起开票(电子普通发票)(深圳航信电子票)   end ****************************************/


    /**************************************** 金税盘页面-发起-op红冲发票(电子普通发票)(深圳航信电子票) start ****************************************/

    /**
     * op发起红冲
     * 在上一层已经实现
     *
     * @param form
     * @param loginSysUser
     * @return
     */
//    @Deprecated
//    SingleBillingRequestBodyKpContent opRedWritePre(SzhtxxInvoiceFptxxOpSingleBillingForm form, LoginSysUser loginSysUser);

    /**
     * op确认红冲 -- 目前逻辑在这 --
     * 要提升一层
     *
     * @param form
     * @param fptxxListItemVo
     * @param invoiceApplyEntity
     * @param loginSysUser
     * @return
     */
    SysNotify opRedWrite(SzhtxxInvoiceFptxxOpSingleBillingForm form, SzhtxxElectronicInvoiceFptxxListItemVo fptxxListItemVo, InvoiceApply invoiceApplyEntity, LoginSysUser loginSysUser);

    /**************************************** 金税盘页面-发起-op红冲发票(电子普通发票)(深圳航信电子票)   end ****************************************/


    /**************************************** 调用深圳航信电子票 start ****************************************/

    SysNotify callDeliverApi(SzhtxxElectronicInvoiceFptxxOpSendEmailPdfAttachmentForm form, SzhtxxElectronicInvoiceFptxxListItemVo fptxxListItemVo, LoginSysUser loginSysUser);

    SysNotify callTaxInfoApi(String nsrsbh, LoginSysUser loginSysUser);

    /**************************************** 调用深圳航信电子票   end ****************************************/

}
