package cn.superdesk.uniorder.dubbo.provider.organisation;

import cn.superdesk.uniorder.common.numerical.AnBeanUtils;
import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.organisation.SysSupplierExtInvoice;
import cn.superdesk.uniorder.dto.param.organisation.SysSupplierExtInvoiceParam;
import cn.superdesk.uniorder.dto.param.organisation.SysSupplierExtInvoiceQueryCriteria;
import cn.superdesk.uniorder.dubbo.facade.organisation.DubboSysSupplierExtInvoiceService;
import cn.superdesk.uniorder.service.organisation.SysSupplierExtInvoiceService;
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-11-29 16:34:49
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021-11-29 16:34:49
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Service(version = "1.0.0", retries = -1, timeout = 10000)
public class DubboSysSupplierExtInvoiceServiceImpl implements DubboSysSupplierExtInvoiceService {

	@Autowired
	private SysSupplierExtInvoiceService sysSupplierExtInvoiceService;


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

	@Override
	public void addObj(SysSupplierExtInvoiceParam param) {

		SysSupplierExtInvoice sysSupplierExtInvoice = AnBeanUtils.copy(param, SysSupplierExtInvoice.class);
		sysSupplierExtInvoiceService.insertSelective(sysSupplierExtInvoice);

	}

	@Override
	public void updateObj(SysSupplierExtInvoiceParam param) {

		SysSupplierExtInvoice sysSupplierExtInvoice = AnBeanUtils.copy(param, SysSupplierExtInvoice.class);
		sysSupplierExtInvoiceService.updateByPrimaryKeySelective(sysSupplierExtInvoice);
	}

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

	@Override
	public SysSupplierExtInvoice findById(Long id) {
		return sysSupplierExtInvoiceService.findById(id);
	}

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

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

		return sysSupplierExtInvoiceService.findAll(queryMap);
	}

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


	@Override
	public void addSysSupplierExtInvoice(SysSupplierExtInvoiceParam param) {

		SysSupplierExtInvoice sysSupplierExtInvoice = AnBeanUtils.copy(param, SysSupplierExtInvoice.class);
		sysSupplierExtInvoiceService.addSysSupplierExtInvoice(sysSupplierExtInvoice);
	}

	@Override
	public void updateSysSupplierExtInvoice(SysSupplierExtInvoiceParam param) {

		SysSupplierExtInvoice sysSupplierExtInvoice = AnBeanUtils.copy(param, SysSupplierExtInvoice.class);
		sysSupplierExtInvoiceService.updateSysSupplierExtInvoice(sysSupplierExtInvoice);
	}

	public void updateSysSupplierExtInvoiceSetDefault(SysSupplierExtInvoice entity) {
		sysSupplierExtInvoiceService.updateSysSupplierExtInvoiceSetDefault(entity);
	}

	@Override
	public void deleteSysSupplierExtInvoice(Long id) {
		sysSupplierExtInvoiceService.deleteSysSupplierExtInvoice(id);
	}

	@Override
	public SysSupplierExtInvoice findSysSupplierExtInvoiceById(Long id) {
		return sysSupplierExtInvoiceService.findSysSupplierExtInvoiceById(id);
	}

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

	@Override
	public R<List<SysSupplierExtInvoice>> pageQueryGenericParam(SysSupplierExtInvoiceQueryCriteria criteria) {
		return sysSupplierExtInvoiceService.pageQueryGenericParam(criteria);
	}
}
