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.InvoiceBankInfo;
import cn.superdesk.uniorder.dto.param.invoice.common.InvoiceBankInfoParam;
import cn.superdesk.uniorder.dto.param.invoice.common.InvoiceBankInfoQueryCriteria;
import cn.superdesk.uniorder.dubbo.facade.invoice.common.DubboInvoiceBankInfoService;
import cn.superdesk.uniorder.service.invoice.common.InvoiceBankInfoService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

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

@Service(version = "1.0.0", retries = -1, timeout = 10000)
public class DubboInvoiceBankInfoServiceImpl implements DubboInvoiceBankInfoService {

	@Autowired
	private InvoiceBankInfoService invoiceBankInfoService;

	@Override
	public int addInvoiceBankInfo(InvoiceBankInfo entity, LoginSysUser loginSysUser) {
		return invoiceBankInfoService.addInvoiceBankInfo(entity, loginSysUser);
	}

	@Override
	public int updateInvoiceBankInfo(InvoiceBankInfo entity, LoginSysUser loginSysUser) {
		return invoiceBankInfoService.updateInvoiceBankInfo(entity, loginSysUser);
	}

	@Override
	public int opPhysicsDelete(Long id, LoginSysUser loginSysUser) {
		return invoiceBankInfoService.opPhysicsDelete(id, loginSysUser);
	}

	@Override
	public int opLogicalDelete(Long id, LoginSysUser loginSysUser) {
		return invoiceBankInfoService.opLogicalDelete(id, loginSysUser);
	}

	@Override
	public int setDefault(Long id, LoginSysUser loginSysUser) {
		return invoiceBankInfoService.setDefault(id, loginSysUser);
	}

	@Override
	public int setNormal(Long id, LoginSysUser loginSysUser) {
		return invoiceBankInfoService.setNormal(id, loginSysUser);
	}

	public R<List<InvoiceBankInfo>> pageQuery(Map<String, Object> conditions, int pageNun, int pageSize) {
		return invoiceBankInfoService.pageQuery(conditions, pageNun, pageSize);
	}

	@Override
	public List<InvoiceBankInfo> query(InvoiceBankInfoQueryCriteria queryCriteria, LoginSysUser loginSysUser) {
		return invoiceBankInfoService.query(queryCriteria, loginSysUser);
	}

	public R<List<InvoiceBankInfoParam>> pageQuery(InvoiceBankInfoQueryCriteria queryCriteria, LoginSysUser loginSysUser) {
		return invoiceBankInfoService.pageQuery(queryCriteria, loginSysUser);
	}

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

	@Override
	public void cacheInit() {

		invoiceBankInfoService.cacheInit();
	}

	@Override
	public void cacheRefresh() {
		invoiceBankInfoService.cacheRefresh();
	}

	@Override
	public void cacheRemove() {
		invoiceBankInfoService.cacheRemove();
	}

	@Override
	public String cacheGet(String hashTable, String keyField) {
		return invoiceBankInfoService.cacheGet(hashTable, keyField);
	}
}
