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.InvoiceTypeModeConfigOffLine;
import cn.superdesk.uniorder.dto.param.invoice.common.InvoiceTypeModeConfigOffLineParam;
import cn.superdesk.uniorder.dto.param.invoice.common.InvoiceTypeModeConfigOffLineQueryCriteria;
import cn.superdesk.uniorder.dubbo.facade.invoice.common.DubboInvoiceTypeModeConfigOffLineService;
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 InvoiceTypeModeConfigOffLineDubboConsumerService {

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


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

	public void addObj(InvoiceTypeModeConfigOffLineParam param) {

		dubboInvoiceTypeModeConfigOffLineService.addObj(param);

	}

	public void updateObj(InvoiceTypeModeConfigOffLineParam param) {

		dubboInvoiceTypeModeConfigOffLineService.updateObj(param);
	}

	public void deleteObj(Long id) {

		dubboInvoiceTypeModeConfigOffLineService.deleteObj(id);
	}

	public InvoiceTypeModeConfigOffLine findById(Long id) {

		return dubboInvoiceTypeModeConfigOffLineService.findById(id);
	}

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

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

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

		return dubboInvoiceTypeModeConfigOffLineService.findAll(queryMap);
	}

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


	public void addInvoiceTypeModeConfigOffLine(InvoiceTypeModeConfigOffLineParam param, String token) {

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);
		dubboInvoiceTypeModeConfigOffLineService.addInvoiceTypeModeConfigOffLine(param, loginSysUser);
	}


	public void updateInvoiceTypeModeConfigOffLine(InvoiceTypeModeConfigOffLineParam param, String token) {

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);
		dubboInvoiceTypeModeConfigOffLineService.updateInvoiceTypeModeConfigOffLine(param, loginSysUser);
	}


	public void deleteInvoiceTypeModeConfigOffLine(Long id, String token) {
		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);
		dubboInvoiceTypeModeConfigOffLineService.deleteInvoiceTypeModeConfigOffLine(id, loginSysUser);
	}


	public InvoiceTypeModeConfigOffLine findInvoiceTypeModeConfigOffLineById(Long id) {

		return dubboInvoiceTypeModeConfigOffLineService.findInvoiceTypeModeConfigOffLineById(id);
	}


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

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);
		return dubboInvoiceTypeModeConfigOffLineService.pageQuery(conditions, pageNun, pageSize);
	}


	public R<List<InvoiceTypeModeConfigOffLine>> pageQueryGenericParam(InvoiceTypeModeConfigOffLineQueryCriteria queryCriteria, String token) {
		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);
		return dubboInvoiceTypeModeConfigOffLineService.pageQueryGenericParam(queryCriteria);
	}
}
