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

import cn.superdesk.uniorder.common.rest.response.R;
import cn.superdesk.uniorder.dao.entity.marketing.UnifiedStatisticsVirt;
import cn.superdesk.uniorder.dao.entity.marketing.department.UnifiedAreaCity;
import cn.superdesk.uniorder.dao.entity.sys.SysConfig;
import cn.superdesk.uniorder.dto.vo.unified.*;
import cn.superdesk.uniorder.dubbo.facade.marketing.DubboUnifiedStatisticsVirtCommonService;
import com.alibaba.dubbo.config.annotation.Reference;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @Description: TODO  这个前人写下来的东西还要细细看一下到底是个什么东西,什么逻辑
 * @Author: linjinyu
 * @CreateDate: 2021/9/6 下午2:26
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/9/6 下午2:26
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Slf4j
@Component
public class UnifiedStatisticsVirtCommonDubboConsumerService {

	@Reference(version = "1.0.0", timeout = 30000, retries = -1)
	private DubboUnifiedStatisticsVirtCommonService dubboUnifiedStatisticsVirtCommonService;


	/****************************************** 统计 start ******************************************/


	public void updateStatisticsVirt(UnifiedStatisticsVirt update) {
		dubboUnifiedStatisticsVirtCommonService.updateStatisticsVirt(update);
	}

	public void insertStatisticsVirt(UnifiedStatisticsVirt add) {
		dubboUnifiedStatisticsVirtCommonService.insertStatisticsVirt(add);
	}



	public List<UnifiedStatisticsVirt> queryVirtRefundOrderStatistical(Map<String, Object> queryMap) {
		return dubboUnifiedStatisticsVirtCommonService.getVirtOrderReturnStatistical(queryMap);
	}

	/****************************************** 统计   end ******************************************/

	public List<UnifiedStatisticsVirt> findAll(Map<String, Object> params) {

		return dubboUnifiedStatisticsVirtCommonService.findAll(params);
	}

	public List<UnifiedStatisticsVirtVo> findAllVo(Map<String, Object> params) {

		return dubboUnifiedStatisticsVirtCommonService.findAllVo(params);
	}

	public UnifiedOrderLastMonth getLastMonth() {

		return dubboUnifiedStatisticsVirtCommonService.getlastmonth();
	}


	/****************************************** amount start ******************************************/

	public BigDecimal getReturnAmount(Map<String, Object> params) {

		return dubboUnifiedStatisticsVirtCommonService.getReturnAmount(params);
	}

	public BigDecimal getundzamount(Map<String, Object> params) {

		return dubboUnifiedStatisticsVirtCommonService.getundzamount(params);
	}

	public BigDecimal getuninvamount(Map<String, Object> params) {

		return dubboUnifiedStatisticsVirtCommonService.getuninvamount(params);
	}

	public BigDecimal getunpaymoney(Map<String, Object> params) {

		return dubboUnifiedStatisticsVirtCommonService.getunpaymoney(params);
	}

	/****************************************** amount   end ******************************************/


	public List<WarningOrderAmountVo> getWarningOrderAmount(Map<String, Object> queryMap) {

		return dubboUnifiedStatisticsVirtCommonService.getWarningOrderAmount(queryMap);
	}

	public BigDecimal getOrderRefundAmountByAreaItem(Map<String, Object> queryTJ) {

		return dubboUnifiedStatisticsVirtCommonService.getreturnAmountByAreaItem(queryTJ);
	}

	public BigDecimal getOrderAmountByAreaItem(Map<String, Object> queryTJ) {
		return dubboUnifiedStatisticsVirtCommonService.getOrderAmountByAreaItem(queryTJ);
	}

	public BigDecimal getOrderCostAmount(Map<String, Object> costQuery) {
		return dubboUnifiedStatisticsVirtCommonService.getOrderCostAmount(costQuery);
	}

	public R<List<UnifiedCustomerTJ>> getDataByPage(String token, Map<String, Object> params, int pageNum, int pageSize) {
		return dubboUnifiedStatisticsVirtCommonService.getDataByPage(params, pageNum, pageSize);
	}

	public List<UnifiedCustomerTJ> getStatisticsVirtData(String token, Map<String, Object> params) {
		return dubboUnifiedStatisticsVirtCommonService.getStatisticsVirtData(params);
	}

	public UnifiedStatisticsVirtSum getStatisticsSum(Map<String, Object> query) {
		return dubboUnifiedStatisticsVirtCommonService.getStatisticsSum(query);
	}

	/****************************************** config start ******************************************/
	public SysConfig getConfigData(String code) {
		return dubboUnifiedStatisticsVirtCommonService.getConfigData(code);
	}

	public void updateConfig(SysConfig config) {
		dubboUnifiedStatisticsVirtCommonService.updateConfig(config);
	}

	/****************************************** config start ******************************************/

	public List<UnifiedAreaCity> findAllAreaCity() {
		return dubboUnifiedStatisticsVirtCommonService.findAllAreaCity();
	}

	public void updateAreaCity(UnifiedAreaCity item) {
		dubboUnifiedStatisticsVirtCommonService.updateAreaCity(item);
	}


}
