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

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.paperInvoice.SzhtxxPaperInvoiceRedTaxInfo;
import cn.superdesk.uniorder.dto.param.thirdpart.szhtxx.paperInvoice.SzhtxxPaperInvoiceRedTaxInfoParam;
import cn.superdesk.uniorder.dto.param.thirdpart.szhtxx.paperInvoice.SzhtxxPaperInvoiceRedTaxInfoQueryCriteria;
import cn.superdesk.uniorder.dto.vo.thirdpart.szhtxx.paperInvoice.SzhtxxPaperInvoiceRedTaxInfoListItemVo;
import cn.superdesk.uniorder.dubbo.facade.thirdpart.szhtxx.paperInvoice.DubboSzhtxxPaperInvoiceRedTaxInfoService;
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-05-25 18:50:54
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022-05-25 18:50:54
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Slf4j
@Component
public class SzhtxxPaperInvoiceRedTaxInfoDubboConsumerService {

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


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

    public int insertSelective(SzhtxxPaperInvoiceRedTaxInfo entity) {

        return dubboSzhtxxPaperInvoiceRedTaxInfoService.insertSelective(entity);

    }

    public int updateByPrimaryKeySelective(SzhtxxPaperInvoiceRedTaxInfo entity) {

        return dubboSzhtxxPaperInvoiceRedTaxInfoService.updateByPrimaryKeySelective(entity);
    }

    public void deleteObj(Long id) {

        dubboSzhtxxPaperInvoiceRedTaxInfoService.deleteObj(id);
    }

    public SzhtxxPaperInvoiceRedTaxInfo findById(Long id) {

        return dubboSzhtxxPaperInvoiceRedTaxInfoService.findById(id);
    }

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

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

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

        return dubboSzhtxxPaperInvoiceRedTaxInfoService.findAll(queryMap);
    }

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


    public int addSzhtxxPaperInvoiceRedTaxInfo(SzhtxxPaperInvoiceRedTaxInfoParam param) {

        return dubboSzhtxxPaperInvoiceRedTaxInfoService.addSzhtxxPaperInvoiceRedTaxInfo(param);
    }


    public int saveOrUpdateSzhtxxPaperInvoiceRedTaxInfo(SzhtxxPaperInvoiceRedTaxInfoParam param, String token) {

        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboSzhtxxPaperInvoiceRedTaxInfoService.saveOrUpdateSzhtxxPaperInvoiceRedTaxInfo(param,loginSysUser);
    }

    public int updateSzhtxxPaperInvoiceRedTaxInfo(SzhtxxPaperInvoiceRedTaxInfoParam param) {

        return dubboSzhtxxPaperInvoiceRedTaxInfoService.updateSzhtxxPaperInvoiceRedTaxInfo(param);
    }


    public int deleteSzhtxxPaperInvoiceRedTaxInfo(Long id) {
        return dubboSzhtxxPaperInvoiceRedTaxInfoService.deleteSzhtxxPaperInvoiceRedTaxInfo(id);
    }


    public SzhtxxPaperInvoiceRedTaxInfo findSzhtxxPaperInvoiceRedTaxInfoById(Long id) {

        return dubboSzhtxxPaperInvoiceRedTaxInfoService.findSzhtxxPaperInvoiceRedTaxInfoById(id);
    }


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

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


    public R<List<SzhtxxPaperInvoiceRedTaxInfoListItemVo>> pageQueryGenericParam(SzhtxxPaperInvoiceRedTaxInfoQueryCriteria queryCriteria) {

        return dubboSzhtxxPaperInvoiceRedTaxInfoService.pageQueryGenericParam(queryCriteria);
    }
}
