package cn.superdesk.uniorder.dubbo.consumer.invoice.common;

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.invoice.common.InvoiceTypeModeConfigSzhtxxPaperInvoice;
import cn.superdesk.uniorder.dto.param.invoice.common.InvoiceTypeModeConfigSzhtxxPaperInvoiceParam;
import cn.superdesk.uniorder.dto.param.invoice.common.InvoiceTypeModeConfigSzhtxxPaperInvoiceQueryCriteria;
import cn.superdesk.uniorder.dubbo.facade.invoice.common.DubboInvoiceTypeModeConfigSzhtxxPaperInvoiceService;
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-04-22 10:22:57
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022-04-22 10:22:57
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Slf4j
@Component
public class InvoiceTypeModeConfigSzhtxxPaperInvoiceDubboConsumerService {

    @Reference(version = "1.0.0", timeout = 10000, retries = -1)
    private DubboInvoiceTypeModeConfigSzhtxxPaperInvoiceService dubboInvoiceTypeModeConfigSzhtxxPaperInvoiceService;


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

    public void addObj(InvoiceTypeModeConfigSzhtxxPaperInvoiceParam param) {

        dubboInvoiceTypeModeConfigSzhtxxPaperInvoiceService.addObj(param);

    }

    public void updateObj(InvoiceTypeModeConfigSzhtxxPaperInvoiceParam param) {

        dubboInvoiceTypeModeConfigSzhtxxPaperInvoiceService.updateObj(param);
    }

    public void deleteObj(Long id) {

        dubboInvoiceTypeModeConfigSzhtxxPaperInvoiceService.deleteObj(id);
    }

    public InvoiceTypeModeConfigSzhtxxPaperInvoice findById(Long id) {

        return dubboInvoiceTypeModeConfigSzhtxxPaperInvoiceService.findById(id);
    }

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

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

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

        return dubboInvoiceTypeModeConfigSzhtxxPaperInvoiceService.findAll(queryMap);
    }

    /****************************************** extends BaseService 部分   end
     * @return******************************************/


    public int addInvoiceTypeModeConfigSzhtxxPaperInvoice(InvoiceTypeModeConfigSzhtxxPaperInvoiceParam param, String token) {

        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboInvoiceTypeModeConfigSzhtxxPaperInvoiceService.addInvoiceTypeModeConfigSzhtxxPaperInvoice(param, loginSysUser);
    }


    public int updateInvoiceTypeModeConfigSzhtxxPaperInvoice(InvoiceTypeModeConfigSzhtxxPaperInvoiceParam param, String token) {

        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboInvoiceTypeModeConfigSzhtxxPaperInvoiceService.updateInvoiceTypeModeConfigSzhtxxPaperInvoice(param, loginSysUser);
    }


    public int deleteInvoiceTypeModeConfigSzhtxxPaperInvoice(Long id, String token) {

        LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

        return dubboInvoiceTypeModeConfigSzhtxxPaperInvoiceService.deleteInvoiceTypeModeConfigSzhtxxPaperInvoice(id, loginSysUser);
    }


    public InvoiceTypeModeConfigSzhtxxPaperInvoice findInvoiceTypeModeConfigSzhtxxPaperInvoiceById(Long id) {

        return dubboInvoiceTypeModeConfigSzhtxxPaperInvoiceService.findInvoiceTypeModeConfigSzhtxxPaperInvoiceById(id);
    }


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

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


    public R<List<InvoiceTypeModeConfigSzhtxxPaperInvoice>> pageQueryGenericParam(InvoiceTypeModeConfigSzhtxxPaperInvoiceQueryCriteria queryCriteria) {

        return dubboInvoiceTypeModeConfigSzhtxxPaperInvoiceService.pageQueryGenericParam(queryCriteria);
    }
}
