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

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.organisation.SysEnterpriseExtAccounting;
import cn.superdesk.uniorder.dto.param.organisation.SysEnterpriseExtAccountingParam;
import cn.superdesk.uniorder.dubbo.facade.organisation.DubboSysEnterpriseExtAccountingService;
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: 2020-08-20 20:23:17
 * @UpdateUser: linjinyu
 * @UpdateDate: 2020-08-20 20:23:17
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Slf4j
@Component
public class SysEnterpriseExtAccountingDubboConsumerService {

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


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

	public void addObj(SysEnterpriseExtAccountingParam param) {

		dubboSysEnterpriseExtAccountingService.addObj(param);

	}

	public void updateObj(SysEnterpriseExtAccountingParam param) {

		dubboSysEnterpriseExtAccountingService.updateObj(param);
	}

	public void deleteObj(Long id) {

		dubboSysEnterpriseExtAccountingService.deleteObj(id);
	}

	public SysEnterpriseExtAccounting findById(Long id) {

		return dubboSysEnterpriseExtAccountingService.findById(id);
	}

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

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

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

		return dubboSysEnterpriseExtAccountingService.findAll(queryMap);
	}

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


	public void initSysEnterpriseExtAccounting(SysEnterpriseExtAccountingParam param) {

		dubboSysEnterpriseExtAccountingService.initSysEnterpriseExtAccounting(param);
	}

	public void addSysEnterpriseExtAccounting(SysEnterpriseExtAccountingParam param) {

		dubboSysEnterpriseExtAccountingService.addSysEnterpriseExtAccounting(param);
	}


	public void updateSysEnterpriseExtAccounting(SysEnterpriseExtAccountingParam param) {

		dubboSysEnterpriseExtAccountingService.updateSysEnterpriseExtAccounting(param);
	}

	public void saveOrUpdateSysEnterpriseExtAccounting(SysEnterpriseExtAccountingParam param, String token) {

		LoginSysUser loginSysUser = JwtUtil.getLoginSysUser(token);

		dubboSysEnterpriseExtAccountingService.saveOrUpdateSysEnterpriseExtAccounting(param, loginSysUser);
	}


	public void deleteSysEnterpriseExtAccounting(Long id) {
		dubboSysEnterpriseExtAccountingService.deleteSysEnterpriseExtAccounting(id);
	}


	public SysEnterpriseExtAccounting findSysEnterpriseExtAccountingById(Long id) {

		return dubboSysEnterpriseExtAccountingService.findSysEnterpriseExtAccountingById(id);
	}


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

		return dubboSysEnterpriseExtAccountingService.pageQuery(conditions, pageNun, pageSize);
	}
}
