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.InvoiceTypeModeConfigSzhtxxElectronicInvoice;
import cn.superdesk.uniorder.dto.param.invoice.common.InvoiceTypeModeConfigSzhtxxElectronicInvoiceParam;
import cn.superdesk.uniorder.dto.param.invoice.common.InvoiceTypeModeConfigSzhtxxElectronicInvoiceQueryCriteria;
import cn.superdesk.uniorder.dubbo.facade.invoice.common.DubboInvoiceTypeModeConfigSzhtxxElectronicInvoiceService;
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-02-10 17:46:12
 * @UpdateUser: linjinyu
 * @UpdateDate: 2022-02-10 17:46:12
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Slf4j
@Component
public class InvoiceTypeModeConfigSzhtxxElectronicInvoiceDubboConsumerService {

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


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

	public void addObj(InvoiceTypeModeConfigSzhtxxElectronicInvoiceParam param) {

		dubboInvoiceTypeModeConfigSzhtxxElectronicInvoiceService.addObj(param);

	}

	public void updateObj(InvoiceTypeModeConfigSzhtxxElectronicInvoiceParam param) {

		dubboInvoiceTypeModeConfigSzhtxxElectronicInvoiceService.updateObj(param);
	}

	public void deleteObj(Long id) {

		dubboInvoiceTypeModeConfigSzhtxxElectronicInvoiceService.deleteObj(id);
	}

	public InvoiceTypeModeConfigSzhtxxElectronicInvoice findById(Long id) {

		return dubboInvoiceTypeModeConfigSzhtxxElectronicInvoiceService.findById(id);
	}

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

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

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

		return dubboInvoiceTypeModeConfigSzhtxxElectronicInvoiceService.findAll(queryMap);
	}

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


	public int addInvoiceTypeModeConfigSzhtxxElectronicInvoice(InvoiceTypeModeConfigSzhtxxElectronicInvoiceParam param, String token) {
		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);
		return dubboInvoiceTypeModeConfigSzhtxxElectronicInvoiceService.addInvoiceTypeModeConfigSzhtxxElectronicInvoice(param, loginSysUser);
	}


	public int updateInvoiceTypeModeConfigSzhtxxElectronicInvoice(InvoiceTypeModeConfigSzhtxxElectronicInvoiceParam param, String token) {
		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);
		return dubboInvoiceTypeModeConfigSzhtxxElectronicInvoiceService.updateInvoiceTypeModeConfigSzhtxxElectronicInvoice(param, loginSysUser);
	}


	public int deleteInvoiceTypeModeConfigSzhtxxElectronicInvoice(Long id, String token) {
		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);
		return dubboInvoiceTypeModeConfigSzhtxxElectronicInvoiceService.deleteInvoiceTypeModeConfigSzhtxxElectronicInvoice(id, loginSysUser);
	}


	public InvoiceTypeModeConfigSzhtxxElectronicInvoice findInvoiceTypeModeConfigSzhtxxElectronicInvoiceById(Long id) {

		return dubboInvoiceTypeModeConfigSzhtxxElectronicInvoiceService.findInvoiceTypeModeConfigSzhtxxElectronicInvoiceById(id);
	}


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

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


	public R<List<InvoiceTypeModeConfigSzhtxxElectronicInvoice>> pageQueryGenericParam(InvoiceTypeModeConfigSzhtxxElectronicInvoiceQueryCriteria queryCriteria) {

		return dubboInvoiceTypeModeConfigSzhtxxElectronicInvoiceService.pageQueryGenericParam(queryCriteria);
	}
}
