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

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.invoice.common.InvoiceTaxRate;
import cn.superdesk.uniorder.dto.param.invoice.common.InvoiceTaxRateParam;
import cn.superdesk.uniorder.dubbo.facade.invoice.common.DubboInvoiceTaxRateService;
import cn.superdesk.uniorder.service.invoice.common.InvoiceTaxRateService;
import cn.superdesk.uniorder.common.numerical.AnBeanUtils;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

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


/**
 * @Description:
 * @Author: linjinyu
 * @Email linjinyu@avic-s.com
 * @CreateDate: 2021-07-23 15:30:45
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021-07-23 15:30:45
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Service(version = "1.0.0", retries = -1, timeout = 10000)
public class DubboInvoiceTaxRateServiceImpl implements DubboInvoiceTaxRateService {

	@Autowired
	private InvoiceTaxRateService invoiceTaxRateService;


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

	@Override
	public void addObj(InvoiceTaxRateParam param) {

		InvoiceTaxRate invoiceTaxRate = AnBeanUtils.copy(param, InvoiceTaxRate.class);
		invoiceTaxRateService.addObj(invoiceTaxRate);

	}

	@Override
	public void updateObj(InvoiceTaxRateParam param) {

		InvoiceTaxRate invoiceTaxRate = AnBeanUtils.copy(param, InvoiceTaxRate.class);
		invoiceTaxRateService.updateObj(invoiceTaxRate);
	}

	@Override
	public void deleteObj(Long id) {
		invoiceTaxRateService.deleteObj(id);
	}

	@Override
	public InvoiceTaxRate findById(Long id) {
		return invoiceTaxRateService.findById(id);
	}

	@Override
	public PageInfo<InvoiceTaxRate> findByPaging(Map<String, Object> conditions, Integer pageNun, Integer pageSize) {
		return invoiceTaxRateService.findByPaging(conditions, pageNun, pageSize);
	}

	@Override
	public List<InvoiceTaxRate> findAll(Map<String, Object> queryMap) {

		return invoiceTaxRateService.findAll(queryMap);
	}

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


	@Override
	public void addInvoiceTaxRate(InvoiceTaxRateParam param) {

		InvoiceTaxRate invoiceTaxRate = AnBeanUtils.copy(param, InvoiceTaxRate.class);
		invoiceTaxRateService.addInvoiceTaxRate(invoiceTaxRate);
	}

	@Override
	public void updateInvoiceTaxRate(InvoiceTaxRateParam param) {

		InvoiceTaxRate invoiceTaxRate = AnBeanUtils.copy(param, InvoiceTaxRate.class);
		invoiceTaxRateService.updateInvoiceTaxRate(invoiceTaxRate);
	}

	@Override
	public void deleteInvoiceTaxRate(Long id) {
		invoiceTaxRateService.deleteInvoiceTaxRate(id);
	}

	@Override
	public InvoiceTaxRate findInvoiceTaxRateById(Long id) {
		return invoiceTaxRateService.findInvoiceTaxRateById(id);
	}

	@Override
	public R<List<InvoiceTaxRate>> pageQuery(Map<String, Object> conditions, int pageNun, int pageSize) {
		return invoiceTaxRateService.pageQuery(conditions, pageNun, pageSize);

	}
}
