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

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.common.security.JwtUtil;
import cn.superdesk.uniorder.common.security.dto.LoginSysUser;
import cn.superdesk.uniorder.dao.entity.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxxResult;
import cn.superdesk.uniorder.dto.param.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxxResultParam;
import cn.superdesk.uniorder.dto.param.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxxResultQueryCriteria;
import cn.superdesk.uniorder.dto.vo.thirdpart.szhtxx.electronicInvoice.SzhtxxElectronicInvoiceFptxxListItemVo;
import cn.superdesk.uniorder.dubbo.facade.thirdpart.szhtxx.electronicInvoice.DubboSzhtxxElectronicInvoiceFptxxResultService;
import com.alibaba.dubbo.config.annotation.Reference;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

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
 */
@Slf4j
@Component
public class SzhtxxElectronicInvoiceFptxxResultDubboConsumerService {

    @Reference(version = "1.0.0", timeout = 30000, retries = -1)
    private DubboSzhtxxElectronicInvoiceFptxxResultService dubboSzhtxxElectronicInvoiceFptxxResultService;


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

    public int insertSelective(SzhtxxElectronicInvoiceFptxxResult entity) {

        return dubboSzhtxxElectronicInvoiceFptxxResultService.insertSelective(entity);

    }

    public int updateByPrimaryKeySelective(SzhtxxElectronicInvoiceFptxxResult entity) {

        return dubboSzhtxxElectronicInvoiceFptxxResultService.updateByPrimaryKeySelective(entity);
    }

    public void deleteObj(Long id) {

        dubboSzhtxxElectronicInvoiceFptxxResultService.deleteObj(id);
    }

    public SzhtxxElectronicInvoiceFptxxResult findById(Long id) {

        return dubboSzhtxxElectronicInvoiceFptxxResultService.findById(id);
    }

    public PageInfo<SzhtxxElectronicInvoiceFptxxResult> findByPaging(Map<String, Object> conditions, Integer pageNun, Integer pageSize) {

        return dubboSzhtxxElectronicInvoiceFptxxResultService.findByPaging(conditions, pageNun, pageSize);
    }

    public List<SzhtxxElectronicInvoiceFptxxResult> findAll(Map<String, Object> queryMap) {

        return dubboSzhtxxElectronicInvoiceFptxxResultService.findAll(queryMap);
    }

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


    public void addSzhtxxElectronicInvoiceFptxxResult(SzhtxxElectronicInvoiceFptxxResultParam param) {

        dubboSzhtxxElectronicInvoiceFptxxResultService.addSzhtxxElectronicInvoiceFptxxResult(param);
    }


    public void updateSzhtxxElectronicInvoiceFptxxResult(SzhtxxElectronicInvoiceFptxxResultParam param) {

        dubboSzhtxxElectronicInvoiceFptxxResultService.updateSzhtxxElectronicInvoiceFptxxResult(param);
    }


    public void deleteSzhtxxElectronicInvoiceFptxxResult(Long id) {
        dubboSzhtxxElectronicInvoiceFptxxResultService.deleteSzhtxxElectronicInvoiceFptxxResult(id);
    }


    public SzhtxxElectronicInvoiceFptxxResult findSzhtxxElectronicInvoiceFptxxResultById(Long id) {

        return dubboSzhtxxElectronicInvoiceFptxxResultService.findSzhtxxElectronicInvoiceFptxxResultById(id);
    }

    public SzhtxxElectronicInvoiceFptxxResult findByFpqqlsh(String fpqqlsh) {

        return dubboSzhtxxElectronicInvoiceFptxxResultService.findByFpqqlsh(fpqqlsh);
    }


    public R<List<SzhtxxElectronicInvoiceFptxxResult>> pageQuery(Map<String, Object> conditions, int pageNun, int pageSize) {

        return dubboSzhtxxElectronicInvoiceFptxxResultService.pageQuery(conditions, pageNun, pageSize);
    }


    public R<List<SzhtxxElectronicInvoiceFptxxResult>> pageQueryGenericParam(SzhtxxElectronicInvoiceFptxxResultQueryCriteria queryCriteria) {

        return dubboSzhtxxElectronicInvoiceFptxxResultService.pageQueryGenericParam(queryCriteria);
    }


    /****************************************** biz start ******************************************/

    /**
     * op转存-通过发票请求唯一流水号转存发票Pdf
     *
     * @param fpqqlsh
     * @param token
     */
    public int savedPdfUrl(String fpqqlsh, String token) {

        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxElectronicInvoiceFptxxResultService.savedPdfUrl(fpqqlsh, loginSysUser);
    }

    public int callServiceSzhtxxElectronicInvoiceApiBatchQuery(List<SzhtxxElectronicInvoiceFptxxListItemVo> fptxxListItemVoList, String token) {

        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxElectronicInvoiceFptxxResultService.callServiceSzhtxxElectronicInvoiceApiBatchQuery(fptxxListItemVoList, loginSysUser);
    }

    public int entryFileNotFoundPdfSingleTime(SzhtxxElectronicInvoiceFptxxListItemVo listItemVo, String token) {

        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxElectronicInvoiceFptxxResultService.entryFileNotFoundPdfSingleTime(listItemVo, loginSysUser);
    }

    public int entryFileNotFoundPdf(List<SzhtxxElectronicInvoiceFptxxListItemVo> fptxxListItemVoList, String token) {

        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxElectronicInvoiceFptxxResultService.entryFileNotFoundPdf(fptxxListItemVoList, loginSysUser);
    }
}
