package cn.superdesk.uniorder.dubbo.consumer.order.base;

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.base.UnifiedOrderCredit;
import cn.superdesk.uniorder.dto.dubbo.base.UnifiedOrderCreditParam;
import cn.superdesk.uniorder.dubbo.facade.order.base.DubboUnifiedOrderCreditService;
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-09-23 15:16:04
 * @UpdateUser: linjinyu
 * @UpdateDate: 2020-09-23 15:16:04
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Slf4j
@Component
public class UnifiedOrderCreditDubboConsumerService {

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


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

	public void addObj(UnifiedOrderCreditParam param) {

		dubboUnifiedOrderCreditService.addObj(param);

	}

	public void updateObj(UnifiedOrderCreditParam param) {

		dubboUnifiedOrderCreditService.updateObj(param);
	}

	public void deleteObj(Long id) {

		dubboUnifiedOrderCreditService.deleteObj(id);
	}

	public UnifiedOrderCredit findById(Long id) {

		return dubboUnifiedOrderCreditService.findById(id);
	}

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

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

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

		return dubboUnifiedOrderCreditService.findAll(queryMap);
	}

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


	public void addUnifiedOrderCredit(UnifiedOrderCreditParam param) {

		dubboUnifiedOrderCreditService.addUnifiedOrderCredit(param);
	}


	public void updateUnifiedOrderCredit(UnifiedOrderCreditParam param) {

		dubboUnifiedOrderCreditService.updateUnifiedOrderCredit(param);
	}


	public void deleteUnifiedOrderCredit(Long id) {
		dubboUnifiedOrderCreditService.deleteUnifiedOrderCredit(id);
	}


	public UnifiedOrderCredit findUnifiedOrderCreditById(Long id) {

		return dubboUnifiedOrderCreditService.findUnifiedOrderCreditById(id);
	}


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

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

	public Map<String, Integer> checkStatement(Map<String, Object> conditions) {
		return dubboUnifiedOrderCreditService.checkStatement(conditions);
	}


	/****************************************** 补丁程序 start ******************************************/

	public String checkAndFixAccountingStateCustomer(/*积分批次号*/String batchs) {
		return dubboUnifiedOrderCreditService.checkAndFixAccountingStateCustomer(batchs);
	}

	/****************************************** 补丁程序   end ******************************************/

	/****************************************** 工具类方法 start ******************************************/

	public List<String> queryOrderSnsBySelectCreditIds(List<Long> selectCreditIds) {
		return dubboUnifiedOrderCreditService.queryOrderSnsBySelectCreditIds(selectCreditIds);
	}

	/****************************************** 工具类方法   end ******************************************/

}
