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

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.common.security.dto.LoginSysUser;
import cn.superdesk.uniorder.dao.entity.invoice.common.InvoiceType;
import cn.superdesk.uniorder.dto.param.invoice.common.InvoiceTypeCacheCriteria;
import cn.superdesk.uniorder.dto.param.invoice.common.InvoiceTypeOpCriteria;
import cn.superdesk.uniorder.dto.param.invoice.common.InvoiceTypeParam;
import cn.superdesk.uniorder.dto.param.invoice.common.InvoiceTypeQueryCriteria;
import cn.superdesk.uniorder.dto.vo.invoice.common.InvoiceTypeOpInvoiceSettingLoadingVo;
import cn.superdesk.uniorder.dto.vo.invoice.common.InvoiceTypePageQueryVo;
import cn.superdesk.uniorder.dto.vo.invoice.common.InvoiceTypeSelectVo;
import cn.superdesk.uniorder.dubbo.facade.invoice.common.DubboInvoiceTypeService;
import cn.superdesk.uniorder.service.invoice.common.InvoiceTypeService;
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 DubboInvoiceTypeServiceImpl implements DubboInvoiceTypeService {

	@Autowired
	private InvoiceTypeService invoiceTypeService;


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

	@Override
	public void addObj(InvoiceTypeParam param) {

		InvoiceType invoiceType = AnBeanUtils.copy(param, InvoiceType.class);
		invoiceTypeService.insertSelective(invoiceType);

	}

	@Override
	public void updateObj(InvoiceTypeParam param) {

		InvoiceType invoiceType = AnBeanUtils.copy(param, InvoiceType.class);
		invoiceTypeService.updateByPrimaryKeySelective(invoiceType);
	}

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

	@Override
	public InvoiceType findById(Long id) {
		return invoiceTypeService.findById(id);
	}

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

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

		return invoiceTypeService.findAll(queryMap);
	}

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


	@Override
	public void addInvoiceType(InvoiceTypeParam param) {

		InvoiceType invoiceType = AnBeanUtils.copy(param, InvoiceType.class);
		invoiceTypeService.addInvoiceType(invoiceType);
	}

	@Override
	public void updateInvoiceType(InvoiceTypeParam param) {

		InvoiceType invoiceType = AnBeanUtils.copy(param, InvoiceType.class);
		invoiceTypeService.updateInvoiceType(invoiceType);
	}

	@Override
	public void deleteInvoiceType(Long id) {
		invoiceTypeService.deleteInvoiceType(id);
	}

	@Override
	public InvoiceType findInvoiceTypeById(Long id) {
		return invoiceTypeService.findInvoiceTypeById(id);
	}

	@Override
	public R<List<InvoiceType>> pageQuery(InvoiceTypeQueryCriteria queryCriteria, LoginSysUser loginSysUser) {
		return invoiceTypeService.pageQuery(queryCriteria, loginSysUser);
	}

	public R<List<InvoiceTypePageQueryVo>> pageQuerySugarUp(InvoiceTypeQueryCriteria queryCriteria, LoginSysUser loginSysUser) {
		return invoiceTypeService.pageQuerySugarUp(queryCriteria, loginSysUser);
	}

	public List<InvoiceTypeSelectVo> selectQuery(InvoiceTypeQueryCriteria queryCriteria, LoginSysUser loginSysUser) {
		return invoiceTypeService.selectQuery(queryCriteria, loginSysUser);
	}


	/****************************************** 操作部分 start ******************************************/


	@Override
	public int opSetDefault(InvoiceTypeOpCriteria opCriteria, LoginSysUser loginSysUser) {
		return invoiceTypeService.opSetDefault(opCriteria, loginSysUser);
	}

	@Override
	public int opSetNormal(InvoiceTypeOpCriteria opCriteria, LoginSysUser loginSysUser) {
		return invoiceTypeService.opSetNormal(opCriteria, loginSysUser);
	}

	@Override
	public int opSetEnable(InvoiceTypeOpCriteria opCriteria, LoginSysUser loginSysUser) {
		return invoiceTypeService.opSetEnable(opCriteria, loginSysUser);
	}

	@Override
	public int opSetDisable(InvoiceTypeOpCriteria opCriteria, LoginSysUser loginSysUser) {
		return invoiceTypeService.opSetDisable(opCriteria, loginSysUser);
	}


	/****************************************** 操作部分   end ******************************************/


	/****************************************** 操作类 进阶 模块X发票种类-开票方式 start ******************************************/

	@Override
	public int opInvoiceSettingSetDefault(InvoiceTypeOpCriteria opCriteria, LoginSysUser loginSysUser) {
		return invoiceTypeService.opInvoiceSettingSetDefault(opCriteria, loginSysUser);
	}

	@Override
	public int opInvoiceSettingSetNormal(InvoiceTypeOpCriteria opCriteria, LoginSysUser loginSysUser) {
		return invoiceTypeService.opInvoiceSettingSetNormal(opCriteria, loginSysUser);
	}

	@Override
	public int opInvoiceSettingSetEnable(InvoiceTypeOpCriteria opCriteria, LoginSysUser loginSysUser) {
		return invoiceTypeService.opInvoiceSettingSetEnable(opCriteria, loginSysUser);
	}

	@Override
	public int opInvoiceSettingSetDisable(InvoiceTypeOpCriteria opCriteria, LoginSysUser loginSysUser) {
		return invoiceTypeService.opInvoiceSettingSetDisable(opCriteria, loginSysUser);
	}

	@Override
	public InvoiceTypeOpInvoiceSettingLoadingVo opInvoiceSettingLoading(InvoiceTypeOpCriteria opCriteria, LoginSysUser loginSysUser) {
		return invoiceTypeService.opInvoiceSettingLoading(opCriteria, loginSysUser);
	}


	/****************************************** 操作类 进阶 模块X发票种类-开票方式   end ******************************************/


	/****************************************** 缓存 start ******************************************/

	@Override
	public void cacheInit(InvoiceTypeCacheCriteria criteria) {

		invoiceTypeService.cacheInit(criteria);
	}

	@Override
	public void cacheRefresh(InvoiceTypeCacheCriteria criteria) {
		invoiceTypeService.cacheRefresh(criteria);
	}

	@Override
	public void cacheRemove(InvoiceTypeCacheCriteria criteria) {
		invoiceTypeService.cacheRemove(criteria);
	}

	@Override
	public String cacheGet(InvoiceTypeCacheCriteria criteria) {
		return invoiceTypeService.cacheGet(criteria);
	}

	/****************************************** 缓存   end ******************************************/
}
